diff --git a/.dockerignore b/.dockerignore
old mode 100755
new mode 100644
index 849d27a..ea51f67
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,4 +1,3 @@
 views/
 applications/
-containers/
-xos/tests/api/node_modules
\ No newline at end of file
+xos/tests/api/node_modules
diff --git a/.gitignore b/.gitignore
index 7813bf4..bf493e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,7 +4,12 @@
 profile
 *.moved-aside
 .idea
+setup/*
+setup/id_rsa/*
 xos/configurations/frontend/Dockerfile
+xos/configurations/mcord/admin-openrc.sh
+xos/configurations/setup/*
+xos/configurations/common/*
 xos/core/xoslib/karma-*
 xos/core/xoslib/docs
 xos/core/xoslib/coverage
@@ -16,4 +21,5 @@
 xos/core/static/*.css
 !xos/core/static/xos.css
 .DS_Store
-xos/configurations/setup
+xos/configurations/setup/
+migrations/
diff --git a/containers/synchronizer/Dockerfile b/containers/synchronizer/Dockerfile
index 011e8dd..c4bb737 100644
--- a/containers/synchronizer/Dockerfile
+++ b/containers/synchronizer/Dockerfile
@@ -45,4 +45,4 @@
 # Supervisor
 COPY conf/synchronizer.conf /etc/supervisor/conf.d/
 
-CMD update-ca-certificates && /usr/bin/supervisord -c /etc/supervisor/conf.d/synchronizer.conf
+CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/synchronizer.conf
diff --git a/containers/xos/Dockerfile b/containers/xos/Dockerfile
index afc7c9d..e631e23 100644
--- a/containers/xos/Dockerfile
+++ b/containers/xos/Dockerfile
@@ -74,6 +74,10 @@
 
 ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
 
+# Include certificates from Openstack
+ADD local_certs.crt /usr/local/share/ca-certificates/local_certs.crt
+RUN update-ca-certificates
+
 # Install XOS
 RUN git clone git://github.com/open-cloud/xos.git /tmp/xos && \
     mv /tmp/xos/xos /opt/ && \
@@ -93,4 +97,4 @@
 WORKDIR /opt/xos
 
 # Define default command.
-CMD update-ca-certificates && python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
+CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
diff --git a/containers/xos/Dockerfile.base b/containers/xos/Dockerfile.base
new file mode 100644
index 0000000..8443b6e
--- /dev/null
+++ b/containers/xos/Dockerfile.base
@@ -0,0 +1,141 @@
+# Dockerfile.base
+# This image isn't used, but installs the prereqs for the other XOS images
+
+FROM       ubuntu:14.04.3
+
+# XXX Workaround for docker bug:
+# https://github.com/docker/docker/issues/6345
+# Kernel 3.15 breaks docker, uss the line below as a workaround
+# until there is a fix
+RUN ln -s -f /bin/true /usr/bin/chfn
+# XXX End workaround
+
+# Install apt packages
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
+    curl \
+    gcc \
+    geoip-database \
+    git \
+    graphviz \
+    graphviz-dev \
+    libgeoip1 \
+    libxslt1-dev \
+    libxslt1.1 \
+    libyaml-dev \
+    m4 \
+    openssh-client \
+    pkg-config \
+    python-ceilometerclient \
+    python-crypto \
+    python-dev \
+    python-glanceclient \
+    python-httplib2 \
+    python-jinja2 \
+    python-keystoneclient \
+    python-neutronclient \
+    python-novaclient \
+    python-paramiko \
+    python-pip \
+    python-psycopg2 \
+    python-pycurl \
+    python-setuptools \
+    python-yaml \
+    rsync \
+    supervisor \
+    tar \
+    wget \
+ && rm -rf /var/lib/apt/lists/*
+
+# Install python pacakges with pip
+RUN pip install \
+    django==1.7 \
+    django-bitfield \
+    django-crispy-forms \
+    django-encrypted-fields \
+    django-extensions \
+    django-filter==0.11.0 \
+    django-geoposition \
+    django-ipware \
+    django_rest_swagger \
+    django-suit==0.3a1 \
+    django-timezones \
+    djangorestframework==3.3.3 \
+    dnslib \
+    jinja2 \
+    lxml \
+    markdown \
+    netaddr \
+    pyOpenSSL \
+    psycopg2 \
+    python-ceilometerclient \
+    python-dateutil \
+    python-keyczar \
+    python-logstash \
+    pygraphviz \
+    pytz \
+    pyyaml \
+    requests
+
+# Upgrade jinja2
+RUN pip install -U \
+    jinja2
+
+# Installs with Easy install (should be incorporated into pip?)
+RUN easy_install --upgrade httplib2
+
+RUN easy_install \
+    python_gflags \
+    google_api_python_client \
+    httplib2.ca_certs_locater
+
+# jQuery download w/checksum
+ENV JQUERY_VERSION jquery-1.9.1.min.js
+ENV JQUERY_DL_URL http://code.jquery.com/jquery-1.9.1.min.js
+ENV JQUERY_SHA256 c12f6098e641aaca96c60215800f18f5671039aecf812217fab3c0d152f6adb4
+
+RUN wget $JQUERY_DL_URL && \
+  echo "$JQUERY_SHA256  $JQUERY_VERSION" | sha256sum -c - && \
+  mv $JQUERY_VERSION /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
+
+# Install heat-translator for TOSCA support
+ENV HT_REPO_URL https://github.com/openstack/heat-translator.git
+ENV HT_REF a951b93c16e54046ed2d233d814860181c772e30
+
+RUN git clone $HT_REPO_URL /tmp/heat-translator && \
+    cd /tmp/heat-translator && \
+    git checkout $HT_REF && \
+    mkdir -p /opt/tosca && \
+    mv /tmp/heat-translator/translator /opt/tosca/translator && \
+    echo > /opt/tosca/translator/__init__.py && \
+    rm -rf /tmp/heat-translator
+
+# Install custom Ansible
+RUN \
+    git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible && \
+    git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras && \
+    git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras && \
+    git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core && \
+    git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core && \
+    # git clone uses cached copy, doesn't pick up latest
+    git -C /opt/ansible pull && \
+    git -C /opt/ansible/lib/ansible/modules/core pull && \
+    git -C /opt/ansible/v2/ansible/modules/core pull && \
+    mkdir -p /usr/local/share /bin /etc/ansible
+
+COPY ansible-hosts /etc/ansible/hosts
+
+# For Synchronizer
+ENV PHANTOMJS_DL_URL http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2
+ENV PHANTOMJS_SHA256 a7658f5f2d9464f86891afdb979eb60b754d5f404801db624368ac11e16724d4
+
+RUN curl -fLsS $PHANTOMJS_DL_URL -o phantomjs.tar.bz2 && \
+  echo "$PHANTOMJS_SHA256  phantomjs.tar.bz2" | sha256sum -c - && \
+  tar -C /usr/local/share -xjf phantomjs.tar.bz2 && \
+  ln -s /usr/local/share/phantomjs-* /usr/local/share/phantomjs && \
+  ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs && \
+  rm phantomjs.tar.bz2
+
+RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum && \
+    cd /tmp/fofum; python setup.py install && \
+    rm -rf /tmp/fofum
+
diff --git a/containers/xos/Dockerfile.devel b/containers/xos/Dockerfile.devel
index 5dc62a6..2b796e4 100644
--- a/containers/xos/Dockerfile.devel
+++ b/containers/xos/Dockerfile.devel
@@ -74,6 +74,10 @@
 
 ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
 
+# Include certificates from Openstack
+ADD containers/xos/local_certs.crt /usr/local/share/ca-certificates/local_certs.crt
+RUN update-ca-certificates
+
 # Install XOS
 ADD xos /opt/xos
 RUN chmod +x /opt/xos/tools/xos-manage
@@ -92,4 +96,4 @@
 WORKDIR /opt/xos
 
 # Define default command.
-CMD update-ca-certificates && python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
+CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
diff --git a/containers/xos/Dockerfile.templ b/containers/xos/Dockerfile.templ
index cfcf9ac..95592c6 100644
--- a/containers/xos/Dockerfile.templ
+++ b/containers/xos/Dockerfile.templ
@@ -68,6 +68,10 @@
 
 ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
 
+# Include certificates from Openstack
+ADD containers/xos/local_certs.crt /usr/local/share/ca-certificates/local_certs.crt
+RUN update-ca-certificates
+
 # Install XOS
 RUN git clone XOS_GIT_REPO -b XOS_GIT_BRANCH /tmp/xos && \
     mv /tmp/xos/xos /opt/ && \
@@ -86,4 +90,4 @@
 WORKDIR /root
 
 # Define default command.
-CMD update-ca-certificates && python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
+CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
diff --git a/containers/xos/ansible-hosts b/containers/xos/ansible-hosts
new file mode 100644
index 0000000..0dd74f1
--- /dev/null
+++ b/containers/xos/ansible-hosts
@@ -0,0 +1,2 @@
+[localhost]
+127.0.0.1
diff --git a/containers/xos/initdb b/containers/xos/initdb
index 1f5b770..b90a570 100755
--- a/containers/xos/initdb
+++ b/containers/xos/initdb
@@ -12,5 +12,5 @@
 # init db schema
 docker run -it --name=$CONTAINER_NAME $IMAGE_NAME /opt/xos/tools/xos-manage makemigrations
 # run overrides the CMD specifed in the Dockerfile, so we re-set the CMD in the final commit"
-docker commit --change="CMD update-ca-certificates && python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_NAME $IMAGE_NAME
+docker commit --change="CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_NAME $IMAGE_NAME
 docker rm $CONTAINER_NAME
diff --git a/containers/xos/local_certs.crt b/containers/xos/local_certs.crt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/containers/xos/local_certs.crt
diff --git a/views/ngXosLib/bower.json b/views/ngXosLib/bower.json
index 08a02e3..d2c7744 100644
--- a/views/ngXosLib/bower.json
+++ b/views/ngXosLib/bower.json
@@ -21,7 +21,8 @@
     "angular-animate": "1.4.7",
     "lodash": "~4.11.1",
     "angular-chart.js": "~0.10.2",
-    "d3": "~3.5.17"
+    "d3": "~3.5.17",
+    "angular-recursion": "~1.0.5"
   },
   "devDependencies": {
     "angular-mocks": "1.4.7",
diff --git a/views/ngXosLib/generator-xos/app/templates/bower.json b/views/ngXosLib/generator-xos/app/templates/bower.json
index 9dafc2b..0abca60 100644
--- a/views/ngXosLib/generator-xos/app/templates/bower.json
+++ b/views/ngXosLib/generator-xos/app/templates/bower.json
@@ -27,6 +27,7 @@
     "lodash": "~4.11.1",
     "bootstrap-css": "3.3.6",
     "angular-chart.js": "~0.10.2",
-    "d3": "~3.5.17"
+    "d3": "~3.5.17",
+    "angular-recursion": "~1.0.5"
   }
 }
diff --git a/views/ngXosLib/gulp/ngXosHelpers.js b/views/ngXosLib/gulp/ngXosHelpers.js
index f29a646..638e665 100644
--- a/views/ngXosLib/gulp/ngXosHelpers.js
+++ b/views/ngXosLib/gulp/ngXosHelpers.js
@@ -85,6 +85,7 @@
       module: {
         glob: [
           options.xosHelperSource + '*.js',
+          options.xosHelperSource + 'services/helpers/**/*.js',
           options.xosHelperSource + 'services/*.js',
           options.xosHelperSource + 'ui_components/**/*.js'
         ],
@@ -115,9 +116,7 @@
   gulp.task('docs', ['makeDocs', 'serveDocs'], function(){
     
     var files = [
-      options.xosHelperSource + '*.js',
-      options.xosHelperSource + 'services/*.js',
-      options.xosHelperSource + 'ui_components/**/*.js'
+      options.xosHelperSource + '**/*.js'
     ];
 
     gulp.watch(files, ['makeDocs']);
diff --git a/views/ngXosLib/gulpfile.js b/views/ngXosLib/gulpfile.js
index e514d7a..e030ad9 100644
--- a/views/ngXosLib/gulpfile.js
+++ b/views/ngXosLib/gulpfile.js
@@ -2,6 +2,7 @@
 
 var gulp = require('gulp');
 var wrench = require('wrench');
+var path = require('path');
 
 var options = {
   ngXosVendor: '../../xos/core/xoslib/static/js/vendor/', //save here the minfied vendor file, this is automatically loaded in the django page
@@ -11,9 +12,9 @@
   docs: './docs'
 };
 
-wrench.readdirSyncRecursive('./gulp')
+wrench.readdirSyncRecursive(path.join(__dirname, './gulp'))
 .map(function(file) {
-  require('./gulp/' + file)(options);
+  require(path.join(__dirname, './gulp/' + file))(options);
 });
 
 gulp.task('default', function () {
diff --git a/views/ngXosLib/xosHelpers/spec/notification.test.js b/views/ngXosLib/xosHelpers/spec/notification.test.js
new file mode 100644
index 0000000..cbc1e56
--- /dev/null
+++ b/views/ngXosLib/xosHelpers/spec/notification.test.js
@@ -0,0 +1,63 @@
+(function () {
+  'use strict';
+
+  describe('The xos.helper module', function(){
+    describe('The xosNotification service', () => {
+
+      let service, scope;
+
+      const options = {icon: 'icon', body: 'message'};
+
+      let notificationMock = {
+        requestPermission: () => {
+          return {
+            then: cb => cb('granted')
+          }
+        },
+        permission: 'granted'
+      }
+
+
+      // load the application module
+      beforeEach(module('xos.helpers', ($provide) => {
+        $provide.value('Notification', notificationMock);
+      }));
+
+      // inject the cartService
+      beforeEach(inject(function (_xosNotification_, $rootScope) {
+        // The injector unwraps the underscores (_) from around the parameter names when matching
+        service = _xosNotification_;
+        scope = $rootScope;
+        spyOn(service, 'sendNotification');
+        spyOn(service, 'checkPermission').and.callThrough();
+        spyOn(notificationMock, 'requestPermission').and.callThrough();
+      }));
+
+      it('should exist', () => {
+        expect(service).toBeDefined();
+      });
+
+      describe('when permission are granted', () => {
+        it('should send the notification', () => {
+          service.notify('Test', options);
+          expect(service.sendNotification).toHaveBeenCalledWith('Test', options);
+        });
+      });
+
+      describe('when permission are not granted', () => {
+        beforeEach(() => {
+          notificationMock.permission = false;
+        });
+
+        it('should request permission', () => {
+          service.notify('Test', options);
+          expect(service.checkPermission).toHaveBeenCalled();
+          scope.$apply(); // this resolve the promise
+          expect(service.sendNotification).toHaveBeenCalledWith('Test', options);
+        });
+      });
+
+    });
+  });
+
+})();
\ No newline at end of file
diff --git a/views/ngXosLib/xosHelpers/spec/services/helpers/form.helpers.test.js b/views/ngXosLib/xosHelpers/spec/services/helpers/form.helpers.test.js
new file mode 100644
index 0000000..f6bfbb2
--- /dev/null
+++ b/views/ngXosLib/xosHelpers/spec/services/helpers/form.helpers.test.js
@@ -0,0 +1,245 @@
+/**
+ * © OpenCORD
+ *
+ * Created by teone on 5/25/16.
+ */
+
+(function () {
+  'use strict';
+
+  describe('The xos.helper module', function(){
+
+    describe('The XosFormHelper service', () => {
+      let service;
+
+      let fields = [
+        'id',
+        'name',
+        'mail',
+        'active',
+        'created',
+        'custom'
+      ];
+
+      let modelField = {
+        id: {},
+        name: {},
+        mail: {},
+        active: {},
+        created: {},
+        custom: {}
+      };
+
+      let model = {
+        id: 1,
+        name: 'test',
+        mail: 'test@onlab.us',
+        active: true,
+        created: '2016-04-18T23:44:16.883181Z',
+        custom: 'MyCustomValue'
+      };
+
+      let customField = {
+        custom: {
+          label: 'Custom Label',
+          type: 'number',
+          validators: {},
+          hint: 'Test Hint'
+        }
+      };
+
+      let formObject = {
+        id: {
+          label: 'Id:',
+          type: 'number',
+          validators: {},
+          hint: ''
+        },
+        name: {
+          label: 'Name:',
+          type: 'text',
+          validators: {},
+          hint: ''
+        },
+        mail: {
+          label: 'Mail:',
+          type: 'email',
+          validators: {},
+          hint: ''
+        },
+        active: {
+          label: 'Active:',
+          type: 'boolean',
+          validators: {},
+          hint: ''
+        },
+        created: {
+          label: 'Created:',
+          type: 'date',
+          validators: {},
+          hint: ''
+        },
+        custom: {
+          label: 'Custom Label:',
+          type: 'number',
+          validators: {},
+          hint: 'Test Hint'
+        }
+      };
+
+      // load the application module
+      beforeEach(module('xos.helpers'));
+
+      // inject the cartService
+      beforeEach(inject(function (_XosFormHelpers_) {
+        // The injector unwraps the underscores (_) from around the parameter names when matching
+        service = _XosFormHelpers_;
+      }));
+
+      describe('the _isEmail method', () => {
+        it('should return true', () => {
+          expect(service._isEmail('test@onlab.us')).toEqual(true);
+        });
+        it('should return false', () => {
+          expect(service._isEmail('testonlab.us')).toEqual(false);
+          expect(service._isEmail('test@onlab')).toEqual(false);
+        });
+      });
+
+      describe('the _getFieldFormat method', () => {
+        it('should return text', () => {
+          expect(service._getFieldFormat('a random text')).toEqual('text');
+          expect(service._getFieldFormat(null)).toEqual('text');
+          expect(service._getFieldFormat('1')).toEqual('text');
+        });
+        it('should return mail', () => {
+          expect(service._getFieldFormat('test@onlab.us')).toEqual('email');
+        });
+        it('should return number', () => {
+          expect(service._getFieldFormat(1)).toEqual('number');
+        });
+        it('should return boolean', () => {
+          expect(service._getFieldFormat(false)).toEqual('boolean');
+          expect(service._getFieldFormat(true)).toEqual('boolean');
+        });
+
+        it('should return date', () => {
+          expect(service._getFieldFormat('2016-04-19T23:09:1092Z')).toEqual('text');
+          expect(service._getFieldFormat(new Date())).toEqual('date');
+          expect(service._getFieldFormat('2016-04-19T23:09:10.208092Z')).toEqual('date');
+        });
+
+        it('should return array', () => {
+          expect(service._getFieldFormat([])).toEqual('array');
+          expect(service._getFieldFormat(['a', 'b'])).toEqual('array');
+        });
+
+        it('should return object', () => {
+          expect(service._getFieldFormat({})).toEqual('object');
+          expect(service._getFieldFormat({foo: 'bar'})).toEqual('object');
+        });
+      });
+
+      describe('the parseModelField mehtod', () => {
+        it('should convert the fields array in an empty form object', () => {
+          expect(service.parseModelField(fields)).toEqual(modelField);
+        });
+
+        xit('should handle nested config', () => {
+          
+        });
+      });
+
+      describe('when modelField are provided', () => {
+        it('should combine modelField and customField in a form object', () => {
+          expect(service.buildFormStructure(modelField, customField, model)).toEqual(formObject);
+        });
+      });
+
+      describe('when model field is an empty array', () => {
+        let empty_modelField = {
+          // 5: {}
+        };
+        let empty_customFields = {
+          id: {
+            label: 'Id',
+            type: 'number'
+          },
+          name: {
+            label: 'Name',
+            type: 'text'
+          },
+          mail: {
+            label: 'Mail',
+            type: 'email'
+          },
+          active: {
+            label: 'Active',
+            type: 'boolean'
+          },
+          created: {
+            label: 'Created',
+            type: 'date'
+          },
+          custom: {
+            label: 'Custom Label',
+            type: 'number',
+            hint: 'Test Hint'
+          }
+        };
+
+        let empty_formObject = {
+          id: {
+            label: 'Id:',
+            type: 'number',
+            validators: {},
+            hint: ''
+          },
+          name: {
+            label: 'Name:',
+            type: 'text',
+            validators: {},
+            hint: ''
+          },
+          mail: {
+            label: 'Mail:',
+            type: 'email',
+            validators: {},
+            hint: ''
+          },
+          active: {
+            label: 'Active:',
+            type: 'boolean',
+            validators: {},
+            hint: ''
+          },
+          created: {
+            label: 'Created:',
+            type: 'date',
+            validators: {},
+            hint: ''
+          },
+          custom: {
+            label: 'Custom Label:',
+            type: 'number',
+            validators: {},
+            hint: 'Test Hint'
+          }
+        };
+
+        let empty_model = {5: 'Nan'}
+
+        it('should create a form object', () => {
+          let res = service.buildFormStructure(empty_modelField, empty_customFields, empty_model)
+          expect(res.id).toEqual(empty_formObject.id);
+          expect(res.name).toEqual(empty_formObject.name);
+          expect(res.mail).toEqual(empty_formObject.mail);
+          expect(res.active).toEqual(empty_formObject.active);
+          expect(res.created).toEqual(empty_formObject.created);
+          expect(res.custom).toEqual(empty_formObject.custom);
+          expect(res).toEqual(empty_formObject);
+        });
+      });
+    });
+  });
+})();
\ No newline at end of file
diff --git a/views/ngXosLib/xosHelpers/spec/ui/field.test.js b/views/ngXosLib/xosHelpers/spec/ui/field.test.js
new file mode 100644
index 0000000..f933a01
--- /dev/null
+++ b/views/ngXosLib/xosHelpers/spec/ui/field.test.js
@@ -0,0 +1,197 @@
+/**
+ * © OpenCORD
+ *
+ * Created by teone on 5/25/16.
+ */
+
+(function () {
+  'use strict';
+
+  let element, scope, isolatedScope, rootScope, compile;
+  const compileElement = (el) => {
+    element = el;
+
+    if(!scope){
+      scope = rootScope.$new();
+    }
+    if(!angular.isDefined(element)){
+      element = angular.element('<xos-field name="name" field="field" ng-model="ngModel"></xos-field>');
+    }
+    compile(element)(scope);
+    scope.$digest();
+    isolatedScope = element.isolateScope().vm;
+  }
+
+  describe('The xos.helper module', function(){
+
+    describe('The xosField component', () => {
+
+      beforeEach(module('xos.helpers'));
+
+      beforeEach(inject(function ($compile, $rootScope) {
+        compile = $compile;
+        rootScope = $rootScope;
+      }));
+
+      it('should throw an error if no name is passed', inject(($compile, $rootScope) => {
+        function errorFunctionWrapper(){
+          // setup the parent scope
+          scope = $rootScope.$new();
+          scope.field = {
+            label: 'Label',
+            type: 'number',
+            validators: {}
+          };
+          scope.ngModel = 1;
+          compileElement();
+        }
+        expect(errorFunctionWrapper).toThrow(new Error('[xosField] Please provide a field name'));
+      }));
+
+      it('should throw an error if no field definition is passed', inject(($compile, $rootScope) => {
+        function errorFunctionWrapper(){
+          // setup the parent scope
+          scope = $rootScope.$new();
+          scope.name = 'label';
+          scope.ngModel = 1;
+          compileElement();
+        }
+        expect(errorFunctionWrapper).toThrow(new Error('[xosField] Please provide a field definition'));
+      }));
+
+      it('should throw an error if no field model is passed', inject(($compile, $rootScope) => {
+        function errorFunctionWrapper(){
+          // setup the parent scope
+          scope = $rootScope.$new();
+          scope.name = 'label';
+          scope.field = {
+            label: 'Label',
+            type: 'number',
+            validators: {}
+          };
+          compileElement(angular.element('<xos-field name="name" field="field"></xos-field>'));
+        }
+        expect(errorFunctionWrapper).toThrow(new Error('[xosField] Please provide an ng-model'));
+      }));
+
+      describe('when a text input is passed', () => {
+        beforeEach(() => {
+          scope = rootScope.$new();
+          scope.name = 'label';
+          scope.field = {
+            label: 'Label',
+            type: 'text',
+            validators: {}
+          };
+          scope.ngModel = 'label';
+          compileElement();
+        });
+
+        it('should print a text field', () => {
+          expect($(element).find('[name="label"]')).toHaveAttr('type', 'text');
+        });
+      });
+
+      describe('when a number input is passed', () => {
+        beforeEach(() => {
+          scope = rootScope.$new();
+          scope.name = 'label';
+          scope.field = {
+            label: 'Label',
+            type: 'number',
+            validators: {}
+          };
+          scope.ngModel = 10;
+          compileElement();
+        });
+
+        it('should print a number field', () => {
+          expect($(element).find('[name="label"]')).toHaveAttr('type', 'number');
+        });
+      });
+
+      describe('when a boolean input is passed', () => {
+        beforeEach(() => {
+          scope = rootScope.$new();
+          scope.name = 'label';
+          scope.field = {
+            label: 'Label',
+            type: 'boolean',
+            validators: {}
+          };
+          scope.ngModel = true;
+          compileElement();
+        });
+
+        let setFalse, setTrue;
+
+        beforeEach(() => {
+          setFalse= $(element).find('.boolean-field > button:first-child');
+          setTrue = $(element).find('.boolean-field > button:last-child');
+        });
+
+        it('should print two buttons', () => {
+          expect($(element).find('.boolean-field > button').length).toEqual(2)
+        });
+
+        it('should change value to false', () => {
+          expect(isolatedScope.ngModel).toEqual(true);
+          setFalse.click()
+          expect(isolatedScope.ngModel).toEqual(false);
+        });
+
+        it('should change value to true', () => {
+          isolatedScope.ngModel = false;
+          scope.$apply();
+          expect(isolatedScope.ngModel).toEqual(false);
+          setTrue.click()
+          expect(isolatedScope.ngModel).toEqual(true);
+        });
+      });
+
+      describe('when an object input is passed', () => {
+        beforeEach(() => {
+          scope = rootScope.$new();
+          scope.name = 'label';
+          scope.field = {
+            label: 'Label',
+            type: 'object',
+            validators: {}
+          };
+          scope.ngModel = {
+            baz: true,
+            foo: 'bar',
+            foz: 1,
+          };
+          compileElement();
+        });
+
+        it('should print a panel to contain object property field', () => {
+          expect($(element).find('.panel.object-field')).toExist()
+        });
+
+        it('should print the right input type for each property', () => {
+          expect($(element).find('input').length).toBe(2);
+          expect($(element).find('.boolean-field > button').length).toEqual(2);
+        });
+
+        it('should format labels', () => {
+          expect($(element).find('input[name="foo"]').parent().find('label').text()).toBe('Foo:');
+        });
+
+        describe('and the model is empty', () => {
+          beforeEach(() => {
+            scope.ngModel = {
+            };
+            compileElement();
+          });
+
+          it('should not print the panel', () => {
+            // console.log($(element).find('.panel.object-field'));
+            expect($(element).find('.panel.object-field')).not.toExist()
+          });
+        });
+      });
+    });
+  });
+})();
\ No newline at end of file
diff --git a/views/ngXosLib/xosHelpers/spec/ui/form.test.js b/views/ngXosLib/xosHelpers/spec/ui/form.test.js
index 226a62a..cb9f9e8 100644
--- a/views/ngXosLib/xosHelpers/spec/ui/form.test.js
+++ b/views/ngXosLib/xosHelpers/spec/ui/form.test.js
@@ -7,232 +7,44 @@
 (function () {
   'use strict';
 
+  let element, scope, isolatedScope, rootScope, compile;
+
+  const compileElement = () => {
+
+    if(!scope){
+      scope = rootScope.$new();
+    }
+
+    element = angular.element(`<xos-form config="config" ng-model="model"></xos-form>`);
+    compile(element)(scope);
+    scope.$digest();
+    isolatedScope = element.isolateScope().vm;
+  }
+
   describe('The xos.helper module', function(){
 
-    describe('The XosFormHelper service', () => {
-      let service;
-
-      let fields = [
-        'id',
-        'name',
-        'mail',
-        'active',
-        'created',
-        'custom'
-      ];
-
-      let modelField = {
-        id: {},
-        name: {},
-        mail: {},
-        active: {},
-        created: {},
-        custom: {}
-      };
-
-      let model = {
-        id: 1,
-        name: 'test',
-        mail: 'test@onlab.us',
-        active: true,
-        created: '2016-04-18T23:44:16.883181Z',
-        custom: 'MyCustomValue'
-      };
-
-      let customField = {
-        custom: {
-          label: 'Custom Label',
-          type: 'number',
-          validators: {}
-        }
-      };
-
-      let formObject = {
-        id: {
-          label: 'Id:',
-          type: 'number',
-          validators: {}
-        },
-        name: {
-          label: 'Name:',
-          type: 'string',
-          validators: {}
-        },
-        mail: {
-          label: 'Mail:',
-          type: 'email',
-          validators: {}
-        },
-        active: {
-          label: 'Active:',
-          type: 'boolean',
-          validators: {}
-        },
-        created: {
-          label: 'Created:',
-          type: 'date',
-          validators: {}
-        },
-        custom: {
-          label: 'Custom Label:',
-          type: 'number',
-          validators: {}
-        }
-      };
-
-      // load the application module
-      beforeEach(module('xos.helpers'));
-
-      // inject the cartService
-      beforeEach(inject(function (_XosFormHelpers_) {
-        // The injector unwraps the underscores (_) from around the parameter names when matching
-        service = _XosFormHelpers_;
-      }));
-
-      describe('the _isEmail method', () => {
-        it('should return true', () => {
-          expect(service._isEmail('test@onlab.us')).toEqual(true);
-        });
-        it('should return false', () => {
-          expect(service._isEmail('testonlab.us')).toEqual(false);
-          expect(service._isEmail('test@onlab')).toEqual(false);
-        });
-      });
-
-      describe('the _getFieldFormat method', () => {
-        it('should return string', () => {
-          expect(service._getFieldFormat('string')).toEqual('string');
-          expect(service._getFieldFormat(null)).toEqual('string');
-        });
-        it('should return mail', () => {
-          expect(service._getFieldFormat('test@onlab.us')).toEqual('email');
-        });
-        it('should return number', () => {
-          expect(service._getFieldFormat(1)).toEqual('number');
-          // this is skipped because not realistic and js Date sucks
-          // expect(service._getFieldFormat('1')).toEqual('number');
-        });
-        it('should return boolean', () => {
-          expect(service._getFieldFormat(false)).toEqual('boolean');
-          expect(service._getFieldFormat(true)).toEqual('boolean');
-        });
-
-        it('should return date', () => {
-          expect(service._getFieldFormat('2016-04-19T23:09:1092Z')).toEqual('string');
-          expect(service._getFieldFormat(new Date())).toEqual('date');
-          expect(service._getFieldFormat('2016-04-19T23:09:10.208092Z')).toEqual('date');
-        });
-      });
-
-      it('should convert the fields array in an empty form object', () => {
-        expect(service.parseModelField(fields)).toEqual(modelField);
-      });
-
-      describe('when modelField are provided', () => {
-        it('should combine modelField and customField in a form object', () => {
-          expect(service.buildFormStructure(modelField, customField, model)).toEqual(formObject);
-        });
-      });
-
-      describe('when model field is an empty array', () => {
-        let empty_modelField = {
-          // 5: {}
-        };
-        let empty_customFields = {
-          id: {
-            label: 'Id',
-            type: 'number'
-          },
-          name: {
-            label: 'Name',
-            type: 'string'
-          },
-          mail: {
-            label: 'Mail',
-            type: 'email'
-          },
-          active: {
-            label: 'Active',
-            type: 'boolean'
-          },
-          created: {
-            label: 'Created',
-            type: 'date'
-          },
-          custom: {
-            label: 'Custom Label',
-            type: 'number'
-          }
-        };
-
-        let empty_formObject = {
-          id: {
-            label: 'Id:',
-            type: 'number',
-            validators: {}
-          },
-          name: {
-            label: 'Name:',
-            type: 'string',
-            validators: {}
-          },
-          mail: {
-            label: 'Mail:',
-            type: 'email',
-            validators: {}
-          },
-          active: {
-            label: 'Active:',
-            type: 'boolean',
-            validators: {}
-          },
-          created: {
-            label: 'Created:',
-            type: 'date',
-            validators: {}
-          },
-          custom: {
-            label: 'Custom Label:',
-            type: 'number',
-            validators: {}
-          }
-        };
-
-        let empty_model = {5: 'Nan'}
-
-        it('should create a form object', () => {
-          let res = service.buildFormStructure(empty_modelField, empty_customFields, empty_model)
-          expect(res.id).toEqual(empty_formObject.id);
-          expect(res.name).toEqual(empty_formObject.name);
-          expect(res.mail).toEqual(empty_formObject.mail);
-          expect(res.active).toEqual(empty_formObject.active);
-          expect(res.created).toEqual(empty_formObject.created);
-          expect(res.custom).toEqual(empty_formObject.custom);
-          expect(res).toEqual(empty_formObject);
-        });
-      });
-    });
-
     describe('The xos-form component', () => {
 
-      let element, scope, isolatedScope;
 
       beforeEach(module('xos.helpers'));
 
+      beforeEach(inject(($compile, $rootScope) => {
+        rootScope = $rootScope;
+        compile = $compile;
+      }));
+
       it('should throw an error if no config is specified', inject(($compile, $rootScope) => {
         function errorFunctionWrapper(){
-          $compile(angular.element('<xos-form></xos-form>'))($rootScope);
-          $rootScope.$digest();
+          compileElement();
         }
         expect(errorFunctionWrapper).toThrow(new Error('[xosForm] Please provide a configuration via the "config" attribute'));
       }));
 
       it('should throw an error if no actions is specified', inject(($compile, $rootScope) => {
         function errorFunctionWrapper(){
-          let scope = $rootScope.$new();
+          scope = $rootScope.$new();
           scope.config = 'green';
-          $compile(angular.element('<xos-form config="config"></xos-form>'))(scope);
-          $rootScope.$digest();
+          compileElement();
         }
         expect(errorFunctionWrapper).toThrow(new Error('[xosForm] Please provide an action list in the configuration'));
       }));
@@ -241,8 +53,7 @@
         
         let cb = jasmine.createSpy('callback');
 
-        beforeEach(inject(($compile, $rootScope) => {
-
+        beforeEach(inject(($rootScope) => {
 
           scope = $rootScope.$new();
 
@@ -274,17 +85,15 @@
             enabled: true,
             role: 'user', //select
             a_permissions: [
-
             ],
-            o_permissions: {
-
+            object_field: {
+              string: 'bar',
+              number: 1,
+              email: 'teo@onlab.us'
             }
           };
 
-          element = angular.element(`<xos-form config="config" ng-model="model"></xos-form>`);
-          $compile(element)(scope);
-          scope.$digest();
-          isolatedScope = element.isolateScope().vm;
+          compileElement();
         }));
 
         it('should add excluded properties to the list', () => {
@@ -292,11 +101,11 @@
           expect(isolatedScope.excludedField).toEqual(expected);
         });
 
-        it('should render 8 input field', () => {
+        it('should render 10 input field', () => {
           // boolean are in the form model, but are not input
           expect(Object.keys(isolatedScope.formField).length).toEqual(9);
           var field = element[0].getElementsByTagName('input');
-          expect(field.length).toEqual(8);
+          expect(field.length).toEqual(10);
         });
 
         it('should render 1 boolean field', () => {
@@ -336,7 +145,7 @@
             expect(isolatedScope.ngModel.enabled).toEqual(false);
           });
 
-          it('should change value to false', () => {
+          it('should change value to true', () => {
             isolatedScope.ngModel.enabled = false;
             scope.$apply();
             expect(isolatedScope.ngModel.enabled).toEqual(false);
@@ -397,6 +206,53 @@
             expect(isolatedScope.testForm.age.$error.min).toBeTruthy();
           });
         });
+
+        describe('when a deep model is passed', () => {
+
+          beforeEach(inject(($rootScope) => {
+
+            scope = $rootScope.$new();
+
+            scope.config = {
+              exclude: ['excludedField'],
+              formName: 'testForm',
+              actions: [
+                {
+                  label: 'Save',
+                  icon: 'ok', // refers to bootstraps glyphicon
+                  cb: cb,
+                  class: 'success'
+                }
+              ],
+              fields: {
+                object_field: {
+                  field_one: {
+                    label: 'Custom Label'
+                  }
+                }
+              }
+            };
+
+            scope.model = {
+              object_field: {
+                field_one: 'bar',
+                number: 1,
+                email: 'teo@onlab.us'
+              }
+            };
+
+            compileElement();
+          }));
+
+          it('should print nested field', () => {
+            expect($(element).find('input').length).toBe(3);
+          });
+
+          xit('should configure nested fields', () => {
+            let custom_label = $(element).find('input[name=field_one]').parent().find('label');
+            expect(custom_label.text()).toBe('Custom Label');
+          });
+        });
       });
     });
   });
diff --git a/views/ngXosLib/xosHelpers/spec/ui/table.test.js b/views/ngXosLib/xosHelpers/spec/ui/table.test.js
index f87eb96..e94eb36 100644
--- a/views/ngXosLib/xosHelpers/spec/ui/table.test.js
+++ b/views/ngXosLib/xosHelpers/spec/ui/table.test.js
@@ -153,7 +153,6 @@
 
               it('should render a dropdown for filtering', () => {
                 let td1 = $(element).find('table tbody tr td')[0];
-                console.log(td1);
                 expect(td1).toContainElement('select');
                 expect(td1).not.toContainElement('input');
               });
diff --git a/views/ngXosLib/xosHelpers/spec/ui/validation.test.js b/views/ngXosLib/xosHelpers/spec/ui/validation.test.js
index 782f03f..bb663fa 100644
--- a/views/ngXosLib/xosHelpers/spec/ui/validation.test.js
+++ b/views/ngXosLib/xosHelpers/spec/ui/validation.test.js
@@ -7,27 +7,46 @@
 (function () {
   'use strict';
 
+  let compile, element, scope, isolatedScope;
+
+  const compileElement = (el) => {
+    element = el;
+
+    if(!scope){
+      scope = rootScope.$new();
+    }
+    if(!angular.isDefined(element)){
+      element = angular.element('<xos-validation field="field" form="form"></xos-validation>');
+    }
+    compile(element)(scope);
+    scope.$digest();
+    isolatedScope = element.isolateScope().vm;
+  }
+
   describe('The xos.helper module', function(){
     describe('The xos-validation component', () => {
 
-      let element, scope, isolatedScope;
-
       beforeEach(module('xos.helpers'));
 
-      beforeEach(inject(($compile, $rootScope) => {
+      describe('when the form has no errors', () => {
+        beforeEach(inject(($compile, $rootScope) => {
+          compile = $compile;
+          scope = $rootScope.$new();
 
-        scope = $rootScope.$new();
+          scope.field = {
+            $error: {}
+          };
 
-        scope.errors = {};
+          scope.form = {
+            $submitted: true
+          }
 
-        element = angular.element(`<xos-validation errors="errors"></xos-validation>`);
-        $compile(element)(scope);
-        scope.$digest();
-        isolatedScope = element.isolateScope().vm;
-      }));
+          compileElement();
+        }));
 
-      it('should not show an alert', () => {
-        expect($(element).find('xos-alert > .alert')[0]).toHaveClass('ng-hide');
+        it('should not show an alert by default', () => {
+          expect($(element).find('xos-alert > .alert')[0]).toHaveClass('ng-hide');
+        });
       });
 
       let availableErrors = [
@@ -56,8 +75,8 @@
       // use a loop to generate similar test
       availableErrors.forEach((e, i) => {
         it(`should show an alert for ${e.type} errors`, () => {
-          scope.errors[e.type] = true;
-          scope.$digest();
+          scope.field.$error[e.type] = true;
+          compileElement();
           let alert = $(element).find('xos-alert > .alert')[i];
           expect(alert).not.toHaveClass('ng-hide');
           expect(alert).toHaveText(e.message);
diff --git a/views/ngXosLib/xosHelpers/src/services/helpers/ui/form.helpers.js b/views/ngXosLib/xosHelpers/src/services/helpers/ui/form.helpers.js
new file mode 100644
index 0000000..04a383a
--- /dev/null
+++ b/views/ngXosLib/xosHelpers/src/services/helpers/ui/form.helpers.js
@@ -0,0 +1,147 @@
+(function () {
+  
+  angular.module('xos.uiComponents')
+
+  /**
+  * @ngdoc service
+  * @name xos.uiComponents.XosFormHelpers
+  * @requires xos.uiComponents.LabelFormatter
+  * @requires xos.helpers._
+  **/
+
+  .service('XosFormHelpers', function(_, LabelFormatter){
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.XosFormHelpers#_isEmail
+    * @methodOf xos.uiComponents.XosFormHelpers
+    * @description
+    * Return true if the string is an email address
+    * @param {string} text The string to be evaluated
+    * @returns {boolean} If the string match an email format
+    **/
+
+
+    this._isEmail = (text) => {
+      var re = /(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
+      return re.test(text);
+    };
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.XosFormHelpers#_getFieldFormat
+    * @methodOf xos.uiComponents.XosFormHelpers
+    * @description
+    * Return the type of the input
+    * @param {mixed} value The data to be evaluated
+    * @returns {string} The type of the input
+    **/
+
+    this._getFieldFormat = (value) => {
+
+      if(angular.isArray(value)){
+        return 'array';
+      }
+
+      // check if is date
+      if (_.isDate(value) || (!Number.isNaN(Date.parse(value)) && new Date(value).getTime() > 631180800000)){
+        return 'date';
+      }
+
+      // check if is boolean
+      // isNaN(false) = false, false is a number (0), true is a number (1)
+      if(typeof value  === 'boolean'){
+        return 'boolean';
+      }
+
+      // check if a string is an email
+      if(this._isEmail(value)){
+        return 'email';
+      }
+
+      // if null return string
+      if(typeof value === 'string' || value === null){
+        return 'text';
+      }
+
+      return typeof value;
+    };
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.XosFormHelpers#buildFormStructure
+    * @methodOf xos.uiComponents.XosFormHelpers
+    * @description
+    * Return the type of the input
+    * @param {object} modelField An object containing one property for each field of the model
+    * @param {object} customField An object containing one property for each field custom field
+    * @param {object} model The actual model on wich build the form structure (it is used to determine the type of the input)
+    * @returns {object} An object describing the form structure in the form of:
+    * ```
+    * {
+    *   'field-name': {
+    *     label: 'Label',
+    *     type: 'number', //typeof field
+    *     validators: {}, // see xosForm for more details
+    *     hint: 'A Custom hint for the field'
+    *   }
+    * }
+    * ```
+    **/
+
+    this.buildFormStructure = (modelField, customField, model) => {
+
+      modelField = Object.keys(modelField).length > 0 ? modelField : customField; //if no model field are provided, check custom
+      customField = customField || {};
+
+      return _.reduce(Object.keys(modelField), (form, f) => {
+
+        form[f] = {
+          label: (customField[f] && customField[f].label) ? `${customField[f].label}:` : LabelFormatter.format(f),
+          type: (customField[f] && customField[f].type) ? customField[f].type : this._getFieldFormat(model[f]),
+          validators: (customField[f] && customField[f].validators) ? customField[f].validators : {},
+          hint: (customField[f] && customField[f].hint)? customField[f].hint : ''
+        };
+
+        if(form[f].type === 'date'){
+          model[f] = new Date(model[f]);
+        }
+
+        if(form[f].type === 'number'){
+          model[f] = parseInt(model[f], 10);
+        }
+
+        return form;
+      }, {});
+    };
+
+    /**
+    * @ngdoc method
+    * @name xos.uiComponents.XosFormHelpers#parseModelField
+    * @methodOf xos.uiComponents.XosFormHelpers
+    * @description
+    * Helpers for buildFormStructure, convert a list of model properties in an object used to build the form structure, eg:
+    * ```
+    * // input:
+    * ['id', 'name'm 'mail']
+    *
+    * // output
+    * {
+    *   id: {},
+    *   name: {},
+    *   mail: {}
+    * }
+    * ```
+    * @param {array} fields An array of fields representing the model properties
+    * @returns {object} An object containing one property for each field of the model
+    **/
+
+    this.parseModelField = (fields) => {
+      return _.reduce(fields, (form, f) => {
+        form[f] = {};
+        return form;
+      }, {});
+    }
+
+  });
+})();
\ No newline at end of file
diff --git a/views/ngXosLib/xosHelpers/src/services/label_formatter.service.js b/views/ngXosLib/xosHelpers/src/services/helpers/ui/label_formatter.service.js
similarity index 95%
rename from views/ngXosLib/xosHelpers/src/services/label_formatter.service.js
rename to views/ngXosLib/xosHelpers/src/services/helpers/ui/label_formatter.service.js
index 3b63ecd..bb1d279 100644
--- a/views/ngXosLib/xosHelpers/src/services/label_formatter.service.js
+++ b/views/ngXosLib/xosHelpers/src/services/helpers/ui/label_formatter.service.js
@@ -3,7 +3,7 @@
 
   /**
   * @ngdoc service
-  * @name xos.helpers.LabelFormatter
+  * @name xos.uiComponents.LabelFormatter
   * @description This factory define a set of helper function to format label started from an object property
   **/
 
diff --git a/views/ngXosLib/xosHelpers/src/services/notification.service.js b/views/ngXosLib/xosHelpers/src/services/notification.service.js
new file mode 100644
index 0000000..e190451
--- /dev/null
+++ b/views/ngXosLib/xosHelpers/src/services/notification.service.js
@@ -0,0 +1,61 @@
+(function() {
+  'use strict';
+
+  angular
+  .module('xos.helpers')
+  .factory('Notification', function(){
+    return window.Notification;
+  })
+  /**
+  * @ngdoc service
+  * @name xos.helpers.xosNotification
+  * @description This factory define a set of helper function to trigger desktop notification
+  **/
+  .service('xosNotification', function($q, $log, Notification) {
+
+    this.checkPermission = () => {
+      const deferred = $q.defer();
+      Notification.requestPermission()
+      .then(permission => {
+        if (permission === 'granted') {
+          deferred.resolve(permission);
+        }
+        else {
+          deferred.reject(permission);
+        }
+      });
+      return deferred.promise;
+    };
+
+    this.sendNotification = (title, options) => {
+      const notification = new Notification(title, options);
+      notification.onerror = function(err){
+        $log.error(err);
+      };
+    };
+
+    /**
+    * @ngdoc method
+    * @name xos.helpers.xosNotification#notify
+    * @methodOf xos.helpers.xosNotification
+    * @description
+    * This method will check for user permission and if granted will send a browser notification.
+    * @param {string} title The notification title
+    * @param {object} options The notification options: `{icon: 'url', body: 'Notification body'}`
+    **/
+
+    this.notify = (title, options) => {
+      if (!('Notification' in window)) {
+        $log.info('This browser does not support desktop notification');
+      }
+      else if (Notification.permission !== 'granted') {
+        this.checkPermission()
+        .then(() => this.sendNotification(title, options));
+      }
+      else if (Notification.permission === 'granted') {
+        this.sendNotification(title, options);
+      }
+    }
+
+  })
+})();
diff --git a/views/ngXosLib/xosHelpers/src/services/rest/Slices_plus.js b/views/ngXosLib/xosHelpers/src/services/rest/Slices_plus.js
index e744caa..8213b11 100644
--- a/views/ngXosLib/xosHelpers/src/services/rest/Slices_plus.js
+++ b/views/ngXosLib/xosHelpers/src/services/rest/Slices_plus.js
@@ -22,5 +22,19 @@
 
       return {$promise: deferred.promise};
     }
+
+    this.get = (id, params) => {
+      let deferred = $q.defer();
+
+      $http.get(`/api/utility/slicesplus/${id}`, {params: params})
+      .then(res => {
+        deferred.resolve(res.data);
+      })
+      .catch(res => {
+        deferred.reject(res.data);
+      });
+      return {$promise: deferred.promise};
+      
+    }
   })
 })();
diff --git a/views/ngXosLib/xosHelpers/src/styles/main.scss b/views/ngXosLib/xosHelpers/src/styles/main.scss
index 43c54f6..cc02e6f 100644
--- a/views/ngXosLib/xosHelpers/src/styles/main.scss
+++ b/views/ngXosLib/xosHelpers/src/styles/main.scss
@@ -4,6 +4,7 @@
 @import '../ui_components/dumbComponents/table/table.scss';
 @import '../ui_components/dumbComponents/alert/alert.scss';
 @import '../ui_components/dumbComponents/validation/validation.scss';
+@import '../ui_components/dumbComponents/field/field.scss';
 
 @import '../ui_components/smartComponents/smartTable/smartTable.scss';
 
diff --git a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/field/field.component.js b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/field/field.component.js
new file mode 100644
index 0000000..20b7707
--- /dev/null
+++ b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/field/field.component.js
@@ -0,0 +1,197 @@
+/**
+ * © OpenCORD
+ *
+ * Visit http://guide.xosproject.org/devguide/addview/ for more information
+ *
+ * Created by teone on 5/25/16.
+ */
+
+(function () {
+  'use strict';
+
+  angular.module('xos.uiComponents')
+  /**
+    * @ngdoc directive
+    * @name xos.uiComponents.directive:xosField
+    * @restrict E
+    * @description The xos-field directive.
+    * This component decide, give a field wich kind of input it need to print.
+    * @param {string} name The field name
+    * @param {object} field The field configuration:
+    * ```
+    * {
+    *   label: 'Label',
+    *   type: 'number', //typeof field
+    *   validators: {} // see xosForm for more details
+    * }
+    * ```
+    * @param {mixed} ngModel The field value
+    *
+    * @example
+    
+    # Basic Example
+    
+      <example module="sampleField1">
+        <file name="script.js">
+          angular.module('sampleField1', ['xos.uiComponents'])
+          .factory('_', function($window){
+            return $window._;
+          })
+          .controller('SampleCtrl', function(){
+            this.name = 'input-name';
+            this.field = {label: 'My String Value:', type: 'string'};
+            this.model = 'my string';
+          });
+        </file>
+        <file name="index.html">
+          <div ng-controller="SampleCtrl as vm">
+            <xos-field ng-model="vm.model" name="vm.name" field="vm.field"></xos-field>
+          </div>
+        </file>
+      </example>
+      
+      # Possible Values
+
+      <example module="sampleField2">
+        <file name="script.js">
+          angular.module('sampleField2', ['xos.uiComponents'])
+          .factory('_', function($window){
+            return $window._;
+          })
+          .controller('SampleCtrl', function(){
+            this.field1 = {
+              name: 'number-field',
+              field: {label: 'My Number Value:', type: 'number'},
+              model: 2
+            };
+
+            this.field2 = {
+              name: 'date-field',
+              field: {label: 'My Date Value:', type: 'date'},
+              model: new Date()
+            };
+
+            this.field3 = {
+              name: 'boolean-field',
+              field: {label: 'My Boolean Value:', type: 'boolean'},
+              model: true
+            };
+
+            this.field4 = {
+              name: 'email-field',
+              field: {label: 'My Email Value:', type: 'email'},
+              model: 'sample@domain.us'
+            };
+          });
+        </file>
+        <file name="index.html">
+          <div ng-controller="SampleCtrl as vm">
+            <xos-field ng-model="vm.field1.model" name="vm.field1.name" field="vm.field1.field"></xos-field>
+            <xos-field ng-model="vm.field2.model" name="vm.field2.name" field="vm.field2.field"></xos-field>
+            <xos-field ng-model="vm.field3.model" name="vm.field3.name" field="vm.field3.field"></xos-field>
+            <xos-field ng-model="vm.field4.model" name="vm.field4.name" field="vm.field4.field"></xos-field>
+          </div>
+        </file>
+      </example>
+
+      # This element is recursive
+
+      <example module="sampleField3">
+        <file name="script.js">
+          angular.module('sampleField3', ['xos.uiComponents'])
+          .factory('_', function($window){
+            return $window._;
+          })
+          .controller('SampleCtrl', function(){
+            this.name = 'input-name';
+            this.field = {label: 'My Object Value:', type: 'object'};
+            this.model = {
+              name: 'Jhon',
+              age: '25',
+              email: 'jhon@thewall.ru',
+              active: true
+            };
+          });
+        </file>
+        <file name="index.html">
+          <div ng-controller="SampleCtrl as vm">
+            <xos-field ng-model="vm.model" name="vm.name" field="vm.field"></xos-field>
+          </div>
+        </file>
+      </example>
+    */
+  .directive('xosField', function(RecursionHelper){
+    return {
+      restrict: 'E',
+      scope: {
+        name: '=',
+        field: '=',
+        ngModel: '='
+      },
+      template: `
+        <label ng-if="vm.field.type !== 'object'">{{vm.field.label}}</label>
+            <input
+              ng-if="vm.field.type !== 'boolean' && vm.field.type !== 'object'"
+              type="{{vm.field.type}}"
+              name="{{vm.name}}"
+              class="form-control"
+              ng-model="vm.ngModel"
+              ng-minlength="vm.field.validators.minlength || 0"
+              ng-maxlength="vm.field.validators.maxlength || 2000"
+              ng-required="vm.field.validators.required || false" />
+            <span class="boolean-field" ng-if="vm.field.type === 'boolean'">
+              <button
+                class="btn btn-success"
+                ng-show="vm.ngModel"
+                ng-click="vm.ngModel = false">
+                <i class="glyphicon glyphicon-ok"></i>
+              </button>
+              <button
+                class="btn btn-danger"
+                ng-show="!vm.ngModel"
+                ng-click="vm.ngModel = true">
+                <i class="glyphicon glyphicon-remove"></i>
+              </button>
+            </span>
+            <div
+              class="panel panel-default object-field"
+              ng-if="vm.field.type == 'object' && !vm.isEmptyObject(vm.ngModel)"
+              >
+              <div class="panel-heading">{{vm.field.label}}</div>
+              <div class="panel-body">
+                <div ng-repeat="(k, v) in vm.ngModel">
+                  <xos-field
+                    name="k"
+                    field="{label: vm.formatLabel(k), type: vm.getType(v)}"
+                    ng-model="v">
+                  </xos-field>
+                </div>
+              </div>
+            </div>
+      `,
+      bindToController: true,
+      controllerAs: 'vm',
+      // the compile cicle is needed to support recursion
+      compile: function (element) {
+        return RecursionHelper.compile(element);
+      },
+      controller: function($attrs, XosFormHelpers, LabelFormatter){
+        // console.log('Field: ', this.name, this.field, this.ngModel);
+        if(!this.name){
+          throw new Error('[xosField] Please provide a field name');
+        }
+        if(!this.field){
+          throw new Error('[xosField] Please provide a field definition');
+        }
+        if(!$attrs.ngModel){
+          throw new Error('[xosField] Please provide an ng-model');
+        }
+
+        this.getType = XosFormHelpers._getFieldFormat;
+        this.formatLabel = LabelFormatter.format;
+
+        this.isEmptyObject = o => Object.keys(o).length === 0;
+      }
+    }
+  });
+})();
\ No newline at end of file
diff --git a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/field/field.scss b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/field/field.scss
new file mode 100644
index 0000000..8dd7ca4
--- /dev/null
+++ b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/field/field.scss
@@ -0,0 +1,3 @@
+xos-field {
+  display: block;
+}
\ No newline at end of file
diff --git a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/form/form.component.js b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/form/form.component.js
index 5294229..92843c2 100644
--- a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/form/form.component.js
+++ b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/form/form.component.js
@@ -9,6 +9,7 @@
 (function () {
   'use strict';
 
+
   angular.module('xos.uiComponents')
 
   /**
@@ -48,6 +49,9 @@
     * ```
     * @element ANY
     * @scope
+    * @requires xos.uiComponents.directive:xosField
+    * @requires xos.uiComponents.XosFormHelpers
+    * @requires xos.helpers._
     * @example
     
     Autogenerated form
@@ -159,31 +163,7 @@
       template: `
         <ng-form name="vm.{{vm.config.formName || 'form'}}">
           <div class="form-group" ng-repeat="(name, field) in vm.formField">
-            <label>{{field.label}}</label>
-            <input
-              ng-if="field.type !== 'boolean'"
-              type="{{field.type}}"
-              name="{{name}}"
-              class="form-control"
-              ng-model="vm.ngModel[name]"
-              ng-minlength="field.validators.minlength || 0"
-              ng-maxlength="field.validators.maxlength || 2000"
-              ng-required="field.validators.required || false" />
-            <span class="boolean-field" ng-if="field.type === 'boolean'">
-              <button
-                class="btn btn-success"
-                ng-show="vm.ngModel[name]"
-                ng-click="vm.ngModel[name] = false">
-                <i class="glyphicon glyphicon-ok"></i>
-              </button>
-              <button
-                class="btn btn-danger"
-                ng-show="!vm.ngModel[name]"
-                ng-click="vm.ngModel[name] = true">
-                <i class="glyphicon glyphicon-remove"></i>
-              </button>
-            </span>
-            <!-- <pre>{{vm[vm.config.formName][name].$error | json}}</pre> -->
+            <xos-field name="name" field="field" ng-model="vm.ngModel[name]"></xos-field>
             <xos-validation errors="vm[vm.config.formName || 'form'][name].$error"></xos-validation>
           </div>
           <div class="form-group" ng-if="vm.config.actions">
@@ -233,76 +213,5 @@
 
       }
     }
-  })
-  .service('XosFormHelpers', function(_, LabelFormatter){
-
-    this._isEmail = (text) => {
-      var re = /(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
-      return re.test(text);
-    };
-
-    this._getFieldFormat = (value) => {
-
-      // check if is date
-      if (_.isDate(value) || (!Number.isNaN(Date.parse(value)) && new Date(value).getTime() > 631180800000)){
-        return 'date';
-      }
-
-      // check if is boolean
-      // isNaN(false) = false, false is a number (0), true is a number (1)
-      if(typeof value  === 'boolean'){
-        return 'boolean';
-      }
-
-      // check if a string is a number
-      if(!isNaN(value) && value !== null){
-        return 'number';
-      }
-
-      // check if a string is an email
-      if(this._isEmail(value)){
-        return 'email';
-      }
-
-      // if null return string
-      if(value === null){
-        return 'string';
-      }
-
-      return typeof value;
-    };
-
-    this.buildFormStructure = (modelField, customField, model) => {
-
-      modelField = Object.keys(modelField).length > 0 ? modelField : customField; //if no model field are provided, check custom
-      customField = customField || {};
-
-      return _.reduce(Object.keys(modelField), (form, f) => {
-
-        form[f] = {
-          label: (customField[f] && customField[f].label) ? `${customField[f].label}:` : LabelFormatter.format(f),
-          type: (customField[f] && customField[f].type) ? customField[f].type : this._getFieldFormat(model[f]),
-          validators: (customField[f] && customField[f].validators) ? customField[f].validators : {}
-        };
-
-        if(form[f].type === 'date'){
-          model[f] = new Date(model[f]);
-        }
-
-        if(form[f].type === 'number'){
-          model[f] = parseInt(model[f], 10);
-        }
-
-        return form;
-      }, {});
-    };
-
-    this.parseModelField = (fields) => {
-      return _.reduce(fields, (form, f) => {
-        form[f] = {};
-        return form;
-      }, {});
-    }
-
-  })
+  });
 })();
diff --git a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/validation/validation.component.js b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/validation/validation.component.js
index 84eb91a..dbe4fbb 100644
--- a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/validation/validation.component.js
+++ b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/validation/validation.component.js
@@ -74,24 +74,24 @@
     return {
       restrict: 'E',
       scope: {
-        errors: '='
+        field: '=',
+        form: '='
       },
       template: `
         <div ng-cloak>
-          <!-- <pre>{{vm.errors.email | json}}</pre> -->
-          <xos-alert config="vm.config" show="vm.errors.required !== undefined && vm.errors.required !== false">
+          <xos-alert config="vm.config" show="vm.field.$error.required !== undefined && vm.field.$error.required !== false  && (vm.field.$touched || vm.form.$submitted)">
             Field required
           </xos-alert>
-          <xos-alert config="vm.config" show="vm.errors.email !== undefined && vm.errors.email !== false">
+          <xos-alert config="vm.config" show="vm.field.$error.email !== undefined && vm.field.$error.email !== false  && (vm.field.$touched || vm.form.$submitted)">
             This is not a valid email
           </xos-alert>
-          <xos-alert config="vm.config" show="vm.errors.minlength !== undefined && vm.errors.minlength !== false">
+          <xos-alert config="vm.config" show="vm.field.$error.minlength !== undefined && vm.field.$error.minlength !== false  && (vm.field.$touched || vm.form.$submitted)">
             Too short
           </xos-alert>
-          <xos-alert config="vm.config" show="vm.errors.maxlength !== undefined && vm.errors.maxlength !== false">
+          <xos-alert config="vm.config" show="vm.field.$error.maxlength !== undefined && vm.field.$error.maxlength !== false  && (vm.field.$touched || vm.form.$submitted)">
             Too long
           </xos-alert>
-          <xos-alert config="vm.config" show="vm.errors.custom !== undefined && vm.errors.custom !== false">
+          <xos-alert config="vm.config" show="vm.field.$error.custom !== undefined && vm.field.$error.custom !== false  && (vm.field.$touched || vm.form.$submitted)">
             Field invalid
           </xos-alert>
         </div>
diff --git a/views/ngXosLib/xosHelpers/src/ui_components/smartComponents/smartTable/smartTable.component.js b/views/ngXosLib/xosHelpers/src/ui_components/smartComponents/smartTable/smartTable.component.js
index 74226cc..b3a2eec 100644
--- a/views/ngXosLib/xosHelpers/src/ui_components/smartComponents/smartTable/smartTable.component.js
+++ b/views/ngXosLib/xosHelpers/src/ui_components/smartComponents/smartTable/smartTable.component.js
@@ -228,7 +228,7 @@
               return p == 'id' || p == 'validators'
             });
 
-            // TODO move out cb
+            // TODO move out cb,  non sense triggering a lot of times
             if(angular.isArray(this.config.hiddenFields)){
               props = _.difference(props, this.config.hiddenFields)
             }
@@ -236,13 +236,20 @@
             let labels = props.map(p => LabelFormatter.format(p));
 
             props.forEach((p, i) => {
-              this.tableConfig.columns.push({
+              let fieldConfig = {
                 label: labels[i],
                 prop: p
-              });
+              };
+
+              if(typeof item[p] !== 'string' && typeof item[p] !== 'undefined'){
+                fieldConfig.type = typeof item[p];
+              }
+
+              this.tableConfig.columns.push(fieldConfig);
             });
 
             // build form structure
+            // TODO move in a pure function for testing purposes
             props.forEach((p, i) => {
               this.formConfig.fields[p] = {
                 label: LabelFormatter.format(labels[i]).replace(':', ''),
diff --git a/views/ngXosLib/xosHelpers/src/ui_components/ui-components.module.js b/views/ngXosLib/xosHelpers/src/ui_components/ui-components.module.js
index ad3dc49..d94e59d 100644
--- a/views/ngXosLib/xosHelpers/src/ui_components/ui-components.module.js
+++ b/views/ngXosLib/xosHelpers/src/ui_components/ui-components.module.js
@@ -24,6 +24,7 @@
   **/
 
   angular.module('xos.uiComponents', [
-    'chart.js'
+    'chart.js',
+    'RecursionHelper'
   ])
 })();
diff --git a/views/ngXosLib/xosHelpers/src/xosHelpers.module.js b/views/ngXosLib/xosHelpers/src/xosHelpers.module.js
index b74ddf9..fe246a6 100644
--- a/views/ngXosLib/xosHelpers/src/xosHelpers.module.js
+++ b/views/ngXosLib/xosHelpers/src/xosHelpers.module.js
@@ -24,9 +24,16 @@
         'ngResource',
         'ngAnimate',
         'bugSnag',
-        'xos.uiComponents',
+        'xos.uiComponents'
       ])
       .config(config)
+
+      /**
+      * @ngdoc service
+      * @name xos.helpers._
+      * @description Wrap [lodash](https://lodash.com/docs) in an Angular Service
+      **/
+
       .factory('_', $window => $window._ );
 
   function config($httpProvider, $interpolateProvider, $resourceProvider) {
diff --git a/views/ngXosViews/diagnostic/spec/logicTopologyHelper.test.js b/views/ngXosViews/diagnostic/spec/logicTopologyHelper.test.js
index dc1f1e5..dcce7e8 100644
--- a/views/ngXosViews/diagnostic/spec/logicTopologyHelper.test.js
+++ b/views/ngXosViews/diagnostic/spec/logicTopologyHelper.test.js
@@ -50,7 +50,6 @@
 
     it('should calculate horizontal position for each element', () => {
       let [el0x, el1x, el2x, el3x, el4x] = Service.computeElementPosition(svgWidth);
-      console.log(x1, el1x);
       expect(el0x).toBeSimilar(svgWidth - (x0 + (Config.elWidths[0] / 2)));
       expect(el1x).toBeSimilar(svgWidth - (x1 + (Config.elWidths[1] / 2)));
       expect(el2x).toBeSimilar(svgWidth - (x2 + (Config.elWidths[2] / 2)));
diff --git a/views/ngXosViews/diagnostic/src/sass/main.scss b/views/ngXosViews/diagnostic/src/sass/main.scss
index 5db9d7f..90f1c50 100644
--- a/views/ngXosViews/diagnostic/src/sass/main.scss
+++ b/views/ngXosViews/diagnostic/src/sass/main.scss
@@ -1,5 +1,6 @@
 /* CONTAINER */
 #xosDiagnostic, [ui-view] {
+    height: 100%;
     min-height: 700px;
     position: relative;
 }
diff --git a/views/ngXosViews/mcordTopology/.bowerrc b/views/ngXosViews/mcordTopology/.bowerrc
new file mode 100644
index 0000000..e491038
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/.bowerrc
@@ -0,0 +1,3 @@
+{
+  "directory": "src/vendor/"
+}
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/.eslintrc b/views/ngXosViews/mcordTopology/.eslintrc
new file mode 100644
index 0000000..c852748
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/.eslintrc
@@ -0,0 +1,42 @@
+{
+    "ecmaFeatures": {
+        "blockBindings": true,
+        "forOf": true,
+        "destructuring": true,
+        "arrowFunctions": true,
+        "templateStrings": true
+    },
+    "env": { 
+        "browser": true,
+        "node": true,
+        "es6": true
+    },
+    "plugins": [
+        //"angular"
+    ],
+    "rules": {
+        "quotes": [2, "single"],
+        "camelcase": [1, {"properties": "always"}],
+        "no-underscore-dangle": 1,
+        "eqeqeq": [2, "smart"],
+        "no-alert": 1,
+        "key-spacing": [1, { "beforeColon": false, "afterColon": true }],
+        "indent": [2, 2],
+        "no-irregular-whitespace": 1,
+        "eol-last": 0,
+        "max-nested-callbacks": [2, 4],
+        "comma-spacing": [1, {"before": false, "after": true}],
+        "no-trailing-spaces": [1, { skipBlankLines: true }],
+        "no-unused-vars": [1, {"vars": "all", "args": "after-used"}],
+        "new-cap": 0,
+
+        //"angular/ng_module_name": [2, '/^xos\.*[a-z]*$/'],
+        //"angular/ng_controller_name": [2, '/^[a-z].*Ctrl$/'],
+        //"angular/ng_service_name": [2, '/^[A-Z].*Service$/'],
+        //"angular/ng_directive_name": [2, '/^[a-z]+[[A-Z].*]*$/'],
+        //"angular/ng_di": [0, "function or array"]
+    },
+    "globals" :{
+        "angular": true
+    } 
+}
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/.gitignore b/views/ngXosViews/mcordTopology/.gitignore
new file mode 100644
index 0000000..567aee4
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/.gitignore
@@ -0,0 +1,6 @@
+dist/
+src/vendor
+.tmp
+node_modules
+npm-debug.log
+dist/
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/bower.json b/views/ngXosViews/mcordTopology/bower.json
new file mode 100644
index 0000000..ed83aa4
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/bower.json
@@ -0,0 +1,30 @@
+{
+  "name": "xos-mcordTopology",
+  "version": "0.0.0",
+  "authors": [
+    "Matteo Scandolo <teo@onlab.us>"
+  ],
+  "description": "The mcordTopology view",
+  "license": "MIT",
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "bower_components",
+    "static/js/vendor/",
+    "test",
+    "tests"
+  ],
+  "dependencies": {
+    "d3": "~3.5.16"
+  },
+  "devDependencies": {
+    "jquery": "2.1.4",
+    "angular-mocks": "1.4.7",
+    "angular": "1.4.7",
+    "angular-ui-router": "0.2.15",
+    "angular-cookies": "1.4.7",
+    "angular-resource": "1.4.7",
+    "lodash": "^3.10.1",
+    "bootstrap-css": "2.3.2"
+  }
+}
diff --git a/views/ngXosViews/mcordTopology/env/default.js b/views/ngXosViews/mcordTopology/env/default.js
new file mode 100644
index 0000000..acc8b5a
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/env/default.js
@@ -0,0 +1,13 @@
+// This is a default configuration for your development environment.
+// You can duplicate this configuration for any of your Backend Environments.
+// Different configurations are loaded setting a NODE_ENV variable that contain the config file name.
+// `NODE_ENV=local npm start`
+//
+// If xoscsrftoken or xossessionid are not specified the browser value are used
+// (works only for local environment as both application are served on the same domain)
+
+module.exports = {
+  host: 'http://xos.dev:9999/',
+  xoscsrftoken: 's1hmvk8d66UwxnRlDze64FrswXBeHjRD',
+  xossessionid: '4qgqwp46w5ln4q24vitc8f5gx6i66wyk'
+};
diff --git a/views/ngXosViews/mcordTopology/env/mock.js b/views/ngXosViews/mcordTopology/env/mock.js
new file mode 100644
index 0000000..610ad78
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/env/mock.js
@@ -0,0 +1,5 @@
+module.exports = {
+  host: 'http://localhost:4000',
+  xoscsrftoken: 'Pkq9PqoAsaMvrEiFAgxfw47IxTOtd0Y5',
+  xossessionid: 'qa1t49qeecdehofjkndqvxik71iwzfvf'
+};
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/gulp/build.js b/views/ngXosViews/mcordTopology/gulp/build.js
new file mode 100644
index 0000000..afc12dd
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/gulp/build.js
@@ -0,0 +1,163 @@
+'use strict';
+
+// BUILD
+//
+// The only purpose of this gulpfile is to build a XOS view and copy the correct files into
+// .html => dashboards
+// .js (minified and concat) => static/js
+//
+// The template are parsed and added to js with angular $templateCache
+
+var gulp = require('gulp');
+var ngAnnotate = require('gulp-ng-annotate');
+var uglify = require('gulp-uglify');
+var templateCache = require('gulp-angular-templatecache');
+var runSequence = require('run-sequence');
+var concat = require('gulp-concat-util');
+var del = require('del');
+var wiredep = require('wiredep');
+var angularFilesort = require('gulp-angular-filesort');
+var _ = require('lodash');
+var eslint = require('gulp-eslint');
+var inject = require('gulp-inject');
+var rename = require('gulp-rename');
+var replace = require('gulp-replace');
+var postcss = require('gulp-postcss');
+var autoprefixer = require('autoprefixer');
+var mqpacker = require('css-mqpacker');
+var csswring = require('csswring');
+
+const TEMPLATE_FOOTER = `
+angular.module('xos.mcordTopology')
+.run(['$location', function(a){
+  a.path('/');
+}])
+`
+
+module.exports = function(options){
+  
+  // delete previous builded file
+  gulp.task('clean', function(){
+    return del(
+      [
+        options.dashboards + 'xosMcordTopology.html',
+        options.static + 'css/xosMcordTopology.css'
+      ],
+      {force: true}
+    );
+  });
+
+  // minify css
+  gulp.task('css', function () {
+    var processors = [
+      autoprefixer({browsers: ['last 1 version']}),
+      mqpacker,
+      csswring
+    ];
+
+    gulp.src([
+      `${options.css}**/*.css`,
+      `!${options.css}dev.css`
+    ])
+    .pipe(postcss(processors))
+    .pipe(gulp.dest(options.tmp + '/css/'));
+  });
+
+  // copy css in correct folder
+  gulp.task('copyCss', ['wait'], function(){
+    return gulp.src([`${options.tmp}/css/*.css`])
+    .pipe(concat('xosMcordTopology.css'))
+    .pipe(gulp.dest(options.static + 'css/'))
+  });
+
+  // compile and minify scripts
+  gulp.task('scripts', function() {
+    return gulp.src([
+      options.tmp + '**/*.js'
+    ])
+    .pipe(ngAnnotate())
+    .pipe(angularFilesort())
+    .pipe(concat('xosMcordTopology.js'))
+    .pipe(concat.header('//Autogenerated, do not edit!!!\n'))
+    .pipe(concat.footer(TEMPLATE_FOOTER))
+    .pipe(uglify())
+    .pipe(gulp.dest(options.static + 'js/'));
+  });
+
+  // set templates in cache
+  gulp.task('templates', function(){
+    return gulp.src('./src/templates/*.html')
+      .pipe(templateCache({
+        module: 'xos.mcordTopology',
+        root: 'templates/'
+      }))
+      .pipe(gulp.dest(options.tmp));
+  });
+
+  // copy html index to Django Folder
+  gulp.task('copyHtml', function(){
+    return gulp.src(options.src + 'index.html')
+      // remove dev dependencies from html
+      .pipe(replace(/<!-- bower:css -->(\n.*)*\n<!-- endbower --><!-- endcss -->/, ''))
+      .pipe(replace(/<!-- bower:js -->(\n.*)*\n<!-- endbower --><!-- endjs -->/, ''))
+      // injecting minified files
+      .pipe(
+        inject(
+          gulp.src([
+            options.static + 'js/vendor/xosMcordTopologyVendor.js',
+            options.static + 'js/xosMcordTopology.js',
+            options.static + 'css/xosMcordTopology.css'
+          ]),
+          {ignorePath: '/../../../xos/core/xoslib'}
+        )
+      )
+      .pipe(rename('xosMcordTopology.html'))
+      .pipe(gulp.dest(options.dashboards));
+  });
+
+  // minify vendor js files
+  gulp.task('wiredep', function(){
+    var bowerDeps = wiredep().js;
+    if(!bowerDeps){
+      return;
+    }
+
+    // remove angular (it's already loaded)
+    _.remove(bowerDeps, function(dep){
+      return dep.indexOf('angular/angular.js') !== -1;
+    });
+
+    return gulp.src(bowerDeps)
+      .pipe(concat('xosMcordTopologyVendor.js'))
+      .pipe(uglify())
+      .pipe(gulp.dest(options.static + 'js/vendor/'));
+  });
+
+  gulp.task('lint', function () {
+    return gulp.src(['src/js/**/*.js'])
+      .pipe(eslint())
+      .pipe(eslint.format())
+      .pipe(eslint.failAfterError());
+  });
+
+  gulp.task('wait', function (cb) {
+    // setTimeout could be any async task
+    setTimeout(function () {
+      cb();
+    }, 1000);
+  });
+
+  gulp.task('build', function() {
+    runSequence(
+      'clean',
+      'templates',
+      'babel',
+      'scripts',
+      'wiredep',
+      'css',
+      'copyCss',
+      'copyHtml',
+      'cleanTmp'
+    );
+  });
+};
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/gulp/server.js b/views/ngXosViews/mcordTopology/gulp/server.js
new file mode 100644
index 0000000..167a5a9
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/gulp/server.js
@@ -0,0 +1,161 @@
+'use strict';
+
+var gulp = require('gulp');
+var browserSync = require('browser-sync').create();
+var inject = require('gulp-inject');
+var runSequence = require('run-sequence');
+var angularFilesort = require('gulp-angular-filesort');
+var babel = require('gulp-babel');
+var wiredep = require('wiredep').stream;
+var httpProxy = require('http-proxy');
+var del = require('del');
+var sass = require('gulp-sass');
+
+const environment = process.env.NODE_ENV;
+
+if (environment){
+  var conf = require(`../env/${environment}.js`);
+}
+else{
+  var conf = require('../env/default.js')
+}
+
+var proxy = httpProxy.createProxyServer({
+  target: conf.host || 'http://0.0.0.0:9999'
+});
+
+
+proxy.on('error', function(error, req, res) {
+  res.writeHead(500, {
+    'Content-Type': 'text/plain'
+  });
+
+  console.error('[Proxy]', error);
+});
+
+module.exports = function(options){
+
+  // open in browser with sync and proxy to 0.0.0.0
+  gulp.task('browser', function() {
+    browserSync.init({
+      // reloadDelay: 500,
+      // logLevel: 'debug',
+      // logConnections: true,
+      startPath: '#/',
+      snippetOptions: {
+        rule: {
+          match: /<!-- browserSync -->/i
+        }
+      },
+      server: {
+        baseDir: options.src,
+        routes: {
+          '/xos/core/xoslib/static/js/vendor': options.helpers
+        },
+        middleware: function(req, res, next){
+          if(
+            req.url.indexOf('/api/') !== -1
+          ){
+            if(conf.xoscsrftoken && conf.xossessionid){
+              req.headers.cookie = `xoscsrftoken=${conf.xoscsrftoken}; xossessionid=${conf.xossessionid}`;
+              req.headers['x-csrftoken'] = conf.xoscsrftoken;
+            }
+            proxy.web(req, res);
+          }
+          else if(req.url.indexOf('/videoLocal.txt') !== -1){
+            let a = (Math.random() * 10).toString();
+            res.end(a)
+          }
+          else{
+            next();
+          }
+        }
+      }
+    });
+
+    gulp.watch(options.src + 'js/**/*.js', ['js-watch']);
+    gulp.watch(options.src + 'vendor/**/*.js', ['bower'], function(){
+      browserSync.reload();
+    });
+    gulp.watch(options.src + '**/*.html', function(){
+      browserSync.reload();
+    });
+    gulp.watch(options.css + '**/*.css', function(){
+      browserSync.reload();
+    });
+    gulp.watch(`${options.sass}/**/*.scss`, ['sass'], function(){
+      browserSync.reload();
+    });
+  });
+
+  // compile sass
+  gulp.task('sass', function () {
+    return gulp.src(`${options.sass}/**/*.scss`)
+      .pipe(sass().on('error', sass.logError))
+      .pipe(gulp.dest(options.css));
+  });
+
+  // transpile js with sourceMaps
+  gulp.task('babel', function(){
+    return gulp.src(options.scripts + '**/*.js')
+      .pipe(babel({sourceMaps: true}))
+      .pipe(gulp.dest(options.tmp));
+  });
+
+  // inject scripts
+  gulp.task('injectScript', ['cleanTmp', 'babel'], function(){
+    return gulp.src(options.src + 'index.html')
+      .pipe(
+        inject(
+          gulp.src([
+            options.tmp + '**/*.js',
+            options.helpers + 'ngXosHelpers.js'
+          ])
+          .pipe(angularFilesort()),
+          {
+            ignorePath: [options.src, '/../../ngXosLib']
+          }
+        )
+      )
+      .pipe(gulp.dest(options.src));
+  });
+
+  // inject CSS
+  gulp.task('injectCss', function(){
+    return gulp.src(options.src + 'index.html')
+      .pipe(
+        inject(
+          gulp.src(options.src + 'css/*.css'),
+          {
+            ignorePath: [options.src]
+          }
+          )
+        )
+      .pipe(gulp.dest(options.src));
+  });
+
+  // inject bower dependencies with wiredep
+  gulp.task('bower', function () {
+    return gulp.src(options.src + 'index.html')
+    .pipe(wiredep({devDependencies: true}))
+    .pipe(gulp.dest(options.src));
+  });
+
+  gulp.task('js-watch', ['injectScript'], function(){
+    browserSync.reload();
+  });
+
+  gulp.task('cleanTmp', function(){
+    return del([options.tmp + '**/*']);
+  });
+
+  gulp.task('serve', function() {
+    runSequence(
+      'sass',
+      'bower',
+      'injectScript',
+      'injectCss',
+      ['browser']
+    );
+  });
+};
diff --git a/views/ngXosViews/mcordTopology/gulpfile.js b/views/ngXosViews/mcordTopology/gulpfile.js
new file mode 100644
index 0000000..08df554
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/gulpfile.js
@@ -0,0 +1,26 @@
+'use strict';
+
+var gulp = require('gulp');
+var wrench = require('wrench');
+
+var options = {
+  src: 'src/',
+  css: 'src/css/',
+  sass: 'src/sass/',
+  scripts: 'src/js/',
+  tmp: 'src/.tmp',
+  dist: 'dist/',
+  api: '../../ngXosLib/api/',
+  helpers: '../../../xos/core/xoslib/static/js/vendor/',
+  static: '../../../xos/core/xoslib/static/', // this is the django static folder
+  dashboards: '../../../xos/core/xoslib/dashboards/' // this is the django html folder
+};
+
+wrench.readdirSyncRecursive('./gulp')
+.map(function(file) {
+  require('./gulp/' + file)(options);
+});
+
+gulp.task('default', function () {
+  gulp.start('build');
+});
diff --git a/views/ngXosViews/mcordTopology/karma.conf.js b/views/ngXosViews/mcordTopology/karma.conf.js
new file mode 100644
index 0000000..4123be9
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/karma.conf.js
@@ -0,0 +1,88 @@
+// Karma configuration
+// Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC)
+
+/* eslint indent: [2,2], quotes: [2, "single"]*/
+
+/*eslint-disable*/
+var wiredep = require('wiredep');
+var path = require('path');
+
+var bowerComponents = wiredep( {devDependencies: true} )[ 'js' ].map(function( file ){
+  return path.relative(process.cwd(), file);
+});
+
+module.exports = function(config) {
+/*eslint-enable*/
+  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: bowerComponents.concat([
+      '../../../xos/core/xoslib/static/js/vendor/ngXosVendor.js',
+      '../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js',
+      'src/js/**/*.js',
+      'spec/**/*.mock.js',
+      'spec/**/*.test.js',
+      'src/**/*.html'
+    ]),
+
+
+    // 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: {
+      'src/js/**/*.js': ['babel'],
+      'spec/**/*.test.js': ['babel'],
+      'src/**/*.html': ['ng-html2js']
+    },
+
+    ngHtml2JsPreprocessor: {
+      stripPrefix: 'src/', //strip the src path from template url (http://stackoverflow.com/questions/22869668/karma-unexpected-request-when-testing-angular-directive-even-with-ng-html2js)
+      moduleName: 'templates' // define the template module name
+    },
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    reporters: ['mocha'],
+
+
+    // 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: ['PhantomJS'],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false
+  });
+};
diff --git a/views/ngXosViews/mcordTopology/mocks/data/instances.json b/views/ngXosViews/mcordTopology/mocks/data/instances.json
new file mode 100644
index 0000000..0f86876
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/mocks/data/instances.json
@@ -0,0 +1,29 @@
+[
+  {
+    "id": 1,
+    "humanReadableName": "BBU_service_instance-1",
+    "instance_id": "instance-00000001", 
+    "instance_uuid": "42b75cb7-7205-4a68-9100-b2c1e3ea69b5", 
+    "name": "BBU_service_instance-1", 
+    "instance_name": "mysite_BBU-1", 
+    "ip": "130.127.133.91"
+  },
+  {
+    "id": 2,
+    "humanReadableName": "BBU_service_instance-2",
+    "instance_id": "instance-00000002", 
+    "instance_uuid": "42b75cb7-7205-4a68-9200-b2c2e3ea69b5", 
+    "name": "BBU_service_instance-2", 
+    "instance_name": "mysite_BBU-2", 
+    "ip": "130.127.133.92"
+  },
+  {
+    "id": 5,
+    "humanReadableName": "vsg_service_instance-4",
+    "instance_id": "instance-00000004", 
+    "instance_uuid": "44b75cb7-7405-4a68-9400-b4c4e3ea69b5", 
+    "name": "vsg_service_instance-4", 
+    "instance_name": "mysite_vsg-4", 
+    "ip": "130.127.133.94"
+  }
+]
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/mocks/mcord.conf.json b/views/ngXosViews/mcordTopology/mocks/mcord.conf.json
new file mode 100644
index 0000000..7246775
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/mocks/mcord.conf.json
@@ -0,0 +1,8 @@
+[
+  {
+    "url": "instances",
+    "base": "xos/",
+    "methods": ["GET", "POST"],
+    "param": "id"
+  }
+]
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/package.json b/views/ngXosViews/mcordTopology/package.json
new file mode 100644
index 0000000..94bb877
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/package.json
@@ -0,0 +1,63 @@
+{
+  "name": "xos-mcordTopology",
+  "version": "1.0.0",
+  "description": "Angular Application for XOS, created with generator-xos",
+  "scripts": {
+    "prestart": "npm install && bower install",
+    "start": "gulp serve",
+    "prebuild": "npm install && bower install",
+    "build": "gulp",
+    "test": "karma start",
+    "test:ci": "karma start --single-run",
+    "lint": "eslint src/js/"
+  },
+  "keywords": [
+    "XOS",
+    "Angular",
+    "XOSlib"
+  ],
+  "author": "Matteo Scandolo",
+  "license": "MIT",
+  "dependencies": {},
+  "devDependencies": {
+    "autoprefixer": "^6.3.3",
+    "browser-sync": "^2.9.11",
+    "css-mqpacker": "^4.0.0",
+    "csswring": "^4.2.1",
+    "del": "^2.0.2",
+    "easy-mocker": "^1.2.0",
+    "eslint": "^1.8.0",
+    "eslint-plugin-angular": "linkmesrl/eslint-plugin-angular",
+    "gulp": "^3.9.0",
+    "gulp-angular-filesort": "^1.1.1",
+    "gulp-angular-templatecache": "^1.8.0",
+    "gulp-babel": "^5.3.0",
+    "gulp-concat": "^2.6.0",
+    "gulp-concat-util": "^0.5.5",
+    "gulp-eslint": "^1.0.0",
+    "gulp-inject": "^3.0.0",
+    "gulp-minify-html": "^1.0.4",
+    "gulp-ng-annotate": "^1.1.0",
+    "gulp-postcss": "^6.0.1",
+    "gulp-rename": "^1.2.2",
+    "gulp-replace": "^0.5.4",
+    "gulp-sass": "^2.2.0",
+    "gulp-uglify": "^1.4.2",
+    "http-proxy": "^1.12.0",
+    "ink-docstrap": "^0.5.2",
+    "jasmine-core": "~2.3.4",
+    "karma": "^0.13.14",
+    "karma-babel-preprocessor": "~5.2.2",
+    "karma-coverage": "^0.5.3",
+    "karma-jasmine": "~0.3.6",
+    "karma-mocha-reporter": "~1.1.1",
+    "karma-ng-html2js-preprocessor": "^0.2.0",
+    "karma-phantomjs-launcher": "~0.2.1",
+    "lodash": "^3.10.1",
+    "phantomjs": "^1.9.19",
+    "proxy-middleware": "^0.15.0",
+    "run-sequence": "^1.1.4",
+    "wiredep": "^3.0.0-beta",
+    "wrench": "^1.5.8"
+  }
+}
diff --git a/views/ngXosViews/mcordTopology/spec/sample.test.js b/views/ngXosViews/mcordTopology/spec/sample.test.js
new file mode 100644
index 0000000..80a0184
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/spec/sample.test.js
@@ -0,0 +1,37 @@
+'use strict';
+
+describe('The User List', () => {
+  
+  var scope, element, isolatedScope, httpBackend;
+
+  beforeEach(module('xos.mcordTopology'));
+  beforeEach(module('templates'));
+
+  beforeEach(inject(function($httpBackend, $compile, $rootScope){
+    
+    httpBackend = $httpBackend;
+    // Setting up mock request
+    $httpBackend.expectGET('/xos/users/?no_hyperlinks=1').respond([
+      {
+        email: 'teo@onlab.us',
+        firstname: 'Matteo',
+        lastname: 'Scandolo' 
+      }
+    ]);
+  
+    scope = $rootScope.$new();
+    element = angular.element('<users-list></users-list>');
+    $compile(element)(scope);
+    scope.$digest();
+    isolatedScope = element.isolateScope().vm;
+  }));
+
+  xit('should load 1 users', () => {
+    httpBackend.flush();
+    expect(isolatedScope.users.length).toBe(1);
+    expect(isolatedScope.users[0].email).toEqual('teo@onlab.us');
+    expect(isolatedScope.users[0].firstname).toEqual('Matteo');
+    expect(isolatedScope.users[0].lastname).toEqual('Scandolo');
+  });
+
+});
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/src/css/dev.css b/views/ngXosViews/mcordTopology/src/css/dev.css
new file mode 100644
index 0000000..32d915d
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/css/dev.css
@@ -0,0 +1,7 @@
+#xosMcordTopology{
+  position: absolute;
+  /*top: 100px;
+  left: 200px;*/
+  width: 100%;
+  height: 100%;
+}
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/src/css/main.css b/views/ngXosViews/mcordTopology/src/css/main.css
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/css/main.css
diff --git a/views/ngXosViews/mcordTopology/src/css/mcord.css b/views/ngXosViews/mcordTopology/src/css/mcord.css
new file mode 100644
index 0000000..8fb7540
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/css/mcord.css
@@ -0,0 +1,81 @@
+#xosMcordTopology {
+  height: 700px;
+}
+
+[ui-view],
+m-cord-topology{
+  width: 100%;
+  height: 100%;
+  display: block;
+}
+
+line {
+  stroke: blue;
+  /*stroke-width: 1;*/
+}
+
+line.big{
+  stroke-width: 2;
+}
+
+circle,
+rect {
+  fill: #fff;
+  stroke-width: 1; 
+}
+
+.fabric {
+  stroke: none;
+  fill: #123456;
+  fill-rule: evenodd;
+}
+
+.fabric-container {
+  fill: transparent;
+  stroke: #000;
+  stroke-width: 1;
+}
+
+.bbu {
+  stroke: black;
+  fill: #FF7F0E;
+}
+
+.rru {
+  stroke: #000;
+  fill: #FFBB78;
+}
+
+.rru.antenna {
+  stroke: #000;
+  fill: brown;
+}
+
+.rru-shadow {
+  fill: #FFBB78;
+  opacity: .4
+}
+
+.MME, .SGW, .PGW, .Vid {
+  fill: purple;
+  stroke: #000;
+}
+
+rect.MME,
+rect.SGW,
+rect.PGW,
+rect.bbu,
+rect.Vid {
+  fill: #fff;
+  stroke: #fff;
+}
+
+.bbu text, 
+.MME text,
+.SGW text,
+.PGW text, 
+.Vid text {
+  font-size: 10px;
+  stroke-width: 0;
+  fill: #000;
+}
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/src/index.html b/views/ngXosViews/mcordTopology/src/index.html
new file mode 100644
index 0000000..d8985de
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/index.html
@@ -0,0 +1,31 @@
+<!-- browserSync -->
+<!-- bower:css -->
+<link rel="stylesheet" href="vendor/bootstrap-css/css/bootstrap.css" />
+<!-- endbower --><!-- endcss -->
+<!-- inject:css -->
+<link rel="stylesheet" href="/css/dev.css">
+<link rel="stylesheet" href="/css/main.css">
+<link rel="stylesheet" href="/css/mcord.css">
+<!-- endinject -->
+
+<div ng-app="xos.mcordTopology" id="xosMcordTopology" class="container-fluid">
+    <div ui-view></div>
+</div>
+
+<!-- bower:js -->
+<script src="vendor/d3/d3.js"></script>
+<script src="vendor/jquery/dist/jquery.js"></script>
+<script src="vendor/angular/angular.js"></script>
+<script src="vendor/angular-mocks/angular-mocks.js"></script>
+<script src="vendor/angular-ui-router/release/angular-ui-router.js"></script>
+<script src="vendor/angular-cookies/angular-cookies.js"></script>
+<script src="vendor/angular-resource/angular-resource.js"></script>
+<script src="vendor/lodash/lodash.js"></script>
+<script src="vendor/bootstrap-css/js/bootstrap.js"></script>
+<!-- endbower --><!-- endjs -->
+<!-- inject:js -->
+<script src="/../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js"></script>
+<script src="/.tmp/main.js"></script>
+<script src="/.tmp/static.data.js"></script>
+<script src="/.tmp/node_drawer.js"></script>
+<!-- endinject -->
diff --git a/views/ngXosViews/mcordTopology/src/js/main.js b/views/ngXosViews/mcordTopology/src/js/main.js
new file mode 100644
index 0000000..6a38c3e
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/js/main.js
@@ -0,0 +1,354 @@
+'use strict';
+
+angular.module('xos.mcordTopology', [
+  'ngResource',
+  'ngCookies',
+  'ui.router',
+  'xos.helpers'
+])
+.config(($stateProvider) => {
+  $stateProvider
+  .state('topology', {
+    url: '/',
+    template: '<m-cord-topology></m-cord-topology>'
+  });
+})
+.config(function($httpProvider){
+  $httpProvider.interceptors.push('NoHyperlinks');
+})
+.factory('_', $window => $window._)
+.service('Traffic', function($http, $q){
+  this.get = () => {
+    var deferred = $q.defer();
+    $http.get('videoLocal.txt')
+    .then(res => {
+      deferred.resolve(res.data);
+    })
+    .catch(e => {
+      console.log(e);
+      deferred.resolve(Math.random() * 10)
+    });
+    return deferred.promise;
+  }
+})
+.directive('mCordTopology', function(){
+  return {
+    restrict: 'E',
+    scope: {},
+    bindToController: true,
+    controllerAs: 'vm',
+    template: '',
+    controller: function($element, $interval, $rootScope, _, $http, TopologyElements, NodeDrawer, Traffic){
+
+      const el = $element[0];
+
+      let nodes = [];
+      let links = [];
+      let traffic = 0;
+      let linkWidth = 1;
+      let trafficCorrection = 5;
+
+      const filterBBU = (instances) => {
+        return _.filter(instances, i => i.name.indexOf("bbu") >= 0);
+      };
+
+      const filterOthers = (instances) => {
+        return TopologyElements.fakedInstance;
+      };
+
+      // retrieving instances list
+      const getData = () => {
+
+        d3.select('svg')
+          .style('width', `${el.clientWidth}px`)
+          .style('height', `${el.clientHeight}px`);
+
+        nodes = TopologyElements.nodes;
+        links = TopologyElements.links;
+
+        Traffic.get()
+        .then((newTraffic) => {
+
+          // calculating link size
+          // it should change between 1 and 10
+          if(!traffic){
+            linkWidth = 2;
+          }
+          else if(newTraffic === traffic){
+            linkWidth = linkWidth;
+          }
+          else{
+            let delta = newTraffic - traffic;
+
+            if(delta > 0){
+              linkWidth = linkWidth + (delta / trafficCorrection);
+            }
+            else{
+              linkWidth = linkWidth - ((delta * -1) / trafficCorrection);
+            }
+
+          }
+
+          if(linkWidth < 0.2){
+            linkWidth = 0.2
+          };
+
+          traffic = newTraffic;
+
+          return $http.get('/api/core/xos/instances');
+          // return XosApi.Instance_List_GET()
+        })
+        .then((instances) => {
+
+          addBbuNodes(filterBBU(instances.data));
+          addOtherNodes(filterOthers(instances.data));
+
+          draw(svg, nodes, links);
+        })
+        .catch((e) => {
+          throw new Error(e);
+        });
+      };
+
+      const force = d3.layout.force();
+
+      // create svg elements
+      const svg = d3.select(el)
+        .append('svg')
+        .style('width', `${el.clientWidth}px`)
+        .style('height', `${el.clientHeight}px`);
+
+      const linkContainer = svg.append('g')
+        .attr({
+          class: 'link-container'
+        });
+
+      const nodeContainer = svg.append('g')
+        .attr({
+          class: 'node-container'
+        });
+
+      // replace human readable ids with d3 ids
+      // NOTE now ids are not manatined on update...
+      const buildLinks = (links, nodes) => {
+        return links.map((l) => {
+
+          console.log(_.find);
+          let source = _.findIndex(nodes, {id: l.source});
+          let target = _.findIndex(nodes, {id: l.target});
+          // console.log(`link-${source}-${target}`, source, target);
+          return {
+            source: source,
+            target: target,
+            value: 1,
+            id: `link-${source}-${target}`,
+            type: l.source.indexOf('fabric') >= 0 ? 'big':'small'
+          };
+
+        });
+      };
+
+      // find fabric nodes and center horizontally
+      const positionFabricNodes = (nodes) => {
+        return _.map(nodes, n => {
+          if(n.type !== 'fabric'){
+            return n;
+          }
+
+          n.x = n.x * hStep;
+          n.y = n.y * vStep;
+
+          return n;
+        });
+      };
+
+      const addBbuNodes = (instances) => {
+
+        // calculate bbu hStep
+        let bbuHStep = ((el.clientWidth / 2) / (instances.length + 1));
+
+        // create nodes
+        let bbuNodes = instances.map((n, i) => {
+          return {
+            type: 'bbu',
+            name: n.name,
+            id: `bbu-${n.id}`,
+            fixed: true,
+            y: vStep * 3,
+            x: bbuHStep * (i + 1)
+          };
+        });
+
+        // create links
+        let bbuLinks = bbuNodes.map(n => {
+          return {
+            source: n.id,
+            target: 'fabric4'
+          };
+        });
+
+        // fake RRU nodes and links
+        instances.forEach((n, i) => {
+          bbuNodes.push({
+            type: 'rru',
+            name: 'rru',
+            id: `rru-${n.id}`,
+            fixed: true,
+            y: vStep * 4,
+            x: bbuHStep * (i + 1)
+          });
+
+          bbuLinks.push({
+            source: `rru-${n.id}`,
+            target: `bbu-${n.id}`
+          });
+        })
+
+        nodes = nodes.concat(bbuNodes);
+
+
+        links = links.concat(bbuLinks);
+      };
+
+      // add MME, PGW, SGW nodes
+      const addOtherNodes = (instances) => {
+        let hStep = ((el.clientWidth / 2) / (instances.length + 1));
+
+        // create nodes
+        let otherNodes = instances.map((n, i) => {
+          return {
+            type: n.name.substring(0, 3),
+            name: n.name,
+            id: `${n.name.substring(0, 3)}-${n.id}`,
+            fixed: true,
+            y: vStep * 3,
+            x: (el.clientWidth / 2) + (hStep * (i + 1))
+          };
+        });
+
+        // create links
+        let otherLinks = otherNodes.map(n => {
+          return {
+            source: n.id,
+            target: 'fabric4'
+          };
+        });
+
+
+        nodes = nodes.concat(otherNodes);
+        links = links.concat(otherLinks);
+      }
+
+      let hStep, vStep;
+
+      hStep = el.clientWidth / 3;
+      vStep = el.clientHeight / 5;
+
+      const draw = (svg, nodes, links) => {
+
+        hStep = el.clientWidth / 3;
+        vStep = el.clientHeight / 5;
+
+        links = buildLinks(links, nodes);
+
+        nodes = positionFabricNodes(nodes);
+
+        console.log(nodes);
+        // start force layout
+        force
+          .nodes(nodes)
+          .links(links)
+          .size([el.clientWidth, el.clientHeight])
+          .charge(-20)
+          .chargeDistance(200)
+          .linkDistance(80)
+          .linkStrength(0.1)
+          .start();
+
+
+        const linkContainer = d3.select('.link-container');
+        const nodeContainer = d3.select('.node-container');
+
+        NodeDrawer.drawFabricBox(nodeContainer, hStep, vStep);
+
+        // draw links
+        var link = linkContainer.selectAll('.link')
+          .data(links, d => d.id);
+        
+        link.enter().append('line')
+          .attr({
+            class: d => `link ${d.type}`,
+            'stroke-width': linkWidth,
+            id: d => d.id,
+            opacity: 0
+          })
+          .transition()
+          .duration(1000)
+          .attr({
+            opacity: 1
+          });
+
+        link
+          .transition()
+          .duration(1000)
+          .attr({
+            'stroke-width': linkWidth,
+            opacity: 1
+          });
+
+        link.exit()
+        .remove();
+
+        //draw nodes
+        var node = nodeContainer.selectAll('.node')
+          .data(nodes, d => {
+            return d.id
+          });
+        
+        // append a group for any new node
+        var enter = node.enter()
+          .append('g', d => d.interfaceCfgIdentifier)
+          .attr({
+            class: d => `${d.type} node`,
+            transform: d => `translate(${d.x}, ${d.y})`
+          });
+
+        // draw nodes
+        NodeDrawer.drawBbus(enter.filter('.bbu'))
+        NodeDrawer.drawRrus(enter.filter('.rru'))
+        NodeDrawer.drawFabric(enter.filter('.fabric'))
+        NodeDrawer.drawOthers(enter.filter(d => {
+          console.log(d.type);
+          return (
+            d.type  === 'MME' ||
+            d.type === 'SGW' ||
+            d.type === 'PGW' ||
+            d.type === 'Vid'
+          )
+        }));
+
+        // remove nodes
+        var exit = node.exit();
+
+        NodeDrawer.removeElements(exit);
+
+        force.on('tick', function() {
+          link
+            .attr('x1', d => d.source.x )
+            .attr('y1', d => d.source.y )
+            .attr('x2', d => d.target.x )
+            .attr('y2', d => d.target.y );
+
+          node.attr('transform', (d) => `translate(${d.x},${d.y})`);
+        });
+      };
+      
+      // $interval(() => {
+      //   getData();
+      // }, 3000);
+      getData();
+
+      
+    }
+  };
+});
diff --git a/views/ngXosViews/mcordTopology/src/js/node_drawer.js b/views/ngXosViews/mcordTopology/src/js/node_drawer.js
new file mode 100644
index 0000000..b2dae65
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/js/node_drawer.js
@@ -0,0 +1,213 @@
+'use strict';
+
+angular.module('xos.mcordTopology')
+.service('NodeDrawer', function(TopologyElements){
+
+  const duration = 500;
+
+  let isFabricDrawed = false;
+
+  this.drawFabricBox = (svg, hStep, vStep) => {
+
+    if(isFabricDrawed){
+      return;
+    }
+
+    let fabric = svg.append('g')
+    .attr({
+      transform: `translate(${hStep - 25}, ${vStep - 25})`
+    });
+
+    fabric.append('rect')
+      .attr({
+        width: hStep + 50,
+        height: vStep + 50,
+        class: 'fabric-container'
+      });
+
+    // fabric.append('text')
+    // .text('Fabric')
+    // .attr({
+    //   'text-anchor': 'middle',
+    //   x: ((hStep + 50) / 2),
+    //   y: -10
+    // });
+
+    isFabricDrawed = true;
+  };
+
+  this.drawBbus = (nodes) => {
+
+    nodes.append('rect')
+      .attr({
+        class: d => d.type,
+        width: 30,
+        height: 30,
+        x: -15,
+        y: -15,
+        opacity: 0
+      })
+      .transition()
+      .duration(duration)
+      .attr({
+        r: 15,
+        opacity: 1
+      });
+
+    nodes
+      .append('path')
+      .attr({
+        class: d => `${d.type} antenna`,
+        opacity: 0,
+        d: () => TopologyElements.icons.bbu,
+        transform: `translate(-18, -18)`
+      })
+      .transition()
+      .duration(duration)
+      .attr({
+        opacity: 1
+      });
+
+    nodes.append('text')
+    .attr({
+      'text-anchor': 'start',
+      y: 25,
+      x: 5,
+      opacity: 0
+    })
+    .text(d => `BBU ${d.name.substr(d.name.length - 1, 1)}`)
+    .transition()
+    .duration(duration * 2)
+    .attr({
+      opacity: 1
+    });
+  };
+
+  this.drawRrus = (nodes) => {
+
+    nodes.append('circle')
+      .attr({
+        class: d => `${d.type}-shadow`,
+        r: 0,
+        opacity: 0
+      })
+      .transition()
+      .duration(duration * 2)
+      // .delay((d, i) => i * (duration / 2))
+      .attr({
+        r: 40,
+        opacity: 1
+      });
+
+    nodes
+      .append('path')
+      .attr({
+        class: d => `${d.type} antenna`,
+        opacity: 0,
+        d: () => TopologyElements.icons.rru,
+        transform: `translate(-18, -18)`
+      })
+      .transition()
+      .duration(duration)
+      .attr({
+        opacity: 1
+      });
+  
+    // nodes.append('circle')
+    //   .attr({
+    //     class: d => d.type,
+    //     r: 0,
+    //     opacity: 0
+    //   })
+    //   .transition()
+    //   .duration(duration)
+    //   // .delay((d, i) => i * (duration / 2))
+    //   .attr({
+    //     r: 10,
+    //     opacity: 1
+    //   });
+  };
+
+  this.drawFabric = (nodes) => {
+    nodes
+      .append('rect')
+      .attr({
+        width: 30,
+        height: 30,
+        x: -15,
+        y: -15
+      });
+
+    nodes
+      .append('path')
+      .attr({
+        class: d => d.type,
+        opacity: 0,
+        d: () => TopologyElements.icons.switch,
+        transform: `translate(-22, -22), scale(0.4)`
+      })
+      .transition()
+      .duration(duration)
+      // .delay((d, i) => i * (duration / 2))
+      .attr({
+        opacity: 1
+      });
+  };
+
+  this.drawOthers = (nodes) => {
+    nodes.append('rect')
+      .attr({
+        class: d => d.type,
+        width: 30,
+        height: 30,
+        x: -15,
+        y: -15,
+        opacity: 0
+      })
+      .transition()
+      .duration(duration)
+      .attr({
+        r: 15,
+        opacity: 1
+      });
+
+    nodes
+      .append('path')
+      .attr({
+        class: d => `${d.type} antenna`,
+        opacity: 0,
+        d: () => TopologyElements.icons.bbu,
+        transform: `translate(-18, -18)`
+      })
+      .transition()
+      .duration(duration)
+      .attr({
+        opacity: 1
+      });
+
+    nodes.append('text')
+    .attr({
+      'text-anchor': 'start',
+      y: 25,
+      x: -12,
+      opacity: 0
+    })
+    .text(d => d.name.toUpperCase())
+    .transition()
+    .duration(duration * 2)
+    .attr({
+      opacity: 1
+    });
+
+  };
+
+  this.removeElements = (nodes) => {
+    nodes
+    .transition()
+    .duration(duration)
+    .attr({
+      opacity: 0
+    })
+    .remove();
+  };
+});
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/src/js/static.data.js b/views/ngXosViews/mcordTopology/src/js/static.data.js
new file mode 100644
index 0000000..97ccf9d
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/js/static.data.js
@@ -0,0 +1,85 @@
+'use strict';
+
+angular.module('xos.mcordTopology')
+.constant('TopologyElements', {
+  nodes: [
+    // {
+    //   id: 'fabric1',
+    //   type: 'fabric',
+    //   name: 'fabric1',
+    //   fixed: true,
+    //   x: 1,
+    //   y: 1
+    // },
+    // {
+    //   id: 'fabric2',
+    //   type: 'fabric',
+    //   name: 'fabric2',
+    //   fixed: true,
+    //   x: 1,
+    //   y: 2
+    // },
+    // {
+    //   id: 'fabric3',
+    //   type: 'fabric',
+    //   name: 'fabric3',
+    //   fixed: true,
+    //   x: 2,
+    //   y: 1
+    // },
+    {
+      id: 'fabric4',
+      type: 'fabric',
+      name: 'fabric4',
+      fixed: true,
+      x: 1.5,
+      y: 1.5
+    }
+  ],
+  links: [
+    // {
+    //   source: 'fabric1',
+    //   target: 'fabric2'
+    // },
+    // {
+    //   source: 'fabric1',
+    //   target: 'fabric4'
+    // },
+    // {
+    //   source: 'fabric3',
+    //   target: 'fabric4'
+    // },
+    // {
+    //   source: 'fabric3',
+    //   target: 'fabric2'
+    // }
+  ],
+  fakedInstance: [
+    {
+      humanReadableName: 'MME',
+      name: 'MME'
+    },
+    {
+      humanReadableName: 'PGW',
+      name: 'PGW'
+    },
+    {
+      humanReadableName: 'SGW',
+      name: 'SGW'
+    },
+    {
+      humanReadableName: 'Video Server',
+      name: 'Video Server'
+    }
+  ],
+  icons: {
+    bbu: `M11.08,4.66H24.76l6.81,6.82H4.23Z M4.24,18.34V13.21H31.6v5.13H4.24Zm25.64-1.72V14.94H28.19v1.69h1.68Zm-13.65-1.7v1.69h1.69V14.93H16.22Zm-3.42,0v1.69h1.68V14.93H12.8Zm-3.42,0v1.69h1.68V14.93H9.38ZM6,14.93v1.69H7.64V14.93H6Z M32.8,33.23H3V11.42l0,0c1.17-1.16,2.54-2.5,3.87-3.8S9.59,5,10.72,3.87l0,0H25.08l0,0C26.25,5,27.6,6.32,28.9,7.61s2.68,2.63,3.83,3.78l0,0v0.06ZM3.3,33H32.53l0-21.43C31.36,10.39,30,9.07,28.71,7.8S26.09,5.22,25,4.1H10.86C9.75,5.21,8.41,6.52,7.12,7.77s-2.67,2.61-3.83,3.76V33Z M4.24,25.18V20.05H31.6v5.13H4.24Zm24-1.73h1.68V21.78H28.19v1.67Zm-12,0H17.9V21.78H16.21v1.68Zm-1.73-1.68H12.81v1.67h1.68V21.78Zm-3.43,1.68V21.78H9.38v1.69h1.68ZM6,23.46H7.64V21.78H6v1.68Z M31.6,26.89V32H4.24V26.89H31.6Zm-3.4,1.72V30.3h1.68V28.61H28.19Zm-10.28,0H16.22V30.3h1.68V28.62Zm-3.43,1.69V28.62H12.8v1.69h1.68Zm-3.42,0V28.62H9.38v1.69h1.68ZM7.65,28.62H6v1.67H7.65V28.62Z`,
+    // bbu: `M15,100a5,5,0,0,1-5-5v-65a5,5,0,0,1,5-5h80a5,5,0,0,1,5,5v65a5,5,0,0,1-5,5zM14,22.5l11-11a10,3,0,0,1,10-2h40a10,3,0,0,1,10,2l11,11zM16,35a5,5,0,0,1,10,0a5,5,0,0,1-10,0z`,
+    switch: `M10,20a10,10,0,0,1,10-10h70a10,10,0,0,1,10,10v70a10,10,
+            0,0,1-10,10h-70a10,10,0,0,1-10-10zM60,26l12,0,0-8,18,13-18,13,0
+            -8-12,0zM60,60l12,0,0-8,18,13-18,13,0-8-12,0zM50,40l-12,0,0-8
+            -18,13,18,13,0-8,12,0zM50,74l-12,0,0-8-18,13,18,13,0-8,12,0z`,
+    // rru: `M85,71.2c-8.9,10.5-29.6,8.7-45.3-3.5C23.9,55.4,19.8,37,28.6,26.5C29.9,38.6,71.5,69.9,85,71.2z M92.7,76.2M16.2,15 M69.5,100.7v-4c0-1.4-1.2-2.2-2.6-2.2H19.3c-1.4,0-2.8,0.7-2.8,2.2v3.9c0,0.7,0.8,1,1.5,1h50.3C69,101.5,69.5,101.3,69.5,100.7z M77.3,7.5l0,3.7c9,0.1,16.3,7.1,16.2,15.7l3.9,0C97.5,16.3,88.5,7.6,77.3,7.5z M77.6,14.7l0,2.5c5.3,0,9.7,4.2,9.6,9.3l2.6,0C89.9,20,84.4,14.7,77.6,14.7z M82.3,22.2c-1.3-1.2-2.9-1.9-4.7-1.9l0,1.2c1.4,0,2.8,0.6,3.8,1.5c1,1,1.6,2.3,1.6,3.7l1.3,0C84.3,25.1,83.6,23.4,82.3,22.2z M38.9,69.5l-5.1,23h16.5l-2.5-17.2C44.1,73.3,38.9,69.5,38.9,69.5zM58.1,54.1c13.7,10.1,26.5,16.8,29.2,13.7c2.7-3.1-5.6-13-19.3-24.4 M62.9,34.2 M62,37.9C47.7,27.3,33.7,20,31,23.1c-2.7,3.2,7,14.2,20.6,26 M73.9,25.7c-2.9,0.1-5.2,2.3-5.1,4.8c0,0.7,0.2,1.4,0.6,2l0,0L53.8,49.7l3.3,2.5L72.7,35l-0.4-0.3c0.6,0.2,1.3,0.3,1.9,0.3c2.9-0.1,5.2-2.3,5.1-4.9C79.3,27.6,76.8,25.6,73.9,25.7z`,
+    rru: `M18.11,11a2.25,2.25,0,0,1,2.13,1.53A2.2,2.2,0,0,1,19.52,15a0.74,0.74,0,0,0-.3.61A7.49,7.49,0,0,0,20,19.35c2,4.55,3.94,9.13,5.89,13.7a1.14,1.14,0,0,1-.59,1.64A1.11,1.11,0,0,1,23.86,34q-0.53-1.2-1-2.41a0.38,0.38,0,0,0-.41-0.28H13.78a0.36,0.36,0,0,0-.39.26q-0.51,1.24-1.06,2.47a1.11,1.11,0,0,1-1.14.67,1.07,1.07,0,0,1-1-.89,1.47,1.47,0,0,1,.1-0.75q2.84-6.66,5.7-13.32a4.06,4.06,0,0,1,.18-0.42A6.39,6.39,0,0,0,17,15.53,0.58,0.58,0,0,0,16.74,15,2.21,2.21,0,0,1,16,12.5,2.26,2.26,0,0,1,18.11,11ZM21.74,29.1c-0.32-.74-0.61-1.43-0.92-2.12a0.35,0.35,0,0,0-.27-0.14H15.66a0.33,0.33,0,0,0-.26.11c-0.32.7-.62,1.41-0.93,2.15h7.26Zm-5.31-4.55h3.37L18.1,20.63Z M2.23,13.56A16,16,0,0,1,6.76,2.16a1.68,1.68,0,0,1,.8-0.46,1.06,1.06,0,0,1,1.18.59,1.16,1.16,0,0,1-.23,1.37A14.48,14.48,0,0,0,6.19,6.77a13.57,13.57,0,0,0,1.9,15.59l0.46,0.49a1.16,1.16,0,1,1-1.68,1.59,15.6,15.6,0,0,1-4.41-8.64C2.32,14.95,2.28,14.07,2.23,13.56Z M34,13.84a15.51,15.51,0,0,1-4.54,10.52,1.19,1.19,0,0,1-1.65.18,1.17,1.17,0,0,1,0-1.77,13.81,13.81,0,0,0,2.79-4.1,13.6,13.6,0,0,0-2.7-14.91A1.8,1.8,0,0,1,27.41,3,1.08,1.08,0,0,1,28,1.8,1.15,1.15,0,0,1,29.38,2a15.59,15.59,0,0,1,2.51,3.28A16.47,16.47,0,0,1,34,13.84Z M10.93,21.6A1.33,1.33,0,0,1,9.87,21a11.06,11.06,0,0,1-2.8-5.27A11.22,11.22,0,0,1,9.8,5.51l0.27-.28a1.16,1.16,0,1,1,1.64,1.63,8.62,8.62,0,0,0-2.06,3.22A8.87,8.87,0,0,0,11.18,19c0.18,0.23.4,0.44,0.59,0.66A1.13,1.13,0,0,1,11.95,21,1.08,1.08,0,0,1,10.93,21.6Z M29.47,13.57a11.11,11.11,0,0,1-3.27,7.64,1.18,1.18,0,0,1-1.51.21,1.13,1.13,0,0,1-.43-1.4,2.06,2.06,0,0,1,.39-0.54,8.85,8.85,0,0,0,2.49-5.89A9,9,0,0,0,24.64,7a1.85,1.85,0,0,1-.44-0.85A1,1,0,0,1,24.82,5a1.07,1.07,0,0,1,1.3.21,20.11,20.11,0,0,1,1.79,2.31A11.09,11.09,0,0,1,29.47,13.57Z M11.3,13.18a6.73,6.73,0,0,1,2-4.73,1.15,1.15,0,0,1,1.45-.2,1.12,1.12,0,0,1,.49,1.32,1.58,1.58,0,0,1-.33.53,4.49,4.49,0,0,0,0,6.26,1.16,1.16,0,1,1-1.7,1.57A6.81,6.81,0,0,1,11.3,13.18Z M24.94,13.14A6.9,6.9,0,0,1,23,18a1.16,1.16,0,1,1-1.7-1.58,4.5,4.5,0,0,0,0-6.29A1.16,1.16,0,1,1,23,8.5,6.75,6.75,0,0,1,24.94,13.14Z`
+  }
+})
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/src/sass/main.scss b/views/ngXosViews/mcordTopology/src/sass/main.scss
new file mode 100644
index 0000000..78cf25b
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/sass/main.scss
@@ -0,0 +1,5 @@
+@import '../../../../style/sass/lib/_variables.scss';
+
+#xosMcordTopology {
+  
+}
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/src/templates/users-list.tpl.html b/views/ngXosViews/mcordTopology/src/templates/users-list.tpl.html
new file mode 100644
index 0000000..fd8d208
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/templates/users-list.tpl.html
@@ -0,0 +1,16 @@
+<div class="row">
+  <div class="col-xs-12">
+    <h1>Users List</h1>
+    <p>This is only an example view.</p>
+  </div>
+</div>
+<div class="row">
+  <div class="col-xs-4">Email</div>
+  <div class="col-xs-4">First Name</div>
+  <div class="col-xs-4">Last Name</div>
+</div>  
+<div class="row" ng-repeat="user in vm.users">
+  <div class="col-xs-4">{{user.email}}</div>
+  <div class="col-xs-4">{{user.firstname}}</div>
+  <div class="col-xs-4">{{user.lastname}}</div>
+</div>  
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/Chart.js/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/Chart.js/.bower.json
deleted file mode 100644
index 809dbba..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/Chart.js/.bower.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "name": "Chart.js",
-  "description": "Simple HTML5 Charts using the canvas element",
-  "homepage": "https://github.com/nnnick/Chart.js",
-  "author": "nnnick",
-  "main": [
-    "Chart.js"
-  ],
-  "ignore": [
-    "**/*",
-    ".travis.yml",
-    "CONTRIBUTING.md",
-    "Chart.js",
-    "LICENSE.md",
-    "README.md",
-    "gulpfile.js",
-    "package.json"
-  ],
-  "dependencies": {},
-  "version": "1.1.1",
-  "_release": "1.1.1",
-  "_resolution": {
-    "type": "version",
-    "tag": "v1.1.1",
-    "commit": "a62537a80029cd5a2e230769a652904e2de2d5d4"
-  },
-  "_source": "https://github.com/nnnick/Chart.js.git",
-  "_target": "~1.1.1",
-  "_originalSource": "Chart.js"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/Chart.js/Chart.js b/views/ngXosViews/serviceGrid/src/vendor/Chart.js/Chart.js
deleted file mode 100644
index 954fbe8..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/Chart.js/Chart.js
+++ /dev/null
@@ -1,3736 +0,0 @@
-/*!
- * Chart.js
- * http://chartjs.org/
- * Version: 1.1.1
- *
- * Copyright 2015 Nick Downie
- * Released under the MIT license
- * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
- */
-
-
-(function(){
-
-	"use strict";
-
-	//Declare root variable - window in the browser, global on the server
-	var root = this,
-		previous = root.Chart;
-
-	//Occupy the global variable of Chart, and create a simple base class
-	var Chart = function(context){
-		var chart = this;
-		this.canvas = context.canvas;
-
-		this.ctx = context;
-
-		//Variables global to the chart
-		var computeDimension = function(element,dimension)
-		{
-			if (element['offset'+dimension])
-			{
-				return element['offset'+dimension];
-			}
-			else
-			{
-				return document.defaultView.getComputedStyle(element).getPropertyValue(dimension);
-			}
-		};
-
-		var width = this.width = computeDimension(context.canvas,'Width') || context.canvas.width;
-		var height = this.height = computeDimension(context.canvas,'Height') || context.canvas.height;
-
-		this.aspectRatio = this.width / this.height;
-		//High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale.
-		helpers.retinaScale(this);
-
-		return this;
-	};
-	//Globally expose the defaults to allow for user updating/changing
-	Chart.defaults = {
-		global: {
-			// Boolean - Whether to animate the chart
-			animation: true,
-
-			// Number - Number of animation steps
-			animationSteps: 60,
-
-			// String - Animation easing effect
-			animationEasing: "easeOutQuart",
-
-			// Boolean - If we should show the scale at all
-			showScale: true,
-
-			// Boolean - If we want to override with a hard coded scale
-			scaleOverride: false,
-
-			// ** Required if scaleOverride is true **
-			// Number - The number of steps in a hard coded scale
-			scaleSteps: null,
-			// Number - The value jump in the hard coded scale
-			scaleStepWidth: null,
-			// Number - The scale starting value
-			scaleStartValue: null,
-
-			// String - Colour of the scale line
-			scaleLineColor: "rgba(0,0,0,.1)",
-
-			// Number - Pixel width of the scale line
-			scaleLineWidth: 1,
-
-			// Boolean - Whether to show labels on the scale
-			scaleShowLabels: true,
-
-			// Interpolated JS string - can access value
-			scaleLabel: "<%=value%>",
-
-			// Boolean - Whether the scale should stick to integers, and not show any floats even if drawing space is there
-			scaleIntegersOnly: true,
-
-			// Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
-			scaleBeginAtZero: false,
-
-			// String - Scale label font declaration for the scale label
-			scaleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
-
-			// Number - Scale label font size in pixels
-			scaleFontSize: 12,
-
-			// String - Scale label font weight style
-			scaleFontStyle: "normal",
-
-			// String - Scale label font colour
-			scaleFontColor: "#666",
-
-			// Boolean - whether or not the chart should be responsive and resize when the browser does.
-			responsive: false,
-
-			// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
-			maintainAspectRatio: true,
-
-			// Boolean - Determines whether to draw tooltips on the canvas or not - attaches events to touchmove & mousemove
-			showTooltips: true,
-
-			// Boolean - Determines whether to draw built-in tooltip or call custom tooltip function
-			customTooltips: false,
-
-			// Array - Array of string names to attach tooltip events
-			tooltipEvents: ["mousemove", "touchstart", "touchmove", "mouseout"],
-
-			// String - Tooltip background colour
-			tooltipFillColor: "rgba(0,0,0,0.8)",
-
-			// String - Tooltip label font declaration for the scale label
-			tooltipFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
-
-			// Number - Tooltip label font size in pixels
-			tooltipFontSize: 14,
-
-			// String - Tooltip font weight style
-			tooltipFontStyle: "normal",
-
-			// String - Tooltip label font colour
-			tooltipFontColor: "#fff",
-
-			// String - Tooltip title font declaration for the scale label
-			tooltipTitleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
-
-			// Number - Tooltip title font size in pixels
-			tooltipTitleFontSize: 14,
-
-			// String - Tooltip title font weight style
-			tooltipTitleFontStyle: "bold",
-
-			// String - Tooltip title font colour
-			tooltipTitleFontColor: "#fff",
-
-			// String - Tooltip title template
-			tooltipTitleTemplate: "<%= label%>",
-
-			// Number - pixel width of padding around tooltip text
-			tooltipYPadding: 6,
-
-			// Number - pixel width of padding around tooltip text
-			tooltipXPadding: 6,
-
-			// Number - Size of the caret on the tooltip
-			tooltipCaretSize: 8,
-
-			// Number - Pixel radius of the tooltip border
-			tooltipCornerRadius: 6,
-
-			// Number - Pixel offset from point x to tooltip edge
-			tooltipXOffset: 10,
-
-			// String - Template string for single tooltips
-			tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>",
-
-			// String - Template string for single tooltips
-			multiTooltipTemplate: "<%= datasetLabel %>: <%= value %>",
-
-			// String - Colour behind the legend colour block
-			multiTooltipKeyBackground: '#fff',
-
-			// Array - A list of colors to use as the defaults
-			segmentColorDefault: ["#A6CEE3", "#1F78B4", "#B2DF8A", "#33A02C", "#FB9A99", "#E31A1C", "#FDBF6F", "#FF7F00", "#CAB2D6", "#6A3D9A", "#B4B482", "#B15928" ],
-
-			// Array - A list of highlight colors to use as the defaults
-			segmentHighlightColorDefaults: [ "#CEF6FF", "#47A0DC", "#DAFFB2", "#5BC854", "#FFC2C1", "#FF4244", "#FFE797", "#FFA728", "#F2DAFE", "#9265C2", "#DCDCAA", "#D98150" ],
-
-			// Function - Will fire on animation progression.
-			onAnimationProgress: function(){},
-
-			// Function - Will fire on animation completion.
-			onAnimationComplete: function(){}
-
-		}
-	};
-
-	//Create a dictionary of chart types, to allow for extension of existing types
-	Chart.types = {};
-
-	//Global Chart helpers object for utility methods and classes
-	var helpers = Chart.helpers = {};
-
-		//-- Basic js utility methods
-	var each = helpers.each = function(loopable,callback,self){
-			var additionalArgs = Array.prototype.slice.call(arguments, 3);
-			// Check to see if null or undefined firstly.
-			if (loopable){
-				if (loopable.length === +loopable.length){
-					var i;
-					for (i=0; i<loopable.length; i++){
-						callback.apply(self,[loopable[i], i].concat(additionalArgs));
-					}
-				}
-				else{
-					for (var item in loopable){
-						callback.apply(self,[loopable[item],item].concat(additionalArgs));
-					}
-				}
-			}
-		},
-		clone = helpers.clone = function(obj){
-			var objClone = {};
-			each(obj,function(value,key){
-				if (obj.hasOwnProperty(key)){
-					objClone[key] = value;
-				}
-			});
-			return objClone;
-		},
-		extend = helpers.extend = function(base){
-			each(Array.prototype.slice.call(arguments,1), function(extensionObject) {
-				each(extensionObject,function(value,key){
-					if (extensionObject.hasOwnProperty(key)){
-						base[key] = value;
-					}
-				});
-			});
-			return base;
-		},
-		merge = helpers.merge = function(base,master){
-			//Merge properties in left object over to a shallow clone of object right.
-			var args = Array.prototype.slice.call(arguments,0);
-			args.unshift({});
-			return extend.apply(null, args);
-		},
-		indexOf = helpers.indexOf = function(arrayToSearch, item){
-			if (Array.prototype.indexOf) {
-				return arrayToSearch.indexOf(item);
-			}
-			else{
-				for (var i = 0; i < arrayToSearch.length; i++) {
-					if (arrayToSearch[i] === item) return i;
-				}
-				return -1;
-			}
-		},
-		where = helpers.where = function(collection, filterCallback){
-			var filtered = [];
-
-			helpers.each(collection, function(item){
-				if (filterCallback(item)){
-					filtered.push(item);
-				}
-			});
-
-			return filtered;
-		},
-		findNextWhere = helpers.findNextWhere = function(arrayToSearch, filterCallback, startIndex){
-			// Default to start of the array
-			if (!startIndex){
-				startIndex = -1;
-			}
-			for (var i = startIndex + 1; i < arrayToSearch.length; i++) {
-				var currentItem = arrayToSearch[i];
-				if (filterCallback(currentItem)){
-					return currentItem;
-				}
-			}
-		},
-		findPreviousWhere = helpers.findPreviousWhere = function(arrayToSearch, filterCallback, startIndex){
-			// Default to end of the array
-			if (!startIndex){
-				startIndex = arrayToSearch.length;
-			}
-			for (var i = startIndex - 1; i >= 0; i--) {
-				var currentItem = arrayToSearch[i];
-				if (filterCallback(currentItem)){
-					return currentItem;
-				}
-			}
-		},
-		inherits = helpers.inherits = function(extensions){
-			//Basic javascript inheritance based on the model created in Backbone.js
-			var parent = this;
-			var ChartElement = (extensions && extensions.hasOwnProperty("constructor")) ? extensions.constructor : function(){ return parent.apply(this, arguments); };
-
-			var Surrogate = function(){ this.constructor = ChartElement;};
-			Surrogate.prototype = parent.prototype;
-			ChartElement.prototype = new Surrogate();
-
-			ChartElement.extend = inherits;
-
-			if (extensions) extend(ChartElement.prototype, extensions);
-
-			ChartElement.__super__ = parent.prototype;
-
-			return ChartElement;
-		},
-		noop = helpers.noop = function(){},
-		uid = helpers.uid = (function(){
-			var id=0;
-			return function(){
-				return "chart-" + id++;
-			};
-		})(),
-		warn = helpers.warn = function(str){
-			//Method for warning of errors
-			if (window.console && typeof window.console.warn === "function") console.warn(str);
-		},
-		amd = helpers.amd = (typeof define === 'function' && define.amd),
-		//-- Math methods
-		isNumber = helpers.isNumber = function(n){
-			return !isNaN(parseFloat(n)) && isFinite(n);
-		},
-		max = helpers.max = function(array){
-			return Math.max.apply( Math, array );
-		},
-		min = helpers.min = function(array){
-			return Math.min.apply( Math, array );
-		},
-		cap = helpers.cap = function(valueToCap,maxValue,minValue){
-			if(isNumber(maxValue)) {
-				if( valueToCap > maxValue ) {
-					return maxValue;
-				}
-			}
-			else if(isNumber(minValue)){
-				if ( valueToCap < minValue ){
-					return minValue;
-				}
-			}
-			return valueToCap;
-		},
-		getDecimalPlaces = helpers.getDecimalPlaces = function(num){
-			if (num%1!==0 && isNumber(num)){
-				var s = num.toString();
-				if(s.indexOf("e-") < 0){
-					// no exponent, e.g. 0.01
-					return s.split(".")[1].length;
-				}
-				else if(s.indexOf(".") < 0) {
-					// no decimal point, e.g. 1e-9
-					return parseInt(s.split("e-")[1]);
-				}
-				else {
-					// exponent and decimal point, e.g. 1.23e-9
-					var parts = s.split(".")[1].split("e-");
-					return parts[0].length + parseInt(parts[1]);
-				}
-			}
-			else {
-				return 0;
-			}
-		},
-		toRadians = helpers.radians = function(degrees){
-			return degrees * (Math.PI/180);
-		},
-		// Gets the angle from vertical upright to the point about a centre.
-		getAngleFromPoint = helpers.getAngleFromPoint = function(centrePoint, anglePoint){
-			var distanceFromXCenter = anglePoint.x - centrePoint.x,
-				distanceFromYCenter = anglePoint.y - centrePoint.y,
-				radialDistanceFromCenter = Math.sqrt( distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);
-
-
-			var angle = Math.PI * 2 + Math.atan2(distanceFromYCenter, distanceFromXCenter);
-
-			//If the segment is in the top left quadrant, we need to add another rotation to the angle
-			if (distanceFromXCenter < 0 && distanceFromYCenter < 0){
-				angle += Math.PI*2;
-			}
-
-			return {
-				angle: angle,
-				distance: radialDistanceFromCenter
-			};
-		},
-		aliasPixel = helpers.aliasPixel = function(pixelWidth){
-			return (pixelWidth % 2 === 0) ? 0 : 0.5;
-		},
-		splineCurve = helpers.splineCurve = function(FirstPoint,MiddlePoint,AfterPoint,t){
-			//Props to Rob Spencer at scaled innovation for his post on splining between points
-			//http://scaledinnovation.com/analytics/splines/aboutSplines.html
-			var d01=Math.sqrt(Math.pow(MiddlePoint.x-FirstPoint.x,2)+Math.pow(MiddlePoint.y-FirstPoint.y,2)),
-				d12=Math.sqrt(Math.pow(AfterPoint.x-MiddlePoint.x,2)+Math.pow(AfterPoint.y-MiddlePoint.y,2)),
-				fa=t*d01/(d01+d12),// scaling factor for triangle Ta
-				fb=t*d12/(d01+d12);
-			return {
-				inner : {
-					x : MiddlePoint.x-fa*(AfterPoint.x-FirstPoint.x),
-					y : MiddlePoint.y-fa*(AfterPoint.y-FirstPoint.y)
-				},
-				outer : {
-					x: MiddlePoint.x+fb*(AfterPoint.x-FirstPoint.x),
-					y : MiddlePoint.y+fb*(AfterPoint.y-FirstPoint.y)
-				}
-			};
-		},
-		calculateOrderOfMagnitude = helpers.calculateOrderOfMagnitude = function(val){
-			return Math.floor(Math.log(val) / Math.LN10);
-		},
-		calculateScaleRange = helpers.calculateScaleRange = function(valuesArray, drawingSize, textSize, startFromZero, integersOnly){
-
-			//Set a minimum step of two - a point at the top of the graph, and a point at the base
-			var minSteps = 2,
-				maxSteps = Math.floor(drawingSize/(textSize * 1.5)),
-				skipFitting = (minSteps >= maxSteps);
-
-			// Filter out null values since these would min() to zero
-			var values = [];
-			each(valuesArray, function( v ){
-				v == null || values.push( v );
-			});
-			var minValue = min(values),
-			    maxValue = max(values);
-
-			// We need some degree of separation here to calculate the scales if all the values are the same
-			// Adding/minusing 0.5 will give us a range of 1.
-			if (maxValue === minValue){
-				maxValue += 0.5;
-				// So we don't end up with a graph with a negative start value if we've said always start from zero
-				if (minValue >= 0.5 && !startFromZero){
-					minValue -= 0.5;
-				}
-				else{
-					// Make up a whole number above the values
-					maxValue += 0.5;
-				}
-			}
-
-			var	valueRange = Math.abs(maxValue - minValue),
-				rangeOrderOfMagnitude = calculateOrderOfMagnitude(valueRange),
-				graphMax = Math.ceil(maxValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude),
-				graphMin = (startFromZero) ? 0 : Math.floor(minValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude),
-				graphRange = graphMax - graphMin,
-				stepValue = Math.pow(10, rangeOrderOfMagnitude),
-				numberOfSteps = Math.round(graphRange / stepValue);
-
-			//If we have more space on the graph we'll use it to give more definition to the data
-			while((numberOfSteps > maxSteps || (numberOfSteps * 2) < maxSteps) && !skipFitting) {
-				if(numberOfSteps > maxSteps){
-					stepValue *=2;
-					numberOfSteps = Math.round(graphRange/stepValue);
-					// Don't ever deal with a decimal number of steps - cancel fitting and just use the minimum number of steps.
-					if (numberOfSteps % 1 !== 0){
-						skipFitting = true;
-					}
-				}
-				//We can fit in double the amount of scale points on the scale
-				else{
-					//If user has declared ints only, and the step value isn't a decimal
-					if (integersOnly && rangeOrderOfMagnitude >= 0){
-						//If the user has said integers only, we need to check that making the scale more granular wouldn't make it a float
-						if(stepValue/2 % 1 === 0){
-							stepValue /=2;
-							numberOfSteps = Math.round(graphRange/stepValue);
-						}
-						//If it would make it a float break out of the loop
-						else{
-							break;
-						}
-					}
-					//If the scale doesn't have to be an int, make the scale more granular anyway.
-					else{
-						stepValue /=2;
-						numberOfSteps = Math.round(graphRange/stepValue);
-					}
-
-				}
-			}
-
-			if (skipFitting){
-				numberOfSteps = minSteps;
-				stepValue = graphRange / numberOfSteps;
-			}
-
-			return {
-				steps : numberOfSteps,
-				stepValue : stepValue,
-				min : graphMin,
-				max	: graphMin + (numberOfSteps * stepValue)
-			};
-
-		},
-		/* jshint ignore:start */
-		// Blows up jshint errors based on the new Function constructor
-		//Templating methods
-		//Javascript micro templating by John Resig - source at http://ejohn.org/blog/javascript-micro-templating/
-		template = helpers.template = function(templateString, valuesObject){
-
-			// If templateString is function rather than string-template - call the function for valuesObject
-
-			if(templateString instanceof Function){
-			 	return templateString(valuesObject);
-		 	}
-
-			var cache = {};
-			function tmpl(str, data){
-				// Figure out if we're getting a template, or if we need to
-				// load the template - and be sure to cache the result.
-				var fn = !/\W/.test(str) ?
-				cache[str] = cache[str] :
-
-				// Generate a reusable function that will serve as a template
-				// generator (and which will be cached).
-				new Function("obj",
-					"var p=[],print=function(){p.push.apply(p,arguments);};" +
-
-					// Introduce the data as local variables using with(){}
-					"with(obj){p.push('" +
-
-					// Convert the template into pure JavaScript
-					str
-						.replace(/[\r\t\n]/g, " ")
-						.split("<%").join("\t")
-						.replace(/((^|%>)[^\t]*)'/g, "$1\r")
-						.replace(/\t=(.*?)%>/g, "',$1,'")
-						.split("\t").join("');")
-						.split("%>").join("p.push('")
-						.split("\r").join("\\'") +
-					"');}return p.join('');"
-				);
-
-				// Provide some basic currying to the user
-				return data ? fn( data ) : fn;
-			}
-			return tmpl(templateString,valuesObject);
-		},
-		/* jshint ignore:end */
-		generateLabels = helpers.generateLabels = function(templateString,numberOfSteps,graphMin,stepValue){
-			var labelsArray = new Array(numberOfSteps);
-			if (templateString){
-				each(labelsArray,function(val,index){
-					labelsArray[index] = template(templateString,{value: (graphMin + (stepValue*(index+1)))});
-				});
-			}
-			return labelsArray;
-		},
-		//--Animation methods
-		//Easing functions adapted from Robert Penner's easing equations
-		//http://www.robertpenner.com/easing/
-		easingEffects = helpers.easingEffects = {
-			linear: function (t) {
-				return t;
-			},
-			easeInQuad: function (t) {
-				return t * t;
-			},
-			easeOutQuad: function (t) {
-				return -1 * t * (t - 2);
-			},
-			easeInOutQuad: function (t) {
-				if ((t /= 1 / 2) < 1){
-					return 1 / 2 * t * t;
-				}
-				return -1 / 2 * ((--t) * (t - 2) - 1);
-			},
-			easeInCubic: function (t) {
-				return t * t * t;
-			},
-			easeOutCubic: function (t) {
-				return 1 * ((t = t / 1 - 1) * t * t + 1);
-			},
-			easeInOutCubic: function (t) {
-				if ((t /= 1 / 2) < 1){
-					return 1 / 2 * t * t * t;
-				}
-				return 1 / 2 * ((t -= 2) * t * t + 2);
-			},
-			easeInQuart: function (t) {
-				return t * t * t * t;
-			},
-			easeOutQuart: function (t) {
-				return -1 * ((t = t / 1 - 1) * t * t * t - 1);
-			},
-			easeInOutQuart: function (t) {
-				if ((t /= 1 / 2) < 1){
-					return 1 / 2 * t * t * t * t;
-				}
-				return -1 / 2 * ((t -= 2) * t * t * t - 2);
-			},
-			easeInQuint: function (t) {
-				return 1 * (t /= 1) * t * t * t * t;
-			},
-			easeOutQuint: function (t) {
-				return 1 * ((t = t / 1 - 1) * t * t * t * t + 1);
-			},
-			easeInOutQuint: function (t) {
-				if ((t /= 1 / 2) < 1){
-					return 1 / 2 * t * t * t * t * t;
-				}
-				return 1 / 2 * ((t -= 2) * t * t * t * t + 2);
-			},
-			easeInSine: function (t) {
-				return -1 * Math.cos(t / 1 * (Math.PI / 2)) + 1;
-			},
-			easeOutSine: function (t) {
-				return 1 * Math.sin(t / 1 * (Math.PI / 2));
-			},
-			easeInOutSine: function (t) {
-				return -1 / 2 * (Math.cos(Math.PI * t / 1) - 1);
-			},
-			easeInExpo: function (t) {
-				return (t === 0) ? 1 : 1 * Math.pow(2, 10 * (t / 1 - 1));
-			},
-			easeOutExpo: function (t) {
-				return (t === 1) ? 1 : 1 * (-Math.pow(2, -10 * t / 1) + 1);
-			},
-			easeInOutExpo: function (t) {
-				if (t === 0){
-					return 0;
-				}
-				if (t === 1){
-					return 1;
-				}
-				if ((t /= 1 / 2) < 1){
-					return 1 / 2 * Math.pow(2, 10 * (t - 1));
-				}
-				return 1 / 2 * (-Math.pow(2, -10 * --t) + 2);
-			},
-			easeInCirc: function (t) {
-				if (t >= 1){
-					return t;
-				}
-				return -1 * (Math.sqrt(1 - (t /= 1) * t) - 1);
-			},
-			easeOutCirc: function (t) {
-				return 1 * Math.sqrt(1 - (t = t / 1 - 1) * t);
-			},
-			easeInOutCirc: function (t) {
-				if ((t /= 1 / 2) < 1){
-					return -1 / 2 * (Math.sqrt(1 - t * t) - 1);
-				}
-				return 1 / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1);
-			},
-			easeInElastic: function (t) {
-				var s = 1.70158;
-				var p = 0;
-				var a = 1;
-				if (t === 0){
-					return 0;
-				}
-				if ((t /= 1) == 1){
-					return 1;
-				}
-				if (!p){
-					p = 1 * 0.3;
-				}
-				if (a < Math.abs(1)) {
-					a = 1;
-					s = p / 4;
-				} else{
-					s = p / (2 * Math.PI) * Math.asin(1 / a);
-				}
-				return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));
-			},
-			easeOutElastic: function (t) {
-				var s = 1.70158;
-				var p = 0;
-				var a = 1;
-				if (t === 0){
-					return 0;
-				}
-				if ((t /= 1) == 1){
-					return 1;
-				}
-				if (!p){
-					p = 1 * 0.3;
-				}
-				if (a < Math.abs(1)) {
-					a = 1;
-					s = p / 4;
-				} else{
-					s = p / (2 * Math.PI) * Math.asin(1 / a);
-				}
-				return a * Math.pow(2, -10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) + 1;
-			},
-			easeInOutElastic: function (t) {
-				var s = 1.70158;
-				var p = 0;
-				var a = 1;
-				if (t === 0){
-					return 0;
-				}
-				if ((t /= 1 / 2) == 2){
-					return 1;
-				}
-				if (!p){
-					p = 1 * (0.3 * 1.5);
-				}
-				if (a < Math.abs(1)) {
-					a = 1;
-					s = p / 4;
-				} else {
-					s = p / (2 * Math.PI) * Math.asin(1 / a);
-				}
-				if (t < 1){
-					return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));}
-				return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) * 0.5 + 1;
-			},
-			easeInBack: function (t) {
-				var s = 1.70158;
-				return 1 * (t /= 1) * t * ((s + 1) * t - s);
-			},
-			easeOutBack: function (t) {
-				var s = 1.70158;
-				return 1 * ((t = t / 1 - 1) * t * ((s + 1) * t + s) + 1);
-			},
-			easeInOutBack: function (t) {
-				var s = 1.70158;
-				if ((t /= 1 / 2) < 1){
-					return 1 / 2 * (t * t * (((s *= (1.525)) + 1) * t - s));
-				}
-				return 1 / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);
-			},
-			easeInBounce: function (t) {
-				return 1 - easingEffects.easeOutBounce(1 - t);
-			},
-			easeOutBounce: function (t) {
-				if ((t /= 1) < (1 / 2.75)) {
-					return 1 * (7.5625 * t * t);
-				} else if (t < (2 / 2.75)) {
-					return 1 * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75);
-				} else if (t < (2.5 / 2.75)) {
-					return 1 * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375);
-				} else {
-					return 1 * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375);
-				}
-			},
-			easeInOutBounce: function (t) {
-				if (t < 1 / 2){
-					return easingEffects.easeInBounce(t * 2) * 0.5;
-				}
-				return easingEffects.easeOutBounce(t * 2 - 1) * 0.5 + 1 * 0.5;
-			}
-		},
-		//Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
-		requestAnimFrame = helpers.requestAnimFrame = (function(){
-			return window.requestAnimationFrame ||
-				window.webkitRequestAnimationFrame ||
-				window.mozRequestAnimationFrame ||
-				window.oRequestAnimationFrame ||
-				window.msRequestAnimationFrame ||
-				function(callback) {
-					return window.setTimeout(callback, 1000 / 60);
-				};
-		})(),
-		cancelAnimFrame = helpers.cancelAnimFrame = (function(){
-			return window.cancelAnimationFrame ||
-				window.webkitCancelAnimationFrame ||
-				window.mozCancelAnimationFrame ||
-				window.oCancelAnimationFrame ||
-				window.msCancelAnimationFrame ||
-				function(callback) {
-					return window.clearTimeout(callback, 1000 / 60);
-				};
-		})(),
-		animationLoop = helpers.animationLoop = function(callback,totalSteps,easingString,onProgress,onComplete,chartInstance){
-
-			var currentStep = 0,
-				easingFunction = easingEffects[easingString] || easingEffects.linear;
-
-			var animationFrame = function(){
-				currentStep++;
-				var stepDecimal = currentStep/totalSteps;
-				var easeDecimal = easingFunction(stepDecimal);
-
-				callback.call(chartInstance,easeDecimal,stepDecimal, currentStep);
-				onProgress.call(chartInstance,easeDecimal,stepDecimal);
-				if (currentStep < totalSteps){
-					chartInstance.animationFrame = requestAnimFrame(animationFrame);
-				} else{
-					onComplete.apply(chartInstance);
-				}
-			};
-			requestAnimFrame(animationFrame);
-		},
-		//-- DOM methods
-		getRelativePosition = helpers.getRelativePosition = function(evt){
-			var mouseX, mouseY;
-			var e = evt.originalEvent || evt,
-				canvas = evt.currentTarget || evt.srcElement,
-				boundingRect = canvas.getBoundingClientRect();
-
-			if (e.touches){
-				mouseX = e.touches[0].clientX - boundingRect.left;
-				mouseY = e.touches[0].clientY - boundingRect.top;
-
-			}
-			else{
-				mouseX = e.clientX - boundingRect.left;
-				mouseY = e.clientY - boundingRect.top;
-			}
-
-			return {
-				x : mouseX,
-				y : mouseY
-			};
-
-		},
-		addEvent = helpers.addEvent = function(node,eventType,method){
-			if (node.addEventListener){
-				node.addEventListener(eventType,method);
-			} else if (node.attachEvent){
-				node.attachEvent("on"+eventType, method);
-			} else {
-				node["on"+eventType] = method;
-			}
-		},
-		removeEvent = helpers.removeEvent = function(node, eventType, handler){
-			if (node.removeEventListener){
-				node.removeEventListener(eventType, handler, false);
-			} else if (node.detachEvent){
-				node.detachEvent("on"+eventType,handler);
-			} else{
-				node["on" + eventType] = noop;
-			}
-		},
-		bindEvents = helpers.bindEvents = function(chartInstance, arrayOfEvents, handler){
-			// Create the events object if it's not already present
-			if (!chartInstance.events) chartInstance.events = {};
-
-			each(arrayOfEvents,function(eventName){
-				chartInstance.events[eventName] = function(){
-					handler.apply(chartInstance, arguments);
-				};
-				addEvent(chartInstance.chart.canvas,eventName,chartInstance.events[eventName]);
-			});
-		},
-		unbindEvents = helpers.unbindEvents = function (chartInstance, arrayOfEvents) {
-			each(arrayOfEvents, function(handler,eventName){
-				removeEvent(chartInstance.chart.canvas, eventName, handler);
-			});
-		},
-		getMaximumWidth = helpers.getMaximumWidth = function(domNode){
-			var container = domNode.parentNode,
-			    padding = parseInt(getStyle(container, 'padding-left')) + parseInt(getStyle(container, 'padding-right'));
-			// TODO = check cross browser stuff with this.
-			return container ? container.clientWidth - padding : 0;
-		},
-		getMaximumHeight = helpers.getMaximumHeight = function(domNode){
-			var container = domNode.parentNode,
-			    padding = parseInt(getStyle(container, 'padding-bottom')) + parseInt(getStyle(container, 'padding-top'));
-			// TODO = check cross browser stuff with this.
-			return container ? container.clientHeight - padding : 0;
-		},
-		getStyle = helpers.getStyle = function (el, property) {
-			return el.currentStyle ?
-				el.currentStyle[property] :
-				document.defaultView.getComputedStyle(el, null).getPropertyValue(property);
-		},
-		getMaximumSize = helpers.getMaximumSize = helpers.getMaximumWidth, // legacy support
-		retinaScale = helpers.retinaScale = function(chart){
-			var ctx = chart.ctx,
-				width = chart.canvas.width,
-				height = chart.canvas.height;
-
-			if (window.devicePixelRatio) {
-				ctx.canvas.style.width = width + "px";
-				ctx.canvas.style.height = height + "px";
-				ctx.canvas.height = height * window.devicePixelRatio;
-				ctx.canvas.width = width * window.devicePixelRatio;
-				ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
-			}
-		},
-		//-- Canvas methods
-		clear = helpers.clear = function(chart){
-			chart.ctx.clearRect(0,0,chart.width,chart.height);
-		},
-		fontString = helpers.fontString = function(pixelSize,fontStyle,fontFamily){
-			return fontStyle + " " + pixelSize+"px " + fontFamily;
-		},
-		longestText = helpers.longestText = function(ctx,font,arrayOfStrings){
-			ctx.font = font;
-			var longest = 0;
-			each(arrayOfStrings,function(string){
-				var textWidth = ctx.measureText(string).width;
-				longest = (textWidth > longest) ? textWidth : longest;
-			});
-			return longest;
-		},
-		drawRoundedRectangle = helpers.drawRoundedRectangle = function(ctx,x,y,width,height,radius){
-			ctx.beginPath();
-			ctx.moveTo(x + radius, y);
-			ctx.lineTo(x + width - radius, y);
-			ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
-			ctx.lineTo(x + width, y + height - radius);
-			ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
-			ctx.lineTo(x + radius, y + height);
-			ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
-			ctx.lineTo(x, y + radius);
-			ctx.quadraticCurveTo(x, y, x + radius, y);
-			ctx.closePath();
-		};
-
-
-	//Store a reference to each instance - allowing us to globally resize chart instances on window resize.
-	//Destroy method on the chart will remove the instance of the chart from this reference.
-	Chart.instances = {};
-
-	Chart.Type = function(data,options,chart){
-		this.options = options;
-		this.chart = chart;
-		this.id = uid();
-		//Add the chart instance to the global namespace
-		Chart.instances[this.id] = this;
-
-		// Initialize is always called when a chart type is created
-		// By default it is a no op, but it should be extended
-		if (options.responsive){
-			this.resize();
-		}
-		this.initialize.call(this,data);
-	};
-
-	//Core methods that'll be a part of every chart type
-	extend(Chart.Type.prototype,{
-		initialize : function(){return this;},
-		clear : function(){
-			clear(this.chart);
-			return this;
-		},
-		stop : function(){
-			// Stops any current animation loop occuring
-			Chart.animationService.cancelAnimation(this);
-			return this;
-		},
-		resize : function(callback){
-			this.stop();
-			var canvas = this.chart.canvas,
-				newWidth = getMaximumWidth(this.chart.canvas),
-				newHeight = this.options.maintainAspectRatio ? newWidth / this.chart.aspectRatio : getMaximumHeight(this.chart.canvas);
-
-			canvas.width = this.chart.width = newWidth;
-			canvas.height = this.chart.height = newHeight;
-
-			retinaScale(this.chart);
-
-			if (typeof callback === "function"){
-				callback.apply(this, Array.prototype.slice.call(arguments, 1));
-			}
-			return this;
-		},
-		reflow : noop,
-		render : function(reflow){
-			if (reflow){
-				this.reflow();
-			}
-			
-			if (this.options.animation && !reflow){
-				var animation = new Chart.Animation();
-				animation.numSteps = this.options.animationSteps;
-				animation.easing = this.options.animationEasing;
-				
-				// render function
-				animation.render = function(chartInstance, animationObject) {
-					var easingFunction = helpers.easingEffects[animationObject.easing];
-					var stepDecimal = animationObject.currentStep / animationObject.numSteps;
-					var easeDecimal = easingFunction(stepDecimal);
-					
-					chartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep);
-				};
-				
-				// user events
-				animation.onAnimationProgress = this.options.onAnimationProgress;
-				animation.onAnimationComplete = this.options.onAnimationComplete;
-				
-				Chart.animationService.addAnimation(this, animation);
-			}
-			else{
-				this.draw();
-				this.options.onAnimationComplete.call(this);
-			}
-			return this;
-		},
-		generateLegend : function(){
-			return helpers.template(this.options.legendTemplate, this);
-		},
-		destroy : function(){
-			this.stop();
-			this.clear();
-			unbindEvents(this, this.events);
-			var canvas = this.chart.canvas;
-
-			// Reset canvas height/width attributes starts a fresh with the canvas context
-			canvas.width = this.chart.width;
-			canvas.height = this.chart.height;
-
-			// < IE9 doesn't support removeProperty
-			if (canvas.style.removeProperty) {
-				canvas.style.removeProperty('width');
-				canvas.style.removeProperty('height');
-			} else {
-				canvas.style.removeAttribute('width');
-				canvas.style.removeAttribute('height');
-			}
-
-			delete Chart.instances[this.id];
-		},
-		showTooltip : function(ChartElements, forceRedraw){
-			// Only redraw the chart if we've actually changed what we're hovering on.
-			if (typeof this.activeElements === 'undefined') this.activeElements = [];
-
-			var isChanged = (function(Elements){
-				var changed = false;
-
-				if (Elements.length !== this.activeElements.length){
-					changed = true;
-					return changed;
-				}
-
-				each(Elements, function(element, index){
-					if (element !== this.activeElements[index]){
-						changed = true;
-					}
-				}, this);
-				return changed;
-			}).call(this, ChartElements);
-
-			if (!isChanged && !forceRedraw){
-				return;
-			}
-			else{
-				this.activeElements = ChartElements;
-			}
-			this.draw();
-			if(this.options.customTooltips){
-				this.options.customTooltips(false);
-			}
-			if (ChartElements.length > 0){
-				// If we have multiple datasets, show a MultiTooltip for all of the data points at that index
-				if (this.datasets && this.datasets.length > 1) {
-					var dataArray,
-						dataIndex;
-
-					for (var i = this.datasets.length - 1; i >= 0; i--) {
-						dataArray = this.datasets[i].points || this.datasets[i].bars || this.datasets[i].segments;
-						dataIndex = indexOf(dataArray, ChartElements[0]);
-						if (dataIndex !== -1){
-							break;
-						}
-					}
-					var tooltipLabels = [],
-						tooltipColors = [],
-						medianPosition = (function(index) {
-
-							// Get all the points at that particular index
-							var Elements = [],
-								dataCollection,
-								xPositions = [],
-								yPositions = [],
-								xMax,
-								yMax,
-								xMin,
-								yMin;
-							helpers.each(this.datasets, function(dataset){
-								dataCollection = dataset.points || dataset.bars || dataset.segments;
-								if (dataCollection[dataIndex] && dataCollection[dataIndex].hasValue()){
-									Elements.push(dataCollection[dataIndex]);
-								}
-							});
-
-							helpers.each(Elements, function(element) {
-								xPositions.push(element.x);
-								yPositions.push(element.y);
-
-
-								//Include any colour information about the element
-								tooltipLabels.push(helpers.template(this.options.multiTooltipTemplate, element));
-								tooltipColors.push({
-									fill: element._saved.fillColor || element.fillColor,
-									stroke: element._saved.strokeColor || element.strokeColor
-								});
-
-							}, this);
-
-							yMin = min(yPositions);
-							yMax = max(yPositions);
-
-							xMin = min(xPositions);
-							xMax = max(xPositions);
-
-							return {
-								x: (xMin > this.chart.width/2) ? xMin : xMax,
-								y: (yMin + yMax)/2
-							};
-						}).call(this, dataIndex);
-
-					new Chart.MultiTooltip({
-						x: medianPosition.x,
-						y: medianPosition.y,
-						xPadding: this.options.tooltipXPadding,
-						yPadding: this.options.tooltipYPadding,
-						xOffset: this.options.tooltipXOffset,
-						fillColor: this.options.tooltipFillColor,
-						textColor: this.options.tooltipFontColor,
-						fontFamily: this.options.tooltipFontFamily,
-						fontStyle: this.options.tooltipFontStyle,
-						fontSize: this.options.tooltipFontSize,
-						titleTextColor: this.options.tooltipTitleFontColor,
-						titleFontFamily: this.options.tooltipTitleFontFamily,
-						titleFontStyle: this.options.tooltipTitleFontStyle,
-						titleFontSize: this.options.tooltipTitleFontSize,
-						cornerRadius: this.options.tooltipCornerRadius,
-						labels: tooltipLabels,
-						legendColors: tooltipColors,
-						legendColorBackground : this.options.multiTooltipKeyBackground,
-						title: template(this.options.tooltipTitleTemplate,ChartElements[0]),
-						chart: this.chart,
-						ctx: this.chart.ctx,
-						custom: this.options.customTooltips
-					}).draw();
-
-				} else {
-					each(ChartElements, function(Element) {
-						var tooltipPosition = Element.tooltipPosition();
-						new Chart.Tooltip({
-							x: Math.round(tooltipPosition.x),
-							y: Math.round(tooltipPosition.y),
-							xPadding: this.options.tooltipXPadding,
-							yPadding: this.options.tooltipYPadding,
-							fillColor: this.options.tooltipFillColor,
-							textColor: this.options.tooltipFontColor,
-							fontFamily: this.options.tooltipFontFamily,
-							fontStyle: this.options.tooltipFontStyle,
-							fontSize: this.options.tooltipFontSize,
-							caretHeight: this.options.tooltipCaretSize,
-							cornerRadius: this.options.tooltipCornerRadius,
-							text: template(this.options.tooltipTemplate, Element),
-							chart: this.chart,
-							custom: this.options.customTooltips
-						}).draw();
-					}, this);
-				}
-			}
-			return this;
-		},
-		toBase64Image : function(){
-			return this.chart.canvas.toDataURL.apply(this.chart.canvas, arguments);
-		}
-	});
-
-	Chart.Type.extend = function(extensions){
-
-		var parent = this;
-
-		var ChartType = function(){
-			return parent.apply(this,arguments);
-		};
-
-		//Copy the prototype object of the this class
-		ChartType.prototype = clone(parent.prototype);
-		//Now overwrite some of the properties in the base class with the new extensions
-		extend(ChartType.prototype, extensions);
-
-		ChartType.extend = Chart.Type.extend;
-
-		if (extensions.name || parent.prototype.name){
-
-			var chartName = extensions.name || parent.prototype.name;
-			//Assign any potential default values of the new chart type
-
-			//If none are defined, we'll use a clone of the chart type this is being extended from.
-			//I.e. if we extend a line chart, we'll use the defaults from the line chart if our new chart
-			//doesn't define some defaults of their own.
-
-			var baseDefaults = (Chart.defaults[parent.prototype.name]) ? clone(Chart.defaults[parent.prototype.name]) : {};
-
-			Chart.defaults[chartName] = extend(baseDefaults,extensions.defaults);
-
-			Chart.types[chartName] = ChartType;
-
-			//Register this new chart type in the Chart prototype
-			Chart.prototype[chartName] = function(data,options){
-				var config = merge(Chart.defaults.global, Chart.defaults[chartName], options || {});
-				return new ChartType(data,config,this);
-			};
-		} else{
-			warn("Name not provided for this chart, so it hasn't been registered");
-		}
-		return parent;
-	};
-
-	Chart.Element = function(configuration){
-		extend(this,configuration);
-		this.initialize.apply(this,arguments);
-		this.save();
-	};
-	extend(Chart.Element.prototype,{
-		initialize : function(){},
-		restore : function(props){
-			if (!props){
-				extend(this,this._saved);
-			} else {
-				each(props,function(key){
-					this[key] = this._saved[key];
-				},this);
-			}
-			return this;
-		},
-		save : function(){
-			this._saved = clone(this);
-			delete this._saved._saved;
-			return this;
-		},
-		update : function(newProps){
-			each(newProps,function(value,key){
-				this._saved[key] = this[key];
-				this[key] = value;
-			},this);
-			return this;
-		},
-		transition : function(props,ease){
-			each(props,function(value,key){
-				this[key] = ((value - this._saved[key]) * ease) + this._saved[key];
-			},this);
-			return this;
-		},
-		tooltipPosition : function(){
-			return {
-				x : this.x,
-				y : this.y
-			};
-		},
-		hasValue: function(){
-			return isNumber(this.value);
-		}
-	});
-
-	Chart.Element.extend = inherits;
-
-
-	Chart.Point = Chart.Element.extend({
-		display: true,
-		inRange: function(chartX,chartY){
-			var hitDetectionRange = this.hitDetectionRadius + this.radius;
-			return ((Math.pow(chartX-this.x, 2)+Math.pow(chartY-this.y, 2)) < Math.pow(hitDetectionRange,2));
-		},
-		draw : function(){
-			if (this.display){
-				var ctx = this.ctx;
-				ctx.beginPath();
-
-				ctx.arc(this.x, this.y, this.radius, 0, Math.PI*2);
-				ctx.closePath();
-
-				ctx.strokeStyle = this.strokeColor;
-				ctx.lineWidth = this.strokeWidth;
-
-				ctx.fillStyle = this.fillColor;
-
-				ctx.fill();
-				ctx.stroke();
-			}
-
-
-			//Quick debug for bezier curve splining
-			//Highlights control points and the line between them.
-			//Handy for dev - stripped in the min version.
-
-			// ctx.save();
-			// ctx.fillStyle = "black";
-			// ctx.strokeStyle = "black"
-			// ctx.beginPath();
-			// ctx.arc(this.controlPoints.inner.x,this.controlPoints.inner.y, 2, 0, Math.PI*2);
-			// ctx.fill();
-
-			// ctx.beginPath();
-			// ctx.arc(this.controlPoints.outer.x,this.controlPoints.outer.y, 2, 0, Math.PI*2);
-			// ctx.fill();
-
-			// ctx.moveTo(this.controlPoints.inner.x,this.controlPoints.inner.y);
-			// ctx.lineTo(this.x, this.y);
-			// ctx.lineTo(this.controlPoints.outer.x,this.controlPoints.outer.y);
-			// ctx.stroke();
-
-			// ctx.restore();
-
-
-
-		}
-	});
-
-	Chart.Arc = Chart.Element.extend({
-		inRange : function(chartX,chartY){
-
-			var pointRelativePosition = helpers.getAngleFromPoint(this, {
-				x: chartX,
-				y: chartY
-			});
-
-			// Normalize all angles to 0 - 2*PI (0 - 360°)
-			var pointRelativeAngle = pointRelativePosition.angle % (Math.PI * 2),
-			    startAngle = (Math.PI * 2 + this.startAngle) % (Math.PI * 2),
-			    endAngle = (Math.PI * 2 + this.endAngle) % (Math.PI * 2) || 360;
-
-			// Calculate wether the pointRelativeAngle is between the start and the end angle
-			var betweenAngles = (endAngle < startAngle) ?
-				pointRelativeAngle <= endAngle || pointRelativeAngle >= startAngle:
-				pointRelativeAngle >= startAngle && pointRelativeAngle <= endAngle;
-
-			//Check if within the range of the open/close angle
-			var withinRadius = (pointRelativePosition.distance >= this.innerRadius && pointRelativePosition.distance <= this.outerRadius);
-
-			return (betweenAngles && withinRadius);
-			//Ensure within the outside of the arc centre, but inside arc outer
-		},
-		tooltipPosition : function(){
-			var centreAngle = this.startAngle + ((this.endAngle - this.startAngle) / 2),
-				rangeFromCentre = (this.outerRadius - this.innerRadius) / 2 + this.innerRadius;
-			return {
-				x : this.x + (Math.cos(centreAngle) * rangeFromCentre),
-				y : this.y + (Math.sin(centreAngle) * rangeFromCentre)
-			};
-		},
-		draw : function(animationPercent){
-
-			var easingDecimal = animationPercent || 1;
-
-			var ctx = this.ctx;
-
-			ctx.beginPath();
-
-			ctx.arc(this.x, this.y, this.outerRadius < 0 ? 0 : this.outerRadius, this.startAngle, this.endAngle);
-
-            ctx.arc(this.x, this.y, this.innerRadius < 0 ? 0 : this.innerRadius, this.endAngle, this.startAngle, true);
-
-			ctx.closePath();
-			ctx.strokeStyle = this.strokeColor;
-			ctx.lineWidth = this.strokeWidth;
-
-			ctx.fillStyle = this.fillColor;
-
-			ctx.fill();
-			ctx.lineJoin = 'bevel';
-
-			if (this.showStroke){
-				ctx.stroke();
-			}
-		}
-	});
-
-	Chart.Rectangle = Chart.Element.extend({
-		draw : function(){
-			var ctx = this.ctx,
-				halfWidth = this.width/2,
-				leftX = this.x - halfWidth,
-				rightX = this.x + halfWidth,
-				top = this.base - (this.base - this.y),
-				halfStroke = this.strokeWidth / 2;
-
-			// Canvas doesn't allow us to stroke inside the width so we can
-			// adjust the sizes to fit if we're setting a stroke on the line
-			if (this.showStroke){
-				leftX += halfStroke;
-				rightX -= halfStroke;
-				top += halfStroke;
-			}
-
-			ctx.beginPath();
-
-			ctx.fillStyle = this.fillColor;
-			ctx.strokeStyle = this.strokeColor;
-			ctx.lineWidth = this.strokeWidth;
-
-			// It'd be nice to keep this class totally generic to any rectangle
-			// and simply specify which border to miss out.
-			ctx.moveTo(leftX, this.base);
-			ctx.lineTo(leftX, top);
-			ctx.lineTo(rightX, top);
-			ctx.lineTo(rightX, this.base);
-			ctx.fill();
-			if (this.showStroke){
-				ctx.stroke();
-			}
-		},
-		height : function(){
-			return this.base - this.y;
-		},
-		inRange : function(chartX,chartY){
-			return (chartX >= this.x - this.width/2 && chartX <= this.x + this.width/2) && (chartY >= this.y && chartY <= this.base);
-		}
-	});
-
-	Chart.Animation = Chart.Element.extend({
-		currentStep: null, // the current animation step
-		numSteps: 60, // default number of steps
-		easing: "", // the easing to use for this animation
-		render: null, // render function used by the animation service
-		
-		onAnimationProgress: null, // user specified callback to fire on each step of the animation 
-		onAnimationComplete: null, // user specified callback to fire when the animation finishes
-	});
-	
-	Chart.Tooltip = Chart.Element.extend({
-		draw : function(){
-
-			var ctx = this.chart.ctx;
-
-			ctx.font = fontString(this.fontSize,this.fontStyle,this.fontFamily);
-
-			this.xAlign = "center";
-			this.yAlign = "above";
-
-			//Distance between the actual element.y position and the start of the tooltip caret
-			var caretPadding = this.caretPadding = 2;
-
-			var tooltipWidth = ctx.measureText(this.text).width + 2*this.xPadding,
-				tooltipRectHeight = this.fontSize + 2*this.yPadding,
-				tooltipHeight = tooltipRectHeight + this.caretHeight + caretPadding;
-
-			if (this.x + tooltipWidth/2 >this.chart.width){
-				this.xAlign = "left";
-			} else if (this.x - tooltipWidth/2 < 0){
-				this.xAlign = "right";
-			}
-
-			if (this.y - tooltipHeight < 0){
-				this.yAlign = "below";
-			}
-
-
-			var tooltipX = this.x - tooltipWidth/2,
-				tooltipY = this.y - tooltipHeight;
-
-			ctx.fillStyle = this.fillColor;
-
-			// Custom Tooltips
-			if(this.custom){
-				this.custom(this);
-			}
-			else{
-				switch(this.yAlign)
-				{
-				case "above":
-					//Draw a caret above the x/y
-					ctx.beginPath();
-					ctx.moveTo(this.x,this.y - caretPadding);
-					ctx.lineTo(this.x + this.caretHeight, this.y - (caretPadding + this.caretHeight));
-					ctx.lineTo(this.x - this.caretHeight, this.y - (caretPadding + this.caretHeight));
-					ctx.closePath();
-					ctx.fill();
-					break;
-				case "below":
-					tooltipY = this.y + caretPadding + this.caretHeight;
-					//Draw a caret below the x/y
-					ctx.beginPath();
-					ctx.moveTo(this.x, this.y + caretPadding);
-					ctx.lineTo(this.x + this.caretHeight, this.y + caretPadding + this.caretHeight);
-					ctx.lineTo(this.x - this.caretHeight, this.y + caretPadding + this.caretHeight);
-					ctx.closePath();
-					ctx.fill();
-					break;
-				}
-
-				switch(this.xAlign)
-				{
-				case "left":
-					tooltipX = this.x - tooltipWidth + (this.cornerRadius + this.caretHeight);
-					break;
-				case "right":
-					tooltipX = this.x - (this.cornerRadius + this.caretHeight);
-					break;
-				}
-
-				drawRoundedRectangle(ctx,tooltipX,tooltipY,tooltipWidth,tooltipRectHeight,this.cornerRadius);
-
-				ctx.fill();
-
-				ctx.fillStyle = this.textColor;
-				ctx.textAlign = "center";
-				ctx.textBaseline = "middle";
-				ctx.fillText(this.text, tooltipX + tooltipWidth/2, tooltipY + tooltipRectHeight/2);
-			}
-		}
-	});
-
-	Chart.MultiTooltip = Chart.Element.extend({
-		initialize : function(){
-			this.font = fontString(this.fontSize,this.fontStyle,this.fontFamily);
-
-			this.titleFont = fontString(this.titleFontSize,this.titleFontStyle,this.titleFontFamily);
-
-			this.titleHeight = this.title ? this.titleFontSize * 1.5 : 0;
-			this.height = (this.labels.length * this.fontSize) + ((this.labels.length-1) * (this.fontSize/2)) + (this.yPadding*2) + this.titleHeight;
-
-			this.ctx.font = this.titleFont;
-
-			var titleWidth = this.ctx.measureText(this.title).width,
-				//Label has a legend square as well so account for this.
-				labelWidth = longestText(this.ctx,this.font,this.labels) + this.fontSize + 3,
-				longestTextWidth = max([labelWidth,titleWidth]);
-
-			this.width = longestTextWidth + (this.xPadding*2);
-
-
-			var halfHeight = this.height/2;
-
-			//Check to ensure the height will fit on the canvas
-			if (this.y - halfHeight < 0 ){
-				this.y = halfHeight;
-			} else if (this.y + halfHeight > this.chart.height){
-				this.y = this.chart.height - halfHeight;
-			}
-
-			//Decide whether to align left or right based on position on canvas
-			if (this.x > this.chart.width/2){
-				this.x -= this.xOffset + this.width;
-			} else {
-				this.x += this.xOffset;
-			}
-
-
-		},
-		getLineHeight : function(index){
-			var baseLineHeight = this.y - (this.height/2) + this.yPadding,
-				afterTitleIndex = index-1;
-
-			//If the index is zero, we're getting the title
-			if (index === 0){
-				return baseLineHeight + this.titleHeight / 3;
-			} else{
-				return baseLineHeight + ((this.fontSize * 1.5 * afterTitleIndex) + this.fontSize / 2) + this.titleHeight;
-			}
-
-		},
-		draw : function(){
-			// Custom Tooltips
-			if(this.custom){
-				this.custom(this);
-			}
-			else{
-				drawRoundedRectangle(this.ctx,this.x,this.y - this.height/2,this.width,this.height,this.cornerRadius);
-				var ctx = this.ctx;
-				ctx.fillStyle = this.fillColor;
-				ctx.fill();
-				ctx.closePath();
-
-				ctx.textAlign = "left";
-				ctx.textBaseline = "middle";
-				ctx.fillStyle = this.titleTextColor;
-				ctx.font = this.titleFont;
-
-				ctx.fillText(this.title,this.x + this.xPadding, this.getLineHeight(0));
-
-				ctx.font = this.font;
-				helpers.each(this.labels,function(label,index){
-					ctx.fillStyle = this.textColor;
-					ctx.fillText(label,this.x + this.xPadding + this.fontSize + 3, this.getLineHeight(index + 1));
-
-					//A bit gnarly, but clearing this rectangle breaks when using explorercanvas (clears whole canvas)
-					//ctx.clearRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);
-					//Instead we'll make a white filled block to put the legendColour palette over.
-
-					ctx.fillStyle = this.legendColorBackground;
-					ctx.fillRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);
-
-					ctx.fillStyle = this.legendColors[index].fill;
-					ctx.fillRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);
-
-
-				},this);
-			}
-		}
-	});
-
-	Chart.Scale = Chart.Element.extend({
-		initialize : function(){
-			this.fit();
-		},
-		buildYLabels : function(){
-			this.yLabels = [];
-
-			var stepDecimalPlaces = getDecimalPlaces(this.stepValue);
-
-			for (var i=0; i<=this.steps; i++){
-				this.yLabels.push(template(this.templateString,{value:(this.min + (i * this.stepValue)).toFixed(stepDecimalPlaces)}));
-			}
-			this.yLabelWidth = (this.display && this.showLabels) ? longestText(this.ctx,this.font,this.yLabels) + 10 : 0;
-		},
-		addXLabel : function(label){
-			this.xLabels.push(label);
-			this.valuesCount++;
-			this.fit();
-		},
-		removeXLabel : function(){
-			this.xLabels.shift();
-			this.valuesCount--;
-			this.fit();
-		},
-		// Fitting loop to rotate x Labels and figure out what fits there, and also calculate how many Y steps to use
-		fit: function(){
-			// First we need the width of the yLabels, assuming the xLabels aren't rotated
-
-			// To do that we need the base line at the top and base of the chart, assuming there is no x label rotation
-			this.startPoint = (this.display) ? this.fontSize : 0;
-			this.endPoint = (this.display) ? this.height - (this.fontSize * 1.5) - 5 : this.height; // -5 to pad labels
-
-			// Apply padding settings to the start and end point.
-			this.startPoint += this.padding;
-			this.endPoint -= this.padding;
-
-			// Cache the starting endpoint, excluding the space for x labels
-			var cachedEndPoint = this.endPoint;
-
-			// Cache the starting height, so can determine if we need to recalculate the scale yAxis
-			var cachedHeight = this.endPoint - this.startPoint,
-				cachedYLabelWidth;
-
-			// Build the current yLabels so we have an idea of what size they'll be to start
-			/*
-			 *	This sets what is returned from calculateScaleRange as static properties of this class:
-			 *
-				this.steps;
-				this.stepValue;
-				this.min;
-				this.max;
-			 *
-			 */
-			this.calculateYRange(cachedHeight);
-
-			// With these properties set we can now build the array of yLabels
-			// and also the width of the largest yLabel
-			this.buildYLabels();
-
-			this.calculateXLabelRotation();
-
-			while((cachedHeight > this.endPoint - this.startPoint)){
-				cachedHeight = this.endPoint - this.startPoint;
-				cachedYLabelWidth = this.yLabelWidth;
-
-				this.calculateYRange(cachedHeight);
-				this.buildYLabels();
-
-				// Only go through the xLabel loop again if the yLabel width has changed
-				if (cachedYLabelWidth < this.yLabelWidth){
-					this.endPoint = cachedEndPoint;
-					this.calculateXLabelRotation();
-				}
-			}
-
-		},
-		calculateXLabelRotation : function(){
-			//Get the width of each grid by calculating the difference
-			//between x offsets between 0 and 1.
-
-			this.ctx.font = this.font;
-
-			var firstWidth = this.ctx.measureText(this.xLabels[0]).width,
-				lastWidth = this.ctx.measureText(this.xLabels[this.xLabels.length - 1]).width,
-				firstRotated,
-				lastRotated;
-
-
-			this.xScalePaddingRight = lastWidth/2 + 3;
-			this.xScalePaddingLeft = (firstWidth/2 > this.yLabelWidth) ? firstWidth/2 : this.yLabelWidth;
-
-			this.xLabelRotation = 0;
-			if (this.display){
-				var originalLabelWidth = longestText(this.ctx,this.font,this.xLabels),
-					cosRotation,
-					firstRotatedWidth;
-				this.xLabelWidth = originalLabelWidth;
-				//Allow 3 pixels x2 padding either side for label readability
-				var xGridWidth = Math.floor(this.calculateX(1) - this.calculateX(0)) - 6;
-
-				//Max label rotate should be 90 - also act as a loop counter
-				while ((this.xLabelWidth > xGridWidth && this.xLabelRotation === 0) || (this.xLabelWidth > xGridWidth && this.xLabelRotation <= 90 && this.xLabelRotation > 0)){
-					cosRotation = Math.cos(toRadians(this.xLabelRotation));
-
-					firstRotated = cosRotation * firstWidth;
-					lastRotated = cosRotation * lastWidth;
-
-					// We're right aligning the text now.
-					if (firstRotated + this.fontSize / 2 > this.yLabelWidth){
-						this.xScalePaddingLeft = firstRotated + this.fontSize / 2;
-					}
-					this.xScalePaddingRight = this.fontSize/2;
-
-
-					this.xLabelRotation++;
-					this.xLabelWidth = cosRotation * originalLabelWidth;
-
-				}
-				if (this.xLabelRotation > 0){
-					this.endPoint -= Math.sin(toRadians(this.xLabelRotation))*originalLabelWidth + 3;
-				}
-			}
-			else{
-				this.xLabelWidth = 0;
-				this.xScalePaddingRight = this.padding;
-				this.xScalePaddingLeft = this.padding;
-			}
-
-		},
-		// Needs to be overidden in each Chart type
-		// Otherwise we need to pass all the data into the scale class
-		calculateYRange: noop,
-		drawingArea: function(){
-			return this.startPoint - this.endPoint;
-		},
-		calculateY : function(value){
-			var scalingFactor = this.drawingArea() / (this.min - this.max);
-			return this.endPoint - (scalingFactor * (value - this.min));
-		},
-		calculateX : function(index){
-			var isRotated = (this.xLabelRotation > 0),
-				// innerWidth = (this.offsetGridLines) ? this.width - offsetLeft - this.padding : this.width - (offsetLeft + halfLabelWidth * 2) - this.padding,
-				innerWidth = this.width - (this.xScalePaddingLeft + this.xScalePaddingRight),
-				valueWidth = innerWidth/Math.max((this.valuesCount - ((this.offsetGridLines) ? 0 : 1)), 1),
-				valueOffset = (valueWidth * index) + this.xScalePaddingLeft;
-
-			if (this.offsetGridLines){
-				valueOffset += (valueWidth/2);
-			}
-
-			return Math.round(valueOffset);
-		},
-		update : function(newProps){
-			helpers.extend(this, newProps);
-			this.fit();
-		},
-		draw : function(){
-			var ctx = this.ctx,
-				yLabelGap = (this.endPoint - this.startPoint) / this.steps,
-				xStart = Math.round(this.xScalePaddingLeft);
-			if (this.display){
-				ctx.fillStyle = this.textColor;
-				ctx.font = this.font;
-				each(this.yLabels,function(labelString,index){
-					var yLabelCenter = this.endPoint - (yLabelGap * index),
-						linePositionY = Math.round(yLabelCenter),
-						drawHorizontalLine = this.showHorizontalLines;
-
-					ctx.textAlign = "right";
-					ctx.textBaseline = "middle";
-					if (this.showLabels){
-						ctx.fillText(labelString,xStart - 10,yLabelCenter);
-					}
-
-					// This is X axis, so draw it
-					if (index === 0 && !drawHorizontalLine){
-						drawHorizontalLine = true;
-					}
-
-					if (drawHorizontalLine){
-						ctx.beginPath();
-					}
-
-					if (index > 0){
-						// This is a grid line in the centre, so drop that
-						ctx.lineWidth = this.gridLineWidth;
-						ctx.strokeStyle = this.gridLineColor;
-					} else {
-						// This is the first line on the scale
-						ctx.lineWidth = this.lineWidth;
-						ctx.strokeStyle = this.lineColor;
-					}
-
-					linePositionY += helpers.aliasPixel(ctx.lineWidth);
-
-					if(drawHorizontalLine){
-						ctx.moveTo(xStart, linePositionY);
-						ctx.lineTo(this.width, linePositionY);
-						ctx.stroke();
-						ctx.closePath();
-					}
-
-					ctx.lineWidth = this.lineWidth;
-					ctx.strokeStyle = this.lineColor;
-					ctx.beginPath();
-					ctx.moveTo(xStart - 5, linePositionY);
-					ctx.lineTo(xStart, linePositionY);
-					ctx.stroke();
-					ctx.closePath();
-
-				},this);
-
-				each(this.xLabels,function(label,index){
-					var xPos = this.calculateX(index) + aliasPixel(this.lineWidth),
-						// Check to see if line/bar here and decide where to place the line
-						linePos = this.calculateX(index - (this.offsetGridLines ? 0.5 : 0)) + aliasPixel(this.lineWidth),
-						isRotated = (this.xLabelRotation > 0),
-						drawVerticalLine = this.showVerticalLines;
-
-					// This is Y axis, so draw it
-					if (index === 0 && !drawVerticalLine){
-						drawVerticalLine = true;
-					}
-
-					if (drawVerticalLine){
-						ctx.beginPath();
-					}
-
-					if (index > 0){
-						// This is a grid line in the centre, so drop that
-						ctx.lineWidth = this.gridLineWidth;
-						ctx.strokeStyle = this.gridLineColor;
-					} else {
-						// This is the first line on the scale
-						ctx.lineWidth = this.lineWidth;
-						ctx.strokeStyle = this.lineColor;
-					}
-
-					if (drawVerticalLine){
-						ctx.moveTo(linePos,this.endPoint);
-						ctx.lineTo(linePos,this.startPoint - 3);
-						ctx.stroke();
-						ctx.closePath();
-					}
-
-
-					ctx.lineWidth = this.lineWidth;
-					ctx.strokeStyle = this.lineColor;
-
-
-					// Small lines at the bottom of the base grid line
-					ctx.beginPath();
-					ctx.moveTo(linePos,this.endPoint);
-					ctx.lineTo(linePos,this.endPoint + 5);
-					ctx.stroke();
-					ctx.closePath();
-
-					ctx.save();
-					ctx.translate(xPos,(isRotated) ? this.endPoint + 12 : this.endPoint + 8);
-					ctx.rotate(toRadians(this.xLabelRotation)*-1);
-					ctx.font = this.font;
-					ctx.textAlign = (isRotated) ? "right" : "center";
-					ctx.textBaseline = (isRotated) ? "middle" : "top";
-					ctx.fillText(label, 0, 0);
-					ctx.restore();
-				},this);
-
-			}
-		}
-
-	});
-
-	Chart.RadialScale = Chart.Element.extend({
-		initialize: function(){
-			this.size = min([this.height, this.width]);
-			this.drawingArea = (this.display) ? (this.size/2) - (this.fontSize/2 + this.backdropPaddingY) : (this.size/2);
-		},
-		calculateCenterOffset: function(value){
-			// Take into account half font size + the yPadding of the top value
-			var scalingFactor = this.drawingArea / (this.max - this.min);
-
-			return (value - this.min) * scalingFactor;
-		},
-		update : function(){
-			if (!this.lineArc){
-				this.setScaleSize();
-			} else {
-				this.drawingArea = (this.display) ? (this.size/2) - (this.fontSize/2 + this.backdropPaddingY) : (this.size/2);
-			}
-			this.buildYLabels();
-		},
-		buildYLabels: function(){
-			this.yLabels = [];
-
-			var stepDecimalPlaces = getDecimalPlaces(this.stepValue);
-
-			for (var i=0; i<=this.steps; i++){
-				this.yLabels.push(template(this.templateString,{value:(this.min + (i * this.stepValue)).toFixed(stepDecimalPlaces)}));
-			}
-		},
-		getCircumference : function(){
-			return ((Math.PI*2) / this.valuesCount);
-		},
-		setScaleSize: function(){
-			/*
-			 * Right, this is really confusing and there is a lot of maths going on here
-			 * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9
-			 *
-			 * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif
-			 *
-			 * Solution:
-			 *
-			 * We assume the radius of the polygon is half the size of the canvas at first
-			 * at each index we check if the text overlaps.
-			 *
-			 * Where it does, we store that angle and that index.
-			 *
-			 * After finding the largest index and angle we calculate how much we need to remove
-			 * from the shape radius to move the point inwards by that x.
-			 *
-			 * We average the left and right distances to get the maximum shape radius that can fit in the box
-			 * along with labels.
-			 *
-			 * Once we have that, we can find the centre point for the chart, by taking the x text protrusion
-			 * on each side, removing that from the size, halving it and adding the left x protrusion width.
-			 *
-			 * This will mean we have a shape fitted to the canvas, as large as it can be with the labels
-			 * and position it in the most space efficient manner
-			 *
-			 * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif
-			 */
-
-
-			// Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.
-			// Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points
-			var largestPossibleRadius = min([(this.height/2 - this.pointLabelFontSize - 5), this.width/2]),
-				pointPosition,
-				i,
-				textWidth,
-				halfTextWidth,
-				furthestRight = this.width,
-				furthestRightIndex,
-				furthestRightAngle,
-				furthestLeft = 0,
-				furthestLeftIndex,
-				furthestLeftAngle,
-				xProtrusionLeft,
-				xProtrusionRight,
-				radiusReductionRight,
-				radiusReductionLeft,
-				maxWidthRadius;
-			this.ctx.font = fontString(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily);
-			for (i=0;i<this.valuesCount;i++){
-				// 5px to space the text slightly out - similar to what we do in the draw function.
-				pointPosition = this.getPointPosition(i, largestPossibleRadius);
-				textWidth = this.ctx.measureText(template(this.templateString, { value: this.labels[i] })).width + 5;
-				if (i === 0 || i === this.valuesCount/2){
-					// If we're at index zero, or exactly the middle, we're at exactly the top/bottom
-					// of the radar chart, so text will be aligned centrally, so we'll half it and compare
-					// w/left and right text sizes
-					halfTextWidth = textWidth/2;
-					if (pointPosition.x + halfTextWidth > furthestRight) {
-						furthestRight = pointPosition.x + halfTextWidth;
-						furthestRightIndex = i;
-					}
-					if (pointPosition.x - halfTextWidth < furthestLeft) {
-						furthestLeft = pointPosition.x - halfTextWidth;
-						furthestLeftIndex = i;
-					}
-				}
-				else if (i < this.valuesCount/2) {
-					// Less than half the values means we'll left align the text
-					if (pointPosition.x + textWidth > furthestRight) {
-						furthestRight = pointPosition.x + textWidth;
-						furthestRightIndex = i;
-					}
-				}
-				else if (i > this.valuesCount/2){
-					// More than half the values means we'll right align the text
-					if (pointPosition.x - textWidth < furthestLeft) {
-						furthestLeft = pointPosition.x - textWidth;
-						furthestLeftIndex = i;
-					}
-				}
-			}
-
-			xProtrusionLeft = furthestLeft;
-
-			xProtrusionRight = Math.ceil(furthestRight - this.width);
-
-			furthestRightAngle = this.getIndexAngle(furthestRightIndex);
-
-			furthestLeftAngle = this.getIndexAngle(furthestLeftIndex);
-
-			radiusReductionRight = xProtrusionRight / Math.sin(furthestRightAngle + Math.PI/2);
-
-			radiusReductionLeft = xProtrusionLeft / Math.sin(furthestLeftAngle + Math.PI/2);
-
-			// Ensure we actually need to reduce the size of the chart
-			radiusReductionRight = (isNumber(radiusReductionRight)) ? radiusReductionRight : 0;
-			radiusReductionLeft = (isNumber(radiusReductionLeft)) ? radiusReductionLeft : 0;
-
-			this.drawingArea = largestPossibleRadius - (radiusReductionLeft + radiusReductionRight)/2;
-
-			//this.drawingArea = min([maxWidthRadius, (this.height - (2 * (this.pointLabelFontSize + 5)))/2])
-			this.setCenterPoint(radiusReductionLeft, radiusReductionRight);
-
-		},
-		setCenterPoint: function(leftMovement, rightMovement){
-
-			var maxRight = this.width - rightMovement - this.drawingArea,
-				maxLeft = leftMovement + this.drawingArea;
-
-			this.xCenter = (maxLeft + maxRight)/2;
-			// Always vertically in the centre as the text height doesn't change
-			this.yCenter = (this.height/2);
-		},
-
-		getIndexAngle : function(index){
-			var angleMultiplier = (Math.PI * 2) / this.valuesCount;
-			// Start from the top instead of right, so remove a quarter of the circle
-
-			return index * angleMultiplier - (Math.PI/2);
-		},
-		getPointPosition : function(index, distanceFromCenter){
-			var thisAngle = this.getIndexAngle(index);
-			return {
-				x : (Math.cos(thisAngle) * distanceFromCenter) + this.xCenter,
-				y : (Math.sin(thisAngle) * distanceFromCenter) + this.yCenter
-			};
-		},
-		draw: function(){
-			if (this.display){
-				var ctx = this.ctx;
-				each(this.yLabels, function(label, index){
-					// Don't draw a centre value
-					if (index > 0){
-						var yCenterOffset = index * (this.drawingArea/this.steps),
-							yHeight = this.yCenter - yCenterOffset,
-							pointPosition;
-
-						// Draw circular lines around the scale
-						if (this.lineWidth > 0){
-							ctx.strokeStyle = this.lineColor;
-							ctx.lineWidth = this.lineWidth;
-
-							if(this.lineArc){
-								ctx.beginPath();
-								ctx.arc(this.xCenter, this.yCenter, yCenterOffset, 0, Math.PI*2);
-								ctx.closePath();
-								ctx.stroke();
-							} else{
-								ctx.beginPath();
-								for (var i=0;i<this.valuesCount;i++)
-								{
-									pointPosition = this.getPointPosition(i, this.calculateCenterOffset(this.min + (index * this.stepValue)));
-									if (i === 0){
-										ctx.moveTo(pointPosition.x, pointPosition.y);
-									} else {
-										ctx.lineTo(pointPosition.x, pointPosition.y);
-									}
-								}
-								ctx.closePath();
-								ctx.stroke();
-							}
-						}
-						if(this.showLabels){
-							ctx.font = fontString(this.fontSize,this.fontStyle,this.fontFamily);
-							if (this.showLabelBackdrop){
-								var labelWidth = ctx.measureText(label).width;
-								ctx.fillStyle = this.backdropColor;
-								ctx.fillRect(
-									this.xCenter - labelWidth/2 - this.backdropPaddingX,
-									yHeight - this.fontSize/2 - this.backdropPaddingY,
-									labelWidth + this.backdropPaddingX*2,
-									this.fontSize + this.backdropPaddingY*2
-								);
-							}
-							ctx.textAlign = 'center';
-							ctx.textBaseline = "middle";
-							ctx.fillStyle = this.fontColor;
-							ctx.fillText(label, this.xCenter, yHeight);
-						}
-					}
-				}, this);
-
-				if (!this.lineArc){
-					ctx.lineWidth = this.angleLineWidth;
-					ctx.strokeStyle = this.angleLineColor;
-					for (var i = this.valuesCount - 1; i >= 0; i--) {
-						var centerOffset = null, outerPosition = null;
-
-						if (this.angleLineWidth > 0 && (i % this.angleLineInterval === 0)){
-							centerOffset = this.calculateCenterOffset(this.max);
-							outerPosition = this.getPointPosition(i, centerOffset);
-							ctx.beginPath();
-							ctx.moveTo(this.xCenter, this.yCenter);
-							ctx.lineTo(outerPosition.x, outerPosition.y);
-							ctx.stroke();
-							ctx.closePath();
-						}
-
-						if (this.backgroundColors && this.backgroundColors.length == this.valuesCount) {
-							if (centerOffset == null)
-								centerOffset = this.calculateCenterOffset(this.max);
-
-							if (outerPosition == null)
-								outerPosition = this.getPointPosition(i, centerOffset);
-
-							var previousOuterPosition = this.getPointPosition(i === 0 ? this.valuesCount - 1 : i - 1, centerOffset);
-							var nextOuterPosition = this.getPointPosition(i === this.valuesCount - 1 ? 0 : i + 1, centerOffset);
-
-							var previousOuterHalfway = { x: (previousOuterPosition.x + outerPosition.x) / 2, y: (previousOuterPosition.y + outerPosition.y) / 2 };
-							var nextOuterHalfway = { x: (outerPosition.x + nextOuterPosition.x) / 2, y: (outerPosition.y + nextOuterPosition.y) / 2 };
-
-							ctx.beginPath();
-							ctx.moveTo(this.xCenter, this.yCenter);
-							ctx.lineTo(previousOuterHalfway.x, previousOuterHalfway.y);
-							ctx.lineTo(outerPosition.x, outerPosition.y);
-							ctx.lineTo(nextOuterHalfway.x, nextOuterHalfway.y);
-							ctx.fillStyle = this.backgroundColors[i];
-							ctx.fill();
-							ctx.closePath();
-						}
-						// Extra 3px out for some label spacing
-						var pointLabelPosition = this.getPointPosition(i, this.calculateCenterOffset(this.max) + 5);
-						ctx.font = fontString(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily);
-						ctx.fillStyle = this.pointLabelFontColor;
-
-						var labelsCount = this.labels.length,
-							halfLabelsCount = this.labels.length/2,
-							quarterLabelsCount = halfLabelsCount/2,
-							upperHalf = (i < quarterLabelsCount || i > labelsCount - quarterLabelsCount),
-							exactQuarter = (i === quarterLabelsCount || i === labelsCount - quarterLabelsCount);
-						if (i === 0){
-							ctx.textAlign = 'center';
-						} else if(i === halfLabelsCount){
-							ctx.textAlign = 'center';
-						} else if (i < halfLabelsCount){
-							ctx.textAlign = 'left';
-						} else {
-							ctx.textAlign = 'right';
-						}
-
-						// Set the correct text baseline based on outer positioning
-						if (exactQuarter){
-							ctx.textBaseline = 'middle';
-						} else if (upperHalf){
-							ctx.textBaseline = 'bottom';
-						} else {
-							ctx.textBaseline = 'top';
-						}
-
-						ctx.fillText(this.labels[i], pointLabelPosition.x, pointLabelPosition.y);
-					}
-				}
-			}
-		}
-	});
-
-	Chart.animationService = {
-		frameDuration: 17,
-		animations: [],
-		dropFrames: 0,
-		addAnimation: function(chartInstance, animationObject) {
-			for (var index = 0; index < this.animations.length; ++ index){
-				if (this.animations[index].chartInstance === chartInstance){
-					// replacing an in progress animation
-					this.animations[index].animationObject = animationObject;
-					return;
-				}
-			}
-			
-			this.animations.push({
-				chartInstance: chartInstance,
-				animationObject: animationObject
-			});
-
-			// If there are no animations queued, manually kickstart a digest, for lack of a better word
-			if (this.animations.length == 1) {
-				helpers.requestAnimFrame.call(window, this.digestWrapper);
-			}
-		},
-		// Cancel the animation for a given chart instance
-		cancelAnimation: function(chartInstance) {
-			var index = helpers.findNextWhere(this.animations, function(animationWrapper) {
-				return animationWrapper.chartInstance === chartInstance;
-			});
-			
-			if (index)
-			{
-				this.animations.splice(index, 1);
-			}
-		},
-		// calls startDigest with the proper context
-		digestWrapper: function() {
-			Chart.animationService.startDigest.call(Chart.animationService);
-		},
-		startDigest: function() {
-
-			var startTime = Date.now();
-			var framesToDrop = 0;
-
-			if(this.dropFrames > 1){
-				framesToDrop = Math.floor(this.dropFrames);
-				this.dropFrames -= framesToDrop;
-			}
-
-			for (var i = 0; i < this.animations.length; i++) {
-
-				if (this.animations[i].animationObject.currentStep === null){
-					this.animations[i].animationObject.currentStep = 0;
-				}
-
-				this.animations[i].animationObject.currentStep += 1 + framesToDrop;
-				if(this.animations[i].animationObject.currentStep > this.animations[i].animationObject.numSteps){
-					this.animations[i].animationObject.currentStep = this.animations[i].animationObject.numSteps;
-				}
-				
-				this.animations[i].animationObject.render(this.animations[i].chartInstance, this.animations[i].animationObject);
-				
-				// Check if executed the last frame.
-				if (this.animations[i].animationObject.currentStep == this.animations[i].animationObject.numSteps){
-					// Call onAnimationComplete
-					this.animations[i].animationObject.onAnimationComplete.call(this.animations[i].chartInstance);
-					// Remove the animation.
-					this.animations.splice(i, 1);
-					// Keep the index in place to offset the splice
-					i--;
-				}
-			}
-
-			var endTime = Date.now();
-			var delay = endTime - startTime - this.frameDuration;
-			var frameDelay = delay / this.frameDuration;
-
-			if(frameDelay > 1){
-				this.dropFrames += frameDelay;
-			}
-
-			// Do we have more stuff to animate?
-			if (this.animations.length > 0){
-				helpers.requestAnimFrame.call(window, this.digestWrapper);
-			}
-		}
-	};
-
-	// Attach global event to resize each chart instance when the browser resizes
-	helpers.addEvent(window, "resize", (function(){
-		// Basic debounce of resize function so it doesn't hurt performance when resizing browser.
-		var timeout;
-		return function(){
-			clearTimeout(timeout);
-			timeout = setTimeout(function(){
-				each(Chart.instances,function(instance){
-					// If the responsive flag is set in the chart instance config
-					// Cascade the resize event down to the chart.
-					if (instance.options.responsive){
-						instance.resize(instance.render, true);
-					}
-				});
-			}, 50);
-		};
-	})());
-
-
-	if (amd) {
-		define('Chart', [], function(){
-			return Chart;
-		});
-	} else if (typeof module === 'object' && module.exports) {
-		module.exports = Chart;
-	}
-
-	root.Chart = Chart;
-
-	Chart.noConflict = function(){
-		root.Chart = previous;
-		return Chart;
-	};
-
-}).call(this);
-
-(function(){
-	"use strict";
-
-	var root = this,
-		Chart = root.Chart,
-		helpers = Chart.helpers;
-
-
-	var defaultConfig = {
-		//Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
-		scaleBeginAtZero : true,
-
-		//Boolean - Whether grid lines are shown across the chart
-		scaleShowGridLines : true,
-
-		//String - Colour of the grid lines
-		scaleGridLineColor : "rgba(0,0,0,.05)",
-
-		//Number - Width of the grid lines
-		scaleGridLineWidth : 1,
-
-		//Boolean - Whether to show horizontal lines (except X axis)
-		scaleShowHorizontalLines: true,
-
-		//Boolean - Whether to show vertical lines (except Y axis)
-		scaleShowVerticalLines: true,
-
-		//Boolean - If there is a stroke on each bar
-		barShowStroke : true,
-
-		//Number - Pixel width of the bar stroke
-		barStrokeWidth : 2,
-
-		//Number - Spacing between each of the X value sets
-		barValueSpacing : 5,
-
-		//Number - Spacing between data sets within X values
-		barDatasetSpacing : 1,
-
-		//String - A legend template
-		legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span class=\"<%=name.toLowerCase()%>-legend-icon\" style=\"background-color:<%=datasets[i].fillColor%>\"></span><span class=\"<%=name.toLowerCase()%>-legend-text\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%></span></li><%}%></ul>"
-
-	};
-
-
-	Chart.Type.extend({
-		name: "Bar",
-		defaults : defaultConfig,
-		initialize:  function(data){
-
-			//Expose options as a scope variable here so we can access it in the ScaleClass
-			var options = this.options;
-
-			this.ScaleClass = Chart.Scale.extend({
-				offsetGridLines : true,
-				calculateBarX : function(datasetCount, datasetIndex, barIndex){
-					//Reusable method for calculating the xPosition of a given bar based on datasetIndex & width of the bar
-					var xWidth = this.calculateBaseWidth(),
-						xAbsolute = this.calculateX(barIndex) - (xWidth/2),
-						barWidth = this.calculateBarWidth(datasetCount);
-
-					return xAbsolute + (barWidth * datasetIndex) + (datasetIndex * options.barDatasetSpacing) + barWidth/2;
-				},
-				calculateBaseWidth : function(){
-					return (this.calculateX(1) - this.calculateX(0)) - (2*options.barValueSpacing);
-				},
-				calculateBarWidth : function(datasetCount){
-					//The padding between datasets is to the right of each bar, providing that there are more than 1 dataset
-					var baseWidth = this.calculateBaseWidth() - ((datasetCount - 1) * options.barDatasetSpacing);
-
-					return (baseWidth / datasetCount);
-				}
-			});
-
-			this.datasets = [];
-
-			//Set up tooltip events on the chart
-			if (this.options.showTooltips){
-				helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
-					var activeBars = (evt.type !== 'mouseout') ? this.getBarsAtEvent(evt) : [];
-
-					this.eachBars(function(bar){
-						bar.restore(['fillColor', 'strokeColor']);
-					});
-					helpers.each(activeBars, function(activeBar){
-						if (activeBar) {
-							activeBar.fillColor = activeBar.highlightFill;
-							activeBar.strokeColor = activeBar.highlightStroke;
-						}
-					});
-					this.showTooltip(activeBars);
-				});
-			}
-
-			//Declare the extension of the default point, to cater for the options passed in to the constructor
-			this.BarClass = Chart.Rectangle.extend({
-				strokeWidth : this.options.barStrokeWidth,
-				showStroke : this.options.barShowStroke,
-				ctx : this.chart.ctx
-			});
-
-			//Iterate through each of the datasets, and build this into a property of the chart
-			helpers.each(data.datasets,function(dataset,datasetIndex){
-
-				var datasetObject = {
-					label : dataset.label || null,
-					fillColor : dataset.fillColor,
-					strokeColor : dataset.strokeColor,
-					bars : []
-				};
-
-				this.datasets.push(datasetObject);
-
-				helpers.each(dataset.data,function(dataPoint,index){
-					//Add a new point for each piece of data, passing any required data to draw.
-					datasetObject.bars.push(new this.BarClass({
-						value : dataPoint,
-						label : data.labels[index],
-						datasetLabel: dataset.label,
-						strokeColor : (typeof dataset.strokeColor == 'object') ? dataset.strokeColor[index] : dataset.strokeColor,
-						fillColor : (typeof dataset.fillColor == 'object') ? dataset.fillColor[index] : dataset.fillColor,
-						highlightFill : (dataset.highlightFill) ? (typeof dataset.highlightFill == 'object') ? dataset.highlightFill[index] : dataset.highlightFill : (typeof dataset.fillColor == 'object') ? dataset.fillColor[index] : dataset.fillColor,
-						highlightStroke : (dataset.highlightStroke) ? (typeof dataset.highlightStroke == 'object') ? dataset.highlightStroke[index] : dataset.highlightStroke : (typeof dataset.strokeColor == 'object') ? dataset.strokeColor[index] : dataset.strokeColor
-					}));
-				},this);
-
-			},this);
-
-			this.buildScale(data.labels);
-
-			this.BarClass.prototype.base = this.scale.endPoint;
-
-			this.eachBars(function(bar, index, datasetIndex){
-				helpers.extend(bar, {
-					width : this.scale.calculateBarWidth(this.datasets.length),
-					x: this.scale.calculateBarX(this.datasets.length, datasetIndex, index),
-					y: this.scale.endPoint
-				});
-				bar.save();
-			}, this);
-
-			this.render();
-		},
-		update : function(){
-			this.scale.update();
-			// Reset any highlight colours before updating.
-			helpers.each(this.activeElements, function(activeElement){
-				activeElement.restore(['fillColor', 'strokeColor']);
-			});
-
-			this.eachBars(function(bar){
-				bar.save();
-			});
-			this.render();
-		},
-		eachBars : function(callback){
-			helpers.each(this.datasets,function(dataset, datasetIndex){
-				helpers.each(dataset.bars, callback, this, datasetIndex);
-			},this);
-		},
-		getBarsAtEvent : function(e){
-			var barsArray = [],
-				eventPosition = helpers.getRelativePosition(e),
-				datasetIterator = function(dataset){
-					barsArray.push(dataset.bars[barIndex]);
-				},
-				barIndex;
-
-			for (var datasetIndex = 0; datasetIndex < this.datasets.length; datasetIndex++) {
-				for (barIndex = 0; barIndex < this.datasets[datasetIndex].bars.length; barIndex++) {
-					if (this.datasets[datasetIndex].bars[barIndex].inRange(eventPosition.x,eventPosition.y)){
-						helpers.each(this.datasets, datasetIterator);
-						return barsArray;
-					}
-				}
-			}
-
-			return barsArray;
-		},
-		buildScale : function(labels){
-			var self = this;
-
-			var dataTotal = function(){
-				var values = [];
-				self.eachBars(function(bar){
-					values.push(bar.value);
-				});
-				return values;
-			};
-
-			var scaleOptions = {
-				templateString : this.options.scaleLabel,
-				height : this.chart.height,
-				width : this.chart.width,
-				ctx : this.chart.ctx,
-				textColor : this.options.scaleFontColor,
-				fontSize : this.options.scaleFontSize,
-				fontStyle : this.options.scaleFontStyle,
-				fontFamily : this.options.scaleFontFamily,
-				valuesCount : labels.length,
-				beginAtZero : this.options.scaleBeginAtZero,
-				integersOnly : this.options.scaleIntegersOnly,
-				calculateYRange: function(currentHeight){
-					var updatedRanges = helpers.calculateScaleRange(
-						dataTotal(),
-						currentHeight,
-						this.fontSize,
-						this.beginAtZero,
-						this.integersOnly
-					);
-					helpers.extend(this, updatedRanges);
-				},
-				xLabels : labels,
-				font : helpers.fontString(this.options.scaleFontSize, this.options.scaleFontStyle, this.options.scaleFontFamily),
-				lineWidth : this.options.scaleLineWidth,
-				lineColor : this.options.scaleLineColor,
-				showHorizontalLines : this.options.scaleShowHorizontalLines,
-				showVerticalLines : this.options.scaleShowVerticalLines,
-				gridLineWidth : (this.options.scaleShowGridLines) ? this.options.scaleGridLineWidth : 0,
-				gridLineColor : (this.options.scaleShowGridLines) ? this.options.scaleGridLineColor : "rgba(0,0,0,0)",
-				padding : (this.options.showScale) ? 0 : (this.options.barShowStroke) ? this.options.barStrokeWidth : 0,
-				showLabels : this.options.scaleShowLabels,
-				display : this.options.showScale
-			};
-
-			if (this.options.scaleOverride){
-				helpers.extend(scaleOptions, {
-					calculateYRange: helpers.noop,
-					steps: this.options.scaleSteps,
-					stepValue: this.options.scaleStepWidth,
-					min: this.options.scaleStartValue,
-					max: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)
-				});
-			}
-
-			this.scale = new this.ScaleClass(scaleOptions);
-		},
-		addData : function(valuesArray,label){
-			//Map the values array for each of the datasets
-			helpers.each(valuesArray,function(value,datasetIndex){
-				//Add a new point for each piece of data, passing any required data to draw.
-				this.datasets[datasetIndex].bars.push(new this.BarClass({
-					value : value,
-					label : label,
-					datasetLabel: this.datasets[datasetIndex].label,
-					x: this.scale.calculateBarX(this.datasets.length, datasetIndex, this.scale.valuesCount+1),
-					y: this.scale.endPoint,
-					width : this.scale.calculateBarWidth(this.datasets.length),
-					base : this.scale.endPoint,
-					strokeColor : this.datasets[datasetIndex].strokeColor,
-					fillColor : this.datasets[datasetIndex].fillColor
-				}));
-			},this);
-
-			this.scale.addXLabel(label);
-			//Then re-render the chart.
-			this.update();
-		},
-		removeData : function(){
-			this.scale.removeXLabel();
-			//Then re-render the chart.
-			helpers.each(this.datasets,function(dataset){
-				dataset.bars.shift();
-			},this);
-			this.update();
-		},
-		reflow : function(){
-			helpers.extend(this.BarClass.prototype,{
-				y: this.scale.endPoint,
-				base : this.scale.endPoint
-			});
-			var newScaleProps = helpers.extend({
-				height : this.chart.height,
-				width : this.chart.width
-			});
-			this.scale.update(newScaleProps);
-		},
-		draw : function(ease){
-			var easingDecimal = ease || 1;
-			this.clear();
-
-			var ctx = this.chart.ctx;
-
-			this.scale.draw(easingDecimal);
-
-			//Draw all the bars for each dataset
-			helpers.each(this.datasets,function(dataset,datasetIndex){
-				helpers.each(dataset.bars,function(bar,index){
-					if (bar.hasValue()){
-						bar.base = this.scale.endPoint;
-						//Transition then draw
-						bar.transition({
-							x : this.scale.calculateBarX(this.datasets.length, datasetIndex, index),
-							y : this.scale.calculateY(bar.value),
-							width : this.scale.calculateBarWidth(this.datasets.length)
-						}, easingDecimal).draw();
-					}
-				},this);
-
-			},this);
-		}
-	});
-
-
-}).call(this);
-
-(function(){
-	"use strict";
-
-	var root = this,
-		Chart = root.Chart,
-		//Cache a local reference to Chart.helpers
-		helpers = Chart.helpers;
-
-	var defaultConfig = {
-		//Boolean - Whether we should show a stroke on each segment
-		segmentShowStroke : true,
-
-		//String - The colour of each segment stroke
-		segmentStrokeColor : "#fff",
-
-		//Number - The width of each segment stroke
-		segmentStrokeWidth : 2,
-
-		//The percentage of the chart that we cut out of the middle.
-		percentageInnerCutout : 50,
-
-		//Number - Amount of animation steps
-		animationSteps : 100,
-
-		//String - Animation easing effect
-		animationEasing : "easeOutBounce",
-
-		//Boolean - Whether we animate the rotation of the Doughnut
-		animateRotate : true,
-
-		//Boolean - Whether we animate scaling the Doughnut from the centre
-		animateScale : false,
-
-		//String - A legend template
-		legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span class=\"<%=name.toLowerCase()%>-legend-icon\" style=\"background-color:<%=segments[i].fillColor%>\"></span><span class=\"<%=name.toLowerCase()%>-legend-text\"><%if(segments[i].label){%><%=segments[i].label%><%}%></span></li><%}%></ul>"
-
-	};
-
-	Chart.Type.extend({
-		//Passing in a name registers this chart in the Chart namespace
-		name: "Doughnut",
-		//Providing a defaults will also register the defaults in the chart namespace
-		defaults : defaultConfig,
-		//Initialize is fired when the chart is initialized - Data is passed in as a parameter
-		//Config is automatically merged by the core of Chart.js, and is available at this.options
-		initialize:  function(data){
-
-			//Declare segments as a static property to prevent inheriting across the Chart type prototype
-			this.segments = [];
-			this.outerRadius = (helpers.min([this.chart.width,this.chart.height]) -	this.options.segmentStrokeWidth/2)/2;
-
-			this.SegmentArc = Chart.Arc.extend({
-				ctx : this.chart.ctx,
-				x : this.chart.width/2,
-				y : this.chart.height/2
-			});
-
-			//Set up tooltip events on the chart
-			if (this.options.showTooltips){
-				helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
-					var activeSegments = (evt.type !== 'mouseout') ? this.getSegmentsAtEvent(evt) : [];
-
-					helpers.each(this.segments,function(segment){
-						segment.restore(["fillColor"]);
-					});
-					helpers.each(activeSegments,function(activeSegment){
-						activeSegment.fillColor = activeSegment.highlightColor;
-					});
-					this.showTooltip(activeSegments);
-				});
-			}
-			this.calculateTotal(data);
-
-			helpers.each(data,function(datapoint, index){
-				if (!datapoint.color) {
-					datapoint.color = 'hsl(' + (360 * index / data.length) + ', 100%, 50%)';
-				}
-				this.addData(datapoint, index, true);
-			},this);
-
-			this.render();
-		},
-		getSegmentsAtEvent : function(e){
-			var segmentsArray = [];
-
-			var location = helpers.getRelativePosition(e);
-
-			helpers.each(this.segments,function(segment){
-				if (segment.inRange(location.x,location.y)) segmentsArray.push(segment);
-			},this);
-			return segmentsArray;
-		},
-		addData : function(segment, atIndex, silent){
-			var index = atIndex !== undefined ? atIndex : this.segments.length;
-			if ( typeof(segment.color) === "undefined" ) {
-				segment.color = Chart.defaults.global.segmentColorDefault[index % Chart.defaults.global.segmentColorDefault.length];
-				segment.highlight = Chart.defaults.global.segmentHighlightColorDefaults[index % Chart.defaults.global.segmentHighlightColorDefaults.length];				
-			}
-			this.segments.splice(index, 0, new this.SegmentArc({
-				value : segment.value,
-				outerRadius : (this.options.animateScale) ? 0 : this.outerRadius,
-				innerRadius : (this.options.animateScale) ? 0 : (this.outerRadius/100) * this.options.percentageInnerCutout,
-				fillColor : segment.color,
-				highlightColor : segment.highlight || segment.color,
-				showStroke : this.options.segmentShowStroke,
-				strokeWidth : this.options.segmentStrokeWidth,
-				strokeColor : this.options.segmentStrokeColor,
-				startAngle : Math.PI * 1.5,
-				circumference : (this.options.animateRotate) ? 0 : this.calculateCircumference(segment.value),
-				label : segment.label
-			}));
-			if (!silent){
-				this.reflow();
-				this.update();
-			}
-		},
-		calculateCircumference : function(value) {
-			if ( this.total > 0 ) {
-				return (Math.PI*2)*(value / this.total);
-			} else {
-				return 0;
-			}
-		},
-		calculateTotal : function(data){
-			this.total = 0;
-			helpers.each(data,function(segment){
-				this.total += Math.abs(segment.value);
-			},this);
-		},
-		update : function(){
-			this.calculateTotal(this.segments);
-
-			// Reset any highlight colours before updating.
-			helpers.each(this.activeElements, function(activeElement){
-				activeElement.restore(['fillColor']);
-			});
-
-			helpers.each(this.segments,function(segment){
-				segment.save();
-			});
-			this.render();
-		},
-
-		removeData: function(atIndex){
-			var indexToDelete = (helpers.isNumber(atIndex)) ? atIndex : this.segments.length-1;
-			this.segments.splice(indexToDelete, 1);
-			this.reflow();
-			this.update();
-		},
-
-		reflow : function(){
-			helpers.extend(this.SegmentArc.prototype,{
-				x : this.chart.width/2,
-				y : this.chart.height/2
-			});
-			this.outerRadius = (helpers.min([this.chart.width,this.chart.height]) -	this.options.segmentStrokeWidth/2)/2;
-			helpers.each(this.segments, function(segment){
-				segment.update({
-					outerRadius : this.outerRadius,
-					innerRadius : (this.outerRadius/100) * this.options.percentageInnerCutout
-				});
-			}, this);
-		},
-		draw : function(easeDecimal){
-			var animDecimal = (easeDecimal) ? easeDecimal : 1;
-			this.clear();
-			helpers.each(this.segments,function(segment,index){
-				segment.transition({
-					circumference : this.calculateCircumference(segment.value),
-					outerRadius : this.outerRadius,
-					innerRadius : (this.outerRadius/100) * this.options.percentageInnerCutout
-				},animDecimal);
-
-				segment.endAngle = segment.startAngle + segment.circumference;
-
-				segment.draw();
-				if (index === 0){
-					segment.startAngle = Math.PI * 1.5;
-				}
-				//Check to see if it's the last segment, if not get the next and update the start angle
-				if (index < this.segments.length-1){
-					this.segments[index+1].startAngle = segment.endAngle;
-				}
-			},this);
-
-		}
-	});
-
-	Chart.types.Doughnut.extend({
-		name : "Pie",
-		defaults : helpers.merge(defaultConfig,{percentageInnerCutout : 0})
-	});
-
-}).call(this);
-
-(function(){
-	"use strict";
-
-	var root = this,
-		Chart = root.Chart,
-		helpers = Chart.helpers;
-
-	var defaultConfig = {
-
-		///Boolean - Whether grid lines are shown across the chart
-		scaleShowGridLines : true,
-
-		//String - Colour of the grid lines
-		scaleGridLineColor : "rgba(0,0,0,.05)",
-
-		//Number - Width of the grid lines
-		scaleGridLineWidth : 1,
-
-		//Boolean - Whether to show horizontal lines (except X axis)
-		scaleShowHorizontalLines: true,
-
-		//Boolean - Whether to show vertical lines (except Y axis)
-		scaleShowVerticalLines: true,
-
-		//Boolean - Whether the line is curved between points
-		bezierCurve : true,
-
-		//Number - Tension of the bezier curve between points
-		bezierCurveTension : 0.4,
-
-		//Boolean - Whether to show a dot for each point
-		pointDot : true,
-
-		//Number - Radius of each point dot in pixels
-		pointDotRadius : 4,
-
-		//Number - Pixel width of point dot stroke
-		pointDotStrokeWidth : 1,
-
-		//Number - amount extra to add to the radius to cater for hit detection outside the drawn point
-		pointHitDetectionRadius : 20,
-
-		//Boolean - Whether to show a stroke for datasets
-		datasetStroke : true,
-
-		//Number - Pixel width of dataset stroke
-		datasetStrokeWidth : 2,
-
-		//Boolean - Whether to fill the dataset with a colour
-		datasetFill : true,
-
-		//String - A legend template
-		legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span class=\"<%=name.toLowerCase()%>-legend-icon\" style=\"background-color:<%=datasets[i].strokeColor%>\"></span><span class=\"<%=name.toLowerCase()%>-legend-text\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%></span></li><%}%></ul>",
-
-		//Boolean - Whether to horizontally center the label and point dot inside the grid
-		offsetGridLines : false
-
-	};
-
-
-	Chart.Type.extend({
-		name: "Line",
-		defaults : defaultConfig,
-		initialize:  function(data){
-			//Declare the extension of the default point, to cater for the options passed in to the constructor
-			this.PointClass = Chart.Point.extend({
-				offsetGridLines : this.options.offsetGridLines,
-				strokeWidth : this.options.pointDotStrokeWidth,
-				radius : this.options.pointDotRadius,
-				display: this.options.pointDot,
-				hitDetectionRadius : this.options.pointHitDetectionRadius,
-				ctx : this.chart.ctx,
-				inRange : function(mouseX){
-					return (Math.pow(mouseX-this.x, 2) < Math.pow(this.radius + this.hitDetectionRadius,2));
-				}
-			});
-
-			this.datasets = [];
-
-			//Set up tooltip events on the chart
-			if (this.options.showTooltips){
-				helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
-					var activePoints = (evt.type !== 'mouseout') ? this.getPointsAtEvent(evt) : [];
-					this.eachPoints(function(point){
-						point.restore(['fillColor', 'strokeColor']);
-					});
-					helpers.each(activePoints, function(activePoint){
-						activePoint.fillColor = activePoint.highlightFill;
-						activePoint.strokeColor = activePoint.highlightStroke;
-					});
-					this.showTooltip(activePoints);
-				});
-			}
-
-			//Iterate through each of the datasets, and build this into a property of the chart
-			helpers.each(data.datasets,function(dataset){
-
-				var datasetObject = {
-					label : dataset.label || null,
-					fillColor : dataset.fillColor,
-					strokeColor : dataset.strokeColor,
-					pointColor : dataset.pointColor,
-					pointStrokeColor : dataset.pointStrokeColor,
-					points : []
-				};
-
-				this.datasets.push(datasetObject);
-
-
-				helpers.each(dataset.data,function(dataPoint,index){
-					//Add a new point for each piece of data, passing any required data to draw.
-					datasetObject.points.push(new this.PointClass({
-						value : dataPoint,
-						label : data.labels[index],
-						datasetLabel: dataset.label,
-						strokeColor : dataset.pointStrokeColor,
-						fillColor : dataset.pointColor,
-						highlightFill : dataset.pointHighlightFill || dataset.pointColor,
-						highlightStroke : dataset.pointHighlightStroke || dataset.pointStrokeColor
-					}));
-				},this);
-
-				this.buildScale(data.labels);
-
-
-				this.eachPoints(function(point, index){
-					helpers.extend(point, {
-						x: this.scale.calculateX(index),
-						y: this.scale.endPoint
-					});
-					point.save();
-				}, this);
-
-			},this);
-
-
-			this.render();
-		},
-		update : function(){
-			this.scale.update();
-			// Reset any highlight colours before updating.
-			helpers.each(this.activeElements, function(activeElement){
-				activeElement.restore(['fillColor', 'strokeColor']);
-			});
-			this.eachPoints(function(point){
-				point.save();
-			});
-			this.render();
-		},
-		eachPoints : function(callback){
-			helpers.each(this.datasets,function(dataset){
-				helpers.each(dataset.points,callback,this);
-			},this);
-		},
-		getPointsAtEvent : function(e){
-			var pointsArray = [],
-				eventPosition = helpers.getRelativePosition(e);
-			helpers.each(this.datasets,function(dataset){
-				helpers.each(dataset.points,function(point){
-					if (point.inRange(eventPosition.x,eventPosition.y)) pointsArray.push(point);
-				});
-			},this);
-			return pointsArray;
-		},
-		buildScale : function(labels){
-			var self = this;
-
-			var dataTotal = function(){
-				var values = [];
-				self.eachPoints(function(point){
-					values.push(point.value);
-				});
-
-				return values;
-			};
-
-			var scaleOptions = {
-				templateString : this.options.scaleLabel,
-				height : this.chart.height,
-				width : this.chart.width,
-				ctx : this.chart.ctx,
-				textColor : this.options.scaleFontColor,
-				offsetGridLines : this.options.offsetGridLines,
-				fontSize : this.options.scaleFontSize,
-				fontStyle : this.options.scaleFontStyle,
-				fontFamily : this.options.scaleFontFamily,
-				valuesCount : labels.length,
-				beginAtZero : this.options.scaleBeginAtZero,
-				integersOnly : this.options.scaleIntegersOnly,
-				calculateYRange : function(currentHeight){
-					var updatedRanges = helpers.calculateScaleRange(
-						dataTotal(),
-						currentHeight,
-						this.fontSize,
-						this.beginAtZero,
-						this.integersOnly
-					);
-					helpers.extend(this, updatedRanges);
-				},
-				xLabels : labels,
-				font : helpers.fontString(this.options.scaleFontSize, this.options.scaleFontStyle, this.options.scaleFontFamily),
-				lineWidth : this.options.scaleLineWidth,
-				lineColor : this.options.scaleLineColor,
-				showHorizontalLines : this.options.scaleShowHorizontalLines,
-				showVerticalLines : this.options.scaleShowVerticalLines,
-				gridLineWidth : (this.options.scaleShowGridLines) ? this.options.scaleGridLineWidth : 0,
-				gridLineColor : (this.options.scaleShowGridLines) ? this.options.scaleGridLineColor : "rgba(0,0,0,0)",
-				padding: (this.options.showScale) ? 0 : this.options.pointDotRadius + this.options.pointDotStrokeWidth,
-				showLabels : this.options.scaleShowLabels,
-				display : this.options.showScale
-			};
-
-			if (this.options.scaleOverride){
-				helpers.extend(scaleOptions, {
-					calculateYRange: helpers.noop,
-					steps: this.options.scaleSteps,
-					stepValue: this.options.scaleStepWidth,
-					min: this.options.scaleStartValue,
-					max: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)
-				});
-			}
-
-
-			this.scale = new Chart.Scale(scaleOptions);
-		},
-		addData : function(valuesArray,label){
-			//Map the values array for each of the datasets
-
-			helpers.each(valuesArray,function(value,datasetIndex){
-				//Add a new point for each piece of data, passing any required data to draw.
-				this.datasets[datasetIndex].points.push(new this.PointClass({
-					value : value,
-					label : label,
-					datasetLabel: this.datasets[datasetIndex].label,
-					x: this.scale.calculateX(this.scale.valuesCount+1),
-					y: this.scale.endPoint,
-					strokeColor : this.datasets[datasetIndex].pointStrokeColor,
-					fillColor : this.datasets[datasetIndex].pointColor
-				}));
-			},this);
-
-			this.scale.addXLabel(label);
-			//Then re-render the chart.
-			this.update();
-		},
-		removeData : function(){
-			this.scale.removeXLabel();
-			//Then re-render the chart.
-			helpers.each(this.datasets,function(dataset){
-				dataset.points.shift();
-			},this);
-			this.update();
-		},
-		reflow : function(){
-			var newScaleProps = helpers.extend({
-				height : this.chart.height,
-				width : this.chart.width
-			});
-			this.scale.update(newScaleProps);
-		},
-		draw : function(ease){
-			var easingDecimal = ease || 1;
-			this.clear();
-
-			var ctx = this.chart.ctx;
-
-			// Some helper methods for getting the next/prev points
-			var hasValue = function(item){
-				return item.value !== null;
-			},
-			nextPoint = function(point, collection, index){
-				return helpers.findNextWhere(collection, hasValue, index) || point;
-			},
-			previousPoint = function(point, collection, index){
-				return helpers.findPreviousWhere(collection, hasValue, index) || point;
-			};
-
-			if (!this.scale) return;
-			this.scale.draw(easingDecimal);
-
-
-			helpers.each(this.datasets,function(dataset){
-				var pointsWithValues = helpers.where(dataset.points, hasValue);
-
-				//Transition each point first so that the line and point drawing isn't out of sync
-				//We can use this extra loop to calculate the control points of this dataset also in this loop
-
-				helpers.each(dataset.points, function(point, index){
-					if (point.hasValue()){
-						point.transition({
-							y : this.scale.calculateY(point.value),
-							x : this.scale.calculateX(index)
-						}, easingDecimal);
-					}
-				},this);
-
-
-				// Control points need to be calculated in a separate loop, because we need to know the current x/y of the point
-				// This would cause issues when there is no animation, because the y of the next point would be 0, so beziers would be skewed
-				if (this.options.bezierCurve){
-					helpers.each(pointsWithValues, function(point, index){
-						var tension = (index > 0 && index < pointsWithValues.length - 1) ? this.options.bezierCurveTension : 0;
-						point.controlPoints = helpers.splineCurve(
-							previousPoint(point, pointsWithValues, index),
-							point,
-							nextPoint(point, pointsWithValues, index),
-							tension
-						);
-
-						// Prevent the bezier going outside of the bounds of the graph
-
-						// Cap puter bezier handles to the upper/lower scale bounds
-						if (point.controlPoints.outer.y > this.scale.endPoint){
-							point.controlPoints.outer.y = this.scale.endPoint;
-						}
-						else if (point.controlPoints.outer.y < this.scale.startPoint){
-							point.controlPoints.outer.y = this.scale.startPoint;
-						}
-
-						// Cap inner bezier handles to the upper/lower scale bounds
-						if (point.controlPoints.inner.y > this.scale.endPoint){
-							point.controlPoints.inner.y = this.scale.endPoint;
-						}
-						else if (point.controlPoints.inner.y < this.scale.startPoint){
-							point.controlPoints.inner.y = this.scale.startPoint;
-						}
-					},this);
-				}
-
-
-				//Draw the line between all the points
-				ctx.lineWidth = this.options.datasetStrokeWidth;
-				ctx.strokeStyle = dataset.strokeColor;
-				ctx.beginPath();
-
-				helpers.each(pointsWithValues, function(point, index){
-					if (index === 0){
-						ctx.moveTo(point.x, point.y);
-					}
-					else{
-						if(this.options.bezierCurve){
-							var previous = previousPoint(point, pointsWithValues, index);
-
-							ctx.bezierCurveTo(
-								previous.controlPoints.outer.x,
-								previous.controlPoints.outer.y,
-								point.controlPoints.inner.x,
-								point.controlPoints.inner.y,
-								point.x,
-								point.y
-							);
-						}
-						else{
-							ctx.lineTo(point.x,point.y);
-						}
-					}
-				}, this);
-
-				if (this.options.datasetStroke) {
-					ctx.stroke();
-				}
-
-				if (this.options.datasetFill && pointsWithValues.length > 0){
-					//Round off the line by going to the base of the chart, back to the start, then fill.
-					ctx.lineTo(pointsWithValues[pointsWithValues.length - 1].x, this.scale.endPoint);
-					ctx.lineTo(pointsWithValues[0].x, this.scale.endPoint);
-					ctx.fillStyle = dataset.fillColor;
-					ctx.closePath();
-					ctx.fill();
-				}
-
-				//Now draw the points over the line
-				//A little inefficient double looping, but better than the line
-				//lagging behind the point positions
-				helpers.each(pointsWithValues,function(point){
-					point.draw();
-				});
-			},this);
-		}
-	});
-
-
-}).call(this);
-
-(function(){
-	"use strict";
-
-	var root = this,
-		Chart = root.Chart,
-		//Cache a local reference to Chart.helpers
-		helpers = Chart.helpers;
-
-	var defaultConfig = {
-		//Boolean - Show a backdrop to the scale label
-		scaleShowLabelBackdrop : true,
-
-		//String - The colour of the label backdrop
-		scaleBackdropColor : "rgba(255,255,255,0.75)",
-
-		// Boolean - Whether the scale should begin at zero
-		scaleBeginAtZero : true,
-
-		//Number - The backdrop padding above & below the label in pixels
-		scaleBackdropPaddingY : 2,
-
-		//Number - The backdrop padding to the side of the label in pixels
-		scaleBackdropPaddingX : 2,
-
-		//Boolean - Show line for each value in the scale
-		scaleShowLine : true,
-
-		//Boolean - Stroke a line around each segment in the chart
-		segmentShowStroke : true,
-
-		//String - The colour of the stroke on each segment.
-		segmentStrokeColor : "#fff",
-
-		//Number - The width of the stroke value in pixels
-		segmentStrokeWidth : 2,
-
-		//Number - Amount of animation steps
-		animationSteps : 100,
-
-		//String - Animation easing effect.
-		animationEasing : "easeOutBounce",
-
-		//Boolean - Whether to animate the rotation of the chart
-		animateRotate : true,
-
-		//Boolean - Whether to animate scaling the chart from the centre
-		animateScale : false,
-
-		//String - A legend template
-		legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span class=\"<%=name.toLowerCase()%>-legend-icon\" style=\"background-color:<%=segments[i].fillColor%>\"></span><span class=\"<%=name.toLowerCase()%>-legend-text\"><%if(segments[i].label){%><%=segments[i].label%><%}%></span></li><%}%></ul>"
-	};
-
-
-	Chart.Type.extend({
-		//Passing in a name registers this chart in the Chart namespace
-		name: "PolarArea",
-		//Providing a defaults will also register the defaults in the chart namespace
-		defaults : defaultConfig,
-		//Initialize is fired when the chart is initialized - Data is passed in as a parameter
-		//Config is automatically merged by the core of Chart.js, and is available at this.options
-		initialize:  function(data){
-			this.segments = [];
-			//Declare segment class as a chart instance specific class, so it can share props for this instance
-			this.SegmentArc = Chart.Arc.extend({
-				showStroke : this.options.segmentShowStroke,
-				strokeWidth : this.options.segmentStrokeWidth,
-				strokeColor : this.options.segmentStrokeColor,
-				ctx : this.chart.ctx,
-				innerRadius : 0,
-				x : this.chart.width/2,
-				y : this.chart.height/2
-			});
-			this.scale = new Chart.RadialScale({
-				display: this.options.showScale,
-				fontStyle: this.options.scaleFontStyle,
-				fontSize: this.options.scaleFontSize,
-				fontFamily: this.options.scaleFontFamily,
-				fontColor: this.options.scaleFontColor,
-				showLabels: this.options.scaleShowLabels,
-				showLabelBackdrop: this.options.scaleShowLabelBackdrop,
-				backdropColor: this.options.scaleBackdropColor,
-				backdropPaddingY : this.options.scaleBackdropPaddingY,
-				backdropPaddingX: this.options.scaleBackdropPaddingX,
-				lineWidth: (this.options.scaleShowLine) ? this.options.scaleLineWidth : 0,
-				lineColor: this.options.scaleLineColor,
-				lineArc: true,
-				width: this.chart.width,
-				height: this.chart.height,
-				xCenter: this.chart.width/2,
-				yCenter: this.chart.height/2,
-				ctx : this.chart.ctx,
-				templateString: this.options.scaleLabel,
-				valuesCount: data.length
-			});
-
-			this.updateScaleRange(data);
-
-			this.scale.update();
-
-			helpers.each(data,function(segment,index){
-				this.addData(segment,index,true);
-			},this);
-
-			//Set up tooltip events on the chart
-			if (this.options.showTooltips){
-				helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
-					var activeSegments = (evt.type !== 'mouseout') ? this.getSegmentsAtEvent(evt) : [];
-					helpers.each(this.segments,function(segment){
-						segment.restore(["fillColor"]);
-					});
-					helpers.each(activeSegments,function(activeSegment){
-						activeSegment.fillColor = activeSegment.highlightColor;
-					});
-					this.showTooltip(activeSegments);
-				});
-			}
-
-			this.render();
-		},
-		getSegmentsAtEvent : function(e){
-			var segmentsArray = [];
-
-			var location = helpers.getRelativePosition(e);
-
-			helpers.each(this.segments,function(segment){
-				if (segment.inRange(location.x,location.y)) segmentsArray.push(segment);
-			},this);
-			return segmentsArray;
-		},
-		addData : function(segment, atIndex, silent){
-			var index = atIndex || this.segments.length;
-
-			this.segments.splice(index, 0, new this.SegmentArc({
-				fillColor: segment.color,
-				highlightColor: segment.highlight || segment.color,
-				label: segment.label,
-				value: segment.value,
-				outerRadius: (this.options.animateScale) ? 0 : this.scale.calculateCenterOffset(segment.value),
-				circumference: (this.options.animateRotate) ? 0 : this.scale.getCircumference(),
-				startAngle: Math.PI * 1.5
-			}));
-			if (!silent){
-				this.reflow();
-				this.update();
-			}
-		},
-		removeData: function(atIndex){
-			var indexToDelete = (helpers.isNumber(atIndex)) ? atIndex : this.segments.length-1;
-			this.segments.splice(indexToDelete, 1);
-			this.reflow();
-			this.update();
-		},
-		calculateTotal: function(data){
-			this.total = 0;
-			helpers.each(data,function(segment){
-				this.total += segment.value;
-			},this);
-			this.scale.valuesCount = this.segments.length;
-		},
-		updateScaleRange: function(datapoints){
-			var valuesArray = [];
-			helpers.each(datapoints,function(segment){
-				valuesArray.push(segment.value);
-			});
-
-			var scaleSizes = (this.options.scaleOverride) ?
-				{
-					steps: this.options.scaleSteps,
-					stepValue: this.options.scaleStepWidth,
-					min: this.options.scaleStartValue,
-					max: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)
-				} :
-				helpers.calculateScaleRange(
-					valuesArray,
-					helpers.min([this.chart.width, this.chart.height])/2,
-					this.options.scaleFontSize,
-					this.options.scaleBeginAtZero,
-					this.options.scaleIntegersOnly
-				);
-
-			helpers.extend(
-				this.scale,
-				scaleSizes,
-				{
-					size: helpers.min([this.chart.width, this.chart.height]),
-					xCenter: this.chart.width/2,
-					yCenter: this.chart.height/2
-				}
-			);
-
-		},
-		update : function(){
-			this.calculateTotal(this.segments);
-
-			helpers.each(this.segments,function(segment){
-				segment.save();
-			});
-			
-			this.reflow();
-			this.render();
-		},
-		reflow : function(){
-			helpers.extend(this.SegmentArc.prototype,{
-				x : this.chart.width/2,
-				y : this.chart.height/2
-			});
-			this.updateScaleRange(this.segments);
-			this.scale.update();
-
-			helpers.extend(this.scale,{
-				xCenter: this.chart.width/2,
-				yCenter: this.chart.height/2
-			});
-
-			helpers.each(this.segments, function(segment){
-				segment.update({
-					outerRadius : this.scale.calculateCenterOffset(segment.value)
-				});
-			}, this);
-
-		},
-		draw : function(ease){
-			var easingDecimal = ease || 1;
-			//Clear & draw the canvas
-			this.clear();
-			helpers.each(this.segments,function(segment, index){
-				segment.transition({
-					circumference : this.scale.getCircumference(),
-					outerRadius : this.scale.calculateCenterOffset(segment.value)
-				},easingDecimal);
-
-				segment.endAngle = segment.startAngle + segment.circumference;
-
-				// If we've removed the first segment we need to set the first one to
-				// start at the top.
-				if (index === 0){
-					segment.startAngle = Math.PI * 1.5;
-				}
-
-				//Check to see if it's the last segment, if not get the next and update the start angle
-				if (index < this.segments.length - 1){
-					this.segments[index+1].startAngle = segment.endAngle;
-				}
-				segment.draw();
-			}, this);
-			this.scale.draw();
-		}
-	});
-
-}).call(this);
-
-(function(){
-	"use strict";
-
-	var root = this,
-		Chart = root.Chart,
-		helpers = Chart.helpers;
-
-
-
-	Chart.Type.extend({
-		name: "Radar",
-		defaults:{
-			//Boolean - Whether to show lines for each scale point
-			scaleShowLine : true,
-
-			//Boolean - Whether we show the angle lines out of the radar
-			angleShowLineOut : true,
-
-			//Boolean - Whether to show labels on the scale
-			scaleShowLabels : false,
-
-			// Boolean - Whether the scale should begin at zero
-			scaleBeginAtZero : true,
-
-			//String - Colour of the angle line
-			angleLineColor : "rgba(0,0,0,.1)",
-
-			//Number - Pixel width of the angle line
-			angleLineWidth : 1,
-
-			//Number - Interval at which to draw angle lines ("every Nth point")
-			angleLineInterval: 1,
-
-			//String - Point label font declaration
-			pointLabelFontFamily : "'Arial'",
-
-			//String - Point label font weight
-			pointLabelFontStyle : "normal",
-
-			//Number - Point label font size in pixels
-			pointLabelFontSize : 10,
-
-			//String - Point label font colour
-			pointLabelFontColor : "#666",
-
-			//Boolean - Whether to show a dot for each point
-			pointDot : true,
-
-			//Number - Radius of each point dot in pixels
-			pointDotRadius : 3,
-
-			//Number - Pixel width of point dot stroke
-			pointDotStrokeWidth : 1,
-
-			//Number - amount extra to add to the radius to cater for hit detection outside the drawn point
-			pointHitDetectionRadius : 20,
-
-			//Boolean - Whether to show a stroke for datasets
-			datasetStroke : true,
-
-			//Number - Pixel width of dataset stroke
-			datasetStrokeWidth : 2,
-
-			//Boolean - Whether to fill the dataset with a colour
-			datasetFill : true,
-
-			//String - A legend template
-			legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span class=\"<%=name.toLowerCase()%>-legend-icon\" style=\"background-color:<%=datasets[i].strokeColor%>\"></span><span class=\"<%=name.toLowerCase()%>-legend-text\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%></span></li><%}%></ul>"
-
-		},
-
-		initialize: function(data){
-			this.PointClass = Chart.Point.extend({
-				strokeWidth : this.options.pointDotStrokeWidth,
-				radius : this.options.pointDotRadius,
-				display: this.options.pointDot,
-				hitDetectionRadius : this.options.pointHitDetectionRadius,
-				ctx : this.chart.ctx
-			});
-
-			this.datasets = [];
-
-			this.buildScale(data);
-
-			//Set up tooltip events on the chart
-			if (this.options.showTooltips){
-				helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
-					var activePointsCollection = (evt.type !== 'mouseout') ? this.getPointsAtEvent(evt) : [];
-
-					this.eachPoints(function(point){
-						point.restore(['fillColor', 'strokeColor']);
-					});
-					helpers.each(activePointsCollection, function(activePoint){
-						activePoint.fillColor = activePoint.highlightFill;
-						activePoint.strokeColor = activePoint.highlightStroke;
-					});
-
-					this.showTooltip(activePointsCollection);
-				});
-			}
-
-			//Iterate through each of the datasets, and build this into a property of the chart
-			helpers.each(data.datasets,function(dataset){
-
-				var datasetObject = {
-					label: dataset.label || null,
-					fillColor : dataset.fillColor,
-					strokeColor : dataset.strokeColor,
-					pointColor : dataset.pointColor,
-					pointStrokeColor : dataset.pointStrokeColor,
-					points : []
-				};
-
-				this.datasets.push(datasetObject);
-
-				helpers.each(dataset.data,function(dataPoint,index){
-					//Add a new point for each piece of data, passing any required data to draw.
-					var pointPosition;
-					if (!this.scale.animation){
-						pointPosition = this.scale.getPointPosition(index, this.scale.calculateCenterOffset(dataPoint));
-					}
-					datasetObject.points.push(new this.PointClass({
-						value : dataPoint,
-						label : data.labels[index],
-						datasetLabel: dataset.label,
-						x: (this.options.animation) ? this.scale.xCenter : pointPosition.x,
-						y: (this.options.animation) ? this.scale.yCenter : pointPosition.y,
-						strokeColor : dataset.pointStrokeColor,
-						fillColor : dataset.pointColor,
-						highlightFill : dataset.pointHighlightFill || dataset.pointColor,
-						highlightStroke : dataset.pointHighlightStroke || dataset.pointStrokeColor
-					}));
-				},this);
-
-			},this);
-
-			this.render();
-		},
-		eachPoints : function(callback){
-			helpers.each(this.datasets,function(dataset){
-				helpers.each(dataset.points,callback,this);
-			},this);
-		},
-
-		getPointsAtEvent : function(evt){
-			var mousePosition = helpers.getRelativePosition(evt),
-				fromCenter = helpers.getAngleFromPoint({
-					x: this.scale.xCenter,
-					y: this.scale.yCenter
-				}, mousePosition);
-
-			var anglePerIndex = (Math.PI * 2) /this.scale.valuesCount,
-				pointIndex = Math.round((fromCenter.angle - Math.PI * 1.5) / anglePerIndex),
-				activePointsCollection = [];
-
-			// If we're at the top, make the pointIndex 0 to get the first of the array.
-			if (pointIndex >= this.scale.valuesCount || pointIndex < 0){
-				pointIndex = 0;
-			}
-
-			if (fromCenter.distance <= this.scale.drawingArea){
-				helpers.each(this.datasets, function(dataset){
-					activePointsCollection.push(dataset.points[pointIndex]);
-				});
-			}
-
-			return activePointsCollection;
-		},
-
-		buildScale : function(data){
-			this.scale = new Chart.RadialScale({
-				display: this.options.showScale,
-				fontStyle: this.options.scaleFontStyle,
-				fontSize: this.options.scaleFontSize,
-				fontFamily: this.options.scaleFontFamily,
-				fontColor: this.options.scaleFontColor,
-				showLabels: this.options.scaleShowLabels,
-				showLabelBackdrop: this.options.scaleShowLabelBackdrop,
-				backdropColor: this.options.scaleBackdropColor,
-				backgroundColors: this.options.scaleBackgroundColors,
-				backdropPaddingY : this.options.scaleBackdropPaddingY,
-				backdropPaddingX: this.options.scaleBackdropPaddingX,
-				lineWidth: (this.options.scaleShowLine) ? this.options.scaleLineWidth : 0,
-				lineColor: this.options.scaleLineColor,
-				angleLineColor : this.options.angleLineColor,
-				angleLineWidth : (this.options.angleShowLineOut) ? this.options.angleLineWidth : 0,
-        angleLineInterval: (this.options.angleLineInterval) ? this.options.angleLineInterval : 1,
-				// Point labels at the edge of each line
-				pointLabelFontColor : this.options.pointLabelFontColor,
-				pointLabelFontSize : this.options.pointLabelFontSize,
-				pointLabelFontFamily : this.options.pointLabelFontFamily,
-				pointLabelFontStyle : this.options.pointLabelFontStyle,
-				height : this.chart.height,
-				width: this.chart.width,
-				xCenter: this.chart.width/2,
-				yCenter: this.chart.height/2,
-				ctx : this.chart.ctx,
-				templateString: this.options.scaleLabel,
-				labels: data.labels,
-				valuesCount: data.datasets[0].data.length
-			});
-
-			this.scale.setScaleSize();
-			this.updateScaleRange(data.datasets);
-			this.scale.buildYLabels();
-		},
-		updateScaleRange: function(datasets){
-			var valuesArray = (function(){
-				var totalDataArray = [];
-				helpers.each(datasets,function(dataset){
-					if (dataset.data){
-						totalDataArray = totalDataArray.concat(dataset.data);
-					}
-					else {
-						helpers.each(dataset.points, function(point){
-							totalDataArray.push(point.value);
-						});
-					}
-				});
-				return totalDataArray;
-			})();
-
-
-			var scaleSizes = (this.options.scaleOverride) ?
-				{
-					steps: this.options.scaleSteps,
-					stepValue: this.options.scaleStepWidth,
-					min: this.options.scaleStartValue,
-					max: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)
-				} :
-				helpers.calculateScaleRange(
-					valuesArray,
-					helpers.min([this.chart.width, this.chart.height])/2,
-					this.options.scaleFontSize,
-					this.options.scaleBeginAtZero,
-					this.options.scaleIntegersOnly
-				);
-
-			helpers.extend(
-				this.scale,
-				scaleSizes
-			);
-
-		},
-		addData : function(valuesArray,label){
-			//Map the values array for each of the datasets
-			this.scale.valuesCount++;
-			helpers.each(valuesArray,function(value,datasetIndex){
-				var pointPosition = this.scale.getPointPosition(this.scale.valuesCount, this.scale.calculateCenterOffset(value));
-				this.datasets[datasetIndex].points.push(new this.PointClass({
-					value : value,
-					label : label,
-					datasetLabel: this.datasets[datasetIndex].label,
-					x: pointPosition.x,
-					y: pointPosition.y,
-					strokeColor : this.datasets[datasetIndex].pointStrokeColor,
-					fillColor : this.datasets[datasetIndex].pointColor
-				}));
-			},this);
-
-			this.scale.labels.push(label);
-
-			this.reflow();
-
-			this.update();
-		},
-		removeData : function(){
-			this.scale.valuesCount--;
-			this.scale.labels.shift();
-			helpers.each(this.datasets,function(dataset){
-				dataset.points.shift();
-			},this);
-			this.reflow();
-			this.update();
-		},
-		update : function(){
-			this.eachPoints(function(point){
-				point.save();
-			});
-			this.reflow();
-			this.render();
-		},
-		reflow: function(){
-			helpers.extend(this.scale, {
-				width : this.chart.width,
-				height: this.chart.height,
-				size : helpers.min([this.chart.width, this.chart.height]),
-				xCenter: this.chart.width/2,
-				yCenter: this.chart.height/2
-			});
-			this.updateScaleRange(this.datasets);
-			this.scale.setScaleSize();
-			this.scale.buildYLabels();
-		},
-		draw : function(ease){
-			var easeDecimal = ease || 1,
-				ctx = this.chart.ctx;
-			this.clear();
-			this.scale.draw();
-
-			helpers.each(this.datasets,function(dataset){
-
-				//Transition each point first so that the line and point drawing isn't out of sync
-				helpers.each(dataset.points,function(point,index){
-					if (point.hasValue()){
-						point.transition(this.scale.getPointPosition(index, this.scale.calculateCenterOffset(point.value)), easeDecimal);
-					}
-				},this);
-
-
-
-				//Draw the line between all the points
-				ctx.lineWidth = this.options.datasetStrokeWidth;
-				ctx.strokeStyle = dataset.strokeColor;
-				ctx.beginPath();
-				helpers.each(dataset.points,function(point,index){
-					if (index === 0){
-						ctx.moveTo(point.x,point.y);
-					}
-					else{
-						ctx.lineTo(point.x,point.y);
-					}
-				},this);
-				ctx.closePath();
-				ctx.stroke();
-
-				ctx.fillStyle = dataset.fillColor;
-				if(this.options.datasetFill){
-					ctx.fill();
-				}
-				//Now draw the points over the line
-				//A little inefficient double looping, but better than the line
-				//lagging behind the point positions
-				helpers.each(dataset.points,function(point){
-					if (point.hasValue()){
-						point.draw();
-					}
-				});
-
-			},this);
-
-		}
-
-	});
-
-
-
-
-
-}).call(this);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/Chart.js/bower.json b/views/ngXosViews/serviceGrid/src/vendor/Chart.js/bower.json
deleted file mode 100644
index 51e5f2d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/Chart.js/bower.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
-  "name": "Chart.js",
-  "description": "Simple HTML5 Charts using the canvas element",
-  "homepage": "https://github.com/nnnick/Chart.js",
-  "author": "nnnick",
-  "main": [
-    "Chart.js"
-  ],
-  "ignore": [
-    "**/*",
-    ".travis.yml",
-    "CONTRIBUTING.md",
-    "Chart.js",
-    "LICENSE.md",
-    "README.md",
-    "gulpfile.js",
-    "package.json"
-  ],
-  "dependencies": {},
-  "version": "1.1.1"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-animate/.bower.json
deleted file mode 100644
index fb88429..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/.bower.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "name": "angular-animate",
-  "version": "1.4.7",
-  "main": "./angular-animate.js",
-  "ignore": [],
-  "dependencies": {
-    "angular": "1.4.7"
-  },
-  "homepage": "https://github.com/angular/bower-angular-animate",
-  "_release": "1.4.7",
-  "_resolution": {
-    "type": "version",
-    "tag": "v1.4.7",
-    "commit": "3e63136fc3d882828594f3ceb929784eb43aa944"
-  },
-  "_source": "https://github.com/angular/bower-angular-animate.git",
-  "_target": "1.4.7",
-  "_originalSource": "angular-animate"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/README.md b/views/ngXosViews/serviceGrid/src/vendor/angular-animate/README.md
deleted file mode 100644
index 8313da6..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-# packaged angular-animate
-
-This repo is for distribution on `npm` and `bower`. The source for this module is in the
-[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngAnimate).
-Please file issues and pull requests against that repo.
-
-## Install
-
-You can install this package either with `npm` or with `bower`.
-
-### npm
-
-```shell
-npm install angular-animate
-```
-
-Then add `ngAnimate` as a dependency for your app:
-
-```javascript
-angular.module('myApp', [require('angular-animate')]);
-```
-
-### bower
-
-```shell
-bower install angular-animate
-```
-
-Then add a `<script>` to your `index.html`:
-
-```html
-<script src="/bower_components/angular-animate/angular-animate.js"></script>
-```
-
-Then add `ngAnimate` as a dependency for your app:
-
-```javascript
-angular.module('myApp', ['ngAnimate']);
-```
-
-## Documentation
-
-Documentation is available on the
-[AngularJS docs site](http://docs.angularjs.org/api/ngAnimate).
-
-## License
-
-The MIT License
-
-Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/angular-animate.js b/views/ngXosViews/serviceGrid/src/vendor/angular-animate/angular-animate.js
deleted file mode 100644
index 1948298..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/angular-animate.js
+++ /dev/null
@@ -1,3928 +0,0 @@
-/**
- * @license AngularJS v1.4.7
- * (c) 2010-2015 Google, Inc. http://angularjs.org
- * License: MIT
- */
-(function(window, angular, undefined) {'use strict';
-
-/* jshint ignore:start */
-var noop        = angular.noop;
-var extend      = angular.extend;
-var jqLite      = angular.element;
-var forEach     = angular.forEach;
-var isArray     = angular.isArray;
-var isString    = angular.isString;
-var isObject    = angular.isObject;
-var isUndefined = angular.isUndefined;
-var isDefined   = angular.isDefined;
-var isFunction  = angular.isFunction;
-var isElement   = angular.isElement;
-
-var ELEMENT_NODE = 1;
-var COMMENT_NODE = 8;
-
-var ADD_CLASS_SUFFIX = '-add';
-var REMOVE_CLASS_SUFFIX = '-remove';
-var EVENT_CLASS_PREFIX = 'ng-';
-var ACTIVE_CLASS_SUFFIX = '-active';
-
-var NG_ANIMATE_CLASSNAME = 'ng-animate';
-var NG_ANIMATE_CHILDREN_DATA = '$$ngAnimateChildren';
-
-// Detect proper transitionend/animationend event names.
-var CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT;
-
-// If unprefixed events are not supported but webkit-prefixed are, use the latter.
-// Otherwise, just use W3C names, browsers not supporting them at all will just ignore them.
-// Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend`
-// but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`.
-// Register both events in case `window.onanimationend` is not supported because of that,
-// do the same for `transitionend` as Safari is likely to exhibit similar behavior.
-// Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit
-// therefore there is no reason to test anymore for other vendor prefixes:
-// http://caniuse.com/#search=transition
-if (isUndefined(window.ontransitionend) && isDefined(window.onwebkittransitionend)) {
-  CSS_PREFIX = '-webkit-';
-  TRANSITION_PROP = 'WebkitTransition';
-  TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';
-} else {
-  TRANSITION_PROP = 'transition';
-  TRANSITIONEND_EVENT = 'transitionend';
-}
-
-if (isUndefined(window.onanimationend) && isDefined(window.onwebkitanimationend)) {
-  CSS_PREFIX = '-webkit-';
-  ANIMATION_PROP = 'WebkitAnimation';
-  ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';
-} else {
-  ANIMATION_PROP = 'animation';
-  ANIMATIONEND_EVENT = 'animationend';
-}
-
-var DURATION_KEY = 'Duration';
-var PROPERTY_KEY = 'Property';
-var DELAY_KEY = 'Delay';
-var TIMING_KEY = 'TimingFunction';
-var ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';
-var ANIMATION_PLAYSTATE_KEY = 'PlayState';
-var SAFE_FAST_FORWARD_DURATION_VALUE = 9999;
-
-var ANIMATION_DELAY_PROP = ANIMATION_PROP + DELAY_KEY;
-var ANIMATION_DURATION_PROP = ANIMATION_PROP + DURATION_KEY;
-var TRANSITION_DELAY_PROP = TRANSITION_PROP + DELAY_KEY;
-var TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY;
-
-var isPromiseLike = function(p) {
-  return p && p.then ? true : false;
-};
-
-function assertArg(arg, name, reason) {
-  if (!arg) {
-    throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required"));
-  }
-  return arg;
-}
-
-function mergeClasses(a,b) {
-  if (!a && !b) return '';
-  if (!a) return b;
-  if (!b) return a;
-  if (isArray(a)) a = a.join(' ');
-  if (isArray(b)) b = b.join(' ');
-  return a + ' ' + b;
-}
-
-function packageStyles(options) {
-  var styles = {};
-  if (options && (options.to || options.from)) {
-    styles.to = options.to;
-    styles.from = options.from;
-  }
-  return styles;
-}
-
-function pendClasses(classes, fix, isPrefix) {
-  var className = '';
-  classes = isArray(classes)
-      ? classes
-      : classes && isString(classes) && classes.length
-          ? classes.split(/\s+/)
-          : [];
-  forEach(classes, function(klass, i) {
-    if (klass && klass.length > 0) {
-      className += (i > 0) ? ' ' : '';
-      className += isPrefix ? fix + klass
-                            : klass + fix;
-    }
-  });
-  return className;
-}
-
-function removeFromArray(arr, val) {
-  var index = arr.indexOf(val);
-  if (val >= 0) {
-    arr.splice(index, 1);
-  }
-}
-
-function stripCommentsFromElement(element) {
-  if (element instanceof jqLite) {
-    switch (element.length) {
-      case 0:
-        return [];
-        break;
-
-      case 1:
-        // there is no point of stripping anything if the element
-        // is the only element within the jqLite wrapper.
-        // (it's important that we retain the element instance.)
-        if (element[0].nodeType === ELEMENT_NODE) {
-          return element;
-        }
-        break;
-
-      default:
-        return jqLite(extractElementNode(element));
-        break;
-    }
-  }
-
-  if (element.nodeType === ELEMENT_NODE) {
-    return jqLite(element);
-  }
-}
-
-function extractElementNode(element) {
-  if (!element[0]) return element;
-  for (var i = 0; i < element.length; i++) {
-    var elm = element[i];
-    if (elm.nodeType == ELEMENT_NODE) {
-      return elm;
-    }
-  }
-}
-
-function $$addClass($$jqLite, element, className) {
-  forEach(element, function(elm) {
-    $$jqLite.addClass(elm, className);
-  });
-}
-
-function $$removeClass($$jqLite, element, className) {
-  forEach(element, function(elm) {
-    $$jqLite.removeClass(elm, className);
-  });
-}
-
-function applyAnimationClassesFactory($$jqLite) {
-  return function(element, options) {
-    if (options.addClass) {
-      $$addClass($$jqLite, element, options.addClass);
-      options.addClass = null;
-    }
-    if (options.removeClass) {
-      $$removeClass($$jqLite, element, options.removeClass);
-      options.removeClass = null;
-    }
-  }
-}
-
-function prepareAnimationOptions(options) {
-  options = options || {};
-  if (!options.$$prepared) {
-    var domOperation = options.domOperation || noop;
-    options.domOperation = function() {
-      options.$$domOperationFired = true;
-      domOperation();
-      domOperation = noop;
-    };
-    options.$$prepared = true;
-  }
-  return options;
-}
-
-function applyAnimationStyles(element, options) {
-  applyAnimationFromStyles(element, options);
-  applyAnimationToStyles(element, options);
-}
-
-function applyAnimationFromStyles(element, options) {
-  if (options.from) {
-    element.css(options.from);
-    options.from = null;
-  }
-}
-
-function applyAnimationToStyles(element, options) {
-  if (options.to) {
-    element.css(options.to);
-    options.to = null;
-  }
-}
-
-function mergeAnimationOptions(element, target, newOptions) {
-  var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || '');
-  var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || '');
-  var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove);
-
-  if (newOptions.preparationClasses) {
-    target.preparationClasses = concatWithSpace(newOptions.preparationClasses, target.preparationClasses);
-    delete newOptions.preparationClasses;
-  }
-
-  // noop is basically when there is no callback; otherwise something has been set
-  var realDomOperation = target.domOperation !== noop ? target.domOperation : null;
-
-  extend(target, newOptions);
-
-  // TODO(matsko or sreeramu): proper fix is to maintain all animation callback in array and call at last,but now only leave has the callback so no issue with this.
-  if (realDomOperation) {
-    target.domOperation = realDomOperation;
-  }
-
-  if (classes.addClass) {
-    target.addClass = classes.addClass;
-  } else {
-    target.addClass = null;
-  }
-
-  if (classes.removeClass) {
-    target.removeClass = classes.removeClass;
-  } else {
-    target.removeClass = null;
-  }
-
-  return target;
-}
-
-function resolveElementClasses(existing, toAdd, toRemove) {
-  var ADD_CLASS = 1;
-  var REMOVE_CLASS = -1;
-
-  var flags = {};
-  existing = splitClassesToLookup(existing);
-
-  toAdd = splitClassesToLookup(toAdd);
-  forEach(toAdd, function(value, key) {
-    flags[key] = ADD_CLASS;
-  });
-
-  toRemove = splitClassesToLookup(toRemove);
-  forEach(toRemove, function(value, key) {
-    flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;
-  });
-
-  var classes = {
-    addClass: '',
-    removeClass: ''
-  };
-
-  forEach(flags, function(val, klass) {
-    var prop, allow;
-    if (val === ADD_CLASS) {
-      prop = 'addClass';
-      allow = !existing[klass];
-    } else if (val === REMOVE_CLASS) {
-      prop = 'removeClass';
-      allow = existing[klass];
-    }
-    if (allow) {
-      if (classes[prop].length) {
-        classes[prop] += ' ';
-      }
-      classes[prop] += klass;
-    }
-  });
-
-  function splitClassesToLookup(classes) {
-    if (isString(classes)) {
-      classes = classes.split(' ');
-    }
-
-    var obj = {};
-    forEach(classes, function(klass) {
-      // sometimes the split leaves empty string values
-      // incase extra spaces were applied to the options
-      if (klass.length) {
-        obj[klass] = true;
-      }
-    });
-    return obj;
-  }
-
-  return classes;
-}
-
-function getDomNode(element) {
-  return (element instanceof angular.element) ? element[0] : element;
-}
-
-function applyGeneratedPreparationClasses(element, event, options) {
-  var classes = '';
-  if (event) {
-    classes = pendClasses(event, EVENT_CLASS_PREFIX, true);
-  }
-  if (options.addClass) {
-    classes = concatWithSpace(classes, pendClasses(options.addClass, ADD_CLASS_SUFFIX));
-  }
-  if (options.removeClass) {
-    classes = concatWithSpace(classes, pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX));
-  }
-  if (classes.length) {
-    options.preparationClasses = classes;
-    element.addClass(classes);
-  }
-}
-
-function clearGeneratedClasses(element, options) {
-  if (options.preparationClasses) {
-    element.removeClass(options.preparationClasses);
-    options.preparationClasses = null;
-  }
-  if (options.activeClasses) {
-    element.removeClass(options.activeClasses);
-    options.activeClasses = null;
-  }
-}
-
-function blockTransitions(node, duration) {
-  // we use a negative delay value since it performs blocking
-  // yet it doesn't kill any existing transitions running on the
-  // same element which makes this safe for class-based animations
-  var value = duration ? '-' + duration + 's' : '';
-  applyInlineStyle(node, [TRANSITION_DELAY_PROP, value]);
-  return [TRANSITION_DELAY_PROP, value];
-}
-
-function blockKeyframeAnimations(node, applyBlock) {
-  var value = applyBlock ? 'paused' : '';
-  var key = ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY;
-  applyInlineStyle(node, [key, value]);
-  return [key, value];
-}
-
-function applyInlineStyle(node, styleTuple) {
-  var prop = styleTuple[0];
-  var value = styleTuple[1];
-  node.style[prop] = value;
-}
-
-function concatWithSpace(a,b) {
-  if (!a) return b;
-  if (!b) return a;
-  return a + ' ' + b;
-}
-
-var $$rAFSchedulerFactory = ['$$rAF', function($$rAF) {
-  var queue, cancelFn;
-
-  function scheduler(tasks) {
-    // we make a copy since RAFScheduler mutates the state
-    // of the passed in array variable and this would be difficult
-    // to track down on the outside code
-    queue = queue.concat(tasks);
-    nextTick();
-  }
-
-  queue = scheduler.queue = [];
-
-  /* waitUntilQuiet does two things:
-   * 1. It will run the FINAL `fn` value only when an uncancelled RAF has passed through
-   * 2. It will delay the next wave of tasks from running until the quiet `fn` has run.
-   *
-   * The motivation here is that animation code can request more time from the scheduler
-   * before the next wave runs. This allows for certain DOM properties such as classes to
-   * be resolved in time for the next animation to run.
-   */
-  scheduler.waitUntilQuiet = function(fn) {
-    if (cancelFn) cancelFn();
-
-    cancelFn = $$rAF(function() {
-      cancelFn = null;
-      fn();
-      nextTick();
-    });
-  };
-
-  return scheduler;
-
-  function nextTick() {
-    if (!queue.length) return;
-
-    var items = queue.shift();
-    for (var i = 0; i < items.length; i++) {
-      items[i]();
-    }
-
-    if (!cancelFn) {
-      $$rAF(function() {
-        if (!cancelFn) nextTick();
-      });
-    }
-  }
-}];
-
-var $$AnimateChildrenDirective = [function() {
-  return function(scope, element, attrs) {
-    var val = attrs.ngAnimateChildren;
-    if (angular.isString(val) && val.length === 0) { //empty attribute
-      element.data(NG_ANIMATE_CHILDREN_DATA, true);
-    } else {
-      attrs.$observe('ngAnimateChildren', function(value) {
-        value = value === 'on' || value === 'true';
-        element.data(NG_ANIMATE_CHILDREN_DATA, value);
-      });
-    }
-  };
-}];
-
-var ANIMATE_TIMER_KEY = '$$animateCss';
-
-/**
- * @ngdoc service
- * @name $animateCss
- * @kind object
- *
- * @description
- * The `$animateCss` service is a useful utility to trigger customized CSS-based transitions/keyframes
- * from a JavaScript-based animation or directly from a directive. The purpose of `$animateCss` is NOT
- * to side-step how `$animate` and ngAnimate work, but the goal is to allow pre-existing animations or
- * directives to create more complex animations that can be purely driven using CSS code.
- *
- * Note that only browsers that support CSS transitions and/or keyframe animations are capable of
- * rendering animations triggered via `$animateCss` (bad news for IE9 and lower).
- *
- * ## Usage
- * Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that
- * is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however,
- * any automatic control over cancelling animations and/or preventing animations from being run on
- * child elements will not be handled by Angular. For this to work as expected, please use `$animate` to
- * trigger the animation and then setup a JavaScript animation that injects `$animateCss` to trigger
- * the CSS animation.
- *
- * The example below shows how we can create a folding animation on an element using `ng-if`:
- *
- * ```html
- * <!-- notice the `fold-animation` CSS class -->
- * <div ng-if="onOff" class="fold-animation">
- *   This element will go BOOM
- * </div>
- * <button ng-click="onOff=true">Fold In</button>
- * ```
- *
- * Now we create the **JavaScript animation** that will trigger the CSS transition:
- *
- * ```js
- * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {
- *   return {
- *     enter: function(element, doneFn) {
- *       var height = element[0].offsetHeight;
- *       return $animateCss(element, {
- *         from: { height:'0px' },
- *         to: { height:height + 'px' },
- *         duration: 1 // one second
- *       });
- *     }
- *   }
- * }]);
- * ```
- *
- * ## More Advanced Uses
- *
- * `$animateCss` is the underlying code that ngAnimate uses to power **CSS-based animations** behind the scenes. Therefore CSS hooks
- * like `.ng-EVENT`, `.ng-EVENT-active`, `.ng-EVENT-stagger` are all features that can be triggered using `$animateCss` via JavaScript code.
- *
- * This also means that just about any combination of adding classes, removing classes, setting styles, dynamically setting a keyframe animation,
- * applying a hardcoded duration or delay value, changing the animation easing or applying a stagger animation are all options that work with
- * `$animateCss`. The service itself is smart enough to figure out the combination of options and examine the element styling properties in order
- * to provide a working animation that will run in CSS.
- *
- * The example below showcases a more advanced version of the `.fold-animation` from the example above:
- *
- * ```js
- * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {
- *   return {
- *     enter: function(element, doneFn) {
- *       var height = element[0].offsetHeight;
- *       return $animateCss(element, {
- *         addClass: 'red large-text pulse-twice',
- *         easing: 'ease-out',
- *         from: { height:'0px' },
- *         to: { height:height + 'px' },
- *         duration: 1 // one second
- *       });
- *     }
- *   }
- * }]);
- * ```
- *
- * Since we're adding/removing CSS classes then the CSS transition will also pick those up:
- *
- * ```css
- * /&#42; since a hardcoded duration value of 1 was provided in the JavaScript animation code,
- * the CSS classes below will be transitioned despite them being defined as regular CSS classes &#42;/
- * .red { background:red; }
- * .large-text { font-size:20px; }
- *
- * /&#42; we can also use a keyframe animation and $animateCss will make it work alongside the transition &#42;/
- * .pulse-twice {
- *   animation: 0.5s pulse linear 2;
- *   -webkit-animation: 0.5s pulse linear 2;
- * }
- *
- * @keyframes pulse {
- *   from { transform: scale(0.5); }
- *   to { transform: scale(1.5); }
- * }
- *
- * @-webkit-keyframes pulse {
- *   from { -webkit-transform: scale(0.5); }
- *   to { -webkit-transform: scale(1.5); }
- * }
- * ```
- *
- * Given this complex combination of CSS classes, styles and options, `$animateCss` will figure everything out and make the animation happen.
- *
- * ## How the Options are handled
- *
- * `$animateCss` is very versatile and intelligent when it comes to figuring out what configurations to apply to the element to ensure the animation
- * works with the options provided. Say for example we were adding a class that contained a keyframe value and we wanted to also animate some inline
- * styles using the `from` and `to` properties.
- *
- * ```js
- * var animator = $animateCss(element, {
- *   from: { background:'red' },
- *   to: { background:'blue' }
- * });
- * animator.start();
- * ```
- *
- * ```css
- * .rotating-animation {
- *   animation:0.5s rotate linear;
- *   -webkit-animation:0.5s rotate linear;
- * }
- *
- * @keyframes rotate {
- *   from { transform: rotate(0deg); }
- *   to { transform: rotate(360deg); }
- * }
- *
- * @-webkit-keyframes rotate {
- *   from { -webkit-transform: rotate(0deg); }
- *   to { -webkit-transform: rotate(360deg); }
- * }
- * ```
- *
- * The missing pieces here are that we do not have a transition set (within the CSS code nor within the `$animateCss` options) and the duration of the animation is
- * going to be detected from what the keyframe styles on the CSS class are. In this event, `$animateCss` will automatically create an inline transition
- * style matching the duration detected from the keyframe style (which is present in the CSS class that is being added) and then prepare both the transition
- * and keyframe animations to run in parallel on the element. Then when the animation is underway the provided `from` and `to` CSS styles will be applied
- * and spread across the transition and keyframe animation.
- *
- * ## What is returned
- *
- * `$animateCss` works in two stages: a preparation phase and an animation phase. Therefore when `$animateCss` is first called it will NOT actually
- * start the animation. All that is going on here is that the element is being prepared for the animation (which means that the generated CSS classes are
- * added and removed on the element). Once `$animateCss` is called it will return an object with the following properties:
- *
- * ```js
- * var animator = $animateCss(element, { ... });
- * ```
- *
- * Now what do the contents of our `animator` variable look like:
- *
- * ```js
- * {
- *   // starts the animation
- *   start: Function,
- *
- *   // ends (aborts) the animation
- *   end: Function
- * }
- * ```
- *
- * To actually start the animation we need to run `animation.start()` which will then return a promise that we can hook into to detect when the animation ends.
- * If we choose not to run the animation then we MUST run `animation.end()` to perform a cleanup on the element (since some CSS classes and stlyes may have been
- * applied to the element during the preparation phase). Note that all other properties such as duration, delay, transitions and keyframes are just properties
- * and that changing them will not reconfigure the parameters of the animation.
- *
- * ### runner.done() vs runner.then()
- * It is documented that `animation.start()` will return a promise object and this is true, however, there is also an additional method available on the
- * runner called `.done(callbackFn)`. The done method works the same as `.finally(callbackFn)`, however, it does **not trigger a digest to occur**.
- * Therefore, for performance reasons, it's always best to use `runner.done(callback)` instead of `runner.then()`, `runner.catch()` or `runner.finally()`
- * unless you really need a digest to kick off afterwards.
- *
- * Keep in mind that, to make this easier, ngAnimate has tweaked the JS animations API to recognize when a runner instance is returned from $animateCss
- * (so there is no need to call `runner.done(doneFn)` inside of your JavaScript animation code).
- * Check the {@link ngAnimate.$animateCss#usage animation code above} to see how this works.
- *
- * @param {DOMElement} element the element that will be animated
- * @param {object} options the animation-related options that will be applied during the animation
- *
- * * `event` - The DOM event (e.g. enter, leave, move). When used, a generated CSS class of `ng-EVENT` and `ng-EVENT-active` will be applied
- * to the element during the animation. Multiple events can be provided when spaces are used as a separator. (Note that this will not perform any DOM operation.)
- * * `easing` - The CSS easing value that will be applied to the transition or keyframe animation (or both).
- * * `transitionStyle` - The raw CSS transition style that will be used (e.g. `1s linear all`).
- * * `keyframeStyle` - The raw CSS keyframe animation style that will be used (e.g. `1s my_animation linear`).
- * * `from` - The starting CSS styles (a key/value object) that will be applied at the start of the animation.
- * * `to` - The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.
- * * `addClass` - A space separated list of CSS classes that will be added to the element and spread across the animation.
- * * `removeClass` - A space separated list of CSS classes that will be removed from the element and spread across the animation.
- * * `duration` - A number value representing the total duration of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `0`
- * is provided then the animation will be skipped entirely.
- * * `delay` - A number value representing the total delay of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `true` is
- * used then whatever delay value is detected from the CSS classes will be mirrored on the elements styles (e.g. by setting delay true then the style value
- * of the element will be `transition-delay: DETECTED_VALUE`). Using `true` is useful when you want the CSS classes and inline styles to all share the same
- * CSS delay value.
- * * `stagger` - A numeric time value representing the delay between successively animated elements
- * ({@link ngAnimate#css-staggering-animations Click here to learn how CSS-based staggering works in ngAnimate.})
- * * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a
- * * `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`)
- * * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occuring on the classes being added and removed.)
- * * `cleanupStyles` - Whether or not the provided `from` and `to` styles will be removed once
- *    the animation is closed. This is useful for when the styles are used purely for the sake of
- *    the animation and do not have a lasting visual effect on the element (e.g. a colapse and open animation).
- *    By default this value is set to `false`.
- *
- * @return {object} an object with start and end methods and details about the animation.
- *
- * * `start` - The method to start the animation. This will return a `Promise` when called.
- * * `end` - This method will cancel the animation and remove all applied CSS classes and styles.
- */
-var ONE_SECOND = 1000;
-var BASE_TEN = 10;
-
-var ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;
-var CLOSING_TIME_BUFFER = 1.5;
-
-var DETECT_CSS_PROPERTIES = {
-  transitionDuration:      TRANSITION_DURATION_PROP,
-  transitionDelay:         TRANSITION_DELAY_PROP,
-  transitionProperty:      TRANSITION_PROP + PROPERTY_KEY,
-  animationDuration:       ANIMATION_DURATION_PROP,
-  animationDelay:          ANIMATION_DELAY_PROP,
-  animationIterationCount: ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY
-};
-
-var DETECT_STAGGER_CSS_PROPERTIES = {
-  transitionDuration:      TRANSITION_DURATION_PROP,
-  transitionDelay:         TRANSITION_DELAY_PROP,
-  animationDuration:       ANIMATION_DURATION_PROP,
-  animationDelay:          ANIMATION_DELAY_PROP
-};
-
-function getCssKeyframeDurationStyle(duration) {
-  return [ANIMATION_DURATION_PROP, duration + 's'];
-}
-
-function getCssDelayStyle(delay, isKeyframeAnimation) {
-  var prop = isKeyframeAnimation ? ANIMATION_DELAY_PROP : TRANSITION_DELAY_PROP;
-  return [prop, delay + 's'];
-}
-
-function computeCssStyles($window, element, properties) {
-  var styles = Object.create(null);
-  var detectedStyles = $window.getComputedStyle(element) || {};
-  forEach(properties, function(formalStyleName, actualStyleName) {
-    var val = detectedStyles[formalStyleName];
-    if (val) {
-      var c = val.charAt(0);
-
-      // only numerical-based values have a negative sign or digit as the first value
-      if (c === '-' || c === '+' || c >= 0) {
-        val = parseMaxTime(val);
-      }
-
-      // by setting this to null in the event that the delay is not set or is set directly as 0
-      // then we can still allow for zegative values to be used later on and not mistake this
-      // value for being greater than any other negative value.
-      if (val === 0) {
-        val = null;
-      }
-      styles[actualStyleName] = val;
-    }
-  });
-
-  return styles;
-}
-
-function parseMaxTime(str) {
-  var maxValue = 0;
-  var values = str.split(/\s*,\s*/);
-  forEach(values, function(value) {
-    // it's always safe to consider only second values and omit `ms` values since
-    // getComputedStyle will always handle the conversion for us
-    if (value.charAt(value.length - 1) == 's') {
-      value = value.substring(0, value.length - 1);
-    }
-    value = parseFloat(value) || 0;
-    maxValue = maxValue ? Math.max(value, maxValue) : value;
-  });
-  return maxValue;
-}
-
-function truthyTimingValue(val) {
-  return val === 0 || val != null;
-}
-
-function getCssTransitionDurationStyle(duration, applyOnlyDuration) {
-  var style = TRANSITION_PROP;
-  var value = duration + 's';
-  if (applyOnlyDuration) {
-    style += DURATION_KEY;
-  } else {
-    value += ' linear all';
-  }
-  return [style, value];
-}
-
-function createLocalCacheLookup() {
-  var cache = Object.create(null);
-  return {
-    flush: function() {
-      cache = Object.create(null);
-    },
-
-    count: function(key) {
-      var entry = cache[key];
-      return entry ? entry.total : 0;
-    },
-
-    get: function(key) {
-      var entry = cache[key];
-      return entry && entry.value;
-    },
-
-    put: function(key, value) {
-      if (!cache[key]) {
-        cache[key] = { total: 1, value: value };
-      } else {
-        cache[key].total++;
-      }
-    }
-  };
-}
-
-// we do not reassign an already present style value since
-// if we detect the style property value again we may be
-// detecting styles that were added via the `from` styles.
-// We make use of `isDefined` here since an empty string
-// or null value (which is what getPropertyValue will return
-// for a non-existing style) will still be marked as a valid
-// value for the style (a falsy value implies that the style
-// is to be removed at the end of the animation). If we had a simple
-// "OR" statement then it would not be enough to catch that.
-function registerRestorableStyles(backup, node, properties) {
-  forEach(properties, function(prop) {
-    backup[prop] = isDefined(backup[prop])
-        ? backup[prop]
-        : node.style.getPropertyValue(prop);
-  });
-}
-
-var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
-  var gcsLookup = createLocalCacheLookup();
-  var gcsStaggerLookup = createLocalCacheLookup();
-
-  this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout',
-               '$$forceReflow', '$sniffer', '$$rAFScheduler', '$animate',
-       function($window,   $$jqLite,   $$AnimateRunner,   $timeout,
-                $$forceReflow,   $sniffer,   $$rAFScheduler, $animate) {
-
-    var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
-
-    var parentCounter = 0;
-    function gcsHashFn(node, extraClasses) {
-      var KEY = "$$ngAnimateParentKey";
-      var parentNode = node.parentNode;
-      var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter);
-      return parentID + '-' + node.getAttribute('class') + '-' + extraClasses;
-    }
-
-    function computeCachedCssStyles(node, className, cacheKey, properties) {
-      var timings = gcsLookup.get(cacheKey);
-
-      if (!timings) {
-        timings = computeCssStyles($window, node, properties);
-        if (timings.animationIterationCount === 'infinite') {
-          timings.animationIterationCount = 1;
-        }
-      }
-
-      // we keep putting this in multiple times even though the value and the cacheKey are the same
-      // because we're keeping an interal tally of how many duplicate animations are detected.
-      gcsLookup.put(cacheKey, timings);
-      return timings;
-    }
-
-    function computeCachedCssStaggerStyles(node, className, cacheKey, properties) {
-      var stagger;
-
-      // if we have one or more existing matches of matching elements
-      // containing the same parent + CSS styles (which is how cacheKey works)
-      // then staggering is possible
-      if (gcsLookup.count(cacheKey) > 0) {
-        stagger = gcsStaggerLookup.get(cacheKey);
-
-        if (!stagger) {
-          var staggerClassName = pendClasses(className, '-stagger');
-
-          $$jqLite.addClass(node, staggerClassName);
-
-          stagger = computeCssStyles($window, node, properties);
-
-          // force the conversion of a null value to zero incase not set
-          stagger.animationDuration = Math.max(stagger.animationDuration, 0);
-          stagger.transitionDuration = Math.max(stagger.transitionDuration, 0);
-
-          $$jqLite.removeClass(node, staggerClassName);
-
-          gcsStaggerLookup.put(cacheKey, stagger);
-        }
-      }
-
-      return stagger || {};
-    }
-
-    var cancelLastRAFRequest;
-    var rafWaitQueue = [];
-    function waitUntilQuiet(callback) {
-      rafWaitQueue.push(callback);
-      $$rAFScheduler.waitUntilQuiet(function() {
-        gcsLookup.flush();
-        gcsStaggerLookup.flush();
-
-        // DO NOT REMOVE THIS LINE OR REFACTOR OUT THE `pageWidth` variable.
-        // PLEASE EXAMINE THE `$$forceReflow` service to understand why.
-        var pageWidth = $$forceReflow();
-
-        // we use a for loop to ensure that if the queue is changed
-        // during this looping then it will consider new requests
-        for (var i = 0; i < rafWaitQueue.length; i++) {
-          rafWaitQueue[i](pageWidth);
-        }
-        rafWaitQueue.length = 0;
-      });
-    }
-
-    function computeTimings(node, className, cacheKey) {
-      var timings = computeCachedCssStyles(node, className, cacheKey, DETECT_CSS_PROPERTIES);
-      var aD = timings.animationDelay;
-      var tD = timings.transitionDelay;
-      timings.maxDelay = aD && tD
-          ? Math.max(aD, tD)
-          : (aD || tD);
-      timings.maxDuration = Math.max(
-          timings.animationDuration * timings.animationIterationCount,
-          timings.transitionDuration);
-
-      return timings;
-    }
-
-    return function init(element, options) {
-      var restoreStyles = {};
-      var node = getDomNode(element);
-      if (!node
-          || !node.parentNode
-          || !$animate.enabled()) {
-        return closeAndReturnNoopAnimator();
-      }
-
-      options = prepareAnimationOptions(options);
-
-      var temporaryStyles = [];
-      var classes = element.attr('class');
-      var styles = packageStyles(options);
-      var animationClosed;
-      var animationPaused;
-      var animationCompleted;
-      var runner;
-      var runnerHost;
-      var maxDelay;
-      var maxDelayTime;
-      var maxDuration;
-      var maxDurationTime;
-
-      if (options.duration === 0 || (!$sniffer.animations && !$sniffer.transitions)) {
-        return closeAndReturnNoopAnimator();
-      }
-
-      var method = options.event && isArray(options.event)
-            ? options.event.join(' ')
-            : options.event;
-
-      var isStructural = method && options.structural;
-      var structuralClassName = '';
-      var addRemoveClassName = '';
-
-      if (isStructural) {
-        structuralClassName = pendClasses(method, EVENT_CLASS_PREFIX, true);
-      } else if (method) {
-        structuralClassName = method;
-      }
-
-      if (options.addClass) {
-        addRemoveClassName += pendClasses(options.addClass, ADD_CLASS_SUFFIX);
-      }
-
-      if (options.removeClass) {
-        if (addRemoveClassName.length) {
-          addRemoveClassName += ' ';
-        }
-        addRemoveClassName += pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX);
-      }
-
-      // there may be a situation where a structural animation is combined together
-      // with CSS classes that need to resolve before the animation is computed.
-      // However this means that there is no explicit CSS code to block the animation
-      // from happening (by setting 0s none in the class name). If this is the case
-      // we need to apply the classes before the first rAF so we know to continue if
-      // there actually is a detected transition or keyframe animation
-      if (options.applyClassesEarly && addRemoveClassName.length) {
-        applyAnimationClasses(element, options);
-      }
-
-      var preparationClasses = [structuralClassName, addRemoveClassName].join(' ').trim();
-      var fullClassName = classes + ' ' + preparationClasses;
-      var activeClasses = pendClasses(preparationClasses, ACTIVE_CLASS_SUFFIX);
-      var hasToStyles = styles.to && Object.keys(styles.to).length > 0;
-      var containsKeyframeAnimation = (options.keyframeStyle || '').length > 0;
-
-      // there is no way we can trigger an animation if no styles and
-      // no classes are being applied which would then trigger a transition,
-      // unless there a is raw keyframe value that is applied to the element.
-      if (!containsKeyframeAnimation
-           && !hasToStyles
-           && !preparationClasses) {
-        return closeAndReturnNoopAnimator();
-      }
-
-      var cacheKey, stagger;
-      if (options.stagger > 0) {
-        var staggerVal = parseFloat(options.stagger);
-        stagger = {
-          transitionDelay: staggerVal,
-          animationDelay: staggerVal,
-          transitionDuration: 0,
-          animationDuration: 0
-        };
-      } else {
-        cacheKey = gcsHashFn(node, fullClassName);
-        stagger = computeCachedCssStaggerStyles(node, preparationClasses, cacheKey, DETECT_STAGGER_CSS_PROPERTIES);
-      }
-
-      if (!options.$$skipPreparationClasses) {
-        $$jqLite.addClass(element, preparationClasses);
-      }
-
-      var applyOnlyDuration;
-
-      if (options.transitionStyle) {
-        var transitionStyle = [TRANSITION_PROP, options.transitionStyle];
-        applyInlineStyle(node, transitionStyle);
-        temporaryStyles.push(transitionStyle);
-      }
-
-      if (options.duration >= 0) {
-        applyOnlyDuration = node.style[TRANSITION_PROP].length > 0;
-        var durationStyle = getCssTransitionDurationStyle(options.duration, applyOnlyDuration);
-
-        // we set the duration so that it will be picked up by getComputedStyle later
-        applyInlineStyle(node, durationStyle);
-        temporaryStyles.push(durationStyle);
-      }
-
-      if (options.keyframeStyle) {
-        var keyframeStyle = [ANIMATION_PROP, options.keyframeStyle];
-        applyInlineStyle(node, keyframeStyle);
-        temporaryStyles.push(keyframeStyle);
-      }
-
-      var itemIndex = stagger
-          ? options.staggerIndex >= 0
-              ? options.staggerIndex
-              : gcsLookup.count(cacheKey)
-          : 0;
-
-      var isFirst = itemIndex === 0;
-
-      // this is a pre-emptive way of forcing the setup classes to be added and applied INSTANTLY
-      // without causing any combination of transitions to kick in. By adding a negative delay value
-      // it forces the setup class' transition to end immediately. We later then remove the negative
-      // transition delay to allow for the transition to naturally do it's thing. The beauty here is
-      // that if there is no transition defined then nothing will happen and this will also allow
-      // other transitions to be stacked on top of each other without any chopping them out.
-      if (isFirst && !options.skipBlocking) {
-        blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE);
-      }
-
-      var timings = computeTimings(node, fullClassName, cacheKey);
-      var relativeDelay = timings.maxDelay;
-      maxDelay = Math.max(relativeDelay, 0);
-      maxDuration = timings.maxDuration;
-
-      var flags = {};
-      flags.hasTransitions          = timings.transitionDuration > 0;
-      flags.hasAnimations           = timings.animationDuration > 0;
-      flags.hasTransitionAll        = flags.hasTransitions && timings.transitionProperty == 'all';
-      flags.applyTransitionDuration = hasToStyles && (
-                                        (flags.hasTransitions && !flags.hasTransitionAll)
-                                         || (flags.hasAnimations && !flags.hasTransitions));
-      flags.applyAnimationDuration  = options.duration && flags.hasAnimations;
-      flags.applyTransitionDelay    = truthyTimingValue(options.delay) && (flags.applyTransitionDuration || flags.hasTransitions);
-      flags.applyAnimationDelay     = truthyTimingValue(options.delay) && flags.hasAnimations;
-      flags.recalculateTimingStyles = addRemoveClassName.length > 0;
-
-      if (flags.applyTransitionDuration || flags.applyAnimationDuration) {
-        maxDuration = options.duration ? parseFloat(options.duration) : maxDuration;
-
-        if (flags.applyTransitionDuration) {
-          flags.hasTransitions = true;
-          timings.transitionDuration = maxDuration;
-          applyOnlyDuration = node.style[TRANSITION_PROP + PROPERTY_KEY].length > 0;
-          temporaryStyles.push(getCssTransitionDurationStyle(maxDuration, applyOnlyDuration));
-        }
-
-        if (flags.applyAnimationDuration) {
-          flags.hasAnimations = true;
-          timings.animationDuration = maxDuration;
-          temporaryStyles.push(getCssKeyframeDurationStyle(maxDuration));
-        }
-      }
-
-      if (maxDuration === 0 && !flags.recalculateTimingStyles) {
-        return closeAndReturnNoopAnimator();
-      }
-
-      if (options.delay != null) {
-        var delayStyle = parseFloat(options.delay);
-
-        if (flags.applyTransitionDelay) {
-          temporaryStyles.push(getCssDelayStyle(delayStyle));
-        }
-
-        if (flags.applyAnimationDelay) {
-          temporaryStyles.push(getCssDelayStyle(delayStyle, true));
-        }
-      }
-
-      // we need to recalculate the delay value since we used a pre-emptive negative
-      // delay value and the delay value is required for the final event checking. This
-      // property will ensure that this will happen after the RAF phase has passed.
-      if (options.duration == null && timings.transitionDuration > 0) {
-        flags.recalculateTimingStyles = flags.recalculateTimingStyles || isFirst;
-      }
-
-      maxDelayTime = maxDelay * ONE_SECOND;
-      maxDurationTime = maxDuration * ONE_SECOND;
-      if (!options.skipBlocking) {
-        flags.blockTransition = timings.transitionDuration > 0;
-        flags.blockKeyframeAnimation = timings.animationDuration > 0 &&
-                                       stagger.animationDelay > 0 &&
-                                       stagger.animationDuration === 0;
-      }
-
-      if (options.from) {
-        if (options.cleanupStyles) {
-          registerRestorableStyles(restoreStyles, node, Object.keys(options.from));
-        }
-        applyAnimationFromStyles(element, options);
-      }
-
-      if (flags.blockTransition || flags.blockKeyframeAnimation) {
-        applyBlocking(maxDuration);
-      } else if (!options.skipBlocking) {
-        blockTransitions(node, false);
-      }
-
-      // TODO(matsko): for 1.5 change this code to have an animator object for better debugging
-      return {
-        $$willAnimate: true,
-        end: endFn,
-        start: function() {
-          if (animationClosed) return;
-
-          runnerHost = {
-            end: endFn,
-            cancel: cancelFn,
-            resume: null, //this will be set during the start() phase
-            pause: null
-          };
-
-          runner = new $$AnimateRunner(runnerHost);
-
-          waitUntilQuiet(start);
-
-          // we don't have access to pause/resume the animation
-          // since it hasn't run yet. AnimateRunner will therefore
-          // set noop functions for resume and pause and they will
-          // later be overridden once the animation is triggered
-          return runner;
-        }
-      };
-
-      function endFn() {
-        close();
-      }
-
-      function cancelFn() {
-        close(true);
-      }
-
-      function close(rejected) { // jshint ignore:line
-        // if the promise has been called already then we shouldn't close
-        // the animation again
-        if (animationClosed || (animationCompleted && animationPaused)) return;
-        animationClosed = true;
-        animationPaused = false;
-
-        if (!options.$$skipPreparationClasses) {
-          $$jqLite.removeClass(element, preparationClasses);
-        }
-        $$jqLite.removeClass(element, activeClasses);
-
-        blockKeyframeAnimations(node, false);
-        blockTransitions(node, false);
-
-        forEach(temporaryStyles, function(entry) {
-          // There is only one way to remove inline style properties entirely from elements.
-          // By using `removeProperty` this works, but we need to convert camel-cased CSS
-          // styles down to hyphenated values.
-          node.style[entry[0]] = '';
-        });
-
-        applyAnimationClasses(element, options);
-        applyAnimationStyles(element, options);
-
-        if (Object.keys(restoreStyles).length) {
-          forEach(restoreStyles, function(value, prop) {
-            value ? node.style.setProperty(prop, value)
-                  : node.style.removeProperty(prop);
-          });
-        }
-
-        // the reason why we have this option is to allow a synchronous closing callback
-        // that is fired as SOON as the animation ends (when the CSS is removed) or if
-        // the animation never takes off at all. A good example is a leave animation since
-        // the element must be removed just after the animation is over or else the element
-        // will appear on screen for one animation frame causing an overbearing flicker.
-        if (options.onDone) {
-          options.onDone();
-        }
-
-        // if the preparation function fails then the promise is not setup
-        if (runner) {
-          runner.complete(!rejected);
-        }
-      }
-
-      function applyBlocking(duration) {
-        if (flags.blockTransition) {
-          blockTransitions(node, duration);
-        }
-
-        if (flags.blockKeyframeAnimation) {
-          blockKeyframeAnimations(node, !!duration);
-        }
-      }
-
-      function closeAndReturnNoopAnimator() {
-        runner = new $$AnimateRunner({
-          end: endFn,
-          cancel: cancelFn
-        });
-
-        // should flush the cache animation
-        waitUntilQuiet(noop);
-        close();
-
-        return {
-          $$willAnimate: false,
-          start: function() {
-            return runner;
-          },
-          end: endFn
-        };
-      }
-
-      function start() {
-        if (animationClosed) return;
-        if (!node.parentNode) {
-          close();
-          return;
-        }
-
-        var startTime, events = [];
-
-        // even though we only pause keyframe animations here the pause flag
-        // will still happen when transitions are used. Only the transition will
-        // not be paused since that is not possible. If the animation ends when
-        // paused then it will not complete until unpaused or cancelled.
-        var playPause = function(playAnimation) {
-          if (!animationCompleted) {
-            animationPaused = !playAnimation;
-            if (timings.animationDuration) {
-              var value = blockKeyframeAnimations(node, animationPaused);
-              animationPaused
-                  ? temporaryStyles.push(value)
-                  : removeFromArray(temporaryStyles, value);
-            }
-          } else if (animationPaused && playAnimation) {
-            animationPaused = false;
-            close();
-          }
-        };
-
-        // checking the stagger duration prevents an accidently cascade of the CSS delay style
-        // being inherited from the parent. If the transition duration is zero then we can safely
-        // rely that the delay value is an intential stagger delay style.
-        var maxStagger = itemIndex > 0
-                         && ((timings.transitionDuration && stagger.transitionDuration === 0) ||
-                            (timings.animationDuration && stagger.animationDuration === 0))
-                         && Math.max(stagger.animationDelay, stagger.transitionDelay);
-        if (maxStagger) {
-          $timeout(triggerAnimationStart,
-                   Math.floor(maxStagger * itemIndex * ONE_SECOND),
-                   false);
-        } else {
-          triggerAnimationStart();
-        }
-
-        // this will decorate the existing promise runner with pause/resume methods
-        runnerHost.resume = function() {
-          playPause(true);
-        };
-
-        runnerHost.pause = function() {
-          playPause(false);
-        };
-
-        function triggerAnimationStart() {
-          // just incase a stagger animation kicks in when the animation
-          // itself was cancelled entirely
-          if (animationClosed) return;
-
-          applyBlocking(false);
-
-          forEach(temporaryStyles, function(entry) {
-            var key = entry[0];
-            var value = entry[1];
-            node.style[key] = value;
-          });
-
-          applyAnimationClasses(element, options);
-          $$jqLite.addClass(element, activeClasses);
-
-          if (flags.recalculateTimingStyles) {
-            fullClassName = node.className + ' ' + preparationClasses;
-            cacheKey = gcsHashFn(node, fullClassName);
-
-            timings = computeTimings(node, fullClassName, cacheKey);
-            relativeDelay = timings.maxDelay;
-            maxDelay = Math.max(relativeDelay, 0);
-            maxDuration = timings.maxDuration;
-
-            if (maxDuration === 0) {
-              close();
-              return;
-            }
-
-            flags.hasTransitions = timings.transitionDuration > 0;
-            flags.hasAnimations = timings.animationDuration > 0;
-          }
-
-          if (flags.applyAnimationDelay) {
-            relativeDelay = typeof options.delay !== "boolean" && truthyTimingValue(options.delay)
-                  ? parseFloat(options.delay)
-                  : relativeDelay;
-
-            maxDelay = Math.max(relativeDelay, 0);
-            timings.animationDelay = relativeDelay;
-            delayStyle = getCssDelayStyle(relativeDelay, true);
-            temporaryStyles.push(delayStyle);
-            node.style[delayStyle[0]] = delayStyle[1];
-          }
-
-          maxDelayTime = maxDelay * ONE_SECOND;
-          maxDurationTime = maxDuration * ONE_SECOND;
-
-          if (options.easing) {
-            var easeProp, easeVal = options.easing;
-            if (flags.hasTransitions) {
-              easeProp = TRANSITION_PROP + TIMING_KEY;
-              temporaryStyles.push([easeProp, easeVal]);
-              node.style[easeProp] = easeVal;
-            }
-            if (flags.hasAnimations) {
-              easeProp = ANIMATION_PROP + TIMING_KEY;
-              temporaryStyles.push([easeProp, easeVal]);
-              node.style[easeProp] = easeVal;
-            }
-          }
-
-          if (timings.transitionDuration) {
-            events.push(TRANSITIONEND_EVENT);
-          }
-
-          if (timings.animationDuration) {
-            events.push(ANIMATIONEND_EVENT);
-          }
-
-          startTime = Date.now();
-          var timerTime = maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime;
-          var endTime = startTime + timerTime;
-
-          var animationsData = element.data(ANIMATE_TIMER_KEY) || [];
-          var setupFallbackTimer = true;
-          if (animationsData.length) {
-            var currentTimerData = animationsData[0];
-            setupFallbackTimer = endTime > currentTimerData.expectedEndTime;
-            if (setupFallbackTimer) {
-              $timeout.cancel(currentTimerData.timer);
-            } else {
-              animationsData.push(close);
-            }
-          }
-
-          if (setupFallbackTimer) {
-            var timer = $timeout(onAnimationExpired, timerTime, false);
-            animationsData[0] = {
-              timer: timer,
-              expectedEndTime: endTime
-            };
-            animationsData.push(close);
-            element.data(ANIMATE_TIMER_KEY, animationsData);
-          }
-
-          element.on(events.join(' '), onAnimationProgress);
-          if (options.to) {
-            if (options.cleanupStyles) {
-              registerRestorableStyles(restoreStyles, node, Object.keys(options.to));
-            }
-            applyAnimationToStyles(element, options);
-          }
-        }
-
-        function onAnimationExpired() {
-          var animationsData = element.data(ANIMATE_TIMER_KEY);
-
-          // this will be false in the event that the element was
-          // removed from the DOM (via a leave animation or something
-          // similar)
-          if (animationsData) {
-            for (var i = 1; i < animationsData.length; i++) {
-              animationsData[i]();
-            }
-            element.removeData(ANIMATE_TIMER_KEY);
-          }
-        }
-
-        function onAnimationProgress(event) {
-          event.stopPropagation();
-          var ev = event.originalEvent || event;
-          var timeStamp = ev.$manualTimeStamp || ev.timeStamp || Date.now();
-
-          /* Firefox (or possibly just Gecko) likes to not round values up
-           * when a ms measurement is used for the animation */
-          var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES));
-
-          /* $manualTimeStamp is a mocked timeStamp value which is set
-           * within browserTrigger(). This is only here so that tests can
-           * mock animations properly. Real events fallback to event.timeStamp,
-           * or, if they don't, then a timeStamp is automatically created for them.
-           * We're checking to see if the timeStamp surpasses the expected delay,
-           * but we're using elapsedTime instead of the timeStamp on the 2nd
-           * pre-condition since animations sometimes close off early */
-          if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) {
-            // we set this flag to ensure that if the transition is paused then, when resumed,
-            // the animation will automatically close itself since transitions cannot be paused.
-            animationCompleted = true;
-            close();
-          }
-        }
-      }
-    };
-  }];
-}];
-
-var $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationProvider) {
-  $$animationProvider.drivers.push('$$animateCssDriver');
-
-  var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';
-  var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor';
-
-  var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out';
-  var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in';
-
-  function isDocumentFragment(node) {
-    return node.parentNode && node.parentNode.nodeType === 11;
-  }
-
-  this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$sniffer', '$$jqLite', '$document',
-       function($animateCss,   $rootScope,   $$AnimateRunner,   $rootElement,   $sniffer,   $$jqLite,   $document) {
-
-    // only browsers that support these properties can render animations
-    if (!$sniffer.animations && !$sniffer.transitions) return noop;
-
-    var bodyNode = $document[0].body;
-    var rootNode = getDomNode($rootElement);
-
-    var rootBodyElement = jqLite(
-      // this is to avoid using something that exists outside of the body
-      // we also special case the doc fragement case because our unit test code
-      // appends the $rootElement to the body after the app has been bootstrapped
-      isDocumentFragment(rootNode) || bodyNode.contains(rootNode) ? rootNode : bodyNode
-    );
-
-    var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
-
-    return function initDriverFn(animationDetails) {
-      return animationDetails.from && animationDetails.to
-          ? prepareFromToAnchorAnimation(animationDetails.from,
-                                         animationDetails.to,
-                                         animationDetails.classes,
-                                         animationDetails.anchors)
-          : prepareRegularAnimation(animationDetails);
-    };
-
-    function filterCssClasses(classes) {
-      //remove all the `ng-` stuff
-      return classes.replace(/\bng-\S+\b/g, '');
-    }
-
-    function getUniqueValues(a, b) {
-      if (isString(a)) a = a.split(' ');
-      if (isString(b)) b = b.split(' ');
-      return a.filter(function(val) {
-        return b.indexOf(val) === -1;
-      }).join(' ');
-    }
-
-    function prepareAnchoredAnimation(classes, outAnchor, inAnchor) {
-      var clone = jqLite(getDomNode(outAnchor).cloneNode(true));
-      var startingClasses = filterCssClasses(getClassVal(clone));
-
-      outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);
-      inAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);
-
-      clone.addClass(NG_ANIMATE_ANCHOR_CLASS_NAME);
-
-      rootBodyElement.append(clone);
-
-      var animatorIn, animatorOut = prepareOutAnimation();
-
-      // the user may not end up using the `out` animation and
-      // only making use of the `in` animation or vice-versa.
-      // In either case we should allow this and not assume the
-      // animation is over unless both animations are not used.
-      if (!animatorOut) {
-        animatorIn = prepareInAnimation();
-        if (!animatorIn) {
-          return end();
-        }
-      }
-
-      var startingAnimator = animatorOut || animatorIn;
-
-      return {
-        start: function() {
-          var runner;
-
-          var currentAnimation = startingAnimator.start();
-          currentAnimation.done(function() {
-            currentAnimation = null;
-            if (!animatorIn) {
-              animatorIn = prepareInAnimation();
-              if (animatorIn) {
-                currentAnimation = animatorIn.start();
-                currentAnimation.done(function() {
-                  currentAnimation = null;
-                  end();
-                  runner.complete();
-                });
-                return currentAnimation;
-              }
-            }
-            // in the event that there is no `in` animation
-            end();
-            runner.complete();
-          });
-
-          runner = new $$AnimateRunner({
-            end: endFn,
-            cancel: endFn
-          });
-
-          return runner;
-
-          function endFn() {
-            if (currentAnimation) {
-              currentAnimation.end();
-            }
-          }
-        }
-      };
-
-      function calculateAnchorStyles(anchor) {
-        var styles = {};
-
-        var coords = getDomNode(anchor).getBoundingClientRect();
-
-        // we iterate directly since safari messes up and doesn't return
-        // all the keys for the coods object when iterated
-        forEach(['width','height','top','left'], function(key) {
-          var value = coords[key];
-          switch (key) {
-            case 'top':
-              value += bodyNode.scrollTop;
-              break;
-            case 'left':
-              value += bodyNode.scrollLeft;
-              break;
-          }
-          styles[key] = Math.floor(value) + 'px';
-        });
-        return styles;
-      }
-
-      function prepareOutAnimation() {
-        var animator = $animateCss(clone, {
-          addClass: NG_OUT_ANCHOR_CLASS_NAME,
-          delay: true,
-          from: calculateAnchorStyles(outAnchor)
-        });
-
-        // read the comment within `prepareRegularAnimation` to understand
-        // why this check is necessary
-        return animator.$$willAnimate ? animator : null;
-      }
-
-      function getClassVal(element) {
-        return element.attr('class') || '';
-      }
-
-      function prepareInAnimation() {
-        var endingClasses = filterCssClasses(getClassVal(inAnchor));
-        var toAdd = getUniqueValues(endingClasses, startingClasses);
-        var toRemove = getUniqueValues(startingClasses, endingClasses);
-
-        var animator = $animateCss(clone, {
-          to: calculateAnchorStyles(inAnchor),
-          addClass: NG_IN_ANCHOR_CLASS_NAME + ' ' + toAdd,
-          removeClass: NG_OUT_ANCHOR_CLASS_NAME + ' ' + toRemove,
-          delay: true
-        });
-
-        // read the comment within `prepareRegularAnimation` to understand
-        // why this check is necessary
-        return animator.$$willAnimate ? animator : null;
-      }
-
-      function end() {
-        clone.remove();
-        outAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);
-        inAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);
-      }
-    }
-
-    function prepareFromToAnchorAnimation(from, to, classes, anchors) {
-      var fromAnimation = prepareRegularAnimation(from, noop);
-      var toAnimation = prepareRegularAnimation(to, noop);
-
-      var anchorAnimations = [];
-      forEach(anchors, function(anchor) {
-        var outElement = anchor['out'];
-        var inElement = anchor['in'];
-        var animator = prepareAnchoredAnimation(classes, outElement, inElement);
-        if (animator) {
-          anchorAnimations.push(animator);
-        }
-      });
-
-      // no point in doing anything when there are no elements to animate
-      if (!fromAnimation && !toAnimation && anchorAnimations.length === 0) return;
-
-      return {
-        start: function() {
-          var animationRunners = [];
-
-          if (fromAnimation) {
-            animationRunners.push(fromAnimation.start());
-          }
-
-          if (toAnimation) {
-            animationRunners.push(toAnimation.start());
-          }
-
-          forEach(anchorAnimations, function(animation) {
-            animationRunners.push(animation.start());
-          });
-
-          var runner = new $$AnimateRunner({
-            end: endFn,
-            cancel: endFn // CSS-driven animations cannot be cancelled, only ended
-          });
-
-          $$AnimateRunner.all(animationRunners, function(status) {
-            runner.complete(status);
-          });
-
-          return runner;
-
-          function endFn() {
-            forEach(animationRunners, function(runner) {
-              runner.end();
-            });
-          }
-        }
-      };
-    }
-
-    function prepareRegularAnimation(animationDetails) {
-      var element = animationDetails.element;
-      var options = animationDetails.options || {};
-
-      if (animationDetails.structural) {
-        options.event = animationDetails.event;
-        options.structural = true;
-        options.applyClassesEarly = true;
-
-        // we special case the leave animation since we want to ensure that
-        // the element is removed as soon as the animation is over. Otherwise
-        // a flicker might appear or the element may not be removed at all
-        if (animationDetails.event === 'leave') {
-          options.onDone = options.domOperation;
-        }
-      }
-
-      // We assign the preparationClasses as the actual animation event since
-      // the internals of $animateCss will just suffix the event token values
-      // with `-active` to trigger the animation.
-      if (options.preparationClasses) {
-        options.event = concatWithSpace(options.event, options.preparationClasses);
-      }
-
-      var animator = $animateCss(element, options);
-
-      // the driver lookup code inside of $$animation attempts to spawn a
-      // driver one by one until a driver returns a.$$willAnimate animator object.
-      // $animateCss will always return an object, however, it will pass in
-      // a flag as a hint as to whether an animation was detected or not
-      return animator.$$willAnimate ? animator : null;
-    }
-  }];
-}];
-
-// TODO(matsko): use caching here to speed things up for detection
-// TODO(matsko): add documentation
-//  by the time...
-
-var $$AnimateJsProvider = ['$animateProvider', function($animateProvider) {
-  this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',
-       function($injector,   $$AnimateRunner,   $$jqLite) {
-
-    var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
-         // $animateJs(element, 'enter');
-    return function(element, event, classes, options) {
-      // the `classes` argument is optional and if it is not used
-      // then the classes will be resolved from the element's className
-      // property as well as options.addClass/options.removeClass.
-      if (arguments.length === 3 && isObject(classes)) {
-        options = classes;
-        classes = null;
-      }
-
-      options = prepareAnimationOptions(options);
-      if (!classes) {
-        classes = element.attr('class') || '';
-        if (options.addClass) {
-          classes += ' ' + options.addClass;
-        }
-        if (options.removeClass) {
-          classes += ' ' + options.removeClass;
-        }
-      }
-
-      var classesToAdd = options.addClass;
-      var classesToRemove = options.removeClass;
-
-      // the lookupAnimations function returns a series of animation objects that are
-      // matched up with one or more of the CSS classes. These animation objects are
-      // defined via the module.animation factory function. If nothing is detected then
-      // we don't return anything which then makes $animation query the next driver.
-      var animations = lookupAnimations(classes);
-      var before, after;
-      if (animations.length) {
-        var afterFn, beforeFn;
-        if (event == 'leave') {
-          beforeFn = 'leave';
-          afterFn = 'afterLeave'; // TODO(matsko): get rid of this
-        } else {
-          beforeFn = 'before' + event.charAt(0).toUpperCase() + event.substr(1);
-          afterFn = event;
-        }
-
-        if (event !== 'enter' && event !== 'move') {
-          before = packageAnimations(element, event, options, animations, beforeFn);
-        }
-        after  = packageAnimations(element, event, options, animations, afterFn);
-      }
-
-      // no matching animations
-      if (!before && !after) return;
-
-      function applyOptions() {
-        options.domOperation();
-        applyAnimationClasses(element, options);
-      }
-
-      return {
-        start: function() {
-          var closeActiveAnimations;
-          var chain = [];
-
-          if (before) {
-            chain.push(function(fn) {
-              closeActiveAnimations = before(fn);
-            });
-          }
-
-          if (chain.length) {
-            chain.push(function(fn) {
-              applyOptions();
-              fn(true);
-            });
-          } else {
-            applyOptions();
-          }
-
-          if (after) {
-            chain.push(function(fn) {
-              closeActiveAnimations = after(fn);
-            });
-          }
-
-          var animationClosed = false;
-          var runner = new $$AnimateRunner({
-            end: function() {
-              endAnimations();
-            },
-            cancel: function() {
-              endAnimations(true);
-            }
-          });
-
-          $$AnimateRunner.chain(chain, onComplete);
-          return runner;
-
-          function onComplete(success) {
-            animationClosed = true;
-            applyOptions();
-            applyAnimationStyles(element, options);
-            runner.complete(success);
-          }
-
-          function endAnimations(cancelled) {
-            if (!animationClosed) {
-              (closeActiveAnimations || noop)(cancelled);
-              onComplete(cancelled);
-            }
-          }
-        }
-      };
-
-      function executeAnimationFn(fn, element, event, options, onDone) {
-        var args;
-        switch (event) {
-          case 'animate':
-            args = [element, options.from, options.to, onDone];
-            break;
-
-          case 'setClass':
-            args = [element, classesToAdd, classesToRemove, onDone];
-            break;
-
-          case 'addClass':
-            args = [element, classesToAdd, onDone];
-            break;
-
-          case 'removeClass':
-            args = [element, classesToRemove, onDone];
-            break;
-
-          default:
-            args = [element, onDone];
-            break;
-        }
-
-        args.push(options);
-
-        var value = fn.apply(fn, args);
-        if (value) {
-          if (isFunction(value.start)) {
-            value = value.start();
-          }
-
-          if (value instanceof $$AnimateRunner) {
-            value.done(onDone);
-          } else if (isFunction(value)) {
-            // optional onEnd / onCancel callback
-            return value;
-          }
-        }
-
-        return noop;
-      }
-
-      function groupEventedAnimations(element, event, options, animations, fnName) {
-        var operations = [];
-        forEach(animations, function(ani) {
-          var animation = ani[fnName];
-          if (!animation) return;
-
-          // note that all of these animations will run in parallel
-          operations.push(function() {
-            var runner;
-            var endProgressCb;
-
-            var resolved = false;
-            var onAnimationComplete = function(rejected) {
-              if (!resolved) {
-                resolved = true;
-                (endProgressCb || noop)(rejected);
-                runner.complete(!rejected);
-              }
-            };
-
-            runner = new $$AnimateRunner({
-              end: function() {
-                onAnimationComplete();
-              },
-              cancel: function() {
-                onAnimationComplete(true);
-              }
-            });
-
-            endProgressCb = executeAnimationFn(animation, element, event, options, function(result) {
-              var cancelled = result === false;
-              onAnimationComplete(cancelled);
-            });
-
-            return runner;
-          });
-        });
-
-        return operations;
-      }
-
-      function packageAnimations(element, event, options, animations, fnName) {
-        var operations = groupEventedAnimations(element, event, options, animations, fnName);
-        if (operations.length === 0) {
-          var a,b;
-          if (fnName === 'beforeSetClass') {
-            a = groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass');
-            b = groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass');
-          } else if (fnName === 'setClass') {
-            a = groupEventedAnimations(element, 'removeClass', options, animations, 'removeClass');
-            b = groupEventedAnimations(element, 'addClass', options, animations, 'addClass');
-          }
-
-          if (a) {
-            operations = operations.concat(a);
-          }
-          if (b) {
-            operations = operations.concat(b);
-          }
-        }
-
-        if (operations.length === 0) return;
-
-        // TODO(matsko): add documentation
-        return function startAnimation(callback) {
-          var runners = [];
-          if (operations.length) {
-            forEach(operations, function(animateFn) {
-              runners.push(animateFn());
-            });
-          }
-
-          runners.length ? $$AnimateRunner.all(runners, callback) : callback();
-
-          return function endFn(reject) {
-            forEach(runners, function(runner) {
-              reject ? runner.cancel() : runner.end();
-            });
-          };
-        };
-      }
-    };
-
-    function lookupAnimations(classes) {
-      classes = isArray(classes) ? classes : classes.split(' ');
-      var matches = [], flagMap = {};
-      for (var i=0; i < classes.length; i++) {
-        var klass = classes[i],
-            animationFactory = $animateProvider.$$registeredAnimations[klass];
-        if (animationFactory && !flagMap[klass]) {
-          matches.push($injector.get(animationFactory));
-          flagMap[klass] = true;
-        }
-      }
-      return matches;
-    }
-  }];
-}];
-
-var $$AnimateJsDriverProvider = ['$$animationProvider', function($$animationProvider) {
-  $$animationProvider.drivers.push('$$animateJsDriver');
-  this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {
-    return function initDriverFn(animationDetails) {
-      if (animationDetails.from && animationDetails.to) {
-        var fromAnimation = prepareAnimation(animationDetails.from);
-        var toAnimation = prepareAnimation(animationDetails.to);
-        if (!fromAnimation && !toAnimation) return;
-
-        return {
-          start: function() {
-            var animationRunners = [];
-
-            if (fromAnimation) {
-              animationRunners.push(fromAnimation.start());
-            }
-
-            if (toAnimation) {
-              animationRunners.push(toAnimation.start());
-            }
-
-            $$AnimateRunner.all(animationRunners, done);
-
-            var runner = new $$AnimateRunner({
-              end: endFnFactory(),
-              cancel: endFnFactory()
-            });
-
-            return runner;
-
-            function endFnFactory() {
-              return function() {
-                forEach(animationRunners, function(runner) {
-                  // at this point we cannot cancel animations for groups just yet. 1.5+
-                  runner.end();
-                });
-              };
-            }
-
-            function done(status) {
-              runner.complete(status);
-            }
-          }
-        };
-      } else {
-        return prepareAnimation(animationDetails);
-      }
-    };
-
-    function prepareAnimation(animationDetails) {
-      // TODO(matsko): make sure to check for grouped animations and delegate down to normal animations
-      var element = animationDetails.element;
-      var event = animationDetails.event;
-      var options = animationDetails.options;
-      var classes = animationDetails.classes;
-      return $$animateJs(element, event, classes, options);
-    }
-  }];
-}];
-
-var NG_ANIMATE_ATTR_NAME = 'data-ng-animate';
-var NG_ANIMATE_PIN_DATA = '$ngAnimatePin';
-var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
-  var PRE_DIGEST_STATE = 1;
-  var RUNNING_STATE = 2;
-
-  var rules = this.rules = {
-    skip: [],
-    cancel: [],
-    join: []
-  };
-
-  function isAllowed(ruleType, element, currentAnimation, previousAnimation) {
-    return rules[ruleType].some(function(fn) {
-      return fn(element, currentAnimation, previousAnimation);
-    });
-  }
-
-  function hasAnimationClasses(options, and) {
-    options = options || {};
-    var a = (options.addClass || '').length > 0;
-    var b = (options.removeClass || '').length > 0;
-    return and ? a && b : a || b;
-  }
-
-  rules.join.push(function(element, newAnimation, currentAnimation) {
-    // if the new animation is class-based then we can just tack that on
-    return !newAnimation.structural && hasAnimationClasses(newAnimation.options);
-  });
-
-  rules.skip.push(function(element, newAnimation, currentAnimation) {
-    // there is no need to animate anything if no classes are being added and
-    // there is no structural animation that will be triggered
-    return !newAnimation.structural && !hasAnimationClasses(newAnimation.options);
-  });
-
-  rules.skip.push(function(element, newAnimation, currentAnimation) {
-    // why should we trigger a new structural animation if the element will
-    // be removed from the DOM anyway?
-    return currentAnimation.event == 'leave' && newAnimation.structural;
-  });
-
-  rules.skip.push(function(element, newAnimation, currentAnimation) {
-    // if there is an ongoing current animation then don't even bother running the class-based animation
-    return currentAnimation.structural && currentAnimation.state === RUNNING_STATE && !newAnimation.structural;
-  });
-
-  rules.cancel.push(function(element, newAnimation, currentAnimation) {
-    // there can never be two structural animations running at the same time
-    return currentAnimation.structural && newAnimation.structural;
-  });
-
-  rules.cancel.push(function(element, newAnimation, currentAnimation) {
-    // if the previous animation is already running, but the new animation will
-    // be triggered, but the new animation is structural
-    return currentAnimation.state === RUNNING_STATE && newAnimation.structural;
-  });
-
-  rules.cancel.push(function(element, newAnimation, currentAnimation) {
-    var nO = newAnimation.options;
-    var cO = currentAnimation.options;
-
-    // if the exact same CSS class is added/removed then it's safe to cancel it
-    return (nO.addClass && nO.addClass === cO.removeClass) || (nO.removeClass && nO.removeClass === cO.addClass);
-  });
-
-  this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$HashMap',
-               '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow',
-       function($$rAF,   $rootScope,   $rootElement,   $document,   $$HashMap,
-                $$animation,   $$AnimateRunner,   $templateRequest,   $$jqLite,   $$forceReflow) {
-
-    var activeAnimationsLookup = new $$HashMap();
-    var disabledElementsLookup = new $$HashMap();
-    var animationsEnabled = null;
-
-    function postDigestTaskFactory() {
-      var postDigestCalled = false;
-      return function(fn) {
-        // we only issue a call to postDigest before
-        // it has first passed. This prevents any callbacks
-        // from not firing once the animation has completed
-        // since it will be out of the digest cycle.
-        if (postDigestCalled) {
-          fn();
-        } else {
-          $rootScope.$$postDigest(function() {
-            postDigestCalled = true;
-            fn();
-          });
-        }
-      };
-    }
-
-    // Wait until all directive and route-related templates are downloaded and
-    // compiled. The $templateRequest.totalPendingRequests variable keeps track of
-    // all of the remote templates being currently downloaded. If there are no
-    // templates currently downloading then the watcher will still fire anyway.
-    var deregisterWatch = $rootScope.$watch(
-      function() { return $templateRequest.totalPendingRequests === 0; },
-      function(isEmpty) {
-        if (!isEmpty) return;
-        deregisterWatch();
-
-        // Now that all templates have been downloaded, $animate will wait until
-        // the post digest queue is empty before enabling animations. By having two
-        // calls to $postDigest calls we can ensure that the flag is enabled at the
-        // very end of the post digest queue. Since all of the animations in $animate
-        // use $postDigest, it's important that the code below executes at the end.
-        // This basically means that the page is fully downloaded and compiled before
-        // any animations are triggered.
-        $rootScope.$$postDigest(function() {
-          $rootScope.$$postDigest(function() {
-            // we check for null directly in the event that the application already called
-            // .enabled() with whatever arguments that it provided it with
-            if (animationsEnabled === null) {
-              animationsEnabled = true;
-            }
-          });
-        });
-      }
-    );
-
-    var callbackRegistry = {};
-
-    // remember that the classNameFilter is set during the provider/config
-    // stage therefore we can optimize here and setup a helper function
-    var classNameFilter = $animateProvider.classNameFilter();
-    var isAnimatableClassName = !classNameFilter
-              ? function() { return true; }
-              : function(className) {
-                return classNameFilter.test(className);
-              };
-
-    var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
-
-    function normalizeAnimationOptions(element, options) {
-      return mergeAnimationOptions(element, options, {});
-    }
-
-    function findCallbacks(element, event) {
-      var targetNode = getDomNode(element);
-
-      var matches = [];
-      var entries = callbackRegistry[event];
-      if (entries) {
-        forEach(entries, function(entry) {
-          if (entry.node.contains(targetNode)) {
-            matches.push(entry.callback);
-          }
-        });
-      }
-
-      return matches;
-    }
-
-    return {
-      on: function(event, container, callback) {
-        var node = extractElementNode(container);
-        callbackRegistry[event] = callbackRegistry[event] || [];
-        callbackRegistry[event].push({
-          node: node,
-          callback: callback
-        });
-      },
-
-      off: function(event, container, callback) {
-        var entries = callbackRegistry[event];
-        if (!entries) return;
-
-        callbackRegistry[event] = arguments.length === 1
-            ? null
-            : filterFromRegistry(entries, container, callback);
-
-        function filterFromRegistry(list, matchContainer, matchCallback) {
-          var containerNode = extractElementNode(matchContainer);
-          return list.filter(function(entry) {
-            var isMatch = entry.node === containerNode &&
-                            (!matchCallback || entry.callback === matchCallback);
-            return !isMatch;
-          });
-        }
-      },
-
-      pin: function(element, parentElement) {
-        assertArg(isElement(element), 'element', 'not an element');
-        assertArg(isElement(parentElement), 'parentElement', 'not an element');
-        element.data(NG_ANIMATE_PIN_DATA, parentElement);
-      },
-
-      push: function(element, event, options, domOperation) {
-        options = options || {};
-        options.domOperation = domOperation;
-        return queueAnimation(element, event, options);
-      },
-
-      // this method has four signatures:
-      //  () - global getter
-      //  (bool) - global setter
-      //  (element) - element getter
-      //  (element, bool) - element setter<F37>
-      enabled: function(element, bool) {
-        var argCount = arguments.length;
-
-        if (argCount === 0) {
-          // () - Global getter
-          bool = !!animationsEnabled;
-        } else {
-          var hasElement = isElement(element);
-
-          if (!hasElement) {
-            // (bool) - Global setter
-            bool = animationsEnabled = !!element;
-          } else {
-            var node = getDomNode(element);
-            var recordExists = disabledElementsLookup.get(node);
-
-            if (argCount === 1) {
-              // (element) - Element getter
-              bool = !recordExists;
-            } else {
-              // (element, bool) - Element setter
-              bool = !!bool;
-              if (!bool) {
-                disabledElementsLookup.put(node, true);
-              } else if (recordExists) {
-                disabledElementsLookup.remove(node);
-              }
-            }
-          }
-        }
-
-        return bool;
-      }
-    };
-
-    function queueAnimation(element, event, options) {
-      var node, parent;
-      element = stripCommentsFromElement(element);
-      if (element) {
-        node = getDomNode(element);
-        parent = element.parent();
-      }
-
-      options = prepareAnimationOptions(options);
-
-      // we create a fake runner with a working promise.
-      // These methods will become available after the digest has passed
-      var runner = new $$AnimateRunner();
-
-      // this is used to trigger callbacks in postDigest mode
-      var runInNextPostDigestOrNow = postDigestTaskFactory();
-
-      if (isArray(options.addClass)) {
-        options.addClass = options.addClass.join(' ');
-      }
-
-      if (options.addClass && !isString(options.addClass)) {
-        options.addClass = null;
-      }
-
-      if (isArray(options.removeClass)) {
-        options.removeClass = options.removeClass.join(' ');
-      }
-
-      if (options.removeClass && !isString(options.removeClass)) {
-        options.removeClass = null;
-      }
-
-      if (options.from && !isObject(options.from)) {
-        options.from = null;
-      }
-
-      if (options.to && !isObject(options.to)) {
-        options.to = null;
-      }
-
-      // there are situations where a directive issues an animation for
-      // a jqLite wrapper that contains only comment nodes... If this
-      // happens then there is no way we can perform an animation
-      if (!node) {
-        close();
-        return runner;
-      }
-
-      var className = [node.className, options.addClass, options.removeClass].join(' ');
-      if (!isAnimatableClassName(className)) {
-        close();
-        return runner;
-      }
-
-      var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;
-
-      // this is a hard disable of all animations for the application or on
-      // the element itself, therefore  there is no need to continue further
-      // past this point if not enabled
-      var skipAnimations = !animationsEnabled || disabledElementsLookup.get(node);
-      var existingAnimation = (!skipAnimations && activeAnimationsLookup.get(node)) || {};
-      var hasExistingAnimation = !!existingAnimation.state;
-
-      // there is no point in traversing the same collection of parent ancestors if a followup
-      // animation will be run on the same element that already did all that checking work
-      if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state != PRE_DIGEST_STATE)) {
-        skipAnimations = !areAnimationsAllowed(element, parent, event);
-      }
-
-      if (skipAnimations) {
-        close();
-        return runner;
-      }
-
-      if (isStructural) {
-        closeChildAnimations(element);
-      }
-
-      var newAnimation = {
-        structural: isStructural,
-        element: element,
-        event: event,
-        close: close,
-        options: options,
-        runner: runner
-      };
-
-      if (hasExistingAnimation) {
-        var skipAnimationFlag = isAllowed('skip', element, newAnimation, existingAnimation);
-        if (skipAnimationFlag) {
-          if (existingAnimation.state === RUNNING_STATE) {
-            close();
-            return runner;
-          } else {
-            mergeAnimationOptions(element, existingAnimation.options, options);
-            return existingAnimation.runner;
-          }
-        }
-
-        var cancelAnimationFlag = isAllowed('cancel', element, newAnimation, existingAnimation);
-        if (cancelAnimationFlag) {
-          if (existingAnimation.state === RUNNING_STATE) {
-            // this will end the animation right away and it is safe
-            // to do so since the animation is already running and the
-            // runner callback code will run in async
-            existingAnimation.runner.end();
-          } else if (existingAnimation.structural) {
-            // this means that the animation is queued into a digest, but
-            // hasn't started yet. Therefore it is safe to run the close
-            // method which will call the runner methods in async.
-            existingAnimation.close();
-          } else {
-            // this will merge the new animation options into existing animation options
-            mergeAnimationOptions(element, existingAnimation.options, newAnimation.options);
-            return existingAnimation.runner;
-          }
-        } else {
-          // a joined animation means that this animation will take over the existing one
-          // so an example would involve a leave animation taking over an enter. Then when
-          // the postDigest kicks in the enter will be ignored.
-          var joinAnimationFlag = isAllowed('join', element, newAnimation, existingAnimation);
-          if (joinAnimationFlag) {
-            if (existingAnimation.state === RUNNING_STATE) {
-              normalizeAnimationOptions(element, options);
-            } else {
-              applyGeneratedPreparationClasses(element, isStructural ? event : null, options);
-
-              event = newAnimation.event = existingAnimation.event;
-              options = mergeAnimationOptions(element, existingAnimation.options, newAnimation.options);
-
-              //we return the same runner since only the option values of this animation will
-              //be fed into the `existingAnimation`.
-              return existingAnimation.runner;
-            }
-          }
-        }
-      } else {
-        // normalization in this case means that it removes redundant CSS classes that
-        // already exist (addClass) or do not exist (removeClass) on the element
-        normalizeAnimationOptions(element, options);
-      }
-
-      // when the options are merged and cleaned up we may end up not having to do
-      // an animation at all, therefore we should check this before issuing a post
-      // digest callback. Structural animations will always run no matter what.
-      var isValidAnimation = newAnimation.structural;
-      if (!isValidAnimation) {
-        // animate (from/to) can be quickly checked first, otherwise we check if any classes are present
-        isValidAnimation = (newAnimation.event === 'animate' && Object.keys(newAnimation.options.to || {}).length > 0)
-                            || hasAnimationClasses(newAnimation.options);
-      }
-
-      if (!isValidAnimation) {
-        close();
-        clearElementAnimationState(element);
-        return runner;
-      }
-
-      // the counter keeps track of cancelled animations
-      var counter = (existingAnimation.counter || 0) + 1;
-      newAnimation.counter = counter;
-
-      markElementAnimationState(element, PRE_DIGEST_STATE, newAnimation);
-
-      $rootScope.$$postDigest(function() {
-        var animationDetails = activeAnimationsLookup.get(node);
-        var animationCancelled = !animationDetails;
-        animationDetails = animationDetails || {};
-
-        // if addClass/removeClass is called before something like enter then the
-        // registered parent element may not be present. The code below will ensure
-        // that a final value for parent element is obtained
-        var parentElement = element.parent() || [];
-
-        // animate/structural/class-based animations all have requirements. Otherwise there
-        // is no point in performing an animation. The parent node must also be set.
-        var isValidAnimation = parentElement.length > 0
-                                && (animationDetails.event === 'animate'
-                                    || animationDetails.structural
-                                    || hasAnimationClasses(animationDetails.options));
-
-        // this means that the previous animation was cancelled
-        // even if the follow-up animation is the same event
-        if (animationCancelled || animationDetails.counter !== counter || !isValidAnimation) {
-          // if another animation did not take over then we need
-          // to make sure that the domOperation and options are
-          // handled accordingly
-          if (animationCancelled) {
-            applyAnimationClasses(element, options);
-            applyAnimationStyles(element, options);
-          }
-
-          // if the event changed from something like enter to leave then we do
-          // it, otherwise if it's the same then the end result will be the same too
-          if (animationCancelled || (isStructural && animationDetails.event !== event)) {
-            options.domOperation();
-            runner.end();
-          }
-
-          // in the event that the element animation was not cancelled or a follow-up animation
-          // isn't allowed to animate from here then we need to clear the state of the element
-          // so that any future animations won't read the expired animation data.
-          if (!isValidAnimation) {
-            clearElementAnimationState(element);
-          }
-
-          return;
-        }
-
-        // this combined multiple class to addClass / removeClass into a setClass event
-        // so long as a structural event did not take over the animation
-        event = !animationDetails.structural && hasAnimationClasses(animationDetails.options, true)
-            ? 'setClass'
-            : animationDetails.event;
-
-        markElementAnimationState(element, RUNNING_STATE);
-        var realRunner = $$animation(element, event, animationDetails.options);
-
-        realRunner.done(function(status) {
-          close(!status);
-          var animationDetails = activeAnimationsLookup.get(node);
-          if (animationDetails && animationDetails.counter === counter) {
-            clearElementAnimationState(getDomNode(element));
-          }
-          notifyProgress(runner, event, 'close', {});
-        });
-
-        // this will update the runner's flow-control events based on
-        // the `realRunner` object.
-        runner.setHost(realRunner);
-        notifyProgress(runner, event, 'start', {});
-      });
-
-      return runner;
-
-      function notifyProgress(runner, event, phase, data) {
-        runInNextPostDigestOrNow(function() {
-          var callbacks = findCallbacks(element, event);
-          if (callbacks.length) {
-            // do not optimize this call here to RAF because
-            // we don't know how heavy the callback code here will
-            // be and if this code is buffered then this can
-            // lead to a performance regression.
-            $$rAF(function() {
-              forEach(callbacks, function(callback) {
-                callback(element, phase, data);
-              });
-            });
-          }
-        });
-        runner.progress(event, phase, data);
-      }
-
-      function close(reject) { // jshint ignore:line
-        clearGeneratedClasses(element, options);
-        applyAnimationClasses(element, options);
-        applyAnimationStyles(element, options);
-        options.domOperation();
-        runner.complete(!reject);
-      }
-    }
-
-    function closeChildAnimations(element) {
-      var node = getDomNode(element);
-      var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']');
-      forEach(children, function(child) {
-        var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME));
-        var animationDetails = activeAnimationsLookup.get(child);
-        switch (state) {
-          case RUNNING_STATE:
-            animationDetails.runner.end();
-            /* falls through */
-          case PRE_DIGEST_STATE:
-            if (animationDetails) {
-              activeAnimationsLookup.remove(child);
-            }
-            break;
-        }
-      });
-    }
-
-    function clearElementAnimationState(element) {
-      var node = getDomNode(element);
-      node.removeAttribute(NG_ANIMATE_ATTR_NAME);
-      activeAnimationsLookup.remove(node);
-    }
-
-    function isMatchingElement(nodeOrElmA, nodeOrElmB) {
-      return getDomNode(nodeOrElmA) === getDomNode(nodeOrElmB);
-    }
-
-    function areAnimationsAllowed(element, parentElement, event) {
-      var bodyElement = jqLite($document[0].body);
-      var bodyElementDetected = isMatchingElement(element, bodyElement) || element[0].nodeName === 'HTML';
-      var rootElementDetected = isMatchingElement(element, $rootElement);
-      var parentAnimationDetected = false;
-      var animateChildren;
-
-      var parentHost = element.data(NG_ANIMATE_PIN_DATA);
-      if (parentHost) {
-        parentElement = parentHost;
-      }
-
-      while (parentElement && parentElement.length) {
-        if (!rootElementDetected) {
-          // angular doesn't want to attempt to animate elements outside of the application
-          // therefore we need to ensure that the rootElement is an ancestor of the current element
-          rootElementDetected = isMatchingElement(parentElement, $rootElement);
-        }
-
-        var parentNode = parentElement[0];
-        if (parentNode.nodeType !== ELEMENT_NODE) {
-          // no point in inspecting the #document element
-          break;
-        }
-
-        var details = activeAnimationsLookup.get(parentNode) || {};
-        // either an enter, leave or move animation will commence
-        // therefore we can't allow any animations to take place
-        // but if a parent animation is class-based then that's ok
-        if (!parentAnimationDetected) {
-          parentAnimationDetected = details.structural || disabledElementsLookup.get(parentNode);
-        }
-
-        if (isUndefined(animateChildren) || animateChildren === true) {
-          var value = parentElement.data(NG_ANIMATE_CHILDREN_DATA);
-          if (isDefined(value)) {
-            animateChildren = value;
-          }
-        }
-
-        // there is no need to continue traversing at this point
-        if (parentAnimationDetected && animateChildren === false) break;
-
-        if (!rootElementDetected) {
-          // angular doesn't want to attempt to animate elements outside of the application
-          // therefore we need to ensure that the rootElement is an ancestor of the current element
-          rootElementDetected = isMatchingElement(parentElement, $rootElement);
-          if (!rootElementDetected) {
-            parentHost = parentElement.data(NG_ANIMATE_PIN_DATA);
-            if (parentHost) {
-              parentElement = parentHost;
-            }
-          }
-        }
-
-        if (!bodyElementDetected) {
-          // we also need to ensure that the element is or will be apart of the body element
-          // otherwise it is pointless to even issue an animation to be rendered
-          bodyElementDetected = isMatchingElement(parentElement, bodyElement);
-        }
-
-        parentElement = parentElement.parent();
-      }
-
-      var allowAnimation = !parentAnimationDetected || animateChildren;
-      return allowAnimation && rootElementDetected && bodyElementDetected;
-    }
-
-    function markElementAnimationState(element, state, details) {
-      details = details || {};
-      details.state = state;
-
-      var node = getDomNode(element);
-      node.setAttribute(NG_ANIMATE_ATTR_NAME, state);
-
-      var oldValue = activeAnimationsLookup.get(node);
-      var newValue = oldValue
-          ? extend(oldValue, details)
-          : details;
-      activeAnimationsLookup.put(node, newValue);
-    }
-  }];
-}];
-
-var $$AnimateAsyncRunFactory = ['$$rAF', function($$rAF) {
-  var waitQueue = [];
-
-  function waitForTick(fn) {
-    waitQueue.push(fn);
-    if (waitQueue.length > 1) return;
-    $$rAF(function() {
-      for (var i = 0; i < waitQueue.length; i++) {
-        waitQueue[i]();
-      }
-      waitQueue = [];
-    });
-  }
-
-  return function() {
-    var passed = false;
-    waitForTick(function() {
-      passed = true;
-    });
-    return function(callback) {
-      passed ? callback() : waitForTick(callback);
-    };
-  };
-}];
-
-var $$AnimateRunnerFactory = ['$q', '$sniffer', '$$animateAsyncRun',
-                      function($q,   $sniffer,   $$animateAsyncRun) {
-
-  var INITIAL_STATE = 0;
-  var DONE_PENDING_STATE = 1;
-  var DONE_COMPLETE_STATE = 2;
-
-  AnimateRunner.chain = function(chain, callback) {
-    var index = 0;
-
-    next();
-    function next() {
-      if (index === chain.length) {
-        callback(true);
-        return;
-      }
-
-      chain[index](function(response) {
-        if (response === false) {
-          callback(false);
-          return;
-        }
-        index++;
-        next();
-      });
-    }
-  };
-
-  AnimateRunner.all = function(runners, callback) {
-    var count = 0;
-    var status = true;
-    forEach(runners, function(runner) {
-      runner.done(onProgress);
-    });
-
-    function onProgress(response) {
-      status = status && response;
-      if (++count === runners.length) {
-        callback(status);
-      }
-    }
-  };
-
-  function AnimateRunner(host) {
-    this.setHost(host);
-
-    this._doneCallbacks = [];
-    this._runInAnimationFrame = $$animateAsyncRun();
-    this._state = 0;
-  }
-
-  AnimateRunner.prototype = {
-    setHost: function(host) {
-      this.host = host || {};
-    },
-
-    done: function(fn) {
-      if (this._state === DONE_COMPLETE_STATE) {
-        fn();
-      } else {
-        this._doneCallbacks.push(fn);
-      }
-    },
-
-    progress: noop,
-
-    getPromise: function() {
-      if (!this.promise) {
-        var self = this;
-        this.promise = $q(function(resolve, reject) {
-          self.done(function(status) {
-            status === false ? reject() : resolve();
-          });
-        });
-      }
-      return this.promise;
-    },
-
-    then: function(resolveHandler, rejectHandler) {
-      return this.getPromise().then(resolveHandler, rejectHandler);
-    },
-
-    'catch': function(handler) {
-      return this.getPromise()['catch'](handler);
-    },
-
-    'finally': function(handler) {
-      return this.getPromise()['finally'](handler);
-    },
-
-    pause: function() {
-      if (this.host.pause) {
-        this.host.pause();
-      }
-    },
-
-    resume: function() {
-      if (this.host.resume) {
-        this.host.resume();
-      }
-    },
-
-    end: function() {
-      if (this.host.end) {
-        this.host.end();
-      }
-      this._resolve(true);
-    },
-
-    cancel: function() {
-      if (this.host.cancel) {
-        this.host.cancel();
-      }
-      this._resolve(false);
-    },
-
-    complete: function(response) {
-      var self = this;
-      if (self._state === INITIAL_STATE) {
-        self._state = DONE_PENDING_STATE;
-        self._runInAnimationFrame(function() {
-          self._resolve(response);
-        });
-      }
-    },
-
-    _resolve: function(response) {
-      if (this._state !== DONE_COMPLETE_STATE) {
-        forEach(this._doneCallbacks, function(fn) {
-          fn(response);
-        });
-        this._doneCallbacks.length = 0;
-        this._state = DONE_COMPLETE_STATE;
-      }
-    }
-  };
-
-  return AnimateRunner;
-}];
-
-var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
-  var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';
-
-  var drivers = this.drivers = [];
-
-  var RUNNER_STORAGE_KEY = '$$animationRunner';
-
-  function setRunner(element, runner) {
-    element.data(RUNNER_STORAGE_KEY, runner);
-  }
-
-  function removeRunner(element) {
-    element.removeData(RUNNER_STORAGE_KEY);
-  }
-
-  function getRunner(element) {
-    return element.data(RUNNER_STORAGE_KEY);
-  }
-
-  this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$HashMap', '$$rAFScheduler',
-       function($$jqLite,   $rootScope,   $injector,   $$AnimateRunner,   $$HashMap,   $$rAFScheduler) {
-
-    var animationQueue = [];
-    var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
-
-    function sortAnimations(animations) {
-      var tree = { children: [] };
-      var i, lookup = new $$HashMap();
-
-      // this is done first beforehand so that the hashmap
-      // is filled with a list of the elements that will be animated
-      for (i = 0; i < animations.length; i++) {
-        var animation = animations[i];
-        lookup.put(animation.domNode, animations[i] = {
-          domNode: animation.domNode,
-          fn: animation.fn,
-          children: []
-        });
-      }
-
-      for (i = 0; i < animations.length; i++) {
-        processNode(animations[i]);
-      }
-
-      return flatten(tree);
-
-      function processNode(entry) {
-        if (entry.processed) return entry;
-        entry.processed = true;
-
-        var elementNode = entry.domNode;
-        var parentNode = elementNode.parentNode;
-        lookup.put(elementNode, entry);
-
-        var parentEntry;
-        while (parentNode) {
-          parentEntry = lookup.get(parentNode);
-          if (parentEntry) {
-            if (!parentEntry.processed) {
-              parentEntry = processNode(parentEntry);
-            }
-            break;
-          }
-          parentNode = parentNode.parentNode;
-        }
-
-        (parentEntry || tree).children.push(entry);
-        return entry;
-      }
-
-      function flatten(tree) {
-        var result = [];
-        var queue = [];
-        var i;
-
-        for (i = 0; i < tree.children.length; i++) {
-          queue.push(tree.children[i]);
-        }
-
-        var remainingLevelEntries = queue.length;
-        var nextLevelEntries = 0;
-        var row = [];
-
-        for (i = 0; i < queue.length; i++) {
-          var entry = queue[i];
-          if (remainingLevelEntries <= 0) {
-            remainingLevelEntries = nextLevelEntries;
-            nextLevelEntries = 0;
-            result.push(row);
-            row = [];
-          }
-          row.push(entry.fn);
-          entry.children.forEach(function(childEntry) {
-            nextLevelEntries++;
-            queue.push(childEntry);
-          });
-          remainingLevelEntries--;
-        }
-
-        if (row.length) {
-          result.push(row);
-        }
-
-        return result;
-      }
-    }
-
-    // TODO(matsko): document the signature in a better way
-    return function(element, event, options) {
-      options = prepareAnimationOptions(options);
-      var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;
-
-      // there is no animation at the current moment, however
-      // these runner methods will get later updated with the
-      // methods leading into the driver's end/cancel methods
-      // for now they just stop the animation from starting
-      var runner = new $$AnimateRunner({
-        end: function() { close(); },
-        cancel: function() { close(true); }
-      });
-
-      if (!drivers.length) {
-        close();
-        return runner;
-      }
-
-      setRunner(element, runner);
-
-      var classes = mergeClasses(element.attr('class'), mergeClasses(options.addClass, options.removeClass));
-      var tempClasses = options.tempClasses;
-      if (tempClasses) {
-        classes += ' ' + tempClasses;
-        options.tempClasses = null;
-      }
-
-      animationQueue.push({
-        // this data is used by the postDigest code and passed into
-        // the driver step function
-        element: element,
-        classes: classes,
-        event: event,
-        structural: isStructural,
-        options: options,
-        beforeStart: beforeStart,
-        close: close
-      });
-
-      element.on('$destroy', handleDestroyedElement);
-
-      // we only want there to be one function called within the post digest
-      // block. This way we can group animations for all the animations that
-      // were apart of the same postDigest flush call.
-      if (animationQueue.length > 1) return runner;
-
-      $rootScope.$$postDigest(function() {
-        var animations = [];
-        forEach(animationQueue, function(entry) {
-          // the element was destroyed early on which removed the runner
-          // form its storage. This means we can't animate this element
-          // at all and it already has been closed due to destruction.
-          if (getRunner(entry.element)) {
-            animations.push(entry);
-          } else {
-            entry.close();
-          }
-        });
-
-        // now any future animations will be in another postDigest
-        animationQueue.length = 0;
-
-        var groupedAnimations = groupAnimations(animations);
-        var toBeSortedAnimations = [];
-
-        forEach(groupedAnimations, function(animationEntry) {
-          toBeSortedAnimations.push({
-            domNode: getDomNode(animationEntry.from ? animationEntry.from.element : animationEntry.element),
-            fn: function triggerAnimationStart() {
-              // it's important that we apply the `ng-animate` CSS class and the
-              // temporary classes before we do any driver invoking since these
-              // CSS classes may be required for proper CSS detection.
-              animationEntry.beforeStart();
-
-              var startAnimationFn, closeFn = animationEntry.close;
-
-              // in the event that the element was removed before the digest runs or
-              // during the RAF sequencing then we should not trigger the animation.
-              var targetElement = animationEntry.anchors
-                  ? (animationEntry.from.element || animationEntry.to.element)
-                  : animationEntry.element;
-
-              if (getRunner(targetElement)) {
-                var operation = invokeFirstDriver(animationEntry);
-                if (operation) {
-                  startAnimationFn = operation.start;
-                }
-              }
-
-              if (!startAnimationFn) {
-                closeFn();
-              } else {
-                var animationRunner = startAnimationFn();
-                animationRunner.done(function(status) {
-                  closeFn(!status);
-                });
-                updateAnimationRunners(animationEntry, animationRunner);
-              }
-            }
-          });
-        });
-
-        // we need to sort each of the animations in order of parent to child
-        // relationships. This ensures that the child classes are applied at the
-        // right time.
-        $$rAFScheduler(sortAnimations(toBeSortedAnimations));
-      });
-
-      return runner;
-
-      // TODO(matsko): change to reference nodes
-      function getAnchorNodes(node) {
-        var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';
-        var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)
-              ? [node]
-              : node.querySelectorAll(SELECTOR);
-        var anchors = [];
-        forEach(items, function(node) {
-          var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);
-          if (attr && attr.length) {
-            anchors.push(node);
-          }
-        });
-        return anchors;
-      }
-
-      function groupAnimations(animations) {
-        var preparedAnimations = [];
-        var refLookup = {};
-        forEach(animations, function(animation, index) {
-          var element = animation.element;
-          var node = getDomNode(element);
-          var event = animation.event;
-          var enterOrMove = ['enter', 'move'].indexOf(event) >= 0;
-          var anchorNodes = animation.structural ? getAnchorNodes(node) : [];
-
-          if (anchorNodes.length) {
-            var direction = enterOrMove ? 'to' : 'from';
-
-            forEach(anchorNodes, function(anchor) {
-              var key = anchor.getAttribute(NG_ANIMATE_REF_ATTR);
-              refLookup[key] = refLookup[key] || {};
-              refLookup[key][direction] = {
-                animationID: index,
-                element: jqLite(anchor)
-              };
-            });
-          } else {
-            preparedAnimations.push(animation);
-          }
-        });
-
-        var usedIndicesLookup = {};
-        var anchorGroups = {};
-        forEach(refLookup, function(operations, key) {
-          var from = operations.from;
-          var to = operations.to;
-
-          if (!from || !to) {
-            // only one of these is set therefore we can't have an
-            // anchor animation since all three pieces are required
-            var index = from ? from.animationID : to.animationID;
-            var indexKey = index.toString();
-            if (!usedIndicesLookup[indexKey]) {
-              usedIndicesLookup[indexKey] = true;
-              preparedAnimations.push(animations[index]);
-            }
-            return;
-          }
-
-          var fromAnimation = animations[from.animationID];
-          var toAnimation = animations[to.animationID];
-          var lookupKey = from.animationID.toString();
-          if (!anchorGroups[lookupKey]) {
-            var group = anchorGroups[lookupKey] = {
-              structural: true,
-              beforeStart: function() {
-                fromAnimation.beforeStart();
-                toAnimation.beforeStart();
-              },
-              close: function() {
-                fromAnimation.close();
-                toAnimation.close();
-              },
-              classes: cssClassesIntersection(fromAnimation.classes, toAnimation.classes),
-              from: fromAnimation,
-              to: toAnimation,
-              anchors: [] // TODO(matsko): change to reference nodes
-            };
-
-            // the anchor animations require that the from and to elements both have at least
-            // one shared CSS class which effictively marries the two elements together to use
-            // the same animation driver and to properly sequence the anchor animation.
-            if (group.classes.length) {
-              preparedAnimations.push(group);
-            } else {
-              preparedAnimations.push(fromAnimation);
-              preparedAnimations.push(toAnimation);
-            }
-          }
-
-          anchorGroups[lookupKey].anchors.push({
-            'out': from.element, 'in': to.element
-          });
-        });
-
-        return preparedAnimations;
-      }
-
-      function cssClassesIntersection(a,b) {
-        a = a.split(' ');
-        b = b.split(' ');
-        var matches = [];
-
-        for (var i = 0; i < a.length; i++) {
-          var aa = a[i];
-          if (aa.substring(0,3) === 'ng-') continue;
-
-          for (var j = 0; j < b.length; j++) {
-            if (aa === b[j]) {
-              matches.push(aa);
-              break;
-            }
-          }
-        }
-
-        return matches.join(' ');
-      }
-
-      function invokeFirstDriver(animationDetails) {
-        // we loop in reverse order since the more general drivers (like CSS and JS)
-        // may attempt more elements, but custom drivers are more particular
-        for (var i = drivers.length - 1; i >= 0; i--) {
-          var driverName = drivers[i];
-          if (!$injector.has(driverName)) continue; // TODO(matsko): remove this check
-
-          var factory = $injector.get(driverName);
-          var driver = factory(animationDetails);
-          if (driver) {
-            return driver;
-          }
-        }
-      }
-
-      function beforeStart() {
-        element.addClass(NG_ANIMATE_CLASSNAME);
-        if (tempClasses) {
-          $$jqLite.addClass(element, tempClasses);
-        }
-      }
-
-      function updateAnimationRunners(animation, newRunner) {
-        if (animation.from && animation.to) {
-          update(animation.from.element);
-          update(animation.to.element);
-        } else {
-          update(animation.element);
-        }
-
-        function update(element) {
-          getRunner(element).setHost(newRunner);
-        }
-      }
-
-      function handleDestroyedElement() {
-        var runner = getRunner(element);
-        if (runner && (event !== 'leave' || !options.$$domOperationFired)) {
-          runner.end();
-        }
-      }
-
-      function close(rejected) { // jshint ignore:line
-        element.off('$destroy', handleDestroyedElement);
-        removeRunner(element);
-
-        applyAnimationClasses(element, options);
-        applyAnimationStyles(element, options);
-        options.domOperation();
-
-        if (tempClasses) {
-          $$jqLite.removeClass(element, tempClasses);
-        }
-
-        element.removeClass(NG_ANIMATE_CLASSNAME);
-        runner.complete(!rejected);
-      }
-    };
-  }];
-}];
-
-/* global angularAnimateModule: true,
-
-   $$AnimateAsyncRunFactory,
-   $$rAFSchedulerFactory,
-   $$AnimateChildrenDirective,
-   $$AnimateRunnerFactory,
-   $$AnimateQueueProvider,
-   $$AnimationProvider,
-   $AnimateCssProvider,
-   $$AnimateCssDriverProvider,
-   $$AnimateJsProvider,
-   $$AnimateJsDriverProvider,
-*/
-
-/**
- * @ngdoc module
- * @name ngAnimate
- * @description
- *
- * The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via
- * callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an Angular app.
- *
- * <div doc-module-components="ngAnimate"></div>
- *
- * # Usage
- * Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based
- * using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For
- * both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within
- * the HTML element that the animation will be triggered on.
- *
- * ## Directive Support
- * The following directives are "animation aware":
- *
- * | Directive                                                                                                | Supported Animations                                                     |
- * |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
- * | {@link ng.directive:ngRepeat#animations ngRepeat}                                                        | enter, leave and move                                                    |
- * | {@link ngRoute.directive:ngView#animations ngView}                                                       | enter and leave                                                          |
- * | {@link ng.directive:ngInclude#animations ngInclude}                                                      | enter and leave                                                          |
- * | {@link ng.directive:ngSwitch#animations ngSwitch}                                                        | enter and leave                                                          |
- * | {@link ng.directive:ngIf#animations ngIf}                                                                | enter and leave                                                          |
- * | {@link ng.directive:ngClass#animations ngClass}                                                          | add and remove (the CSS class(es) present)                               |
- * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide}            | add and remove (the ng-hide class value)                                 |
- * | {@link ng.directive:form#animation-hooks form} & {@link ng.directive:ngModel#animation-hooks ngModel}    | add and remove (dirty, pristine, valid, invalid & all other validations) |
- * | {@link module:ngMessages#animations ngMessages}                                                          | add and remove (ng-active & ng-inactive)                                 |
- * | {@link module:ngMessages#animations ngMessage}                                                           | enter and leave                                                          |
- *
- * (More information can be found by visiting each the documentation associated with each directive.)
- *
- * ## CSS-based Animations
- *
- * CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML
- * and CSS code we can create an animation that will be picked up by Angular when an the underlying directive performs an operation.
- *
- * The example below shows how an `enter` animation can be made possible on an element using `ng-if`:
- *
- * ```html
- * <div ng-if="bool" class="fade">
- *    Fade me in out
- * </div>
- * <button ng-click="bool=true">Fade In!</button>
- * <button ng-click="bool=false">Fade Out!</button>
- * ```
- *
- * Notice the CSS class **fade**? We can now create the CSS transition code that references this class:
- *
- * ```css
- * /&#42; The starting CSS styles for the enter animation &#42;/
- * .fade.ng-enter {
- *   transition:0.5s linear all;
- *   opacity:0;
- * }
- *
- * /&#42; The finishing CSS styles for the enter animation &#42;/
- * .fade.ng-enter.ng-enter-active {
- *   opacity:1;
- * }
- * ```
- *
- * The key thing to remember here is that, depending on the animation event (which each of the directives above trigger depending on what's going on) two
- * generated CSS classes will be applied to the element; in the example above we have `.ng-enter` and `.ng-enter-active`. For CSS transitions, the transition
- * code **must** be defined within the starting CSS class (in this case `.ng-enter`). The destination class is what the transition will animate towards.
- *
- * If for example we wanted to create animations for `leave` and `move` (ngRepeat triggers move) then we can do so using the same CSS naming conventions:
- *
- * ```css
- * /&#42; now the element will fade out before it is removed from the DOM &#42;/
- * .fade.ng-leave {
- *   transition:0.5s linear all;
- *   opacity:1;
- * }
- * .fade.ng-leave.ng-leave-active {
- *   opacity:0;
- * }
- * ```
- *
- * We can also make use of **CSS Keyframes** by referencing the keyframe animation within the starting CSS class:
- *
- * ```css
- * /&#42; there is no need to define anything inside of the destination
- * CSS class since the keyframe will take charge of the animation &#42;/
- * .fade.ng-leave {
- *   animation: my_fade_animation 0.5s linear;
- *   -webkit-animation: my_fade_animation 0.5s linear;
- * }
- *
- * @keyframes my_fade_animation {
- *   from { opacity:1; }
- *   to { opacity:0; }
- * }
- *
- * @-webkit-keyframes my_fade_animation {
- *   from { opacity:1; }
- *   to { opacity:0; }
- * }
- * ```
- *
- * Feel free also mix transitions and keyframes together as well as any other CSS classes on the same element.
- *
- * ### CSS Class-based Animations
- *
- * Class-based animations (animations that are triggered via `ngClass`, `ngShow`, `ngHide` and some other directives) have a slightly different
- * naming convention. Class-based animations are basic enough that a standard transition or keyframe can be referenced on the class being added
- * and removed.
- *
- * For example if we wanted to do a CSS animation for `ngHide` then we place an animation on the `.ng-hide` CSS class:
- *
- * ```html
- * <div ng-show="bool" class="fade">
- *   Show and hide me
- * </div>
- * <button ng-click="bool=true">Toggle</button>
- *
- * <style>
- * .fade.ng-hide {
- *   transition:0.5s linear all;
- *   opacity:0;
- * }
- * </style>
- * ```
- *
- * All that is going on here with ngShow/ngHide behind the scenes is the `.ng-hide` class is added/removed (when the hidden state is valid). Since
- * ngShow and ngHide are animation aware then we can match up a transition and ngAnimate handles the rest.
- *
- * In addition the addition and removal of the CSS class, ngAnimate also provides two helper methods that we can use to further decorate the animation
- * with CSS styles.
- *
- * ```html
- * <div ng-class="{on:onOff}" class="highlight">
- *   Highlight this box
- * </div>
- * <button ng-click="onOff=!onOff">Toggle</button>
- *
- * <style>
- * .highlight {
- *   transition:0.5s linear all;
- * }
- * .highlight.on-add {
- *   background:white;
- * }
- * .highlight.on {
- *   background:yellow;
- * }
- * .highlight.on-remove {
- *   background:black;
- * }
- * </style>
- * ```
- *
- * We can also make use of CSS keyframes by placing them within the CSS classes.
- *
- *
- * ### CSS Staggering Animations
- * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a
- * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be
- * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for
- * the animation. The style property expected within the stagger class can either be a **transition-delay** or an
- * **animation-delay** property (or both if your animation contains both transitions and keyframe animations).
- *
- * ```css
- * .my-animation.ng-enter {
- *   /&#42; standard transition code &#42;/
- *   transition: 1s linear all;
- *   opacity:0;
- * }
- * .my-animation.ng-enter-stagger {
- *   /&#42; this will have a 100ms delay between each successive leave animation &#42;/
- *   transition-delay: 0.1s;
- *
- *   /&#42; As of 1.4.4, this must always be set: it signals ngAnimate
- *     to not accidentally inherit a delay property from another CSS class &#42;/
- *   transition-duration: 0s;
- * }
- * .my-animation.ng-enter.ng-enter-active {
- *   /&#42; standard transition styles &#42;/
- *   opacity:1;
- * }
- * ```
- *
- * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations
- * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this
- * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation
- * will also be reset if one or more animation frames have passed since the multiple calls to `$animate` were fired.
- *
- * The following code will issue the **ng-leave-stagger** event on the element provided:
- *
- * ```js
- * var kids = parent.children();
- *
- * $animate.leave(kids[0]); //stagger index=0
- * $animate.leave(kids[1]); //stagger index=1
- * $animate.leave(kids[2]); //stagger index=2
- * $animate.leave(kids[3]); //stagger index=3
- * $animate.leave(kids[4]); //stagger index=4
- *
- * window.requestAnimationFrame(function() {
- *   //stagger has reset itself
- *   $animate.leave(kids[5]); //stagger index=0
- *   $animate.leave(kids[6]); //stagger index=1
- *
- *   $scope.$digest();
- * });
- * ```
- *
- * Stagger animations are currently only supported within CSS-defined animations.
- *
- * ### The `ng-animate` CSS class
- *
- * When ngAnimate is animating an element it will apply the `ng-animate` CSS class to the element for the duration of the animation.
- * This is a temporary CSS class and it will be removed once the animation is over (for both JavaScript and CSS-based animations).
- *
- * Therefore, animations can be applied to an element using this temporary class directly via CSS.
- *
- * ```css
- * .zipper.ng-animate {
- *   transition:0.5s linear all;
- * }
- * .zipper.ng-enter {
- *   opacity:0;
- * }
- * .zipper.ng-enter.ng-enter-active {
- *   opacity:1;
- * }
- * .zipper.ng-leave {
- *   opacity:1;
- * }
- * .zipper.ng-leave.ng-leave-active {
- *   opacity:0;
- * }
- * ```
- *
- * (Note that the `ng-animate` CSS class is reserved and it cannot be applied on an element directly since ngAnimate will always remove
- * the CSS class once an animation has completed.)
- *
- *
- * ## JavaScript-based Animations
- *
- * ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared
- * CSS class that is referenced in our HTML code) but in addition we need to register the JavaScript animation on the module. By making use of the
- * `module.animation()` module function we can register the ainmation.
- *
- * Let's see an example of a enter/leave animation using `ngRepeat`:
- *
- * ```html
- * <div ng-repeat="item in items" class="slide">
- *   {{ item }}
- * </div>
- * ```
- *
- * See the **slide** CSS class? Let's use that class to define an animation that we'll structure in our module code by using `module.animation`:
- *
- * ```js
- * myModule.animation('.slide', [function() {
- *   return {
- *     // make note that other events (like addClass/removeClass)
- *     // have different function input parameters
- *     enter: function(element, doneFn) {
- *       jQuery(element).fadeIn(1000, doneFn);
- *
- *       // remember to call doneFn so that angular
- *       // knows that the animation has concluded
- *     },
- *
- *     move: function(element, doneFn) {
- *       jQuery(element).fadeIn(1000, doneFn);
- *     },
- *
- *     leave: function(element, doneFn) {
- *       jQuery(element).fadeOut(1000, doneFn);
- *     }
- *   }
- * }]
- * ```
- *
- * The nice thing about JS-based animations is that we can inject other services and make use of advanced animation libraries such as
- * greensock.js and velocity.js.
- *
- * If our animation code class-based (meaning that something like `ngClass`, `ngHide` and `ngShow` triggers it) then we can still define
- * our animations inside of the same registered animation, however, the function input arguments are a bit different:
- *
- * ```html
- * <div ng-class="color" class="colorful">
- *   this box is moody
- * </div>
- * <button ng-click="color='red'">Change to red</button>
- * <button ng-click="color='blue'">Change to blue</button>
- * <button ng-click="color='green'">Change to green</button>
- * ```
- *
- * ```js
- * myModule.animation('.colorful', [function() {
- *   return {
- *     addClass: function(element, className, doneFn) {
- *       // do some cool animation and call the doneFn
- *     },
- *     removeClass: function(element, className, doneFn) {
- *       // do some cool animation and call the doneFn
- *     },
- *     setClass: function(element, addedClass, removedClass, doneFn) {
- *       // do some cool animation and call the doneFn
- *     }
- *   }
- * }]
- * ```
- *
- * ## CSS + JS Animations Together
- *
- * AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of Angular,
- * defining CSS and JS animations to work off of the same CSS class will not work anymore. Therefore the example below will only result in **JS animations taking
- * charge of the animation**:
- *
- * ```html
- * <div ng-if="bool" class="slide">
- *   Slide in and out
- * </div>
- * ```
- *
- * ```js
- * myModule.animation('.slide', [function() {
- *   return {
- *     enter: function(element, doneFn) {
- *       jQuery(element).slideIn(1000, doneFn);
- *     }
- *   }
- * }]
- * ```
- *
- * ```css
- * .slide.ng-enter {
- *   transition:0.5s linear all;
- *   transform:translateY(-100px);
- * }
- * .slide.ng-enter.ng-enter-active {
- *   transform:translateY(0);
- * }
- * ```
- *
- * Does this mean that CSS and JS animations cannot be used together? Do JS-based animations always have higher priority? We can make up for the
- * lack of CSS animations by using the `$animateCss` service to trigger our own tweaked-out, CSS-based animations directly from
- * our own JS-based animation code:
- *
- * ```js
- * myModule.animation('.slide', ['$animateCss', function($animateCss) {
- *   return {
- *     enter: function(element, doneFn) {
-*        // this will trigger `.slide.ng-enter` and `.slide.ng-enter-active`.
- *       var runner = $animateCss(element, {
- *         event: 'enter',
- *         structural: true
- *       }).start();
-*        runner.done(doneFn);
- *     }
- *   }
- * }]
- * ```
- *
- * The nice thing here is that we can save bandwidth by sticking to our CSS-based animation code and we don't need to rely on a 3rd-party animation framework.
- *
- * The `$animateCss` service is very powerful since we can feed in all kinds of extra properties that will be evaluated and fed into a CSS transition or
- * keyframe animation. For example if we wanted to animate the height of an element while adding and removing classes then we can do so by providing that
- * data into `$animateCss` directly:
- *
- * ```js
- * myModule.animation('.slide', ['$animateCss', function($animateCss) {
- *   return {
- *     enter: function(element, doneFn) {
- *       var runner = $animateCss(element, {
- *         event: 'enter',
- *         structural: true,
- *         addClass: 'maroon-setting',
- *         from: { height:0 },
- *         to: { height: 200 }
- *       }).start();
- *
- *       runner.done(doneFn);
- *     }
- *   }
- * }]
- * ```
- *
- * Now we can fill in the rest via our transition CSS code:
- *
- * ```css
- * /&#42; the transition tells ngAnimate to make the animation happen &#42;/
- * .slide.ng-enter { transition:0.5s linear all; }
- *
- * /&#42; this extra CSS class will be absorbed into the transition
- * since the $animateCss code is adding the class &#42;/
- * .maroon-setting { background:red; }
- * ```
- *
- * And `$animateCss` will figure out the rest. Just make sure to have the `done()` callback fire the `doneFn` function to signal when the animation is over.
- *
- * To learn more about what's possible be sure to visit the {@link ngAnimate.$animateCss $animateCss service}.
- *
- * ## Animation Anchoring (via `ng-animate-ref`)
- *
- * ngAnimate in AngularJS 1.4 comes packed with the ability to cross-animate elements between
- * structural areas of an application (like views) by pairing up elements using an attribute
- * called `ng-animate-ref`.
- *
- * Let's say for example we have two views that are managed by `ng-view` and we want to show
- * that there is a relationship between two components situated in within these views. By using the
- * `ng-animate-ref` attribute we can identify that the two components are paired together and we
- * can then attach an animation, which is triggered when the view changes.
- *
- * Say for example we have the following template code:
- *
- * ```html
- * <!-- index.html -->
- * <div ng-view class="view-animation">
- * </div>
- *
- * <!-- home.html -->
- * <a href="#/banner-page">
- *   <img src="./banner.jpg" class="banner" ng-animate-ref="banner">
- * </a>
- *
- * <!-- banner-page.html -->
- * <img src="./banner.jpg" class="banner" ng-animate-ref="banner">
- * ```
- *
- * Now, when the view changes (once the link is clicked), ngAnimate will examine the
- * HTML contents to see if there is a match reference between any components in the view
- * that is leaving and the view that is entering. It will scan both the view which is being
- * removed (leave) and inserted (enter) to see if there are any paired DOM elements that
- * contain a matching ref value.
- *
- * The two images match since they share the same ref value. ngAnimate will now create a
- * transport element (which is a clone of the first image element) and it will then attempt
- * to animate to the position of the second image element in the next view. For the animation to
- * work a special CSS class called `ng-anchor` will be added to the transported element.
- *
- * We can now attach a transition onto the `.banner.ng-anchor` CSS class and then
- * ngAnimate will handle the entire transition for us as well as the addition and removal of
- * any changes of CSS classes between the elements:
- *
- * ```css
- * .banner.ng-anchor {
- *   /&#42; this animation will last for 1 second since there are
- *          two phases to the animation (an `in` and an `out` phase) &#42;/
- *   transition:0.5s linear all;
- * }
- * ```
- *
- * We also **must** include animations for the views that are being entered and removed
- * (otherwise anchoring wouldn't be possible since the new view would be inserted right away).
- *
- * ```css
- * .view-animation.ng-enter, .view-animation.ng-leave {
- *   transition:0.5s linear all;
- *   position:fixed;
- *   left:0;
- *   top:0;
- *   width:100%;
- * }
- * .view-animation.ng-enter {
- *   transform:translateX(100%);
- * }
- * .view-animation.ng-leave,
- * .view-animation.ng-enter.ng-enter-active {
- *   transform:translateX(0%);
- * }
- * .view-animation.ng-leave.ng-leave-active {
- *   transform:translateX(-100%);
- * }
- * ```
- *
- * Now we can jump back to the anchor animation. When the animation happens, there are two stages that occur:
- * an `out` and an `in` stage. The `out` stage happens first and that is when the element is animated away
- * from its origin. Once that animation is over then the `in` stage occurs which animates the
- * element to its destination. The reason why there are two animations is to give enough time
- * for the enter animation on the new element to be ready.
- *
- * The example above sets up a transition for both the in and out phases, but we can also target the out or
- * in phases directly via `ng-anchor-out` and `ng-anchor-in`.
- *
- * ```css
- * .banner.ng-anchor-out {
- *   transition: 0.5s linear all;
- *
- *   /&#42; the scale will be applied during the out animation,
- *          but will be animated away when the in animation runs &#42;/
- *   transform: scale(1.2);
- * }
- *
- * .banner.ng-anchor-in {
- *   transition: 1s linear all;
- * }
- * ```
- *
- *
- *
- *
- * ### Anchoring Demo
- *
-  <example module="anchoringExample"
-           name="anchoringExample"
-           id="anchoringExample"
-           deps="angular-animate.js;angular-route.js"
-           animations="true">
-    <file name="index.html">
-      <a href="#/">Home</a>
-      <hr />
-      <div class="view-container">
-        <div ng-view class="view"></div>
-      </div>
-    </file>
-    <file name="script.js">
-      angular.module('anchoringExample', ['ngAnimate', 'ngRoute'])
-        .config(['$routeProvider', function($routeProvider) {
-          $routeProvider.when('/', {
-            templateUrl: 'home.html',
-            controller: 'HomeController as home'
-          });
-          $routeProvider.when('/profile/:id', {
-            templateUrl: 'profile.html',
-            controller: 'ProfileController as profile'
-          });
-        }])
-        .run(['$rootScope', function($rootScope) {
-          $rootScope.records = [
-            { id:1, title: "Miss Beulah Roob" },
-            { id:2, title: "Trent Morissette" },
-            { id:3, title: "Miss Ava Pouros" },
-            { id:4, title: "Rod Pouros" },
-            { id:5, title: "Abdul Rice" },
-            { id:6, title: "Laurie Rutherford Sr." },
-            { id:7, title: "Nakia McLaughlin" },
-            { id:8, title: "Jordon Blanda DVM" },
-            { id:9, title: "Rhoda Hand" },
-            { id:10, title: "Alexandrea Sauer" }
-          ];
-        }])
-        .controller('HomeController', [function() {
-          //empty
-        }])
-        .controller('ProfileController', ['$rootScope', '$routeParams', function($rootScope, $routeParams) {
-          var index = parseInt($routeParams.id, 10);
-          var record = $rootScope.records[index - 1];
-
-          this.title = record.title;
-          this.id = record.id;
-        }]);
-    </file>
-    <file name="home.html">
-      <h2>Welcome to the home page</h1>
-      <p>Please click on an element</p>
-      <a class="record"
-         ng-href="#/profile/{{ record.id }}"
-         ng-animate-ref="{{ record.id }}"
-         ng-repeat="record in records">
-        {{ record.title }}
-      </a>
-    </file>
-    <file name="profile.html">
-      <div class="profile record" ng-animate-ref="{{ profile.id }}">
-        {{ profile.title }}
-      </div>
-    </file>
-    <file name="animations.css">
-      .record {
-        display:block;
-        font-size:20px;
-      }
-      .profile {
-        background:black;
-        color:white;
-        font-size:100px;
-      }
-      .view-container {
-        position:relative;
-      }
-      .view-container > .view.ng-animate {
-        position:absolute;
-        top:0;
-        left:0;
-        width:100%;
-        min-height:500px;
-      }
-      .view.ng-enter, .view.ng-leave,
-      .record.ng-anchor {
-        transition:0.5s linear all;
-      }
-      .view.ng-enter {
-        transform:translateX(100%);
-      }
-      .view.ng-enter.ng-enter-active, .view.ng-leave {
-        transform:translateX(0%);
-      }
-      .view.ng-leave.ng-leave-active {
-        transform:translateX(-100%);
-      }
-      .record.ng-anchor-out {
-        background:red;
-      }
-    </file>
-  </example>
- *
- * ### How is the element transported?
- *
- * When an anchor animation occurs, ngAnimate will clone the starting element and position it exactly where the starting
- * element is located on screen via absolute positioning. The cloned element will be placed inside of the root element
- * of the application (where ng-app was defined) and all of the CSS classes of the starting element will be applied. The
- * element will then animate into the `out` and `in` animations and will eventually reach the coordinates and match
- * the dimensions of the destination element. During the entire animation a CSS class of `.ng-animate-shim` will be applied
- * to both the starting and destination elements in order to hide them from being visible (the CSS styling for the class
- * is: `visibility:hidden`). Once the anchor reaches its destination then it will be removed and the destination element
- * will become visible since the shim class will be removed.
- *
- * ### How is the morphing handled?
- *
- * CSS Anchoring relies on transitions and keyframes and the internal code is intelligent enough to figure out
- * what CSS classes differ between the starting element and the destination element. These different CSS classes
- * will be added/removed on the anchor element and a transition will be applied (the transition that is provided
- * in the anchor class). Long story short, ngAnimate will figure out what classes to add and remove which will
- * make the transition of the element as smooth and automatic as possible. Be sure to use simple CSS classes that
- * do not rely on DOM nesting structure so that the anchor element appears the same as the starting element (since
- * the cloned element is placed inside of root element which is likely close to the body element).
- *
- * Note that if the root element is on the `<html>` element then the cloned node will be placed inside of body.
- *
- *
- * ## Using $animate in your directive code
- *
- * So far we've explored how to feed in animations into an Angular application, but how do we trigger animations within our own directives in our application?
- * By injecting the `$animate` service into our directive code, we can trigger structural and class-based hooks which can then be consumed by animations. Let's
- * imagine we have a greeting box that shows and hides itself when the data changes
- *
- * ```html
- * <greeting-box active="onOrOff">Hi there</greeting-box>
- * ```
- *
- * ```js
- * ngModule.directive('greetingBox', ['$animate', function($animate) {
- *   return function(scope, element, attrs) {
- *     attrs.$observe('active', function(value) {
- *       value ? $animate.addClass(element, 'on') : $animate.removeClass(element, 'on');
- *     });
- *   });
- * }]);
- * ```
- *
- * Now the `on` CSS class is added and removed on the greeting box component. Now if we add a CSS class on top of the greeting box element
- * in our HTML code then we can trigger a CSS or JS animation to happen.
- *
- * ```css
- * /&#42; normally we would create a CSS class to reference on the element &#42;/
- * greeting-box.on { transition:0.5s linear all; background:green; color:white; }
- * ```
- *
- * The `$animate` service contains a variety of other methods like `enter`, `leave`, `animate` and `setClass`. To learn more about what's
- * possible be sure to visit the {@link ng.$animate $animate service API page}.
- *
- *
- * ### Preventing Collisions With Third Party Libraries
- *
- * Some third-party frameworks place animation duration defaults across many element or className
- * selectors in order to make their code small and reuseable. This can lead to issues with ngAnimate, which
- * is expecting actual animations on these elements and has to wait for their completion.
- *
- * You can prevent this unwanted behavior by using a prefix on all your animation classes:
- *
- * ```css
- * /&#42; prefixed with animate- &#42;/
- * .animate-fade-add.animate-fade-add-active {
- *   transition:1s linear all;
- *   opacity:0;
- * }
- * ```
- *
- * You then configure `$animate` to enforce this prefix:
- *
- * ```js
- * $animateProvider.classNameFilter(/animate-/);
- * ```
- *
- * This also may provide your application with a speed boost since only specific elements containing CSS class prefix
- * will be evaluated for animation when any DOM changes occur in the application.
- *
- * ## Callbacks and Promises
- *
- * When `$animate` is called it returns a promise that can be used to capture when the animation has ended. Therefore if we were to trigger
- * an animation (within our directive code) then we can continue performing directive and scope related activities after the animation has
- * ended by chaining onto the returned promise that animation method returns.
- *
- * ```js
- * // somewhere within the depths of the directive
- * $animate.enter(element, parent).then(function() {
- *   //the animation has completed
- * });
- * ```
- *
- * (Note that earlier versions of Angular prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case
- * anymore.)
- *
- * In addition to the animation promise, we can also make use of animation-related callbacks within our directives and controller code by registering
- * an event listener using the `$animate` service. Let's say for example that an animation was triggered on our view
- * routing controller to hook into that:
- *
- * ```js
- * ngModule.controller('HomePageController', ['$animate', function($animate) {
- *   $animate.on('enter', ngViewElement, function(element) {
- *     // the animation for this route has completed
- *   }]);
- * }])
- * ```
- *
- * (Note that you will need to trigger a digest within the callback to get angular to notice any scope-related changes.)
- */
-
-/**
- * @ngdoc service
- * @name $animate
- * @kind object
- *
- * @description
- * The ngAnimate `$animate` service documentation is the same for the core `$animate` service.
- *
- * Click here {@link ng.$animate to learn more about animations with `$animate`}.
- */
-angular.module('ngAnimate', [])
-  .directive('ngAnimateChildren', $$AnimateChildrenDirective)
-  .factory('$$rAFScheduler', $$rAFSchedulerFactory)
-
-  .factory('$$AnimateRunner', $$AnimateRunnerFactory)
-  .factory('$$animateAsyncRun', $$AnimateAsyncRunFactory)
-
-  .provider('$$animateQueue', $$AnimateQueueProvider)
-  .provider('$$animation', $$AnimationProvider)
-
-  .provider('$animateCss', $AnimateCssProvider)
-  .provider('$$animateCssDriver', $$AnimateCssDriverProvider)
-
-  .provider('$$animateJs', $$AnimateJsProvider)
-  .provider('$$animateJsDriver', $$AnimateJsDriverProvider);
-
-
-})(window, window.angular);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/angular-animate.min.js b/views/ngXosViews/serviceGrid/src/vendor/angular-animate/angular-animate.min.js
deleted file mode 100644
index c24d9e0..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/angular-animate.min.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- AngularJS v1.4.7
- (c) 2010-2015 Google, Inc. http://angularjs.org
- License: MIT
-*/
-(function(G,t,Ra){'use strict';function va(a,b,c){if(!a)throw ngMinErr("areq",b||"?",c||"required");return a}function wa(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;W(a)&&(a=a.join(" "));W(b)&&(b=b.join(" "));return a+" "+b}function Ha(a){var b={};a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from);return b}function S(a,b,c){var d="";a=W(a)?a:a&&M(a)&&a.length?a.split(/\s+/):[];q(a,function(a,u){a&&0<a.length&&(d+=0<u?" ":"",d+=c?b+a:a+b)});return d}function Ia(a){if(a instanceof J)switch(a.length){case 0:return[];
-case 1:if(1===a[0].nodeType)return a;break;default:return J(la(a))}if(1===a.nodeType)return J(a)}function la(a){if(!a[0])return a;for(var b=0;b<a.length;b++){var c=a[b];if(1==c.nodeType)return c}}function Ja(a,b,c){q(b,function(b){a.addClass(b,c)})}function Ka(a,b,c){q(b,function(b){a.removeClass(b,c)})}function P(a){return function(b,c){c.addClass&&(Ja(a,b,c.addClass),c.addClass=null);c.removeClass&&(Ka(a,b,c.removeClass),c.removeClass=null)}}function ha(a){a=a||{};if(!a.$$prepared){var b=a.domOperation||
-L;a.domOperation=function(){a.$$domOperationFired=!0;b();b=L};a.$$prepared=!0}return a}function da(a,b){xa(a,b);ya(a,b)}function xa(a,b){b.from&&(a.css(b.from),b.from=null)}function ya(a,b){b.to&&(a.css(b.to),b.to=null)}function Q(a,b,c){var d=(b.addClass||"")+" "+(c.addClass||""),g=(b.removeClass||"")+" "+(c.removeClass||"");a=La(a.attr("class"),d,g);c.preparationClasses&&(b.preparationClasses=X(c.preparationClasses,b.preparationClasses),delete c.preparationClasses);d=b.domOperation!==L?b.domOperation:
-null;za(b,c);d&&(b.domOperation=d);b.addClass=a.addClass?a.addClass:null;b.removeClass=a.removeClass?a.removeClass:null;return b}function La(a,b,c){function d(a){M(a)&&(a=a.split(" "));var b={};q(a,function(a){a.length&&(b[a]=!0)});return b}var g={};a=d(a);b=d(b);q(b,function(a,b){g[b]=1});c=d(c);q(c,function(a,b){g[b]=1===g[b]?null:-1});var u={addClass:"",removeClass:""};q(g,function(b,c){var g,d;1===b?(g="addClass",d=!a[c]):-1===b&&(g="removeClass",d=a[c]);d&&(u[g].length&&(u[g]+=" "),u[g]+=c)});
-return u}function H(a){return a instanceof t.element?a[0]:a}function Ma(a,b,c){var d="";b&&(d=S(b,"ng-",!0));c.addClass&&(d=X(d,S(c.addClass,"-add")));c.removeClass&&(d=X(d,S(c.removeClass,"-remove")));d.length&&(c.preparationClasses=d,a.addClass(d))}function ia(a,b){var c=b?"-"+b+"s":"";ea(a,[fa,c]);return[fa,c]}function ma(a,b){var c=b?"paused":"",d=T+"PlayState";ea(a,[d,c]);return[d,c]}function ea(a,b){a.style[b[0]]=b[1]}function X(a,b){return a?b?a+" "+b:a:b}function Aa(a,b,c){var d=Object.create(null),
-g=a.getComputedStyle(b)||{};q(c,function(a,b){var c=g[a];if(c){var f=c.charAt(0);if("-"===f||"+"===f||0<=f)c=Na(c);0===c&&(c=null);d[b]=c}});return d}function Na(a){var b=0;a=a.split(/\s*,\s*/);q(a,function(a){"s"==a.charAt(a.length-1)&&(a=a.substring(0,a.length-1));a=parseFloat(a)||0;b=b?Math.max(a,b):a});return b}function na(a){return 0===a||null!=a}function Ba(a,b){var c=N,d=a+"s";b?c+="Duration":d+=" linear all";return[c,d]}function Ca(){var a=Object.create(null);return{flush:function(){a=Object.create(null)},
-count:function(b){return(b=a[b])?b.total:0},get:function(b){return(b=a[b])&&b.value},put:function(b,c){a[b]?a[b].total++:a[b]={total:1,value:c}}}}function Da(a,b,c){q(c,function(c){a[c]=U(a[c])?a[c]:b.style.getPropertyValue(c)})}var L=t.noop,za=t.extend,J=t.element,q=t.forEach,W=t.isArray,M=t.isString,oa=t.isObject,pa=t.isUndefined,U=t.isDefined,Ea=t.isFunction,qa=t.isElement,N,ra,T,sa;pa(G.ontransitionend)&&U(G.onwebkittransitionend)?(N="WebkitTransition",ra="webkitTransitionEnd transitionend"):
-(N="transition",ra="transitionend");pa(G.onanimationend)&&U(G.onwebkitanimationend)?(T="WebkitAnimation",sa="webkitAnimationEnd animationend"):(T="animation",sa="animationend");var ja=T+"Delay",ta=T+"Duration",fa=N+"Delay";G=N+"Duration";var Oa={transitionDuration:G,transitionDelay:fa,transitionProperty:N+"Property",animationDuration:ta,animationDelay:ja,animationIterationCount:T+"IterationCount"},Pa={transitionDuration:G,transitionDelay:fa,animationDuration:ta,animationDelay:ja};t.module("ngAnimate",
-[]).directive("ngAnimateChildren",[function(){return function(a,b,c){a=c.ngAnimateChildren;t.isString(a)&&0===a.length?b.data("$$ngAnimateChildren",!0):c.$observe("ngAnimateChildren",function(a){b.data("$$ngAnimateChildren","on"===a||"true"===a)})}}]).factory("$$rAFScheduler",["$$rAF",function(a){function b(a){d=d.concat(a);c()}function c(){if(d.length){for(var b=d.shift(),z=0;z<b.length;z++)b[z]();g||a(function(){g||c()})}}var d,g;d=b.queue=[];b.waitUntilQuiet=function(b){g&&g();g=a(function(){g=
-null;b();c()})};return b}]).factory("$$AnimateRunner",["$q","$sniffer","$$animateAsyncRun",function(a,b,c){function d(a){this.setHost(a);this._doneCallbacks=[];this._runInAnimationFrame=c();this._state=0}d.chain=function(a,b){function c(){if(d===a.length)b(!0);else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};d.all=function(a,b){function c(z){f=f&&z;++d===a.length&&b(f)}var d=0,f=!0;q(a,function(a){a.done(c)})};d.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?
-a():this._doneCallbacks.push(a)},progress:L,getPromise:function(){if(!this.promise){var b=this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},"finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end();
-this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._runInAnimationFrame(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(q(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=0,this._state=2)}};return d}]).factory("$$animateAsyncRun",["$$rAF",function(a){function b(b){c.push(b);1<c.length||a(function(){for(var a=0;a<c.length;a++)c[a]();c=[]})}var c=[];return function(){var a=
-!1;b(function(){a=!0});return function(c){a?c():b(c)}}}]).provider("$$animateQueue",["$animateProvider",function(a){function b(a,b,c,q){return d[a].some(function(a){return a(b,c,q)})}function c(a,b){a=a||{};var c=0<(a.addClass||"").length,d=0<(a.removeClass||"").length;return b?c&&d:c||d}var d=this.rules={skip:[],cancel:[],join:[]};d.join.push(function(a,b,d){return!b.structural&&c(b.options)});d.skip.push(function(a,b,d){return!b.structural&&!c(b.options)});d.skip.push(function(a,b,c){return"leave"==
-c.event&&b.structural});d.skip.push(function(a,b,c){return c.structural&&2===c.state&&!b.structural});d.cancel.push(function(a,b,c){return c.structural&&b.structural});d.cancel.push(function(a,b,c){return 2===c.state&&b.structural});d.cancel.push(function(a,b,c){a=b.options;c=c.options;return a.addClass&&a.addClass===c.removeClass||a.removeClass&&a.removeClass===c.addClass});this.$get=["$$rAF","$rootScope","$rootElement","$document","$$HashMap","$$animation","$$AnimateRunner","$templateRequest","$$jqLite",
-"$$forceReflow",function(d,u,z,x,f,k,$,t,h,I){function A(){var a=!1;return function(b){a?b():u.$$postDigest(function(){a=!0;b()})}}function Y(a,b){var c=H(a),e=[],d=v[b];d&&q(d,function(a){a.node.contains(c)&&e.push(a.callback)});return e}function E(a,e,l){function n(b,c,e,v){z(function(){var b=Y(a,c);b.length&&d(function(){q(b,function(b){b(a,e,v)})})});b.progress(c,e,v)}function v(b){var c=a,e=l;e.preparationClasses&&(c.removeClass(e.preparationClasses),e.preparationClasses=null);e.activeClasses&&
-(c.removeClass(e.activeClasses),e.activeClasses=null);Ga(a,l);da(a,l);l.domOperation();f.complete(!b)}var s,C;if(a=Ia(a))s=H(a),C=a.parent();l=ha(l);var f=new $,z=A();W(l.addClass)&&(l.addClass=l.addClass.join(" "));l.addClass&&!M(l.addClass)&&(l.addClass=null);W(l.removeClass)&&(l.removeClass=l.removeClass.join(" "));l.removeClass&&!M(l.removeClass)&&(l.removeClass=null);l.from&&!oa(l.from)&&(l.from=null);l.to&&!oa(l.to)&&(l.to=null);if(!s)return v(),f;var h=[s.className,l.addClass,l.removeClass].join(" ");
-if(!Qa(h))return v(),f;var E=0<=["enter","move","leave"].indexOf(e),x=!F||D.get(s),h=!x&&m.get(s)||{},I=!!h.state;x||I&&1==h.state||(x=!ka(a,C,e));if(x)return v(),f;E&&w(a);C={structural:E,element:a,event:e,close:v,options:l,runner:f};if(I){if(b("skip",a,C,h)){if(2===h.state)return v(),f;Q(a,h.options,l);return h.runner}if(b("cancel",a,C,h))if(2===h.state)h.runner.end();else if(h.structural)h.close();else return Q(a,h.options,C.options),h.runner;else if(b("join",a,C,h))if(2===h.state)Q(a,l,{});else return Ma(a,
-E?e:null,l),e=C.event=h.event,l=Q(a,h.options,C.options),h.runner}else Q(a,l,{});(I=C.structural)||(I="animate"===C.event&&0<Object.keys(C.options.to||{}).length||c(C.options));if(!I)return v(),y(a),f;var t=(h.counter||0)+1;C.counter=t;r(a,1,C);u.$$postDigest(function(){var b=m.get(s),d=!b,b=b||{},h=0<(a.parent()||[]).length&&("animate"===b.event||b.structural||c(b.options));if(d||b.counter!==t||!h){d&&(Ga(a,l),da(a,l));if(d||E&&b.event!==e)l.domOperation(),f.end();h||y(a)}else e=!b.structural&&c(b.options,
-!0)?"setClass":b.event,r(a,2),b=k(a,e,b.options),b.done(function(b){v(!b);(b=m.get(s))&&b.counter===t&&y(H(a));n(f,e,"close",{})}),f.setHost(b),n(f,e,"start",{})});return f}function w(a){a=H(a).querySelectorAll("[data-ng-animate]");q(a,function(a){var b=parseInt(a.getAttribute("data-ng-animate")),c=m.get(a);switch(b){case 2:c.runner.end();case 1:c&&m.remove(a)}})}function y(a){a=H(a);a.removeAttribute("data-ng-animate");m.remove(a)}function e(a,b){return H(a)===H(b)}function ka(a,b,c){c=J(x[0].body);
-var d=e(a,c)||"HTML"===a[0].nodeName,v=e(a,z),n=!1,y;for((a=a.data("$ngAnimatePin"))&&(b=a);b&&b.length;){v||(v=e(b,z));a=b[0];if(1!==a.nodeType)break;var r=m.get(a)||{};n||(n=r.structural||D.get(a));if(pa(y)||!0===y)a=b.data("$$ngAnimateChildren"),U(a)&&(y=a);if(n&&!1===y)break;v||(v=e(b,z),v||(a=b.data("$ngAnimatePin"))&&(b=a));d||(d=e(b,c));b=b.parent()}return(!n||y)&&v&&d}function r(a,b,c){c=c||{};c.state=b;a=H(a);a.setAttribute("data-ng-animate",b);c=(b=m.get(a))?za(b,c):c;m.put(a,c)}var m=new f,
-D=new f,F=null,s=u.$watch(function(){return 0===t.totalPendingRequests},function(a){a&&(s(),u.$$postDigest(function(){u.$$postDigest(function(){null===F&&(F=!0)})}))}),v={},n=a.classNameFilter(),Qa=n?function(a){return n.test(a)}:function(){return!0},Ga=P(h);return{on:function(a,b,c){b=la(b);v[a]=v[a]||[];v[a].push({node:b,callback:c})},off:function(a,b,c){function e(a,b,c){var d=la(b);return a.filter(function(a){return!(a.node===d&&(!c||a.callback===c))})}var d=v[a];d&&(v[a]=1===arguments.length?
-null:e(d,b,c))},pin:function(a,b){va(qa(a),"element","not an element");va(qa(b),"parentElement","not an element");a.data("$ngAnimatePin",b)},push:function(a,b,c,e){c=c||{};c.domOperation=e;return E(a,b,c)},enabled:function(a,b){var c=arguments.length;if(0===c)b=!!F;else if(qa(a)){var e=H(a),d=D.get(e);1===c?b=!d:(b=!!b)?d&&D.remove(e):D.put(e,!0)}else b=F=!!a;return b}}}]}]).provider("$$animation",["$animateProvider",function(a){function b(a){return a.data("$$animationRunner")}var c=this.drivers=
-[];this.$get=["$$jqLite","$rootScope","$injector","$$AnimateRunner","$$HashMap","$$rAFScheduler",function(a,g,u,z,x,f){function k(a){function b(a){if(a.processed)return a;a.processed=!0;var e=a.domNode,d=e.parentNode;f.put(e,a);for(var r;d;){if(r=f.get(d)){r.processed||(r=b(r));break}d=d.parentNode}(r||c).children.push(a);return a}var c={children:[]},d,f=new x;for(d=0;d<a.length;d++){var g=a[d];f.put(g.domNode,a[d]={domNode:g.domNode,fn:g.fn,children:[]})}for(d=0;d<a.length;d++)b(a[d]);return function(a){var b=
-[],c=[],d;for(d=0;d<a.children.length;d++)c.push(a.children[d]);a=c.length;var m=0,f=[];for(d=0;d<c.length;d++){var g=c[d];0>=a&&(a=m,m=0,b.push(f),f=[]);f.push(g.fn);g.children.forEach(function(a){m++;c.push(a)});a--}f.length&&b.push(f);return b}(c)}var $=[],t=P(a);return function(h,x,A){function Y(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];q(a,function(a){var c=a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)});return b}function E(a){var b=[],
-c={};q(a,function(a,e){var d=H(a.element),v=0<=["enter","move"].indexOf(a.event),d=a.structural?Y(d):[];if(d.length){var m=v?"to":"from";q(d,function(a){var b=a.getAttribute("ng-animate-ref");c[b]=c[b]||{};c[b][m]={animationID:e,element:J(a)}})}else b.push(a)});var e={},d={};q(c,function(c,m){var f=c.from,y=c.to;if(f&&y){var g=a[f.animationID],r=a[y.animationID],s=f.animationID.toString();if(!d[s]){var h=d[s]={structural:!0,beforeStart:function(){g.beforeStart();r.beforeStart()},close:function(){g.close();
-r.close()},classes:w(g.classes,r.classes),from:g,to:r,anchors:[]};h.classes.length?b.push(h):(b.push(g),b.push(r))}d[s].anchors.push({out:f.element,"in":y.element})}else f=f?f.animationID:y.animationID,y=f.toString(),e[y]||(e[y]=!0,b.push(a[f]))});return b}function w(a,b){a=a.split(" ");b=b.split(" ");for(var c=[],e=0;e<a.length;e++){var d=a[e];if("ng-"!==d.substring(0,3))for(var m=0;m<b.length;m++)if(d===b[m]){c.push(d);break}}return c.join(" ")}function y(a){for(var b=c.length-1;0<=b;b--){var e=
-c[b];if(u.has(e)&&(e=u.get(e)(a)))return e}}function e(a,c){a.from&&a.to?(b(a.from.element).setHost(c),b(a.to.element).setHost(c)):b(a.element).setHost(c)}function ka(){var a=b(h);!a||"leave"===x&&A.$$domOperationFired||a.end()}function r(b){h.off("$destroy",ka);h.removeData("$$animationRunner");t(h,A);da(h,A);A.domOperation();s&&a.removeClass(h,s);h.removeClass("ng-animate");D.complete(!b)}A=ha(A);var m=0<=["enter","move","leave"].indexOf(x),D=new z({end:function(){r()},cancel:function(){r(!0)}});
-if(!c.length)return r(),D;h.data("$$animationRunner",D);var F=wa(h.attr("class"),wa(A.addClass,A.removeClass)),s=A.tempClasses;s&&(F+=" "+s,A.tempClasses=null);$.push({element:h,classes:F,event:x,structural:m,options:A,beforeStart:function(){h.addClass("ng-animate");s&&a.addClass(h,s)},close:r});h.on("$destroy",ka);if(1<$.length)return D;g.$$postDigest(function(){var a=[];q($,function(c){b(c.element)?a.push(c):c.close()});$.length=0;var c=E(a),d=[];q(c,function(a){d.push({domNode:H(a.from?a.from.element:
-a.element),fn:function(){a.beforeStart();var c,d=a.close;if(b(a.anchors?a.from.element||a.to.element:a.element)){var m=y(a);m&&(c=m.start)}c?(c=c(),c.done(function(a){d(!a)}),e(a,c)):d()}})});f(k(d))});return D}}]}]).provider("$animateCss",["$animateProvider",function(a){var b=Ca(),c=Ca();this.$get=["$window","$$jqLite","$$AnimateRunner","$timeout","$$forceReflow","$sniffer","$$rAFScheduler","$animate",function(a,g,u,z,x,f,k,t){function Fa(a,b){var c=a.parentNode;return(c.$$ngAnimateParentKey||(c.$$ngAnimateParentKey=
-++E))+"-"+a.getAttribute("class")+"-"+b}function h(f,e,h,r){var m;0<b.count(h)&&(m=c.get(h),m||(e=S(e,"-stagger"),g.addClass(f,e),m=Aa(a,f,r),m.animationDuration=Math.max(m.animationDuration,0),m.transitionDuration=Math.max(m.transitionDuration,0),g.removeClass(f,e),c.put(h,m)));return m||{}}function I(a){w.push(a);k.waitUntilQuiet(function(){b.flush();c.flush();for(var a=x(),d=0;d<w.length;d++)w[d](a);w.length=0})}function A(c,e,f){e=b.get(f);e||(e=Aa(a,c,Oa),"infinite"===e.animationIterationCount&&
-(e.animationIterationCount=1));b.put(f,e);c=e;f=c.animationDelay;e=c.transitionDelay;c.maxDelay=f&&e?Math.max(f,e):f||e;c.maxDuration=Math.max(c.animationDuration*c.animationIterationCount,c.transitionDuration);return c}var Y=P(g),E=0,w=[];return function(a,c){function d(){m()}function r(){m(!0)}function m(b){if(!(E||ua&&l)){E=!0;l=!1;c.$$skipPreparationClasses||g.removeClass(a,Z);g.removeClass(a,X);ma(n,!1);ia(n,!1);q(w,function(a){n.style[a[0]]=""});Y(a,c);da(a,c);Object.keys(v).length&&q(v,function(a,
-b){a?n.style.setProperty(b,a):n.style.removeProperty(b)});if(c.onDone)c.onDone();G&&G.complete(!b)}}function D(a){p.blockTransition&&ia(n,a);p.blockKeyframeAnimation&&ma(n,!!a)}function F(){G=new u({end:d,cancel:r});I(L);m();return{$$willAnimate:!1,start:function(){return G},end:d}}function s(){function b(){if(!E){D(!1);q(w,function(a){n.style[a[0]]=a[1]});Y(a,c);g.addClass(a,X);if(p.recalculateTimingStyles){ga=n.className+" "+Z;aa=Fa(n,ga);B=A(n,ga,aa);V=B.maxDelay;C=Math.max(V,0);K=B.maxDuration;
-if(0===K){m();return}p.hasTransitions=0<B.transitionDuration;p.hasAnimations=0<B.animationDuration}p.applyAnimationDelay&&(V="boolean"!==typeof c.delay&&na(c.delay)?parseFloat(c.delay):V,C=Math.max(V,0),B.animationDelay=V,ca=[ja,V+"s"],w.push(ca),n.style[ca[0]]=ca[1]);M=1E3*C;P=1E3*K;if(c.easing){var s,k=c.easing;p.hasTransitions&&(s=N+"TimingFunction",w.push([s,k]),n.style[s]=k);p.hasAnimations&&(s=T+"TimingFunction",w.push([s,k]),n.style[s]=k)}B.transitionDuration&&h.push(ra);B.animationDuration&&
-h.push(sa);r=Date.now();var l=M+1.5*P;s=r+l;var k=a.data("$$animateCss")||[],x=!0;if(k.length){var F=k[0];(x=s>F.expectedEndTime)?z.cancel(F.timer):k.push(m)}x&&(l=z(d,l,!1),k[0]={timer:l,expectedEndTime:s},k.push(m),a.data("$$animateCss",k));a.on(h.join(" "),f);c.to&&(c.cleanupStyles&&Da(v,n,Object.keys(c.to)),ya(a,c))}}function d(){var b=a.data("$$animateCss");if(b){for(var c=1;c<b.length;c++)b[c]();a.removeData("$$animateCss")}}function f(a){a.stopPropagation();var b=a.originalEvent||a;a=b.$manualTimeStamp||
-b.timeStamp||Date.now();b=parseFloat(b.elapsedTime.toFixed(3));Math.max(a-r,0)>=M&&b>=K&&(ua=!0,m())}if(!E)if(n.parentNode){var r,h=[],s=function(a){if(ua)l&&a&&(l=!1,m());else if(l=!a,B.animationDuration)if(a=ma(n,l),l)w.push(a);else{var b=w,c=b.indexOf(a);0<=a&&b.splice(c,1)}},k=0<U&&(B.transitionDuration&&0===R.transitionDuration||B.animationDuration&&0===R.animationDuration)&&Math.max(R.animationDelay,R.transitionDelay);k?z(b,Math.floor(k*U*1E3),!1):b();J.resume=function(){s(!0)};J.pause=function(){s(!1)}}else m()}
-var v={},n=H(a);if(!n||!n.parentNode||!t.enabled())return F();c=ha(c);var w=[],x=a.attr("class"),k=Ha(c),E,l,ua,G,J,C,M,K,P;if(0===c.duration||!f.animations&&!f.transitions)return F();var ba=c.event&&W(c.event)?c.event.join(" "):c.event,Q="",O="";ba&&c.structural?Q=S(ba,"ng-",!0):ba&&(Q=ba);c.addClass&&(O+=S(c.addClass,"-add"));c.removeClass&&(O.length&&(O+=" "),O+=S(c.removeClass,"-remove"));c.applyClassesEarly&&O.length&&Y(a,c);var Z=[Q,O].join(" ").trim(),ga=x+" "+Z,X=S(Z,"-active"),x=k.to&&0<
-Object.keys(k.to).length;if(!(0<(c.keyframeStyle||"").length||x||Z))return F();var aa,R;0<c.stagger?(k=parseFloat(c.stagger),R={transitionDelay:k,animationDelay:k,transitionDuration:0,animationDuration:0}):(aa=Fa(n,ga),R=h(n,Z,aa,Pa));c.$$skipPreparationClasses||g.addClass(a,Z);c.transitionStyle&&(k=[N,c.transitionStyle],ea(n,k),w.push(k));0<=c.duration&&(k=0<n.style[N].length,k=Ba(c.duration,k),ea(n,k),w.push(k));c.keyframeStyle&&(k=[T,c.keyframeStyle],ea(n,k),w.push(k));var U=R?0<=c.staggerIndex?
-c.staggerIndex:b.count(aa):0;(ba=0===U)&&!c.skipBlocking&&ia(n,9999);var B=A(n,ga,aa),V=B.maxDelay;C=Math.max(V,0);K=B.maxDuration;var p={};p.hasTransitions=0<B.transitionDuration;p.hasAnimations=0<B.animationDuration;p.hasTransitionAll=p.hasTransitions&&"all"==B.transitionProperty;p.applyTransitionDuration=x&&(p.hasTransitions&&!p.hasTransitionAll||p.hasAnimations&&!p.hasTransitions);p.applyAnimationDuration=c.duration&&p.hasAnimations;p.applyTransitionDelay=na(c.delay)&&(p.applyTransitionDuration||
-p.hasTransitions);p.applyAnimationDelay=na(c.delay)&&p.hasAnimations;p.recalculateTimingStyles=0<O.length;if(p.applyTransitionDuration||p.applyAnimationDuration)K=c.duration?parseFloat(c.duration):K,p.applyTransitionDuration&&(p.hasTransitions=!0,B.transitionDuration=K,k=0<n.style[N+"Property"].length,w.push(Ba(K,k))),p.applyAnimationDuration&&(p.hasAnimations=!0,B.animationDuration=K,w.push([ta,K+"s"]));if(0===K&&!p.recalculateTimingStyles)return F();if(null!=c.delay){var ca=parseFloat(c.delay);
-p.applyTransitionDelay&&w.push([fa,ca+"s"]);p.applyAnimationDelay&&w.push([ja,ca+"s"])}null==c.duration&&0<B.transitionDuration&&(p.recalculateTimingStyles=p.recalculateTimingStyles||ba);M=1E3*C;P=1E3*K;c.skipBlocking||(p.blockTransition=0<B.transitionDuration,p.blockKeyframeAnimation=0<B.animationDuration&&0<R.animationDelay&&0===R.animationDuration);c.from&&(c.cleanupStyles&&Da(v,n,Object.keys(c.from)),xa(a,c));p.blockTransition||p.blockKeyframeAnimation?D(K):c.skipBlocking||ia(n,!1);return{$$willAnimate:!0,
-end:d,start:function(){if(!E)return J={end:d,cancel:r,resume:null,pause:null},G=new u(J),I(s),G}}}}]}]).provider("$$animateCssDriver",["$$animationProvider",function(a){a.drivers.push("$$animateCssDriver");this.$get=["$animateCss","$rootScope","$$AnimateRunner","$rootElement","$sniffer","$$jqLite","$document",function(a,c,d,g,u,z,x){function f(a){return a.replace(/\bng-\S+\b/g,"")}function k(a,b){M(a)&&(a=a.split(" "));M(b)&&(b=b.split(" "));return a.filter(function(a){return-1===b.indexOf(a)}).join(" ")}
-function t(c,h,g){function x(a){var b={},c=H(a).getBoundingClientRect();q(["width","height","top","left"],function(a){var d=c[a];switch(a){case "top":d+=I.scrollTop;break;case "left":d+=I.scrollLeft}b[a]=Math.floor(d)+"px"});return b}function e(){var c=f(g.attr("class")||""),d=k(c,m),c=k(m,c),d=a(r,{to:x(g),addClass:"ng-anchor-in "+d,removeClass:"ng-anchor-out "+c,delay:!0});return d.$$willAnimate?d:null}function z(){r.remove();h.removeClass("ng-animate-shim");g.removeClass("ng-animate-shim")}var r=
-J(H(h).cloneNode(!0)),m=f(r.attr("class")||"");h.addClass("ng-animate-shim");g.addClass("ng-animate-shim");r.addClass("ng-anchor");A.append(r);var D;c=function(){var c=a(r,{addClass:"ng-anchor-out",delay:!0,from:x(h)});return c.$$willAnimate?c:null}();if(!c&&(D=e(),!D))return z();var F=c||D;return{start:function(){function a(){c&&c.end()}var b,c=F.start();c.done(function(){c=null;if(!D&&(D=e()))return c=D.start(),c.done(function(){c=null;z();b.complete()}),c;z();b.complete()});return b=new d({end:a,
-cancel:a})}}}function G(a,b,c,f){var e=h(a,L),g=h(b,L),k=[];q(f,function(a){(a=t(c,a.out,a["in"]))&&k.push(a)});if(e||g||0!==k.length)return{start:function(){function a(){q(b,function(a){a.end()})}var b=[];e&&b.push(e.start());g&&b.push(g.start());q(k,function(a){b.push(a.start())});var c=new d({end:a,cancel:a});d.all(b,function(a){c.complete(a)});return c}}}function h(c){var d=c.element,f=c.options||{};c.structural&&(f.event=c.event,f.structural=!0,f.applyClassesEarly=!0,"leave"===c.event&&(f.onDone=
-f.domOperation));f.preparationClasses&&(f.event=X(f.event,f.preparationClasses));c=a(d,f);return c.$$willAnimate?c:null}if(!u.animations&&!u.transitions)return L;var I=x[0].body;c=H(g);var A=J(c.parentNode&&11===c.parentNode.nodeType||I.contains(c)?c:I);P(z);return function(a){return a.from&&a.to?G(a.from,a.to,a.classes,a.anchors):h(a)}}]}]).provider("$$animateJs",["$animateProvider",function(a){this.$get=["$injector","$$AnimateRunner","$$jqLite",function(b,c,d){function g(c){c=W(c)?c:c.split(" ");
-for(var d=[],f={},g=0;g<c.length;g++){var q=c[g],u=a.$$registeredAnimations[q];u&&!f[q]&&(d.push(b.get(u)),f[q]=!0)}return d}var u=P(d);return function(a,b,d,k){function t(){k.domOperation();u(a,k)}function G(a,b,d,f,e){switch(d){case "animate":b=[b,f.from,f.to,e];break;case "setClass":b=[b,A,H,e];break;case "addClass":b=[b,A,e];break;case "removeClass":b=[b,H,e];break;default:b=[b,e]}b.push(f);if(a=a.apply(a,b))if(Ea(a.start)&&(a=a.start()),a instanceof c)a.done(e);else if(Ea(a))return a;return L}
-function h(a,b,d,e,f){var g=[];q(e,function(e){var h=e[f];h&&g.push(function(){var e,f,g=!1,k=function(a){g||(g=!0,(f||L)(a),e.complete(!a))};e=new c({end:function(){k()},cancel:function(){k(!0)}});f=G(h,a,b,d,function(a){k(!1===a)});return e})});return g}function I(a,b,d,e,f){var g=h(a,b,d,e,f);if(0===g.length){var k,u;"beforeSetClass"===f?(k=h(a,"removeClass",d,e,"beforeRemoveClass"),u=h(a,"addClass",d,e,"beforeAddClass")):"setClass"===f&&(k=h(a,"removeClass",d,e,"removeClass"),u=h(a,"addClass",
-d,e,"addClass"));k&&(g=g.concat(k));u&&(g=g.concat(u))}if(0!==g.length)return function(a){var b=[];g.length&&q(g,function(a){b.push(a())});b.length?c.all(b,a):a();return function(a){q(b,function(b){a?b.cancel():b.end()})}}}3===arguments.length&&oa(d)&&(k=d,d=null);k=ha(k);d||(d=a.attr("class")||"",k.addClass&&(d+=" "+k.addClass),k.removeClass&&(d+=" "+k.removeClass));var A=k.addClass,H=k.removeClass,E=g(d),w,y;if(E.length){var e,J;"leave"==b?(J="leave",e="afterLeave"):(J="before"+b.charAt(0).toUpperCase()+
-b.substr(1),e=b);"enter"!==b&&"move"!==b&&(w=I(a,b,k,E,J));y=I(a,b,k,E,e)}if(w||y)return{start:function(){function b(c){f=!0;t();da(a,k);g.complete(c)}var d,e=[];w&&e.push(function(a){d=w(a)});e.length?e.push(function(a){t();a(!0)}):t();y&&e.push(function(a){d=y(a)});var f=!1,g=new c({end:function(){f||((d||L)(void 0),b(void 0))},cancel:function(){f||((d||L)(!0),b(!0))}});c.chain(e,b);return g}}}}]}]).provider("$$animateJsDriver",["$$animationProvider",function(a){a.drivers.push("$$animateJsDriver");
-this.$get=["$$animateJs","$$AnimateRunner",function(a,c){function d(c){return a(c.element,c.event,c.classes,c.options)}return function(a){if(a.from&&a.to){var b=d(a.from),t=d(a.to);if(b||t)return{start:function(){function a(){return function(){q(d,function(a){a.end()})}}var d=[];b&&d.push(b.start());t&&d.push(t.start());c.all(d,function(a){g.complete(a)});var g=new c({end:a(),cancel:a()});return g}}}else return d(a)}}]}])})(window,window.angular);
-//# sourceMappingURL=angular-animate.min.js.map
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/angular-animate.min.js.map b/views/ngXosViews/serviceGrid/src/vendor/angular-animate/angular-animate.min.js.map
deleted file mode 100644
index 20d38d2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/angular-animate.min.js.map
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-"version":3,
-"file":"angular-animate.min.js",
-"lineCount":55,
-"mappings":"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",
-"sources":["angular-animate.js"],
-"names":["window","angular","undefined","assertArg","arg","name","reason","ngMinErr","mergeClasses","a","b","isArray","join","packageStyles","options","styles","to","from","pendClasses","classes","fix","isPrefix","className","isString","length","split","forEach","klass","i","stripCommentsFromElement","element","jqLite","ELEMENT_NODE","nodeType","extractElementNode","elm","$$addClass","$$jqLite","addClass","$$removeClass","removeClass","applyAnimationClassesFactory","prepareAnimationOptions","$$prepared","domOperation","noop","options.domOperation","$$domOperationFired","applyAnimationStyles","applyAnimationFromStyles","applyAnimationToStyles","css","mergeAnimationOptions","target","newOptions","toAdd","toRemove","resolveElementClasses","attr","preparationClasses","concatWithSpace","realDomOperation","extend","existing","splitClassesToLookup","obj","flags","value","key","ADD_CLASS","REMOVE_CLASS","val","prop","allow","getDomNode","applyGeneratedPreparationClasses","event","EVENT_CLASS_PREFIX","ADD_CLASS_SUFFIX","REMOVE_CLASS_SUFFIX","blockTransitions","node","duration","applyInlineStyle","TRANSITION_DELAY_PROP","blockKeyframeAnimations","applyBlock","ANIMATION_PROP","ANIMATION_PLAYSTATE_KEY","styleTuple","style","computeCssStyles","$window","properties","Object","create","detectedStyles","getComputedStyle","formalStyleName","actualStyleName","c","charAt","parseMaxTime","str","maxValue","values","substring","parseFloat","Math","max","truthyTimingValue","getCssTransitionDurationStyle","applyOnlyDuration","TRANSITION_PROP","DURATION_KEY","createLocalCacheLookup","cache","flush","count","entry","total","get","put","registerRestorableStyles","backup","isDefined","getPropertyValue","isObject","isUndefined","isFunction","isElement","TRANSITIONEND_EVENT","ANIMATIONEND_EVENT","ontransitionend","onwebkittransitionend","onanimationend","onwebkitanimationend","ANIMATION_DELAY_PROP","DELAY_KEY","ANIMATION_DURATION_PROP","TRANSITION_DURATION_PROP","DETECT_CSS_PROPERTIES","transitionDuration","transitionDelay","transitionProperty","PROPERTY_KEY","animationDuration","animationDelay","animationIterationCount","ANIMATION_ITERATION_COUNT_KEY","DETECT_STAGGER_CSS_PROPERTIES","module","directive","$$AnimateChildrenDirective","scope","attrs","ngAnimateChildren","data","NG_ANIMATE_CHILDREN_DATA","$observe","factory","$$rAFSchedulerFactory","$$rAF","scheduler","tasks","queue","concat","nextTick","items","shift","cancelFn","waitUntilQuiet","scheduler.waitUntilQuiet","fn","$$AnimateRunnerFactory","$q","$sniffer","$$animateAsyncRun","AnimateRunner","host","setHost","_doneCallbacks","_runInAnimationFrame","_state","chain","AnimateRunner.chain","callback","next","index","response","all","AnimateRunner.all","runners","onProgress","status","runner","done","prototype","DONE_COMPLETE_STATE","push","progress","getPromise","promise","self","resolve","reject","then","resolveHandler","rejectHandler","catch","handler","finally","pause","resume","end","_resolve","cancel","complete","INITIAL_STATE","DONE_PENDING_STATE","$$AnimateAsyncRunFactory","waitForTick","waitQueue","passed","provider","$$AnimateQueueProvider","$animateProvider","isAllowed","ruleType","currentAnimation","previousAnimation","rules","some","hasAnimationClasses","and","skip","newAnimation","structural","RUNNING_STATE","state","nO","cO","$get","$rootScope","$rootElement","$document","$$HashMap","$$animation","$$AnimateRunner","$templateRequest","$$forceReflow","postDigestTaskFactory","postDigestCalled","$$postDigest","findCallbacks","targetNode","matches","entries","callbackRegistry","contains","queueAnimation","notifyProgress","phase","runInNextPostDigestOrNow","callbacks","close","activeClasses","applyAnimationClasses","parent","isAnimatableClassName","isStructural","indexOf","skipAnimations","animationsEnabled","disabledElementsLookup","existingAnimation","activeAnimationsLookup","hasExistingAnimation","PRE_DIGEST_STATE","areAnimationsAllowed","closeChildAnimations","skipAnimationFlag","cancelAnimationFlag","joinAnimationFlag","isValidAnimation","keys","clearElementAnimationState","counter","markElementAnimationState","animationDetails","animationCancelled","realRunner","children","querySelectorAll","child","parseInt","getAttribute","NG_ANIMATE_ATTR_NAME","remove","removeAttribute","isMatchingElement","nodeOrElmA","nodeOrElmB","parentElement","bodyElement","body","bodyElementDetected","nodeName","rootElementDetected","parentAnimationDetected","animateChildren","parentHost","NG_ANIMATE_PIN_DATA","parentNode","details","setAttribute","newValue","oldValue","deregisterWatch","$watch","totalPendingRequests","isEmpty","classNameFilter","test","on","container","off","filterFromRegistry","list","matchContainer","matchCallback","containerNode","filter","arguments","pin","enabled","bool","argCount","hasElement","recordExists","$$AnimationProvider","getRunner","RUNNER_STORAGE_KEY","drivers","$injector","$$rAFScheduler","sortAnimations","animations","processNode","processed","elementNode","domNode","lookup","parentEntry","tree","animation","flatten","result","remainingLevelEntries","nextLevelEntries","row","childEntry","animationQueue","getAnchorNodes","hasAttribute","NG_ANIMATE_REF_ATTR","SELECTOR","anchors","groupAnimations","preparedAnimations","refLookup","enterOrMove","anchorNodes","direction","anchor","animationID","usedIndicesLookup","anchorGroups","operations","fromAnimation","toAnimation","lookupKey","toString","group","beforeStart","cssClassesIntersection","indexKey","aa","j","invokeFirstDriver","driverName","has","driver","updateAnimationRunners","newRunner","handleDestroyedElement","rejected","removeData","tempClasses","NG_ANIMATE_CLASSNAME","groupedAnimations","toBeSortedAnimations","animationEntry","triggerAnimationStart","startAnimationFn","closeFn","targetElement","operation","start","animationRunner","$AnimateCssProvider","gcsLookup","gcsStaggerLookup","$timeout","$animate","gcsHashFn","extraClasses","parentCounter","computeCachedCssStaggerStyles","cacheKey","stagger","staggerClassName","rafWaitQueue","pageWidth","computeTimings","timings","aD","tD","maxDelay","maxDuration","init","endFn","animationClosed","animationCompleted","animationPaused","$$skipPreparationClasses","temporaryStyles","restoreStyles","setProperty","removeProperty","onDone","applyBlocking","blockTransition","blockKeyframeAnimation","closeAndReturnNoopAnimator","$$willAnimate","recalculateTimingStyles","fullClassName","relativeDelay","hasTransitions","hasAnimations","applyAnimationDelay","delay","delayStyle","maxDelayTime","ONE_SECOND","maxDurationTime","easing","easeProp","easeVal","TIMING_KEY","events","startTime","Date","now","timerTime","CLOSING_TIME_BUFFER","endTime","animationsData","ANIMATE_TIMER_KEY","setupFallbackTimer","currentTimerData","expectedEndTime","timer","onAnimationExpired","onAnimationProgress","cleanupStyles","stopPropagation","ev","originalEvent","timeStamp","$manualTimeStamp","elapsedTime","toFixed","ELAPSED_TIME_MAX_DECIMAL_PLACES","playPause","playAnimation","arr","splice","maxStagger","itemIndex","floor","runnerHost","runnerHost.resume","runnerHost.pause","transitions","method","structuralClassName","addRemoveClassName","applyClassesEarly","trim","ACTIVE_CLASS_SUFFIX","hasToStyles","keyframeStyle","staggerVal","transitionStyle","durationStyle","staggerIndex","isFirst","skipBlocking","SAFE_FAST_FORWARD_DURATION_VALUE","hasTransitionAll","applyTransitionDuration","applyAnimationDuration","applyTransitionDelay","$$AnimateCssDriverProvider","$$animationProvider","$animateCss","filterCssClasses","replace","getUniqueValues","prepareAnchoredAnimation","outAnchor","inAnchor","calculateAnchorStyles","coords","getBoundingClientRect","bodyNode","scrollTop","scrollLeft","prepareInAnimation","endingClasses","startingClasses","animator","clone","NG_ANIMATE_SHIM_CLASS_NAME","cloneNode","NG_ANIMATE_ANCHOR_CLASS_NAME","rootBodyElement","append","animatorIn","animatorOut","prepareOutAnimation","NG_OUT_ANCHOR_CLASS_NAME","startingAnimator","prepareFromToAnchorAnimation","prepareRegularAnimation","anchorAnimations","outElement","inElement","animationRunners","rootNode","initDriverFn","$$AnimateJsProvider","lookupAnimations","flagMap","animationFactory","$$registeredAnimations","applyOptions","executeAnimationFn","args","classesToAdd","classesToRemove","apply","groupEventedAnimations","fnName","ani","endProgressCb","resolved","onAnimationComplete","packageAnimations","startAnimation","animateFn","before","after","afterFn","beforeFn","toUpperCase","substr","onComplete","success","closeActiveAnimations","cancelled","$$AnimateJsDriverProvider","$$animateJs","prepareAnimation","endFnFactory"]
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-animate/bower.json
deleted file mode 100644
index e0d8e54..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/bower.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "name": "angular-animate",
-  "version": "1.4.7",
-  "main": "./angular-animate.js",
-  "ignore": [],
-  "dependencies": {
-    "angular": "1.4.7"
-  }
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/index.js b/views/ngXosViews/serviceGrid/src/vendor/angular-animate/index.js
deleted file mode 100644
index 6ec0a35..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-require('./angular-animate');
-module.exports = 'ngAnimate';
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/package.json b/views/ngXosViews/serviceGrid/src/vendor/angular-animate/package.json
deleted file mode 100644
index 4374968..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-animate/package.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
-  "name": "angular-animate",
-  "version": "1.4.7",
-  "description": "AngularJS module for animations",
-  "main": "index.js",
-  "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
-  },
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/angular/angular.js.git"
-  },
-  "keywords": [
-    "angular",
-    "framework",
-    "browser",
-    "animation",
-    "client-side"
-  ],
-  "author": "Angular Core Team <angular-core+npm@google.com>",
-  "license": "MIT",
-  "bugs": {
-    "url": "https://github.com/angular/angular.js/issues"
-  },
-  "homepage": "http://angularjs.org"
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/.bower.json
deleted file mode 100644
index 7223baf..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/.bower.json
+++ /dev/null
@@ -1,63 +0,0 @@
-{
-  "name": "angular-chart.js",
-  "version": "0.10.2",
-  "main": [
-    "./dist/angular-chart.js",
-    "./dist/angular-chart.css"
-  ],
-  "authors": [
-    "Jerome Touffe-Blin <jtblin@gmail.com>"
-  ],
-  "repository": {
-    "type": "git",
-    "url": "git://github.com/jtblin/angular-chart.js.git"
-  },
-  "description": "An angular.js wrapper for Chart.js - reactive, responsive, beautiful charts.",
-  "moduleType": [
-    "globals"
-  ],
-  "keywords": [
-    "angular",
-    "angular.js",
-    "chartjs",
-    "chart",
-    "reactive",
-    "responsive",
-    "graph",
-    "bar",
-    "line",
-    "area",
-    "donut"
-  ],
-  "license": "BSD",
-  "ignore": [
-    "**/.*",
-    "node_modules",
-    "bower_components",
-    "examples",
-    "test",
-    "tests"
-  ],
-  "dependencies": {
-    "angular": "1.x",
-    "Chart.js": "~1.1.1"
-  },
-  "devDependencies": {
-    "Chart.StackedBar.js": "~1.0.1",
-    "angular-bootstrap": "~0.11.0",
-    "angular-mocks": "~1.x",
-    "font-awesome": "~4.1.0",
-    "rainbow": "~1.1.9",
-    "requirejs": "~2.1.20"
-  },
-  "homepage": "https://github.com/jtblin/angular-chart.js",
-  "_release": "0.10.2",
-  "_resolution": {
-    "type": "version",
-    "tag": "0.10.2",
-    "commit": "3ddc3a29c1217e9bfd2662d574c45e6e873e870d"
-  },
-  "_source": "https://github.com/jtblin/angular-chart.js.git",
-  "_target": "~0.10.2",
-  "_originalSource": "angular-chart.js"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/CONTRIBUTING.md b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/CONTRIBUTING.md
deleted file mode 100644
index 3f2f6b2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/CONTRIBUTING.md
+++ /dev/null
@@ -1,9 +0,0 @@
-### Contributing
-
-1. Create an issue
-1. Fork the repo
-1. Install dependencies: `npm install` and `bower install`
-1. Make your changes
-1. Install [GraphicsMagick](http://www.graphicsmagick.org/)
-1. Run linter and tests: `gulp check`
-1. Submit pull request
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/Dockerfile b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/Dockerfile
deleted file mode 100644
index a33c9b2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/Dockerfile
+++ /dev/null
@@ -1,7 +0,0 @@
-FROM jtblin/debian-node-graphicsmagick:stretch-node-v4.4.3-gm-v1.3.23
-WORKDIR /src
-ADD . ./
-RUN chown -R node:node /src
-USER node
-RUN npm install && npm install bower && ./node_modules/bower/bin/bower install
-CMD ["npm", "test"]
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/ISSUE_TEMPLATE.md b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/ISSUE_TEMPLATE.md
deleted file mode 100644
index be515e4..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/ISSUE_TEMPLATE.md
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--
-Thanks for wanting to report an issue you've found in angular-chart.js. 
-
-Plese note that issues or feature requests for Chart.js (e.g. new chart type, new axis, etc.) 
-need to be opened on Chart.js issues tracker: https://github.com/nnnick/Chart.js/issues.
-
-For general questions about usage, please use [http://stackoverflow.com/](http://stackoverflow.com/)
-as you will be more likely to get an appropriate answer.
- 
-Please check if the issue exists before creating a new one. 
-While opening an issue please provide a jsbin template or equivalent 
-to reproduce the issue. 
-
--->
-
-### Overview
-
-Describe the issue. What is the issue and what did you expect?
-
-Please make sure to review and check all of these items:
-
-- [ ] Use latest version of the library
-- [ ] Make sure you've included all the dependencies e.g Chart.js, angular, css file
-- [ ] Include a repro case, see below.
-
-
-### Step to reproduce
-
-**Ensure you add a link to a plunker, jsbin, or equivalent.** 
-Here is a [jsbin template](http://jsbin.com/dufibi/3/edit?html,js,output) for convenience.
-
-
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/LICENSE b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/LICENSE
deleted file mode 100644
index f3bd714..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) Jerome Touffe-Blin ("Author")
-All rights reserved.
-
-The BSD License
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/PULL_REQUEST_TEMPLATE.md b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index a650830..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,15 +0,0 @@
-<!-- Thanks for taking the time to submit a pull request for this project. Please ensure the following 
-     before opening a pull request as best as you can. -->
-
-### Description of change
-
-<!-- Please provide a description of the change here. Indicate which issue it's referring to. -->
-
-### Pull Request check-list
-
-- [ ] Run `gulp test` to ensure there are no linting, or style issues and all tests pass.
-- [ ] Squash your commits into a few commits only.
-- [ ] Make sure the commit message is short, concise and descriptive of the issues you're fixing.
-- [ ] Avoid mixing up multiple issues and/or features, open one pull request for each issue.
-- [ ] Have you updated the documentation and / or examples?
-- [ ] Have you included a new test?
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/README.md b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/README.md
deleted file mode 100644
index 0c81b1c..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/README.md
+++ /dev/null
@@ -1,219 +0,0 @@
-# angular-chart.js
-
-[![Bower version](https://badge.fury.io/bo/angular-chart.js.svg)](http://badge.fury.io/bo/angular-chart.js)
-[![npm version](https://badge.fury.io/js/angular-chart.js.svg)](http://badge.fury.io/js/angular-chart.js)
-[![Build Status](https://travis-ci.org/jtblin/angular-chart.js.svg?branch=master)](https://travis-ci.org/jtblin/angular-chart.js)
-[![Codacy Badge](https://api.codacy.com/project/badge/grade/6aa5ba92f4984a24874e5976ee541623)](https://www.codacy.com/app/jtblin/angular-chart-js)
-[![Code Coverage](https://d3s6mut3hikguw.cloudfront.net/github/jtblin/angular-chart.js/badges/coverage.svg)](https://codeclimate.com/github/jtblin/angular-chart.js)
-[![npm](https://img.shields.io/npm/dm/angular-chart.js.svg?maxAge=2592000)](https://www.npmjs.com/package/angular-chart.js)
-
-Beautiful, reactive, responsive charts for Angular.JS using [Chart.js](http://www.chartjs.org/). 
-
-[Demo](http://jtblin.github.io/angular-chart.js/)
-
-# v0.x - Chart.js v1.1.x - stable
-
-This is the stable version of angular-chart.js that uses the v1.1.x version of Chart.js.
-
-# v1.0.0-alpha - Chart.js v2.0.x
-
-If you are interested by the 2.0 version of Chart.js, please checkout the 
-[chartjs-2.0 branch](https://github.com/jtblin/angular-chart.js/tree/chartjs-2.0). Report issues
-and feedback for this version by opening issues labelled with `v1.x`.
-
-See https://github.com/jtblin/angular-chart.js/issues/123 for more details and subscribe to it to get 
-the latest progress on Chart.js 2.0 integration.
-
-# Installation
-
-### bower
-
-    bower install --save angular-chart.js
-
-### npm
-
-    npm install --save angular-chart.js
-
-### cdn
-
-    //cdn.jsdelivr.net/angular.chartjs/latest/angular-chart.min.js
-    //cdn.jsdelivr.net/angular.chartjs/latest/angular-chart.css
-
-### manually
-
-or copy the files from `dist/`. 
-
-Then add the sources to your code (adjust paths as needed) after 
-adding the dependencies for Angular and Chart.js first:
-
-```html
-<head>
-  <link rel="stylesheet" href="bower_components/angular-chart.js/dist/angular-chart.css" />
-<head>
-<body>
-  ...
-</body>
-  <script src="bower_components/angular/angular.min.js"></script>
-  <script src="bower_components/Chart.js/Chart.min.js"></script>
-  <script src="bower_components/angular-chart.js/dist/angular-chart.min.js"></script>
-```
-
-# Utilisation
-
-There are 6 types of charts so 6 directives: `chart-line`, `chart-bar`, `chart-radar`, `chart-pie`, 
-`chart-polar-area`, `chart-doughnut`.
-
-They all use mostly the same API (`[chart-]` indicates an optional but recommended prefix):
-
-- `[chart-]data`: series data
-- `[chart-]labels`: x axis labels (line, bar, radar) or series labels (pie, doughnut, polar area)
-- `[chart-]options`: chart options (as from [Chart.js documentation](http://www.chartjs.org/docs/))
-- `[chart-]series`: (default: `[]`): series labels (line, bar, radar)
-- `[chart-]colours`: data colours (will use default colours if not specified)
-- `getColour`: function that returns a colour in case there are not enough (will use random colours if not specified)
-- `[chart-]click`: onclick event handler
-- `[chart-]hover`: onmousemove event handler
-- `[chart-]legend`: (default: `false`): show legend below the chart
-
-*DEPRECATION WARNING*: Note that all attributes which do *not* use the `[chart-]` prefix are deprecated 
-and may be removed in a future version.
-
-There is another directive `chart-base` that takes an extra attribute `chart-type` to define the type
-dynamically, see [stacked bar example](http://jtblin.github.io/angular-chart.js/examples/stacked-bars.html).
-
-# Example
-
-## Markup
-
-```html
-<canvas id="line" class="chart chart-line" chart-data="data" chart-labels="labels" 
-	chart-legend="true" chart-series="series" chart-click="onClick"></canvas> 
-```
-
-## Javascript
-
-```javascript
-angular.module("app", ["chart.js"])
-  // Optional configuration
-  .config(['ChartJsProvider', function (ChartJsProvider) {
-    // Configure all charts
-    ChartJsProvider.setOptions({
-      colours: ['#FF5252', '#FF8A80'],
-      responsive: false
-    });
-    // Configure all line charts
-    ChartJsProvider.setOptions('Line', {
-      datasetFill: false
-    });
-  }])
-  .controller("LineCtrl", ['$scope', '$timeout', function ($scope, $timeout) {
-
-  $scope.labels = ["January", "February", "March", "April", "May", "June", "July"];
-  $scope.series = ['Series A', 'Series B'];
-  $scope.data = [
-    [65, 59, 80, 81, 56, 55, 40],
-    [28, 48, 40, 19, 86, 27, 90]
-  ];
-  $scope.onClick = function (points, evt) {
-    console.log(points, evt);
-  };
-  
-  // Simulate async data update
-  $timeout(function () {
-    $scope.data = [
-      [28, 48, 40, 19, 86, 27, 90],
-      [65, 59, 80, 81, 56, 55, 40]
-    ];
-  }, 3000);
-}]);
-```
-
-## AMD RequireJS
-
-See [a simple AMD example](examples/amd.js)
-
-## CommonJS e.g. webpack
-
-Module should work with CommonJS out of the box e.g. [browserify](http://browserify.org/) or 
-[webpack](http://webpack.github.io/), see a [webpack example](examples/webpack.config.js).
-
-# Reactive
-
-angular-chart.js watch updates on data, series, labels, colours and options and will update, or destroy and recreate, 
-the chart on changes.
-
-# Events
-
-angular-chart.js emits the following events on the `scope` and pass the chart as argument:
-
-* `create`: when chart is created
-* `update`: when chart is updated
-* `destroy`: when chart is destroyed
-
-```
-$scope.$on('create', function (event, chart) {
-  console.log(chart);
-});
-```
-
-**Note**: the event can be emitted multiple times for each chart as the chart can be destroyed and
-created multiple times during angular `watch` lifecycle.
-
-angular-chart.js listen to the scope `destroy` event and destroy the chart when it happens.
-
-# Colours
-
-There are a set of 7 default colours. Colours can be replaced using the `colours` attribute.
-If there is more data than colours, colours are generated randomly or can be provided 
-via a function through the `getColour` attribute.
-
-Hex colours are converted to Chart.js colours automatically, 
-including different shades for highlight, fill, stroke, etc.
-
-## Browser compatibility
-
-For IE8 and older browsers, you will need 
-to include [excanvas](https://code.google.com/p/explorercanvas/wiki/Instructions). 
-You will also need a [shim](https://github.com/es-shims/es5-shim) for ES5 functions.
-
-You also need to have  ```height``` and ```width``` attributes for the ```<canvas>``` tag of your chart if using IE8 and older browsers. If you *do not* have these attributes, you will need a 
-[getComputedStyle shim](https://github.com/Financial-Times/polyfill-service/blob/master/polyfills/getComputedStyle/polyfill.js) and the line ```document.defaultView = window;```, but there still may be errors (due to code in Chart.js).
-
-```html
-<head>
-<!--[if lt IE 9]>
-  <script src="excanvas.js"></script>
-  <script src="es5-shim.js"></script>
-<![endif]-->
-</head>
-```
-
-# Issues
-
-**Issues or feature requests for Chart.js (e.g. new chart type, new axis, etc.) need to be opened on 
-[Chart.js issues tracker](https://github.com/nnnick/Chart.js/issues)**
-
-**For general questions about usage, please use [http://stackoverflow.com/](http://stackoverflow.com/)**
- 
-Please check if issue exists first, otherwise open issue in [github](https://github.com/jtblin/angular-chart.js/issues). 
-**Ensure you add a link to a plunker, jsbin, or equivalent.** 
-Here is a [jsbin template](http://jsbin.com/dufibi/3/edit?html,js,output) for convenience.
-
-# Contributing
- 
-Pull requests welcome!
-
-See [CONTRIBUTING.md](CONTRIBUTING.md).
-
-## Contributors
-
-Thank you to the [contributors](https://github.com/jtblin/angular-chart.js/graphs/contributors)!
-
-# Author
-
-Jerome Touffe-Blin, [@jtblin](https://twitter.com/jtblin), [About me](http://about.me/jtblin)
-
-# License
-
-angular-chart.js is copyright 2015 Jerome Touffe-Blin and contributors. 
-It is licensed under the BSD license. See the include LICENSE file for details.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/angular-chart.js b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/angular-chart.js
deleted file mode 100644
index 4624343..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/angular-chart.js
+++ /dev/null
@@ -1,375 +0,0 @@
-(function (factory) {
-  'use strict';
-  if (typeof exports === 'object') {
-    // Node/CommonJS
-    module.exports = factory(
-      typeof angular !== 'undefined' ? angular : require('angular'),
-      typeof Chart !== 'undefined' ? Chart : require('chart.js'));
-  }  else if (typeof define === 'function' && define.amd) {
-    // AMD. Register as an anonymous module.
-    define(['angular', 'chart'], factory);
-  } else {
-    // Browser globals
-    factory(angular, Chart);
-  }
-}(function (angular, Chart) {
-  'use strict';
-
-  Chart.defaults.global.responsive = true;
-  Chart.defaults.global.multiTooltipTemplate = '<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>';
-
-  Chart.defaults.global.colours = [
-    '#97BBCD', // blue
-    '#DCDCDC', // light grey
-    '#F7464A', // red
-    '#46BFBD', // green
-    '#FDB45C', // yellow
-    '#949FB1', // grey
-    '#4D5360'  // dark grey
-  ];
-
-  var usingExcanvas = typeof window.G_vmlCanvasManager === 'object' &&
-    window.G_vmlCanvasManager !== null &&
-    typeof window.G_vmlCanvasManager.initElement === 'function';
-
-  if (usingExcanvas) Chart.defaults.global.animation = false;
-
-  return angular.module('chart.js', [])
-    .provider('ChartJs', ChartJsProvider)
-    .factory('ChartJsFactory', ['ChartJs', '$timeout', ChartJsFactory])
-    .directive('chartBase', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory(); }])
-    .directive('chartLine', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Line'); }])
-    .directive('chartBar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Bar'); }])
-    .directive('chartRadar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Radar'); }])
-    .directive('chartDoughnut', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Doughnut'); }])
-    .directive('chartPie', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Pie'); }])
-    .directive('chartPolarArea', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('PolarArea'); }]);
-
-  /**
-   * Wrapper for chart.js
-   * Allows configuring chart js using the provider
-   *
-   * angular.module('myModule', ['chart.js']).config(function(ChartJsProvider) {
-   *   ChartJsProvider.setOptions({ responsive: true });
-   *   ChartJsProvider.setOptions('Line', { responsive: false });
-   * })))
-   */
-  function ChartJsProvider () {
-    var options = {};
-    var ChartJs = {
-      Chart: Chart,
-      getOptions: function (type) {
-        var typeOptions = type && options[type] || {};
-        return angular.extend({}, options, typeOptions);
-      }
-    };
-
-    /**
-     * Allow to set global options during configuration
-     */
-    this.setOptions = function (type, customOptions) {
-      // If no type was specified set option for the global object
-      if (! customOptions) {
-        customOptions = type;
-        options = angular.extend(options, customOptions);
-        return;
-      }
-      // Set options for the specific chart
-      options[type] = angular.extend(options[type] || {}, customOptions);
-    };
-
-    this.$get = function () {
-      return ChartJs;
-    };
-  }
-
-  function ChartJsFactory (ChartJs, $timeout) {
-    return function chart (type) {
-      return {
-        restrict: 'CA',
-        scope: {
-          data: '=?',
-          labels: '=?',
-          options: '=?',
-          series: '=?',
-          colours: '=?',
-          getColour: '=?',
-          chartType: '=',
-          legend: '@',
-          click: '=?',
-          hover: '=?',
-
-          chartData: '=?',
-          chartLabels: '=?',
-          chartOptions: '=?',
-          chartSeries: '=?',
-          chartColours: '=?',
-          chartLegend: '@',
-          chartClick: '=?',
-          chartHover: '=?'
-        },
-        link: function (scope, elem/*, attrs */) {
-          var chart, container = document.createElement('div');
-          container.className = 'chart-container';
-          elem.replaceWith(container);
-          container.appendChild(elem[0]);
-
-          if (usingExcanvas) window.G_vmlCanvasManager.initElement(elem[0]);
-
-          ['data', 'labels', 'options', 'series', 'colours', 'legend', 'click', 'hover'].forEach(deprecated);
-          function aliasVar (fromName, toName) {
-            scope.$watch(fromName, function (newVal) {
-              if (typeof newVal === 'undefined') return;
-              scope[toName] = newVal;
-            });
-          }
-          /* provide backward compatibility to "old" directive names, by
-           * having an alias point from the new names to the old names. */
-          aliasVar('chartData', 'data');
-          aliasVar('chartLabels', 'labels');
-          aliasVar('chartOptions', 'options');
-          aliasVar('chartSeries', 'series');
-          aliasVar('chartColours', 'colours');
-          aliasVar('chartLegend', 'legend');
-          aliasVar('chartClick', 'click');
-          aliasVar('chartHover', 'hover');
-
-          // Order of setting "watch" matter
-
-          scope.$watch('data', function (newVal, oldVal) {
-            if (! newVal || ! newVal.length || (Array.isArray(newVal[0]) && ! newVal[0].length)) {
-              destroyChart(chart, scope);
-              return;
-            }
-            var chartType = type || scope.chartType;
-            if (! chartType) return;
-
-            if (chart && canUpdateChart(newVal, oldVal))
-              return updateChart(chart, newVal, scope, elem);
-
-            createChart(chartType);
-          }, true);
-
-          scope.$watch('series', resetChart, true);
-          scope.$watch('labels', resetChart, true);
-          scope.$watch('options', resetChart, true);
-          scope.$watch('colours', resetChart, true);
-
-          scope.$watch('chartType', function (newVal, oldVal) {
-            if (isEmpty(newVal)) return;
-            if (angular.equals(newVal, oldVal)) return;
-            createChart(newVal);
-          });
-
-          scope.$on('$destroy', function () {
-            destroyChart(chart, scope);
-          });
-
-          function resetChart (newVal, oldVal) {
-            if (isEmpty(newVal)) return;
-            if (angular.equals(newVal, oldVal)) return;
-            var chartType = type || scope.chartType;
-            if (! chartType) return;
-
-            // chart.update() doesn't work for series and labels
-            // so we have to re-create the chart entirely
-            createChart(chartType);
-          }
-
-          function createChart (type) {
-            if (isResponsive(type, scope) && elem[0].clientHeight === 0 && container.clientHeight === 0) {
-              return $timeout(function () {
-                createChart(type);
-              }, 50, false);
-            }
-            if (! scope.data || ! scope.data.length) return;
-            scope.getColour = typeof scope.getColour === 'function' ? scope.getColour : getRandomColour;
-            var colours = getColours(type, scope);
-            var cvs = elem[0], ctx = cvs.getContext('2d');
-            var data = Array.isArray(scope.data[0]) ?
-              getDataSets(scope.labels, scope.data, scope.series || [], colours) :
-              getData(scope.labels, scope.data, colours);
-            var options = angular.extend({}, ChartJs.getOptions(type), scope.options);
-
-            // Destroy old chart if it exists to avoid ghost charts issue
-            // https://github.com/jtblin/angular-chart.js/issues/187
-            destroyChart(chart, scope);
-            chart = new ChartJs.Chart(ctx)[type](data, options);
-            scope.$emit('create', chart);
-
-            // Bind events
-            cvs.onclick = scope.click ? getEventHandler(scope, chart, 'click', false) : angular.noop;
-            cvs.onmousemove = scope.hover ? getEventHandler(scope, chart, 'hover', true) : angular.noop;
-
-            if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);
-          }
-
-          function deprecated (attr) {
-            if (typeof console !== 'undefined' && ChartJs.getOptions().env !== 'test') {
-              var warn = typeof console.warn === 'function' ? console.warn : console.log;
-              if (!! scope[attr]) {
-                warn.call(console, '"%s" is deprecated and will be removed in a future version. ' +
-                  'Please use "chart-%s" instead.', attr, attr);
-              }
-            }
-          }
-        }
-      };
-    };
-
-    function canUpdateChart (newVal, oldVal) {
-      if (newVal && oldVal && newVal.length && oldVal.length) {
-        return Array.isArray(newVal[0]) ?
-        newVal.length === oldVal.length && newVal.every(function (element, index) {
-          return element.length === oldVal[index].length; }) :
-          oldVal.reduce(sum, 0) > 0 ? newVal.length === oldVal.length : false;
-      }
-      return false;
-    }
-
-    function sum (carry, val) {
-      return carry + val;
-    }
-
-    function getEventHandler (scope, chart, action, triggerOnlyOnChange) {
-      var lastState = null;
-      return function (evt) {
-        var atEvent = chart.getPointsAtEvent || chart.getBarsAtEvent || chart.getSegmentsAtEvent;
-        if (atEvent) {
-          var activePoints = atEvent.call(chart, evt);
-          if (triggerOnlyOnChange === false || angular.equals(lastState, activePoints) === false) {
-            lastState = activePoints;
-            scope[action](activePoints, evt);
-            scope.$apply();
-          }
-        }
-      };
-    }
-
-    function getColours (type, scope) {
-      var notEnoughColours = false;
-      var colours = angular.copy(scope.colours ||
-        ChartJs.getOptions(type).colours ||
-        Chart.defaults.global.colours
-      );
-      while (colours.length < scope.data.length) {
-        colours.push(scope.getColour());
-        notEnoughColours = true;
-      }
-      // mutate colours in this case as we don't want
-      // the colours to change on each refresh
-      if (notEnoughColours) scope.colours = colours;
-      return colours.map(convertColour);
-    }
-
-    function convertColour (colour) {
-      if (typeof colour === 'object' && colour !== null) return colour;
-      if (typeof colour === 'string' && colour[0] === '#') return getColour(hexToRgb(colour.substr(1)));
-      return getRandomColour();
-    }
-
-    function getRandomColour () {
-      var colour = [getRandomInt(0, 255), getRandomInt(0, 255), getRandomInt(0, 255)];
-      return getColour(colour);
-    }
-
-    function getColour (colour) {
-      return {
-        fillColor: rgba(colour, 0.2),
-        strokeColor: rgba(colour, 1),
-        pointColor: rgba(colour, 1),
-        pointStrokeColor: '#fff',
-        pointHighlightFill: '#fff',
-        pointHighlightStroke: rgba(colour, 0.8)
-      };
-    }
-
-    function getRandomInt (min, max) {
-      return Math.floor(Math.random() * (max - min + 1)) + min;
-    }
-
-    function rgba (colour, alpha) {
-      if (usingExcanvas) {
-        // rgba not supported by IE8
-        return 'rgb(' + colour.join(',') + ')';
-      } else {
-        return 'rgba(' + colour.concat(alpha).join(',') + ')';
-      }
-    }
-
-    // Credit: http://stackoverflow.com/a/11508164/1190235
-    function hexToRgb (hex) {
-      var bigint = parseInt(hex, 16),
-        r = (bigint >> 16) & 255,
-        g = (bigint >> 8) & 255,
-        b = bigint & 255;
-
-      return [r, g, b];
-    }
-
-    function getDataSets (labels, data, series, colours) {
-      return {
-        labels: labels,
-        datasets: data.map(function (item, i) {
-          return angular.extend({}, colours[i], {
-            label: series[i],
-            data: item
-          });
-        })
-      };
-    }
-
-    function getData (labels, data, colours) {
-      return labels.map(function (label, i) {
-        return angular.extend({}, colours[i], {
-          label: label,
-          value: data[i],
-          color: colours[i].strokeColor,
-          highlight: colours[i].pointHighlightStroke
-        });
-      });
-    }
-
-    function setLegend (elem, chart) {
-      var $parent = elem.parent(),
-          $oldLegend = $parent.find('chart-legend'),
-          legend = '<chart-legend>' + chart.generateLegend() + '</chart-legend>';
-      if ($oldLegend.length) $oldLegend.replaceWith(legend);
-      else $parent.append(legend);
-    }
-
-    function updateChart (chart, values, scope, elem) {
-      if (Array.isArray(scope.data[0])) {
-        chart.datasets.forEach(function (dataset, i) {
-          (dataset.points || dataset.bars).forEach(function (dataItem, j) {
-            dataItem.value = values[i][j];
-          });
-        });
-      } else {
-        chart.segments.forEach(function (segment, i) {
-          segment.value = values[i];
-        });
-      }
-      chart.update();
-      scope.$emit('update', chart);
-      if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);
-    }
-
-    function isEmpty (value) {
-      return ! value ||
-        (Array.isArray(value) && ! value.length) ||
-        (typeof value === 'object' && ! Object.keys(value).length);
-    }
-
-    function isResponsive (type, scope) {
-      var options = angular.extend({}, Chart.defaults.global, ChartJs.getOptions(type), scope.options);
-      return options.responsive;
-    }
-
-    function destroyChart(chart, scope) {
-      if(! chart) return;
-      chart.destroy();
-      scope.$emit('destroy', chart);
-    }
-  }
-}));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/angular-chart.less b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/angular-chart.less
deleted file mode 100644
index 4e30cd1..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/angular-chart.less
+++ /dev/null
@@ -1,30 +0,0 @@
-.chart-legend, .bar-legend, .line-legend, .pie-legend, .radar-legend, .polararea-legend, .doughnut-legend {
-  list-style-type: none;
-  margin-top: 5px;
-  text-align: center;
-  /* NOTE: Browsers automatically add 40px of padding-left to all lists, so we should offset that, otherwise the legend is off-center */
-  -webkit-padding-start:0; /* Webkit */
-  -moz-padding-start:0; /* Mozilla */
-  padding-left:0; /* IE (handles all cases, really, but we should also include the vendor-specific properties just to be safe) */
-
-  li {
-    display: inline-block;
-    white-space: nowrap;
-    position: relative;
-    margin-bottom: 4px;
-    border-radius: 5px;
-    padding: 2px 8px 2px 28px;
-    font-size: smaller;
-    cursor: default;
-  }
-}
-
-.chart-legend-icon, .bar-legend-icon, .line-legend-icon, .pie-legend-icon, .radar-legend-icon, .polararea-legend-icon, .doughnut-legend-icon {
-  display: block;
-  position: absolute;
-  left: 0;
-  top: 0;
-  width: 20px;
-  height: 20px;
-  border-radius: 5px;
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/bower.json
deleted file mode 100644
index a733e52..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/bower.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
-  "name": "angular-chart.js",
-  "version": "0.10.2",
-  "main": [
-    "./dist/angular-chart.js",
-    "./dist/angular-chart.css"
-  ],
-  "authors": [
-    "Jerome Touffe-Blin <jtblin@gmail.com>"
-  ],
-  "repository": {
-    "type": "git",
-    "url": "git://github.com/jtblin/angular-chart.js.git"
-  },
-  "description": "An angular.js wrapper for Chart.js - reactive, responsive, beautiful charts.",
-  "moduleType": [
-    "globals"
-  ],
-  "keywords": [
-    "angular",
-    "angular.js",
-    "chartjs",
-    "chart",
-    "reactive",
-    "responsive",
-    "graph",
-    "bar",
-    "line",
-    "area",
-    "donut"
-  ],
-  "license": "BSD",
-  "ignore": [
-    "**/.*",
-    "node_modules",
-    "bower_components",
-    "examples",
-    "test",
-    "tests"
-  ],
-  "dependencies": {
-    "angular": "1.x",
-    "Chart.js": "~1.1.1"
-  },
-  "devDependencies": {
-    "Chart.StackedBar.js": "~1.0.1",
-    "angular-bootstrap": "~0.11.0",
-    "angular-mocks": "~1.x",
-    "font-awesome": "~4.1.0",
-    "rainbow": "~1.1.9",
-    "requirejs": "~2.1.20"
-  }
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.css b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.css
deleted file mode 100644
index 9fc8593..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.css
+++ /dev/null
@@ -1,49 +0,0 @@
-.chart-legend,
-.bar-legend,
-.line-legend,
-.pie-legend,
-.radar-legend,
-.polararea-legend,
-.doughnut-legend {
-  list-style-type: none;
-  margin-top: 5px;
-  text-align: center;
-  /* NOTE: Browsers automatically add 40px of padding-left to all lists, so we should offset that, otherwise the legend is off-center */
-  -webkit-padding-start: 0;
-  /* Webkit */
-  -moz-padding-start: 0;
-  /* Mozilla */
-  padding-left: 0;
-  /* IE (handles all cases, really, but we should also include the vendor-specific properties just to be safe) */
-}
-.chart-legend li,
-.bar-legend li,
-.line-legend li,
-.pie-legend li,
-.radar-legend li,
-.polararea-legend li,
-.doughnut-legend li {
-  display: inline-block;
-  white-space: nowrap;
-  position: relative;
-  margin-bottom: 4px;
-  border-radius: 5px;
-  padding: 2px 8px 2px 28px;
-  font-size: smaller;
-  cursor: default;
-}
-.chart-legend-icon,
-.bar-legend-icon,
-.line-legend-icon,
-.pie-legend-icon,
-.radar-legend-icon,
-.polararea-legend-icon,
-.doughnut-legend-icon {
-  display: block;
-  position: absolute;
-  left: 0;
-  top: 0;
-  width: 20px;
-  height: 20px;
-  border-radius: 5px;
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js
deleted file mode 100644
index 4624343..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js
+++ /dev/null
@@ -1,375 +0,0 @@
-(function (factory) {
-  'use strict';
-  if (typeof exports === 'object') {
-    // Node/CommonJS
-    module.exports = factory(
-      typeof angular !== 'undefined' ? angular : require('angular'),
-      typeof Chart !== 'undefined' ? Chart : require('chart.js'));
-  }  else if (typeof define === 'function' && define.amd) {
-    // AMD. Register as an anonymous module.
-    define(['angular', 'chart'], factory);
-  } else {
-    // Browser globals
-    factory(angular, Chart);
-  }
-}(function (angular, Chart) {
-  'use strict';
-
-  Chart.defaults.global.responsive = true;
-  Chart.defaults.global.multiTooltipTemplate = '<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>';
-
-  Chart.defaults.global.colours = [
-    '#97BBCD', // blue
-    '#DCDCDC', // light grey
-    '#F7464A', // red
-    '#46BFBD', // green
-    '#FDB45C', // yellow
-    '#949FB1', // grey
-    '#4D5360'  // dark grey
-  ];
-
-  var usingExcanvas = typeof window.G_vmlCanvasManager === 'object' &&
-    window.G_vmlCanvasManager !== null &&
-    typeof window.G_vmlCanvasManager.initElement === 'function';
-
-  if (usingExcanvas) Chart.defaults.global.animation = false;
-
-  return angular.module('chart.js', [])
-    .provider('ChartJs', ChartJsProvider)
-    .factory('ChartJsFactory', ['ChartJs', '$timeout', ChartJsFactory])
-    .directive('chartBase', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory(); }])
-    .directive('chartLine', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Line'); }])
-    .directive('chartBar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Bar'); }])
-    .directive('chartRadar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Radar'); }])
-    .directive('chartDoughnut', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Doughnut'); }])
-    .directive('chartPie', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Pie'); }])
-    .directive('chartPolarArea', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('PolarArea'); }]);
-
-  /**
-   * Wrapper for chart.js
-   * Allows configuring chart js using the provider
-   *
-   * angular.module('myModule', ['chart.js']).config(function(ChartJsProvider) {
-   *   ChartJsProvider.setOptions({ responsive: true });
-   *   ChartJsProvider.setOptions('Line', { responsive: false });
-   * })))
-   */
-  function ChartJsProvider () {
-    var options = {};
-    var ChartJs = {
-      Chart: Chart,
-      getOptions: function (type) {
-        var typeOptions = type && options[type] || {};
-        return angular.extend({}, options, typeOptions);
-      }
-    };
-
-    /**
-     * Allow to set global options during configuration
-     */
-    this.setOptions = function (type, customOptions) {
-      // If no type was specified set option for the global object
-      if (! customOptions) {
-        customOptions = type;
-        options = angular.extend(options, customOptions);
-        return;
-      }
-      // Set options for the specific chart
-      options[type] = angular.extend(options[type] || {}, customOptions);
-    };
-
-    this.$get = function () {
-      return ChartJs;
-    };
-  }
-
-  function ChartJsFactory (ChartJs, $timeout) {
-    return function chart (type) {
-      return {
-        restrict: 'CA',
-        scope: {
-          data: '=?',
-          labels: '=?',
-          options: '=?',
-          series: '=?',
-          colours: '=?',
-          getColour: '=?',
-          chartType: '=',
-          legend: '@',
-          click: '=?',
-          hover: '=?',
-
-          chartData: '=?',
-          chartLabels: '=?',
-          chartOptions: '=?',
-          chartSeries: '=?',
-          chartColours: '=?',
-          chartLegend: '@',
-          chartClick: '=?',
-          chartHover: '=?'
-        },
-        link: function (scope, elem/*, attrs */) {
-          var chart, container = document.createElement('div');
-          container.className = 'chart-container';
-          elem.replaceWith(container);
-          container.appendChild(elem[0]);
-
-          if (usingExcanvas) window.G_vmlCanvasManager.initElement(elem[0]);
-
-          ['data', 'labels', 'options', 'series', 'colours', 'legend', 'click', 'hover'].forEach(deprecated);
-          function aliasVar (fromName, toName) {
-            scope.$watch(fromName, function (newVal) {
-              if (typeof newVal === 'undefined') return;
-              scope[toName] = newVal;
-            });
-          }
-          /* provide backward compatibility to "old" directive names, by
-           * having an alias point from the new names to the old names. */
-          aliasVar('chartData', 'data');
-          aliasVar('chartLabels', 'labels');
-          aliasVar('chartOptions', 'options');
-          aliasVar('chartSeries', 'series');
-          aliasVar('chartColours', 'colours');
-          aliasVar('chartLegend', 'legend');
-          aliasVar('chartClick', 'click');
-          aliasVar('chartHover', 'hover');
-
-          // Order of setting "watch" matter
-
-          scope.$watch('data', function (newVal, oldVal) {
-            if (! newVal || ! newVal.length || (Array.isArray(newVal[0]) && ! newVal[0].length)) {
-              destroyChart(chart, scope);
-              return;
-            }
-            var chartType = type || scope.chartType;
-            if (! chartType) return;
-
-            if (chart && canUpdateChart(newVal, oldVal))
-              return updateChart(chart, newVal, scope, elem);
-
-            createChart(chartType);
-          }, true);
-
-          scope.$watch('series', resetChart, true);
-          scope.$watch('labels', resetChart, true);
-          scope.$watch('options', resetChart, true);
-          scope.$watch('colours', resetChart, true);
-
-          scope.$watch('chartType', function (newVal, oldVal) {
-            if (isEmpty(newVal)) return;
-            if (angular.equals(newVal, oldVal)) return;
-            createChart(newVal);
-          });
-
-          scope.$on('$destroy', function () {
-            destroyChart(chart, scope);
-          });
-
-          function resetChart (newVal, oldVal) {
-            if (isEmpty(newVal)) return;
-            if (angular.equals(newVal, oldVal)) return;
-            var chartType = type || scope.chartType;
-            if (! chartType) return;
-
-            // chart.update() doesn't work for series and labels
-            // so we have to re-create the chart entirely
-            createChart(chartType);
-          }
-
-          function createChart (type) {
-            if (isResponsive(type, scope) && elem[0].clientHeight === 0 && container.clientHeight === 0) {
-              return $timeout(function () {
-                createChart(type);
-              }, 50, false);
-            }
-            if (! scope.data || ! scope.data.length) return;
-            scope.getColour = typeof scope.getColour === 'function' ? scope.getColour : getRandomColour;
-            var colours = getColours(type, scope);
-            var cvs = elem[0], ctx = cvs.getContext('2d');
-            var data = Array.isArray(scope.data[0]) ?
-              getDataSets(scope.labels, scope.data, scope.series || [], colours) :
-              getData(scope.labels, scope.data, colours);
-            var options = angular.extend({}, ChartJs.getOptions(type), scope.options);
-
-            // Destroy old chart if it exists to avoid ghost charts issue
-            // https://github.com/jtblin/angular-chart.js/issues/187
-            destroyChart(chart, scope);
-            chart = new ChartJs.Chart(ctx)[type](data, options);
-            scope.$emit('create', chart);
-
-            // Bind events
-            cvs.onclick = scope.click ? getEventHandler(scope, chart, 'click', false) : angular.noop;
-            cvs.onmousemove = scope.hover ? getEventHandler(scope, chart, 'hover', true) : angular.noop;
-
-            if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);
-          }
-
-          function deprecated (attr) {
-            if (typeof console !== 'undefined' && ChartJs.getOptions().env !== 'test') {
-              var warn = typeof console.warn === 'function' ? console.warn : console.log;
-              if (!! scope[attr]) {
-                warn.call(console, '"%s" is deprecated and will be removed in a future version. ' +
-                  'Please use "chart-%s" instead.', attr, attr);
-              }
-            }
-          }
-        }
-      };
-    };
-
-    function canUpdateChart (newVal, oldVal) {
-      if (newVal && oldVal && newVal.length && oldVal.length) {
-        return Array.isArray(newVal[0]) ?
-        newVal.length === oldVal.length && newVal.every(function (element, index) {
-          return element.length === oldVal[index].length; }) :
-          oldVal.reduce(sum, 0) > 0 ? newVal.length === oldVal.length : false;
-      }
-      return false;
-    }
-
-    function sum (carry, val) {
-      return carry + val;
-    }
-
-    function getEventHandler (scope, chart, action, triggerOnlyOnChange) {
-      var lastState = null;
-      return function (evt) {
-        var atEvent = chart.getPointsAtEvent || chart.getBarsAtEvent || chart.getSegmentsAtEvent;
-        if (atEvent) {
-          var activePoints = atEvent.call(chart, evt);
-          if (triggerOnlyOnChange === false || angular.equals(lastState, activePoints) === false) {
-            lastState = activePoints;
-            scope[action](activePoints, evt);
-            scope.$apply();
-          }
-        }
-      };
-    }
-
-    function getColours (type, scope) {
-      var notEnoughColours = false;
-      var colours = angular.copy(scope.colours ||
-        ChartJs.getOptions(type).colours ||
-        Chart.defaults.global.colours
-      );
-      while (colours.length < scope.data.length) {
-        colours.push(scope.getColour());
-        notEnoughColours = true;
-      }
-      // mutate colours in this case as we don't want
-      // the colours to change on each refresh
-      if (notEnoughColours) scope.colours = colours;
-      return colours.map(convertColour);
-    }
-
-    function convertColour (colour) {
-      if (typeof colour === 'object' && colour !== null) return colour;
-      if (typeof colour === 'string' && colour[0] === '#') return getColour(hexToRgb(colour.substr(1)));
-      return getRandomColour();
-    }
-
-    function getRandomColour () {
-      var colour = [getRandomInt(0, 255), getRandomInt(0, 255), getRandomInt(0, 255)];
-      return getColour(colour);
-    }
-
-    function getColour (colour) {
-      return {
-        fillColor: rgba(colour, 0.2),
-        strokeColor: rgba(colour, 1),
-        pointColor: rgba(colour, 1),
-        pointStrokeColor: '#fff',
-        pointHighlightFill: '#fff',
-        pointHighlightStroke: rgba(colour, 0.8)
-      };
-    }
-
-    function getRandomInt (min, max) {
-      return Math.floor(Math.random() * (max - min + 1)) + min;
-    }
-
-    function rgba (colour, alpha) {
-      if (usingExcanvas) {
-        // rgba not supported by IE8
-        return 'rgb(' + colour.join(',') + ')';
-      } else {
-        return 'rgba(' + colour.concat(alpha).join(',') + ')';
-      }
-    }
-
-    // Credit: http://stackoverflow.com/a/11508164/1190235
-    function hexToRgb (hex) {
-      var bigint = parseInt(hex, 16),
-        r = (bigint >> 16) & 255,
-        g = (bigint >> 8) & 255,
-        b = bigint & 255;
-
-      return [r, g, b];
-    }
-
-    function getDataSets (labels, data, series, colours) {
-      return {
-        labels: labels,
-        datasets: data.map(function (item, i) {
-          return angular.extend({}, colours[i], {
-            label: series[i],
-            data: item
-          });
-        })
-      };
-    }
-
-    function getData (labels, data, colours) {
-      return labels.map(function (label, i) {
-        return angular.extend({}, colours[i], {
-          label: label,
-          value: data[i],
-          color: colours[i].strokeColor,
-          highlight: colours[i].pointHighlightStroke
-        });
-      });
-    }
-
-    function setLegend (elem, chart) {
-      var $parent = elem.parent(),
-          $oldLegend = $parent.find('chart-legend'),
-          legend = '<chart-legend>' + chart.generateLegend() + '</chart-legend>';
-      if ($oldLegend.length) $oldLegend.replaceWith(legend);
-      else $parent.append(legend);
-    }
-
-    function updateChart (chart, values, scope, elem) {
-      if (Array.isArray(scope.data[0])) {
-        chart.datasets.forEach(function (dataset, i) {
-          (dataset.points || dataset.bars).forEach(function (dataItem, j) {
-            dataItem.value = values[i][j];
-          });
-        });
-      } else {
-        chart.segments.forEach(function (segment, i) {
-          segment.value = values[i];
-        });
-      }
-      chart.update();
-      scope.$emit('update', chart);
-      if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);
-    }
-
-    function isEmpty (value) {
-      return ! value ||
-        (Array.isArray(value) && ! value.length) ||
-        (typeof value === 'object' && ! Object.keys(value).length);
-    }
-
-    function isResponsive (type, scope) {
-      var options = angular.extend({}, Chart.defaults.global, ChartJs.getOptions(type), scope.options);
-      return options.responsive;
-    }
-
-    function destroyChart(chart, scope) {
-      if(! chart) return;
-      chart.destroy();
-      scope.$emit('destroy', chart);
-    }
-  }
-}));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js.tar.gz b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js.tar.gz
deleted file mode 100644
index 8171824..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.js.tar.gz
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css
deleted file mode 100644
index 40c1412..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.bar-legend,.chart-legend,.doughnut-legend,.line-legend,.pie-legend,.polararea-legend,.radar-legend{list-style-type:none;margin-top:5px;text-align:center;-webkit-padding-start:0;-moz-padding-start:0;padding-left:0}.bar-legend li,.chart-legend li,.doughnut-legend li,.line-legend li,.pie-legend li,.polararea-legend li,.radar-legend li{display:inline-block;white-space:nowrap;position:relative;margin-bottom:4px;border-radius:5px;padding:2px 8px 2px 28px;font-size:smaller;cursor:default}.bar-legend-icon,.chart-legend-icon,.doughnut-legend-icon,.line-legend-icon,.pie-legend-icon,.polararea-legend-icon,.radar-legend-icon{display:block;position:absolute;left:0;top:0;width:20px;height:20px;border-radius:5px}
-/*# sourceMappingURL=angular-chart.min.css.map */
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css.map b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css.map
deleted file mode 100644
index 65db89b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.css.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["angular-chart.css"],"names":[],"mappings":"AAAc,W,CAAd,a,CAKkB,gB,CAJN,Y,CACC,W,CAEC,iB,CADF,a,CAIV,oB,CACA,c,CACA,iB,CAEA,uB,CAEA,oB,CAEA,c,CAGe,c,CAAjB,gB,CAKqB,mB,CAJN,e,CACC,c,CAEC,oB,CADF,gB,CAIb,oB,CACA,kB,CACA,iB,CACA,iB,CACA,iB,CACA,wB,CACA,iB,CACA,c,CAEiB,gB,CAAnB,kB,CAKuB,qB,CAJN,iB,CACC,gB,CAEC,sB,CADF,kB,CAIf,a,CACA,iB,CACA,M,CACA,K,CACA,U,CACA,W,CACA,iB","file":"angular-chart.min.css","sourcesContent":[".chart-legend,\n.bar-legend,\n.line-legend,\n.pie-legend,\n.radar-legend,\n.polararea-legend,\n.doughnut-legend {\n  list-style-type: none;\n  margin-top: 5px;\n  text-align: center;\n  /* NOTE: Browsers automatically add 40px of padding-left to all lists, so we should offset that, otherwise the legend is off-center */\n  -webkit-padding-start: 0;\n  /* Webkit */\n  -moz-padding-start: 0;\n  /* Mozilla */\n  padding-left: 0;\n  /* IE (handles all cases, really, but we should also include the vendor-specific properties just to be safe) */\n}\n.chart-legend li,\n.bar-legend li,\n.line-legend li,\n.pie-legend li,\n.radar-legend li,\n.polararea-legend li,\n.doughnut-legend li {\n  display: inline-block;\n  white-space: nowrap;\n  position: relative;\n  margin-bottom: 4px;\n  border-radius: 5px;\n  padding: 2px 8px 2px 28px;\n  font-size: smaller;\n  cursor: default;\n}\n.chart-legend-icon,\n.bar-legend-icon,\n.line-legend-icon,\n.pie-legend-icon,\n.radar-legend-icon,\n.polararea-legend-icon,\n.doughnut-legend-icon {\n  display: block;\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 20px;\n  height: 20px;\n  border-radius: 5px;\n}\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js
deleted file mode 100644
index eca3a1e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-!function(t){"use strict";"object"==typeof exports?module.exports=t("undefined"!=typeof angular?angular:require("angular"),"undefined"!=typeof Chart?Chart:require("chart.js")):"function"==typeof define&&define.amd?define(["angular","chart"],t):t(angular,Chart)}(function(t,e){"use strict";function n(){var n={},r={Chart:e,getOptions:function(e){var r=e&&n[e]||{};return t.extend({},n,r)}};this.setOptions=function(e,r){return r?void(n[e]=t.extend(n[e]||{},r)):(r=e,void(n=t.extend(n,r)))},this.$get=function(){return r}}function r(n,r){function o(t,e){return t&&e&&t.length&&e.length?Array.isArray(t[0])?t.length===e.length&&t.every(function(t,n){return t.length===e[n].length}):e.reduce(i,0)>0?t.length===e.length:!1:!1}function i(t,e){return t+e}function c(e,n,r,a){var o=null;return function(i){var c=n.getPointsAtEvent||n.getBarsAtEvent||n.getSegmentsAtEvent;if(c){var l=c.call(n,i);a!==!1&&t.equals(o,l)!==!1||(o=l,e[r](l,i),e.$apply())}}}function l(r,a){for(var o=!1,i=t.copy(a.colours||n.getOptions(r).colours||e.defaults.global.colours);i.length<a.data.length;)i.push(a.getColour()),o=!0;return o&&(a.colours=i),i.map(u)}function u(t){return"object"==typeof t&&null!==t?t:"string"==typeof t&&"#"===t[0]?f(g(t.substr(1))):s()}function s(){var t=[h(0,255),h(0,255),h(0,255)];return f(t)}function f(t){return{fillColor:d(t,.2),strokeColor:d(t,1),pointColor:d(t,1),pointStrokeColor:"#fff",pointHighlightFill:"#fff",pointHighlightStroke:d(t,.8)}}function h(t,e){return Math.floor(Math.random()*(e-t+1))+t}function d(t,e){return a?"rgb("+t.join(",")+")":"rgba("+t.concat(e).join(",")+")"}function g(t){var e=parseInt(t,16),n=e>>16&255,r=e>>8&255,a=255&e;return[n,r,a]}function p(e,n,r,a){return{labels:e,datasets:n.map(function(e,n){return t.extend({},a[n],{label:r[n],data:e})})}}function v(e,n,r){return e.map(function(e,a){return t.extend({},r[a],{label:e,value:n[a],color:r[a].strokeColor,highlight:r[a].pointHighlightStroke})})}function y(t,e){var n=t.parent(),r=n.find("chart-legend"),a="<chart-legend>"+e.generateLegend()+"</chart-legend>";r.length?r.replaceWith(a):n.append(a)}function C(t,e,n,r){Array.isArray(n.data[0])?t.datasets.forEach(function(t,n){(t.points||t.bars).forEach(function(t,r){t.value=e[n][r]})}):t.segments.forEach(function(t,n){t.value=e[n]}),t.update(),n.$emit("update",t),n.legend&&"false"!==n.legend&&y(r,t)}function b(t){return!t||Array.isArray(t)&&!t.length||"object"==typeof t&&!Object.keys(t).length}function m(r,a){var o=t.extend({},e.defaults.global,n.getOptions(r),a.options);return o.responsive}function w(t,e){t&&(t.destroy(),e.$emit("destroy",t))}return function(e){return{restrict:"CA",scope:{data:"=?",labels:"=?",options:"=?",series:"=?",colours:"=?",getColour:"=?",chartType:"=",legend:"@",click:"=?",hover:"=?",chartData:"=?",chartLabels:"=?",chartOptions:"=?",chartSeries:"=?",chartColours:"=?",chartLegend:"@",chartClick:"=?",chartHover:"=?"},link:function(i,u){function f(t,e){i.$watch(t,function(t){"undefined"!=typeof t&&(i[e]=t)})}function h(n,r){if(!b(n)&&!t.equals(n,r)){var a=e||i.chartType;a&&d(a)}}function d(e){if(m(e,i)&&0===u[0].clientHeight&&0===k.clientHeight)return r(function(){d(e)},50,!1);if(i.data&&i.data.length){i.getColour="function"==typeof i.getColour?i.getColour:s;var a=l(e,i),o=u[0],f=o.getContext("2d"),h=Array.isArray(i.data[0])?p(i.labels,i.data,i.series||[],a):v(i.labels,i.data,a),g=t.extend({},n.getOptions(e),i.options);w(A,i),A=new n.Chart(f)[e](h,g),i.$emit("create",A),o.onclick=i.click?c(i,A,"click",!1):t.noop,o.onmousemove=i.hover?c(i,A,"hover",!0):t.noop,i.legend&&"false"!==i.legend&&y(u,A)}}function g(t){if("undefined"!=typeof console&&"test"!==n.getOptions().env){var e="function"==typeof console.warn?console.warn:console.log;i[t]&&e.call(console,'"%s" is deprecated and will be removed in a future version. Please use "chart-%s" instead.',t,t)}}var A,k=document.createElement("div");k.className="chart-container",u.replaceWith(k),k.appendChild(u[0]),a&&window.G_vmlCanvasManager.initElement(u[0]),["data","labels","options","series","colours","legend","click","hover"].forEach(g),f("chartData","data"),f("chartLabels","labels"),f("chartOptions","options"),f("chartSeries","series"),f("chartColours","colours"),f("chartLegend","legend"),f("chartClick","click"),f("chartHover","hover"),i.$watch("data",function(t,n){if(!t||!t.length||Array.isArray(t[0])&&!t[0].length)return void w(A,i);var r=e||i.chartType;if(r)return A&&o(t,n)?C(A,t,i,u):void d(r)},!0),i.$watch("series",h,!0),i.$watch("labels",h,!0),i.$watch("options",h,!0),i.$watch("colours",h,!0),i.$watch("chartType",function(e,n){b(e)||t.equals(e,n)||d(e)}),i.$on("$destroy",function(){w(A,i)})}}}}e.defaults.global.responsive=!0,e.defaults.global.multiTooltipTemplate="<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>",e.defaults.global.colours=["#97BBCD","#DCDCDC","#F7464A","#46BFBD","#FDB45C","#949FB1","#4D5360"];var a="object"==typeof window.G_vmlCanvasManager&&null!==window.G_vmlCanvasManager&&"function"==typeof window.G_vmlCanvasManager.initElement;return a&&(e.defaults.global.animation=!1),t.module("chart.js",[]).provider("ChartJs",n).factory("ChartJsFactory",["ChartJs","$timeout",r]).directive("chartBase",["ChartJsFactory",function(t){return new t}]).directive("chartLine",["ChartJsFactory",function(t){return new t("Line")}]).directive("chartBar",["ChartJsFactory",function(t){return new t("Bar")}]).directive("chartRadar",["ChartJsFactory",function(t){return new t("Radar")}]).directive("chartDoughnut",["ChartJsFactory",function(t){return new t("Doughnut")}]).directive("chartPie",["ChartJsFactory",function(t){return new t("Pie")}]).directive("chartPolarArea",["ChartJsFactory",function(t){return new t("PolarArea")}])});
-//# sourceMappingURL=angular-chart.min.js.map
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js.map b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js.map
deleted file mode 100644
index 6d5826f..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/dist/angular-chart.min.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["angular-chart.min.js"],"names":["factory","exports","module","angular","require","Chart","define","amd","ChartJsProvider","options","ChartJs","getOptions","type","typeOptions","extend","this","setOptions","customOptions","$get","ChartJsFactory","$timeout","canUpdateChart","newVal","oldVal","length","Array","isArray","every","element","index","reduce","sum","carry","val","getEventHandler","scope","chart","action","triggerOnlyOnChange","lastState","evt","atEvent","getPointsAtEvent","getBarsAtEvent","getSegmentsAtEvent","activePoints","call","equals","$apply","getColours","notEnoughColours","colours","copy","defaults","global","data","push","getColour","map","convertColour","colour","hexToRgb","substr","getRandomColour","getRandomInt","fillColor","rgba","strokeColor","pointColor","pointStrokeColor","pointHighlightFill","pointHighlightStroke","min","max","Math","floor","random","alpha","usingExcanvas","join","concat","hex","bigint","parseInt","r","g","b","getDataSets","labels","series","datasets","item","i","label","getData","value","color","highlight","setLegend","elem","$parent","parent","$oldLegend","find","legend","generateLegend","replaceWith","append","updateChart","values","forEach","dataset","points","bars","dataItem","j","segments","segment","update","$emit","isEmpty","Object","keys","isResponsive","responsive","destroyChart","destroy","restrict","chartType","click","hover","chartData","chartLabels","chartOptions","chartSeries","chartColours","chartLegend","chartClick","chartHover","link","aliasVar","fromName","toName","$watch","resetChart","createChart","clientHeight","container","cvs","ctx","getContext","onclick","noop","onmousemove","deprecated","attr","console","env","warn","log","document","createElement","className","appendChild","window","G_vmlCanvasManager","initElement","$on","multiTooltipTemplate","animation","provider","directive"],"mappings":"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","file":"angular-chart.min.js","sourcesContent":["(function (factory) {\n  'use strict';\n  if (typeof exports === 'object') {\n    // Node/CommonJS\n    module.exports = factory(\n      typeof angular !== 'undefined' ? angular : require('angular'),\n      typeof Chart !== 'undefined' ? Chart : require('chart.js'));\n  }  else if (typeof define === 'function' && define.amd) {\n    // AMD. Register as an anonymous module.\n    define(['angular', 'chart'], factory);\n  } else {\n    // Browser globals\n    factory(angular, Chart);\n  }\n}(function (angular, Chart) {\n  'use strict';\n\n  Chart.defaults.global.responsive = true;\n  Chart.defaults.global.multiTooltipTemplate = '<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>';\n\n  Chart.defaults.global.colours = [\n    '#97BBCD', // blue\n    '#DCDCDC', // light grey\n    '#F7464A', // red\n    '#46BFBD', // green\n    '#FDB45C', // yellow\n    '#949FB1', // grey\n    '#4D5360'  // dark grey\n  ];\n\n  var usingExcanvas = typeof window.G_vmlCanvasManager === 'object' &&\n    window.G_vmlCanvasManager !== null &&\n    typeof window.G_vmlCanvasManager.initElement === 'function';\n\n  if (usingExcanvas) Chart.defaults.global.animation = false;\n\n  return angular.module('chart.js', [])\n    .provider('ChartJs', ChartJsProvider)\n    .factory('ChartJsFactory', ['ChartJs', '$timeout', ChartJsFactory])\n    .directive('chartBase', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory(); }])\n    .directive('chartLine', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Line'); }])\n    .directive('chartBar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Bar'); }])\n    .directive('chartRadar', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Radar'); }])\n    .directive('chartDoughnut', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Doughnut'); }])\n    .directive('chartPie', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('Pie'); }])\n    .directive('chartPolarArea', ['ChartJsFactory', function (ChartJsFactory) { return new ChartJsFactory('PolarArea'); }]);\n\n  /**\n   * Wrapper for chart.js\n   * Allows configuring chart js using the provider\n   *\n   * angular.module('myModule', ['chart.js']).config(function(ChartJsProvider) {\n   *   ChartJsProvider.setOptions({ responsive: true });\n   *   ChartJsProvider.setOptions('Line', { responsive: false });\n   * })))\n   */\n  function ChartJsProvider () {\n    var options = {};\n    var ChartJs = {\n      Chart: Chart,\n      getOptions: function (type) {\n        var typeOptions = type && options[type] || {};\n        return angular.extend({}, options, typeOptions);\n      }\n    };\n\n    /**\n     * Allow to set global options during configuration\n     */\n    this.setOptions = function (type, customOptions) {\n      // If no type was specified set option for the global object\n      if (! customOptions) {\n        customOptions = type;\n        options = angular.extend(options, customOptions);\n        return;\n      }\n      // Set options for the specific chart\n      options[type] = angular.extend(options[type] || {}, customOptions);\n    };\n\n    this.$get = function () {\n      return ChartJs;\n    };\n  }\n\n  function ChartJsFactory (ChartJs, $timeout) {\n    return function chart (type) {\n      return {\n        restrict: 'CA',\n        scope: {\n          data: '=?',\n          labels: '=?',\n          options: '=?',\n          series: '=?',\n          colours: '=?',\n          getColour: '=?',\n          chartType: '=',\n          legend: '@',\n          click: '=?',\n          hover: '=?',\n\n          chartData: '=?',\n          chartLabels: '=?',\n          chartOptions: '=?',\n          chartSeries: '=?',\n          chartColours: '=?',\n          chartLegend: '@',\n          chartClick: '=?',\n          chartHover: '=?'\n        },\n        link: function (scope, elem/*, attrs */) {\n          var chart, container = document.createElement('div');\n          container.className = 'chart-container';\n          elem.replaceWith(container);\n          container.appendChild(elem[0]);\n\n          if (usingExcanvas) window.G_vmlCanvasManager.initElement(elem[0]);\n\n          ['data', 'labels', 'options', 'series', 'colours', 'legend', 'click', 'hover'].forEach(deprecated);\n          function aliasVar (fromName, toName) {\n            scope.$watch(fromName, function (newVal) {\n              if (typeof newVal === 'undefined') return;\n              scope[toName] = newVal;\n            });\n          }\n          /* provide backward compatibility to \"old\" directive names, by\n           * having an alias point from the new names to the old names. */\n          aliasVar('chartData', 'data');\n          aliasVar('chartLabels', 'labels');\n          aliasVar('chartOptions', 'options');\n          aliasVar('chartSeries', 'series');\n          aliasVar('chartColours', 'colours');\n          aliasVar('chartLegend', 'legend');\n          aliasVar('chartClick', 'click');\n          aliasVar('chartHover', 'hover');\n\n          // Order of setting \"watch\" matter\n\n          scope.$watch('data', function (newVal, oldVal) {\n            if (! newVal || ! newVal.length || (Array.isArray(newVal[0]) && ! newVal[0].length)) {\n              destroyChart(chart, scope);\n              return;\n            }\n            var chartType = type || scope.chartType;\n            if (! chartType) return;\n\n            if (chart && canUpdateChart(newVal, oldVal))\n              return updateChart(chart, newVal, scope, elem);\n\n            createChart(chartType);\n          }, true);\n\n          scope.$watch('series', resetChart, true);\n          scope.$watch('labels', resetChart, true);\n          scope.$watch('options', resetChart, true);\n          scope.$watch('colours', resetChart, true);\n\n          scope.$watch('chartType', function (newVal, oldVal) {\n            if (isEmpty(newVal)) return;\n            if (angular.equals(newVal, oldVal)) return;\n            createChart(newVal);\n          });\n\n          scope.$on('$destroy', function () {\n            destroyChart(chart, scope);\n          });\n\n          function resetChart (newVal, oldVal) {\n            if (isEmpty(newVal)) return;\n            if (angular.equals(newVal, oldVal)) return;\n            var chartType = type || scope.chartType;\n            if (! chartType) return;\n\n            // chart.update() doesn't work for series and labels\n            // so we have to re-create the chart entirely\n            createChart(chartType);\n          }\n\n          function createChart (type) {\n            if (isResponsive(type, scope) && elem[0].clientHeight === 0 && container.clientHeight === 0) {\n              return $timeout(function () {\n                createChart(type);\n              }, 50, false);\n            }\n            if (! scope.data || ! scope.data.length) return;\n            scope.getColour = typeof scope.getColour === 'function' ? scope.getColour : getRandomColour;\n            var colours = getColours(type, scope);\n            var cvs = elem[0], ctx = cvs.getContext('2d');\n            var data = Array.isArray(scope.data[0]) ?\n              getDataSets(scope.labels, scope.data, scope.series || [], colours) :\n              getData(scope.labels, scope.data, colours);\n            var options = angular.extend({}, ChartJs.getOptions(type), scope.options);\n\n            // Destroy old chart if it exists to avoid ghost charts issue\n            // https://github.com/jtblin/angular-chart.js/issues/187\n            destroyChart(chart, scope);\n            chart = new ChartJs.Chart(ctx)[type](data, options);\n            scope.$emit('create', chart);\n\n            // Bind events\n            cvs.onclick = scope.click ? getEventHandler(scope, chart, 'click', false) : angular.noop;\n            cvs.onmousemove = scope.hover ? getEventHandler(scope, chart, 'hover', true) : angular.noop;\n\n            if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);\n          }\n\n          function deprecated (attr) {\n            if (typeof console !== 'undefined' && ChartJs.getOptions().env !== 'test') {\n              var warn = typeof console.warn === 'function' ? console.warn : console.log;\n              if (!! scope[attr]) {\n                warn.call(console, '\"%s\" is deprecated and will be removed in a future version. ' +\n                  'Please use \"chart-%s\" instead.', attr, attr);\n              }\n            }\n          }\n        }\n      };\n    };\n\n    function canUpdateChart (newVal, oldVal) {\n      if (newVal && oldVal && newVal.length && oldVal.length) {\n        return Array.isArray(newVal[0]) ?\n        newVal.length === oldVal.length && newVal.every(function (element, index) {\n          return element.length === oldVal[index].length; }) :\n          oldVal.reduce(sum, 0) > 0 ? newVal.length === oldVal.length : false;\n      }\n      return false;\n    }\n\n    function sum (carry, val) {\n      return carry + val;\n    }\n\n    function getEventHandler (scope, chart, action, triggerOnlyOnChange) {\n      var lastState = null;\n      return function (evt) {\n        var atEvent = chart.getPointsAtEvent || chart.getBarsAtEvent || chart.getSegmentsAtEvent;\n        if (atEvent) {\n          var activePoints = atEvent.call(chart, evt);\n          if (triggerOnlyOnChange === false || angular.equals(lastState, activePoints) === false) {\n            lastState = activePoints;\n            scope[action](activePoints, evt);\n            scope.$apply();\n          }\n        }\n      };\n    }\n\n    function getColours (type, scope) {\n      var notEnoughColours = false;\n      var colours = angular.copy(scope.colours ||\n        ChartJs.getOptions(type).colours ||\n        Chart.defaults.global.colours\n      );\n      while (colours.length < scope.data.length) {\n        colours.push(scope.getColour());\n        notEnoughColours = true;\n      }\n      // mutate colours in this case as we don't want\n      // the colours to change on each refresh\n      if (notEnoughColours) scope.colours = colours;\n      return colours.map(convertColour);\n    }\n\n    function convertColour (colour) {\n      if (typeof colour === 'object' && colour !== null) return colour;\n      if (typeof colour === 'string' && colour[0] === '#') return getColour(hexToRgb(colour.substr(1)));\n      return getRandomColour();\n    }\n\n    function getRandomColour () {\n      var colour = [getRandomInt(0, 255), getRandomInt(0, 255), getRandomInt(0, 255)];\n      return getColour(colour);\n    }\n\n    function getColour (colour) {\n      return {\n        fillColor: rgba(colour, 0.2),\n        strokeColor: rgba(colour, 1),\n        pointColor: rgba(colour, 1),\n        pointStrokeColor: '#fff',\n        pointHighlightFill: '#fff',\n        pointHighlightStroke: rgba(colour, 0.8)\n      };\n    }\n\n    function getRandomInt (min, max) {\n      return Math.floor(Math.random() * (max - min + 1)) + min;\n    }\n\n    function rgba (colour, alpha) {\n      if (usingExcanvas) {\n        // rgba not supported by IE8\n        return 'rgb(' + colour.join(',') + ')';\n      } else {\n        return 'rgba(' + colour.concat(alpha).join(',') + ')';\n      }\n    }\n\n    // Credit: http://stackoverflow.com/a/11508164/1190235\n    function hexToRgb (hex) {\n      var bigint = parseInt(hex, 16),\n        r = (bigint >> 16) & 255,\n        g = (bigint >> 8) & 255,\n        b = bigint & 255;\n\n      return [r, g, b];\n    }\n\n    function getDataSets (labels, data, series, colours) {\n      return {\n        labels: labels,\n        datasets: data.map(function (item, i) {\n          return angular.extend({}, colours[i], {\n            label: series[i],\n            data: item\n          });\n        })\n      };\n    }\n\n    function getData (labels, data, colours) {\n      return labels.map(function (label, i) {\n        return angular.extend({}, colours[i], {\n          label: label,\n          value: data[i],\n          color: colours[i].strokeColor,\n          highlight: colours[i].pointHighlightStroke\n        });\n      });\n    }\n\n    function setLegend (elem, chart) {\n      var $parent = elem.parent(),\n          $oldLegend = $parent.find('chart-legend'),\n          legend = '<chart-legend>' + chart.generateLegend() + '</chart-legend>';\n      if ($oldLegend.length) $oldLegend.replaceWith(legend);\n      else $parent.append(legend);\n    }\n\n    function updateChart (chart, values, scope, elem) {\n      if (Array.isArray(scope.data[0])) {\n        chart.datasets.forEach(function (dataset, i) {\n          (dataset.points || dataset.bars).forEach(function (dataItem, j) {\n            dataItem.value = values[i][j];\n          });\n        });\n      } else {\n        chart.segments.forEach(function (segment, i) {\n          segment.value = values[i];\n        });\n      }\n      chart.update();\n      scope.$emit('update', chart);\n      if (scope.legend && scope.legend !== 'false') setLegend(elem, chart);\n    }\n\n    function isEmpty (value) {\n      return ! value ||\n        (Array.isArray(value) && ! value.length) ||\n        (typeof value === 'object' && ! Object.keys(value).length);\n    }\n\n    function isResponsive (type, scope) {\n      var options = angular.extend({}, Chart.defaults.global, ChartJs.getOptions(type), scope.options);\n      return options.responsive;\n    }\n\n    function destroyChart(chart, scope) {\n      if(! chart) return;\n      chart.destroy();\n      scope.$emit('destroy', chart);\n    }\n  }\n}));\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/gulpfile.js b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/gulpfile.js
deleted file mode 100644
index 492de9a..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/gulpfile.js
+++ /dev/null
@@ -1,168 +0,0 @@
-(function () {
-  'use strict';
-
-  var fs = require('fs');
-  var path = require('path');
-  var gulp = require('gulp');
-  var less = require('gulp-less');
-  var sourcemaps = require('gulp-sourcemaps');
-  var uglify = require('gulp-uglify');
-  var csso = require('gulp-csso');
-  var jshint = require('gulp-jshint');
-  var stylish = require('jshint-stylish');
-  var jscs = require('gulp-jscs');
-  var mocha = require('gulp-spawn-mocha');
-  var tar = require('gulp-tar');
-  var gzip = require('gulp-gzip');
-  var bumper = require('gulp-bump');
-  var git = require('gulp-git');
-  var shell = require('gulp-shell');
-  var rename = require('gulp-rename');
-  var sequence = require('gulp-sequence');
-  var rimraf = require('gulp-rimraf');
-  var istanbul = require('gulp-istanbul');
-  var istanbulReport = require('gulp-istanbul-report');
-  var mochaPhantomJS = require('gulp-mocha-phantomjs');
-
-  gulp.task('clean', function () {
-    return gulp.src('./dist/*', { read: false })
-      .pipe(rimraf());
-  });
-
-  gulp.task('less', function () {
-    return gulp.src('./*.less')
-      .pipe(less())
-      .pipe(gulp.dest('./dist'));
-  });
-
-  gulp.task('css-min', function () {
-    return gulp.src('./dist/*.css')
-      .pipe(sourcemaps.init())
-      .pipe(csso())
-      .pipe(rename({ suffix: '.min' }))
-      .pipe(sourcemaps.write('./'))
-      .pipe(gulp.dest('./dist'));
-  });
-
-  gulp.task('lint', function () {
-    return gulp.src('**/*.js')
-      .pipe(jshint())
-      .pipe(jshint.reporter(stylish));
-  });
-
-  gulp.task('style', function () {
-    return gulp.src('**/*.js')
-      .pipe(jscs());
-  });
-
-  gulp.task('cover', function () {
-    return gulp.src('angular-chart.js')
-      .pipe(istanbul({ coverageVariable: '__coverage__' }))
-      .pipe(rename('coverage.js'))
-      .pipe(gulp.dest('test/fixtures'));
-  });
-
-  gulp.task('unit', function () {
-    return gulp.src('test/index.html', { read: false })
-      .pipe(mochaPhantomJS({
-        phantomjs: {
-          hooks: 'mocha-phantomjs-istanbul',
-          coverageFile: 'coverage/coverage.json'
-        },
-        reporter: process.env.REPORTER || 'spec'
-    }));
-  });
-
-  gulp.task('integration', function () {
-    return gulp.src(path.join('test', 'test.integration.js'), { read: false })
-      .pipe(mocha({ reporter: 'list', timeout: 20000, require: 'test/support/setup.js' }));
-  });
-
-  gulp.task('report', function () {
-    return gulp.src('coverage/coverage.json')
-      .pipe(istanbulReport({ reporters: ['lcov'] }));
-  });
-
-  gulp.task('bump-patch', bump('patch'));
-  gulp.task('bump-minor', bump('minor'));
-  gulp.task('bump-major', bump('major'));
-
-  gulp.task('bower', function () {
-    return gulp.src('./angular-chart.js')
-      .pipe(gulp.dest('./dist'));
-  });
-
-  gulp.task('js', ['lint', 'style', 'bower'], function () {
-    return gulp.src('./angular-chart.js')
-      .pipe(rename('angular-chart.min.js'))
-      .pipe(sourcemaps.init())
-      .pipe(uglify())
-      .pipe(sourcemaps.write('./'))
-      .pipe(gulp.dest('./dist'));
-  });
-
-  gulp.task('build', function () {
-    return gulp.src(['dist/*', '!./dist/*.tar.gz'])
-      .pipe(tar('angular-chart.js.tar'))
-      .pipe(gzip({ gzipOptions: { level: 9 } }))
-      .pipe(gulp.dest('dist/'));
-  });
-
-  gulp.task('update', function (cb) {
-    fs.readFile('./examples/charts.template.html', 'utf8', function (err, file) {
-      if (err) return cb(err);
-      file = file.replace('<!-- version -->', version());
-      fs.writeFile('./examples/charts.html', file, cb);
-    });
-  });
-
-  gulp.task('git-commit', function () {
-    var v = version();
-    gulp.src(['./dist/*', './package.json', './bower.json', './examples/charts.html', './test/fixtures/coverage.js'])
-      .pipe(git.add())
-      .pipe(git.commit(v))
-    ;
-  });
-
-  gulp.task('git-push', function (cb) {
-    var v = version();
-    git.push('origin', 'master', function (err) {
-      if (err) return cb(err);
-      git.tag(v, v, function (err) {
-        if (err) return cb(err);
-        git.push('origin', 'master', {args: '--tags' }, cb);
-      });
-    });
-  });
-
-  gulp.task('npm', shell.task([
-    'npm publish'
-  ]));
-
-  gulp.task('watch', function () {
-    gulp.watch('./*.js', ['js']);
-    gulp.watch('./*.less', ['less']);
-    return true;
-  });
-
-  function bump (level) {
-    return function () {
-      return gulp.src(['./package.json', './bower.json'])
-        .pipe(bumper({type: level}))
-        .pipe(gulp.dest('./'));
-    };
-  }
-
-  function version () {
-    return JSON.parse(fs.readFileSync('package.json', 'utf8')).version;
-  }
-
-  gulp.task('default', sequence('check', 'assets'));
-  gulp.task('assets', sequence('clean', ['less', 'js'], 'css-min', 'build'));
-  gulp.task('test', sequence('cover', 'unit', 'integration', 'report'));
-  gulp.task('check', sequence(['lint', 'style'], 'test'));
-  gulp.task('deploy-patch', sequence('default', 'bump-patch', 'update', 'git-commit', 'git-push', 'npm'));
-  gulp.task('deploy-minor', sequence('default', 'bump-minor', 'update', 'git-commit', 'git-push', 'npm'));
-  gulp.task('deploy-major', sequence('default', 'bump-patch', 'update', 'git-commit', 'git-push', 'npm'));
-
-})();
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/package.json b/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/package.json
deleted file mode 100644
index 70c344b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-chart.js/package.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
-  "name": "angular-chart.js",
-  "version": "0.10.2",
-  "description": "An angular.js wrapper for Chart.js",
-  "main": "dist/angular-chart.js",
-  "directories": {
-    "example": "examples"
-  },
-  "scripts": {
-    "codeclimate": "./node_modules/codeclimate-test-reporter/bin/codeclimate.js < coverage/lcov.info",
-    "docker": "docker build -t angular-chart.js . && docker run --rm -it -v `pwd`/coverage:/src/coverage angular-chart.js",
-    "test": "gulp check"
-  },
-  "author": "Jerome Touffe-Blin <jtblin@gmail.com>",
-  "repository": {
-    "type": "git",
-    "url": "git://github.com/jtblin/angular-chart.js.git"
-  },
-  "license": "BSD-2-Clause",
-  "devDependencies": {
-    "chai": "^3.4.1",
-    "chai-string": "^1.1.1",
-    "codeclimate-test-reporter": "^0.3.1",
-    "cp": "^0.2.0",
-    "gm": "^1.17.0",
-    "gulp": "^3.9.0",
-    "gulp-bump": "^1.0.0",
-    "gulp-csso": "^1.0.1",
-    "gulp-git": "^1.6.0",
-    "gulp-gzip": "^1.2.0",
-    "gulp-istanbul": "^0.10.3",
-    "gulp-istanbul-report": "^0.0.1",
-    "gulp-jscs": "^3.0.2",
-    "gulp-jshint": "^1.9.2",
-    "gulp-less": "^3.0.3",
-    "gulp-mocha-phantomjs": "^0.11.0",
-    "gulp-rename": "^1.2.0",
-    "gulp-rimraf": "^0.2.0",
-    "gulp-sequence": "^0.4.1",
-    "gulp-shell": "^0.5.1",
-    "gulp-sourcemaps": "^1.0.0",
-    "gulp-spawn-mocha": "^2.0.1",
-    "gulp-tar": "^1.5.0",
-    "gulp-uglify": "^1.4.2",
-    "imgur-node-api": "^0.1.0",
-    "jshint-stylish": "^2.0.1",
-    "mkdirp": "^0.5.0",
-    "mocha": "^2.1.0",
-    "mocha-phantomjs-istanbul": "^0.0.2",
-    "sinon": "^1.12.2",
-    "sinon-chai": "^2.7.0",
-    "testatic": "^0.1.0",
-    "tmp-sync": "^1.1.0",
-    "webpack": "^1.13.0",
-    "webshot": "^0.18.0"
-  },
-  "dependencies": {
-    "angular": "1.x",
-    "chart.js": "^1.1.1"
-  }
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/.bower.json
deleted file mode 100644
index 152e2f9..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/.bower.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "name": "angular-cookies",
-  "version": "1.4.7",
-  "main": "./angular-cookies.js",
-  "ignore": [],
-  "dependencies": {
-    "angular": "1.4.7"
-  },
-  "homepage": "https://github.com/angular/bower-angular-cookies",
-  "_release": "1.4.7",
-  "_resolution": {
-    "type": "version",
-    "tag": "v1.4.7",
-    "commit": "083c164d49ab007e7725b77b9f46095679db010f"
-  },
-  "_source": "https://github.com/angular/bower-angular-cookies.git",
-  "_target": "1.4.7",
-  "_originalSource": "angular-cookies"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/README.md b/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/README.md
deleted file mode 100644
index 7b190d3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-# packaged angular-cookies
-
-This repo is for distribution on `npm` and `bower`. The source for this module is in the
-[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngCookies).
-Please file issues and pull requests against that repo.
-
-## Install
-
-You can install this package either with `npm` or with `bower`.
-
-### npm
-
-```shell
-npm install angular-cookies
-```
-
-Then add `ngCookies` as a dependency for your app:
-
-```javascript
-angular.module('myApp', [require('angular-cookies')]);
-```
-
-### bower
-
-```shell
-bower install angular-cookies
-```
-
-Add a `<script>` to your `index.html`:
-
-```html
-<script src="/bower_components/angular-cookies/angular-cookies.js"></script>
-```
-
-Then add `ngCookies` as a dependency for your app:
-
-```javascript
-angular.module('myApp', ['ngCookies']);
-```
-
-## Documentation
-
-Documentation is available on the
-[AngularJS docs site](http://docs.angularjs.org/api/ngCookies).
-
-## License
-
-The MIT License
-
-Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/angular-cookies.js b/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/angular-cookies.js
deleted file mode 100644
index 3eabd43..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/angular-cookies.js
+++ /dev/null
@@ -1,321 +0,0 @@
-/**
- * @license AngularJS v1.4.7
- * (c) 2010-2015 Google, Inc. http://angularjs.org
- * License: MIT
- */
-(function(window, angular, undefined) {'use strict';
-
-/**
- * @ngdoc module
- * @name ngCookies
- * @description
- *
- * # ngCookies
- *
- * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies.
- *
- *
- * <div doc-module-components="ngCookies"></div>
- *
- * See {@link ngCookies.$cookies `$cookies`} for usage.
- */
-
-
-angular.module('ngCookies', ['ng']).
-  /**
-   * @ngdoc provider
-   * @name $cookiesProvider
-   * @description
-   * Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service.
-   * */
-   provider('$cookies', [function $CookiesProvider() {
-    /**
-     * @ngdoc property
-     * @name $cookiesProvider#defaults
-     * @description
-     *
-     * Object containing default options to pass when setting cookies.
-     *
-     * The object may have following properties:
-     *
-     * - **path** - `{string}` - The cookie will be available only for this path and its
-     *   sub-paths. By default, this would be the URL that appears in your base tag.
-     * - **domain** - `{string}` - The cookie will be available only for this domain and
-     *   its sub-domains. For obvious security reasons the user agent will not accept the
-     *   cookie if the current domain is not a sub domain or equals to the requested domain.
-     * - **expires** - `{string|Date}` - String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT"
-     *   or a Date object indicating the exact date/time this cookie will expire.
-     * - **secure** - `{boolean}` - The cookie will be available only in secured connection.
-     *
-     * Note: by default the address that appears in your `<base>` tag will be used as path.
-     * This is important so that cookies will be visible for all routes in case html5mode is enabled
-     *
-     **/
-    var defaults = this.defaults = {};
-
-    function calcOptions(options) {
-      return options ? angular.extend({}, defaults, options) : defaults;
-    }
-
-    /**
-     * @ngdoc service
-     * @name $cookies
-     *
-     * @description
-     * Provides read/write access to browser's cookies.
-     *
-     * <div class="alert alert-info">
-     * Up until Angular 1.3, `$cookies` exposed properties that represented the
-     * current browser cookie values. In version 1.4, this behavior has changed, and
-     * `$cookies` now provides a standard api of getters, setters etc.
-     * </div>
-     *
-     * Requires the {@link ngCookies `ngCookies`} module to be installed.
-     *
-     * @example
-     *
-     * ```js
-     * angular.module('cookiesExample', ['ngCookies'])
-     *   .controller('ExampleController', ['$cookies', function($cookies) {
-     *     // Retrieving a cookie
-     *     var favoriteCookie = $cookies.get('myFavorite');
-     *     // Setting a cookie
-     *     $cookies.put('myFavorite', 'oatmeal');
-     *   }]);
-     * ```
-     */
-    this.$get = ['$$cookieReader', '$$cookieWriter', function($$cookieReader, $$cookieWriter) {
-      return {
-        /**
-         * @ngdoc method
-         * @name $cookies#get
-         *
-         * @description
-         * Returns the value of given cookie key
-         *
-         * @param {string} key Id to use for lookup.
-         * @returns {string} Raw cookie value.
-         */
-        get: function(key) {
-          return $$cookieReader()[key];
-        },
-
-        /**
-         * @ngdoc method
-         * @name $cookies#getObject
-         *
-         * @description
-         * Returns the deserialized value of given cookie key
-         *
-         * @param {string} key Id to use for lookup.
-         * @returns {Object} Deserialized cookie value.
-         */
-        getObject: function(key) {
-          var value = this.get(key);
-          return value ? angular.fromJson(value) : value;
-        },
-
-        /**
-         * @ngdoc method
-         * @name $cookies#getAll
-         *
-         * @description
-         * Returns a key value object with all the cookies
-         *
-         * @returns {Object} All cookies
-         */
-        getAll: function() {
-          return $$cookieReader();
-        },
-
-        /**
-         * @ngdoc method
-         * @name $cookies#put
-         *
-         * @description
-         * Sets a value for given cookie key
-         *
-         * @param {string} key Id for the `value`.
-         * @param {string} value Raw value to be stored.
-         * @param {Object=} options Options object.
-         *    See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
-         */
-        put: function(key, value, options) {
-          $$cookieWriter(key, value, calcOptions(options));
-        },
-
-        /**
-         * @ngdoc method
-         * @name $cookies#putObject
-         *
-         * @description
-         * Serializes and sets a value for given cookie key
-         *
-         * @param {string} key Id for the `value`.
-         * @param {Object} value Value to be stored.
-         * @param {Object=} options Options object.
-         *    See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
-         */
-        putObject: function(key, value, options) {
-          this.put(key, angular.toJson(value), options);
-        },
-
-        /**
-         * @ngdoc method
-         * @name $cookies#remove
-         *
-         * @description
-         * Remove given cookie
-         *
-         * @param {string} key Id of the key-value pair to delete.
-         * @param {Object=} options Options object.
-         *    See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
-         */
-        remove: function(key, options) {
-          $$cookieWriter(key, undefined, calcOptions(options));
-        }
-      };
-    }];
-  }]);
-
-angular.module('ngCookies').
-/**
- * @ngdoc service
- * @name $cookieStore
- * @deprecated
- * @requires $cookies
- *
- * @description
- * Provides a key-value (string-object) storage, that is backed by session cookies.
- * Objects put or retrieved from this storage are automatically serialized or
- * deserialized by angular's toJson/fromJson.
- *
- * Requires the {@link ngCookies `ngCookies`} module to be installed.
- *
- * <div class="alert alert-danger">
- * **Note:** The $cookieStore service is **deprecated**.
- * Please use the {@link ngCookies.$cookies `$cookies`} service instead.
- * </div>
- *
- * @example
- *
- * ```js
- * angular.module('cookieStoreExample', ['ngCookies'])
- *   .controller('ExampleController', ['$cookieStore', function($cookieStore) {
- *     // Put cookie
- *     $cookieStore.put('myFavorite','oatmeal');
- *     // Get cookie
- *     var favoriteCookie = $cookieStore.get('myFavorite');
- *     // Removing a cookie
- *     $cookieStore.remove('myFavorite');
- *   }]);
- * ```
- */
- factory('$cookieStore', ['$cookies', function($cookies) {
-
-    return {
-      /**
-       * @ngdoc method
-       * @name $cookieStore#get
-       *
-       * @description
-       * Returns the value of given cookie key
-       *
-       * @param {string} key Id to use for lookup.
-       * @returns {Object} Deserialized cookie value, undefined if the cookie does not exist.
-       */
-      get: function(key) {
-        return $cookies.getObject(key);
-      },
-
-      /**
-       * @ngdoc method
-       * @name $cookieStore#put
-       *
-       * @description
-       * Sets a value for given cookie key
-       *
-       * @param {string} key Id for the `value`.
-       * @param {Object} value Value to be stored.
-       */
-      put: function(key, value) {
-        $cookies.putObject(key, value);
-      },
-
-      /**
-       * @ngdoc method
-       * @name $cookieStore#remove
-       *
-       * @description
-       * Remove given cookie
-       *
-       * @param {string} key Id of the key-value pair to delete.
-       */
-      remove: function(key) {
-        $cookies.remove(key);
-      }
-    };
-
-  }]);
-
-/**
- * @name $$cookieWriter
- * @requires $document
- *
- * @description
- * This is a private service for writing cookies
- *
- * @param {string} name Cookie name
- * @param {string=} value Cookie value (if undefined, cookie will be deleted)
- * @param {Object=} options Object with options that need to be stored for the cookie.
- */
-function $$CookieWriter($document, $log, $browser) {
-  var cookiePath = $browser.baseHref();
-  var rawDocument = $document[0];
-
-  function buildCookieString(name, value, options) {
-    var path, expires;
-    options = options || {};
-    expires = options.expires;
-    path = angular.isDefined(options.path) ? options.path : cookiePath;
-    if (angular.isUndefined(value)) {
-      expires = 'Thu, 01 Jan 1970 00:00:00 GMT';
-      value = '';
-    }
-    if (angular.isString(expires)) {
-      expires = new Date(expires);
-    }
-
-    var str = encodeURIComponent(name) + '=' + encodeURIComponent(value);
-    str += path ? ';path=' + path : '';
-    str += options.domain ? ';domain=' + options.domain : '';
-    str += expires ? ';expires=' + expires.toUTCString() : '';
-    str += options.secure ? ';secure' : '';
-
-    // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:
-    // - 300 cookies
-    // - 20 cookies per unique domain
-    // - 4096 bytes per cookie
-    var cookieLength = str.length + 1;
-    if (cookieLength > 4096) {
-      $log.warn("Cookie '" + name +
-        "' possibly not set or overflowed because it was too large (" +
-        cookieLength + " > 4096 bytes)!");
-    }
-
-    return str;
-  }
-
-  return function(name, value, options) {
-    rawDocument.cookie = buildCookieString(name, value, options);
-  };
-}
-
-$$CookieWriter.$inject = ['$document', '$log', '$browser'];
-
-angular.module('ngCookies').provider('$$cookieWriter', function $$CookieWriterProvider() {
-  this.$get = $$CookieWriter;
-});
-
-
-})(window, window.angular);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/angular-cookies.min.js b/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/angular-cookies.min.js
deleted file mode 100644
index d68e3ef..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/angular-cookies.min.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- AngularJS v1.4.7
- (c) 2010-2015 Google, Inc. http://angularjs.org
- License: MIT
-*/
-(function(p,c,n){'use strict';function l(b,a,g){var d=g.baseHref(),k=b[0];return function(b,e,f){var g,h;f=f||{};h=f.expires;g=c.isDefined(f.path)?f.path:d;c.isUndefined(e)&&(h="Thu, 01 Jan 1970 00:00:00 GMT",e="");c.isString(h)&&(h=new Date(h));e=encodeURIComponent(b)+"="+encodeURIComponent(e);e=e+(g?";path="+g:"")+(f.domain?";domain="+f.domain:"");e+=h?";expires="+h.toUTCString():"";e+=f.secure?";secure":"";f=e.length+1;4096<f&&a.warn("Cookie '"+b+"' possibly not set or overflowed because it was too large ("+
-f+" > 4096 bytes)!");k.cookie=e}}c.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,g){return{get:function(d){return a()[d]},getObject:function(d){return(d=this.get(d))?c.fromJson(d):d},getAll:function(){return a()},put:function(d,a,m){g(d,a,m?c.extend({},b,m):b)},putObject:function(d,b,a){this.put(d,c.toJson(b),a)},remove:function(a,k){g(a,n,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore",
-["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,c){b.putObject(a,c)},remove:function(a){b.remove(a)}}}]);l.$inject=["$document","$log","$browser"];c.module("ngCookies").provider("$$cookieWriter",function(){this.$get=l})})(window,window.angular);
-//# sourceMappingURL=angular-cookies.min.js.map
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/angular-cookies.min.js.map b/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/angular-cookies.min.js.map
deleted file mode 100644
index d269e1f..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/angular-cookies.min.js.map
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-"version":3,
-"file":"angular-cookies.min.js",
-"lineCount":8,
-"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CA0QtCC,QAASA,EAAc,CAACC,CAAD,CAAYC,CAAZ,CAAkBC,CAAlB,CAA4B,CACjD,IAAIC,EAAaD,CAAAE,SAAA,EAAjB,CACIC,EAAcL,CAAA,CAAU,CAAV,CAmClB,OAAO,SAAQ,CAACM,CAAD,CAAOC,CAAP,CAAcC,CAAd,CAAuB,CAjCW,IAC3CC,CAD2C,CACrCC,CACVF,EAAA,CAgCoDA,CAhCpD,EAAqB,EACrBE,EAAA,CAAUF,CAAAE,QACVD,EAAA,CAAOZ,CAAAc,UAAA,CAAkBH,CAAAC,KAAlB,CAAA,CAAkCD,CAAAC,KAAlC,CAAiDN,CACpDN,EAAAe,YAAA,CAAoBL,CAApB,CAAJ,GACEG,CACA,CADU,+BACV,CAAAH,CAAA,CAAQ,EAFV,CAIIV,EAAAgB,SAAA,CAAiBH,CAAjB,CAAJ,GACEA,CADF,CACY,IAAII,IAAJ,CAASJ,CAAT,CADZ,CAIIK,EAAAA,CAAMC,kBAAA,CAqB6BV,CArB7B,CAANS,CAAiC,GAAjCA,CAAuCC,kBAAA,CAAmBT,CAAnB,CAE3CQ,EAAA,CADAA,CACA,EADON,CAAA,CAAO,QAAP,CAAkBA,CAAlB,CAAyB,EAChC,GAAOD,CAAAS,OAAA,CAAiB,UAAjB,CAA8BT,CAAAS,OAA9B,CAA+C,EAAtD,CACAF,EAAA,EAAOL,CAAA,CAAU,WAAV,CAAwBA,CAAAQ,YAAA,EAAxB,CAAgD,EACvDH,EAAA,EAAOP,CAAAW,OAAA,CAAiB,SAAjB,CAA6B,EAMhCC,EAAAA,CAAeL,CAAAM,OAAfD,CAA4B,CACb,KAAnB,CAAIA,CAAJ,EACEnB,CAAAqB,KAAA,CAAU,UAAV,CASqChB,CATrC,CACE,6DADF;AAEEc,CAFF,CAEiB,iBAFjB,CASFf,EAAAkB,OAAA,CAJOR,CAG6B,CArCW,CAxPnDlB,CAAA2B,OAAA,CAAe,WAAf,CAA4B,CAAC,IAAD,CAA5B,CAAAC,SAAA,CAOY,UAPZ,CAOwB,CAACC,QAAyB,EAAG,CAuBjD,IAAIC,EAAW,IAAAA,SAAXA,CAA2B,EAiC/B,KAAAC,KAAA,CAAY,CAAC,gBAAD,CAAmB,gBAAnB,CAAqC,QAAQ,CAACC,CAAD,CAAiBC,CAAjB,CAAiC,CACxF,MAAO,CAWLC,IAAKA,QAAQ,CAACC,CAAD,CAAM,CACjB,MAAOH,EAAA,EAAA,CAAiBG,CAAjB,CADU,CAXd,CAyBLC,UAAWA,QAAQ,CAACD,CAAD,CAAM,CAEvB,MAAO,CADHzB,CACG,CADK,IAAAwB,IAAA,CAASC,CAAT,CACL,EAAQnC,CAAAqC,SAAA,CAAiB3B,CAAjB,CAAR,CAAkCA,CAFlB,CAzBpB,CAuCL4B,OAAQA,QAAQ,EAAG,CACjB,MAAON,EAAA,EADU,CAvCd,CAuDLO,IAAKA,QAAQ,CAACJ,CAAD,CAAMzB,CAAN,CAAaC,CAAb,CAAsB,CACjCsB,CAAA,CAAeE,CAAf,CAAoBzB,CAApB,CAAuCC,CAvFpC,CAAUX,CAAAwC,OAAA,CAAe,EAAf,CAAmBV,CAAnB,CAuF0BnB,CAvF1B,CAAV,CAAkDmB,CAuFrD,CADiC,CAvD9B,CAuELW,UAAWA,QAAQ,CAACN,CAAD,CAAMzB,CAAN,CAAaC,CAAb,CAAsB,CACvC,IAAA4B,IAAA,CAASJ,CAAT,CAAcnC,CAAA0C,OAAA,CAAehC,CAAf,CAAd,CAAqCC,CAArC,CADuC,CAvEpC,CAsFLgC,OAAQA,QAAQ,CAACR,CAAD,CAAMxB,CAAN,CAAe,CAC7BsB,CAAA,CAAeE,CAAf,CAAoBlC,CAApB,CAA2CU,CAtHxC,CAAUX,CAAAwC,OAAA,CAAe,EAAf,CAAmBV,CAAnB,CAsH8BnB,CAtH9B,CAAV,CAAkDmB,CAsHrD,CAD6B,CAtF1B,CADiF,CAA9E,CAxDqC,CAA7B,CAPxB,CA6JA9B,EAAA2B,OAAA,CAAe,WAAf,CAAAiB,QAAA,CAiCS,cAjCT;AAiCyB,CAAC,UAAD,CAAa,QAAQ,CAACC,CAAD,CAAW,CAErD,MAAO,CAWLX,IAAKA,QAAQ,CAACC,CAAD,CAAM,CACjB,MAAOU,EAAAT,UAAA,CAAmBD,CAAnB,CADU,CAXd,CAyBLI,IAAKA,QAAQ,CAACJ,CAAD,CAAMzB,CAAN,CAAa,CACxBmC,CAAAJ,UAAA,CAAmBN,CAAnB,CAAwBzB,CAAxB,CADwB,CAzBrB,CAsCLiC,OAAQA,QAAQ,CAACR,CAAD,CAAM,CACpBU,CAAAF,OAAA,CAAgBR,CAAhB,CADoB,CAtCjB,CAF8C,CAAhC,CAjCzB,CAqIAjC,EAAA4C,QAAA,CAAyB,CAAC,WAAD,CAAc,MAAd,CAAsB,UAAtB,CAEzB9C,EAAA2B,OAAA,CAAe,WAAf,CAAAC,SAAA,CAAqC,gBAArC,CAAuDmB,QAA+B,EAAG,CACvF,IAAAhB,KAAA,CAAY7B,CAD2E,CAAzF,CAtTsC,CAArC,CAAD,CA2TGH,MA3TH,CA2TWA,MAAAC,QA3TX;",
-"sources":["angular-cookies.js"],
-"names":["window","angular","undefined","$$CookieWriter","$document","$log","$browser","cookiePath","baseHref","rawDocument","name","value","options","path","expires","isDefined","isUndefined","isString","Date","str","encodeURIComponent","domain","toUTCString","secure","cookieLength","length","warn","cookie","module","provider","$CookiesProvider","defaults","$get","$$cookieReader","$$cookieWriter","get","key","getObject","fromJson","getAll","put","extend","putObject","toJson","remove","factory","$cookies","$inject","$$CookieWriterProvider"]
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/bower.json
deleted file mode 100644
index a5f4f63..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/bower.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "name": "angular-cookies",
-  "version": "1.4.7",
-  "main": "./angular-cookies.js",
-  "ignore": [],
-  "dependencies": {
-    "angular": "1.4.7"
-  }
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/index.js b/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/index.js
deleted file mode 100644
index 6576675..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-require('./angular-cookies');
-module.exports = 'ngCookies';
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/package.json b/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/package.json
deleted file mode 100644
index 7eddecd..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-cookies/package.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
-  "name": "angular-cookies",
-  "version": "1.4.7",
-  "description": "AngularJS module for cookies",
-  "main": "index.js",
-  "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
-  },
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/angular/angular.js.git"
-  },
-  "keywords": [
-    "angular",
-    "framework",
-    "browser",
-    "cookies",
-    "client-side"
-  ],
-  "author": "Angular Core Team <angular-core+npm@google.com>",
-  "license": "MIT",
-  "bugs": {
-    "url": "https://github.com/angular/angular.js/issues"
-  },
-  "homepage": "http://angularjs.org"
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/.bower.json
deleted file mode 100644
index e3882e0..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/.bower.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "name": "angular-mocks",
-  "version": "1.4.7",
-  "main": "./angular-mocks.js",
-  "ignore": [],
-  "dependencies": {
-    "angular": "1.4.7"
-  },
-  "homepage": "https://github.com/angular/bower-angular-mocks",
-  "_release": "1.4.7",
-  "_resolution": {
-    "type": "version",
-    "tag": "v1.4.7",
-    "commit": "74c65a6a54f39516be40b0afdd99efb461595fd9"
-  },
-  "_source": "https://github.com/angular/bower-angular-mocks.git",
-  "_target": "1.4.7",
-  "_originalSource": "angular-mocks"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/README.md b/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/README.md
deleted file mode 100644
index 440cce9..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-# packaged angular-mocks
-
-This repo is for distribution on `npm` and `bower`. The source for this module is in the
-[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngMock).
-Please file issues and pull requests against that repo.
-
-## Install
-
-You can install this package either with `npm` or with `bower`.
-
-### npm
-
-```shell
-npm install angular-mocks
-```
-
-You can `require` ngMock modules:
-
-```js
-var angular = require('angular');
-angular.module('myMod', [
-  require('angular-animate'),
-  require('angular-mocks/ngMock')
-  require('angular-mocks/ngAnimateMock')
-]);
-```
-
-### bower
-
-```shell
-bower install angular-mocks
-```
-
-The mocks are then available at `bower_components/angular-mocks/angular-mocks.js`.
-
-## Documentation
-
-Documentation is available on the
-[AngularJS docs site](https://docs.angularjs.org/guide/unit-testing).
-
-## License
-
-The MIT License
-
-Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/angular-mocks.js b/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/angular-mocks.js
deleted file mode 100644
index febfd0d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/angular-mocks.js
+++ /dev/null
@@ -1,2470 +0,0 @@
-/**
- * @license AngularJS v1.4.7
- * (c) 2010-2015 Google, Inc. http://angularjs.org
- * License: MIT
- */
-(function(window, angular, undefined) {
-
-'use strict';
-
-/**
- * @ngdoc object
- * @name angular.mock
- * @description
- *
- * Namespace from 'angular-mocks.js' which contains testing related code.
- */
-angular.mock = {};
-
-/**
- * ! This is a private undocumented service !
- *
- * @name $browser
- *
- * @description
- * This service is a mock implementation of {@link ng.$browser}. It provides fake
- * implementation for commonly used browser apis that are hard to test, e.g. setTimeout, xhr,
- * cookies, etc...
- *
- * The api of this service is the same as that of the real {@link ng.$browser $browser}, except
- * that there are several helper methods available which can be used in tests.
- */
-angular.mock.$BrowserProvider = function() {
-  this.$get = function() {
-    return new angular.mock.$Browser();
-  };
-};
-
-angular.mock.$Browser = function() {
-  var self = this;
-
-  this.isMock = true;
-  self.$$url = "http://server/";
-  self.$$lastUrl = self.$$url; // used by url polling fn
-  self.pollFns = [];
-
-  // TODO(vojta): remove this temporary api
-  self.$$completeOutstandingRequest = angular.noop;
-  self.$$incOutstandingRequestCount = angular.noop;
-
-
-  // register url polling fn
-
-  self.onUrlChange = function(listener) {
-    self.pollFns.push(
-      function() {
-        if (self.$$lastUrl !== self.$$url || self.$$state !== self.$$lastState) {
-          self.$$lastUrl = self.$$url;
-          self.$$lastState = self.$$state;
-          listener(self.$$url, self.$$state);
-        }
-      }
-    );
-
-    return listener;
-  };
-
-  self.$$applicationDestroyed = angular.noop;
-  self.$$checkUrlChange = angular.noop;
-
-  self.deferredFns = [];
-  self.deferredNextId = 0;
-
-  self.defer = function(fn, delay) {
-    delay = delay || 0;
-    self.deferredFns.push({time:(self.defer.now + delay), fn:fn, id: self.deferredNextId});
-    self.deferredFns.sort(function(a, b) { return a.time - b.time;});
-    return self.deferredNextId++;
-  };
-
-
-  /**
-   * @name $browser#defer.now
-   *
-   * @description
-   * Current milliseconds mock time.
-   */
-  self.defer.now = 0;
-
-
-  self.defer.cancel = function(deferId) {
-    var fnIndex;
-
-    angular.forEach(self.deferredFns, function(fn, index) {
-      if (fn.id === deferId) fnIndex = index;
-    });
-
-    if (angular.isDefined(fnIndex)) {
-      self.deferredFns.splice(fnIndex, 1);
-      return true;
-    }
-
-    return false;
-  };
-
-
-  /**
-   * @name $browser#defer.flush
-   *
-   * @description
-   * Flushes all pending requests and executes the defer callbacks.
-   *
-   * @param {number=} number of milliseconds to flush. See {@link #defer.now}
-   */
-  self.defer.flush = function(delay) {
-    if (angular.isDefined(delay)) {
-      self.defer.now += delay;
-    } else {
-      if (self.deferredFns.length) {
-        self.defer.now = self.deferredFns[self.deferredFns.length - 1].time;
-      } else {
-        throw new Error('No deferred tasks to be flushed');
-      }
-    }
-
-    while (self.deferredFns.length && self.deferredFns[0].time <= self.defer.now) {
-      self.deferredFns.shift().fn();
-    }
-  };
-
-  self.$$baseHref = '/';
-  self.baseHref = function() {
-    return this.$$baseHref;
-  };
-};
-angular.mock.$Browser.prototype = {
-
-/**
-  * @name $browser#poll
-  *
-  * @description
-  * run all fns in pollFns
-  */
-  poll: function poll() {
-    angular.forEach(this.pollFns, function(pollFn) {
-      pollFn();
-    });
-  },
-
-  url: function(url, replace, state) {
-    if (angular.isUndefined(state)) {
-      state = null;
-    }
-    if (url) {
-      this.$$url = url;
-      // Native pushState serializes & copies the object; simulate it.
-      this.$$state = angular.copy(state);
-      return this;
-    }
-
-    return this.$$url;
-  },
-
-  state: function() {
-    return this.$$state;
-  },
-
-  notifyWhenNoOutstandingRequests: function(fn) {
-    fn();
-  }
-};
-
-
-/**
- * @ngdoc provider
- * @name $exceptionHandlerProvider
- *
- * @description
- * Configures the mock implementation of {@link ng.$exceptionHandler} to rethrow or to log errors
- * passed to the `$exceptionHandler`.
- */
-
-/**
- * @ngdoc service
- * @name $exceptionHandler
- *
- * @description
- * Mock implementation of {@link ng.$exceptionHandler} that rethrows or logs errors passed
- * to it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration
- * information.
- *
- *
- * ```js
- *   describe('$exceptionHandlerProvider', function() {
- *
- *     it('should capture log messages and exceptions', function() {
- *
- *       module(function($exceptionHandlerProvider) {
- *         $exceptionHandlerProvider.mode('log');
- *       });
- *
- *       inject(function($log, $exceptionHandler, $timeout) {
- *         $timeout(function() { $log.log(1); });
- *         $timeout(function() { $log.log(2); throw 'banana peel'; });
- *         $timeout(function() { $log.log(3); });
- *         expect($exceptionHandler.errors).toEqual([]);
- *         expect($log.assertEmpty());
- *         $timeout.flush();
- *         expect($exceptionHandler.errors).toEqual(['banana peel']);
- *         expect($log.log.logs).toEqual([[1], [2], [3]]);
- *       });
- *     });
- *   });
- * ```
- */
-
-angular.mock.$ExceptionHandlerProvider = function() {
-  var handler;
-
-  /**
-   * @ngdoc method
-   * @name $exceptionHandlerProvider#mode
-   *
-   * @description
-   * Sets the logging mode.
-   *
-   * @param {string} mode Mode of operation, defaults to `rethrow`.
-   *
-   *   - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log`
-   *            mode stores an array of errors in `$exceptionHandler.errors`, to allow later
-   *            assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and
-   *            {@link ngMock.$log#reset reset()}
-   *   - `rethrow`: If any errors are passed to the handler in tests, it typically means that there
-   *                is a bug in the application or test, so this mock will make these tests fail.
-   *                For any implementations that expect exceptions to be thrown, the `rethrow` mode
-   *                will also maintain a log of thrown errors.
-   */
-  this.mode = function(mode) {
-
-    switch (mode) {
-      case 'log':
-      case 'rethrow':
-        var errors = [];
-        handler = function(e) {
-          if (arguments.length == 1) {
-            errors.push(e);
-          } else {
-            errors.push([].slice.call(arguments, 0));
-          }
-          if (mode === "rethrow") {
-            throw e;
-          }
-        };
-        handler.errors = errors;
-        break;
-      default:
-        throw new Error("Unknown mode '" + mode + "', only 'log'/'rethrow' modes are allowed!");
-    }
-  };
-
-  this.$get = function() {
-    return handler;
-  };
-
-  this.mode('rethrow');
-};
-
-
-/**
- * @ngdoc service
- * @name $log
- *
- * @description
- * Mock implementation of {@link ng.$log} that gathers all logged messages in arrays
- * (one array per logging level). These arrays are exposed as `logs` property of each of the
- * level-specific log function, e.g. for level `error` the array is exposed as `$log.error.logs`.
- *
- */
-angular.mock.$LogProvider = function() {
-  var debug = true;
-
-  function concat(array1, array2, index) {
-    return array1.concat(Array.prototype.slice.call(array2, index));
-  }
-
-  this.debugEnabled = function(flag) {
-    if (angular.isDefined(flag)) {
-      debug = flag;
-      return this;
-    } else {
-      return debug;
-    }
-  };
-
-  this.$get = function() {
-    var $log = {
-      log: function() { $log.log.logs.push(concat([], arguments, 0)); },
-      warn: function() { $log.warn.logs.push(concat([], arguments, 0)); },
-      info: function() { $log.info.logs.push(concat([], arguments, 0)); },
-      error: function() { $log.error.logs.push(concat([], arguments, 0)); },
-      debug: function() {
-        if (debug) {
-          $log.debug.logs.push(concat([], arguments, 0));
-        }
-      }
-    };
-
-    /**
-     * @ngdoc method
-     * @name $log#reset
-     *
-     * @description
-     * Reset all of the logging arrays to empty.
-     */
-    $log.reset = function() {
-      /**
-       * @ngdoc property
-       * @name $log#log.logs
-       *
-       * @description
-       * Array of messages logged using {@link ng.$log#log `log()`}.
-       *
-       * @example
-       * ```js
-       * $log.log('Some Log');
-       * var first = $log.log.logs.unshift();
-       * ```
-       */
-      $log.log.logs = [];
-      /**
-       * @ngdoc property
-       * @name $log#info.logs
-       *
-       * @description
-       * Array of messages logged using {@link ng.$log#info `info()`}.
-       *
-       * @example
-       * ```js
-       * $log.info('Some Info');
-       * var first = $log.info.logs.unshift();
-       * ```
-       */
-      $log.info.logs = [];
-      /**
-       * @ngdoc property
-       * @name $log#warn.logs
-       *
-       * @description
-       * Array of messages logged using {@link ng.$log#warn `warn()`}.
-       *
-       * @example
-       * ```js
-       * $log.warn('Some Warning');
-       * var first = $log.warn.logs.unshift();
-       * ```
-       */
-      $log.warn.logs = [];
-      /**
-       * @ngdoc property
-       * @name $log#error.logs
-       *
-       * @description
-       * Array of messages logged using {@link ng.$log#error `error()`}.
-       *
-       * @example
-       * ```js
-       * $log.error('Some Error');
-       * var first = $log.error.logs.unshift();
-       * ```
-       */
-      $log.error.logs = [];
-        /**
-       * @ngdoc property
-       * @name $log#debug.logs
-       *
-       * @description
-       * Array of messages logged using {@link ng.$log#debug `debug()`}.
-       *
-       * @example
-       * ```js
-       * $log.debug('Some Error');
-       * var first = $log.debug.logs.unshift();
-       * ```
-       */
-      $log.debug.logs = [];
-    };
-
-    /**
-     * @ngdoc method
-     * @name $log#assertEmpty
-     *
-     * @description
-     * Assert that all of the logging methods have no logged messages. If any messages are present,
-     * an exception is thrown.
-     */
-    $log.assertEmpty = function() {
-      var errors = [];
-      angular.forEach(['error', 'warn', 'info', 'log', 'debug'], function(logLevel) {
-        angular.forEach($log[logLevel].logs, function(log) {
-          angular.forEach(log, function(logItem) {
-            errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\n' +
-                        (logItem.stack || ''));
-          });
-        });
-      });
-      if (errors.length) {
-        errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or " +
-          "an expected log message was not checked and removed:");
-        errors.push('');
-        throw new Error(errors.join('\n---------\n'));
-      }
-    };
-
-    $log.reset();
-    return $log;
-  };
-};
-
-
-/**
- * @ngdoc service
- * @name $interval
- *
- * @description
- * Mock implementation of the $interval service.
- *
- * Use {@link ngMock.$interval#flush `$interval.flush(millis)`} to
- * move forward by `millis` milliseconds and trigger any functions scheduled to run in that
- * time.
- *
- * @param {function()} fn A function that should be called repeatedly.
- * @param {number} delay Number of milliseconds between each function call.
- * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat
- *   indefinitely.
- * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise
- *   will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
- * @param {...*=} Pass additional parameters to the executed function.
- * @returns {promise} A promise which will be notified on each iteration.
- */
-angular.mock.$IntervalProvider = function() {
-  this.$get = ['$browser', '$rootScope', '$q', '$$q',
-       function($browser,   $rootScope,   $q,   $$q) {
-    var repeatFns = [],
-        nextRepeatId = 0,
-        now = 0;
-
-    var $interval = function(fn, delay, count, invokeApply) {
-      var hasParams = arguments.length > 4,
-          args = hasParams ? Array.prototype.slice.call(arguments, 4) : [],
-          iteration = 0,
-          skipApply = (angular.isDefined(invokeApply) && !invokeApply),
-          deferred = (skipApply ? $$q : $q).defer(),
-          promise = deferred.promise;
-
-      count = (angular.isDefined(count)) ? count : 0;
-      promise.then(null, null, (!hasParams) ? fn : function() {
-        fn.apply(null, args);
-      });
-
-      promise.$$intervalId = nextRepeatId;
-
-      function tick() {
-        deferred.notify(iteration++);
-
-        if (count > 0 && iteration >= count) {
-          var fnIndex;
-          deferred.resolve(iteration);
-
-          angular.forEach(repeatFns, function(fn, index) {
-            if (fn.id === promise.$$intervalId) fnIndex = index;
-          });
-
-          if (angular.isDefined(fnIndex)) {
-            repeatFns.splice(fnIndex, 1);
-          }
-        }
-
-        if (skipApply) {
-          $browser.defer.flush();
-        } else {
-          $rootScope.$apply();
-        }
-      }
-
-      repeatFns.push({
-        nextTime:(now + delay),
-        delay: delay,
-        fn: tick,
-        id: nextRepeatId,
-        deferred: deferred
-      });
-      repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});
-
-      nextRepeatId++;
-      return promise;
-    };
-    /**
-     * @ngdoc method
-     * @name $interval#cancel
-     *
-     * @description
-     * Cancels a task associated with the `promise`.
-     *
-     * @param {promise} promise A promise from calling the `$interval` function.
-     * @returns {boolean} Returns `true` if the task was successfully cancelled.
-     */
-    $interval.cancel = function(promise) {
-      if (!promise) return false;
-      var fnIndex;
-
-      angular.forEach(repeatFns, function(fn, index) {
-        if (fn.id === promise.$$intervalId) fnIndex = index;
-      });
-
-      if (angular.isDefined(fnIndex)) {
-        repeatFns[fnIndex].deferred.reject('canceled');
-        repeatFns.splice(fnIndex, 1);
-        return true;
-      }
-
-      return false;
-    };
-
-    /**
-     * @ngdoc method
-     * @name $interval#flush
-     * @description
-     *
-     * Runs interval tasks scheduled to be run in the next `millis` milliseconds.
-     *
-     * @param {number=} millis maximum timeout amount to flush up until.
-     *
-     * @return {number} The amount of time moved forward.
-     */
-    $interval.flush = function(millis) {
-      now += millis;
-      while (repeatFns.length && repeatFns[0].nextTime <= now) {
-        var task = repeatFns[0];
-        task.fn();
-        task.nextTime += task.delay;
-        repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});
-      }
-      return millis;
-    };
-
-    return $interval;
-  }];
-};
-
-
-/* jshint -W101 */
-/* The R_ISO8061_STR regex is never going to fit into the 100 char limit!
- * This directive should go inside the anonymous function but a bug in JSHint means that it would
- * not be enacted early enough to prevent the warning.
- */
-var R_ISO8061_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?:\:?(\d\d)(?:\:?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/;
-
-function jsonStringToDate(string) {
-  var match;
-  if (match = string.match(R_ISO8061_STR)) {
-    var date = new Date(0),
-        tzHour = 0,
-        tzMin  = 0;
-    if (match[9]) {
-      tzHour = toInt(match[9] + match[10]);
-      tzMin = toInt(match[9] + match[11]);
-    }
-    date.setUTCFullYear(toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));
-    date.setUTCHours(toInt(match[4] || 0) - tzHour,
-                     toInt(match[5] || 0) - tzMin,
-                     toInt(match[6] || 0),
-                     toInt(match[7] || 0));
-    return date;
-  }
-  return string;
-}
-
-function toInt(str) {
-  return parseInt(str, 10);
-}
-
-function padNumber(num, digits, trim) {
-  var neg = '';
-  if (num < 0) {
-    neg =  '-';
-    num = -num;
-  }
-  num = '' + num;
-  while (num.length < digits) num = '0' + num;
-  if (trim) {
-    num = num.substr(num.length - digits);
-  }
-  return neg + num;
-}
-
-
-/**
- * @ngdoc type
- * @name angular.mock.TzDate
- * @description
- *
- * *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`.
- *
- * Mock of the Date type which has its timezone specified via constructor arg.
- *
- * The main purpose is to create Date-like instances with timezone fixed to the specified timezone
- * offset, so that we can test code that depends on local timezone settings without dependency on
- * the time zone settings of the machine where the code is running.
- *
- * @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored)
- * @param {(number|string)} timestamp Timestamp representing the desired time in *UTC*
- *
- * @example
- * !!!! WARNING !!!!!
- * This is not a complete Date object so only methods that were implemented can be called safely.
- * To make matters worse, TzDate instances inherit stuff from Date via a prototype.
- *
- * We do our best to intercept calls to "unimplemented" methods, but since the list of methods is
- * incomplete we might be missing some non-standard methods. This can result in errors like:
- * "Date.prototype.foo called on incompatible Object".
- *
- * ```js
- * var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z');
- * newYearInBratislava.getTimezoneOffset() => -60;
- * newYearInBratislava.getFullYear() => 2010;
- * newYearInBratislava.getMonth() => 0;
- * newYearInBratislava.getDate() => 1;
- * newYearInBratislava.getHours() => 0;
- * newYearInBratislava.getMinutes() => 0;
- * newYearInBratislava.getSeconds() => 0;
- * ```
- *
- */
-angular.mock.TzDate = function(offset, timestamp) {
-  var self = new Date(0);
-  if (angular.isString(timestamp)) {
-    var tsStr = timestamp;
-
-    self.origDate = jsonStringToDate(timestamp);
-
-    timestamp = self.origDate.getTime();
-    if (isNaN(timestamp)) {
-      throw {
-        name: "Illegal Argument",
-        message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string"
-      };
-    }
-  } else {
-    self.origDate = new Date(timestamp);
-  }
-
-  var localOffset = new Date(timestamp).getTimezoneOffset();
-  self.offsetDiff = localOffset * 60 * 1000 - offset * 1000 * 60 * 60;
-  self.date = new Date(timestamp + self.offsetDiff);
-
-  self.getTime = function() {
-    return self.date.getTime() - self.offsetDiff;
-  };
-
-  self.toLocaleDateString = function() {
-    return self.date.toLocaleDateString();
-  };
-
-  self.getFullYear = function() {
-    return self.date.getFullYear();
-  };
-
-  self.getMonth = function() {
-    return self.date.getMonth();
-  };
-
-  self.getDate = function() {
-    return self.date.getDate();
-  };
-
-  self.getHours = function() {
-    return self.date.getHours();
-  };
-
-  self.getMinutes = function() {
-    return self.date.getMinutes();
-  };
-
-  self.getSeconds = function() {
-    return self.date.getSeconds();
-  };
-
-  self.getMilliseconds = function() {
-    return self.date.getMilliseconds();
-  };
-
-  self.getTimezoneOffset = function() {
-    return offset * 60;
-  };
-
-  self.getUTCFullYear = function() {
-    return self.origDate.getUTCFullYear();
-  };
-
-  self.getUTCMonth = function() {
-    return self.origDate.getUTCMonth();
-  };
-
-  self.getUTCDate = function() {
-    return self.origDate.getUTCDate();
-  };
-
-  self.getUTCHours = function() {
-    return self.origDate.getUTCHours();
-  };
-
-  self.getUTCMinutes = function() {
-    return self.origDate.getUTCMinutes();
-  };
-
-  self.getUTCSeconds = function() {
-    return self.origDate.getUTCSeconds();
-  };
-
-  self.getUTCMilliseconds = function() {
-    return self.origDate.getUTCMilliseconds();
-  };
-
-  self.getDay = function() {
-    return self.date.getDay();
-  };
-
-  // provide this method only on browsers that already have it
-  if (self.toISOString) {
-    self.toISOString = function() {
-      return padNumber(self.origDate.getUTCFullYear(), 4) + '-' +
-            padNumber(self.origDate.getUTCMonth() + 1, 2) + '-' +
-            padNumber(self.origDate.getUTCDate(), 2) + 'T' +
-            padNumber(self.origDate.getUTCHours(), 2) + ':' +
-            padNumber(self.origDate.getUTCMinutes(), 2) + ':' +
-            padNumber(self.origDate.getUTCSeconds(), 2) + '.' +
-            padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z';
-    };
-  }
-
-  //hide all methods not implemented in this mock that the Date prototype exposes
-  var unimplementedMethods = ['getUTCDay',
-      'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds',
-      'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',
-      'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds',
-      'setYear', 'toDateString', 'toGMTString', 'toJSON', 'toLocaleFormat', 'toLocaleString',
-      'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf'];
-
-  angular.forEach(unimplementedMethods, function(methodName) {
-    self[methodName] = function() {
-      throw new Error("Method '" + methodName + "' is not implemented in the TzDate mock");
-    };
-  });
-
-  return self;
-};
-
-//make "tzDateInstance instanceof Date" return true
-angular.mock.TzDate.prototype = Date.prototype;
-/* jshint +W101 */
-
-angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
-
-  .config(['$provide', function($provide) {
-
-    $provide.factory('$$forceReflow', function() {
-      function reflowFn() {
-        reflowFn.totalReflows++;
-      }
-      reflowFn.totalReflows = 0;
-      return reflowFn;
-    });
-
-    $provide.factory('$$animateAsyncRun', function() {
-      var queue = [];
-      var queueFn = function() {
-        return function(fn) {
-          queue.push(fn);
-        };
-      };
-      queueFn.flush = function() {
-        if (queue.length === 0) return false;
-
-        for (var i = 0; i < queue.length; i++) {
-          queue[i]();
-        }
-        queue = [];
-
-        return true;
-      };
-      return queueFn;
-    });
-
-    $provide.decorator('$animate', ['$delegate', '$timeout', '$browser', '$$rAF',
-                                    '$$forceReflow', '$$animateAsyncRun', '$rootScope',
-                            function($delegate,   $timeout,   $browser,   $$rAF,
-                                     $$forceReflow,   $$animateAsyncRun,  $rootScope) {
-      var animate = {
-        queue: [],
-        cancel: $delegate.cancel,
-        on: $delegate.on,
-        off: $delegate.off,
-        pin: $delegate.pin,
-        get reflows() {
-          return $$forceReflow.totalReflows;
-        },
-        enabled: $delegate.enabled,
-        flush: function() {
-          $rootScope.$digest();
-
-          var doNextRun, somethingFlushed = false;
-          do {
-            doNextRun = false;
-
-            if ($$rAF.queue.length) {
-              $$rAF.flush();
-              doNextRun = somethingFlushed = true;
-            }
-
-            if ($$animateAsyncRun.flush()) {
-              doNextRun = somethingFlushed = true;
-            }
-          } while (doNextRun);
-
-          if (!somethingFlushed) {
-            throw new Error('No pending animations ready to be closed or flushed');
-          }
-
-          $rootScope.$digest();
-        }
-      };
-
-      angular.forEach(
-        ['animate','enter','leave','move','addClass','removeClass','setClass'], function(method) {
-        animate[method] = function() {
-          animate.queue.push({
-            event: method,
-            element: arguments[0],
-            options: arguments[arguments.length - 1],
-            args: arguments
-          });
-          return $delegate[method].apply($delegate, arguments);
-        };
-      });
-
-      return animate;
-    }]);
-
-  }]);
-
-
-/**
- * @ngdoc function
- * @name angular.mock.dump
- * @description
- *
- * *NOTE*: this is not an injectable instance, just a globally available function.
- *
- * Method for serializing common angular objects (scope, elements, etc..) into strings, useful for
- * debugging.
- *
- * This method is also available on window, where it can be used to display objects on debug
- * console.
- *
- * @param {*} object - any object to turn into string.
- * @return {string} a serialized string of the argument
- */
-angular.mock.dump = function(object) {
-  return serialize(object);
-
-  function serialize(object) {
-    var out;
-
-    if (angular.isElement(object)) {
-      object = angular.element(object);
-      out = angular.element('<div></div>');
-      angular.forEach(object, function(element) {
-        out.append(angular.element(element).clone());
-      });
-      out = out.html();
-    } else if (angular.isArray(object)) {
-      out = [];
-      angular.forEach(object, function(o) {
-        out.push(serialize(o));
-      });
-      out = '[ ' + out.join(', ') + ' ]';
-    } else if (angular.isObject(object)) {
-      if (angular.isFunction(object.$eval) && angular.isFunction(object.$apply)) {
-        out = serializeScope(object);
-      } else if (object instanceof Error) {
-        out = object.stack || ('' + object.name + ': ' + object.message);
-      } else {
-        // TODO(i): this prevents methods being logged,
-        // we should have a better way to serialize objects
-        out = angular.toJson(object, true);
-      }
-    } else {
-      out = String(object);
-    }
-
-    return out;
-  }
-
-  function serializeScope(scope, offset) {
-    offset = offset ||  '  ';
-    var log = [offset + 'Scope(' + scope.$id + '): {'];
-    for (var key in scope) {
-      if (Object.prototype.hasOwnProperty.call(scope, key) && !key.match(/^(\$|this)/)) {
-        log.push('  ' + key + ': ' + angular.toJson(scope[key]));
-      }
-    }
-    var child = scope.$$childHead;
-    while (child) {
-      log.push(serializeScope(child, offset + '  '));
-      child = child.$$nextSibling;
-    }
-    log.push('}');
-    return log.join('\n' + offset);
-  }
-};
-
-/**
- * @ngdoc service
- * @name $httpBackend
- * @description
- * Fake HTTP backend implementation suitable for unit testing applications that use the
- * {@link ng.$http $http service}.
- *
- * *Note*: For fake HTTP backend implementation suitable for end-to-end testing or backend-less
- * development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}.
- *
- * During unit testing, we want our unit tests to run quickly and have no external dependencies so
- * we don’t want to send [XHR](https://developer.mozilla.org/en/xmlhttprequest) or
- * [JSONP](http://en.wikipedia.org/wiki/JSONP) requests to a real server. All we really need is
- * to verify whether a certain request has been sent or not, or alternatively just let the
- * application make requests, respond with pre-trained responses and assert that the end result is
- * what we expect it to be.
- *
- * This mock implementation can be used to respond with static or dynamic responses via the
- * `expect` and `when` apis and their shortcuts (`expectGET`, `whenPOST`, etc).
- *
- * When an Angular application needs some data from a server, it calls the $http service, which
- * sends the request to a real server using $httpBackend service. With dependency injection, it is
- * easy to inject $httpBackend mock (which has the same API as $httpBackend) and use it to verify
- * the requests and respond with some testing data without sending a request to a real server.
- *
- * There are two ways to specify what test data should be returned as http responses by the mock
- * backend when the code under test makes http requests:
- *
- * - `$httpBackend.expect` - specifies a request expectation
- * - `$httpBackend.when` - specifies a backend definition
- *
- *
- * # Request Expectations vs Backend Definitions
- *
- * Request expectations provide a way to make assertions about requests made by the application and
- * to define responses for those requests. The test will fail if the expected requests are not made
- * or they are made in the wrong order.
- *
- * Backend definitions allow you to define a fake backend for your application which doesn't assert
- * if a particular request was made or not, it just returns a trained response if a request is made.
- * The test will pass whether or not the request gets made during testing.
- *
- *
- * <table class="table">
- *   <tr><th width="220px"></th><th>Request expectations</th><th>Backend definitions</th></tr>
- *   <tr>
- *     <th>Syntax</th>
- *     <td>.expect(...).respond(...)</td>
- *     <td>.when(...).respond(...)</td>
- *   </tr>
- *   <tr>
- *     <th>Typical usage</th>
- *     <td>strict unit tests</td>
- *     <td>loose (black-box) unit testing</td>
- *   </tr>
- *   <tr>
- *     <th>Fulfills multiple requests</th>
- *     <td>NO</td>
- *     <td>YES</td>
- *   </tr>
- *   <tr>
- *     <th>Order of requests matters</th>
- *     <td>YES</td>
- *     <td>NO</td>
- *   </tr>
- *   <tr>
- *     <th>Request required</th>
- *     <td>YES</td>
- *     <td>NO</td>
- *   </tr>
- *   <tr>
- *     <th>Response required</th>
- *     <td>optional (see below)</td>
- *     <td>YES</td>
- *   </tr>
- * </table>
- *
- * In cases where both backend definitions and request expectations are specified during unit
- * testing, the request expectations are evaluated first.
- *
- * If a request expectation has no response specified, the algorithm will search your backend
- * definitions for an appropriate response.
- *
- * If a request didn't match any expectation or if the expectation doesn't have the response
- * defined, the backend definitions are evaluated in sequential order to see if any of them match
- * the request. The response from the first matched definition is returned.
- *
- *
- * # Flushing HTTP requests
- *
- * The $httpBackend used in production always responds to requests asynchronously. If we preserved
- * this behavior in unit testing, we'd have to create async unit tests, which are hard to write,
- * to follow and to maintain. But neither can the testing mock respond synchronously; that would
- * change the execution of the code under test. For this reason, the mock $httpBackend has a
- * `flush()` method, which allows the test to explicitly flush pending requests. This preserves
- * the async api of the backend, while allowing the test to execute synchronously.
- *
- *
- * # Unit testing with mock $httpBackend
- * The following code shows how to setup and use the mock backend when unit testing a controller.
- * First we create the controller under test:
- *
-  ```js
-  // The module code
-  angular
-    .module('MyApp', [])
-    .controller('MyController', MyController);
-
-  // The controller code
-  function MyController($scope, $http) {
-    var authToken;
-
-    $http.get('/auth.py').success(function(data, status, headers) {
-      authToken = headers('A-Token');
-      $scope.user = data;
-    });
-
-    $scope.saveMessage = function(message) {
-      var headers = { 'Authorization': authToken };
-      $scope.status = 'Saving...';
-
-      $http.post('/add-msg.py', message, { headers: headers } ).success(function(response) {
-        $scope.status = '';
-      }).error(function() {
-        $scope.status = 'Failed...';
-      });
-    };
-  }
-  ```
- *
- * Now we setup the mock backend and create the test specs:
- *
-  ```js
-    // testing controller
-    describe('MyController', function() {
-       var $httpBackend, $rootScope, createController, authRequestHandler;
-
-       // Set up the module
-       beforeEach(module('MyApp'));
-
-       beforeEach(inject(function($injector) {
-         // Set up the mock http service responses
-         $httpBackend = $injector.get('$httpBackend');
-         // backend definition common for all tests
-         authRequestHandler = $httpBackend.when('GET', '/auth.py')
-                                .respond({userId: 'userX'}, {'A-Token': 'xxx'});
-
-         // Get hold of a scope (i.e. the root scope)
-         $rootScope = $injector.get('$rootScope');
-         // The $controller service is used to create instances of controllers
-         var $controller = $injector.get('$controller');
-
-         createController = function() {
-           return $controller('MyController', {'$scope' : $rootScope });
-         };
-       }));
-
-
-       afterEach(function() {
-         $httpBackend.verifyNoOutstandingExpectation();
-         $httpBackend.verifyNoOutstandingRequest();
-       });
-
-
-       it('should fetch authentication token', function() {
-         $httpBackend.expectGET('/auth.py');
-         var controller = createController();
-         $httpBackend.flush();
-       });
-
-
-       it('should fail authentication', function() {
-
-         // Notice how you can change the response even after it was set
-         authRequestHandler.respond(401, '');
-
-         $httpBackend.expectGET('/auth.py');
-         var controller = createController();
-         $httpBackend.flush();
-         expect($rootScope.status).toBe('Failed...');
-       });
-
-
-       it('should send msg to server', function() {
-         var controller = createController();
-         $httpBackend.flush();
-
-         // now you don’t care about the authentication, but
-         // the controller will still send the request and
-         // $httpBackend will respond without you having to
-         // specify the expectation and response for this request
-
-         $httpBackend.expectPOST('/add-msg.py', 'message content').respond(201, '');
-         $rootScope.saveMessage('message content');
-         expect($rootScope.status).toBe('Saving...');
-         $httpBackend.flush();
-         expect($rootScope.status).toBe('');
-       });
-
-
-       it('should send auth header', function() {
-         var controller = createController();
-         $httpBackend.flush();
-
-         $httpBackend.expectPOST('/add-msg.py', undefined, function(headers) {
-           // check if the header was sent, if it wasn't the expectation won't
-           // match the request and the test will fail
-           return headers['Authorization'] == 'xxx';
-         }).respond(201, '');
-
-         $rootScope.saveMessage('whatever');
-         $httpBackend.flush();
-       });
-    });
-   ```
- */
-angular.mock.$HttpBackendProvider = function() {
-  this.$get = ['$rootScope', '$timeout', createHttpBackendMock];
-};
-
-/**
- * General factory function for $httpBackend mock.
- * Returns instance for unit testing (when no arguments specified):
- *   - passing through is disabled
- *   - auto flushing is disabled
- *
- * Returns instance for e2e testing (when `$delegate` and `$browser` specified):
- *   - passing through (delegating request to real backend) is enabled
- *   - auto flushing is enabled
- *
- * @param {Object=} $delegate Real $httpBackend instance (allow passing through if specified)
- * @param {Object=} $browser Auto-flushing enabled if specified
- * @return {Object} Instance of $httpBackend mock
- */
-function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
-  var definitions = [],
-      expectations = [],
-      responses = [],
-      responsesPush = angular.bind(responses, responses.push),
-      copy = angular.copy;
-
-  function createResponse(status, data, headers, statusText) {
-    if (angular.isFunction(status)) return status;
-
-    return function() {
-      return angular.isNumber(status)
-          ? [status, data, headers, statusText]
-          : [200, status, data, headers];
-    };
-  }
-
-  // TODO(vojta): change params to: method, url, data, headers, callback
-  function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) {
-    var xhr = new MockXhr(),
-        expectation = expectations[0],
-        wasExpected = false;
-
-    function prettyPrint(data) {
-      return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)
-          ? data
-          : angular.toJson(data);
-    }
-
-    function wrapResponse(wrapped) {
-      if (!$browser && timeout) {
-        timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout);
-      }
-
-      return handleResponse;
-
-      function handleResponse() {
-        var response = wrapped.response(method, url, data, headers);
-        xhr.$$respHeaders = response[2];
-        callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(),
-                 copy(response[3] || ''));
-      }
-
-      function handleTimeout() {
-        for (var i = 0, ii = responses.length; i < ii; i++) {
-          if (responses[i] === handleResponse) {
-            responses.splice(i, 1);
-            callback(-1, undefined, '');
-            break;
-          }
-        }
-      }
-    }
-
-    if (expectation && expectation.match(method, url)) {
-      if (!expectation.matchData(data)) {
-        throw new Error('Expected ' + expectation + ' with different data\n' +
-            'EXPECTED: ' + prettyPrint(expectation.data) + '\nGOT:      ' + data);
-      }
-
-      if (!expectation.matchHeaders(headers)) {
-        throw new Error('Expected ' + expectation + ' with different headers\n' +
-                        'EXPECTED: ' + prettyPrint(expectation.headers) + '\nGOT:      ' +
-                        prettyPrint(headers));
-      }
-
-      expectations.shift();
-
-      if (expectation.response) {
-        responses.push(wrapResponse(expectation));
-        return;
-      }
-      wasExpected = true;
-    }
-
-    var i = -1, definition;
-    while ((definition = definitions[++i])) {
-      if (definition.match(method, url, data, headers || {})) {
-        if (definition.response) {
-          // if $browser specified, we do auto flush all requests
-          ($browser ? $browser.defer : responsesPush)(wrapResponse(definition));
-        } else if (definition.passThrough) {
-          $delegate(method, url, data, callback, headers, timeout, withCredentials);
-        } else throw new Error('No response defined !');
-        return;
-      }
-    }
-    throw wasExpected ?
-        new Error('No response defined !') :
-        new Error('Unexpected request: ' + method + ' ' + url + '\n' +
-                  (expectation ? 'Expected ' + expectation : 'No more request expected'));
-  }
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#when
-   * @description
-   * Creates a new backend definition.
-   *
-   * @param {string} method HTTP method.
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
-   *   data string and returns true if the data is as expected.
-   * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
-   *   object and returns true if the headers match the current definition.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   *   request is handled. You can save this object for later use and invoke `respond` again in
-   *   order to change how a matched request is handled.
-   *
-   *  - respond –
-   *      `{function([status,] data[, headers, statusText])
-   *      | function(function(method, url, data, headers)}`
-   *    – The respond method takes a set of static data to be returned or a function that can
-   *    return an array containing response status (number), response data (string), response
-   *    headers (Object), and the text for the status (string). The respond method returns the
-   *    `requestHandler` object for possible overrides.
-   */
-  $httpBackend.when = function(method, url, data, headers) {
-    var definition = new MockHttpExpectation(method, url, data, headers),
-        chain = {
-          respond: function(status, data, headers, statusText) {
-            definition.passThrough = undefined;
-            definition.response = createResponse(status, data, headers, statusText);
-            return chain;
-          }
-        };
-
-    if ($browser) {
-      chain.passThrough = function() {
-        definition.response = undefined;
-        definition.passThrough = true;
-        return chain;
-      };
-    }
-
-    definitions.push(definition);
-    return chain;
-  };
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#whenGET
-   * @description
-   * Creates a new backend definition for GET requests. For more info see `when()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {(Object|function(Object))=} headers HTTP headers.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   * request is handled. You can save this object for later use and invoke `respond` again in
-   * order to change how a matched request is handled.
-   */
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#whenHEAD
-   * @description
-   * Creates a new backend definition for HEAD requests. For more info see `when()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {(Object|function(Object))=} headers HTTP headers.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   * request is handled. You can save this object for later use and invoke `respond` again in
-   * order to change how a matched request is handled.
-   */
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#whenDELETE
-   * @description
-   * Creates a new backend definition for DELETE requests. For more info see `when()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {(Object|function(Object))=} headers HTTP headers.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   * request is handled. You can save this object for later use and invoke `respond` again in
-   * order to change how a matched request is handled.
-   */
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#whenPOST
-   * @description
-   * Creates a new backend definition for POST requests. For more info see `when()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
-   *   data string and returns true if the data is as expected.
-   * @param {(Object|function(Object))=} headers HTTP headers.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   * request is handled. You can save this object for later use and invoke `respond` again in
-   * order to change how a matched request is handled.
-   */
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#whenPUT
-   * @description
-   * Creates a new backend definition for PUT requests.  For more info see `when()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
-   *   data string and returns true if the data is as expected.
-   * @param {(Object|function(Object))=} headers HTTP headers.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   * request is handled. You can save this object for later use and invoke `respond` again in
-   * order to change how a matched request is handled.
-   */
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#whenJSONP
-   * @description
-   * Creates a new backend definition for JSONP requests. For more info see `when()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   * request is handled. You can save this object for later use and invoke `respond` again in
-   * order to change how a matched request is handled.
-   */
-  createShortMethods('when');
-
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#expect
-   * @description
-   * Creates a new request expectation.
-   *
-   * @param {string} method HTTP method.
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
-   *  receives data string and returns true if the data is as expected, or Object if request body
-   *  is in JSON format.
-   * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
-   *   object and returns true if the headers match the current expectation.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   *  request is handled. You can save this object for later use and invoke `respond` again in
-   *  order to change how a matched request is handled.
-   *
-   *  - respond –
-   *    `{function([status,] data[, headers, statusText])
-   *    | function(function(method, url, data, headers)}`
-   *    – The respond method takes a set of static data to be returned or a function that can
-   *    return an array containing response status (number), response data (string), response
-   *    headers (Object), and the text for the status (string). The respond method returns the
-   *    `requestHandler` object for possible overrides.
-   */
-  $httpBackend.expect = function(method, url, data, headers) {
-    var expectation = new MockHttpExpectation(method, url, data, headers),
-        chain = {
-          respond: function(status, data, headers, statusText) {
-            expectation.response = createResponse(status, data, headers, statusText);
-            return chain;
-          }
-        };
-
-    expectations.push(expectation);
-    return chain;
-  };
-
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#expectGET
-   * @description
-   * Creates a new request expectation for GET requests. For more info see `expect()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {Object=} headers HTTP headers.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   * request is handled. You can save this object for later use and invoke `respond` again in
-   * order to change how a matched request is handled. See #expect for more info.
-   */
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#expectHEAD
-   * @description
-   * Creates a new request expectation for HEAD requests. For more info see `expect()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {Object=} headers HTTP headers.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   *   request is handled. You can save this object for later use and invoke `respond` again in
-   *   order to change how a matched request is handled.
-   */
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#expectDELETE
-   * @description
-   * Creates a new request expectation for DELETE requests. For more info see `expect()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {Object=} headers HTTP headers.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   *   request is handled. You can save this object for later use and invoke `respond` again in
-   *   order to change how a matched request is handled.
-   */
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#expectPOST
-   * @description
-   * Creates a new request expectation for POST requests. For more info see `expect()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
-   *  receives data string and returns true if the data is as expected, or Object if request body
-   *  is in JSON format.
-   * @param {Object=} headers HTTP headers.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   *   request is handled. You can save this object for later use and invoke `respond` again in
-   *   order to change how a matched request is handled.
-   */
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#expectPUT
-   * @description
-   * Creates a new request expectation for PUT requests. For more info see `expect()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
-   *  receives data string and returns true if the data is as expected, or Object if request body
-   *  is in JSON format.
-   * @param {Object=} headers HTTP headers.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   *   request is handled. You can save this object for later use and invoke `respond` again in
-   *   order to change how a matched request is handled.
-   */
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#expectPATCH
-   * @description
-   * Creates a new request expectation for PATCH requests. For more info see `expect()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
-   *   and returns true if the url matches the current definition.
-   * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that
-   *  receives data string and returns true if the data is as expected, or Object if request body
-   *  is in JSON format.
-   * @param {Object=} headers HTTP headers.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   *   request is handled. You can save this object for later use and invoke `respond` again in
-   *   order to change how a matched request is handled.
-   */
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#expectJSONP
-   * @description
-   * Creates a new request expectation for JSONP requests. For more info see `expect()`.
-   *
-   * @param {string|RegExp|function(string)} url HTTP url or function that receives an url
-   *   and returns true if the url matches the current definition.
-   * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
-   *   request is handled. You can save this object for later use and invoke `respond` again in
-   *   order to change how a matched request is handled.
-   */
-  createShortMethods('expect');
-
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#flush
-   * @description
-   * Flushes all pending requests using the trained responses.
-   *
-   * @param {number=} count Number of responses to flush (in the order they arrived). If undefined,
-   *   all pending requests will be flushed. If there are no pending requests when the flush method
-   *   is called an exception is thrown (as this typically a sign of programming error).
-   */
-  $httpBackend.flush = function(count, digest) {
-    if (digest !== false) $rootScope.$digest();
-    if (!responses.length) throw new Error('No pending request to flush !');
-
-    if (angular.isDefined(count) && count !== null) {
-      while (count--) {
-        if (!responses.length) throw new Error('No more pending request to flush !');
-        responses.shift()();
-      }
-    } else {
-      while (responses.length) {
-        responses.shift()();
-      }
-    }
-    $httpBackend.verifyNoOutstandingExpectation(digest);
-  };
-
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#verifyNoOutstandingExpectation
-   * @description
-   * Verifies that all of the requests defined via the `expect` api were made. If any of the
-   * requests were not made, verifyNoOutstandingExpectation throws an exception.
-   *
-   * Typically, you would call this method following each test case that asserts requests using an
-   * "afterEach" clause.
-   *
-   * ```js
-   *   afterEach($httpBackend.verifyNoOutstandingExpectation);
-   * ```
-   */
-  $httpBackend.verifyNoOutstandingExpectation = function(digest) {
-    if (digest !== false) $rootScope.$digest();
-    if (expectations.length) {
-      throw new Error('Unsatisfied requests: ' + expectations.join(', '));
-    }
-  };
-
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#verifyNoOutstandingRequest
-   * @description
-   * Verifies that there are no outstanding requests that need to be flushed.
-   *
-   * Typically, you would call this method following each test case that asserts requests using an
-   * "afterEach" clause.
-   *
-   * ```js
-   *   afterEach($httpBackend.verifyNoOutstandingRequest);
-   * ```
-   */
-  $httpBackend.verifyNoOutstandingRequest = function() {
-    if (responses.length) {
-      throw new Error('Unflushed requests: ' + responses.length);
-    }
-  };
-
-
-  /**
-   * @ngdoc method
-   * @name $httpBackend#resetExpectations
-   * @description
-   * Resets all request expectations, but preserves all backend definitions. Typically, you would
-   * call resetExpectations during a multiple-phase test when you want to reuse the same instance of
-   * $httpBackend mock.
-   */
-  $httpBackend.resetExpectations = function() {
-    expectations.length = 0;
-    responses.length = 0;
-  };
-
-  return $httpBackend;
-
-
-  function createShortMethods(prefix) {
-    angular.forEach(['GET', 'DELETE', 'JSONP', 'HEAD'], function(method) {
-     $httpBackend[prefix + method] = function(url, headers) {
-       return $httpBackend[prefix](method, url, undefined, headers);
-     };
-    });
-
-    angular.forEach(['PUT', 'POST', 'PATCH'], function(method) {
-      $httpBackend[prefix + method] = function(url, data, headers) {
-        return $httpBackend[prefix](method, url, data, headers);
-      };
-    });
-  }
-}
-
-function MockHttpExpectation(method, url, data, headers) {
-
-  this.data = data;
-  this.headers = headers;
-
-  this.match = function(m, u, d, h) {
-    if (method != m) return false;
-    if (!this.matchUrl(u)) return false;
-    if (angular.isDefined(d) && !this.matchData(d)) return false;
-    if (angular.isDefined(h) && !this.matchHeaders(h)) return false;
-    return true;
-  };
-
-  this.matchUrl = function(u) {
-    if (!url) return true;
-    if (angular.isFunction(url.test)) return url.test(u);
-    if (angular.isFunction(url)) return url(u);
-    return url == u;
-  };
-
-  this.matchHeaders = function(h) {
-    if (angular.isUndefined(headers)) return true;
-    if (angular.isFunction(headers)) return headers(h);
-    return angular.equals(headers, h);
-  };
-
-  this.matchData = function(d) {
-    if (angular.isUndefined(data)) return true;
-    if (data && angular.isFunction(data.test)) return data.test(d);
-    if (data && angular.isFunction(data)) return data(d);
-    if (data && !angular.isString(data)) {
-      return angular.equals(angular.fromJson(angular.toJson(data)), angular.fromJson(d));
-    }
-    return data == d;
-  };
-
-  this.toString = function() {
-    return method + ' ' + url;
-  };
-}
-
-function createMockXhr() {
-  return new MockXhr();
-}
-
-function MockXhr() {
-
-  // hack for testing $http, $httpBackend
-  MockXhr.$$lastInstance = this;
-
-  this.open = function(method, url, async) {
-    this.$$method = method;
-    this.$$url = url;
-    this.$$async = async;
-    this.$$reqHeaders = {};
-    this.$$respHeaders = {};
-  };
-
-  this.send = function(data) {
-    this.$$data = data;
-  };
-
-  this.setRequestHeader = function(key, value) {
-    this.$$reqHeaders[key] = value;
-  };
-
-  this.getResponseHeader = function(name) {
-    // the lookup must be case insensitive,
-    // that's why we try two quick lookups first and full scan last
-    var header = this.$$respHeaders[name];
-    if (header) return header;
-
-    name = angular.lowercase(name);
-    header = this.$$respHeaders[name];
-    if (header) return header;
-
-    header = undefined;
-    angular.forEach(this.$$respHeaders, function(headerVal, headerName) {
-      if (!header && angular.lowercase(headerName) == name) header = headerVal;
-    });
-    return header;
-  };
-
-  this.getAllResponseHeaders = function() {
-    var lines = [];
-
-    angular.forEach(this.$$respHeaders, function(value, key) {
-      lines.push(key + ': ' + value);
-    });
-    return lines.join('\n');
-  };
-
-  this.abort = angular.noop;
-}
-
-
-/**
- * @ngdoc service
- * @name $timeout
- * @description
- *
- * This service is just a simple decorator for {@link ng.$timeout $timeout} service
- * that adds a "flush" and "verifyNoPendingTasks" methods.
- */
-
-angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $browser) {
-
-  /**
-   * @ngdoc method
-   * @name $timeout#flush
-   * @description
-   *
-   * Flushes the queue of pending tasks.
-   *
-   * @param {number=} delay maximum timeout amount to flush up until
-   */
-  $delegate.flush = function(delay) {
-    $browser.defer.flush(delay);
-  };
-
-  /**
-   * @ngdoc method
-   * @name $timeout#verifyNoPendingTasks
-   * @description
-   *
-   * Verifies that there are no pending tasks that need to be flushed.
-   */
-  $delegate.verifyNoPendingTasks = function() {
-    if ($browser.deferredFns.length) {
-      throw new Error('Deferred tasks to flush (' + $browser.deferredFns.length + '): ' +
-          formatPendingTasksAsString($browser.deferredFns));
-    }
-  };
-
-  function formatPendingTasksAsString(tasks) {
-    var result = [];
-    angular.forEach(tasks, function(task) {
-      result.push('{id: ' + task.id + ', ' + 'time: ' + task.time + '}');
-    });
-
-    return result.join(', ');
-  }
-
-  return $delegate;
-}];
-
-angular.mock.$RAFDecorator = ['$delegate', function($delegate) {
-  var rafFn = function(fn) {
-    var index = rafFn.queue.length;
-    rafFn.queue.push(fn);
-    return function() {
-      rafFn.queue.splice(index, 1);
-    };
-  };
-
-  rafFn.queue = [];
-  rafFn.supported = $delegate.supported;
-
-  rafFn.flush = function() {
-    if (rafFn.queue.length === 0) {
-      throw new Error('No rAF callbacks present');
-    }
-
-    var length = rafFn.queue.length;
-    for (var i = 0; i < length; i++) {
-      rafFn.queue[i]();
-    }
-
-    rafFn.queue = rafFn.queue.slice(i);
-  };
-
-  return rafFn;
-}];
-
-/**
- *
- */
-angular.mock.$RootElementProvider = function() {
-  this.$get = function() {
-    return angular.element('<div ng-app></div>');
-  };
-};
-
-/**
- * @ngdoc service
- * @name $controller
- * @description
- * A decorator for {@link ng.$controller} with additional `bindings` parameter, useful when testing
- * controllers of directives that use {@link $compile#-bindtocontroller- `bindToController`}.
- *
- *
- * ## Example
- *
- * ```js
- *
- * // Directive definition ...
- *
- * myMod.directive('myDirective', {
- *   controller: 'MyDirectiveController',
- *   bindToController: {
- *     name: '@'
- *   }
- * });
- *
- *
- * // Controller definition ...
- *
- * myMod.controller('MyDirectiveController', ['log', function($log) {
- *   $log.info(this.name);
- * })];
- *
- *
- * // In a test ...
- *
- * describe('myDirectiveController', function() {
- *   it('should write the bound name to the log', inject(function($controller, $log) {
- *     var ctrl = $controller('MyDirectiveController', { /* no locals &#42;/ }, { name: 'Clark Kent' });
- *     expect(ctrl.name).toEqual('Clark Kent');
- *     expect($log.info.logs).toEqual(['Clark Kent']);
- *   });
- * });
- *
- * ```
- *
- * @param {Function|string} constructor If called with a function then it's considered to be the
- *    controller constructor function. Otherwise it's considered to be a string which is used
- *    to retrieve the controller constructor using the following steps:
- *
- *    * check if a controller with given name is registered via `$controllerProvider`
- *    * check if evaluating the string on the current scope returns a constructor
- *    * if $controllerProvider#allowGlobals, check `window[constructor]` on the global
- *      `window` object (not recommended)
- *
- *    The string can use the `controller as property` syntax, where the controller instance is published
- *    as the specified property on the `scope`; the `scope` must be injected into `locals` param for this
- *    to work correctly.
- *
- * @param {Object} locals Injection locals for Controller.
- * @param {Object=} bindings Properties to add to the controller before invoking the constructor. This is used
- *                           to simulate the `bindToController` feature and simplify certain kinds of tests.
- * @return {Object} Instance of given controller.
- */
-angular.mock.$ControllerDecorator = ['$delegate', function($delegate) {
-  return function(expression, locals, later, ident) {
-    if (later && typeof later === 'object') {
-      var create = $delegate(expression, locals, true, ident);
-      angular.extend(create.instance, later);
-      return create();
-    }
-    return $delegate(expression, locals, later, ident);
-  };
-}];
-
-
-/**
- * @ngdoc module
- * @name ngMock
- * @packageName angular-mocks
- * @description
- *
- * # ngMock
- *
- * The `ngMock` module provides support to inject and mock Angular services into unit tests.
- * In addition, ngMock also extends various core ng services such that they can be
- * inspected and controlled in a synchronous manner within test code.
- *
- *
- * <div doc-module-components="ngMock"></div>
- *
- */
-angular.module('ngMock', ['ng']).provider({
-  $browser: angular.mock.$BrowserProvider,
-  $exceptionHandler: angular.mock.$ExceptionHandlerProvider,
-  $log: angular.mock.$LogProvider,
-  $interval: angular.mock.$IntervalProvider,
-  $httpBackend: angular.mock.$HttpBackendProvider,
-  $rootElement: angular.mock.$RootElementProvider
-}).config(['$provide', function($provide) {
-  $provide.decorator('$timeout', angular.mock.$TimeoutDecorator);
-  $provide.decorator('$$rAF', angular.mock.$RAFDecorator);
-  $provide.decorator('$rootScope', angular.mock.$RootScopeDecorator);
-  $provide.decorator('$controller', angular.mock.$ControllerDecorator);
-}]);
-
-/**
- * @ngdoc module
- * @name ngMockE2E
- * @module ngMockE2E
- * @packageName angular-mocks
- * @description
- *
- * The `ngMockE2E` is an angular module which contains mocks suitable for end-to-end testing.
- * Currently there is only one mock present in this module -
- * the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock.
- */
-angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
-  $provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator);
-}]);
-
-/**
- * @ngdoc service
- * @name $httpBackend
- * @module ngMockE2E
- * @description
- * Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of
- * applications that use the {@link ng.$http $http service}.
- *
- * *Note*: For fake http backend implementation suitable for unit testing please see
- * {@link ngMock.$httpBackend unit-testing $httpBackend mock}.
- *
- * This implementation can be used to respond with static or dynamic responses via the `when` api
- * and its shortcuts (`whenGET`, `whenPOST`, etc) and optionally pass through requests to the
- * real $httpBackend for specific requests (e.g. to interact with certain remote apis or to fetch
- * templates from a webserver).
- *
- * As opposed to unit-testing, in an end-to-end testing scenario or in scenario when an application
- * is being developed with the real backend api replaced with a mock, it is often desirable for
- * certain category of requests to bypass the mock and issue a real http request (e.g. to fetch
- * templates or static files from the webserver). To configure the backend with this behavior
- * use the `passThrough` request handler of `when` instead of `respond`.
- *
- * Additionally, we don't want to manually have to flush mocked out requests like we do during unit
- * testing. For this reason the e2e $httpBackend flushes mocked out requests
- * automatically, closely simulating the behavior of the XMLHttpRequest object.
- *
- * To setup the application to run with this http backend, you have to create a module that depends
- * on the `ngMockE2E` and your application modules and defines the fake backend:
- *
- * ```js
- *   myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']);
- *   myAppDev.run(function($httpBackend) {
- *     phones = [{name: 'phone1'}, {name: 'phone2'}];
- *
- *     // returns the current list of phones
- *     $httpBackend.whenGET('/phones').respond(phones);
- *
- *     // adds a new phone to the phones array
- *     $httpBackend.whenPOST('/phones').respond(function(method, url, data) {
- *       var phone = angular.fromJson(data);
- *       phones.push(phone);
- *       return [200, phone, {}];
- *     });
- *     $httpBackend.whenGET(/^\/templates\//).passThrough();
- *     //...
- *   });
- * ```
- *
- * Afterwards, bootstrap your app with this new module.
- */
-
-/**
- * @ngdoc method
- * @name $httpBackend#when
- * @module ngMockE2E
- * @description
- * Creates a new backend definition.
- *
- * @param {string} method HTTP method.
- * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
- *   and returns true if the url matches the current definition.
- * @param {(string|RegExp)=} data HTTP request body.
- * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
- *   object and returns true if the headers match the current definition.
- * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
- *   control how a matched request is handled. You can save this object for later use and invoke
- *   `respond` or `passThrough` again in order to change how a matched request is handled.
- *
- *  - respond –
- *    `{function([status,] data[, headers, statusText])
- *    | function(function(method, url, data, headers)}`
- *    – The respond method takes a set of static data to be returned or a function that can return
- *    an array containing response status (number), response data (string), response headers
- *    (Object), and the text for the status (string).
- *  - passThrough – `{function()}` – Any request matching a backend definition with
- *    `passThrough` handler will be passed through to the real backend (an XHR request will be made
- *    to the server.)
- *  - Both methods return the `requestHandler` object for possible overrides.
- */
-
-/**
- * @ngdoc method
- * @name $httpBackend#whenGET
- * @module ngMockE2E
- * @description
- * Creates a new backend definition for GET requests. For more info see `when()`.
- *
- * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
- *   and returns true if the url matches the current definition.
- * @param {(Object|function(Object))=} headers HTTP headers.
- * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
- *   control how a matched request is handled. You can save this object for later use and invoke
- *   `respond` or `passThrough` again in order to change how a matched request is handled.
- */
-
-/**
- * @ngdoc method
- * @name $httpBackend#whenHEAD
- * @module ngMockE2E
- * @description
- * Creates a new backend definition for HEAD requests. For more info see `when()`.
- *
- * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
- *   and returns true if the url matches the current definition.
- * @param {(Object|function(Object))=} headers HTTP headers.
- * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
- *   control how a matched request is handled. You can save this object for later use and invoke
- *   `respond` or `passThrough` again in order to change how a matched request is handled.
- */
-
-/**
- * @ngdoc method
- * @name $httpBackend#whenDELETE
- * @module ngMockE2E
- * @description
- * Creates a new backend definition for DELETE requests. For more info see `when()`.
- *
- * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
- *   and returns true if the url matches the current definition.
- * @param {(Object|function(Object))=} headers HTTP headers.
- * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
- *   control how a matched request is handled. You can save this object for later use and invoke
- *   `respond` or `passThrough` again in order to change how a matched request is handled.
- */
-
-/**
- * @ngdoc method
- * @name $httpBackend#whenPOST
- * @module ngMockE2E
- * @description
- * Creates a new backend definition for POST requests. For more info see `when()`.
- *
- * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
- *   and returns true if the url matches the current definition.
- * @param {(string|RegExp)=} data HTTP request body.
- * @param {(Object|function(Object))=} headers HTTP headers.
- * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
- *   control how a matched request is handled. You can save this object for later use and invoke
- *   `respond` or `passThrough` again in order to change how a matched request is handled.
- */
-
-/**
- * @ngdoc method
- * @name $httpBackend#whenPUT
- * @module ngMockE2E
- * @description
- * Creates a new backend definition for PUT requests.  For more info see `when()`.
- *
- * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
- *   and returns true if the url matches the current definition.
- * @param {(string|RegExp)=} data HTTP request body.
- * @param {(Object|function(Object))=} headers HTTP headers.
- * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
- *   control how a matched request is handled. You can save this object for later use and invoke
- *   `respond` or `passThrough` again in order to change how a matched request is handled.
- */
-
-/**
- * @ngdoc method
- * @name $httpBackend#whenPATCH
- * @module ngMockE2E
- * @description
- * Creates a new backend definition for PATCH requests.  For more info see `when()`.
- *
- * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
- *   and returns true if the url matches the current definition.
- * @param {(string|RegExp)=} data HTTP request body.
- * @param {(Object|function(Object))=} headers HTTP headers.
- * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
- *   control how a matched request is handled. You can save this object for later use and invoke
- *   `respond` or `passThrough` again in order to change how a matched request is handled.
- */
-
-/**
- * @ngdoc method
- * @name $httpBackend#whenJSONP
- * @module ngMockE2E
- * @description
- * Creates a new backend definition for JSONP requests. For more info see `when()`.
- *
- * @param {string|RegExp|function(string)} url HTTP url or function that receives a url
- *   and returns true if the url matches the current definition.
- * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
- *   control how a matched request is handled. You can save this object for later use and invoke
- *   `respond` or `passThrough` again in order to change how a matched request is handled.
- */
-angular.mock.e2e = {};
-angular.mock.e2e.$httpBackendDecorator =
-  ['$rootScope', '$timeout', '$delegate', '$browser', createHttpBackendMock];
-
-
-/**
- * @ngdoc type
- * @name $rootScope.Scope
- * @module ngMock
- * @description
- * {@link ng.$rootScope.Scope Scope} type decorated with helper methods useful for testing. These
- * methods are automatically available on any {@link ng.$rootScope.Scope Scope} instance when
- * `ngMock` module is loaded.
- *
- * In addition to all the regular `Scope` methods, the following helper methods are available:
- */
-angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
-
-  var $rootScopePrototype = Object.getPrototypeOf($delegate);
-
-  $rootScopePrototype.$countChildScopes = countChildScopes;
-  $rootScopePrototype.$countWatchers = countWatchers;
-
-  return $delegate;
-
-  // ------------------------------------------------------------------------------------------ //
-
-  /**
-   * @ngdoc method
-   * @name $rootScope.Scope#$countChildScopes
-   * @module ngMock
-   * @description
-   * Counts all the direct and indirect child scopes of the current scope.
-   *
-   * The current scope is excluded from the count. The count includes all isolate child scopes.
-   *
-   * @returns {number} Total number of child scopes.
-   */
-  function countChildScopes() {
-    // jshint validthis: true
-    var count = 0; // exclude the current scope
-    var pendingChildHeads = [this.$$childHead];
-    var currentScope;
-
-    while (pendingChildHeads.length) {
-      currentScope = pendingChildHeads.shift();
-
-      while (currentScope) {
-        count += 1;
-        pendingChildHeads.push(currentScope.$$childHead);
-        currentScope = currentScope.$$nextSibling;
-      }
-    }
-
-    return count;
-  }
-
-
-  /**
-   * @ngdoc method
-   * @name $rootScope.Scope#$countWatchers
-   * @module ngMock
-   * @description
-   * Counts all the watchers of direct and indirect child scopes of the current scope.
-   *
-   * The watchers of the current scope are included in the count and so are all the watchers of
-   * isolate child scopes.
-   *
-   * @returns {number} Total number of watchers.
-   */
-  function countWatchers() {
-    // jshint validthis: true
-    var count = this.$$watchers ? this.$$watchers.length : 0; // include the current scope
-    var pendingChildHeads = [this.$$childHead];
-    var currentScope;
-
-    while (pendingChildHeads.length) {
-      currentScope = pendingChildHeads.shift();
-
-      while (currentScope) {
-        count += currentScope.$$watchers ? currentScope.$$watchers.length : 0;
-        pendingChildHeads.push(currentScope.$$childHead);
-        currentScope = currentScope.$$nextSibling;
-      }
-    }
-
-    return count;
-  }
-}];
-
-
-if (window.jasmine || window.mocha) {
-
-  var currentSpec = null,
-      annotatedFunctions = [],
-      isSpecRunning = function() {
-        return !!currentSpec;
-      };
-
-  angular.mock.$$annotate = angular.injector.$$annotate;
-  angular.injector.$$annotate = function(fn) {
-    if (typeof fn === 'function' && !fn.$inject) {
-      annotatedFunctions.push(fn);
-    }
-    return angular.mock.$$annotate.apply(this, arguments);
-  };
-
-
-  (window.beforeEach || window.setup)(function() {
-    annotatedFunctions = [];
-    currentSpec = this;
-  });
-
-  (window.afterEach || window.teardown)(function() {
-    var injector = currentSpec.$injector;
-
-    annotatedFunctions.forEach(function(fn) {
-      delete fn.$inject;
-    });
-
-    angular.forEach(currentSpec.$modules, function(module) {
-      if (module && module.$$hashKey) {
-        module.$$hashKey = undefined;
-      }
-    });
-
-    currentSpec.$injector = null;
-    currentSpec.$modules = null;
-    currentSpec = null;
-
-    if (injector) {
-      injector.get('$rootElement').off();
-    }
-
-    // clean up jquery's fragment cache
-    angular.forEach(angular.element.fragments, function(val, key) {
-      delete angular.element.fragments[key];
-    });
-
-    MockXhr.$$lastInstance = null;
-
-    angular.forEach(angular.callbacks, function(val, key) {
-      delete angular.callbacks[key];
-    });
-    angular.callbacks.counter = 0;
-  });
-
-  /**
-   * @ngdoc function
-   * @name angular.mock.module
-   * @description
-   *
-   * *NOTE*: This function is also published on window for easy access.<br>
-   * *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha
-   *
-   * This function registers a module configuration code. It collects the configuration information
-   * which will be used when the injector is created by {@link angular.mock.inject inject}.
-   *
-   * See {@link angular.mock.inject inject} for usage example
-   *
-   * @param {...(string|Function|Object)} fns any number of modules which are represented as string
-   *        aliases or as anonymous module initialization functions. The modules are used to
-   *        configure the injector. The 'ng' and 'ngMock' modules are automatically loaded. If an
-   *        object literal is passed they will be registered as values in the module, the key being
-   *        the module name and the value being what is returned.
-   */
-  window.module = angular.mock.module = function() {
-    var moduleFns = Array.prototype.slice.call(arguments, 0);
-    return isSpecRunning() ? workFn() : workFn;
-    /////////////////////
-    function workFn() {
-      if (currentSpec.$injector) {
-        throw new Error('Injector already created, can not register a module!');
-      } else {
-        var modules = currentSpec.$modules || (currentSpec.$modules = []);
-        angular.forEach(moduleFns, function(module) {
-          if (angular.isObject(module) && !angular.isArray(module)) {
-            modules.push(function($provide) {
-              angular.forEach(module, function(value, key) {
-                $provide.value(key, value);
-              });
-            });
-          } else {
-            modules.push(module);
-          }
-        });
-      }
-    }
-  };
-
-  /**
-   * @ngdoc function
-   * @name angular.mock.inject
-   * @description
-   *
-   * *NOTE*: This function is also published on window for easy access.<br>
-   * *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha
-   *
-   * The inject function wraps a function into an injectable function. The inject() creates new
-   * instance of {@link auto.$injector $injector} per test, which is then used for
-   * resolving references.
-   *
-   *
-   * ## Resolving References (Underscore Wrapping)
-   * Often, we would like to inject a reference once, in a `beforeEach()` block and reuse this
-   * in multiple `it()` clauses. To be able to do this we must assign the reference to a variable
-   * that is declared in the scope of the `describe()` block. Since we would, most likely, want
-   * the variable to have the same name of the reference we have a problem, since the parameter
-   * to the `inject()` function would hide the outer variable.
-   *
-   * To help with this, the injected parameters can, optionally, be enclosed with underscores.
-   * These are ignored by the injector when the reference name is resolved.
-   *
-   * For example, the parameter `_myService_` would be resolved as the reference `myService`.
-   * Since it is available in the function body as _myService_, we can then assign it to a variable
-   * defined in an outer scope.
-   *
-   * ```
-   * // Defined out reference variable outside
-   * var myService;
-   *
-   * // Wrap the parameter in underscores
-   * beforeEach( inject( function(_myService_){
-   *   myService = _myService_;
-   * }));
-   *
-   * // Use myService in a series of tests.
-   * it('makes use of myService', function() {
-   *   myService.doStuff();
-   * });
-   *
-   * ```
-   *
-   * See also {@link angular.mock.module angular.mock.module}
-   *
-   * ## Example
-   * Example of what a typical jasmine tests looks like with the inject method.
-   * ```js
-   *
-   *   angular.module('myApplicationModule', [])
-   *       .value('mode', 'app')
-   *       .value('version', 'v1.0.1');
-   *
-   *
-   *   describe('MyApp', function() {
-   *
-   *     // You need to load modules that you want to test,
-   *     // it loads only the "ng" module by default.
-   *     beforeEach(module('myApplicationModule'));
-   *
-   *
-   *     // inject() is used to inject arguments of all given functions
-   *     it('should provide a version', inject(function(mode, version) {
-   *       expect(version).toEqual('v1.0.1');
-   *       expect(mode).toEqual('app');
-   *     }));
-   *
-   *
-   *     // The inject and module method can also be used inside of the it or beforeEach
-   *     it('should override a version and test the new version is injected', function() {
-   *       // module() takes functions or strings (module aliases)
-   *       module(function($provide) {
-   *         $provide.value('version', 'overridden'); // override version here
-   *       });
-   *
-   *       inject(function(version) {
-   *         expect(version).toEqual('overridden');
-   *       });
-   *     });
-   *   });
-   *
-   * ```
-   *
-   * @param {...Function} fns any number of functions which will be injected using the injector.
-   */
-
-
-
-  var ErrorAddingDeclarationLocationStack = function(e, errorForStack) {
-    this.message = e.message;
-    this.name = e.name;
-    if (e.line) this.line = e.line;
-    if (e.sourceId) this.sourceId = e.sourceId;
-    if (e.stack && errorForStack)
-      this.stack = e.stack + '\n' + errorForStack.stack;
-    if (e.stackArray) this.stackArray = e.stackArray;
-  };
-  ErrorAddingDeclarationLocationStack.prototype.toString = Error.prototype.toString;
-
-  window.inject = angular.mock.inject = function() {
-    var blockFns = Array.prototype.slice.call(arguments, 0);
-    var errorForStack = new Error('Declaration Location');
-    return isSpecRunning() ? workFn.call(currentSpec) : workFn;
-    /////////////////////
-    function workFn() {
-      var modules = currentSpec.$modules || [];
-      var strictDi = !!currentSpec.$injectorStrict;
-      modules.unshift('ngMock');
-      modules.unshift('ng');
-      var injector = currentSpec.$injector;
-      if (!injector) {
-        if (strictDi) {
-          // If strictDi is enabled, annotate the providerInjector blocks
-          angular.forEach(modules, function(moduleFn) {
-            if (typeof moduleFn === "function") {
-              angular.injector.$$annotate(moduleFn);
-            }
-          });
-        }
-        injector = currentSpec.$injector = angular.injector(modules, strictDi);
-        currentSpec.$injectorStrict = strictDi;
-      }
-      for (var i = 0, ii = blockFns.length; i < ii; i++) {
-        if (currentSpec.$injectorStrict) {
-          // If the injector is strict / strictDi, and the spec wants to inject using automatic
-          // annotation, then annotate the function here.
-          injector.annotate(blockFns[i]);
-        }
-        try {
-          /* jshint -W040 *//* Jasmine explicitly provides a `this` object when calling functions */
-          injector.invoke(blockFns[i] || angular.noop, this);
-          /* jshint +W040 */
-        } catch (e) {
-          if (e.stack && errorForStack) {
-            throw new ErrorAddingDeclarationLocationStack(e, errorForStack);
-          }
-          throw e;
-        } finally {
-          errorForStack = null;
-        }
-      }
-    }
-  };
-
-
-  angular.mock.inject.strictDi = function(value) {
-    value = arguments.length ? !!value : true;
-    return isSpecRunning() ? workFn() : workFn;
-
-    function workFn() {
-      if (value !== currentSpec.$injectorStrict) {
-        if (currentSpec.$injector) {
-          throw new Error('Injector already created, can not modify strict annotations');
-        } else {
-          currentSpec.$injectorStrict = value;
-        }
-      }
-    }
-  };
-}
-
-
-})(window, window.angular);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/bower.json
deleted file mode 100644
index 1158b54..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/bower.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "name": "angular-mocks",
-  "version": "1.4.7",
-  "main": "./angular-mocks.js",
-  "ignore": [],
-  "dependencies": {
-    "angular": "1.4.7"
-  }
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/ngAnimateMock.js b/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/ngAnimateMock.js
deleted file mode 100644
index 6f99e62..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/ngAnimateMock.js
+++ /dev/null
@@ -1,2 +0,0 @@
-require('./angular-mocks');
-module.exports = 'ngAnimateMock';
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/ngMock.js b/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/ngMock.js
deleted file mode 100644
index 7944de7..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/ngMock.js
+++ /dev/null
@@ -1,2 +0,0 @@
-require('./angular-mocks');
-module.exports = 'ngMock';
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/ngMockE2E.js b/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/ngMockE2E.js
deleted file mode 100644
index fc2e539..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/ngMockE2E.js
+++ /dev/null
@@ -1,2 +0,0 @@
-require('./angular-mocks');
-module.exports = 'ngMockE2E';
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/package.json b/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/package.json
deleted file mode 100644
index 4369e17..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-mocks/package.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-  "name": "angular-mocks",
-  "version": "1.4.7",
-  "description": "AngularJS mocks for testing",
-  "main": "angular-mocks.js",
-  "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
-  },
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/angular/angular.js.git"
-  },
-  "keywords": [
-    "angular",
-    "framework",
-    "browser",
-    "mocks",
-    "testing",
-    "client-side"
-  ],
-  "author": "Angular Core Team <angular-core+npm@google.com>",
-  "license": "MIT",
-  "bugs": {
-    "url": "https://github.com/angular/angular.js/issues"
-  },
-  "homepage": "http://angularjs.org"
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-resource/.bower.json
deleted file mode 100644
index 7057f3b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/.bower.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "name": "angular-resource",
-  "version": "1.4.7",
-  "main": "./angular-resource.js",
-  "ignore": [],
-  "dependencies": {
-    "angular": "1.4.7"
-  },
-  "homepage": "https://github.com/angular/bower-angular-resource",
-  "_release": "1.4.7",
-  "_resolution": {
-    "type": "version",
-    "tag": "v1.4.7",
-    "commit": "c97a21f0e610d48045863da9518d8c13b2c1ed9d"
-  },
-  "_source": "https://github.com/angular/bower-angular-resource.git",
-  "_target": "1.4.7",
-  "_originalSource": "angular-resource"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/README.md b/views/ngXosViews/serviceGrid/src/vendor/angular-resource/README.md
deleted file mode 100644
index f3bd119..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-# packaged angular-resource
-
-This repo is for distribution on `npm` and `bower`. The source for this module is in the
-[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngResource).
-Please file issues and pull requests against that repo.
-
-## Install
-
-You can install this package either with `npm` or with `bower`.
-
-### npm
-
-```shell
-npm install angular-resource
-```
-
-Then add `ngResource` as a dependency for your app:
-
-```javascript
-angular.module('myApp', [require('angular-resource')]);
-```
-
-### bower
-
-```shell
-bower install angular-resource
-```
-
-Add a `<script>` to your `index.html`:
-
-```html
-<script src="/bower_components/angular-resource/angular-resource.js"></script>
-```
-
-Then add `ngResource` as a dependency for your app:
-
-```javascript
-angular.module('myApp', ['ngResource']);
-```
-
-## Documentation
-
-Documentation is available on the
-[AngularJS docs site](http://docs.angularjs.org/api/ngResource).
-
-## License
-
-The MIT License
-
-Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/angular-resource.js b/views/ngXosViews/serviceGrid/src/vendor/angular-resource/angular-resource.js
deleted file mode 100644
index 39b370e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/angular-resource.js
+++ /dev/null
@@ -1,675 +0,0 @@
-/**
- * @license AngularJS v1.4.7
- * (c) 2010-2015 Google, Inc. http://angularjs.org
- * License: MIT
- */
-(function(window, angular, undefined) {'use strict';
-
-var $resourceMinErr = angular.$$minErr('$resource');
-
-// Helper functions and regex to lookup a dotted path on an object
-// stopping at undefined/null.  The path must be composed of ASCII
-// identifiers (just like $parse)
-var MEMBER_NAME_REGEX = /^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;
-
-function isValidDottedPath(path) {
-  return (path != null && path !== '' && path !== 'hasOwnProperty' &&
-      MEMBER_NAME_REGEX.test('.' + path));
-}
-
-function lookupDottedPath(obj, path) {
-  if (!isValidDottedPath(path)) {
-    throw $resourceMinErr('badmember', 'Dotted member path "@{0}" is invalid.', path);
-  }
-  var keys = path.split('.');
-  for (var i = 0, ii = keys.length; i < ii && angular.isDefined(obj); i++) {
-    var key = keys[i];
-    obj = (obj !== null) ? obj[key] : undefined;
-  }
-  return obj;
-}
-
-/**
- * Create a shallow copy of an object and clear other fields from the destination
- */
-function shallowClearAndCopy(src, dst) {
-  dst = dst || {};
-
-  angular.forEach(dst, function(value, key) {
-    delete dst[key];
-  });
-
-  for (var key in src) {
-    if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {
-      dst[key] = src[key];
-    }
-  }
-
-  return dst;
-}
-
-/**
- * @ngdoc module
- * @name ngResource
- * @description
- *
- * # ngResource
- *
- * The `ngResource` module provides interaction support with RESTful services
- * via the $resource service.
- *
- *
- * <div doc-module-components="ngResource"></div>
- *
- * See {@link ngResource.$resource `$resource`} for usage.
- */
-
-/**
- * @ngdoc service
- * @name $resource
- * @requires $http
- *
- * @description
- * A factory which creates a resource object that lets you interact with
- * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.
- *
- * The returned resource object has action methods which provide high-level behaviors without
- * the need to interact with the low level {@link ng.$http $http} service.
- *
- * Requires the {@link ngResource `ngResource`} module to be installed.
- *
- * By default, trailing slashes will be stripped from the calculated URLs,
- * which can pose problems with server backends that do not expect that
- * behavior.  This can be disabled by configuring the `$resourceProvider` like
- * this:
- *
- * ```js
-     app.config(['$resourceProvider', function($resourceProvider) {
-       // Don't strip trailing slashes from calculated URLs
-       $resourceProvider.defaults.stripTrailingSlashes = false;
-     }]);
- * ```
- *
- * @param {string} url A parameterized URL template with parameters prefixed by `:` as in
- *   `/user/:username`. If you are using a URL with a port number (e.g.
- *   `http://example.com:8080/api`), it will be respected.
- *
- *   If you are using a url with a suffix, just add the suffix, like this:
- *   `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')`
- *   or even `$resource('http://example.com/resource/:resource_id.:format')`
- *   If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be
- *   collapsed down to a single `.`.  If you need this sequence to appear and not collapse then you
- *   can escape it with `/\.`.
- *
- * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
- *   `actions` methods. If any of the parameter value is a function, it will be executed every time
- *   when a param value needs to be obtained for a request (unless the param was overridden).
- *
- *   Each key value in the parameter object is first bound to url template if present and then any
- *   excess keys are appended to the url search query after the `?`.
- *
- *   Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in
- *   URL `/path/greet?salutation=Hello`.
- *
- *   If the parameter value is prefixed with `@` then the value for that parameter will be extracted
- *   from the corresponding property on the `data` object (provided when calling an action method).  For
- *   example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of `someParam`
- *   will be `data.someProp`.
- *
- * @param {Object.<Object>=} actions Hash with declaration of custom actions that should extend
- *   the default set of resource actions. The declaration should be created in the format of {@link
- *   ng.$http#usage $http.config}:
- *
- *       {action1: {method:?, params:?, isArray:?, headers:?, ...},
- *        action2: {method:?, params:?, isArray:?, headers:?, ...},
- *        ...}
- *
- *   Where:
- *
- *   - **`action`** – {string} – The name of action. This name becomes the name of the method on
- *     your resource object.
- *   - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`,
- *     `DELETE`, `JSONP`, etc).
- *   - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of
- *     the parameter value is a function, it will be executed every time when a param value needs to
- *     be obtained for a request (unless the param was overridden).
- *   - **`url`** – {string} – action specific `url` override. The url templating is supported just
- *     like for the resource-level urls.
- *   - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,
- *     see `returns` section.
- *   - **`transformRequest`** –
- *     `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
- *     transform function or an array of such functions. The transform function takes the http
- *     request body and headers and returns its transformed (typically serialized) version.
- *     By default, transformRequest will contain one function that checks if the request data is
- *     an object and serializes to using `angular.toJson`. To prevent this behavior, set
- *     `transformRequest` to an empty array: `transformRequest: []`
- *   - **`transformResponse`** –
- *     `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
- *     transform function or an array of such functions. The transform function takes the http
- *     response body and headers and returns its transformed (typically deserialized) version.
- *     By default, transformResponse will contain one function that checks if the response looks like
- *     a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, set
- *     `transformResponse` to an empty array: `transformResponse: []`
- *   - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
- *     GET request, otherwise if a cache instance built with
- *     {@link ng.$cacheFactory $cacheFactory}, this cache will be used for
- *     caching.
- *   - **`timeout`** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} that
- *     should abort the request when resolved.
- *   - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the
- *     XHR object. See
- *     [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5)
- *     for more information.
- *   - **`responseType`** - `{string}` - see
- *     [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).
- *   - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods -
- *     `response` and `responseError`. Both `response` and `responseError` interceptors get called
- *     with `http response` object. See {@link ng.$http $http interceptors}.
- *
- * @param {Object} options Hash with custom settings that should extend the
- *   default `$resourceProvider` behavior.  The only supported option is
- *
- *   Where:
- *
- *   - **`stripTrailingSlashes`** – {boolean} – If true then the trailing
- *   slashes from any calculated URL will be stripped. (Defaults to true.)
- *
- * @returns {Object} A resource "class" object with methods for the default set of resource actions
- *   optionally extended with custom `actions`. The default set contains these actions:
- *   ```js
- *   { 'get':    {method:'GET'},
- *     'save':   {method:'POST'},
- *     'query':  {method:'GET', isArray:true},
- *     'remove': {method:'DELETE'},
- *     'delete': {method:'DELETE'} };
- *   ```
- *
- *   Calling these methods invoke an {@link ng.$http} with the specified http method,
- *   destination and parameters. When the data is returned from the server then the object is an
- *   instance of the resource class. The actions `save`, `remove` and `delete` are available on it
- *   as  methods with the `$` prefix. This allows you to easily perform CRUD operations (create,
- *   read, update, delete) on server-side data like this:
- *   ```js
- *   var User = $resource('/user/:userId', {userId:'@id'});
- *   var user = User.get({userId:123}, function() {
- *     user.abc = true;
- *     user.$save();
- *   });
- *   ```
- *
- *   It is important to realize that invoking a $resource object method immediately returns an
- *   empty reference (object or array depending on `isArray`). Once the data is returned from the
- *   server the existing reference is populated with the actual data. This is a useful trick since
- *   usually the resource is assigned to a model which is then rendered by the view. Having an empty
- *   object results in no rendering, once the data arrives from the server then the object is
- *   populated with the data and the view automatically re-renders itself showing the new data. This
- *   means that in most cases one never has to write a callback function for the action methods.
- *
- *   The action methods on the class object or instance object can be invoked with the following
- *   parameters:
- *
- *   - HTTP GET "class" actions: `Resource.action([parameters], [success], [error])`
- *   - non-GET "class" actions: `Resource.action([parameters], postData, [success], [error])`
- *   - non-GET instance actions:  `instance.$action([parameters], [success], [error])`
- *
- *
- *   Success callback is called with (value, responseHeaders) arguments, where the value is
- *   the populated resource instance or collection object. The error callback is called
- *   with (httpResponse) argument.
- *
- *   Class actions return empty instance (with additional properties below).
- *   Instance actions return promise of the action.
- *
- *   The Resource instances and collection have these additional properties:
- *
- *   - `$promise`: the {@link ng.$q promise} of the original server interaction that created this
- *     instance or collection.
- *
- *     On success, the promise is resolved with the same resource instance or collection object,
- *     updated with data from server. This makes it easy to use in
- *     {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view
- *     rendering until the resource(s) are loaded.
- *
- *     On failure, the promise is resolved with the {@link ng.$http http response} object, without
- *     the `resource` property.
- *
- *     If an interceptor object was provided, the promise will instead be resolved with the value
- *     returned by the interceptor.
- *
- *   - `$resolved`: `true` after first server interaction is completed (either with success or
- *      rejection), `false` before that. Knowing if the Resource has been resolved is useful in
- *      data-binding.
- *
- * @example
- *
- * # Credit card resource
- *
- * ```js
-     // Define CreditCard class
-     var CreditCard = $resource('/user/:userId/card/:cardId',
-      {userId:123, cardId:'@id'}, {
-       charge: {method:'POST', params:{charge:true}}
-      });
-
-     // We can retrieve a collection from the server
-     var cards = CreditCard.query(function() {
-       // GET: /user/123/card
-       // server returns: [ {id:456, number:'1234', name:'Smith'} ];
-
-       var card = cards[0];
-       // each item is an instance of CreditCard
-       expect(card instanceof CreditCard).toEqual(true);
-       card.name = "J. Smith";
-       // non GET methods are mapped onto the instances
-       card.$save();
-       // POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'}
-       // server returns: {id:456, number:'1234', name: 'J. Smith'};
-
-       // our custom method is mapped as well.
-       card.$charge({amount:9.99});
-       // POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'}
-     });
-
-     // we can create an instance as well
-     var newCard = new CreditCard({number:'0123'});
-     newCard.name = "Mike Smith";
-     newCard.$save();
-     // POST: /user/123/card {number:'0123', name:'Mike Smith'}
-     // server returns: {id:789, number:'0123', name: 'Mike Smith'};
-     expect(newCard.id).toEqual(789);
- * ```
- *
- * The object returned from this function execution is a resource "class" which has "static" method
- * for each action in the definition.
- *
- * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and
- * `headers`.
- * When the data is returned from the server then the object is an instance of the resource type and
- * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD
- * operations (create, read, update, delete) on server-side data.
-
-   ```js
-     var User = $resource('/user/:userId', {userId:'@id'});
-     User.get({userId:123}, function(user) {
-       user.abc = true;
-       user.$save();
-     });
-   ```
- *
- * It's worth noting that the success callback for `get`, `query` and other methods gets passed
- * in the response that came from the server as well as $http header getter function, so one
- * could rewrite the above example and get access to http headers as:
- *
-   ```js
-     var User = $resource('/user/:userId', {userId:'@id'});
-     User.get({userId:123}, function(u, getResponseHeaders){
-       u.abc = true;
-       u.$save(function(u, putResponseHeaders) {
-         //u => saved user object
-         //putResponseHeaders => $http header getter
-       });
-     });
-   ```
- *
- * You can also access the raw `$http` promise via the `$promise` property on the object returned
- *
-   ```
-     var User = $resource('/user/:userId', {userId:'@id'});
-     User.get({userId:123})
-         .$promise.then(function(user) {
-           $scope.user = user;
-         });
-   ```
-
- * # Creating a custom 'PUT' request
- * In this example we create a custom method on our resource to make a PUT request
- * ```js
- *    var app = angular.module('app', ['ngResource', 'ngRoute']);
- *
- *    // Some APIs expect a PUT request in the format URL/object/ID
- *    // Here we are creating an 'update' method
- *    app.factory('Notes', ['$resource', function($resource) {
- *    return $resource('/notes/:id', null,
- *        {
- *            'update': { method:'PUT' }
- *        });
- *    }]);
- *
- *    // In our controller we get the ID from the URL using ngRoute and $routeParams
- *    // We pass in $routeParams and our Notes factory along with $scope
- *    app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes',
-                                      function($scope, $routeParams, Notes) {
- *    // First get a note object from the factory
- *    var note = Notes.get({ id:$routeParams.id });
- *    $id = note.id;
- *
- *    // Now call update passing in the ID first then the object you are updating
- *    Notes.update({ id:$id }, note);
- *
- *    // This will PUT /notes/ID with the note object in the request payload
- *    }]);
- * ```
- */
-angular.module('ngResource', ['ng']).
-  provider('$resource', function() {
-    var PROTOCOL_AND_DOMAIN_REGEX = /^https?:\/\/[^\/]*/;
-    var provider = this;
-
-    this.defaults = {
-      // Strip slashes by default
-      stripTrailingSlashes: true,
-
-      // Default actions configuration
-      actions: {
-        'get': {method: 'GET'},
-        'save': {method: 'POST'},
-        'query': {method: 'GET', isArray: true},
-        'remove': {method: 'DELETE'},
-        'delete': {method: 'DELETE'}
-      }
-    };
-
-    this.$get = ['$http', '$q', function($http, $q) {
-
-      var noop = angular.noop,
-        forEach = angular.forEach,
-        extend = angular.extend,
-        copy = angular.copy,
-        isFunction = angular.isFunction;
-
-      /**
-       * We need our custom method because encodeURIComponent is too aggressive and doesn't follow
-       * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set
-       * (pchar) allowed in path segments:
-       *    segment       = *pchar
-       *    pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
-       *    pct-encoded   = "%" HEXDIG HEXDIG
-       *    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
-       *    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
-       *                     / "*" / "+" / "," / ";" / "="
-       */
-      function encodeUriSegment(val) {
-        return encodeUriQuery(val, true).
-          replace(/%26/gi, '&').
-          replace(/%3D/gi, '=').
-          replace(/%2B/gi, '+');
-      }
-
-
-      /**
-       * This method is intended for encoding *key* or *value* parts of query component. We need a
-       * custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't
-       * have to be encoded per http://tools.ietf.org/html/rfc3986:
-       *    query       = *( pchar / "/" / "?" )
-       *    pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
-       *    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
-       *    pct-encoded   = "%" HEXDIG HEXDIG
-       *    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
-       *                     / "*" / "+" / "," / ";" / "="
-       */
-      function encodeUriQuery(val, pctEncodeSpaces) {
-        return encodeURIComponent(val).
-          replace(/%40/gi, '@').
-          replace(/%3A/gi, ':').
-          replace(/%24/g, '$').
-          replace(/%2C/gi, ',').
-          replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
-      }
-
-      function Route(template, defaults) {
-        this.template = template;
-        this.defaults = extend({}, provider.defaults, defaults);
-        this.urlParams = {};
-      }
-
-      Route.prototype = {
-        setUrlParams: function(config, params, actionUrl) {
-          var self = this,
-            url = actionUrl || self.template,
-            val,
-            encodedVal,
-            protocolAndDomain = '';
-
-          var urlParams = self.urlParams = {};
-          forEach(url.split(/\W/), function(param) {
-            if (param === 'hasOwnProperty') {
-              throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name.");
-            }
-            if (!(new RegExp("^\\d+$").test(param)) && param &&
-              (new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) {
-              urlParams[param] = true;
-            }
-          });
-          url = url.replace(/\\:/g, ':');
-          url = url.replace(PROTOCOL_AND_DOMAIN_REGEX, function(match) {
-            protocolAndDomain = match;
-            return '';
-          });
-
-          params = params || {};
-          forEach(self.urlParams, function(_, urlParam) {
-            val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
-            if (angular.isDefined(val) && val !== null) {
-              encodedVal = encodeUriSegment(val);
-              url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) {
-                return encodedVal + p1;
-              });
-            } else {
-              url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
-                  leadingSlashes, tail) {
-                if (tail.charAt(0) == '/') {
-                  return tail;
-                } else {
-                  return leadingSlashes + tail;
-                }
-              });
-            }
-          });
-
-          // strip trailing slashes and set the url (unless this behavior is specifically disabled)
-          if (self.defaults.stripTrailingSlashes) {
-            url = url.replace(/\/+$/, '') || '/';
-          }
-
-          // then replace collapse `/.` if found in the last URL path segment before the query
-          // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`
-          url = url.replace(/\/\.(?=\w+($|\?))/, '.');
-          // replace escaped `/\.` with `/.`
-          config.url = protocolAndDomain + url.replace(/\/\\\./, '/.');
-
-
-          // set params - delegate param encoding to $http
-          forEach(params, function(value, key) {
-            if (!self.urlParams[key]) {
-              config.params = config.params || {};
-              config.params[key] = value;
-            }
-          });
-        }
-      };
-
-
-      function resourceFactory(url, paramDefaults, actions, options) {
-        var route = new Route(url, options);
-
-        actions = extend({}, provider.defaults.actions, actions);
-
-        function extractParams(data, actionParams) {
-          var ids = {};
-          actionParams = extend({}, paramDefaults, actionParams);
-          forEach(actionParams, function(value, key) {
-            if (isFunction(value)) { value = value(); }
-            ids[key] = value && value.charAt && value.charAt(0) == '@' ?
-              lookupDottedPath(data, value.substr(1)) : value;
-          });
-          return ids;
-        }
-
-        function defaultResponseInterceptor(response) {
-          return response.resource;
-        }
-
-        function Resource(value) {
-          shallowClearAndCopy(value || {}, this);
-        }
-
-        Resource.prototype.toJSON = function() {
-          var data = extend({}, this);
-          delete data.$promise;
-          delete data.$resolved;
-          return data;
-        };
-
-        forEach(actions, function(action, name) {
-          var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);
-
-          Resource[name] = function(a1, a2, a3, a4) {
-            var params = {}, data, success, error;
-
-            /* jshint -W086 */ /* (purposefully fall through case statements) */
-            switch (arguments.length) {
-              case 4:
-                error = a4;
-                success = a3;
-              //fallthrough
-              case 3:
-              case 2:
-                if (isFunction(a2)) {
-                  if (isFunction(a1)) {
-                    success = a1;
-                    error = a2;
-                    break;
-                  }
-
-                  success = a2;
-                  error = a3;
-                  //fallthrough
-                } else {
-                  params = a1;
-                  data = a2;
-                  success = a3;
-                  break;
-                }
-              case 1:
-                if (isFunction(a1)) success = a1;
-                else if (hasBody) data = a1;
-                else params = a1;
-                break;
-              case 0: break;
-              default:
-                throw $resourceMinErr('badargs',
-                  "Expected up to 4 arguments [params, data, success, error], got {0} arguments",
-                  arguments.length);
-            }
-            /* jshint +W086 */ /* (purposefully fall through case statements) */
-
-            var isInstanceCall = this instanceof Resource;
-            var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));
-            var httpConfig = {};
-            var responseInterceptor = action.interceptor && action.interceptor.response ||
-              defaultResponseInterceptor;
-            var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||
-              undefined;
-
-            forEach(action, function(value, key) {
-              if (key != 'params' && key != 'isArray' && key != 'interceptor') {
-                httpConfig[key] = copy(value);
-              }
-            });
-
-            if (hasBody) httpConfig.data = data;
-            route.setUrlParams(httpConfig,
-              extend({}, extractParams(data, action.params || {}), params),
-              action.url);
-
-            var promise = $http(httpConfig).then(function(response) {
-              var data = response.data,
-                promise = value.$promise;
-
-              if (data) {
-                // Need to convert action.isArray to boolean in case it is undefined
-                // jshint -W018
-                if (angular.isArray(data) !== (!!action.isArray)) {
-                  throw $resourceMinErr('badcfg',
-                      'Error in resource configuration for action `{0}`. Expected response to ' +
-                      'contain an {1} but got an {2} (Request: {3} {4})', name, action.isArray ? 'array' : 'object',
-                    angular.isArray(data) ? 'array' : 'object', httpConfig.method, httpConfig.url);
-                }
-                // jshint +W018
-                if (action.isArray) {
-                  value.length = 0;
-                  forEach(data, function(item) {
-                    if (typeof item === "object") {
-                      value.push(new Resource(item));
-                    } else {
-                      // Valid JSON values may be string literals, and these should not be converted
-                      // into objects. These items will not have access to the Resource prototype
-                      // methods, but unfortunately there
-                      value.push(item);
-                    }
-                  });
-                } else {
-                  shallowClearAndCopy(data, value);
-                  value.$promise = promise;
-                }
-              }
-
-              value.$resolved = true;
-
-              response.resource = value;
-
-              return response;
-            }, function(response) {
-              value.$resolved = true;
-
-              (error || noop)(response);
-
-              return $q.reject(response);
-            });
-
-            promise = promise.then(
-              function(response) {
-                var value = responseInterceptor(response);
-                (success || noop)(value, response.headers);
-                return value;
-              },
-              responseErrorInterceptor);
-
-            if (!isInstanceCall) {
-              // we are creating instance / collection
-              // - set the initial promise
-              // - return the instance / collection
-              value.$promise = promise;
-              value.$resolved = false;
-
-              return value;
-            }
-
-            // instance call
-            return promise;
-          };
-
-
-          Resource.prototype['$' + name] = function(params, success, error) {
-            if (isFunction(params)) {
-              error = success; success = params; params = {};
-            }
-            var result = Resource[name].call(this, params, this, success, error);
-            return result.$promise || result;
-          };
-        });
-
-        Resource.bind = function(additionalParamDefaults) {
-          return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions);
-        };
-
-        return Resource;
-      }
-
-      return resourceFactory;
-    }];
-  });
-
-
-})(window, window.angular);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/angular-resource.min.js b/views/ngXosViews/serviceGrid/src/vendor/angular-resource/angular-resource.min.js
deleted file mode 100644
index 0d22c37..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/angular-resource.min.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- AngularJS v1.4.7
- (c) 2010-2015 Google, Inc. http://angularjs.org
- License: MIT
-*/
-(function(I,f,C){'use strict';function D(t,e){e=e||{};f.forEach(e,function(f,k){delete e[k]});for(var k in t)!t.hasOwnProperty(k)||"$"===k.charAt(0)&&"$"===k.charAt(1)||(e[k]=t[k]);return e}var y=f.$$minErr("$resource"),B=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;f.module("ngResource",["ng"]).provider("$resource",function(){var t=/^https?:\/\/[^\/]*/,e=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};
-this.$get=["$http","$q",function(k,F){function w(f,g){this.template=f;this.defaults=r({},e.defaults,g);this.urlParams={}}function z(l,g,s,h){function c(b,q){var c={};q=r({},g,q);u(q,function(a,q){x(a)&&(a=a());var m;if(a&&a.charAt&&"@"==a.charAt(0)){m=b;var d=a.substr(1);if(null==d||""===d||"hasOwnProperty"===d||!B.test("."+d))throw y("badmember",d);for(var d=d.split("."),n=0,g=d.length;n<g&&f.isDefined(m);n++){var e=d[n];m=null!==m?m[e]:C}}else m=a;c[q]=m});return c}function G(b){return b.resource}
-function d(b){D(b||{},this)}var t=new w(l,h);s=r({},e.defaults.actions,s);d.prototype.toJSON=function(){var b=r({},this);delete b.$promise;delete b.$resolved;return b};u(s,function(b,q){var g=/^(POST|PUT|PATCH)$/i.test(b.method);d[q]=function(a,A,m,e){var n={},h,l,s;switch(arguments.length){case 4:s=e,l=m;case 3:case 2:if(x(A)){if(x(a)){l=a;s=A;break}l=A;s=m}else{n=a;h=A;l=m;break}case 1:x(a)?l=a:g?h=a:n=a;break;case 0:break;default:throw y("badargs",arguments.length);}var w=this instanceof d,p=w?
-h:b.isArray?[]:new d(h),v={},z=b.interceptor&&b.interceptor.response||G,B=b.interceptor&&b.interceptor.responseError||C;u(b,function(b,a){"params"!=a&&"isArray"!=a&&"interceptor"!=a&&(v[a]=H(b))});g&&(v.data=h);t.setUrlParams(v,r({},c(h,b.params||{}),n),b.url);n=k(v).then(function(a){var c=a.data,m=p.$promise;if(c){if(f.isArray(c)!==!!b.isArray)throw y("badcfg",q,b.isArray?"array":"object",f.isArray(c)?"array":"object",v.method,v.url);b.isArray?(p.length=0,u(c,function(a){"object"===typeof a?p.push(new d(a)):
-p.push(a)})):(D(c,p),p.$promise=m)}p.$resolved=!0;a.resource=p;return a},function(a){p.$resolved=!0;(s||E)(a);return F.reject(a)});n=n.then(function(a){var b=z(a);(l||E)(b,a.headers);return b},B);return w?n:(p.$promise=n,p.$resolved=!1,p)};d.prototype["$"+q]=function(a,b,c){x(a)&&(c=b,b=a,a={});a=d[q].call(this,a,this,b,c);return a.$promise||a}});d.bind=function(b){return z(l,r({},g,b),s)};return d}var E=f.noop,u=f.forEach,r=f.extend,H=f.copy,x=f.isFunction;w.prototype={setUrlParams:function(l,g,
-e){var h=this,c=e||h.template,k,d,r="",b=h.urlParams={};u(c.split(/\W/),function(d){if("hasOwnProperty"===d)throw y("badname");!/^\d+$/.test(d)&&d&&(new RegExp("(^|[^\\\\]):"+d+"(\\W|$)")).test(c)&&(b[d]=!0)});c=c.replace(/\\:/g,":");c=c.replace(t,function(b){r=b;return""});g=g||{};u(h.urlParams,function(b,e){k=g.hasOwnProperty(e)?g[e]:h.defaults[e];f.isDefined(k)&&null!==k?(d=encodeURIComponent(k).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,
-"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),c=c.replace(new RegExp(":"+e+"(\\W|$)","g"),function(a,b){return d+b})):c=c.replace(new RegExp("(/?):"+e+"(\\W|$)","g"),function(a,b,c){return"/"==c.charAt(0)?c:b+c})});h.defaults.stripTrailingSlashes&&(c=c.replace(/\/+$/,"")||"/");c=c.replace(/\/\.(?=\w+($|\?))/,".");l.url=r+c.replace(/\/\\\./,"/.");u(g,function(b,c){h.urlParams[c]||(l.params=l.params||{},l.params[c]=b)})}};return z}]})})(window,window.angular);
-//# sourceMappingURL=angular-resource.min.js.map
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/angular-resource.min.js.map b/views/ngXosViews/serviceGrid/src/vendor/angular-resource/angular-resource.min.js.map
deleted file mode 100644
index 2d23594..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/angular-resource.min.js.map
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-"version":3,
-"file":"angular-resource.min.js",
-"lineCount":12,
-"mappings":"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",
-"sources":["angular-resource.js"],
-"names":["window","angular","undefined","shallowClearAndCopy","src","dst","forEach","value","key","hasOwnProperty","charAt","$resourceMinErr","$$minErr","MEMBER_NAME_REGEX","module","provider","PROTOCOL_AND_DOMAIN_REGEX","defaults","stripTrailingSlashes","actions","method","isArray","$get","$http","$q","Route","template","extend","urlParams","resourceFactory","url","paramDefaults","options","extractParams","data","actionParams","ids","isFunction","path","test","keys","split","i","ii","length","isDefined","obj","defaultResponseInterceptor","response","resource","Resource","route","prototype","toJSON","Resource.prototype.toJSON","$promise","$resolved","action","name","hasBody","a1","a2","a3","a4","params","success","error","arguments","isInstanceCall","httpConfig","responseInterceptor","interceptor","responseErrorInterceptor","responseError","copy","setUrlParams","promise","then","item","push","noop","reject","headers","result","call","bind","Resource.bind","additionalParamDefaults","config","actionUrl","self","val","encodedVal","protocolAndDomain","param","RegExp","replace","match","_","urlParam","encodeURIComponent","p1","leadingSlashes","tail"]
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-resource/bower.json
deleted file mode 100644
index f466b55..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/bower.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "name": "angular-resource",
-  "version": "1.4.7",
-  "main": "./angular-resource.js",
-  "ignore": [],
-  "dependencies": {
-    "angular": "1.4.7"
-  }
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/index.js b/views/ngXosViews/serviceGrid/src/vendor/angular-resource/index.js
deleted file mode 100644
index fc40152..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-require('./angular-resource');
-module.exports = 'ngResource';
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/package.json b/views/ngXosViews/serviceGrid/src/vendor/angular-resource/package.json
deleted file mode 100644
index 3fa675b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-resource/package.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
-  "name": "angular-resource",
-  "version": "1.4.7",
-  "description": "AngularJS module for interacting with RESTful server-side data sources",
-  "main": "index.js",
-  "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
-  },
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/angular/angular.js.git"
-  },
-  "keywords": [
-    "angular",
-    "framework",
-    "browser",
-    "rest",
-    "client-side"
-  ],
-  "author": "Angular Core Team <angular-core+npm@google.com>",
-  "license": "MIT",
-  "bugs": {
-    "url": "https://github.com/angular/angular.js/issues"
-  },
-  "homepage": "http://angularjs.org"
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/.bower.json
deleted file mode 100644
index 95c7ab9..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/.bower.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
-  "name": "angular-ui-router",
-  "version": "0.2.15",
-  "main": "./release/angular-ui-router.js",
-  "dependencies": {
-    "angular": ">= 1.0.8"
-  },
-  "ignore": [
-    "**/.*",
-    "node_modules",
-    "bower_components",
-    "component.json",
-    "package.json",
-    "lib",
-    "config",
-    "sample",
-    "test",
-    "tests",
-    "ngdoc_assets",
-    "Gruntfile.js",
-    "files.js"
-  ],
-  "homepage": "https://github.com/angular-ui/angular-ui-router-bower",
-  "_release": "0.2.15",
-  "_resolution": {
-    "type": "version",
-    "tag": "0.2.15",
-    "commit": "90ce66133afc3572a8d7556d6d3fcee0efd8bb13"
-  },
-  "_source": "https://github.com/angular-ui/angular-ui-router-bower.git",
-  "_target": "0.2.15",
-  "_originalSource": "angular-ui-router"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/CHANGELOG.md b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/CHANGELOG.md
deleted file mode 100644
index 23b59d3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/CHANGELOG.md
+++ /dev/null
@@ -1,228 +0,0 @@
-<a name="0.2.14"></a>
-### 0.2.14 (2015-04-23)
-
-
-#### Bug Fixes
-
-* **$StateRefDirective:** resolve missing support for svg anchor elements #1667 ([0149a7bb](https://github.com/angular-ui/ui-router/commit/0149a7bb38b7af99388a1ad7cc9909a7b7c4439d))
-* **$urlMatcherFactory:**
-  * regex params should respect case-sensitivity ([1e10519f](https://github.com/angular-ui/ui-router/commit/1e10519f3be6bbf0cefdcce623cd2ade06e649e5), closes [#1671](https://github.com/angular-ui/ui-router/issues/1671))
-  * unquote all dashes from array params ([06664d33](https://github.com/angular-ui/ui-router/commit/06664d330f882390655dcfa83e10276110d0d0fa))
-  * add Type.$normalize function ([b0c6aa23](https://github.com/angular-ui/ui-router/commit/b0c6aa2350fdd3ce8483144774adc12f5a72b7e9))
-  * make optional params regex grouping optional ([06f73794](https://github.com/angular-ui/ui-router/commit/06f737945e83e668d09cfc3bcffd04a500ff1963), closes [#1576](https://github.com/angular-ui/ui-router/issues/1576))
-* **$state:** allow about.*.** glob patterns ([e39b27a2](https://github.com/angular-ui/ui-router/commit/e39b27a2cb7d88525c446a041f9fbf1553202010))
-* **uiSref:**
-  * use Object's toString instead of Window's toString ([2aa7f4d1](https://github.com/angular-ui/ui-router/commit/2aa7f4d139dbd5b9fcc4afdcf2ab6642c87f5671))
-  * add absolute to allowed transition options ([ae1b3c4e](https://github.com/angular-ui/ui-router/commit/ae1b3c4eedc37983400d830895afb50457c63af4))
-* **uiSrefActive:** Apply active classes on lazy loaded states ([f0ddbe7b](https://github.com/angular-ui/ui-router/commit/f0ddbe7b4a91daf279c3b7d0cee732bb1f3be5b4))
-* **uiView:** add `$element` to locals for view controller ([db68914c](https://github.com/angular-ui/ui-router/commit/db68914cd6c821e7dec8155bd33142a3a97f5453))
-
-
-#### Features
-
-* **$state:**
-  * support URLs with #fragments ([3da0a170](https://github.com/angular-ui/ui-router/commit/3da0a17069e27598c0f9d9164e104dd5ce05cdc6))
-  * inject resolve params into controllerProvider ([b380c223](https://github.com/angular-ui/ui-router/commit/b380c223fe12e2fde7582c0d6b1ed7b15a23579b), closes [#1131](https://github.com/angular-ui/ui-router/issues/1131))
-  * added 'state' to state reload method (feat no.1612)  - modiefied options.reload  ([b8f04575](https://github.com/angular-ui/ui-router/commit/b8f04575a8557035c1858c4d5c8dbde3e1855aaa))
-  * broadcast $stateChangeCancel event when event.preventDefault() is called in $sta ([ecefb758](https://github.com/angular-ui/ui-router/commit/ecefb758cb445e41620b62a272aafa3638613d7a))
-* **$uiViewScroll:** change function to return promise ([c2a9a311](https://github.com/angular-ui/ui-router/commit/c2a9a311388bb212e5a2e820536d1d739f829ccd), closes [#1702](https://github.com/angular-ui/ui-router/issues/1702))
-* **uiSrefActive:** Added support for multiple nested uiSref directives ([b1844948](https://github.com/angular-ui/ui-router/commit/b18449481d152b50705abfce2493a444eb059fa5))
-
-
-<a name="0.2.13"></a>
-### 0.2.13 (2014-11-20)
-
-This release primarily fixes issues reported against 0.2.12
-
-#### Bug Fixes
-
-* **$state:** fix $state.includes/.is to apply param types before comparisions fix(uiSref): ma ([19715d15](https://github.com/angular-ui/ui-router/commit/19715d15e3cbfff724519e9febedd05b49c75baa), closes [#1513](https://github.com/angular-ui/ui-router/issues/1513))
-  * Avoid re-synchronizing from url after .transitionTo ([b267ecd3](https://github.com/angular-ui/ui-router/commit/b267ecd348e5c415233573ef95ebdbd051875f52), closes [#1573](https://github.com/angular-ui/ui-router/issues/1573))
-* **$urlMatcherFactory:**
-  * Built-in date type uses local time zone ([d726bedc](https://github.com/angular-ui/ui-router/commit/d726bedcbb5f70a5660addf43fd52ec730790293))
-  * make date type fn check .is before running ([aa94ce3b](https://github.com/angular-ui/ui-router/commit/aa94ce3b86632ad05301530a2213099da73a3dc0), closes [#1564](https://github.com/angular-ui/ui-router/issues/1564))
-  * early binding of array handler bypasses type resolution ([ada4bc27](https://github.com/angular-ui/ui-router/commit/ada4bc27df5eff3ba3ab0de94a09bd91b0f7a28c))
-  * add 'any' Type for non-encoding non-url params ([3bfd75ab](https://github.com/angular-ui/ui-router/commit/3bfd75ab445ee2f1dd55275465059ed116b10b27), closes [#1562](https://github.com/angular-ui/ui-router/issues/1562))
-  * fix encoding slashes in params ([0c983a08](https://github.com/angular-ui/ui-router/commit/0c983a08e2947f999683571477debd73038e95cf), closes [#1119](https://github.com/angular-ui/ui-router/issues/1119))
-  * fix mixed path/query params ordering problem ([a479fbd0](https://github.com/angular-ui/ui-router/commit/a479fbd0b8eb393a94320973e5b9a62d83912ee2), closes [#1543](https://github.com/angular-ui/ui-router/issues/1543))
-* **ArrayType:**
-  * specify empty array mapping corner case ([74aa6091](https://github.com/angular-ui/ui-router/commit/74aa60917e996b0b4e27bbb4eb88c3c03832021d), closes [#1511](https://github.com/angular-ui/ui-router/issues/1511))
-  * fix .equals for array types ([5e6783b7](https://github.com/angular-ui/ui-router/commit/5e6783b77af9a90ddff154f990b43dbb17eeda6e), closes [#1538](https://github.com/angular-ui/ui-router/issues/1538))
-* **Param:** fix default value shorthand declaration ([831d812a](https://github.com/angular-ui/ui-router/commit/831d812a524524c71f0ee1c9afaf0487a5a66230), closes [#1554](https://github.com/angular-ui/ui-router/issues/1554))
-* **common:** fixed the _.filter clone to not create sparse arrays ([750f5cf5](https://github.com/angular-ui/ui-router/commit/750f5cf5fd91f9ada96f39e50d39aceb2caf22b6), closes [#1563](https://github.com/angular-ui/ui-router/issues/1563))
-* **ie8:** fix calls to indexOf and filter ([dcb31b84](https://github.com/angular-ui/ui-router/commit/dcb31b843391b3e61dee4de13f368c109541813e), closes [#1556](https://github.com/angular-ui/ui-router/issues/1556))
-
-
-#### Features
-
-* add json parameter Type ([027f1fcf](https://github.com/angular-ui/ui-router/commit/027f1fcf9c0916cea651e88981345da6f9ff214a))
-
-
-<a name="0.2.12"></a>
-### 0.2.12 (2014-11-13)
-
-#### Bug Fixes
-
-* **$resolve:** use resolve fn result, not parent resolved value of same name ([67f5e00c](https://github.com/angular-ui/ui-router/commit/67f5e00cc9aa006ce3fe6cde9dff261c28eab70a), closes [#1317], [#1353])
-* **$state:**
-  * populate default params in .transitionTo. ([3f60fbe6](https://github.com/angular-ui/ui-router/commit/3f60fbe6d65ebeca8d97952c05aa1d269f1b7ba1), closes [#1396])
-  * reload() now reinvokes controllers ([73443420](https://github.com/angular-ui/ui-router/commit/7344342018847902594dc1fc62d30a5c30f01763), closes [#582])
-  * do not emit $viewContentLoading if notify: false ([74255feb](https://github.com/angular-ui/ui-router/commit/74255febdf48ae082a02ca1e735165f2c369a463), closes [#1387](https://github.com/angular-ui/ui-router/issues/1387))
-  * register states at config-time ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a))
-  * handle parent.name when parent is obj ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a))
-* **$urlMatcherFactory:**
-  * register types at config ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a), closes [#1476])
-  * made path params default value "" for backwards compat ([8f998e71](https://github.com/angular-ui/ui-router/commit/8f998e71e43a0b31293331c981f5db0f0097b8ba))
-  * Pre-replace certain param values for better mapping ([6374a3e2](https://github.com/angular-ui/ui-router/commit/6374a3e29ab932014a7c77d2e1ab884cc841a2e3))
-  * fixed ParamSet.$$keys() ordering ([9136fecb](https://github.com/angular-ui/ui-router/commit/9136fecbc2bfd4fda748a9914f0225a46c933860))
-  * empty string policy now respected in Param.value() ([db12c85c](https://github.com/angular-ui/ui-router/commit/db12c85c16f2d105415f9bbbdeb11863f64728e0))
-  * "string" type now encodes/decodes slashes ([3045e415](https://github.com/angular-ui/ui-router/commit/3045e41577a8b8b8afc6039f42adddf5f3c061ec), closes [#1119])
-  * allow arrays in both path and query params ([fdd2f2c1](https://github.com/angular-ui/ui-router/commit/fdd2f2c191c4a67c874fdb9ec9a34f8dde9ad180), closes [#1073], [#1045], [#1486], [#1394])
-  * typed params in search ([8d4cab69](https://github.com/angular-ui/ui-router/commit/8d4cab69dd67058e1a716892cc37b7d80a57037f), closes [#1488](https://github.com/angular-ui/ui-router/issues/1488))
-  * no longer generate unroutable urls ([cb9fd9d8](https://github.com/angular-ui/ui-router/commit/cb9fd9d8943cb26c7223f6990db29c82ae8740f8), closes [#1487](https://github.com/angular-ui/ui-router/issues/1487))
-  * handle optional parameter followed by required parameter in url format. ([efc72106](https://github.com/angular-ui/ui-router/commit/efc72106ddcc4774b48ea176a505ef9e95193b41))
-  * default to parameter string coersion. ([13a468a7](https://github.com/angular-ui/ui-router/commit/13a468a7d54c2fb0751b94c0c1841d580b71e6dc), closes [#1414](https://github.com/angular-ui/ui-router/issues/1414))
-  * concat respects strictMode/caseInsensitive ([dd72e103](https://github.com/angular-ui/ui-router/commit/dd72e103edb342d9cf802816fe127e1bbd68fd5f), closes [#1395])
-* **ui-sref:**
-  * Allow sref state options to take a scope object ([b5f7b596](https://github.com/angular-ui/ui-router/commit/b5f7b59692ce4933e2d63eb5df3f50a4ba68ccc0))
-  * replace raw href modification with attrs. ([08c96782](https://github.com/angular-ui/ui-router/commit/08c96782faf881b0c7ab00afc233ee6729548fa0))
-  * nagivate to state when url is "" fix($state.href): generate href for state with  ([656b5aab](https://github.com/angular-ui/ui-router/commit/656b5aab906e5749db9b5a080c6a83b95f50fd91), closes [#1363](https://github.com/angular-ui/ui-router/issues/1363))
-  * Check that state is defined in isMatch() ([92aebc75](https://github.com/angular-ui/ui-router/commit/92aebc7520f88babdc6e266536086e07263514c3), closes [#1314](https://github.com/angular-ui/ui-router/issues/1314), [#1332](https://github.com/angular-ui/ui-router/issues/1332))
-* **uiView:**
-  * allow inteprolated ui-view names ([81f6a19a](https://github.com/angular-ui/ui-router/commit/81f6a19a432dac9198fd33243855bfd3b4fea8c0), closes [#1324](https://github.com/angular-ui/ui-router/issues/1324))
-  * Made anim work with angular 1.3 ([c3bb7ad9](https://github.com/angular-ui/ui-router/commit/c3bb7ad903da1e1f3c91019cfd255be8489ff4ef), closes [#1367](https://github.com/angular-ui/ui-router/issues/1367), [#1345](https://github.com/angular-ui/ui-router/issues/1345))
-* **urlRouter:** html5Mode accepts an object from angular v1.3.0-rc.3 ([7fea1e9d](https://github.com/angular-ui/ui-router/commit/7fea1e9d0d8c6e09cc6c895ecb93d4221e9adf48))
-* **stateFilters:** mark state filters as stateful. ([a00b353e](https://github.com/angular-ui/ui-router/commit/a00b353e3036f64a81245c4e7898646ba218f833), closes [#1479])
-* **ui-router:** re-add IE8 compatibility for map/filter/keys ([8ce69d9f](https://github.com/angular-ui/ui-router/commit/8ce69d9f7c886888ab53eca7e53536f36b428aae), closes [#1518], [#1383])
-* **package:** point 'main' to a valid filename ([ac903350](https://github.com/angular-ui/ui-router/commit/ac9033501debb63364539d91fbf3a0cba4579f8e))
-* **travis:** make CI build faster ([0531de05](https://github.com/angular-ui/ui-router/commit/0531de052e414a8d839fbb4e7635e923e94865b3))
-
-
-#### Features
-
-##### Default and Typed params
-
-This release includes a lot of bug fixes around default/optional and typed parameters.  As such, 0.2.12 is the first release where we recommend those features be used.
-
-* **$state:**
-  * add state params validation ([b1379e6a](https://github.com/angular-ui/ui-router/commit/b1379e6a4d38f7ed7436e05873932d7c279af578), closes [#1433](https://github.com/angular-ui/ui-router/issues/1433))
-  * is/includes/get work on relative stateOrName ([232e94b3](https://github.com/angular-ui/ui-router/commit/232e94b3c2ca2c764bb9510046e4b61690c87852))
-  * .reload() returns state transition promise ([639e0565](https://github.com/angular-ui/ui-router/commit/639e0565dece9d5544cc93b3eee6e11c99bd7373))
-* **$templateFactory:** request templateURL as text/html ([ccd60769](https://github.com/angular-ui/ui-router/commit/ccd6076904a4b801d77b47f6e2de4c06ce9962f8), closes [#1287])
-* **$urlMatcherFactory:** Made a Params and ParamSet class ([0cc1e6cc](https://github.com/angular-ui/ui-router/commit/0cc1e6cc461a4640618e2bb594566551c54834e2))
-
-
-
-<a name="0.2.11"></a>
-### 0.2.11 (2014-08-26)
-
-
-#### Bug Fixes
-
-* **$resolve:** Resolves only inherit from immediate parent fixes #702 ([df34e20c](https://github.com/angular-ui/ui-router/commit/df34e20c576299e7a3c8bd4ebc68d42341c0ace9))
-* **$state:**
-  * change $state.href default options.inherit to true ([deea695f](https://github.com/angular-ui/ui-router/commit/deea695f5cacc55de351ab985144fd233c02a769))
-  * sanity-check state lookups ([456fd5ae](https://github.com/angular-ui/ui-router/commit/456fd5aec9ea507518927bfabd62b4afad4cf714), closes [#980](https://github.com/angular-ui/ui-router/issues/980))
-  * didn't comply to inherit parameter ([09836781](https://github.com/angular-ui/ui-router/commit/09836781f126c1c485b06551eb9cfd4fa0f45c35))
-  * allow view content loading broadcast ([7b78edee](https://github.com/angular-ui/ui-router/commit/7b78edeeb52a74abf4d3f00f79534033d5a08d1a))
-* **$urlMatcherFactory:**
-  * detect injected functions ([91f75ae6](https://github.com/angular-ui/ui-router/commit/91f75ae66c4d129f6f69e53bd547594e9661f5d5))
-  * syntax ([1ebed370](https://github.com/angular-ui/ui-router/commit/1ebed37069bae8614d41541d56521f5c45f703f3))
-* **UrlMatcher:**
-  * query param function defaults ([f9c20530](https://github.com/angular-ui/ui-router/commit/f9c205304f10d8a4ebe7efe9025e642016479a51))
-  * don't decode default values ([63607bdb](https://github.com/angular-ui/ui-router/commit/63607bdbbcb432d3fb37856a1cb3da0cd496804e))
-* **travis:** update Node version to fix build ([d6b95ef2](https://github.com/angular-ui/ui-router/commit/d6b95ef23d9dacb4eba08897f5190a0bcddb3a48))
-* **uiSref:**
-  * Generate an href for states with a blank url. closes #1293 ([691745b1](https://github.com/angular-ui/ui-router/commit/691745b12fa05d3700dd28f0c8d25f8a105074ad))
-  * should inherit params by default ([b973dad1](https://github.com/angular-ui/ui-router/commit/b973dad155ad09a7975e1476bd096f7b2c758eeb))
-  * cancel transition if preventDefault() has been called ([2e6d9167](https://github.com/angular-ui/ui-router/commit/2e6d9167d3afbfbca6427e53e012f94fb5fb8022))
-* **uiView:** Fixed infinite loop when is called .go() from a controller. ([e13988b8](https://github.com/angular-ui/ui-router/commit/e13988b8cd6231d75c78876ee9d012cc87f4a8d9), closes [#1194](https://github.com/angular-ui/ui-router/issues/1194))
-* **docs:**
-  * Fixed link to milestones ([6c0ae500](https://github.com/angular-ui/ui-router/commit/6c0ae500cc238ea9fc95adcc15415c55fc9e1f33))
-  * fix bug in decorator example ([4bd00af5](https://github.com/angular-ui/ui-router/commit/4bd00af50b8b88a49d1545a76290731cb8e0feb1))
-  * Removed an incorrect semi-colon ([af97cef8](https://github.com/angular-ui/ui-router/commit/af97cef8b967f2e32177e539ef41450dca131a7d))
-  * Explain return value of rule as function ([5e887890](https://github.com/angular-ui/ui-router/commit/5e8878900a6ffe59a81aed531a3925e34a297377))
-
-
-#### Features
-
-* **$state:**
-  * allow parameters to pass unharmed ([8939d057](https://github.com/angular-ui/ui-router/commit/8939d0572ab1316e458ef016317ecff53131a822))
-    * **BREAKING CHANGE**: state parameters are no longer automatically coerced to strings, and unspecified parameter values are now set to undefined rather than null.
-  * allow prevent syncUrl on failure ([753060b9](https://github.com/angular-ui/ui-router/commit/753060b910d5d2da600a6fa0757976e401c33172))
-* **typescript:** Add typescript definitions for component builds ([521ceb3f](https://github.com/angular-ui/ui-router/commit/521ceb3fd7850646422f411921e21ce5e7d82e0f))
-* **uiSref:** extend syntax for ui-sref ([71cad3d6](https://github.com/angular-ui/ui-router/commit/71cad3d636508b5a9fe004775ad1f1adc0c80c3e))
-* **uiSrefActive:** 
-  * Also activate for child states. ([bf163ad6](https://github.com/angular-ui/ui-router/commit/bf163ad6ce176ce28792696c8302d7cdf5c05a01), closes [#818](https://github.com/angular-ui/ui-router/issues/818))
-    * **BREAKING CHANGE** Since ui-sref-active now activates even when child states are active you may need to swap out your ui-sref-active with ui-sref-active-eq, thought typically we think devs want the auto inheritance.
-
-  * uiSrefActiveEq: new directive with old ui-sref-active behavior
-* **$urlRouter:**
-  * defer URL change interception ([c72d8ce1](https://github.com/angular-ui/ui-router/commit/c72d8ce11916d0ac22c81b409c9e61d7048554d7))
-  * force URLs to have valid params ([d48505cd](https://github.com/angular-ui/ui-router/commit/d48505cd328d83e39d5706e085ba319715f999a6))
-  * abstract $location handling ([08b4636b](https://github.com/angular-ui/ui-router/commit/08b4636b294611f08db35f00641eb5211686fb50))
-* **$urlMatcherFactory:**
-  * fail on bad parameters ([d8f124c1](https://github.com/angular-ui/ui-router/commit/d8f124c10d00c7e5dde88c602d966db261aea221))
-  * date type support ([b7f074ff](https://github.com/angular-ui/ui-router/commit/b7f074ff65ca150a3cdbda4d5ad6cb17107300eb))
-  * implement type support ([450b1f0e](https://github.com/angular-ui/ui-router/commit/450b1f0e8e03c738174ff967f688b9a6373290f4))
-* **UrlMatcher:**
-  * handle query string arrays ([9cf764ef](https://github.com/angular-ui/ui-router/commit/9cf764efab45fa9309368688d535ddf6e96d6449), closes [#373](https://github.com/angular-ui/ui-router/issues/373))
-  * injectable functions as defaults ([00966ecd](https://github.com/angular-ui/ui-router/commit/00966ecd91fb745846039160cab707bfca8b3bec))
-  * default values & type decoding for query params ([a472b301](https://github.com/angular-ui/ui-router/commit/a472b301389fbe84d1c1fa9f24852b492a569d11))
-  * allow shorthand definitions ([5b724304](https://github.com/angular-ui/ui-router/commit/5b7243049793505e44b6608ea09878c37c95b1f5))
-  * validates whole interface ([32b27db1](https://github.com/angular-ui/ui-router/commit/32b27db173722e9194ef1d5c0ea7d93f25a98d11))
-  * implement non-strict matching ([a3e21366](https://github.com/angular-ui/ui-router/commit/a3e21366bee0475c9795a1ec76f70eec41c5b4e3))
-  * add per-param config support ([07b3029f](https://github.com/angular-ui/ui-router/commit/07b3029f4d409cf955780113df92e36401b47580))
-    * **BREAKING CHANGE**: the `params` option in state configurations must now be an object keyed by parameter name.
-
-### 0.2.10 (2014-03-12)
-
-
-#### Bug Fixes
-
-* **$state:** use $browser.baseHref() when generating urls with .href() ([cbcc8488](https://github.com/angular-ui/ui-router/commit/cbcc84887d6b6d35258adabb97c714cd9c1e272d))
-* **bower.json:** JS files should not be ignored ([ccdab193](https://github.com/angular-ui/ui-router/commit/ccdab193315f304eb3be5f5b97c47a926c79263e))
-* **dev:** karma:background task is missing, can't run grunt:dev. ([d9f7b898](https://github.com/angular-ui/ui-router/commit/d9f7b898e8e3abb8c846b0faa16a382913d7b22b))
-* **sample:** Contacts menu button not staying active when navigating to detail states. Need t ([2fcb8443](https://github.com/angular-ui/ui-router/commit/2fcb84437cb43ade12682a92b764f13cac77dfe7))
-* **uiSref:** support mock-clicks/events with no data ([717d3ff7](https://github.com/angular-ui/ui-router/commit/717d3ff7d0ba72d239892dee562b401cdf90e418))
-* **uiView:**
-  * Do NOT autoscroll when autoscroll attr is missing ([affe5bd7](https://github.com/angular-ui/ui-router/commit/affe5bd785cdc3f02b7a9f64a52e3900386ec3a0), closes [#807](https://github.com/angular-ui/ui-router/issues/807))
-  * Refactoring uiView directive to copy ngView logic ([548fab6a](https://github.com/angular-ui/ui-router/commit/548fab6ab9debc9904c5865c8bc68b4fc3271dd0), closes [#857](https://github.com/angular-ui/ui-router/issues/857), [#552](https://github.com/angular-ui/ui-router/issues/552))
-
-
-#### Features
-
-* **$state:** includes() allows glob patterns for state matching. ([2d5f6b37](https://github.com/angular-ui/ui-router/commit/2d5f6b37191a3135f4a6d9e8f344c54edcdc065b))
-* **UrlMatcher:** Add support for case insensitive url matching ([642d5247](https://github.com/angular-ui/ui-router/commit/642d524799f604811e680331002feec7199a1fb5))
-* **uiSref:** add support for transition options ([2ed7a728](https://github.com/angular-ui/ui-router/commit/2ed7a728cee6854b38501fbc1df6139d3de5b28a))
-* **uiView:** add controllerAs config with function ([1ee7334a](https://github.com/angular-ui/ui-router/commit/1ee7334a73efeccc9b95340e315cdfd59944762d))
-
-
-### 0.2.9 (2014-01-17)
-
-
-This release is identical to 0.2.8. 0.2.8 was re-tagged in git to fix a problem with bower.
-
-
-### 0.2.8 (2014-01-16)
-
-
-#### Bug Fixes
-
-* **$state:** allow null to be passed as 'params' param ([094dc30e](https://github.com/angular-ui/ui-router/commit/094dc30e883e1bd14e50a475553bafeaade3b178))
-* **$state.go:** param inheritance shouldn't inherit from siblings ([aea872e0](https://github.com/angular-ui/ui-router/commit/aea872e0b983cb433436ce5875df10c838fccedb))
-* **bower.json:** fixes bower.json ([eed3cc4d](https://github.com/angular-ui/ui-router/commit/eed3cc4d4dfef1d3ef84b9fd063127538ebf59d3))
-* **uiSrefActive:** annotate controller injection ([85921422](https://github.com/angular-ui/ui-router/commit/85921422ff7fb0effed358136426d616cce3d583), closes [#671](https://github.com/angular-ui/ui-router/issues/671))
-* **uiView:**
-  * autoscroll tests pass on 1.2.4 & 1.1.5 ([86eacac0](https://github.com/angular-ui/ui-router/commit/86eacac09ca5e9000bd3b9c7ba6e2cc95d883a3a))
-  * don't animate initial load ([83b6634d](https://github.com/angular-ui/ui-router/commit/83b6634d27942ca74766b2b1244a7fc52c5643d9))
-  * test pass against 1.0.8 and 1.2.4 ([a402415a](https://github.com/angular-ui/ui-router/commit/a402415a2a28b360c43b9fe8f4f54c540f6c33de))
-  * it should autoscroll when expr is missing. ([8bb9e27a](https://github.com/angular-ui/ui-router/commit/8bb9e27a2986725f45daf44c4c9f846385095aff))
-
-
-#### Features
-
-* **uiSref:** add target attribute behaviour ([c12bf9a5](https://github.com/angular-ui/ui-router/commit/c12bf9a520d30d70294e3d82de7661900f8e394e))
-* **uiView:**
-  * merge autoscroll expression test. ([b89e0f87](https://github.com/angular-ui/ui-router/commit/b89e0f871d5cc35c10925ede986c10684d5c9252))
-  * cache and test autoscroll expression ([ee262282](https://github.com/angular-ui/ui-router/commit/ee2622828c2ce83807f006a459ac4e11406d9258))
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/CONTRIBUTING.md b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/CONTRIBUTING.md
deleted file mode 100644
index 63829a5..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/CONTRIBUTING.md
+++ /dev/null
@@ -1,65 +0,0 @@
-
-# Report an Issue
-
-Help us make UI-Router better! If you think you might have found a bug, or some other weirdness, start by making sure
-it hasn't already been reported. You can [search through existing issues](https://github.com/angular-ui/ui-router/search?q=wat%3F&type=Issues)
-to see if someone's reported one similar to yours.
-
-If not, then [create a plunkr](http://bit.ly/UIR-Plunk) that demonstrates the problem (try to use as little code
-as possible: the more minimalist, the faster we can debug it).
-
-Next, [create a new issue](https://github.com/angular-ui/ui-router/issues/new) that briefly explains the problem,
-and provides a bit of background as to the circumstances that triggered it. Don't forget to include the link to
-that plunkr you created!
-
-**Note**: If you're unsure how a feature is used, or are encountering some unexpected behavior that you aren't sure
-is a bug, it's best to talk it out on
-[StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) before reporting it. This
-keeps development streamlined, and helps us focus on building great software.
-
-
-Issues only! |
--------------|
-Please keep in mind that the issue tracker is for *issues*. Please do *not* post an issue if you need help or support. Instead, see one of the above-mentioned forums or [IRC](irc://irc.freenode.net/#angularjs). |
-
-####Purple Labels
-A purple label means that **you** need to take some further action.  
- - ![Not Actionable - Need Info](http://angular-ui.github.io/ui-router/images/notactionable.png): Your issue is not specific enough, or there is no clear action that we can take. Please clarify and refine your issue.
- - ![Plunkr Please](http://angular-ui.github.io/ui-router/images/plunkrplease.png): Please [create a plunkr](http://bit.ly/UIR-Plunk)
- - ![StackOverflow](http://angular-ui.github.io/ui-router/images/stackoverflow.png): We suspect your issue is really a help request, or could be answered by the community.  Please ask your question on [StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router).  If you determine that is an actual issue, please explain why.
- 
-If your issue gets labeled with purple label, no further action will be taken until you respond to the label appropriately.
-
-# Contribute
-
-**(1)** See the **[Developing](#developing)** section below, to get the development version of UI-Router up and running on your local machine.
-
-**(2)** Check out the [roadmap](https://github.com/angular-ui/ui-router/milestones) to see where the project is headed, and if your feature idea fits with where we're headed.
-
-**(3)** If you're not sure, [open an RFC](https://github.com/angular-ui/ui-router/issues/new?title=RFC:%20My%20idea) to get some feedback on your idea.
-
-**(4)** Finally, commit some code and open a pull request. Code & commits should abide by the following rules:
-
-- *Always* have test coverage for new features (or regression tests for bug fixes), and *never* break existing tests
-- Commits should represent one logical change each; if a feature goes through multiple iterations, squash your commits down to one
-- Make sure to follow the [Angular commit message format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) so your change will appear in the changelog of the next release.
-- Changes should always respect the coding style of the project
-
-
-
-# Developing
-
-UI-Router uses <code>grunt >= 0.4.x</code>. Make sure to upgrade your environment and read the
-[Migration Guide](http://gruntjs.com/upgrading-from-0.3-to-0.4).
-
-Dependencies for building from source and running tests:
-
-* [grunt-cli](https://github.com/gruntjs/grunt-cli) - run: `$ npm install -g grunt-cli`
-* Then, install the development dependencies by running `$ npm install` from the project directory
-
-There are a number of targets in the gruntfile that are used to generating different builds:
-
-* `grunt`: Perform a normal build, runs jshint and karma tests
-* `grunt build`: Perform a normal build
-* `grunt dist`: Perform a clean build and generate documentation
-* `grunt dev`: Run dev server (sample app) and watch for changes, builds and runs karma tests on changes.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/LICENSE b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/LICENSE
deleted file mode 100644
index 6413b09..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License
-
-Copyright (c) 2013-2015 The AngularUI Team, Karsten Sperling
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/README.md b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/README.md
deleted file mode 100644
index 1d8bcd6..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/README.md
+++ /dev/null
@@ -1,245 +0,0 @@
-# AngularUI Router &nbsp;[![Build Status](https://travis-ci.org/angular-ui/ui-router.svg?branch=master)](https://travis-ci.org/angular-ui/ui-router)
-
-#### The de-facto solution to flexible routing with nested views
----
-**[Download 0.2.15](http://angular-ui.github.io/ui-router/release/angular-ui-router.js)** (or **[Minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)**) **|**
-**[Guide](https://github.com/angular-ui/ui-router/wiki) |**
-**[API](http://angular-ui.github.io/ui-router/site) |**
-**[Sample](http://angular-ui.github.com/ui-router/sample/) ([Src](https://github.com/angular-ui/ui-router/tree/gh-pages/sample)) |**
-**[FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) |**
-**[Resources](#resources) |**
-**[Report an Issue](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#report-an-issue) |**
-**[Contribute](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#contribute) |**
-**[Help!](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) |**
-**[Discuss](https://groups.google.com/forum/#!categories/angular-ui/router)**
-
----
-
-AngularUI Router is a routing framework for [AngularJS](http://angularjs.org), which allows you to organize the
-parts of your interface into a [*state machine*](https://en.wikipedia.org/wiki/Finite-state_machine). Unlike the
-[`$route` service](http://docs.angularjs.org/api/ngRoute.$route) in the Angular ngRoute module, which is organized around URL
-routes, UI-Router is organized around [*states*](https://github.com/angular-ui/ui-router/wiki),
-which may optionally have routes, as well as other behavior, attached.
-
-States are bound to *named*, *nested* and *parallel views*, allowing you to powerfully manage your application's interface.
-
-Check out the sample app: http://angular-ui.github.io/ui-router/sample/
-
--
-**Note:** *UI-Router is under active development. As such, while this library is well-tested, the API may change. Consider using it in production applications only if you're comfortable following a changelog and updating your usage accordingly.*
-
-
-## Get Started
-
-**(1)** Get UI-Router in one of the following ways:
- - clone & [build](CONTRIBUTING.md#developing) this repository
- - [download the release](http://angular-ui.github.io/ui-router/release/angular-ui-router.js) (or [minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js))
- - [link to cdn](http://cdnjs.com/libraries/angular-ui-router)
- - via **[jspm](http://jspm.io/)**: by running `$ jspm install angular-ui-router` from your console
- - or via **[npm](https://www.npmjs.org/)**: by running `$ npm install angular-ui-router` from your console
- - or via **[Bower](http://bower.io/)**: by running `$ bower install angular-ui-router` from your console
- - or via **[Component](https://github.com/component/component)**: by running `$ component install angular-ui/ui-router` from your console
-
-**(2)** Include `angular-ui-router.js` (or `angular-ui-router.min.js`) in your `index.html`, after including Angular itself (For Component users: ignore this step)
-
-**(3)** Add `'ui.router'` to your main module's list of dependencies (For Component users: replace `'ui.router'` with `require('angular-ui-router')`)
-
-When you're done, your setup should look similar to the following:
-
->
-```html
-<!doctype html>
-<html ng-app="myApp">
-<head>
-    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
-    <script src="js/angular-ui-router.min.js"></script>
-    <script>
-        var myApp = angular.module('myApp', ['ui.router']);
-        // For Component users, it should look like this:
-        // var myApp = angular.module('myApp', [require('angular-ui-router')]);
-    </script>
-    ...
-</head>
-<body>
-    ...
-</body>
-</html>
-```
-
-### [Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview)
-
-The majority of UI-Router's power is in its ability to nest states & views.
-
-**(1)** First, follow the [setup](#get-started) instructions detailed above.
-
-**(2)** Then, add a [`ui-view` directive](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-view) to the `<body />` of your app.
-
->
-```html
-<!-- index.html -->
-<body>
-    <div ui-view></div>
-    <!-- We'll also add some navigation: -->
-    <a ui-sref="state1">State 1</a>
-    <a ui-sref="state2">State 2</a>
-</body>
-```
-
-**(3)** You'll notice we also added some links with [`ui-sref` directives](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-sref). In addition to managing state transitions, this directive auto-generates the `href` attribute of the `<a />` element it's attached to, if the corresponding state has a URL. Next we'll add some templates. These will plug into the `ui-view` within `index.html`. Notice that they have their own `ui-view` as well! That is the key to nesting states and views.
-
->
-```html
-<!-- partials/state1.html -->
-<h1>State 1</h1>
-<hr/>
-<a ui-sref="state1.list">Show List</a>
-<div ui-view></div>
-```
-```html
-<!-- partials/state2.html -->
-<h1>State 2</h1>
-<hr/>
-<a ui-sref="state2.list">Show List</a>
-<div ui-view></div>
-```
-
-**(4)** Next, we'll add some child templates. *These* will get plugged into the `ui-view` of their parent state templates.
-
->
-```html
-<!-- partials/state1.list.html -->
-<h3>List of State 1 Items</h3>
-<ul>
-  <li ng-repeat="item in items">{{ item }}</li>
-</ul>
-```
-
->
-```html
-<!-- partials/state2.list.html -->
-<h3>List of State 2 Things</h3>
-<ul>
-  <li ng-repeat="thing in things">{{ thing }}</li>
-</ul>
-```
-
-**(5)** Finally, we'll wire it all up with `$stateProvider`. Set up your states in the module config, as in the following:
-
-
->
-```javascript
-myApp.config(function($stateProvider, $urlRouterProvider) {
-  //
-  // For any unmatched url, redirect to /state1
-  $urlRouterProvider.otherwise("/state1");
-  //
-  // Now set up the states
-  $stateProvider
-    .state('state1', {
-      url: "/state1",
-      templateUrl: "partials/state1.html"
-    })
-    .state('state1.list', {
-      url: "/list",
-      templateUrl: "partials/state1.list.html",
-      controller: function($scope) {
-        $scope.items = ["A", "List", "Of", "Items"];
-      }
-    })
-    .state('state2', {
-      url: "/state2",
-      templateUrl: "partials/state2.html"
-    })
-    .state('state2.list', {
-      url: "/list",
-      templateUrl: "partials/state2.list.html",
-      controller: function($scope) {
-        $scope.things = ["A", "Set", "Of", "Things"];
-      }
-    });
-});
-```
-
-**(6)** See this quick start example in action.
->**[Go to Quick Start Plunker for Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview)**
-
-**(7)** This only scratches the surface
->**[Dive Deeper!](https://github.com/angular-ui/ui-router/wiki)**
-
-
-### [Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview)
-
-Another great feature is the ability to have multiple `ui-view`s view per template.
-
-**Pro Tip:** *While multiple parallel views are a powerful feature, you'll often be able to manage your
-interfaces more effectively by nesting your views, and pairing those views with nested states.*
-
-**(1)** Follow the [setup](#get-started) instructions detailed above.
-
-**(2)** Add one or more `ui-view` to your app, give them names.
->
-```html
-<!-- index.html -->
-<body>
-    <div ui-view="viewA"></div>
-    <div ui-view="viewB"></div>
-    <!-- Also a way to navigate -->
-    <a ui-sref="route1">Route 1</a>
-    <a ui-sref="route2">Route 2</a>
-</body>
-```
-
-**(3)** Set up your states in the module config:
->
-```javascript
-myApp.config(function($stateProvider) {
-  $stateProvider
-    .state('index', {
-      url: "",
-      views: {
-        "viewA": { template: "index.viewA" },
-        "viewB": { template: "index.viewB" }
-      }
-    })
-    .state('route1', {
-      url: "/route1",
-      views: {
-        "viewA": { template: "route1.viewA" },
-        "viewB": { template: "route1.viewB" }
-      }
-    })
-    .state('route2', {
-      url: "/route2",
-      views: {
-        "viewA": { template: "route2.viewA" },
-        "viewB": { template: "route2.viewB" }
-      }
-    })
-});
-```
-
-**(4)** See this quick start example in action.
->**[Go to Quick Start Plunker for Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview)**
-
-
-## Resources
-
-* [In-Depth Guide](https://github.com/angular-ui/ui-router/wiki)
-* [API Reference](http://angular-ui.github.io/ui-router/site)
-* [Sample App](http://angular-ui.github.com/ui-router/sample/) ([Source](https://github.com/angular-ui/ui-router/tree/gh-pages/sample))
-* [FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions)
-* [Slides comparing ngRoute to ui-router](http://slid.es/timkindberg/ui-router#/)
-* [UI-Router Extras / Addons](http://christopherthielen.github.io/ui-router-extras/#/home) (@christopherthielen)
- 
-### Videos
-
-* [Introduction Video](https://egghead.io/lessons/angularjs-introduction-ui-router) (egghead.io)
-* [Tim Kindberg on Angular UI-Router](https://www.youtube.com/watch?v=lBqiZSemrqg)
-* [Activating States](https://egghead.io/lessons/angularjs-ui-router-activating-states) (egghead.io)
-* [Learn Angular.js using UI-Router](http://youtu.be/QETUuZ27N0w) (LearnCode.academy)
-
-
-
-## Reporting issues and Contributing
-
-Please read our [Contributor guidelines](CONTRIBUTING.md) before reporting an issue or creating a pull request.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/api/angular-ui-router.d.ts b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/api/angular-ui-router.d.ts
deleted file mode 100644
index 55c5d5e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/api/angular-ui-router.d.ts
+++ /dev/null
@@ -1,126 +0,0 @@
-// Type definitions for Angular JS 1.1.5+ (ui.router module)
-// Project: https://github.com/angular-ui/ui-router
-// Definitions by: Michel Salib <https://github.com/michelsalib>
-// Definitions: https://github.com/borisyankov/DefinitelyTyped
-
-declare module ng.ui {
-
-    interface IState {
-        name?: string;
-        template?: string;
-        templateUrl?: any; // string || () => string
-        templateProvider?: any; // () => string || IPromise<string>
-        controller?: any;
-        controllerAs?: string;    
-        controllerProvider?: any;
-        resolve?: {};
-        url?: string;
-        params?: any;
-        views?: {};
-        abstract?: boolean;
-        onEnter?: (...args: any[]) => void;
-        onExit?: (...args: any[]) => void;
-        data?: any;
-        reloadOnSearch?: boolean;
-    }
-
-    interface ITypedState<T> extends IState {
-        data?: T;
-    }
-
-    interface IStateProvider extends IServiceProvider {
-        state(name: string, config: IState): IStateProvider;
-        state(config: IState): IStateProvider;
-        decorator(name?: string, decorator?: (state: IState, parent: Function) => any): any;
-    }
-
-    interface IUrlMatcher {
-        concat(pattern: string): IUrlMatcher;
-        exec(path: string, searchParams: {}): {};
-        parameters(): string[];
-        format(values: {}): string;
-    }
-
-    interface IUrlMatcherFactory {
-        compile(pattern: string): IUrlMatcher;
-        isMatcher(o: any): boolean;
-    }
-
-    interface IUrlRouterProvider extends IServiceProvider {
-        when(whenPath: RegExp, handler: Function): IUrlRouterProvider;
-        when(whenPath: RegExp, handler: any[]): IUrlRouterProvider;
-        when(whenPath: RegExp, toPath: string): IUrlRouterProvider;
-        when(whenPath: IUrlMatcher, hanlder: Function): IUrlRouterProvider;
-        when(whenPath: IUrlMatcher, handler: any[]): IUrlRouterProvider;
-        when(whenPath: IUrlMatcher, toPath: string): IUrlRouterProvider;
-        when(whenPath: string, handler: Function): IUrlRouterProvider;
-        when(whenPath: string, handler: any[]): IUrlRouterProvider;
-        when(whenPath: string, toPath: string): IUrlRouterProvider;
-        otherwise(handler: Function): IUrlRouterProvider;
-        otherwise(handler: any[]): IUrlRouterProvider;
-        otherwise(path: string): IUrlRouterProvider;
-        rule(handler: Function): IUrlRouterProvider;
-        rule(handler: any[]): IUrlRouterProvider;
-    }
-
-    interface IStateOptions {
-        location?: any;
-        inherit?: boolean;
-        relative?: IState;
-        notify?: boolean;
-        reload?: boolean;
-    }
-
-    interface IHrefOptions {
-        lossy?: boolean;
-        inherit?: boolean;
-        relative?: IState;
-        absolute?: boolean;
-    }
-
-    interface IStateService {
-        go(to: string, params?: {}, options?: IStateOptions): IPromise<any>;
-        transitionTo(state: string, params?: {}, updateLocation?: boolean): void;
-        transitionTo(state: string, params?: {}, options?: IStateOptions): void;
-        includes(state: string, params?: {}): boolean;
-        is(state:string, params?: {}): boolean;
-        is(state: IState, params?: {}): boolean;
-        href(state: IState, params?: {}, options?: IHrefOptions): string;
-        href(state: string, params?: {}, options?: IHrefOptions): string;
-        get(state: string): IState;
-        get(): IState[];
-        current: IState;
-        params: any;
-        reload(): void;
-    }
-
-    interface IStateParamsService {
-        [key: string]: any;
-    }
-
-    interface IStateParams {
-        [key: string]: any;
-    }
-
-    interface IUrlRouterService {
-        /*
-         * Triggers an update; the same update that happens when the address bar
-         * url changes, aka $locationChangeSuccess.
-         *
-         * This method is useful when you need to use preventDefault() on the
-         * $locationChangeSuccess event, perform some custom logic (route protection,
-         * auth, config, redirection, etc) and then finally proceed with the transition
-         * by calling $urlRouter.sync().
-         *
-         */
-        sync(): void;
-    }
-
-    interface IUiViewScrollProvider {
-        /*
-         * Reverts back to using the core $anchorScroll service for scrolling 
-         * based on the url anchor.
-         */
-        useAnchorScroll(): void;
-    }
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/bower.json
deleted file mode 100644
index f4f08fa..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/bower.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
-  "name": "angular-ui-router",
-  "version": "0.2.15",
-  "main": "./release/angular-ui-router.js",
-  "dependencies": {
-    "angular": ">= 1.0.8"
-  },
-  "ignore": [
-    "**/.*",
-    "node_modules",
-    "bower_components",
-    "component.json",
-    "package.json",
-    "lib",
-    "config",
-    "sample",
-    "test",
-    "tests",
-    "ngdoc_assets",
-    "Gruntfile.js",
-    "files.js"
-  ]
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/release/angular-ui-router.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/release/angular-ui-router.js
deleted file mode 100644
index 57c62cc..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/release/angular-ui-router.js
+++ /dev/null
@@ -1,4370 +0,0 @@
-/**
- * State-based routing for AngularJS
- * @version v0.2.15
- * @link http://angular-ui.github.com/
- * @license MIT License, http://www.opensource.org/licenses/MIT
- */
-
-/* commonjs package manager support (eg componentjs) */
-if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){
-  module.exports = 'ui.router';
-}
-
-(function (window, angular, undefined) {
-/*jshint globalstrict:true*/
-/*global angular:false*/
-'use strict';
-
-var isDefined = angular.isDefined,
-    isFunction = angular.isFunction,
-    isString = angular.isString,
-    isObject = angular.isObject,
-    isArray = angular.isArray,
-    forEach = angular.forEach,
-    extend = angular.extend,
-    copy = angular.copy;
-
-function inherit(parent, extra) {
-  return extend(new (extend(function() {}, { prototype: parent }))(), extra);
-}
-
-function merge(dst) {
-  forEach(arguments, function(obj) {
-    if (obj !== dst) {
-      forEach(obj, function(value, key) {
-        if (!dst.hasOwnProperty(key)) dst[key] = value;
-      });
-    }
-  });
-  return dst;
-}
-
-/**
- * Finds the common ancestor path between two states.
- *
- * @param {Object} first The first state.
- * @param {Object} second The second state.
- * @return {Array} Returns an array of state names in descending order, not including the root.
- */
-function ancestors(first, second) {
-  var path = [];
-
-  for (var n in first.path) {
-    if (first.path[n] !== second.path[n]) break;
-    path.push(first.path[n]);
-  }
-  return path;
-}
-
-/**
- * IE8-safe wrapper for `Object.keys()`.
- *
- * @param {Object} object A JavaScript object.
- * @return {Array} Returns the keys of the object as an array.
- */
-function objectKeys(object) {
-  if (Object.keys) {
-    return Object.keys(object);
-  }
-  var result = [];
-
-  forEach(object, function(val, key) {
-    result.push(key);
-  });
-  return result;
-}
-
-/**
- * IE8-safe wrapper for `Array.prototype.indexOf()`.
- *
- * @param {Array} array A JavaScript array.
- * @param {*} value A value to search the array for.
- * @return {Number} Returns the array index value of `value`, or `-1` if not present.
- */
-function indexOf(array, value) {
-  if (Array.prototype.indexOf) {
-    return array.indexOf(value, Number(arguments[2]) || 0);
-  }
-  var len = array.length >>> 0, from = Number(arguments[2]) || 0;
-  from = (from < 0) ? Math.ceil(from) : Math.floor(from);
-
-  if (from < 0) from += len;
-
-  for (; from < len; from++) {
-    if (from in array && array[from] === value) return from;
-  }
-  return -1;
-}
-
-/**
- * Merges a set of parameters with all parameters inherited between the common parents of the
- * current state and a given destination state.
- *
- * @param {Object} currentParams The value of the current state parameters ($stateParams).
- * @param {Object} newParams The set of parameters which will be composited with inherited params.
- * @param {Object} $current Internal definition of object representing the current state.
- * @param {Object} $to Internal definition of object representing state to transition to.
- */
-function inheritParams(currentParams, newParams, $current, $to) {
-  var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];
-
-  for (var i in parents) {
-    if (!parents[i].params) continue;
-    parentParams = objectKeys(parents[i].params);
-    if (!parentParams.length) continue;
-
-    for (var j in parentParams) {
-      if (indexOf(inheritList, parentParams[j]) >= 0) continue;
-      inheritList.push(parentParams[j]);
-      inherited[parentParams[j]] = currentParams[parentParams[j]];
-    }
-  }
-  return extend({}, inherited, newParams);
-}
-
-/**
- * Performs a non-strict comparison of the subset of two objects, defined by a list of keys.
- *
- * @param {Object} a The first object.
- * @param {Object} b The second object.
- * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified,
- *                     it defaults to the list of keys in `a`.
- * @return {Boolean} Returns `true` if the keys match, otherwise `false`.
- */
-function equalForKeys(a, b, keys) {
-  if (!keys) {
-    keys = [];
-    for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility
-  }
-
-  for (var i=0; i<keys.length; i++) {
-    var k = keys[i];
-    if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized
-  }
-  return true;
-}
-
-/**
- * Returns the subset of an object, based on a list of keys.
- *
- * @param {Array} keys
- * @param {Object} values
- * @return {Boolean} Returns a subset of `values`.
- */
-function filterByKeys(keys, values) {
-  var filtered = {};
-
-  forEach(keys, function (name) {
-    filtered[name] = values[name];
-  });
-  return filtered;
-}
-
-// like _.indexBy
-// when you know that your index values will be unique, or you want last-one-in to win
-function indexBy(array, propName) {
-  var result = {};
-  forEach(array, function(item) {
-    result[item[propName]] = item;
-  });
-  return result;
-}
-
-// extracted from underscore.js
-// Return a copy of the object only containing the whitelisted properties.
-function pick(obj) {
-  var copy = {};
-  var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));
-  forEach(keys, function(key) {
-    if (key in obj) copy[key] = obj[key];
-  });
-  return copy;
-}
-
-// extracted from underscore.js
-// Return a copy of the object omitting the blacklisted properties.
-function omit(obj) {
-  var copy = {};
-  var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));
-  for (var key in obj) {
-    if (indexOf(keys, key) == -1) copy[key] = obj[key];
-  }
-  return copy;
-}
-
-function pluck(collection, key) {
-  var result = isArray(collection) ? [] : {};
-
-  forEach(collection, function(val, i) {
-    result[i] = isFunction(key) ? key(val) : val[key];
-  });
-  return result;
-}
-
-function filter(collection, callback) {
-  var array = isArray(collection);
-  var result = array ? [] : {};
-  forEach(collection, function(val, i) {
-    if (callback(val, i)) {
-      result[array ? result.length : i] = val;
-    }
-  });
-  return result;
-}
-
-function map(collection, callback) {
-  var result = isArray(collection) ? [] : {};
-
-  forEach(collection, function(val, i) {
-    result[i] = callback(val, i);
-  });
-  return result;
-}
-
-/**
- * @ngdoc overview
- * @name ui.router.util
- *
- * @description
- * # ui.router.util sub-module
- *
- * This module is a dependency of other sub-modules. Do not include this module as a dependency
- * in your angular app (use {@link ui.router} module instead).
- *
- */
-angular.module('ui.router.util', ['ng']);
-
-/**
- * @ngdoc overview
- * @name ui.router.router
- * 
- * @requires ui.router.util
- *
- * @description
- * # ui.router.router sub-module
- *
- * This module is a dependency of other sub-modules. Do not include this module as a dependency
- * in your angular app (use {@link ui.router} module instead).
- */
-angular.module('ui.router.router', ['ui.router.util']);
-
-/**
- * @ngdoc overview
- * @name ui.router.state
- * 
- * @requires ui.router.router
- * @requires ui.router.util
- *
- * @description
- * # ui.router.state sub-module
- *
- * This module is a dependency of the main ui.router module. Do not include this module as a dependency
- * in your angular app (use {@link ui.router} module instead).
- * 
- */
-angular.module('ui.router.state', ['ui.router.router', 'ui.router.util']);
-
-/**
- * @ngdoc overview
- * @name ui.router
- *
- * @requires ui.router.state
- *
- * @description
- * # ui.router
- * 
- * ## The main module for ui.router 
- * There are several sub-modules included with the ui.router module, however only this module is needed
- * as a dependency within your angular app. The other modules are for organization purposes. 
- *
- * The modules are:
- * * ui.router - the main "umbrella" module
- * * ui.router.router - 
- * 
- * *You'll need to include **only** this module as the dependency within your angular app.*
- * 
- * <pre>
- * <!doctype html>
- * <html ng-app="myApp">
- * <head>
- *   <script src="js/angular.js"></script>
- *   <!-- Include the ui-router script -->
- *   <script src="js/angular-ui-router.min.js"></script>
- *   <script>
- *     // ...and add 'ui.router' as a dependency
- *     var myApp = angular.module('myApp', ['ui.router']);
- *   </script>
- * </head>
- * <body>
- * </body>
- * </html>
- * </pre>
- */
-angular.module('ui.router', ['ui.router.state']);
-
-angular.module('ui.router.compat', ['ui.router']);
-
-/**
- * @ngdoc object
- * @name ui.router.util.$resolve
- *
- * @requires $q
- * @requires $injector
- *
- * @description
- * Manages resolution of (acyclic) graphs of promises.
- */
-$Resolve.$inject = ['$q', '$injector'];
-function $Resolve(  $q,    $injector) {
-  
-  var VISIT_IN_PROGRESS = 1,
-      VISIT_DONE = 2,
-      NOTHING = {},
-      NO_DEPENDENCIES = [],
-      NO_LOCALS = NOTHING,
-      NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING });
-  
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$resolve#study
-   * @methodOf ui.router.util.$resolve
-   *
-   * @description
-   * Studies a set of invocables that are likely to be used multiple times.
-   * <pre>
-   * $resolve.study(invocables)(locals, parent, self)
-   * </pre>
-   * is equivalent to
-   * <pre>
-   * $resolve.resolve(invocables, locals, parent, self)
-   * </pre>
-   * but the former is more efficient (in fact `resolve` just calls `study` 
-   * internally).
-   *
-   * @param {object} invocables Invocable objects
-   * @return {function} a function to pass in locals, parent and self
-   */
-  this.study = function (invocables) {
-    if (!isObject(invocables)) throw new Error("'invocables' must be an object");
-    var invocableKeys = objectKeys(invocables || {});
-    
-    // Perform a topological sort of invocables to build an ordered plan
-    var plan = [], cycle = [], visited = {};
-    function visit(value, key) {
-      if (visited[key] === VISIT_DONE) return;
-      
-      cycle.push(key);
-      if (visited[key] === VISIT_IN_PROGRESS) {
-        cycle.splice(0, indexOf(cycle, key));
-        throw new Error("Cyclic dependency: " + cycle.join(" -> "));
-      }
-      visited[key] = VISIT_IN_PROGRESS;
-      
-      if (isString(value)) {
-        plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES);
-      } else {
-        var params = $injector.annotate(value);
-        forEach(params, function (param) {
-          if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param);
-        });
-        plan.push(key, value, params);
-      }
-      
-      cycle.pop();
-      visited[key] = VISIT_DONE;
-    }
-    forEach(invocables, visit);
-    invocables = cycle = visited = null; // plan is all that's required
-    
-    function isResolve(value) {
-      return isObject(value) && value.then && value.$$promises;
-    }
-    
-    return function (locals, parent, self) {
-      if (isResolve(locals) && self === undefined) {
-        self = parent; parent = locals; locals = null;
-      }
-      if (!locals) locals = NO_LOCALS;
-      else if (!isObject(locals)) {
-        throw new Error("'locals' must be an object");
-      }       
-      if (!parent) parent = NO_PARENT;
-      else if (!isResolve(parent)) {
-        throw new Error("'parent' must be a promise returned by $resolve.resolve()");
-      }
-      
-      // To complete the overall resolution, we have to wait for the parent
-      // promise and for the promise for each invokable in our plan.
-      var resolution = $q.defer(),
-          result = resolution.promise,
-          promises = result.$$promises = {},
-          values = extend({}, locals),
-          wait = 1 + plan.length/3,
-          merged = false;
-          
-      function done() {
-        // Merge parent values we haven't got yet and publish our own $$values
-        if (!--wait) {
-          if (!merged) merge(values, parent.$$values); 
-          result.$$values = values;
-          result.$$promises = result.$$promises || true; // keep for isResolve()
-          delete result.$$inheritedValues;
-          resolution.resolve(values);
-        }
-      }
-      
-      function fail(reason) {
-        result.$$failure = reason;
-        resolution.reject(reason);
-      }
-
-      // Short-circuit if parent has already failed
-      if (isDefined(parent.$$failure)) {
-        fail(parent.$$failure);
-        return result;
-      }
-      
-      if (parent.$$inheritedValues) {
-        merge(values, omit(parent.$$inheritedValues, invocableKeys));
-      }
-
-      // Merge parent values if the parent has already resolved, or merge
-      // parent promises and wait if the parent resolve is still in progress.
-      extend(promises, parent.$$promises);
-      if (parent.$$values) {
-        merged = merge(values, omit(parent.$$values, invocableKeys));
-        result.$$inheritedValues = omit(parent.$$values, invocableKeys);
-        done();
-      } else {
-        if (parent.$$inheritedValues) {
-          result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys);
-        }        
-        parent.then(done, fail);
-      }
-      
-      // Process each invocable in the plan, but ignore any where a local of the same name exists.
-      for (var i=0, ii=plan.length; i<ii; i+=3) {
-        if (locals.hasOwnProperty(plan[i])) done();
-        else invoke(plan[i], plan[i+1], plan[i+2]);
-      }
-      
-      function invoke(key, invocable, params) {
-        // Create a deferred for this invocation. Failures will propagate to the resolution as well.
-        var invocation = $q.defer(), waitParams = 0;
-        function onfailure(reason) {
-          invocation.reject(reason);
-          fail(reason);
-        }
-        // Wait for any parameter that we have a promise for (either from parent or from this
-        // resolve; in that case study() will have made sure it's ordered before us in the plan).
-        forEach(params, function (dep) {
-          if (promises.hasOwnProperty(dep) && !locals.hasOwnProperty(dep)) {
-            waitParams++;
-            promises[dep].then(function (result) {
-              values[dep] = result;
-              if (!(--waitParams)) proceed();
-            }, onfailure);
-          }
-        });
-        if (!waitParams) proceed();
-        function proceed() {
-          if (isDefined(result.$$failure)) return;
-          try {
-            invocation.resolve($injector.invoke(invocable, self, values));
-            invocation.promise.then(function (result) {
-              values[key] = result;
-              done();
-            }, onfailure);
-          } catch (e) {
-            onfailure(e);
-          }
-        }
-        // Publish promise synchronously; invocations further down in the plan may depend on it.
-        promises[key] = invocation.promise;
-      }
-      
-      return result;
-    };
-  };
-  
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$resolve#resolve
-   * @methodOf ui.router.util.$resolve
-   *
-   * @description
-   * Resolves a set of invocables. An invocable is a function to be invoked via 
-   * `$injector.invoke()`, and can have an arbitrary number of dependencies. 
-   * An invocable can either return a value directly,
-   * or a `$q` promise. If a promise is returned it will be resolved and the 
-   * resulting value will be used instead. Dependencies of invocables are resolved 
-   * (in this order of precedence)
-   *
-   * - from the specified `locals`
-   * - from another invocable that is part of this `$resolve` call
-   * - from an invocable that is inherited from a `parent` call to `$resolve` 
-   *   (or recursively
-   * - from any ancestor `$resolve` of that parent).
-   *
-   * The return value of `$resolve` is a promise for an object that contains 
-   * (in this order of precedence)
-   *
-   * - any `locals` (if specified)
-   * - the resolved return values of all injectables
-   * - any values inherited from a `parent` call to `$resolve` (if specified)
-   *
-   * The promise will resolve after the `parent` promise (if any) and all promises 
-   * returned by injectables have been resolved. If any invocable 
-   * (or `$injector.invoke`) throws an exception, or if a promise returned by an 
-   * invocable is rejected, the `$resolve` promise is immediately rejected with the 
-   * same error. A rejection of a `parent` promise (if specified) will likewise be 
-   * propagated immediately. Once the `$resolve` promise has been rejected, no 
-   * further invocables will be called.
-   * 
-   * Cyclic dependencies between invocables are not permitted and will caues `$resolve`
-   * to throw an error. As a special case, an injectable can depend on a parameter 
-   * with the same name as the injectable, which will be fulfilled from the `parent` 
-   * injectable of the same name. This allows inherited values to be decorated. 
-   * Note that in this case any other injectable in the same `$resolve` with the same
-   * dependency would see the decorated value, not the inherited value.
-   *
-   * Note that missing dependencies -- unlike cyclic dependencies -- will cause an 
-   * (asynchronous) rejection of the `$resolve` promise rather than a (synchronous) 
-   * exception.
-   *
-   * Invocables are invoked eagerly as soon as all dependencies are available. 
-   * This is true even for dependencies inherited from a `parent` call to `$resolve`.
-   *
-   * As a special case, an invocable can be a string, in which case it is taken to 
-   * be a service name to be passed to `$injector.get()`. This is supported primarily 
-   * for backwards-compatibility with the `resolve` property of `$routeProvider` 
-   * routes.
-   *
-   * @param {object} invocables functions to invoke or 
-   * `$injector` services to fetch.
-   * @param {object} locals  values to make available to the injectables
-   * @param {object} parent  a promise returned by another call to `$resolve`.
-   * @param {object} self  the `this` for the invoked methods
-   * @return {object} Promise for an object that contains the resolved return value
-   * of all invocables, as well as any inherited and local values.
-   */
-  this.resolve = function (invocables, locals, parent, self) {
-    return this.study(invocables)(locals, parent, self);
-  };
-}
-
-angular.module('ui.router.util').service('$resolve', $Resolve);
-
-
-/**
- * @ngdoc object
- * @name ui.router.util.$templateFactory
- *
- * @requires $http
- * @requires $templateCache
- * @requires $injector
- *
- * @description
- * Service. Manages loading of templates.
- */
-$TemplateFactory.$inject = ['$http', '$templateCache', '$injector'];
-function $TemplateFactory(  $http,   $templateCache,   $injector) {
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$templateFactory#fromConfig
-   * @methodOf ui.router.util.$templateFactory
-   *
-   * @description
-   * Creates a template from a configuration object. 
-   *
-   * @param {object} config Configuration object for which to load a template. 
-   * The following properties are search in the specified order, and the first one 
-   * that is defined is used to create the template:
-   *
-   * @param {string|object} config.template html string template or function to 
-   * load via {@link ui.router.util.$templateFactory#fromString fromString}.
-   * @param {string|object} config.templateUrl url to load or a function returning 
-   * the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}.
-   * @param {Function} config.templateProvider function to invoke via 
-   * {@link ui.router.util.$templateFactory#fromProvider fromProvider}.
-   * @param {object} params  Parameters to pass to the template function.
-   * @param {object} locals Locals to pass to `invoke` if the template is loaded 
-   * via a `templateProvider`. Defaults to `{ params: params }`.
-   *
-   * @return {string|object}  The template html as a string, or a promise for 
-   * that string,or `null` if no template is configured.
-   */
-  this.fromConfig = function (config, params, locals) {
-    return (
-      isDefined(config.template) ? this.fromString(config.template, params) :
-      isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) :
-      isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) :
-      null
-    );
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$templateFactory#fromString
-   * @methodOf ui.router.util.$templateFactory
-   *
-   * @description
-   * Creates a template from a string or a function returning a string.
-   *
-   * @param {string|object} template html template as a string or function that 
-   * returns an html template as a string.
-   * @param {object} params Parameters to pass to the template function.
-   *
-   * @return {string|object} The template html as a string, or a promise for that 
-   * string.
-   */
-  this.fromString = function (template, params) {
-    return isFunction(template) ? template(params) : template;
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$templateFactory#fromUrl
-   * @methodOf ui.router.util.$templateFactory
-   * 
-   * @description
-   * Loads a template from the a URL via `$http` and `$templateCache`.
-   *
-   * @param {string|Function} url url of the template to load, or a function 
-   * that returns a url.
-   * @param {Object} params Parameters to pass to the url function.
-   * @return {string|Promise.<string>} The template html as a string, or a promise 
-   * for that string.
-   */
-  this.fromUrl = function (url, params) {
-    if (isFunction(url)) url = url(params);
-    if (url == null) return null;
-    else return $http
-        .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }})
-        .then(function(response) { return response.data; });
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$templateFactory#fromProvider
-   * @methodOf ui.router.util.$templateFactory
-   *
-   * @description
-   * Creates a template by invoking an injectable provider function.
-   *
-   * @param {Function} provider Function to invoke via `$injector.invoke`
-   * @param {Object} params Parameters for the template.
-   * @param {Object} locals Locals to pass to `invoke`. Defaults to 
-   * `{ params: params }`.
-   * @return {string|Promise.<string>} The template html as a string, or a promise 
-   * for that string.
-   */
-  this.fromProvider = function (provider, params, locals) {
-    return $injector.invoke(provider, null, locals || { params: params });
-  };
-}
-
-angular.module('ui.router.util').service('$templateFactory', $TemplateFactory);
-
-var $$UMFP; // reference to $UrlMatcherFactoryProvider
-
-/**
- * @ngdoc object
- * @name ui.router.util.type:UrlMatcher
- *
- * @description
- * Matches URLs against patterns and extracts named parameters from the path or the search
- * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list
- * of search parameters. Multiple search parameter names are separated by '&'. Search parameters
- * do not influence whether or not a URL is matched, but their values are passed through into
- * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}.
- *
- * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace
- * syntax, which optionally allows a regular expression for the parameter to be specified:
- *
- * * `':'` name - colon placeholder
- * * `'*'` name - catch-all placeholder
- * * `'{' name '}'` - curly placeholder
- * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the
- *   regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.
- *
- * Parameter names may contain only word characters (latin letters, digits, and underscore) and
- * must be unique within the pattern (across both path and search parameters). For colon
- * placeholders or curly placeholders without an explicit regexp, a path parameter matches any
- * number of characters other than '/'. For catch-all placeholders the path parameter matches
- * any number of characters.
- *
- * Examples:
- *
- * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for
- *   trailing slashes, and patterns have to match the entire path, not just a prefix.
- * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or
- *   '/user/bob/details'. The second path segment will be captured as the parameter 'id'.
- * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.
- * * `'/user/{id:[^/]*}'` - Same as the previous example.
- * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id
- *   parameter consists of 1 to 8 hex digits.
- * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the
- *   path into the parameter 'path'.
- * * `'/files/*path'` - ditto.
- * * `'/calendar/{start:date}'` - Matches "/calendar/2014-11-12" (because the pattern defined
- *   in the built-in  `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start
- *
- * @param {string} pattern  The pattern to compile into a matcher.
- * @param {Object} config  A configuration object hash:
- * @param {Object=} parentMatcher Used to concatenate the pattern/config onto
- *   an existing UrlMatcher
- *
- * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`.
- * * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`.
- *
- * @property {string} prefix  A static prefix of this pattern. The matcher guarantees that any
- *   URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns
- *   non-null) will start with this prefix.
- *
- * @property {string} source  The pattern that was passed into the constructor
- *
- * @property {string} sourcePath  The path portion of the source property
- *
- * @property {string} sourceSearch  The search portion of the source property
- *
- * @property {string} regex  The constructed regex that will be used to match against the url when
- *   it is time to determine which url will match.
- *
- * @returns {Object}  New `UrlMatcher` object
- */
-function UrlMatcher(pattern, config, parentMatcher) {
-  config = extend({ params: {} }, isObject(config) ? config : {});
-
-  // Find all placeholders and create a compiled pattern, using either classic or curly syntax:
-  //   '*' name
-  //   ':' name
-  //   '{' name '}'
-  //   '{' name ':' regexp '}'
-  // The regular expression is somewhat complicated due to the need to allow curly braces
-  // inside the regular expression. The placeholder regexp breaks down as follows:
-  //    ([:*])([\w\[\]]+)              - classic placeholder ($1 / $2) (search version has - for snake-case)
-  //    \{([\w\[\]]+)(?:\:( ... ))?\}  - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case
-  //    (?: ... | ... | ... )+         - the regexp consists of any number of atoms, an atom being either
-  //    [^{}\\]+                       - anything other than curly braces or backslash
-  //    \\.                            - a backslash escape
-  //    \{(?:[^{}\\]+|\\.)*\}          - a matched set of curly braces containing other atoms
-  var placeholder       = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
-      searchPlaceholder = /([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
-      compiled = '^', last = 0, m,
-      segments = this.segments = [],
-      parentParams = parentMatcher ? parentMatcher.params : {},
-      params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(),
-      paramNames = [];
-
-  function addParameter(id, type, config, location) {
-    paramNames.push(id);
-    if (parentParams[id]) return parentParams[id];
-    if (!/^\w+(-+\w+)*(?:\[\])?$/.test(id)) throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'");
-    if (params[id]) throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'");
-    params[id] = new $$UMFP.Param(id, type, config, location);
-    return params[id];
-  }
-
-  function quoteRegExp(string, pattern, squash, optional) {
-    var surroundPattern = ['',''], result = string.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&");
-    if (!pattern) return result;
-    switch(squash) {
-      case false: surroundPattern = ['(', ')' + (optional ? "?" : "")]; break;
-      case true:  surroundPattern = ['?(', ')?']; break;
-      default:    surroundPattern = ['(' + squash + "|", ')?']; break;
-    }
-    return result + surroundPattern[0] + pattern + surroundPattern[1];
-  }
-
-  this.source = pattern;
-
-  // Split into static segments separated by path parameter placeholders.
-  // The number of segments is always 1 more than the number of parameters.
-  function matchDetails(m, isSearch) {
-    var id, regexp, segment, type, cfg, arrayMode;
-    id          = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null
-    cfg         = config.params[id];
-    segment     = pattern.substring(last, m.index);
-    regexp      = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null);
-    type        = $$UMFP.type(regexp || "string") || inherit($$UMFP.type("string"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) });
-    return {
-      id: id, regexp: regexp, segment: segment, type: type, cfg: cfg
-    };
-  }
-
-  var p, param, segment;
-  while ((m = placeholder.exec(pattern))) {
-    p = matchDetails(m, false);
-    if (p.segment.indexOf('?') >= 0) break; // we're into the search part
-
-    param = addParameter(p.id, p.type, p.cfg, "path");
-    compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash, param.isOptional);
-    segments.push(p.segment);
-    last = placeholder.lastIndex;
-  }
-  segment = pattern.substring(last);
-
-  // Find any search parameter names and remove them from the last segment
-  var i = segment.indexOf('?');
-
-  if (i >= 0) {
-    var search = this.sourceSearch = segment.substring(i);
-    segment = segment.substring(0, i);
-    this.sourcePath = pattern.substring(0, last + i);
-
-    if (search.length > 0) {
-      last = 0;
-      while ((m = searchPlaceholder.exec(search))) {
-        p = matchDetails(m, true);
-        param = addParameter(p.id, p.type, p.cfg, "search");
-        last = placeholder.lastIndex;
-        // check if ?&
-      }
-    }
-  } else {
-    this.sourcePath = pattern;
-    this.sourceSearch = '';
-  }
-
-  compiled += quoteRegExp(segment) + (config.strict === false ? '\/?' : '') + '$';
-  segments.push(segment);
-
-  this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined);
-  this.prefix = segments[0];
-  this.$$paramNames = paramNames;
-}
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:UrlMatcher#concat
- * @methodOf ui.router.util.type:UrlMatcher
- *
- * @description
- * Returns a new matcher for a pattern constructed by appending the path part and adding the
- * search parameters of the specified pattern to this pattern. The current pattern is not
- * modified. This can be understood as creating a pattern for URLs that are relative to (or
- * suffixes of) the current pattern.
- *
- * @example
- * The following two matchers are equivalent:
- * <pre>
- * new UrlMatcher('/user/{id}?q').concat('/details?date');
- * new UrlMatcher('/user/{id}/details?q&date');
- * </pre>
- *
- * @param {string} pattern  The pattern to append.
- * @param {Object} config  An object hash of the configuration for the matcher.
- * @returns {UrlMatcher}  A matcher for the concatenated pattern.
- */
-UrlMatcher.prototype.concat = function (pattern, config) {
-  // Because order of search parameters is irrelevant, we can add our own search
-  // parameters to the end of the new pattern. Parse the new pattern by itself
-  // and then join the bits together, but it's much easier to do this on a string level.
-  var defaultConfig = {
-    caseInsensitive: $$UMFP.caseInsensitive(),
-    strict: $$UMFP.strictMode(),
-    squash: $$UMFP.defaultSquashPolicy()
-  };
-  return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this);
-};
-
-UrlMatcher.prototype.toString = function () {
-  return this.source;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:UrlMatcher#exec
- * @methodOf ui.router.util.type:UrlMatcher
- *
- * @description
- * Tests the specified path against this matcher, and returns an object containing the captured
- * parameter values, or null if the path does not match. The returned object contains the values
- * of any search parameters that are mentioned in the pattern, but their value may be null if
- * they are not present in `searchParams`. This means that search parameters are always treated
- * as optional.
- *
- * @example
- * <pre>
- * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
- *   x: '1', q: 'hello'
- * });
- * // returns { id: 'bob', q: 'hello', r: null }
- * </pre>
- *
- * @param {string} path  The URL path to match, e.g. `$location.path()`.
- * @param {Object} searchParams  URL search parameters, e.g. `$location.search()`.
- * @returns {Object}  The captured parameter values.
- */
-UrlMatcher.prototype.exec = function (path, searchParams) {
-  var m = this.regexp.exec(path);
-  if (!m) return null;
-  searchParams = searchParams || {};
-
-  var paramNames = this.parameters(), nTotal = paramNames.length,
-    nPath = this.segments.length - 1,
-    values = {}, i, j, cfg, paramName;
-
-  if (nPath !== m.length - 1) throw new Error("Unbalanced capture group in route '" + this.source + "'");
-
-  function decodePathArray(string) {
-    function reverseString(str) { return str.split("").reverse().join(""); }
-    function unquoteDashes(str) { return str.replace(/\\-/g, "-"); }
-
-    var split = reverseString(string).split(/-(?!\\)/);
-    var allReversed = map(split, reverseString);
-    return map(allReversed, unquoteDashes).reverse();
-  }
-
-  for (i = 0; i < nPath; i++) {
-    paramName = paramNames[i];
-    var param = this.params[paramName];
-    var paramVal = m[i+1];
-    // if the param value matches a pre-replace pair, replace the value before decoding.
-    for (j = 0; j < param.replace; j++) {
-      if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;
-    }
-    if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);
-    values[paramName] = param.value(paramVal);
-  }
-  for (/**/; i < nTotal; i++) {
-    paramName = paramNames[i];
-    values[paramName] = this.params[paramName].value(searchParams[paramName]);
-  }
-
-  return values;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:UrlMatcher#parameters
- * @methodOf ui.router.util.type:UrlMatcher
- *
- * @description
- * Returns the names of all path and search parameters of this pattern in an unspecified order.
- *
- * @returns {Array.<string>}  An array of parameter names. Must be treated as read-only. If the
- *    pattern has no parameters, an empty array is returned.
- */
-UrlMatcher.prototype.parameters = function (param) {
-  if (!isDefined(param)) return this.$$paramNames;
-  return this.params[param] || null;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:UrlMatcher#validate
- * @methodOf ui.router.util.type:UrlMatcher
- *
- * @description
- * Checks an object hash of parameters to validate their correctness according to the parameter
- * types of this `UrlMatcher`.
- *
- * @param {Object} params The object hash of parameters to validate.
- * @returns {boolean} Returns `true` if `params` validates, otherwise `false`.
- */
-UrlMatcher.prototype.validates = function (params) {
-  return this.params.$$validates(params);
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:UrlMatcher#format
- * @methodOf ui.router.util.type:UrlMatcher
- *
- * @description
- * Creates a URL that matches this pattern by substituting the specified values
- * for the path and search parameters. Null values for path parameters are
- * treated as empty strings.
- *
- * @example
- * <pre>
- * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
- * // returns '/user/bob?q=yes'
- * </pre>
- *
- * @param {Object} values  the values to substitute for the parameters in this pattern.
- * @returns {string}  the formatted URL (path and optionally search part).
- */
-UrlMatcher.prototype.format = function (values) {
-  values = values || {};
-  var segments = this.segments, params = this.parameters(), paramset = this.params;
-  if (!this.validates(values)) return null;
-
-  var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0];
-
-  function encodeDashes(str) { // Replace dashes with encoded "\-"
-    return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); });
-  }
-
-  for (i = 0; i < nTotal; i++) {
-    var isPathParam = i < nPath;
-    var name = params[i], param = paramset[name], value = param.value(values[name]);
-    var isDefaultValue = param.isOptional && param.type.equals(param.value(), value);
-    var squash = isDefaultValue ? param.squash : false;
-    var encoded = param.type.encode(value);
-
-    if (isPathParam) {
-      var nextSegment = segments[i + 1];
-      if (squash === false) {
-        if (encoded != null) {
-          if (isArray(encoded)) {
-            result += map(encoded, encodeDashes).join("-");
-          } else {
-            result += encodeURIComponent(encoded);
-          }
-        }
-        result += nextSegment;
-      } else if (squash === true) {
-        var capture = result.match(/\/$/) ? /\/?(.*)/ : /(.*)/;
-        result += nextSegment.match(capture)[1];
-      } else if (isString(squash)) {
-        result += squash + nextSegment;
-      }
-    } else {
-      if (encoded == null || (isDefaultValue && squash !== false)) continue;
-      if (!isArray(encoded)) encoded = [ encoded ];
-      encoded = map(encoded, encodeURIComponent).join('&' + name + '=');
-      result += (search ? '&' : '?') + (name + '=' + encoded);
-      search = true;
-    }
-  }
-
-  return result;
-};
-
-/**
- * @ngdoc object
- * @name ui.router.util.type:Type
- *
- * @description
- * Implements an interface to define custom parameter types that can be decoded from and encoded to
- * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`}
- * objects when matching or formatting URLs, or comparing or validating parameter values.
- *
- * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more
- * information on registering custom types.
- *
- * @param {Object} config  A configuration object which contains the custom type definition.  The object's
- *        properties will override the default methods and/or pattern in `Type`'s public interface.
- * @example
- * <pre>
- * {
- *   decode: function(val) { return parseInt(val, 10); },
- *   encode: function(val) { return val && val.toString(); },
- *   equals: function(a, b) { return this.is(a) && a === b; },
- *   is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },
- *   pattern: /\d+/
- * }
- * </pre>
- *
- * @property {RegExp} pattern The regular expression pattern used to match values of this type when
- *           coming from a substring of a URL.
- *
- * @returns {Object}  Returns a new `Type` object.
- */
-function Type(config) {
-  extend(this, config);
-}
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:Type#is
- * @methodOf ui.router.util.type:Type
- *
- * @description
- * Detects whether a value is of a particular type. Accepts a native (decoded) value
- * and determines whether it matches the current `Type` object.
- *
- * @param {*} val  The value to check.
- * @param {string} key  Optional. If the type check is happening in the context of a specific
- *        {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the
- *        parameter in which `val` is stored. Can be used for meta-programming of `Type` objects.
- * @returns {Boolean}  Returns `true` if the value matches the type, otherwise `false`.
- */
-Type.prototype.is = function(val, key) {
-  return true;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:Type#encode
- * @methodOf ui.router.util.type:Type
- *
- * @description
- * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the
- * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it
- * only needs to be a representation of `val` that has been coerced to a string.
- *
- * @param {*} val  The value to encode.
- * @param {string} key  The name of the parameter in which `val` is stored. Can be used for
- *        meta-programming of `Type` objects.
- * @returns {string}  Returns a string representation of `val` that can be encoded in a URL.
- */
-Type.prototype.encode = function(val, key) {
-  return val;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:Type#decode
- * @methodOf ui.router.util.type:Type
- *
- * @description
- * Converts a parameter value (from URL string or transition param) to a custom/native value.
- *
- * @param {string} val  The URL parameter value to decode.
- * @param {string} key  The name of the parameter in which `val` is stored. Can be used for
- *        meta-programming of `Type` objects.
- * @returns {*}  Returns a custom representation of the URL parameter value.
- */
-Type.prototype.decode = function(val, key) {
-  return val;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:Type#equals
- * @methodOf ui.router.util.type:Type
- *
- * @description
- * Determines whether two decoded values are equivalent.
- *
- * @param {*} a  A value to compare against.
- * @param {*} b  A value to compare against.
- * @returns {Boolean}  Returns `true` if the values are equivalent/equal, otherwise `false`.
- */
-Type.prototype.equals = function(a, b) {
-  return a == b;
-};
-
-Type.prototype.$subPattern = function() {
-  var sub = this.pattern.toString();
-  return sub.substr(1, sub.length - 2);
-};
-
-Type.prototype.pattern = /.*/;
-
-Type.prototype.toString = function() { return "{Type:" + this.name + "}"; };
-
-/** Given an encoded string, or a decoded object, returns a decoded object */
-Type.prototype.$normalize = function(val) {
-  return this.is(val) ? val : this.decode(val);
-};
-
-/*
- * Wraps an existing custom Type as an array of Type, depending on 'mode'.
- * e.g.:
- * - urlmatcher pattern "/path?{queryParam[]:int}"
- * - url: "/path?queryParam=1&queryParam=2
- * - $stateParams.queryParam will be [1, 2]
- * if `mode` is "auto", then
- * - url: "/path?queryParam=1 will create $stateParams.queryParam: 1
- * - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]
- */
-Type.prototype.$asArray = function(mode, isSearch) {
-  if (!mode) return this;
-  if (mode === "auto" && !isSearch) throw new Error("'auto' array mode is for query parameters only");
-
-  function ArrayType(type, mode) {
-    function bindTo(type, callbackName) {
-      return function() {
-        return type[callbackName].apply(type, arguments);
-      };
-    }
-
-    // Wrap non-array value as array
-    function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }
-    // Unwrap array value for "auto" mode. Return undefined for empty array.
-    function arrayUnwrap(val) {
-      switch(val.length) {
-        case 0: return undefined;
-        case 1: return mode === "auto" ? val[0] : val;
-        default: return val;
-      }
-    }
-    function falsey(val) { return !val; }
-
-    // Wraps type (.is/.encode/.decode) functions to operate on each value of an array
-    function arrayHandler(callback, allTruthyMode) {
-      return function handleArray(val) {
-        val = arrayWrap(val);
-        var result = map(val, callback);
-        if (allTruthyMode === true)
-          return filter(result, falsey).length === 0;
-        return arrayUnwrap(result);
-      };
-    }
-
-    // Wraps type (.equals) functions to operate on each value of an array
-    function arrayEqualsHandler(callback) {
-      return function handleArray(val1, val2) {
-        var left = arrayWrap(val1), right = arrayWrap(val2);
-        if (left.length !== right.length) return false;
-        for (var i = 0; i < left.length; i++) {
-          if (!callback(left[i], right[i])) return false;
-        }
-        return true;
-      };
-    }
-
-    this.encode = arrayHandler(bindTo(type, 'encode'));
-    this.decode = arrayHandler(bindTo(type, 'decode'));
-    this.is     = arrayHandler(bindTo(type, 'is'), true);
-    this.equals = arrayEqualsHandler(bindTo(type, 'equals'));
-    this.pattern = type.pattern;
-    this.$normalize = arrayHandler(bindTo(type, '$normalize'));
-    this.name = type.name;
-    this.$arrayMode = mode;
-  }
-
-  return new ArrayType(this, mode);
-};
-
-
-
-/**
- * @ngdoc object
- * @name ui.router.util.$urlMatcherFactory
- *
- * @description
- * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory
- * is also available to providers under the name `$urlMatcherFactoryProvider`.
- */
-function $UrlMatcherFactory() {
-  $$UMFP = this;
-
-  var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false;
-
-  function valToString(val) { return val != null ? val.toString().replace(/\//g, "%2F") : val; }
-  function valFromString(val) { return val != null ? val.toString().replace(/%2F/g, "/") : val; }
-
-  var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {
-    string: {
-      encode: valToString,
-      decode: valFromString,
-      // TODO: in 1.0, make string .is() return false if value is undefined/null by default.
-      // In 0.2.x, string params are optional by default for backwards compat
-      is: function(val) { return val == null || !isDefined(val) || typeof val === "string"; },
-      pattern: /[^/]*/
-    },
-    int: {
-      encode: valToString,
-      decode: function(val) { return parseInt(val, 10); },
-      is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; },
-      pattern: /\d+/
-    },
-    bool: {
-      encode: function(val) { return val ? 1 : 0; },
-      decode: function(val) { return parseInt(val, 10) !== 0; },
-      is: function(val) { return val === true || val === false; },
-      pattern: /0|1/
-    },
-    date: {
-      encode: function (val) {
-        if (!this.is(val))
-          return undefined;
-        return [ val.getFullYear(),
-          ('0' + (val.getMonth() + 1)).slice(-2),
-          ('0' + val.getDate()).slice(-2)
-        ].join("-");
-      },
-      decode: function (val) {
-        if (this.is(val)) return val;
-        var match = this.capture.exec(val);
-        return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;
-      },
-      is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); },
-      equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); },
-      pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,
-      capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/
-    },
-    json: {
-      encode: angular.toJson,
-      decode: angular.fromJson,
-      is: angular.isObject,
-      equals: angular.equals,
-      pattern: /[^/]*/
-    },
-    any: { // does not encode/decode
-      encode: angular.identity,
-      decode: angular.identity,
-      equals: angular.equals,
-      pattern: /.*/
-    }
-  };
-
-  function getDefaultConfig() {
-    return {
-      strict: isStrictMode,
-      caseInsensitive: isCaseInsensitive
-    };
-  }
-
-  function isInjectable(value) {
-    return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1])));
-  }
-
-  /**
-   * [Internal] Get the default value of a parameter, which may be an injectable function.
-   */
-  $UrlMatcherFactory.$$getDefaultValue = function(config) {
-    if (!isInjectable(config.value)) return config.value;
-    if (!injector) throw new Error("Injectable functions cannot be called at configuration time");
-    return injector.invoke(config.value);
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#caseInsensitive
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Defines whether URL matching should be case sensitive (the default behavior), or not.
-   *
-   * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`;
-   * @returns {boolean} the current value of caseInsensitive
-   */
-  this.caseInsensitive = function(value) {
-    if (isDefined(value))
-      isCaseInsensitive = value;
-    return isCaseInsensitive;
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#strictMode
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Defines whether URLs should match trailing slashes, or not (the default behavior).
-   *
-   * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`.
-   * @returns {boolean} the current value of strictMode
-   */
-  this.strictMode = function(value) {
-    if (isDefined(value))
-      isStrictMode = value;
-    return isStrictMode;
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Sets the default behavior when generating or matching URLs with default parameter values.
-   *
-   * @param {string} value A string that defines the default parameter URL squashing behavior.
-   *    `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL
-   *    `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the
-   *             parameter is surrounded by slashes, squash (remove) one slash from the URL
-   *    any other string, e.g. "~": When generating an href with a default parameter value, squash (remove)
-   *             the parameter value from the URL and replace it with this string.
-   */
-  this.defaultSquashPolicy = function(value) {
-    if (!isDefined(value)) return defaultSquashPolicy;
-    if (value !== true && value !== false && !isString(value))
-      throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string");
-    defaultSquashPolicy = value;
-    return value;
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#compile
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern.
-   *
-   * @param {string} pattern  The URL pattern.
-   * @param {Object} config  The config object hash.
-   * @returns {UrlMatcher}  The UrlMatcher.
-   */
-  this.compile = function (pattern, config) {
-    return new UrlMatcher(pattern, extend(getDefaultConfig(), config));
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#isMatcher
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Returns true if the specified object is a `UrlMatcher`, or false otherwise.
-   *
-   * @param {Object} object  The object to perform the type check against.
-   * @returns {Boolean}  Returns `true` if the object matches the `UrlMatcher` interface, by
-   *          implementing all the same methods.
-   */
-  this.isMatcher = function (o) {
-    if (!isObject(o)) return false;
-    var result = true;
-
-    forEach(UrlMatcher.prototype, function(val, name) {
-      if (isFunction(val)) {
-        result = result && (isDefined(o[name]) && isFunction(o[name]));
-      }
-    });
-    return result;
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#type
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to
-   * generate URLs with typed parameters.
-   *
-   * @param {string} name  The type name.
-   * @param {Object|Function} definition   The type definition. See
-   *        {@link ui.router.util.type:Type `Type`} for information on the values accepted.
-   * @param {Object|Function} definitionFn (optional) A function that is injected before the app
-   *        runtime starts.  The result of this function is merged into the existing `definition`.
-   *        See {@link ui.router.util.type:Type `Type`} for information on the values accepted.
-   *
-   * @returns {Object}  Returns `$urlMatcherFactoryProvider`.
-   *
-   * @example
-   * This is a simple example of a custom type that encodes and decodes items from an
-   * array, using the array index as the URL-encoded value:
-   *
-   * <pre>
-   * var list = ['John', 'Paul', 'George', 'Ringo'];
-   *
-   * $urlMatcherFactoryProvider.type('listItem', {
-   *   encode: function(item) {
-   *     // Represent the list item in the URL using its corresponding index
-   *     return list.indexOf(item);
-   *   },
-   *   decode: function(item) {
-   *     // Look up the list item by index
-   *     return list[parseInt(item, 10)];
-   *   },
-   *   is: function(item) {
-   *     // Ensure the item is valid by checking to see that it appears
-   *     // in the list
-   *     return list.indexOf(item) > -1;
-   *   }
-   * });
-   *
-   * $stateProvider.state('list', {
-   *   url: "/list/{item:listItem}",
-   *   controller: function($scope, $stateParams) {
-   *     console.log($stateParams.item);
-   *   }
-   * });
-   *
-   * // ...
-   *
-   * // Changes URL to '/list/3', logs "Ringo" to the console
-   * $state.go('list', { item: "Ringo" });
-   * </pre>
-   *
-   * This is a more complex example of a type that relies on dependency injection to
-   * interact with services, and uses the parameter name from the URL to infer how to
-   * handle encoding and decoding parameter values:
-   *
-   * <pre>
-   * // Defines a custom type that gets a value from a service,
-   * // where each service gets different types of values from
-   * // a backend API:
-   * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {
-   *
-   *   // Matches up services to URL parameter names
-   *   var services = {
-   *     user: Users,
-   *     post: Posts
-   *   };
-   *
-   *   return {
-   *     encode: function(object) {
-   *       // Represent the object in the URL using its unique ID
-   *       return object.id;
-   *     },
-   *     decode: function(value, key) {
-   *       // Look up the object by ID, using the parameter
-   *       // name (key) to call the correct service
-   *       return services[key].findById(value);
-   *     },
-   *     is: function(object, key) {
-   *       // Check that object is a valid dbObject
-   *       return angular.isObject(object) && object.id && services[key];
-   *     }
-   *     equals: function(a, b) {
-   *       // Check the equality of decoded objects by comparing
-   *       // their unique IDs
-   *       return a.id === b.id;
-   *     }
-   *   };
-   * });
-   *
-   * // In a config() block, you can then attach URLs with
-   * // type-annotated parameters:
-   * $stateProvider.state('users', {
-   *   url: "/users",
-   *   // ...
-   * }).state('users.item', {
-   *   url: "/{user:dbObject}",
-   *   controller: function($scope, $stateParams) {
-   *     // $stateParams.user will now be an object returned from
-   *     // the Users service
-   *   },
-   *   // ...
-   * });
-   * </pre>
-   */
-  this.type = function (name, definition, definitionFn) {
-    if (!isDefined(definition)) return $types[name];
-    if ($types.hasOwnProperty(name)) throw new Error("A type named '" + name + "' has already been defined.");
-
-    $types[name] = new Type(extend({ name: name }, definition));
-    if (definitionFn) {
-      typeQueue.push({ name: name, def: definitionFn });
-      if (!enqueue) flushTypeQueue();
-    }
-    return this;
-  };
-
-  // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s
-  function flushTypeQueue() {
-    while(typeQueue.length) {
-      var type = typeQueue.shift();
-      if (type.pattern) throw new Error("You cannot override a type's .pattern at runtime.");
-      angular.extend($types[type.name], injector.invoke(type.def));
-    }
-  }
-
-  // Register default types. Store them in the prototype of $types.
-  forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); });
-  $types = inherit($types, {});
-
-  /* No need to document $get, since it returns this */
-  this.$get = ['$injector', function ($injector) {
-    injector = $injector;
-    enqueue = false;
-    flushTypeQueue();
-
-    forEach(defaultTypes, function(type, name) {
-      if (!$types[name]) $types[name] = new Type(type);
-    });
-    return this;
-  }];
-
-  this.Param = function Param(id, type, config, location) {
-    var self = this;
-    config = unwrapShorthand(config);
-    type = getType(config, type, location);
-    var arrayMode = getArrayMode();
-    type = arrayMode ? type.$asArray(arrayMode, location === "search") : type;
-    if (type.name === "string" && !arrayMode && location === "path" && config.value === undefined)
-      config.value = ""; // for 0.2.x; in 0.3.0+ do not automatically default to ""
-    var isOptional = config.value !== undefined;
-    var squash = getSquashPolicy(config, isOptional);
-    var replace = getReplace(config, arrayMode, isOptional, squash);
-
-    function unwrapShorthand(config) {
-      var keys = isObject(config) ? objectKeys(config) : [];
-      var isShorthand = indexOf(keys, "value") === -1 && indexOf(keys, "type") === -1 &&
-                        indexOf(keys, "squash") === -1 && indexOf(keys, "array") === -1;
-      if (isShorthand) config = { value: config };
-      config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; };
-      return config;
-    }
-
-    function getType(config, urlType, location) {
-      if (config.type && urlType) throw new Error("Param '"+id+"' has two type configurations.");
-      if (urlType) return urlType;
-      if (!config.type) return (location === "config" ? $types.any : $types.string);
-      return config.type instanceof Type ? config.type : new Type(config.type);
-    }
-
-    // array config: param name (param[]) overrides default settings.  explicit config overrides param name.
-    function getArrayMode() {
-      var arrayDefaults = { array: (location === "search" ? "auto" : false) };
-      var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {};
-      return extend(arrayDefaults, arrayParamNomenclature, config).array;
-    }
-
-    /**
-     * returns false, true, or the squash value to indicate the "default parameter url squash policy".
-     */
-    function getSquashPolicy(config, isOptional) {
-      var squash = config.squash;
-      if (!isOptional || squash === false) return false;
-      if (!isDefined(squash) || squash == null) return defaultSquashPolicy;
-      if (squash === true || isString(squash)) return squash;
-      throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string");
-    }
-
-    function getReplace(config, arrayMode, isOptional, squash) {
-      var replace, configuredKeys, defaultPolicy = [
-        { from: "",   to: (isOptional || arrayMode ? undefined : "") },
-        { from: null, to: (isOptional || arrayMode ? undefined : "") }
-      ];
-      replace = isArray(config.replace) ? config.replace : [];
-      if (isString(squash))
-        replace.push({ from: squash, to: undefined });
-      configuredKeys = map(replace, function(item) { return item.from; } );
-      return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace);
-    }
-
-    /**
-     * [Internal] Get the default value of a parameter, which may be an injectable function.
-     */
-    function $$getDefaultValue() {
-      if (!injector) throw new Error("Injectable functions cannot be called at configuration time");
-      var defaultValue = injector.invoke(config.$$fn);
-      if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))
-        throw new Error("Default value (" + defaultValue + ") for parameter '" + self.id + "' is not an instance of Type (" + self.type.name + ")");
-      return defaultValue;
-    }
-
-    /**
-     * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the
-     * default value, which may be the result of an injectable function.
-     */
-    function $value(value) {
-      function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }
-      function $replace(value) {
-        var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });
-        return replacement.length ? replacement[0] : value;
-      }
-      value = $replace(value);
-      return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);
-    }
-
-    function toString() { return "{Param:" + id + " " + type + " squash: '" + squash + "' optional: " + isOptional + "}"; }
-
-    extend(this, {
-      id: id,
-      type: type,
-      location: location,
-      array: arrayMode,
-      squash: squash,
-      replace: replace,
-      isOptional: isOptional,
-      value: $value,
-      dynamic: undefined,
-      config: config,
-      toString: toString
-    });
-  };
-
-  function ParamSet(params) {
-    extend(this, params || {});
-  }
-
-  ParamSet.prototype = {
-    $$new: function() {
-      return inherit(this, extend(new ParamSet(), { $$parent: this}));
-    },
-    $$keys: function () {
-      var keys = [], chain = [], parent = this,
-        ignore = objectKeys(ParamSet.prototype);
-      while (parent) { chain.push(parent); parent = parent.$$parent; }
-      chain.reverse();
-      forEach(chain, function(paramset) {
-        forEach(objectKeys(paramset), function(key) {
-            if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key);
-        });
-      });
-      return keys;
-    },
-    $$values: function(paramValues) {
-      var values = {}, self = this;
-      forEach(self.$$keys(), function(key) {
-        values[key] = self[key].value(paramValues && paramValues[key]);
-      });
-      return values;
-    },
-    $$equals: function(paramValues1, paramValues2) {
-      var equal = true, self = this;
-      forEach(self.$$keys(), function(key) {
-        var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key];
-        if (!self[key].type.equals(left, right)) equal = false;
-      });
-      return equal;
-    },
-    $$validates: function $$validate(paramValues) {
-      var keys = this.$$keys(), i, param, rawVal, normalized, encoded;
-      for (i = 0; i < keys.length; i++) {
-        param = this[keys[i]];
-        rawVal = paramValues[keys[i]];
-        if ((rawVal === undefined || rawVal === null) && param.isOptional)
-          break; // There was no parameter value, but the param is optional
-        normalized = param.type.$normalize(rawVal);
-        if (!param.type.is(normalized))
-          return false; // The value was not of the correct Type, and could not be decoded to the correct Type
-        encoded = param.type.encode(normalized);
-        if (angular.isString(encoded) && !param.type.pattern.exec(encoded))
-          return false; // The value was of the correct type, but when encoded, did not match the Type's regexp
-      }
-      return true;
-    },
-    $$parent: undefined
-  };
-
-  this.ParamSet = ParamSet;
-}
-
-// Register as a provider so it's available to other providers
-angular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory);
-angular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]);
-
-/**
- * @ngdoc object
- * @name ui.router.router.$urlRouterProvider
- *
- * @requires ui.router.util.$urlMatcherFactoryProvider
- * @requires $locationProvider
- *
- * @description
- * `$urlRouterProvider` has the responsibility of watching `$location`. 
- * When `$location` changes it runs through a list of rules one by one until a 
- * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify 
- * a url in a state configuration. All urls are compiled into a UrlMatcher object.
- *
- * There are several methods on `$urlRouterProvider` that make it useful to use directly
- * in your module config.
- */
-$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider'];
-function $UrlRouterProvider(   $locationProvider,   $urlMatcherFactory) {
-  var rules = [], otherwise = null, interceptDeferred = false, listener;
-
-  // Returns a string that is a prefix of all strings matching the RegExp
-  function regExpPrefix(re) {
-    var prefix = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(re.source);
-    return (prefix != null) ? prefix[1].replace(/\\(.)/g, "$1") : '';
-  }
-
-  // Interpolates matched values into a String.replace()-style pattern
-  function interpolate(pattern, match) {
-    return pattern.replace(/\$(\$|\d{1,2})/, function (m, what) {
-      return match[what === '$' ? 0 : Number(what)];
-    });
-  }
-
-  /**
-   * @ngdoc function
-   * @name ui.router.router.$urlRouterProvider#rule
-   * @methodOf ui.router.router.$urlRouterProvider
-   *
-   * @description
-   * Defines rules that are used by `$urlRouterProvider` to find matches for
-   * specific URLs.
-   *
-   * @example
-   * <pre>
-   * var app = angular.module('app', ['ui.router.router']);
-   *
-   * app.config(function ($urlRouterProvider) {
-   *   // Here's an example of how you might allow case insensitive urls
-   *   $urlRouterProvider.rule(function ($injector, $location) {
-   *     var path = $location.path(),
-   *         normalized = path.toLowerCase();
-   *
-   *     if (path !== normalized) {
-   *       return normalized;
-   *     }
-   *   });
-   * });
-   * </pre>
-   *
-   * @param {object} rule Handler function that takes `$injector` and `$location`
-   * services as arguments. You can use them to return a valid path as a string.
-   *
-   * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
-   */
-  this.rule = function (rule) {
-    if (!isFunction(rule)) throw new Error("'rule' must be a function");
-    rules.push(rule);
-    return this;
-  };
-
-  /**
-   * @ngdoc object
-   * @name ui.router.router.$urlRouterProvider#otherwise
-   * @methodOf ui.router.router.$urlRouterProvider
-   *
-   * @description
-   * Defines a path that is used when an invalid route is requested.
-   *
-   * @example
-   * <pre>
-   * var app = angular.module('app', ['ui.router.router']);
-   *
-   * app.config(function ($urlRouterProvider) {
-   *   // if the path doesn't match any of the urls you configured
-   *   // otherwise will take care of routing the user to the
-   *   // specified url
-   *   $urlRouterProvider.otherwise('/index');
-   *
-   *   // Example of using function rule as param
-   *   $urlRouterProvider.otherwise(function ($injector, $location) {
-   *     return '/a/valid/url';
-   *   });
-   * });
-   * </pre>
-   *
-   * @param {string|object} rule The url path you want to redirect to or a function 
-   * rule that returns the url path. The function version is passed two params: 
-   * `$injector` and `$location` services, and must return a url string.
-   *
-   * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
-   */
-  this.otherwise = function (rule) {
-    if (isString(rule)) {
-      var redirect = rule;
-      rule = function () { return redirect; };
-    }
-    else if (!isFunction(rule)) throw new Error("'rule' must be a function");
-    otherwise = rule;
-    return this;
-  };
-
-
-  function handleIfMatch($injector, handler, match) {
-    if (!match) return false;
-    var result = $injector.invoke(handler, handler, { $match: match });
-    return isDefined(result) ? result : true;
-  }
-
-  /**
-   * @ngdoc function
-   * @name ui.router.router.$urlRouterProvider#when
-   * @methodOf ui.router.router.$urlRouterProvider
-   *
-   * @description
-   * Registers a handler for a given url matching. if handle is a string, it is
-   * treated as a redirect, and is interpolated according to the syntax of match
-   * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
-   *
-   * If the handler is a function, it is injectable. It gets invoked if `$location`
-   * matches. You have the option of inject the match object as `$match`.
-   *
-   * The handler can return
-   *
-   * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`
-   *   will continue trying to find another one that matches.
-   * - **string** which is treated as a redirect and passed to `$location.url()`
-   * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.
-   *
-   * @example
-   * <pre>
-   * var app = angular.module('app', ['ui.router.router']);
-   *
-   * app.config(function ($urlRouterProvider) {
-   *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {
-   *     if ($state.$current.navigable !== state ||
-   *         !equalForKeys($match, $stateParams) {
-   *      $state.transitionTo(state, $match, false);
-   *     }
-   *   });
-   * });
-   * </pre>
-   *
-   * @param {string|object} what The incoming path that you want to redirect.
-   * @param {string|object} handler The path you want to redirect your user to.
-   */
-  this.when = function (what, handler) {
-    var redirect, handlerIsString = isString(handler);
-    if (isString(what)) what = $urlMatcherFactory.compile(what);
-
-    if (!handlerIsString && !isFunction(handler) && !isArray(handler))
-      throw new Error("invalid 'handler' in when()");
-
-    var strategies = {
-      matcher: function (what, handler) {
-        if (handlerIsString) {
-          redirect = $urlMatcherFactory.compile(handler);
-          handler = ['$match', function ($match) { return redirect.format($match); }];
-        }
-        return extend(function ($injector, $location) {
-          return handleIfMatch($injector, handler, what.exec($location.path(), $location.search()));
-        }, {
-          prefix: isString(what.prefix) ? what.prefix : ''
-        });
-      },
-      regex: function (what, handler) {
-        if (what.global || what.sticky) throw new Error("when() RegExp must not be global or sticky");
-
-        if (handlerIsString) {
-          redirect = handler;
-          handler = ['$match', function ($match) { return interpolate(redirect, $match); }];
-        }
-        return extend(function ($injector, $location) {
-          return handleIfMatch($injector, handler, what.exec($location.path()));
-        }, {
-          prefix: regExpPrefix(what)
-        });
-      }
-    };
-
-    var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp };
-
-    for (var n in check) {
-      if (check[n]) return this.rule(strategies[n](what, handler));
-    }
-
-    throw new Error("invalid 'what' in when()");
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.router.$urlRouterProvider#deferIntercept
-   * @methodOf ui.router.router.$urlRouterProvider
-   *
-   * @description
-   * Disables (or enables) deferring location change interception.
-   *
-   * If you wish to customize the behavior of syncing the URL (for example, if you wish to
-   * defer a transition but maintain the current URL), call this method at configuration time.
-   * Then, at run time, call `$urlRouter.listen()` after you have configured your own
-   * `$locationChangeSuccess` event handler.
-   *
-   * @example
-   * <pre>
-   * var app = angular.module('app', ['ui.router.router']);
-   *
-   * app.config(function ($urlRouterProvider) {
-   *
-   *   // Prevent $urlRouter from automatically intercepting URL changes;
-   *   // this allows you to configure custom behavior in between
-   *   // location changes and route synchronization:
-   *   $urlRouterProvider.deferIntercept();
-   *
-   * }).run(function ($rootScope, $urlRouter, UserService) {
-   *
-   *   $rootScope.$on('$locationChangeSuccess', function(e) {
-   *     // UserService is an example service for managing user state
-   *     if (UserService.isLoggedIn()) return;
-   *
-   *     // Prevent $urlRouter's default handler from firing
-   *     e.preventDefault();
-   *
-   *     UserService.handleLogin().then(function() {
-   *       // Once the user has logged in, sync the current URL
-   *       // to the router:
-   *       $urlRouter.sync();
-   *     });
-   *   });
-   *
-   *   // Configures $urlRouter's listener *after* your custom listener
-   *   $urlRouter.listen();
-   * });
-   * </pre>
-   *
-   * @param {boolean} defer Indicates whether to defer location change interception. Passing
-            no parameter is equivalent to `true`.
-   */
-  this.deferIntercept = function (defer) {
-    if (defer === undefined) defer = true;
-    interceptDeferred = defer;
-  };
-
-  /**
-   * @ngdoc object
-   * @name ui.router.router.$urlRouter
-   *
-   * @requires $location
-   * @requires $rootScope
-   * @requires $injector
-   * @requires $browser
-   *
-   * @description
-   *
-   */
-  this.$get = $get;
-  $get.$inject = ['$location', '$rootScope', '$injector', '$browser'];
-  function $get(   $location,   $rootScope,   $injector,   $browser) {
-
-    var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl;
-
-    function appendBasePath(url, isHtml5, absolute) {
-      if (baseHref === '/') return url;
-      if (isHtml5) return baseHref.slice(0, -1) + url;
-      if (absolute) return baseHref.slice(1) + url;
-      return url;
-    }
-
-    // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree
-    function update(evt) {
-      if (evt && evt.defaultPrevented) return;
-      var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;
-      lastPushedUrl = undefined;
-      // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573
-      //if (ignoreUpdate) return true;
-
-      function check(rule) {
-        var handled = rule($injector, $location);
-
-        if (!handled) return false;
-        if (isString(handled)) $location.replace().url(handled);
-        return true;
-      }
-      var n = rules.length, i;
-
-      for (i = 0; i < n; i++) {
-        if (check(rules[i])) return;
-      }
-      // always check otherwise last to allow dynamic updates to the set of rules
-      if (otherwise) check(otherwise);
-    }
-
-    function listen() {
-      listener = listener || $rootScope.$on('$locationChangeSuccess', update);
-      return listener;
-    }
-
-    if (!interceptDeferred) listen();
-
-    return {
-      /**
-       * @ngdoc function
-       * @name ui.router.router.$urlRouter#sync
-       * @methodOf ui.router.router.$urlRouter
-       *
-       * @description
-       * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`.
-       * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,
-       * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed
-       * with the transition by calling `$urlRouter.sync()`.
-       *
-       * @example
-       * <pre>
-       * angular.module('app', ['ui.router'])
-       *   .run(function($rootScope, $urlRouter) {
-       *     $rootScope.$on('$locationChangeSuccess', function(evt) {
-       *       // Halt state change from even starting
-       *       evt.preventDefault();
-       *       // Perform custom logic
-       *       var meetsRequirement = ...
-       *       // Continue with the update and state transition if logic allows
-       *       if (meetsRequirement) $urlRouter.sync();
-       *     });
-       * });
-       * </pre>
-       */
-      sync: function() {
-        update();
-      },
-
-      listen: function() {
-        return listen();
-      },
-
-      update: function(read) {
-        if (read) {
-          location = $location.url();
-          return;
-        }
-        if ($location.url() === location) return;
-
-        $location.url(location);
-        $location.replace();
-      },
-
-      push: function(urlMatcher, params, options) {
-         var url = urlMatcher.format(params || {});
-
-        // Handle the special hash param, if needed
-        if (url !== null && params && params['#']) {
-            url += '#' + params['#'];
-        }
-
-        $location.url(url);
-        lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined;
-        if (options && options.replace) $location.replace();
-      },
-
-      /**
-       * @ngdoc function
-       * @name ui.router.router.$urlRouter#href
-       * @methodOf ui.router.router.$urlRouter
-       *
-       * @description
-       * A URL generation method that returns the compiled URL for a given
-       * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters.
-       *
-       * @example
-       * <pre>
-       * $bob = $urlRouter.href(new UrlMatcher("/about/:person"), {
-       *   person: "bob"
-       * });
-       * // $bob == "/about/bob";
-       * </pre>
-       *
-       * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate.
-       * @param {object=} params An object of parameter values to fill the matcher's required parameters.
-       * @param {object=} options Options object. The options are:
-       *
-       * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
-       *
-       * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
-       */
-      href: function(urlMatcher, params, options) {
-        if (!urlMatcher.validates(params)) return null;
-
-        var isHtml5 = $locationProvider.html5Mode();
-        if (angular.isObject(isHtml5)) {
-          isHtml5 = isHtml5.enabled;
-        }
-        
-        var url = urlMatcher.format(params);
-        options = options || {};
-
-        if (!isHtml5 && url !== null) {
-          url = "#" + $locationProvider.hashPrefix() + url;
-        }
-
-        // Handle special hash param, if needed
-        if (url !== null && params && params['#']) {
-          url += '#' + params['#'];
-        }
-
-        url = appendBasePath(url, isHtml5, options.absolute);
-
-        if (!options.absolute || !url) {
-          return url;
-        }
-
-        var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();
-        port = (port === 80 || port === 443 ? '' : ':' + port);
-
-        return [$location.protocol(), '://', $location.host(), port, slash, url].join('');
-      }
-    };
-  }
-}
-
-angular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider);
-
-/**
- * @ngdoc object
- * @name ui.router.state.$stateProvider
- *
- * @requires ui.router.router.$urlRouterProvider
- * @requires ui.router.util.$urlMatcherFactoryProvider
- *
- * @description
- * The new `$stateProvider` works similar to Angular's v1 router, but it focuses purely
- * on state.
- *
- * A state corresponds to a "place" in the application in terms of the overall UI and
- * navigation. A state describes (via the controller / template / view properties) what
- * the UI looks like and does at that place.
- *
- * States often have things in common, and the primary way of factoring out these
- * commonalities in this model is via the state hierarchy, i.e. parent/child states aka
- * nested states.
- *
- * The `$stateProvider` provides interfaces to declare these states for your app.
- */
-$StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider'];
-function $StateProvider(   $urlRouterProvider,   $urlMatcherFactory) {
-
-  var root, states = {}, $state, queue = {}, abstractKey = 'abstract';
-
-  // Builds state properties from definition passed to registerState()
-  var stateBuilder = {
-
-    // Derive parent state from a hierarchical name only if 'parent' is not explicitly defined.
-    // state.children = [];
-    // if (parent) parent.children.push(state);
-    parent: function(state) {
-      if (isDefined(state.parent) && state.parent) return findState(state.parent);
-      // regex matches any valid composite state name
-      // would match "contact.list" but not "contacts"
-      var compositeName = /^(.+)\.[^.]+$/.exec(state.name);
-      return compositeName ? findState(compositeName[1]) : root;
-    },
-
-    // inherit 'data' from parent and override by own values (if any)
-    data: function(state) {
-      if (state.parent && state.parent.data) {
-        state.data = state.self.data = extend({}, state.parent.data, state.data);
-      }
-      return state.data;
-    },
-
-    // Build a URLMatcher if necessary, either via a relative or absolute URL
-    url: function(state) {
-      var url = state.url, config = { params: state.params || {} };
-
-      if (isString(url)) {
-        if (url.charAt(0) == '^') return $urlMatcherFactory.compile(url.substring(1), config);
-        return (state.parent.navigable || root).url.concat(url, config);
-      }
-
-      if (!url || $urlMatcherFactory.isMatcher(url)) return url;
-      throw new Error("Invalid url '" + url + "' in state '" + state + "'");
-    },
-
-    // Keep track of the closest ancestor state that has a URL (i.e. is navigable)
-    navigable: function(state) {
-      return state.url ? state : (state.parent ? state.parent.navigable : null);
-    },
-
-    // Own parameters for this state. state.url.params is already built at this point. Create and add non-url params
-    ownParams: function(state) {
-      var params = state.url && state.url.params || new $$UMFP.ParamSet();
-      forEach(state.params || {}, function(config, id) {
-        if (!params[id]) params[id] = new $$UMFP.Param(id, null, config, "config");
-      });
-      return params;
-    },
-
-    // Derive parameters for this state and ensure they're a super-set of parent's parameters
-    params: function(state) {
-      return state.parent && state.parent.params ? extend(state.parent.params.$$new(), state.ownParams) : new $$UMFP.ParamSet();
-    },
-
-    // If there is no explicit multi-view configuration, make one up so we don't have
-    // to handle both cases in the view directive later. Note that having an explicit
-    // 'views' property will mean the default unnamed view properties are ignored. This
-    // is also a good time to resolve view names to absolute names, so everything is a
-    // straight lookup at link time.
-    views: function(state) {
-      var views = {};
-
-      forEach(isDefined(state.views) ? state.views : { '': state }, function (view, name) {
-        if (name.indexOf('@') < 0) name += '@' + state.parent.name;
-        views[name] = view;
-      });
-      return views;
-    },
-
-    // Keep a full path from the root down to this state as this is needed for state activation.
-    path: function(state) {
-      return state.parent ? state.parent.path.concat(state) : []; // exclude root from path
-    },
-
-    // Speed up $state.contains() as it's used a lot
-    includes: function(state) {
-      var includes = state.parent ? extend({}, state.parent.includes) : {};
-      includes[state.name] = true;
-      return includes;
-    },
-
-    $delegates: {}
-  };
-
-  function isRelative(stateName) {
-    return stateName.indexOf(".") === 0 || stateName.indexOf("^") === 0;
-  }
-
-  function findState(stateOrName, base) {
-    if (!stateOrName) return undefined;
-
-    var isStr = isString(stateOrName),
-        name  = isStr ? stateOrName : stateOrName.name,
-        path  = isRelative(name);
-
-    if (path) {
-      if (!base) throw new Error("No reference point given for path '"  + name + "'");
-      base = findState(base);
-      
-      var rel = name.split("."), i = 0, pathLength = rel.length, current = base;
-
-      for (; i < pathLength; i++) {
-        if (rel[i] === "" && i === 0) {
-          current = base;
-          continue;
-        }
-        if (rel[i] === "^") {
-          if (!current.parent) throw new Error("Path '" + name + "' not valid for state '" + base.name + "'");
-          current = current.parent;
-          continue;
-        }
-        break;
-      }
-      rel = rel.slice(i).join(".");
-      name = current.name + (current.name && rel ? "." : "") + rel;
-    }
-    var state = states[name];
-
-    if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {
-      return state;
-    }
-    return undefined;
-  }
-
-  function queueState(parentName, state) {
-    if (!queue[parentName]) {
-      queue[parentName] = [];
-    }
-    queue[parentName].push(state);
-  }
-
-  function flushQueuedChildren(parentName) {
-    var queued = queue[parentName] || [];
-    while(queued.length) {
-      registerState(queued.shift());
-    }
-  }
-
-  function registerState(state) {
-    // Wrap a new object around the state so we can store our private details easily.
-    state = inherit(state, {
-      self: state,
-      resolve: state.resolve || {},
-      toString: function() { return this.name; }
-    });
-
-    var name = state.name;
-    if (!isString(name) || name.indexOf('@') >= 0) throw new Error("State must have a valid name");
-    if (states.hasOwnProperty(name)) throw new Error("State '" + name + "'' is already defined");
-
-    // Get parent name
-    var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))
-        : (isString(state.parent)) ? state.parent
-        : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name
-        : '';
-
-    // If parent is not registered yet, add state to queue and register later
-    if (parentName && !states[parentName]) {
-      return queueState(parentName, state.self);
-    }
-
-    for (var key in stateBuilder) {
-      if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]);
-    }
-    states[name] = state;
-
-    // Register the state in the global state list and with $urlRouter if necessary.
-    if (!state[abstractKey] && state.url) {
-      $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) {
-        if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) {
-          $state.transitionTo(state, $match, { inherit: true, location: false });
-        }
-      }]);
-    }
-
-    // Register any queued children
-    flushQueuedChildren(name);
-
-    return state;
-  }
-
-  // Checks text to see if it looks like a glob.
-  function isGlob (text) {
-    return text.indexOf('*') > -1;
-  }
-
-  // Returns true if glob matches current $state name.
-  function doesStateMatchGlob (glob) {
-    var globSegments = glob.split('.'),
-        segments = $state.$current.name.split('.');
-
-    //match single stars
-    for (var i = 0, l = globSegments.length; i < l; i++) {
-      if (globSegments[i] === '*') {
-        segments[i] = '*';
-      }
-    }
-
-    //match greedy starts
-    if (globSegments[0] === '**') {
-       segments = segments.slice(indexOf(segments, globSegments[1]));
-       segments.unshift('**');
-    }
-    //match greedy ends
-    if (globSegments[globSegments.length - 1] === '**') {
-       segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);
-       segments.push('**');
-    }
-
-    if (globSegments.length != segments.length) {
-      return false;
-    }
-
-    return segments.join('') === globSegments.join('');
-  }
-
-
-  // Implicit root state that is always active
-  root = registerState({
-    name: '',
-    url: '^',
-    views: null,
-    'abstract': true
-  });
-  root.navigable = null;
-
-
-  /**
-   * @ngdoc function
-   * @name ui.router.state.$stateProvider#decorator
-   * @methodOf ui.router.state.$stateProvider
-   *
-   * @description
-   * Allows you to extend (carefully) or override (at your own peril) the 
-   * `stateBuilder` object used internally by `$stateProvider`. This can be used 
-   * to add custom functionality to ui-router, for example inferring templateUrl 
-   * based on the state name.
-   *
-   * When passing only a name, it returns the current (original or decorated) builder
-   * function that matches `name`.
-   *
-   * The builder functions that can be decorated are listed below. Though not all
-   * necessarily have a good use case for decoration, that is up to you to decide.
-   *
-   * In addition, users can attach custom decorators, which will generate new 
-   * properties within the state's internal definition. There is currently no clear 
-   * use-case for this beyond accessing internal states (i.e. $state.$current), 
-   * however, expect this to become increasingly relevant as we introduce additional 
-   * meta-programming features.
-   *
-   * **Warning**: Decorators should not be interdependent because the order of 
-   * execution of the builder functions in non-deterministic. Builder functions 
-   * should only be dependent on the state definition object and super function.
-   *
-   *
-   * Existing builder functions and current return values:
-   *
-   * - **parent** `{object}` - returns the parent state object.
-   * - **data** `{object}` - returns state data, including any inherited data that is not
-   *   overridden by own values (if any).
-   * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
-   *   or `null`.
-   * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is 
-   *   navigable).
-   * - **params** `{object}` - returns an array of state params that are ensured to 
-   *   be a super-set of parent's params.
-   * - **views** `{object}` - returns a views object where each key is an absolute view 
-   *   name (i.e. "viewName@stateName") and each value is the config object 
-   *   (template, controller) for the view. Even when you don't use the views object 
-   *   explicitly on a state config, one is still created for you internally.
-   *   So by decorating this builder function you have access to decorating template 
-   *   and controller properties.
-   * - **ownParams** `{object}` - returns an array of params that belong to the state, 
-   *   not including any params defined by ancestor states.
-   * - **path** `{string}` - returns the full path from the root down to this state. 
-   *   Needed for state activation.
-   * - **includes** `{object}` - returns an object that includes every state that 
-   *   would pass a `$state.includes()` test.
-   *
-   * @example
-   * <pre>
-   * // Override the internal 'views' builder with a function that takes the state
-   * // definition, and a reference to the internal function being overridden:
-   * $stateProvider.decorator('views', function (state, parent) {
-   *   var result = {},
-   *       views = parent(state);
-   *
-   *   angular.forEach(views, function (config, name) {
-   *     var autoName = (state.name + '.' + name).replace('.', '/');
-   *     config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
-   *     result[name] = config;
-   *   });
-   *   return result;
-   * });
-   *
-   * $stateProvider.state('home', {
-   *   views: {
-   *     'contact.list': { controller: 'ListController' },
-   *     'contact.item': { controller: 'ItemController' }
-   *   }
-   * });
-   *
-   * // ...
-   *
-   * $state.go('home');
-   * // Auto-populates list and item views with /partials/home/contact/list.html,
-   * // and /partials/home/contact/item.html, respectively.
-   * </pre>
-   *
-   * @param {string} name The name of the builder function to decorate. 
-   * @param {object} func A function that is responsible for decorating the original 
-   * builder function. The function receives two parameters:
-   *
-   *   - `{object}` - state - The state config object.
-   *   - `{object}` - super - The original builder function.
-   *
-   * @return {object} $stateProvider - $stateProvider instance
-   */
-  this.decorator = decorator;
-  function decorator(name, func) {
-    /*jshint validthis: true */
-    if (isString(name) && !isDefined(func)) {
-      return stateBuilder[name];
-    }
-    if (!isFunction(func) || !isString(name)) {
-      return this;
-    }
-    if (stateBuilder[name] && !stateBuilder.$delegates[name]) {
-      stateBuilder.$delegates[name] = stateBuilder[name];
-    }
-    stateBuilder[name] = func;
-    return this;
-  }
-
-  /**
-   * @ngdoc function
-   * @name ui.router.state.$stateProvider#state
-   * @methodOf ui.router.state.$stateProvider
-   *
-   * @description
-   * Registers a state configuration under a given state name. The stateConfig object
-   * has the following acceptable properties.
-   *
-   * @param {string} name A unique state name, e.g. "home", "about", "contacts".
-   * To create a parent/child state use a dot, e.g. "about.sales", "home.newest".
-   * @param {object} stateConfig State configuration object.
-   * @param {string|function=} stateConfig.template
-   * <a id='template'></a>
-   *   html template as a string or a function that returns
-   *   an html template as a string which should be used by the uiView directives. This property 
-   *   takes precedence over templateUrl.
-   *   
-   *   If `template` is a function, it will be called with the following parameters:
-   *
-   *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by
-   *     applying the current state
-   *
-   * <pre>template:
-   *   "<h1>inline template definition</h1>" +
-   *   "<div ui-view></div>"</pre>
-   * <pre>template: function(params) {
-   *       return "<h1>generated template</h1>"; }</pre>
-   * </div>
-   *
-   * @param {string|function=} stateConfig.templateUrl
-   * <a id='templateUrl'></a>
-   *
-   *   path or function that returns a path to an html
-   *   template that should be used by uiView.
-   *   
-   *   If `templateUrl` is a function, it will be called with the following parameters:
-   *
-   *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by 
-   *     applying the current state
-   *
-   * <pre>templateUrl: "home.html"</pre>
-   * <pre>templateUrl: function(params) {
-   *     return myTemplates[params.pageId]; }</pre>
-   *
-   * @param {function=} stateConfig.templateProvider
-   * <a id='templateProvider'></a>
-   *    Provider function that returns HTML content string.
-   * <pre> templateProvider:
-   *       function(MyTemplateService, params) {
-   *         return MyTemplateService.getTemplate(params.pageId);
-   *       }</pre>
-   *
-   * @param {string|function=} stateConfig.controller
-   * <a id='controller'></a>
-   *
-   *  Controller fn that should be associated with newly
-   *   related scope or the name of a registered controller if passed as a string.
-   *   Optionally, the ControllerAs may be declared here.
-   * <pre>controller: "MyRegisteredController"</pre>
-   * <pre>controller:
-   *     "MyRegisteredController as fooCtrl"}</pre>
-   * <pre>controller: function($scope, MyService) {
-   *     $scope.data = MyService.getData(); }</pre>
-   *
-   * @param {function=} stateConfig.controllerProvider
-   * <a id='controllerProvider'></a>
-   *
-   * Injectable provider function that returns the actual controller or string.
-   * <pre>controllerProvider:
-   *   function(MyResolveData) {
-   *     if (MyResolveData.foo)
-   *       return "FooCtrl"
-   *     else if (MyResolveData.bar)
-   *       return "BarCtrl";
-   *     else return function($scope) {
-   *       $scope.baz = "Qux";
-   *     }
-   *   }</pre>
-   *
-   * @param {string=} stateConfig.controllerAs
-   * <a id='controllerAs'></a>
-   * 
-   * A controller alias name. If present the controller will be
-   *   published to scope under the controllerAs name.
-   * <pre>controllerAs: "myCtrl"</pre>
-   *
-   * @param {string|object=} stateConfig.parent
-   * <a id='parent'></a>
-   * Optionally specifies the parent state of this state.
-   *
-   * <pre>parent: 'parentState'</pre>
-   * <pre>parent: parentState // JS variable</pre>
-   *
-   * @param {object=} stateConfig.resolve
-   * <a id='resolve'></a>
-   *
-   * An optional map&lt;string, function&gt; of dependencies which
-   *   should be injected into the controller. If any of these dependencies are promises, 
-   *   the router will wait for them all to be resolved before the controller is instantiated.
-   *   If all the promises are resolved successfully, the $stateChangeSuccess event is fired
-   *   and the values of the resolved promises are injected into any controllers that reference them.
-   *   If any  of the promises are rejected the $stateChangeError event is fired.
-   *
-   *   The map object is:
-   *   
-   *   - key - {string}: name of dependency to be injected into controller
-   *   - factory - {string|function}: If string then it is alias for service. Otherwise if function, 
-   *     it is injected and return value it treated as dependency. If result is a promise, it is 
-   *     resolved before its value is injected into controller.
-   *
-   * <pre>resolve: {
-   *     myResolve1:
-   *       function($http, $stateParams) {
-   *         return $http.get("/api/foos/"+stateParams.fooID);
-   *       }
-   *     }</pre>
-   *
-   * @param {string=} stateConfig.url
-   * <a id='url'></a>
-   *
-   *   A url fragment with optional parameters. When a state is navigated or
-   *   transitioned to, the `$stateParams` service will be populated with any 
-   *   parameters that were passed.
-   *
-   *   (See {@link ui.router.util.type:UrlMatcher UrlMatcher} `UrlMatcher`} for
-   *   more details on acceptable patterns )
-   *
-   * examples:
-   * <pre>url: "/home"
-   * url: "/users/:userid"
-   * url: "/books/{bookid:[a-zA-Z_-]}"
-   * url: "/books/{categoryid:int}"
-   * url: "/books/{publishername:string}/{categoryid:int}"
-   * url: "/messages?before&after"
-   * url: "/messages?{before:date}&{after:date}"
-   * url: "/messages/:mailboxid?{before:date}&{after:date}"
-   * </pre>
-   *
-   * @param {object=} stateConfig.views
-   * <a id='views'></a>
-   * an optional map&lt;string, object&gt; which defined multiple views, or targets views
-   * manually/explicitly.
-   *
-   * Examples:
-   *
-   * Targets three named `ui-view`s in the parent state's template
-   * <pre>views: {
-   *     header: {
-   *       controller: "headerCtrl",
-   *       templateUrl: "header.html"
-   *     }, body: {
-   *       controller: "bodyCtrl",
-   *       templateUrl: "body.html"
-   *     }, footer: {
-   *       controller: "footCtrl",
-   *       templateUrl: "footer.html"
-   *     }
-   *   }</pre>
-   *
-   * Targets named `ui-view="header"` from grandparent state 'top''s template, and named `ui-view="body" from parent state's template.
-   * <pre>views: {
-   *     'header@top': {
-   *       controller: "msgHeaderCtrl",
-   *       templateUrl: "msgHeader.html"
-   *     }, 'body': {
-   *       controller: "messagesCtrl",
-   *       templateUrl: "messages.html"
-   *     }
-   *   }</pre>
-   *
-   * @param {boolean=} [stateConfig.abstract=false]
-   * <a id='abstract'></a>
-   * An abstract state will never be directly activated,
-   *   but can provide inherited properties to its common children states.
-   * <pre>abstract: true</pre>
-   *
-   * @param {function=} stateConfig.onEnter
-   * <a id='onEnter'></a>
-   *
-   * Callback function for when a state is entered. Good way
-   *   to trigger an action or dispatch an event, such as opening a dialog.
-   * If minifying your scripts, make sure to explictly annotate this function,
-   * because it won't be automatically annotated by your build tools.
-   *
-   * <pre>onEnter: function(MyService, $stateParams) {
-   *     MyService.foo($stateParams.myParam);
-   * }</pre>
-   *
-   * @param {function=} stateConfig.onExit
-   * <a id='onExit'></a>
-   *
-   * Callback function for when a state is exited. Good way to
-   *   trigger an action or dispatch an event, such as opening a dialog.
-   * If minifying your scripts, make sure to explictly annotate this function,
-   * because it won't be automatically annotated by your build tools.
-   *
-   * <pre>onExit: function(MyService, $stateParams) {
-   *     MyService.cleanup($stateParams.myParam);
-   * }</pre>
-   *
-   * @param {boolean=} [stateConfig.reloadOnSearch=true]
-   * <a id='reloadOnSearch'></a>
-   *
-   * If `false`, will not retrigger the same state
-   *   just because a search/query parameter has changed (via $location.search() or $location.hash()). 
-   *   Useful for when you'd like to modify $location.search() without triggering a reload.
-   * <pre>reloadOnSearch: false</pre>
-   *
-   * @param {object=} stateConfig.data
-   * <a id='data'></a>
-   *
-   * Arbitrary data object, useful for custom configuration.  The parent state's `data` is
-   *   prototypally inherited.  In other words, adding a data property to a state adds it to
-   *   the entire subtree via prototypal inheritance.
-   *
-   * <pre>data: {
-   *     requiredRole: 'foo'
-   * } </pre>
-   *
-   * @param {object=} stateConfig.params
-   * <a id='params'></a>
-   *
-   * A map which optionally configures parameters declared in the `url`, or
-   *   defines additional non-url parameters.  For each parameter being
-   *   configured, add a configuration object keyed to the name of the parameter.
-   *
-   *   Each parameter configuration object may contain the following properties:
-   *
-   *   - ** value ** - {object|function=}: specifies the default value for this
-   *     parameter.  This implicitly sets this parameter as optional.
-   *
-   *     When UI-Router routes to a state and no value is
-   *     specified for this parameter in the URL or transition, the
-   *     default value will be used instead.  If `value` is a function,
-   *     it will be injected and invoked, and the return value used.
-   *
-   *     *Note*: `undefined` is treated as "no default value" while `null`
-   *     is treated as "the default value is `null`".
-   *
-   *     *Shorthand*: If you only need to configure the default value of the
-   *     parameter, you may use a shorthand syntax.   In the **`params`**
-   *     map, instead mapping the param name to a full parameter configuration
-   *     object, simply set map it to the default parameter value, e.g.:
-   *
-   * <pre>// define a parameter's default value
-   * params: {
-   *     param1: { value: "defaultValue" }
-   * }
-   * // shorthand default values
-   * params: {
-   *     param1: "defaultValue",
-   *     param2: "param2Default"
-   * }</pre>
-   *
-   *   - ** array ** - {boolean=}: *(default: false)* If true, the param value will be
-   *     treated as an array of values.  If you specified a Type, the value will be
-   *     treated as an array of the specified Type.  Note: query parameter values
-   *     default to a special `"auto"` mode.
-   *
-   *     For query parameters in `"auto"` mode, if multiple  values for a single parameter
-   *     are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values
-   *     are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`).  However, if
-   *     only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single
-   *     value (e.g.: `{ foo: '1' }`).
-   *
-   * <pre>params: {
-   *     param1: { array: true }
-   * }</pre>
-   *
-   *   - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when
-   *     the current parameter value is the same as the default value. If `squash` is not set, it uses the
-   *     configured default squash policy.
-   *     (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`})
-   *
-   *   There are three squash settings:
-   *
-   *     - false: The parameter's default value is not squashed.  It is encoded and included in the URL
-   *     - true: The parameter's default value is omitted from the URL.  If the parameter is preceeded and followed
-   *       by slashes in the state's `url` declaration, then one of those slashes are omitted.
-   *       This can allow for cleaner looking URLs.
-   *     - `"<arbitrary string>"`: The parameter's default value is replaced with an arbitrary placeholder of  your choice.
-   *
-   * <pre>params: {
-   *     param1: {
-   *       value: "defaultId",
-   *       squash: true
-   * } }
-   * // squash "defaultValue" to "~"
-   * params: {
-   *     param1: {
-   *       value: "defaultValue",
-   *       squash: "~"
-   * } }
-   * </pre>
-   *
-   *
-   * @example
-   * <pre>
-   * // Some state name examples
-   *
-   * // stateName can be a single top-level name (must be unique).
-   * $stateProvider.state("home", {});
-   *
-   * // Or it can be a nested state name. This state is a child of the
-   * // above "home" state.
-   * $stateProvider.state("home.newest", {});
-   *
-   * // Nest states as deeply as needed.
-   * $stateProvider.state("home.newest.abc.xyz.inception", {});
-   *
-   * // state() returns $stateProvider, so you can chain state declarations.
-   * $stateProvider
-   *   .state("home", {})
-   *   .state("about", {})
-   *   .state("contacts", {});
-   * </pre>
-   *
-   */
-  this.state = state;
-  function state(name, definition) {
-    /*jshint validthis: true */
-    if (isObject(name)) definition = name;
-    else definition.name = name;
-    registerState(definition);
-    return this;
-  }
-
-  /**
-   * @ngdoc object
-   * @name ui.router.state.$state
-   *
-   * @requires $rootScope
-   * @requires $q
-   * @requires ui.router.state.$view
-   * @requires $injector
-   * @requires ui.router.util.$resolve
-   * @requires ui.router.state.$stateParams
-   * @requires ui.router.router.$urlRouter
-   *
-   * @property {object} params A param object, e.g. {sectionId: section.id)}, that 
-   * you'd like to test against the current active state.
-   * @property {object} current A reference to the state's config object. However 
-   * you passed it in. Useful for accessing custom data.
-   * @property {object} transition Currently pending transition. A promise that'll 
-   * resolve or reject.
-   *
-   * @description
-   * `$state` service is responsible for representing states as well as transitioning
-   * between them. It also provides interfaces to ask for current state or even states
-   * you're coming from.
-   */
-  this.$get = $get;
-  $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory'];
-  function $get(   $rootScope,   $q,   $view,   $injector,   $resolve,   $stateParams,   $urlRouter,   $location,   $urlMatcherFactory) {
-
-    var TransitionSuperseded = $q.reject(new Error('transition superseded'));
-    var TransitionPrevented = $q.reject(new Error('transition prevented'));
-    var TransitionAborted = $q.reject(new Error('transition aborted'));
-    var TransitionFailed = $q.reject(new Error('transition failed'));
-
-    // Handles the case where a state which is the target of a transition is not found, and the user
-    // can optionally retry or defer the transition
-    function handleRedirect(redirect, state, params, options) {
-      /**
-       * @ngdoc event
-       * @name ui.router.state.$state#$stateNotFound
-       * @eventOf ui.router.state.$state
-       * @eventType broadcast on root scope
-       * @description
-       * Fired when a requested state **cannot be found** using the provided state name during transition.
-       * The event is broadcast allowing any handlers a single chance to deal with the error (usually by
-       * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,
-       * you can see its three properties in the example. You can use `event.preventDefault()` to abort the
-       * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.
-       *
-       * @param {Object} event Event object.
-       * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.
-       * @param {State} fromState Current state object.
-       * @param {Object} fromParams Current state params.
-       *
-       * @example
-       *
-       * <pre>
-       * // somewhere, assume lazy.state has not been defined
-       * $state.go("lazy.state", {a:1, b:2}, {inherit:false});
-       *
-       * // somewhere else
-       * $scope.$on('$stateNotFound',
-       * function(event, unfoundState, fromState, fromParams){
-       *     console.log(unfoundState.to); // "lazy.state"
-       *     console.log(unfoundState.toParams); // {a:1, b:2}
-       *     console.log(unfoundState.options); // {inherit:false} + default options
-       * })
-       * </pre>
-       */
-      var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);
-
-      if (evt.defaultPrevented) {
-        $urlRouter.update();
-        return TransitionAborted;
-      }
-
-      if (!evt.retry) {
-        return null;
-      }
-
-      // Allow the handler to return a promise to defer state lookup retry
-      if (options.$retry) {
-        $urlRouter.update();
-        return TransitionFailed;
-      }
-      var retryTransition = $state.transition = $q.when(evt.retry);
-
-      retryTransition.then(function() {
-        if (retryTransition !== $state.transition) return TransitionSuperseded;
-        redirect.options.$retry = true;
-        return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);
-      }, function() {
-        return TransitionAborted;
-      });
-      $urlRouter.update();
-
-      return retryTransition;
-    }
-
-    root.locals = { resolve: null, globals: { $stateParams: {} } };
-
-    $state = {
-      params: {},
-      current: root.self,
-      $current: root,
-      transition: null
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#reload
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * A method that force reloads the current state. All resolves are re-resolved,
-     * controllers reinstantiated, and events re-fired.
-     *
-     * @example
-     * <pre>
-     * var app angular.module('app', ['ui.router']);
-     *
-     * app.controller('ctrl', function ($scope, $state) {
-     *   $scope.reload = function(){
-     *     $state.reload();
-     *   }
-     * });
-     * </pre>
-     *
-     * `reload()` is just an alias for:
-     * <pre>
-     * $state.transitionTo($state.current, $stateParams, { 
-     *   reload: true, inherit: false, notify: true
-     * });
-     * </pre>
-     *
-     * @param {string=|object=} state - A state name or a state object, which is the root of the resolves to be re-resolved.
-     * @example
-     * <pre>
-     * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item' 
-     * //and current state is 'contacts.detail.item'
-     * var app angular.module('app', ['ui.router']);
-     *
-     * app.controller('ctrl', function ($scope, $state) {
-     *   $scope.reload = function(){
-     *     //will reload 'contact.detail' and 'contact.detail.item' states
-     *     $state.reload('contact.detail');
-     *   }
-     * });
-     * </pre>
-     *
-     * `reload()` is just an alias for:
-     * <pre>
-     * $state.transitionTo($state.current, $stateParams, { 
-     *   reload: true, inherit: false, notify: true
-     * });
-     * </pre>
-
-     * @returns {promise} A promise representing the state of the new transition. See
-     * {@link ui.router.state.$state#methods_go $state.go}.
-     */
-    $state.reload = function reload(state) {
-      return $state.transitionTo($state.current, $stateParams, { reload: state || true, inherit: false, notify: true});
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#go
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * Convenience method for transitioning to a new state. `$state.go` calls 
-     * `$state.transitionTo` internally but automatically sets options to 
-     * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. 
-     * This allows you to easily use an absolute or relative to path and specify 
-     * only the parameters you'd like to update (while letting unspecified parameters 
-     * inherit from the currently active ancestor states).
-     *
-     * @example
-     * <pre>
-     * var app = angular.module('app', ['ui.router']);
-     *
-     * app.controller('ctrl', function ($scope, $state) {
-     *   $scope.changeState = function () {
-     *     $state.go('contact.detail');
-     *   };
-     * });
-     * </pre>
-     * <img src='../ngdoc_assets/StateGoExamples.png'/>
-     *
-     * @param {string} to Absolute state name or relative state path. Some examples:
-     *
-     * - `$state.go('contact.detail')` - will go to the `contact.detail` state
-     * - `$state.go('^')` - will go to a parent state
-     * - `$state.go('^.sibling')` - will go to a sibling state
-     * - `$state.go('.child.grandchild')` - will go to grandchild state
-     *
-     * @param {object=} params A map of the parameters that will be sent to the state, 
-     * will populate $stateParams. Any parameters that are not specified will be inherited from currently 
-     * defined parameters. This allows, for example, going to a sibling state that shares parameters
-     * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.
-     * transitioning to a sibling will get you the parameters for all parents, transitioning to a child
-     * will get you all current parameters, etc.
-     * @param {object=} options Options object. The options are:
-     *
-     * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
-     *    will not. If string, must be `"replace"`, which will update url and also replace last history record.
-     * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.
-     * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), 
-     *    defines which state to be relative from.
-     * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
-     * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params 
-     *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
-     *    use this when you want to force a reload when *everything* is the same, including search params.
-     *
-     * @returns {promise} A promise representing the state of the new transition.
-     *
-     * Possible success values:
-     *
-     * - $state.current
-     *
-     * <br/>Possible rejection values:
-     *
-     * - 'transition superseded' - when a newer transition has been started after this one
-     * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener
-     * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or
-     *   when a `$stateNotFound` `event.retry` promise errors.
-     * - 'transition failed' - when a state has been unsuccessfully found after 2 tries.
-     * - *resolve error* - when an error has occurred with a `resolve`
-     *
-     */
-    $state.go = function go(to, params, options) {
-      return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options));
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#transitionTo
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go}
-     * uses `transitionTo` internally. `$state.go` is recommended in most situations.
-     *
-     * @example
-     * <pre>
-     * var app = angular.module('app', ['ui.router']);
-     *
-     * app.controller('ctrl', function ($scope, $state) {
-     *   $scope.changeState = function () {
-     *     $state.transitionTo('contact.detail');
-     *   };
-     * });
-     * </pre>
-     *
-     * @param {string} to State name.
-     * @param {object=} toParams A map of the parameters that will be sent to the state,
-     * will populate $stateParams.
-     * @param {object=} options Options object. The options are:
-     *
-     * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
-     *    will not. If string, must be `"replace"`, which will update url and also replace last history record.
-     * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.
-     * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), 
-     *    defines which state to be relative from.
-     * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
-     * - **`reload`** (v0.2.5) - {boolean=false|string=|object=}, If `true` will force transition even if the state or params 
-     *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
-     *    use this when you want to force a reload when *everything* is the same, including search params.
-     *    if String, then will reload the state with the name given in reload, and any children.
-     *    if Object, then a stateObj is expected, will reload the state found in stateObj, and any children.
-     *
-     * @returns {promise} A promise representing the state of the new transition. See
-     * {@link ui.router.state.$state#methods_go $state.go}.
-     */
-    $state.transitionTo = function transitionTo(to, toParams, options) {
-      toParams = toParams || {};
-      options = extend({
-        location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false
-      }, options || {});
-
-      var from = $state.$current, fromParams = $state.params, fromPath = from.path;
-      var evt, toState = findState(to, options.relative);
-
-      // Store the hash param for later (since it will be stripped out by various methods)
-      var hash = toParams['#'];
-
-      if (!isDefined(toState)) {
-        var redirect = { to: to, toParams: toParams, options: options };
-        var redirectResult = handleRedirect(redirect, from.self, fromParams, options);
-
-        if (redirectResult) {
-          return redirectResult;
-        }
-
-        // Always retry once if the $stateNotFound was not prevented
-        // (handles either redirect changed or state lazy-definition)
-        to = redirect.to;
-        toParams = redirect.toParams;
-        options = redirect.options;
-        toState = findState(to, options.relative);
-
-        if (!isDefined(toState)) {
-          if (!options.relative) throw new Error("No such state '" + to + "'");
-          throw new Error("Could not resolve '" + to + "' from state '" + options.relative + "'");
-        }
-      }
-      if (toState[abstractKey]) throw new Error("Cannot transition to abstract state '" + to + "'");
-      if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState);
-      if (!toState.params.$$validates(toParams)) return TransitionFailed;
-
-      toParams = toState.params.$$values(toParams);
-      to = toState;
-
-      var toPath = to.path;
-
-      // Starting from the root of the path, keep all levels that haven't changed
-      var keep = 0, state = toPath[keep], locals = root.locals, toLocals = [];
-
-      if (!options.reload) {
-        while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) {
-          locals = toLocals[keep] = state.locals;
-          keep++;
-          state = toPath[keep];
-        }
-      } else if (isString(options.reload) || isObject(options.reload)) {
-        if (isObject(options.reload) && !options.reload.name) {
-          throw new Error('Invalid reload state object');
-        }
-        
-        var reloadState = options.reload === true ? fromPath[0] : findState(options.reload);
-        if (options.reload && !reloadState) {
-          throw new Error("No such reload state '" + (isString(options.reload) ? options.reload : options.reload.name) + "'");
-        }
-
-        while (state && state === fromPath[keep] && state !== reloadState) {
-          locals = toLocals[keep] = state.locals;
-          keep++;
-          state = toPath[keep];
-        }
-      }
-
-      // If we're going to the same state and all locals are kept, we've got nothing to do.
-      // But clear 'transition', as we still want to cancel any other pending transitions.
-      // TODO: We may not want to bump 'transition' if we're called from a location change
-      // that we've initiated ourselves, because we might accidentally abort a legitimate
-      // transition initiated from code?
-      if (shouldSkipReload(to, toParams, from, fromParams, locals, options)) {
-        if (hash) toParams['#'] = hash;
-        $state.params = toParams;
-        copy($state.params, $stateParams);
-        if (options.location && to.navigable && to.navigable.url) {
-          $urlRouter.push(to.navigable.url, toParams, {
-            $$avoidResync: true, replace: options.location === 'replace'
-          });
-          $urlRouter.update(true);
-        }
-        $state.transition = null;
-        return $q.when($state.current);
-      }
-
-      // Filter parameters before we pass them to event handlers etc.
-      toParams = filterByKeys(to.params.$$keys(), toParams || {});
-
-      // Broadcast start event and cancel the transition if requested
-      if (options.notify) {
-        /**
-         * @ngdoc event
-         * @name ui.router.state.$state#$stateChangeStart
-         * @eventOf ui.router.state.$state
-         * @eventType broadcast on root scope
-         * @description
-         * Fired when the state transition **begins**. You can use `event.preventDefault()`
-         * to prevent the transition from happening and then the transition promise will be
-         * rejected with a `'transition prevented'` value.
-         *
-         * @param {Object} event Event object.
-         * @param {State} toState The state being transitioned to.
-         * @param {Object} toParams The params supplied to the `toState`.
-         * @param {State} fromState The current state, pre-transition.
-         * @param {Object} fromParams The params supplied to the `fromState`.
-         *
-         * @example
-         *
-         * <pre>
-         * $rootScope.$on('$stateChangeStart',
-         * function(event, toState, toParams, fromState, fromParams){
-         *     event.preventDefault();
-         *     // transitionTo() promise will be rejected with
-         *     // a 'transition prevented' error
-         * })
-         * </pre>
-         */
-        if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams).defaultPrevented) {
-          $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams);
-          $urlRouter.update();
-          return TransitionPrevented;
-        }
-      }
-
-      // Resolve locals for the remaining states, but don't update any global state just
-      // yet -- if anything fails to resolve the current state needs to remain untouched.
-      // We also set up an inheritance chain for the locals here. This allows the view directive
-      // to quickly look up the correct definition for each view in the current state. Even
-      // though we create the locals object itself outside resolveState(), it is initially
-      // empty and gets filled asynchronously. We need to keep track of the promise for the
-      // (fully resolved) current locals, and pass this down the chain.
-      var resolved = $q.when(locals);
-
-      for (var l = keep; l < toPath.length; l++, state = toPath[l]) {
-        locals = toLocals[l] = inherit(locals);
-        resolved = resolveState(state, toParams, state === to, resolved, locals, options);
-      }
-
-      // Once everything is resolved, we are ready to perform the actual transition
-      // and return a promise for the new state. We also keep track of what the
-      // current promise is, so that we can detect overlapping transitions and
-      // keep only the outcome of the last transition.
-      var transition = $state.transition = resolved.then(function () {
-        var l, entering, exiting;
-
-        if ($state.transition !== transition) return TransitionSuperseded;
-
-        // Exit 'from' states not kept
-        for (l = fromPath.length - 1; l >= keep; l--) {
-          exiting = fromPath[l];
-          if (exiting.self.onExit) {
-            $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals);
-          }
-          exiting.locals = null;
-        }
-
-        // Enter 'to' states not kept
-        for (l = keep; l < toPath.length; l++) {
-          entering = toPath[l];
-          entering.locals = toLocals[l];
-          if (entering.self.onEnter) {
-            $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals);
-          }
-        }
-
-        // Re-add the saved hash before we start returning things
-        if (hash) toParams['#'] = hash;
-
-        // Run it again, to catch any transitions in callbacks
-        if ($state.transition !== transition) return TransitionSuperseded;
-
-        // Update globals in $state
-        $state.$current = to;
-        $state.current = to.self;
-        $state.params = toParams;
-        copy($state.params, $stateParams);
-        $state.transition = null;
-
-        if (options.location && to.navigable) {
-          $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, {
-            $$avoidResync: true, replace: options.location === 'replace'
-          });
-        }
-
-        if (options.notify) {
-        /**
-         * @ngdoc event
-         * @name ui.router.state.$state#$stateChangeSuccess
-         * @eventOf ui.router.state.$state
-         * @eventType broadcast on root scope
-         * @description
-         * Fired once the state transition is **complete**.
-         *
-         * @param {Object} event Event object.
-         * @param {State} toState The state being transitioned to.
-         * @param {Object} toParams The params supplied to the `toState`.
-         * @param {State} fromState The current state, pre-transition.
-         * @param {Object} fromParams The params supplied to the `fromState`.
-         */
-          $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams);
-        }
-        $urlRouter.update(true);
-
-        return $state.current;
-      }, function (error) {
-        if ($state.transition !== transition) return TransitionSuperseded;
-
-        $state.transition = null;
-        /**
-         * @ngdoc event
-         * @name ui.router.state.$state#$stateChangeError
-         * @eventOf ui.router.state.$state
-         * @eventType broadcast on root scope
-         * @description
-         * Fired when an **error occurs** during transition. It's important to note that if you
-         * have any errors in your resolve functions (javascript errors, non-existent services, etc)
-         * they will not throw traditionally. You must listen for this $stateChangeError event to
-         * catch **ALL** errors.
-         *
-         * @param {Object} event Event object.
-         * @param {State} toState The state being transitioned to.
-         * @param {Object} toParams The params supplied to the `toState`.
-         * @param {State} fromState The current state, pre-transition.
-         * @param {Object} fromParams The params supplied to the `fromState`.
-         * @param {Error} error The resolve error object.
-         */
-        evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error);
-
-        if (!evt.defaultPrevented) {
-            $urlRouter.update();
-        }
-
-        return $q.reject(error);
-      });
-
-      return transition;
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#is
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * Similar to {@link ui.router.state.$state#methods_includes $state.includes},
-     * but only checks for the full state name. If params is supplied then it will be
-     * tested for strict equality against the current active params object, so all params
-     * must match with none missing and no extras.
-     *
-     * @example
-     * <pre>
-     * $state.$current.name = 'contacts.details.item';
-     *
-     * // absolute name
-     * $state.is('contact.details.item'); // returns true
-     * $state.is(contactDetailItemStateObject); // returns true
-     *
-     * // relative name (. and ^), typically from a template
-     * // E.g. from the 'contacts.details' template
-     * <div ng-class="{highlighted: $state.is('.item')}">Item</div>
-     * </pre>
-     *
-     * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check.
-     * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like
-     * to test against the current active state.
-     * @param {object=} options An options object.  The options are:
-     *
-     * - **`relative`** - {string|object} -  If `stateOrName` is a relative state name and `options.relative` is set, .is will
-     * test relative to `options.relative` state (or name).
-     *
-     * @returns {boolean} Returns true if it is the state.
-     */
-    $state.is = function is(stateOrName, params, options) {
-      options = extend({ relative: $state.$current }, options || {});
-      var state = findState(stateOrName, options.relative);
-
-      if (!isDefined(state)) { return undefined; }
-      if ($state.$current !== state) { return false; }
-      return params ? equalForKeys(state.params.$$values(params), $stateParams) : true;
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#includes
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * A method to determine if the current active state is equal to or is the child of the
-     * state stateName. If any params are passed then they will be tested for a match as well.
-     * Not all the parameters need to be passed, just the ones you'd like to test for equality.
-     *
-     * @example
-     * Partial and relative names
-     * <pre>
-     * $state.$current.name = 'contacts.details.item';
-     *
-     * // Using partial names
-     * $state.includes("contacts"); // returns true
-     * $state.includes("contacts.details"); // returns true
-     * $state.includes("contacts.details.item"); // returns true
-     * $state.includes("contacts.list"); // returns false
-     * $state.includes("about"); // returns false
-     *
-     * // Using relative names (. and ^), typically from a template
-     * // E.g. from the 'contacts.details' template
-     * <div ng-class="{highlighted: $state.includes('.item')}">Item</div>
-     * </pre>
-     *
-     * Basic globbing patterns
-     * <pre>
-     * $state.$current.name = 'contacts.details.item.url';
-     *
-     * $state.includes("*.details.*.*"); // returns true
-     * $state.includes("*.details.**"); // returns true
-     * $state.includes("**.item.**"); // returns true
-     * $state.includes("*.details.item.url"); // returns true
-     * $state.includes("*.details.*.url"); // returns true
-     * $state.includes("*.details.*"); // returns false
-     * $state.includes("item.**"); // returns false
-     * </pre>
-     *
-     * @param {string} stateOrName A partial name, relative name, or glob pattern
-     * to be searched for within the current state name.
-     * @param {object=} params A param object, e.g. `{sectionId: section.id}`,
-     * that you'd like to test against the current active state.
-     * @param {object=} options An options object.  The options are:
-     *
-     * - **`relative`** - {string|object=} -  If `stateOrName` is a relative state reference and `options.relative` is set,
-     * .includes will test relative to `options.relative` state (or name).
-     *
-     * @returns {boolean} Returns true if it does include the state
-     */
-    $state.includes = function includes(stateOrName, params, options) {
-      options = extend({ relative: $state.$current }, options || {});
-      if (isString(stateOrName) && isGlob(stateOrName)) {
-        if (!doesStateMatchGlob(stateOrName)) {
-          return false;
-        }
-        stateOrName = $state.$current.name;
-      }
-
-      var state = findState(stateOrName, options.relative);
-      if (!isDefined(state)) { return undefined; }
-      if (!isDefined($state.$current.includes[state.name])) { return false; }
-      return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true;
-    };
-
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#href
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * A url generation method that returns the compiled url for the given state populated with the given params.
-     *
-     * @example
-     * <pre>
-     * expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob");
-     * </pre>
-     *
-     * @param {string|object} stateOrName The state name or state object you'd like to generate a url from.
-     * @param {object=} params An object of parameter values to fill the state's required parameters.
-     * @param {object=} options Options object. The options are:
-     *
-     * - **`lossy`** - {boolean=true} -  If true, and if there is no url associated with the state provided in the
-     *    first parameter, then the constructed href url will be built from the first navigable ancestor (aka
-     *    ancestor with a valid url).
-     * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.
-     * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), 
-     *    defines which state to be relative from.
-     * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
-     * 
-     * @returns {string} compiled state url
-     */
-    $state.href = function href(stateOrName, params, options) {
-      options = extend({
-        lossy:    true,
-        inherit:  true,
-        absolute: false,
-        relative: $state.$current
-      }, options || {});
-
-      var state = findState(stateOrName, options.relative);
-
-      if (!isDefined(state)) return null;
-      if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state);
-      
-      var nav = (state && options.lossy) ? state.navigable : state;
-
-      if (!nav || nav.url === undefined || nav.url === null) {
-        return null;
-      }
-      return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys().concat('#'), params || {}), {
-        absolute: options.absolute
-      });
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#get
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * Returns the state configuration object for any specific state or all states.
-     *
-     * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for
-     * the requested state. If not provided, returns an array of ALL state configs.
-     * @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context.
-     * @returns {Object|Array} State configuration object or array of all objects.
-     */
-    $state.get = function (stateOrName, context) {
-      if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; });
-      var state = findState(stateOrName, context || $state.$current);
-      return (state && state.self) ? state.self : null;
-    };
-
-    function resolveState(state, params, paramsAreFiltered, inherited, dst, options) {
-      // Make a restricted $stateParams with only the parameters that apply to this state if
-      // necessary. In addition to being available to the controller and onEnter/onExit callbacks,
-      // we also need $stateParams to be available for any $injector calls we make during the
-      // dependency resolution process.
-      var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params);
-      var locals = { $stateParams: $stateParams };
-
-      // Resolve 'global' dependencies for the state, i.e. those not specific to a view.
-      // We're also including $stateParams in this; that way the parameters are restricted
-      // to the set that should be visible to the state, and are independent of when we update
-      // the global $state and $stateParams values.
-      dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state);
-      var promises = [dst.resolve.then(function (globals) {
-        dst.globals = globals;
-      })];
-      if (inherited) promises.push(inherited);
-
-      function resolveViews() {
-        var viewsPromises = [];
-
-        // Resolve template and dependencies for all views.
-        forEach(state.views, function (view, name) {
-          var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {});
-          injectables.$template = [ function () {
-            return $view.load(name, { view: view, locals: dst.globals, params: $stateParams, notify: options.notify }) || '';
-          }];
-
-          viewsPromises.push($resolve.resolve(injectables, dst.globals, dst.resolve, state).then(function (result) {
-            // References to the controller (only instantiated at link time)
-            if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) {
-              var injectLocals = angular.extend({}, injectables, dst.globals);
-              result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals);
-            } else {
-              result.$$controller = view.controller;
-            }
-            // Provide access to the state itself for internal use
-            result.$$state = state;
-            result.$$controllerAs = view.controllerAs;
-            dst[name] = result;
-          }));
-        });
-
-        return $q.all(viewsPromises).then(function(){
-          return dst.globals;
-        });
-      }
-
-      // Wait for all the promises and then return the activation object
-      return $q.all(promises).then(resolveViews).then(function (values) {
-        return dst;
-      });
-    }
-
-    return $state;
-  }
-
-  function shouldSkipReload(to, toParams, from, fromParams, locals, options) {
-    // Return true if there are no differences in non-search (path/object) params, false if there are differences
-    function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {
-      // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.
-      function notSearchParam(key) {
-        return fromAndToState.params[key].location != "search";
-      }
-      var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);
-      var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));
-      var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);
-      return nonQueryParamSet.$$equals(fromParams, toParams);
-    }
-
-    // If reload was not explicitly requested
-    // and we're transitioning to the same state we're already in
-    // and    the locals didn't change
-    //     or they changed in a way that doesn't merit reloading
-    //        (reloadOnParams:false, or reloadOnSearch.false and only search params changed)
-    // Then return true.
-    if (!options.reload && to === from &&
-      (locals === from.locals || (to.self.reloadOnSearch === false && nonSearchParamsEqual(from, fromParams, toParams)))) {
-      return true;
-    }
-  }
-}
-
-angular.module('ui.router.state')
-  .value('$stateParams', {})
-  .provider('$state', $StateProvider);
-
-
-$ViewProvider.$inject = [];
-function $ViewProvider() {
-
-  this.$get = $get;
-  /**
-   * @ngdoc object
-   * @name ui.router.state.$view
-   *
-   * @requires ui.router.util.$templateFactory
-   * @requires $rootScope
-   *
-   * @description
-   *
-   */
-  $get.$inject = ['$rootScope', '$templateFactory'];
-  function $get(   $rootScope,   $templateFactory) {
-    return {
-      // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })
-      /**
-       * @ngdoc function
-       * @name ui.router.state.$view#load
-       * @methodOf ui.router.state.$view
-       *
-       * @description
-       *
-       * @param {string} name name
-       * @param {object} options option object.
-       */
-      load: function load(name, options) {
-        var result, defaults = {
-          template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}
-        };
-        options = extend(defaults, options);
-
-        if (options.view) {
-          result = $templateFactory.fromConfig(options.view, options.params, options.locals);
-        }
-        if (result && options.notify) {
-        /**
-         * @ngdoc event
-         * @name ui.router.state.$state#$viewContentLoading
-         * @eventOf ui.router.state.$view
-         * @eventType broadcast on root scope
-         * @description
-         *
-         * Fired once the view **begins loading**, *before* the DOM is rendered.
-         *
-         * @param {Object} event Event object.
-         * @param {Object} viewConfig The view config properties (template, controller, etc).
-         *
-         * @example
-         *
-         * <pre>
-         * $scope.$on('$viewContentLoading',
-         * function(event, viewConfig){
-         *     // Access to all the view config properties.
-         *     // and one special property 'targetView'
-         *     // viewConfig.targetView
-         * });
-         * </pre>
-         */
-          $rootScope.$broadcast('$viewContentLoading', options);
-        }
-        return result;
-      }
-    };
-  }
-}
-
-angular.module('ui.router.state').provider('$view', $ViewProvider);
-
-/**
- * @ngdoc object
- * @name ui.router.state.$uiViewScrollProvider
- *
- * @description
- * Provider that returns the {@link ui.router.state.$uiViewScroll} service function.
- */
-function $ViewScrollProvider() {
-
-  var useAnchorScroll = false;
-
-  /**
-   * @ngdoc function
-   * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll
-   * @methodOf ui.router.state.$uiViewScrollProvider
-   *
-   * @description
-   * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for
-   * scrolling based on the url anchor.
-   */
-  this.useAnchorScroll = function () {
-    useAnchorScroll = true;
-  };
-
-  /**
-   * @ngdoc object
-   * @name ui.router.state.$uiViewScroll
-   *
-   * @requires $anchorScroll
-   * @requires $timeout
-   *
-   * @description
-   * When called with a jqLite element, it scrolls the element into view (after a
-   * `$timeout` so the DOM has time to refresh).
-   *
-   * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,
-   * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}.
-   */
-  this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {
-    if (useAnchorScroll) {
-      return $anchorScroll;
-    }
-
-    return function ($element) {
-      return $timeout(function () {
-        $element[0].scrollIntoView();
-      }, 0, false);
-    };
-  }];
-}
-
-angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);
-
-/**
- * @ngdoc directive
- * @name ui.router.state.directive:ui-view
- *
- * @requires ui.router.state.$state
- * @requires $compile
- * @requires $controller
- * @requires $injector
- * @requires ui.router.state.$uiViewScroll
- * @requires $document
- *
- * @restrict ECA
- *
- * @description
- * The ui-view directive tells $state where to place your templates.
- *
- * @param {string=} name A view name. The name should be unique amongst the other views in the
- * same state. You can have views of the same name that live in different states.
- *
- * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window
- * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll
- * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you
- * scroll ui-view elements into view when they are populated during a state activation.
- *
- * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)
- * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*
- *
- * @param {string=} onload Expression to evaluate whenever the view updates.
- * 
- * @example
- * A view can be unnamed or named. 
- * <pre>
- * <!-- Unnamed -->
- * <div ui-view></div> 
- * 
- * <!-- Named -->
- * <div ui-view="viewName"></div>
- * </pre>
- *
- * You can only have one unnamed view within any template (or root html). If you are only using a 
- * single view and it is unnamed then you can populate it like so:
- * <pre>
- * <div ui-view></div> 
- * $stateProvider.state("home", {
- *   template: "<h1>HELLO!</h1>"
- * })
- * </pre>
- * 
- * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`}
- * config property, by name, in this case an empty name:
- * <pre>
- * $stateProvider.state("home", {
- *   views: {
- *     "": {
- *       template: "<h1>HELLO!</h1>"
- *     }
- *   }    
- * })
- * </pre>
- * 
- * But typically you'll only use the views property if you name your view or have more than one view 
- * in the same template. There's not really a compelling reason to name a view if its the only one, 
- * but you could if you wanted, like so:
- * <pre>
- * <div ui-view="main"></div>
- * </pre> 
- * <pre>
- * $stateProvider.state("home", {
- *   views: {
- *     "main": {
- *       template: "<h1>HELLO!</h1>"
- *     }
- *   }    
- * })
- * </pre>
- * 
- * Really though, you'll use views to set up multiple views:
- * <pre>
- * <div ui-view></div>
- * <div ui-view="chart"></div> 
- * <div ui-view="data"></div> 
- * </pre>
- * 
- * <pre>
- * $stateProvider.state("home", {
- *   views: {
- *     "": {
- *       template: "<h1>HELLO!</h1>"
- *     },
- *     "chart": {
- *       template: "<chart_thing/>"
- *     },
- *     "data": {
- *       template: "<data_thing/>"
- *     }
- *   }    
- * })
- * </pre>
- *
- * Examples for `autoscroll`:
- *
- * <pre>
- * <!-- If autoscroll present with no expression,
- *      then scroll ui-view into view -->
- * <ui-view autoscroll/>
- *
- * <!-- If autoscroll present with valid expression,
- *      then scroll ui-view into view if expression evaluates to true -->
- * <ui-view autoscroll='true'/>
- * <ui-view autoscroll='false'/>
- * <ui-view autoscroll='scopeVariable'/>
- * </pre>
- */
-$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate'];
-function $ViewDirective(   $state,   $injector,   $uiViewScroll,   $interpolate) {
-
-  function getService() {
-    return ($injector.has) ? function(service) {
-      return $injector.has(service) ? $injector.get(service) : null;
-    } : function(service) {
-      try {
-        return $injector.get(service);
-      } catch (e) {
-        return null;
-      }
-    };
-  }
-
-  var service = getService(),
-      $animator = service('$animator'),
-      $animate = service('$animate');
-
-  // Returns a set of DOM manipulation functions based on which Angular version
-  // it should use
-  function getRenderer(attrs, scope) {
-    var statics = function() {
-      return {
-        enter: function (element, target, cb) { target.after(element); cb(); },
-        leave: function (element, cb) { element.remove(); cb(); }
-      };
-    };
-
-    if ($animate) {
-      return {
-        enter: function(element, target, cb) {
-          var promise = $animate.enter(element, null, target, cb);
-          if (promise && promise.then) promise.then(cb);
-        },
-        leave: function(element, cb) {
-          var promise = $animate.leave(element, cb);
-          if (promise && promise.then) promise.then(cb);
-        }
-      };
-    }
-
-    if ($animator) {
-      var animate = $animator && $animator(scope, attrs);
-
-      return {
-        enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },
-        leave: function(element, cb) { animate.leave(element); cb(); }
-      };
-    }
-
-    return statics();
-  }
-
-  var directive = {
-    restrict: 'ECA',
-    terminal: true,
-    priority: 400,
-    transclude: 'element',
-    compile: function (tElement, tAttrs, $transclude) {
-      return function (scope, $element, attrs) {
-        var previousEl, currentEl, currentScope, latestLocals,
-            onloadExp     = attrs.onload || '',
-            autoScrollExp = attrs.autoscroll,
-            renderer      = getRenderer(attrs, scope);
-
-        scope.$on('$stateChangeSuccess', function() {
-          updateView(false);
-        });
-        scope.$on('$viewContentLoading', function() {
-          updateView(false);
-        });
-
-        updateView(true);
-
-        function cleanupLastView() {
-          if (previousEl) {
-            previousEl.remove();
-            previousEl = null;
-          }
-
-          if (currentScope) {
-            currentScope.$destroy();
-            currentScope = null;
-          }
-
-          if (currentEl) {
-            renderer.leave(currentEl, function() {
-              previousEl = null;
-            });
-
-            previousEl = currentEl;
-            currentEl = null;
-          }
-        }
-
-        function updateView(firstTime) {
-          var newScope,
-              name            = getUiViewName(scope, attrs, $element, $interpolate),
-              previousLocals  = name && $state.$current && $state.$current.locals[name];
-
-          if (!firstTime && previousLocals === latestLocals) return; // nothing to do
-          newScope = scope.$new();
-          latestLocals = $state.$current.locals[name];
-
-          var clone = $transclude(newScope, function(clone) {
-            renderer.enter(clone, $element, function onUiViewEnter() {
-              if(currentScope) {
-                currentScope.$emit('$viewContentAnimationEnded');
-              }
-
-              if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {
-                $uiViewScroll(clone);
-              }
-            });
-            cleanupLastView();
-          });
-
-          currentEl = clone;
-          currentScope = newScope;
-          /**
-           * @ngdoc event
-           * @name ui.router.state.directive:ui-view#$viewContentLoaded
-           * @eventOf ui.router.state.directive:ui-view
-           * @eventType emits on ui-view directive scope
-           * @description           *
-           * Fired once the view is **loaded**, *after* the DOM is rendered.
-           *
-           * @param {Object} event Event object.
-           */
-          currentScope.$emit('$viewContentLoaded');
-          currentScope.$eval(onloadExp);
-        }
-      };
-    }
-  };
-
-  return directive;
-}
-
-$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate'];
-function $ViewDirectiveFill (  $compile,   $controller,   $state,   $interpolate) {
-  return {
-    restrict: 'ECA',
-    priority: -400,
-    compile: function (tElement) {
-      var initial = tElement.html();
-      return function (scope, $element, attrs) {
-        var current = $state.$current,
-            name = getUiViewName(scope, attrs, $element, $interpolate),
-            locals  = current && current.locals[name];
-
-        if (! locals) {
-          return;
-        }
-
-        $element.data('$uiView', { name: name, state: locals.$$state });
-        $element.html(locals.$template ? locals.$template : initial);
-
-        var link = $compile($element.contents());
-
-        if (locals.$$controller) {
-          locals.$scope = scope;
-          locals.$element = $element;
-          var controller = $controller(locals.$$controller, locals);
-          if (locals.$$controllerAs) {
-            scope[locals.$$controllerAs] = controller;
-          }
-          $element.data('$ngControllerController', controller);
-          $element.children().data('$ngControllerController', controller);
-        }
-
-        link(scope);
-      };
-    }
-  };
-}
-
-/**
- * Shared ui-view code for both directives:
- * Given scope, element, and its attributes, return the view's name
- */
-function getUiViewName(scope, attrs, element, $interpolate) {
-  var name = $interpolate(attrs.uiView || attrs.name || '')(scope);
-  var inherited = element.inheritedData('$uiView');
-  return name.indexOf('@') >= 0 ?  name :  (name + '@' + (inherited ? inherited.state.name : ''));
-}
-
-angular.module('ui.router.state').directive('uiView', $ViewDirective);
-angular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);
-
-function parseStateRef(ref, current) {
-  var preparsed = ref.match(/^\s*({[^}]*})\s*$/), parsed;
-  if (preparsed) ref = current + '(' + preparsed[1] + ')';
-  parsed = ref.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/);
-  if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'");
-  return { state: parsed[1], paramExpr: parsed[3] || null };
-}
-
-function stateContext(el) {
-  var stateData = el.parent().inheritedData('$uiView');
-
-  if (stateData && stateData.state && stateData.state.name) {
-    return stateData.state;
-  }
-}
-
-/**
- * @ngdoc directive
- * @name ui.router.state.directive:ui-sref
- *
- * @requires ui.router.state.$state
- * @requires $timeout
- *
- * @restrict A
- *
- * @description
- * A directive that binds a link (`<a>` tag) to a state. If the state has an associated 
- * URL, the directive will automatically generate & update the `href` attribute via 
- * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking 
- * the link will trigger a state transition with optional parameters. 
- *
- * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be 
- * handled natively by the browser.
- *
- * You can also use relative state paths within ui-sref, just like the relative 
- * paths passed to `$state.go()`. You just need to be aware that the path is relative
- * to the state that the link lives in, in other words the state that loaded the 
- * template containing the link.
- *
- * You can specify options to pass to {@link ui.router.state.$state#go $state.go()}
- * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,
- * and `reload`.
- *
- * @example
- * Here's an example of how you'd use ui-sref and how it would compile. If you have the 
- * following template:
- * <pre>
- * <a ui-sref="home">Home</a> | <a ui-sref="about">About</a> | <a ui-sref="{page: 2}">Next page</a>
- * 
- * <ul>
- *     <li ng-repeat="contact in contacts">
- *         <a ui-sref="contacts.detail({ id: contact.id })">{{ contact.name }}</a>
- *     </li>
- * </ul>
- * </pre>
- * 
- * Then the compiled html would be (assuming Html5Mode is off and current state is contacts):
- * <pre>
- * <a href="#/home" ui-sref="home">Home</a> | <a href="#/about" ui-sref="about">About</a> | <a href="#/contacts?page=2" ui-sref="{page: 2}">Next page</a>
- * 
- * <ul>
- *     <li ng-repeat="contact in contacts">
- *         <a href="#/contacts/1" ui-sref="contacts.detail({ id: contact.id })">Joe</a>
- *     </li>
- *     <li ng-repeat="contact in contacts">
- *         <a href="#/contacts/2" ui-sref="contacts.detail({ id: contact.id })">Alice</a>
- *     </li>
- *     <li ng-repeat="contact in contacts">
- *         <a href="#/contacts/3" ui-sref="contacts.detail({ id: contact.id })">Bob</a>
- *     </li>
- * </ul>
- *
- * <a ui-sref="home" ui-sref-opts="{reload: true}">Home</a>
- * </pre>
- *
- * @param {string} ui-sref 'stateName' can be any valid absolute or relative state
- * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()}
- */
-$StateRefDirective.$inject = ['$state', '$timeout'];
-function $StateRefDirective($state, $timeout) {
-  var allowedOptions = ['location', 'inherit', 'reload', 'absolute'];
-
-  return {
-    restrict: 'A',
-    require: ['?^uiSrefActive', '?^uiSrefActiveEq'],
-    link: function(scope, element, attrs, uiSrefActive) {
-      var ref = parseStateRef(attrs.uiSref, $state.current.name);
-      var params = null, url = null, base = stateContext(element) || $state.$current;
-      // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
-      var hrefKind = Object.prototype.toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?
-                 'xlink:href' : 'href';
-      var newHref = null, isAnchor = element.prop("tagName").toUpperCase() === "A";
-      var isForm = element[0].nodeName === "FORM";
-      var attr = isForm ? "action" : hrefKind, nav = true;
-
-      var options = { relative: base, inherit: true };
-      var optionsOverride = scope.$eval(attrs.uiSrefOpts) || {};
-
-      angular.forEach(allowedOptions, function(option) {
-        if (option in optionsOverride) {
-          options[option] = optionsOverride[option];
-        }
-      });
-
-      var update = function(newVal) {
-        if (newVal) params = angular.copy(newVal);
-        if (!nav) return;
-
-        newHref = $state.href(ref.state, params, options);
-
-        var activeDirective = uiSrefActive[1] || uiSrefActive[0];
-        if (activeDirective) {
-          activeDirective.$$addStateInfo(ref.state, params);
-        }
-        if (newHref === null) {
-          nav = false;
-          return false;
-        }
-        attrs.$set(attr, newHref);
-      };
-
-      if (ref.paramExpr) {
-        scope.$watch(ref.paramExpr, function(newVal, oldVal) {
-          if (newVal !== params) update(newVal);
-        }, true);
-        params = angular.copy(scope.$eval(ref.paramExpr));
-      }
-      update();
-
-      if (isForm) return;
-
-      element.bind("click", function(e) {
-        var button = e.which || e.button;
-        if ( !(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target')) ) {
-          // HACK: This is to allow ng-clicks to be processed before the transition is initiated:
-          var transition = $timeout(function() {
-            $state.go(ref.state, params, options);
-          });
-          e.preventDefault();
-
-          // if the state has no URL, ignore one preventDefault from the <a> directive.
-          var ignorePreventDefaultCount = isAnchor && !newHref ? 1: 0;
-          e.preventDefault = function() {
-            if (ignorePreventDefaultCount-- <= 0)
-              $timeout.cancel(transition);
-          };
-        }
-      });
-    }
-  };
-}
-
-/**
- * @ngdoc directive
- * @name ui.router.state.directive:ui-sref-active
- *
- * @requires ui.router.state.$state
- * @requires ui.router.state.$stateParams
- * @requires $interpolate
- *
- * @restrict A
- *
- * @description
- * A directive working alongside ui-sref to add classes to an element when the
- * related ui-sref directive's state is active, and removing them when it is inactive.
- * The primary use-case is to simplify the special appearance of navigation menus
- * relying on `ui-sref`, by having the "active" state's menu button appear different,
- * distinguishing it from the inactive menu items.
- *
- * ui-sref-active can live on the same element as ui-sref or on a parent element. The first
- * ui-sref-active found at the same level or above the ui-sref will be used.
- *
- * Will activate when the ui-sref's target state or any child state is active. If you
- * need to activate only when the ui-sref target state is active and *not* any of
- * it's children, then you will use
- * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq}
- *
- * @example
- * Given the following template:
- * <pre>
- * <ul>
- *   <li ui-sref-active="active" class="item">
- *     <a href ui-sref="app.user({user: 'bilbobaggins'})">@bilbobaggins</a>
- *   </li>
- * </ul>
- * </pre>
- *
- *
- * When the app state is "app.user" (or any children states), and contains the state parameter "user" with value "bilbobaggins",
- * the resulting HTML will appear as (note the 'active' class):
- * <pre>
- * <ul>
- *   <li ui-sref-active="active" class="item active">
- *     <a ui-sref="app.user({user: 'bilbobaggins'})" href="/users/bilbobaggins">@bilbobaggins</a>
- *   </li>
- * </ul>
- * </pre>
- *
- * The class name is interpolated **once** during the directives link time (any further changes to the
- * interpolated value are ignored).
- *
- * Multiple classes may be specified in a space-separated format:
- * <pre>
- * <ul>
- *   <li ui-sref-active='class1 class2 class3'>
- *     <a ui-sref="app.user">link</a>
- *   </li>
- * </ul>
- * </pre>
- */
-
-/**
- * @ngdoc directive
- * @name ui.router.state.directive:ui-sref-active-eq
- *
- * @requires ui.router.state.$state
- * @requires ui.router.state.$stateParams
- * @requires $interpolate
- *
- * @restrict A
- *
- * @description
- * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate
- * when the exact target state used in the `ui-sref` is active; no child states.
- *
- */
-$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];
-function $StateRefActiveDirective($state, $stateParams, $interpolate) {
-  return  {
-    restrict: "A",
-    controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
-      var states = [], activeClass;
-
-      // There probably isn't much point in $observing this
-      // uiSrefActive and uiSrefActiveEq share the same directive object with some
-      // slight difference in logic routing
-      activeClass = $interpolate($attrs.uiSrefActiveEq || $attrs.uiSrefActive || '', false)($scope);
-
-      // Allow uiSref to communicate with uiSrefActive[Equals]
-      this.$$addStateInfo = function (newState, newParams) {
-        var state = $state.get(newState, stateContext($element));
-
-        states.push({
-          state: state || { name: newState },
-          params: newParams
-        });
-
-        update();
-      };
-
-      $scope.$on('$stateChangeSuccess', update);
-
-      // Update route state
-      function update() {
-        if (anyMatch()) {
-          $element.addClass(activeClass);
-        } else {
-          $element.removeClass(activeClass);
-        }
-      }
-
-      function anyMatch() {
-        for (var i = 0; i < states.length; i++) {
-          if (isMatch(states[i].state, states[i].params)) {
-            return true;
-          }
-        }
-        return false;
-      }
-
-      function isMatch(state, params) {
-        if (typeof $attrs.uiSrefActiveEq !== 'undefined') {
-          return $state.is(state.name, params);
-        } else {
-          return $state.includes(state.name, params);
-        }
-      }
-    }]
-  };
-}
-
-angular.module('ui.router.state')
-  .directive('uiSref', $StateRefDirective)
-  .directive('uiSrefActive', $StateRefActiveDirective)
-  .directive('uiSrefActiveEq', $StateRefActiveDirective);
-
-/**
- * @ngdoc filter
- * @name ui.router.state.filter:isState
- *
- * @requires ui.router.state.$state
- *
- * @description
- * Translates to {@link ui.router.state.$state#methods_is $state.is("stateName")}.
- */
-$IsStateFilter.$inject = ['$state'];
-function $IsStateFilter($state) {
-  var isFilter = function (state) {
-    return $state.is(state);
-  };
-  isFilter.$stateful = true;
-  return isFilter;
-}
-
-/**
- * @ngdoc filter
- * @name ui.router.state.filter:includedByState
- *
- * @requires ui.router.state.$state
- *
- * @description
- * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}.
- */
-$IncludedByStateFilter.$inject = ['$state'];
-function $IncludedByStateFilter($state) {
-  var includesFilter = function (state) {
-    return $state.includes(state);
-  };
-  includesFilter.$stateful = true;
-  return  includesFilter;
-}
-
-angular.module('ui.router.state')
-  .filter('isState', $IsStateFilter)
-  .filter('includedByState', $IncludedByStateFilter);
-})(window, window.angular);
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/release/angular-ui-router.min.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/release/angular-ui-router.min.js
deleted file mode 100644
index 18d8307..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/release/angular-ui-router.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * State-based routing for AngularJS
- * @version v0.2.15
- * @link http://angular-ui.github.com/
- * @license MIT License, http://www.opensource.org/licenses/MIT
- */
-"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return N(new(N(function(){},{prototype:a})),b)}function e(a){return M(arguments,function(b){b!==a&&M(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return M(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function i(a,b,c,d){var e,i=f(c,d),j={},k=[];for(var l in i)if(i[l].params&&(e=g(i[l].params),e.length))for(var m in e)h(k,e[m])>=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return N({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e<c.length;e++){var f=c[e];if(a[f]!=b[f])return!1}return!0}function k(a,b){var c={};return M(a,function(a){c[a]=b[a]}),c}function l(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));return M(c,function(c){c in a&&(b[c]=a[c])}),b}function m(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var d in a)-1==h(c,d)&&(b[d]=a[d]);return b}function n(a,b){var c=L(a),d=c?[]:{};return M(a,function(a,e){b(a,e)&&(d[c?d.length:e]=a)}),d}function o(a,b){var c=L(a)?[]:{};return M(a,function(a,d){c[d]=b(a,d)}),c}function p(a,b){var d=1,f=2,i={},j=[],k=i,l=N(a.when(i),{$$promises:i,$$values:i});this.study=function(i){function n(a,c){if(s[c]!==f){if(r.push(c),s[c]===d)throw r.splice(0,h(r,c)),new Error("Cyclic dependency: "+r.join(" -> "));if(s[c]=d,J(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);M(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return K(a)&&a.then&&a.$$promises}if(!K(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return M(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!H(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;M(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!K(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=N({},d),u=1+q.length/3,v=!1;if(H(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),N(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;x>w;w+=3)d.hasOwnProperty(q[w])?h():j(q[w],q[w+1],q[w+2]);return r}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function q(a,b,c){this.fromConfig=function(a,b,c){return H(a.template)?this.fromString(a.template,b):H(a.templateUrl)?this.fromUrl(a.templateUrl,b):H(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return I(a)?a(b):a},this.fromUrl=function(c,d){return I(c)&&(c=c(d)),null==c?null:a.get(c,{cache:b,headers:{Accept:"text/html"}}).then(function(a){return a.data})},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function r(a,b,e){function f(b,c,d,e){if(q.push(b),o[b])return o[b];if(!/^\w+(-+\w+)*(?:\[\])?$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(p[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");return p[b]=new P.Param(b,c,d,e),p[b]}function g(a,b,c,d){var e=["",""],f=a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!b)return f;switch(c){case!1:e=["(",")"+(d?"?":"")];break;case!0:e=["?(",")?"];break;default:e=["("+c+"|",")?"]}return f+e[0]+b+e[1]}function h(e,f){var g,h,i,j,k;return g=e[2]||e[3],k=b.params[g],i=a.substring(m,e.index),h=f?e[4]:e[4]||("*"==e[1]?".*":null),j=P.type(h||"string")||d(P.type("string"),{pattern:new RegExp(h,b.caseInsensitive?"i":c)}),{id:g,regexp:h,segment:i,type:j,cfg:k}}b=N({params:{}},K(b)?b:{});var i,j=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,k=/([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l="^",m=0,n=this.segments=[],o=e?e.params:{},p=this.params=e?e.params.$$new():new P.ParamSet,q=[];this.source=a;for(var r,s,t;(i=j.exec(a))&&(r=h(i,!1),!(r.segment.indexOf("?")>=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function s(a){N(this,a)}function t(){function a(a){return null!=a?a.toString().replace(/\//g,"%2F"):a}function e(a){return null!=a?a.toString().replace(/%2F/g,"/"):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return I(a)||L(a)&&I(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(u[a.name],l.invoke(a.def))}}function k(a){N(this,a||{})}P=this;var l,m=!1,p=!0,q=!1,u={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!H(a)||"string"==typeof a},pattern:/[^/]*/},"int":{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return H(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};t.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return H(a)&&(m=a),m},this.strictMode=function(a){return H(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!H(a))return q;if(a!==!0&&a!==!1&&!J(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new r(a,N(f(),b))},this.isMatcher=function(a){if(!K(a))return!1;var b=!0;return M(r.prototype,function(c,d){I(c)&&(b=b&&H(a[d])&&I(a[d]))}),b},this.type=function(a,b,c){if(!H(b))return u[a];if(u.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return u[a]=new s(N({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},M(x,function(a,b){u[b]=new s(N({name:b},a))}),u=d(u,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),M(x,function(a,b){u[b]||(u[b]=new s(a))}),this}],this.Param=function(a,b,d,e){function f(a){var b=K(a)?g(a):[],c=-1===h(b,"value")&&-1===h(b,"type")&&-1===h(b,"squash")&&-1===h(b,"array");return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function j(b,c,d){if(b.type&&c)throw new Error("Param '"+a+"' has two type configurations.");return c?c:b.type?b.type instanceof s?b.type:new s(b.type):"config"===d?u.any:u.string}function k(){var b={array:"search"===e?"auto":!1},c=a.match(/\[\]$/)?{array:!0}:{};return N(b,c,d).array}function m(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!H(c)||null==c)return q;if(c===!0||J(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function p(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=L(a.replace)?a.replace:[],J(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return-1===h(g,a.from)}).concat(f)}function r(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(d.$$fn);if(null!==a&&a!==c&&!w.type.is(a))throw new Error("Default value ("+a+") for parameter '"+w.id+"' is not an instance of Type ("+w.type.name+")");return a}function t(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(w.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),H(a)?w.type.$normalize(a):r()}function v(){return"{Param:"+a+" "+b+" squash: '"+z+"' optional: "+y+"}"}var w=this;d=f(d),b=j(d,b,e);var x=k();b=x?b.$asArray(x,"search"===e):b,"string"!==b.name||x||"path"!==e||d.value!==c||(d.value="");var y=d.value!==c,z=m(d,y),A=p(d,x,y,z);N(this,{id:a,type:b,location:e,array:x,squash:z,replace:A,isOptional:y,value:t,dynamic:c,config:d,toString:v})},k.prototype={$$new:function(){return d(this,N(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),M(b,function(b){M(g(b),function(b){-1===h(a,b)&&-1===h(d,b)&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return M(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return M(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d<i.length&&(e=this[i[d]],f=a[i[d]],f!==c&&null!==f||!e.isOptional);d++){if(g=e.type.$normalize(f),!e.type.is(g))return!1;if(h=e.type.encode(g),b.isString(h)&&!e.type.pattern.exec(h))return!1}return!0},$$parent:c},this.ParamSet=k}function u(a,d){function e(a){var b=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);return null!=b?b[1].replace(/\\(.)/g,"$1"):""}function f(a,b){return a.replace(/\$(\$|\d{1,2})/,function(a,c){return b["$"===c?0:Number(c)]})}function g(a,b,c){if(!c)return!1;var d=a.invoke(b,b,{$match:c});return H(d)?d:!0}function h(d,e,f,g){function h(a,b,c){return"/"===p?a:b?p.slice(0,-1)+a:c?p.slice(1)+a:a}function m(a){function b(a){var b=a(f,d);return b?(J(b)&&d.replace().url(b),!0):!1}if(!a||!a.defaultPrevented){o&&d.url()===o;o=c;var e,g=j.length;for(e=0;g>e;e++)if(b(j[e]))return;k&&b(k)}}function n(){return i=i||e.$on("$locationChangeSuccess",m)}var o,p=g.baseHref(),q=d.url();return l||n(),{sync:function(){m()},listen:function(){return n()},update:function(a){return a?void(q=d.url()):void(d.url()!==q&&(d.url(q),d.replace()))},push:function(a,b,e){var f=a.format(b||{});null!==f&&b&&b["#"]&&(f+="#"+b["#"]),d.url(f),o=e&&e.$$avoidResync?d.url():c,e&&e.replace&&d.replace()},href:function(c,e,f){if(!c.validates(e))return null;var g=a.html5Mode();b.isObject(g)&&(g=g.enabled);var i=c.format(e);if(f=f||{},g||null===i||(i="#"+a.hashPrefix()+i),null!==i&&e&&e["#"]&&(i+="#"+e["#"]),i=h(i,g,f.absolute),!f.absolute||!i)return i;var j=!g&&i?"/":"",k=d.port();return k=80===k||443===k?"":":"+k,[d.protocol(),"://",d.host(),k,j,i].join("")}}}var i,j=[],k=null,l=!1;this.rule=function(a){if(!I(a))throw new Error("'rule' must be a function");return j.push(a),this},this.otherwise=function(a){if(J(a)){var b=a;a=function(){return b}}else if(!I(a))throw new Error("'rule' must be a function");return k=a,this},this.when=function(a,b){var c,h=J(b);if(J(a)&&(a=d.compile(a)),!h&&!I(b)&&!L(b))throw new Error("invalid 'handler' in when()");var i={matcher:function(a,b){return h&&(c=d.compile(b),b=["$match",function(a){return c.format(a)}]),N(function(c,d){return g(c,b,a.exec(d.path(),d.search()))},{prefix:J(a.prefix)?a.prefix:""})},regex:function(a,b){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(c=b,b=["$match",function(a){return f(c,a)}]),N(function(c,d){return g(c,b,a.exec(d.path()))},{prefix:e(a)})}},j={matcher:d.isMatcher(a),regex:a instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](a,b));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(a){a===c&&(a=!0),l=a},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser"]}function v(a,e){function f(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function m(a,b){if(!a)return c;var d=J(a),e=d?a:a.name,g=f(e);if(g){if(!b)throw new Error("No reference point given for path '"+e+"'");b=m(b);for(var h=e.split("."),i=0,j=h.length,k=b;j>i;i++)if(""!==h[i]||0!==i){if("^"!==h[i])break;if(!k.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");k=k.parent}else k=b;h=h.slice(i).join("."),e=k.name+(k.name&&h?".":"")+h}var l=z[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function n(a,b){A[a]||(A[a]=[]),A[a].push(b)}function p(a){for(var b=A[a]||[];b.length;)q(b.shift())}function q(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!J(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(z.hasOwnProperty(c))throw new Error("State '"+c+"'' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):J(b.parent)?b.parent:K(b.parent)&&J(b.parent.name)?b.parent.name:"";if(e&&!z[e])return n(e,b.self);for(var f in C)I(C[f])&&(b[f]=C[f](b,C.$delegates[f]));return z[c]=b,!b[B]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){y.$current.navigable==b&&j(a,c)||y.transitionTo(b,a,{inherit:!0,location:!1})}]),p(c),b}function r(a){return a.indexOf("*")>-1}function s(a){for(var b=a.split("."),c=y.$current.name.split("."),d=0,e=b.length;e>d;d++)"*"===b[d]&&(c[d]="*");return"**"===b[0]&&(c=c.slice(h(c,b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(h(c,b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length!=c.length?!1:c.join("")===b.join("")}function t(a,b){return J(a)&&!H(b)?C[a]:I(b)&&J(a)?(C[a]&&!C.$delegates[a]&&(C.$delegates[a]=C[a]),C[a]=b,this):this}function u(a,b){return K(a)?b=a:b.name=a,q(b),this}function v(a,e,f,h,l,n,p,q,t){function u(b,c,d,f){var g=a.$broadcast("$stateNotFound",b,c,d);if(g.defaultPrevented)return p.update(),D;if(!g.retry)return null;if(f.$retry)return p.update(),E;var h=y.transition=e.when(g.retry);return h.then(function(){return h!==y.transition?A:(b.options.$retry=!0,y.transitionTo(b.to,b.toParams,b.options))},function(){return D}),p.update(),h}function v(a,c,d,g,i,j){function m(){var c=[];return M(a.views,function(d,e){var g=d.resolve&&d.resolve!==a.resolve?d.resolve:{};g.$template=[function(){return f.load(e,{view:d,locals:i.globals,params:n,notify:j.notify})||""}],c.push(l.resolve(g,i.globals,i.resolve,a).then(function(c){if(I(d.controllerProvider)||L(d.controllerProvider)){var f=b.extend({},g,i.globals);c.$$controller=h.invoke(d.controllerProvider,null,f)}else c.$$controller=d.controller;c.$$state=a,c.$$controllerAs=d.controllerAs,i[e]=c}))}),e.all(c).then(function(){return i.globals})}var n=d?c:k(a.params.$$keys(),c),o={$stateParams:n};i.resolve=l.resolve(a.resolve,o,i.resolve,a);var p=[i.resolve.then(function(a){i.globals=a})];return g&&p.push(g),e.all(p).then(m).then(function(a){return i})}var A=e.reject(new Error("transition superseded")),C=e.reject(new Error("transition prevented")),D=e.reject(new Error("transition aborted")),E=e.reject(new Error("transition failed"));return x.locals={resolve:null,globals:{$stateParams:{}}},y={params:{},current:x.self,$current:x,transition:null},y.reload=function(a){return y.transitionTo(y.current,n,{reload:a||!0,inherit:!1,notify:!0})},y.go=function(a,b,c){return y.transitionTo(a,b,N({inherit:!0,relative:y.$current},c))},y.transitionTo=function(b,c,f){c=c||{},f=N({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});var g,j=y.$current,l=y.params,o=j.path,q=m(b,f.relative),r=c["#"];if(!H(q)){var s={to:b,toParams:c,options:f},t=u(s,j.self,l,f);if(t)return t;if(b=s.to,c=s.toParams,f=s.options,q=m(b,f.relative),!H(q)){if(!f.relative)throw new Error("No such state '"+b+"'");throw new Error("Could not resolve '"+b+"' from state '"+f.relative+"'")}}if(q[B])throw new Error("Cannot transition to abstract state '"+b+"'");if(f.inherit&&(c=i(n,c||{},y.$current,q)),!q.params.$$validates(c))return E;c=q.params.$$values(c),b=q;var z=b.path,D=0,F=z[D],G=x.locals,I=[];if(f.reload){if(J(f.reload)||K(f.reload)){if(K(f.reload)&&!f.reload.name)throw new Error("Invalid reload state object");var L=f.reload===!0?o[0]:m(f.reload);if(f.reload&&!L)throw new Error("No such reload state '"+(J(f.reload)?f.reload:f.reload.name)+"'");for(;F&&F===o[D]&&F!==L;)G=I[D]=F.locals,D++,F=z[D]}}else for(;F&&F===o[D]&&F.ownParams.$$equals(c,l);)G=I[D]=F.locals,D++,F=z[D];if(w(b,c,j,l,G,f))return r&&(c["#"]=r),y.params=c,O(y.params,n),f.location&&b.navigable&&b.navigable.url&&(p.push(b.navigable.url,c,{$$avoidResync:!0,replace:"replace"===f.location}),p.update(!0)),y.transition=null,e.when(y.current);if(c=k(b.params.$$keys(),c||{}),f.notify&&a.$broadcast("$stateChangeStart",b.self,c,j.self,l).defaultPrevented)return a.$broadcast("$stateChangeCancel",b.self,c,j.self,l),p.update(),C;for(var M=e.when(G),P=D;P<z.length;P++,F=z[P])G=I[P]=d(G),M=v(F,c,F===b,M,G,f);var Q=y.transition=M.then(function(){var d,e,g;if(y.transition!==Q)return A;for(d=o.length-1;d>=D;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=D;d<z.length;d++)e=z[d],e.locals=I[d],e.self.onEnter&&h.invoke(e.self.onEnter,e.self,e.locals.globals);return r&&(c["#"]=r),y.transition!==Q?A:(y.$current=b,y.current=b.self,y.params=c,O(y.params,n),y.transition=null,f.location&&b.navigable&&p.push(b.navigable.url,b.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===f.location}),f.notify&&a.$broadcast("$stateChangeSuccess",b.self,c,j.self,l),p.update(!0),y.current)},function(d){return y.transition!==Q?A:(y.transition=null,g=a.$broadcast("$stateChangeError",b.self,c,j.self,l,d),g.defaultPrevented||p.update(),e.reject(d))});return Q},y.is=function(a,b,d){d=N({relative:y.$current},d||{});var e=m(a,d.relative);return H(e)?y.$current!==e?!1:b?j(e.params.$$values(b),n):!0:c},y.includes=function(a,b,d){if(d=N({relative:y.$current},d||{}),J(a)&&r(a)){if(!s(a))return!1;a=y.$current.name}var e=m(a,d.relative);return H(e)?H(y.$current.includes[e.name])?b?j(e.params.$$values(b),n,g(b)):!0:!1:c},y.href=function(a,b,d){d=N({lossy:!0,inherit:!0,absolute:!1,relative:y.$current},d||{});var e=m(a,d.relative);if(!H(e))return null;d.inherit&&(b=i(n,b||{},y.$current,e));var f=e&&d.lossy?e.navigable:e;return f&&f.url!==c&&null!==f.url?p.href(f.url,k(e.params.$$keys().concat("#"),b||{}),{absolute:d.absolute}):null},y.get=function(a,b){if(0===arguments.length)return o(g(z),function(a){return z[a].self});var c=m(a,b||y.$current);return c&&c.self?c.self:null},y}function w(a,b,c,d,e,f){function g(a,b,c){function d(b){return"search"!=a.params[b].location}var e=a.params.$$keys().filter(d),f=l.apply({},[a.params].concat(e)),g=new P.ParamSet(f);return g.$$equals(b,c)}return!f.reload&&a===c&&(e===c.locals||a.self.reloadOnSearch===!1&&g(c,d,b))?!0:void 0}var x,y,z={},A={},B="abstract",C={parent:function(a){if(H(a.parent)&&a.parent)return m(a.parent);var b=/^(.+)\.[^.]+$/.exec(a.name);return b?m(b[1]):x},data:function(a){return a.parent&&a.parent.data&&(a.data=a.self.data=N({},a.parent.data,a.data)),a.data},url:function(a){var b=a.url,c={params:a.params||{}};if(J(b))return"^"==b.charAt(0)?e.compile(b.substring(1),c):(a.parent.navigable||x).url.concat(b,c);if(!b||e.isMatcher(b))return b;throw new Error("Invalid url '"+b+"' in state '"+a+"'")},navigable:function(a){return a.url?a:a.parent?a.parent.navigable:null},ownParams:function(a){var b=a.url&&a.url.params||new P.ParamSet;return M(a.params||{},function(a,c){b[c]||(b[c]=new P.Param(c,null,a,"config"))}),b},params:function(a){return a.parent&&a.parent.params?N(a.parent.params.$$new(),a.ownParams):new P.ParamSet},views:function(a){var b={};return M(H(a.views)?a.views:{"":a},function(c,d){d.indexOf("@")<0&&(d+="@"+a.parent.name),b[d]=c}),b},path:function(a){return a.parent?a.parent.path.concat(a):[]},includes:function(a){var b=a.parent?N({},a.parent.includes):{};return b[a.name]=!0,b},$delegates:{}};x=q({name:"",url:"^",views:null,"abstract":!0}),x.navigable=null,this.decorator=t,this.state=u,this.$get=v,v.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function w(){function a(a,b){return{load:function(c,d){var e,f={template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}};return d=N(f,d),d.view&&(e=b.fromConfig(d.view,d.params,d.locals)),e&&d.notify&&a.$broadcast("$viewContentLoading",d),e}}}this.$get=a,a.$inject=["$rootScope","$templateFactory"]}function x(){var a=!1;this.useAnchorScroll=function(){a=!0},this.$get=["$anchorScroll","$timeout",function(b,c){return a?b:function(a){return c(function(){a[0].scrollIntoView()},0,!1)}}]}function y(a,c,d,e){function f(){return c.has?function(a){return c.has(a)?c.get(a):null}:function(a){try{return c.get(a)}catch(b){return null}}}function g(a,b){var c=function(){return{enter:function(a,b,c){b.after(a),c()},leave:function(a,b){a.remove(),b()}}};if(j)return{enter:function(a,b,c){var d=j.enter(a,null,b,c);d&&d.then&&d.then(c)},leave:function(a,b){var c=j.leave(a,b);c&&c.then&&c.then(b)}};if(i){var d=i&&i(b,a);return{enter:function(a,b,c){d.enter(a,null,b),c()},leave:function(a,b){d.leave(a),b()}}}return c()}var h=f(),i=h("$animator"),j=h("$animate"),k={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,f,h){return function(c,f,i){function j(){l&&(l.remove(),l=null),n&&(n.$destroy(),n=null),m&&(r.leave(m,function(){l=null}),l=m,m=null)}function k(g){var k,l=A(c,i,f,e),s=l&&a.$current&&a.$current.locals[l];if(g||s!==o){k=c.$new(),o=a.$current.locals[l];var t=h(k,function(a){r.enter(a,f,function(){n&&n.$emit("$viewContentAnimationEnded"),(b.isDefined(q)&&!q||c.$eval(q))&&d(a)}),j()});m=t,n=k,n.$emit("$viewContentLoaded"),n.$eval(p)}}var l,m,n,o,p=i.onload||"",q=i.autoscroll,r=g(i,c);c.$on("$stateChangeSuccess",function(){k(!1)}),c.$on("$viewContentLoading",function(){k(!1)}),k(!0)}}};return k}function z(a,b,c,d){return{restrict:"ECA",priority:-400,compile:function(e){var f=e.html();return function(e,g,h){var i=c.$current,j=A(e,h,g,d),k=i&&i.locals[j];if(k){g.data("$uiView",{name:j,state:k.$$state}),g.html(k.$template?k.$template:f);var l=a(g.contents());if(k.$$controller){k.$scope=e,k.$element=g;var m=b(k.$$controller,k);k.$$controllerAs&&(e[k.$$controllerAs]=m),g.data("$ngControllerController",m),g.children().data("$ngControllerController",m)}l(e)}}}}}function A(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function B(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function C(a){var b=a.parent().inheritedData("$uiView");return b&&b.state&&b.state.name?b.state:void 0}function D(a,c){var d=["location","inherit","reload","absolute"];return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(e,f,g,h){var i=B(g.uiSref,a.current.name),j=null,k=C(f)||a.$current,l="[object SVGAnimatedString]"===Object.prototype.toString.call(f.prop("href"))?"xlink:href":"href",m=null,n="A"===f.prop("tagName").toUpperCase(),o="FORM"===f[0].nodeName,p=o?"action":l,q=!0,r={relative:k,inherit:!0},s=e.$eval(g.uiSrefOpts)||{};b.forEach(d,function(a){a in s&&(r[a]=s[a])});var t=function(c){if(c&&(j=b.copy(c)),q){m=a.href(i.state,j,r);var d=h[1]||h[0];return d&&d.$$addStateInfo(i.state,j),null===m?(q=!1,!1):void g.$set(p,m)}};i.paramExpr&&(e.$watch(i.paramExpr,function(a,b){a!==j&&t(a)},!0),j=b.copy(e.$eval(i.paramExpr))),t(),o||f.bind("click",function(b){var d=b.which||b.button;if(!(d>1||b.ctrlKey||b.metaKey||b.shiftKey||f.attr("target"))){var e=c(function(){a.go(i.state,j,r)});b.preventDefault();var g=n&&!m?1:0;b.preventDefault=function(){g--<=0&&c.cancel(e)}}})}}}function E(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs",function(b,d,e){function f(){g()?d.addClass(i):d.removeClass(i)}function g(){for(var a=0;a<j.length;a++)if(h(j[a].state,j[a].params))return!0;return!1}function h(b,c){return"undefined"!=typeof e.uiSrefActiveEq?a.is(b.name,c):a.includes(b.name,c)}var i,j=[];i=c(e.uiSrefActiveEq||e.uiSrefActive||"",!1)(b),this.$$addStateInfo=function(b,c){var e=a.get(b,C(d));j.push({state:e||{name:b},params:c}),f()},b.$on("$stateChangeSuccess",f)}]}}function F(a){var b=function(b){return a.is(b)};return b.$stateful=!0,b}function G(a){var b=function(b){return a.includes(b)};return b.$stateful=!0,b}var H=b.isDefined,I=b.isFunction,J=b.isString,K=b.isObject,L=b.isArray,M=b.forEach,N=b.extend,O=b.copy;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),p.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",p),q.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",q);var P;r.prototype.concat=function(a,b){var c={caseInsensitive:P.caseInsensitive(),strict:P.strictMode(),squash:P.defaultSquashPolicy()};return new r(this.sourcePath+a+this.sourceSearch,N(c,b),this)},r.prototype.toString=function(){return this.source},r.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");for(e=0;j>e;e++){g=h[e];var l=this.params[g],m=d[e+1];for(f=0;f<l.replace;f++)l.replace[f].from===m&&(m=l.replace[f].to);m&&l.array===!0&&(m=c(m)),k[g]=l.value(m)}for(;i>e;e++)g=h[e],k[g]=this.params[g].value(b[g]);return k},r.prototype.parameters=function(a){return H(a)?this.params[a]||null:this.$$paramNames},r.prototype.validates=function(a){return this.params.$$validates(a)},r.prototype.format=function(a){function b(a){return encodeURIComponent(a).replace(/-/g,function(a){return"%5C%"+a.charCodeAt(0).toString(16).toUpperCase()})}a=a||{};var c=this.segments,d=this.parameters(),e=this.params;if(!this.validates(a))return null;var f,g=!1,h=c.length-1,i=d.length,j=c[0];for(f=0;i>f;f++){var k=h>f,l=d[f],m=e[l],n=m.value(a[l]),p=m.isOptional&&m.type.equals(m.value(),n),q=p?m.squash:!1,r=m.type.encode(n);if(k){var s=c[f+1];if(q===!1)null!=r&&(j+=L(r)?o(r,b).join("-"):encodeURIComponent(r)),j+=s;else if(q===!0){var t=j.match(/\/$/)?/\/?(.*)/:/(.*)/;j+=s.match(t)[1]}else J(q)&&(j+=q+s)}else{if(null==r||p&&q!==!1)continue;L(r)||(r=[r]),r=o(r,encodeURIComponent).join("&"+l+"="),j+=(g?"&":"?")+(l+"="+r),g=!0}}return j},s.prototype.is=function(a,b){return!0},s.prototype.encode=function(a,b){return a},s.prototype.decode=function(a,b){return a},s.prototype.equals=function(a,b){return a==b},s.prototype.$subPattern=function(){var a=this.pattern.toString();return a.substr(1,a.length-2)},s.prototype.pattern=/.*/,s.prototype.toString=function(){return"{Type:"+this.name+"}"},s.prototype.$normalize=function(a){return this.is(a)?a:this.decode(a)},s.prototype.$asArray=function(a,b){function d(a,b){function d(a,b){return function(){return a[b].apply(a,arguments)}}function e(a){return L(a)?a:H(a)?[a]:[]}function f(a){switch(a.length){case 0:return c;case 1:return"auto"===b?a[0]:a;default:return a}}function g(a){return!a}function h(a,b){return function(c){c=e(c);var d=o(c,a);return b===!0?0===n(d,g).length:f(d)}}function i(a){return function(b,c){var d=e(b),f=e(c);if(d.length!==f.length)return!1;for(var g=0;g<d.length;g++)if(!a(d[g],f[g]))return!1;return!0}}this.encode=h(d(a,"encode")),this.decode=h(d(a,"decode")),this.is=h(d(a,"is"),!0),this.equals=i(d(a,"equals")),this.pattern=a.pattern,this.$normalize=h(d(a,"$normalize")),this.name=a.name,this.$arrayMode=b}if(!a)return this;if("auto"===a&&!b)throw new Error("'auto' array mode is for query parameters only");return new d(this,a)},b.module("ui.router.util").provider("$urlMatcherFactory",t),b.module("ui.router.util").run(["$urlMatcherFactory",function(a){}]),u.$inject=["$locationProvider","$urlMatcherFactoryProvider"],b.module("ui.router.router").provider("$urlRouter",u),v.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],b.module("ui.router.state").value("$stateParams",{}).provider("$state",v),w.$inject=[],b.module("ui.router.state").provider("$view",w),b.module("ui.router.state").provider("$uiViewScroll",x),y.$inject=["$state","$injector","$uiViewScroll","$interpolate"],z.$inject=["$compile","$controller","$state","$interpolate"],b.module("ui.router.state").directive("uiView",y),b.module("ui.router.state").directive("uiView",z),D.$inject=["$state","$timeout"],E.$inject=["$state","$stateParams","$interpolate"],b.module("ui.router.state").directive("uiSref",D).directive("uiSrefActive",E).directive("uiSrefActiveEq",E),F.$inject=["$state"],G.$inject=["$state"],b.module("ui.router.state").filter("isState",F).filter("includedByState",G)}(window,window.angular);
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/common.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/common.js
deleted file mode 100644
index a85ff9e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/common.js
+++ /dev/null
@@ -1,292 +0,0 @@
-/*jshint globalstrict:true*/
-/*global angular:false*/
-'use strict';
-
-var isDefined = angular.isDefined,
-    isFunction = angular.isFunction,
-    isString = angular.isString,
-    isObject = angular.isObject,
-    isArray = angular.isArray,
-    forEach = angular.forEach,
-    extend = angular.extend,
-    copy = angular.copy;
-
-function inherit(parent, extra) {
-  return extend(new (extend(function() {}, { prototype: parent }))(), extra);
-}
-
-function merge(dst) {
-  forEach(arguments, function(obj) {
-    if (obj !== dst) {
-      forEach(obj, function(value, key) {
-        if (!dst.hasOwnProperty(key)) dst[key] = value;
-      });
-    }
-  });
-  return dst;
-}
-
-/**
- * Finds the common ancestor path between two states.
- *
- * @param {Object} first The first state.
- * @param {Object} second The second state.
- * @return {Array} Returns an array of state names in descending order, not including the root.
- */
-function ancestors(first, second) {
-  var path = [];
-
-  for (var n in first.path) {
-    if (first.path[n] !== second.path[n]) break;
-    path.push(first.path[n]);
-  }
-  return path;
-}
-
-/**
- * IE8-safe wrapper for `Object.keys()`.
- *
- * @param {Object} object A JavaScript object.
- * @return {Array} Returns the keys of the object as an array.
- */
-function objectKeys(object) {
-  if (Object.keys) {
-    return Object.keys(object);
-  }
-  var result = [];
-
-  forEach(object, function(val, key) {
-    result.push(key);
-  });
-  return result;
-}
-
-/**
- * IE8-safe wrapper for `Array.prototype.indexOf()`.
- *
- * @param {Array} array A JavaScript array.
- * @param {*} value A value to search the array for.
- * @return {Number} Returns the array index value of `value`, or `-1` if not present.
- */
-function indexOf(array, value) {
-  if (Array.prototype.indexOf) {
-    return array.indexOf(value, Number(arguments[2]) || 0);
-  }
-  var len = array.length >>> 0, from = Number(arguments[2]) || 0;
-  from = (from < 0) ? Math.ceil(from) : Math.floor(from);
-
-  if (from < 0) from += len;
-
-  for (; from < len; from++) {
-    if (from in array && array[from] === value) return from;
-  }
-  return -1;
-}
-
-/**
- * Merges a set of parameters with all parameters inherited between the common parents of the
- * current state and a given destination state.
- *
- * @param {Object} currentParams The value of the current state parameters ($stateParams).
- * @param {Object} newParams The set of parameters which will be composited with inherited params.
- * @param {Object} $current Internal definition of object representing the current state.
- * @param {Object} $to Internal definition of object representing state to transition to.
- */
-function inheritParams(currentParams, newParams, $current, $to) {
-  var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];
-
-  for (var i in parents) {
-    if (!parents[i].params) continue;
-    parentParams = objectKeys(parents[i].params);
-    if (!parentParams.length) continue;
-
-    for (var j in parentParams) {
-      if (indexOf(inheritList, parentParams[j]) >= 0) continue;
-      inheritList.push(parentParams[j]);
-      inherited[parentParams[j]] = currentParams[parentParams[j]];
-    }
-  }
-  return extend({}, inherited, newParams);
-}
-
-/**
- * Performs a non-strict comparison of the subset of two objects, defined by a list of keys.
- *
- * @param {Object} a The first object.
- * @param {Object} b The second object.
- * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified,
- *                     it defaults to the list of keys in `a`.
- * @return {Boolean} Returns `true` if the keys match, otherwise `false`.
- */
-function equalForKeys(a, b, keys) {
-  if (!keys) {
-    keys = [];
-    for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility
-  }
-
-  for (var i=0; i<keys.length; i++) {
-    var k = keys[i];
-    if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized
-  }
-  return true;
-}
-
-/**
- * Returns the subset of an object, based on a list of keys.
- *
- * @param {Array} keys
- * @param {Object} values
- * @return {Boolean} Returns a subset of `values`.
- */
-function filterByKeys(keys, values) {
-  var filtered = {};
-
-  forEach(keys, function (name) {
-    filtered[name] = values[name];
-  });
-  return filtered;
-}
-
-// like _.indexBy
-// when you know that your index values will be unique, or you want last-one-in to win
-function indexBy(array, propName) {
-  var result = {};
-  forEach(array, function(item) {
-    result[item[propName]] = item;
-  });
-  return result;
-}
-
-// extracted from underscore.js
-// Return a copy of the object only containing the whitelisted properties.
-function pick(obj) {
-  var copy = {};
-  var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));
-  forEach(keys, function(key) {
-    if (key in obj) copy[key] = obj[key];
-  });
-  return copy;
-}
-
-// extracted from underscore.js
-// Return a copy of the object omitting the blacklisted properties.
-function omit(obj) {
-  var copy = {};
-  var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));
-  for (var key in obj) {
-    if (indexOf(keys, key) == -1) copy[key] = obj[key];
-  }
-  return copy;
-}
-
-function pluck(collection, key) {
-  var result = isArray(collection) ? [] : {};
-
-  forEach(collection, function(val, i) {
-    result[i] = isFunction(key) ? key(val) : val[key];
-  });
-  return result;
-}
-
-function filter(collection, callback) {
-  var array = isArray(collection);
-  var result = array ? [] : {};
-  forEach(collection, function(val, i) {
-    if (callback(val, i)) {
-      result[array ? result.length : i] = val;
-    }
-  });
-  return result;
-}
-
-function map(collection, callback) {
-  var result = isArray(collection) ? [] : {};
-
-  forEach(collection, function(val, i) {
-    result[i] = callback(val, i);
-  });
-  return result;
-}
-
-/**
- * @ngdoc overview
- * @name ui.router.util
- *
- * @description
- * # ui.router.util sub-module
- *
- * This module is a dependency of other sub-modules. Do not include this module as a dependency
- * in your angular app (use {@link ui.router} module instead).
- *
- */
-angular.module('ui.router.util', ['ng']);
-
-/**
- * @ngdoc overview
- * @name ui.router.router
- * 
- * @requires ui.router.util
- *
- * @description
- * # ui.router.router sub-module
- *
- * This module is a dependency of other sub-modules. Do not include this module as a dependency
- * in your angular app (use {@link ui.router} module instead).
- */
-angular.module('ui.router.router', ['ui.router.util']);
-
-/**
- * @ngdoc overview
- * @name ui.router.state
- * 
- * @requires ui.router.router
- * @requires ui.router.util
- *
- * @description
- * # ui.router.state sub-module
- *
- * This module is a dependency of the main ui.router module. Do not include this module as a dependency
- * in your angular app (use {@link ui.router} module instead).
- * 
- */
-angular.module('ui.router.state', ['ui.router.router', 'ui.router.util']);
-
-/**
- * @ngdoc overview
- * @name ui.router
- *
- * @requires ui.router.state
- *
- * @description
- * # ui.router
- * 
- * ## The main module for ui.router 
- * There are several sub-modules included with the ui.router module, however only this module is needed
- * as a dependency within your angular app. The other modules are for organization purposes. 
- *
- * The modules are:
- * * ui.router - the main "umbrella" module
- * * ui.router.router - 
- * 
- * *You'll need to include **only** this module as the dependency within your angular app.*
- * 
- * <pre>
- * <!doctype html>
- * <html ng-app="myApp">
- * <head>
- *   <script src="js/angular.js"></script>
- *   <!-- Include the ui-router script -->
- *   <script src="js/angular-ui-router.min.js"></script>
- *   <script>
- *     // ...and add 'ui.router' as a dependency
- *     var myApp = angular.module('myApp', ['ui.router']);
- *   </script>
- * </head>
- * <body>
- * </body>
- * </html>
- * </pre>
- */
-angular.module('ui.router', ['ui.router.state']);
-
-angular.module('ui.router.compat', ['ui.router']);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/resolve.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/resolve.js
deleted file mode 100644
index f1c1790..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/resolve.js
+++ /dev/null
@@ -1,252 +0,0 @@
-/**
- * @ngdoc object
- * @name ui.router.util.$resolve
- *
- * @requires $q
- * @requires $injector
- *
- * @description
- * Manages resolution of (acyclic) graphs of promises.
- */
-$Resolve.$inject = ['$q', '$injector'];
-function $Resolve(  $q,    $injector) {
-  
-  var VISIT_IN_PROGRESS = 1,
-      VISIT_DONE = 2,
-      NOTHING = {},
-      NO_DEPENDENCIES = [],
-      NO_LOCALS = NOTHING,
-      NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING });
-  
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$resolve#study
-   * @methodOf ui.router.util.$resolve
-   *
-   * @description
-   * Studies a set of invocables that are likely to be used multiple times.
-   * <pre>
-   * $resolve.study(invocables)(locals, parent, self)
-   * </pre>
-   * is equivalent to
-   * <pre>
-   * $resolve.resolve(invocables, locals, parent, self)
-   * </pre>
-   * but the former is more efficient (in fact `resolve` just calls `study` 
-   * internally).
-   *
-   * @param {object} invocables Invocable objects
-   * @return {function} a function to pass in locals, parent and self
-   */
-  this.study = function (invocables) {
-    if (!isObject(invocables)) throw new Error("'invocables' must be an object");
-    var invocableKeys = objectKeys(invocables || {});
-    
-    // Perform a topological sort of invocables to build an ordered plan
-    var plan = [], cycle = [], visited = {};
-    function visit(value, key) {
-      if (visited[key] === VISIT_DONE) return;
-      
-      cycle.push(key);
-      if (visited[key] === VISIT_IN_PROGRESS) {
-        cycle.splice(0, indexOf(cycle, key));
-        throw new Error("Cyclic dependency: " + cycle.join(" -> "));
-      }
-      visited[key] = VISIT_IN_PROGRESS;
-      
-      if (isString(value)) {
-        plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES);
-      } else {
-        var params = $injector.annotate(value);
-        forEach(params, function (param) {
-          if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param);
-        });
-        plan.push(key, value, params);
-      }
-      
-      cycle.pop();
-      visited[key] = VISIT_DONE;
-    }
-    forEach(invocables, visit);
-    invocables = cycle = visited = null; // plan is all that's required
-    
-    function isResolve(value) {
-      return isObject(value) && value.then && value.$$promises;
-    }
-    
-    return function (locals, parent, self) {
-      if (isResolve(locals) && self === undefined) {
-        self = parent; parent = locals; locals = null;
-      }
-      if (!locals) locals = NO_LOCALS;
-      else if (!isObject(locals)) {
-        throw new Error("'locals' must be an object");
-      }       
-      if (!parent) parent = NO_PARENT;
-      else if (!isResolve(parent)) {
-        throw new Error("'parent' must be a promise returned by $resolve.resolve()");
-      }
-      
-      // To complete the overall resolution, we have to wait for the parent
-      // promise and for the promise for each invokable in our plan.
-      var resolution = $q.defer(),
-          result = resolution.promise,
-          promises = result.$$promises = {},
-          values = extend({}, locals),
-          wait = 1 + plan.length/3,
-          merged = false;
-          
-      function done() {
-        // Merge parent values we haven't got yet and publish our own $$values
-        if (!--wait) {
-          if (!merged) merge(values, parent.$$values); 
-          result.$$values = values;
-          result.$$promises = result.$$promises || true; // keep for isResolve()
-          delete result.$$inheritedValues;
-          resolution.resolve(values);
-        }
-      }
-      
-      function fail(reason) {
-        result.$$failure = reason;
-        resolution.reject(reason);
-      }
-
-      // Short-circuit if parent has already failed
-      if (isDefined(parent.$$failure)) {
-        fail(parent.$$failure);
-        return result;
-      }
-      
-      if (parent.$$inheritedValues) {
-        merge(values, omit(parent.$$inheritedValues, invocableKeys));
-      }
-
-      // Merge parent values if the parent has already resolved, or merge
-      // parent promises and wait if the parent resolve is still in progress.
-      extend(promises, parent.$$promises);
-      if (parent.$$values) {
-        merged = merge(values, omit(parent.$$values, invocableKeys));
-        result.$$inheritedValues = omit(parent.$$values, invocableKeys);
-        done();
-      } else {
-        if (parent.$$inheritedValues) {
-          result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys);
-        }        
-        parent.then(done, fail);
-      }
-      
-      // Process each invocable in the plan, but ignore any where a local of the same name exists.
-      for (var i=0, ii=plan.length; i<ii; i+=3) {
-        if (locals.hasOwnProperty(plan[i])) done();
-        else invoke(plan[i], plan[i+1], plan[i+2]);
-      }
-      
-      function invoke(key, invocable, params) {
-        // Create a deferred for this invocation. Failures will propagate to the resolution as well.
-        var invocation = $q.defer(), waitParams = 0;
-        function onfailure(reason) {
-          invocation.reject(reason);
-          fail(reason);
-        }
-        // Wait for any parameter that we have a promise for (either from parent or from this
-        // resolve; in that case study() will have made sure it's ordered before us in the plan).
-        forEach(params, function (dep) {
-          if (promises.hasOwnProperty(dep) && !locals.hasOwnProperty(dep)) {
-            waitParams++;
-            promises[dep].then(function (result) {
-              values[dep] = result;
-              if (!(--waitParams)) proceed();
-            }, onfailure);
-          }
-        });
-        if (!waitParams) proceed();
-        function proceed() {
-          if (isDefined(result.$$failure)) return;
-          try {
-            invocation.resolve($injector.invoke(invocable, self, values));
-            invocation.promise.then(function (result) {
-              values[key] = result;
-              done();
-            }, onfailure);
-          } catch (e) {
-            onfailure(e);
-          }
-        }
-        // Publish promise synchronously; invocations further down in the plan may depend on it.
-        promises[key] = invocation.promise;
-      }
-      
-      return result;
-    };
-  };
-  
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$resolve#resolve
-   * @methodOf ui.router.util.$resolve
-   *
-   * @description
-   * Resolves a set of invocables. An invocable is a function to be invoked via 
-   * `$injector.invoke()`, and can have an arbitrary number of dependencies. 
-   * An invocable can either return a value directly,
-   * or a `$q` promise. If a promise is returned it will be resolved and the 
-   * resulting value will be used instead. Dependencies of invocables are resolved 
-   * (in this order of precedence)
-   *
-   * - from the specified `locals`
-   * - from another invocable that is part of this `$resolve` call
-   * - from an invocable that is inherited from a `parent` call to `$resolve` 
-   *   (or recursively
-   * - from any ancestor `$resolve` of that parent).
-   *
-   * The return value of `$resolve` is a promise for an object that contains 
-   * (in this order of precedence)
-   *
-   * - any `locals` (if specified)
-   * - the resolved return values of all injectables
-   * - any values inherited from a `parent` call to `$resolve` (if specified)
-   *
-   * The promise will resolve after the `parent` promise (if any) and all promises 
-   * returned by injectables have been resolved. If any invocable 
-   * (or `$injector.invoke`) throws an exception, or if a promise returned by an 
-   * invocable is rejected, the `$resolve` promise is immediately rejected with the 
-   * same error. A rejection of a `parent` promise (if specified) will likewise be 
-   * propagated immediately. Once the `$resolve` promise has been rejected, no 
-   * further invocables will be called.
-   * 
-   * Cyclic dependencies between invocables are not permitted and will caues `$resolve`
-   * to throw an error. As a special case, an injectable can depend on a parameter 
-   * with the same name as the injectable, which will be fulfilled from the `parent` 
-   * injectable of the same name. This allows inherited values to be decorated. 
-   * Note that in this case any other injectable in the same `$resolve` with the same
-   * dependency would see the decorated value, not the inherited value.
-   *
-   * Note that missing dependencies -- unlike cyclic dependencies -- will cause an 
-   * (asynchronous) rejection of the `$resolve` promise rather than a (synchronous) 
-   * exception.
-   *
-   * Invocables are invoked eagerly as soon as all dependencies are available. 
-   * This is true even for dependencies inherited from a `parent` call to `$resolve`.
-   *
-   * As a special case, an invocable can be a string, in which case it is taken to 
-   * be a service name to be passed to `$injector.get()`. This is supported primarily 
-   * for backwards-compatibility with the `resolve` property of `$routeProvider` 
-   * routes.
-   *
-   * @param {object} invocables functions to invoke or 
-   * `$injector` services to fetch.
-   * @param {object} locals  values to make available to the injectables
-   * @param {object} parent  a promise returned by another call to `$resolve`.
-   * @param {object} self  the `this` for the invoked methods
-   * @return {object} Promise for an object that contains the resolved return value
-   * of all invocables, as well as any inherited and local values.
-   */
-  this.resolve = function (invocables, locals, parent, self) {
-    return this.study(invocables)(locals, parent, self);
-  };
-}
-
-angular.module('ui.router.util').service('$resolve', $Resolve);
-
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/state.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/state.js
deleted file mode 100644
index 56ee5a0..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/state.js
+++ /dev/null
@@ -1,1465 +0,0 @@
-/**
- * @ngdoc object
- * @name ui.router.state.$stateProvider
- *
- * @requires ui.router.router.$urlRouterProvider
- * @requires ui.router.util.$urlMatcherFactoryProvider
- *
- * @description
- * The new `$stateProvider` works similar to Angular's v1 router, but it focuses purely
- * on state.
- *
- * A state corresponds to a "place" in the application in terms of the overall UI and
- * navigation. A state describes (via the controller / template / view properties) what
- * the UI looks like and does at that place.
- *
- * States often have things in common, and the primary way of factoring out these
- * commonalities in this model is via the state hierarchy, i.e. parent/child states aka
- * nested states.
- *
- * The `$stateProvider` provides interfaces to declare these states for your app.
- */
-$StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider'];
-function $StateProvider(   $urlRouterProvider,   $urlMatcherFactory) {
-
-  var root, states = {}, $state, queue = {}, abstractKey = 'abstract';
-
-  // Builds state properties from definition passed to registerState()
-  var stateBuilder = {
-
-    // Derive parent state from a hierarchical name only if 'parent' is not explicitly defined.
-    // state.children = [];
-    // if (parent) parent.children.push(state);
-    parent: function(state) {
-      if (isDefined(state.parent) && state.parent) return findState(state.parent);
-      // regex matches any valid composite state name
-      // would match "contact.list" but not "contacts"
-      var compositeName = /^(.+)\.[^.]+$/.exec(state.name);
-      return compositeName ? findState(compositeName[1]) : root;
-    },
-
-    // inherit 'data' from parent and override by own values (if any)
-    data: function(state) {
-      if (state.parent && state.parent.data) {
-        state.data = state.self.data = extend({}, state.parent.data, state.data);
-      }
-      return state.data;
-    },
-
-    // Build a URLMatcher if necessary, either via a relative or absolute URL
-    url: function(state) {
-      var url = state.url, config = { params: state.params || {} };
-
-      if (isString(url)) {
-        if (url.charAt(0) == '^') return $urlMatcherFactory.compile(url.substring(1), config);
-        return (state.parent.navigable || root).url.concat(url, config);
-      }
-
-      if (!url || $urlMatcherFactory.isMatcher(url)) return url;
-      throw new Error("Invalid url '" + url + "' in state '" + state + "'");
-    },
-
-    // Keep track of the closest ancestor state that has a URL (i.e. is navigable)
-    navigable: function(state) {
-      return state.url ? state : (state.parent ? state.parent.navigable : null);
-    },
-
-    // Own parameters for this state. state.url.params is already built at this point. Create and add non-url params
-    ownParams: function(state) {
-      var params = state.url && state.url.params || new $$UMFP.ParamSet();
-      forEach(state.params || {}, function(config, id) {
-        if (!params[id]) params[id] = new $$UMFP.Param(id, null, config, "config");
-      });
-      return params;
-    },
-
-    // Derive parameters for this state and ensure they're a super-set of parent's parameters
-    params: function(state) {
-      return state.parent && state.parent.params ? extend(state.parent.params.$$new(), state.ownParams) : new $$UMFP.ParamSet();
-    },
-
-    // If there is no explicit multi-view configuration, make one up so we don't have
-    // to handle both cases in the view directive later. Note that having an explicit
-    // 'views' property will mean the default unnamed view properties are ignored. This
-    // is also a good time to resolve view names to absolute names, so everything is a
-    // straight lookup at link time.
-    views: function(state) {
-      var views = {};
-
-      forEach(isDefined(state.views) ? state.views : { '': state }, function (view, name) {
-        if (name.indexOf('@') < 0) name += '@' + state.parent.name;
-        views[name] = view;
-      });
-      return views;
-    },
-
-    // Keep a full path from the root down to this state as this is needed for state activation.
-    path: function(state) {
-      return state.parent ? state.parent.path.concat(state) : []; // exclude root from path
-    },
-
-    // Speed up $state.contains() as it's used a lot
-    includes: function(state) {
-      var includes = state.parent ? extend({}, state.parent.includes) : {};
-      includes[state.name] = true;
-      return includes;
-    },
-
-    $delegates: {}
-  };
-
-  function isRelative(stateName) {
-    return stateName.indexOf(".") === 0 || stateName.indexOf("^") === 0;
-  }
-
-  function findState(stateOrName, base) {
-    if (!stateOrName) return undefined;
-
-    var isStr = isString(stateOrName),
-        name  = isStr ? stateOrName : stateOrName.name,
-        path  = isRelative(name);
-
-    if (path) {
-      if (!base) throw new Error("No reference point given for path '"  + name + "'");
-      base = findState(base);
-      
-      var rel = name.split("."), i = 0, pathLength = rel.length, current = base;
-
-      for (; i < pathLength; i++) {
-        if (rel[i] === "" && i === 0) {
-          current = base;
-          continue;
-        }
-        if (rel[i] === "^") {
-          if (!current.parent) throw new Error("Path '" + name + "' not valid for state '" + base.name + "'");
-          current = current.parent;
-          continue;
-        }
-        break;
-      }
-      rel = rel.slice(i).join(".");
-      name = current.name + (current.name && rel ? "." : "") + rel;
-    }
-    var state = states[name];
-
-    if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {
-      return state;
-    }
-    return undefined;
-  }
-
-  function queueState(parentName, state) {
-    if (!queue[parentName]) {
-      queue[parentName] = [];
-    }
-    queue[parentName].push(state);
-  }
-
-  function flushQueuedChildren(parentName) {
-    var queued = queue[parentName] || [];
-    while(queued.length) {
-      registerState(queued.shift());
-    }
-  }
-
-  function registerState(state) {
-    // Wrap a new object around the state so we can store our private details easily.
-    state = inherit(state, {
-      self: state,
-      resolve: state.resolve || {},
-      toString: function() { return this.name; }
-    });
-
-    var name = state.name;
-    if (!isString(name) || name.indexOf('@') >= 0) throw new Error("State must have a valid name");
-    if (states.hasOwnProperty(name)) throw new Error("State '" + name + "'' is already defined");
-
-    // Get parent name
-    var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))
-        : (isString(state.parent)) ? state.parent
-        : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name
-        : '';
-
-    // If parent is not registered yet, add state to queue and register later
-    if (parentName && !states[parentName]) {
-      return queueState(parentName, state.self);
-    }
-
-    for (var key in stateBuilder) {
-      if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]);
-    }
-    states[name] = state;
-
-    // Register the state in the global state list and with $urlRouter if necessary.
-    if (!state[abstractKey] && state.url) {
-      $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) {
-        if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) {
-          $state.transitionTo(state, $match, { inherit: true, location: false });
-        }
-      }]);
-    }
-
-    // Register any queued children
-    flushQueuedChildren(name);
-
-    return state;
-  }
-
-  // Checks text to see if it looks like a glob.
-  function isGlob (text) {
-    return text.indexOf('*') > -1;
-  }
-
-  // Returns true if glob matches current $state name.
-  function doesStateMatchGlob (glob) {
-    var globSegments = glob.split('.'),
-        segments = $state.$current.name.split('.');
-
-    //match single stars
-    for (var i = 0, l = globSegments.length; i < l; i++) {
-      if (globSegments[i] === '*') {
-        segments[i] = '*';
-      }
-    }
-
-    //match greedy starts
-    if (globSegments[0] === '**') {
-       segments = segments.slice(indexOf(segments, globSegments[1]));
-       segments.unshift('**');
-    }
-    //match greedy ends
-    if (globSegments[globSegments.length - 1] === '**') {
-       segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);
-       segments.push('**');
-    }
-
-    if (globSegments.length != segments.length) {
-      return false;
-    }
-
-    return segments.join('') === globSegments.join('');
-  }
-
-
-  // Implicit root state that is always active
-  root = registerState({
-    name: '',
-    url: '^',
-    views: null,
-    'abstract': true
-  });
-  root.navigable = null;
-
-
-  /**
-   * @ngdoc function
-   * @name ui.router.state.$stateProvider#decorator
-   * @methodOf ui.router.state.$stateProvider
-   *
-   * @description
-   * Allows you to extend (carefully) or override (at your own peril) the 
-   * `stateBuilder` object used internally by `$stateProvider`. This can be used 
-   * to add custom functionality to ui-router, for example inferring templateUrl 
-   * based on the state name.
-   *
-   * When passing only a name, it returns the current (original or decorated) builder
-   * function that matches `name`.
-   *
-   * The builder functions that can be decorated are listed below. Though not all
-   * necessarily have a good use case for decoration, that is up to you to decide.
-   *
-   * In addition, users can attach custom decorators, which will generate new 
-   * properties within the state's internal definition. There is currently no clear 
-   * use-case for this beyond accessing internal states (i.e. $state.$current), 
-   * however, expect this to become increasingly relevant as we introduce additional 
-   * meta-programming features.
-   *
-   * **Warning**: Decorators should not be interdependent because the order of 
-   * execution of the builder functions in non-deterministic. Builder functions 
-   * should only be dependent on the state definition object and super function.
-   *
-   *
-   * Existing builder functions and current return values:
-   *
-   * - **parent** `{object}` - returns the parent state object.
-   * - **data** `{object}` - returns state data, including any inherited data that is not
-   *   overridden by own values (if any).
-   * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
-   *   or `null`.
-   * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is 
-   *   navigable).
-   * - **params** `{object}` - returns an array of state params that are ensured to 
-   *   be a super-set of parent's params.
-   * - **views** `{object}` - returns a views object where each key is an absolute view 
-   *   name (i.e. "viewName@stateName") and each value is the config object 
-   *   (template, controller) for the view. Even when you don't use the views object 
-   *   explicitly on a state config, one is still created for you internally.
-   *   So by decorating this builder function you have access to decorating template 
-   *   and controller properties.
-   * - **ownParams** `{object}` - returns an array of params that belong to the state, 
-   *   not including any params defined by ancestor states.
-   * - **path** `{string}` - returns the full path from the root down to this state. 
-   *   Needed for state activation.
-   * - **includes** `{object}` - returns an object that includes every state that 
-   *   would pass a `$state.includes()` test.
-   *
-   * @example
-   * <pre>
-   * // Override the internal 'views' builder with a function that takes the state
-   * // definition, and a reference to the internal function being overridden:
-   * $stateProvider.decorator('views', function (state, parent) {
-   *   var result = {},
-   *       views = parent(state);
-   *
-   *   angular.forEach(views, function (config, name) {
-   *     var autoName = (state.name + '.' + name).replace('.', '/');
-   *     config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
-   *     result[name] = config;
-   *   });
-   *   return result;
-   * });
-   *
-   * $stateProvider.state('home', {
-   *   views: {
-   *     'contact.list': { controller: 'ListController' },
-   *     'contact.item': { controller: 'ItemController' }
-   *   }
-   * });
-   *
-   * // ...
-   *
-   * $state.go('home');
-   * // Auto-populates list and item views with /partials/home/contact/list.html,
-   * // and /partials/home/contact/item.html, respectively.
-   * </pre>
-   *
-   * @param {string} name The name of the builder function to decorate. 
-   * @param {object} func A function that is responsible for decorating the original 
-   * builder function. The function receives two parameters:
-   *
-   *   - `{object}` - state - The state config object.
-   *   - `{object}` - super - The original builder function.
-   *
-   * @return {object} $stateProvider - $stateProvider instance
-   */
-  this.decorator = decorator;
-  function decorator(name, func) {
-    /*jshint validthis: true */
-    if (isString(name) && !isDefined(func)) {
-      return stateBuilder[name];
-    }
-    if (!isFunction(func) || !isString(name)) {
-      return this;
-    }
-    if (stateBuilder[name] && !stateBuilder.$delegates[name]) {
-      stateBuilder.$delegates[name] = stateBuilder[name];
-    }
-    stateBuilder[name] = func;
-    return this;
-  }
-
-  /**
-   * @ngdoc function
-   * @name ui.router.state.$stateProvider#state
-   * @methodOf ui.router.state.$stateProvider
-   *
-   * @description
-   * Registers a state configuration under a given state name. The stateConfig object
-   * has the following acceptable properties.
-   *
-   * @param {string} name A unique state name, e.g. "home", "about", "contacts".
-   * To create a parent/child state use a dot, e.g. "about.sales", "home.newest".
-   * @param {object} stateConfig State configuration object.
-   * @param {string|function=} stateConfig.template
-   * <a id='template'></a>
-   *   html template as a string or a function that returns
-   *   an html template as a string which should be used by the uiView directives. This property 
-   *   takes precedence over templateUrl.
-   *   
-   *   If `template` is a function, it will be called with the following parameters:
-   *
-   *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by
-   *     applying the current state
-   *
-   * <pre>template:
-   *   "<h1>inline template definition</h1>" +
-   *   "<div ui-view></div>"</pre>
-   * <pre>template: function(params) {
-   *       return "<h1>generated template</h1>"; }</pre>
-   * </div>
-   *
-   * @param {string|function=} stateConfig.templateUrl
-   * <a id='templateUrl'></a>
-   *
-   *   path or function that returns a path to an html
-   *   template that should be used by uiView.
-   *   
-   *   If `templateUrl` is a function, it will be called with the following parameters:
-   *
-   *   - {array.&lt;object&gt;} - state parameters extracted from the current $location.path() by 
-   *     applying the current state
-   *
-   * <pre>templateUrl: "home.html"</pre>
-   * <pre>templateUrl: function(params) {
-   *     return myTemplates[params.pageId]; }</pre>
-   *
-   * @param {function=} stateConfig.templateProvider
-   * <a id='templateProvider'></a>
-   *    Provider function that returns HTML content string.
-   * <pre> templateProvider:
-   *       function(MyTemplateService, params) {
-   *         return MyTemplateService.getTemplate(params.pageId);
-   *       }</pre>
-   *
-   * @param {string|function=} stateConfig.controller
-   * <a id='controller'></a>
-   *
-   *  Controller fn that should be associated with newly
-   *   related scope or the name of a registered controller if passed as a string.
-   *   Optionally, the ControllerAs may be declared here.
-   * <pre>controller: "MyRegisteredController"</pre>
-   * <pre>controller:
-   *     "MyRegisteredController as fooCtrl"}</pre>
-   * <pre>controller: function($scope, MyService) {
-   *     $scope.data = MyService.getData(); }</pre>
-   *
-   * @param {function=} stateConfig.controllerProvider
-   * <a id='controllerProvider'></a>
-   *
-   * Injectable provider function that returns the actual controller or string.
-   * <pre>controllerProvider:
-   *   function(MyResolveData) {
-   *     if (MyResolveData.foo)
-   *       return "FooCtrl"
-   *     else if (MyResolveData.bar)
-   *       return "BarCtrl";
-   *     else return function($scope) {
-   *       $scope.baz = "Qux";
-   *     }
-   *   }</pre>
-   *
-   * @param {string=} stateConfig.controllerAs
-   * <a id='controllerAs'></a>
-   * 
-   * A controller alias name. If present the controller will be
-   *   published to scope under the controllerAs name.
-   * <pre>controllerAs: "myCtrl"</pre>
-   *
-   * @param {string|object=} stateConfig.parent
-   * <a id='parent'></a>
-   * Optionally specifies the parent state of this state.
-   *
-   * <pre>parent: 'parentState'</pre>
-   * <pre>parent: parentState // JS variable</pre>
-   *
-   * @param {object=} stateConfig.resolve
-   * <a id='resolve'></a>
-   *
-   * An optional map&lt;string, function&gt; of dependencies which
-   *   should be injected into the controller. If any of these dependencies are promises, 
-   *   the router will wait for them all to be resolved before the controller is instantiated.
-   *   If all the promises are resolved successfully, the $stateChangeSuccess event is fired
-   *   and the values of the resolved promises are injected into any controllers that reference them.
-   *   If any  of the promises are rejected the $stateChangeError event is fired.
-   *
-   *   The map object is:
-   *   
-   *   - key - {string}: name of dependency to be injected into controller
-   *   - factory - {string|function}: If string then it is alias for service. Otherwise if function, 
-   *     it is injected and return value it treated as dependency. If result is a promise, it is 
-   *     resolved before its value is injected into controller.
-   *
-   * <pre>resolve: {
-   *     myResolve1:
-   *       function($http, $stateParams) {
-   *         return $http.get("/api/foos/"+stateParams.fooID);
-   *       }
-   *     }</pre>
-   *
-   * @param {string=} stateConfig.url
-   * <a id='url'></a>
-   *
-   *   A url fragment with optional parameters. When a state is navigated or
-   *   transitioned to, the `$stateParams` service will be populated with any 
-   *   parameters that were passed.
-   *
-   *   (See {@link ui.router.util.type:UrlMatcher UrlMatcher} `UrlMatcher`} for
-   *   more details on acceptable patterns )
-   *
-   * examples:
-   * <pre>url: "/home"
-   * url: "/users/:userid"
-   * url: "/books/{bookid:[a-zA-Z_-]}"
-   * url: "/books/{categoryid:int}"
-   * url: "/books/{publishername:string}/{categoryid:int}"
-   * url: "/messages?before&after"
-   * url: "/messages?{before:date}&{after:date}"
-   * url: "/messages/:mailboxid?{before:date}&{after:date}"
-   * </pre>
-   *
-   * @param {object=} stateConfig.views
-   * <a id='views'></a>
-   * an optional map&lt;string, object&gt; which defined multiple views, or targets views
-   * manually/explicitly.
-   *
-   * Examples:
-   *
-   * Targets three named `ui-view`s in the parent state's template
-   * <pre>views: {
-   *     header: {
-   *       controller: "headerCtrl",
-   *       templateUrl: "header.html"
-   *     }, body: {
-   *       controller: "bodyCtrl",
-   *       templateUrl: "body.html"
-   *     }, footer: {
-   *       controller: "footCtrl",
-   *       templateUrl: "footer.html"
-   *     }
-   *   }</pre>
-   *
-   * Targets named `ui-view="header"` from grandparent state 'top''s template, and named `ui-view="body" from parent state's template.
-   * <pre>views: {
-   *     'header@top': {
-   *       controller: "msgHeaderCtrl",
-   *       templateUrl: "msgHeader.html"
-   *     }, 'body': {
-   *       controller: "messagesCtrl",
-   *       templateUrl: "messages.html"
-   *     }
-   *   }</pre>
-   *
-   * @param {boolean=} [stateConfig.abstract=false]
-   * <a id='abstract'></a>
-   * An abstract state will never be directly activated,
-   *   but can provide inherited properties to its common children states.
-   * <pre>abstract: true</pre>
-   *
-   * @param {function=} stateConfig.onEnter
-   * <a id='onEnter'></a>
-   *
-   * Callback function for when a state is entered. Good way
-   *   to trigger an action or dispatch an event, such as opening a dialog.
-   * If minifying your scripts, make sure to explictly annotate this function,
-   * because it won't be automatically annotated by your build tools.
-   *
-   * <pre>onEnter: function(MyService, $stateParams) {
-   *     MyService.foo($stateParams.myParam);
-   * }</pre>
-   *
-   * @param {function=} stateConfig.onExit
-   * <a id='onExit'></a>
-   *
-   * Callback function for when a state is exited. Good way to
-   *   trigger an action or dispatch an event, such as opening a dialog.
-   * If minifying your scripts, make sure to explictly annotate this function,
-   * because it won't be automatically annotated by your build tools.
-   *
-   * <pre>onExit: function(MyService, $stateParams) {
-   *     MyService.cleanup($stateParams.myParam);
-   * }</pre>
-   *
-   * @param {boolean=} [stateConfig.reloadOnSearch=true]
-   * <a id='reloadOnSearch'></a>
-   *
-   * If `false`, will not retrigger the same state
-   *   just because a search/query parameter has changed (via $location.search() or $location.hash()). 
-   *   Useful for when you'd like to modify $location.search() without triggering a reload.
-   * <pre>reloadOnSearch: false</pre>
-   *
-   * @param {object=} stateConfig.data
-   * <a id='data'></a>
-   *
-   * Arbitrary data object, useful for custom configuration.  The parent state's `data` is
-   *   prototypally inherited.  In other words, adding a data property to a state adds it to
-   *   the entire subtree via prototypal inheritance.
-   *
-   * <pre>data: {
-   *     requiredRole: 'foo'
-   * } </pre>
-   *
-   * @param {object=} stateConfig.params
-   * <a id='params'></a>
-   *
-   * A map which optionally configures parameters declared in the `url`, or
-   *   defines additional non-url parameters.  For each parameter being
-   *   configured, add a configuration object keyed to the name of the parameter.
-   *
-   *   Each parameter configuration object may contain the following properties:
-   *
-   *   - ** value ** - {object|function=}: specifies the default value for this
-   *     parameter.  This implicitly sets this parameter as optional.
-   *
-   *     When UI-Router routes to a state and no value is
-   *     specified for this parameter in the URL or transition, the
-   *     default value will be used instead.  If `value` is a function,
-   *     it will be injected and invoked, and the return value used.
-   *
-   *     *Note*: `undefined` is treated as "no default value" while `null`
-   *     is treated as "the default value is `null`".
-   *
-   *     *Shorthand*: If you only need to configure the default value of the
-   *     parameter, you may use a shorthand syntax.   In the **`params`**
-   *     map, instead mapping the param name to a full parameter configuration
-   *     object, simply set map it to the default parameter value, e.g.:
-   *
-   * <pre>// define a parameter's default value
-   * params: {
-   *     param1: { value: "defaultValue" }
-   * }
-   * // shorthand default values
-   * params: {
-   *     param1: "defaultValue",
-   *     param2: "param2Default"
-   * }</pre>
-   *
-   *   - ** array ** - {boolean=}: *(default: false)* If true, the param value will be
-   *     treated as an array of values.  If you specified a Type, the value will be
-   *     treated as an array of the specified Type.  Note: query parameter values
-   *     default to a special `"auto"` mode.
-   *
-   *     For query parameters in `"auto"` mode, if multiple  values for a single parameter
-   *     are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values
-   *     are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`).  However, if
-   *     only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single
-   *     value (e.g.: `{ foo: '1' }`).
-   *
-   * <pre>params: {
-   *     param1: { array: true }
-   * }</pre>
-   *
-   *   - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when
-   *     the current parameter value is the same as the default value. If `squash` is not set, it uses the
-   *     configured default squash policy.
-   *     (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`})
-   *
-   *   There are three squash settings:
-   *
-   *     - false: The parameter's default value is not squashed.  It is encoded and included in the URL
-   *     - true: The parameter's default value is omitted from the URL.  If the parameter is preceeded and followed
-   *       by slashes in the state's `url` declaration, then one of those slashes are omitted.
-   *       This can allow for cleaner looking URLs.
-   *     - `"<arbitrary string>"`: The parameter's default value is replaced with an arbitrary placeholder of  your choice.
-   *
-   * <pre>params: {
-   *     param1: {
-   *       value: "defaultId",
-   *       squash: true
-   * } }
-   * // squash "defaultValue" to "~"
-   * params: {
-   *     param1: {
-   *       value: "defaultValue",
-   *       squash: "~"
-   * } }
-   * </pre>
-   *
-   *
-   * @example
-   * <pre>
-   * // Some state name examples
-   *
-   * // stateName can be a single top-level name (must be unique).
-   * $stateProvider.state("home", {});
-   *
-   * // Or it can be a nested state name. This state is a child of the
-   * // above "home" state.
-   * $stateProvider.state("home.newest", {});
-   *
-   * // Nest states as deeply as needed.
-   * $stateProvider.state("home.newest.abc.xyz.inception", {});
-   *
-   * // state() returns $stateProvider, so you can chain state declarations.
-   * $stateProvider
-   *   .state("home", {})
-   *   .state("about", {})
-   *   .state("contacts", {});
-   * </pre>
-   *
-   */
-  this.state = state;
-  function state(name, definition) {
-    /*jshint validthis: true */
-    if (isObject(name)) definition = name;
-    else definition.name = name;
-    registerState(definition);
-    return this;
-  }
-
-  /**
-   * @ngdoc object
-   * @name ui.router.state.$state
-   *
-   * @requires $rootScope
-   * @requires $q
-   * @requires ui.router.state.$view
-   * @requires $injector
-   * @requires ui.router.util.$resolve
-   * @requires ui.router.state.$stateParams
-   * @requires ui.router.router.$urlRouter
-   *
-   * @property {object} params A param object, e.g. {sectionId: section.id)}, that 
-   * you'd like to test against the current active state.
-   * @property {object} current A reference to the state's config object. However 
-   * you passed it in. Useful for accessing custom data.
-   * @property {object} transition Currently pending transition. A promise that'll 
-   * resolve or reject.
-   *
-   * @description
-   * `$state` service is responsible for representing states as well as transitioning
-   * between them. It also provides interfaces to ask for current state or even states
-   * you're coming from.
-   */
-  this.$get = $get;
-  $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory'];
-  function $get(   $rootScope,   $q,   $view,   $injector,   $resolve,   $stateParams,   $urlRouter,   $location,   $urlMatcherFactory) {
-
-    var TransitionSuperseded = $q.reject(new Error('transition superseded'));
-    var TransitionPrevented = $q.reject(new Error('transition prevented'));
-    var TransitionAborted = $q.reject(new Error('transition aborted'));
-    var TransitionFailed = $q.reject(new Error('transition failed'));
-
-    // Handles the case where a state which is the target of a transition is not found, and the user
-    // can optionally retry or defer the transition
-    function handleRedirect(redirect, state, params, options) {
-      /**
-       * @ngdoc event
-       * @name ui.router.state.$state#$stateNotFound
-       * @eventOf ui.router.state.$state
-       * @eventType broadcast on root scope
-       * @description
-       * Fired when a requested state **cannot be found** using the provided state name during transition.
-       * The event is broadcast allowing any handlers a single chance to deal with the error (usually by
-       * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,
-       * you can see its three properties in the example. You can use `event.preventDefault()` to abort the
-       * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.
-       *
-       * @param {Object} event Event object.
-       * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.
-       * @param {State} fromState Current state object.
-       * @param {Object} fromParams Current state params.
-       *
-       * @example
-       *
-       * <pre>
-       * // somewhere, assume lazy.state has not been defined
-       * $state.go("lazy.state", {a:1, b:2}, {inherit:false});
-       *
-       * // somewhere else
-       * $scope.$on('$stateNotFound',
-       * function(event, unfoundState, fromState, fromParams){
-       *     console.log(unfoundState.to); // "lazy.state"
-       *     console.log(unfoundState.toParams); // {a:1, b:2}
-       *     console.log(unfoundState.options); // {inherit:false} + default options
-       * })
-       * </pre>
-       */
-      var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);
-
-      if (evt.defaultPrevented) {
-        $urlRouter.update();
-        return TransitionAborted;
-      }
-
-      if (!evt.retry) {
-        return null;
-      }
-
-      // Allow the handler to return a promise to defer state lookup retry
-      if (options.$retry) {
-        $urlRouter.update();
-        return TransitionFailed;
-      }
-      var retryTransition = $state.transition = $q.when(evt.retry);
-
-      retryTransition.then(function() {
-        if (retryTransition !== $state.transition) return TransitionSuperseded;
-        redirect.options.$retry = true;
-        return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);
-      }, function() {
-        return TransitionAborted;
-      });
-      $urlRouter.update();
-
-      return retryTransition;
-    }
-
-    root.locals = { resolve: null, globals: { $stateParams: {} } };
-
-    $state = {
-      params: {},
-      current: root.self,
-      $current: root,
-      transition: null
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#reload
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * A method that force reloads the current state. All resolves are re-resolved,
-     * controllers reinstantiated, and events re-fired.
-     *
-     * @example
-     * <pre>
-     * var app angular.module('app', ['ui.router']);
-     *
-     * app.controller('ctrl', function ($scope, $state) {
-     *   $scope.reload = function(){
-     *     $state.reload();
-     *   }
-     * });
-     * </pre>
-     *
-     * `reload()` is just an alias for:
-     * <pre>
-     * $state.transitionTo($state.current, $stateParams, { 
-     *   reload: true, inherit: false, notify: true
-     * });
-     * </pre>
-     *
-     * @param {string=|object=} state - A state name or a state object, which is the root of the resolves to be re-resolved.
-     * @example
-     * <pre>
-     * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item' 
-     * //and current state is 'contacts.detail.item'
-     * var app angular.module('app', ['ui.router']);
-     *
-     * app.controller('ctrl', function ($scope, $state) {
-     *   $scope.reload = function(){
-     *     //will reload 'contact.detail' and 'contact.detail.item' states
-     *     $state.reload('contact.detail');
-     *   }
-     * });
-     * </pre>
-     *
-     * `reload()` is just an alias for:
-     * <pre>
-     * $state.transitionTo($state.current, $stateParams, { 
-     *   reload: true, inherit: false, notify: true
-     * });
-     * </pre>
-
-     * @returns {promise} A promise representing the state of the new transition. See
-     * {@link ui.router.state.$state#methods_go $state.go}.
-     */
-    $state.reload = function reload(state) {
-      return $state.transitionTo($state.current, $stateParams, { reload: state || true, inherit: false, notify: true});
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#go
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * Convenience method for transitioning to a new state. `$state.go` calls 
-     * `$state.transitionTo` internally but automatically sets options to 
-     * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. 
-     * This allows you to easily use an absolute or relative to path and specify 
-     * only the parameters you'd like to update (while letting unspecified parameters 
-     * inherit from the currently active ancestor states).
-     *
-     * @example
-     * <pre>
-     * var app = angular.module('app', ['ui.router']);
-     *
-     * app.controller('ctrl', function ($scope, $state) {
-     *   $scope.changeState = function () {
-     *     $state.go('contact.detail');
-     *   };
-     * });
-     * </pre>
-     * <img src='../ngdoc_assets/StateGoExamples.png'/>
-     *
-     * @param {string} to Absolute state name or relative state path. Some examples:
-     *
-     * - `$state.go('contact.detail')` - will go to the `contact.detail` state
-     * - `$state.go('^')` - will go to a parent state
-     * - `$state.go('^.sibling')` - will go to a sibling state
-     * - `$state.go('.child.grandchild')` - will go to grandchild state
-     *
-     * @param {object=} params A map of the parameters that will be sent to the state, 
-     * will populate $stateParams. Any parameters that are not specified will be inherited from currently 
-     * defined parameters. This allows, for example, going to a sibling state that shares parameters
-     * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.
-     * transitioning to a sibling will get you the parameters for all parents, transitioning to a child
-     * will get you all current parameters, etc.
-     * @param {object=} options Options object. The options are:
-     *
-     * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
-     *    will not. If string, must be `"replace"`, which will update url and also replace last history record.
-     * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.
-     * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), 
-     *    defines which state to be relative from.
-     * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
-     * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params 
-     *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
-     *    use this when you want to force a reload when *everything* is the same, including search params.
-     *
-     * @returns {promise} A promise representing the state of the new transition.
-     *
-     * Possible success values:
-     *
-     * - $state.current
-     *
-     * <br/>Possible rejection values:
-     *
-     * - 'transition superseded' - when a newer transition has been started after this one
-     * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener
-     * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or
-     *   when a `$stateNotFound` `event.retry` promise errors.
-     * - 'transition failed' - when a state has been unsuccessfully found after 2 tries.
-     * - *resolve error* - when an error has occurred with a `resolve`
-     *
-     */
-    $state.go = function go(to, params, options) {
-      return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options));
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#transitionTo
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go}
-     * uses `transitionTo` internally. `$state.go` is recommended in most situations.
-     *
-     * @example
-     * <pre>
-     * var app = angular.module('app', ['ui.router']);
-     *
-     * app.controller('ctrl', function ($scope, $state) {
-     *   $scope.changeState = function () {
-     *     $state.transitionTo('contact.detail');
-     *   };
-     * });
-     * </pre>
-     *
-     * @param {string} to State name.
-     * @param {object=} toParams A map of the parameters that will be sent to the state,
-     * will populate $stateParams.
-     * @param {object=} options Options object. The options are:
-     *
-     * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
-     *    will not. If string, must be `"replace"`, which will update url and also replace last history record.
-     * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.
-     * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), 
-     *    defines which state to be relative from.
-     * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
-     * - **`reload`** (v0.2.5) - {boolean=false|string=|object=}, If `true` will force transition even if the state or params 
-     *    have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
-     *    use this when you want to force a reload when *everything* is the same, including search params.
-     *    if String, then will reload the state with the name given in reload, and any children.
-     *    if Object, then a stateObj is expected, will reload the state found in stateObj, and any children.
-     *
-     * @returns {promise} A promise representing the state of the new transition. See
-     * {@link ui.router.state.$state#methods_go $state.go}.
-     */
-    $state.transitionTo = function transitionTo(to, toParams, options) {
-      toParams = toParams || {};
-      options = extend({
-        location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false
-      }, options || {});
-
-      var from = $state.$current, fromParams = $state.params, fromPath = from.path;
-      var evt, toState = findState(to, options.relative);
-
-      // Store the hash param for later (since it will be stripped out by various methods)
-      var hash = toParams['#'];
-
-      if (!isDefined(toState)) {
-        var redirect = { to: to, toParams: toParams, options: options };
-        var redirectResult = handleRedirect(redirect, from.self, fromParams, options);
-
-        if (redirectResult) {
-          return redirectResult;
-        }
-
-        // Always retry once if the $stateNotFound was not prevented
-        // (handles either redirect changed or state lazy-definition)
-        to = redirect.to;
-        toParams = redirect.toParams;
-        options = redirect.options;
-        toState = findState(to, options.relative);
-
-        if (!isDefined(toState)) {
-          if (!options.relative) throw new Error("No such state '" + to + "'");
-          throw new Error("Could not resolve '" + to + "' from state '" + options.relative + "'");
-        }
-      }
-      if (toState[abstractKey]) throw new Error("Cannot transition to abstract state '" + to + "'");
-      if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState);
-      if (!toState.params.$$validates(toParams)) return TransitionFailed;
-
-      toParams = toState.params.$$values(toParams);
-      to = toState;
-
-      var toPath = to.path;
-
-      // Starting from the root of the path, keep all levels that haven't changed
-      var keep = 0, state = toPath[keep], locals = root.locals, toLocals = [];
-
-      if (!options.reload) {
-        while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) {
-          locals = toLocals[keep] = state.locals;
-          keep++;
-          state = toPath[keep];
-        }
-      } else if (isString(options.reload) || isObject(options.reload)) {
-        if (isObject(options.reload) && !options.reload.name) {
-          throw new Error('Invalid reload state object');
-        }
-        
-        var reloadState = options.reload === true ? fromPath[0] : findState(options.reload);
-        if (options.reload && !reloadState) {
-          throw new Error("No such reload state '" + (isString(options.reload) ? options.reload : options.reload.name) + "'");
-        }
-
-        while (state && state === fromPath[keep] && state !== reloadState) {
-          locals = toLocals[keep] = state.locals;
-          keep++;
-          state = toPath[keep];
-        }
-      }
-
-      // If we're going to the same state and all locals are kept, we've got nothing to do.
-      // But clear 'transition', as we still want to cancel any other pending transitions.
-      // TODO: We may not want to bump 'transition' if we're called from a location change
-      // that we've initiated ourselves, because we might accidentally abort a legitimate
-      // transition initiated from code?
-      if (shouldSkipReload(to, toParams, from, fromParams, locals, options)) {
-        if (hash) toParams['#'] = hash;
-        $state.params = toParams;
-        copy($state.params, $stateParams);
-        if (options.location && to.navigable && to.navigable.url) {
-          $urlRouter.push(to.navigable.url, toParams, {
-            $$avoidResync: true, replace: options.location === 'replace'
-          });
-          $urlRouter.update(true);
-        }
-        $state.transition = null;
-        return $q.when($state.current);
-      }
-
-      // Filter parameters before we pass them to event handlers etc.
-      toParams = filterByKeys(to.params.$$keys(), toParams || {});
-
-      // Broadcast start event and cancel the transition if requested
-      if (options.notify) {
-        /**
-         * @ngdoc event
-         * @name ui.router.state.$state#$stateChangeStart
-         * @eventOf ui.router.state.$state
-         * @eventType broadcast on root scope
-         * @description
-         * Fired when the state transition **begins**. You can use `event.preventDefault()`
-         * to prevent the transition from happening and then the transition promise will be
-         * rejected with a `'transition prevented'` value.
-         *
-         * @param {Object} event Event object.
-         * @param {State} toState The state being transitioned to.
-         * @param {Object} toParams The params supplied to the `toState`.
-         * @param {State} fromState The current state, pre-transition.
-         * @param {Object} fromParams The params supplied to the `fromState`.
-         *
-         * @example
-         *
-         * <pre>
-         * $rootScope.$on('$stateChangeStart',
-         * function(event, toState, toParams, fromState, fromParams){
-         *     event.preventDefault();
-         *     // transitionTo() promise will be rejected with
-         *     // a 'transition prevented' error
-         * })
-         * </pre>
-         */
-        if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams).defaultPrevented) {
-          $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams);
-          $urlRouter.update();
-          return TransitionPrevented;
-        }
-      }
-
-      // Resolve locals for the remaining states, but don't update any global state just
-      // yet -- if anything fails to resolve the current state needs to remain untouched.
-      // We also set up an inheritance chain for the locals here. This allows the view directive
-      // to quickly look up the correct definition for each view in the current state. Even
-      // though we create the locals object itself outside resolveState(), it is initially
-      // empty and gets filled asynchronously. We need to keep track of the promise for the
-      // (fully resolved) current locals, and pass this down the chain.
-      var resolved = $q.when(locals);
-
-      for (var l = keep; l < toPath.length; l++, state = toPath[l]) {
-        locals = toLocals[l] = inherit(locals);
-        resolved = resolveState(state, toParams, state === to, resolved, locals, options);
-      }
-
-      // Once everything is resolved, we are ready to perform the actual transition
-      // and return a promise for the new state. We also keep track of what the
-      // current promise is, so that we can detect overlapping transitions and
-      // keep only the outcome of the last transition.
-      var transition = $state.transition = resolved.then(function () {
-        var l, entering, exiting;
-
-        if ($state.transition !== transition) return TransitionSuperseded;
-
-        // Exit 'from' states not kept
-        for (l = fromPath.length - 1; l >= keep; l--) {
-          exiting = fromPath[l];
-          if (exiting.self.onExit) {
-            $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals);
-          }
-          exiting.locals = null;
-        }
-
-        // Enter 'to' states not kept
-        for (l = keep; l < toPath.length; l++) {
-          entering = toPath[l];
-          entering.locals = toLocals[l];
-          if (entering.self.onEnter) {
-            $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals);
-          }
-        }
-
-        // Re-add the saved hash before we start returning things
-        if (hash) toParams['#'] = hash;
-
-        // Run it again, to catch any transitions in callbacks
-        if ($state.transition !== transition) return TransitionSuperseded;
-
-        // Update globals in $state
-        $state.$current = to;
-        $state.current = to.self;
-        $state.params = toParams;
-        copy($state.params, $stateParams);
-        $state.transition = null;
-
-        if (options.location && to.navigable) {
-          $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, {
-            $$avoidResync: true, replace: options.location === 'replace'
-          });
-        }
-
-        if (options.notify) {
-        /**
-         * @ngdoc event
-         * @name ui.router.state.$state#$stateChangeSuccess
-         * @eventOf ui.router.state.$state
-         * @eventType broadcast on root scope
-         * @description
-         * Fired once the state transition is **complete**.
-         *
-         * @param {Object} event Event object.
-         * @param {State} toState The state being transitioned to.
-         * @param {Object} toParams The params supplied to the `toState`.
-         * @param {State} fromState The current state, pre-transition.
-         * @param {Object} fromParams The params supplied to the `fromState`.
-         */
-          $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams);
-        }
-        $urlRouter.update(true);
-
-        return $state.current;
-      }, function (error) {
-        if ($state.transition !== transition) return TransitionSuperseded;
-
-        $state.transition = null;
-        /**
-         * @ngdoc event
-         * @name ui.router.state.$state#$stateChangeError
-         * @eventOf ui.router.state.$state
-         * @eventType broadcast on root scope
-         * @description
-         * Fired when an **error occurs** during transition. It's important to note that if you
-         * have any errors in your resolve functions (javascript errors, non-existent services, etc)
-         * they will not throw traditionally. You must listen for this $stateChangeError event to
-         * catch **ALL** errors.
-         *
-         * @param {Object} event Event object.
-         * @param {State} toState The state being transitioned to.
-         * @param {Object} toParams The params supplied to the `toState`.
-         * @param {State} fromState The current state, pre-transition.
-         * @param {Object} fromParams The params supplied to the `fromState`.
-         * @param {Error} error The resolve error object.
-         */
-        evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error);
-
-        if (!evt.defaultPrevented) {
-            $urlRouter.update();
-        }
-
-        return $q.reject(error);
-      });
-
-      return transition;
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#is
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * Similar to {@link ui.router.state.$state#methods_includes $state.includes},
-     * but only checks for the full state name. If params is supplied then it will be
-     * tested for strict equality against the current active params object, so all params
-     * must match with none missing and no extras.
-     *
-     * @example
-     * <pre>
-     * $state.$current.name = 'contacts.details.item';
-     *
-     * // absolute name
-     * $state.is('contact.details.item'); // returns true
-     * $state.is(contactDetailItemStateObject); // returns true
-     *
-     * // relative name (. and ^), typically from a template
-     * // E.g. from the 'contacts.details' template
-     * <div ng-class="{highlighted: $state.is('.item')}">Item</div>
-     * </pre>
-     *
-     * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check.
-     * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like
-     * to test against the current active state.
-     * @param {object=} options An options object.  The options are:
-     *
-     * - **`relative`** - {string|object} -  If `stateOrName` is a relative state name and `options.relative` is set, .is will
-     * test relative to `options.relative` state (or name).
-     *
-     * @returns {boolean} Returns true if it is the state.
-     */
-    $state.is = function is(stateOrName, params, options) {
-      options = extend({ relative: $state.$current }, options || {});
-      var state = findState(stateOrName, options.relative);
-
-      if (!isDefined(state)) { return undefined; }
-      if ($state.$current !== state) { return false; }
-      return params ? equalForKeys(state.params.$$values(params), $stateParams) : true;
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#includes
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * A method to determine if the current active state is equal to or is the child of the
-     * state stateName. If any params are passed then they will be tested for a match as well.
-     * Not all the parameters need to be passed, just the ones you'd like to test for equality.
-     *
-     * @example
-     * Partial and relative names
-     * <pre>
-     * $state.$current.name = 'contacts.details.item';
-     *
-     * // Using partial names
-     * $state.includes("contacts"); // returns true
-     * $state.includes("contacts.details"); // returns true
-     * $state.includes("contacts.details.item"); // returns true
-     * $state.includes("contacts.list"); // returns false
-     * $state.includes("about"); // returns false
-     *
-     * // Using relative names (. and ^), typically from a template
-     * // E.g. from the 'contacts.details' template
-     * <div ng-class="{highlighted: $state.includes('.item')}">Item</div>
-     * </pre>
-     *
-     * Basic globbing patterns
-     * <pre>
-     * $state.$current.name = 'contacts.details.item.url';
-     *
-     * $state.includes("*.details.*.*"); // returns true
-     * $state.includes("*.details.**"); // returns true
-     * $state.includes("**.item.**"); // returns true
-     * $state.includes("*.details.item.url"); // returns true
-     * $state.includes("*.details.*.url"); // returns true
-     * $state.includes("*.details.*"); // returns false
-     * $state.includes("item.**"); // returns false
-     * </pre>
-     *
-     * @param {string} stateOrName A partial name, relative name, or glob pattern
-     * to be searched for within the current state name.
-     * @param {object=} params A param object, e.g. `{sectionId: section.id}`,
-     * that you'd like to test against the current active state.
-     * @param {object=} options An options object.  The options are:
-     *
-     * - **`relative`** - {string|object=} -  If `stateOrName` is a relative state reference and `options.relative` is set,
-     * .includes will test relative to `options.relative` state (or name).
-     *
-     * @returns {boolean} Returns true if it does include the state
-     */
-    $state.includes = function includes(stateOrName, params, options) {
-      options = extend({ relative: $state.$current }, options || {});
-      if (isString(stateOrName) && isGlob(stateOrName)) {
-        if (!doesStateMatchGlob(stateOrName)) {
-          return false;
-        }
-        stateOrName = $state.$current.name;
-      }
-
-      var state = findState(stateOrName, options.relative);
-      if (!isDefined(state)) { return undefined; }
-      if (!isDefined($state.$current.includes[state.name])) { return false; }
-      return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true;
-    };
-
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#href
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * A url generation method that returns the compiled url for the given state populated with the given params.
-     *
-     * @example
-     * <pre>
-     * expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob");
-     * </pre>
-     *
-     * @param {string|object} stateOrName The state name or state object you'd like to generate a url from.
-     * @param {object=} params An object of parameter values to fill the state's required parameters.
-     * @param {object=} options Options object. The options are:
-     *
-     * - **`lossy`** - {boolean=true} -  If true, and if there is no url associated with the state provided in the
-     *    first parameter, then the constructed href url will be built from the first navigable ancestor (aka
-     *    ancestor with a valid url).
-     * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.
-     * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), 
-     *    defines which state to be relative from.
-     * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
-     * 
-     * @returns {string} compiled state url
-     */
-    $state.href = function href(stateOrName, params, options) {
-      options = extend({
-        lossy:    true,
-        inherit:  true,
-        absolute: false,
-        relative: $state.$current
-      }, options || {});
-
-      var state = findState(stateOrName, options.relative);
-
-      if (!isDefined(state)) return null;
-      if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state);
-      
-      var nav = (state && options.lossy) ? state.navigable : state;
-
-      if (!nav || nav.url === undefined || nav.url === null) {
-        return null;
-      }
-      return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys().concat('#'), params || {}), {
-        absolute: options.absolute
-      });
-    };
-
-    /**
-     * @ngdoc function
-     * @name ui.router.state.$state#get
-     * @methodOf ui.router.state.$state
-     *
-     * @description
-     * Returns the state configuration object for any specific state or all states.
-     *
-     * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for
-     * the requested state. If not provided, returns an array of ALL state configs.
-     * @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context.
-     * @returns {Object|Array} State configuration object or array of all objects.
-     */
-    $state.get = function (stateOrName, context) {
-      if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; });
-      var state = findState(stateOrName, context || $state.$current);
-      return (state && state.self) ? state.self : null;
-    };
-
-    function resolveState(state, params, paramsAreFiltered, inherited, dst, options) {
-      // Make a restricted $stateParams with only the parameters that apply to this state if
-      // necessary. In addition to being available to the controller and onEnter/onExit callbacks,
-      // we also need $stateParams to be available for any $injector calls we make during the
-      // dependency resolution process.
-      var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params);
-      var locals = { $stateParams: $stateParams };
-
-      // Resolve 'global' dependencies for the state, i.e. those not specific to a view.
-      // We're also including $stateParams in this; that way the parameters are restricted
-      // to the set that should be visible to the state, and are independent of when we update
-      // the global $state and $stateParams values.
-      dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state);
-      var promises = [dst.resolve.then(function (globals) {
-        dst.globals = globals;
-      })];
-      if (inherited) promises.push(inherited);
-
-      function resolveViews() {
-        var viewsPromises = [];
-
-        // Resolve template and dependencies for all views.
-        forEach(state.views, function (view, name) {
-          var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {});
-          injectables.$template = [ function () {
-            return $view.load(name, { view: view, locals: dst.globals, params: $stateParams, notify: options.notify }) || '';
-          }];
-
-          viewsPromises.push($resolve.resolve(injectables, dst.globals, dst.resolve, state).then(function (result) {
-            // References to the controller (only instantiated at link time)
-            if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) {
-              var injectLocals = angular.extend({}, injectables, dst.globals);
-              result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals);
-            } else {
-              result.$$controller = view.controller;
-            }
-            // Provide access to the state itself for internal use
-            result.$$state = state;
-            result.$$controllerAs = view.controllerAs;
-            dst[name] = result;
-          }));
-        });
-
-        return $q.all(viewsPromises).then(function(){
-          return dst.globals;
-        });
-      }
-
-      // Wait for all the promises and then return the activation object
-      return $q.all(promises).then(resolveViews).then(function (values) {
-        return dst;
-      });
-    }
-
-    return $state;
-  }
-
-  function shouldSkipReload(to, toParams, from, fromParams, locals, options) {
-    // Return true if there are no differences in non-search (path/object) params, false if there are differences
-    function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {
-      // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.
-      function notSearchParam(key) {
-        return fromAndToState.params[key].location != "search";
-      }
-      var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);
-      var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));
-      var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);
-      return nonQueryParamSet.$$equals(fromParams, toParams);
-    }
-
-    // If reload was not explicitly requested
-    // and we're transitioning to the same state we're already in
-    // and    the locals didn't change
-    //     or they changed in a way that doesn't merit reloading
-    //        (reloadOnParams:false, or reloadOnSearch.false and only search params changed)
-    // Then return true.
-    if (!options.reload && to === from &&
-      (locals === from.locals || (to.self.reloadOnSearch === false && nonSearchParamsEqual(from, fromParams, toParams)))) {
-      return true;
-    }
-  }
-}
-
-angular.module('ui.router.state')
-  .value('$stateParams', {})
-  .provider('$state', $StateProvider);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/stateDirectives.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/stateDirectives.js
deleted file mode 100644
index 0999103..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/stateDirectives.js
+++ /dev/null
@@ -1,285 +0,0 @@
-function parseStateRef(ref, current) {
-  var preparsed = ref.match(/^\s*({[^}]*})\s*$/), parsed;
-  if (preparsed) ref = current + '(' + preparsed[1] + ')';
-  parsed = ref.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/);
-  if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'");
-  return { state: parsed[1], paramExpr: parsed[3] || null };
-}
-
-function stateContext(el) {
-  var stateData = el.parent().inheritedData('$uiView');
-
-  if (stateData && stateData.state && stateData.state.name) {
-    return stateData.state;
-  }
-}
-
-/**
- * @ngdoc directive
- * @name ui.router.state.directive:ui-sref
- *
- * @requires ui.router.state.$state
- * @requires $timeout
- *
- * @restrict A
- *
- * @description
- * A directive that binds a link (`<a>` tag) to a state. If the state has an associated 
- * URL, the directive will automatically generate & update the `href` attribute via 
- * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking 
- * the link will trigger a state transition with optional parameters. 
- *
- * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be 
- * handled natively by the browser.
- *
- * You can also use relative state paths within ui-sref, just like the relative 
- * paths passed to `$state.go()`. You just need to be aware that the path is relative
- * to the state that the link lives in, in other words the state that loaded the 
- * template containing the link.
- *
- * You can specify options to pass to {@link ui.router.state.$state#go $state.go()}
- * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,
- * and `reload`.
- *
- * @example
- * Here's an example of how you'd use ui-sref and how it would compile. If you have the 
- * following template:
- * <pre>
- * <a ui-sref="home">Home</a> | <a ui-sref="about">About</a> | <a ui-sref="{page: 2}">Next page</a>
- * 
- * <ul>
- *     <li ng-repeat="contact in contacts">
- *         <a ui-sref="contacts.detail({ id: contact.id })">{{ contact.name }}</a>
- *     </li>
- * </ul>
- * </pre>
- * 
- * Then the compiled html would be (assuming Html5Mode is off and current state is contacts):
- * <pre>
- * <a href="#/home" ui-sref="home">Home</a> | <a href="#/about" ui-sref="about">About</a> | <a href="#/contacts?page=2" ui-sref="{page: 2}">Next page</a>
- * 
- * <ul>
- *     <li ng-repeat="contact in contacts">
- *         <a href="#/contacts/1" ui-sref="contacts.detail({ id: contact.id })">Joe</a>
- *     </li>
- *     <li ng-repeat="contact in contacts">
- *         <a href="#/contacts/2" ui-sref="contacts.detail({ id: contact.id })">Alice</a>
- *     </li>
- *     <li ng-repeat="contact in contacts">
- *         <a href="#/contacts/3" ui-sref="contacts.detail({ id: contact.id })">Bob</a>
- *     </li>
- * </ul>
- *
- * <a ui-sref="home" ui-sref-opts="{reload: true}">Home</a>
- * </pre>
- *
- * @param {string} ui-sref 'stateName' can be any valid absolute or relative state
- * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()}
- */
-$StateRefDirective.$inject = ['$state', '$timeout'];
-function $StateRefDirective($state, $timeout) {
-  var allowedOptions = ['location', 'inherit', 'reload', 'absolute'];
-
-  return {
-    restrict: 'A',
-    require: ['?^uiSrefActive', '?^uiSrefActiveEq'],
-    link: function(scope, element, attrs, uiSrefActive) {
-      var ref = parseStateRef(attrs.uiSref, $state.current.name);
-      var params = null, url = null, base = stateContext(element) || $state.$current;
-      // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
-      var hrefKind = Object.prototype.toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?
-                 'xlink:href' : 'href';
-      var newHref = null, isAnchor = element.prop("tagName").toUpperCase() === "A";
-      var isForm = element[0].nodeName === "FORM";
-      var attr = isForm ? "action" : hrefKind, nav = true;
-
-      var options = { relative: base, inherit: true };
-      var optionsOverride = scope.$eval(attrs.uiSrefOpts) || {};
-
-      angular.forEach(allowedOptions, function(option) {
-        if (option in optionsOverride) {
-          options[option] = optionsOverride[option];
-        }
-      });
-
-      var update = function(newVal) {
-        if (newVal) params = angular.copy(newVal);
-        if (!nav) return;
-
-        newHref = $state.href(ref.state, params, options);
-
-        var activeDirective = uiSrefActive[1] || uiSrefActive[0];
-        if (activeDirective) {
-          activeDirective.$$addStateInfo(ref.state, params);
-        }
-        if (newHref === null) {
-          nav = false;
-          return false;
-        }
-        attrs.$set(attr, newHref);
-      };
-
-      if (ref.paramExpr) {
-        scope.$watch(ref.paramExpr, function(newVal, oldVal) {
-          if (newVal !== params) update(newVal);
-        }, true);
-        params = angular.copy(scope.$eval(ref.paramExpr));
-      }
-      update();
-
-      if (isForm) return;
-
-      element.bind("click", function(e) {
-        var button = e.which || e.button;
-        if ( !(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target')) ) {
-          // HACK: This is to allow ng-clicks to be processed before the transition is initiated:
-          var transition = $timeout(function() {
-            $state.go(ref.state, params, options);
-          });
-          e.preventDefault();
-
-          // if the state has no URL, ignore one preventDefault from the <a> directive.
-          var ignorePreventDefaultCount = isAnchor && !newHref ? 1: 0;
-          e.preventDefault = function() {
-            if (ignorePreventDefaultCount-- <= 0)
-              $timeout.cancel(transition);
-          };
-        }
-      });
-    }
-  };
-}
-
-/**
- * @ngdoc directive
- * @name ui.router.state.directive:ui-sref-active
- *
- * @requires ui.router.state.$state
- * @requires ui.router.state.$stateParams
- * @requires $interpolate
- *
- * @restrict A
- *
- * @description
- * A directive working alongside ui-sref to add classes to an element when the
- * related ui-sref directive's state is active, and removing them when it is inactive.
- * The primary use-case is to simplify the special appearance of navigation menus
- * relying on `ui-sref`, by having the "active" state's menu button appear different,
- * distinguishing it from the inactive menu items.
- *
- * ui-sref-active can live on the same element as ui-sref or on a parent element. The first
- * ui-sref-active found at the same level or above the ui-sref will be used.
- *
- * Will activate when the ui-sref's target state or any child state is active. If you
- * need to activate only when the ui-sref target state is active and *not* any of
- * it's children, then you will use
- * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq}
- *
- * @example
- * Given the following template:
- * <pre>
- * <ul>
- *   <li ui-sref-active="active" class="item">
- *     <a href ui-sref="app.user({user: 'bilbobaggins'})">@bilbobaggins</a>
- *   </li>
- * </ul>
- * </pre>
- *
- *
- * When the app state is "app.user" (or any children states), and contains the state parameter "user" with value "bilbobaggins",
- * the resulting HTML will appear as (note the 'active' class):
- * <pre>
- * <ul>
- *   <li ui-sref-active="active" class="item active">
- *     <a ui-sref="app.user({user: 'bilbobaggins'})" href="/users/bilbobaggins">@bilbobaggins</a>
- *   </li>
- * </ul>
- * </pre>
- *
- * The class name is interpolated **once** during the directives link time (any further changes to the
- * interpolated value are ignored).
- *
- * Multiple classes may be specified in a space-separated format:
- * <pre>
- * <ul>
- *   <li ui-sref-active='class1 class2 class3'>
- *     <a ui-sref="app.user">link</a>
- *   </li>
- * </ul>
- * </pre>
- */
-
-/**
- * @ngdoc directive
- * @name ui.router.state.directive:ui-sref-active-eq
- *
- * @requires ui.router.state.$state
- * @requires ui.router.state.$stateParams
- * @requires $interpolate
- *
- * @restrict A
- *
- * @description
- * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate
- * when the exact target state used in the `ui-sref` is active; no child states.
- *
- */
-$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];
-function $StateRefActiveDirective($state, $stateParams, $interpolate) {
-  return  {
-    restrict: "A",
-    controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
-      var states = [], activeClass;
-
-      // There probably isn't much point in $observing this
-      // uiSrefActive and uiSrefActiveEq share the same directive object with some
-      // slight difference in logic routing
-      activeClass = $interpolate($attrs.uiSrefActiveEq || $attrs.uiSrefActive || '', false)($scope);
-
-      // Allow uiSref to communicate with uiSrefActive[Equals]
-      this.$$addStateInfo = function (newState, newParams) {
-        var state = $state.get(newState, stateContext($element));
-
-        states.push({
-          state: state || { name: newState },
-          params: newParams
-        });
-
-        update();
-      };
-
-      $scope.$on('$stateChangeSuccess', update);
-
-      // Update route state
-      function update() {
-        if (anyMatch()) {
-          $element.addClass(activeClass);
-        } else {
-          $element.removeClass(activeClass);
-        }
-      }
-
-      function anyMatch() {
-        for (var i = 0; i < states.length; i++) {
-          if (isMatch(states[i].state, states[i].params)) {
-            return true;
-          }
-        }
-        return false;
-      }
-
-      function isMatch(state, params) {
-        if (typeof $attrs.uiSrefActiveEq !== 'undefined') {
-          return $state.is(state.name, params);
-        } else {
-          return $state.includes(state.name, params);
-        }
-      }
-    }]
-  };
-}
-
-angular.module('ui.router.state')
-  .directive('uiSref', $StateRefDirective)
-  .directive('uiSrefActive', $StateRefActiveDirective)
-  .directive('uiSrefActiveEq', $StateRefActiveDirective);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/stateFilters.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/stateFilters.js
deleted file mode 100644
index e0a1175..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/stateFilters.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * @ngdoc filter
- * @name ui.router.state.filter:isState
- *
- * @requires ui.router.state.$state
- *
- * @description
- * Translates to {@link ui.router.state.$state#methods_is $state.is("stateName")}.
- */
-$IsStateFilter.$inject = ['$state'];
-function $IsStateFilter($state) {
-  var isFilter = function (state) {
-    return $state.is(state);
-  };
-  isFilter.$stateful = true;
-  return isFilter;
-}
-
-/**
- * @ngdoc filter
- * @name ui.router.state.filter:includedByState
- *
- * @requires ui.router.state.$state
- *
- * @description
- * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}.
- */
-$IncludedByStateFilter.$inject = ['$state'];
-function $IncludedByStateFilter($state) {
-  var includesFilter = function (state) {
-    return $state.includes(state);
-  };
-  includesFilter.$stateful = true;
-  return  includesFilter;
-}
-
-angular.module('ui.router.state')
-  .filter('isState', $IsStateFilter)
-  .filter('includedByState', $IncludedByStateFilter);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/templateFactory.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/templateFactory.js
deleted file mode 100644
index ca491a9..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/templateFactory.js
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * @ngdoc object
- * @name ui.router.util.$templateFactory
- *
- * @requires $http
- * @requires $templateCache
- * @requires $injector
- *
- * @description
- * Service. Manages loading of templates.
- */
-$TemplateFactory.$inject = ['$http', '$templateCache', '$injector'];
-function $TemplateFactory(  $http,   $templateCache,   $injector) {
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$templateFactory#fromConfig
-   * @methodOf ui.router.util.$templateFactory
-   *
-   * @description
-   * Creates a template from a configuration object. 
-   *
-   * @param {object} config Configuration object for which to load a template. 
-   * The following properties are search in the specified order, and the first one 
-   * that is defined is used to create the template:
-   *
-   * @param {string|object} config.template html string template or function to 
-   * load via {@link ui.router.util.$templateFactory#fromString fromString}.
-   * @param {string|object} config.templateUrl url to load or a function returning 
-   * the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}.
-   * @param {Function} config.templateProvider function to invoke via 
-   * {@link ui.router.util.$templateFactory#fromProvider fromProvider}.
-   * @param {object} params  Parameters to pass to the template function.
-   * @param {object} locals Locals to pass to `invoke` if the template is loaded 
-   * via a `templateProvider`. Defaults to `{ params: params }`.
-   *
-   * @return {string|object}  The template html as a string, or a promise for 
-   * that string,or `null` if no template is configured.
-   */
-  this.fromConfig = function (config, params, locals) {
-    return (
-      isDefined(config.template) ? this.fromString(config.template, params) :
-      isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) :
-      isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) :
-      null
-    );
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$templateFactory#fromString
-   * @methodOf ui.router.util.$templateFactory
-   *
-   * @description
-   * Creates a template from a string or a function returning a string.
-   *
-   * @param {string|object} template html template as a string or function that 
-   * returns an html template as a string.
-   * @param {object} params Parameters to pass to the template function.
-   *
-   * @return {string|object} The template html as a string, or a promise for that 
-   * string.
-   */
-  this.fromString = function (template, params) {
-    return isFunction(template) ? template(params) : template;
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$templateFactory#fromUrl
-   * @methodOf ui.router.util.$templateFactory
-   * 
-   * @description
-   * Loads a template from the a URL via `$http` and `$templateCache`.
-   *
-   * @param {string|Function} url url of the template to load, or a function 
-   * that returns a url.
-   * @param {Object} params Parameters to pass to the url function.
-   * @return {string|Promise.<string>} The template html as a string, or a promise 
-   * for that string.
-   */
-  this.fromUrl = function (url, params) {
-    if (isFunction(url)) url = url(params);
-    if (url == null) return null;
-    else return $http
-        .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }})
-        .then(function(response) { return response.data; });
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$templateFactory#fromProvider
-   * @methodOf ui.router.util.$templateFactory
-   *
-   * @description
-   * Creates a template by invoking an injectable provider function.
-   *
-   * @param {Function} provider Function to invoke via `$injector.invoke`
-   * @param {Object} params Parameters for the template.
-   * @param {Object} locals Locals to pass to `invoke`. Defaults to 
-   * `{ params: params }`.
-   * @return {string|Promise.<string>} The template html as a string, or a promise 
-   * for that string.
-   */
-  this.fromProvider = function (provider, params, locals) {
-    return $injector.invoke(provider, null, locals || { params: params });
-  };
-}
-
-angular.module('ui.router.util').service('$templateFactory', $TemplateFactory);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/urlMatcherFactory.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/urlMatcherFactory.js
deleted file mode 100644
index bf116f0..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/urlMatcherFactory.js
+++ /dev/null
@@ -1,1050 +0,0 @@
-var $$UMFP; // reference to $UrlMatcherFactoryProvider
-
-/**
- * @ngdoc object
- * @name ui.router.util.type:UrlMatcher
- *
- * @description
- * Matches URLs against patterns and extracts named parameters from the path or the search
- * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list
- * of search parameters. Multiple search parameter names are separated by '&'. Search parameters
- * do not influence whether or not a URL is matched, but their values are passed through into
- * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}.
- *
- * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace
- * syntax, which optionally allows a regular expression for the parameter to be specified:
- *
- * * `':'` name - colon placeholder
- * * `'*'` name - catch-all placeholder
- * * `'{' name '}'` - curly placeholder
- * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the
- *   regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.
- *
- * Parameter names may contain only word characters (latin letters, digits, and underscore) and
- * must be unique within the pattern (across both path and search parameters). For colon
- * placeholders or curly placeholders without an explicit regexp, a path parameter matches any
- * number of characters other than '/'. For catch-all placeholders the path parameter matches
- * any number of characters.
- *
- * Examples:
- *
- * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for
- *   trailing slashes, and patterns have to match the entire path, not just a prefix.
- * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or
- *   '/user/bob/details'. The second path segment will be captured as the parameter 'id'.
- * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.
- * * `'/user/{id:[^/]*}'` - Same as the previous example.
- * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id
- *   parameter consists of 1 to 8 hex digits.
- * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the
- *   path into the parameter 'path'.
- * * `'/files/*path'` - ditto.
- * * `'/calendar/{start:date}'` - Matches "/calendar/2014-11-12" (because the pattern defined
- *   in the built-in  `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start
- *
- * @param {string} pattern  The pattern to compile into a matcher.
- * @param {Object} config  A configuration object hash:
- * @param {Object=} parentMatcher Used to concatenate the pattern/config onto
- *   an existing UrlMatcher
- *
- * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`.
- * * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`.
- *
- * @property {string} prefix  A static prefix of this pattern. The matcher guarantees that any
- *   URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns
- *   non-null) will start with this prefix.
- *
- * @property {string} source  The pattern that was passed into the constructor
- *
- * @property {string} sourcePath  The path portion of the source property
- *
- * @property {string} sourceSearch  The search portion of the source property
- *
- * @property {string} regex  The constructed regex that will be used to match against the url when
- *   it is time to determine which url will match.
- *
- * @returns {Object}  New `UrlMatcher` object
- */
-function UrlMatcher(pattern, config, parentMatcher) {
-  config = extend({ params: {} }, isObject(config) ? config : {});
-
-  // Find all placeholders and create a compiled pattern, using either classic or curly syntax:
-  //   '*' name
-  //   ':' name
-  //   '{' name '}'
-  //   '{' name ':' regexp '}'
-  // The regular expression is somewhat complicated due to the need to allow curly braces
-  // inside the regular expression. The placeholder regexp breaks down as follows:
-  //    ([:*])([\w\[\]]+)              - classic placeholder ($1 / $2) (search version has - for snake-case)
-  //    \{([\w\[\]]+)(?:\:( ... ))?\}  - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case
-  //    (?: ... | ... | ... )+         - the regexp consists of any number of atoms, an atom being either
-  //    [^{}\\]+                       - anything other than curly braces or backslash
-  //    \\.                            - a backslash escape
-  //    \{(?:[^{}\\]+|\\.)*\}          - a matched set of curly braces containing other atoms
-  var placeholder       = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
-      searchPlaceholder = /([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
-      compiled = '^', last = 0, m,
-      segments = this.segments = [],
-      parentParams = parentMatcher ? parentMatcher.params : {},
-      params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(),
-      paramNames = [];
-
-  function addParameter(id, type, config, location) {
-    paramNames.push(id);
-    if (parentParams[id]) return parentParams[id];
-    if (!/^\w+(-+\w+)*(?:\[\])?$/.test(id)) throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'");
-    if (params[id]) throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'");
-    params[id] = new $$UMFP.Param(id, type, config, location);
-    return params[id];
-  }
-
-  function quoteRegExp(string, pattern, squash, optional) {
-    var surroundPattern = ['',''], result = string.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&");
-    if (!pattern) return result;
-    switch(squash) {
-      case false: surroundPattern = ['(', ')' + (optional ? "?" : "")]; break;
-      case true:  surroundPattern = ['?(', ')?']; break;
-      default:    surroundPattern = ['(' + squash + "|", ')?']; break;
-    }
-    return result + surroundPattern[0] + pattern + surroundPattern[1];
-  }
-
-  this.source = pattern;
-
-  // Split into static segments separated by path parameter placeholders.
-  // The number of segments is always 1 more than the number of parameters.
-  function matchDetails(m, isSearch) {
-    var id, regexp, segment, type, cfg, arrayMode;
-    id          = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null
-    cfg         = config.params[id];
-    segment     = pattern.substring(last, m.index);
-    regexp      = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null);
-    type        = $$UMFP.type(regexp || "string") || inherit($$UMFP.type("string"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) });
-    return {
-      id: id, regexp: regexp, segment: segment, type: type, cfg: cfg
-    };
-  }
-
-  var p, param, segment;
-  while ((m = placeholder.exec(pattern))) {
-    p = matchDetails(m, false);
-    if (p.segment.indexOf('?') >= 0) break; // we're into the search part
-
-    param = addParameter(p.id, p.type, p.cfg, "path");
-    compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash, param.isOptional);
-    segments.push(p.segment);
-    last = placeholder.lastIndex;
-  }
-  segment = pattern.substring(last);
-
-  // Find any search parameter names and remove them from the last segment
-  var i = segment.indexOf('?');
-
-  if (i >= 0) {
-    var search = this.sourceSearch = segment.substring(i);
-    segment = segment.substring(0, i);
-    this.sourcePath = pattern.substring(0, last + i);
-
-    if (search.length > 0) {
-      last = 0;
-      while ((m = searchPlaceholder.exec(search))) {
-        p = matchDetails(m, true);
-        param = addParameter(p.id, p.type, p.cfg, "search");
-        last = placeholder.lastIndex;
-        // check if ?&
-      }
-    }
-  } else {
-    this.sourcePath = pattern;
-    this.sourceSearch = '';
-  }
-
-  compiled += quoteRegExp(segment) + (config.strict === false ? '\/?' : '') + '$';
-  segments.push(segment);
-
-  this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined);
-  this.prefix = segments[0];
-  this.$$paramNames = paramNames;
-}
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:UrlMatcher#concat
- * @methodOf ui.router.util.type:UrlMatcher
- *
- * @description
- * Returns a new matcher for a pattern constructed by appending the path part and adding the
- * search parameters of the specified pattern to this pattern. The current pattern is not
- * modified. This can be understood as creating a pattern for URLs that are relative to (or
- * suffixes of) the current pattern.
- *
- * @example
- * The following two matchers are equivalent:
- * <pre>
- * new UrlMatcher('/user/{id}?q').concat('/details?date');
- * new UrlMatcher('/user/{id}/details?q&date');
- * </pre>
- *
- * @param {string} pattern  The pattern to append.
- * @param {Object} config  An object hash of the configuration for the matcher.
- * @returns {UrlMatcher}  A matcher for the concatenated pattern.
- */
-UrlMatcher.prototype.concat = function (pattern, config) {
-  // Because order of search parameters is irrelevant, we can add our own search
-  // parameters to the end of the new pattern. Parse the new pattern by itself
-  // and then join the bits together, but it's much easier to do this on a string level.
-  var defaultConfig = {
-    caseInsensitive: $$UMFP.caseInsensitive(),
-    strict: $$UMFP.strictMode(),
-    squash: $$UMFP.defaultSquashPolicy()
-  };
-  return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this);
-};
-
-UrlMatcher.prototype.toString = function () {
-  return this.source;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:UrlMatcher#exec
- * @methodOf ui.router.util.type:UrlMatcher
- *
- * @description
- * Tests the specified path against this matcher, and returns an object containing the captured
- * parameter values, or null if the path does not match. The returned object contains the values
- * of any search parameters that are mentioned in the pattern, but their value may be null if
- * they are not present in `searchParams`. This means that search parameters are always treated
- * as optional.
- *
- * @example
- * <pre>
- * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
- *   x: '1', q: 'hello'
- * });
- * // returns { id: 'bob', q: 'hello', r: null }
- * </pre>
- *
- * @param {string} path  The URL path to match, e.g. `$location.path()`.
- * @param {Object} searchParams  URL search parameters, e.g. `$location.search()`.
- * @returns {Object}  The captured parameter values.
- */
-UrlMatcher.prototype.exec = function (path, searchParams) {
-  var m = this.regexp.exec(path);
-  if (!m) return null;
-  searchParams = searchParams || {};
-
-  var paramNames = this.parameters(), nTotal = paramNames.length,
-    nPath = this.segments.length - 1,
-    values = {}, i, j, cfg, paramName;
-
-  if (nPath !== m.length - 1) throw new Error("Unbalanced capture group in route '" + this.source + "'");
-
-  function decodePathArray(string) {
-    function reverseString(str) { return str.split("").reverse().join(""); }
-    function unquoteDashes(str) { return str.replace(/\\-/g, "-"); }
-
-    var split = reverseString(string).split(/-(?!\\)/);
-    var allReversed = map(split, reverseString);
-    return map(allReversed, unquoteDashes).reverse();
-  }
-
-  for (i = 0; i < nPath; i++) {
-    paramName = paramNames[i];
-    var param = this.params[paramName];
-    var paramVal = m[i+1];
-    // if the param value matches a pre-replace pair, replace the value before decoding.
-    for (j = 0; j < param.replace; j++) {
-      if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;
-    }
-    if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);
-    values[paramName] = param.value(paramVal);
-  }
-  for (/**/; i < nTotal; i++) {
-    paramName = paramNames[i];
-    values[paramName] = this.params[paramName].value(searchParams[paramName]);
-  }
-
-  return values;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:UrlMatcher#parameters
- * @methodOf ui.router.util.type:UrlMatcher
- *
- * @description
- * Returns the names of all path and search parameters of this pattern in an unspecified order.
- *
- * @returns {Array.<string>}  An array of parameter names. Must be treated as read-only. If the
- *    pattern has no parameters, an empty array is returned.
- */
-UrlMatcher.prototype.parameters = function (param) {
-  if (!isDefined(param)) return this.$$paramNames;
-  return this.params[param] || null;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:UrlMatcher#validate
- * @methodOf ui.router.util.type:UrlMatcher
- *
- * @description
- * Checks an object hash of parameters to validate their correctness according to the parameter
- * types of this `UrlMatcher`.
- *
- * @param {Object} params The object hash of parameters to validate.
- * @returns {boolean} Returns `true` if `params` validates, otherwise `false`.
- */
-UrlMatcher.prototype.validates = function (params) {
-  return this.params.$$validates(params);
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:UrlMatcher#format
- * @methodOf ui.router.util.type:UrlMatcher
- *
- * @description
- * Creates a URL that matches this pattern by substituting the specified values
- * for the path and search parameters. Null values for path parameters are
- * treated as empty strings.
- *
- * @example
- * <pre>
- * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
- * // returns '/user/bob?q=yes'
- * </pre>
- *
- * @param {Object} values  the values to substitute for the parameters in this pattern.
- * @returns {string}  the formatted URL (path and optionally search part).
- */
-UrlMatcher.prototype.format = function (values) {
-  values = values || {};
-  var segments = this.segments, params = this.parameters(), paramset = this.params;
-  if (!this.validates(values)) return null;
-
-  var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0];
-
-  function encodeDashes(str) { // Replace dashes with encoded "\-"
-    return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); });
-  }
-
-  for (i = 0; i < nTotal; i++) {
-    var isPathParam = i < nPath;
-    var name = params[i], param = paramset[name], value = param.value(values[name]);
-    var isDefaultValue = param.isOptional && param.type.equals(param.value(), value);
-    var squash = isDefaultValue ? param.squash : false;
-    var encoded = param.type.encode(value);
-
-    if (isPathParam) {
-      var nextSegment = segments[i + 1];
-      if (squash === false) {
-        if (encoded != null) {
-          if (isArray(encoded)) {
-            result += map(encoded, encodeDashes).join("-");
-          } else {
-            result += encodeURIComponent(encoded);
-          }
-        }
-        result += nextSegment;
-      } else if (squash === true) {
-        var capture = result.match(/\/$/) ? /\/?(.*)/ : /(.*)/;
-        result += nextSegment.match(capture)[1];
-      } else if (isString(squash)) {
-        result += squash + nextSegment;
-      }
-    } else {
-      if (encoded == null || (isDefaultValue && squash !== false)) continue;
-      if (!isArray(encoded)) encoded = [ encoded ];
-      encoded = map(encoded, encodeURIComponent).join('&' + name + '=');
-      result += (search ? '&' : '?') + (name + '=' + encoded);
-      search = true;
-    }
-  }
-
-  return result;
-};
-
-/**
- * @ngdoc object
- * @name ui.router.util.type:Type
- *
- * @description
- * Implements an interface to define custom parameter types that can be decoded from and encoded to
- * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`}
- * objects when matching or formatting URLs, or comparing or validating parameter values.
- *
- * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more
- * information on registering custom types.
- *
- * @param {Object} config  A configuration object which contains the custom type definition.  The object's
- *        properties will override the default methods and/or pattern in `Type`'s public interface.
- * @example
- * <pre>
- * {
- *   decode: function(val) { return parseInt(val, 10); },
- *   encode: function(val) { return val && val.toString(); },
- *   equals: function(a, b) { return this.is(a) && a === b; },
- *   is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },
- *   pattern: /\d+/
- * }
- * </pre>
- *
- * @property {RegExp} pattern The regular expression pattern used to match values of this type when
- *           coming from a substring of a URL.
- *
- * @returns {Object}  Returns a new `Type` object.
- */
-function Type(config) {
-  extend(this, config);
-}
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:Type#is
- * @methodOf ui.router.util.type:Type
- *
- * @description
- * Detects whether a value is of a particular type. Accepts a native (decoded) value
- * and determines whether it matches the current `Type` object.
- *
- * @param {*} val  The value to check.
- * @param {string} key  Optional. If the type check is happening in the context of a specific
- *        {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the
- *        parameter in which `val` is stored. Can be used for meta-programming of `Type` objects.
- * @returns {Boolean}  Returns `true` if the value matches the type, otherwise `false`.
- */
-Type.prototype.is = function(val, key) {
-  return true;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:Type#encode
- * @methodOf ui.router.util.type:Type
- *
- * @description
- * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the
- * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it
- * only needs to be a representation of `val` that has been coerced to a string.
- *
- * @param {*} val  The value to encode.
- * @param {string} key  The name of the parameter in which `val` is stored. Can be used for
- *        meta-programming of `Type` objects.
- * @returns {string}  Returns a string representation of `val` that can be encoded in a URL.
- */
-Type.prototype.encode = function(val, key) {
-  return val;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:Type#decode
- * @methodOf ui.router.util.type:Type
- *
- * @description
- * Converts a parameter value (from URL string or transition param) to a custom/native value.
- *
- * @param {string} val  The URL parameter value to decode.
- * @param {string} key  The name of the parameter in which `val` is stored. Can be used for
- *        meta-programming of `Type` objects.
- * @returns {*}  Returns a custom representation of the URL parameter value.
- */
-Type.prototype.decode = function(val, key) {
-  return val;
-};
-
-/**
- * @ngdoc function
- * @name ui.router.util.type:Type#equals
- * @methodOf ui.router.util.type:Type
- *
- * @description
- * Determines whether two decoded values are equivalent.
- *
- * @param {*} a  A value to compare against.
- * @param {*} b  A value to compare against.
- * @returns {Boolean}  Returns `true` if the values are equivalent/equal, otherwise `false`.
- */
-Type.prototype.equals = function(a, b) {
-  return a == b;
-};
-
-Type.prototype.$subPattern = function() {
-  var sub = this.pattern.toString();
-  return sub.substr(1, sub.length - 2);
-};
-
-Type.prototype.pattern = /.*/;
-
-Type.prototype.toString = function() { return "{Type:" + this.name + "}"; };
-
-/** Given an encoded string, or a decoded object, returns a decoded object */
-Type.prototype.$normalize = function(val) {
-  return this.is(val) ? val : this.decode(val);
-};
-
-/*
- * Wraps an existing custom Type as an array of Type, depending on 'mode'.
- * e.g.:
- * - urlmatcher pattern "/path?{queryParam[]:int}"
- * - url: "/path?queryParam=1&queryParam=2
- * - $stateParams.queryParam will be [1, 2]
- * if `mode` is "auto", then
- * - url: "/path?queryParam=1 will create $stateParams.queryParam: 1
- * - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]
- */
-Type.prototype.$asArray = function(mode, isSearch) {
-  if (!mode) return this;
-  if (mode === "auto" && !isSearch) throw new Error("'auto' array mode is for query parameters only");
-
-  function ArrayType(type, mode) {
-    function bindTo(type, callbackName) {
-      return function() {
-        return type[callbackName].apply(type, arguments);
-      };
-    }
-
-    // Wrap non-array value as array
-    function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }
-    // Unwrap array value for "auto" mode. Return undefined for empty array.
-    function arrayUnwrap(val) {
-      switch(val.length) {
-        case 0: return undefined;
-        case 1: return mode === "auto" ? val[0] : val;
-        default: return val;
-      }
-    }
-    function falsey(val) { return !val; }
-
-    // Wraps type (.is/.encode/.decode) functions to operate on each value of an array
-    function arrayHandler(callback, allTruthyMode) {
-      return function handleArray(val) {
-        val = arrayWrap(val);
-        var result = map(val, callback);
-        if (allTruthyMode === true)
-          return filter(result, falsey).length === 0;
-        return arrayUnwrap(result);
-      };
-    }
-
-    // Wraps type (.equals) functions to operate on each value of an array
-    function arrayEqualsHandler(callback) {
-      return function handleArray(val1, val2) {
-        var left = arrayWrap(val1), right = arrayWrap(val2);
-        if (left.length !== right.length) return false;
-        for (var i = 0; i < left.length; i++) {
-          if (!callback(left[i], right[i])) return false;
-        }
-        return true;
-      };
-    }
-
-    this.encode = arrayHandler(bindTo(type, 'encode'));
-    this.decode = arrayHandler(bindTo(type, 'decode'));
-    this.is     = arrayHandler(bindTo(type, 'is'), true);
-    this.equals = arrayEqualsHandler(bindTo(type, 'equals'));
-    this.pattern = type.pattern;
-    this.$normalize = arrayHandler(bindTo(type, '$normalize'));
-    this.name = type.name;
-    this.$arrayMode = mode;
-  }
-
-  return new ArrayType(this, mode);
-};
-
-
-
-/**
- * @ngdoc object
- * @name ui.router.util.$urlMatcherFactory
- *
- * @description
- * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory
- * is also available to providers under the name `$urlMatcherFactoryProvider`.
- */
-function $UrlMatcherFactory() {
-  $$UMFP = this;
-
-  var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false;
-
-  function valToString(val) { return val != null ? val.toString().replace(/\//g, "%2F") : val; }
-  function valFromString(val) { return val != null ? val.toString().replace(/%2F/g, "/") : val; }
-
-  var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {
-    string: {
-      encode: valToString,
-      decode: valFromString,
-      // TODO: in 1.0, make string .is() return false if value is undefined/null by default.
-      // In 0.2.x, string params are optional by default for backwards compat
-      is: function(val) { return val == null || !isDefined(val) || typeof val === "string"; },
-      pattern: /[^/]*/
-    },
-    int: {
-      encode: valToString,
-      decode: function(val) { return parseInt(val, 10); },
-      is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; },
-      pattern: /\d+/
-    },
-    bool: {
-      encode: function(val) { return val ? 1 : 0; },
-      decode: function(val) { return parseInt(val, 10) !== 0; },
-      is: function(val) { return val === true || val === false; },
-      pattern: /0|1/
-    },
-    date: {
-      encode: function (val) {
-        if (!this.is(val))
-          return undefined;
-        return [ val.getFullYear(),
-          ('0' + (val.getMonth() + 1)).slice(-2),
-          ('0' + val.getDate()).slice(-2)
-        ].join("-");
-      },
-      decode: function (val) {
-        if (this.is(val)) return val;
-        var match = this.capture.exec(val);
-        return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;
-      },
-      is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); },
-      equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); },
-      pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,
-      capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/
-    },
-    json: {
-      encode: angular.toJson,
-      decode: angular.fromJson,
-      is: angular.isObject,
-      equals: angular.equals,
-      pattern: /[^/]*/
-    },
-    any: { // does not encode/decode
-      encode: angular.identity,
-      decode: angular.identity,
-      equals: angular.equals,
-      pattern: /.*/
-    }
-  };
-
-  function getDefaultConfig() {
-    return {
-      strict: isStrictMode,
-      caseInsensitive: isCaseInsensitive
-    };
-  }
-
-  function isInjectable(value) {
-    return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1])));
-  }
-
-  /**
-   * [Internal] Get the default value of a parameter, which may be an injectable function.
-   */
-  $UrlMatcherFactory.$$getDefaultValue = function(config) {
-    if (!isInjectable(config.value)) return config.value;
-    if (!injector) throw new Error("Injectable functions cannot be called at configuration time");
-    return injector.invoke(config.value);
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#caseInsensitive
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Defines whether URL matching should be case sensitive (the default behavior), or not.
-   *
-   * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`;
-   * @returns {boolean} the current value of caseInsensitive
-   */
-  this.caseInsensitive = function(value) {
-    if (isDefined(value))
-      isCaseInsensitive = value;
-    return isCaseInsensitive;
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#strictMode
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Defines whether URLs should match trailing slashes, or not (the default behavior).
-   *
-   * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`.
-   * @returns {boolean} the current value of strictMode
-   */
-  this.strictMode = function(value) {
-    if (isDefined(value))
-      isStrictMode = value;
-    return isStrictMode;
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Sets the default behavior when generating or matching URLs with default parameter values.
-   *
-   * @param {string} value A string that defines the default parameter URL squashing behavior.
-   *    `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL
-   *    `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the
-   *             parameter is surrounded by slashes, squash (remove) one slash from the URL
-   *    any other string, e.g. "~": When generating an href with a default parameter value, squash (remove)
-   *             the parameter value from the URL and replace it with this string.
-   */
-  this.defaultSquashPolicy = function(value) {
-    if (!isDefined(value)) return defaultSquashPolicy;
-    if (value !== true && value !== false && !isString(value))
-      throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string");
-    defaultSquashPolicy = value;
-    return value;
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#compile
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern.
-   *
-   * @param {string} pattern  The URL pattern.
-   * @param {Object} config  The config object hash.
-   * @returns {UrlMatcher}  The UrlMatcher.
-   */
-  this.compile = function (pattern, config) {
-    return new UrlMatcher(pattern, extend(getDefaultConfig(), config));
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#isMatcher
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Returns true if the specified object is a `UrlMatcher`, or false otherwise.
-   *
-   * @param {Object} object  The object to perform the type check against.
-   * @returns {Boolean}  Returns `true` if the object matches the `UrlMatcher` interface, by
-   *          implementing all the same methods.
-   */
-  this.isMatcher = function (o) {
-    if (!isObject(o)) return false;
-    var result = true;
-
-    forEach(UrlMatcher.prototype, function(val, name) {
-      if (isFunction(val)) {
-        result = result && (isDefined(o[name]) && isFunction(o[name]));
-      }
-    });
-    return result;
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.util.$urlMatcherFactory#type
-   * @methodOf ui.router.util.$urlMatcherFactory
-   *
-   * @description
-   * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to
-   * generate URLs with typed parameters.
-   *
-   * @param {string} name  The type name.
-   * @param {Object|Function} definition   The type definition. See
-   *        {@link ui.router.util.type:Type `Type`} for information on the values accepted.
-   * @param {Object|Function} definitionFn (optional) A function that is injected before the app
-   *        runtime starts.  The result of this function is merged into the existing `definition`.
-   *        See {@link ui.router.util.type:Type `Type`} for information on the values accepted.
-   *
-   * @returns {Object}  Returns `$urlMatcherFactoryProvider`.
-   *
-   * @example
-   * This is a simple example of a custom type that encodes and decodes items from an
-   * array, using the array index as the URL-encoded value:
-   *
-   * <pre>
-   * var list = ['John', 'Paul', 'George', 'Ringo'];
-   *
-   * $urlMatcherFactoryProvider.type('listItem', {
-   *   encode: function(item) {
-   *     // Represent the list item in the URL using its corresponding index
-   *     return list.indexOf(item);
-   *   },
-   *   decode: function(item) {
-   *     // Look up the list item by index
-   *     return list[parseInt(item, 10)];
-   *   },
-   *   is: function(item) {
-   *     // Ensure the item is valid by checking to see that it appears
-   *     // in the list
-   *     return list.indexOf(item) > -1;
-   *   }
-   * });
-   *
-   * $stateProvider.state('list', {
-   *   url: "/list/{item:listItem}",
-   *   controller: function($scope, $stateParams) {
-   *     console.log($stateParams.item);
-   *   }
-   * });
-   *
-   * // ...
-   *
-   * // Changes URL to '/list/3', logs "Ringo" to the console
-   * $state.go('list', { item: "Ringo" });
-   * </pre>
-   *
-   * This is a more complex example of a type that relies on dependency injection to
-   * interact with services, and uses the parameter name from the URL to infer how to
-   * handle encoding and decoding parameter values:
-   *
-   * <pre>
-   * // Defines a custom type that gets a value from a service,
-   * // where each service gets different types of values from
-   * // a backend API:
-   * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {
-   *
-   *   // Matches up services to URL parameter names
-   *   var services = {
-   *     user: Users,
-   *     post: Posts
-   *   };
-   *
-   *   return {
-   *     encode: function(object) {
-   *       // Represent the object in the URL using its unique ID
-   *       return object.id;
-   *     },
-   *     decode: function(value, key) {
-   *       // Look up the object by ID, using the parameter
-   *       // name (key) to call the correct service
-   *       return services[key].findById(value);
-   *     },
-   *     is: function(object, key) {
-   *       // Check that object is a valid dbObject
-   *       return angular.isObject(object) && object.id && services[key];
-   *     }
-   *     equals: function(a, b) {
-   *       // Check the equality of decoded objects by comparing
-   *       // their unique IDs
-   *       return a.id === b.id;
-   *     }
-   *   };
-   * });
-   *
-   * // In a config() block, you can then attach URLs with
-   * // type-annotated parameters:
-   * $stateProvider.state('users', {
-   *   url: "/users",
-   *   // ...
-   * }).state('users.item', {
-   *   url: "/{user:dbObject}",
-   *   controller: function($scope, $stateParams) {
-   *     // $stateParams.user will now be an object returned from
-   *     // the Users service
-   *   },
-   *   // ...
-   * });
-   * </pre>
-   */
-  this.type = function (name, definition, definitionFn) {
-    if (!isDefined(definition)) return $types[name];
-    if ($types.hasOwnProperty(name)) throw new Error("A type named '" + name + "' has already been defined.");
-
-    $types[name] = new Type(extend({ name: name }, definition));
-    if (definitionFn) {
-      typeQueue.push({ name: name, def: definitionFn });
-      if (!enqueue) flushTypeQueue();
-    }
-    return this;
-  };
-
-  // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s
-  function flushTypeQueue() {
-    while(typeQueue.length) {
-      var type = typeQueue.shift();
-      if (type.pattern) throw new Error("You cannot override a type's .pattern at runtime.");
-      angular.extend($types[type.name], injector.invoke(type.def));
-    }
-  }
-
-  // Register default types. Store them in the prototype of $types.
-  forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); });
-  $types = inherit($types, {});
-
-  /* No need to document $get, since it returns this */
-  this.$get = ['$injector', function ($injector) {
-    injector = $injector;
-    enqueue = false;
-    flushTypeQueue();
-
-    forEach(defaultTypes, function(type, name) {
-      if (!$types[name]) $types[name] = new Type(type);
-    });
-    return this;
-  }];
-
-  this.Param = function Param(id, type, config, location) {
-    var self = this;
-    config = unwrapShorthand(config);
-    type = getType(config, type, location);
-    var arrayMode = getArrayMode();
-    type = arrayMode ? type.$asArray(arrayMode, location === "search") : type;
-    if (type.name === "string" && !arrayMode && location === "path" && config.value === undefined)
-      config.value = ""; // for 0.2.x; in 0.3.0+ do not automatically default to ""
-    var isOptional = config.value !== undefined;
-    var squash = getSquashPolicy(config, isOptional);
-    var replace = getReplace(config, arrayMode, isOptional, squash);
-
-    function unwrapShorthand(config) {
-      var keys = isObject(config) ? objectKeys(config) : [];
-      var isShorthand = indexOf(keys, "value") === -1 && indexOf(keys, "type") === -1 &&
-                        indexOf(keys, "squash") === -1 && indexOf(keys, "array") === -1;
-      if (isShorthand) config = { value: config };
-      config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; };
-      return config;
-    }
-
-    function getType(config, urlType, location) {
-      if (config.type && urlType) throw new Error("Param '"+id+"' has two type configurations.");
-      if (urlType) return urlType;
-      if (!config.type) return (location === "config" ? $types.any : $types.string);
-      return config.type instanceof Type ? config.type : new Type(config.type);
-    }
-
-    // array config: param name (param[]) overrides default settings.  explicit config overrides param name.
-    function getArrayMode() {
-      var arrayDefaults = { array: (location === "search" ? "auto" : false) };
-      var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {};
-      return extend(arrayDefaults, arrayParamNomenclature, config).array;
-    }
-
-    /**
-     * returns false, true, or the squash value to indicate the "default parameter url squash policy".
-     */
-    function getSquashPolicy(config, isOptional) {
-      var squash = config.squash;
-      if (!isOptional || squash === false) return false;
-      if (!isDefined(squash) || squash == null) return defaultSquashPolicy;
-      if (squash === true || isString(squash)) return squash;
-      throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string");
-    }
-
-    function getReplace(config, arrayMode, isOptional, squash) {
-      var replace, configuredKeys, defaultPolicy = [
-        { from: "",   to: (isOptional || arrayMode ? undefined : "") },
-        { from: null, to: (isOptional || arrayMode ? undefined : "") }
-      ];
-      replace = isArray(config.replace) ? config.replace : [];
-      if (isString(squash))
-        replace.push({ from: squash, to: undefined });
-      configuredKeys = map(replace, function(item) { return item.from; } );
-      return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace);
-    }
-
-    /**
-     * [Internal] Get the default value of a parameter, which may be an injectable function.
-     */
-    function $$getDefaultValue() {
-      if (!injector) throw new Error("Injectable functions cannot be called at configuration time");
-      var defaultValue = injector.invoke(config.$$fn);
-      if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))
-        throw new Error("Default value (" + defaultValue + ") for parameter '" + self.id + "' is not an instance of Type (" + self.type.name + ")");
-      return defaultValue;
-    }
-
-    /**
-     * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the
-     * default value, which may be the result of an injectable function.
-     */
-    function $value(value) {
-      function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }
-      function $replace(value) {
-        var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });
-        return replacement.length ? replacement[0] : value;
-      }
-      value = $replace(value);
-      return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);
-    }
-
-    function toString() { return "{Param:" + id + " " + type + " squash: '" + squash + "' optional: " + isOptional + "}"; }
-
-    extend(this, {
-      id: id,
-      type: type,
-      location: location,
-      array: arrayMode,
-      squash: squash,
-      replace: replace,
-      isOptional: isOptional,
-      value: $value,
-      dynamic: undefined,
-      config: config,
-      toString: toString
-    });
-  };
-
-  function ParamSet(params) {
-    extend(this, params || {});
-  }
-
-  ParamSet.prototype = {
-    $$new: function() {
-      return inherit(this, extend(new ParamSet(), { $$parent: this}));
-    },
-    $$keys: function () {
-      var keys = [], chain = [], parent = this,
-        ignore = objectKeys(ParamSet.prototype);
-      while (parent) { chain.push(parent); parent = parent.$$parent; }
-      chain.reverse();
-      forEach(chain, function(paramset) {
-        forEach(objectKeys(paramset), function(key) {
-            if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key);
-        });
-      });
-      return keys;
-    },
-    $$values: function(paramValues) {
-      var values = {}, self = this;
-      forEach(self.$$keys(), function(key) {
-        values[key] = self[key].value(paramValues && paramValues[key]);
-      });
-      return values;
-    },
-    $$equals: function(paramValues1, paramValues2) {
-      var equal = true, self = this;
-      forEach(self.$$keys(), function(key) {
-        var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key];
-        if (!self[key].type.equals(left, right)) equal = false;
-      });
-      return equal;
-    },
-    $$validates: function $$validate(paramValues) {
-      var keys = this.$$keys(), i, param, rawVal, normalized, encoded;
-      for (i = 0; i < keys.length; i++) {
-        param = this[keys[i]];
-        rawVal = paramValues[keys[i]];
-        if ((rawVal === undefined || rawVal === null) && param.isOptional)
-          break; // There was no parameter value, but the param is optional
-        normalized = param.type.$normalize(rawVal);
-        if (!param.type.is(normalized))
-          return false; // The value was not of the correct Type, and could not be decoded to the correct Type
-        encoded = param.type.encode(normalized);
-        if (angular.isString(encoded) && !param.type.pattern.exec(encoded))
-          return false; // The value was of the correct type, but when encoded, did not match the Type's regexp
-      }
-      return true;
-    },
-    $$parent: undefined
-  };
-
-  this.ParamSet = ParamSet;
-}
-
-// Register as a provider so it's available to other providers
-angular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory);
-angular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/urlRouter.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/urlRouter.js
deleted file mode 100644
index 33c1709..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/urlRouter.js
+++ /dev/null
@@ -1,427 +0,0 @@
-/**
- * @ngdoc object
- * @name ui.router.router.$urlRouterProvider
- *
- * @requires ui.router.util.$urlMatcherFactoryProvider
- * @requires $locationProvider
- *
- * @description
- * `$urlRouterProvider` has the responsibility of watching `$location`. 
- * When `$location` changes it runs through a list of rules one by one until a 
- * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify 
- * a url in a state configuration. All urls are compiled into a UrlMatcher object.
- *
- * There are several methods on `$urlRouterProvider` that make it useful to use directly
- * in your module config.
- */
-$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider'];
-function $UrlRouterProvider(   $locationProvider,   $urlMatcherFactory) {
-  var rules = [], otherwise = null, interceptDeferred = false, listener;
-
-  // Returns a string that is a prefix of all strings matching the RegExp
-  function regExpPrefix(re) {
-    var prefix = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(re.source);
-    return (prefix != null) ? prefix[1].replace(/\\(.)/g, "$1") : '';
-  }
-
-  // Interpolates matched values into a String.replace()-style pattern
-  function interpolate(pattern, match) {
-    return pattern.replace(/\$(\$|\d{1,2})/, function (m, what) {
-      return match[what === '$' ? 0 : Number(what)];
-    });
-  }
-
-  /**
-   * @ngdoc function
-   * @name ui.router.router.$urlRouterProvider#rule
-   * @methodOf ui.router.router.$urlRouterProvider
-   *
-   * @description
-   * Defines rules that are used by `$urlRouterProvider` to find matches for
-   * specific URLs.
-   *
-   * @example
-   * <pre>
-   * var app = angular.module('app', ['ui.router.router']);
-   *
-   * app.config(function ($urlRouterProvider) {
-   *   // Here's an example of how you might allow case insensitive urls
-   *   $urlRouterProvider.rule(function ($injector, $location) {
-   *     var path = $location.path(),
-   *         normalized = path.toLowerCase();
-   *
-   *     if (path !== normalized) {
-   *       return normalized;
-   *     }
-   *   });
-   * });
-   * </pre>
-   *
-   * @param {object} rule Handler function that takes `$injector` and `$location`
-   * services as arguments. You can use them to return a valid path as a string.
-   *
-   * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
-   */
-  this.rule = function (rule) {
-    if (!isFunction(rule)) throw new Error("'rule' must be a function");
-    rules.push(rule);
-    return this;
-  };
-
-  /**
-   * @ngdoc object
-   * @name ui.router.router.$urlRouterProvider#otherwise
-   * @methodOf ui.router.router.$urlRouterProvider
-   *
-   * @description
-   * Defines a path that is used when an invalid route is requested.
-   *
-   * @example
-   * <pre>
-   * var app = angular.module('app', ['ui.router.router']);
-   *
-   * app.config(function ($urlRouterProvider) {
-   *   // if the path doesn't match any of the urls you configured
-   *   // otherwise will take care of routing the user to the
-   *   // specified url
-   *   $urlRouterProvider.otherwise('/index');
-   *
-   *   // Example of using function rule as param
-   *   $urlRouterProvider.otherwise(function ($injector, $location) {
-   *     return '/a/valid/url';
-   *   });
-   * });
-   * </pre>
-   *
-   * @param {string|object} rule The url path you want to redirect to or a function 
-   * rule that returns the url path. The function version is passed two params: 
-   * `$injector` and `$location` services, and must return a url string.
-   *
-   * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
-   */
-  this.otherwise = function (rule) {
-    if (isString(rule)) {
-      var redirect = rule;
-      rule = function () { return redirect; };
-    }
-    else if (!isFunction(rule)) throw new Error("'rule' must be a function");
-    otherwise = rule;
-    return this;
-  };
-
-
-  function handleIfMatch($injector, handler, match) {
-    if (!match) return false;
-    var result = $injector.invoke(handler, handler, { $match: match });
-    return isDefined(result) ? result : true;
-  }
-
-  /**
-   * @ngdoc function
-   * @name ui.router.router.$urlRouterProvider#when
-   * @methodOf ui.router.router.$urlRouterProvider
-   *
-   * @description
-   * Registers a handler for a given url matching. if handle is a string, it is
-   * treated as a redirect, and is interpolated according to the syntax of match
-   * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
-   *
-   * If the handler is a function, it is injectable. It gets invoked if `$location`
-   * matches. You have the option of inject the match object as `$match`.
-   *
-   * The handler can return
-   *
-   * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`
-   *   will continue trying to find another one that matches.
-   * - **string** which is treated as a redirect and passed to `$location.url()`
-   * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.
-   *
-   * @example
-   * <pre>
-   * var app = angular.module('app', ['ui.router.router']);
-   *
-   * app.config(function ($urlRouterProvider) {
-   *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {
-   *     if ($state.$current.navigable !== state ||
-   *         !equalForKeys($match, $stateParams) {
-   *      $state.transitionTo(state, $match, false);
-   *     }
-   *   });
-   * });
-   * </pre>
-   *
-   * @param {string|object} what The incoming path that you want to redirect.
-   * @param {string|object} handler The path you want to redirect your user to.
-   */
-  this.when = function (what, handler) {
-    var redirect, handlerIsString = isString(handler);
-    if (isString(what)) what = $urlMatcherFactory.compile(what);
-
-    if (!handlerIsString && !isFunction(handler) && !isArray(handler))
-      throw new Error("invalid 'handler' in when()");
-
-    var strategies = {
-      matcher: function (what, handler) {
-        if (handlerIsString) {
-          redirect = $urlMatcherFactory.compile(handler);
-          handler = ['$match', function ($match) { return redirect.format($match); }];
-        }
-        return extend(function ($injector, $location) {
-          return handleIfMatch($injector, handler, what.exec($location.path(), $location.search()));
-        }, {
-          prefix: isString(what.prefix) ? what.prefix : ''
-        });
-      },
-      regex: function (what, handler) {
-        if (what.global || what.sticky) throw new Error("when() RegExp must not be global or sticky");
-
-        if (handlerIsString) {
-          redirect = handler;
-          handler = ['$match', function ($match) { return interpolate(redirect, $match); }];
-        }
-        return extend(function ($injector, $location) {
-          return handleIfMatch($injector, handler, what.exec($location.path()));
-        }, {
-          prefix: regExpPrefix(what)
-        });
-      }
-    };
-
-    var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp };
-
-    for (var n in check) {
-      if (check[n]) return this.rule(strategies[n](what, handler));
-    }
-
-    throw new Error("invalid 'what' in when()");
-  };
-
-  /**
-   * @ngdoc function
-   * @name ui.router.router.$urlRouterProvider#deferIntercept
-   * @methodOf ui.router.router.$urlRouterProvider
-   *
-   * @description
-   * Disables (or enables) deferring location change interception.
-   *
-   * If you wish to customize the behavior of syncing the URL (for example, if you wish to
-   * defer a transition but maintain the current URL), call this method at configuration time.
-   * Then, at run time, call `$urlRouter.listen()` after you have configured your own
-   * `$locationChangeSuccess` event handler.
-   *
-   * @example
-   * <pre>
-   * var app = angular.module('app', ['ui.router.router']);
-   *
-   * app.config(function ($urlRouterProvider) {
-   *
-   *   // Prevent $urlRouter from automatically intercepting URL changes;
-   *   // this allows you to configure custom behavior in between
-   *   // location changes and route synchronization:
-   *   $urlRouterProvider.deferIntercept();
-   *
-   * }).run(function ($rootScope, $urlRouter, UserService) {
-   *
-   *   $rootScope.$on('$locationChangeSuccess', function(e) {
-   *     // UserService is an example service for managing user state
-   *     if (UserService.isLoggedIn()) return;
-   *
-   *     // Prevent $urlRouter's default handler from firing
-   *     e.preventDefault();
-   *
-   *     UserService.handleLogin().then(function() {
-   *       // Once the user has logged in, sync the current URL
-   *       // to the router:
-   *       $urlRouter.sync();
-   *     });
-   *   });
-   *
-   *   // Configures $urlRouter's listener *after* your custom listener
-   *   $urlRouter.listen();
-   * });
-   * </pre>
-   *
-   * @param {boolean} defer Indicates whether to defer location change interception. Passing
-            no parameter is equivalent to `true`.
-   */
-  this.deferIntercept = function (defer) {
-    if (defer === undefined) defer = true;
-    interceptDeferred = defer;
-  };
-
-  /**
-   * @ngdoc object
-   * @name ui.router.router.$urlRouter
-   *
-   * @requires $location
-   * @requires $rootScope
-   * @requires $injector
-   * @requires $browser
-   *
-   * @description
-   *
-   */
-  this.$get = $get;
-  $get.$inject = ['$location', '$rootScope', '$injector', '$browser'];
-  function $get(   $location,   $rootScope,   $injector,   $browser) {
-
-    var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl;
-
-    function appendBasePath(url, isHtml5, absolute) {
-      if (baseHref === '/') return url;
-      if (isHtml5) return baseHref.slice(0, -1) + url;
-      if (absolute) return baseHref.slice(1) + url;
-      return url;
-    }
-
-    // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree
-    function update(evt) {
-      if (evt && evt.defaultPrevented) return;
-      var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;
-      lastPushedUrl = undefined;
-      // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573
-      //if (ignoreUpdate) return true;
-
-      function check(rule) {
-        var handled = rule($injector, $location);
-
-        if (!handled) return false;
-        if (isString(handled)) $location.replace().url(handled);
-        return true;
-      }
-      var n = rules.length, i;
-
-      for (i = 0; i < n; i++) {
-        if (check(rules[i])) return;
-      }
-      // always check otherwise last to allow dynamic updates to the set of rules
-      if (otherwise) check(otherwise);
-    }
-
-    function listen() {
-      listener = listener || $rootScope.$on('$locationChangeSuccess', update);
-      return listener;
-    }
-
-    if (!interceptDeferred) listen();
-
-    return {
-      /**
-       * @ngdoc function
-       * @name ui.router.router.$urlRouter#sync
-       * @methodOf ui.router.router.$urlRouter
-       *
-       * @description
-       * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`.
-       * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,
-       * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed
-       * with the transition by calling `$urlRouter.sync()`.
-       *
-       * @example
-       * <pre>
-       * angular.module('app', ['ui.router'])
-       *   .run(function($rootScope, $urlRouter) {
-       *     $rootScope.$on('$locationChangeSuccess', function(evt) {
-       *       // Halt state change from even starting
-       *       evt.preventDefault();
-       *       // Perform custom logic
-       *       var meetsRequirement = ...
-       *       // Continue with the update and state transition if logic allows
-       *       if (meetsRequirement) $urlRouter.sync();
-       *     });
-       * });
-       * </pre>
-       */
-      sync: function() {
-        update();
-      },
-
-      listen: function() {
-        return listen();
-      },
-
-      update: function(read) {
-        if (read) {
-          location = $location.url();
-          return;
-        }
-        if ($location.url() === location) return;
-
-        $location.url(location);
-        $location.replace();
-      },
-
-      push: function(urlMatcher, params, options) {
-         var url = urlMatcher.format(params || {});
-
-        // Handle the special hash param, if needed
-        if (url !== null && params && params['#']) {
-            url += '#' + params['#'];
-        }
-
-        $location.url(url);
-        lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined;
-        if (options && options.replace) $location.replace();
-      },
-
-      /**
-       * @ngdoc function
-       * @name ui.router.router.$urlRouter#href
-       * @methodOf ui.router.router.$urlRouter
-       *
-       * @description
-       * A URL generation method that returns the compiled URL for a given
-       * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters.
-       *
-       * @example
-       * <pre>
-       * $bob = $urlRouter.href(new UrlMatcher("/about/:person"), {
-       *   person: "bob"
-       * });
-       * // $bob == "/about/bob";
-       * </pre>
-       *
-       * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate.
-       * @param {object=} params An object of parameter values to fill the matcher's required parameters.
-       * @param {object=} options Options object. The options are:
-       *
-       * - **`absolute`** - {boolean=false},  If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
-       *
-       * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
-       */
-      href: function(urlMatcher, params, options) {
-        if (!urlMatcher.validates(params)) return null;
-
-        var isHtml5 = $locationProvider.html5Mode();
-        if (angular.isObject(isHtml5)) {
-          isHtml5 = isHtml5.enabled;
-        }
-        
-        var url = urlMatcher.format(params);
-        options = options || {};
-
-        if (!isHtml5 && url !== null) {
-          url = "#" + $locationProvider.hashPrefix() + url;
-        }
-
-        // Handle special hash param, if needed
-        if (url !== null && params && params['#']) {
-          url += '#' + params['#'];
-        }
-
-        url = appendBasePath(url, isHtml5, options.absolute);
-
-        if (!options.absolute || !url) {
-          return url;
-        }
-
-        var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();
-        port = (port === 80 || port === 443 ? '' : ':' + port);
-
-        return [$location.protocol(), '://', $location.host(), port, slash, url].join('');
-      }
-    };
-  }
-}
-
-angular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/view.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/view.js
deleted file mode 100644
index f19a3c5..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/view.js
+++ /dev/null
@@ -1,71 +0,0 @@
-
-$ViewProvider.$inject = [];
-function $ViewProvider() {
-
-  this.$get = $get;
-  /**
-   * @ngdoc object
-   * @name ui.router.state.$view
-   *
-   * @requires ui.router.util.$templateFactory
-   * @requires $rootScope
-   *
-   * @description
-   *
-   */
-  $get.$inject = ['$rootScope', '$templateFactory'];
-  function $get(   $rootScope,   $templateFactory) {
-    return {
-      // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })
-      /**
-       * @ngdoc function
-       * @name ui.router.state.$view#load
-       * @methodOf ui.router.state.$view
-       *
-       * @description
-       *
-       * @param {string} name name
-       * @param {object} options option object.
-       */
-      load: function load(name, options) {
-        var result, defaults = {
-          template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}
-        };
-        options = extend(defaults, options);
-
-        if (options.view) {
-          result = $templateFactory.fromConfig(options.view, options.params, options.locals);
-        }
-        if (result && options.notify) {
-        /**
-         * @ngdoc event
-         * @name ui.router.state.$state#$viewContentLoading
-         * @eventOf ui.router.state.$view
-         * @eventType broadcast on root scope
-         * @description
-         *
-         * Fired once the view **begins loading**, *before* the DOM is rendered.
-         *
-         * @param {Object} event Event object.
-         * @param {Object} viewConfig The view config properties (template, controller, etc).
-         *
-         * @example
-         *
-         * <pre>
-         * $scope.$on('$viewContentLoading',
-         * function(event, viewConfig){
-         *     // Access to all the view config properties.
-         *     // and one special property 'targetView'
-         *     // viewConfig.targetView
-         * });
-         * </pre>
-         */
-          $rootScope.$broadcast('$viewContentLoading', options);
-        }
-        return result;
-      }
-    };
-  }
-}
-
-angular.module('ui.router.state').provider('$view', $ViewProvider);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/viewDirective.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/viewDirective.js
deleted file mode 100644
index b702207..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/viewDirective.js
+++ /dev/null
@@ -1,303 +0,0 @@
-/**
- * @ngdoc directive
- * @name ui.router.state.directive:ui-view
- *
- * @requires ui.router.state.$state
- * @requires $compile
- * @requires $controller
- * @requires $injector
- * @requires ui.router.state.$uiViewScroll
- * @requires $document
- *
- * @restrict ECA
- *
- * @description
- * The ui-view directive tells $state where to place your templates.
- *
- * @param {string=} name A view name. The name should be unique amongst the other views in the
- * same state. You can have views of the same name that live in different states.
- *
- * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window
- * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll
- * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you
- * scroll ui-view elements into view when they are populated during a state activation.
- *
- * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)
- * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*
- *
- * @param {string=} onload Expression to evaluate whenever the view updates.
- * 
- * @example
- * A view can be unnamed or named. 
- * <pre>
- * <!-- Unnamed -->
- * <div ui-view></div> 
- * 
- * <!-- Named -->
- * <div ui-view="viewName"></div>
- * </pre>
- *
- * You can only have one unnamed view within any template (or root html). If you are only using a 
- * single view and it is unnamed then you can populate it like so:
- * <pre>
- * <div ui-view></div> 
- * $stateProvider.state("home", {
- *   template: "<h1>HELLO!</h1>"
- * })
- * </pre>
- * 
- * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`}
- * config property, by name, in this case an empty name:
- * <pre>
- * $stateProvider.state("home", {
- *   views: {
- *     "": {
- *       template: "<h1>HELLO!</h1>"
- *     }
- *   }    
- * })
- * </pre>
- * 
- * But typically you'll only use the views property if you name your view or have more than one view 
- * in the same template. There's not really a compelling reason to name a view if its the only one, 
- * but you could if you wanted, like so:
- * <pre>
- * <div ui-view="main"></div>
- * </pre> 
- * <pre>
- * $stateProvider.state("home", {
- *   views: {
- *     "main": {
- *       template: "<h1>HELLO!</h1>"
- *     }
- *   }    
- * })
- * </pre>
- * 
- * Really though, you'll use views to set up multiple views:
- * <pre>
- * <div ui-view></div>
- * <div ui-view="chart"></div> 
- * <div ui-view="data"></div> 
- * </pre>
- * 
- * <pre>
- * $stateProvider.state("home", {
- *   views: {
- *     "": {
- *       template: "<h1>HELLO!</h1>"
- *     },
- *     "chart": {
- *       template: "<chart_thing/>"
- *     },
- *     "data": {
- *       template: "<data_thing/>"
- *     }
- *   }    
- * })
- * </pre>
- *
- * Examples for `autoscroll`:
- *
- * <pre>
- * <!-- If autoscroll present with no expression,
- *      then scroll ui-view into view -->
- * <ui-view autoscroll/>
- *
- * <!-- If autoscroll present with valid expression,
- *      then scroll ui-view into view if expression evaluates to true -->
- * <ui-view autoscroll='true'/>
- * <ui-view autoscroll='false'/>
- * <ui-view autoscroll='scopeVariable'/>
- * </pre>
- */
-$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate'];
-function $ViewDirective(   $state,   $injector,   $uiViewScroll,   $interpolate) {
-
-  function getService() {
-    return ($injector.has) ? function(service) {
-      return $injector.has(service) ? $injector.get(service) : null;
-    } : function(service) {
-      try {
-        return $injector.get(service);
-      } catch (e) {
-        return null;
-      }
-    };
-  }
-
-  var service = getService(),
-      $animator = service('$animator'),
-      $animate = service('$animate');
-
-  // Returns a set of DOM manipulation functions based on which Angular version
-  // it should use
-  function getRenderer(attrs, scope) {
-    var statics = function() {
-      return {
-        enter: function (element, target, cb) { target.after(element); cb(); },
-        leave: function (element, cb) { element.remove(); cb(); }
-      };
-    };
-
-    if ($animate) {
-      return {
-        enter: function(element, target, cb) {
-          var promise = $animate.enter(element, null, target, cb);
-          if (promise && promise.then) promise.then(cb);
-        },
-        leave: function(element, cb) {
-          var promise = $animate.leave(element, cb);
-          if (promise && promise.then) promise.then(cb);
-        }
-      };
-    }
-
-    if ($animator) {
-      var animate = $animator && $animator(scope, attrs);
-
-      return {
-        enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },
-        leave: function(element, cb) { animate.leave(element); cb(); }
-      };
-    }
-
-    return statics();
-  }
-
-  var directive = {
-    restrict: 'ECA',
-    terminal: true,
-    priority: 400,
-    transclude: 'element',
-    compile: function (tElement, tAttrs, $transclude) {
-      return function (scope, $element, attrs) {
-        var previousEl, currentEl, currentScope, latestLocals,
-            onloadExp     = attrs.onload || '',
-            autoScrollExp = attrs.autoscroll,
-            renderer      = getRenderer(attrs, scope);
-
-        scope.$on('$stateChangeSuccess', function() {
-          updateView(false);
-        });
-        scope.$on('$viewContentLoading', function() {
-          updateView(false);
-        });
-
-        updateView(true);
-
-        function cleanupLastView() {
-          if (previousEl) {
-            previousEl.remove();
-            previousEl = null;
-          }
-
-          if (currentScope) {
-            currentScope.$destroy();
-            currentScope = null;
-          }
-
-          if (currentEl) {
-            renderer.leave(currentEl, function() {
-              previousEl = null;
-            });
-
-            previousEl = currentEl;
-            currentEl = null;
-          }
-        }
-
-        function updateView(firstTime) {
-          var newScope,
-              name            = getUiViewName(scope, attrs, $element, $interpolate),
-              previousLocals  = name && $state.$current && $state.$current.locals[name];
-
-          if (!firstTime && previousLocals === latestLocals) return; // nothing to do
-          newScope = scope.$new();
-          latestLocals = $state.$current.locals[name];
-
-          var clone = $transclude(newScope, function(clone) {
-            renderer.enter(clone, $element, function onUiViewEnter() {
-              if(currentScope) {
-                currentScope.$emit('$viewContentAnimationEnded');
-              }
-
-              if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {
-                $uiViewScroll(clone);
-              }
-            });
-            cleanupLastView();
-          });
-
-          currentEl = clone;
-          currentScope = newScope;
-          /**
-           * @ngdoc event
-           * @name ui.router.state.directive:ui-view#$viewContentLoaded
-           * @eventOf ui.router.state.directive:ui-view
-           * @eventType emits on ui-view directive scope
-           * @description           *
-           * Fired once the view is **loaded**, *after* the DOM is rendered.
-           *
-           * @param {Object} event Event object.
-           */
-          currentScope.$emit('$viewContentLoaded');
-          currentScope.$eval(onloadExp);
-        }
-      };
-    }
-  };
-
-  return directive;
-}
-
-$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate'];
-function $ViewDirectiveFill (  $compile,   $controller,   $state,   $interpolate) {
-  return {
-    restrict: 'ECA',
-    priority: -400,
-    compile: function (tElement) {
-      var initial = tElement.html();
-      return function (scope, $element, attrs) {
-        var current = $state.$current,
-            name = getUiViewName(scope, attrs, $element, $interpolate),
-            locals  = current && current.locals[name];
-
-        if (! locals) {
-          return;
-        }
-
-        $element.data('$uiView', { name: name, state: locals.$$state });
-        $element.html(locals.$template ? locals.$template : initial);
-
-        var link = $compile($element.contents());
-
-        if (locals.$$controller) {
-          locals.$scope = scope;
-          locals.$element = $element;
-          var controller = $controller(locals.$$controller, locals);
-          if (locals.$$controllerAs) {
-            scope[locals.$$controllerAs] = controller;
-          }
-          $element.data('$ngControllerController', controller);
-          $element.children().data('$ngControllerController', controller);
-        }
-
-        link(scope);
-      };
-    }
-  };
-}
-
-/**
- * Shared ui-view code for both directives:
- * Given scope, element, and its attributes, return the view's name
- */
-function getUiViewName(scope, attrs, element, $interpolate) {
-  var name = $interpolate(attrs.uiView || attrs.name || '')(scope);
-  var inherited = element.inheritedData('$uiView');
-  return name.indexOf('@') >= 0 ?  name :  (name + '@' + (inherited ? inherited.state.name : ''));
-}
-
-angular.module('ui.router.state').directive('uiView', $ViewDirective);
-angular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/viewScroll.js b/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/viewScroll.js
deleted file mode 100644
index 81114e2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular-ui-router/src/viewScroll.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * @ngdoc object
- * @name ui.router.state.$uiViewScrollProvider
- *
- * @description
- * Provider that returns the {@link ui.router.state.$uiViewScroll} service function.
- */
-function $ViewScrollProvider() {
-
-  var useAnchorScroll = false;
-
-  /**
-   * @ngdoc function
-   * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll
-   * @methodOf ui.router.state.$uiViewScrollProvider
-   *
-   * @description
-   * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for
-   * scrolling based on the url anchor.
-   */
-  this.useAnchorScroll = function () {
-    useAnchorScroll = true;
-  };
-
-  /**
-   * @ngdoc object
-   * @name ui.router.state.$uiViewScroll
-   *
-   * @requires $anchorScroll
-   * @requires $timeout
-   *
-   * @description
-   * When called with a jqLite element, it scrolls the element into view (after a
-   * `$timeout` so the DOM has time to refresh).
-   *
-   * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,
-   * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}.
-   */
-  this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {
-    if (useAnchorScroll) {
-      return $anchorScroll;
-    }
-
-    return function ($element) {
-      return $timeout(function () {
-        $element[0].scrollIntoView();
-      }, 0, false);
-    };
-  }];
-}
-
-angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular/.bower.json
deleted file mode 100644
index e15139e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular/.bower.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-  "name": "angular",
-  "version": "1.4.7",
-  "main": "./angular.js",
-  "ignore": [],
-  "dependencies": {},
-  "homepage": "https://github.com/angular/bower-angular",
-  "_release": "1.4.7",
-  "_resolution": {
-    "type": "version",
-    "tag": "v1.4.7",
-    "commit": "6bdc6b4855b416bf029105324080ca7d6aca0e9f"
-  },
-  "_source": "https://github.com/angular/bower-angular.git",
-  "_target": "1.4.7",
-  "_originalSource": "angular"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular/README.md b/views/ngXosViews/serviceGrid/src/vendor/angular/README.md
deleted file mode 100644
index d1bc0ed..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-# packaged angular
-
-This repo is for distribution on `npm` and `bower`. The source for this module is in the
-[main AngularJS repo](https://github.com/angular/angular.js).
-Please file issues and pull requests against that repo.
-
-## Install
-
-You can install this package either with `npm` or with `bower`.
-
-### npm
-
-```shell
-npm install angular
-```
-
-Then add a `<script>` to your `index.html`:
-
-```html
-<script src="/node_modules/angular/angular.js"></script>
-```
-
-Or `require('angular')` from your code.
-
-### bower
-
-```shell
-bower install angular
-```
-
-Then add a `<script>` to your `index.html`:
-
-```html
-<script src="/bower_components/angular/angular.js"></script>
-```
-
-## Documentation
-
-Documentation is available on the
-[AngularJS docs site](http://docs.angularjs.org/).
-
-## License
-
-The MIT License
-
-Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular/angular-csp.css b/views/ngXosViews/serviceGrid/src/vendor/angular/angular-csp.css
deleted file mode 100644
index f3cd926..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular/angular-csp.css
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Include this file in your html if you are using the CSP mode. */
-
-@charset "UTF-8";
-
-[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],
-.ng-cloak, .x-ng-cloak,
-.ng-hide:not(.ng-hide-animate) {
-  display: none !important;
-}
-
-ng\:form {
-  display: block;
-}
-
-.ng-animate-shim {
-  visibility:hidden;
-}
-
-.ng-anchor {
-  position:absolute;
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular/angular.js b/views/ngXosViews/serviceGrid/src/vendor/angular/angular.js
deleted file mode 100644
index 34a93c1..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular/angular.js
+++ /dev/null
@@ -1,28904 +0,0 @@
-/**
- * @license AngularJS v1.4.7
- * (c) 2010-2015 Google, Inc. http://angularjs.org
- * License: MIT
- */
-(function(window, document, undefined) {'use strict';
-
-/**
- * @description
- *
- * This object provides a utility for producing rich Error messages within
- * Angular. It can be called as follows:
- *
- * var exampleMinErr = minErr('example');
- * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);
- *
- * The above creates an instance of minErr in the example namespace. The
- * resulting error will have a namespaced error code of example.one.  The
- * resulting error will replace {0} with the value of foo, and {1} with the
- * value of bar. The object is not restricted in the number of arguments it can
- * take.
- *
- * If fewer arguments are specified than necessary for interpolation, the extra
- * interpolation markers will be preserved in the final string.
- *
- * Since data will be parsed statically during a build step, some restrictions
- * are applied with respect to how minErr instances are created and called.
- * Instances should have names of the form namespaceMinErr for a minErr created
- * using minErr('namespace') . Error codes, namespaces and template strings
- * should all be static strings, not variables or general expressions.
- *
- * @param {string} module The namespace to use for the new minErr instance.
- * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning
- *   error from returned function, for cases when a particular type of error is useful.
- * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance
- */
-
-function minErr(module, ErrorConstructor) {
-  ErrorConstructor = ErrorConstructor || Error;
-  return function() {
-    var SKIP_INDEXES = 2;
-
-    var templateArgs = arguments,
-      code = templateArgs[0],
-      message = '[' + (module ? module + ':' : '') + code + '] ',
-      template = templateArgs[1],
-      paramPrefix, i;
-
-    message += template.replace(/\{\d+\}/g, function(match) {
-      var index = +match.slice(1, -1),
-        shiftedIndex = index + SKIP_INDEXES;
-
-      if (shiftedIndex < templateArgs.length) {
-        return toDebugString(templateArgs[shiftedIndex]);
-      }
-
-      return match;
-    });
-
-    message += '\nhttp://errors.angularjs.org/1.4.7/' +
-      (module ? module + '/' : '') + code;
-
-    for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
-      message += paramPrefix + 'p' + (i - SKIP_INDEXES) + '=' +
-        encodeURIComponent(toDebugString(templateArgs[i]));
-    }
-
-    return new ErrorConstructor(message);
-  };
-}
-
-/* We need to tell jshint what variables are being exported */
-/* global angular: true,
-  msie: true,
-  jqLite: true,
-  jQuery: true,
-  slice: true,
-  splice: true,
-  push: true,
-  toString: true,
-  ngMinErr: true,
-  angularModule: true,
-  uid: true,
-  REGEX_STRING_REGEXP: true,
-  VALIDITY_STATE_PROPERTY: true,
-
-  lowercase: true,
-  uppercase: true,
-  manualLowercase: true,
-  manualUppercase: true,
-  nodeName_: true,
-  isArrayLike: true,
-  forEach: true,
-  forEachSorted: true,
-  reverseParams: true,
-  nextUid: true,
-  setHashKey: true,
-  extend: true,
-  toInt: true,
-  inherit: true,
-  merge: true,
-  noop: true,
-  identity: true,
-  valueFn: true,
-  isUndefined: true,
-  isDefined: true,
-  isObject: true,
-  isBlankObject: true,
-  isString: true,
-  isNumber: true,
-  isDate: true,
-  isArray: true,
-  isFunction: true,
-  isRegExp: true,
-  isWindow: true,
-  isScope: true,
-  isFile: true,
-  isFormData: true,
-  isBlob: true,
-  isBoolean: true,
-  isPromiseLike: true,
-  trim: true,
-  escapeForRegexp: true,
-  isElement: true,
-  makeMap: true,
-  includes: true,
-  arrayRemove: true,
-  copy: true,
-  shallowCopy: true,
-  equals: true,
-  csp: true,
-  jq: true,
-  concat: true,
-  sliceArgs: true,
-  bind: true,
-  toJsonReplacer: true,
-  toJson: true,
-  fromJson: true,
-  convertTimezoneToLocal: true,
-  timezoneToOffset: true,
-  startingTag: true,
-  tryDecodeURIComponent: true,
-  parseKeyValue: true,
-  toKeyValue: true,
-  encodeUriSegment: true,
-  encodeUriQuery: true,
-  angularInit: true,
-  bootstrap: true,
-  getTestability: true,
-  snake_case: true,
-  bindJQuery: true,
-  assertArg: true,
-  assertArgFn: true,
-  assertNotHasOwnProperty: true,
-  getter: true,
-  getBlockNodes: true,
-  hasOwnProperty: true,
-  createMap: true,
-
-  NODE_TYPE_ELEMENT: true,
-  NODE_TYPE_ATTRIBUTE: true,
-  NODE_TYPE_TEXT: true,
-  NODE_TYPE_COMMENT: true,
-  NODE_TYPE_DOCUMENT: true,
-  NODE_TYPE_DOCUMENT_FRAGMENT: true,
-*/
-
-////////////////////////////////////
-
-/**
- * @ngdoc module
- * @name ng
- * @module ng
- * @description
- *
- * # ng (core module)
- * The ng module is loaded by default when an AngularJS application is started. The module itself
- * contains the essential components for an AngularJS application to function. The table below
- * lists a high level breakdown of each of the services/factories, filters, directives and testing
- * components available within this core module.
- *
- * <div doc-module-components="ng"></div>
- */
-
-var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/;
-
-// The name of a form control's ValidityState property.
-// This is used so that it's possible for internal tests to create mock ValidityStates.
-var VALIDITY_STATE_PROPERTY = 'validity';
-
-/**
- * @ngdoc function
- * @name angular.lowercase
- * @module ng
- * @kind function
- *
- * @description Converts the specified string to lowercase.
- * @param {string} string String to be converted to lowercase.
- * @returns {string} Lowercased string.
- */
-var lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-
-/**
- * @ngdoc function
- * @name angular.uppercase
- * @module ng
- * @kind function
- *
- * @description Converts the specified string to uppercase.
- * @param {string} string String to be converted to uppercase.
- * @returns {string} Uppercased string.
- */
-var uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};
-
-
-var manualLowercase = function(s) {
-  /* jshint bitwise: false */
-  return isString(s)
-      ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})
-      : s;
-};
-var manualUppercase = function(s) {
-  /* jshint bitwise: false */
-  return isString(s)
-      ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})
-      : s;
-};
-
-
-// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish
-// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods
-// with correct but slower alternatives.
-if ('i' !== 'I'.toLowerCase()) {
-  lowercase = manualLowercase;
-  uppercase = manualUppercase;
-}
-
-
-var
-    msie,             // holds major version number for IE, or NaN if UA is not IE.
-    jqLite,           // delay binding since jQuery could be loaded after us.
-    jQuery,           // delay binding
-    slice             = [].slice,
-    splice            = [].splice,
-    push              = [].push,
-    toString          = Object.prototype.toString,
-    getPrototypeOf    = Object.getPrototypeOf,
-    ngMinErr          = minErr('ng'),
-
-    /** @name angular */
-    angular           = window.angular || (window.angular = {}),
-    angularModule,
-    uid               = 0;
-
-/**
- * documentMode is an IE-only property
- * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx
- */
-msie = document.documentMode;
-
-
-/**
- * @private
- * @param {*} obj
- * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,
- *                   String ...)
- */
-function isArrayLike(obj) {
-  if (obj == null || isWindow(obj)) {
-    return false;
-  }
-
-  // Support: iOS 8.2 (not reproducible in simulator)
-  // "length" in obj used to prevent JIT error (gh-11508)
-  var length = "length" in Object(obj) && obj.length;
-
-  if (obj.nodeType === NODE_TYPE_ELEMENT && length) {
-    return true;
-  }
-
-  return isString(obj) || isArray(obj) || length === 0 ||
-         typeof length === 'number' && length > 0 && (length - 1) in obj;
-}
-
-/**
- * @ngdoc function
- * @name angular.forEach
- * @module ng
- * @kind function
- *
- * @description
- * Invokes the `iterator` function once for each item in `obj` collection, which can be either an
- * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`
- * is the value of an object property or an array element, `key` is the object property key or
- * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.
- *
- * It is worth noting that `.forEach` does not iterate over inherited properties because it filters
- * using the `hasOwnProperty` method.
- *
- * Unlike ES262's
- * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),
- * Providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just
- * return the value provided.
- *
-   ```js
-     var values = {name: 'misko', gender: 'male'};
-     var log = [];
-     angular.forEach(values, function(value, key) {
-       this.push(key + ': ' + value);
-     }, log);
-     expect(log).toEqual(['name: misko', 'gender: male']);
-   ```
- *
- * @param {Object|Array} obj Object to iterate over.
- * @param {Function} iterator Iterator function.
- * @param {Object=} context Object to become context (`this`) for the iterator function.
- * @returns {Object|Array} Reference to `obj`.
- */
-
-function forEach(obj, iterator, context) {
-  var key, length;
-  if (obj) {
-    if (isFunction(obj)) {
-      for (key in obj) {
-        // Need to check if hasOwnProperty exists,
-        // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function
-        if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {
-          iterator.call(context, obj[key], key, obj);
-        }
-      }
-    } else if (isArray(obj) || isArrayLike(obj)) {
-      var isPrimitive = typeof obj !== 'object';
-      for (key = 0, length = obj.length; key < length; key++) {
-        if (isPrimitive || key in obj) {
-          iterator.call(context, obj[key], key, obj);
-        }
-      }
-    } else if (obj.forEach && obj.forEach !== forEach) {
-        obj.forEach(iterator, context, obj);
-    } else if (isBlankObject(obj)) {
-      // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty
-      for (key in obj) {
-        iterator.call(context, obj[key], key, obj);
-      }
-    } else if (typeof obj.hasOwnProperty === 'function') {
-      // Slow path for objects inheriting Object.prototype, hasOwnProperty check needed
-      for (key in obj) {
-        if (obj.hasOwnProperty(key)) {
-          iterator.call(context, obj[key], key, obj);
-        }
-      }
-    } else {
-      // Slow path for objects which do not have a method `hasOwnProperty`
-      for (key in obj) {
-        if (hasOwnProperty.call(obj, key)) {
-          iterator.call(context, obj[key], key, obj);
-        }
-      }
-    }
-  }
-  return obj;
-}
-
-function forEachSorted(obj, iterator, context) {
-  var keys = Object.keys(obj).sort();
-  for (var i = 0; i < keys.length; i++) {
-    iterator.call(context, obj[keys[i]], keys[i]);
-  }
-  return keys;
-}
-
-
-/**
- * when using forEach the params are value, key, but it is often useful to have key, value.
- * @param {function(string, *)} iteratorFn
- * @returns {function(*, string)}
- */
-function reverseParams(iteratorFn) {
-  return function(value, key) { iteratorFn(key, value); };
-}
-
-/**
- * A consistent way of creating unique IDs in angular.
- *
- * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before
- * we hit number precision issues in JavaScript.
- *
- * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M
- *
- * @returns {number} an unique alpha-numeric string
- */
-function nextUid() {
-  return ++uid;
-}
-
-
-/**
- * Set or clear the hashkey for an object.
- * @param obj object
- * @param h the hashkey (!truthy to delete the hashkey)
- */
-function setHashKey(obj, h) {
-  if (h) {
-    obj.$$hashKey = h;
-  } else {
-    delete obj.$$hashKey;
-  }
-}
-
-
-function baseExtend(dst, objs, deep) {
-  var h = dst.$$hashKey;
-
-  for (var i = 0, ii = objs.length; i < ii; ++i) {
-    var obj = objs[i];
-    if (!isObject(obj) && !isFunction(obj)) continue;
-    var keys = Object.keys(obj);
-    for (var j = 0, jj = keys.length; j < jj; j++) {
-      var key = keys[j];
-      var src = obj[key];
-
-      if (deep && isObject(src)) {
-        if (isDate(src)) {
-          dst[key] = new Date(src.valueOf());
-        } else if (isRegExp(src)) {
-          dst[key] = new RegExp(src);
-        } else {
-          if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};
-          baseExtend(dst[key], [src], true);
-        }
-      } else {
-        dst[key] = src;
-      }
-    }
-  }
-
-  setHashKey(dst, h);
-  return dst;
-}
-
-/**
- * @ngdoc function
- * @name angular.extend
- * @module ng
- * @kind function
- *
- * @description
- * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)
- * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so
- * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.
- *
- * **Note:** Keep in mind that `angular.extend` does not support recursive merge (deep copy). Use
- * {@link angular.merge} for this.
- *
- * @param {Object} dst Destination object.
- * @param {...Object} src Source object(s).
- * @returns {Object} Reference to `dst`.
- */
-function extend(dst) {
-  return baseExtend(dst, slice.call(arguments, 1), false);
-}
-
-
-/**
-* @ngdoc function
-* @name angular.merge
-* @module ng
-* @kind function
-*
-* @description
-* Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s)
-* to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so
-* by passing an empty object as the target: `var object = angular.merge({}, object1, object2)`.
-*
-* Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source
-* objects, performing a deep copy.
-*
-* @param {Object} dst Destination object.
-* @param {...Object} src Source object(s).
-* @returns {Object} Reference to `dst`.
-*/
-function merge(dst) {
-  return baseExtend(dst, slice.call(arguments, 1), true);
-}
-
-
-
-function toInt(str) {
-  return parseInt(str, 10);
-}
-
-
-function inherit(parent, extra) {
-  return extend(Object.create(parent), extra);
-}
-
-/**
- * @ngdoc function
- * @name angular.noop
- * @module ng
- * @kind function
- *
- * @description
- * A function that performs no operations. This function can be useful when writing code in the
- * functional style.
-   ```js
-     function foo(callback) {
-       var result = calculateResult();
-       (callback || angular.noop)(result);
-     }
-   ```
- */
-function noop() {}
-noop.$inject = [];
-
-
-/**
- * @ngdoc function
- * @name angular.identity
- * @module ng
- * @kind function
- *
- * @description
- * A function that returns its first argument. This function is useful when writing code in the
- * functional style.
- *
-   ```js
-     function transformer(transformationFn, value) {
-       return (transformationFn || angular.identity)(value);
-     };
-   ```
-  * @param {*} value to be returned.
-  * @returns {*} the value passed in.
- */
-function identity($) {return $;}
-identity.$inject = [];
-
-
-function valueFn(value) {return function() {return value;};}
-
-function hasCustomToString(obj) {
-  return isFunction(obj.toString) && obj.toString !== Object.prototype.toString;
-}
-
-
-/**
- * @ngdoc function
- * @name angular.isUndefined
- * @module ng
- * @kind function
- *
- * @description
- * Determines if a reference is undefined.
- *
- * @param {*} value Reference to check.
- * @returns {boolean} True if `value` is undefined.
- */
-function isUndefined(value) {return typeof value === 'undefined';}
-
-
-/**
- * @ngdoc function
- * @name angular.isDefined
- * @module ng
- * @kind function
- *
- * @description
- * Determines if a reference is defined.
- *
- * @param {*} value Reference to check.
- * @returns {boolean} True if `value` is defined.
- */
-function isDefined(value) {return typeof value !== 'undefined';}
-
-
-/**
- * @ngdoc function
- * @name angular.isObject
- * @module ng
- * @kind function
- *
- * @description
- * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not
- * considered to be objects. Note that JavaScript arrays are objects.
- *
- * @param {*} value Reference to check.
- * @returns {boolean} True if `value` is an `Object` but not `null`.
- */
-function isObject(value) {
-  // http://jsperf.com/isobject4
-  return value !== null && typeof value === 'object';
-}
-
-
-/**
- * Determine if a value is an object with a null prototype
- *
- * @returns {boolean} True if `value` is an `Object` with a null prototype
- */
-function isBlankObject(value) {
-  return value !== null && typeof value === 'object' && !getPrototypeOf(value);
-}
-
-
-/**
- * @ngdoc function
- * @name angular.isString
- * @module ng
- * @kind function
- *
- * @description
- * Determines if a reference is a `String`.
- *
- * @param {*} value Reference to check.
- * @returns {boolean} True if `value` is a `String`.
- */
-function isString(value) {return typeof value === 'string';}
-
-
-/**
- * @ngdoc function
- * @name angular.isNumber
- * @module ng
- * @kind function
- *
- * @description
- * Determines if a reference is a `Number`.
- *
- * This includes the "special" numbers `NaN`, `+Infinity` and `-Infinity`.
- *
- * If you wish to exclude these then you can use the native
- * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite)
- * method.
- *
- * @param {*} value Reference to check.
- * @returns {boolean} True if `value` is a `Number`.
- */
-function isNumber(value) {return typeof value === 'number';}
-
-
-/**
- * @ngdoc function
- * @name angular.isDate
- * @module ng
- * @kind function
- *
- * @description
- * Determines if a value is a date.
- *
- * @param {*} value Reference to check.
- * @returns {boolean} True if `value` is a `Date`.
- */
-function isDate(value) {
-  return toString.call(value) === '[object Date]';
-}
-
-
-/**
- * @ngdoc function
- * @name angular.isArray
- * @module ng
- * @kind function
- *
- * @description
- * Determines if a reference is an `Array`.
- *
- * @param {*} value Reference to check.
- * @returns {boolean} True if `value` is an `Array`.
- */
-var isArray = Array.isArray;
-
-/**
- * @ngdoc function
- * @name angular.isFunction
- * @module ng
- * @kind function
- *
- * @description
- * Determines if a reference is a `Function`.
- *
- * @param {*} value Reference to check.
- * @returns {boolean} True if `value` is a `Function`.
- */
-function isFunction(value) {return typeof value === 'function';}
-
-
-/**
- * Determines if a value is a regular expression object.
- *
- * @private
- * @param {*} value Reference to check.
- * @returns {boolean} True if `value` is a `RegExp`.
- */
-function isRegExp(value) {
-  return toString.call(value) === '[object RegExp]';
-}
-
-
-/**
- * Checks if `obj` is a window object.
- *
- * @private
- * @param {*} obj Object to check
- * @returns {boolean} True if `obj` is a window obj.
- */
-function isWindow(obj) {
-  return obj && obj.window === obj;
-}
-
-
-function isScope(obj) {
-  return obj && obj.$evalAsync && obj.$watch;
-}
-
-
-function isFile(obj) {
-  return toString.call(obj) === '[object File]';
-}
-
-
-function isFormData(obj) {
-  return toString.call(obj) === '[object FormData]';
-}
-
-
-function isBlob(obj) {
-  return toString.call(obj) === '[object Blob]';
-}
-
-
-function isBoolean(value) {
-  return typeof value === 'boolean';
-}
-
-
-function isPromiseLike(obj) {
-  return obj && isFunction(obj.then);
-}
-
-
-var TYPED_ARRAY_REGEXP = /^\[object (Uint8(Clamped)?)|(Uint16)|(Uint32)|(Int8)|(Int16)|(Int32)|(Float(32)|(64))Array\]$/;
-function isTypedArray(value) {
-  return TYPED_ARRAY_REGEXP.test(toString.call(value));
-}
-
-
-var trim = function(value) {
-  return isString(value) ? value.trim() : value;
-};
-
-// Copied from:
-// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021
-// Prereq: s is a string.
-var escapeForRegexp = function(s) {
-  return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, '\\$1').
-           replace(/\x08/g, '\\x08');
-};
-
-
-/**
- * @ngdoc function
- * @name angular.isElement
- * @module ng
- * @kind function
- *
- * @description
- * Determines if a reference is a DOM element (or wrapped jQuery element).
- *
- * @param {*} value Reference to check.
- * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).
- */
-function isElement(node) {
-  return !!(node &&
-    (node.nodeName  // we are a direct element
-    || (node.prop && node.attr && node.find)));  // we have an on and find method part of jQuery API
-}
-
-/**
- * @param str 'key1,key2,...'
- * @returns {object} in the form of {key1:true, key2:true, ...}
- */
-function makeMap(str) {
-  var obj = {}, items = str.split(","), i;
-  for (i = 0; i < items.length; i++) {
-    obj[items[i]] = true;
-  }
-  return obj;
-}
-
-
-function nodeName_(element) {
-  return lowercase(element.nodeName || (element[0] && element[0].nodeName));
-}
-
-function includes(array, obj) {
-  return Array.prototype.indexOf.call(array, obj) != -1;
-}
-
-function arrayRemove(array, value) {
-  var index = array.indexOf(value);
-  if (index >= 0) {
-    array.splice(index, 1);
-  }
-  return index;
-}
-
-/**
- * @ngdoc function
- * @name angular.copy
- * @module ng
- * @kind function
- *
- * @description
- * Creates a deep copy of `source`, which should be an object or an array.
- *
- * * If no destination is supplied, a copy of the object or array is created.
- * * If a destination is provided, all of its elements (for arrays) or properties (for objects)
- *   are deleted and then all elements/properties from the source are copied to it.
- * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.
- * * If `source` is identical to 'destination' an exception will be thrown.
- *
- * @param {*} source The source that will be used to make a copy.
- *                   Can be any type, including primitives, `null`, and `undefined`.
- * @param {(Object|Array)=} destination Destination into which the source is copied. If
- *     provided, must be of the same type as `source`.
- * @returns {*} The copy or updated `destination`, if `destination` was specified.
- *
- * @example
- <example module="copyExample">
- <file name="index.html">
- <div ng-controller="ExampleController">
- <form novalidate class="simple-form">
- Name: <input type="text" ng-model="user.name" /><br />
- E-mail: <input type="email" ng-model="user.email" /><br />
- Gender: <input type="radio" ng-model="user.gender" value="male" />male
- <input type="radio" ng-model="user.gender" value="female" />female<br />
- <button ng-click="reset()">RESET</button>
- <button ng-click="update(user)">SAVE</button>
- </form>
- <pre>form = {{user | json}}</pre>
- <pre>master = {{master | json}}</pre>
- </div>
-
- <script>
-  angular.module('copyExample', [])
-    .controller('ExampleController', ['$scope', function($scope) {
-      $scope.master= {};
-
-      $scope.update = function(user) {
-        // Example with 1 argument
-        $scope.master= angular.copy(user);
-      };
-
-      $scope.reset = function() {
-        // Example with 2 arguments
-        angular.copy($scope.master, $scope.user);
-      };
-
-      $scope.reset();
-    }]);
- </script>
- </file>
- </example>
- */
-function copy(source, destination, stackSource, stackDest) {
-  if (isWindow(source) || isScope(source)) {
-    throw ngMinErr('cpws',
-      "Can't copy! Making copies of Window or Scope instances is not supported.");
-  }
-  if (isTypedArray(destination)) {
-    throw ngMinErr('cpta',
-      "Can't copy! TypedArray destination cannot be mutated.");
-  }
-
-  if (!destination) {
-    destination = source;
-    if (isObject(source)) {
-      var index;
-      if (stackSource && (index = stackSource.indexOf(source)) !== -1) {
-        return stackDest[index];
-      }
-
-      // TypedArray, Date and RegExp have specific copy functionality and must be
-      // pushed onto the stack before returning.
-      // Array and other objects create the base object and recurse to copy child
-      // objects. The array/object will be pushed onto the stack when recursed.
-      if (isArray(source)) {
-        return copy(source, [], stackSource, stackDest);
-      } else if (isTypedArray(source)) {
-        destination = new source.constructor(source);
-      } else if (isDate(source)) {
-        destination = new Date(source.getTime());
-      } else if (isRegExp(source)) {
-        destination = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]);
-        destination.lastIndex = source.lastIndex;
-      } else if (isFunction(source.cloneNode)) {
-          destination = source.cloneNode(true);
-      } else {
-        var emptyObject = Object.create(getPrototypeOf(source));
-        return copy(source, emptyObject, stackSource, stackDest);
-      }
-
-      if (stackDest) {
-        stackSource.push(source);
-        stackDest.push(destination);
-      }
-    }
-  } else {
-    if (source === destination) throw ngMinErr('cpi',
-      "Can't copy! Source and destination are identical.");
-
-    stackSource = stackSource || [];
-    stackDest = stackDest || [];
-
-    if (isObject(source)) {
-      stackSource.push(source);
-      stackDest.push(destination);
-    }
-
-    var result, key;
-    if (isArray(source)) {
-      destination.length = 0;
-      for (var i = 0; i < source.length; i++) {
-        destination.push(copy(source[i], null, stackSource, stackDest));
-      }
-    } else {
-      var h = destination.$$hashKey;
-      if (isArray(destination)) {
-        destination.length = 0;
-      } else {
-        forEach(destination, function(value, key) {
-          delete destination[key];
-        });
-      }
-      if (isBlankObject(source)) {
-        // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty
-        for (key in source) {
-          destination[key] = copy(source[key], null, stackSource, stackDest);
-        }
-      } else if (source && typeof source.hasOwnProperty === 'function') {
-        // Slow path, which must rely on hasOwnProperty
-        for (key in source) {
-          if (source.hasOwnProperty(key)) {
-            destination[key] = copy(source[key], null, stackSource, stackDest);
-          }
-        }
-      } else {
-        // Slowest path --- hasOwnProperty can't be called as a method
-        for (key in source) {
-          if (hasOwnProperty.call(source, key)) {
-            destination[key] = copy(source[key], null, stackSource, stackDest);
-          }
-        }
-      }
-      setHashKey(destination,h);
-    }
-  }
-  return destination;
-}
-
-/**
- * Creates a shallow copy of an object, an array or a primitive.
- *
- * Assumes that there are no proto properties for objects.
- */
-function shallowCopy(src, dst) {
-  if (isArray(src)) {
-    dst = dst || [];
-
-    for (var i = 0, ii = src.length; i < ii; i++) {
-      dst[i] = src[i];
-    }
-  } else if (isObject(src)) {
-    dst = dst || {};
-
-    for (var key in src) {
-      if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {
-        dst[key] = src[key];
-      }
-    }
-  }
-
-  return dst || src;
-}
-
-
-/**
- * @ngdoc function
- * @name angular.equals
- * @module ng
- * @kind function
- *
- * @description
- * Determines if two objects or two values are equivalent. Supports value types, regular
- * expressions, arrays and objects.
- *
- * Two objects or values are considered equivalent if at least one of the following is true:
- *
- * * Both objects or values pass `===` comparison.
- * * Both objects or values are of the same type and all of their properties are equal by
- *   comparing them with `angular.equals`.
- * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)
- * * Both values represent the same regular expression (In JavaScript,
- *   /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual
- *   representation matches).
- *
- * During a property comparison, properties of `function` type and properties with names
- * that begin with `$` are ignored.
- *
- * Scope and DOMWindow objects are being compared only by identify (`===`).
- *
- * @param {*} o1 Object or value to compare.
- * @param {*} o2 Object or value to compare.
- * @returns {boolean} True if arguments are equal.
- */
-function equals(o1, o2) {
-  if (o1 === o2) return true;
-  if (o1 === null || o2 === null) return false;
-  if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
-  var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
-  if (t1 == t2) {
-    if (t1 == 'object') {
-      if (isArray(o1)) {
-        if (!isArray(o2)) return false;
-        if ((length = o1.length) == o2.length) {
-          for (key = 0; key < length; key++) {
-            if (!equals(o1[key], o2[key])) return false;
-          }
-          return true;
-        }
-      } else if (isDate(o1)) {
-        if (!isDate(o2)) return false;
-        return equals(o1.getTime(), o2.getTime());
-      } else if (isRegExp(o1)) {
-        return isRegExp(o2) ? o1.toString() == o2.toString() : false;
-      } else {
-        if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||
-          isArray(o2) || isDate(o2) || isRegExp(o2)) return false;
-        keySet = createMap();
-        for (key in o1) {
-          if (key.charAt(0) === '$' || isFunction(o1[key])) continue;
-          if (!equals(o1[key], o2[key])) return false;
-          keySet[key] = true;
-        }
-        for (key in o2) {
-          if (!(key in keySet) &&
-              key.charAt(0) !== '$' &&
-              isDefined(o2[key]) &&
-              !isFunction(o2[key])) return false;
-        }
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-var csp = function() {
-  if (!isDefined(csp.rules)) {
-
-
-    var ngCspElement = (document.querySelector('[ng-csp]') ||
-                    document.querySelector('[data-ng-csp]'));
-
-    if (ngCspElement) {
-      var ngCspAttribute = ngCspElement.getAttribute('ng-csp') ||
-                    ngCspElement.getAttribute('data-ng-csp');
-      csp.rules = {
-        noUnsafeEval: !ngCspAttribute || (ngCspAttribute.indexOf('no-unsafe-eval') !== -1),
-        noInlineStyle: !ngCspAttribute || (ngCspAttribute.indexOf('no-inline-style') !== -1)
-      };
-    } else {
-      csp.rules = {
-        noUnsafeEval: noUnsafeEval(),
-        noInlineStyle: false
-      };
-    }
-  }
-
-  return csp.rules;
-
-  function noUnsafeEval() {
-    try {
-      /* jshint -W031, -W054 */
-      new Function('');
-      /* jshint +W031, +W054 */
-      return false;
-    } catch (e) {
-      return true;
-    }
-  }
-};
-
-/**
- * @ngdoc directive
- * @module ng
- * @name ngJq
- *
- * @element ANY
- * @param {string=} ngJq the name of the library available under `window`
- * to be used for angular.element
- * @description
- * Use this directive to force the angular.element library.  This should be
- * used to force either jqLite by leaving ng-jq blank or setting the name of
- * the jquery variable under window (eg. jQuery).
- *
- * Since angular looks for this directive when it is loaded (doesn't wait for the
- * DOMContentLoaded event), it must be placed on an element that comes before the script
- * which loads angular. Also, only the first instance of `ng-jq` will be used and all
- * others ignored.
- *
- * @example
- * This example shows how to force jqLite using the `ngJq` directive to the `html` tag.
- ```html
- <!doctype html>
- <html ng-app ng-jq>
- ...
- ...
- </html>
- ```
- * @example
- * This example shows how to use a jQuery based library of a different name.
- * The library name must be available at the top most 'window'.
- ```html
- <!doctype html>
- <html ng-app ng-jq="jQueryLib">
- ...
- ...
- </html>
- ```
- */
-var jq = function() {
-  if (isDefined(jq.name_)) return jq.name_;
-  var el;
-  var i, ii = ngAttrPrefixes.length, prefix, name;
-  for (i = 0; i < ii; ++i) {
-    prefix = ngAttrPrefixes[i];
-    if (el = document.querySelector('[' + prefix.replace(':', '\\:') + 'jq]')) {
-      name = el.getAttribute(prefix + 'jq');
-      break;
-    }
-  }
-
-  return (jq.name_ = name);
-};
-
-function concat(array1, array2, index) {
-  return array1.concat(slice.call(array2, index));
-}
-
-function sliceArgs(args, startIndex) {
-  return slice.call(args, startIndex || 0);
-}
-
-
-/* jshint -W101 */
-/**
- * @ngdoc function
- * @name angular.bind
- * @module ng
- * @kind function
- *
- * @description
- * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
- * `fn`). You can supply optional `args` that are prebound to the function. This feature is also
- * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as
- * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).
- *
- * @param {Object} self Context which `fn` should be evaluated in.
- * @param {function()} fn Function to be bound.
- * @param {...*} args Optional arguments to be prebound to the `fn` function call.
- * @returns {function()} Function that wraps the `fn` with all the specified bindings.
- */
-/* jshint +W101 */
-function bind(self, fn) {
-  var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
-  if (isFunction(fn) && !(fn instanceof RegExp)) {
-    return curryArgs.length
-      ? function() {
-          return arguments.length
-            ? fn.apply(self, concat(curryArgs, arguments, 0))
-            : fn.apply(self, curryArgs);
-        }
-      : function() {
-          return arguments.length
-            ? fn.apply(self, arguments)
-            : fn.call(self);
-        };
-  } else {
-    // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
-    return fn;
-  }
-}
-
-
-function toJsonReplacer(key, value) {
-  var val = value;
-
-  if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {
-    val = undefined;
-  } else if (isWindow(value)) {
-    val = '$WINDOW';
-  } else if (value &&  document === value) {
-    val = '$DOCUMENT';
-  } else if (isScope(value)) {
-    val = '$SCOPE';
-  }
-
-  return val;
-}
-
-
-/**
- * @ngdoc function
- * @name angular.toJson
- * @module ng
- * @kind function
- *
- * @description
- * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be
- * stripped since angular uses this notation internally.
- *
- * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
- * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace.
- *    If set to an integer, the JSON output will contain that many spaces per indentation.
- * @returns {string|undefined} JSON-ified string representing `obj`.
- */
-function toJson(obj, pretty) {
-  if (typeof obj === 'undefined') return undefined;
-  if (!isNumber(pretty)) {
-    pretty = pretty ? 2 : null;
-  }
-  return JSON.stringify(obj, toJsonReplacer, pretty);
-}
-
-
-/**
- * @ngdoc function
- * @name angular.fromJson
- * @module ng
- * @kind function
- *
- * @description
- * Deserializes a JSON string.
- *
- * @param {string} json JSON string to deserialize.
- * @returns {Object|Array|string|number} Deserialized JSON string.
- */
-function fromJson(json) {
-  return isString(json)
-      ? JSON.parse(json)
-      : json;
-}
-
-
-function timezoneToOffset(timezone, fallback) {
-  var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
-  return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
-}
-
-
-function addDateMinutes(date, minutes) {
-  date = new Date(date.getTime());
-  date.setMinutes(date.getMinutes() + minutes);
-  return date;
-}
-
-
-function convertTimezoneToLocal(date, timezone, reverse) {
-  reverse = reverse ? -1 : 1;
-  var timezoneOffset = timezoneToOffset(timezone, date.getTimezoneOffset());
-  return addDateMinutes(date, reverse * (timezoneOffset - date.getTimezoneOffset()));
-}
-
-
-/**
- * @returns {string} Returns the string representation of the element.
- */
-function startingTag(element) {
-  element = jqLite(element).clone();
-  try {
-    // turns out IE does not let you set .html() on elements which
-    // are not allowed to have children. So we just ignore it.
-    element.empty();
-  } catch (e) {}
-  var elemHtml = jqLite('<div>').append(element).html();
-  try {
-    return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :
-        elemHtml.
-          match(/^(<[^>]+>)/)[1].
-          replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); });
-  } catch (e) {
-    return lowercase(elemHtml);
-  }
-
-}
-
-
-/////////////////////////////////////////////////
-
-/**
- * Tries to decode the URI component without throwing an exception.
- *
- * @private
- * @param str value potential URI component to check.
- * @returns {boolean} True if `value` can be decoded
- * with the decodeURIComponent function.
- */
-function tryDecodeURIComponent(value) {
-  try {
-    return decodeURIComponent(value);
-  } catch (e) {
-    // Ignore any invalid uri component
-  }
-}
-
-
-/**
- * Parses an escaped url query string into key-value pairs.
- * @returns {Object.<string,boolean|Array>}
- */
-function parseKeyValue(/**string*/keyValue) {
-  var obj = {};
-  forEach((keyValue || "").split('&'), function(keyValue) {
-    var splitPoint, key, val;
-    if (keyValue) {
-      key = keyValue = keyValue.replace(/\+/g,'%20');
-      splitPoint = keyValue.indexOf('=');
-      if (splitPoint !== -1) {
-        key = keyValue.substring(0, splitPoint);
-        val = keyValue.substring(splitPoint + 1);
-      }
-      key = tryDecodeURIComponent(key);
-      if (isDefined(key)) {
-        val = isDefined(val) ? tryDecodeURIComponent(val) : true;
-        if (!hasOwnProperty.call(obj, key)) {
-          obj[key] = val;
-        } else if (isArray(obj[key])) {
-          obj[key].push(val);
-        } else {
-          obj[key] = [obj[key],val];
-        }
-      }
-    }
-  });
-  return obj;
-}
-
-function toKeyValue(obj) {
-  var parts = [];
-  forEach(obj, function(value, key) {
-    if (isArray(value)) {
-      forEach(value, function(arrayValue) {
-        parts.push(encodeUriQuery(key, true) +
-                   (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
-      });
-    } else {
-    parts.push(encodeUriQuery(key, true) +
-               (value === true ? '' : '=' + encodeUriQuery(value, true)));
-    }
-  });
-  return parts.length ? parts.join('&') : '';
-}
-
-
-/**
- * We need our custom method because encodeURIComponent is too aggressive and doesn't follow
- * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
- * segments:
- *    segment       = *pchar
- *    pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
- *    pct-encoded   = "%" HEXDIG HEXDIG
- *    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
- *    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
- *                     / "*" / "+" / "," / ";" / "="
- */
-function encodeUriSegment(val) {
-  return encodeUriQuery(val, true).
-             replace(/%26/gi, '&').
-             replace(/%3D/gi, '=').
-             replace(/%2B/gi, '+');
-}
-
-
-/**
- * This method is intended for encoding *key* or *value* parts of query component. We need a custom
- * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be
- * encoded per http://tools.ietf.org/html/rfc3986:
- *    query       = *( pchar / "/" / "?" )
- *    pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
- *    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
- *    pct-encoded   = "%" HEXDIG HEXDIG
- *    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
- *                     / "*" / "+" / "," / ";" / "="
- */
-function encodeUriQuery(val, pctEncodeSpaces) {
-  return encodeURIComponent(val).
-             replace(/%40/gi, '@').
-             replace(/%3A/gi, ':').
-             replace(/%24/g, '$').
-             replace(/%2C/gi, ',').
-             replace(/%3B/gi, ';').
-             replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
-}
-
-var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
-
-function getNgAttribute(element, ngAttr) {
-  var attr, i, ii = ngAttrPrefixes.length;
-  for (i = 0; i < ii; ++i) {
-    attr = ngAttrPrefixes[i] + ngAttr;
-    if (isString(attr = element.getAttribute(attr))) {
-      return attr;
-    }
-  }
-  return null;
-}
-
-/**
- * @ngdoc directive
- * @name ngApp
- * @module ng
- *
- * @element ANY
- * @param {angular.Module} ngApp an optional application
- *   {@link angular.module module} name to load.
- * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be
- *   created in "strict-di" mode. This means that the application will fail to invoke functions which
- *   do not use explicit function annotation (and are thus unsuitable for minification), as described
- *   in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in
- *   tracking down the root of these bugs.
- *
- * @description
- *
- * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive
- * designates the **root element** of the application and is typically placed near the root element
- * of the page - e.g. on the `<body>` or `<html>` tags.
- *
- * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`
- * found in the document will be used to define the root element to auto-bootstrap as an
- * application. To run multiple applications in an HTML document you must manually bootstrap them using
- * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.
- *
- * You can specify an **AngularJS module** to be used as the root module for the application.  This
- * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It
- * should contain the application code needed or have dependencies on other modules that will
- * contain the code. See {@link angular.module} for more information.
- *
- * In the example below if the `ngApp` directive were not placed on the `html` element then the
- * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`
- * would not be resolved to `3`.
- *
- * `ngApp` is the easiest, and most common way to bootstrap an application.
- *
- <example module="ngAppDemo">
-   <file name="index.html">
-   <div ng-controller="ngAppDemoController">
-     I can add: {{a}} + {{b}} =  {{ a+b }}
-   </div>
-   </file>
-   <file name="script.js">
-   angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {
-     $scope.a = 1;
-     $scope.b = 2;
-   });
-   </file>
- </example>
- *
- * Using `ngStrictDi`, you would see something like this:
- *
- <example ng-app-included="true">
-   <file name="index.html">
-   <div ng-app="ngAppStrictDemo" ng-strict-di>
-       <div ng-controller="GoodController1">
-           I can add: {{a}} + {{b}} =  {{ a+b }}
-
-           <p>This renders because the controller does not fail to
-              instantiate, by using explicit annotation style (see
-              script.js for details)
-           </p>
-       </div>
-
-       <div ng-controller="GoodController2">
-           Name: <input ng-model="name"><br />
-           Hello, {{name}}!
-
-           <p>This renders because the controller does not fail to
-              instantiate, by using explicit annotation style
-              (see script.js for details)
-           </p>
-       </div>
-
-       <div ng-controller="BadController">
-           I can add: {{a}} + {{b}} =  {{ a+b }}
-
-           <p>The controller could not be instantiated, due to relying
-              on automatic function annotations (which are disabled in
-              strict mode). As such, the content of this section is not
-              interpolated, and there should be an error in your web console.
-           </p>
-       </div>
-   </div>
-   </file>
-   <file name="script.js">
-   angular.module('ngAppStrictDemo', [])
-     // BadController will fail to instantiate, due to relying on automatic function annotation,
-     // rather than an explicit annotation
-     .controller('BadController', function($scope) {
-       $scope.a = 1;
-       $scope.b = 2;
-     })
-     // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,
-     // due to using explicit annotations using the array style and $inject property, respectively.
-     .controller('GoodController1', ['$scope', function($scope) {
-       $scope.a = 1;
-       $scope.b = 2;
-     }])
-     .controller('GoodController2', GoodController2);
-     function GoodController2($scope) {
-       $scope.name = "World";
-     }
-     GoodController2.$inject = ['$scope'];
-   </file>
-   <file name="style.css">
-   div[ng-controller] {
-       margin-bottom: 1em;
-       -webkit-border-radius: 4px;
-       border-radius: 4px;
-       border: 1px solid;
-       padding: .5em;
-   }
-   div[ng-controller^=Good] {
-       border-color: #d6e9c6;
-       background-color: #dff0d8;
-       color: #3c763d;
-   }
-   div[ng-controller^=Bad] {
-       border-color: #ebccd1;
-       background-color: #f2dede;
-       color: #a94442;
-       margin-bottom: 0;
-   }
-   </file>
- </example>
- */
-function angularInit(element, bootstrap) {
-  var appElement,
-      module,
-      config = {};
-
-  // The element `element` has priority over any other element
-  forEach(ngAttrPrefixes, function(prefix) {
-    var name = prefix + 'app';
-
-    if (!appElement && element.hasAttribute && element.hasAttribute(name)) {
-      appElement = element;
-      module = element.getAttribute(name);
-    }
-  });
-  forEach(ngAttrPrefixes, function(prefix) {
-    var name = prefix + 'app';
-    var candidate;
-
-    if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) {
-      appElement = candidate;
-      module = candidate.getAttribute(name);
-    }
-  });
-  if (appElement) {
-    config.strictDi = getNgAttribute(appElement, "strict-di") !== null;
-    bootstrap(appElement, module ? [module] : [], config);
-  }
-}
-
-/**
- * @ngdoc function
- * @name angular.bootstrap
- * @module ng
- * @description
- * Use this function to manually start up angular application.
- *
- * See: {@link guide/bootstrap Bootstrap}
- *
- * Note that Protractor based end-to-end tests cannot use this function to bootstrap manually.
- * They must use {@link ng.directive:ngApp ngApp}.
- *
- * Angular will detect if it has been loaded into the browser more than once and only allow the
- * first loaded script to be bootstrapped and will report a warning to the browser console for
- * each of the subsequent scripts. This prevents strange results in applications, where otherwise
- * multiple instances of Angular try to work on the DOM.
- *
- * ```html
- * <!doctype html>
- * <html>
- * <body>
- * <div ng-controller="WelcomeController">
- *   {{greeting}}
- * </div>
- *
- * <script src="angular.js"></script>
- * <script>
- *   var app = angular.module('demo', [])
- *   .controller('WelcomeController', function($scope) {
- *       $scope.greeting = 'Welcome!';
- *   });
- *   angular.bootstrap(document, ['demo']);
- * </script>
- * </body>
- * </html>
- * ```
- *
- * @param {DOMElement} element DOM element which is the root of angular application.
- * @param {Array<String|Function|Array>=} modules an array of modules to load into the application.
- *     Each item in the array should be the name of a predefined module or a (DI annotated)
- *     function that will be invoked by the injector as a `config` block.
- *     See: {@link angular.module modules}
- * @param {Object=} config an object for defining configuration options for the application. The
- *     following keys are supported:
- *
- * * `strictDi` - disable automatic function annotation for the application. This is meant to
- *   assist in finding bugs which break minified code. Defaults to `false`.
- *
- * @returns {auto.$injector} Returns the newly created injector for this app.
- */
-function bootstrap(element, modules, config) {
-  if (!isObject(config)) config = {};
-  var defaultConfig = {
-    strictDi: false
-  };
-  config = extend(defaultConfig, config);
-  var doBootstrap = function() {
-    element = jqLite(element);
-
-    if (element.injector()) {
-      var tag = (element[0] === document) ? 'document' : startingTag(element);
-      //Encode angle brackets to prevent input from being sanitized to empty string #8683
-      throw ngMinErr(
-          'btstrpd',
-          "App Already Bootstrapped with this Element '{0}'",
-          tag.replace(/</,'&lt;').replace(/>/,'&gt;'));
-    }
-
-    modules = modules || [];
-    modules.unshift(['$provide', function($provide) {
-      $provide.value('$rootElement', element);
-    }]);
-
-    if (config.debugInfoEnabled) {
-      // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.
-      modules.push(['$compileProvider', function($compileProvider) {
-        $compileProvider.debugInfoEnabled(true);
-      }]);
-    }
-
-    modules.unshift('ng');
-    var injector = createInjector(modules, config.strictDi);
-    injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',
-       function bootstrapApply(scope, element, compile, injector) {
-        scope.$apply(function() {
-          element.data('$injector', injector);
-          compile(element)(scope);
-        });
-      }]
-    );
-    return injector;
-  };
-
-  var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;
-  var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;
-
-  if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {
-    config.debugInfoEnabled = true;
-    window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');
-  }
-
-  if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {
-    return doBootstrap();
-  }
-
-  window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');
-  angular.resumeBootstrap = function(extraModules) {
-    forEach(extraModules, function(module) {
-      modules.push(module);
-    });
-    return doBootstrap();
-  };
-
-  if (isFunction(angular.resumeDeferredBootstrap)) {
-    angular.resumeDeferredBootstrap();
-  }
-}
-
-/**
- * @ngdoc function
- * @name angular.reloadWithDebugInfo
- * @module ng
- * @description
- * Use this function to reload the current application with debug information turned on.
- * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.
- *
- * See {@link ng.$compileProvider#debugInfoEnabled} for more.
- */
-function reloadWithDebugInfo() {
-  window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;
-  window.location.reload();
-}
-
-/**
- * @name angular.getTestability
- * @module ng
- * @description
- * Get the testability service for the instance of Angular on the given
- * element.
- * @param {DOMElement} element DOM element which is the root of angular application.
- */
-function getTestability(rootElement) {
-  var injector = angular.element(rootElement).injector();
-  if (!injector) {
-    throw ngMinErr('test',
-      'no injector found for element argument to getTestability');
-  }
-  return injector.get('$$testability');
-}
-
-var SNAKE_CASE_REGEXP = /[A-Z]/g;
-function snake_case(name, separator) {
-  separator = separator || '_';
-  return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
-    return (pos ? separator : '') + letter.toLowerCase();
-  });
-}
-
-var bindJQueryFired = false;
-var skipDestroyOnNextJQueryCleanData;
-function bindJQuery() {
-  var originalCleanData;
-
-  if (bindJQueryFired) {
-    return;
-  }
-
-  // bind to jQuery if present;
-  var jqName = jq();
-  jQuery = isUndefined(jqName) ? window.jQuery :   // use jQuery (if present)
-           !jqName             ? undefined     :   // use jqLite
-                                 window[jqName];   // use jQuery specified by `ngJq`
-
-  // Use jQuery if it exists with proper functionality, otherwise default to us.
-  // Angular 1.2+ requires jQuery 1.7+ for on()/off() support.
-  // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older
-  // versions. It will not work for sure with jQuery <1.7, though.
-  if (jQuery && jQuery.fn.on) {
-    jqLite = jQuery;
-    extend(jQuery.fn, {
-      scope: JQLitePrototype.scope,
-      isolateScope: JQLitePrototype.isolateScope,
-      controller: JQLitePrototype.controller,
-      injector: JQLitePrototype.injector,
-      inheritedData: JQLitePrototype.inheritedData
-    });
-
-    // All nodes removed from the DOM via various jQuery APIs like .remove()
-    // are passed through jQuery.cleanData. Monkey-patch this method to fire
-    // the $destroy event on all removed nodes.
-    originalCleanData = jQuery.cleanData;
-    jQuery.cleanData = function(elems) {
-      var events;
-      if (!skipDestroyOnNextJQueryCleanData) {
-        for (var i = 0, elem; (elem = elems[i]) != null; i++) {
-          events = jQuery._data(elem, "events");
-          if (events && events.$destroy) {
-            jQuery(elem).triggerHandler('$destroy');
-          }
-        }
-      } else {
-        skipDestroyOnNextJQueryCleanData = false;
-      }
-      originalCleanData(elems);
-    };
-  } else {
-    jqLite = JQLite;
-  }
-
-  angular.element = jqLite;
-
-  // Prevent double-proxying.
-  bindJQueryFired = true;
-}
-
-/**
- * throw error if the argument is falsy.
- */
-function assertArg(arg, name, reason) {
-  if (!arg) {
-    throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required"));
-  }
-  return arg;
-}
-
-function assertArgFn(arg, name, acceptArrayAnnotation) {
-  if (acceptArrayAnnotation && isArray(arg)) {
-      arg = arg[arg.length - 1];
-  }
-
-  assertArg(isFunction(arg), name, 'not a function, got ' +
-      (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));
-  return arg;
-}
-
-/**
- * throw error if the name given is hasOwnProperty
- * @param  {String} name    the name to test
- * @param  {String} context the context in which the name is used, such as module or directive
- */
-function assertNotHasOwnProperty(name, context) {
-  if (name === 'hasOwnProperty') {
-    throw ngMinErr('badname', "hasOwnProperty is not a valid {0} name", context);
-  }
-}
-
-/**
- * Return the value accessible from the object by path. Any undefined traversals are ignored
- * @param {Object} obj starting object
- * @param {String} path path to traverse
- * @param {boolean} [bindFnToScope=true]
- * @returns {Object} value as accessible by path
- */
-//TODO(misko): this function needs to be removed
-function getter(obj, path, bindFnToScope) {
-  if (!path) return obj;
-  var keys = path.split('.');
-  var key;
-  var lastInstance = obj;
-  var len = keys.length;
-
-  for (var i = 0; i < len; i++) {
-    key = keys[i];
-    if (obj) {
-      obj = (lastInstance = obj)[key];
-    }
-  }
-  if (!bindFnToScope && isFunction(obj)) {
-    return bind(lastInstance, obj);
-  }
-  return obj;
-}
-
-/**
- * Return the DOM siblings between the first and last node in the given array.
- * @param {Array} array like object
- * @returns {Array} the inputted object or a jqLite collection containing the nodes
- */
-function getBlockNodes(nodes) {
-  // TODO(perf): update `nodes` instead of creating a new object?
-  var node = nodes[0];
-  var endNode = nodes[nodes.length - 1];
-  var blockNodes;
-
-  for (var i = 1; node !== endNode && (node = node.nextSibling); i++) {
-    if (blockNodes || nodes[i] !== node) {
-      if (!blockNodes) {
-        blockNodes = jqLite(slice.call(nodes, 0, i));
-      }
-      blockNodes.push(node);
-    }
-  }
-
-  return blockNodes || nodes;
-}
-
-
-/**
- * Creates a new object without a prototype. This object is useful for lookup without having to
- * guard against prototypically inherited properties via hasOwnProperty.
- *
- * Related micro-benchmarks:
- * - http://jsperf.com/object-create2
- * - http://jsperf.com/proto-map-lookup/2
- * - http://jsperf.com/for-in-vs-object-keys2
- *
- * @returns {Object}
- */
-function createMap() {
-  return Object.create(null);
-}
-
-var NODE_TYPE_ELEMENT = 1;
-var NODE_TYPE_ATTRIBUTE = 2;
-var NODE_TYPE_TEXT = 3;
-var NODE_TYPE_COMMENT = 8;
-var NODE_TYPE_DOCUMENT = 9;
-var NODE_TYPE_DOCUMENT_FRAGMENT = 11;
-
-/**
- * @ngdoc type
- * @name angular.Module
- * @module ng
- * @description
- *
- * Interface for configuring angular {@link angular.module modules}.
- */
-
-function setupModuleLoader(window) {
-
-  var $injectorMinErr = minErr('$injector');
-  var ngMinErr = minErr('ng');
-
-  function ensure(obj, name, factory) {
-    return obj[name] || (obj[name] = factory());
-  }
-
-  var angular = ensure(window, 'angular', Object);
-
-  // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap
-  angular.$$minErr = angular.$$minErr || minErr;
-
-  return ensure(angular, 'module', function() {
-    /** @type {Object.<string, angular.Module>} */
-    var modules = {};
-
-    /**
-     * @ngdoc function
-     * @name angular.module
-     * @module ng
-     * @description
-     *
-     * The `angular.module` is a global place for creating, registering and retrieving Angular
-     * modules.
-     * All modules (angular core or 3rd party) that should be available to an application must be
-     * registered using this mechanism.
-     *
-     * Passing one argument retrieves an existing {@link angular.Module},
-     * whereas passing more than one argument creates a new {@link angular.Module}
-     *
-     *
-     * # Module
-     *
-     * A module is a collection of services, directives, controllers, filters, and configuration information.
-     * `angular.module` is used to configure the {@link auto.$injector $injector}.
-     *
-     * ```js
-     * // Create a new module
-     * var myModule = angular.module('myModule', []);
-     *
-     * // register a new service
-     * myModule.value('appName', 'MyCoolApp');
-     *
-     * // configure existing services inside initialization blocks.
-     * myModule.config(['$locationProvider', function($locationProvider) {
-     *   // Configure existing providers
-     *   $locationProvider.hashPrefix('!');
-     * }]);
-     * ```
-     *
-     * Then you can create an injector and load your modules like this:
-     *
-     * ```js
-     * var injector = angular.injector(['ng', 'myModule'])
-     * ```
-     *
-     * However it's more likely that you'll just use
-     * {@link ng.directive:ngApp ngApp} or
-     * {@link angular.bootstrap} to simplify this process for you.
-     *
-     * @param {!string} name The name of the module to create or retrieve.
-     * @param {!Array.<string>=} requires If specified then new module is being created. If
-     *        unspecified then the module is being retrieved for further configuration.
-     * @param {Function=} configFn Optional configuration function for the module. Same as
-     *        {@link angular.Module#config Module#config()}.
-     * @returns {module} new module with the {@link angular.Module} api.
-     */
-    return function module(name, requires, configFn) {
-      var assertNotHasOwnProperty = function(name, context) {
-        if (name === 'hasOwnProperty') {
-          throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
-        }
-      };
-
-      assertNotHasOwnProperty(name, 'module');
-      if (requires && modules.hasOwnProperty(name)) {
-        modules[name] = null;
-      }
-      return ensure(modules, name, function() {
-        if (!requires) {
-          throw $injectorMinErr('nomod', "Module '{0}' is not available! You either misspelled " +
-             "the module name or forgot to load it. If registering a module ensure that you " +
-             "specify the dependencies as the second argument.", name);
-        }
-
-        /** @type {!Array.<Array.<*>>} */
-        var invokeQueue = [];
-
-        /** @type {!Array.<Function>} */
-        var configBlocks = [];
-
-        /** @type {!Array.<Function>} */
-        var runBlocks = [];
-
-        var config = invokeLater('$injector', 'invoke', 'push', configBlocks);
-
-        /** @type {angular.Module} */
-        var moduleInstance = {
-          // Private state
-          _invokeQueue: invokeQueue,
-          _configBlocks: configBlocks,
-          _runBlocks: runBlocks,
-
-          /**
-           * @ngdoc property
-           * @name angular.Module#requires
-           * @module ng
-           *
-           * @description
-           * Holds the list of modules which the injector will load before the current module is
-           * loaded.
-           */
-          requires: requires,
-
-          /**
-           * @ngdoc property
-           * @name angular.Module#name
-           * @module ng
-           *
-           * @description
-           * Name of the module.
-           */
-          name: name,
-
-
-          /**
-           * @ngdoc method
-           * @name angular.Module#provider
-           * @module ng
-           * @param {string} name service name
-           * @param {Function} providerType Construction function for creating new instance of the
-           *                                service.
-           * @description
-           * See {@link auto.$provide#provider $provide.provider()}.
-           */
-          provider: invokeLaterAndSetModuleName('$provide', 'provider'),
-
-          /**
-           * @ngdoc method
-           * @name angular.Module#factory
-           * @module ng
-           * @param {string} name service name
-           * @param {Function} providerFunction Function for creating new instance of the service.
-           * @description
-           * See {@link auto.$provide#factory $provide.factory()}.
-           */
-          factory: invokeLaterAndSetModuleName('$provide', 'factory'),
-
-          /**
-           * @ngdoc method
-           * @name angular.Module#service
-           * @module ng
-           * @param {string} name service name
-           * @param {Function} constructor A constructor function that will be instantiated.
-           * @description
-           * See {@link auto.$provide#service $provide.service()}.
-           */
-          service: invokeLaterAndSetModuleName('$provide', 'service'),
-
-          /**
-           * @ngdoc method
-           * @name angular.Module#value
-           * @module ng
-           * @param {string} name service name
-           * @param {*} object Service instance object.
-           * @description
-           * See {@link auto.$provide#value $provide.value()}.
-           */
-          value: invokeLater('$provide', 'value'),
-
-          /**
-           * @ngdoc method
-           * @name angular.Module#constant
-           * @module ng
-           * @param {string} name constant name
-           * @param {*} object Constant value.
-           * @description
-           * Because the constant are fixed, they get applied before other provide methods.
-           * See {@link auto.$provide#constant $provide.constant()}.
-           */
-          constant: invokeLater('$provide', 'constant', 'unshift'),
-
-           /**
-           * @ngdoc method
-           * @name angular.Module#decorator
-           * @module ng
-           * @param {string} The name of the service to decorate.
-           * @param {Function} This function will be invoked when the service needs to be
-           *                                    instantiated and should return the decorated service instance.
-           * @description
-           * See {@link auto.$provide#decorator $provide.decorator()}.
-           */
-          decorator: invokeLaterAndSetModuleName('$provide', 'decorator'),
-
-          /**
-           * @ngdoc method
-           * @name angular.Module#animation
-           * @module ng
-           * @param {string} name animation name
-           * @param {Function} animationFactory Factory function for creating new instance of an
-           *                                    animation.
-           * @description
-           *
-           * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.
-           *
-           *
-           * Defines an animation hook that can be later used with
-           * {@link $animate $animate} service and directives that use this service.
-           *
-           * ```js
-           * module.animation('.animation-name', function($inject1, $inject2) {
-           *   return {
-           *     eventName : function(element, done) {
-           *       //code to run the animation
-           *       //once complete, then run done()
-           *       return function cancellationFunction(element) {
-           *         //code to cancel the animation
-           *       }
-           *     }
-           *   }
-           * })
-           * ```
-           *
-           * See {@link ng.$animateProvider#register $animateProvider.register()} and
-           * {@link ngAnimate ngAnimate module} for more information.
-           */
-          animation: invokeLaterAndSetModuleName('$animateProvider', 'register'),
-
-          /**
-           * @ngdoc method
-           * @name angular.Module#filter
-           * @module ng
-           * @param {string} name Filter name - this must be a valid angular expression identifier
-           * @param {Function} filterFactory Factory function for creating new instance of filter.
-           * @description
-           * See {@link ng.$filterProvider#register $filterProvider.register()}.
-           *
-           * <div class="alert alert-warning">
-           * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.
-           * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace
-           * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores
-           * (`myapp_subsection_filterx`).
-           * </div>
-           */
-          filter: invokeLaterAndSetModuleName('$filterProvider', 'register'),
-
-          /**
-           * @ngdoc method
-           * @name angular.Module#controller
-           * @module ng
-           * @param {string|Object} name Controller name, or an object map of controllers where the
-           *    keys are the names and the values are the constructors.
-           * @param {Function} constructor Controller constructor function.
-           * @description
-           * See {@link ng.$controllerProvider#register $controllerProvider.register()}.
-           */
-          controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'),
-
-          /**
-           * @ngdoc method
-           * @name angular.Module#directive
-           * @module ng
-           * @param {string|Object} name Directive name, or an object map of directives where the
-           *    keys are the names and the values are the factories.
-           * @param {Function} directiveFactory Factory function for creating new instance of
-           * directives.
-           * @description
-           * See {@link ng.$compileProvider#directive $compileProvider.directive()}.
-           */
-          directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),
-
-          /**
-           * @ngdoc method
-           * @name angular.Module#config
-           * @module ng
-           * @param {Function} configFn Execute this function on module load. Useful for service
-           *    configuration.
-           * @description
-           * Use this method to register work which needs to be performed on module loading.
-           * For more about how to configure services, see
-           * {@link providers#provider-recipe Provider Recipe}.
-           */
-          config: config,
-
-          /**
-           * @ngdoc method
-           * @name angular.Module#run
-           * @module ng
-           * @param {Function} initializationFn Execute this function after injector creation.
-           *    Useful for application initialization.
-           * @description
-           * Use this method to register work which should be performed when the injector is done
-           * loading all modules.
-           */
-          run: function(block) {
-            runBlocks.push(block);
-            return this;
-          }
-        };
-
-        if (configFn) {
-          config(configFn);
-        }
-
-        return moduleInstance;
-
-        /**
-         * @param {string} provider
-         * @param {string} method
-         * @param {String=} insertMethod
-         * @returns {angular.Module}
-         */
-        function invokeLater(provider, method, insertMethod, queue) {
-          if (!queue) queue = invokeQueue;
-          return function() {
-            queue[insertMethod || 'push']([provider, method, arguments]);
-            return moduleInstance;
-          };
-        }
-
-        /**
-         * @param {string} provider
-         * @param {string} method
-         * @returns {angular.Module}
-         */
-        function invokeLaterAndSetModuleName(provider, method) {
-          return function(recipeName, factoryFunction) {
-            if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;
-            invokeQueue.push([provider, method, arguments]);
-            return moduleInstance;
-          };
-        }
-      });
-    };
-  });
-
-}
-
-/* global: toDebugString: true */
-
-function serializeObject(obj) {
-  var seen = [];
-
-  return JSON.stringify(obj, function(key, val) {
-    val = toJsonReplacer(key, val);
-    if (isObject(val)) {
-
-      if (seen.indexOf(val) >= 0) return '...';
-
-      seen.push(val);
-    }
-    return val;
-  });
-}
-
-function toDebugString(obj) {
-  if (typeof obj === 'function') {
-    return obj.toString().replace(/ \{[\s\S]*$/, '');
-  } else if (isUndefined(obj)) {
-    return 'undefined';
-  } else if (typeof obj !== 'string') {
-    return serializeObject(obj);
-  }
-  return obj;
-}
-
-/* global angularModule: true,
-  version: true,
-
-  $CompileProvider,
-
-  htmlAnchorDirective,
-  inputDirective,
-  inputDirective,
-  formDirective,
-  scriptDirective,
-  selectDirective,
-  styleDirective,
-  optionDirective,
-  ngBindDirective,
-  ngBindHtmlDirective,
-  ngBindTemplateDirective,
-  ngClassDirective,
-  ngClassEvenDirective,
-  ngClassOddDirective,
-  ngCloakDirective,
-  ngControllerDirective,
-  ngFormDirective,
-  ngHideDirective,
-  ngIfDirective,
-  ngIncludeDirective,
-  ngIncludeFillContentDirective,
-  ngInitDirective,
-  ngNonBindableDirective,
-  ngPluralizeDirective,
-  ngRepeatDirective,
-  ngShowDirective,
-  ngStyleDirective,
-  ngSwitchDirective,
-  ngSwitchWhenDirective,
-  ngSwitchDefaultDirective,
-  ngOptionsDirective,
-  ngTranscludeDirective,
-  ngModelDirective,
-  ngListDirective,
-  ngChangeDirective,
-  patternDirective,
-  patternDirective,
-  requiredDirective,
-  requiredDirective,
-  minlengthDirective,
-  minlengthDirective,
-  maxlengthDirective,
-  maxlengthDirective,
-  ngValueDirective,
-  ngModelOptionsDirective,
-  ngAttributeAliasDirectives,
-  ngEventDirectives,
-
-  $AnchorScrollProvider,
-  $AnimateProvider,
-  $CoreAnimateCssProvider,
-  $$CoreAnimateQueueProvider,
-  $$CoreAnimateRunnerProvider,
-  $BrowserProvider,
-  $CacheFactoryProvider,
-  $ControllerProvider,
-  $DocumentProvider,
-  $ExceptionHandlerProvider,
-  $FilterProvider,
-  $$ForceReflowProvider,
-  $InterpolateProvider,
-  $IntervalProvider,
-  $$HashMapProvider,
-  $HttpProvider,
-  $HttpParamSerializerProvider,
-  $HttpParamSerializerJQLikeProvider,
-  $HttpBackendProvider,
-  $xhrFactoryProvider,
-  $LocationProvider,
-  $LogProvider,
-  $ParseProvider,
-  $RootScopeProvider,
-  $QProvider,
-  $$QProvider,
-  $$SanitizeUriProvider,
-  $SceProvider,
-  $SceDelegateProvider,
-  $SnifferProvider,
-  $TemplateCacheProvider,
-  $TemplateRequestProvider,
-  $$TestabilityProvider,
-  $TimeoutProvider,
-  $$RAFProvider,
-  $WindowProvider,
-  $$jqLiteProvider,
-  $$CookieReaderProvider
-*/
-
-
-/**
- * @ngdoc object
- * @name angular.version
- * @module ng
- * @description
- * An object that contains information about the current AngularJS version.
- *
- * This object has the following properties:
- *
- * - `full` – `{string}` – Full version string, such as "0.9.18".
- * - `major` – `{number}` – Major version number, such as "0".
- * - `minor` – `{number}` – Minor version number, such as "9".
- * - `dot` – `{number}` – Dot version number, such as "18".
- * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
- */
-var version = {
-  full: '1.4.7',    // all of these placeholder strings will be replaced by grunt's
-  major: 1,    // package task
-  minor: 4,
-  dot: 7,
-  codeName: 'dark-luminescence'
-};
-
-
-function publishExternalAPI(angular) {
-  extend(angular, {
-    'bootstrap': bootstrap,
-    'copy': copy,
-    'extend': extend,
-    'merge': merge,
-    'equals': equals,
-    'element': jqLite,
-    'forEach': forEach,
-    'injector': createInjector,
-    'noop': noop,
-    'bind': bind,
-    'toJson': toJson,
-    'fromJson': fromJson,
-    'identity': identity,
-    'isUndefined': isUndefined,
-    'isDefined': isDefined,
-    'isString': isString,
-    'isFunction': isFunction,
-    'isObject': isObject,
-    'isNumber': isNumber,
-    'isElement': isElement,
-    'isArray': isArray,
-    'version': version,
-    'isDate': isDate,
-    'lowercase': lowercase,
-    'uppercase': uppercase,
-    'callbacks': {counter: 0},
-    'getTestability': getTestability,
-    '$$minErr': minErr,
-    '$$csp': csp,
-    'reloadWithDebugInfo': reloadWithDebugInfo
-  });
-
-  angularModule = setupModuleLoader(window);
-
-  angularModule('ng', ['ngLocale'], ['$provide',
-    function ngModule($provide) {
-      // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
-      $provide.provider({
-        $$sanitizeUri: $$SanitizeUriProvider
-      });
-      $provide.provider('$compile', $CompileProvider).
-        directive({
-            a: htmlAnchorDirective,
-            input: inputDirective,
-            textarea: inputDirective,
-            form: formDirective,
-            script: scriptDirective,
-            select: selectDirective,
-            style: styleDirective,
-            option: optionDirective,
-            ngBind: ngBindDirective,
-            ngBindHtml: ngBindHtmlDirective,
-            ngBindTemplate: ngBindTemplateDirective,
-            ngClass: ngClassDirective,
-            ngClassEven: ngClassEvenDirective,
-            ngClassOdd: ngClassOddDirective,
-            ngCloak: ngCloakDirective,
-            ngController: ngControllerDirective,
-            ngForm: ngFormDirective,
-            ngHide: ngHideDirective,
-            ngIf: ngIfDirective,
-            ngInclude: ngIncludeDirective,
-            ngInit: ngInitDirective,
-            ngNonBindable: ngNonBindableDirective,
-            ngPluralize: ngPluralizeDirective,
-            ngRepeat: ngRepeatDirective,
-            ngShow: ngShowDirective,
-            ngStyle: ngStyleDirective,
-            ngSwitch: ngSwitchDirective,
-            ngSwitchWhen: ngSwitchWhenDirective,
-            ngSwitchDefault: ngSwitchDefaultDirective,
-            ngOptions: ngOptionsDirective,
-            ngTransclude: ngTranscludeDirective,
-            ngModel: ngModelDirective,
-            ngList: ngListDirective,
-            ngChange: ngChangeDirective,
-            pattern: patternDirective,
-            ngPattern: patternDirective,
-            required: requiredDirective,
-            ngRequired: requiredDirective,
-            minlength: minlengthDirective,
-            ngMinlength: minlengthDirective,
-            maxlength: maxlengthDirective,
-            ngMaxlength: maxlengthDirective,
-            ngValue: ngValueDirective,
-            ngModelOptions: ngModelOptionsDirective
-        }).
-        directive({
-          ngInclude: ngIncludeFillContentDirective
-        }).
-        directive(ngAttributeAliasDirectives).
-        directive(ngEventDirectives);
-      $provide.provider({
-        $anchorScroll: $AnchorScrollProvider,
-        $animate: $AnimateProvider,
-        $animateCss: $CoreAnimateCssProvider,
-        $$animateQueue: $$CoreAnimateQueueProvider,
-        $$AnimateRunner: $$CoreAnimateRunnerProvider,
-        $browser: $BrowserProvider,
-        $cacheFactory: $CacheFactoryProvider,
-        $controller: $ControllerProvider,
-        $document: $DocumentProvider,
-        $exceptionHandler: $ExceptionHandlerProvider,
-        $filter: $FilterProvider,
-        $$forceReflow: $$ForceReflowProvider,
-        $interpolate: $InterpolateProvider,
-        $interval: $IntervalProvider,
-        $http: $HttpProvider,
-        $httpParamSerializer: $HttpParamSerializerProvider,
-        $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider,
-        $httpBackend: $HttpBackendProvider,
-        $xhrFactory: $xhrFactoryProvider,
-        $location: $LocationProvider,
-        $log: $LogProvider,
-        $parse: $ParseProvider,
-        $rootScope: $RootScopeProvider,
-        $q: $QProvider,
-        $$q: $$QProvider,
-        $sce: $SceProvider,
-        $sceDelegate: $SceDelegateProvider,
-        $sniffer: $SnifferProvider,
-        $templateCache: $TemplateCacheProvider,
-        $templateRequest: $TemplateRequestProvider,
-        $$testability: $$TestabilityProvider,
-        $timeout: $TimeoutProvider,
-        $window: $WindowProvider,
-        $$rAF: $$RAFProvider,
-        $$jqLite: $$jqLiteProvider,
-        $$HashMap: $$HashMapProvider,
-        $$cookieReader: $$CookieReaderProvider
-      });
-    }
-  ]);
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *     Any commits to this file should be reviewed with security in mind.  *
- *   Changes to this file can potentially create security vulnerabilities. *
- *          An approval from 2 Core members with history of modifying      *
- *                         this file is required.                          *
- *                                                                         *
- *  Does the change somehow allow for arbitrary javascript to be executed? *
- *    Or allows for someone to change the prototype of built-in objects?   *
- *     Or gives undesired access to variables likes document or window?    *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* global JQLitePrototype: true,
-  addEventListenerFn: true,
-  removeEventListenerFn: true,
-  BOOLEAN_ATTR: true,
-  ALIASED_ATTR: true,
-*/
-
-//////////////////////////////////
-//JQLite
-//////////////////////////////////
-
-/**
- * @ngdoc function
- * @name angular.element
- * @module ng
- * @kind function
- *
- * @description
- * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.
- *
- * If jQuery is available, `angular.element` is an alias for the
- * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`
- * delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite."
- *
- * <div class="alert alert-success">jqLite is a tiny, API-compatible subset of jQuery that allows
- * Angular to manipulate the DOM in a cross-browser compatible way. **jqLite** implements only the most
- * commonly needed functionality with the goal of having a very small footprint.</div>
- *
- * To use `jQuery`, simply ensure it is loaded before the `angular.js` file.
- *
- * <div class="alert">**Note:** all element references in Angular are always wrapped with jQuery or
- * jqLite; they are never raw DOM references.</div>
- *
- * ## Angular's jqLite
- * jqLite provides only the following jQuery methods:
- *
- * - [`addClass()`](http://api.jquery.com/addClass/)
- * - [`after()`](http://api.jquery.com/after/)
- * - [`append()`](http://api.jquery.com/append/)
- * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters
- * - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData
- * - [`children()`](http://api.jquery.com/children/) - Does not support selectors
- * - [`clone()`](http://api.jquery.com/clone/)
- * - [`contents()`](http://api.jquery.com/contents/)
- * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`. As a setter, does not convert numbers to strings or append 'px'.
- * - [`data()`](http://api.jquery.com/data/)
- * - [`detach()`](http://api.jquery.com/detach/)
- * - [`empty()`](http://api.jquery.com/empty/)
- * - [`eq()`](http://api.jquery.com/eq/)
- * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name
- * - [`hasClass()`](http://api.jquery.com/hasClass/)
- * - [`html()`](http://api.jquery.com/html/)
- * - [`next()`](http://api.jquery.com/next/) - Does not support selectors
- * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData
- * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces, selectors or event object as parameter
- * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors
- * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors
- * - [`prepend()`](http://api.jquery.com/prepend/)
- * - [`prop()`](http://api.jquery.com/prop/)
- * - [`ready()`](http://api.jquery.com/ready/)
- * - [`remove()`](http://api.jquery.com/remove/)
- * - [`removeAttr()`](http://api.jquery.com/removeAttr/)
- * - [`removeClass()`](http://api.jquery.com/removeClass/)
- * - [`removeData()`](http://api.jquery.com/removeData/)
- * - [`replaceWith()`](http://api.jquery.com/replaceWith/)
- * - [`text()`](http://api.jquery.com/text/)
- * - [`toggleClass()`](http://api.jquery.com/toggleClass/)
- * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers.
- * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces or event object as parameter
- * - [`val()`](http://api.jquery.com/val/)
- * - [`wrap()`](http://api.jquery.com/wrap/)
- *
- * ## jQuery/jqLite Extras
- * Angular also provides the following additional methods and events to both jQuery and jqLite:
- *
- * ### Events
- * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event
- *    on all DOM nodes being removed.  This can be used to clean up any 3rd party bindings to the DOM
- *    element before it is removed.
- *
- * ### Methods
- * - `controller(name)` - retrieves the controller of the current element or its parent. By default
- *   retrieves controller associated with the `ngController` directive. If `name` is provided as
- *   camelCase directive name, then the controller for this directive will be retrieved (e.g.
- *   `'ngModel'`).
- * - `injector()` - retrieves the injector of the current element or its parent.
- * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current
- *   element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to
- *   be enabled.
- * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the
- *   current element. This getter should be used only on elements that contain a directive which starts a new isolate
- *   scope. Calling `scope()` on this element always returns the original non-isolate scope.
- *   Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.
- * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top
- *   parent element is reached.
- *
- * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.
- * @returns {Object} jQuery object.
- */
-
-JQLite.expando = 'ng339';
-
-var jqCache = JQLite.cache = {},
-    jqId = 1,
-    addEventListenerFn = function(element, type, fn) {
-      element.addEventListener(type, fn, false);
-    },
-    removeEventListenerFn = function(element, type, fn) {
-      element.removeEventListener(type, fn, false);
-    };
-
-/*
- * !!! This is an undocumented "private" function !!!
- */
-JQLite._data = function(node) {
-  //jQuery always returns an object on cache miss
-  return this.cache[node[this.expando]] || {};
-};
-
-function jqNextId() { return ++jqId; }
-
-
-var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
-var MOZ_HACK_REGEXP = /^moz([A-Z])/;
-var MOUSE_EVENT_MAP= { mouseleave: "mouseout", mouseenter: "mouseover"};
-var jqLiteMinErr = minErr('jqLite');
-
-/**
- * Converts snake_case to camelCase.
- * Also there is special case for Moz prefix starting with upper case letter.
- * @param name Name to normalize
- */
-function camelCase(name) {
-  return name.
-    replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
-      return offset ? letter.toUpperCase() : letter;
-    }).
-    replace(MOZ_HACK_REGEXP, 'Moz$1');
-}
-
-var SINGLE_TAG_REGEXP = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/;
-var HTML_REGEXP = /<|&#?\w+;/;
-var TAG_NAME_REGEXP = /<([\w:-]+)/;
-var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi;
-
-var wrapMap = {
-  'option': [1, '<select multiple="multiple">', '</select>'],
-
-  'thead': [1, '<table>', '</table>'],
-  'col': [2, '<table><colgroup>', '</colgroup></table>'],
-  'tr': [2, '<table><tbody>', '</tbody></table>'],
-  'td': [3, '<table><tbody><tr>', '</tr></tbody></table>'],
-  '_default': [0, "", ""]
-};
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-
-function jqLiteIsTextNode(html) {
-  return !HTML_REGEXP.test(html);
-}
-
-function jqLiteAcceptsData(node) {
-  // The window object can accept data but has no nodeType
-  // Otherwise we are only interested in elements (1) and documents (9)
-  var nodeType = node.nodeType;
-  return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;
-}
-
-function jqLiteHasData(node) {
-  for (var key in jqCache[node.ng339]) {
-    return true;
-  }
-  return false;
-}
-
-function jqLiteBuildFragment(html, context) {
-  var tmp, tag, wrap,
-      fragment = context.createDocumentFragment(),
-      nodes = [], i;
-
-  if (jqLiteIsTextNode(html)) {
-    // Convert non-html into a text node
-    nodes.push(context.createTextNode(html));
-  } else {
-    // Convert html into DOM nodes
-    tmp = tmp || fragment.appendChild(context.createElement("div"));
-    tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase();
-    wrap = wrapMap[tag] || wrapMap._default;
-    tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1></$2>") + wrap[2];
-
-    // Descend through wrappers to the right content
-    i = wrap[0];
-    while (i--) {
-      tmp = tmp.lastChild;
-    }
-
-    nodes = concat(nodes, tmp.childNodes);
-
-    tmp = fragment.firstChild;
-    tmp.textContent = "";
-  }
-
-  // Remove wrapper from fragment
-  fragment.textContent = "";
-  fragment.innerHTML = ""; // Clear inner HTML
-  forEach(nodes, function(node) {
-    fragment.appendChild(node);
-  });
-
-  return fragment;
-}
-
-function jqLiteParseHTML(html, context) {
-  context = context || document;
-  var parsed;
-
-  if ((parsed = SINGLE_TAG_REGEXP.exec(html))) {
-    return [context.createElement(parsed[1])];
-  }
-
-  if ((parsed = jqLiteBuildFragment(html, context))) {
-    return parsed.childNodes;
-  }
-
-  return [];
-}
-
-/////////////////////////////////////////////
-function JQLite(element) {
-  if (element instanceof JQLite) {
-    return element;
-  }
-
-  var argIsString;
-
-  if (isString(element)) {
-    element = trim(element);
-    argIsString = true;
-  }
-  if (!(this instanceof JQLite)) {
-    if (argIsString && element.charAt(0) != '<') {
-      throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');
-    }
-    return new JQLite(element);
-  }
-
-  if (argIsString) {
-    jqLiteAddNodes(this, jqLiteParseHTML(element));
-  } else {
-    jqLiteAddNodes(this, element);
-  }
-}
-
-function jqLiteClone(element) {
-  return element.cloneNode(true);
-}
-
-function jqLiteDealoc(element, onlyDescendants) {
-  if (!onlyDescendants) jqLiteRemoveData(element);
-
-  if (element.querySelectorAll) {
-    var descendants = element.querySelectorAll('*');
-    for (var i = 0, l = descendants.length; i < l; i++) {
-      jqLiteRemoveData(descendants[i]);
-    }
-  }
-}
-
-function jqLiteOff(element, type, fn, unsupported) {
-  if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
-
-  var expandoStore = jqLiteExpandoStore(element);
-  var events = expandoStore && expandoStore.events;
-  var handle = expandoStore && expandoStore.handle;
-
-  if (!handle) return; //no listeners registered
-
-  if (!type) {
-    for (type in events) {
-      if (type !== '$destroy') {
-        removeEventListenerFn(element, type, handle);
-      }
-      delete events[type];
-    }
-  } else {
-    forEach(type.split(' '), function(type) {
-      if (isDefined(fn)) {
-        var listenerFns = events[type];
-        arrayRemove(listenerFns || [], fn);
-        if (listenerFns && listenerFns.length > 0) {
-          return;
-        }
-      }
-
-      removeEventListenerFn(element, type, handle);
-      delete events[type];
-    });
-  }
-}
-
-function jqLiteRemoveData(element, name) {
-  var expandoId = element.ng339;
-  var expandoStore = expandoId && jqCache[expandoId];
-
-  if (expandoStore) {
-    if (name) {
-      delete expandoStore.data[name];
-      return;
-    }
-
-    if (expandoStore.handle) {
-      if (expandoStore.events.$destroy) {
-        expandoStore.handle({}, '$destroy');
-      }
-      jqLiteOff(element);
-    }
-    delete jqCache[expandoId];
-    element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it
-  }
-}
-
-
-function jqLiteExpandoStore(element, createIfNecessary) {
-  var expandoId = element.ng339,
-      expandoStore = expandoId && jqCache[expandoId];
-
-  if (createIfNecessary && !expandoStore) {
-    element.ng339 = expandoId = jqNextId();
-    expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined};
-  }
-
-  return expandoStore;
-}
-
-
-function jqLiteData(element, key, value) {
-  if (jqLiteAcceptsData(element)) {
-
-    var isSimpleSetter = isDefined(value);
-    var isSimpleGetter = !isSimpleSetter && key && !isObject(key);
-    var massGetter = !key;
-    var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);
-    var data = expandoStore && expandoStore.data;
-
-    if (isSimpleSetter) { // data('key', value)
-      data[key] = value;
-    } else {
-      if (massGetter) {  // data()
-        return data;
-      } else {
-        if (isSimpleGetter) { // data('key')
-          // don't force creation of expandoStore if it doesn't exist yet
-          return data && data[key];
-        } else { // mass-setter: data({key1: val1, key2: val2})
-          extend(data, key);
-        }
-      }
-    }
-  }
-}
-
-function jqLiteHasClass(element, selector) {
-  if (!element.getAttribute) return false;
-  return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " ").
-      indexOf(" " + selector + " ") > -1);
-}
-
-function jqLiteRemoveClass(element, cssClasses) {
-  if (cssClasses && element.setAttribute) {
-    forEach(cssClasses.split(' '), function(cssClass) {
-      element.setAttribute('class', trim(
-          (" " + (element.getAttribute('class') || '') + " ")
-          .replace(/[\n\t]/g, " ")
-          .replace(" " + trim(cssClass) + " ", " "))
-      );
-    });
-  }
-}
-
-function jqLiteAddClass(element, cssClasses) {
-  if (cssClasses && element.setAttribute) {
-    var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')
-                            .replace(/[\n\t]/g, " ");
-
-    forEach(cssClasses.split(' '), function(cssClass) {
-      cssClass = trim(cssClass);
-      if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {
-        existingClasses += cssClass + ' ';
-      }
-    });
-
-    element.setAttribute('class', trim(existingClasses));
-  }
-}
-
-
-function jqLiteAddNodes(root, elements) {
-  // THIS CODE IS VERY HOT. Don't make changes without benchmarking.
-
-  if (elements) {
-
-    // if a Node (the most common case)
-    if (elements.nodeType) {
-      root[root.length++] = elements;
-    } else {
-      var length = elements.length;
-
-      // if an Array or NodeList and not a Window
-      if (typeof length === 'number' && elements.window !== elements) {
-        if (length) {
-          for (var i = 0; i < length; i++) {
-            root[root.length++] = elements[i];
-          }
-        }
-      } else {
-        root[root.length++] = elements;
-      }
-    }
-  }
-}
-
-
-function jqLiteController(element, name) {
-  return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller');
-}
-
-function jqLiteInheritedData(element, name, value) {
-  // if element is the document object work with the html element instead
-  // this makes $(document).scope() possible
-  if (element.nodeType == NODE_TYPE_DOCUMENT) {
-    element = element.documentElement;
-  }
-  var names = isArray(name) ? name : [name];
-
-  while (element) {
-    for (var i = 0, ii = names.length; i < ii; i++) {
-      if (isDefined(value = jqLite.data(element, names[i]))) return value;
-    }
-
-    // If dealing with a document fragment node with a host element, and no parent, use the host
-    // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM
-    // to lookup parent controllers.
-    element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);
-  }
-}
-
-function jqLiteEmpty(element) {
-  jqLiteDealoc(element, true);
-  while (element.firstChild) {
-    element.removeChild(element.firstChild);
-  }
-}
-
-function jqLiteRemove(element, keepData) {
-  if (!keepData) jqLiteDealoc(element);
-  var parent = element.parentNode;
-  if (parent) parent.removeChild(element);
-}
-
-
-function jqLiteDocumentLoaded(action, win) {
-  win = win || window;
-  if (win.document.readyState === 'complete') {
-    // Force the action to be run async for consistent behaviour
-    // from the action's point of view
-    // i.e. it will definitely not be in a $apply
-    win.setTimeout(action);
-  } else {
-    // No need to unbind this handler as load is only ever called once
-    jqLite(win).on('load', action);
-  }
-}
-
-//////////////////////////////////////////
-// Functions which are declared directly.
-//////////////////////////////////////////
-var JQLitePrototype = JQLite.prototype = {
-  ready: function(fn) {
-    var fired = false;
-
-    function trigger() {
-      if (fired) return;
-      fired = true;
-      fn();
-    }
-
-    // check if document is already loaded
-    if (document.readyState === 'complete') {
-      setTimeout(trigger);
-    } else {
-      this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9
-      // we can not use jqLite since we are not done loading and jQuery could be loaded later.
-      // jshint -W064
-      JQLite(window).on('load', trigger); // fallback to window.onload for others
-      // jshint +W064
-    }
-  },
-  toString: function() {
-    var value = [];
-    forEach(this, function(e) { value.push('' + e);});
-    return '[' + value.join(', ') + ']';
-  },
-
-  eq: function(index) {
-      return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);
-  },
-
-  length: 0,
-  push: push,
-  sort: [].sort,
-  splice: [].splice
-};
-
-//////////////////////////////////////////
-// Functions iterating getter/setters.
-// these functions return self on setter and
-// value on get.
-//////////////////////////////////////////
-var BOOLEAN_ATTR = {};
-forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) {
-  BOOLEAN_ATTR[lowercase(value)] = value;
-});
-var BOOLEAN_ELEMENTS = {};
-forEach('input,select,option,textarea,button,form,details'.split(','), function(value) {
-  BOOLEAN_ELEMENTS[value] = true;
-});
-var ALIASED_ATTR = {
-  'ngMinlength': 'minlength',
-  'ngMaxlength': 'maxlength',
-  'ngMin': 'min',
-  'ngMax': 'max',
-  'ngPattern': 'pattern'
-};
-
-function getBooleanAttrName(element, name) {
-  // check dom last since we will most likely fail on name
-  var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];
-
-  // booleanAttr is here twice to minimize DOM access
-  return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;
-}
-
-function getAliasedAttrName(name) {
-  return ALIASED_ATTR[name];
-}
-
-forEach({
-  data: jqLiteData,
-  removeData: jqLiteRemoveData,
-  hasData: jqLiteHasData
-}, function(fn, name) {
-  JQLite[name] = fn;
-});
-
-forEach({
-  data: jqLiteData,
-  inheritedData: jqLiteInheritedData,
-
-  scope: function(element) {
-    // Can't use jqLiteData here directly so we stay compatible with jQuery!
-    return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);
-  },
-
-  isolateScope: function(element) {
-    // Can't use jqLiteData here directly so we stay compatible with jQuery!
-    return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');
-  },
-
-  controller: jqLiteController,
-
-  injector: function(element) {
-    return jqLiteInheritedData(element, '$injector');
-  },
-
-  removeAttr: function(element, name) {
-    element.removeAttribute(name);
-  },
-
-  hasClass: jqLiteHasClass,
-
-  css: function(element, name, value) {
-    name = camelCase(name);
-
-    if (isDefined(value)) {
-      element.style[name] = value;
-    } else {
-      return element.style[name];
-    }
-  },
-
-  attr: function(element, name, value) {
-    var nodeType = element.nodeType;
-    if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT) {
-      return;
-    }
-    var lowercasedName = lowercase(name);
-    if (BOOLEAN_ATTR[lowercasedName]) {
-      if (isDefined(value)) {
-        if (!!value) {
-          element[name] = true;
-          element.setAttribute(name, lowercasedName);
-        } else {
-          element[name] = false;
-          element.removeAttribute(lowercasedName);
-        }
-      } else {
-        return (element[name] ||
-                 (element.attributes.getNamedItem(name) || noop).specified)
-               ? lowercasedName
-               : undefined;
-      }
-    } else if (isDefined(value)) {
-      element.setAttribute(name, value);
-    } else if (element.getAttribute) {
-      // the extra argument "2" is to get the right thing for a.href in IE, see jQuery code
-      // some elements (e.g. Document) don't have get attribute, so return undefined
-      var ret = element.getAttribute(name, 2);
-      // normalize non-existing attributes to undefined (as jQuery)
-      return ret === null ? undefined : ret;
-    }
-  },
-
-  prop: function(element, name, value) {
-    if (isDefined(value)) {
-      element[name] = value;
-    } else {
-      return element[name];
-    }
-  },
-
-  text: (function() {
-    getText.$dv = '';
-    return getText;
-
-    function getText(element, value) {
-      if (isUndefined(value)) {
-        var nodeType = element.nodeType;
-        return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : '';
-      }
-      element.textContent = value;
-    }
-  })(),
-
-  val: function(element, value) {
-    if (isUndefined(value)) {
-      if (element.multiple && nodeName_(element) === 'select') {
-        var result = [];
-        forEach(element.options, function(option) {
-          if (option.selected) {
-            result.push(option.value || option.text);
-          }
-        });
-        return result.length === 0 ? null : result;
-      }
-      return element.value;
-    }
-    element.value = value;
-  },
-
-  html: function(element, value) {
-    if (isUndefined(value)) {
-      return element.innerHTML;
-    }
-    jqLiteDealoc(element, true);
-    element.innerHTML = value;
-  },
-
-  empty: jqLiteEmpty
-}, function(fn, name) {
-  /**
-   * Properties: writes return selection, reads return first value
-   */
-  JQLite.prototype[name] = function(arg1, arg2) {
-    var i, key;
-    var nodeCount = this.length;
-
-    // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it
-    // in a way that survives minification.
-    // jqLiteEmpty takes no arguments but is a setter.
-    if (fn !== jqLiteEmpty &&
-        (isUndefined((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) {
-      if (isObject(arg1)) {
-
-        // we are a write, but the object properties are the key/values
-        for (i = 0; i < nodeCount; i++) {
-          if (fn === jqLiteData) {
-            // data() takes the whole object in jQuery
-            fn(this[i], arg1);
-          } else {
-            for (key in arg1) {
-              fn(this[i], key, arg1[key]);
-            }
-          }
-        }
-        // return self for chaining
-        return this;
-      } else {
-        // we are a read, so read the first child.
-        // TODO: do we still need this?
-        var value = fn.$dv;
-        // Only if we have $dv do we iterate over all, otherwise it is just the first element.
-        var jj = (isUndefined(value)) ? Math.min(nodeCount, 1) : nodeCount;
-        for (var j = 0; j < jj; j++) {
-          var nodeValue = fn(this[j], arg1, arg2);
-          value = value ? value + nodeValue : nodeValue;
-        }
-        return value;
-      }
-    } else {
-      // we are a write, so apply to all children
-      for (i = 0; i < nodeCount; i++) {
-        fn(this[i], arg1, arg2);
-      }
-      // return self for chaining
-      return this;
-    }
-  };
-});
-
-function createEventHandler(element, events) {
-  var eventHandler = function(event, type) {
-    // jQuery specific api
-    event.isDefaultPrevented = function() {
-      return event.defaultPrevented;
-    };
-
-    var eventFns = events[type || event.type];
-    var eventFnsLength = eventFns ? eventFns.length : 0;
-
-    if (!eventFnsLength) return;
-
-    if (isUndefined(event.immediatePropagationStopped)) {
-      var originalStopImmediatePropagation = event.stopImmediatePropagation;
-      event.stopImmediatePropagation = function() {
-        event.immediatePropagationStopped = true;
-
-        if (event.stopPropagation) {
-          event.stopPropagation();
-        }
-
-        if (originalStopImmediatePropagation) {
-          originalStopImmediatePropagation.call(event);
-        }
-      };
-    }
-
-    event.isImmediatePropagationStopped = function() {
-      return event.immediatePropagationStopped === true;
-    };
-
-    // Copy event handlers in case event handlers array is modified during execution.
-    if ((eventFnsLength > 1)) {
-      eventFns = shallowCopy(eventFns);
-    }
-
-    for (var i = 0; i < eventFnsLength; i++) {
-      if (!event.isImmediatePropagationStopped()) {
-        eventFns[i].call(element, event);
-      }
-    }
-  };
-
-  // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all
-  //       events on `element`
-  eventHandler.elem = element;
-  return eventHandler;
-}
-
-//////////////////////////////////////////
-// Functions iterating traversal.
-// These functions chain results into a single
-// selector.
-//////////////////////////////////////////
-forEach({
-  removeData: jqLiteRemoveData,
-
-  on: function jqLiteOn(element, type, fn, unsupported) {
-    if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');
-
-    // Do not add event handlers to non-elements because they will not be cleaned up.
-    if (!jqLiteAcceptsData(element)) {
-      return;
-    }
-
-    var expandoStore = jqLiteExpandoStore(element, true);
-    var events = expandoStore.events;
-    var handle = expandoStore.handle;
-
-    if (!handle) {
-      handle = expandoStore.handle = createEventHandler(element, events);
-    }
-
-    // http://jsperf.com/string-indexof-vs-split
-    var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];
-    var i = types.length;
-
-    while (i--) {
-      type = types[i];
-      var eventFns = events[type];
-
-      if (!eventFns) {
-        events[type] = [];
-
-        if (type === 'mouseenter' || type === 'mouseleave') {
-          // Refer to jQuery's implementation of mouseenter & mouseleave
-          // Read about mouseenter and mouseleave:
-          // http://www.quirksmode.org/js/events_mouse.html#link8
-
-          jqLiteOn(element, MOUSE_EVENT_MAP[type], function(event) {
-            var target = this, related = event.relatedTarget;
-            // For mousenter/leave call the handler if related is outside the target.
-            // NB: No relatedTarget if the mouse left/entered the browser window
-            if (!related || (related !== target && !target.contains(related))) {
-              handle(event, type);
-            }
-          });
-
-        } else {
-          if (type !== '$destroy') {
-            addEventListenerFn(element, type, handle);
-          }
-        }
-        eventFns = events[type];
-      }
-      eventFns.push(fn);
-    }
-  },
-
-  off: jqLiteOff,
-
-  one: function(element, type, fn) {
-    element = jqLite(element);
-
-    //add the listener twice so that when it is called
-    //you can remove the original function and still be
-    //able to call element.off(ev, fn) normally
-    element.on(type, function onFn() {
-      element.off(type, fn);
-      element.off(type, onFn);
-    });
-    element.on(type, fn);
-  },
-
-  replaceWith: function(element, replaceNode) {
-    var index, parent = element.parentNode;
-    jqLiteDealoc(element);
-    forEach(new JQLite(replaceNode), function(node) {
-      if (index) {
-        parent.insertBefore(node, index.nextSibling);
-      } else {
-        parent.replaceChild(node, element);
-      }
-      index = node;
-    });
-  },
-
-  children: function(element) {
-    var children = [];
-    forEach(element.childNodes, function(element) {
-      if (element.nodeType === NODE_TYPE_ELEMENT) {
-        children.push(element);
-      }
-    });
-    return children;
-  },
-
-  contents: function(element) {
-    return element.contentDocument || element.childNodes || [];
-  },
-
-  append: function(element, node) {
-    var nodeType = element.nodeType;
-    if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return;
-
-    node = new JQLite(node);
-
-    for (var i = 0, ii = node.length; i < ii; i++) {
-      var child = node[i];
-      element.appendChild(child);
-    }
-  },
-
-  prepend: function(element, node) {
-    if (element.nodeType === NODE_TYPE_ELEMENT) {
-      var index = element.firstChild;
-      forEach(new JQLite(node), function(child) {
-        element.insertBefore(child, index);
-      });
-    }
-  },
-
-  wrap: function(element, wrapNode) {
-    wrapNode = jqLite(wrapNode).eq(0).clone()[0];
-    var parent = element.parentNode;
-    if (parent) {
-      parent.replaceChild(wrapNode, element);
-    }
-    wrapNode.appendChild(element);
-  },
-
-  remove: jqLiteRemove,
-
-  detach: function(element) {
-    jqLiteRemove(element, true);
-  },
-
-  after: function(element, newElement) {
-    var index = element, parent = element.parentNode;
-    newElement = new JQLite(newElement);
-
-    for (var i = 0, ii = newElement.length; i < ii; i++) {
-      var node = newElement[i];
-      parent.insertBefore(node, index.nextSibling);
-      index = node;
-    }
-  },
-
-  addClass: jqLiteAddClass,
-  removeClass: jqLiteRemoveClass,
-
-  toggleClass: function(element, selector, condition) {
-    if (selector) {
-      forEach(selector.split(' '), function(className) {
-        var classCondition = condition;
-        if (isUndefined(classCondition)) {
-          classCondition = !jqLiteHasClass(element, className);
-        }
-        (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);
-      });
-    }
-  },
-
-  parent: function(element) {
-    var parent = element.parentNode;
-    return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null;
-  },
-
-  next: function(element) {
-    return element.nextElementSibling;
-  },
-
-  find: function(element, selector) {
-    if (element.getElementsByTagName) {
-      return element.getElementsByTagName(selector);
-    } else {
-      return [];
-    }
-  },
-
-  clone: jqLiteClone,
-
-  triggerHandler: function(element, event, extraParameters) {
-
-    var dummyEvent, eventFnsCopy, handlerArgs;
-    var eventName = event.type || event;
-    var expandoStore = jqLiteExpandoStore(element);
-    var events = expandoStore && expandoStore.events;
-    var eventFns = events && events[eventName];
-
-    if (eventFns) {
-      // Create a dummy event to pass to the handlers
-      dummyEvent = {
-        preventDefault: function() { this.defaultPrevented = true; },
-        isDefaultPrevented: function() { return this.defaultPrevented === true; },
-        stopImmediatePropagation: function() { this.immediatePropagationStopped = true; },
-        isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; },
-        stopPropagation: noop,
-        type: eventName,
-        target: element
-      };
-
-      // If a custom event was provided then extend our dummy event with it
-      if (event.type) {
-        dummyEvent = extend(dummyEvent, event);
-      }
-
-      // Copy event handlers in case event handlers array is modified during execution.
-      eventFnsCopy = shallowCopy(eventFns);
-      handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];
-
-      forEach(eventFnsCopy, function(fn) {
-        if (!dummyEvent.isImmediatePropagationStopped()) {
-          fn.apply(element, handlerArgs);
-        }
-      });
-    }
-  }
-}, function(fn, name) {
-  /**
-   * chaining functions
-   */
-  JQLite.prototype[name] = function(arg1, arg2, arg3) {
-    var value;
-
-    for (var i = 0, ii = this.length; i < ii; i++) {
-      if (isUndefined(value)) {
-        value = fn(this[i], arg1, arg2, arg3);
-        if (isDefined(value)) {
-          // any function which returns a value needs to be wrapped
-          value = jqLite(value);
-        }
-      } else {
-        jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));
-      }
-    }
-    return isDefined(value) ? value : this;
-  };
-
-  // bind legacy bind/unbind to on/off
-  JQLite.prototype.bind = JQLite.prototype.on;
-  JQLite.prototype.unbind = JQLite.prototype.off;
-});
-
-
-// Provider for private $$jqLite service
-function $$jqLiteProvider() {
-  this.$get = function $$jqLite() {
-    return extend(JQLite, {
-      hasClass: function(node, classes) {
-        if (node.attr) node = node[0];
-        return jqLiteHasClass(node, classes);
-      },
-      addClass: function(node, classes) {
-        if (node.attr) node = node[0];
-        return jqLiteAddClass(node, classes);
-      },
-      removeClass: function(node, classes) {
-        if (node.attr) node = node[0];
-        return jqLiteRemoveClass(node, classes);
-      }
-    });
-  };
-}
-
-/**
- * Computes a hash of an 'obj'.
- * Hash of a:
- *  string is string
- *  number is number as string
- *  object is either result of calling $$hashKey function on the object or uniquely generated id,
- *         that is also assigned to the $$hashKey property of the object.
- *
- * @param obj
- * @returns {string} hash string such that the same input will have the same hash string.
- *         The resulting string key is in 'type:hashKey' format.
- */
-function hashKey(obj, nextUidFn) {
-  var key = obj && obj.$$hashKey;
-
-  if (key) {
-    if (typeof key === 'function') {
-      key = obj.$$hashKey();
-    }
-    return key;
-  }
-
-  var objType = typeof obj;
-  if (objType == 'function' || (objType == 'object' && obj !== null)) {
-    key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();
-  } else {
-    key = objType + ':' + obj;
-  }
-
-  return key;
-}
-
-/**
- * HashMap which can use objects as keys
- */
-function HashMap(array, isolatedUid) {
-  if (isolatedUid) {
-    var uid = 0;
-    this.nextUid = function() {
-      return ++uid;
-    };
-  }
-  forEach(array, this.put, this);
-}
-HashMap.prototype = {
-  /**
-   * Store key value pair
-   * @param key key to store can be any type
-   * @param value value to store can be any type
-   */
-  put: function(key, value) {
-    this[hashKey(key, this.nextUid)] = value;
-  },
-
-  /**
-   * @param key
-   * @returns {Object} the value for the key
-   */
-  get: function(key) {
-    return this[hashKey(key, this.nextUid)];
-  },
-
-  /**
-   * Remove the key/value pair
-   * @param key
-   */
-  remove: function(key) {
-    var value = this[key = hashKey(key, this.nextUid)];
-    delete this[key];
-    return value;
-  }
-};
-
-var $$HashMapProvider = [function() {
-  this.$get = [function() {
-    return HashMap;
-  }];
-}];
-
-/**
- * @ngdoc function
- * @module ng
- * @name angular.injector
- * @kind function
- *
- * @description
- * Creates an injector object that can be used for retrieving services as well as for
- * dependency injection (see {@link guide/di dependency injection}).
- *
- * @param {Array.<string|Function>} modules A list of module functions or their aliases. See
- *     {@link angular.module}. The `ng` module must be explicitly added.
- * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which
- *     disallows argument name annotation inference.
- * @returns {injector} Injector object. See {@link auto.$injector $injector}.
- *
- * @example
- * Typical usage
- * ```js
- *   // create an injector
- *   var $injector = angular.injector(['ng']);
- *
- *   // use the injector to kick off your application
- *   // use the type inference to auto inject arguments, or use implicit injection
- *   $injector.invoke(function($rootScope, $compile, $document) {
- *     $compile($document)($rootScope);
- *     $rootScope.$digest();
- *   });
- * ```
- *
- * Sometimes you want to get access to the injector of a currently running Angular app
- * from outside Angular. Perhaps, you want to inject and compile some markup after the
- * application has been bootstrapped. You can do this using the extra `injector()` added
- * to JQuery/jqLite elements. See {@link angular.element}.
- *
- * *This is fairly rare but could be the case if a third party library is injecting the
- * markup.*
- *
- * In the following example a new block of HTML containing a `ng-controller`
- * directive is added to the end of the document body by JQuery. We then compile and link
- * it into the current AngularJS scope.
- *
- * ```js
- * var $div = $('<div ng-controller="MyCtrl">{{content.label}}</div>');
- * $(document.body).append($div);
- *
- * angular.element(document).injector().invoke(function($compile) {
- *   var scope = angular.element($div).scope();
- *   $compile($div)(scope);
- * });
- * ```
- */
-
-
-/**
- * @ngdoc module
- * @name auto
- * @description
- *
- * Implicit module which gets automatically added to each {@link auto.$injector $injector}.
- */
-
-var FN_ARGS = /^[^\(]*\(\s*([^\)]*)\)/m;
-var FN_ARG_SPLIT = /,/;
-var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
-var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
-var $injectorMinErr = minErr('$injector');
-
-function anonFn(fn) {
-  // For anonymous functions, showing at the very least the function signature can help in
-  // debugging.
-  var fnText = fn.toString().replace(STRIP_COMMENTS, ''),
-      args = fnText.match(FN_ARGS);
-  if (args) {
-    return 'function(' + (args[1] || '').replace(/[\s\r\n]+/, ' ') + ')';
-  }
-  return 'fn';
-}
-
-function annotate(fn, strictDi, name) {
-  var $inject,
-      fnText,
-      argDecl,
-      last;
-
-  if (typeof fn === 'function') {
-    if (!($inject = fn.$inject)) {
-      $inject = [];
-      if (fn.length) {
-        if (strictDi) {
-          if (!isString(name) || !name) {
-            name = fn.name || anonFn(fn);
-          }
-          throw $injectorMinErr('strictdi',
-            '{0} is not using explicit annotation and cannot be invoked in strict mode', name);
-        }
-        fnText = fn.toString().replace(STRIP_COMMENTS, '');
-        argDecl = fnText.match(FN_ARGS);
-        forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {
-          arg.replace(FN_ARG, function(all, underscore, name) {
-            $inject.push(name);
-          });
-        });
-      }
-      fn.$inject = $inject;
-    }
-  } else if (isArray(fn)) {
-    last = fn.length - 1;
-    assertArgFn(fn[last], 'fn');
-    $inject = fn.slice(0, last);
-  } else {
-    assertArgFn(fn, 'fn', true);
-  }
-  return $inject;
-}
-
-///////////////////////////////////////
-
-/**
- * @ngdoc service
- * @name $injector
- *
- * @description
- *
- * `$injector` is used to retrieve object instances as defined by
- * {@link auto.$provide provider}, instantiate types, invoke methods,
- * and load modules.
- *
- * The following always holds true:
- *
- * ```js
- *   var $injector = angular.injector();
- *   expect($injector.get('$injector')).toBe($injector);
- *   expect($injector.invoke(function($injector) {
- *     return $injector;
- *   })).toBe($injector);
- * ```
- *
- * # Injection Function Annotation
- *
- * JavaScript does not have annotations, and annotations are needed for dependency injection. The
- * following are all valid ways of annotating function with injection arguments and are equivalent.
- *
- * ```js
- *   // inferred (only works if code not minified/obfuscated)
- *   $injector.invoke(function(serviceA){});
- *
- *   // annotated
- *   function explicit(serviceA) {};
- *   explicit.$inject = ['serviceA'];
- *   $injector.invoke(explicit);
- *
- *   // inline
- *   $injector.invoke(['serviceA', function(serviceA){}]);
- * ```
- *
- * ## Inference
- *
- * In JavaScript calling `toString()` on a function returns the function definition. The definition
- * can then be parsed and the function arguments can be extracted. This method of discovering
- * annotations is disallowed when the injector is in strict mode.
- * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the
- * argument names.
- *
- * ## `$inject` Annotation
- * By adding an `$inject` property onto a function the injection parameters can be specified.
- *
- * ## Inline
- * As an array of injection names, where the last item in the array is the function to call.
- */
-
-/**
- * @ngdoc method
- * @name $injector#get
- *
- * @description
- * Return an instance of the service.
- *
- * @param {string} name The name of the instance to retrieve.
- * @param {string=} caller An optional string to provide the origin of the function call for error messages.
- * @return {*} The instance.
- */
-
-/**
- * @ngdoc method
- * @name $injector#invoke
- *
- * @description
- * Invoke the method and supply the method arguments from the `$injector`.
- *
- * @param {Function|Array.<string|Function>} fn The injectable function to invoke. Function parameters are
- *   injected according to the {@link guide/di $inject Annotation} rules.
- * @param {Object=} self The `this` for the invoked method.
- * @param {Object=} locals Optional object. If preset then any argument names are read from this
- *                         object first, before the `$injector` is consulted.
- * @returns {*} the value returned by the invoked `fn` function.
- */
-
-/**
- * @ngdoc method
- * @name $injector#has
- *
- * @description
- * Allows the user to query if the particular service exists.
- *
- * @param {string} name Name of the service to query.
- * @returns {boolean} `true` if injector has given service.
- */
-
-/**
- * @ngdoc method
- * @name $injector#instantiate
- * @description
- * Create a new instance of JS type. The method takes a constructor function, invokes the new
- * operator, and supplies all of the arguments to the constructor function as specified by the
- * constructor annotation.
- *
- * @param {Function} Type Annotated constructor function.
- * @param {Object=} locals Optional object. If preset then any argument names are read from this
- * object first, before the `$injector` is consulted.
- * @returns {Object} new instance of `Type`.
- */
-
-/**
- * @ngdoc method
- * @name $injector#annotate
- *
- * @description
- * Returns an array of service names which the function is requesting for injection. This API is
- * used by the injector to determine which services need to be injected into the function when the
- * function is invoked. There are three ways in which the function can be annotated with the needed
- * dependencies.
- *
- * # Argument names
- *
- * The simplest form is to extract the dependencies from the arguments of the function. This is done
- * by converting the function into a string using `toString()` method and extracting the argument
- * names.
- * ```js
- *   // Given
- *   function MyController($scope, $route) {
- *     // ...
- *   }
- *
- *   // Then
- *   expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
- * ```
- *
- * You can disallow this method by using strict injection mode.
- *
- * This method does not work with code minification / obfuscation. For this reason the following
- * annotation strategies are supported.
- *
- * # The `$inject` property
- *
- * If a function has an `$inject` property and its value is an array of strings, then the strings
- * represent names of services to be injected into the function.
- * ```js
- *   // Given
- *   var MyController = function(obfuscatedScope, obfuscatedRoute) {
- *     // ...
- *   }
- *   // Define function dependencies
- *   MyController['$inject'] = ['$scope', '$route'];
- *
- *   // Then
- *   expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
- * ```
- *
- * # The array notation
- *
- * It is often desirable to inline Injected functions and that's when setting the `$inject` property
- * is very inconvenient. In these situations using the array notation to specify the dependencies in
- * a way that survives minification is a better choice:
- *
- * ```js
- *   // We wish to write this (not minification / obfuscation safe)
- *   injector.invoke(function($compile, $rootScope) {
- *     // ...
- *   });
- *
- *   // We are forced to write break inlining
- *   var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {
- *     // ...
- *   };
- *   tmpFn.$inject = ['$compile', '$rootScope'];
- *   injector.invoke(tmpFn);
- *
- *   // To better support inline function the inline annotation is supported
- *   injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {
- *     // ...
- *   }]);
- *
- *   // Therefore
- *   expect(injector.annotate(
- *      ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])
- *    ).toEqual(['$compile', '$rootScope']);
- * ```
- *
- * @param {Function|Array.<string|Function>} fn Function for which dependent service names need to
- * be retrieved as described above.
- *
- * @param {boolean=} [strictDi=false] Disallow argument name annotation inference.
- *
- * @returns {Array.<string>} The names of the services which the function requires.
- */
-
-
-
-
-/**
- * @ngdoc service
- * @name $provide
- *
- * @description
- *
- * The {@link auto.$provide $provide} service has a number of methods for registering components
- * with the {@link auto.$injector $injector}. Many of these functions are also exposed on
- * {@link angular.Module}.
- *
- * An Angular **service** is a singleton object created by a **service factory**.  These **service
- * factories** are functions which, in turn, are created by a **service provider**.
- * The **service providers** are constructor functions. When instantiated they must contain a
- * property called `$get`, which holds the **service factory** function.
- *
- * When you request a service, the {@link auto.$injector $injector} is responsible for finding the
- * correct **service provider**, instantiating it and then calling its `$get` **service factory**
- * function to get the instance of the **service**.
- *
- * Often services have no configuration options and there is no need to add methods to the service
- * provider.  The provider will be no more than a constructor function with a `$get` property. For
- * these cases the {@link auto.$provide $provide} service has additional helper methods to register
- * services without specifying a provider.
- *
- * * {@link auto.$provide#provider provider(provider)} - registers a **service provider** with the
- *     {@link auto.$injector $injector}
- * * {@link auto.$provide#constant constant(obj)} - registers a value/object that can be accessed by
- *     providers and services.
- * * {@link auto.$provide#value value(obj)} - registers a value/object that can only be accessed by
- *     services, not providers.
- * * {@link auto.$provide#factory factory(fn)} - registers a service **factory function**, `fn`,
- *     that will be wrapped in a **service provider** object, whose `$get` property will contain the
- *     given factory function.
- * * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class`
- *     that will be wrapped in a **service provider** object, whose `$get` property will instantiate
- *      a new object using the given constructor function.
- *
- * See the individual methods for more information and examples.
- */
-
-/**
- * @ngdoc method
- * @name $provide#provider
- * @description
- *
- * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions
- * are constructor functions, whose instances are responsible for "providing" a factory for a
- * service.
- *
- * Service provider names start with the name of the service they provide followed by `Provider`.
- * For example, the {@link ng.$log $log} service has a provider called
- * {@link ng.$logProvider $logProvider}.
- *
- * Service provider objects can have additional methods which allow configuration of the provider
- * and its service. Importantly, you can configure what kind of service is created by the `$get`
- * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a
- * method {@link ng.$logProvider#debugEnabled debugEnabled}
- * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the
- * console or not.
- *
- * @param {string} name The name of the instance. NOTE: the provider will be available under `name +
-                        'Provider'` key.
- * @param {(Object|function())} provider If the provider is:
- *
- *   - `Object`: then it should have a `$get` method. The `$get` method will be invoked using
- *     {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.
- *   - `Constructor`: a new instance of the provider will be created using
- *     {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.
- *
- * @returns {Object} registered provider instance
-
- * @example
- *
- * The following example shows how to create a simple event tracking service and register it using
- * {@link auto.$provide#provider $provide.provider()}.
- *
- * ```js
- *  // Define the eventTracker provider
- *  function EventTrackerProvider() {
- *    var trackingUrl = '/track';
- *
- *    // A provider method for configuring where the tracked events should been saved
- *    this.setTrackingUrl = function(url) {
- *      trackingUrl = url;
- *    };
- *
- *    // The service factory function
- *    this.$get = ['$http', function($http) {
- *      var trackedEvents = {};
- *      return {
- *        // Call this to track an event
- *        event: function(event) {
- *          var count = trackedEvents[event] || 0;
- *          count += 1;
- *          trackedEvents[event] = count;
- *          return count;
- *        },
- *        // Call this to save the tracked events to the trackingUrl
- *        save: function() {
- *          $http.post(trackingUrl, trackedEvents);
- *        }
- *      };
- *    }];
- *  }
- *
- *  describe('eventTracker', function() {
- *    var postSpy;
- *
- *    beforeEach(module(function($provide) {
- *      // Register the eventTracker provider
- *      $provide.provider('eventTracker', EventTrackerProvider);
- *    }));
- *
- *    beforeEach(module(function(eventTrackerProvider) {
- *      // Configure eventTracker provider
- *      eventTrackerProvider.setTrackingUrl('/custom-track');
- *    }));
- *
- *    it('tracks events', inject(function(eventTracker) {
- *      expect(eventTracker.event('login')).toEqual(1);
- *      expect(eventTracker.event('login')).toEqual(2);
- *    }));
- *
- *    it('saves to the tracking url', inject(function(eventTracker, $http) {
- *      postSpy = spyOn($http, 'post');
- *      eventTracker.event('login');
- *      eventTracker.save();
- *      expect(postSpy).toHaveBeenCalled();
- *      expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track');
- *      expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track');
- *      expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 });
- *    }));
- *  });
- * ```
- */
-
-/**
- * @ngdoc method
- * @name $provide#factory
- * @description
- *
- * Register a **service factory**, which will be called to return the service instance.
- * This is short for registering a service where its provider consists of only a `$get` property,
- * which is the given service factory function.
- * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to
- * configure your service in a provider.
- *
- * @param {string} name The name of the instance.
- * @param {Function|Array.<string|Function>} $getFn The injectable $getFn for the instance creation.
- *                      Internally this is a short hand for `$provide.provider(name, {$get: $getFn})`.
- * @returns {Object} registered provider instance
- *
- * @example
- * Here is an example of registering a service
- * ```js
- *   $provide.factory('ping', ['$http', function($http) {
- *     return function ping() {
- *       return $http.send('/ping');
- *     };
- *   }]);
- * ```
- * You would then inject and use this service like this:
- * ```js
- *   someModule.controller('Ctrl', ['ping', function(ping) {
- *     ping();
- *   }]);
- * ```
- */
-
-
-/**
- * @ngdoc method
- * @name $provide#service
- * @description
- *
- * Register a **service constructor**, which will be invoked with `new` to create the service
- * instance.
- * This is short for registering a service where its provider's `$get` property is the service
- * constructor function that will be used to instantiate the service instance.
- *
- * You should use {@link auto.$provide#service $provide.service(class)} if you define your service
- * as a type/class.
- *
- * @param {string} name The name of the instance.
- * @param {Function|Array.<string|Function>} constructor An injectable class (constructor function)
- *     that will be instantiated.
- * @returns {Object} registered provider instance
- *
- * @example
- * Here is an example of registering a service using
- * {@link auto.$provide#service $provide.service(class)}.
- * ```js
- *   var Ping = function($http) {
- *     this.$http = $http;
- *   };
- *
- *   Ping.$inject = ['$http'];
- *
- *   Ping.prototype.send = function() {
- *     return this.$http.get('/ping');
- *   };
- *   $provide.service('ping', Ping);
- * ```
- * You would then inject and use this service like this:
- * ```js
- *   someModule.controller('Ctrl', ['ping', function(ping) {
- *     ping.send();
- *   }]);
- * ```
- */
-
-
-/**
- * @ngdoc method
- * @name $provide#value
- * @description
- *
- * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a
- * number, an array, an object or a function.  This is short for registering a service where its
- * provider's `$get` property is a factory function that takes no arguments and returns the **value
- * service**.
- *
- * Value services are similar to constant services, except that they cannot be injected into a
- * module configuration function (see {@link angular.Module#config}) but they can be overridden by
- * an Angular
- * {@link auto.$provide#decorator decorator}.
- *
- * @param {string} name The name of the instance.
- * @param {*} value The value.
- * @returns {Object} registered provider instance
- *
- * @example
- * Here are some examples of creating value services.
- * ```js
- *   $provide.value('ADMIN_USER', 'admin');
- *
- *   $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });
- *
- *   $provide.value('halfOf', function(value) {
- *     return value / 2;
- *   });
- * ```
- */
-
-
-/**
- * @ngdoc method
- * @name $provide#constant
- * @description
- *
- * Register a **constant service**, such as a string, a number, an array, an object or a function,
- * with the {@link auto.$injector $injector}. Unlike {@link auto.$provide#value value} it can be
- * injected into a module configuration function (see {@link angular.Module#config}) and it cannot
- * be overridden by an Angular {@link auto.$provide#decorator decorator}.
- *
- * @param {string} name The name of the constant.
- * @param {*} value The constant value.
- * @returns {Object} registered instance
- *
- * @example
- * Here a some examples of creating constants:
- * ```js
- *   $provide.constant('SHARD_HEIGHT', 306);
- *
- *   $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);
- *
- *   $provide.constant('double', function(value) {
- *     return value * 2;
- *   });
- * ```
- */
-
-
-/**
- * @ngdoc method
- * @name $provide#decorator
- * @description
- *
- * Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator
- * intercepts the creation of a service, allowing it to override or modify the behaviour of the
- * service. The object returned by the decorator may be the original service, or a new service
- * object which replaces or wraps and delegates to the original service.
- *
- * @param {string} name The name of the service to decorate.
- * @param {Function|Array.<string|Function>} decorator This function will be invoked when the service needs to be
- *    instantiated and should return the decorated service instance. The function is called using
- *    the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable.
- *    Local injection arguments:
- *
- *    * `$delegate` - The original service instance, which can be monkey patched, configured,
- *      decorated or delegated to.
- *
- * @example
- * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting
- * calls to {@link ng.$log#error $log.warn()}.
- * ```js
- *   $provide.decorator('$log', ['$delegate', function($delegate) {
- *     $delegate.warn = $delegate.error;
- *     return $delegate;
- *   }]);
- * ```
- */
-
-
-function createInjector(modulesToLoad, strictDi) {
-  strictDi = (strictDi === true);
-  var INSTANTIATING = {},
-      providerSuffix = 'Provider',
-      path = [],
-      loadedModules = new HashMap([], true),
-      providerCache = {
-        $provide: {
-            provider: supportObject(provider),
-            factory: supportObject(factory),
-            service: supportObject(service),
-            value: supportObject(value),
-            constant: supportObject(constant),
-            decorator: decorator
-          }
-      },
-      providerInjector = (providerCache.$injector =
-          createInternalInjector(providerCache, function(serviceName, caller) {
-            if (angular.isString(caller)) {
-              path.push(caller);
-            }
-            throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- '));
-          })),
-      instanceCache = {},
-      instanceInjector = (instanceCache.$injector =
-          createInternalInjector(instanceCache, function(serviceName, caller) {
-            var provider = providerInjector.get(serviceName + providerSuffix, caller);
-            return instanceInjector.invoke(provider.$get, provider, undefined, serviceName);
-          }));
-
-
-  forEach(loadModules(modulesToLoad), function(fn) { if (fn) instanceInjector.invoke(fn); });
-
-  return instanceInjector;
-
-  ////////////////////////////////////
-  // $provider
-  ////////////////////////////////////
-
-  function supportObject(delegate) {
-    return function(key, value) {
-      if (isObject(key)) {
-        forEach(key, reverseParams(delegate));
-      } else {
-        return delegate(key, value);
-      }
-    };
-  }
-
-  function provider(name, provider_) {
-    assertNotHasOwnProperty(name, 'service');
-    if (isFunction(provider_) || isArray(provider_)) {
-      provider_ = providerInjector.instantiate(provider_);
-    }
-    if (!provider_.$get) {
-      throw $injectorMinErr('pget', "Provider '{0}' must define $get factory method.", name);
-    }
-    return providerCache[name + providerSuffix] = provider_;
-  }
-
-  function enforceReturnValue(name, factory) {
-    return function enforcedReturnValue() {
-      var result = instanceInjector.invoke(factory, this);
-      if (isUndefined(result)) {
-        throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name);
-      }
-      return result;
-    };
-  }
-
-  function factory(name, factoryFn, enforce) {
-    return provider(name, {
-      $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn
-    });
-  }
-
-  function service(name, constructor) {
-    return factory(name, ['$injector', function($injector) {
-      return $injector.instantiate(constructor);
-    }]);
-  }
-
-  function value(name, val) { return factory(name, valueFn(val), false); }
-
-  function constant(name, value) {
-    assertNotHasOwnProperty(name, 'constant');
-    providerCache[name] = value;
-    instanceCache[name] = value;
-  }
-
-  function decorator(serviceName, decorFn) {
-    var origProvider = providerInjector.get(serviceName + providerSuffix),
-        orig$get = origProvider.$get;
-
-    origProvider.$get = function() {
-      var origInstance = instanceInjector.invoke(orig$get, origProvider);
-      return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});
-    };
-  }
-
-  ////////////////////////////////////
-  // Module Loading
-  ////////////////////////////////////
-  function loadModules(modulesToLoad) {
-    assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array');
-    var runBlocks = [], moduleFn;
-    forEach(modulesToLoad, function(module) {
-      if (loadedModules.get(module)) return;
-      loadedModules.put(module, true);
-
-      function runInvokeQueue(queue) {
-        var i, ii;
-        for (i = 0, ii = queue.length; i < ii; i++) {
-          var invokeArgs = queue[i],
-              provider = providerInjector.get(invokeArgs[0]);
-
-          provider[invokeArgs[1]].apply(provider, invokeArgs[2]);
-        }
-      }
-
-      try {
-        if (isString(module)) {
-          moduleFn = angularModule(module);
-          runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);
-          runInvokeQueue(moduleFn._invokeQueue);
-          runInvokeQueue(moduleFn._configBlocks);
-        } else if (isFunction(module)) {
-            runBlocks.push(providerInjector.invoke(module));
-        } else if (isArray(module)) {
-            runBlocks.push(providerInjector.invoke(module));
-        } else {
-          assertArgFn(module, 'module');
-        }
-      } catch (e) {
-        if (isArray(module)) {
-          module = module[module.length - 1];
-        }
-        if (e.message && e.stack && e.stack.indexOf(e.message) == -1) {
-          // Safari & FF's stack traces don't contain error.message content
-          // unlike those of Chrome and IE
-          // So if stack doesn't contain message, we create a new string that contains both.
-          // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here.
-          /* jshint -W022 */
-          e = e.message + '\n' + e.stack;
-        }
-        throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}",
-                  module, e.stack || e.message || e);
-      }
-    });
-    return runBlocks;
-  }
-
-  ////////////////////////////////////
-  // internal Injector
-  ////////////////////////////////////
-
-  function createInternalInjector(cache, factory) {
-
-    function getService(serviceName, caller) {
-      if (cache.hasOwnProperty(serviceName)) {
-        if (cache[serviceName] === INSTANTIATING) {
-          throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
-                    serviceName + ' <- ' + path.join(' <- '));
-        }
-        return cache[serviceName];
-      } else {
-        try {
-          path.unshift(serviceName);
-          cache[serviceName] = INSTANTIATING;
-          return cache[serviceName] = factory(serviceName, caller);
-        } catch (err) {
-          if (cache[serviceName] === INSTANTIATING) {
-            delete cache[serviceName];
-          }
-          throw err;
-        } finally {
-          path.shift();
-        }
-      }
-    }
-
-    function invoke(fn, self, locals, serviceName) {
-      if (typeof locals === 'string') {
-        serviceName = locals;
-        locals = null;
-      }
-
-      var args = [],
-          $inject = createInjector.$$annotate(fn, strictDi, serviceName),
-          length, i,
-          key;
-
-      for (i = 0, length = $inject.length; i < length; i++) {
-        key = $inject[i];
-        if (typeof key !== 'string') {
-          throw $injectorMinErr('itkn',
-                  'Incorrect injection token! Expected service name as string, got {0}', key);
-        }
-        args.push(
-          locals && locals.hasOwnProperty(key)
-          ? locals[key]
-          : getService(key, serviceName)
-        );
-      }
-      if (isArray(fn)) {
-        fn = fn[length];
-      }
-
-      // http://jsperf.com/angularjs-invoke-apply-vs-switch
-      // #5388
-      return fn.apply(self, args);
-    }
-
-    function instantiate(Type, locals, serviceName) {
-      // Check if Type is annotated and use just the given function at n-1 as parameter
-      // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);
-      // Object creation: http://jsperf.com/create-constructor/2
-      var instance = Object.create((isArray(Type) ? Type[Type.length - 1] : Type).prototype || null);
-      var returnedValue = invoke(Type, instance, locals, serviceName);
-
-      return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance;
-    }
-
-    return {
-      invoke: invoke,
-      instantiate: instantiate,
-      get: getService,
-      annotate: createInjector.$$annotate,
-      has: function(name) {
-        return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);
-      }
-    };
-  }
-}
-
-createInjector.$$annotate = annotate;
-
-/**
- * @ngdoc provider
- * @name $anchorScrollProvider
- *
- * @description
- * Use `$anchorScrollProvider` to disable automatic scrolling whenever
- * {@link ng.$location#hash $location.hash()} changes.
- */
-function $AnchorScrollProvider() {
-
-  var autoScrollingEnabled = true;
-
-  /**
-   * @ngdoc method
-   * @name $anchorScrollProvider#disableAutoScrolling
-   *
-   * @description
-   * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to
-   * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.<br />
-   * Use this method to disable automatic scrolling.
-   *
-   * If automatic scrolling is disabled, one must explicitly call
-   * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the
-   * current hash.
-   */
-  this.disableAutoScrolling = function() {
-    autoScrollingEnabled = false;
-  };
-
-  /**
-   * @ngdoc service
-   * @name $anchorScroll
-   * @kind function
-   * @requires $window
-   * @requires $location
-   * @requires $rootScope
-   *
-   * @description
-   * When called, it scrolls to the element related to the specified `hash` or (if omitted) to the
-   * current value of {@link ng.$location#hash $location.hash()}, according to the rules specified
-   * in the
-   * [HTML5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document).
-   *
-   * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to
-   * match any anchor whenever it changes. This can be disabled by calling
-   * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}.
-   *
-   * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a
-   * vertical scroll-offset (either fixed or dynamic).
-   *
-   * @param {string=} hash The hash specifying the element to scroll to. If omitted, the value of
-   *                       {@link ng.$location#hash $location.hash()} will be used.
-   *
-   * @property {(number|function|jqLite)} yOffset
-   * If set, specifies a vertical scroll-offset. This is often useful when there are fixed
-   * positioned elements at the top of the page, such as navbars, headers etc.
-   *
-   * `yOffset` can be specified in various ways:
-   * - **number**: A fixed number of pixels to be used as offset.<br /><br />
-   * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return
-   *   a number representing the offset (in pixels).<br /><br />
-   * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from
-   *   the top of the page to the element's bottom will be used as offset.<br />
-   *   **Note**: The element will be taken into account only as long as its `position` is set to
-   *   `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust
-   *   their height and/or positioning according to the viewport's size.
-   *
-   * <br />
-   * <div class="alert alert-warning">
-   * In order for `yOffset` to work properly, scrolling should take place on the document's root and
-   * not some child element.
-   * </div>
-   *
-   * @example
-     <example module="anchorScrollExample">
-       <file name="index.html">
-         <div id="scrollArea" ng-controller="ScrollController">
-           <a ng-click="gotoBottom()">Go to bottom</a>
-           <a id="bottom"></a> You're at the bottom!
-         </div>
-       </file>
-       <file name="script.js">
-         angular.module('anchorScrollExample', [])
-           .controller('ScrollController', ['$scope', '$location', '$anchorScroll',
-             function ($scope, $location, $anchorScroll) {
-               $scope.gotoBottom = function() {
-                 // set the location.hash to the id of
-                 // the element you wish to scroll to.
-                 $location.hash('bottom');
-
-                 // call $anchorScroll()
-                 $anchorScroll();
-               };
-             }]);
-       </file>
-       <file name="style.css">
-         #scrollArea {
-           height: 280px;
-           overflow: auto;
-         }
-
-         #bottom {
-           display: block;
-           margin-top: 2000px;
-         }
-       </file>
-     </example>
-   *
-   * <hr />
-   * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value).
-   * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details.
-   *
-   * @example
-     <example module="anchorScrollOffsetExample">
-       <file name="index.html">
-         <div class="fixed-header" ng-controller="headerCtrl">
-           <a href="" ng-click="gotoAnchor(x)" ng-repeat="x in [1,2,3,4,5]">
-             Go to anchor {{x}}
-           </a>
-         </div>
-         <div id="anchor{{x}}" class="anchor" ng-repeat="x in [1,2,3,4,5]">
-           Anchor {{x}} of 5
-         </div>
-       </file>
-       <file name="script.js">
-         angular.module('anchorScrollOffsetExample', [])
-           .run(['$anchorScroll', function($anchorScroll) {
-             $anchorScroll.yOffset = 50;   // always scroll by 50 extra pixels
-           }])
-           .controller('headerCtrl', ['$anchorScroll', '$location', '$scope',
-             function ($anchorScroll, $location, $scope) {
-               $scope.gotoAnchor = function(x) {
-                 var newHash = 'anchor' + x;
-                 if ($location.hash() !== newHash) {
-                   // set the $location.hash to `newHash` and
-                   // $anchorScroll will automatically scroll to it
-                   $location.hash('anchor' + x);
-                 } else {
-                   // call $anchorScroll() explicitly,
-                   // since $location.hash hasn't changed
-                   $anchorScroll();
-                 }
-               };
-             }
-           ]);
-       </file>
-       <file name="style.css">
-         body {
-           padding-top: 50px;
-         }
-
-         .anchor {
-           border: 2px dashed DarkOrchid;
-           padding: 10px 10px 200px 10px;
-         }
-
-         .fixed-header {
-           background-color: rgba(0, 0, 0, 0.2);
-           height: 50px;
-           position: fixed;
-           top: 0; left: 0; right: 0;
-         }
-
-         .fixed-header > a {
-           display: inline-block;
-           margin: 5px 15px;
-         }
-       </file>
-     </example>
-   */
-  this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {
-    var document = $window.document;
-
-    // Helper function to get first anchor from a NodeList
-    // (using `Array#some()` instead of `angular#forEach()` since it's more performant
-    //  and working in all supported browsers.)
-    function getFirstAnchor(list) {
-      var result = null;
-      Array.prototype.some.call(list, function(element) {
-        if (nodeName_(element) === 'a') {
-          result = element;
-          return true;
-        }
-      });
-      return result;
-    }
-
-    function getYOffset() {
-
-      var offset = scroll.yOffset;
-
-      if (isFunction(offset)) {
-        offset = offset();
-      } else if (isElement(offset)) {
-        var elem = offset[0];
-        var style = $window.getComputedStyle(elem);
-        if (style.position !== 'fixed') {
-          offset = 0;
-        } else {
-          offset = elem.getBoundingClientRect().bottom;
-        }
-      } else if (!isNumber(offset)) {
-        offset = 0;
-      }
-
-      return offset;
-    }
-
-    function scrollTo(elem) {
-      if (elem) {
-        elem.scrollIntoView();
-
-        var offset = getYOffset();
-
-        if (offset) {
-          // `offset` is the number of pixels we should scroll UP in order to align `elem` properly.
-          // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the
-          // top of the viewport.
-          //
-          // IF the number of pixels from the top of `elem` to the end of the page's content is less
-          // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some
-          // way down the page.
-          //
-          // This is often the case for elements near the bottom of the page.
-          //
-          // In such cases we do not need to scroll the whole `offset` up, just the difference between
-          // the top of the element and the offset, which is enough to align the top of `elem` at the
-          // desired position.
-          var elemTop = elem.getBoundingClientRect().top;
-          $window.scrollBy(0, elemTop - offset);
-        }
-      } else {
-        $window.scrollTo(0, 0);
-      }
-    }
-
-    function scroll(hash) {
-      hash = isString(hash) ? hash : $location.hash();
-      var elm;
-
-      // empty hash, scroll to the top of the page
-      if (!hash) scrollTo(null);
-
-      // element with given id
-      else if ((elm = document.getElementById(hash))) scrollTo(elm);
-
-      // first anchor with given name :-D
-      else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm);
-
-      // no element and hash == 'top', scroll to the top of the page
-      else if (hash === 'top') scrollTo(null);
-    }
-
-    // does not scroll when user clicks on anchor link that is currently on
-    // (no url change, no $location.hash() change), browser native does scroll
-    if (autoScrollingEnabled) {
-      $rootScope.$watch(function autoScrollWatch() {return $location.hash();},
-        function autoScrollWatchAction(newVal, oldVal) {
-          // skip the initial scroll if $location.hash is empty
-          if (newVal === oldVal && newVal === '') return;
-
-          jqLiteDocumentLoaded(function() {
-            $rootScope.$evalAsync(scroll);
-          });
-        });
-    }
-
-    return scroll;
-  }];
-}
-
-var $animateMinErr = minErr('$animate');
-var ELEMENT_NODE = 1;
-var NG_ANIMATE_CLASSNAME = 'ng-animate';
-
-function mergeClasses(a,b) {
-  if (!a && !b) return '';
-  if (!a) return b;
-  if (!b) return a;
-  if (isArray(a)) a = a.join(' ');
-  if (isArray(b)) b = b.join(' ');
-  return a + ' ' + b;
-}
-
-function extractElementNode(element) {
-  for (var i = 0; i < element.length; i++) {
-    var elm = element[i];
-    if (elm.nodeType === ELEMENT_NODE) {
-      return elm;
-    }
-  }
-}
-
-function splitClasses(classes) {
-  if (isString(classes)) {
-    classes = classes.split(' ');
-  }
-
-  // Use createMap() to prevent class assumptions involving property names in
-  // Object.prototype
-  var obj = createMap();
-  forEach(classes, function(klass) {
-    // sometimes the split leaves empty string values
-    // incase extra spaces were applied to the options
-    if (klass.length) {
-      obj[klass] = true;
-    }
-  });
-  return obj;
-}
-
-// if any other type of options value besides an Object value is
-// passed into the $animate.method() animation then this helper code
-// will be run which will ignore it. While this patch is not the
-// greatest solution to this, a lot of existing plugins depend on
-// $animate to either call the callback (< 1.2) or return a promise
-// that can be changed. This helper function ensures that the options
-// are wiped clean incase a callback function is provided.
-function prepareAnimateOptions(options) {
-  return isObject(options)
-      ? options
-      : {};
-}
-
-var $$CoreAnimateRunnerProvider = function() {
-  this.$get = ['$q', '$$rAF', function($q, $$rAF) {
-    function AnimateRunner() {}
-    AnimateRunner.all = noop;
-    AnimateRunner.chain = noop;
-    AnimateRunner.prototype = {
-      end: noop,
-      cancel: noop,
-      resume: noop,
-      pause: noop,
-      complete: noop,
-      then: function(pass, fail) {
-        return $q(function(resolve) {
-          $$rAF(function() {
-            resolve();
-          });
-        }).then(pass, fail);
-      }
-    };
-    return AnimateRunner;
-  }];
-};
-
-// this is prefixed with Core since it conflicts with
-// the animateQueueProvider defined in ngAnimate/animateQueue.js
-var $$CoreAnimateQueueProvider = function() {
-  var postDigestQueue = new HashMap();
-  var postDigestElements = [];
-
-  this.$get = ['$$AnimateRunner', '$rootScope',
-       function($$AnimateRunner,   $rootScope) {
-    return {
-      enabled: noop,
-      on: noop,
-      off: noop,
-      pin: noop,
-
-      push: function(element, event, options, domOperation) {
-        domOperation        && domOperation();
-
-        options = options || {};
-        options.from        && element.css(options.from);
-        options.to          && element.css(options.to);
-
-        if (options.addClass || options.removeClass) {
-          addRemoveClassesPostDigest(element, options.addClass, options.removeClass);
-        }
-
-        return new $$AnimateRunner(); // jshint ignore:line
-      }
-    };
-
-
-    function updateData(data, classes, value) {
-      var changed = false;
-      if (classes) {
-        classes = isString(classes) ? classes.split(' ') :
-                  isArray(classes) ? classes : [];
-        forEach(classes, function(className) {
-          if (className) {
-            changed = true;
-            data[className] = value;
-          }
-        });
-      }
-      return changed;
-    }
-
-    function handleCSSClassChanges() {
-      forEach(postDigestElements, function(element) {
-        var data = postDigestQueue.get(element);
-        if (data) {
-          var existing = splitClasses(element.attr('class'));
-          var toAdd = '';
-          var toRemove = '';
-          forEach(data, function(status, className) {
-            var hasClass = !!existing[className];
-            if (status !== hasClass) {
-              if (status) {
-                toAdd += (toAdd.length ? ' ' : '') + className;
-              } else {
-                toRemove += (toRemove.length ? ' ' : '') + className;
-              }
-            }
-          });
-
-          forEach(element, function(elm) {
-            toAdd    && jqLiteAddClass(elm, toAdd);
-            toRemove && jqLiteRemoveClass(elm, toRemove);
-          });
-          postDigestQueue.remove(element);
-        }
-      });
-      postDigestElements.length = 0;
-    }
-
-
-    function addRemoveClassesPostDigest(element, add, remove) {
-      var data = postDigestQueue.get(element) || {};
-
-      var classesAdded = updateData(data, add, true);
-      var classesRemoved = updateData(data, remove, false);
-
-      if (classesAdded || classesRemoved) {
-
-        postDigestQueue.put(element, data);
-        postDigestElements.push(element);
-
-        if (postDigestElements.length === 1) {
-          $rootScope.$$postDigest(handleCSSClassChanges);
-        }
-      }
-    }
-  }];
-};
-
-/**
- * @ngdoc provider
- * @name $animateProvider
- *
- * @description
- * Default implementation of $animate that doesn't perform any animations, instead just
- * synchronously performs DOM updates and resolves the returned runner promise.
- *
- * In order to enable animations the `ngAnimate` module has to be loaded.
- *
- * To see the functional implementation check out `src/ngAnimate/animate.js`.
- */
-var $AnimateProvider = ['$provide', function($provide) {
-  var provider = this;
-
-  this.$$registeredAnimations = Object.create(null);
-
-   /**
-   * @ngdoc method
-   * @name $animateProvider#register
-   *
-   * @description
-   * Registers a new injectable animation factory function. The factory function produces the
-   * animation object which contains callback functions for each event that is expected to be
-   * animated.
-   *
-   *   * `eventFn`: `function(element, ... , doneFunction, options)`
-   *   The element to animate, the `doneFunction` and the options fed into the animation. Depending
-   *   on the type of animation additional arguments will be injected into the animation function. The
-   *   list below explains the function signatures for the different animation methods:
-   *
-   *   - setClass: function(element, addedClasses, removedClasses, doneFunction, options)
-   *   - addClass: function(element, addedClasses, doneFunction, options)
-   *   - removeClass: function(element, removedClasses, doneFunction, options)
-   *   - enter, leave, move: function(element, doneFunction, options)
-   *   - animate: function(element, fromStyles, toStyles, doneFunction, options)
-   *
-   *   Make sure to trigger the `doneFunction` once the animation is fully complete.
-   *
-   * ```js
-   *   return {
-   *     //enter, leave, move signature
-   *     eventFn : function(element, done, options) {
-   *       //code to run the animation
-   *       //once complete, then run done()
-   *       return function endFunction(wasCancelled) {
-   *         //code to cancel the animation
-   *       }
-   *     }
-   *   }
-   * ```
-   *
-   * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to).
-   * @param {Function} factory The factory function that will be executed to return the animation
-   *                           object.
-   */
-  this.register = function(name, factory) {
-    if (name && name.charAt(0) !== '.') {
-      throw $animateMinErr('notcsel', "Expecting class selector starting with '.' got '{0}'.", name);
-    }
-
-    var key = name + '-animation';
-    provider.$$registeredAnimations[name.substr(1)] = key;
-    $provide.factory(key, factory);
-  };
-
-  /**
-   * @ngdoc method
-   * @name $animateProvider#classNameFilter
-   *
-   * @description
-   * Sets and/or returns the CSS class regular expression that is checked when performing
-   * an animation. Upon bootstrap the classNameFilter value is not set at all and will
-   * therefore enable $animate to attempt to perform an animation on any element that is triggered.
-   * When setting the `classNameFilter` value, animations will only be performed on elements
-   * that successfully match the filter expression. This in turn can boost performance
-   * for low-powered devices as well as applications containing a lot of structural operations.
-   * @param {RegExp=} expression The className expression which will be checked against all animations
-   * @return {RegExp} The current CSS className expression value. If null then there is no expression value
-   */
-  this.classNameFilter = function(expression) {
-    if (arguments.length === 1) {
-      this.$$classNameFilter = (expression instanceof RegExp) ? expression : null;
-      if (this.$$classNameFilter) {
-        var reservedRegex = new RegExp("(\\s+|\\/)" + NG_ANIMATE_CLASSNAME + "(\\s+|\\/)");
-        if (reservedRegex.test(this.$$classNameFilter.toString())) {
-          throw $animateMinErr('nongcls','$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.', NG_ANIMATE_CLASSNAME);
-
-        }
-      }
-    }
-    return this.$$classNameFilter;
-  };
-
-  this.$get = ['$$animateQueue', function($$animateQueue) {
-    function domInsert(element, parentElement, afterElement) {
-      // if for some reason the previous element was removed
-      // from the dom sometime before this code runs then let's
-      // just stick to using the parent element as the anchor
-      if (afterElement) {
-        var afterNode = extractElementNode(afterElement);
-        if (afterNode && !afterNode.parentNode && !afterNode.previousElementSibling) {
-          afterElement = null;
-        }
-      }
-      afterElement ? afterElement.after(element) : parentElement.prepend(element);
-    }
-
-    /**
-     * @ngdoc service
-     * @name $animate
-     * @description The $animate service exposes a series of DOM utility methods that provide support
-     * for animation hooks. The default behavior is the application of DOM operations, however,
-     * when an animation is detected (and animations are enabled), $animate will do the heavy lifting
-     * to ensure that animation runs with the triggered DOM operation.
-     *
-     * By default $animate doesn't trigger an animations. This is because the `ngAnimate` module isn't
-     * included and only when it is active then the animation hooks that `$animate` triggers will be
-     * functional. Once active then all structural `ng-` directives will trigger animations as they perform
-     * their DOM-related operations (enter, leave and move). Other directives such as `ngClass`,
-     * `ngShow`, `ngHide` and `ngMessages` also provide support for animations.
-     *
-     * It is recommended that the`$animate` service is always used when executing DOM-related procedures within directives.
-     *
-     * To learn more about enabling animation support, click here to visit the
-     * {@link ngAnimate ngAnimate module page}.
-     */
-    return {
-      // we don't call it directly since non-existant arguments may
-      // be interpreted as null within the sub enabled function
-
-      /**
-       *
-       * @ngdoc method
-       * @name $animate#on
-       * @kind function
-       * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)
-       *    has fired on the given element or among any of its children. Once the listener is fired, the provided callback
-       *    is fired with the following params:
-       *
-       * ```js
-       * $animate.on('enter', container,
-       *    function callback(element, phase) {
-       *      // cool we detected an enter animation within the container
-       *    }
-       * );
-       * ```
-       *
-       * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)
-       * @param {DOMElement} container the container element that will capture each of the animation events that are fired on itself
-       *     as well as among its children
-       * @param {Function} callback the callback function that will be fired when the listener is triggered
-       *
-       * The arguments present in the callback function are:
-       * * `element` - The captured DOM element that the animation was fired on.
-       * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends).
-       */
-      on: $$animateQueue.on,
-
-      /**
-       *
-       * @ngdoc method
-       * @name $animate#off
-       * @kind function
-       * @description Deregisters an event listener based on the event which has been associated with the provided element. This method
-       * can be used in three different ways depending on the arguments:
-       *
-       * ```js
-       * // remove all the animation event listeners listening for `enter`
-       * $animate.off('enter');
-       *
-       * // remove all the animation event listeners listening for `enter` on the given element and its children
-       * $animate.off('enter', container);
-       *
-       * // remove the event listener function provided by `listenerFn` that is set
-       * // to listen for `enter` on the given `element` as well as its children
-       * $animate.off('enter', container, callback);
-       * ```
-       *
-       * @param {string} event the animation event (e.g. enter, leave, move, addClass, removeClass, etc...)
-       * @param {DOMElement=} container the container element the event listener was placed on
-       * @param {Function=} callback the callback function that was registered as the listener
-       */
-      off: $$animateQueue.off,
-
-      /**
-       * @ngdoc method
-       * @name $animate#pin
-       * @kind function
-       * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists
-       *    outside of the DOM structure of the Angular application. By doing so, any animation triggered via `$animate` can be issued on the
-       *    element despite being outside the realm of the application or within another application. Say for example if the application
-       *    was bootstrapped on an element that is somewhere inside of the `<body>` tag, but we wanted to allow for an element to be situated
-       *    as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind
-       *    that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.
-       *
-       *    Note that this feature is only active when the `ngAnimate` module is used.
-       *
-       * @param {DOMElement} element the external element that will be pinned
-       * @param {DOMElement} parentElement the host parent element that will be associated with the external element
-       */
-      pin: $$animateQueue.pin,
-
-      /**
-       *
-       * @ngdoc method
-       * @name $animate#enabled
-       * @kind function
-       * @description Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This
-       * function can be called in four ways:
-       *
-       * ```js
-       * // returns true or false
-       * $animate.enabled();
-       *
-       * // changes the enabled state for all animations
-       * $animate.enabled(false);
-       * $animate.enabled(true);
-       *
-       * // returns true or false if animations are enabled for an element
-       * $animate.enabled(element);
-       *
-       * // changes the enabled state for an element and its children
-       * $animate.enabled(element, true);
-       * $animate.enabled(element, false);
-       * ```
-       *
-       * @param {DOMElement=} element the element that will be considered for checking/setting the enabled state
-       * @param {boolean=} enabled whether or not the animations will be enabled for the element
-       *
-       * @return {boolean} whether or not animations are enabled
-       */
-      enabled: $$animateQueue.enabled,
-
-      /**
-       * @ngdoc method
-       * @name $animate#cancel
-       * @kind function
-       * @description Cancels the provided animation.
-       *
-       * @param {Promise} animationPromise The animation promise that is returned when an animation is started.
-       */
-      cancel: function(runner) {
-        runner.end && runner.end();
-      },
-
-      /**
-       *
-       * @ngdoc method
-       * @name $animate#enter
-       * @kind function
-       * @description Inserts the element into the DOM either after the `after` element (if provided) or
-       *   as the first child within the `parent` element and then triggers an animation.
-       *   A promise is returned that will be resolved during the next digest once the animation
-       *   has completed.
-       *
-       * @param {DOMElement} element the element which will be inserted into the DOM
-       * @param {DOMElement} parent the parent element which will append the element as
-       *   a child (so long as the after element is not present)
-       * @param {DOMElement=} after the sibling element after which the element will be appended
-       * @param {object=} options an optional collection of options/styles that will be applied to the element
-       *
-       * @return {Promise} the animation callback promise
-       */
-      enter: function(element, parent, after, options) {
-        parent = parent && jqLite(parent);
-        after = after && jqLite(after);
-        parent = parent || after.parent();
-        domInsert(element, parent, after);
-        return $$animateQueue.push(element, 'enter', prepareAnimateOptions(options));
-      },
-
-      /**
-       *
-       * @ngdoc method
-       * @name $animate#move
-       * @kind function
-       * @description Inserts (moves) the element into its new position in the DOM either after
-       *   the `after` element (if provided) or as the first child within the `parent` element
-       *   and then triggers an animation. A promise is returned that will be resolved
-       *   during the next digest once the animation has completed.
-       *
-       * @param {DOMElement} element the element which will be moved into the new DOM position
-       * @param {DOMElement} parent the parent element which will append the element as
-       *   a child (so long as the after element is not present)
-       * @param {DOMElement=} after the sibling element after which the element will be appended
-       * @param {object=} options an optional collection of options/styles that will be applied to the element
-       *
-       * @return {Promise} the animation callback promise
-       */
-      move: function(element, parent, after, options) {
-        parent = parent && jqLite(parent);
-        after = after && jqLite(after);
-        parent = parent || after.parent();
-        domInsert(element, parent, after);
-        return $$animateQueue.push(element, 'move', prepareAnimateOptions(options));
-      },
-
-      /**
-       * @ngdoc method
-       * @name $animate#leave
-       * @kind function
-       * @description Triggers an animation and then removes the element from the DOM.
-       * When the function is called a promise is returned that will be resolved during the next
-       * digest once the animation has completed.
-       *
-       * @param {DOMElement} element the element which will be removed from the DOM
-       * @param {object=} options an optional collection of options/styles that will be applied to the element
-       *
-       * @return {Promise} the animation callback promise
-       */
-      leave: function(element, options) {
-        return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function() {
-          element.remove();
-        });
-      },
-
-      /**
-       * @ngdoc method
-       * @name $animate#addClass
-       * @kind function
-       *
-       * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon
-       *   execution, the addClass operation will only be handled after the next digest and it will not trigger an
-       *   animation if element already contains the CSS class or if the class is removed at a later step.
-       *   Note that class-based animations are treated differently compared to structural animations
-       *   (like enter, move and leave) since the CSS classes may be added/removed at different points
-       *   depending if CSS or JavaScript animations are used.
-       *
-       * @param {DOMElement} element the element which the CSS classes will be applied to
-       * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)
-       * @param {object=} options an optional collection of options/styles that will be applied to the element
-       *
-       * @return {Promise} the animation callback promise
-       */
-      addClass: function(element, className, options) {
-        options = prepareAnimateOptions(options);
-        options.addClass = mergeClasses(options.addclass, className);
-        return $$animateQueue.push(element, 'addClass', options);
-      },
-
-      /**
-       * @ngdoc method
-       * @name $animate#removeClass
-       * @kind function
-       *
-       * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon
-       *   execution, the removeClass operation will only be handled after the next digest and it will not trigger an
-       *   animation if element does not contain the CSS class or if the class is added at a later step.
-       *   Note that class-based animations are treated differently compared to structural animations
-       *   (like enter, move and leave) since the CSS classes may be added/removed at different points
-       *   depending if CSS or JavaScript animations are used.
-       *
-       * @param {DOMElement} element the element which the CSS classes will be applied to
-       * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)
-       * @param {object=} options an optional collection of options/styles that will be applied to the element
-       *
-       * @return {Promise} the animation callback promise
-       */
-      removeClass: function(element, className, options) {
-        options = prepareAnimateOptions(options);
-        options.removeClass = mergeClasses(options.removeClass, className);
-        return $$animateQueue.push(element, 'removeClass', options);
-      },
-
-      /**
-       * @ngdoc method
-       * @name $animate#setClass
-       * @kind function
-       *
-       * @description Performs both the addition and removal of a CSS classes on an element and (during the process)
-       *    triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and
-       *    `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has
-       *    passed. Note that class-based animations are treated differently compared to structural animations
-       *    (like enter, move and leave) since the CSS classes may be added/removed at different points
-       *    depending if CSS or JavaScript animations are used.
-       *
-       * @param {DOMElement} element the element which the CSS classes will be applied to
-       * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)
-       * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)
-       * @param {object=} options an optional collection of options/styles that will be applied to the element
-       *
-       * @return {Promise} the animation callback promise
-       */
-      setClass: function(element, add, remove, options) {
-        options = prepareAnimateOptions(options);
-        options.addClass = mergeClasses(options.addClass, add);
-        options.removeClass = mergeClasses(options.removeClass, remove);
-        return $$animateQueue.push(element, 'setClass', options);
-      },
-
-      /**
-       * @ngdoc method
-       * @name $animate#animate
-       * @kind function
-       *
-       * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element.
-       * If any detected CSS transition, keyframe or JavaScript matches the provided className value then the animation will take
-       * on the provided styles. For example, if a transition animation is set for the given className then the provided from and
-       * to styles will be applied alongside the given transition. If a JavaScript animation is detected then the provided styles
-       * will be given in as function paramters into the `animate` method (or as apart of the `options` parameter).
-       *
-       * @param {DOMElement} element the element which the CSS styles will be applied to
-       * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation.
-       * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation.
-       * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If
-       *    this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element.
-       *    (Note that if no animation is detected then this value will not be appplied to the element.)
-       * @param {object=} options an optional collection of options/styles that will be applied to the element
-       *
-       * @return {Promise} the animation callback promise
-       */
-      animate: function(element, from, to, className, options) {
-        options = prepareAnimateOptions(options);
-        options.from = options.from ? extend(options.from, from) : from;
-        options.to   = options.to   ? extend(options.to, to)     : to;
-
-        className = className || 'ng-inline-animate';
-        options.tempClasses = mergeClasses(options.tempClasses, className);
-        return $$animateQueue.push(element, 'animate', options);
-      }
-    };
-  }];
-}];
-
-/**
- * @ngdoc service
- * @name $animateCss
- * @kind object
- *
- * @description
- * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included,
- * then the `$animateCss` service will actually perform animations.
- *
- * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}.
- */
-var $CoreAnimateCssProvider = function() {
-  this.$get = ['$$rAF', '$q', function($$rAF, $q) {
-
-    var RAFPromise = function() {};
-    RAFPromise.prototype = {
-      done: function(cancel) {
-        this.defer && this.defer[cancel === true ? 'reject' : 'resolve']();
-      },
-      end: function() {
-        this.done();
-      },
-      cancel: function() {
-        this.done(true);
-      },
-      getPromise: function() {
-        if (!this.defer) {
-          this.defer = $q.defer();
-        }
-        return this.defer.promise;
-      },
-      then: function(f1,f2) {
-        return this.getPromise().then(f1,f2);
-      },
-      'catch': function(f1) {
-        return this.getPromise()['catch'](f1);
-      },
-      'finally': function(f1) {
-        return this.getPromise()['finally'](f1);
-      }
-    };
-
-    return function(element, options) {
-      // there is no point in applying the styles since
-      // there is no animation that goes on at all in
-      // this version of $animateCss.
-      if (options.cleanupStyles) {
-        options.from = options.to = null;
-      }
-
-      if (options.from) {
-        element.css(options.from);
-        options.from = null;
-      }
-
-      var closed, runner = new RAFPromise();
-      return {
-        start: run,
-        end: run
-      };
-
-      function run() {
-        $$rAF(function() {
-          close();
-          if (!closed) {
-            runner.done();
-          }
-          closed = true;
-        });
-        return runner;
-      }
-
-      function close() {
-        if (options.addClass) {
-          element.addClass(options.addClass);
-          options.addClass = null;
-        }
-        if (options.removeClass) {
-          element.removeClass(options.removeClass);
-          options.removeClass = null;
-        }
-        if (options.to) {
-          element.css(options.to);
-          options.to = null;
-        }
-      }
-    };
-  }];
-};
-
-/* global stripHash: true */
-
-/**
- * ! This is a private undocumented service !
- *
- * @name $browser
- * @requires $log
- * @description
- * This object has two goals:
- *
- * - hide all the global state in the browser caused by the window object
- * - abstract away all the browser specific features and inconsistencies
- *
- * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser`
- * service, which can be used for convenient testing of the application without the interaction with
- * the real browser apis.
- */
-/**
- * @param {object} window The global window object.
- * @param {object} document jQuery wrapped document.
- * @param {object} $log window.console or an object with the same interface.
- * @param {object} $sniffer $sniffer service
- */
-function Browser(window, document, $log, $sniffer) {
-  var self = this,
-      rawDocument = document[0],
-      location = window.location,
-      history = window.history,
-      setTimeout = window.setTimeout,
-      clearTimeout = window.clearTimeout,
-      pendingDeferIds = {};
-
-  self.isMock = false;
-
-  var outstandingRequestCount = 0;
-  var outstandingRequestCallbacks = [];
-
-  // TODO(vojta): remove this temporary api
-  self.$$completeOutstandingRequest = completeOutstandingRequest;
-  self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };
-
-  /**
-   * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`
-   * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
-   */
-  function completeOutstandingRequest(fn) {
-    try {
-      fn.apply(null, sliceArgs(arguments, 1));
-    } finally {
-      outstandingRequestCount--;
-      if (outstandingRequestCount === 0) {
-        while (outstandingRequestCallbacks.length) {
-          try {
-            outstandingRequestCallbacks.pop()();
-          } catch (e) {
-            $log.error(e);
-          }
-        }
-      }
-    }
-  }
-
-  function getHash(url) {
-    var index = url.indexOf('#');
-    return index === -1 ? '' : url.substr(index);
-  }
-
-  /**
-   * @private
-   * Note: this method is used only by scenario runner
-   * TODO(vojta): prefix this method with $$ ?
-   * @param {function()} callback Function that will be called when no outstanding request
-   */
-  self.notifyWhenNoOutstandingRequests = function(callback) {
-    if (outstandingRequestCount === 0) {
-      callback();
-    } else {
-      outstandingRequestCallbacks.push(callback);
-    }
-  };
-
-  //////////////////////////////////////////////////////////////
-  // URL API
-  //////////////////////////////////////////////////////////////
-
-  var cachedState, lastHistoryState,
-      lastBrowserUrl = location.href,
-      baseElement = document.find('base'),
-      pendingLocation = null;
-
-  cacheState();
-  lastHistoryState = cachedState;
-
-  /**
-   * @name $browser#url
-   *
-   * @description
-   * GETTER:
-   * Without any argument, this method just returns current value of location.href.
-   *
-   * SETTER:
-   * With at least one argument, this method sets url to new value.
-   * If html5 history api supported, pushState/replaceState is used, otherwise
-   * location.href/location.replace is used.
-   * Returns its own instance to allow chaining
-   *
-   * NOTE: this api is intended for use only by the $location service. Please use the
-   * {@link ng.$location $location service} to change url.
-   *
-   * @param {string} url New url (when used as setter)
-   * @param {boolean=} replace Should new url replace current history record?
-   * @param {object=} state object to use with pushState/replaceState
-   */
-  self.url = function(url, replace, state) {
-    // In modern browsers `history.state` is `null` by default; treating it separately
-    // from `undefined` would cause `$browser.url('/foo')` to change `history.state`
-    // to undefined via `pushState`. Instead, let's change `undefined` to `null` here.
-    if (isUndefined(state)) {
-      state = null;
-    }
-
-    // Android Browser BFCache causes location, history reference to become stale.
-    if (location !== window.location) location = window.location;
-    if (history !== window.history) history = window.history;
-
-    // setter
-    if (url) {
-      var sameState = lastHistoryState === state;
-
-      // Don't change anything if previous and current URLs and states match. This also prevents
-      // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode.
-      // See https://github.com/angular/angular.js/commit/ffb2701
-      if (lastBrowserUrl === url && (!$sniffer.history || sameState)) {
-        return self;
-      }
-      var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);
-      lastBrowserUrl = url;
-      lastHistoryState = state;
-      // Don't use history API if only the hash changed
-      // due to a bug in IE10/IE11 which leads
-      // to not firing a `hashchange` nor `popstate` event
-      // in some cases (see #9143).
-      if ($sniffer.history && (!sameBase || !sameState)) {
-        history[replace ? 'replaceState' : 'pushState'](state, '', url);
-        cacheState();
-        // Do the assignment again so that those two variables are referentially identical.
-        lastHistoryState = cachedState;
-      } else {
-        if (!sameBase || pendingLocation) {
-          pendingLocation = url;
-        }
-        if (replace) {
-          location.replace(url);
-        } else if (!sameBase) {
-          location.href = url;
-        } else {
-          location.hash = getHash(url);
-        }
-        if (location.href !== url) {
-          pendingLocation = url;
-        }
-      }
-      return self;
-    // getter
-    } else {
-      // - pendingLocation is needed as browsers don't allow to read out
-      //   the new location.href if a reload happened or if there is a bug like in iOS 9 (see
-      //   https://openradar.appspot.com/22186109).
-      // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172
-      return pendingLocation || location.href.replace(/%27/g,"'");
-    }
-  };
-
-  /**
-   * @name $browser#state
-   *
-   * @description
-   * This method is a getter.
-   *
-   * Return history.state or null if history.state is undefined.
-   *
-   * @returns {object} state
-   */
-  self.state = function() {
-    return cachedState;
-  };
-
-  var urlChangeListeners = [],
-      urlChangeInit = false;
-
-  function cacheStateAndFireUrlChange() {
-    pendingLocation = null;
-    cacheState();
-    fireUrlChange();
-  }
-
-  function getCurrentState() {
-    try {
-      return history.state;
-    } catch (e) {
-      // MSIE can reportedly throw when there is no state (UNCONFIRMED).
-    }
-  }
-
-  // This variable should be used *only* inside the cacheState function.
-  var lastCachedState = null;
-  function cacheState() {
-    // This should be the only place in $browser where `history.state` is read.
-    cachedState = getCurrentState();
-    cachedState = isUndefined(cachedState) ? null : cachedState;
-
-    // Prevent callbacks fo fire twice if both hashchange & popstate were fired.
-    if (equals(cachedState, lastCachedState)) {
-      cachedState = lastCachedState;
-    }
-    lastCachedState = cachedState;
-  }
-
-  function fireUrlChange() {
-    if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {
-      return;
-    }
-
-    lastBrowserUrl = self.url();
-    lastHistoryState = cachedState;
-    forEach(urlChangeListeners, function(listener) {
-      listener(self.url(), cachedState);
-    });
-  }
-
-  /**
-   * @name $browser#onUrlChange
-   *
-   * @description
-   * Register callback function that will be called, when url changes.
-   *
-   * It's only called when the url is changed from outside of angular:
-   * - user types different url into address bar
-   * - user clicks on history (forward/back) button
-   * - user clicks on a link
-   *
-   * It's not called when url is changed by $browser.url() method
-   *
-   * The listener gets called with new url as parameter.
-   *
-   * NOTE: this api is intended for use only by the $location service. Please use the
-   * {@link ng.$location $location service} to monitor url changes in angular apps.
-   *
-   * @param {function(string)} listener Listener function to be called when url changes.
-   * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.
-   */
-  self.onUrlChange = function(callback) {
-    // TODO(vojta): refactor to use node's syntax for events
-    if (!urlChangeInit) {
-      // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)
-      // don't fire popstate when user change the address bar and don't fire hashchange when url
-      // changed by push/replaceState
-
-      // html5 history api - popstate event
-      if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange);
-      // hashchange event
-      jqLite(window).on('hashchange', cacheStateAndFireUrlChange);
-
-      urlChangeInit = true;
-    }
-
-    urlChangeListeners.push(callback);
-    return callback;
-  };
-
-  /**
-   * @private
-   * Remove popstate and hashchange handler from window.
-   *
-   * NOTE: this api is intended for use only by $rootScope.
-   */
-  self.$$applicationDestroyed = function() {
-    jqLite(window).off('hashchange popstate', cacheStateAndFireUrlChange);
-  };
-
-  /**
-   * Checks whether the url has changed outside of Angular.
-   * Needs to be exported to be able to check for changes that have been done in sync,
-   * as hashchange/popstate events fire in async.
-   */
-  self.$$checkUrlChange = fireUrlChange;
-
-  //////////////////////////////////////////////////////////////
-  // Misc API
-  //////////////////////////////////////////////////////////////
-
-  /**
-   * @name $browser#baseHref
-   *
-   * @description
-   * Returns current <base href>
-   * (always relative - without domain)
-   *
-   * @returns {string} The current base href
-   */
-  self.baseHref = function() {
-    var href = baseElement.attr('href');
-    return href ? href.replace(/^(https?\:)?\/\/[^\/]*/, '') : '';
-  };
-
-  /**
-   * @name $browser#defer
-   * @param {function()} fn A function, who's execution should be deferred.
-   * @param {number=} [delay=0] of milliseconds to defer the function execution.
-   * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.
-   *
-   * @description
-   * Executes a fn asynchronously via `setTimeout(fn, delay)`.
-   *
-   * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using
-   * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed
-   * via `$browser.defer.flush()`.
-   *
-   */
-  self.defer = function(fn, delay) {
-    var timeoutId;
-    outstandingRequestCount++;
-    timeoutId = setTimeout(function() {
-      delete pendingDeferIds[timeoutId];
-      completeOutstandingRequest(fn);
-    }, delay || 0);
-    pendingDeferIds[timeoutId] = true;
-    return timeoutId;
-  };
-
-
-  /**
-   * @name $browser#defer.cancel
-   *
-   * @description
-   * Cancels a deferred task identified with `deferId`.
-   *
-   * @param {*} deferId Token returned by the `$browser.defer` function.
-   * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully
-   *                    canceled.
-   */
-  self.defer.cancel = function(deferId) {
-    if (pendingDeferIds[deferId]) {
-      delete pendingDeferIds[deferId];
-      clearTimeout(deferId);
-      completeOutstandingRequest(noop);
-      return true;
-    }
-    return false;
-  };
-
-}
-
-function $BrowserProvider() {
-  this.$get = ['$window', '$log', '$sniffer', '$document',
-      function($window, $log, $sniffer, $document) {
-        return new Browser($window, $document, $log, $sniffer);
-      }];
-}
-
-/**
- * @ngdoc service
- * @name $cacheFactory
- *
- * @description
- * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to
- * them.
- *
- * ```js
- *
- *  var cache = $cacheFactory('cacheId');
- *  expect($cacheFactory.get('cacheId')).toBe(cache);
- *  expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();
- *
- *  cache.put("key", "value");
- *  cache.put("another key", "another value");
- *
- *  // We've specified no options on creation
- *  expect(cache.info()).toEqual({id: 'cacheId', size: 2});
- *
- * ```
- *
- *
- * @param {string} cacheId Name or id of the newly created cache.
- * @param {object=} options Options object that specifies the cache behavior. Properties:
- *
- *   - `{number=}` `capacity` — turns the cache into LRU cache.
- *
- * @returns {object} Newly created cache object with the following set of methods:
- *
- * - `{object}` `info()` — Returns id, size, and options of cache.
- * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns
- *   it.
- * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.
- * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.
- * - `{void}` `removeAll()` — Removes all cached values.
- * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory.
- *
- * @example
-   <example module="cacheExampleApp">
-     <file name="index.html">
-       <div ng-controller="CacheController">
-         <input ng-model="newCacheKey" placeholder="Key">
-         <input ng-model="newCacheValue" placeholder="Value">
-         <button ng-click="put(newCacheKey, newCacheValue)">Cache</button>
-
-         <p ng-if="keys.length">Cached Values</p>
-         <div ng-repeat="key in keys">
-           <span ng-bind="key"></span>
-           <span>: </span>
-           <b ng-bind="cache.get(key)"></b>
-         </div>
-
-         <p>Cache Info</p>
-         <div ng-repeat="(key, value) in cache.info()">
-           <span ng-bind="key"></span>
-           <span>: </span>
-           <b ng-bind="value"></b>
-         </div>
-       </div>
-     </file>
-     <file name="script.js">
-       angular.module('cacheExampleApp', []).
-         controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {
-           $scope.keys = [];
-           $scope.cache = $cacheFactory('cacheId');
-           $scope.put = function(key, value) {
-             if (angular.isUndefined($scope.cache.get(key))) {
-               $scope.keys.push(key);
-             }
-             $scope.cache.put(key, angular.isUndefined(value) ? null : value);
-           };
-         }]);
-     </file>
-     <file name="style.css">
-       p {
-         margin: 10px 0 3px;
-       }
-     </file>
-   </example>
- */
-function $CacheFactoryProvider() {
-
-  this.$get = function() {
-    var caches = {};
-
-    function cacheFactory(cacheId, options) {
-      if (cacheId in caches) {
-        throw minErr('$cacheFactory')('iid', "CacheId '{0}' is already taken!", cacheId);
-      }
-
-      var size = 0,
-          stats = extend({}, options, {id: cacheId}),
-          data = {},
-          capacity = (options && options.capacity) || Number.MAX_VALUE,
-          lruHash = {},
-          freshEnd = null,
-          staleEnd = null;
-
-      /**
-       * @ngdoc type
-       * @name $cacheFactory.Cache
-       *
-       * @description
-       * A cache object used to store and retrieve data, primarily used by
-       * {@link $http $http} and the {@link ng.directive:script script} directive to cache
-       * templates and other data.
-       *
-       * ```js
-       *  angular.module('superCache')
-       *    .factory('superCache', ['$cacheFactory', function($cacheFactory) {
-       *      return $cacheFactory('super-cache');
-       *    }]);
-       * ```
-       *
-       * Example test:
-       *
-       * ```js
-       *  it('should behave like a cache', inject(function(superCache) {
-       *    superCache.put('key', 'value');
-       *    superCache.put('another key', 'another value');
-       *
-       *    expect(superCache.info()).toEqual({
-       *      id: 'super-cache',
-       *      size: 2
-       *    });
-       *
-       *    superCache.remove('another key');
-       *    expect(superCache.get('another key')).toBeUndefined();
-       *
-       *    superCache.removeAll();
-       *    expect(superCache.info()).toEqual({
-       *      id: 'super-cache',
-       *      size: 0
-       *    });
-       *  }));
-       * ```
-       */
-      return caches[cacheId] = {
-
-        /**
-         * @ngdoc method
-         * @name $cacheFactory.Cache#put
-         * @kind function
-         *
-         * @description
-         * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be
-         * retrieved later, and incrementing the size of the cache if the key was not already
-         * present in the cache. If behaving like an LRU cache, it will also remove stale
-         * entries from the set.
-         *
-         * It will not insert undefined values into the cache.
-         *
-         * @param {string} key the key under which the cached data is stored.
-         * @param {*} value the value to store alongside the key. If it is undefined, the key
-         *    will not be stored.
-         * @returns {*} the value stored.
-         */
-        put: function(key, value) {
-          if (isUndefined(value)) return;
-          if (capacity < Number.MAX_VALUE) {
-            var lruEntry = lruHash[key] || (lruHash[key] = {key: key});
-
-            refresh(lruEntry);
-          }
-
-          if (!(key in data)) size++;
-          data[key] = value;
-
-          if (size > capacity) {
-            this.remove(staleEnd.key);
-          }
-
-          return value;
-        },
-
-        /**
-         * @ngdoc method
-         * @name $cacheFactory.Cache#get
-         * @kind function
-         *
-         * @description
-         * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object.
-         *
-         * @param {string} key the key of the data to be retrieved
-         * @returns {*} the value stored.
-         */
-        get: function(key) {
-          if (capacity < Number.MAX_VALUE) {
-            var lruEntry = lruHash[key];
-
-            if (!lruEntry) return;
-
-            refresh(lruEntry);
-          }
-
-          return data[key];
-        },
-
-
-        /**
-         * @ngdoc method
-         * @name $cacheFactory.Cache#remove
-         * @kind function
-         *
-         * @description
-         * Removes an entry from the {@link $cacheFactory.Cache Cache} object.
-         *
-         * @param {string} key the key of the entry to be removed
-         */
-        remove: function(key) {
-          if (capacity < Number.MAX_VALUE) {
-            var lruEntry = lruHash[key];
-
-            if (!lruEntry) return;
-
-            if (lruEntry == freshEnd) freshEnd = lruEntry.p;
-            if (lruEntry == staleEnd) staleEnd = lruEntry.n;
-            link(lruEntry.n,lruEntry.p);
-
-            delete lruHash[key];
-          }
-
-          delete data[key];
-          size--;
-        },
-
-
-        /**
-         * @ngdoc method
-         * @name $cacheFactory.Cache#removeAll
-         * @kind function
-         *
-         * @description
-         * Clears the cache object of any entries.
-         */
-        removeAll: function() {
-          data = {};
-          size = 0;
-          lruHash = {};
-          freshEnd = staleEnd = null;
-        },
-
-
-        /**
-         * @ngdoc method
-         * @name $cacheFactory.Cache#destroy
-         * @kind function
-         *
-         * @description
-         * Destroys the {@link $cacheFactory.Cache Cache} object entirely,
-         * removing it from the {@link $cacheFactory $cacheFactory} set.
-         */
-        destroy: function() {
-          data = null;
-          stats = null;
-          lruHash = null;
-          delete caches[cacheId];
-        },
-
-
-        /**
-         * @ngdoc method
-         * @name $cacheFactory.Cache#info
-         * @kind function
-         *
-         * @description
-         * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}.
-         *
-         * @returns {object} an object with the following properties:
-         *   <ul>
-         *     <li>**id**: the id of the cache instance</li>
-         *     <li>**size**: the number of entries kept in the cache instance</li>
-         *     <li>**...**: any additional properties from the options object when creating the
-         *       cache.</li>
-         *   </ul>
-         */
-        info: function() {
-          return extend({}, stats, {size: size});
-        }
-      };
-
-
-      /**
-       * makes the `entry` the freshEnd of the LRU linked list
-       */
-      function refresh(entry) {
-        if (entry != freshEnd) {
-          if (!staleEnd) {
-            staleEnd = entry;
-          } else if (staleEnd == entry) {
-            staleEnd = entry.n;
-          }
-
-          link(entry.n, entry.p);
-          link(entry, freshEnd);
-          freshEnd = entry;
-          freshEnd.n = null;
-        }
-      }
-
-
-      /**
-       * bidirectionally links two entries of the LRU linked list
-       */
-      function link(nextEntry, prevEntry) {
-        if (nextEntry != prevEntry) {
-          if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify
-          if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify
-        }
-      }
-    }
-
-
-  /**
-   * @ngdoc method
-   * @name $cacheFactory#info
-   *
-   * @description
-   * Get information about all the caches that have been created
-   *
-   * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info`
-   */
-    cacheFactory.info = function() {
-      var info = {};
-      forEach(caches, function(cache, cacheId) {
-        info[cacheId] = cache.info();
-      });
-      return info;
-    };
-
-
-  /**
-   * @ngdoc method
-   * @name $cacheFactory#get
-   *
-   * @description
-   * Get access to a cache object by the `cacheId` used when it was created.
-   *
-   * @param {string} cacheId Name or id of a cache to access.
-   * @returns {object} Cache object identified by the cacheId or undefined if no such cache.
-   */
-    cacheFactory.get = function(cacheId) {
-      return caches[cacheId];
-    };
-
-
-    return cacheFactory;
-  };
-}
-
-/**
- * @ngdoc service
- * @name $templateCache
- *
- * @description
- * The first time a template is used, it is loaded in the template cache for quick retrieval. You
- * can load templates directly into the cache in a `script` tag, or by consuming the
- * `$templateCache` service directly.
- *
- * Adding via the `script` tag:
- *
- * ```html
- *   <script type="text/ng-template" id="templateId.html">
- *     <p>This is the content of the template</p>
- *   </script>
- * ```
- *
- * **Note:** the `script` tag containing the template does not need to be included in the `head` of
- * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE,
- * element with ng-app attribute), otherwise the template will be ignored.
- *
- * Adding via the `$templateCache` service:
- *
- * ```js
- * var myApp = angular.module('myApp', []);
- * myApp.run(function($templateCache) {
- *   $templateCache.put('templateId.html', 'This is the content of the template');
- * });
- * ```
- *
- * To retrieve the template later, simply use it in your HTML:
- * ```html
- * <div ng-include=" 'templateId.html' "></div>
- * ```
- *
- * or get it via Javascript:
- * ```js
- * $templateCache.get('templateId.html')
- * ```
- *
- * See {@link ng.$cacheFactory $cacheFactory}.
- *
- */
-function $TemplateCacheProvider() {
-  this.$get = ['$cacheFactory', function($cacheFactory) {
-    return $cacheFactory('templates');
-  }];
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *     Any commits to this file should be reviewed with security in mind.  *
- *   Changes to this file can potentially create security vulnerabilities. *
- *          An approval from 2 Core members with history of modifying      *
- *                         this file is required.                          *
- *                                                                         *
- *  Does the change somehow allow for arbitrary javascript to be executed? *
- *    Or allows for someone to change the prototype of built-in objects?   *
- *     Or gives undesired access to variables likes document or window?    *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!
- *
- * DOM-related variables:
- *
- * - "node" - DOM Node
- * - "element" - DOM Element or Node
- * - "$node" or "$element" - jqLite-wrapped node or element
- *
- *
- * Compiler related stuff:
- *
- * - "linkFn" - linking fn of a single directive
- * - "nodeLinkFn" - function that aggregates all linking fns for a particular node
- * - "childLinkFn" -  function that aggregates all linking fns for child nodes of a particular node
- * - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList)
- */
-
-
-/**
- * @ngdoc service
- * @name $compile
- * @kind function
- *
- * @description
- * Compiles an HTML string or DOM into a template and produces a template function, which
- * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.
- *
- * The compilation is a process of walking the DOM tree and matching DOM elements to
- * {@link ng.$compileProvider#directive directives}.
- *
- * <div class="alert alert-warning">
- * **Note:** This document is an in-depth reference of all directive options.
- * For a gentle introduction to directives with examples of common use cases,
- * see the {@link guide/directive directive guide}.
- * </div>
- *
- * ## Comprehensive Directive API
- *
- * There are many different options for a directive.
- *
- * The difference resides in the return value of the factory function.
- * You can either return a "Directive Definition Object" (see below) that defines the directive properties,
- * or just the `postLink` function (all other properties will have the default values).
- *
- * <div class="alert alert-success">
- * **Best Practice:** It's recommended to use the "directive definition object" form.
- * </div>
- *
- * Here's an example directive declared with a Directive Definition Object:
- *
- * ```js
- *   var myModule = angular.module(...);
- *
- *   myModule.directive('directiveName', function factory(injectables) {
- *     var directiveDefinitionObject = {
- *       priority: 0,
- *       template: '<div></div>', // or // function(tElement, tAttrs) { ... },
- *       // or
- *       // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... },
- *       transclude: false,
- *       restrict: 'A',
- *       templateNamespace: 'html',
- *       scope: false,
- *       controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },
- *       controllerAs: 'stringIdentifier',
- *       bindToController: false,
- *       require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'],
- *       compile: function compile(tElement, tAttrs, transclude) {
- *         return {
- *           pre: function preLink(scope, iElement, iAttrs, controller) { ... },
- *           post: function postLink(scope, iElement, iAttrs, controller) { ... }
- *         }
- *         // or
- *         // return function postLink( ... ) { ... }
- *       },
- *       // or
- *       // link: {
- *       //  pre: function preLink(scope, iElement, iAttrs, controller) { ... },
- *       //  post: function postLink(scope, iElement, iAttrs, controller) { ... }
- *       // }
- *       // or
- *       // link: function postLink( ... ) { ... }
- *     };
- *     return directiveDefinitionObject;
- *   });
- * ```
- *
- * <div class="alert alert-warning">
- * **Note:** Any unspecified options will use the default value. You can see the default values below.
- * </div>
- *
- * Therefore the above can be simplified as:
- *
- * ```js
- *   var myModule = angular.module(...);
- *
- *   myModule.directive('directiveName', function factory(injectables) {
- *     var directiveDefinitionObject = {
- *       link: function postLink(scope, iElement, iAttrs) { ... }
- *     };
- *     return directiveDefinitionObject;
- *     // or
- *     // return function postLink(scope, iElement, iAttrs) { ... }
- *   });
- * ```
- *
- *
- *
- * ### Directive Definition Object
- *
- * The directive definition object provides instructions to the {@link ng.$compile
- * compiler}. The attributes are:
- *
- * #### `multiElement`
- * When this property is set to true, the HTML compiler will collect DOM nodes between
- * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them
- * together as the directive elements. It is recommended that this feature be used on directives
- * which are not strictly behavioural (such as {@link ngClick}), and which
- * do not manipulate or replace child nodes (such as {@link ngInclude}).
- *
- * #### `priority`
- * When there are multiple directives defined on a single DOM element, sometimes it
- * is necessary to specify the order in which the directives are applied. The `priority` is used
- * to sort the directives before their `compile` functions get called. Priority is defined as a
- * number. Directives with greater numerical `priority` are compiled first. Pre-link functions
- * are also run in priority order, but post-link functions are run in reverse order. The order
- * of directives with the same priority is undefined. The default priority is `0`.
- *
- * #### `terminal`
- * If set to true then the current `priority` will be the last set of directives
- * which will execute (any directives at the current priority will still execute
- * as the order of execution on same `priority` is undefined). Note that expressions
- * and other directives used in the directive's template will also be excluded from execution.
- *
- * #### `scope`
- * The scope property can be `true`, an object or a falsy value:
- *
- * * **falsy:** No scope will be created for the directive. The directive will use its parent's scope.
- *
- * * **`true`:** A new child scope that prototypically inherits from its parent will be created for
- * the directive's element. If multiple directives on the same element request a new scope,
- * only one new scope is created. The new scope rule does not apply for the root of the template
- * since the root of the template always gets a new scope.
- *
- * * **`{...}` (an object hash):** A new "isolate" scope is created for the directive's element. The
- * 'isolate' scope differs from normal scope in that it does not prototypically inherit from its parent
- * scope. This is useful when creating reusable components, which should not accidentally read or modify
- * data in the parent scope.
- *
- * The 'isolate' scope object hash defines a set of local scope properties derived from attributes on the
- * directive's element. These local properties are useful for aliasing values for templates. The keys in
- * the object hash map to the name of the property on the isolate scope; the values define how the property
- * is bound to the parent scope, via matching attributes on the directive's element:
- *
- * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is
- *   always a string since DOM attributes are strings. If no `attr` name is specified  then the
- *   attribute name is assumed to be the same as the local name.
- *   Given `<widget my-attr="hello {{name}}">` and widget definition
- *   of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect
- *   the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the
- *   `localName` property on the widget scope. The `name` is read from the parent scope (not
- *   component scope).
- *
- * * `=` or `=attr` - set up bi-directional binding between a local scope property and the
- *   parent scope property of name defined via the value of the `attr` attribute. If no `attr`
- *   name is specified then the attribute name is assumed to be the same as the local name.
- *   Given `<widget my-attr="parentModel">` and widget definition of
- *   `scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the
- *   value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected
- *   in `localModel` and any changes in `localModel` will reflect in `parentModel`. If the parent
- *   scope property doesn't exist, it will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception. You
- *   can avoid this behavior using `=?` or `=?attr` in order to flag the property as optional. If
- *   you want to shallow watch for changes (i.e. $watchCollection instead of $watch) you can use
- *   `=*` or `=*attr` (`=*?` or `=*?attr` if the property is optional).
- *
- * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope.
- *   If no `attr` name is specified then the attribute name is assumed to be the same as the
- *   local name. Given `<widget my-attr="count = count + value">` and widget definition of
- *   `scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to
- *   a function wrapper for the `count = count + value` expression. Often it's desirable to
- *   pass data from the isolated scope via an expression to the parent scope, this can be
- *   done by passing a map of local variable names and values into the expression wrapper fn.
- *   For example, if the expression is `increment(amount)` then we can specify the amount value
- *   by calling the `localFn` as `localFn({amount: 22})`.
- *
- * In general it's possible to apply more than one directive to one element, but there might be limitations
- * depending on the type of scope required by the directives. The following points will help explain these limitations.
- * For simplicity only two directives are taken into account, but it is also applicable for several directives:
- *
- * * **no scope** + **no scope** => Two directives which don't require their own scope will use their parent's scope
- * * **child scope** + **no scope** =>  Both directives will share one single child scope
- * * **child scope** + **child scope** =>  Both directives will share one single child scope
- * * **isolated scope** + **no scope** =>  The isolated directive will use it's own created isolated scope. The other directive will use
- * its parent's scope
- * * **isolated scope** + **child scope** =>  **Won't work!** Only one scope can be related to one element. Therefore these directives cannot
- * be applied to the same element.
- * * **isolated scope** + **isolated scope**  =>  **Won't work!** Only one scope can be related to one element. Therefore these directives
- * cannot be applied to the same element.
- *
- *
- * #### `bindToController`
- * When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will
- * allow a component to have its properties bound to the controller, rather than to scope. When the controller
- * is instantiated, the initial values of the isolate scope bindings are already available.
- *
- * #### `controller`
- * Controller constructor function. The controller is instantiated before the
- * pre-linking phase and can be accessed by other directives (see
- * `require` attribute). This allows the directives to communicate with each other and augment
- * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals:
- *
- * * `$scope` - Current scope associated with the element
- * * `$element` - Current element
- * * `$attrs` - Current attributes object for the element
- * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:
- *   `function([scope], cloneLinkingFn, futureParentElement)`.
- *    * `scope`: optional argument to override the scope.
- *    * `cloneLinkingFn`: optional argument to create clones of the original transcluded content.
- *    * `futureParentElement`:
- *        * defines the parent to which the `cloneLinkingFn` will add the cloned elements.
- *        * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`.
- *        * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements)
- *          and when the `cloneLinkinFn` is passed,
- *          as those elements need to created and cloned in a special way when they are defined outside their
- *          usual containers (e.g. like `<svg>`).
- *        * See also the `directive.templateNamespace` property.
- *
- *
- * #### `require`
- * Require another directive and inject its controller as the fourth argument to the linking function. The
- * `require` takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the
- * injected argument will be an array in corresponding order. If no such directive can be
- * found, or if the directive does not have a controller, then an error is raised (unless no link function
- * is specified, in which case error checking is skipped). The name can be prefixed with:
- *
- * * (no prefix) - Locate the required controller on the current element. Throw an error if not found.
- * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.
- * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found.
- * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found.
- * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass
- *   `null` to the `link` fn if not found.
- * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass
- *   `null` to the `link` fn if not found.
- *
- *
- * #### `controllerAs`
- * Identifier name for a reference to the controller in the directive's scope.
- * This allows the controller to be referenced from the directive template. This is especially
- * useful when a directive is used as component, i.e. with an `isolate` scope. It's also possible
- * to use it in a directive without an `isolate` / `new` scope, but you need to be aware that the
- * `controllerAs` reference might overwrite a property that already exists on the parent scope.
- *
- *
- * #### `restrict`
- * String of subset of `EACM` which restricts the directive to a specific directive
- * declaration style. If omitted, the defaults (elements and attributes) are used.
- *
- * * `E` - Element name (default): `<my-directive></my-directive>`
- * * `A` - Attribute (default): `<div my-directive="exp"></div>`
- * * `C` - Class: `<div class="my-directive: exp;"></div>`
- * * `M` - Comment: `<!-- directive: my-directive exp -->`
- *
- *
- * #### `templateNamespace`
- * String representing the document type used by the markup in the template.
- * AngularJS needs this information as those elements need to be created and cloned
- * in a special way when they are defined outside their usual containers like `<svg>` and `<math>`.
- *
- * * `html` - All root nodes in the template are HTML. Root nodes may also be
- *   top-level elements such as `<svg>` or `<math>`.
- * * `svg` - The root nodes in the template are SVG elements (excluding `<math>`).
- * * `math` - The root nodes in the template are MathML elements (excluding `<svg>`).
- *
- * If no `templateNamespace` is specified, then the namespace is considered to be `html`.
- *
- * #### `template`
- * HTML markup that may:
- * * Replace the contents of the directive's element (default).
- * * Replace the directive's element itself (if `replace` is true - DEPRECATED).
- * * Wrap the contents of the directive's element (if `transclude` is true).
- *
- * Value may be:
- *
- * * A string. For example `<div red-on-hover>{{delete_str}}</div>`.
- * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`
- *   function api below) and returns a string value.
- *
- *
- * #### `templateUrl`
- * This is similar to `template` but the template is loaded from the specified URL, asynchronously.
- *
- * Because template loading is asynchronous the compiler will suspend compilation of directives on that element
- * for later when the template has been resolved.  In the meantime it will continue to compile and link
- * sibling and parent elements as though this element had not contained any directives.
- *
- * The compiler does not suspend the entire compilation to wait for templates to be loaded because this
- * would result in the whole app "stalling" until all templates are loaded asynchronously - even in the
- * case when only one deeply nested directive has `templateUrl`.
- *
- * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache}
- *
- * You can specify `templateUrl` as a string representing the URL or as a function which takes two
- * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns
- * a string value representing the url.  In either case, the template URL is passed through {@link
- * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}.
- *
- *
- * #### `replace` ([*DEPRECATED*!], will be removed in next major release - i.e. v2.0)
- * specify what the template should replace. Defaults to `false`.
- *
- * * `true` - the template will replace the directive's element.
- * * `false` - the template will replace the contents of the directive's element.
- *
- * The replacement process migrates all of the attributes / classes from the old element to the new
- * one. See the {@link guide/directive#template-expanding-directive
- * Directives Guide} for an example.
- *
- * There are very few scenarios where element replacement is required for the application function,
- * the main one being reusable custom components that are used within SVG contexts
- * (because SVG doesn't work with custom elements in the DOM tree).
- *
- * #### `transclude`
- * Extract the contents of the element where the directive appears and make it available to the directive.
- * The contents are compiled and provided to the directive as a **transclusion function**. See the
- * {@link $compile#transclusion Transclusion} section below.
- *
- * There are two kinds of transclusion depending upon whether you want to transclude just the contents of the
- * directive's element or the entire element:
- *
- * * `true` - transclude the content (i.e. the child nodes) of the directive's element.
- * * `'element'` - transclude the whole of the directive's element including any directives on this
- *   element that defined at a lower priority than this directive. When used, the `template`
- *   property is ignored.
- *
- *
- * #### `compile`
- *
- * ```js
- *   function compile(tElement, tAttrs, transclude) { ... }
- * ```
- *
- * The compile function deals with transforming the template DOM. Since most directives do not do
- * template transformation, it is not used often. The compile function takes the following arguments:
- *
- *   * `tElement` - template element - The element where the directive has been declared. It is
- *     safe to do template transformation on the element and child elements only.
- *
- *   * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared
- *     between all directive compile functions.
- *
- *   * `transclude` -  [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)`
- *
- * <div class="alert alert-warning">
- * **Note:** The template instance and the link instance may be different objects if the template has
- * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that
- * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration
- * should be done in a linking function rather than in a compile function.
- * </div>
-
- * <div class="alert alert-warning">
- * **Note:** The compile function cannot handle directives that recursively use themselves in their
- * own templates or compile functions. Compiling these directives results in an infinite loop and a
- * stack overflow errors.
- *
- * This can be avoided by manually using $compile in the postLink function to imperatively compile
- * a directive's template instead of relying on automatic template compilation via `template` or
- * `templateUrl` declaration or manual compilation inside the compile function.
- * </div>
- *
- * <div class="alert alert-danger">
- * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it
- *   e.g. does not know about the right outer scope. Please use the transclude function that is passed
- *   to the link function instead.
- * </div>
-
- * A compile function can have a return value which can be either a function or an object.
- *
- * * returning a (post-link) function - is equivalent to registering the linking function via the
- *   `link` property of the config object when the compile function is empty.
- *
- * * returning an object with function(s) registered via `pre` and `post` properties - allows you to
- *   control when a linking function should be called during the linking phase. See info about
- *   pre-linking and post-linking functions below.
- *
- *
- * #### `link`
- * This property is used only if the `compile` property is not defined.
- *
- * ```js
- *   function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }
- * ```
- *
- * The link function is responsible for registering DOM listeners as well as updating the DOM. It is
- * executed after the template has been cloned. This is where most of the directive logic will be
- * put.
- *
- *   * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the
- *     directive for registering {@link ng.$rootScope.Scope#$watch watches}.
- *
- *   * `iElement` - instance element - The element where the directive is to be used. It is safe to
- *     manipulate the children of the element only in `postLink` function since the children have
- *     already been linked.
- *
- *   * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared
- *     between all directive linking functions.
- *
- *   * `controller` - the directive's required controller instance(s) - Instances are shared
- *     among all directives, which allows the directives to use the controllers as a communication
- *     channel. The exact value depends on the directive's `require` property:
- *       * no controller(s) required: the directive's own controller, or `undefined` if it doesn't have one
- *       * `string`: the controller instance
- *       * `array`: array of controller instances
- *
- *     If a required controller cannot be found, and it is optional, the instance is `null`,
- *     otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown.
- *
- *     Note that you can also require the directive's own controller - it will be made available like
- *     any other controller.
- *
- *   * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope.
- *     This is the same as the `$transclude`
- *     parameter of directive controllers, see there for details.
- *     `function([scope], cloneLinkingFn, futureParentElement)`.
- *
- * #### Pre-linking function
- *
- * Executed before the child elements are linked. Not safe to do DOM transformation since the
- * compiler linking function will fail to locate the correct elements for linking.
- *
- * #### Post-linking function
- *
- * Executed after the child elements are linked.
- *
- * Note that child elements that contain `templateUrl` directives will not have been compiled
- * and linked since they are waiting for their template to load asynchronously and their own
- * compilation and linking has been suspended until that occurs.
- *
- * It is safe to do DOM transformation in the post-linking function on elements that are not waiting
- * for their async templates to be resolved.
- *
- *
- * ### Transclusion
- *
- * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and
- * copying them to another part of the DOM, while maintaining their connection to the original AngularJS
- * scope from where they were taken.
- *
- * Transclusion is used (often with {@link ngTransclude}) to insert the
- * original contents of a directive's element into a specified place in the template of the directive.
- * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded
- * content has access to the properties on the scope from which it was taken, even if the directive
- * has isolated scope.
- * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}.
- *
- * This makes it possible for the widget to have private state for its template, while the transcluded
- * content has access to its originating scope.
- *
- * <div class="alert alert-warning">
- * **Note:** When testing an element transclude directive you must not place the directive at the root of the
- * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives
- * Testing Transclusion Directives}.
- * </div>
- *
- * #### Transclusion Functions
- *
- * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion
- * function** to the directive's `link` function and `controller`. This transclusion function is a special
- * **linking function** that will return the compiled contents linked to a new transclusion scope.
- *
- * <div class="alert alert-info">
- * If you are just using {@link ngTransclude} then you don't need to worry about this function, since
- * ngTransclude will deal with it for us.
- * </div>
- *
- * If you want to manually control the insertion and removal of the transcluded content in your directive
- * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery
- * object that contains the compiled DOM, which is linked to the correct transclusion scope.
- *
- * When you call a transclusion function you can pass in a **clone attach function**. This function accepts
- * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded
- * content and the `scope` is the newly created transclusion scope, to which the clone is bound.
- *
- * <div class="alert alert-info">
- * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a translude function
- * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope.
- * </div>
- *
- * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone
- * attach function**:
- *
- * ```js
- * var transcludedContent, transclusionScope;
- *
- * $transclude(function(clone, scope) {
- *   element.append(clone);
- *   transcludedContent = clone;
- *   transclusionScope = scope;
- * });
- * ```
- *
- * Later, if you want to remove the transcluded content from your DOM then you should also destroy the
- * associated transclusion scope:
- *
- * ```js
- * transcludedContent.remove();
- * transclusionScope.$destroy();
- * ```
- *
- * <div class="alert alert-info">
- * **Best Practice**: if you intend to add and remove transcluded content manually in your directive
- * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it),
- * then you are also responsible for calling `$destroy` on the transclusion scope.
- * </div>
- *
- * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat}
- * automatically destroy their transluded clones as necessary so you do not need to worry about this if
- * you are simply using {@link ngTransclude} to inject the transclusion into your directive.
- *
- *
- * #### Transclusion Scopes
- *
- * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion
- * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed
- * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it
- * was taken.
- *
- * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look
- * like this:
- *
- * ```html
- * <div ng-app>
- *   <div isolate>
- *     <div transclusion>
- *     </div>
- *   </div>
- * </div>
- * ```
- *
- * The `$parent` scope hierarchy will look like this:
- *
- * ```
- * - $rootScope
- *   - isolate
- *     - transclusion
- * ```
- *
- * but the scopes will inherit prototypically from different scopes to their `$parent`.
- *
- * ```
- * - $rootScope
- *   - transclusion
- * - isolate
- * ```
- *
- *
- * ### Attributes
- *
- * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the
- * `link()` or `compile()` functions. It has a variety of uses.
- *
- * accessing *Normalized attribute names:*
- * Directives like 'ngBind' can be expressed in many ways: 'ng:bind', `data-ng-bind`, or 'x-ng-bind'.
- * the attributes object allows for normalized access to
- *   the attributes.
- *
- * * *Directive inter-communication:* All directives share the same instance of the attributes
- *   object which allows the directives to use the attributes object as inter directive
- *   communication.
- *
- * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object
- *   allowing other directives to read the interpolated value.
- *
- * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes
- *   that contain interpolation (e.g. `src="{{bar}}"`). Not only is this very efficient but it's also
- *   the only way to easily get the actual value because during the linking phase the interpolation
- *   hasn't been evaluated yet and so the value is at this time set to `undefined`.
- *
- * ```js
- * function linkingFn(scope, elm, attrs, ctrl) {
- *   // get the attribute value
- *   console.log(attrs.ngModel);
- *
- *   // change the attribute
- *   attrs.$set('ngModel', 'new value');
- *
- *   // observe changes to interpolated attribute
- *   attrs.$observe('ngModel', function(value) {
- *     console.log('ngModel has changed value to ' + value);
- *   });
- * }
- * ```
- *
- * ## Example
- *
- * <div class="alert alert-warning">
- * **Note**: Typically directives are registered with `module.directive`. The example below is
- * to illustrate how `$compile` works.
- * </div>
- *
- <example module="compileExample">
-   <file name="index.html">
-    <script>
-      angular.module('compileExample', [], function($compileProvider) {
-        // configure new 'compile' directive by passing a directive
-        // factory function. The factory function injects the '$compile'
-        $compileProvider.directive('compile', function($compile) {
-          // directive factory creates a link function
-          return function(scope, element, attrs) {
-            scope.$watch(
-              function(scope) {
-                 // watch the 'compile' expression for changes
-                return scope.$eval(attrs.compile);
-              },
-              function(value) {
-                // when the 'compile' expression changes
-                // assign it into the current DOM
-                element.html(value);
-
-                // compile the new DOM and link it to the current
-                // scope.
-                // NOTE: we only compile .childNodes so that
-                // we don't get into infinite loop compiling ourselves
-                $compile(element.contents())(scope);
-              }
-            );
-          };
-        });
-      })
-      .controller('GreeterController', ['$scope', function($scope) {
-        $scope.name = 'Angular';
-        $scope.html = 'Hello {{name}}';
-      }]);
-    </script>
-    <div ng-controller="GreeterController">
-      <input ng-model="name"> <br/>
-      <textarea ng-model="html"></textarea> <br/>
-      <div compile="html"></div>
-    </div>
-   </file>
-   <file name="protractor.js" type="protractor">
-     it('should auto compile', function() {
-       var textarea = $('textarea');
-       var output = $('div[compile]');
-       // The initial state reads 'Hello Angular'.
-       expect(output.getText()).toBe('Hello Angular');
-       textarea.clear();
-       textarea.sendKeys('{{name}}!');
-       expect(output.getText()).toBe('Angular!');
-     });
-   </file>
- </example>
-
- *
- *
- * @param {string|DOMElement} element Element or HTML string to compile into a template function.
- * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED.
- *
- * <div class="alert alert-danger">
- * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it
- *   e.g. will not use the right outer scope. Please pass the transclude function as a
- *   `parentBoundTranscludeFn` to the link function instead.
- * </div>
- *
- * @param {number} maxPriority only apply directives lower than given priority (Only effects the
- *                 root element(s), not their children)
- * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template
- * (a DOM element/tree) to a scope. Where:
- *
- *  * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to.
- *  * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the
- *  `template` and call the `cloneAttachFn` function allowing the caller to attach the
- *  cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is
- *  called as: <br/> `cloneAttachFn(clonedElement, scope)` where:
- *
- *      * `clonedElement` - is a clone of the original `element` passed into the compiler.
- *      * `scope` - is the current scope with which the linking function is working with.
- *
- *  * `options` - An optional object hash with linking options. If `options` is provided, then the following
- *  keys may be used to control linking behavior:
- *
- *      * `parentBoundTranscludeFn` - the transclude function made available to
- *        directives; if given, it will be passed through to the link functions of
- *        directives found in `element` during compilation.
- *      * `transcludeControllers` - an object hash with keys that map controller names
- *        to controller instances; if given, it will make the controllers
- *        available to directives.
- *      * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add
- *        the cloned elements; only needed for transcludes that are allowed to contain non html
- *        elements (e.g. SVG elements). See also the directive.controller property.
- *
- * Calling the linking function returns the element of the template. It is either the original
- * element passed in, or the clone of the element if the `cloneAttachFn` is provided.
- *
- * After linking the view is not updated until after a call to $digest which typically is done by
- * Angular automatically.
- *
- * If you need access to the bound view, there are two ways to do it:
- *
- * - If you are not asking the linking function to clone the template, create the DOM element(s)
- *   before you send them to the compiler and keep this reference around.
- *   ```js
- *     var element = $compile('<p>{{total}}</p>')(scope);
- *   ```
- *
- * - if on the other hand, you need the element to be cloned, the view reference from the original
- *   example would not point to the clone, but rather to the original template that was cloned. In
- *   this case, you can access the clone via the cloneAttachFn:
- *   ```js
- *     var templateElement = angular.element('<p>{{total}}</p>'),
- *         scope = ....;
- *
- *     var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) {
- *       //attach the clone to DOM document at the right place
- *     });
- *
- *     //now we have reference to the cloned DOM via `clonedElement`
- *   ```
- *
- *
- * For information on how the compiler works, see the
- * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide.
- */
-
-var $compileMinErr = minErr('$compile');
-
-/**
- * @ngdoc provider
- * @name $compileProvider
- *
- * @description
- */
-$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];
-function $CompileProvider($provide, $$sanitizeUriProvider) {
-  var hasDirectives = {},
-      Suffix = 'Directive',
-      COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\w\-]+)\s+(.*)$/,
-      CLASS_DIRECTIVE_REGEXP = /(([\w\-]+)(?:\:([^;]+))?;?)/,
-      ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'),
-      REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/;
-
-  // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes
-  // The assumption is that future DOM event attribute names will begin with
-  // 'on' and be composed of only English letters.
-  var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;
-
-  function parseIsolateBindings(scope, directiveName, isController) {
-    var LOCAL_REGEXP = /^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/;
-
-    var bindings = {};
-
-    forEach(scope, function(definition, scopeName) {
-      var match = definition.match(LOCAL_REGEXP);
-
-      if (!match) {
-        throw $compileMinErr('iscp',
-            "Invalid {3} for directive '{0}'." +
-            " Definition: {... {1}: '{2}' ...}",
-            directiveName, scopeName, definition,
-            (isController ? "controller bindings definition" :
-            "isolate scope definition"));
-      }
-
-      bindings[scopeName] = {
-        mode: match[1][0],
-        collection: match[2] === '*',
-        optional: match[3] === '?',
-        attrName: match[4] || scopeName
-      };
-    });
-
-    return bindings;
-  }
-
-  function parseDirectiveBindings(directive, directiveName) {
-    var bindings = {
-      isolateScope: null,
-      bindToController: null
-    };
-    if (isObject(directive.scope)) {
-      if (directive.bindToController === true) {
-        bindings.bindToController = parseIsolateBindings(directive.scope,
-                                                         directiveName, true);
-        bindings.isolateScope = {};
-      } else {
-        bindings.isolateScope = parseIsolateBindings(directive.scope,
-                                                     directiveName, false);
-      }
-    }
-    if (isObject(directive.bindToController)) {
-      bindings.bindToController =
-          parseIsolateBindings(directive.bindToController, directiveName, true);
-    }
-    if (isObject(bindings.bindToController)) {
-      var controller = directive.controller;
-      var controllerAs = directive.controllerAs;
-      if (!controller) {
-        // There is no controller, there may or may not be a controllerAs property
-        throw $compileMinErr('noctrl',
-              "Cannot bind to controller without directive '{0}'s controller.",
-              directiveName);
-      } else if (!identifierForController(controller, controllerAs)) {
-        // There is a controller, but no identifier or controllerAs property
-        throw $compileMinErr('noident',
-              "Cannot bind to controller without identifier for directive '{0}'.",
-              directiveName);
-      }
-    }
-    return bindings;
-  }
-
-  function assertValidDirectiveName(name) {
-    var letter = name.charAt(0);
-    if (!letter || letter !== lowercase(letter)) {
-      throw $compileMinErr('baddir', "Directive name '{0}' is invalid. The first character must be a lowercase letter", name);
-    }
-    if (name !== name.trim()) {
-      throw $compileMinErr('baddir',
-            "Directive name '{0}' is invalid. The name should not contain leading or trailing whitespaces",
-            name);
-    }
-  }
-
-  /**
-   * @ngdoc method
-   * @name $compileProvider#directive
-   * @kind function
-   *
-   * @description
-   * Register a new directive with the compiler.
-   *
-   * @param {string|Object} name Name of the directive in camel-case (i.e. <code>ngBind</code> which
-   *    will match as <code>ng-bind</code>), or an object map of directives where the keys are the
-   *    names and the values are the factories.
-   * @param {Function|Array} directiveFactory An injectable directive factory function. See
-   *    {@link guide/directive} for more info.
-   * @returns {ng.$compileProvider} Self for chaining.
-   */
-   this.directive = function registerDirective(name, directiveFactory) {
-    assertNotHasOwnProperty(name, 'directive');
-    if (isString(name)) {
-      assertValidDirectiveName(name);
-      assertArg(directiveFactory, 'directiveFactory');
-      if (!hasDirectives.hasOwnProperty(name)) {
-        hasDirectives[name] = [];
-        $provide.factory(name + Suffix, ['$injector', '$exceptionHandler',
-          function($injector, $exceptionHandler) {
-            var directives = [];
-            forEach(hasDirectives[name], function(directiveFactory, index) {
-              try {
-                var directive = $injector.invoke(directiveFactory);
-                if (isFunction(directive)) {
-                  directive = { compile: valueFn(directive) };
-                } else if (!directive.compile && directive.link) {
-                  directive.compile = valueFn(directive.link);
-                }
-                directive.priority = directive.priority || 0;
-                directive.index = index;
-                directive.name = directive.name || name;
-                directive.require = directive.require || (directive.controller && directive.name);
-                directive.restrict = directive.restrict || 'EA';
-                var bindings = directive.$$bindings =
-                    parseDirectiveBindings(directive, directive.name);
-                if (isObject(bindings.isolateScope)) {
-                  directive.$$isolateBindings = bindings.isolateScope;
-                }
-                directive.$$moduleName = directiveFactory.$$moduleName;
-                directives.push(directive);
-              } catch (e) {
-                $exceptionHandler(e);
-              }
-            });
-            return directives;
-          }]);
-      }
-      hasDirectives[name].push(directiveFactory);
-    } else {
-      forEach(name, reverseParams(registerDirective));
-    }
-    return this;
-  };
-
-
-  /**
-   * @ngdoc method
-   * @name $compileProvider#aHrefSanitizationWhitelist
-   * @kind function
-   *
-   * @description
-   * Retrieves or overrides the default regular expression that is used for whitelisting of safe
-   * urls during a[href] sanitization.
-   *
-   * The sanitization is a security measure aimed at preventing XSS attacks via html links.
-   *
-   * Any url about to be assigned to a[href] via data-binding is first normalized and turned into
-   * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`
-   * regular expression. If a match is found, the original url is written into the dom. Otherwise,
-   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
-   *
-   * @param {RegExp=} regexp New regexp to whitelist urls with.
-   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
-   *    chaining otherwise.
-   */
-  this.aHrefSanitizationWhitelist = function(regexp) {
-    if (isDefined(regexp)) {
-      $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);
-      return this;
-    } else {
-      return $$sanitizeUriProvider.aHrefSanitizationWhitelist();
-    }
-  };
-
-
-  /**
-   * @ngdoc method
-   * @name $compileProvider#imgSrcSanitizationWhitelist
-   * @kind function
-   *
-   * @description
-   * Retrieves or overrides the default regular expression that is used for whitelisting of safe
-   * urls during img[src] sanitization.
-   *
-   * The sanitization is a security measure aimed at prevent XSS attacks via html links.
-   *
-   * Any url about to be assigned to img[src] via data-binding is first normalized and turned into
-   * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`
-   * regular expression. If a match is found, the original url is written into the dom. Otherwise,
-   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
-   *
-   * @param {RegExp=} regexp New regexp to whitelist urls with.
-   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
-   *    chaining otherwise.
-   */
-  this.imgSrcSanitizationWhitelist = function(regexp) {
-    if (isDefined(regexp)) {
-      $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);
-      return this;
-    } else {
-      return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();
-    }
-  };
-
-  /**
-   * @ngdoc method
-   * @name  $compileProvider#debugInfoEnabled
-   *
-   * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the
-   * current debugInfoEnabled state
-   * @returns {*} current value if used as getter or itself (chaining) if used as setter
-   *
-   * @kind function
-   *
-   * @description
-   * Call this method to enable/disable various debug runtime information in the compiler such as adding
-   * binding information and a reference to the current scope on to DOM elements.
-   * If enabled, the compiler will add the following to DOM elements that have been bound to the scope
-   * * `ng-binding` CSS class
-   * * `$binding` data property containing an array of the binding expressions
-   *
-   * You may want to disable this in production for a significant performance boost. See
-   * {@link guide/production#disabling-debug-data Disabling Debug Data} for more.
-   *
-   * The default value is true.
-   */
-  var debugInfoEnabled = true;
-  this.debugInfoEnabled = function(enabled) {
-    if (isDefined(enabled)) {
-      debugInfoEnabled = enabled;
-      return this;
-    }
-    return debugInfoEnabled;
-  };
-
-  this.$get = [
-            '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse',
-            '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri',
-    function($injector,   $interpolate,   $exceptionHandler,   $templateRequest,   $parse,
-             $controller,   $rootScope,   $document,   $sce,   $animate,   $$sanitizeUri) {
-
-    var Attributes = function(element, attributesToCopy) {
-      if (attributesToCopy) {
-        var keys = Object.keys(attributesToCopy);
-        var i, l, key;
-
-        for (i = 0, l = keys.length; i < l; i++) {
-          key = keys[i];
-          this[key] = attributesToCopy[key];
-        }
-      } else {
-        this.$attr = {};
-      }
-
-      this.$$element = element;
-    };
-
-    Attributes.prototype = {
-      /**
-       * @ngdoc method
-       * @name $compile.directive.Attributes#$normalize
-       * @kind function
-       *
-       * @description
-       * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or
-       * `data-`) to its normalized, camelCase form.
-       *
-       * Also there is special case for Moz prefix starting with upper case letter.
-       *
-       * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}
-       *
-       * @param {string} name Name to normalize
-       */
-      $normalize: directiveNormalize,
-
-
-      /**
-       * @ngdoc method
-       * @name $compile.directive.Attributes#$addClass
-       * @kind function
-       *
-       * @description
-       * Adds the CSS class value specified by the classVal parameter to the element. If animations
-       * are enabled then an animation will be triggered for the class addition.
-       *
-       * @param {string} classVal The className value that will be added to the element
-       */
-      $addClass: function(classVal) {
-        if (classVal && classVal.length > 0) {
-          $animate.addClass(this.$$element, classVal);
-        }
-      },
-
-      /**
-       * @ngdoc method
-       * @name $compile.directive.Attributes#$removeClass
-       * @kind function
-       *
-       * @description
-       * Removes the CSS class value specified by the classVal parameter from the element. If
-       * animations are enabled then an animation will be triggered for the class removal.
-       *
-       * @param {string} classVal The className value that will be removed from the element
-       */
-      $removeClass: function(classVal) {
-        if (classVal && classVal.length > 0) {
-          $animate.removeClass(this.$$element, classVal);
-        }
-      },
-
-      /**
-       * @ngdoc method
-       * @name $compile.directive.Attributes#$updateClass
-       * @kind function
-       *
-       * @description
-       * Adds and removes the appropriate CSS class values to the element based on the difference
-       * between the new and old CSS class values (specified as newClasses and oldClasses).
-       *
-       * @param {string} newClasses The current CSS className value
-       * @param {string} oldClasses The former CSS className value
-       */
-      $updateClass: function(newClasses, oldClasses) {
-        var toAdd = tokenDifference(newClasses, oldClasses);
-        if (toAdd && toAdd.length) {
-          $animate.addClass(this.$$element, toAdd);
-        }
-
-        var toRemove = tokenDifference(oldClasses, newClasses);
-        if (toRemove && toRemove.length) {
-          $animate.removeClass(this.$$element, toRemove);
-        }
-      },
-
-      /**
-       * Set a normalized attribute on the element in a way such that all directives
-       * can share the attribute. This function properly handles boolean attributes.
-       * @param {string} key Normalized key. (ie ngAttribute)
-       * @param {string|boolean} value The value to set. If `null` attribute will be deleted.
-       * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.
-       *     Defaults to true.
-       * @param {string=} attrName Optional none normalized name. Defaults to key.
-       */
-      $set: function(key, value, writeAttr, attrName) {
-        // TODO: decide whether or not to throw an error if "class"
-        //is set through this function since it may cause $updateClass to
-        //become unstable.
-
-        var node = this.$$element[0],
-            booleanKey = getBooleanAttrName(node, key),
-            aliasedKey = getAliasedAttrName(key),
-            observer = key,
-            nodeName;
-
-        if (booleanKey) {
-          this.$$element.prop(key, value);
-          attrName = booleanKey;
-        } else if (aliasedKey) {
-          this[aliasedKey] = value;
-          observer = aliasedKey;
-        }
-
-        this[key] = value;
-
-        // translate normalized key to actual key
-        if (attrName) {
-          this.$attr[key] = attrName;
-        } else {
-          attrName = this.$attr[key];
-          if (!attrName) {
-            this.$attr[key] = attrName = snake_case(key, '-');
-          }
-        }
-
-        nodeName = nodeName_(this.$$element);
-
-        if ((nodeName === 'a' && key === 'href') ||
-            (nodeName === 'img' && key === 'src')) {
-          // sanitize a[href] and img[src] values
-          this[key] = value = $$sanitizeUri(value, key === 'src');
-        } else if (nodeName === 'img' && key === 'srcset') {
-          // sanitize img[srcset] values
-          var result = "";
-
-          // first check if there are spaces because it's not the same pattern
-          var trimmedSrcset = trim(value);
-          //                (   999x   ,|   999w   ,|   ,|,   )
-          var srcPattern = /(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/;
-          var pattern = /\s/.test(trimmedSrcset) ? srcPattern : /(,)/;
-
-          // split srcset into tuple of uri and descriptor except for the last item
-          var rawUris = trimmedSrcset.split(pattern);
-
-          // for each tuples
-          var nbrUrisWith2parts = Math.floor(rawUris.length / 2);
-          for (var i = 0; i < nbrUrisWith2parts; i++) {
-            var innerIdx = i * 2;
-            // sanitize the uri
-            result += $$sanitizeUri(trim(rawUris[innerIdx]), true);
-            // add the descriptor
-            result += (" " + trim(rawUris[innerIdx + 1]));
-          }
-
-          // split the last item into uri and descriptor
-          var lastTuple = trim(rawUris[i * 2]).split(/\s/);
-
-          // sanitize the last uri
-          result += $$sanitizeUri(trim(lastTuple[0]), true);
-
-          // and add the last descriptor if any
-          if (lastTuple.length === 2) {
-            result += (" " + trim(lastTuple[1]));
-          }
-          this[key] = value = result;
-        }
-
-        if (writeAttr !== false) {
-          if (value === null || isUndefined(value)) {
-            this.$$element.removeAttr(attrName);
-          } else {
-            this.$$element.attr(attrName, value);
-          }
-        }
-
-        // fire observers
-        var $$observers = this.$$observers;
-        $$observers && forEach($$observers[observer], function(fn) {
-          try {
-            fn(value);
-          } catch (e) {
-            $exceptionHandler(e);
-          }
-        });
-      },
-
-
-      /**
-       * @ngdoc method
-       * @name $compile.directive.Attributes#$observe
-       * @kind function
-       *
-       * @description
-       * Observes an interpolated attribute.
-       *
-       * The observer function will be invoked once during the next `$digest` following
-       * compilation. The observer is then invoked whenever the interpolated value
-       * changes.
-       *
-       * @param {string} key Normalized key. (ie ngAttribute) .
-       * @param {function(interpolatedValue)} fn Function that will be called whenever
-                the interpolated value of the attribute changes.
-       *        See the {@link guide/directive#text-and-attribute-bindings Directives} guide for more info.
-       * @returns {function()} Returns a deregistration function for this observer.
-       */
-      $observe: function(key, fn) {
-        var attrs = this,
-            $$observers = (attrs.$$observers || (attrs.$$observers = createMap())),
-            listeners = ($$observers[key] || ($$observers[key] = []));
-
-        listeners.push(fn);
-        $rootScope.$evalAsync(function() {
-          if (!listeners.$$inter && attrs.hasOwnProperty(key) && !isUndefined(attrs[key])) {
-            // no one registered attribute interpolation function, so lets call it manually
-            fn(attrs[key]);
-          }
-        });
-
-        return function() {
-          arrayRemove(listeners, fn);
-        };
-      }
-    };
-
-
-    function safeAddClass($element, className) {
-      try {
-        $element.addClass(className);
-      } catch (e) {
-        // ignore, since it means that we are trying to set class on
-        // SVG element, where class name is read-only.
-      }
-    }
-
-
-    var startSymbol = $interpolate.startSymbol(),
-        endSymbol = $interpolate.endSymbol(),
-        denormalizeTemplate = (startSymbol == '{{' || endSymbol  == '}}')
-            ? identity
-            : function denormalizeTemplate(template) {
-              return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol);
-        },
-        NG_ATTR_BINDING = /^ngAttr[A-Z]/;
-
-    compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) {
-      var bindings = $element.data('$binding') || [];
-
-      if (isArray(binding)) {
-        bindings = bindings.concat(binding);
-      } else {
-        bindings.push(binding);
-      }
-
-      $element.data('$binding', bindings);
-    } : noop;
-
-    compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) {
-      safeAddClass($element, 'ng-binding');
-    } : noop;
-
-    compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) {
-      var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';
-      $element.data(dataName, scope);
-    } : noop;
-
-    compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) {
-      safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope');
-    } : noop;
-
-    return compile;
-
-    //================================
-
-    function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,
-                        previousCompileContext) {
-      if (!($compileNodes instanceof jqLite)) {
-        // jquery always rewraps, whereas we need to preserve the original selector so that we can
-        // modify it.
-        $compileNodes = jqLite($compileNodes);
-      }
-      // We can not compile top level text elements since text nodes can be merged and we will
-      // not be able to attach scope data to them, so we will wrap them in <span>
-      forEach($compileNodes, function(node, index) {
-        if (node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\S+/) /* non-empty */ ) {
-          $compileNodes[index] = jqLite(node).wrap('<span></span>').parent()[0];
-        }
-      });
-      var compositeLinkFn =
-              compileNodes($compileNodes, transcludeFn, $compileNodes,
-                           maxPriority, ignoreDirective, previousCompileContext);
-      compile.$$addScopeClass($compileNodes);
-      var namespace = null;
-      return function publicLinkFn(scope, cloneConnectFn, options) {
-        assertArg(scope, 'scope');
-
-        options = options || {};
-        var parentBoundTranscludeFn = options.parentBoundTranscludeFn,
-          transcludeControllers = options.transcludeControllers,
-          futureParentElement = options.futureParentElement;
-
-        // When `parentBoundTranscludeFn` is passed, it is a
-        // `controllersBoundTransclude` function (it was previously passed
-        // as `transclude` to directive.link) so we must unwrap it to get
-        // its `boundTranscludeFn`
-        if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) {
-          parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;
-        }
-
-        if (!namespace) {
-          namespace = detectNamespaceForChildElements(futureParentElement);
-        }
-        var $linkNode;
-        if (namespace !== 'html') {
-          // When using a directive with replace:true and templateUrl the $compileNodes
-          // (or a child element inside of them)
-          // might change, so we need to recreate the namespace adapted compileNodes
-          // for call to the link function.
-          // Note: This will already clone the nodes...
-          $linkNode = jqLite(
-            wrapTemplate(namespace, jqLite('<div>').append($compileNodes).html())
-          );
-        } else if (cloneConnectFn) {
-          // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart
-          // and sometimes changes the structure of the DOM.
-          $linkNode = JQLitePrototype.clone.call($compileNodes);
-        } else {
-          $linkNode = $compileNodes;
-        }
-
-        if (transcludeControllers) {
-          for (var controllerName in transcludeControllers) {
-            $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);
-          }
-        }
-
-        compile.$$addScopeInfo($linkNode, scope);
-
-        if (cloneConnectFn) cloneConnectFn($linkNode, scope);
-        if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);
-        return $linkNode;
-      };
-    }
-
-    function detectNamespaceForChildElements(parentElement) {
-      // TODO: Make this detect MathML as well...
-      var node = parentElement && parentElement[0];
-      if (!node) {
-        return 'html';
-      } else {
-        return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/) ? 'svg' : 'html';
-      }
-    }
-
-    /**
-     * Compile function matches each node in nodeList against the directives. Once all directives
-     * for a particular node are collected their compile functions are executed. The compile
-     * functions return values - the linking functions - are combined into a composite linking
-     * function, which is the a linking function for the node.
-     *
-     * @param {NodeList} nodeList an array of nodes or NodeList to compile
-     * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the
-     *        scope argument is auto-generated to the new child of the transcluded parent scope.
-     * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then
-     *        the rootElement must be set the jqLite collection of the compile root. This is
-     *        needed so that the jqLite collection items can be replaced with widgets.
-     * @param {number=} maxPriority Max directive priority.
-     * @returns {Function} A composite linking function of all of the matched directives or null.
-     */
-    function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,
-                            previousCompileContext) {
-      var linkFns = [],
-          attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound;
-
-      for (var i = 0; i < nodeList.length; i++) {
-        attrs = new Attributes();
-
-        // we must always refer to nodeList[i] since the nodes can be replaced underneath us.
-        directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined,
-                                        ignoreDirective);
-
-        nodeLinkFn = (directives.length)
-            ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement,
-                                      null, [], [], previousCompileContext)
-            : null;
-
-        if (nodeLinkFn && nodeLinkFn.scope) {
-          compile.$$addScopeClass(attrs.$$element);
-        }
-
-        childLinkFn = (nodeLinkFn && nodeLinkFn.terminal ||
-                      !(childNodes = nodeList[i].childNodes) ||
-                      !childNodes.length)
-            ? null
-            : compileNodes(childNodes,
-                 nodeLinkFn ? (
-                  (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement)
-                     && nodeLinkFn.transclude) : transcludeFn);
-
-        if (nodeLinkFn || childLinkFn) {
-          linkFns.push(i, nodeLinkFn, childLinkFn);
-          linkFnFound = true;
-          nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn;
-        }
-
-        //use the previous context only for the first element in the virtual group
-        previousCompileContext = null;
-      }
-
-      // return a linking function if we have found anything, null otherwise
-      return linkFnFound ? compositeLinkFn : null;
-
-      function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {
-        var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn;
-        var stableNodeList;
-
-
-        if (nodeLinkFnFound) {
-          // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our
-          // offsets don't get screwed up
-          var nodeListLength = nodeList.length;
-          stableNodeList = new Array(nodeListLength);
-
-          // create a sparse array by only copying the elements which have a linkFn
-          for (i = 0; i < linkFns.length; i+=3) {
-            idx = linkFns[i];
-            stableNodeList[idx] = nodeList[idx];
-          }
-        } else {
-          stableNodeList = nodeList;
-        }
-
-        for (i = 0, ii = linkFns.length; i < ii;) {
-          node = stableNodeList[linkFns[i++]];
-          nodeLinkFn = linkFns[i++];
-          childLinkFn = linkFns[i++];
-
-          if (nodeLinkFn) {
-            if (nodeLinkFn.scope) {
-              childScope = scope.$new();
-              compile.$$addScopeInfo(jqLite(node), childScope);
-              var destroyBindings = nodeLinkFn.$$destroyBindings;
-              if (destroyBindings) {
-                nodeLinkFn.$$destroyBindings = null;
-                childScope.$on('$destroyed', destroyBindings);
-              }
-            } else {
-              childScope = scope;
-            }
-
-            if (nodeLinkFn.transcludeOnThisElement) {
-              childBoundTranscludeFn = createBoundTranscludeFn(
-                  scope, nodeLinkFn.transclude, parentBoundTranscludeFn);
-
-            } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {
-              childBoundTranscludeFn = parentBoundTranscludeFn;
-
-            } else if (!parentBoundTranscludeFn && transcludeFn) {
-              childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);
-
-            } else {
-              childBoundTranscludeFn = null;
-            }
-
-            nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn,
-                       nodeLinkFn);
-
-          } else if (childLinkFn) {
-            childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);
-          }
-        }
-      }
-    }
-
-    function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {
-
-      var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
-
-        if (!transcludedScope) {
-          transcludedScope = scope.$new(false, containingScope);
-          transcludedScope.$$transcluded = true;
-        }
-
-        return transcludeFn(transcludedScope, cloneFn, {
-          parentBoundTranscludeFn: previousBoundTranscludeFn,
-          transcludeControllers: controllers,
-          futureParentElement: futureParentElement
-        });
-      };
-
-      return boundTranscludeFn;
-    }
-
-    /**
-     * Looks for directives on the given node and adds them to the directive collection which is
-     * sorted.
-     *
-     * @param node Node to search.
-     * @param directives An array to which the directives are added to. This array is sorted before
-     *        the function returns.
-     * @param attrs The shared attrs object which is used to populate the normalized attributes.
-     * @param {number=} maxPriority Max directive priority.
-     */
-    function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {
-      var nodeType = node.nodeType,
-          attrsMap = attrs.$attr,
-          match,
-          className;
-
-      switch (nodeType) {
-        case NODE_TYPE_ELEMENT: /* Element */
-          // use the node name: <directive>
-          addDirective(directives,
-              directiveNormalize(nodeName_(node)), 'E', maxPriority, ignoreDirective);
-
-          // iterate over the attributes
-          for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,
-                   j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {
-            var attrStartName = false;
-            var attrEndName = false;
-
-            attr = nAttrs[j];
-            name = attr.name;
-            value = trim(attr.value);
-
-            // support ngAttr attribute binding
-            ngAttrName = directiveNormalize(name);
-            if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) {
-              name = name.replace(PREFIX_REGEXP, '')
-                .substr(8).replace(/_(.)/g, function(match, letter) {
-                  return letter.toUpperCase();
-                });
-            }
-
-            var directiveNName = ngAttrName.replace(/(Start|End)$/, '');
-            if (directiveIsMultiElement(directiveNName)) {
-              if (ngAttrName === directiveNName + 'Start') {
-                attrStartName = name;
-                attrEndName = name.substr(0, name.length - 5) + 'end';
-                name = name.substr(0, name.length - 6);
-              }
-            }
-
-            nName = directiveNormalize(name.toLowerCase());
-            attrsMap[nName] = name;
-            if (isNgAttr || !attrs.hasOwnProperty(nName)) {
-                attrs[nName] = value;
-                if (getBooleanAttrName(node, nName)) {
-                  attrs[nName] = true; // presence means true
-                }
-            }
-            addAttrInterpolateDirective(node, directives, value, nName, isNgAttr);
-            addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,
-                          attrEndName);
-          }
-
-          // use class as directive
-          className = node.className;
-          if (isObject(className)) {
-              // Maybe SVGAnimatedString
-              className = className.animVal;
-          }
-          if (isString(className) && className !== '') {
-            while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) {
-              nName = directiveNormalize(match[2]);
-              if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) {
-                attrs[nName] = trim(match[3]);
-              }
-              className = className.substr(match.index + match[0].length);
-            }
-          }
-          break;
-        case NODE_TYPE_TEXT: /* Text Node */
-          if (msie === 11) {
-            // Workaround for #11781
-            while (node.parentNode && node.nextSibling && node.nextSibling.nodeType === NODE_TYPE_TEXT) {
-              node.nodeValue = node.nodeValue + node.nextSibling.nodeValue;
-              node.parentNode.removeChild(node.nextSibling);
-            }
-          }
-          addTextInterpolateDirective(directives, node.nodeValue);
-          break;
-        case NODE_TYPE_COMMENT: /* Comment */
-          try {
-            match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
-            if (match) {
-              nName = directiveNormalize(match[1]);
-              if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {
-                attrs[nName] = trim(match[2]);
-              }
-            }
-          } catch (e) {
-            // turns out that under some circumstances IE9 throws errors when one attempts to read
-            // comment's node value.
-            // Just ignore it and continue. (Can't seem to reproduce in test case.)
-          }
-          break;
-      }
-
-      directives.sort(byPriority);
-      return directives;
-    }
-
-    /**
-     * Given a node with an directive-start it collects all of the siblings until it finds
-     * directive-end.
-     * @param node
-     * @param attrStart
-     * @param attrEnd
-     * @returns {*}
-     */
-    function groupScan(node, attrStart, attrEnd) {
-      var nodes = [];
-      var depth = 0;
-      if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {
-        do {
-          if (!node) {
-            throw $compileMinErr('uterdir',
-                      "Unterminated attribute, found '{0}' but no matching '{1}' found.",
-                      attrStart, attrEnd);
-          }
-          if (node.nodeType == NODE_TYPE_ELEMENT) {
-            if (node.hasAttribute(attrStart)) depth++;
-            if (node.hasAttribute(attrEnd)) depth--;
-          }
-          nodes.push(node);
-          node = node.nextSibling;
-        } while (depth > 0);
-      } else {
-        nodes.push(node);
-      }
-
-      return jqLite(nodes);
-    }
-
-    /**
-     * Wrapper for linking function which converts normal linking function into a grouped
-     * linking function.
-     * @param linkFn
-     * @param attrStart
-     * @param attrEnd
-     * @returns {Function}
-     */
-    function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {
-      return function(scope, element, attrs, controllers, transcludeFn) {
-        element = groupScan(element[0], attrStart, attrEnd);
-        return linkFn(scope, element, attrs, controllers, transcludeFn);
-      };
-    }
-
-    /**
-     * Once the directives have been collected, their compile functions are executed. This method
-     * is responsible for inlining directive templates as well as terminating the application
-     * of the directives if the terminal directive has been reached.
-     *
-     * @param {Array} directives Array of collected directives to execute their compile function.
-     *        this needs to be pre-sorted by priority order.
-     * @param {Node} compileNode The raw DOM node to apply the compile functions to
-     * @param {Object} templateAttrs The shared attribute function
-     * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the
-     *                                                  scope argument is auto-generated to the new
-     *                                                  child of the transcluded parent scope.
-     * @param {JQLite} jqCollection If we are working on the root of the compile tree then this
-     *                              argument has the root jqLite array so that we can replace nodes
-     *                              on it.
-     * @param {Object=} originalReplaceDirective An optional directive that will be ignored when
-     *                                           compiling the transclusion.
-     * @param {Array.<Function>} preLinkFns
-     * @param {Array.<Function>} postLinkFns
-     * @param {Object} previousCompileContext Context used for previous compilation of the current
-     *                                        node
-     * @returns {Function} linkFn
-     */
-    function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,
-                                   jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,
-                                   previousCompileContext) {
-      previousCompileContext = previousCompileContext || {};
-
-      var terminalPriority = -Number.MAX_VALUE,
-          newScopeDirective = previousCompileContext.newScopeDirective,
-          controllerDirectives = previousCompileContext.controllerDirectives,
-          newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,
-          templateDirective = previousCompileContext.templateDirective,
-          nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,
-          hasTranscludeDirective = false,
-          hasTemplate = false,
-          hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,
-          $compileNode = templateAttrs.$$element = jqLite(compileNode),
-          directive,
-          directiveName,
-          $template,
-          replaceDirective = originalReplaceDirective,
-          childTranscludeFn = transcludeFn,
-          linkFn,
-          directiveValue;
-
-      // executes all directives on the current element
-      for (var i = 0, ii = directives.length; i < ii; i++) {
-        directive = directives[i];
-        var attrStart = directive.$$start;
-        var attrEnd = directive.$$end;
-
-        // collect multiblock sections
-        if (attrStart) {
-          $compileNode = groupScan(compileNode, attrStart, attrEnd);
-        }
-        $template = undefined;
-
-        if (terminalPriority > directive.priority) {
-          break; // prevent further processing of directives
-        }
-
-        if (directiveValue = directive.scope) {
-
-          // skip the check for directives with async templates, we'll check the derived sync
-          // directive when the template arrives
-          if (!directive.templateUrl) {
-            if (isObject(directiveValue)) {
-              // This directive is trying to add an isolated scope.
-              // Check that there is no scope of any kind already
-              assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective,
-                                directive, $compileNode);
-              newIsolateScopeDirective = directive;
-            } else {
-              // This directive is trying to add a child scope.
-              // Check that there is no isolated scope already
-              assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,
-                                $compileNode);
-            }
-          }
-
-          newScopeDirective = newScopeDirective || directive;
-        }
-
-        directiveName = directive.name;
-
-        if (!directive.templateUrl && directive.controller) {
-          directiveValue = directive.controller;
-          controllerDirectives = controllerDirectives || createMap();
-          assertNoDuplicate("'" + directiveName + "' controller",
-              controllerDirectives[directiveName], directive, $compileNode);
-          controllerDirectives[directiveName] = directive;
-        }
-
-        if (directiveValue = directive.transclude) {
-          hasTranscludeDirective = true;
-
-          // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.
-          // This option should only be used by directives that know how to safely handle element transclusion,
-          // where the transcluded nodes are added or replaced after linking.
-          if (!directive.$$tlb) {
-            assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);
-            nonTlbTranscludeDirective = directive;
-          }
-
-          if (directiveValue == 'element') {
-            hasElementTranscludeDirective = true;
-            terminalPriority = directive.priority;
-            $template = $compileNode;
-            $compileNode = templateAttrs.$$element =
-                jqLite(document.createComment(' ' + directiveName + ': ' +
-                                              templateAttrs[directiveName] + ' '));
-            compileNode = $compileNode[0];
-            replaceWith(jqCollection, sliceArgs($template), compileNode);
-
-            childTranscludeFn = compile($template, transcludeFn, terminalPriority,
-                                        replaceDirective && replaceDirective.name, {
-                                          // Don't pass in:
-                                          // - controllerDirectives - otherwise we'll create duplicates controllers
-                                          // - newIsolateScopeDirective or templateDirective - combining templates with
-                                          //   element transclusion doesn't make sense.
-                                          //
-                                          // We need only nonTlbTranscludeDirective so that we prevent putting transclusion
-                                          // on the same element more than once.
-                                          nonTlbTranscludeDirective: nonTlbTranscludeDirective
-                                        });
-          } else {
-            $template = jqLite(jqLiteClone(compileNode)).contents();
-            $compileNode.empty(); // clear contents
-            childTranscludeFn = compile($template, transcludeFn);
-          }
-        }
-
-        if (directive.template) {
-          hasTemplate = true;
-          assertNoDuplicate('template', templateDirective, directive, $compileNode);
-          templateDirective = directive;
-
-          directiveValue = (isFunction(directive.template))
-              ? directive.template($compileNode, templateAttrs)
-              : directive.template;
-
-          directiveValue = denormalizeTemplate(directiveValue);
-
-          if (directive.replace) {
-            replaceDirective = directive;
-            if (jqLiteIsTextNode(directiveValue)) {
-              $template = [];
-            } else {
-              $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue)));
-            }
-            compileNode = $template[0];
-
-            if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
-              throw $compileMinErr('tplrt',
-                  "Template for directive '{0}' must have exactly one root element. {1}",
-                  directiveName, '');
-            }
-
-            replaceWith(jqCollection, $compileNode, compileNode);
-
-            var newTemplateAttrs = {$attr: {}};
-
-            // combine directives from the original node and from the template:
-            // - take the array of directives for this element
-            // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed)
-            // - collect directives from the template and sort them by priority
-            // - combine directives as: processed + template + unprocessed
-            var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs);
-            var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1));
-
-            if (newIsolateScopeDirective) {
-              markDirectivesAsIsolate(templateDirectives);
-            }
-            directives = directives.concat(templateDirectives).concat(unprocessedDirectives);
-            mergeTemplateAttributes(templateAttrs, newTemplateAttrs);
-
-            ii = directives.length;
-          } else {
-            $compileNode.html(directiveValue);
-          }
-        }
-
-        if (directive.templateUrl) {
-          hasTemplate = true;
-          assertNoDuplicate('template', templateDirective, directive, $compileNode);
-          templateDirective = directive;
-
-          if (directive.replace) {
-            replaceDirective = directive;
-          }
-
-          nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode,
-              templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, {
-                controllerDirectives: controllerDirectives,
-                newScopeDirective: (newScopeDirective !== directive) && newScopeDirective,
-                newIsolateScopeDirective: newIsolateScopeDirective,
-                templateDirective: templateDirective,
-                nonTlbTranscludeDirective: nonTlbTranscludeDirective
-              });
-          ii = directives.length;
-        } else if (directive.compile) {
-          try {
-            linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);
-            if (isFunction(linkFn)) {
-              addLinkFns(null, linkFn, attrStart, attrEnd);
-            } else if (linkFn) {
-              addLinkFns(linkFn.pre, linkFn.post, attrStart, attrEnd);
-            }
-          } catch (e) {
-            $exceptionHandler(e, startingTag($compileNode));
-          }
-        }
-
-        if (directive.terminal) {
-          nodeLinkFn.terminal = true;
-          terminalPriority = Math.max(terminalPriority, directive.priority);
-        }
-
-      }
-
-      nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;
-      nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective;
-      nodeLinkFn.templateOnThisElement = hasTemplate;
-      nodeLinkFn.transclude = childTranscludeFn;
-
-      previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;
-
-      // might be normal or delayed nodeLinkFn depending on if templateUrl is present
-      return nodeLinkFn;
-
-      ////////////////////
-
-      function addLinkFns(pre, post, attrStart, attrEnd) {
-        if (pre) {
-          if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);
-          pre.require = directive.require;
-          pre.directiveName = directiveName;
-          if (newIsolateScopeDirective === directive || directive.$$isolateScope) {
-            pre = cloneAndAnnotateFn(pre, {isolateScope: true});
-          }
-          preLinkFns.push(pre);
-        }
-        if (post) {
-          if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);
-          post.require = directive.require;
-          post.directiveName = directiveName;
-          if (newIsolateScopeDirective === directive || directive.$$isolateScope) {
-            post = cloneAndAnnotateFn(post, {isolateScope: true});
-          }
-          postLinkFns.push(post);
-        }
-      }
-
-
-      function getControllers(directiveName, require, $element, elementControllers) {
-        var value;
-
-        if (isString(require)) {
-          var match = require.match(REQUIRE_PREFIX_REGEXP);
-          var name = require.substring(match[0].length);
-          var inheritType = match[1] || match[3];
-          var optional = match[2] === '?';
-
-          //If only parents then start at the parent element
-          if (inheritType === '^^') {
-            $element = $element.parent();
-          //Otherwise attempt getting the controller from elementControllers in case
-          //the element is transcluded (and has no data) and to avoid .data if possible
-          } else {
-            value = elementControllers && elementControllers[name];
-            value = value && value.instance;
-          }
-
-          if (!value) {
-            var dataName = '$' + name + 'Controller';
-            value = inheritType ? $element.inheritedData(dataName) : $element.data(dataName);
-          }
-
-          if (!value && !optional) {
-            throw $compileMinErr('ctreq',
-                "Controller '{0}', required by directive '{1}', can't be found!",
-                name, directiveName);
-          }
-        } else if (isArray(require)) {
-          value = [];
-          for (var i = 0, ii = require.length; i < ii; i++) {
-            value[i] = getControllers(directiveName, require[i], $element, elementControllers);
-          }
-        }
-
-        return value || null;
-      }
-
-      function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope) {
-        var elementControllers = createMap();
-        for (var controllerKey in controllerDirectives) {
-          var directive = controllerDirectives[controllerKey];
-          var locals = {
-            $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,
-            $element: $element,
-            $attrs: attrs,
-            $transclude: transcludeFn
-          };
-
-          var controller = directive.controller;
-          if (controller == '@') {
-            controller = attrs[directive.name];
-          }
-
-          var controllerInstance = $controller(controller, locals, true, directive.controllerAs);
-
-          // For directives with element transclusion the element is a comment,
-          // but jQuery .data doesn't support attaching data to comment nodes as it's hard to
-          // clean up (http://bugs.jquery.com/ticket/8335).
-          // Instead, we save the controllers for the element in a local hash and attach to .data
-          // later, once we have the actual element.
-          elementControllers[directive.name] = controllerInstance;
-          if (!hasElementTranscludeDirective) {
-            $element.data('$' + directive.name + 'Controller', controllerInstance.instance);
-          }
-        }
-        return elementControllers;
-      }
-
-      function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn,
-                          thisLinkFn) {
-        var i, ii, linkFn, controller, isolateScope, elementControllers, transcludeFn, $element,
-            attrs;
-
-        if (compileNode === linkNode) {
-          attrs = templateAttrs;
-          $element = templateAttrs.$$element;
-        } else {
-          $element = jqLite(linkNode);
-          attrs = new Attributes($element, templateAttrs);
-        }
-
-        if (newIsolateScopeDirective) {
-          isolateScope = scope.$new(true);
-        }
-
-        if (boundTranscludeFn) {
-          // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn`
-          // is later passed as `parentBoundTranscludeFn` to `publicLinkFn`
-          transcludeFn = controllersBoundTransclude;
-          transcludeFn.$$boundTransclude = boundTranscludeFn;
-        }
-
-        if (controllerDirectives) {
-          elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope);
-        }
-
-        if (newIsolateScopeDirective) {
-          // Initialize isolate scope bindings for new isolate scope directive.
-          compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective ||
-              templateDirective === newIsolateScopeDirective.$$originalDirective)));
-          compile.$$addScopeClass($element, true);
-          isolateScope.$$isolateBindings =
-              newIsolateScopeDirective.$$isolateBindings;
-          initializeDirectiveBindings(scope, attrs, isolateScope,
-                                      isolateScope.$$isolateBindings,
-                                      newIsolateScopeDirective, isolateScope);
-        }
-        if (elementControllers) {
-          // Initialize bindToController bindings for new/isolate scopes
-          var scopeDirective = newIsolateScopeDirective || newScopeDirective;
-          var bindings;
-          var controllerForBindings;
-          if (scopeDirective && elementControllers[scopeDirective.name]) {
-            bindings = scopeDirective.$$bindings.bindToController;
-            controller = elementControllers[scopeDirective.name];
-
-            if (controller && controller.identifier && bindings) {
-              controllerForBindings = controller;
-              thisLinkFn.$$destroyBindings =
-                  initializeDirectiveBindings(scope, attrs, controller.instance,
-                                              bindings, scopeDirective);
-            }
-          }
-          for (i in elementControllers) {
-            controller = elementControllers[i];
-            var controllerResult = controller();
-
-            if (controllerResult !== controller.instance) {
-              // If the controller constructor has a return value, overwrite the instance
-              // from setupControllers and update the element data
-              controller.instance = controllerResult;
-              $element.data('$' + i + 'Controller', controllerResult);
-              if (controller === controllerForBindings) {
-                // Remove and re-install bindToController bindings
-                thisLinkFn.$$destroyBindings();
-                thisLinkFn.$$destroyBindings =
-                  initializeDirectiveBindings(scope, attrs, controllerResult, bindings, scopeDirective);
-              }
-            }
-          }
-        }
-
-        // PRELINKING
-        for (i = 0, ii = preLinkFns.length; i < ii; i++) {
-          linkFn = preLinkFns[i];
-          invokeLinkFn(linkFn,
-              linkFn.isolateScope ? isolateScope : scope,
-              $element,
-              attrs,
-              linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),
-              transcludeFn
-          );
-        }
-
-        // RECURSION
-        // We only pass the isolate scope, if the isolate directive has a template,
-        // otherwise the child elements do not belong to the isolate directive.
-        var scopeToChild = scope;
-        if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) {
-          scopeToChild = isolateScope;
-        }
-        childLinkFn && childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn);
-
-        // POSTLINKING
-        for (i = postLinkFns.length - 1; i >= 0; i--) {
-          linkFn = postLinkFns[i];
-          invokeLinkFn(linkFn,
-              linkFn.isolateScope ? isolateScope : scope,
-              $element,
-              attrs,
-              linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),
-              transcludeFn
-          );
-        }
-
-        // This is the function that is injected as `$transclude`.
-        // Note: all arguments are optional!
-        function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {
-          var transcludeControllers;
-
-          // No scope passed in:
-          if (!isScope(scope)) {
-            futureParentElement = cloneAttachFn;
-            cloneAttachFn = scope;
-            scope = undefined;
-          }
-
-          if (hasElementTranscludeDirective) {
-            transcludeControllers = elementControllers;
-          }
-          if (!futureParentElement) {
-            futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;
-          }
-          return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
-        }
-      }
-    }
-
-    function markDirectivesAsIsolate(directives) {
-      // mark all directives as needing isolate scope.
-      for (var j = 0, jj = directives.length; j < jj; j++) {
-        directives[j] = inherit(directives[j], {$$isolateScope: true});
-      }
-    }
-
-    /**
-     * looks up the directive and decorates it with exception handling and proper parameters. We
-     * call this the boundDirective.
-     *
-     * @param {string} name name of the directive to look up.
-     * @param {string} location The directive must be found in specific format.
-     *   String containing any of theses characters:
-     *
-     *   * `E`: element name
-     *   * `A': attribute
-     *   * `C`: class
-     *   * `M`: comment
-     * @returns {boolean} true if directive was added.
-     */
-    function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,
-                          endAttrName) {
-      if (name === ignoreDirective) return null;
-      var match = null;
-      if (hasDirectives.hasOwnProperty(name)) {
-        for (var directive, directives = $injector.get(name + Suffix),
-            i = 0, ii = directives.length; i < ii; i++) {
-          try {
-            directive = directives[i];
-            if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&
-                 directive.restrict.indexOf(location) != -1) {
-              if (startAttrName) {
-                directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});
-              }
-              tDirectives.push(directive);
-              match = directive;
-            }
-          } catch (e) { $exceptionHandler(e); }
-        }
-      }
-      return match;
-    }
-
-
-    /**
-     * looks up the directive and returns true if it is a multi-element directive,
-     * and therefore requires DOM nodes between -start and -end markers to be grouped
-     * together.
-     *
-     * @param {string} name name of the directive to look up.
-     * @returns true if directive was registered as multi-element.
-     */
-    function directiveIsMultiElement(name) {
-      if (hasDirectives.hasOwnProperty(name)) {
-        for (var directive, directives = $injector.get(name + Suffix),
-            i = 0, ii = directives.length; i < ii; i++) {
-          directive = directives[i];
-          if (directive.multiElement) {
-            return true;
-          }
-        }
-      }
-      return false;
-    }
-
-    /**
-     * When the element is replaced with HTML template then the new attributes
-     * on the template need to be merged with the existing attributes in the DOM.
-     * The desired effect is to have both of the attributes present.
-     *
-     * @param {object} dst destination attributes (original DOM)
-     * @param {object} src source attributes (from the directive template)
-     */
-    function mergeTemplateAttributes(dst, src) {
-      var srcAttr = src.$attr,
-          dstAttr = dst.$attr,
-          $element = dst.$$element;
-
-      // reapply the old attributes to the new element
-      forEach(dst, function(value, key) {
-        if (key.charAt(0) != '$') {
-          if (src[key] && src[key] !== value) {
-            value += (key === 'style' ? ';' : ' ') + src[key];
-          }
-          dst.$set(key, value, true, srcAttr[key]);
-        }
-      });
-
-      // copy the new attributes on the old attrs object
-      forEach(src, function(value, key) {
-        if (key == 'class') {
-          safeAddClass($element, value);
-          dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value;
-        } else if (key == 'style') {
-          $element.attr('style', $element.attr('style') + ';' + value);
-          dst['style'] = (dst['style'] ? dst['style'] + ';' : '') + value;
-          // `dst` will never contain hasOwnProperty as DOM parser won't let it.
-          // You will get an "InvalidCharacterError: DOM Exception 5" error if you
-          // have an attribute like "has-own-property" or "data-has-own-property", etc.
-        } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) {
-          dst[key] = value;
-          dstAttr[key] = srcAttr[key];
-        }
-      });
-    }
-
-
-    function compileTemplateUrl(directives, $compileNode, tAttrs,
-        $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {
-      var linkQueue = [],
-          afterTemplateNodeLinkFn,
-          afterTemplateChildLinkFn,
-          beforeTemplateCompileNode = $compileNode[0],
-          origAsyncDirective = directives.shift(),
-          derivedSyncDirective = inherit(origAsyncDirective, {
-            templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective
-          }),
-          templateUrl = (isFunction(origAsyncDirective.templateUrl))
-              ? origAsyncDirective.templateUrl($compileNode, tAttrs)
-              : origAsyncDirective.templateUrl,
-          templateNamespace = origAsyncDirective.templateNamespace;
-
-      $compileNode.empty();
-
-      $templateRequest(templateUrl)
-        .then(function(content) {
-          var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;
-
-          content = denormalizeTemplate(content);
-
-          if (origAsyncDirective.replace) {
-            if (jqLiteIsTextNode(content)) {
-              $template = [];
-            } else {
-              $template = removeComments(wrapTemplate(templateNamespace, trim(content)));
-            }
-            compileNode = $template[0];
-
-            if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
-              throw $compileMinErr('tplrt',
-                  "Template for directive '{0}' must have exactly one root element. {1}",
-                  origAsyncDirective.name, templateUrl);
-            }
-
-            tempTemplateAttrs = {$attr: {}};
-            replaceWith($rootElement, $compileNode, compileNode);
-            var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs);
-
-            if (isObject(origAsyncDirective.scope)) {
-              markDirectivesAsIsolate(templateDirectives);
-            }
-            directives = templateDirectives.concat(directives);
-            mergeTemplateAttributes(tAttrs, tempTemplateAttrs);
-          } else {
-            compileNode = beforeTemplateCompileNode;
-            $compileNode.html(content);
-          }
-
-          directives.unshift(derivedSyncDirective);
-
-          afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs,
-              childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns,
-              previousCompileContext);
-          forEach($rootElement, function(node, i) {
-            if (node == compileNode) {
-              $rootElement[i] = $compileNode[0];
-            }
-          });
-          afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);
-
-          while (linkQueue.length) {
-            var scope = linkQueue.shift(),
-                beforeTemplateLinkNode = linkQueue.shift(),
-                linkRootElement = linkQueue.shift(),
-                boundTranscludeFn = linkQueue.shift(),
-                linkNode = $compileNode[0];
-
-            if (scope.$$destroyed) continue;
-
-            if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {
-              var oldClasses = beforeTemplateLinkNode.className;
-
-              if (!(previousCompileContext.hasElementTranscludeDirective &&
-                  origAsyncDirective.replace)) {
-                // it was cloned therefore we have to clone as well.
-                linkNode = jqLiteClone(compileNode);
-              }
-              replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);
-
-              // Copy in CSS classes from original node
-              safeAddClass(jqLite(linkNode), oldClasses);
-            }
-            if (afterTemplateNodeLinkFn.transcludeOnThisElement) {
-              childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);
-            } else {
-              childBoundTranscludeFn = boundTranscludeFn;
-            }
-            afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement,
-              childBoundTranscludeFn, afterTemplateNodeLinkFn);
-          }
-          linkQueue = null;
-        });
-
-      return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {
-        var childBoundTranscludeFn = boundTranscludeFn;
-        if (scope.$$destroyed) return;
-        if (linkQueue) {
-          linkQueue.push(scope,
-                         node,
-                         rootElement,
-                         childBoundTranscludeFn);
-        } else {
-          if (afterTemplateNodeLinkFn.transcludeOnThisElement) {
-            childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);
-          }
-          afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn,
-                                  afterTemplateNodeLinkFn);
-        }
-      };
-    }
-
-
-    /**
-     * Sorting function for bound directives.
-     */
-    function byPriority(a, b) {
-      var diff = b.priority - a.priority;
-      if (diff !== 0) return diff;
-      if (a.name !== b.name) return (a.name < b.name) ? -1 : 1;
-      return a.index - b.index;
-    }
-
-    function assertNoDuplicate(what, previousDirective, directive, element) {
-
-      function wrapModuleNameIfDefined(moduleName) {
-        return moduleName ?
-          (' (module: ' + moduleName + ')') :
-          '';
-      }
-
-      if (previousDirective) {
-        throw $compileMinErr('multidir', 'Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}',
-            previousDirective.name, wrapModuleNameIfDefined(previousDirective.$$moduleName),
-            directive.name, wrapModuleNameIfDefined(directive.$$moduleName), what, startingTag(element));
-      }
-    }
-
-
-    function addTextInterpolateDirective(directives, text) {
-      var interpolateFn = $interpolate(text, true);
-      if (interpolateFn) {
-        directives.push({
-          priority: 0,
-          compile: function textInterpolateCompileFn(templateNode) {
-            var templateNodeParent = templateNode.parent(),
-                hasCompileParent = !!templateNodeParent.length;
-
-            // When transcluding a template that has bindings in the root
-            // we don't have a parent and thus need to add the class during linking fn.
-            if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);
-
-            return function textInterpolateLinkFn(scope, node) {
-              var parent = node.parent();
-              if (!hasCompileParent) compile.$$addBindingClass(parent);
-              compile.$$addBindingInfo(parent, interpolateFn.expressions);
-              scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {
-                node[0].nodeValue = value;
-              });
-            };
-          }
-        });
-      }
-    }
-
-
-    function wrapTemplate(type, template) {
-      type = lowercase(type || 'html');
-      switch (type) {
-      case 'svg':
-      case 'math':
-        var wrapper = document.createElement('div');
-        wrapper.innerHTML = '<' + type + '>' + template + '</' + type + '>';
-        return wrapper.childNodes[0].childNodes;
-      default:
-        return template;
-      }
-    }
-
-
-    function getTrustedContext(node, attrNormalizedName) {
-      if (attrNormalizedName == "srcdoc") {
-        return $sce.HTML;
-      }
-      var tag = nodeName_(node);
-      // maction[xlink:href] can source SVG.  It's not limited to <maction>.
-      if (attrNormalizedName == "xlinkHref" ||
-          (tag == "form" && attrNormalizedName == "action") ||
-          (tag != "img" && (attrNormalizedName == "src" ||
-                            attrNormalizedName == "ngSrc"))) {
-        return $sce.RESOURCE_URL;
-      }
-    }
-
-
-    function addAttrInterpolateDirective(node, directives, value, name, allOrNothing) {
-      var trustedContext = getTrustedContext(node, name);
-      allOrNothing = ALL_OR_NOTHING_ATTRS[name] || allOrNothing;
-
-      var interpolateFn = $interpolate(value, true, trustedContext, allOrNothing);
-
-      // no interpolation found -> ignore
-      if (!interpolateFn) return;
-
-
-      if (name === "multiple" && nodeName_(node) === "select") {
-        throw $compileMinErr("selmulti",
-            "Binding to the 'multiple' attribute is not supported. Element: {0}",
-            startingTag(node));
-      }
-
-      directives.push({
-        priority: 100,
-        compile: function() {
-            return {
-              pre: function attrInterpolatePreLinkFn(scope, element, attr) {
-                var $$observers = (attr.$$observers || (attr.$$observers = createMap()));
-
-                if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {
-                  throw $compileMinErr('nodomevents',
-                      "Interpolations for HTML DOM event attributes are disallowed.  Please use the " +
-                          "ng- versions (such as ng-click instead of onclick) instead.");
-                }
-
-                // If the attribute has changed since last $interpolate()ed
-                var newValue = attr[name];
-                if (newValue !== value) {
-                  // we need to interpolate again since the attribute value has been updated
-                  // (e.g. by another directive's compile function)
-                  // ensure unset/empty values make interpolateFn falsy
-                  interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing);
-                  value = newValue;
-                }
-
-                // if attribute was updated so that there is no interpolation going on we don't want to
-                // register any observers
-                if (!interpolateFn) return;
-
-                // initialize attr object so that it's ready in case we need the value for isolate
-                // scope initialization, otherwise the value would not be available from isolate
-                // directive's linking fn during linking phase
-                attr[name] = interpolateFn(scope);
-
-                ($$observers[name] || ($$observers[name] = [])).$$inter = true;
-                (attr.$$observers && attr.$$observers[name].$$scope || scope).
-                  $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {
-                    //special case for class attribute addition + removal
-                    //so that class changes can tap into the animation
-                    //hooks provided by the $animate service. Be sure to
-                    //skip animations when the first digest occurs (when
-                    //both the new and the old values are the same) since
-                    //the CSS classes are the non-interpolated values
-                    if (name === 'class' && newValue != oldValue) {
-                      attr.$updateClass(newValue, oldValue);
-                    } else {
-                      attr.$set(name, newValue);
-                    }
-                  });
-              }
-            };
-          }
-      });
-    }
-
-
-    /**
-     * This is a special jqLite.replaceWith, which can replace items which
-     * have no parents, provided that the containing jqLite collection is provided.
-     *
-     * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes
-     *                               in the root of the tree.
-     * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep
-     *                                  the shell, but replace its DOM node reference.
-     * @param {Node} newNode The new DOM node.
-     */
-    function replaceWith($rootElement, elementsToRemove, newNode) {
-      var firstElementToRemove = elementsToRemove[0],
-          removeCount = elementsToRemove.length,
-          parent = firstElementToRemove.parentNode,
-          i, ii;
-
-      if ($rootElement) {
-        for (i = 0, ii = $rootElement.length; i < ii; i++) {
-          if ($rootElement[i] == firstElementToRemove) {
-            $rootElement[i++] = newNode;
-            for (var j = i, j2 = j + removeCount - 1,
-                     jj = $rootElement.length;
-                 j < jj; j++, j2++) {
-              if (j2 < jj) {
-                $rootElement[j] = $rootElement[j2];
-              } else {
-                delete $rootElement[j];
-              }
-            }
-            $rootElement.length -= removeCount - 1;
-
-            // If the replaced element is also the jQuery .context then replace it
-            // .context is a deprecated jQuery api, so we should set it only when jQuery set it
-            // http://api.jquery.com/context/
-            if ($rootElement.context === firstElementToRemove) {
-              $rootElement.context = newNode;
-            }
-            break;
-          }
-        }
-      }
-
-      if (parent) {
-        parent.replaceChild(newNode, firstElementToRemove);
-      }
-
-      // TODO(perf): what's this document fragment for? is it needed? can we at least reuse it?
-      var fragment = document.createDocumentFragment();
-      fragment.appendChild(firstElementToRemove);
-
-      if (jqLite.hasData(firstElementToRemove)) {
-        // Copy over user data (that includes Angular's $scope etc.). Don't copy private
-        // data here because there's no public interface in jQuery to do that and copying over
-        // event listeners (which is the main use of private data) wouldn't work anyway.
-        jqLite(newNode).data(jqLite(firstElementToRemove).data());
-
-        // Remove data of the replaced element. We cannot just call .remove()
-        // on the element it since that would deallocate scope that is needed
-        // for the new node. Instead, remove the data "manually".
-        if (!jQuery) {
-          delete jqLite.cache[firstElementToRemove[jqLite.expando]];
-        } else {
-          // jQuery 2.x doesn't expose the data storage. Use jQuery.cleanData to clean up after
-          // the replaced element. The cleanData version monkey-patched by Angular would cause
-          // the scope to be trashed and we do need the very same scope to work with the new
-          // element. However, we cannot just cache the non-patched version and use it here as
-          // that would break if another library patches the method after Angular does (one
-          // example is jQuery UI). Instead, set a flag indicating scope destroying should be
-          // skipped this one time.
-          skipDestroyOnNextJQueryCleanData = true;
-          jQuery.cleanData([firstElementToRemove]);
-        }
-      }
-
-      for (var k = 1, kk = elementsToRemove.length; k < kk; k++) {
-        var element = elementsToRemove[k];
-        jqLite(element).remove(); // must do this way to clean up expando
-        fragment.appendChild(element);
-        delete elementsToRemove[k];
-      }
-
-      elementsToRemove[0] = newNode;
-      elementsToRemove.length = 1;
-    }
-
-
-    function cloneAndAnnotateFn(fn, annotation) {
-      return extend(function() { return fn.apply(null, arguments); }, fn, annotation);
-    }
-
-
-    function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) {
-      try {
-        linkFn(scope, $element, attrs, controllers, transcludeFn);
-      } catch (e) {
-        $exceptionHandler(e, startingTag($element));
-      }
-    }
-
-
-    // Set up $watches for isolate scope and controller bindings. This process
-    // only occurs for isolate scopes and new scopes with controllerAs.
-    function initializeDirectiveBindings(scope, attrs, destination, bindings,
-                                         directive, newScope) {
-      var onNewScopeDestroyed;
-      forEach(bindings, function(definition, scopeName) {
-        var attrName = definition.attrName,
-        optional = definition.optional,
-        mode = definition.mode, // @, =, or &
-        lastValue,
-        parentGet, parentSet, compare;
-
-        switch (mode) {
-
-          case '@':
-            if (!optional && !hasOwnProperty.call(attrs, attrName)) {
-              destination[scopeName] = attrs[attrName] = void 0;
-            }
-            attrs.$observe(attrName, function(value) {
-              if (isString(value)) {
-                destination[scopeName] = value;
-              }
-            });
-            attrs.$$observers[attrName].$$scope = scope;
-            if (isString(attrs[attrName])) {
-              // If the attribute has been provided then we trigger an interpolation to ensure
-              // the value is there for use in the link fn
-              destination[scopeName] = $interpolate(attrs[attrName])(scope);
-            }
-            break;
-
-          case '=':
-            if (!hasOwnProperty.call(attrs, attrName)) {
-              if (optional) break;
-              attrs[attrName] = void 0;
-            }
-            if (optional && !attrs[attrName]) break;
-
-            parentGet = $parse(attrs[attrName]);
-            if (parentGet.literal) {
-              compare = equals;
-            } else {
-              compare = function(a, b) { return a === b || (a !== a && b !== b); };
-            }
-            parentSet = parentGet.assign || function() {
-              // reset the change, or we will throw this exception on every $digest
-              lastValue = destination[scopeName] = parentGet(scope);
-              throw $compileMinErr('nonassign',
-                  "Expression '{0}' used with directive '{1}' is non-assignable!",
-                  attrs[attrName], directive.name);
-            };
-            lastValue = destination[scopeName] = parentGet(scope);
-            var parentValueWatch = function parentValueWatch(parentValue) {
-              if (!compare(parentValue, destination[scopeName])) {
-                // we are out of sync and need to copy
-                if (!compare(parentValue, lastValue)) {
-                  // parent changed and it has precedence
-                  destination[scopeName] = parentValue;
-                } else {
-                  // if the parent can be assigned then do so
-                  parentSet(scope, parentValue = destination[scopeName]);
-                }
-              }
-              return lastValue = parentValue;
-            };
-            parentValueWatch.$stateful = true;
-            var unwatch;
-            if (definition.collection) {
-              unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);
-            } else {
-              unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);
-            }
-            onNewScopeDestroyed = (onNewScopeDestroyed || []);
-            onNewScopeDestroyed.push(unwatch);
-            break;
-
-          case '&':
-            // Don't assign Object.prototype method to scope
-            parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop;
-
-            // Don't assign noop to destination if expression is not valid
-            if (parentGet === noop && optional) break;
-
-            destination[scopeName] = function(locals) {
-              return parentGet(scope, locals);
-            };
-            break;
-        }
-      });
-      var destroyBindings = onNewScopeDestroyed ? function destroyBindings() {
-        for (var i = 0, ii = onNewScopeDestroyed.length; i < ii; ++i) {
-          onNewScopeDestroyed[i]();
-        }
-      } : noop;
-      if (newScope && destroyBindings !== noop) {
-        newScope.$on('$destroy', destroyBindings);
-        return noop;
-      }
-      return destroyBindings;
-    }
-  }];
-}
-
-var PREFIX_REGEXP = /^((?:x|data)[\:\-_])/i;
-/**
- * Converts all accepted directives format into proper directive name.
- * @param name Name to normalize
- */
-function directiveNormalize(name) {
-  return camelCase(name.replace(PREFIX_REGEXP, ''));
-}
-
-/**
- * @ngdoc type
- * @name $compile.directive.Attributes
- *
- * @description
- * A shared object between directive compile / linking functions which contains normalized DOM
- * element attributes. The values reflect current binding state `{{ }}`. The normalization is
- * needed since all of these are treated as equivalent in Angular:
- *
- * ```
- *    <span ng:bind="a" ng-bind="a" data-ng-bind="a" x-ng-bind="a">
- * ```
- */
-
-/**
- * @ngdoc property
- * @name $compile.directive.Attributes#$attr
- *
- * @description
- * A map of DOM element attribute names to the normalized name. This is
- * needed to do reverse lookup from normalized name back to actual name.
- */
-
-
-/**
- * @ngdoc method
- * @name $compile.directive.Attributes#$set
- * @kind function
- *
- * @description
- * Set DOM element attribute value.
- *
- *
- * @param {string} name Normalized element attribute name of the property to modify. The name is
- *          reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}
- *          property to the original name.
- * @param {string} value Value to set the attribute to. The value can be an interpolated string.
- */
-
-
-
-/**
- * Closure compiler type information
- */
-
-function nodesetLinkingFn(
-  /* angular.Scope */ scope,
-  /* NodeList */ nodeList,
-  /* Element */ rootElement,
-  /* function(Function) */ boundTranscludeFn
-) {}
-
-function directiveLinkingFn(
-  /* nodesetLinkingFn */ nodesetLinkingFn,
-  /* angular.Scope */ scope,
-  /* Node */ node,
-  /* Element */ rootElement,
-  /* function(Function) */ boundTranscludeFn
-) {}
-
-function tokenDifference(str1, str2) {
-  var values = '',
-      tokens1 = str1.split(/\s+/),
-      tokens2 = str2.split(/\s+/);
-
-  outer:
-  for (var i = 0; i < tokens1.length; i++) {
-    var token = tokens1[i];
-    for (var j = 0; j < tokens2.length; j++) {
-      if (token == tokens2[j]) continue outer;
-    }
-    values += (values.length > 0 ? ' ' : '') + token;
-  }
-  return values;
-}
-
-function removeComments(jqNodes) {
-  jqNodes = jqLite(jqNodes);
-  var i = jqNodes.length;
-
-  if (i <= 1) {
-    return jqNodes;
-  }
-
-  while (i--) {
-    var node = jqNodes[i];
-    if (node.nodeType === NODE_TYPE_COMMENT) {
-      splice.call(jqNodes, i, 1);
-    }
-  }
-  return jqNodes;
-}
-
-var $controllerMinErr = minErr('$controller');
-
-
-var CNTRL_REG = /^(\S+)(\s+as\s+(\w+))?$/;
-function identifierForController(controller, ident) {
-  if (ident && isString(ident)) return ident;
-  if (isString(controller)) {
-    var match = CNTRL_REG.exec(controller);
-    if (match) return match[3];
-  }
-}
-
-
-/**
- * @ngdoc provider
- * @name $controllerProvider
- * @description
- * The {@link ng.$controller $controller service} is used by Angular to create new
- * controllers.
- *
- * This provider allows controller registration via the
- * {@link ng.$controllerProvider#register register} method.
- */
-function $ControllerProvider() {
-  var controllers = {},
-      globals = false;
-
-  /**
-   * @ngdoc method
-   * @name $controllerProvider#register
-   * @param {string|Object} name Controller name, or an object map of controllers where the keys are
-   *    the names and the values are the constructors.
-   * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI
-   *    annotations in the array notation).
-   */
-  this.register = function(name, constructor) {
-    assertNotHasOwnProperty(name, 'controller');
-    if (isObject(name)) {
-      extend(controllers, name);
-    } else {
-      controllers[name] = constructor;
-    }
-  };
-
-  /**
-   * @ngdoc method
-   * @name $controllerProvider#allowGlobals
-   * @description If called, allows `$controller` to find controller constructors on `window`
-   */
-  this.allowGlobals = function() {
-    globals = true;
-  };
-
-
-  this.$get = ['$injector', '$window', function($injector, $window) {
-
-    /**
-     * @ngdoc service
-     * @name $controller
-     * @requires $injector
-     *
-     * @param {Function|string} constructor If called with a function then it's considered to be the
-     *    controller constructor function. Otherwise it's considered to be a string which is used
-     *    to retrieve the controller constructor using the following steps:
-     *
-     *    * check if a controller with given name is registered via `$controllerProvider`
-     *    * check if evaluating the string on the current scope returns a constructor
-     *    * if $controllerProvider#allowGlobals, check `window[constructor]` on the global
-     *      `window` object (not recommended)
-     *
-     *    The string can use the `controller as property` syntax, where the controller instance is published
-     *    as the specified property on the `scope`; the `scope` must be injected into `locals` param for this
-     *    to work correctly.
-     *
-     * @param {Object} locals Injection locals for Controller.
-     * @return {Object} Instance of given controller.
-     *
-     * @description
-     * `$controller` service is responsible for instantiating controllers.
-     *
-     * It's just a simple call to {@link auto.$injector $injector}, but extracted into
-     * a service, so that one can override this service with [BC version](https://gist.github.com/1649788).
-     */
-    return function(expression, locals, later, ident) {
-      // PRIVATE API:
-      //   param `later` --- indicates that the controller's constructor is invoked at a later time.
-      //                     If true, $controller will allocate the object with the correct
-      //                     prototype chain, but will not invoke the controller until a returned
-      //                     callback is invoked.
-      //   param `ident` --- An optional label which overrides the label parsed from the controller
-      //                     expression, if any.
-      var instance, match, constructor, identifier;
-      later = later === true;
-      if (ident && isString(ident)) {
-        identifier = ident;
-      }
-
-      if (isString(expression)) {
-        match = expression.match(CNTRL_REG);
-        if (!match) {
-          throw $controllerMinErr('ctrlfmt',
-            "Badly formed controller string '{0}'. " +
-            "Must match `__name__ as __id__` or `__name__`.", expression);
-        }
-        constructor = match[1],
-        identifier = identifier || match[3];
-        expression = controllers.hasOwnProperty(constructor)
-            ? controllers[constructor]
-            : getter(locals.$scope, constructor, true) ||
-                (globals ? getter($window, constructor, true) : undefined);
-
-        assertArgFn(expression, constructor, true);
-      }
-
-      if (later) {
-        // Instantiate controller later:
-        // This machinery is used to create an instance of the object before calling the
-        // controller's constructor itself.
-        //
-        // This allows properties to be added to the controller before the constructor is
-        // invoked. Primarily, this is used for isolate scope bindings in $compile.
-        //
-        // This feature is not intended for use by applications, and is thus not documented
-        // publicly.
-        // Object creation: http://jsperf.com/create-constructor/2
-        var controllerPrototype = (isArray(expression) ?
-          expression[expression.length - 1] : expression).prototype;
-        instance = Object.create(controllerPrototype || null);
-
-        if (identifier) {
-          addIdentifier(locals, identifier, instance, constructor || expression.name);
-        }
-
-        var instantiate;
-        return instantiate = extend(function() {
-          var result = $injector.invoke(expression, instance, locals, constructor);
-          if (result !== instance && (isObject(result) || isFunction(result))) {
-            instance = result;
-            if (identifier) {
-              // If result changed, re-assign controllerAs value to scope.
-              addIdentifier(locals, identifier, instance, constructor || expression.name);
-            }
-          }
-          return instance;
-        }, {
-          instance: instance,
-          identifier: identifier
-        });
-      }
-
-      instance = $injector.instantiate(expression, locals, constructor);
-
-      if (identifier) {
-        addIdentifier(locals, identifier, instance, constructor || expression.name);
-      }
-
-      return instance;
-    };
-
-    function addIdentifier(locals, identifier, instance, name) {
-      if (!(locals && isObject(locals.$scope))) {
-        throw minErr('$controller')('noscp',
-          "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",
-          name, identifier);
-      }
-
-      locals.$scope[identifier] = instance;
-    }
-  }];
-}
-
-/**
- * @ngdoc service
- * @name $document
- * @requires $window
- *
- * @description
- * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.
- *
- * @example
-   <example module="documentExample">
-     <file name="index.html">
-       <div ng-controller="ExampleController">
-         <p>$document title: <b ng-bind="title"></b></p>
-         <p>window.document title: <b ng-bind="windowTitle"></b></p>
-       </div>
-     </file>
-     <file name="script.js">
-       angular.module('documentExample', [])
-         .controller('ExampleController', ['$scope', '$document', function($scope, $document) {
-           $scope.title = $document[0].title;
-           $scope.windowTitle = angular.element(window.document)[0].title;
-         }]);
-     </file>
-   </example>
- */
-function $DocumentProvider() {
-  this.$get = ['$window', function(window) {
-    return jqLite(window.document);
-  }];
-}
-
-/**
- * @ngdoc service
- * @name $exceptionHandler
- * @requires ng.$log
- *
- * @description
- * Any uncaught exception in angular expressions is delegated to this service.
- * The default implementation simply delegates to `$log.error` which logs it into
- * the browser console.
- *
- * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by
- * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.
- *
- * ## Example:
- *
- * ```js
- *   angular.module('exceptionOverride', []).factory('$exceptionHandler', function() {
- *     return function(exception, cause) {
- *       exception.message += ' (caused by "' + cause + '")';
- *       throw exception;
- *     };
- *   });
- * ```
- *
- * This example will override the normal action of `$exceptionHandler`, to make angular
- * exceptions fail hard when they happen, instead of just logging to the console.
- *
- * <hr />
- * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`
- * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}
- * (unless executed during a digest).
- *
- * If you wish, you can manually delegate exceptions, e.g.
- * `try { ... } catch(e) { $exceptionHandler(e); }`
- *
- * @param {Error} exception Exception associated with the error.
- * @param {string=} cause optional information about the context in which
- *       the error was thrown.
- *
- */
-function $ExceptionHandlerProvider() {
-  this.$get = ['$log', function($log) {
-    return function(exception, cause) {
-      $log.error.apply($log, arguments);
-    };
-  }];
-}
-
-var $$ForceReflowProvider = function() {
-  this.$get = ['$document', function($document) {
-    return function(domNode) {
-      //the line below will force the browser to perform a repaint so
-      //that all the animated elements within the animation frame will
-      //be properly updated and drawn on screen. This is required to
-      //ensure that the preparation animation is properly flushed so that
-      //the active state picks up from there. DO NOT REMOVE THIS LINE.
-      //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH
-      //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND
-      //WILL TAKE YEARS AWAY FROM YOUR LIFE.
-      if (domNode) {
-        if (!domNode.nodeType && domNode instanceof jqLite) {
-          domNode = domNode[0];
-        }
-      } else {
-        domNode = $document[0].body;
-      }
-      return domNode.offsetWidth + 1;
-    };
-  }];
-};
-
-var APPLICATION_JSON = 'application/json';
-var CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'};
-var JSON_START = /^\[|^\{(?!\{)/;
-var JSON_ENDS = {
-  '[': /]$/,
-  '{': /}$/
-};
-var JSON_PROTECTION_PREFIX = /^\)\]\}',?\n/;
-var $httpMinErr = minErr('$http');
-var $httpMinErrLegacyFn = function(method) {
-  return function() {
-    throw $httpMinErr('legacy', 'The method `{0}` on the promise returned from `$http` has been disabled.', method);
-  };
-};
-
-function serializeValue(v) {
-  if (isObject(v)) {
-    return isDate(v) ? v.toISOString() : toJson(v);
-  }
-  return v;
-}
-
-
-function $HttpParamSerializerProvider() {
-  /**
-   * @ngdoc service
-   * @name $httpParamSerializer
-   * @description
-   *
-   * Default {@link $http `$http`} params serializer that converts objects to strings
-   * according to the following rules:
-   *
-   * * `{'foo': 'bar'}` results in `foo=bar`
-   * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object)
-   * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element)
-   * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D"` (stringified and encoded representation of an object)
-   *
-   * Note that serializer will sort the request parameters alphabetically.
-   * */
-
-  this.$get = function() {
-    return function ngParamSerializer(params) {
-      if (!params) return '';
-      var parts = [];
-      forEachSorted(params, function(value, key) {
-        if (value === null || isUndefined(value)) return;
-        if (isArray(value)) {
-          forEach(value, function(v, k) {
-            parts.push(encodeUriQuery(key)  + '=' + encodeUriQuery(serializeValue(v)));
-          });
-        } else {
-          parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value)));
-        }
-      });
-
-      return parts.join('&');
-    };
-  };
-}
-
-function $HttpParamSerializerJQLikeProvider() {
-  /**
-   * @ngdoc service
-   * @name $httpParamSerializerJQLike
-   * @description
-   *
-   * Alternative {@link $http `$http`} params serializer that follows
-   * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic.
-   * The serializer will also sort the params alphabetically.
-   *
-   * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property:
-   *
-   * ```js
-   * $http({
-   *   url: myUrl,
-   *   method: 'GET',
-   *   params: myParams,
-   *   paramSerializer: '$httpParamSerializerJQLike'
-   * });
-   * ```
-   *
-   * It is also possible to set it as the default `paramSerializer` in the
-   * {@link $httpProvider#defaults `$httpProvider`}.
-   *
-   * Additionally, you can inject the serializer and use it explicitly, for example to serialize
-   * form data for submission:
-   *
-   * ```js
-   * .controller(function($http, $httpParamSerializerJQLike) {
-   *   //...
-   *
-   *   $http({
-   *     url: myUrl,
-   *     method: 'POST',
-   *     data: $httpParamSerializerJQLike(myData),
-   *     headers: {
-   *       'Content-Type': 'application/x-www-form-urlencoded'
-   *     }
-   *   });
-   *
-   * });
-   * ```
-   *
-   * */
-  this.$get = function() {
-    return function jQueryLikeParamSerializer(params) {
-      if (!params) return '';
-      var parts = [];
-      serialize(params, '', true);
-      return parts.join('&');
-
-      function serialize(toSerialize, prefix, topLevel) {
-        if (toSerialize === null || isUndefined(toSerialize)) return;
-        if (isArray(toSerialize)) {
-          forEach(toSerialize, function(value, index) {
-            serialize(value, prefix + '[' + (isObject(value) ? index : '') + ']');
-          });
-        } else if (isObject(toSerialize) && !isDate(toSerialize)) {
-          forEachSorted(toSerialize, function(value, key) {
-            serialize(value, prefix +
-                (topLevel ? '' : '[') +
-                key +
-                (topLevel ? '' : ']'));
-          });
-        } else {
-          parts.push(encodeUriQuery(prefix) + '=' + encodeUriQuery(serializeValue(toSerialize)));
-        }
-      }
-    };
-  };
-}
-
-function defaultHttpResponseTransform(data, headers) {
-  if (isString(data)) {
-    // Strip json vulnerability protection prefix and trim whitespace
-    var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();
-
-    if (tempData) {
-      var contentType = headers('Content-Type');
-      if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) {
-        data = fromJson(tempData);
-      }
-    }
-  }
-
-  return data;
-}
-
-function isJsonLike(str) {
-    var jsonStart = str.match(JSON_START);
-    return jsonStart && JSON_ENDS[jsonStart[0]].test(str);
-}
-
-/**
- * Parse headers into key value object
- *
- * @param {string} headers Raw headers as a string
- * @returns {Object} Parsed headers as key value object
- */
-function parseHeaders(headers) {
-  var parsed = createMap(), i;
-
-  function fillInParsed(key, val) {
-    if (key) {
-      parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
-    }
-  }
-
-  if (isString(headers)) {
-    forEach(headers.split('\n'), function(line) {
-      i = line.indexOf(':');
-      fillInParsed(lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1)));
-    });
-  } else if (isObject(headers)) {
-    forEach(headers, function(headerVal, headerKey) {
-      fillInParsed(lowercase(headerKey), trim(headerVal));
-    });
-  }
-
-  return parsed;
-}
-
-
-/**
- * Returns a function that provides access to parsed headers.
- *
- * Headers are lazy parsed when first requested.
- * @see parseHeaders
- *
- * @param {(string|Object)} headers Headers to provide access to.
- * @returns {function(string=)} Returns a getter function which if called with:
- *
- *   - if called with single an argument returns a single header value or null
- *   - if called with no arguments returns an object containing all headers.
- */
-function headersGetter(headers) {
-  var headersObj;
-
-  return function(name) {
-    if (!headersObj) headersObj =  parseHeaders(headers);
-
-    if (name) {
-      var value = headersObj[lowercase(name)];
-      if (value === void 0) {
-        value = null;
-      }
-      return value;
-    }
-
-    return headersObj;
-  };
-}
-
-
-/**
- * Chain all given functions
- *
- * This function is used for both request and response transforming
- *
- * @param {*} data Data to transform.
- * @param {function(string=)} headers HTTP headers getter fn.
- * @param {number} status HTTP status code of the response.
- * @param {(Function|Array.<Function>)} fns Function or an array of functions.
- * @returns {*} Transformed data.
- */
-function transformData(data, headers, status, fns) {
-  if (isFunction(fns)) {
-    return fns(data, headers, status);
-  }
-
-  forEach(fns, function(fn) {
-    data = fn(data, headers, status);
-  });
-
-  return data;
-}
-
-
-function isSuccess(status) {
-  return 200 <= status && status < 300;
-}
-
-
-/**
- * @ngdoc provider
- * @name $httpProvider
- * @description
- * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service.
- * */
-function $HttpProvider() {
-  /**
-   * @ngdoc property
-   * @name $httpProvider#defaults
-   * @description
-   *
-   * Object containing default values for all {@link ng.$http $http} requests.
-   *
-   * - **`defaults.cache`** - {Object} - an object built with {@link ng.$cacheFactory `$cacheFactory`}
-   * that will provide the cache for all requests who set their `cache` property to `true`.
-   * If you set the `defaults.cache = false` then only requests that specify their own custom
-   * cache object will be cached. See {@link $http#caching $http Caching} for more information.
-   *
-   * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.
-   * Defaults value is `'XSRF-TOKEN'`.
-   *
-   * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the
-   * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.
-   *
-   * - **`defaults.headers`** - {Object} - Default headers for all $http requests.
-   * Refer to {@link ng.$http#setting-http-headers $http} for documentation on
-   * setting default headers.
-   *     - **`defaults.headers.common`**
-   *     - **`defaults.headers.post`**
-   *     - **`defaults.headers.put`**
-   *     - **`defaults.headers.patch`**
-   *
-   *
-   * - **`defaults.paramSerializer`** - `{string|function(Object<string,string>):string}` - A function
-   *  used to the prepare string representation of request parameters (specified as an object).
-   *  If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}.
-   *  Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}.
-   *
-   **/
-  var defaults = this.defaults = {
-    // transform incoming response data
-    transformResponse: [defaultHttpResponseTransform],
-
-    // transform outgoing request data
-    transformRequest: [function(d) {
-      return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d;
-    }],
-
-    // default headers
-    headers: {
-      common: {
-        'Accept': 'application/json, text/plain, */*'
-      },
-      post:   shallowCopy(CONTENT_TYPE_APPLICATION_JSON),
-      put:    shallowCopy(CONTENT_TYPE_APPLICATION_JSON),
-      patch:  shallowCopy(CONTENT_TYPE_APPLICATION_JSON)
-    },
-
-    xsrfCookieName: 'XSRF-TOKEN',
-    xsrfHeaderName: 'X-XSRF-TOKEN',
-
-    paramSerializer: '$httpParamSerializer'
-  };
-
-  var useApplyAsync = false;
-  /**
-   * @ngdoc method
-   * @name $httpProvider#useApplyAsync
-   * @description
-   *
-   * Configure $http service to combine processing of multiple http responses received at around
-   * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in
-   * significant performance improvement for bigger applications that make many HTTP requests
-   * concurrently (common during application bootstrap).
-   *
-   * Defaults to false. If no value is specified, returns the current configured value.
-   *
-   * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred
-   *    "apply" on the next tick, giving time for subsequent requests in a roughly ~10ms window
-   *    to load and share the same digest cycle.
-   *
-   * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.
-   *    otherwise, returns the current configured value.
-   **/
-  this.useApplyAsync = function(value) {
-    if (isDefined(value)) {
-      useApplyAsync = !!value;
-      return this;
-    }
-    return useApplyAsync;
-  };
-
-  var useLegacyPromise = true;
-  /**
-   * @ngdoc method
-   * @name $httpProvider#useLegacyPromiseExtensions
-   * @description
-   *
-   * Configure `$http` service to return promises without the shorthand methods `success` and `error`.
-   * This should be used to make sure that applications work without these methods.
-   *
-   * Defaults to false. If no value is specified, returns the current configured value.
-   *
-   * @param {boolean=} value If true, `$http` will return a normal promise without the `success` and `error` methods.
-   *
-   * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.
-   *    otherwise, returns the current configured value.
-   **/
-  this.useLegacyPromiseExtensions = function(value) {
-    if (isDefined(value)) {
-      useLegacyPromise = !!value;
-      return this;
-    }
-    return useLegacyPromise;
-  };
-
-  /**
-   * @ngdoc property
-   * @name $httpProvider#interceptors
-   * @description
-   *
-   * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http}
-   * pre-processing of request or postprocessing of responses.
-   *
-   * These service factories are ordered by request, i.e. they are applied in the same order as the
-   * array, on request, but reverse order, on response.
-   *
-   * {@link ng.$http#interceptors Interceptors detailed info}
-   **/
-  var interceptorFactories = this.interceptors = [];
-
-  this.$get = ['$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector',
-      function($httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector) {
-
-    var defaultCache = $cacheFactory('$http');
-
-    /**
-     * Make sure that default param serializer is exposed as a function
-     */
-    defaults.paramSerializer = isString(defaults.paramSerializer) ?
-      $injector.get(defaults.paramSerializer) : defaults.paramSerializer;
-
-    /**
-     * Interceptors stored in reverse order. Inner interceptors before outer interceptors.
-     * The reversal is needed so that we can build up the interception chain around the
-     * server request.
-     */
-    var reversedInterceptors = [];
-
-    forEach(interceptorFactories, function(interceptorFactory) {
-      reversedInterceptors.unshift(isString(interceptorFactory)
-          ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory));
-    });
-
-    /**
-     * @ngdoc service
-     * @kind function
-     * @name $http
-     * @requires ng.$httpBackend
-     * @requires $cacheFactory
-     * @requires $rootScope
-     * @requires $q
-     * @requires $injector
-     *
-     * @description
-     * The `$http` service is a core Angular service that facilitates communication with the remote
-     * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest)
-     * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP).
-     *
-     * For unit testing applications that use `$http` service, see
-     * {@link ngMock.$httpBackend $httpBackend mock}.
-     *
-     * For a higher level of abstraction, please check out the {@link ngResource.$resource
-     * $resource} service.
-     *
-     * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by
-     * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage
-     * it is important to familiarize yourself with these APIs and the guarantees they provide.
-     *
-     *
-     * ## General usage
-     * The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} —
-     * that is used to generate an HTTP request and returns  a {@link ng.$q promise}.
-     *
-     * ```js
-     *   // Simple GET request example:
-     *   $http({
-     *     method: 'GET',
-     *     url: '/someUrl'
-     *   }).then(function successCallback(response) {
-     *       // this callback will be called asynchronously
-     *       // when the response is available
-     *     }, function errorCallback(response) {
-     *       // called asynchronously if an error occurs
-     *       // or server returns response with an error status.
-     *     });
-     * ```
-     *
-     * The response object has these properties:
-     *
-     *   - **data** – `{string|Object}` – The response body transformed with the transform
-     *     functions.
-     *   - **status** – `{number}` – HTTP status code of the response.
-     *   - **headers** – `{function([headerName])}` – Header getter function.
-     *   - **config** – `{Object}` – The configuration object that was used to generate the request.
-     *   - **statusText** – `{string}` – HTTP status text of the response.
-     *
-     * A response status code between 200 and 299 is considered a success status and
-     * will result in the success callback being called. Note that if the response is a redirect,
-     * XMLHttpRequest will transparently follow it, meaning that the error callback will not be
-     * called for such responses.
-     *
-     *
-     * ## Shortcut methods
-     *
-     * Shortcut methods are also available. All shortcut methods require passing in the URL, and
-     * request data must be passed in for POST/PUT requests. An optional config can be passed as the
-     * last argument.
-     *
-     * ```js
-     *   $http.get('/someUrl', config).then(successCallback, errorCallback);
-     *   $http.post('/someUrl', data, config).then(successCallback, errorCallback);
-     * ```
-     *
-     * Complete list of shortcut methods:
-     *
-     * - {@link ng.$http#get $http.get}
-     * - {@link ng.$http#head $http.head}
-     * - {@link ng.$http#post $http.post}
-     * - {@link ng.$http#put $http.put}
-     * - {@link ng.$http#delete $http.delete}
-     * - {@link ng.$http#jsonp $http.jsonp}
-     * - {@link ng.$http#patch $http.patch}
-     *
-     *
-     * ## Writing Unit Tests that use $http
-     * When unit testing (using {@link ngMock ngMock}), it is necessary to call
-     * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending
-     * request using trained responses.
-     *
-     * ```
-     * $httpBackend.expectGET(...);
-     * $http.get(...);
-     * $httpBackend.flush();
-     * ```
-     *
-     * ## Deprecation Notice
-     * <div class="alert alert-danger">
-     *   The `$http` legacy promise methods `success` and `error` have been deprecated.
-     *   Use the standard `then` method instead.
-     *   If {@link $httpProvider#useLegacyPromiseExtensions `$httpProvider.useLegacyPromiseExtensions`} is set to
-     *   `false` then these methods will throw {@link $http:legacy `$http/legacy`} error.
-     * </div>
-     *
-     * ## Setting HTTP Headers
-     *
-     * The $http service will automatically add certain HTTP headers to all requests. These defaults
-     * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration
-     * object, which currently contains this default configuration:
-     *
-     * - `$httpProvider.defaults.headers.common` (headers that are common for all requests):
-     *   - `Accept: application/json, text/plain, * / *`
-     * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)
-     *   - `Content-Type: application/json`
-     * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)
-     *   - `Content-Type: application/json`
-     *
-     * To add or overwrite these defaults, simply add or remove a property from these configuration
-     * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object
-     * with the lowercased HTTP method name as the key, e.g.
-     * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`.
-     *
-     * The defaults can also be set at runtime via the `$http.defaults` object in the same
-     * fashion. For example:
-     *
-     * ```
-     * module.run(function($http) {
-     *   $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w'
-     * });
-     * ```
-     *
-     * In addition, you can supply a `headers` property in the config object passed when
-     * calling `$http(config)`, which overrides the defaults without changing them globally.
-     *
-     * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis,
-     * Use the `headers` property, setting the desired header to `undefined`. For example:
-     *
-     * ```js
-     * var req = {
-     *  method: 'POST',
-     *  url: 'http://example.com',
-     *  headers: {
-     *    'Content-Type': undefined
-     *  },
-     *  data: { test: 'test' }
-     * }
-     *
-     * $http(req).then(function(){...}, function(){...});
-     * ```
-     *
-     * ## Transforming Requests and Responses
-     *
-     * Both requests and responses can be transformed using transformation functions: `transformRequest`
-     * and `transformResponse`. These properties can be a single function that returns
-     * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions,
-     * which allows you to `push` or `unshift` a new transformation function into the transformation chain.
-     *
-     * ### Default Transformations
-     *
-     * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and
-     * `defaults.transformResponse` properties. If a request does not provide its own transformations
-     * then these will be applied.
-     *
-     * You can augment or replace the default transformations by modifying these properties by adding to or
-     * replacing the array.
-     *
-     * Angular provides the following default transformations:
-     *
-     * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`):
-     *
-     * - If the `data` property of the request configuration object contains an object, serialize it
-     *   into JSON format.
-     *
-     * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`):
-     *
-     *  - If XSRF prefix is detected, strip it (see Security Considerations section below).
-     *  - If JSON response is detected, deserialize it using a JSON parser.
-     *
-     *
-     * ### Overriding the Default Transformations Per Request
-     *
-     * If you wish override the request/response transformations only for a single request then provide
-     * `transformRequest` and/or `transformResponse` properties on the configuration object passed
-     * into `$http`.
-     *
-     * Note that if you provide these properties on the config object the default transformations will be
-     * overwritten. If you wish to augment the default transformations then you must include them in your
-     * local transformation array.
-     *
-     * The following code demonstrates adding a new response transformation to be run after the default response
-     * transformations have been run.
-     *
-     * ```js
-     * function appendTransform(defaults, transform) {
-     *
-     *   // We can't guarantee that the default transformation is an array
-     *   defaults = angular.isArray(defaults) ? defaults : [defaults];
-     *
-     *   // Append the new transformation to the defaults
-     *   return defaults.concat(transform);
-     * }
-     *
-     * $http({
-     *   url: '...',
-     *   method: 'GET',
-     *   transformResponse: appendTransform($http.defaults.transformResponse, function(value) {
-     *     return doTransform(value);
-     *   })
-     * });
-     * ```
-     *
-     *
-     * ## Caching
-     *
-     * To enable caching, set the request configuration `cache` property to `true` (to use default
-     * cache) or to a custom cache object (built with {@link ng.$cacheFactory `$cacheFactory`}).
-     * When the cache is enabled, `$http` stores the response from the server in the specified
-     * cache. The next time the same request is made, the response is served from the cache without
-     * sending a request to the server.
-     *
-     * Note that even if the response is served from cache, delivery of the data is asynchronous in
-     * the same way that real requests are.
-     *
-     * If there are multiple GET requests for the same URL that should be cached using the same
-     * cache, but the cache is not populated yet, only one request to the server will be made and
-     * the remaining requests will be fulfilled using the response from the first request.
-     *
-     * You can change the default cache to a new object (built with
-     * {@link ng.$cacheFactory `$cacheFactory`}) by updating the
-     * {@link ng.$http#defaults `$http.defaults.cache`} property. All requests who set
-     * their `cache` property to `true` will now use this cache object.
-     *
-     * If you set the default cache to `false` then only requests that specify their own custom
-     * cache object will be cached.
-     *
-     * ## Interceptors
-     *
-     * Before you start creating interceptors, be sure to understand the
-     * {@link ng.$q $q and deferred/promise APIs}.
-     *
-     * For purposes of global error handling, authentication, or any kind of synchronous or
-     * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be
-     * able to intercept requests before they are handed to the server and
-     * responses before they are handed over to the application code that
-     * initiated these requests. The interceptors leverage the {@link ng.$q
-     * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing.
-     *
-     * The interceptors are service factories that are registered with the `$httpProvider` by
-     * adding them to the `$httpProvider.interceptors` array. The factory is called and
-     * injected with dependencies (if specified) and returns the interceptor.
-     *
-     * There are two kinds of interceptors (and two kinds of rejection interceptors):
-     *
-     *   * `request`: interceptors get called with a http {@link $http#usage config} object. The function is free to
-     *     modify the `config` object or create a new one. The function needs to return the `config`
-     *     object directly, or a promise containing the `config` or a new `config` object.
-     *   * `requestError`: interceptor gets called when a previous interceptor threw an error or
-     *     resolved with a rejection.
-     *   * `response`: interceptors get called with http `response` object. The function is free to
-     *     modify the `response` object or create a new one. The function needs to return the `response`
-     *     object directly, or as a promise containing the `response` or a new `response` object.
-     *   * `responseError`: interceptor gets called when a previous interceptor threw an error or
-     *     resolved with a rejection.
-     *
-     *
-     * ```js
-     *   // register the interceptor as a service
-     *   $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
-     *     return {
-     *       // optional method
-     *       'request': function(config) {
-     *         // do something on success
-     *         return config;
-     *       },
-     *
-     *       // optional method
-     *      'requestError': function(rejection) {
-     *         // do something on error
-     *         if (canRecover(rejection)) {
-     *           return responseOrNewPromise
-     *         }
-     *         return $q.reject(rejection);
-     *       },
-     *
-     *
-     *
-     *       // optional method
-     *       'response': function(response) {
-     *         // do something on success
-     *         return response;
-     *       },
-     *
-     *       // optional method
-     *      'responseError': function(rejection) {
-     *         // do something on error
-     *         if (canRecover(rejection)) {
-     *           return responseOrNewPromise
-     *         }
-     *         return $q.reject(rejection);
-     *       }
-     *     };
-     *   });
-     *
-     *   $httpProvider.interceptors.push('myHttpInterceptor');
-     *
-     *
-     *   // alternatively, register the interceptor via an anonymous factory
-     *   $httpProvider.interceptors.push(function($q, dependency1, dependency2) {
-     *     return {
-     *      'request': function(config) {
-     *          // same as above
-     *       },
-     *
-     *       'response': function(response) {
-     *          // same as above
-     *       }
-     *     };
-     *   });
-     * ```
-     *
-     * ## Security Considerations
-     *
-     * When designing web applications, consider security threats from:
-     *
-     * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)
-     * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)
-     *
-     * Both server and the client must cooperate in order to eliminate these threats. Angular comes
-     * pre-configured with strategies that address these issues, but for this to work backend server
-     * cooperation is required.
-     *
-     * ### JSON Vulnerability Protection
-     *
-     * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)
-     * allows third party website to turn your JSON resource URL into
-     * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To
-     * counter this your server can prefix all JSON requests with following string `")]}',\n"`.
-     * Angular will automatically strip the prefix before processing it as JSON.
-     *
-     * For example if your server needs to return:
-     * ```js
-     * ['one','two']
-     * ```
-     *
-     * which is vulnerable to attack, your server can return:
-     * ```js
-     * )]}',
-     * ['one','two']
-     * ```
-     *
-     * Angular will strip the prefix, before processing the JSON.
-     *
-     *
-     * ### Cross Site Request Forgery (XSRF) Protection
-     *
-     * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is a technique by which
-     * an unauthorized site can gain your user's private data. Angular provides a mechanism
-     * to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie
-     * (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only
-     * JavaScript that runs on your domain could read the cookie, your server can be assured that
-     * the XHR came from JavaScript running on your domain. The header will not be set for
-     * cross-domain requests.
-     *
-     * To take advantage of this, your server needs to set a token in a JavaScript readable session
-     * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the
-     * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure
-     * that only JavaScript running on your domain could have sent the request. The token must be
-     * unique for each user and must be verifiable by the server (to prevent the JavaScript from
-     * making up its own tokens). We recommend that the token is a digest of your site's
-     * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography&#41;)
-     * for added security.
-     *
-     * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName
-     * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,
-     * or the per-request config object.
-     *
-     * In order to prevent collisions in environments where multiple Angular apps share the
-     * same domain or subdomain, we recommend that each application uses unique cookie name.
-     *
-     * @param {object} config Object describing the request to be made and how it should be
-     *    processed. The object has following properties:
-     *
-     *    - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)
-     *    - **url** – `{string}` – Absolute or relative URL of the resource that is being requested.
-     *    - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be serialized
-     *      with the `paramSerializer` and appended as GET parameters.
-     *    - **data** – `{string|Object}` – Data to be sent as the request message data.
-     *    - **headers** – `{Object}` – Map of strings or functions which return strings representing
-     *      HTTP headers to send to the server. If the return value of a function is null, the
-     *      header will not be sent. Functions accept a config object as an argument.
-     *    - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token.
-     *    - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token.
-     *    - **transformRequest** –
-     *      `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
-     *      transform function or an array of such functions. The transform function takes the http
-     *      request body and headers and returns its transformed (typically serialized) version.
-     *      See {@link ng.$http#overriding-the-default-transformations-per-request
-     *      Overriding the Default Transformations}
-     *    - **transformResponse** –
-     *      `{function(data, headersGetter, status)|Array.<function(data, headersGetter, status)>}` –
-     *      transform function or an array of such functions. The transform function takes the http
-     *      response body, headers and status and returns its transformed (typically deserialized) version.
-     *      See {@link ng.$http#overriding-the-default-transformations-per-request
-     *      Overriding the Default TransformationjqLiks}
-     *    - **paramSerializer** - `{string|function(Object<string,string>):string}` - A function used to
-     *      prepare the string representation of request parameters (specified as an object).
-     *      If specified as string, it is interpreted as function registered with the
-     *      {@link $injector $injector}, which means you can create your own serializer
-     *      by registering it as a {@link auto.$provide#service service}.
-     *      The default serializer is the {@link $httpParamSerializer $httpParamSerializer};
-     *      alternatively, you can use the {@link $httpParamSerializerJQLike $httpParamSerializerJQLike}
-     *    - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
-     *      GET request, otherwise if a cache instance built with
-     *      {@link ng.$cacheFactory $cacheFactory}, this cache will be used for
-     *      caching.
-     *    - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise}
-     *      that should abort the request when resolved.
-     *    - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the
-     *      XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials)
-     *      for more information.
-     *    - **responseType** - `{string}` - see
-     *      [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype).
-     *
-     * @returns {HttpPromise} Returns a {@link ng.$q `Promise}` that will be resolved to a response object
-     *                        when the request succeeds or fails.
-     *
-     *
-     * @property {Array.<Object>} pendingRequests Array of config objects for currently pending
-     *   requests. This is primarily meant to be used for debugging purposes.
-     *
-     *
-     * @example
-<example module="httpExample">
-<file name="index.html">
-  <div ng-controller="FetchController">
-    <select ng-model="method" aria-label="Request method">
-      <option>GET</option>
-      <option>JSONP</option>
-    </select>
-    <input type="text" ng-model="url" size="80" aria-label="URL" />
-    <button id="fetchbtn" ng-click="fetch()">fetch</button><br>
-    <button id="samplegetbtn" ng-click="updateModel('GET', 'http-hello.html')">Sample GET</button>
-    <button id="samplejsonpbtn"
-      ng-click="updateModel('JSONP',
-                    'https://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')">
-      Sample JSONP
-    </button>
-    <button id="invalidjsonpbtn"
-      ng-click="updateModel('JSONP', 'https://angularjs.org/doesntexist&callback=JSON_CALLBACK')">
-        Invalid JSONP
-      </button>
-    <pre>http status code: {{status}}</pre>
-    <pre>http response data: {{data}}</pre>
-  </div>
-</file>
-<file name="script.js">
-  angular.module('httpExample', [])
-    .controller('FetchController', ['$scope', '$http', '$templateCache',
-      function($scope, $http, $templateCache) {
-        $scope.method = 'GET';
-        $scope.url = 'http-hello.html';
-
-        $scope.fetch = function() {
-          $scope.code = null;
-          $scope.response = null;
-
-          $http({method: $scope.method, url: $scope.url, cache: $templateCache}).
-            then(function(response) {
-              $scope.status = response.status;
-              $scope.data = response.data;
-            }, function(response) {
-              $scope.data = response.data || "Request failed";
-              $scope.status = response.status;
-          });
-        };
-
-        $scope.updateModel = function(method, url) {
-          $scope.method = method;
-          $scope.url = url;
-        };
-      }]);
-</file>
-<file name="http-hello.html">
-  Hello, $http!
-</file>
-<file name="protractor.js" type="protractor">
-  var status = element(by.binding('status'));
-  var data = element(by.binding('data'));
-  var fetchBtn = element(by.id('fetchbtn'));
-  var sampleGetBtn = element(by.id('samplegetbtn'));
-  var sampleJsonpBtn = element(by.id('samplejsonpbtn'));
-  var invalidJsonpBtn = element(by.id('invalidjsonpbtn'));
-
-  it('should make an xhr GET request', function() {
-    sampleGetBtn.click();
-    fetchBtn.click();
-    expect(status.getText()).toMatch('200');
-    expect(data.getText()).toMatch(/Hello, \$http!/);
-  });
-
-// Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185
-// it('should make a JSONP request to angularjs.org', function() {
-//   sampleJsonpBtn.click();
-//   fetchBtn.click();
-//   expect(status.getText()).toMatch('200');
-//   expect(data.getText()).toMatch(/Super Hero!/);
-// });
-
-  it('should make JSONP request to invalid URL and invoke the error handler',
-      function() {
-    invalidJsonpBtn.click();
-    fetchBtn.click();
-    expect(status.getText()).toMatch('0');
-    expect(data.getText()).toMatch('Request failed');
-  });
-</file>
-</example>
-     */
-    function $http(requestConfig) {
-
-      if (!angular.isObject(requestConfig)) {
-        throw minErr('$http')('badreq', 'Http request configuration must be an object.  Received: {0}', requestConfig);
-      }
-
-      var config = extend({
-        method: 'get',
-        transformRequest: defaults.transformRequest,
-        transformResponse: defaults.transformResponse,
-        paramSerializer: defaults.paramSerializer
-      }, requestConfig);
-
-      config.headers = mergeHeaders(requestConfig);
-      config.method = uppercase(config.method);
-      config.paramSerializer = isString(config.paramSerializer) ?
-        $injector.get(config.paramSerializer) : config.paramSerializer;
-
-      var serverRequest = function(config) {
-        var headers = config.headers;
-        var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);
-
-        // strip content-type if data is undefined
-        if (isUndefined(reqData)) {
-          forEach(headers, function(value, header) {
-            if (lowercase(header) === 'content-type') {
-                delete headers[header];
-            }
-          });
-        }
-
-        if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {
-          config.withCredentials = defaults.withCredentials;
-        }
-
-        // send request
-        return sendReq(config, reqData).then(transformResponse, transformResponse);
-      };
-
-      var chain = [serverRequest, undefined];
-      var promise = $q.when(config);
-
-      // apply interceptors
-      forEach(reversedInterceptors, function(interceptor) {
-        if (interceptor.request || interceptor.requestError) {
-          chain.unshift(interceptor.request, interceptor.requestError);
-        }
-        if (interceptor.response || interceptor.responseError) {
-          chain.push(interceptor.response, interceptor.responseError);
-        }
-      });
-
-      while (chain.length) {
-        var thenFn = chain.shift();
-        var rejectFn = chain.shift();
-
-        promise = promise.then(thenFn, rejectFn);
-      }
-
-      if (useLegacyPromise) {
-        promise.success = function(fn) {
-          assertArgFn(fn, 'fn');
-
-          promise.then(function(response) {
-            fn(response.data, response.status, response.headers, config);
-          });
-          return promise;
-        };
-
-        promise.error = function(fn) {
-          assertArgFn(fn, 'fn');
-
-          promise.then(null, function(response) {
-            fn(response.data, response.status, response.headers, config);
-          });
-          return promise;
-        };
-      } else {
-        promise.success = $httpMinErrLegacyFn('success');
-        promise.error = $httpMinErrLegacyFn('error');
-      }
-
-      return promise;
-
-      function transformResponse(response) {
-        // make a copy since the response must be cacheable
-        var resp = extend({}, response);
-        if (!response.data) {
-          resp.data = response.data;
-        } else {
-          resp.data = transformData(response.data, response.headers, response.status, config.transformResponse);
-        }
-        return (isSuccess(response.status))
-          ? resp
-          : $q.reject(resp);
-      }
-
-      function executeHeaderFns(headers, config) {
-        var headerContent, processedHeaders = {};
-
-        forEach(headers, function(headerFn, header) {
-          if (isFunction(headerFn)) {
-            headerContent = headerFn(config);
-            if (headerContent != null) {
-              processedHeaders[header] = headerContent;
-            }
-          } else {
-            processedHeaders[header] = headerFn;
-          }
-        });
-
-        return processedHeaders;
-      }
-
-      function mergeHeaders(config) {
-        var defHeaders = defaults.headers,
-            reqHeaders = extend({}, config.headers),
-            defHeaderName, lowercaseDefHeaderName, reqHeaderName;
-
-        defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);
-
-        // using for-in instead of forEach to avoid unecessary iteration after header has been found
-        defaultHeadersIteration:
-        for (defHeaderName in defHeaders) {
-          lowercaseDefHeaderName = lowercase(defHeaderName);
-
-          for (reqHeaderName in reqHeaders) {
-            if (lowercase(reqHeaderName) === lowercaseDefHeaderName) {
-              continue defaultHeadersIteration;
-            }
-          }
-
-          reqHeaders[defHeaderName] = defHeaders[defHeaderName];
-        }
-
-        // execute if header value is a function for merged headers
-        return executeHeaderFns(reqHeaders, shallowCopy(config));
-      }
-    }
-
-    $http.pendingRequests = [];
-
-    /**
-     * @ngdoc method
-     * @name $http#get
-     *
-     * @description
-     * Shortcut method to perform `GET` request.
-     *
-     * @param {string} url Relative or absolute URL specifying the destination of the request
-     * @param {Object=} config Optional configuration object
-     * @returns {HttpPromise} Future object
-     */
-
-    /**
-     * @ngdoc method
-     * @name $http#delete
-     *
-     * @description
-     * Shortcut method to perform `DELETE` request.
-     *
-     * @param {string} url Relative or absolute URL specifying the destination of the request
-     * @param {Object=} config Optional configuration object
-     * @returns {HttpPromise} Future object
-     */
-
-    /**
-     * @ngdoc method
-     * @name $http#head
-     *
-     * @description
-     * Shortcut method to perform `HEAD` request.
-     *
-     * @param {string} url Relative or absolute URL specifying the destination of the request
-     * @param {Object=} config Optional configuration object
-     * @returns {HttpPromise} Future object
-     */
-
-    /**
-     * @ngdoc method
-     * @name $http#jsonp
-     *
-     * @description
-     * Shortcut method to perform `JSONP` request.
-     *
-     * @param {string} url Relative or absolute URL specifying the destination of the request.
-     *                     The name of the callback should be the string `JSON_CALLBACK`.
-     * @param {Object=} config Optional configuration object
-     * @returns {HttpPromise} Future object
-     */
-    createShortMethods('get', 'delete', 'head', 'jsonp');
-
-    /**
-     * @ngdoc method
-     * @name $http#post
-     *
-     * @description
-     * Shortcut method to perform `POST` request.
-     *
-     * @param {string} url Relative or absolute URL specifying the destination of the request
-     * @param {*} data Request content
-     * @param {Object=} config Optional configuration object
-     * @returns {HttpPromise} Future object
-     */
-
-    /**
-     * @ngdoc method
-     * @name $http#put
-     *
-     * @description
-     * Shortcut method to perform `PUT` request.
-     *
-     * @param {string} url Relative or absolute URL specifying the destination of the request
-     * @param {*} data Request content
-     * @param {Object=} config Optional configuration object
-     * @returns {HttpPromise} Future object
-     */
-
-     /**
-      * @ngdoc method
-      * @name $http#patch
-      *
-      * @description
-      * Shortcut method to perform `PATCH` request.
-      *
-      * @param {string} url Relative or absolute URL specifying the destination of the request
-      * @param {*} data Request content
-      * @param {Object=} config Optional configuration object
-      * @returns {HttpPromise} Future object
-      */
-    createShortMethodsWithData('post', 'put', 'patch');
-
-        /**
-         * @ngdoc property
-         * @name $http#defaults
-         *
-         * @description
-         * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of
-         * default headers, withCredentials as well as request and response transformations.
-         *
-         * See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above.
-         */
-    $http.defaults = defaults;
-
-
-    return $http;
-
-
-    function createShortMethods(names) {
-      forEach(arguments, function(name) {
-        $http[name] = function(url, config) {
-          return $http(extend({}, config || {}, {
-            method: name,
-            url: url
-          }));
-        };
-      });
-    }
-
-
-    function createShortMethodsWithData(name) {
-      forEach(arguments, function(name) {
-        $http[name] = function(url, data, config) {
-          return $http(extend({}, config || {}, {
-            method: name,
-            url: url,
-            data: data
-          }));
-        };
-      });
-    }
-
-
-    /**
-     * Makes the request.
-     *
-     * !!! ACCESSES CLOSURE VARS:
-     * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests
-     */
-    function sendReq(config, reqData) {
-      var deferred = $q.defer(),
-          promise = deferred.promise,
-          cache,
-          cachedResp,
-          reqHeaders = config.headers,
-          url = buildUrl(config.url, config.paramSerializer(config.params));
-
-      $http.pendingRequests.push(config);
-      promise.then(removePendingReq, removePendingReq);
-
-
-      if ((config.cache || defaults.cache) && config.cache !== false &&
-          (config.method === 'GET' || config.method === 'JSONP')) {
-        cache = isObject(config.cache) ? config.cache
-              : isObject(defaults.cache) ? defaults.cache
-              : defaultCache;
-      }
-
-      if (cache) {
-        cachedResp = cache.get(url);
-        if (isDefined(cachedResp)) {
-          if (isPromiseLike(cachedResp)) {
-            // cached request has already been sent, but there is no response yet
-            cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);
-          } else {
-            // serving from cache
-            if (isArray(cachedResp)) {
-              resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);
-            } else {
-              resolvePromise(cachedResp, 200, {}, 'OK');
-            }
-          }
-        } else {
-          // put the promise for the non-transformed response into cache as a placeholder
-          cache.put(url, promise);
-        }
-      }
-
-
-      // if we won't have the response in cache, set the xsrf headers and
-      // send the request to the backend
-      if (isUndefined(cachedResp)) {
-        var xsrfValue = urlIsSameOrigin(config.url)
-            ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]
-            : undefined;
-        if (xsrfValue) {
-          reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;
-        }
-
-        $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,
-            config.withCredentials, config.responseType);
-      }
-
-      return promise;
-
-
-      /**
-       * Callback registered to $httpBackend():
-       *  - caches the response if desired
-       *  - resolves the raw $http promise
-       *  - calls $apply
-       */
-      function done(status, response, headersString, statusText) {
-        if (cache) {
-          if (isSuccess(status)) {
-            cache.put(url, [status, response, parseHeaders(headersString), statusText]);
-          } else {
-            // remove promise from the cache
-            cache.remove(url);
-          }
-        }
-
-        function resolveHttpPromise() {
-          resolvePromise(response, status, headersString, statusText);
-        }
-
-        if (useApplyAsync) {
-          $rootScope.$applyAsync(resolveHttpPromise);
-        } else {
-          resolveHttpPromise();
-          if (!$rootScope.$$phase) $rootScope.$apply();
-        }
-      }
-
-
-      /**
-       * Resolves the raw $http promise.
-       */
-      function resolvePromise(response, status, headers, statusText) {
-        //status: HTTP response status code, 0, -1 (aborted by timeout / promise)
-        status = status >= -1 ? status : 0;
-
-        (isSuccess(status) ? deferred.resolve : deferred.reject)({
-          data: response,
-          status: status,
-          headers: headersGetter(headers),
-          config: config,
-          statusText: statusText
-        });
-      }
-
-      function resolvePromiseWithResult(result) {
-        resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);
-      }
-
-      function removePendingReq() {
-        var idx = $http.pendingRequests.indexOf(config);
-        if (idx !== -1) $http.pendingRequests.splice(idx, 1);
-      }
-    }
-
-
-    function buildUrl(url, serializedParams) {
-      if (serializedParams.length > 0) {
-        url += ((url.indexOf('?') == -1) ? '?' : '&') + serializedParams;
-      }
-      return url;
-    }
-  }];
-}
-
-/**
- * @ngdoc service
- * @name $xhrFactory
- *
- * @description
- * Factory function used to create XMLHttpRequest objects.
- *
- * Replace or decorate this service to create your own custom XMLHttpRequest objects.
- *
- * ```
- * angular.module('myApp', [])
- * .factory('$xhrFactory', function() {
- *   return function createXhr(method, url) {
- *     return new window.XMLHttpRequest({mozSystem: true});
- *   };
- * });
- * ```
- *
- * @param {string} method HTTP method of the request (GET, POST, PUT, ..)
- * @param {string} url URL of the request.
- */
-function $xhrFactoryProvider() {
-  this.$get = function() {
-    return function createXhr() {
-      return new window.XMLHttpRequest();
-    };
-  };
-}
-
-/**
- * @ngdoc service
- * @name $httpBackend
- * @requires $window
- * @requires $document
- * @requires $xhrFactory
- *
- * @description
- * HTTP backend used by the {@link ng.$http service} that delegates to
- * XMLHttpRequest object or JSONP and deals with browser incompatibilities.
- *
- * You should never need to use this service directly, instead use the higher-level abstractions:
- * {@link ng.$http $http} or {@link ngResource.$resource $resource}.
- *
- * During testing this implementation is swapped with {@link ngMock.$httpBackend mock
- * $httpBackend} which can be trained with responses.
- */
-function $HttpBackendProvider() {
-  this.$get = ['$browser', '$window', '$document', '$xhrFactory', function($browser, $window, $document, $xhrFactory) {
-    return createHttpBackend($browser, $xhrFactory, $browser.defer, $window.angular.callbacks, $document[0]);
-  }];
-}
-
-function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {
-  // TODO(vojta): fix the signature
-  return function(method, url, post, callback, headers, timeout, withCredentials, responseType) {
-    $browser.$$incOutstandingRequestCount();
-    url = url || $browser.url();
-
-    if (lowercase(method) == 'jsonp') {
-      var callbackId = '_' + (callbacks.counter++).toString(36);
-      callbacks[callbackId] = function(data) {
-        callbacks[callbackId].data = data;
-        callbacks[callbackId].called = true;
-      };
-
-      var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId),
-          callbackId, function(status, text) {
-        completeRequest(callback, status, callbacks[callbackId].data, "", text);
-        callbacks[callbackId] = noop;
-      });
-    } else {
-
-      var xhr = createXhr(method, url);
-
-      xhr.open(method, url, true);
-      forEach(headers, function(value, key) {
-        if (isDefined(value)) {
-            xhr.setRequestHeader(key, value);
-        }
-      });
-
-      xhr.onload = function requestLoaded() {
-        var statusText = xhr.statusText || '';
-
-        // responseText is the old-school way of retrieving response (supported by IE9)
-        // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)
-        var response = ('response' in xhr) ? xhr.response : xhr.responseText;
-
-        // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
-        var status = xhr.status === 1223 ? 204 : xhr.status;
-
-        // fix status code when it is 0 (0 status is undocumented).
-        // Occurs when accessing file resources or on Android 4.1 stock browser
-        // while retrieving files from application cache.
-        if (status === 0) {
-          status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0;
-        }
-
-        completeRequest(callback,
-            status,
-            response,
-            xhr.getAllResponseHeaders(),
-            statusText);
-      };
-
-      var requestError = function() {
-        // The response is always empty
-        // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error
-        completeRequest(callback, -1, null, null, '');
-      };
-
-      xhr.onerror = requestError;
-      xhr.onabort = requestError;
-
-      if (withCredentials) {
-        xhr.withCredentials = true;
-      }
-
-      if (responseType) {
-        try {
-          xhr.responseType = responseType;
-        } catch (e) {
-          // WebKit added support for the json responseType value on 09/03/2013
-          // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are
-          // known to throw when setting the value "json" as the response type. Other older
-          // browsers implementing the responseType
-          //
-          // The json response type can be ignored if not supported, because JSON payloads are
-          // parsed on the client-side regardless.
-          if (responseType !== 'json') {
-            throw e;
-          }
-        }
-      }
-
-      xhr.send(isUndefined(post) ? null : post);
-    }
-
-    if (timeout > 0) {
-      var timeoutId = $browserDefer(timeoutRequest, timeout);
-    } else if (isPromiseLike(timeout)) {
-      timeout.then(timeoutRequest);
-    }
-
-
-    function timeoutRequest() {
-      jsonpDone && jsonpDone();
-      xhr && xhr.abort();
-    }
-
-    function completeRequest(callback, status, response, headersString, statusText) {
-      // cancel timeout and subsequent timeout promise resolution
-      if (isDefined(timeoutId)) {
-        $browserDefer.cancel(timeoutId);
-      }
-      jsonpDone = xhr = null;
-
-      callback(status, response, headersString, statusText);
-      $browser.$$completeOutstandingRequest(noop);
-    }
-  };
-
-  function jsonpReq(url, callbackId, done) {
-    // we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.:
-    // - fetches local scripts via XHR and evals them
-    // - adds and immediately removes script elements from the document
-    var script = rawDocument.createElement('script'), callback = null;
-    script.type = "text/javascript";
-    script.src = url;
-    script.async = true;
-
-    callback = function(event) {
-      removeEventListenerFn(script, "load", callback);
-      removeEventListenerFn(script, "error", callback);
-      rawDocument.body.removeChild(script);
-      script = null;
-      var status = -1;
-      var text = "unknown";
-
-      if (event) {
-        if (event.type === "load" && !callbacks[callbackId].called) {
-          event = { type: "error" };
-        }
-        text = event.type;
-        status = event.type === "error" ? 404 : 200;
-      }
-
-      if (done) {
-        done(status, text);
-      }
-    };
-
-    addEventListenerFn(script, "load", callback);
-    addEventListenerFn(script, "error", callback);
-    rawDocument.body.appendChild(script);
-    return callback;
-  }
-}
-
-var $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate');
-$interpolateMinErr.throwNoconcat = function(text) {
-  throw $interpolateMinErr('noconcat',
-      "Error while interpolating: {0}\nStrict Contextual Escaping disallows " +
-      "interpolations that concatenate multiple expressions when a trusted value is " +
-      "required.  See http://docs.angularjs.org/api/ng.$sce", text);
-};
-
-$interpolateMinErr.interr = function(text, err) {
-  return $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, err.toString());
-};
-
-/**
- * @ngdoc provider
- * @name $interpolateProvider
- *
- * @description
- *
- * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
- *
- * @example
-<example module="customInterpolationApp">
-<file name="index.html">
-<script>
-  var customInterpolationApp = angular.module('customInterpolationApp', []);
-
-  customInterpolationApp.config(function($interpolateProvider) {
-    $interpolateProvider.startSymbol('//');
-    $interpolateProvider.endSymbol('//');
-  });
-
-
-  customInterpolationApp.controller('DemoController', function() {
-      this.label = "This binding is brought you by // interpolation symbols.";
-  });
-</script>
-<div ng-app="App" ng-controller="DemoController as demo">
-    //demo.label//
-</div>
-</file>
-<file name="protractor.js" type="protractor">
-  it('should interpolate binding with custom symbols', function() {
-    expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.');
-  });
-</file>
-</example>
- */
-function $InterpolateProvider() {
-  var startSymbol = '{{';
-  var endSymbol = '}}';
-
-  /**
-   * @ngdoc method
-   * @name $interpolateProvider#startSymbol
-   * @description
-   * Symbol to denote start of expression in the interpolated string. Defaults to `{{`.
-   *
-   * @param {string=} value new value to set the starting symbol to.
-   * @returns {string|self} Returns the symbol when used as getter and self if used as setter.
-   */
-  this.startSymbol = function(value) {
-    if (value) {
-      startSymbol = value;
-      return this;
-    } else {
-      return startSymbol;
-    }
-  };
-
-  /**
-   * @ngdoc method
-   * @name $interpolateProvider#endSymbol
-   * @description
-   * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
-   *
-   * @param {string=} value new value to set the ending symbol to.
-   * @returns {string|self} Returns the symbol when used as getter and self if used as setter.
-   */
-  this.endSymbol = function(value) {
-    if (value) {
-      endSymbol = value;
-      return this;
-    } else {
-      return endSymbol;
-    }
-  };
-
-
-  this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {
-    var startSymbolLength = startSymbol.length,
-        endSymbolLength = endSymbol.length,
-        escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),
-        escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');
-
-    function escape(ch) {
-      return '\\\\\\' + ch;
-    }
-
-    function unescapeText(text) {
-      return text.replace(escapedStartRegexp, startSymbol).
-        replace(escapedEndRegexp, endSymbol);
-    }
-
-    function stringify(value) {
-      if (value == null) { // null || undefined
-        return '';
-      }
-      switch (typeof value) {
-        case 'string':
-          break;
-        case 'number':
-          value = '' + value;
-          break;
-        default:
-          value = toJson(value);
-      }
-
-      return value;
-    }
-
-    /**
-     * @ngdoc service
-     * @name $interpolate
-     * @kind function
-     *
-     * @requires $parse
-     * @requires $sce
-     *
-     * @description
-     *
-     * Compiles a string with markup into an interpolation function. This service is used by the
-     * HTML {@link ng.$compile $compile} service for data binding. See
-     * {@link ng.$interpolateProvider $interpolateProvider} for configuring the
-     * interpolation markup.
-     *
-     *
-     * ```js
-     *   var $interpolate = ...; // injected
-     *   var exp = $interpolate('Hello {{name | uppercase}}!');
-     *   expect(exp({name:'Angular'})).toEqual('Hello ANGULAR!');
-     * ```
-     *
-     * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is
-     * `true`, the interpolation function will return `undefined` unless all embedded expressions
-     * evaluate to a value other than `undefined`.
-     *
-     * ```js
-     *   var $interpolate = ...; // injected
-     *   var context = {greeting: 'Hello', name: undefined };
-     *
-     *   // default "forgiving" mode
-     *   var exp = $interpolate('{{greeting}} {{name}}!');
-     *   expect(exp(context)).toEqual('Hello !');
-     *
-     *   // "allOrNothing" mode
-     *   exp = $interpolate('{{greeting}} {{name}}!', false, null, true);
-     *   expect(exp(context)).toBeUndefined();
-     *   context.name = 'Angular';
-     *   expect(exp(context)).toEqual('Hello Angular!');
-     * ```
-     *
-     * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior.
-     *
-     * ####Escaped Interpolation
-     * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers
-     * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash).
-     * It will be rendered as a regular start/end marker, and will not be interpreted as an expression
-     * or binding.
-     *
-     * This enables web-servers to prevent script injection attacks and defacing attacks, to some
-     * degree, while also enabling code examples to work without relying on the
-     * {@link ng.directive:ngNonBindable ngNonBindable} directive.
-     *
-     * **For security purposes, it is strongly encouraged that web servers escape user-supplied data,
-     * replacing angle brackets (&lt;, &gt;) with &amp;lt; and &amp;gt; respectively, and replacing all
-     * interpolation start/end markers with their escaped counterparts.**
-     *
-     * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered
-     * output when the $interpolate service processes the text. So, for HTML elements interpolated
-     * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter
-     * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such,
-     * this is typically useful only when user-data is used in rendering a template from the server, or
-     * when otherwise untrusted data is used by a directive.
-     *
-     * <example>
-     *  <file name="index.html">
-     *    <div ng-init="username='A user'">
-     *      <p ng-init="apptitle='Escaping demo'">{{apptitle}}: \{\{ username = "defaced value"; \}\}
-     *        </p>
-     *      <p><strong>{{username}}</strong> attempts to inject code which will deface the
-     *        application, but fails to accomplish their task, because the server has correctly
-     *        escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash)
-     *        characters.</p>
-     *      <p>Instead, the result of the attempted script injection is visible, and can be removed
-     *        from the database by an administrator.</p>
-     *    </div>
-     *  </file>
-     * </example>
-     *
-     * @param {string} text The text with markup to interpolate.
-     * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have
-     *    embedded expression in order to return an interpolation function. Strings with no
-     *    embedded expression will return null for the interpolation function.
-     * @param {string=} trustedContext when provided, the returned function passes the interpolated
-     *    result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult,
-     *    trustedContext)} before returning it.  Refer to the {@link ng.$sce $sce} service that
-     *    provides Strict Contextual Escaping for details.
-     * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined
-     *    unless all embedded expressions evaluate to a value other than `undefined`.
-     * @returns {function(context)} an interpolation function which is used to compute the
-     *    interpolated string. The function has these parameters:
-     *
-     * - `context`: evaluation context for all expressions embedded in the interpolated text
-     */
-    function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {
-      allOrNothing = !!allOrNothing;
-      var startIndex,
-          endIndex,
-          index = 0,
-          expressions = [],
-          parseFns = [],
-          textLength = text.length,
-          exp,
-          concat = [],
-          expressionPositions = [];
-
-      while (index < textLength) {
-        if (((startIndex = text.indexOf(startSymbol, index)) != -1) &&
-             ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1)) {
-          if (index !== startIndex) {
-            concat.push(unescapeText(text.substring(index, startIndex)));
-          }
-          exp = text.substring(startIndex + startSymbolLength, endIndex);
-          expressions.push(exp);
-          parseFns.push($parse(exp, parseStringifyInterceptor));
-          index = endIndex + endSymbolLength;
-          expressionPositions.push(concat.length);
-          concat.push('');
-        } else {
-          // we did not find an interpolation, so we have to add the remainder to the separators array
-          if (index !== textLength) {
-            concat.push(unescapeText(text.substring(index)));
-          }
-          break;
-        }
-      }
-
-      // Concatenating expressions makes it hard to reason about whether some combination of
-      // concatenated values are unsafe to use and could easily lead to XSS.  By requiring that a
-      // single expression be used for iframe[src], object[src], etc., we ensure that the value
-      // that's used is assigned or constructed by some JS code somewhere that is more testable or
-      // make it obvious that you bound the value to some user controlled value.  This helps reduce
-      // the load when auditing for XSS issues.
-      if (trustedContext && concat.length > 1) {
-          $interpolateMinErr.throwNoconcat(text);
-      }
-
-      if (!mustHaveExpression || expressions.length) {
-        var compute = function(values) {
-          for (var i = 0, ii = expressions.length; i < ii; i++) {
-            if (allOrNothing && isUndefined(values[i])) return;
-            concat[expressionPositions[i]] = values[i];
-          }
-          return concat.join('');
-        };
-
-        var getValue = function(value) {
-          return trustedContext ?
-            $sce.getTrusted(trustedContext, value) :
-            $sce.valueOf(value);
-        };
-
-        return extend(function interpolationFn(context) {
-            var i = 0;
-            var ii = expressions.length;
-            var values = new Array(ii);
-
-            try {
-              for (; i < ii; i++) {
-                values[i] = parseFns[i](context);
-              }
-
-              return compute(values);
-            } catch (err) {
-              $exceptionHandler($interpolateMinErr.interr(text, err));
-            }
-
-          }, {
-          // all of these properties are undocumented for now
-          exp: text, //just for compatibility with regular watchers created via $watch
-          expressions: expressions,
-          $$watchDelegate: function(scope, listener) {
-            var lastValue;
-            return scope.$watchGroup(parseFns, function interpolateFnWatcher(values, oldValues) {
-              var currValue = compute(values);
-              if (isFunction(listener)) {
-                listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);
-              }
-              lastValue = currValue;
-            });
-          }
-        });
-      }
-
-      function parseStringifyInterceptor(value) {
-        try {
-          value = getValue(value);
-          return allOrNothing && !isDefined(value) ? value : stringify(value);
-        } catch (err) {
-          $exceptionHandler($interpolateMinErr.interr(text, err));
-        }
-      }
-    }
-
-
-    /**
-     * @ngdoc method
-     * @name $interpolate#startSymbol
-     * @description
-     * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.
-     *
-     * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change
-     * the symbol.
-     *
-     * @returns {string} start symbol.
-     */
-    $interpolate.startSymbol = function() {
-      return startSymbol;
-    };
-
-
-    /**
-     * @ngdoc method
-     * @name $interpolate#endSymbol
-     * @description
-     * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
-     *
-     * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change
-     * the symbol.
-     *
-     * @returns {string} end symbol.
-     */
-    $interpolate.endSymbol = function() {
-      return endSymbol;
-    };
-
-    return $interpolate;
-  }];
-}
-
-function $IntervalProvider() {
-  this.$get = ['$rootScope', '$window', '$q', '$$q',
-       function($rootScope,   $window,   $q,   $$q) {
-    var intervals = {};
-
-
-     /**
-      * @ngdoc service
-      * @name $interval
-      *
-      * @description
-      * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay`
-      * milliseconds.
-      *
-      * The return value of registering an interval function is a promise. This promise will be
-      * notified upon each tick of the interval, and will be resolved after `count` iterations, or
-      * run indefinitely if `count` is not defined. The value of the notification will be the
-      * number of iterations that have run.
-      * To cancel an interval, call `$interval.cancel(promise)`.
-      *
-      * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to
-      * move forward by `millis` milliseconds and trigger any functions scheduled to run in that
-      * time.
-      *
-      * <div class="alert alert-warning">
-      * **Note**: Intervals created by this service must be explicitly destroyed when you are finished
-      * with them.  In particular they are not automatically destroyed when a controller's scope or a
-      * directive's element are destroyed.
-      * You should take this into consideration and make sure to always cancel the interval at the
-      * appropriate moment.  See the example below for more details on how and when to do this.
-      * </div>
-      *
-      * @param {function()} fn A function that should be called repeatedly.
-      * @param {number} delay Number of milliseconds between each function call.
-      * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat
-      *   indefinitely.
-      * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise
-      *   will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
-      * @param {...*=} Pass additional parameters to the executed function.
-      * @returns {promise} A promise which will be notified on each iteration.
-      *
-      * @example
-      * <example module="intervalExample">
-      * <file name="index.html">
-      *   <script>
-      *     angular.module('intervalExample', [])
-      *       .controller('ExampleController', ['$scope', '$interval',
-      *         function($scope, $interval) {
-      *           $scope.format = 'M/d/yy h:mm:ss a';
-      *           $scope.blood_1 = 100;
-      *           $scope.blood_2 = 120;
-      *
-      *           var stop;
-      *           $scope.fight = function() {
-      *             // Don't start a new fight if we are already fighting
-      *             if ( angular.isDefined(stop) ) return;
-      *
-      *             stop = $interval(function() {
-      *               if ($scope.blood_1 > 0 && $scope.blood_2 > 0) {
-      *                 $scope.blood_1 = $scope.blood_1 - 3;
-      *                 $scope.blood_2 = $scope.blood_2 - 4;
-      *               } else {
-      *                 $scope.stopFight();
-      *               }
-      *             }, 100);
-      *           };
-      *
-      *           $scope.stopFight = function() {
-      *             if (angular.isDefined(stop)) {
-      *               $interval.cancel(stop);
-      *               stop = undefined;
-      *             }
-      *           };
-      *
-      *           $scope.resetFight = function() {
-      *             $scope.blood_1 = 100;
-      *             $scope.blood_2 = 120;
-      *           };
-      *
-      *           $scope.$on('$destroy', function() {
-      *             // Make sure that the interval is destroyed too
-      *             $scope.stopFight();
-      *           });
-      *         }])
-      *       // Register the 'myCurrentTime' directive factory method.
-      *       // We inject $interval and dateFilter service since the factory method is DI.
-      *       .directive('myCurrentTime', ['$interval', 'dateFilter',
-      *         function($interval, dateFilter) {
-      *           // return the directive link function. (compile function not needed)
-      *           return function(scope, element, attrs) {
-      *             var format,  // date format
-      *                 stopTime; // so that we can cancel the time updates
-      *
-      *             // used to update the UI
-      *             function updateTime() {
-      *               element.text(dateFilter(new Date(), format));
-      *             }
-      *
-      *             // watch the expression, and update the UI on change.
-      *             scope.$watch(attrs.myCurrentTime, function(value) {
-      *               format = value;
-      *               updateTime();
-      *             });
-      *
-      *             stopTime = $interval(updateTime, 1000);
-      *
-      *             // listen on DOM destroy (removal) event, and cancel the next UI update
-      *             // to prevent updating time after the DOM element was removed.
-      *             element.on('$destroy', function() {
-      *               $interval.cancel(stopTime);
-      *             });
-      *           }
-      *         }]);
-      *   </script>
-      *
-      *   <div>
-      *     <div ng-controller="ExampleController">
-      *       <label>Date format: <input ng-model="format"></label> <hr/>
-      *       Current time is: <span my-current-time="format"></span>
-      *       <hr/>
-      *       Blood 1 : <font color='red'>{{blood_1}}</font>
-      *       Blood 2 : <font color='red'>{{blood_2}}</font>
-      *       <button type="button" data-ng-click="fight()">Fight</button>
-      *       <button type="button" data-ng-click="stopFight()">StopFight</button>
-      *       <button type="button" data-ng-click="resetFight()">resetFight</button>
-      *     </div>
-      *   </div>
-      *
-      * </file>
-      * </example>
-      */
-    function interval(fn, delay, count, invokeApply) {
-      var hasParams = arguments.length > 4,
-          args = hasParams ? sliceArgs(arguments, 4) : [],
-          setInterval = $window.setInterval,
-          clearInterval = $window.clearInterval,
-          iteration = 0,
-          skipApply = (isDefined(invokeApply) && !invokeApply),
-          deferred = (skipApply ? $$q : $q).defer(),
-          promise = deferred.promise;
-
-      count = isDefined(count) ? count : 0;
-
-      promise.then(null, null, (!hasParams) ? fn : function() {
-        fn.apply(null, args);
-      });
-
-      promise.$$intervalId = setInterval(function tick() {
-        deferred.notify(iteration++);
-
-        if (count > 0 && iteration >= count) {
-          deferred.resolve(iteration);
-          clearInterval(promise.$$intervalId);
-          delete intervals[promise.$$intervalId];
-        }
-
-        if (!skipApply) $rootScope.$apply();
-
-      }, delay);
-
-      intervals[promise.$$intervalId] = deferred;
-
-      return promise;
-    }
-
-
-     /**
-      * @ngdoc method
-      * @name $interval#cancel
-      *
-      * @description
-      * Cancels a task associated with the `promise`.
-      *
-      * @param {Promise=} promise returned by the `$interval` function.
-      * @returns {boolean} Returns `true` if the task was successfully canceled.
-      */
-    interval.cancel = function(promise) {
-      if (promise && promise.$$intervalId in intervals) {
-        intervals[promise.$$intervalId].reject('canceled');
-        $window.clearInterval(promise.$$intervalId);
-        delete intervals[promise.$$intervalId];
-        return true;
-      }
-      return false;
-    };
-
-    return interval;
-  }];
-}
-
-/**
- * @ngdoc service
- * @name $locale
- *
- * @description
- * $locale service provides localization rules for various Angular components. As of right now the
- * only public api is:
- *
- * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)
- */
-
-var PATH_MATCH = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/,
-    DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
-var $locationMinErr = minErr('$location');
-
-
-/**
- * Encode path using encodeUriSegment, ignoring forward slashes
- *
- * @param {string} path Path to encode
- * @returns {string}
- */
-function encodePath(path) {
-  var segments = path.split('/'),
-      i = segments.length;
-
-  while (i--) {
-    segments[i] = encodeUriSegment(segments[i]);
-  }
-
-  return segments.join('/');
-}
-
-function parseAbsoluteUrl(absoluteUrl, locationObj) {
-  var parsedUrl = urlResolve(absoluteUrl);
-
-  locationObj.$$protocol = parsedUrl.protocol;
-  locationObj.$$host = parsedUrl.hostname;
-  locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;
-}
-
-
-function parseAppUrl(relativeUrl, locationObj) {
-  var prefixed = (relativeUrl.charAt(0) !== '/');
-  if (prefixed) {
-    relativeUrl = '/' + relativeUrl;
-  }
-  var match = urlResolve(relativeUrl);
-  locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?
-      match.pathname.substring(1) : match.pathname);
-  locationObj.$$search = parseKeyValue(match.search);
-  locationObj.$$hash = decodeURIComponent(match.hash);
-
-  // make sure path starts with '/';
-  if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') {
-    locationObj.$$path = '/' + locationObj.$$path;
-  }
-}
-
-
-/**
- *
- * @param {string} begin
- * @param {string} whole
- * @returns {string} returns text from whole after begin or undefined if it does not begin with
- *                   expected string.
- */
-function beginsWith(begin, whole) {
-  if (whole.indexOf(begin) === 0) {
-    return whole.substr(begin.length);
-  }
-}
-
-
-function stripHash(url) {
-  var index = url.indexOf('#');
-  return index == -1 ? url : url.substr(0, index);
-}
-
-function trimEmptyHash(url) {
-  return url.replace(/(#.+)|#$/, '$1');
-}
-
-
-function stripFile(url) {
-  return url.substr(0, stripHash(url).lastIndexOf('/') + 1);
-}
-
-/* return the server only (scheme://host:port) */
-function serverBase(url) {
-  return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));
-}
-
-
-/**
- * LocationHtml5Url represents an url
- * This object is exposed as $location service when HTML5 mode is enabled and supported
- *
- * @constructor
- * @param {string} appBase application base URL
- * @param {string} appBaseNoFile application base URL stripped of any filename
- * @param {string} basePrefix url path prefix
- */
-function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {
-  this.$$html5 = true;
-  basePrefix = basePrefix || '';
-  parseAbsoluteUrl(appBase, this);
-
-
-  /**
-   * Parse given html5 (regular) url string into properties
-   * @param {string} url HTML5 url
-   * @private
-   */
-  this.$$parse = function(url) {
-    var pathUrl = beginsWith(appBaseNoFile, url);
-    if (!isString(pathUrl)) {
-      throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url,
-          appBaseNoFile);
-    }
-
-    parseAppUrl(pathUrl, this);
-
-    if (!this.$$path) {
-      this.$$path = '/';
-    }
-
-    this.$$compose();
-  };
-
-  /**
-   * Compose url and update `absUrl` property
-   * @private
-   */
-  this.$$compose = function() {
-    var search = toKeyValue(this.$$search),
-        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
-
-    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
-    this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/'
-  };
-
-  this.$$parseLinkUrl = function(url, relHref) {
-    if (relHref && relHref[0] === '#') {
-      // special case for links to hash fragments:
-      // keep the old url and only replace the hash fragment
-      this.hash(relHref.slice(1));
-      return true;
-    }
-    var appUrl, prevAppUrl;
-    var rewrittenUrl;
-
-    if (isDefined(appUrl = beginsWith(appBase, url))) {
-      prevAppUrl = appUrl;
-      if (isDefined(appUrl = beginsWith(basePrefix, appUrl))) {
-        rewrittenUrl = appBaseNoFile + (beginsWith('/', appUrl) || appUrl);
-      } else {
-        rewrittenUrl = appBase + prevAppUrl;
-      }
-    } else if (isDefined(appUrl = beginsWith(appBaseNoFile, url))) {
-      rewrittenUrl = appBaseNoFile + appUrl;
-    } else if (appBaseNoFile == url + '/') {
-      rewrittenUrl = appBaseNoFile;
-    }
-    if (rewrittenUrl) {
-      this.$$parse(rewrittenUrl);
-    }
-    return !!rewrittenUrl;
-  };
-}
-
-
-/**
- * LocationHashbangUrl represents url
- * This object is exposed as $location service when developer doesn't opt into html5 mode.
- * It also serves as the base class for html5 mode fallback on legacy browsers.
- *
- * @constructor
- * @param {string} appBase application base URL
- * @param {string} appBaseNoFile application base URL stripped of any filename
- * @param {string} hashPrefix hashbang prefix
- */
-function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {
-
-  parseAbsoluteUrl(appBase, this);
-
-
-  /**
-   * Parse given hashbang url into properties
-   * @param {string} url Hashbang url
-   * @private
-   */
-  this.$$parse = function(url) {
-    var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url);
-    var withoutHashUrl;
-
-    if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') {
-
-      // The rest of the url starts with a hash so we have
-      // got either a hashbang path or a plain hash fragment
-      withoutHashUrl = beginsWith(hashPrefix, withoutBaseUrl);
-      if (isUndefined(withoutHashUrl)) {
-        // There was no hashbang prefix so we just have a hash fragment
-        withoutHashUrl = withoutBaseUrl;
-      }
-
-    } else {
-      // There was no hashbang path nor hash fragment:
-      // If we are in HTML5 mode we use what is left as the path;
-      // Otherwise we ignore what is left
-      if (this.$$html5) {
-        withoutHashUrl = withoutBaseUrl;
-      } else {
-        withoutHashUrl = '';
-        if (isUndefined(withoutBaseUrl)) {
-          appBase = url;
-          this.replace();
-        }
-      }
-    }
-
-    parseAppUrl(withoutHashUrl, this);
-
-    this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);
-
-    this.$$compose();
-
-    /*
-     * In Windows, on an anchor node on documents loaded from
-     * the filesystem, the browser will return a pathname
-     * prefixed with the drive name ('/C:/path') when a
-     * pathname without a drive is set:
-     *  * a.setAttribute('href', '/foo')
-     *   * a.pathname === '/C:/foo' //true
-     *
-     * Inside of Angular, we're always using pathnames that
-     * do not include drive names for routing.
-     */
-    function removeWindowsDriveName(path, url, base) {
-      /*
-      Matches paths for file protocol on windows,
-      such as /C:/foo/bar, and captures only /foo/bar.
-      */
-      var windowsFilePathExp = /^\/[A-Z]:(\/.*)/;
-
-      var firstPathSegmentMatch;
-
-      //Get the relative path from the input URL.
-      if (url.indexOf(base) === 0) {
-        url = url.replace(base, '');
-      }
-
-      // The input URL intentionally contains a first path segment that ends with a colon.
-      if (windowsFilePathExp.exec(url)) {
-        return path;
-      }
-
-      firstPathSegmentMatch = windowsFilePathExp.exec(path);
-      return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;
-    }
-  };
-
-  /**
-   * Compose hashbang url and update `absUrl` property
-   * @private
-   */
-  this.$$compose = function() {
-    var search = toKeyValue(this.$$search),
-        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
-
-    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
-    this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');
-  };
-
-  this.$$parseLinkUrl = function(url, relHref) {
-    if (stripHash(appBase) == stripHash(url)) {
-      this.$$parse(url);
-      return true;
-    }
-    return false;
-  };
-}
-
-
-/**
- * LocationHashbangUrl represents url
- * This object is exposed as $location service when html5 history api is enabled but the browser
- * does not support it.
- *
- * @constructor
- * @param {string} appBase application base URL
- * @param {string} appBaseNoFile application base URL stripped of any filename
- * @param {string} hashPrefix hashbang prefix
- */
-function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {
-  this.$$html5 = true;
-  LocationHashbangUrl.apply(this, arguments);
-
-  this.$$parseLinkUrl = function(url, relHref) {
-    if (relHref && relHref[0] === '#') {
-      // special case for links to hash fragments:
-      // keep the old url and only replace the hash fragment
-      this.hash(relHref.slice(1));
-      return true;
-    }
-
-    var rewrittenUrl;
-    var appUrl;
-
-    if (appBase == stripHash(url)) {
-      rewrittenUrl = url;
-    } else if ((appUrl = beginsWith(appBaseNoFile, url))) {
-      rewrittenUrl = appBase + hashPrefix + appUrl;
-    } else if (appBaseNoFile === url + '/') {
-      rewrittenUrl = appBaseNoFile;
-    }
-    if (rewrittenUrl) {
-      this.$$parse(rewrittenUrl);
-    }
-    return !!rewrittenUrl;
-  };
-
-  this.$$compose = function() {
-    var search = toKeyValue(this.$$search),
-        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
-
-    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
-    // include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#'
-    this.$$absUrl = appBase + hashPrefix + this.$$url;
-  };
-
-}
-
-
-var locationPrototype = {
-
-  /**
-   * Are we in html5 mode?
-   * @private
-   */
-  $$html5: false,
-
-  /**
-   * Has any change been replacing?
-   * @private
-   */
-  $$replace: false,
-
-  /**
-   * @ngdoc method
-   * @name $location#absUrl
-   *
-   * @description
-   * This method is getter only.
-   *
-   * Return full url representation with all segments encoded according to rules specified in
-   * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).
-   *
-   *
-   * ```js
-   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
-   * var absUrl = $location.absUrl();
-   * // => "http://example.com/#/some/path?foo=bar&baz=xoxo"
-   * ```
-   *
-   * @return {string} full url
-   */
-  absUrl: locationGetter('$$absUrl'),
-
-  /**
-   * @ngdoc method
-   * @name $location#url
-   *
-   * @description
-   * This method is getter / setter.
-   *
-   * Return url (e.g. `/path?a=b#hash`) when called without any parameter.
-   *
-   * Change path, search and hash, when called with parameter and return `$location`.
-   *
-   *
-   * ```js
-   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
-   * var url = $location.url();
-   * // => "/some/path?foo=bar&baz=xoxo"
-   * ```
-   *
-   * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)
-   * @return {string} url
-   */
-  url: function(url) {
-    if (isUndefined(url)) {
-      return this.$$url;
-    }
-
-    var match = PATH_MATCH.exec(url);
-    if (match[1] || url === '') this.path(decodeURIComponent(match[1]));
-    if (match[2] || match[1] || url === '') this.search(match[3] || '');
-    this.hash(match[5] || '');
-
-    return this;
-  },
-
-  /**
-   * @ngdoc method
-   * @name $location#protocol
-   *
-   * @description
-   * This method is getter only.
-   *
-   * Return protocol of current url.
-   *
-   *
-   * ```js
-   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
-   * var protocol = $location.protocol();
-   * // => "http"
-   * ```
-   *
-   * @return {string} protocol of current url
-   */
-  protocol: locationGetter('$$protocol'),
-
-  /**
-   * @ngdoc method
-   * @name $location#host
-   *
-   * @description
-   * This method is getter only.
-   *
-   * Return host of current url.
-   *
-   * Note: compared to the non-angular version `location.host` which returns `hostname:port`, this returns the `hostname` portion only.
-   *
-   *
-   * ```js
-   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
-   * var host = $location.host();
-   * // => "example.com"
-   *
-   * // given url http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo
-   * host = $location.host();
-   * // => "example.com"
-   * host = location.host;
-   * // => "example.com:8080"
-   * ```
-   *
-   * @return {string} host of current url.
-   */
-  host: locationGetter('$$host'),
-
-  /**
-   * @ngdoc method
-   * @name $location#port
-   *
-   * @description
-   * This method is getter only.
-   *
-   * Return port of current url.
-   *
-   *
-   * ```js
-   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
-   * var port = $location.port();
-   * // => 80
-   * ```
-   *
-   * @return {Number} port
-   */
-  port: locationGetter('$$port'),
-
-  /**
-   * @ngdoc method
-   * @name $location#path
-   *
-   * @description
-   * This method is getter / setter.
-   *
-   * Return path of current url when called without any parameter.
-   *
-   * Change path when called with parameter and return `$location`.
-   *
-   * Note: Path should always begin with forward slash (/), this method will add the forward slash
-   * if it is missing.
-   *
-   *
-   * ```js
-   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
-   * var path = $location.path();
-   * // => "/some/path"
-   * ```
-   *
-   * @param {(string|number)=} path New path
-   * @return {string} path
-   */
-  path: locationGetterSetter('$$path', function(path) {
-    path = path !== null ? path.toString() : '';
-    return path.charAt(0) == '/' ? path : '/' + path;
-  }),
-
-  /**
-   * @ngdoc method
-   * @name $location#search
-   *
-   * @description
-   * This method is getter / setter.
-   *
-   * Return search part (as object) of current url when called without any parameter.
-   *
-   * Change search part when called with parameter and return `$location`.
-   *
-   *
-   * ```js
-   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
-   * var searchObject = $location.search();
-   * // => {foo: 'bar', baz: 'xoxo'}
-   *
-   * // set foo to 'yipee'
-   * $location.search('foo', 'yipee');
-   * // $location.search() => {foo: 'yipee', baz: 'xoxo'}
-   * ```
-   *
-   * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or
-   * hash object.
-   *
-   * When called with a single argument the method acts as a setter, setting the `search` component
-   * of `$location` to the specified value.
-   *
-   * If the argument is a hash object containing an array of values, these values will be encoded
-   * as duplicate search parameters in the url.
-   *
-   * @param {(string|Number|Array<string>|boolean)=} paramValue If `search` is a string or number, then `paramValue`
-   * will override only a single search property.
-   *
-   * If `paramValue` is an array, it will override the property of the `search` component of
-   * `$location` specified via the first argument.
-   *
-   * If `paramValue` is `null`, the property specified via the first argument will be deleted.
-   *
-   * If `paramValue` is `true`, the property specified via the first argument will be added with no
-   * value nor trailing equal sign.
-   *
-   * @return {Object} If called with no arguments returns the parsed `search` object. If called with
-   * one or more arguments returns `$location` object itself.
-   */
-  search: function(search, paramValue) {
-    switch (arguments.length) {
-      case 0:
-        return this.$$search;
-      case 1:
-        if (isString(search) || isNumber(search)) {
-          search = search.toString();
-          this.$$search = parseKeyValue(search);
-        } else if (isObject(search)) {
-          search = copy(search, {});
-          // remove object undefined or null properties
-          forEach(search, function(value, key) {
-            if (value == null) delete search[key];
-          });
-
-          this.$$search = search;
-        } else {
-          throw $locationMinErr('isrcharg',
-              'The first argument of the `$location#search()` call must be a string or an object.');
-        }
-        break;
-      default:
-        if (isUndefined(paramValue) || paramValue === null) {
-          delete this.$$search[search];
-        } else {
-          this.$$search[search] = paramValue;
-        }
-    }
-
-    this.$$compose();
-    return this;
-  },
-
-  /**
-   * @ngdoc method
-   * @name $location#hash
-   *
-   * @description
-   * This method is getter / setter.
-   *
-   * Return hash fragment when called without any parameter.
-   *
-   * Change hash fragment when called with parameter and return `$location`.
-   *
-   *
-   * ```js
-   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue
-   * var hash = $location.hash();
-   * // => "hashValue"
-   * ```
-   *
-   * @param {(string|number)=} hash New hash fragment
-   * @return {string} hash
-   */
-  hash: locationGetterSetter('$$hash', function(hash) {
-    return hash !== null ? hash.toString() : '';
-  }),
-
-  /**
-   * @ngdoc method
-   * @name $location#replace
-   *
-   * @description
-   * If called, all changes to $location during current `$digest` will be replacing current history
-   * record, instead of adding new one.
-   */
-  replace: function() {
-    this.$$replace = true;
-    return this;
-  }
-};
-
-forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) {
-  Location.prototype = Object.create(locationPrototype);
-
-  /**
-   * @ngdoc method
-   * @name $location#state
-   *
-   * @description
-   * This method is getter / setter.
-   *
-   * Return the history state object when called without any parameter.
-   *
-   * Change the history state object when called with one parameter and return `$location`.
-   * The state object is later passed to `pushState` or `replaceState`.
-   *
-   * NOTE: This method is supported only in HTML5 mode and only in browsers supporting
-   * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support
-   * older browsers (like IE9 or Android < 4.0), don't use this method.
-   *
-   * @param {object=} state State object for pushState or replaceState
-   * @return {object} state
-   */
-  Location.prototype.state = function(state) {
-    if (!arguments.length) {
-      return this.$$state;
-    }
-
-    if (Location !== LocationHtml5Url || !this.$$html5) {
-      throw $locationMinErr('nostate', 'History API state support is available only ' +
-        'in HTML5 mode and only in browsers supporting HTML5 History API');
-    }
-    // The user might modify `stateObject` after invoking `$location.state(stateObject)`
-    // but we're changing the $$state reference to $browser.state() during the $digest
-    // so the modification window is narrow.
-    this.$$state = isUndefined(state) ? null : state;
-
-    return this;
-  };
-});
-
-
-function locationGetter(property) {
-  return function() {
-    return this[property];
-  };
-}
-
-
-function locationGetterSetter(property, preprocess) {
-  return function(value) {
-    if (isUndefined(value)) {
-      return this[property];
-    }
-
-    this[property] = preprocess(value);
-    this.$$compose();
-
-    return this;
-  };
-}
-
-
-/**
- * @ngdoc service
- * @name $location
- *
- * @requires $rootElement
- *
- * @description
- * The $location service parses the URL in the browser address bar (based on the
- * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL
- * available to your application. Changes to the URL in the address bar are reflected into
- * $location service and changes to $location are reflected into the browser address bar.
- *
- * **The $location service:**
- *
- * - Exposes the current URL in the browser address bar, so you can
- *   - Watch and observe the URL.
- *   - Change the URL.
- * - Synchronizes the URL with the browser when the user
- *   - Changes the address bar.
- *   - Clicks the back or forward button (or clicks a History link).
- *   - Clicks on a link.
- * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).
- *
- * For more information see {@link guide/$location Developer Guide: Using $location}
- */
-
-/**
- * @ngdoc provider
- * @name $locationProvider
- * @description
- * Use the `$locationProvider` to configure how the application deep linking paths are stored.
- */
-function $LocationProvider() {
-  var hashPrefix = '',
-      html5Mode = {
-        enabled: false,
-        requireBase: true,
-        rewriteLinks: true
-      };
-
-  /**
-   * @ngdoc method
-   * @name $locationProvider#hashPrefix
-   * @description
-   * @param {string=} prefix Prefix for hash part (containing path and search)
-   * @returns {*} current value if used as getter or itself (chaining) if used as setter
-   */
-  this.hashPrefix = function(prefix) {
-    if (isDefined(prefix)) {
-      hashPrefix = prefix;
-      return this;
-    } else {
-      return hashPrefix;
-    }
-  };
-
-  /**
-   * @ngdoc method
-   * @name $locationProvider#html5Mode
-   * @description
-   * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value.
-   *   If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported
-   *   properties:
-   *   - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to
-   *     change urls where supported. Will fall back to hash-prefixed paths in browsers that do not
-   *     support `pushState`.
-   *   - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies
-   *     whether or not a <base> tag is required to be present. If `enabled` and `requireBase` are
-   *     true, and a base tag is not present, an error will be thrown when `$location` is injected.
-   *     See the {@link guide/$location $location guide for more information}
-   *   - **rewriteLinks** - `{boolean}` - (default: `true`) When html5Mode is enabled,
-   *     enables/disables url rewriting for relative links.
-   *
-   * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter
-   */
-  this.html5Mode = function(mode) {
-    if (isBoolean(mode)) {
-      html5Mode.enabled = mode;
-      return this;
-    } else if (isObject(mode)) {
-
-      if (isBoolean(mode.enabled)) {
-        html5Mode.enabled = mode.enabled;
-      }
-
-      if (isBoolean(mode.requireBase)) {
-        html5Mode.requireBase = mode.requireBase;
-      }
-
-      if (isBoolean(mode.rewriteLinks)) {
-        html5Mode.rewriteLinks = mode.rewriteLinks;
-      }
-
-      return this;
-    } else {
-      return html5Mode;
-    }
-  };
-
-  /**
-   * @ngdoc event
-   * @name $location#$locationChangeStart
-   * @eventType broadcast on root scope
-   * @description
-   * Broadcasted before a URL will change.
-   *
-   * This change can be prevented by calling
-   * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more
-   * details about event object. Upon successful change
-   * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.
-   *
-   * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when
-   * the browser supports the HTML5 History API.
-   *
-   * @param {Object} angularEvent Synthetic event object.
-   * @param {string} newUrl New URL
-   * @param {string=} oldUrl URL that was before it was changed.
-   * @param {string=} newState New history state object
-   * @param {string=} oldState History state object that was before it was changed.
-   */
-
-  /**
-   * @ngdoc event
-   * @name $location#$locationChangeSuccess
-   * @eventType broadcast on root scope
-   * @description
-   * Broadcasted after a URL was changed.
-   *
-   * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when
-   * the browser supports the HTML5 History API.
-   *
-   * @param {Object} angularEvent Synthetic event object.
-   * @param {string} newUrl New URL
-   * @param {string=} oldUrl URL that was before it was changed.
-   * @param {string=} newState New history state object
-   * @param {string=} oldState History state object that was before it was changed.
-   */
-
-  this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window',
-      function($rootScope, $browser, $sniffer, $rootElement, $window) {
-    var $location,
-        LocationMode,
-        baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''
-        initialUrl = $browser.url(),
-        appBase;
-
-    if (html5Mode.enabled) {
-      if (!baseHref && html5Mode.requireBase) {
-        throw $locationMinErr('nobase',
-          "$location in HTML5 mode requires a <base> tag to be present!");
-      }
-      appBase = serverBase(initialUrl) + (baseHref || '/');
-      LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;
-    } else {
-      appBase = stripHash(initialUrl);
-      LocationMode = LocationHashbangUrl;
-    }
-    var appBaseNoFile = stripFile(appBase);
-
-    $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix);
-    $location.$$parseLinkUrl(initialUrl, initialUrl);
-
-    $location.$$state = $browser.state();
-
-    var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i;
-
-    function setBrowserUrlWithFallback(url, replace, state) {
-      var oldUrl = $location.url();
-      var oldState = $location.$$state;
-      try {
-        $browser.url(url, replace, state);
-
-        // Make sure $location.state() returns referentially identical (not just deeply equal)
-        // state object; this makes possible quick checking if the state changed in the digest
-        // loop. Checking deep equality would be too expensive.
-        $location.$$state = $browser.state();
-      } catch (e) {
-        // Restore old values if pushState fails
-        $location.url(oldUrl);
-        $location.$$state = oldState;
-
-        throw e;
-      }
-    }
-
-    $rootElement.on('click', function(event) {
-      // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)
-      // currently we open nice url link and redirect then
-
-      if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return;
-
-      var elm = jqLite(event.target);
-
-      // traverse the DOM up to find first A tag
-      while (nodeName_(elm[0]) !== 'a') {
-        // ignore rewriting if no A tag (reached root element, or no parent - removed from document)
-        if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;
-      }
-
-      var absHref = elm.prop('href');
-      // get the actual href attribute - see
-      // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx
-      var relHref = elm.attr('href') || elm.attr('xlink:href');
-
-      if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {
-        // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during
-        // an animation.
-        absHref = urlResolve(absHref.animVal).href;
-      }
-
-      // Ignore when url is started with javascript: or mailto:
-      if (IGNORE_URI_REGEXP.test(absHref)) return;
-
-      if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) {
-        if ($location.$$parseLinkUrl(absHref, relHref)) {
-          // We do a preventDefault for all urls that are part of the angular application,
-          // in html5mode and also without, so that we are able to abort navigation without
-          // getting double entries in the location history.
-          event.preventDefault();
-          // update location manually
-          if ($location.absUrl() != $browser.url()) {
-            $rootScope.$apply();
-            // hack to work around FF6 bug 684208 when scenario runner clicks on links
-            $window.angular['ff-684208-preventDefault'] = true;
-          }
-        }
-      }
-    });
-
-
-    // rewrite hashbang url <> html5 url
-    if (trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)) {
-      $browser.url($location.absUrl(), true);
-    }
-
-    var initializing = true;
-
-    // update $location when $browser url changes
-    $browser.onUrlChange(function(newUrl, newState) {
-
-      if (isUndefined(beginsWith(appBaseNoFile, newUrl))) {
-        // If we are navigating outside of the app then force a reload
-        $window.location.href = newUrl;
-        return;
-      }
-
-      $rootScope.$evalAsync(function() {
-        var oldUrl = $location.absUrl();
-        var oldState = $location.$$state;
-        var defaultPrevented;
-
-        $location.$$parse(newUrl);
-        $location.$$state = newState;
-
-        defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
-            newState, oldState).defaultPrevented;
-
-        // if the location was changed by a `$locationChangeStart` handler then stop
-        // processing this location change
-        if ($location.absUrl() !== newUrl) return;
-
-        if (defaultPrevented) {
-          $location.$$parse(oldUrl);
-          $location.$$state = oldState;
-          setBrowserUrlWithFallback(oldUrl, false, oldState);
-        } else {
-          initializing = false;
-          afterLocationChange(oldUrl, oldState);
-        }
-      });
-      if (!$rootScope.$$phase) $rootScope.$digest();
-    });
-
-    // update browser
-    $rootScope.$watch(function $locationWatch() {
-      var oldUrl = trimEmptyHash($browser.url());
-      var newUrl = trimEmptyHash($location.absUrl());
-      var oldState = $browser.state();
-      var currentReplace = $location.$$replace;
-      var urlOrStateChanged = oldUrl !== newUrl ||
-        ($location.$$html5 && $sniffer.history && oldState !== $location.$$state);
-
-      if (initializing || urlOrStateChanged) {
-        initializing = false;
-
-        $rootScope.$evalAsync(function() {
-          var newUrl = $location.absUrl();
-          var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
-              $location.$$state, oldState).defaultPrevented;
-
-          // if the location was changed by a `$locationChangeStart` handler then stop
-          // processing this location change
-          if ($location.absUrl() !== newUrl) return;
-
-          if (defaultPrevented) {
-            $location.$$parse(oldUrl);
-            $location.$$state = oldState;
-          } else {
-            if (urlOrStateChanged) {
-              setBrowserUrlWithFallback(newUrl, currentReplace,
-                                        oldState === $location.$$state ? null : $location.$$state);
-            }
-            afterLocationChange(oldUrl, oldState);
-          }
-        });
-      }
-
-      $location.$$replace = false;
-
-      // we don't need to return anything because $evalAsync will make the digest loop dirty when
-      // there is a change
-    });
-
-    return $location;
-
-    function afterLocationChange(oldUrl, oldState) {
-      $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl,
-        $location.$$state, oldState);
-    }
-}];
-}
-
-/**
- * @ngdoc service
- * @name $log
- * @requires $window
- *
- * @description
- * Simple service for logging. Default implementation safely writes the message
- * into the browser's console (if present).
- *
- * The main purpose of this service is to simplify debugging and troubleshooting.
- *
- * The default is to log `debug` messages. You can use
- * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.
- *
- * @example
-   <example module="logExample">
-     <file name="script.js">
-       angular.module('logExample', [])
-         .controller('LogController', ['$scope', '$log', function($scope, $log) {
-           $scope.$log = $log;
-           $scope.message = 'Hello World!';
-         }]);
-     </file>
-     <file name="index.html">
-       <div ng-controller="LogController">
-         <p>Reload this page with open console, enter text and hit the log button...</p>
-         <label>Message:
-         <input type="text" ng-model="message" /></label>
-         <button ng-click="$log.log(message)">log</button>
-         <button ng-click="$log.warn(message)">warn</button>
-         <button ng-click="$log.info(message)">info</button>
-         <button ng-click="$log.error(message)">error</button>
-         <button ng-click="$log.debug(message)">debug</button>
-       </div>
-     </file>
-   </example>
- */
-
-/**
- * @ngdoc provider
- * @name $logProvider
- * @description
- * Use the `$logProvider` to configure how the application logs messages
- */
-function $LogProvider() {
-  var debug = true,
-      self = this;
-
-  /**
-   * @ngdoc method
-   * @name $logProvider#debugEnabled
-   * @description
-   * @param {boolean=} flag enable or disable debug level messages
-   * @returns {*} current value if used as getter or itself (chaining) if used as setter
-   */
-  this.debugEnabled = function(flag) {
-    if (isDefined(flag)) {
-      debug = flag;
-    return this;
-    } else {
-      return debug;
-    }
-  };
-
-  this.$get = ['$window', function($window) {
-    return {
-      /**
-       * @ngdoc method
-       * @name $log#log
-       *
-       * @description
-       * Write a log message
-       */
-      log: consoleLog('log'),
-
-      /**
-       * @ngdoc method
-       * @name $log#info
-       *
-       * @description
-       * Write an information message
-       */
-      info: consoleLog('info'),
-
-      /**
-       * @ngdoc method
-       * @name $log#warn
-       *
-       * @description
-       * Write a warning message
-       */
-      warn: consoleLog('warn'),
-
-      /**
-       * @ngdoc method
-       * @name $log#error
-       *
-       * @description
-       * Write an error message
-       */
-      error: consoleLog('error'),
-
-      /**
-       * @ngdoc method
-       * @name $log#debug
-       *
-       * @description
-       * Write a debug message
-       */
-      debug: (function() {
-        var fn = consoleLog('debug');
-
-        return function() {
-          if (debug) {
-            fn.apply(self, arguments);
-          }
-        };
-      }())
-    };
-
-    function formatError(arg) {
-      if (arg instanceof Error) {
-        if (arg.stack) {
-          arg = (arg.message && arg.stack.indexOf(arg.message) === -1)
-              ? 'Error: ' + arg.message + '\n' + arg.stack
-              : arg.stack;
-        } else if (arg.sourceURL) {
-          arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line;
-        }
-      }
-      return arg;
-    }
-
-    function consoleLog(type) {
-      var console = $window.console || {},
-          logFn = console[type] || console.log || noop,
-          hasApply = false;
-
-      // Note: reading logFn.apply throws an error in IE11 in IE8 document mode.
-      // The reason behind this is that console.log has type "object" in IE8...
-      try {
-        hasApply = !!logFn.apply;
-      } catch (e) {}
-
-      if (hasApply) {
-        return function() {
-          var args = [];
-          forEach(arguments, function(arg) {
-            args.push(formatError(arg));
-          });
-          return logFn.apply(console, args);
-        };
-      }
-
-      // we are IE which either doesn't have window.console => this is noop and we do nothing,
-      // or we are IE where console.log doesn't have apply so we log at least first 2 args
-      return function(arg1, arg2) {
-        logFn(arg1, arg2 == null ? '' : arg2);
-      };
-    }
-  }];
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *     Any commits to this file should be reviewed with security in mind.  *
- *   Changes to this file can potentially create security vulnerabilities. *
- *          An approval from 2 Core members with history of modifying      *
- *                         this file is required.                          *
- *                                                                         *
- *  Does the change somehow allow for arbitrary javascript to be executed? *
- *    Or allows for someone to change the prototype of built-in objects?   *
- *     Or gives undesired access to variables likes document or window?    *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-var $parseMinErr = minErr('$parse');
-
-// Sandboxing Angular Expressions
-// ------------------------------
-// Angular expressions are generally considered safe because these expressions only have direct
-// access to `$scope` and locals. However, one can obtain the ability to execute arbitrary JS code by
-// obtaining a reference to native JS functions such as the Function constructor.
-//
-// As an example, consider the following Angular expression:
-//
-//   {}.toString.constructor('alert("evil JS code")')
-//
-// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits
-// against the expression language, but not to prevent exploits that were enabled by exposing
-// sensitive JavaScript or browser APIs on Scope. Exposing such objects on a Scope is never a good
-// practice and therefore we are not even trying to protect against interaction with an object
-// explicitly exposed in this way.
-//
-// In general, it is not possible to access a Window object from an angular expression unless a
-// window or some DOM object that has a reference to window is published onto a Scope.
-// Similarly we prevent invocations of function known to be dangerous, as well as assignments to
-// native objects.
-//
-// See https://docs.angularjs.org/guide/security
-
-
-function ensureSafeMemberName(name, fullExpression) {
-  if (name === "__defineGetter__" || name === "__defineSetter__"
-      || name === "__lookupGetter__" || name === "__lookupSetter__"
-      || name === "__proto__") {
-    throw $parseMinErr('isecfld',
-        'Attempting to access a disallowed field in Angular expressions! '
-        + 'Expression: {0}', fullExpression);
-  }
-  return name;
-}
-
-function getStringValue(name, fullExpression) {
-  // From the JavaScript docs:
-  // Property names must be strings. This means that non-string objects cannot be used
-  // as keys in an object. Any non-string object, including a number, is typecasted
-  // into a string via the toString method.
-  //
-  // So, to ensure that we are checking the same `name` that JavaScript would use,
-  // we cast it to a string, if possible.
-  // Doing `name + ''` can cause a repl error if the result to `toString` is not a string,
-  // this is, this will handle objects that misbehave.
-  name = name + '';
-  if (!isString(name)) {
-    throw $parseMinErr('iseccst',
-        'Cannot convert object to primitive value! '
-        + 'Expression: {0}', fullExpression);
-  }
-  return name;
-}
-
-function ensureSafeObject(obj, fullExpression) {
-  // nifty check if obj is Function that is fast and works across iframes and other contexts
-  if (obj) {
-    if (obj.constructor === obj) {
-      throw $parseMinErr('isecfn',
-          'Referencing Function in Angular expressions is disallowed! Expression: {0}',
-          fullExpression);
-    } else if (// isWindow(obj)
-        obj.window === obj) {
-      throw $parseMinErr('isecwindow',
-          'Referencing the Window in Angular expressions is disallowed! Expression: {0}',
-          fullExpression);
-    } else if (// isElement(obj)
-        obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) {
-      throw $parseMinErr('isecdom',
-          'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',
-          fullExpression);
-    } else if (// block Object so that we can't get hold of dangerous Object.* methods
-        obj === Object) {
-      throw $parseMinErr('isecobj',
-          'Referencing Object in Angular expressions is disallowed! Expression: {0}',
-          fullExpression);
-    }
-  }
-  return obj;
-}
-
-var CALL = Function.prototype.call;
-var APPLY = Function.prototype.apply;
-var BIND = Function.prototype.bind;
-
-function ensureSafeFunction(obj, fullExpression) {
-  if (obj) {
-    if (obj.constructor === obj) {
-      throw $parseMinErr('isecfn',
-        'Referencing Function in Angular expressions is disallowed! Expression: {0}',
-        fullExpression);
-    } else if (obj === CALL || obj === APPLY || obj === BIND) {
-      throw $parseMinErr('isecff',
-        'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}',
-        fullExpression);
-    }
-  }
-}
-
-function ensureSafeAssignContext(obj, fullExpression) {
-  if (obj) {
-    if (obj === (0).constructor || obj === (false).constructor || obj === ''.constructor ||
-        obj === {}.constructor || obj === [].constructor || obj === Function.constructor) {
-      throw $parseMinErr('isecaf',
-        'Assigning to a constructor is disallowed! Expression: {0}', fullExpression);
-    }
-  }
-}
-
-var OPERATORS = createMap();
-forEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function(operator) { OPERATORS[operator] = true; });
-var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'};
-
-
-/////////////////////////////////////////
-
-
-/**
- * @constructor
- */
-var Lexer = function(options) {
-  this.options = options;
-};
-
-Lexer.prototype = {
-  constructor: Lexer,
-
-  lex: function(text) {
-    this.text = text;
-    this.index = 0;
-    this.tokens = [];
-
-    while (this.index < this.text.length) {
-      var ch = this.text.charAt(this.index);
-      if (ch === '"' || ch === "'") {
-        this.readString(ch);
-      } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {
-        this.readNumber();
-      } else if (this.isIdent(ch)) {
-        this.readIdent();
-      } else if (this.is(ch, '(){}[].,;:?')) {
-        this.tokens.push({index: this.index, text: ch});
-        this.index++;
-      } else if (this.isWhitespace(ch)) {
-        this.index++;
-      } else {
-        var ch2 = ch + this.peek();
-        var ch3 = ch2 + this.peek(2);
-        var op1 = OPERATORS[ch];
-        var op2 = OPERATORS[ch2];
-        var op3 = OPERATORS[ch3];
-        if (op1 || op2 || op3) {
-          var token = op3 ? ch3 : (op2 ? ch2 : ch);
-          this.tokens.push({index: this.index, text: token, operator: true});
-          this.index += token.length;
-        } else {
-          this.throwError('Unexpected next character ', this.index, this.index + 1);
-        }
-      }
-    }
-    return this.tokens;
-  },
-
-  is: function(ch, chars) {
-    return chars.indexOf(ch) !== -1;
-  },
-
-  peek: function(i) {
-    var num = i || 1;
-    return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false;
-  },
-
-  isNumber: function(ch) {
-    return ('0' <= ch && ch <= '9') && typeof ch === "string";
-  },
-
-  isWhitespace: function(ch) {
-    // IE treats non-breaking space as \u00A0
-    return (ch === ' ' || ch === '\r' || ch === '\t' ||
-            ch === '\n' || ch === '\v' || ch === '\u00A0');
-  },
-
-  isIdent: function(ch) {
-    return ('a' <= ch && ch <= 'z' ||
-            'A' <= ch && ch <= 'Z' ||
-            '_' === ch || ch === '$');
-  },
-
-  isExpOperator: function(ch) {
-    return (ch === '-' || ch === '+' || this.isNumber(ch));
-  },
-
-  throwError: function(error, start, end) {
-    end = end || this.index;
-    var colStr = (isDefined(start)
-            ? 's ' + start +  '-' + this.index + ' [' + this.text.substring(start, end) + ']'
-            : ' ' + end);
-    throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].',
-        error, colStr, this.text);
-  },
-
-  readNumber: function() {
-    var number = '';
-    var start = this.index;
-    while (this.index < this.text.length) {
-      var ch = lowercase(this.text.charAt(this.index));
-      if (ch == '.' || this.isNumber(ch)) {
-        number += ch;
-      } else {
-        var peekCh = this.peek();
-        if (ch == 'e' && this.isExpOperator(peekCh)) {
-          number += ch;
-        } else if (this.isExpOperator(ch) &&
-            peekCh && this.isNumber(peekCh) &&
-            number.charAt(number.length - 1) == 'e') {
-          number += ch;
-        } else if (this.isExpOperator(ch) &&
-            (!peekCh || !this.isNumber(peekCh)) &&
-            number.charAt(number.length - 1) == 'e') {
-          this.throwError('Invalid exponent');
-        } else {
-          break;
-        }
-      }
-      this.index++;
-    }
-    this.tokens.push({
-      index: start,
-      text: number,
-      constant: true,
-      value: Number(number)
-    });
-  },
-
-  readIdent: function() {
-    var start = this.index;
-    while (this.index < this.text.length) {
-      var ch = this.text.charAt(this.index);
-      if (!(this.isIdent(ch) || this.isNumber(ch))) {
-        break;
-      }
-      this.index++;
-    }
-    this.tokens.push({
-      index: start,
-      text: this.text.slice(start, this.index),
-      identifier: true
-    });
-  },
-
-  readString: function(quote) {
-    var start = this.index;
-    this.index++;
-    var string = '';
-    var rawString = quote;
-    var escape = false;
-    while (this.index < this.text.length) {
-      var ch = this.text.charAt(this.index);
-      rawString += ch;
-      if (escape) {
-        if (ch === 'u') {
-          var hex = this.text.substring(this.index + 1, this.index + 5);
-          if (!hex.match(/[\da-f]{4}/i)) {
-            this.throwError('Invalid unicode escape [\\u' + hex + ']');
-          }
-          this.index += 4;
-          string += String.fromCharCode(parseInt(hex, 16));
-        } else {
-          var rep = ESCAPE[ch];
-          string = string + (rep || ch);
-        }
-        escape = false;
-      } else if (ch === '\\') {
-        escape = true;
-      } else if (ch === quote) {
-        this.index++;
-        this.tokens.push({
-          index: start,
-          text: rawString,
-          constant: true,
-          value: string
-        });
-        return;
-      } else {
-        string += ch;
-      }
-      this.index++;
-    }
-    this.throwError('Unterminated quote', start);
-  }
-};
-
-var AST = function(lexer, options) {
-  this.lexer = lexer;
-  this.options = options;
-};
-
-AST.Program = 'Program';
-AST.ExpressionStatement = 'ExpressionStatement';
-AST.AssignmentExpression = 'AssignmentExpression';
-AST.ConditionalExpression = 'ConditionalExpression';
-AST.LogicalExpression = 'LogicalExpression';
-AST.BinaryExpression = 'BinaryExpression';
-AST.UnaryExpression = 'UnaryExpression';
-AST.CallExpression = 'CallExpression';
-AST.MemberExpression = 'MemberExpression';
-AST.Identifier = 'Identifier';
-AST.Literal = 'Literal';
-AST.ArrayExpression = 'ArrayExpression';
-AST.Property = 'Property';
-AST.ObjectExpression = 'ObjectExpression';
-AST.ThisExpression = 'ThisExpression';
-
-// Internal use only
-AST.NGValueParameter = 'NGValueParameter';
-
-AST.prototype = {
-  ast: function(text) {
-    this.text = text;
-    this.tokens = this.lexer.lex(text);
-
-    var value = this.program();
-
-    if (this.tokens.length !== 0) {
-      this.throwError('is an unexpected token', this.tokens[0]);
-    }
-
-    return value;
-  },
-
-  program: function() {
-    var body = [];
-    while (true) {
-      if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']'))
-        body.push(this.expressionStatement());
-      if (!this.expect(';')) {
-        return { type: AST.Program, body: body};
-      }
-    }
-  },
-
-  expressionStatement: function() {
-    return { type: AST.ExpressionStatement, expression: this.filterChain() };
-  },
-
-  filterChain: function() {
-    var left = this.expression();
-    var token;
-    while ((token = this.expect('|'))) {
-      left = this.filter(left);
-    }
-    return left;
-  },
-
-  expression: function() {
-    return this.assignment();
-  },
-
-  assignment: function() {
-    var result = this.ternary();
-    if (this.expect('=')) {
-      result = { type: AST.AssignmentExpression, left: result, right: this.assignment(), operator: '='};
-    }
-    return result;
-  },
-
-  ternary: function() {
-    var test = this.logicalOR();
-    var alternate;
-    var consequent;
-    if (this.expect('?')) {
-      alternate = this.expression();
-      if (this.consume(':')) {
-        consequent = this.expression();
-        return { type: AST.ConditionalExpression, test: test, alternate: alternate, consequent: consequent};
-      }
-    }
-    return test;
-  },
-
-  logicalOR: function() {
-    var left = this.logicalAND();
-    while (this.expect('||')) {
-      left = { type: AST.LogicalExpression, operator: '||', left: left, right: this.logicalAND() };
-    }
-    return left;
-  },
-
-  logicalAND: function() {
-    var left = this.equality();
-    while (this.expect('&&')) {
-      left = { type: AST.LogicalExpression, operator: '&&', left: left, right: this.equality()};
-    }
-    return left;
-  },
-
-  equality: function() {
-    var left = this.relational();
-    var token;
-    while ((token = this.expect('==','!=','===','!=='))) {
-      left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.relational() };
-    }
-    return left;
-  },
-
-  relational: function() {
-    var left = this.additive();
-    var token;
-    while ((token = this.expect('<', '>', '<=', '>='))) {
-      left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.additive() };
-    }
-    return left;
-  },
-
-  additive: function() {
-    var left = this.multiplicative();
-    var token;
-    while ((token = this.expect('+','-'))) {
-      left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.multiplicative() };
-    }
-    return left;
-  },
-
-  multiplicative: function() {
-    var left = this.unary();
-    var token;
-    while ((token = this.expect('*','/','%'))) {
-      left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.unary() };
-    }
-    return left;
-  },
-
-  unary: function() {
-    var token;
-    if ((token = this.expect('+', '-', '!'))) {
-      return { type: AST.UnaryExpression, operator: token.text, prefix: true, argument: this.unary() };
-    } else {
-      return this.primary();
-    }
-  },
-
-  primary: function() {
-    var primary;
-    if (this.expect('(')) {
-      primary = this.filterChain();
-      this.consume(')');
-    } else if (this.expect('[')) {
-      primary = this.arrayDeclaration();
-    } else if (this.expect('{')) {
-      primary = this.object();
-    } else if (this.constants.hasOwnProperty(this.peek().text)) {
-      primary = copy(this.constants[this.consume().text]);
-    } else if (this.peek().identifier) {
-      primary = this.identifier();
-    } else if (this.peek().constant) {
-      primary = this.constant();
-    } else {
-      this.throwError('not a primary expression', this.peek());
-    }
-
-    var next;
-    while ((next = this.expect('(', '[', '.'))) {
-      if (next.text === '(') {
-        primary = {type: AST.CallExpression, callee: primary, arguments: this.parseArguments() };
-        this.consume(')');
-      } else if (next.text === '[') {
-        primary = { type: AST.MemberExpression, object: primary, property: this.expression(), computed: true };
-        this.consume(']');
-      } else if (next.text === '.') {
-        primary = { type: AST.MemberExpression, object: primary, property: this.identifier(), computed: false };
-      } else {
-        this.throwError('IMPOSSIBLE');
-      }
-    }
-    return primary;
-  },
-
-  filter: function(baseExpression) {
-    var args = [baseExpression];
-    var result = {type: AST.CallExpression, callee: this.identifier(), arguments: args, filter: true};
-
-    while (this.expect(':')) {
-      args.push(this.expression());
-    }
-
-    return result;
-  },
-
-  parseArguments: function() {
-    var args = [];
-    if (this.peekToken().text !== ')') {
-      do {
-        args.push(this.expression());
-      } while (this.expect(','));
-    }
-    return args;
-  },
-
-  identifier: function() {
-    var token = this.consume();
-    if (!token.identifier) {
-      this.throwError('is not a valid identifier', token);
-    }
-    return { type: AST.Identifier, name: token.text };
-  },
-
-  constant: function() {
-    // TODO check that it is a constant
-    return { type: AST.Literal, value: this.consume().value };
-  },
-
-  arrayDeclaration: function() {
-    var elements = [];
-    if (this.peekToken().text !== ']') {
-      do {
-        if (this.peek(']')) {
-          // Support trailing commas per ES5.1.
-          break;
-        }
-        elements.push(this.expression());
-      } while (this.expect(','));
-    }
-    this.consume(']');
-
-    return { type: AST.ArrayExpression, elements: elements };
-  },
-
-  object: function() {
-    var properties = [], property;
-    if (this.peekToken().text !== '}') {
-      do {
-        if (this.peek('}')) {
-          // Support trailing commas per ES5.1.
-          break;
-        }
-        property = {type: AST.Property, kind: 'init'};
-        if (this.peek().constant) {
-          property.key = this.constant();
-        } else if (this.peek().identifier) {
-          property.key = this.identifier();
-        } else {
-          this.throwError("invalid key", this.peek());
-        }
-        this.consume(':');
-        property.value = this.expression();
-        properties.push(property);
-      } while (this.expect(','));
-    }
-    this.consume('}');
-
-    return {type: AST.ObjectExpression, properties: properties };
-  },
-
-  throwError: function(msg, token) {
-    throw $parseMinErr('syntax',
-        'Syntax Error: Token \'{0}\' {1} at column {2} of the expression [{3}] starting at [{4}].',
-          token.text, msg, (token.index + 1), this.text, this.text.substring(token.index));
-  },
-
-  consume: function(e1) {
-    if (this.tokens.length === 0) {
-      throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);
-    }
-
-    var token = this.expect(e1);
-    if (!token) {
-      this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());
-    }
-    return token;
-  },
-
-  peekToken: function() {
-    if (this.tokens.length === 0) {
-      throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);
-    }
-    return this.tokens[0];
-  },
-
-  peek: function(e1, e2, e3, e4) {
-    return this.peekAhead(0, e1, e2, e3, e4);
-  },
-
-  peekAhead: function(i, e1, e2, e3, e4) {
-    if (this.tokens.length > i) {
-      var token = this.tokens[i];
-      var t = token.text;
-      if (t === e1 || t === e2 || t === e3 || t === e4 ||
-          (!e1 && !e2 && !e3 && !e4)) {
-        return token;
-      }
-    }
-    return false;
-  },
-
-  expect: function(e1, e2, e3, e4) {
-    var token = this.peek(e1, e2, e3, e4);
-    if (token) {
-      this.tokens.shift();
-      return token;
-    }
-    return false;
-  },
-
-
-  /* `undefined` is not a constant, it is an identifier,
-   * but using it as an identifier is not supported
-   */
-  constants: {
-    'true': { type: AST.Literal, value: true },
-    'false': { type: AST.Literal, value: false },
-    'null': { type: AST.Literal, value: null },
-    'undefined': {type: AST.Literal, value: undefined },
-    'this': {type: AST.ThisExpression }
-  }
-};
-
-function ifDefined(v, d) {
-  return typeof v !== 'undefined' ? v : d;
-}
-
-function plusFn(l, r) {
-  if (typeof l === 'undefined') return r;
-  if (typeof r === 'undefined') return l;
-  return l + r;
-}
-
-function isStateless($filter, filterName) {
-  var fn = $filter(filterName);
-  return !fn.$stateful;
-}
-
-function findConstantAndWatchExpressions(ast, $filter) {
-  var allConstants;
-  var argsToWatch;
-  switch (ast.type) {
-  case AST.Program:
-    allConstants = true;
-    forEach(ast.body, function(expr) {
-      findConstantAndWatchExpressions(expr.expression, $filter);
-      allConstants = allConstants && expr.expression.constant;
-    });
-    ast.constant = allConstants;
-    break;
-  case AST.Literal:
-    ast.constant = true;
-    ast.toWatch = [];
-    break;
-  case AST.UnaryExpression:
-    findConstantAndWatchExpressions(ast.argument, $filter);
-    ast.constant = ast.argument.constant;
-    ast.toWatch = ast.argument.toWatch;
-    break;
-  case AST.BinaryExpression:
-    findConstantAndWatchExpressions(ast.left, $filter);
-    findConstantAndWatchExpressions(ast.right, $filter);
-    ast.constant = ast.left.constant && ast.right.constant;
-    ast.toWatch = ast.left.toWatch.concat(ast.right.toWatch);
-    break;
-  case AST.LogicalExpression:
-    findConstantAndWatchExpressions(ast.left, $filter);
-    findConstantAndWatchExpressions(ast.right, $filter);
-    ast.constant = ast.left.constant && ast.right.constant;
-    ast.toWatch = ast.constant ? [] : [ast];
-    break;
-  case AST.ConditionalExpression:
-    findConstantAndWatchExpressions(ast.test, $filter);
-    findConstantAndWatchExpressions(ast.alternate, $filter);
-    findConstantAndWatchExpressions(ast.consequent, $filter);
-    ast.constant = ast.test.constant && ast.alternate.constant && ast.consequent.constant;
-    ast.toWatch = ast.constant ? [] : [ast];
-    break;
-  case AST.Identifier:
-    ast.constant = false;
-    ast.toWatch = [ast];
-    break;
-  case AST.MemberExpression:
-    findConstantAndWatchExpressions(ast.object, $filter);
-    if (ast.computed) {
-      findConstantAndWatchExpressions(ast.property, $filter);
-    }
-    ast.constant = ast.object.constant && (!ast.computed || ast.property.constant);
-    ast.toWatch = [ast];
-    break;
-  case AST.CallExpression:
-    allConstants = ast.filter ? isStateless($filter, ast.callee.name) : false;
-    argsToWatch = [];
-    forEach(ast.arguments, function(expr) {
-      findConstantAndWatchExpressions(expr, $filter);
-      allConstants = allConstants && expr.constant;
-      if (!expr.constant) {
-        argsToWatch.push.apply(argsToWatch, expr.toWatch);
-      }
-    });
-    ast.constant = allConstants;
-    ast.toWatch = ast.filter && isStateless($filter, ast.callee.name) ? argsToWatch : [ast];
-    break;
-  case AST.AssignmentExpression:
-    findConstantAndWatchExpressions(ast.left, $filter);
-    findConstantAndWatchExpressions(ast.right, $filter);
-    ast.constant = ast.left.constant && ast.right.constant;
-    ast.toWatch = [ast];
-    break;
-  case AST.ArrayExpression:
-    allConstants = true;
-    argsToWatch = [];
-    forEach(ast.elements, function(expr) {
-      findConstantAndWatchExpressions(expr, $filter);
-      allConstants = allConstants && expr.constant;
-      if (!expr.constant) {
-        argsToWatch.push.apply(argsToWatch, expr.toWatch);
-      }
-    });
-    ast.constant = allConstants;
-    ast.toWatch = argsToWatch;
-    break;
-  case AST.ObjectExpression:
-    allConstants = true;
-    argsToWatch = [];
-    forEach(ast.properties, function(property) {
-      findConstantAndWatchExpressions(property.value, $filter);
-      allConstants = allConstants && property.value.constant;
-      if (!property.value.constant) {
-        argsToWatch.push.apply(argsToWatch, property.value.toWatch);
-      }
-    });
-    ast.constant = allConstants;
-    ast.toWatch = argsToWatch;
-    break;
-  case AST.ThisExpression:
-    ast.constant = false;
-    ast.toWatch = [];
-    break;
-  }
-}
-
-function getInputs(body) {
-  if (body.length != 1) return;
-  var lastExpression = body[0].expression;
-  var candidate = lastExpression.toWatch;
-  if (candidate.length !== 1) return candidate;
-  return candidate[0] !== lastExpression ? candidate : undefined;
-}
-
-function isAssignable(ast) {
-  return ast.type === AST.Identifier || ast.type === AST.MemberExpression;
-}
-
-function assignableAST(ast) {
-  if (ast.body.length === 1 && isAssignable(ast.body[0].expression)) {
-    return {type: AST.AssignmentExpression, left: ast.body[0].expression, right: {type: AST.NGValueParameter}, operator: '='};
-  }
-}
-
-function isLiteral(ast) {
-  return ast.body.length === 0 ||
-      ast.body.length === 1 && (
-      ast.body[0].expression.type === AST.Literal ||
-      ast.body[0].expression.type === AST.ArrayExpression ||
-      ast.body[0].expression.type === AST.ObjectExpression);
-}
-
-function isConstant(ast) {
-  return ast.constant;
-}
-
-function ASTCompiler(astBuilder, $filter) {
-  this.astBuilder = astBuilder;
-  this.$filter = $filter;
-}
-
-ASTCompiler.prototype = {
-  compile: function(expression, expensiveChecks) {
-    var self = this;
-    var ast = this.astBuilder.ast(expression);
-    this.state = {
-      nextId: 0,
-      filters: {},
-      expensiveChecks: expensiveChecks,
-      fn: {vars: [], body: [], own: {}},
-      assign: {vars: [], body: [], own: {}},
-      inputs: []
-    };
-    findConstantAndWatchExpressions(ast, self.$filter);
-    var extra = '';
-    var assignable;
-    this.stage = 'assign';
-    if ((assignable = assignableAST(ast))) {
-      this.state.computing = 'assign';
-      var result = this.nextId();
-      this.recurse(assignable, result);
-      this.return_(result);
-      extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l');
-    }
-    var toWatch = getInputs(ast.body);
-    self.stage = 'inputs';
-    forEach(toWatch, function(watch, key) {
-      var fnKey = 'fn' + key;
-      self.state[fnKey] = {vars: [], body: [], own: {}};
-      self.state.computing = fnKey;
-      var intoId = self.nextId();
-      self.recurse(watch, intoId);
-      self.return_(intoId);
-      self.state.inputs.push(fnKey);
-      watch.watchId = key;
-    });
-    this.state.computing = 'fn';
-    this.stage = 'main';
-    this.recurse(ast);
-    var fnString =
-      // The build and minification steps remove the string "use strict" from the code, but this is done using a regex.
-      // This is a workaround for this until we do a better job at only removing the prefix only when we should.
-      '"' + this.USE + ' ' + this.STRICT + '";\n' +
-      this.filterPrefix() +
-      'var fn=' + this.generateFunction('fn', 's,l,a,i') +
-      extra +
-      this.watchFns() +
-      'return fn;';
-
-    /* jshint -W054 */
-    var fn = (new Function('$filter',
-        'ensureSafeMemberName',
-        'ensureSafeObject',
-        'ensureSafeFunction',
-        'getStringValue',
-        'ensureSafeAssignContext',
-        'ifDefined',
-        'plus',
-        'text',
-        fnString))(
-          this.$filter,
-          ensureSafeMemberName,
-          ensureSafeObject,
-          ensureSafeFunction,
-          getStringValue,
-          ensureSafeAssignContext,
-          ifDefined,
-          plusFn,
-          expression);
-    /* jshint +W054 */
-    this.state = this.stage = undefined;
-    fn.literal = isLiteral(ast);
-    fn.constant = isConstant(ast);
-    return fn;
-  },
-
-  USE: 'use',
-
-  STRICT: 'strict',
-
-  watchFns: function() {
-    var result = [];
-    var fns = this.state.inputs;
-    var self = this;
-    forEach(fns, function(name) {
-      result.push('var ' + name + '=' + self.generateFunction(name, 's'));
-    });
-    if (fns.length) {
-      result.push('fn.inputs=[' + fns.join(',') + '];');
-    }
-    return result.join('');
-  },
-
-  generateFunction: function(name, params) {
-    return 'function(' + params + '){' +
-        this.varsPrefix(name) +
-        this.body(name) +
-        '};';
-  },
-
-  filterPrefix: function() {
-    var parts = [];
-    var self = this;
-    forEach(this.state.filters, function(id, filter) {
-      parts.push(id + '=$filter(' + self.escape(filter) + ')');
-    });
-    if (parts.length) return 'var ' + parts.join(',') + ';';
-    return '';
-  },
-
-  varsPrefix: function(section) {
-    return this.state[section].vars.length ? 'var ' + this.state[section].vars.join(',') + ';' : '';
-  },
-
-  body: function(section) {
-    return this.state[section].body.join('');
-  },
-
-  recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
-    var left, right, self = this, args, expression;
-    recursionFn = recursionFn || noop;
-    if (!skipWatchIdCheck && isDefined(ast.watchId)) {
-      intoId = intoId || this.nextId();
-      this.if_('i',
-        this.lazyAssign(intoId, this.computedMember('i', ast.watchId)),
-        this.lazyRecurse(ast, intoId, nameId, recursionFn, create, true)
-      );
-      return;
-    }
-    switch (ast.type) {
-    case AST.Program:
-      forEach(ast.body, function(expression, pos) {
-        self.recurse(expression.expression, undefined, undefined, function(expr) { right = expr; });
-        if (pos !== ast.body.length - 1) {
-          self.current().body.push(right, ';');
-        } else {
-          self.return_(right);
-        }
-      });
-      break;
-    case AST.Literal:
-      expression = this.escape(ast.value);
-      this.assign(intoId, expression);
-      recursionFn(expression);
-      break;
-    case AST.UnaryExpression:
-      this.recurse(ast.argument, undefined, undefined, function(expr) { right = expr; });
-      expression = ast.operator + '(' + this.ifDefined(right, 0) + ')';
-      this.assign(intoId, expression);
-      recursionFn(expression);
-      break;
-    case AST.BinaryExpression:
-      this.recurse(ast.left, undefined, undefined, function(expr) { left = expr; });
-      this.recurse(ast.right, undefined, undefined, function(expr) { right = expr; });
-      if (ast.operator === '+') {
-        expression = this.plus(left, right);
-      } else if (ast.operator === '-') {
-        expression = this.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0);
-      } else {
-        expression = '(' + left + ')' + ast.operator + '(' + right + ')';
-      }
-      this.assign(intoId, expression);
-      recursionFn(expression);
-      break;
-    case AST.LogicalExpression:
-      intoId = intoId || this.nextId();
-      self.recurse(ast.left, intoId);
-      self.if_(ast.operator === '&&' ? intoId : self.not(intoId), self.lazyRecurse(ast.right, intoId));
-      recursionFn(intoId);
-      break;
-    case AST.ConditionalExpression:
-      intoId = intoId || this.nextId();
-      self.recurse(ast.test, intoId);
-      self.if_(intoId, self.lazyRecurse(ast.alternate, intoId), self.lazyRecurse(ast.consequent, intoId));
-      recursionFn(intoId);
-      break;
-    case AST.Identifier:
-      intoId = intoId || this.nextId();
-      if (nameId) {
-        nameId.context = self.stage === 'inputs' ? 's' : this.assign(this.nextId(), this.getHasOwnProperty('l', ast.name) + '?l:s');
-        nameId.computed = false;
-        nameId.name = ast.name;
-      }
-      ensureSafeMemberName(ast.name);
-      self.if_(self.stage === 'inputs' || self.not(self.getHasOwnProperty('l', ast.name)),
-        function() {
-          self.if_(self.stage === 'inputs' || 's', function() {
-            if (create && create !== 1) {
-              self.if_(
-                self.not(self.nonComputedMember('s', ast.name)),
-                self.lazyAssign(self.nonComputedMember('s', ast.name), '{}'));
-            }
-            self.assign(intoId, self.nonComputedMember('s', ast.name));
-          });
-        }, intoId && self.lazyAssign(intoId, self.nonComputedMember('l', ast.name))
-        );
-      if (self.state.expensiveChecks || isPossiblyDangerousMemberName(ast.name)) {
-        self.addEnsureSafeObject(intoId);
-      }
-      recursionFn(intoId);
-      break;
-    case AST.MemberExpression:
-      left = nameId && (nameId.context = this.nextId()) || this.nextId();
-      intoId = intoId || this.nextId();
-      self.recurse(ast.object, left, undefined, function() {
-        self.if_(self.notNull(left), function() {
-          if (ast.computed) {
-            right = self.nextId();
-            self.recurse(ast.property, right);
-            self.getStringValue(right);
-            self.addEnsureSafeMemberName(right);
-            if (create && create !== 1) {
-              self.if_(self.not(self.computedMember(left, right)), self.lazyAssign(self.computedMember(left, right), '{}'));
-            }
-            expression = self.ensureSafeObject(self.computedMember(left, right));
-            self.assign(intoId, expression);
-            if (nameId) {
-              nameId.computed = true;
-              nameId.name = right;
-            }
-          } else {
-            ensureSafeMemberName(ast.property.name);
-            if (create && create !== 1) {
-              self.if_(self.not(self.nonComputedMember(left, ast.property.name)), self.lazyAssign(self.nonComputedMember(left, ast.property.name), '{}'));
-            }
-            expression = self.nonComputedMember(left, ast.property.name);
-            if (self.state.expensiveChecks || isPossiblyDangerousMemberName(ast.property.name)) {
-              expression = self.ensureSafeObject(expression);
-            }
-            self.assign(intoId, expression);
-            if (nameId) {
-              nameId.computed = false;
-              nameId.name = ast.property.name;
-            }
-          }
-        }, function() {
-          self.assign(intoId, 'undefined');
-        });
-        recursionFn(intoId);
-      }, !!create);
-      break;
-    case AST.CallExpression:
-      intoId = intoId || this.nextId();
-      if (ast.filter) {
-        right = self.filter(ast.callee.name);
-        args = [];
-        forEach(ast.arguments, function(expr) {
-          var argument = self.nextId();
-          self.recurse(expr, argument);
-          args.push(argument);
-        });
-        expression = right + '(' + args.join(',') + ')';
-        self.assign(intoId, expression);
-        recursionFn(intoId);
-      } else {
-        right = self.nextId();
-        left = {};
-        args = [];
-        self.recurse(ast.callee, right, left, function() {
-          self.if_(self.notNull(right), function() {
-            self.addEnsureSafeFunction(right);
-            forEach(ast.arguments, function(expr) {
-              self.recurse(expr, self.nextId(), undefined, function(argument) {
-                args.push(self.ensureSafeObject(argument));
-              });
-            });
-            if (left.name) {
-              if (!self.state.expensiveChecks) {
-                self.addEnsureSafeObject(left.context);
-              }
-              expression = self.member(left.context, left.name, left.computed) + '(' + args.join(',') + ')';
-            } else {
-              expression = right + '(' + args.join(',') + ')';
-            }
-            expression = self.ensureSafeObject(expression);
-            self.assign(intoId, expression);
-          }, function() {
-            self.assign(intoId, 'undefined');
-          });
-          recursionFn(intoId);
-        });
-      }
-      break;
-    case AST.AssignmentExpression:
-      right = this.nextId();
-      left = {};
-      if (!isAssignable(ast.left)) {
-        throw $parseMinErr('lval', 'Trying to assing a value to a non l-value');
-      }
-      this.recurse(ast.left, undefined, left, function() {
-        self.if_(self.notNull(left.context), function() {
-          self.recurse(ast.right, right);
-          self.addEnsureSafeObject(self.member(left.context, left.name, left.computed));
-          self.addEnsureSafeAssignContext(left.context);
-          expression = self.member(left.context, left.name, left.computed) + ast.operator + right;
-          self.assign(intoId, expression);
-          recursionFn(intoId || expression);
-        });
-      }, 1);
-      break;
-    case AST.ArrayExpression:
-      args = [];
-      forEach(ast.elements, function(expr) {
-        self.recurse(expr, self.nextId(), undefined, function(argument) {
-          args.push(argument);
-        });
-      });
-      expression = '[' + args.join(',') + ']';
-      this.assign(intoId, expression);
-      recursionFn(expression);
-      break;
-    case AST.ObjectExpression:
-      args = [];
-      forEach(ast.properties, function(property) {
-        self.recurse(property.value, self.nextId(), undefined, function(expr) {
-          args.push(self.escape(
-              property.key.type === AST.Identifier ? property.key.name :
-                ('' + property.key.value)) +
-              ':' + expr);
-        });
-      });
-      expression = '{' + args.join(',') + '}';
-      this.assign(intoId, expression);
-      recursionFn(expression);
-      break;
-    case AST.ThisExpression:
-      this.assign(intoId, 's');
-      recursionFn('s');
-      break;
-    case AST.NGValueParameter:
-      this.assign(intoId, 'v');
-      recursionFn('v');
-      break;
-    }
-  },
-
-  getHasOwnProperty: function(element, property) {
-    var key = element + '.' + property;
-    var own = this.current().own;
-    if (!own.hasOwnProperty(key)) {
-      own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')');
-    }
-    return own[key];
-  },
-
-  assign: function(id, value) {
-    if (!id) return;
-    this.current().body.push(id, '=', value, ';');
-    return id;
-  },
-
-  filter: function(filterName) {
-    if (!this.state.filters.hasOwnProperty(filterName)) {
-      this.state.filters[filterName] = this.nextId(true);
-    }
-    return this.state.filters[filterName];
-  },
-
-  ifDefined: function(id, defaultValue) {
-    return 'ifDefined(' + id + ',' + this.escape(defaultValue) + ')';
-  },
-
-  plus: function(left, right) {
-    return 'plus(' + left + ',' + right + ')';
-  },
-
-  return_: function(id) {
-    this.current().body.push('return ', id, ';');
-  },
-
-  if_: function(test, alternate, consequent) {
-    if (test === true) {
-      alternate();
-    } else {
-      var body = this.current().body;
-      body.push('if(', test, '){');
-      alternate();
-      body.push('}');
-      if (consequent) {
-        body.push('else{');
-        consequent();
-        body.push('}');
-      }
-    }
-  },
-
-  not: function(expression) {
-    return '!(' + expression + ')';
-  },
-
-  notNull: function(expression) {
-    return expression + '!=null';
-  },
-
-  nonComputedMember: function(left, right) {
-    return left + '.' + right;
-  },
-
-  computedMember: function(left, right) {
-    return left + '[' + right + ']';
-  },
-
-  member: function(left, right, computed) {
-    if (computed) return this.computedMember(left, right);
-    return this.nonComputedMember(left, right);
-  },
-
-  addEnsureSafeObject: function(item) {
-    this.current().body.push(this.ensureSafeObject(item), ';');
-  },
-
-  addEnsureSafeMemberName: function(item) {
-    this.current().body.push(this.ensureSafeMemberName(item), ';');
-  },
-
-  addEnsureSafeFunction: function(item) {
-    this.current().body.push(this.ensureSafeFunction(item), ';');
-  },
-
-  addEnsureSafeAssignContext: function(item) {
-    this.current().body.push(this.ensureSafeAssignContext(item), ';');
-  },
-
-  ensureSafeObject: function(item) {
-    return 'ensureSafeObject(' + item + ',text)';
-  },
-
-  ensureSafeMemberName: function(item) {
-    return 'ensureSafeMemberName(' + item + ',text)';
-  },
-
-  ensureSafeFunction: function(item) {
-    return 'ensureSafeFunction(' + item + ',text)';
-  },
-
-  getStringValue: function(item) {
-    this.assign(item, 'getStringValue(' + item + ',text)');
-  },
-
-  ensureSafeAssignContext: function(item) {
-    return 'ensureSafeAssignContext(' + item + ',text)';
-  },
-
-  lazyRecurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
-    var self = this;
-    return function() {
-      self.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck);
-    };
-  },
-
-  lazyAssign: function(id, value) {
-    var self = this;
-    return function() {
-      self.assign(id, value);
-    };
-  },
-
-  stringEscapeRegex: /[^ a-zA-Z0-9]/g,
-
-  stringEscapeFn: function(c) {
-    return '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4);
-  },
-
-  escape: function(value) {
-    if (isString(value)) return "'" + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + "'";
-    if (isNumber(value)) return value.toString();
-    if (value === true) return 'true';
-    if (value === false) return 'false';
-    if (value === null) return 'null';
-    if (typeof value === 'undefined') return 'undefined';
-
-    throw $parseMinErr('esc', 'IMPOSSIBLE');
-  },
-
-  nextId: function(skip, init) {
-    var id = 'v' + (this.state.nextId++);
-    if (!skip) {
-      this.current().vars.push(id + (init ? '=' + init : ''));
-    }
-    return id;
-  },
-
-  current: function() {
-    return this.state[this.state.computing];
-  }
-};
-
-
-function ASTInterpreter(astBuilder, $filter) {
-  this.astBuilder = astBuilder;
-  this.$filter = $filter;
-}
-
-ASTInterpreter.prototype = {
-  compile: function(expression, expensiveChecks) {
-    var self = this;
-    var ast = this.astBuilder.ast(expression);
-    this.expression = expression;
-    this.expensiveChecks = expensiveChecks;
-    findConstantAndWatchExpressions(ast, self.$filter);
-    var assignable;
-    var assign;
-    if ((assignable = assignableAST(ast))) {
-      assign = this.recurse(assignable);
-    }
-    var toWatch = getInputs(ast.body);
-    var inputs;
-    if (toWatch) {
-      inputs = [];
-      forEach(toWatch, function(watch, key) {
-        var input = self.recurse(watch);
-        watch.input = input;
-        inputs.push(input);
-        watch.watchId = key;
-      });
-    }
-    var expressions = [];
-    forEach(ast.body, function(expression) {
-      expressions.push(self.recurse(expression.expression));
-    });
-    var fn = ast.body.length === 0 ? function() {} :
-             ast.body.length === 1 ? expressions[0] :
-             function(scope, locals) {
-               var lastValue;
-               forEach(expressions, function(exp) {
-                 lastValue = exp(scope, locals);
-               });
-               return lastValue;
-             };
-    if (assign) {
-      fn.assign = function(scope, value, locals) {
-        return assign(scope, locals, value);
-      };
-    }
-    if (inputs) {
-      fn.inputs = inputs;
-    }
-    fn.literal = isLiteral(ast);
-    fn.constant = isConstant(ast);
-    return fn;
-  },
-
-  recurse: function(ast, context, create) {
-    var left, right, self = this, args, expression;
-    if (ast.input) {
-      return this.inputs(ast.input, ast.watchId);
-    }
-    switch (ast.type) {
-    case AST.Literal:
-      return this.value(ast.value, context);
-    case AST.UnaryExpression:
-      right = this.recurse(ast.argument);
-      return this['unary' + ast.operator](right, context);
-    case AST.BinaryExpression:
-      left = this.recurse(ast.left);
-      right = this.recurse(ast.right);
-      return this['binary' + ast.operator](left, right, context);
-    case AST.LogicalExpression:
-      left = this.recurse(ast.left);
-      right = this.recurse(ast.right);
-      return this['binary' + ast.operator](left, right, context);
-    case AST.ConditionalExpression:
-      return this['ternary?:'](
-        this.recurse(ast.test),
-        this.recurse(ast.alternate),
-        this.recurse(ast.consequent),
-        context
-      );
-    case AST.Identifier:
-      ensureSafeMemberName(ast.name, self.expression);
-      return self.identifier(ast.name,
-                             self.expensiveChecks || isPossiblyDangerousMemberName(ast.name),
-                             context, create, self.expression);
-    case AST.MemberExpression:
-      left = this.recurse(ast.object, false, !!create);
-      if (!ast.computed) {
-        ensureSafeMemberName(ast.property.name, self.expression);
-        right = ast.property.name;
-      }
-      if (ast.computed) right = this.recurse(ast.property);
-      return ast.computed ?
-        this.computedMember(left, right, context, create, self.expression) :
-        this.nonComputedMember(left, right, self.expensiveChecks, context, create, self.expression);
-    case AST.CallExpression:
-      args = [];
-      forEach(ast.arguments, function(expr) {
-        args.push(self.recurse(expr));
-      });
-      if (ast.filter) right = this.$filter(ast.callee.name);
-      if (!ast.filter) right = this.recurse(ast.callee, true);
-      return ast.filter ?
-        function(scope, locals, assign, inputs) {
-          var values = [];
-          for (var i = 0; i < args.length; ++i) {
-            values.push(args[i](scope, locals, assign, inputs));
-          }
-          var value = right.apply(undefined, values, inputs);
-          return context ? {context: undefined, name: undefined, value: value} : value;
-        } :
-        function(scope, locals, assign, inputs) {
-          var rhs = right(scope, locals, assign, inputs);
-          var value;
-          if (rhs.value != null) {
-            ensureSafeObject(rhs.context, self.expression);
-            ensureSafeFunction(rhs.value, self.expression);
-            var values = [];
-            for (var i = 0; i < args.length; ++i) {
-              values.push(ensureSafeObject(args[i](scope, locals, assign, inputs), self.expression));
-            }
-            value = ensureSafeObject(rhs.value.apply(rhs.context, values), self.expression);
-          }
-          return context ? {value: value} : value;
-        };
-    case AST.AssignmentExpression:
-      left = this.recurse(ast.left, true, 1);
-      right = this.recurse(ast.right);
-      return function(scope, locals, assign, inputs) {
-        var lhs = left(scope, locals, assign, inputs);
-        var rhs = right(scope, locals, assign, inputs);
-        ensureSafeObject(lhs.value, self.expression);
-        ensureSafeAssignContext(lhs.context);
-        lhs.context[lhs.name] = rhs;
-        return context ? {value: rhs} : rhs;
-      };
-    case AST.ArrayExpression:
-      args = [];
-      forEach(ast.elements, function(expr) {
-        args.push(self.recurse(expr));
-      });
-      return function(scope, locals, assign, inputs) {
-        var value = [];
-        for (var i = 0; i < args.length; ++i) {
-          value.push(args[i](scope, locals, assign, inputs));
-        }
-        return context ? {value: value} : value;
-      };
-    case AST.ObjectExpression:
-      args = [];
-      forEach(ast.properties, function(property) {
-        args.push({key: property.key.type === AST.Identifier ?
-                        property.key.name :
-                        ('' + property.key.value),
-                   value: self.recurse(property.value)
-        });
-      });
-      return function(scope, locals, assign, inputs) {
-        var value = {};
-        for (var i = 0; i < args.length; ++i) {
-          value[args[i].key] = args[i].value(scope, locals, assign, inputs);
-        }
-        return context ? {value: value} : value;
-      };
-    case AST.ThisExpression:
-      return function(scope) {
-        return context ? {value: scope} : scope;
-      };
-    case AST.NGValueParameter:
-      return function(scope, locals, assign, inputs) {
-        return context ? {value: assign} : assign;
-      };
-    }
-  },
-
-  'unary+': function(argument, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = argument(scope, locals, assign, inputs);
-      if (isDefined(arg)) {
-        arg = +arg;
-      } else {
-        arg = 0;
-      }
-      return context ? {value: arg} : arg;
-    };
-  },
-  'unary-': function(argument, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = argument(scope, locals, assign, inputs);
-      if (isDefined(arg)) {
-        arg = -arg;
-      } else {
-        arg = 0;
-      }
-      return context ? {value: arg} : arg;
-    };
-  },
-  'unary!': function(argument, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = !argument(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary+': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var lhs = left(scope, locals, assign, inputs);
-      var rhs = right(scope, locals, assign, inputs);
-      var arg = plusFn(lhs, rhs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary-': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var lhs = left(scope, locals, assign, inputs);
-      var rhs = right(scope, locals, assign, inputs);
-      var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary*': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary/': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary%': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary===': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary!==': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary==': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary!=': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary<': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary>': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary<=': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary>=': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary&&': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'binary||': function(left, right, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  'ternary?:': function(test, alternate, consequent, context) {
-    return function(scope, locals, assign, inputs) {
-      var arg = test(scope, locals, assign, inputs) ? alternate(scope, locals, assign, inputs) : consequent(scope, locals, assign, inputs);
-      return context ? {value: arg} : arg;
-    };
-  },
-  value: function(value, context) {
-    return function() { return context ? {context: undefined, name: undefined, value: value} : value; };
-  },
-  identifier: function(name, expensiveChecks, context, create, expression) {
-    return function(scope, locals, assign, inputs) {
-      var base = locals && (name in locals) ? locals : scope;
-      if (create && create !== 1 && base && !(base[name])) {
-        base[name] = {};
-      }
-      var value = base ? base[name] : undefined;
-      if (expensiveChecks) {
-        ensureSafeObject(value, expression);
-      }
-      if (context) {
-        return {context: base, name: name, value: value};
-      } else {
-        return value;
-      }
-    };
-  },
-  computedMember: function(left, right, context, create, expression) {
-    return function(scope, locals, assign, inputs) {
-      var lhs = left(scope, locals, assign, inputs);
-      var rhs;
-      var value;
-      if (lhs != null) {
-        rhs = right(scope, locals, assign, inputs);
-        rhs = getStringValue(rhs);
-        ensureSafeMemberName(rhs, expression);
-        if (create && create !== 1 && lhs && !(lhs[rhs])) {
-          lhs[rhs] = {};
-        }
-        value = lhs[rhs];
-        ensureSafeObject(value, expression);
-      }
-      if (context) {
-        return {context: lhs, name: rhs, value: value};
-      } else {
-        return value;
-      }
-    };
-  },
-  nonComputedMember: function(left, right, expensiveChecks, context, create, expression) {
-    return function(scope, locals, assign, inputs) {
-      var lhs = left(scope, locals, assign, inputs);
-      if (create && create !== 1 && lhs && !(lhs[right])) {
-        lhs[right] = {};
-      }
-      var value = lhs != null ? lhs[right] : undefined;
-      if (expensiveChecks || isPossiblyDangerousMemberName(right)) {
-        ensureSafeObject(value, expression);
-      }
-      if (context) {
-        return {context: lhs, name: right, value: value};
-      } else {
-        return value;
-      }
-    };
-  },
-  inputs: function(input, watchId) {
-    return function(scope, value, locals, inputs) {
-      if (inputs) return inputs[watchId];
-      return input(scope, value, locals);
-    };
-  }
-};
-
-/**
- * @constructor
- */
-var Parser = function(lexer, $filter, options) {
-  this.lexer = lexer;
-  this.$filter = $filter;
-  this.options = options;
-  this.ast = new AST(this.lexer);
-  this.astCompiler = options.csp ? new ASTInterpreter(this.ast, $filter) :
-                                   new ASTCompiler(this.ast, $filter);
-};
-
-Parser.prototype = {
-  constructor: Parser,
-
-  parse: function(text) {
-    return this.astCompiler.compile(text, this.options.expensiveChecks);
-  }
-};
-
-var getterFnCacheDefault = createMap();
-var getterFnCacheExpensive = createMap();
-
-function isPossiblyDangerousMemberName(name) {
-  return name == 'constructor';
-}
-
-var objectValueOf = Object.prototype.valueOf;
-
-function getValueOf(value) {
-  return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value);
-}
-
-///////////////////////////////////
-
-/**
- * @ngdoc service
- * @name $parse
- * @kind function
- *
- * @description
- *
- * Converts Angular {@link guide/expression expression} into a function.
- *
- * ```js
- *   var getter = $parse('user.name');
- *   var setter = getter.assign;
- *   var context = {user:{name:'angular'}};
- *   var locals = {user:{name:'local'}};
- *
- *   expect(getter(context)).toEqual('angular');
- *   setter(context, 'newValue');
- *   expect(context.user.name).toEqual('newValue');
- *   expect(getter(context, locals)).toEqual('local');
- * ```
- *
- *
- * @param {string} expression String expression to compile.
- * @returns {function(context, locals)} a function which represents the compiled expression:
- *
- *    * `context` – `{object}` – an object against which any expressions embedded in the strings
- *      are evaluated against (typically a scope object).
- *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
- *      `context`.
- *
- *    The returned function also has the following properties:
- *      * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript
- *        literal.
- *      * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript
- *        constant literals.
- *      * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be
- *        set to a function to change its value on the given context.
- *
- */
-
-
-/**
- * @ngdoc provider
- * @name $parseProvider
- *
- * @description
- * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}
- *  service.
- */
-function $ParseProvider() {
-  var cacheDefault = createMap();
-  var cacheExpensive = createMap();
-
-  this.$get = ['$filter', function($filter) {
-    var noUnsafeEval = csp().noUnsafeEval;
-    var $parseOptions = {
-          csp: noUnsafeEval,
-          expensiveChecks: false
-        },
-        $parseOptionsExpensive = {
-          csp: noUnsafeEval,
-          expensiveChecks: true
-        };
-
-    return function $parse(exp, interceptorFn, expensiveChecks) {
-      var parsedExpression, oneTime, cacheKey;
-
-      switch (typeof exp) {
-        case 'string':
-          exp = exp.trim();
-          cacheKey = exp;
-
-          var cache = (expensiveChecks ? cacheExpensive : cacheDefault);
-          parsedExpression = cache[cacheKey];
-
-          if (!parsedExpression) {
-            if (exp.charAt(0) === ':' && exp.charAt(1) === ':') {
-              oneTime = true;
-              exp = exp.substring(2);
-            }
-            var parseOptions = expensiveChecks ? $parseOptionsExpensive : $parseOptions;
-            var lexer = new Lexer(parseOptions);
-            var parser = new Parser(lexer, $filter, parseOptions);
-            parsedExpression = parser.parse(exp);
-            if (parsedExpression.constant) {
-              parsedExpression.$$watchDelegate = constantWatchDelegate;
-            } else if (oneTime) {
-              parsedExpression.$$watchDelegate = parsedExpression.literal ?
-                  oneTimeLiteralWatchDelegate : oneTimeWatchDelegate;
-            } else if (parsedExpression.inputs) {
-              parsedExpression.$$watchDelegate = inputsWatchDelegate;
-            }
-            cache[cacheKey] = parsedExpression;
-          }
-          return addInterceptor(parsedExpression, interceptorFn);
-
-        case 'function':
-          return addInterceptor(exp, interceptorFn);
-
-        default:
-          return noop;
-      }
-    };
-
-    function expressionInputDirtyCheck(newValue, oldValueOfValue) {
-
-      if (newValue == null || oldValueOfValue == null) { // null/undefined
-        return newValue === oldValueOfValue;
-      }
-
-      if (typeof newValue === 'object') {
-
-        // attempt to convert the value to a primitive type
-        // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can
-        //             be cheaply dirty-checked
-        newValue = getValueOf(newValue);
-
-        if (typeof newValue === 'object') {
-          // objects/arrays are not supported - deep-watching them would be too expensive
-          return false;
-        }
-
-        // fall-through to the primitive equality check
-      }
-
-      //Primitive or NaN
-      return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue);
-    }
-
-    function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {
-      var inputExpressions = parsedExpression.inputs;
-      var lastResult;
-
-      if (inputExpressions.length === 1) {
-        var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails
-        inputExpressions = inputExpressions[0];
-        return scope.$watch(function expressionInputWatch(scope) {
-          var newInputValue = inputExpressions(scope);
-          if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf)) {
-            lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]);
-            oldInputValueOf = newInputValue && getValueOf(newInputValue);
-          }
-          return lastResult;
-        }, listener, objectEquality, prettyPrintExpression);
-      }
-
-      var oldInputValueOfValues = [];
-      var oldInputValues = [];
-      for (var i = 0, ii = inputExpressions.length; i < ii; i++) {
-        oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails
-        oldInputValues[i] = null;
-      }
-
-      return scope.$watch(function expressionInputsWatch(scope) {
-        var changed = false;
-
-        for (var i = 0, ii = inputExpressions.length; i < ii; i++) {
-          var newInputValue = inputExpressions[i](scope);
-          if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) {
-            oldInputValues[i] = newInputValue;
-            oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);
-          }
-        }
-
-        if (changed) {
-          lastResult = parsedExpression(scope, undefined, undefined, oldInputValues);
-        }
-
-        return lastResult;
-      }, listener, objectEquality, prettyPrintExpression);
-    }
-
-    function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression) {
-      var unwatch, lastValue;
-      return unwatch = scope.$watch(function oneTimeWatch(scope) {
-        return parsedExpression(scope);
-      }, function oneTimeListener(value, old, scope) {
-        lastValue = value;
-        if (isFunction(listener)) {
-          listener.apply(this, arguments);
-        }
-        if (isDefined(value)) {
-          scope.$$postDigest(function() {
-            if (isDefined(lastValue)) {
-              unwatch();
-            }
-          });
-        }
-      }, objectEquality);
-    }
-
-    function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) {
-      var unwatch, lastValue;
-      return unwatch = scope.$watch(function oneTimeWatch(scope) {
-        return parsedExpression(scope);
-      }, function oneTimeListener(value, old, scope) {
-        lastValue = value;
-        if (isFunction(listener)) {
-          listener.call(this, value, old, scope);
-        }
-        if (isAllDefined(value)) {
-          scope.$$postDigest(function() {
-            if (isAllDefined(lastValue)) unwatch();
-          });
-        }
-      }, objectEquality);
-
-      function isAllDefined(value) {
-        var allDefined = true;
-        forEach(value, function(val) {
-          if (!isDefined(val)) allDefined = false;
-        });
-        return allDefined;
-      }
-    }
-
-    function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {
-      var unwatch;
-      return unwatch = scope.$watch(function constantWatch(scope) {
-        return parsedExpression(scope);
-      }, function constantListener(value, old, scope) {
-        if (isFunction(listener)) {
-          listener.apply(this, arguments);
-        }
-        unwatch();
-      }, objectEquality);
-    }
-
-    function addInterceptor(parsedExpression, interceptorFn) {
-      if (!interceptorFn) return parsedExpression;
-      var watchDelegate = parsedExpression.$$watchDelegate;
-
-      var regularWatch =
-          watchDelegate !== oneTimeLiteralWatchDelegate &&
-          watchDelegate !== oneTimeWatchDelegate;
-
-      var fn = regularWatch ? function regularInterceptedExpression(scope, locals, assign, inputs) {
-        var value = parsedExpression(scope, locals, assign, inputs);
-        return interceptorFn(value, scope, locals);
-      } : function oneTimeInterceptedExpression(scope, locals, assign, inputs) {
-        var value = parsedExpression(scope, locals, assign, inputs);
-        var result = interceptorFn(value, scope, locals);
-        // we only return the interceptor's result if the
-        // initial value is defined (for bind-once)
-        return isDefined(value) ? result : value;
-      };
-
-      // Propagate $$watchDelegates other then inputsWatchDelegate
-      if (parsedExpression.$$watchDelegate &&
-          parsedExpression.$$watchDelegate !== inputsWatchDelegate) {
-        fn.$$watchDelegate = parsedExpression.$$watchDelegate;
-      } else if (!interceptorFn.$stateful) {
-        // If there is an interceptor, but no watchDelegate then treat the interceptor like
-        // we treat filters - it is assumed to be a pure function unless flagged with $stateful
-        fn.$$watchDelegate = inputsWatchDelegate;
-        fn.inputs = parsedExpression.inputs ? parsedExpression.inputs : [parsedExpression];
-      }
-
-      return fn;
-    }
-  }];
-}
-
-/**
- * @ngdoc service
- * @name $q
- * @requires $rootScope
- *
- * @description
- * A service that helps you run functions asynchronously, and use their return values (or exceptions)
- * when they are done processing.
- *
- * This is an implementation of promises/deferred objects inspired by
- * [Kris Kowal's Q](https://github.com/kriskowal/q).
- *
- * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred
- * implementations, and the other which resembles ES6 promises to some degree.
- *
- * # $q constructor
- *
- * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver`
- * function as the first argument. This is similar to the native Promise implementation from ES6 Harmony,
- * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
- *
- * While the constructor-style use is supported, not all of the supporting methods from ES6 Harmony promises are
- * available yet.
- *
- * It can be used like so:
- *
- * ```js
- *   // for the purpose of this example let's assume that variables `$q` and `okToGreet`
- *   // are available in the current lexical scope (they could have been injected or passed in).
- *
- *   function asyncGreet(name) {
- *     // perform some asynchronous operation, resolve or reject the promise when appropriate.
- *     return $q(function(resolve, reject) {
- *       setTimeout(function() {
- *         if (okToGreet(name)) {
- *           resolve('Hello, ' + name + '!');
- *         } else {
- *           reject('Greeting ' + name + ' is not allowed.');
- *         }
- *       }, 1000);
- *     });
- *   }
- *
- *   var promise = asyncGreet('Robin Hood');
- *   promise.then(function(greeting) {
- *     alert('Success: ' + greeting);
- *   }, function(reason) {
- *     alert('Failed: ' + reason);
- *   });
- * ```
- *
- * Note: progress/notify callbacks are not currently supported via the ES6-style interface.
- *
- * However, the more traditional CommonJS-style usage is still available, and documented below.
- *
- * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an
- * interface for interacting with an object that represents the result of an action that is
- * performed asynchronously, and may or may not be finished at any given point in time.
- *
- * From the perspective of dealing with error handling, deferred and promise APIs are to
- * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming.
- *
- * ```js
- *   // for the purpose of this example let's assume that variables `$q` and `okToGreet`
- *   // are available in the current lexical scope (they could have been injected or passed in).
- *
- *   function asyncGreet(name) {
- *     var deferred = $q.defer();
- *
- *     setTimeout(function() {
- *       deferred.notify('About to greet ' + name + '.');
- *
- *       if (okToGreet(name)) {
- *         deferred.resolve('Hello, ' + name + '!');
- *       } else {
- *         deferred.reject('Greeting ' + name + ' is not allowed.');
- *       }
- *     }, 1000);
- *
- *     return deferred.promise;
- *   }
- *
- *   var promise = asyncGreet('Robin Hood');
- *   promise.then(function(greeting) {
- *     alert('Success: ' + greeting);
- *   }, function(reason) {
- *     alert('Failed: ' + reason);
- *   }, function(update) {
- *     alert('Got notification: ' + update);
- *   });
- * ```
- *
- * At first it might not be obvious why this extra complexity is worth the trouble. The payoff
- * comes in the way of guarantees that promise and deferred APIs make, see
- * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md.
- *
- * Additionally the promise api allows for composition that is very hard to do with the
- * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.
- * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the
- * section on serial or parallel joining of promises.
- *
- * # The Deferred API
- *
- * A new instance of deferred is constructed by calling `$q.defer()`.
- *
- * The purpose of the deferred object is to expose the associated Promise instance as well as APIs
- * that can be used for signaling the successful or unsuccessful completion, as well as the status
- * of the task.
- *
- * **Methods**
- *
- * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection
- *   constructed via `$q.reject`, the promise will be rejected instead.
- * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to
- *   resolving it with a rejection constructed via `$q.reject`.
- * - `notify(value)` - provides updates on the status of the promise's execution. This may be called
- *   multiple times before the promise is either resolved or rejected.
- *
- * **Properties**
- *
- * - promise – `{Promise}` – promise object associated with this deferred.
- *
- *
- * # The Promise API
- *
- * A new promise instance is created when a deferred instance is created and can be retrieved by
- * calling `deferred.promise`.
- *
- * The purpose of the promise object is to allow for interested parties to get access to the result
- * of the deferred task when it completes.
- *
- * **Methods**
- *
- * - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or
- *   will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously
- *   as soon as the result is available. The callbacks are called with a single argument: the result
- *   or rejection reason. Additionally, the notify callback may be called zero or more times to
- *   provide a progress indication, before the promise is resolved or rejected.
- *
- *   This method *returns a new promise* which is resolved or rejected via the return value of the
- *   `successCallback`, `errorCallback` (unless that value is a promise, in which case it is resolved
- *   with the value which is resolved in that promise using
- *   [promise chaining](http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promises-queues)).
- *   It also notifies via the return value of the `notifyCallback` method. The promise cannot be
- *   resolved or rejected from the notifyCallback method.
- *
- * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`
- *
- * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise,
- *   but to do so without modifying the final value. This is useful to release resources or do some
- *   clean-up that needs to be done whether the promise was rejected or resolved. See the [full
- *   specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for
- *   more information.
- *
- * # Chaining promises
- *
- * Because calling the `then` method of a promise returns a new derived promise, it is easily
- * possible to create a chain of promises:
- *
- * ```js
- *   promiseB = promiseA.then(function(result) {
- *     return result + 1;
- *   });
- *
- *   // promiseB will be resolved immediately after promiseA is resolved and its value
- *   // will be the result of promiseA incremented by 1
- * ```
- *
- * It is possible to create chains of any length and since a promise can be resolved with another
- * promise (which will defer its resolution further), it is possible to pause/defer resolution of
- * the promises at any point in the chain. This makes it possible to implement powerful APIs like
- * $http's response interceptors.
- *
- *
- * # Differences between Kris Kowal's Q and $q
- *
- *  There are two main differences:
- *
- * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation
- *   mechanism in angular, which means faster propagation of resolution or rejection into your
- *   models and avoiding unnecessary browser repaints, which would result in flickering UI.
- * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains
- *   all the important functionality needed for common async tasks.
- *
- *  # Testing
- *
- *  ```js
- *    it('should simulate promise', inject(function($q, $rootScope) {
- *      var deferred = $q.defer();
- *      var promise = deferred.promise;
- *      var resolvedValue;
- *
- *      promise.then(function(value) { resolvedValue = value; });
- *      expect(resolvedValue).toBeUndefined();
- *
- *      // Simulate resolving of promise
- *      deferred.resolve(123);
- *      // Note that the 'then' function does not get called synchronously.
- *      // This is because we want the promise API to always be async, whether or not
- *      // it got called synchronously or asynchronously.
- *      expect(resolvedValue).toBeUndefined();
- *
- *      // Propagate promise resolution to 'then' functions using $apply().
- *      $rootScope.$apply();
- *      expect(resolvedValue).toEqual(123);
- *    }));
- *  ```
- *
- * @param {function(function, function)} resolver Function which is responsible for resolving or
- *   rejecting the newly created promise. The first parameter is a function which resolves the
- *   promise, the second parameter is a function which rejects the promise.
- *
- * @returns {Promise} The newly created promise.
- */
-function $QProvider() {
-
-  this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
-    return qFactory(function(callback) {
-      $rootScope.$evalAsync(callback);
-    }, $exceptionHandler);
-  }];
-}
-
-function $$QProvider() {
-  this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) {
-    return qFactory(function(callback) {
-      $browser.defer(callback);
-    }, $exceptionHandler);
-  }];
-}
-
-/**
- * Constructs a promise manager.
- *
- * @param {function(function)} nextTick Function for executing functions in the next turn.
- * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for
- *     debugging purposes.
- * @returns {object} Promise manager.
- */
-function qFactory(nextTick, exceptionHandler) {
-  var $qMinErr = minErr('$q', TypeError);
-  function callOnce(self, resolveFn, rejectFn) {
-    var called = false;
-    function wrap(fn) {
-      return function(value) {
-        if (called) return;
-        called = true;
-        fn.call(self, value);
-      };
-    }
-
-    return [wrap(resolveFn), wrap(rejectFn)];
-  }
-
-  /**
-   * @ngdoc method
-   * @name ng.$q#defer
-   * @kind function
-   *
-   * @description
-   * Creates a `Deferred` object which represents a task which will finish in the future.
-   *
-   * @returns {Deferred} Returns a new instance of deferred.
-   */
-  var defer = function() {
-    return new Deferred();
-  };
-
-  function Promise() {
-    this.$$state = { status: 0 };
-  }
-
-  extend(Promise.prototype, {
-    then: function(onFulfilled, onRejected, progressBack) {
-      if (isUndefined(onFulfilled) && isUndefined(onRejected) && isUndefined(progressBack)) {
-        return this;
-      }
-      var result = new Deferred();
-
-      this.$$state.pending = this.$$state.pending || [];
-      this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]);
-      if (this.$$state.status > 0) scheduleProcessQueue(this.$$state);
-
-      return result.promise;
-    },
-
-    "catch": function(callback) {
-      return this.then(null, callback);
-    },
-
-    "finally": function(callback, progressBack) {
-      return this.then(function(value) {
-        return handleCallback(value, true, callback);
-      }, function(error) {
-        return handleCallback(error, false, callback);
-      }, progressBack);
-    }
-  });
-
-  //Faster, more basic than angular.bind http://jsperf.com/angular-bind-vs-custom-vs-native
-  function simpleBind(context, fn) {
-    return function(value) {
-      fn.call(context, value);
-    };
-  }
-
-  function processQueue(state) {
-    var fn, deferred, pending;
-
-    pending = state.pending;
-    state.processScheduled = false;
-    state.pending = undefined;
-    for (var i = 0, ii = pending.length; i < ii; ++i) {
-      deferred = pending[i][0];
-      fn = pending[i][state.status];
-      try {
-        if (isFunction(fn)) {
-          deferred.resolve(fn(state.value));
-        } else if (state.status === 1) {
-          deferred.resolve(state.value);
-        } else {
-          deferred.reject(state.value);
-        }
-      } catch (e) {
-        deferred.reject(e);
-        exceptionHandler(e);
-      }
-    }
-  }
-
-  function scheduleProcessQueue(state) {
-    if (state.processScheduled || !state.pending) return;
-    state.processScheduled = true;
-    nextTick(function() { processQueue(state); });
-  }
-
-  function Deferred() {
-    this.promise = new Promise();
-    //Necessary to support unbound execution :/
-    this.resolve = simpleBind(this, this.resolve);
-    this.reject = simpleBind(this, this.reject);
-    this.notify = simpleBind(this, this.notify);
-  }
-
-  extend(Deferred.prototype, {
-    resolve: function(val) {
-      if (this.promise.$$state.status) return;
-      if (val === this.promise) {
-        this.$$reject($qMinErr(
-          'qcycle',
-          "Expected promise to be resolved with value other than itself '{0}'",
-          val));
-      } else {
-        this.$$resolve(val);
-      }
-
-    },
-
-    $$resolve: function(val) {
-      var then, fns;
-
-      fns = callOnce(this, this.$$resolve, this.$$reject);
-      try {
-        if ((isObject(val) || isFunction(val))) then = val && val.then;
-        if (isFunction(then)) {
-          this.promise.$$state.status = -1;
-          then.call(val, fns[0], fns[1], this.notify);
-        } else {
-          this.promise.$$state.value = val;
-          this.promise.$$state.status = 1;
-          scheduleProcessQueue(this.promise.$$state);
-        }
-      } catch (e) {
-        fns[1](e);
-        exceptionHandler(e);
-      }
-    },
-
-    reject: function(reason) {
-      if (this.promise.$$state.status) return;
-      this.$$reject(reason);
-    },
-
-    $$reject: function(reason) {
-      this.promise.$$state.value = reason;
-      this.promise.$$state.status = 2;
-      scheduleProcessQueue(this.promise.$$state);
-    },
-
-    notify: function(progress) {
-      var callbacks = this.promise.$$state.pending;
-
-      if ((this.promise.$$state.status <= 0) && callbacks && callbacks.length) {
-        nextTick(function() {
-          var callback, result;
-          for (var i = 0, ii = callbacks.length; i < ii; i++) {
-            result = callbacks[i][0];
-            callback = callbacks[i][3];
-            try {
-              result.notify(isFunction(callback) ? callback(progress) : progress);
-            } catch (e) {
-              exceptionHandler(e);
-            }
-          }
-        });
-      }
-    }
-  });
-
-  /**
-   * @ngdoc method
-   * @name $q#reject
-   * @kind function
-   *
-   * @description
-   * Creates a promise that is resolved as rejected with the specified `reason`. This api should be
-   * used to forward rejection in a chain of promises. If you are dealing with the last promise in
-   * a promise chain, you don't need to worry about it.
-   *
-   * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of
-   * `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via
-   * a promise error callback and you want to forward the error to the promise derived from the
-   * current promise, you have to "rethrow" the error by returning a rejection constructed via
-   * `reject`.
-   *
-   * ```js
-   *   promiseB = promiseA.then(function(result) {
-   *     // success: do something and resolve promiseB
-   *     //          with the old or a new result
-   *     return result;
-   *   }, function(reason) {
-   *     // error: handle the error if possible and
-   *     //        resolve promiseB with newPromiseOrValue,
-   *     //        otherwise forward the rejection to promiseB
-   *     if (canHandle(reason)) {
-   *      // handle the error and recover
-   *      return newPromiseOrValue;
-   *     }
-   *     return $q.reject(reason);
-   *   });
-   * ```
-   *
-   * @param {*} reason Constant, message, exception or an object representing the rejection reason.
-   * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.
-   */
-  var reject = function(reason) {
-    var result = new Deferred();
-    result.reject(reason);
-    return result.promise;
-  };
-
-  var makePromise = function makePromise(value, resolved) {
-    var result = new Deferred();
-    if (resolved) {
-      result.resolve(value);
-    } else {
-      result.reject(value);
-    }
-    return result.promise;
-  };
-
-  var handleCallback = function handleCallback(value, isResolved, callback) {
-    var callbackOutput = null;
-    try {
-      if (isFunction(callback)) callbackOutput = callback();
-    } catch (e) {
-      return makePromise(e, false);
-    }
-    if (isPromiseLike(callbackOutput)) {
-      return callbackOutput.then(function() {
-        return makePromise(value, isResolved);
-      }, function(error) {
-        return makePromise(error, false);
-      });
-    } else {
-      return makePromise(value, isResolved);
-    }
-  };
-
-  /**
-   * @ngdoc method
-   * @name $q#when
-   * @kind function
-   *
-   * @description
-   * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.
-   * This is useful when you are dealing with an object that might or might not be a promise, or if
-   * the promise comes from a source that can't be trusted.
-   *
-   * @param {*} value Value or a promise
-   * @param {Function=} successCallback
-   * @param {Function=} errorCallback
-   * @param {Function=} progressCallback
-   * @returns {Promise} Returns a promise of the passed value or promise
-   */
-
-
-  var when = function(value, callback, errback, progressBack) {
-    var result = new Deferred();
-    result.resolve(value);
-    return result.promise.then(callback, errback, progressBack);
-  };
-
-  /**
-   * @ngdoc method
-   * @name $q#resolve
-   * @kind function
-   *
-   * @description
-   * Alias of {@link ng.$q#when when} to maintain naming consistency with ES6.
-   *
-   * @param {*} value Value or a promise
-   * @param {Function=} successCallback
-   * @param {Function=} errorCallback
-   * @param {Function=} progressCallback
-   * @returns {Promise} Returns a promise of the passed value or promise
-   */
-  var resolve = when;
-
-  /**
-   * @ngdoc method
-   * @name $q#all
-   * @kind function
-   *
-   * @description
-   * Combines multiple promises into a single promise that is resolved when all of the input
-   * promises are resolved.
-   *
-   * @param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
-   * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values,
-   *   each value corresponding to the promise at the same index/key in the `promises` array/hash.
-   *   If any of the promises is resolved with a rejection, this resulting promise will be rejected
-   *   with the same rejection value.
-   */
-
-  function all(promises) {
-    var deferred = new Deferred(),
-        counter = 0,
-        results = isArray(promises) ? [] : {};
-
-    forEach(promises, function(promise, key) {
-      counter++;
-      when(promise).then(function(value) {
-        if (results.hasOwnProperty(key)) return;
-        results[key] = value;
-        if (!(--counter)) deferred.resolve(results);
-      }, function(reason) {
-        if (results.hasOwnProperty(key)) return;
-        deferred.reject(reason);
-      });
-    });
-
-    if (counter === 0) {
-      deferred.resolve(results);
-    }
-
-    return deferred.promise;
-  }
-
-  var $Q = function Q(resolver) {
-    if (!isFunction(resolver)) {
-      throw $qMinErr('norslvr', "Expected resolverFn, got '{0}'", resolver);
-    }
-
-    if (!(this instanceof Q)) {
-      // More useful when $Q is the Promise itself.
-      return new Q(resolver);
-    }
-
-    var deferred = new Deferred();
-
-    function resolveFn(value) {
-      deferred.resolve(value);
-    }
-
-    function rejectFn(reason) {
-      deferred.reject(reason);
-    }
-
-    resolver(resolveFn, rejectFn);
-
-    return deferred.promise;
-  };
-
-  $Q.defer = defer;
-  $Q.reject = reject;
-  $Q.when = when;
-  $Q.resolve = resolve;
-  $Q.all = all;
-
-  return $Q;
-}
-
-function $$RAFProvider() { //rAF
-  this.$get = ['$window', '$timeout', function($window, $timeout) {
-    var requestAnimationFrame = $window.requestAnimationFrame ||
-                                $window.webkitRequestAnimationFrame;
-
-    var cancelAnimationFrame = $window.cancelAnimationFrame ||
-                               $window.webkitCancelAnimationFrame ||
-                               $window.webkitCancelRequestAnimationFrame;
-
-    var rafSupported = !!requestAnimationFrame;
-    var raf = rafSupported
-      ? function(fn) {
-          var id = requestAnimationFrame(fn);
-          return function() {
-            cancelAnimationFrame(id);
-          };
-        }
-      : function(fn) {
-          var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666
-          return function() {
-            $timeout.cancel(timer);
-          };
-        };
-
-    raf.supported = rafSupported;
-
-    return raf;
-  }];
-}
-
-/**
- * DESIGN NOTES
- *
- * The design decisions behind the scope are heavily favored for speed and memory consumption.
- *
- * The typical use of scope is to watch the expressions, which most of the time return the same
- * value as last time so we optimize the operation.
- *
- * Closures construction is expensive in terms of speed as well as memory:
- *   - No closures, instead use prototypical inheritance for API
- *   - Internal state needs to be stored on scope directly, which means that private state is
- *     exposed as $$____ properties
- *
- * Loop operations are optimized by using while(count--) { ... }
- *   - this means that in order to keep the same order of execution as addition we have to add
- *     items to the array at the beginning (unshift) instead of at the end (push)
- *
- * Child scopes are created and removed often
- *   - Using an array would be slow since inserts in middle are expensive so we use linked list
- *
- * There are few watches then a lot of observers. This is why you don't want the observer to be
- * implemented in the same way as watch. Watch requires return of initialization function which
- * are expensive to construct.
- */
-
-
-/**
- * @ngdoc provider
- * @name $rootScopeProvider
- * @description
- *
- * Provider for the $rootScope service.
- */
-
-/**
- * @ngdoc method
- * @name $rootScopeProvider#digestTtl
- * @description
- *
- * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and
- * assuming that the model is unstable.
- *
- * The current default is 10 iterations.
- *
- * In complex applications it's possible that the dependencies between `$watch`s will result in
- * several digest iterations. However if an application needs more than the default 10 digest
- * iterations for its model to stabilize then you should investigate what is causing the model to
- * continuously change during the digest.
- *
- * Increasing the TTL could have performance implications, so you should not change it without
- * proper justification.
- *
- * @param {number} limit The number of digest iterations.
- */
-
-
-/**
- * @ngdoc service
- * @name $rootScope
- * @description
- *
- * Every application has a single root {@link ng.$rootScope.Scope scope}.
- * All other scopes are descendant scopes of the root scope. Scopes provide separation
- * between the model and the view, via a mechanism for watching the model for changes.
- * They also provide an event emission/broadcast and subscription facility. See the
- * {@link guide/scope developer guide on scopes}.
- */
-function $RootScopeProvider() {
-  var TTL = 10;
-  var $rootScopeMinErr = minErr('$rootScope');
-  var lastDirtyWatch = null;
-  var applyAsyncId = null;
-
-  this.digestTtl = function(value) {
-    if (arguments.length) {
-      TTL = value;
-    }
-    return TTL;
-  };
-
-  function createChildScopeClass(parent) {
-    function ChildScope() {
-      this.$$watchers = this.$$nextSibling =
-          this.$$childHead = this.$$childTail = null;
-      this.$$listeners = {};
-      this.$$listenerCount = {};
-      this.$$watchersCount = 0;
-      this.$id = nextUid();
-      this.$$ChildScope = null;
-    }
-    ChildScope.prototype = parent;
-    return ChildScope;
-  }
-
-  this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser',
-      function($injector, $exceptionHandler, $parse, $browser) {
-
-    function destroyChildScope($event) {
-        $event.currentScope.$$destroyed = true;
-    }
-
-    /**
-     * @ngdoc type
-     * @name $rootScope.Scope
-     *
-     * @description
-     * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the
-     * {@link auto.$injector $injector}. Child scopes are created using the
-     * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when
-     * compiled HTML template is executed.) See also the {@link guide/scope Scopes guide} for
-     * an in-depth introduction and usage examples.
-     *
-     *
-     * # Inheritance
-     * A scope can inherit from a parent scope, as in this example:
-     * ```js
-         var parent = $rootScope;
-         var child = parent.$new();
-
-         parent.salutation = "Hello";
-         expect(child.salutation).toEqual('Hello');
-
-         child.salutation = "Welcome";
-         expect(child.salutation).toEqual('Welcome');
-         expect(parent.salutation).toEqual('Hello');
-     * ```
-     *
-     * When interacting with `Scope` in tests, additional helper methods are available on the
-     * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional
-     * details.
-     *
-     *
-     * @param {Object.<string, function()>=} providers Map of service factory which need to be
-     *                                       provided for the current scope. Defaults to {@link ng}.
-     * @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should
-     *                              append/override services provided by `providers`. This is handy
-     *                              when unit-testing and having the need to override a default
-     *                              service.
-     * @returns {Object} Newly created scope.
-     *
-     */
-    function Scope() {
-      this.$id = nextUid();
-      this.$$phase = this.$parent = this.$$watchers =
-                     this.$$nextSibling = this.$$prevSibling =
-                     this.$$childHead = this.$$childTail = null;
-      this.$root = this;
-      this.$$destroyed = false;
-      this.$$listeners = {};
-      this.$$listenerCount = {};
-      this.$$watchersCount = 0;
-      this.$$isolateBindings = null;
-    }
-
-    /**
-     * @ngdoc property
-     * @name $rootScope.Scope#$id
-     *
-     * @description
-     * Unique scope ID (monotonically increasing) useful for debugging.
-     */
-
-     /**
-      * @ngdoc property
-      * @name $rootScope.Scope#$parent
-      *
-      * @description
-      * Reference to the parent scope.
-      */
-
-      /**
-       * @ngdoc property
-       * @name $rootScope.Scope#$root
-       *
-       * @description
-       * Reference to the root scope.
-       */
-
-    Scope.prototype = {
-      constructor: Scope,
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$new
-       * @kind function
-       *
-       * @description
-       * Creates a new child {@link ng.$rootScope.Scope scope}.
-       *
-       * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event.
-       * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.
-       *
-       * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is
-       * desired for the scope and its child scopes to be permanently detached from the parent and
-       * thus stop participating in model change detection and listener notification by invoking.
-       *
-       * @param {boolean} isolate If true, then the scope does not prototypically inherit from the
-       *         parent scope. The scope is isolated, as it can not see parent scope properties.
-       *         When creating widgets, it is useful for the widget to not accidentally read parent
-       *         state.
-       *
-       * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent`
-       *                              of the newly created scope. Defaults to `this` scope if not provided.
-       *                              This is used when creating a transclude scope to correctly place it
-       *                              in the scope hierarchy while maintaining the correct prototypical
-       *                              inheritance.
-       *
-       * @returns {Object} The newly created child scope.
-       *
-       */
-      $new: function(isolate, parent) {
-        var child;
-
-        parent = parent || this;
-
-        if (isolate) {
-          child = new Scope();
-          child.$root = this.$root;
-        } else {
-          // Only create a child scope class if somebody asks for one,
-          // but cache it to allow the VM to optimize lookups.
-          if (!this.$$ChildScope) {
-            this.$$ChildScope = createChildScopeClass(this);
-          }
-          child = new this.$$ChildScope();
-        }
-        child.$parent = parent;
-        child.$$prevSibling = parent.$$childTail;
-        if (parent.$$childHead) {
-          parent.$$childTail.$$nextSibling = child;
-          parent.$$childTail = child;
-        } else {
-          parent.$$childHead = parent.$$childTail = child;
-        }
-
-        // When the new scope is not isolated or we inherit from `this`, and
-        // the parent scope is destroyed, the property `$$destroyed` is inherited
-        // prototypically. In all other cases, this property needs to be set
-        // when the parent scope is destroyed.
-        // The listener needs to be added after the parent is set
-        if (isolate || parent != this) child.$on('$destroy', destroyChildScope);
-
-        return child;
-      },
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$watch
-       * @kind function
-       *
-       * @description
-       * Registers a `listener` callback to be executed whenever the `watchExpression` changes.
-       *
-       * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest
-       *   $digest()} and should return the value that will be watched. (`watchExpression` should not change
-       *   its value when executed multiple times with the same input because it may be executed multiple
-       *   times by {@link ng.$rootScope.Scope#$digest $digest()}. That is, `watchExpression` should be
-       *   [idempotent](http://en.wikipedia.org/wiki/Idempotence).
-       * - The `listener` is called only when the value from the current `watchExpression` and the
-       *   previous call to `watchExpression` are not equal (with the exception of the initial run,
-       *   see below). Inequality is determined according to reference inequality,
-       *   [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)
-       *    via the `!==` Javascript operator, unless `objectEquality == true`
-       *   (see next point)
-       * - When `objectEquality == true`, inequality of the `watchExpression` is determined
-       *   according to the {@link angular.equals} function. To save the value of the object for
-       *   later comparison, the {@link angular.copy} function is used. This therefore means that
-       *   watching complex objects will have adverse memory and performance implications.
-       * - The watch `listener` may change the model, which may trigger other `listener`s to fire.
-       *   This is achieved by rerunning the watchers until no changes are detected. The rerun
-       *   iteration limit is 10 to prevent an infinite loop deadlock.
-       *
-       *
-       * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,
-       * you can register a `watchExpression` function with no `listener`. (Be prepared for
-       * multiple calls to your `watchExpression` because it will execute multiple times in a
-       * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.)
-       *
-       * After a watcher is registered with the scope, the `listener` fn is called asynchronously
-       * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the
-       * watcher. In rare cases, this is undesirable because the listener is called when the result
-       * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you
-       * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the
-       * listener was called due to initialization.
-       *
-       *
-       *
-       * # Example
-       * ```js
-           // let's assume that scope was dependency injected as the $rootScope
-           var scope = $rootScope;
-           scope.name = 'misko';
-           scope.counter = 0;
-
-           expect(scope.counter).toEqual(0);
-           scope.$watch('name', function(newValue, oldValue) {
-             scope.counter = scope.counter + 1;
-           });
-           expect(scope.counter).toEqual(0);
-
-           scope.$digest();
-           // the listener is always called during the first $digest loop after it was registered
-           expect(scope.counter).toEqual(1);
-
-           scope.$digest();
-           // but now it will not be called unless the value changes
-           expect(scope.counter).toEqual(1);
-
-           scope.name = 'adam';
-           scope.$digest();
-           expect(scope.counter).toEqual(2);
-
-
-
-           // Using a function as a watchExpression
-           var food;
-           scope.foodCounter = 0;
-           expect(scope.foodCounter).toEqual(0);
-           scope.$watch(
-             // This function returns the value being watched. It is called for each turn of the $digest loop
-             function() { return food; },
-             // This is the change listener, called when the value returned from the above function changes
-             function(newValue, oldValue) {
-               if ( newValue !== oldValue ) {
-                 // Only increment the counter if the value changed
-                 scope.foodCounter = scope.foodCounter + 1;
-               }
-             }
-           );
-           // No digest has been run so the counter will be zero
-           expect(scope.foodCounter).toEqual(0);
-
-           // Run the digest but since food has not changed count will still be zero
-           scope.$digest();
-           expect(scope.foodCounter).toEqual(0);
-
-           // Update food and run digest.  Now the counter will increment
-           food = 'cheeseburger';
-           scope.$digest();
-           expect(scope.foodCounter).toEqual(1);
-
-       * ```
-       *
-       *
-       *
-       * @param {(function()|string)} watchExpression Expression that is evaluated on each
-       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers
-       *    a call to the `listener`.
-       *
-       *    - `string`: Evaluated as {@link guide/expression expression}
-       *    - `function(scope)`: called with current `scope` as a parameter.
-       * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value
-       *    of `watchExpression` changes.
-       *
-       *    - `newVal` contains the current value of the `watchExpression`
-       *    - `oldVal` contains the previous value of the `watchExpression`
-       *    - `scope` refers to the current scope
-       * @param {boolean=} objectEquality Compare for object equality using {@link angular.equals} instead of
-       *     comparing for reference equality.
-       * @returns {function()} Returns a deregistration function for this listener.
-       */
-      $watch: function(watchExp, listener, objectEquality, prettyPrintExpression) {
-        var get = $parse(watchExp);
-
-        if (get.$$watchDelegate) {
-          return get.$$watchDelegate(this, listener, objectEquality, get, watchExp);
-        }
-        var scope = this,
-            array = scope.$$watchers,
-            watcher = {
-              fn: listener,
-              last: initWatchVal,
-              get: get,
-              exp: prettyPrintExpression || watchExp,
-              eq: !!objectEquality
-            };
-
-        lastDirtyWatch = null;
-
-        if (!isFunction(listener)) {
-          watcher.fn = noop;
-        }
-
-        if (!array) {
-          array = scope.$$watchers = [];
-        }
-        // we use unshift since we use a while loop in $digest for speed.
-        // the while loop reads in reverse order.
-        array.unshift(watcher);
-        incrementWatchersCount(this, 1);
-
-        return function deregisterWatch() {
-          if (arrayRemove(array, watcher) >= 0) {
-            incrementWatchersCount(scope, -1);
-          }
-          lastDirtyWatch = null;
-        };
-      },
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$watchGroup
-       * @kind function
-       *
-       * @description
-       * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.
-       * If any one expression in the collection changes the `listener` is executed.
-       *
-       * - The items in the `watchExpressions` array are observed via standard $watch operation and are examined on every
-       *   call to $digest() to see if any items changes.
-       * - The `listener` is called whenever any expression in the `watchExpressions` array changes.
-       *
-       * @param {Array.<string|Function(scope)>} watchExpressions Array of expressions that will be individually
-       * watched using {@link ng.$rootScope.Scope#$watch $watch()}
-       *
-       * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any
-       *    expression in `watchExpressions` changes
-       *    The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching
-       *    those of `watchExpression`
-       *    and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching
-       *    those of `watchExpression`
-       *    The `scope` refers to the current scope.
-       * @returns {function()} Returns a de-registration function for all listeners.
-       */
-      $watchGroup: function(watchExpressions, listener) {
-        var oldValues = new Array(watchExpressions.length);
-        var newValues = new Array(watchExpressions.length);
-        var deregisterFns = [];
-        var self = this;
-        var changeReactionScheduled = false;
-        var firstRun = true;
-
-        if (!watchExpressions.length) {
-          // No expressions means we call the listener ASAP
-          var shouldCall = true;
-          self.$evalAsync(function() {
-            if (shouldCall) listener(newValues, newValues, self);
-          });
-          return function deregisterWatchGroup() {
-            shouldCall = false;
-          };
-        }
-
-        if (watchExpressions.length === 1) {
-          // Special case size of one
-          return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) {
-            newValues[0] = value;
-            oldValues[0] = oldValue;
-            listener(newValues, (value === oldValue) ? newValues : oldValues, scope);
-          });
-        }
-
-        forEach(watchExpressions, function(expr, i) {
-          var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) {
-            newValues[i] = value;
-            oldValues[i] = oldValue;
-            if (!changeReactionScheduled) {
-              changeReactionScheduled = true;
-              self.$evalAsync(watchGroupAction);
-            }
-          });
-          deregisterFns.push(unwatchFn);
-        });
-
-        function watchGroupAction() {
-          changeReactionScheduled = false;
-
-          if (firstRun) {
-            firstRun = false;
-            listener(newValues, newValues, self);
-          } else {
-            listener(newValues, oldValues, self);
-          }
-        }
-
-        return function deregisterWatchGroup() {
-          while (deregisterFns.length) {
-            deregisterFns.shift()();
-          }
-        };
-      },
-
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$watchCollection
-       * @kind function
-       *
-       * @description
-       * Shallow watches the properties of an object and fires whenever any of the properties change
-       * (for arrays, this implies watching the array items; for object maps, this implies watching
-       * the properties). If a change is detected, the `listener` callback is fired.
-       *
-       * - The `obj` collection is observed via standard $watch operation and is examined on every
-       *   call to $digest() to see if any items have been added, removed, or moved.
-       * - The `listener` is called whenever anything within the `obj` has changed. Examples include
-       *   adding, removing, and moving items belonging to an object or array.
-       *
-       *
-       * # Example
-       * ```js
-          $scope.names = ['igor', 'matias', 'misko', 'james'];
-          $scope.dataCount = 4;
-
-          $scope.$watchCollection('names', function(newNames, oldNames) {
-            $scope.dataCount = newNames.length;
-          });
-
-          expect($scope.dataCount).toEqual(4);
-          $scope.$digest();
-
-          //still at 4 ... no changes
-          expect($scope.dataCount).toEqual(4);
-
-          $scope.names.pop();
-          $scope.$digest();
-
-          //now there's been a change
-          expect($scope.dataCount).toEqual(3);
-       * ```
-       *
-       *
-       * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The
-       *    expression value should evaluate to an object or an array which is observed on each
-       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the
-       *    collection will trigger a call to the `listener`.
-       *
-       * @param {function(newCollection, oldCollection, scope)} listener a callback function called
-       *    when a change is detected.
-       *    - The `newCollection` object is the newly modified data obtained from the `obj` expression
-       *    - The `oldCollection` object is a copy of the former collection data.
-       *      Due to performance considerations, the`oldCollection` value is computed only if the
-       *      `listener` function declares two or more arguments.
-       *    - The `scope` argument refers to the current scope.
-       *
-       * @returns {function()} Returns a de-registration function for this listener. When the
-       *    de-registration function is executed, the internal watch operation is terminated.
-       */
-      $watchCollection: function(obj, listener) {
-        $watchCollectionInterceptor.$stateful = true;
-
-        var self = this;
-        // the current value, updated on each dirty-check run
-        var newValue;
-        // a shallow copy of the newValue from the last dirty-check run,
-        // updated to match newValue during dirty-check run
-        var oldValue;
-        // a shallow copy of the newValue from when the last change happened
-        var veryOldValue;
-        // only track veryOldValue if the listener is asking for it
-        var trackVeryOldValue = (listener.length > 1);
-        var changeDetected = 0;
-        var changeDetector = $parse(obj, $watchCollectionInterceptor);
-        var internalArray = [];
-        var internalObject = {};
-        var initRun = true;
-        var oldLength = 0;
-
-        function $watchCollectionInterceptor(_value) {
-          newValue = _value;
-          var newLength, key, bothNaN, newItem, oldItem;
-
-          // If the new value is undefined, then return undefined as the watch may be a one-time watch
-          if (isUndefined(newValue)) return;
-
-          if (!isObject(newValue)) { // if primitive
-            if (oldValue !== newValue) {
-              oldValue = newValue;
-              changeDetected++;
-            }
-          } else if (isArrayLike(newValue)) {
-            if (oldValue !== internalArray) {
-              // we are transitioning from something which was not an array into array.
-              oldValue = internalArray;
-              oldLength = oldValue.length = 0;
-              changeDetected++;
-            }
-
-            newLength = newValue.length;
-
-            if (oldLength !== newLength) {
-              // if lengths do not match we need to trigger change notification
-              changeDetected++;
-              oldValue.length = oldLength = newLength;
-            }
-            // copy the items to oldValue and look for changes.
-            for (var i = 0; i < newLength; i++) {
-              oldItem = oldValue[i];
-              newItem = newValue[i];
-
-              bothNaN = (oldItem !== oldItem) && (newItem !== newItem);
-              if (!bothNaN && (oldItem !== newItem)) {
-                changeDetected++;
-                oldValue[i] = newItem;
-              }
-            }
-          } else {
-            if (oldValue !== internalObject) {
-              // we are transitioning from something which was not an object into object.
-              oldValue = internalObject = {};
-              oldLength = 0;
-              changeDetected++;
-            }
-            // copy the items to oldValue and look for changes.
-            newLength = 0;
-            for (key in newValue) {
-              if (hasOwnProperty.call(newValue, key)) {
-                newLength++;
-                newItem = newValue[key];
-                oldItem = oldValue[key];
-
-                if (key in oldValue) {
-                  bothNaN = (oldItem !== oldItem) && (newItem !== newItem);
-                  if (!bothNaN && (oldItem !== newItem)) {
-                    changeDetected++;
-                    oldValue[key] = newItem;
-                  }
-                } else {
-                  oldLength++;
-                  oldValue[key] = newItem;
-                  changeDetected++;
-                }
-              }
-            }
-            if (oldLength > newLength) {
-              // we used to have more keys, need to find them and destroy them.
-              changeDetected++;
-              for (key in oldValue) {
-                if (!hasOwnProperty.call(newValue, key)) {
-                  oldLength--;
-                  delete oldValue[key];
-                }
-              }
-            }
-          }
-          return changeDetected;
-        }
-
-        function $watchCollectionAction() {
-          if (initRun) {
-            initRun = false;
-            listener(newValue, newValue, self);
-          } else {
-            listener(newValue, veryOldValue, self);
-          }
-
-          // make a copy for the next time a collection is changed
-          if (trackVeryOldValue) {
-            if (!isObject(newValue)) {
-              //primitive
-              veryOldValue = newValue;
-            } else if (isArrayLike(newValue)) {
-              veryOldValue = new Array(newValue.length);
-              for (var i = 0; i < newValue.length; i++) {
-                veryOldValue[i] = newValue[i];
-              }
-            } else { // if object
-              veryOldValue = {};
-              for (var key in newValue) {
-                if (hasOwnProperty.call(newValue, key)) {
-                  veryOldValue[key] = newValue[key];
-                }
-              }
-            }
-          }
-        }
-
-        return this.$watch(changeDetector, $watchCollectionAction);
-      },
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$digest
-       * @kind function
-       *
-       * @description
-       * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and
-       * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change
-       * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}
-       * until no more listeners are firing. This means that it is possible to get into an infinite
-       * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of
-       * iterations exceeds 10.
-       *
-       * Usually, you don't call `$digest()` directly in
-       * {@link ng.directive:ngController controllers} or in
-       * {@link ng.$compileProvider#directive directives}.
-       * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within
-       * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`.
-       *
-       * If you want to be notified whenever `$digest()` is called,
-       * you can register a `watchExpression` function with
-       * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.
-       *
-       * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.
-       *
-       * # Example
-       * ```js
-           var scope = ...;
-           scope.name = 'misko';
-           scope.counter = 0;
-
-           expect(scope.counter).toEqual(0);
-           scope.$watch('name', function(newValue, oldValue) {
-             scope.counter = scope.counter + 1;
-           });
-           expect(scope.counter).toEqual(0);
-
-           scope.$digest();
-           // the listener is always called during the first $digest loop after it was registered
-           expect(scope.counter).toEqual(1);
-
-           scope.$digest();
-           // but now it will not be called unless the value changes
-           expect(scope.counter).toEqual(1);
-
-           scope.name = 'adam';
-           scope.$digest();
-           expect(scope.counter).toEqual(2);
-       * ```
-       *
-       */
-      $digest: function() {
-        var watch, value, last,
-            watchers,
-            length,
-            dirty, ttl = TTL,
-            next, current, target = this,
-            watchLog = [],
-            logIdx, logMsg, asyncTask;
-
-        beginPhase('$digest');
-        // Check for changes to browser url that happened in sync before the call to $digest
-        $browser.$$checkUrlChange();
-
-        if (this === $rootScope && applyAsyncId !== null) {
-          // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then
-          // cancel the scheduled $apply and flush the queue of expressions to be evaluated.
-          $browser.defer.cancel(applyAsyncId);
-          flushApplyAsync();
-        }
-
-        lastDirtyWatch = null;
-
-        do { // "while dirty" loop
-          dirty = false;
-          current = target;
-
-          while (asyncQueue.length) {
-            try {
-              asyncTask = asyncQueue.shift();
-              asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals);
-            } catch (e) {
-              $exceptionHandler(e);
-            }
-            lastDirtyWatch = null;
-          }
-
-          traverseScopesLoop:
-          do { // "traverse the scopes" loop
-            if ((watchers = current.$$watchers)) {
-              // process our watches
-              length = watchers.length;
-              while (length--) {
-                try {
-                  watch = watchers[length];
-                  // Most common watches are on primitives, in which case we can short
-                  // circuit it with === operator, only when === fails do we use .equals
-                  if (watch) {
-                    if ((value = watch.get(current)) !== (last = watch.last) &&
-                        !(watch.eq
-                            ? equals(value, last)
-                            : (typeof value === 'number' && typeof last === 'number'
-                               && isNaN(value) && isNaN(last)))) {
-                      dirty = true;
-                      lastDirtyWatch = watch;
-                      watch.last = watch.eq ? copy(value, null) : value;
-                      watch.fn(value, ((last === initWatchVal) ? value : last), current);
-                      if (ttl < 5) {
-                        logIdx = 4 - ttl;
-                        if (!watchLog[logIdx]) watchLog[logIdx] = [];
-                        watchLog[logIdx].push({
-                          msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp,
-                          newVal: value,
-                          oldVal: last
-                        });
-                      }
-                    } else if (watch === lastDirtyWatch) {
-                      // If the most recently dirty watcher is now clean, short circuit since the remaining watchers
-                      // have already been tested.
-                      dirty = false;
-                      break traverseScopesLoop;
-                    }
-                  }
-                } catch (e) {
-                  $exceptionHandler(e);
-                }
-              }
-            }
-
-            // Insanity Warning: scope depth-first traversal
-            // yes, this code is a bit crazy, but it works and we have tests to prove it!
-            // this piece should be kept in sync with the traversal in $broadcast
-            if (!(next = ((current.$$watchersCount && current.$$childHead) ||
-                (current !== target && current.$$nextSibling)))) {
-              while (current !== target && !(next = current.$$nextSibling)) {
-                current = current.$parent;
-              }
-            }
-          } while ((current = next));
-
-          // `break traverseScopesLoop;` takes us to here
-
-          if ((dirty || asyncQueue.length) && !(ttl--)) {
-            clearPhase();
-            throw $rootScopeMinErr('infdig',
-                '{0} $digest() iterations reached. Aborting!\n' +
-                'Watchers fired in the last 5 iterations: {1}',
-                TTL, watchLog);
-          }
-
-        } while (dirty || asyncQueue.length);
-
-        clearPhase();
-
-        while (postDigestQueue.length) {
-          try {
-            postDigestQueue.shift()();
-          } catch (e) {
-            $exceptionHandler(e);
-          }
-        }
-      },
-
-
-      /**
-       * @ngdoc event
-       * @name $rootScope.Scope#$destroy
-       * @eventType broadcast on scope being destroyed
-       *
-       * @description
-       * Broadcasted when a scope and its children are being destroyed.
-       *
-       * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
-       * clean up DOM bindings before an element is removed from the DOM.
-       */
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$destroy
-       * @kind function
-       *
-       * @description
-       * Removes the current scope (and all of its children) from the parent scope. Removal implies
-       * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer
-       * propagate to the current scope and its children. Removal also implies that the current
-       * scope is eligible for garbage collection.
-       *
-       * The `$destroy()` is usually used by directives such as
-       * {@link ng.directive:ngRepeat ngRepeat} for managing the
-       * unrolling of the loop.
-       *
-       * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.
-       * Application code can register a `$destroy` event handler that will give it a chance to
-       * perform any necessary cleanup.
-       *
-       * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
-       * clean up DOM bindings before an element is removed from the DOM.
-       */
-      $destroy: function() {
-        // We can't destroy a scope that has been already destroyed.
-        if (this.$$destroyed) return;
-        var parent = this.$parent;
-
-        this.$broadcast('$destroy');
-        this.$$destroyed = true;
-
-        if (this === $rootScope) {
-          //Remove handlers attached to window when $rootScope is removed
-          $browser.$$applicationDestroyed();
-        }
-
-        incrementWatchersCount(this, -this.$$watchersCount);
-        for (var eventName in this.$$listenerCount) {
-          decrementListenerCount(this, this.$$listenerCount[eventName], eventName);
-        }
-
-        // sever all the references to parent scopes (after this cleanup, the current scope should
-        // not be retained by any of our references and should be eligible for garbage collection)
-        if (parent && parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;
-        if (parent && parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;
-        if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;
-        if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;
-
-        // Disable listeners, watchers and apply/digest methods
-        this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;
-        this.$on = this.$watch = this.$watchGroup = function() { return noop; };
-        this.$$listeners = {};
-
-        // All of the code below is bogus code that works around V8's memory leak via optimized code
-        // and inline caches.
-        //
-        // see:
-        // - https://code.google.com/p/v8/issues/detail?id=2073#c26
-        // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909
-        // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451
-
-        this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead =
-            this.$$childTail = this.$root = this.$$watchers = null;
-      },
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$eval
-       * @kind function
-       *
-       * @description
-       * Executes the `expression` on the current scope and returns the result. Any exceptions in
-       * the expression are propagated (uncaught). This is useful when evaluating Angular
-       * expressions.
-       *
-       * # Example
-       * ```js
-           var scope = ng.$rootScope.Scope();
-           scope.a = 1;
-           scope.b = 2;
-
-           expect(scope.$eval('a+b')).toEqual(3);
-           expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);
-       * ```
-       *
-       * @param {(string|function())=} expression An angular expression to be executed.
-       *
-       *    - `string`: execute using the rules as defined in  {@link guide/expression expression}.
-       *    - `function(scope)`: execute the function with the current `scope` parameter.
-       *
-       * @param {(object)=} locals Local variables object, useful for overriding values in scope.
-       * @returns {*} The result of evaluating the expression.
-       */
-      $eval: function(expr, locals) {
-        return $parse(expr)(this, locals);
-      },
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$evalAsync
-       * @kind function
-       *
-       * @description
-       * Executes the expression on the current scope at a later point in time.
-       *
-       * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only
-       * that:
-       *
-       *   - it will execute after the function that scheduled the evaluation (preferably before DOM
-       *     rendering).
-       *   - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after
-       *     `expression` execution.
-       *
-       * Any exceptions from the execution of the expression are forwarded to the
-       * {@link ng.$exceptionHandler $exceptionHandler} service.
-       *
-       * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle
-       * will be scheduled. However, it is encouraged to always call code that changes the model
-       * from within an `$apply` call. That includes code evaluated via `$evalAsync`.
-       *
-       * @param {(string|function())=} expression An angular expression to be executed.
-       *
-       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.
-       *    - `function(scope)`: execute the function with the current `scope` parameter.
-       *
-       * @param {(object)=} locals Local variables object, useful for overriding values in scope.
-       */
-      $evalAsync: function(expr, locals) {
-        // if we are outside of an $digest loop and this is the first time we are scheduling async
-        // task also schedule async auto-flush
-        if (!$rootScope.$$phase && !asyncQueue.length) {
-          $browser.defer(function() {
-            if (asyncQueue.length) {
-              $rootScope.$digest();
-            }
-          });
-        }
-
-        asyncQueue.push({scope: this, expression: expr, locals: locals});
-      },
-
-      $$postDigest: function(fn) {
-        postDigestQueue.push(fn);
-      },
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$apply
-       * @kind function
-       *
-       * @description
-       * `$apply()` is used to execute an expression in angular from outside of the angular
-       * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).
-       * Because we are calling into the angular framework we need to perform proper scope life
-       * cycle of {@link ng.$exceptionHandler exception handling},
-       * {@link ng.$rootScope.Scope#$digest executing watches}.
-       *
-       * ## Life cycle
-       *
-       * # Pseudo-Code of `$apply()`
-       * ```js
-           function $apply(expr) {
-             try {
-               return $eval(expr);
-             } catch (e) {
-               $exceptionHandler(e);
-             } finally {
-               $root.$digest();
-             }
-           }
-       * ```
-       *
-       *
-       * Scope's `$apply()` method transitions through the following stages:
-       *
-       * 1. The {@link guide/expression expression} is executed using the
-       *    {@link ng.$rootScope.Scope#$eval $eval()} method.
-       * 2. Any exceptions from the execution of the expression are forwarded to the
-       *    {@link ng.$exceptionHandler $exceptionHandler} service.
-       * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the
-       *    expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.
-       *
-       *
-       * @param {(string|function())=} exp An angular expression to be executed.
-       *
-       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.
-       *    - `function(scope)`: execute the function with current `scope` parameter.
-       *
-       * @returns {*} The result of evaluating the expression.
-       */
-      $apply: function(expr) {
-        try {
-          beginPhase('$apply');
-          try {
-            return this.$eval(expr);
-          } finally {
-            clearPhase();
-          }
-        } catch (e) {
-          $exceptionHandler(e);
-        } finally {
-          try {
-            $rootScope.$digest();
-          } catch (e) {
-            $exceptionHandler(e);
-            throw e;
-          }
-        }
-      },
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$applyAsync
-       * @kind function
-       *
-       * @description
-       * Schedule the invocation of $apply to occur at a later time. The actual time difference
-       * varies across browsers, but is typically around ~10 milliseconds.
-       *
-       * This can be used to queue up multiple expressions which need to be evaluated in the same
-       * digest.
-       *
-       * @param {(string|function())=} exp An angular expression to be executed.
-       *
-       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.
-       *    - `function(scope)`: execute the function with current `scope` parameter.
-       */
-      $applyAsync: function(expr) {
-        var scope = this;
-        expr && applyAsyncQueue.push($applyAsyncExpression);
-        scheduleApplyAsync();
-
-        function $applyAsyncExpression() {
-          scope.$eval(expr);
-        }
-      },
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$on
-       * @kind function
-       *
-       * @description
-       * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for
-       * discussion of event life cycle.
-       *
-       * The event listener function format is: `function(event, args...)`. The `event` object
-       * passed into the listener has the following attributes:
-       *
-       *   - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or
-       *     `$broadcast`-ed.
-       *   - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the
-       *     event propagates through the scope hierarchy, this property is set to null.
-       *   - `name` - `{string}`: name of the event.
-       *   - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel
-       *     further event propagation (available only for events that were `$emit`-ed).
-       *   - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag
-       *     to true.
-       *   - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.
-       *
-       * @param {string} name Event name to listen on.
-       * @param {function(event, ...args)} listener Function to call when the event is emitted.
-       * @returns {function()} Returns a deregistration function for this listener.
-       */
-      $on: function(name, listener) {
-        var namedListeners = this.$$listeners[name];
-        if (!namedListeners) {
-          this.$$listeners[name] = namedListeners = [];
-        }
-        namedListeners.push(listener);
-
-        var current = this;
-        do {
-          if (!current.$$listenerCount[name]) {
-            current.$$listenerCount[name] = 0;
-          }
-          current.$$listenerCount[name]++;
-        } while ((current = current.$parent));
-
-        var self = this;
-        return function() {
-          var indexOfListener = namedListeners.indexOf(listener);
-          if (indexOfListener !== -1) {
-            namedListeners[indexOfListener] = null;
-            decrementListenerCount(self, 1, name);
-          }
-        };
-      },
-
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$emit
-       * @kind function
-       *
-       * @description
-       * Dispatches an event `name` upwards through the scope hierarchy notifying the
-       * registered {@link ng.$rootScope.Scope#$on} listeners.
-       *
-       * The event life cycle starts at the scope on which `$emit` was called. All
-       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get
-       * notified. Afterwards, the event traverses upwards toward the root scope and calls all
-       * registered listeners along the way. The event will stop propagating if one of the listeners
-       * cancels it.
-       *
-       * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed
-       * onto the {@link ng.$exceptionHandler $exceptionHandler} service.
-       *
-       * @param {string} name Event name to emit.
-       * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.
-       * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).
-       */
-      $emit: function(name, args) {
-        var empty = [],
-            namedListeners,
-            scope = this,
-            stopPropagation = false,
-            event = {
-              name: name,
-              targetScope: scope,
-              stopPropagation: function() {stopPropagation = true;},
-              preventDefault: function() {
-                event.defaultPrevented = true;
-              },
-              defaultPrevented: false
-            },
-            listenerArgs = concat([event], arguments, 1),
-            i, length;
-
-        do {
-          namedListeners = scope.$$listeners[name] || empty;
-          event.currentScope = scope;
-          for (i = 0, length = namedListeners.length; i < length; i++) {
-
-            // if listeners were deregistered, defragment the array
-            if (!namedListeners[i]) {
-              namedListeners.splice(i, 1);
-              i--;
-              length--;
-              continue;
-            }
-            try {
-              //allow all listeners attached to the current scope to run
-              namedListeners[i].apply(null, listenerArgs);
-            } catch (e) {
-              $exceptionHandler(e);
-            }
-          }
-          //if any listener on the current scope stops propagation, prevent bubbling
-          if (stopPropagation) {
-            event.currentScope = null;
-            return event;
-          }
-          //traverse upwards
-          scope = scope.$parent;
-        } while (scope);
-
-        event.currentScope = null;
-
-        return event;
-      },
-
-
-      /**
-       * @ngdoc method
-       * @name $rootScope.Scope#$broadcast
-       * @kind function
-       *
-       * @description
-       * Dispatches an event `name` downwards to all child scopes (and their children) notifying the
-       * registered {@link ng.$rootScope.Scope#$on} listeners.
-       *
-       * The event life cycle starts at the scope on which `$broadcast` was called. All
-       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get
-       * notified. Afterwards, the event propagates to all direct and indirect scopes of the current
-       * scope and calls all registered listeners along the way. The event cannot be canceled.
-       *
-       * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed
-       * onto the {@link ng.$exceptionHandler $exceptionHandler} service.
-       *
-       * @param {string} name Event name to broadcast.
-       * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.
-       * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}
-       */
-      $broadcast: function(name, args) {
-        var target = this,
-            current = target,
-            next = target,
-            event = {
-              name: name,
-              targetScope: target,
-              preventDefault: function() {
-                event.defaultPrevented = true;
-              },
-              defaultPrevented: false
-            };
-
-        if (!target.$$listenerCount[name]) return event;
-
-        var listenerArgs = concat([event], arguments, 1),
-            listeners, i, length;
-
-        //down while you can, then up and next sibling or up and next sibling until back at root
-        while ((current = next)) {
-          event.currentScope = current;
-          listeners = current.$$listeners[name] || [];
-          for (i = 0, length = listeners.length; i < length; i++) {
-            // if listeners were deregistered, defragment the array
-            if (!listeners[i]) {
-              listeners.splice(i, 1);
-              i--;
-              length--;
-              continue;
-            }
-
-            try {
-              listeners[i].apply(null, listenerArgs);
-            } catch (e) {
-              $exceptionHandler(e);
-            }
-          }
-
-          // Insanity Warning: scope depth-first traversal
-          // yes, this code is a bit crazy, but it works and we have tests to prove it!
-          // this piece should be kept in sync with the traversal in $digest
-          // (though it differs due to having the extra check for $$listenerCount)
-          if (!(next = ((current.$$listenerCount[name] && current.$$childHead) ||
-              (current !== target && current.$$nextSibling)))) {
-            while (current !== target && !(next = current.$$nextSibling)) {
-              current = current.$parent;
-            }
-          }
-        }
-
-        event.currentScope = null;
-        return event;
-      }
-    };
-
-    var $rootScope = new Scope();
-
-    //The internal queues. Expose them on the $rootScope for debugging/testing purposes.
-    var asyncQueue = $rootScope.$$asyncQueue = [];
-    var postDigestQueue = $rootScope.$$postDigestQueue = [];
-    var applyAsyncQueue = $rootScope.$$applyAsyncQueue = [];
-
-    return $rootScope;
-
-
-    function beginPhase(phase) {
-      if ($rootScope.$$phase) {
-        throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase);
-      }
-
-      $rootScope.$$phase = phase;
-    }
-
-    function clearPhase() {
-      $rootScope.$$phase = null;
-    }
-
-    function incrementWatchersCount(current, count) {
-      do {
-        current.$$watchersCount += count;
-      } while ((current = current.$parent));
-    }
-
-    function decrementListenerCount(current, count, name) {
-      do {
-        current.$$listenerCount[name] -= count;
-
-        if (current.$$listenerCount[name] === 0) {
-          delete current.$$listenerCount[name];
-        }
-      } while ((current = current.$parent));
-    }
-
-    /**
-     * function used as an initial value for watchers.
-     * because it's unique we can easily tell it apart from other values
-     */
-    function initWatchVal() {}
-
-    function flushApplyAsync() {
-      while (applyAsyncQueue.length) {
-        try {
-          applyAsyncQueue.shift()();
-        } catch (e) {
-          $exceptionHandler(e);
-        }
-      }
-      applyAsyncId = null;
-    }
-
-    function scheduleApplyAsync() {
-      if (applyAsyncId === null) {
-        applyAsyncId = $browser.defer(function() {
-          $rootScope.$apply(flushApplyAsync);
-        });
-      }
-    }
-  }];
-}
-
-/**
- * @description
- * Private service to sanitize uris for links and images. Used by $compile and $sanitize.
- */
-function $$SanitizeUriProvider() {
-  var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/,
-    imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/;
-
-  /**
-   * @description
-   * Retrieves or overrides the default regular expression that is used for whitelisting of safe
-   * urls during a[href] sanitization.
-   *
-   * The sanitization is a security measure aimed at prevent XSS attacks via html links.
-   *
-   * Any url about to be assigned to a[href] via data-binding is first normalized and turned into
-   * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`
-   * regular expression. If a match is found, the original url is written into the dom. Otherwise,
-   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
-   *
-   * @param {RegExp=} regexp New regexp to whitelist urls with.
-   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
-   *    chaining otherwise.
-   */
-  this.aHrefSanitizationWhitelist = function(regexp) {
-    if (isDefined(regexp)) {
-      aHrefSanitizationWhitelist = regexp;
-      return this;
-    }
-    return aHrefSanitizationWhitelist;
-  };
-
-
-  /**
-   * @description
-   * Retrieves or overrides the default regular expression that is used for whitelisting of safe
-   * urls during img[src] sanitization.
-   *
-   * The sanitization is a security measure aimed at prevent XSS attacks via html links.
-   *
-   * Any url about to be assigned to img[src] via data-binding is first normalized and turned into
-   * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`
-   * regular expression. If a match is found, the original url is written into the dom. Otherwise,
-   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
-   *
-   * @param {RegExp=} regexp New regexp to whitelist urls with.
-   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
-   *    chaining otherwise.
-   */
-  this.imgSrcSanitizationWhitelist = function(regexp) {
-    if (isDefined(regexp)) {
-      imgSrcSanitizationWhitelist = regexp;
-      return this;
-    }
-    return imgSrcSanitizationWhitelist;
-  };
-
-  this.$get = function() {
-    return function sanitizeUri(uri, isImage) {
-      var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;
-      var normalizedVal;
-      normalizedVal = urlResolve(uri).href;
-      if (normalizedVal !== '' && !normalizedVal.match(regex)) {
-        return 'unsafe:' + normalizedVal;
-      }
-      return uri;
-    };
-  };
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *     Any commits to this file should be reviewed with security in mind.  *
- *   Changes to this file can potentially create security vulnerabilities. *
- *          An approval from 2 Core members with history of modifying      *
- *                         this file is required.                          *
- *                                                                         *
- *  Does the change somehow allow for arbitrary javascript to be executed? *
- *    Or allows for someone to change the prototype of built-in objects?   *
- *     Or gives undesired access to variables likes document or window?    *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-var $sceMinErr = minErr('$sce');
-
-var SCE_CONTEXTS = {
-  HTML: 'html',
-  CSS: 'css',
-  URL: 'url',
-  // RESOURCE_URL is a subtype of URL used in contexts where a privileged resource is sourced from a
-  // url.  (e.g. ng-include, script src, templateUrl)
-  RESOURCE_URL: 'resourceUrl',
-  JS: 'js'
-};
-
-// Helper functions follow.
-
-function adjustMatcher(matcher) {
-  if (matcher === 'self') {
-    return matcher;
-  } else if (isString(matcher)) {
-    // Strings match exactly except for 2 wildcards - '*' and '**'.
-    // '*' matches any character except those from the set ':/.?&'.
-    // '**' matches any character (like .* in a RegExp).
-    // More than 2 *'s raises an error as it's ill defined.
-    if (matcher.indexOf('***') > -1) {
-      throw $sceMinErr('iwcard',
-          'Illegal sequence *** in string matcher.  String: {0}', matcher);
-    }
-    matcher = escapeForRegexp(matcher).
-                  replace('\\*\\*', '.*').
-                  replace('\\*', '[^:/.?&;]*');
-    return new RegExp('^' + matcher + '$');
-  } else if (isRegExp(matcher)) {
-    // The only other type of matcher allowed is a Regexp.
-    // Match entire URL / disallow partial matches.
-    // Flags are reset (i.e. no global, ignoreCase or multiline)
-    return new RegExp('^' + matcher.source + '$');
-  } else {
-    throw $sceMinErr('imatcher',
-        'Matchers may only be "self", string patterns or RegExp objects');
-  }
-}
-
-
-function adjustMatchers(matchers) {
-  var adjustedMatchers = [];
-  if (isDefined(matchers)) {
-    forEach(matchers, function(matcher) {
-      adjustedMatchers.push(adjustMatcher(matcher));
-    });
-  }
-  return adjustedMatchers;
-}
-
-
-/**
- * @ngdoc service
- * @name $sceDelegate
- * @kind function
- *
- * @description
- *
- * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict
- * Contextual Escaping (SCE)} services to AngularJS.
- *
- * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of
- * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS.  This is
- * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to
- * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things
- * work because `$sce` delegates to `$sceDelegate` for these operations.
- *
- * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.
- *
- * The default instance of `$sceDelegate` should work out of the box with little pain.  While you
- * can override it completely to change the behavior of `$sce`, the common case would
- * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting
- * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as
- * templates.  Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist
- * $sceDelegateProvider.resourceUrlWhitelist} and {@link
- * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}
- */
-
-/**
- * @ngdoc provider
- * @name $sceDelegateProvider
- * @description
- *
- * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate
- * $sceDelegate} service.  This allows one to get/set the whitelists and blacklists used to ensure
- * that the URLs used for sourcing Angular templates are safe.  Refer {@link
- * ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and
- * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}
- *
- * For the general details about this service in Angular, read the main page for {@link ng.$sce
- * Strict Contextual Escaping (SCE)}.
- *
- * **Example**:  Consider the following case. <a name="example"></a>
- *
- * - your app is hosted at url `http://myapp.example.com/`
- * - but some of your templates are hosted on other domains you control such as
- *   `http://srv01.assets.example.com/`,  `http://srv02.assets.example.com/`, etc.
- * - and you have an open redirect at `http://myapp.example.com/clickThru?...`.
- *
- * Here is what a secure configuration for this scenario might look like:
- *
- * ```
- *  angular.module('myApp', []).config(function($sceDelegateProvider) {
- *    $sceDelegateProvider.resourceUrlWhitelist([
- *      // Allow same origin resource loads.
- *      'self',
- *      // Allow loading from our assets domain.  Notice the difference between * and **.
- *      'http://srv*.assets.example.com/**'
- *    ]);
- *
- *    // The blacklist overrides the whitelist so the open redirect here is blocked.
- *    $sceDelegateProvider.resourceUrlBlacklist([
- *      'http://myapp.example.com/clickThru**'
- *    ]);
- *  });
- * ```
- */
-
-function $SceDelegateProvider() {
-  this.SCE_CONTEXTS = SCE_CONTEXTS;
-
-  // Resource URLs can also be trusted by policy.
-  var resourceUrlWhitelist = ['self'],
-      resourceUrlBlacklist = [];
-
-  /**
-   * @ngdoc method
-   * @name $sceDelegateProvider#resourceUrlWhitelist
-   * @kind function
-   *
-   * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value
-   *     provided.  This must be an array or null.  A snapshot of this array is used so further
-   *     changes to the array are ignored.
-   *
-   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
-   *     allowed in this array.
-   *
-   *     Note: **an empty whitelist array will block all URLs**!
-   *
-   * @return {Array} the currently set whitelist array.
-   *
-   * The **default value** when no whitelist has been explicitly set is `['self']` allowing only
-   * same origin resource requests.
-   *
-   * @description
-   * Sets/Gets the whitelist of trusted resource URLs.
-   */
-  this.resourceUrlWhitelist = function(value) {
-    if (arguments.length) {
-      resourceUrlWhitelist = adjustMatchers(value);
-    }
-    return resourceUrlWhitelist;
-  };
-
-  /**
-   * @ngdoc method
-   * @name $sceDelegateProvider#resourceUrlBlacklist
-   * @kind function
-   *
-   * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value
-   *     provided.  This must be an array or null.  A snapshot of this array is used so further
-   *     changes to the array are ignored.
-   *
-   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
-   *     allowed in this array.
-   *
-   *     The typical usage for the blacklist is to **block
-   *     [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as
-   *     these would otherwise be trusted but actually return content from the redirected domain.
-   *
-   *     Finally, **the blacklist overrides the whitelist** and has the final say.
-   *
-   * @return {Array} the currently set blacklist array.
-   *
-   * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there
-   * is no blacklist.)
-   *
-   * @description
-   * Sets/Gets the blacklist of trusted resource URLs.
-   */
-
-  this.resourceUrlBlacklist = function(value) {
-    if (arguments.length) {
-      resourceUrlBlacklist = adjustMatchers(value);
-    }
-    return resourceUrlBlacklist;
-  };
-
-  this.$get = ['$injector', function($injector) {
-
-    var htmlSanitizer = function htmlSanitizer(html) {
-      throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
-    };
-
-    if ($injector.has('$sanitize')) {
-      htmlSanitizer = $injector.get('$sanitize');
-    }
-
-
-    function matchUrl(matcher, parsedUrl) {
-      if (matcher === 'self') {
-        return urlIsSameOrigin(parsedUrl);
-      } else {
-        // definitely a regex.  See adjustMatchers()
-        return !!matcher.exec(parsedUrl.href);
-      }
-    }
-
-    function isResourceUrlAllowedByPolicy(url) {
-      var parsedUrl = urlResolve(url.toString());
-      var i, n, allowed = false;
-      // Ensure that at least one item from the whitelist allows this url.
-      for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {
-        if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {
-          allowed = true;
-          break;
-        }
-      }
-      if (allowed) {
-        // Ensure that no item from the blacklist blocked this url.
-        for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {
-          if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {
-            allowed = false;
-            break;
-          }
-        }
-      }
-      return allowed;
-    }
-
-    function generateHolderType(Base) {
-      var holderType = function TrustedValueHolderType(trustedValue) {
-        this.$$unwrapTrustedValue = function() {
-          return trustedValue;
-        };
-      };
-      if (Base) {
-        holderType.prototype = new Base();
-      }
-      holderType.prototype.valueOf = function sceValueOf() {
-        return this.$$unwrapTrustedValue();
-      };
-      holderType.prototype.toString = function sceToString() {
-        return this.$$unwrapTrustedValue().toString();
-      };
-      return holderType;
-    }
-
-    var trustedValueHolderBase = generateHolderType(),
-        byType = {};
-
-    byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase);
-    byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase);
-    byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase);
-    byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase);
-    byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]);
-
-    /**
-     * @ngdoc method
-     * @name $sceDelegate#trustAs
-     *
-     * @description
-     * Returns an object that is trusted by angular for use in specified strict
-     * contextual escaping contexts (such as ng-bind-html, ng-include, any src
-     * attribute interpolation, any dom event binding attribute interpolation
-     * such as for onclick,  etc.) that uses the provided value.
-     * See {@link ng.$sce $sce} for enabling strict contextual escaping.
-     *
-     * @param {string} type The kind of context in which this value is safe for use.  e.g. url,
-     *   resourceUrl, html, js and css.
-     * @param {*} value The value that that should be considered trusted/safe.
-     * @returns {*} A value that can be used to stand in for the provided `value` in places
-     * where Angular expects a $sce.trustAs() return value.
-     */
-    function trustAs(type, trustedValue) {
-      var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);
-      if (!Constructor) {
-        throw $sceMinErr('icontext',
-            'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',
-            type, trustedValue);
-      }
-      if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') {
-        return trustedValue;
-      }
-      // All the current contexts in SCE_CONTEXTS happen to be strings.  In order to avoid trusting
-      // mutable objects, we ensure here that the value passed in is actually a string.
-      if (typeof trustedValue !== 'string') {
-        throw $sceMinErr('itype',
-            'Attempted to trust a non-string value in a content requiring a string: Context: {0}',
-            type);
-      }
-      return new Constructor(trustedValue);
-    }
-
-    /**
-     * @ngdoc method
-     * @name $sceDelegate#valueOf
-     *
-     * @description
-     * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs
-     * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link
-     * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.
-     *
-     * If the passed parameter is not a value that had been returned by {@link
-     * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, returns it as-is.
-     *
-     * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}
-     *      call or anything else.
-     * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs
-     *     `$sceDelegate.trustAs`} if `value` is the result of such a call.  Otherwise, returns
-     *     `value` unchanged.
-     */
-    function valueOf(maybeTrusted) {
-      if (maybeTrusted instanceof trustedValueHolderBase) {
-        return maybeTrusted.$$unwrapTrustedValue();
-      } else {
-        return maybeTrusted;
-      }
-    }
-
-    /**
-     * @ngdoc method
-     * @name $sceDelegate#getTrusted
-     *
-     * @description
-     * Takes the result of a {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call and
-     * returns the originally supplied value if the queried context type is a supertype of the
-     * created type.  If this condition isn't satisfied, throws an exception.
-     *
-     * @param {string} type The kind of context in which this value is to be used.
-     * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs
-     *     `$sceDelegate.trustAs`} call.
-     * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#trustAs
-     *     `$sceDelegate.trustAs`} if valid in this context.  Otherwise, throws an exception.
-     */
-    function getTrusted(type, maybeTrusted) {
-      if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') {
-        return maybeTrusted;
-      }
-      var constructor = (byType.hasOwnProperty(type) ? byType[type] : null);
-      if (constructor && maybeTrusted instanceof constructor) {
-        return maybeTrusted.$$unwrapTrustedValue();
-      }
-      // If we get here, then we may only take one of two actions.
-      // 1. sanitize the value for the requested type, or
-      // 2. throw an exception.
-      if (type === SCE_CONTEXTS.RESOURCE_URL) {
-        if (isResourceUrlAllowedByPolicy(maybeTrusted)) {
-          return maybeTrusted;
-        } else {
-          throw $sceMinErr('insecurl',
-              'Blocked loading resource from url not allowed by $sceDelegate policy.  URL: {0}',
-              maybeTrusted.toString());
-        }
-      } else if (type === SCE_CONTEXTS.HTML) {
-        return htmlSanitizer(maybeTrusted);
-      }
-      throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
-    }
-
-    return { trustAs: trustAs,
-             getTrusted: getTrusted,
-             valueOf: valueOf };
-  }];
-}
-
-
-/**
- * @ngdoc provider
- * @name $sceProvider
- * @description
- *
- * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service.
- * -   enable/disable Strict Contextual Escaping (SCE) in a module
- * -   override the default implementation with a custom delegate
- *
- * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.
- */
-
-/* jshint maxlen: false*/
-
-/**
- * @ngdoc service
- * @name $sce
- * @kind function
- *
- * @description
- *
- * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.
- *
- * # Strict Contextual Escaping
- *
- * Strict Contextual Escaping (SCE) is a mode in which AngularJS requires bindings in certain
- * contexts to result in a value that is marked as safe to use for that context.  One example of
- * such a context is binding arbitrary html controlled by the user via `ng-bind-html`.  We refer
- * to these contexts as privileged or SCE contexts.
- *
- * As of version 1.2, Angular ships with SCE enabled by default.
- *
- * Note:  When enabled (the default), IE<11 in quirks mode is not supported.  In this mode, IE<11 allow
- * one to execute arbitrary javascript by the use of the expression() syntax.  Refer
- * <http://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx> to learn more about them.
- * You can ensure your document is in standards mode and not quirks mode by adding `<!doctype html>`
- * to the top of your HTML document.
- *
- * SCE assists in writing code in way that (a) is secure by default and (b) makes auditing for
- * security vulnerabilities such as XSS, clickjacking, etc. a lot easier.
- *
- * Here's an example of a binding in a privileged context:
- *
- * ```
- * <input ng-model="userHtml" aria-label="User input">
- * <div ng-bind-html="userHtml"></div>
- * ```
- *
- * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user.  With SCE
- * disabled, this application allows the user to render arbitrary HTML into the DIV.
- * In a more realistic example, one may be rendering user comments, blog articles, etc. via
- * bindings.  (HTML is just one example of a context where rendering user controlled input creates
- * security vulnerabilities.)
- *
- * For the case of HTML, you might use a library, either on the client side, or on the server side,
- * to sanitize unsafe HTML before binding to the value and rendering it in the document.
- *
- * How would you ensure that every place that used these types of bindings was bound to a value that
- * was sanitized by your library (or returned as safe for rendering by your server?)  How can you
- * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some
- * properties/fields and forgot to update the binding to the sanitized value?
- *
- * To be secure by default, you want to ensure that any such bindings are disallowed unless you can
- * determine that something explicitly says it's safe to use a value for binding in that
- * context.  You can then audit your code (a simple grep would do) to ensure that this is only done
- * for those values that you can easily tell are safe - because they were received from your server,
- * sanitized by your library, etc.  You can organize your codebase to help with this - perhaps
- * allowing only the files in a specific directory to do this.  Ensuring that the internal API
- * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.
- *
- * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs}
- * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to
- * obtain values that will be accepted by SCE / privileged contexts.
- *
- *
- * ## How does it work?
- *
- * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted
- * $sce.getTrusted(context, value)} rather than to the value directly.  Directives use {@link
- * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the
- * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals.
- *
- * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link
- * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}.  Here's the actual code (slightly
- * simplified):
- *
- * ```
- * var ngBindHtmlDirective = ['$sce', function($sce) {
- *   return function(scope, element, attr) {
- *     scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) {
- *       element.html(value || '');
- *     });
- *   };
- * }];
- * ```
- *
- * ## Impact on loading templates
- *
- * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as
- * `templateUrl`'s specified by {@link guide/directive directives}.
- *
- * By default, Angular only loads templates from the same domain and protocol as the application
- * document.  This is done by calling {@link ng.$sce#getTrustedResourceUrl
- * $sce.getTrustedResourceUrl} on the template URL.  To load templates from other domains and/or
- * protocols, you may either either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist
- * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value.
- *
- * *Please note*:
- * The browser's
- * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)
- * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)
- * policy apply in addition to this and may further restrict whether the template is successfully
- * loaded.  This means that without the right CORS policy, loading templates from a different domain
- * won't work on all browsers.  Also, loading templates from `file://` URL does not work on some
- * browsers.
- *
- * ## This feels like too much overhead
- *
- * It's important to remember that SCE only applies to interpolation expressions.
- *
- * If your expressions are constant literals, they're automatically trusted and you don't need to
- * call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g.
- * `<div ng-bind-html="'<b>implicitly trusted</b>'"></div>`) just works.
- *
- * Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them
- * through {@link ng.$sce#getTrusted $sce.getTrusted}.  SCE doesn't play a role here.
- *
- * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load
- * templates in `ng-include` from your application's domain without having to even know about SCE.
- * It blocks loading templates from other domains or loading templates over http from an https
- * served document.  You can change these by setting your own custom {@link
- * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link
- * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs.
- *
- * This significantly reduces the overhead.  It is far easier to pay the small overhead and have an
- * application that's secure and can be audited to verify that with much more ease than bolting
- * security onto an application later.
- *
- * <a name="contexts"></a>
- * ## What trusted context types are supported?
- *
- * | Context             | Notes          |
- * |---------------------|----------------|
- * | `$sce.HTML`         | For HTML that's safe to source into the application.  The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. |
- * | `$sce.CSS`          | For CSS that's safe to source into the application.  Currently unused.  Feel free to use it in your own directives. |
- * | `$sce.URL`          | For URLs that are safe to follow as links.  Currently unused (`<a href=` and `<img src=` sanitize their urls and don't constitute an SCE context. |
- * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application.  Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.)  <br><br>Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. |
- * | `$sce.JS`           | For JavaScript that is safe to execute in your application's context.  Currently unused.  Feel free to use it in your own directives. |
- *
- * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist} <a name="resourceUrlPatternItem"></a>
- *
- *  Each element in these arrays must be one of the following:
- *
- *  - **'self'**
- *    - The special **string**, `'self'`, can be used to match against all URLs of the **same
- *      domain** as the application document using the **same protocol**.
- *  - **String** (except the special value `'self'`)
- *    - The string is matched against the full *normalized / absolute URL* of the resource
- *      being tested (substring matches are not good enough.)
- *    - There are exactly **two wildcard sequences** - `*` and `**`.  All other characters
- *      match themselves.
- *    - `*`: matches zero or more occurrences of any character other than one of the following 6
- *      characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'.  It's a useful wildcard for use
- *      in a whitelist.
- *    - `**`: matches zero or more occurrences of *any* character.  As such, it's not
- *      appropriate for use in a scheme, domain, etc. as it would match too much.  (e.g.
- *      http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might
- *      not have been the intention.)  Its usage at the very end of the path is ok.  (e.g.
- *      http://foo.example.com/templates/**).
- *  - **RegExp** (*see caveat below*)
- *    - *Caveat*:  While regular expressions are powerful and offer great flexibility,  their syntax
- *      (and all the inevitable escaping) makes them *harder to maintain*.  It's easy to
- *      accidentally introduce a bug when one updates a complex expression (imho, all regexes should
- *      have good test coverage).  For instance, the use of `.` in the regex is correct only in a
- *      small number of cases.  A `.` character in the regex used when matching the scheme or a
- *      subdomain could be matched against a `:` or literal `.` that was likely not intended.   It
- *      is highly recommended to use the string patterns and only fall back to regular expressions
- *      as a last resort.
- *    - The regular expression must be an instance of RegExp (i.e. not a string.)  It is
- *      matched against the **entire** *normalized / absolute URL* of the resource being tested
- *      (even when the RegExp did not have the `^` and `$` codes.)  In addition, any flags
- *      present on the RegExp (such as multiline, global, ignoreCase) are ignored.
- *    - If you are generating your JavaScript from some other templating engine (not
- *      recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),
- *      remember to escape your regular expression (and be aware that you might need more than
- *      one level of escaping depending on your templating engine and the way you interpolated
- *      the value.)  Do make use of your platform's escaping mechanism as it might be good
- *      enough before coding your own.  E.g. Ruby has
- *      [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape)
- *      and Python has [re.escape](http://docs.python.org/library/re.html#re.escape).
- *      Javascript lacks a similar built in function for escaping.  Take a look at Google
- *      Closure library's [goog.string.regExpEscape(s)](
- *      http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962).
- *
- * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.
- *
- * ## Show me an example using SCE.
- *
- * <example module="mySceApp" deps="angular-sanitize.js">
- * <file name="index.html">
- *   <div ng-controller="AppController as myCtrl">
- *     <i ng-bind-html="myCtrl.explicitlyTrustedHtml" id="explicitlyTrustedHtml"></i><br><br>
- *     <b>User comments</b><br>
- *     By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when
- *     $sanitize is available.  If $sanitize isn't available, this results in an error instead of an
- *     exploit.
- *     <div class="well">
- *       <div ng-repeat="userComment in myCtrl.userComments">
- *         <b>{{userComment.name}}</b>:
- *         <span ng-bind-html="userComment.htmlComment" class="htmlComment"></span>
- *         <br>
- *       </div>
- *     </div>
- *   </div>
- * </file>
- *
- * <file name="script.js">
- *   angular.module('mySceApp', ['ngSanitize'])
- *     .controller('AppController', ['$http', '$templateCache', '$sce',
- *       function($http, $templateCache, $sce) {
- *         var self = this;
- *         $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) {
- *           self.userComments = userComments;
- *         });
- *         self.explicitlyTrustedHtml = $sce.trustAsHtml(
- *             '<span onmouseover="this.textContent=&quot;Explicitly trusted HTML bypasses ' +
- *             'sanitization.&quot;">Hover over this text.</span>');
- *       }]);
- * </file>
- *
- * <file name="test_data.json">
- * [
- *   { "name": "Alice",
- *     "htmlComment":
- *         "<span onmouseover='this.textContent=\"PWN3D!\"'>Is <i>anyone</i> reading this?</span>"
- *   },
- *   { "name": "Bob",
- *     "htmlComment": "<i>Yes!</i>  Am I the only other one?"
- *   }
- * ]
- * </file>
- *
- * <file name="protractor.js" type="protractor">
- *   describe('SCE doc demo', function() {
- *     it('should sanitize untrusted values', function() {
- *       expect(element.all(by.css('.htmlComment')).first().getInnerHtml())
- *           .toBe('<span>Is <i>anyone</i> reading this?</span>');
- *     });
- *
- *     it('should NOT sanitize explicitly trusted values', function() {
- *       expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe(
- *           '<span onmouseover="this.textContent=&quot;Explicitly trusted HTML bypasses ' +
- *           'sanitization.&quot;">Hover over this text.</span>');
- *     });
- *   });
- * </file>
- * </example>
- *
- *
- *
- * ## Can I disable SCE completely?
- *
- * Yes, you can.  However, this is strongly discouraged.  SCE gives you a lot of security benefits
- * for little coding overhead.  It will be much harder to take an SCE disabled application and
- * either secure it on your own or enable SCE at a later stage.  It might make sense to disable SCE
- * for cases where you have a lot of existing code that was written before SCE was introduced and
- * you're migrating them a module at a time.
- *
- * That said, here's how you can completely disable SCE:
- *
- * ```
- * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) {
- *   // Completely disable SCE.  For demonstration purposes only!
- *   // Do not use in new projects.
- *   $sceProvider.enabled(false);
- * });
- * ```
- *
- */
-/* jshint maxlen: 100 */
-
-function $SceProvider() {
-  var enabled = true;
-
-  /**
-   * @ngdoc method
-   * @name $sceProvider#enabled
-   * @kind function
-   *
-   * @param {boolean=} value If provided, then enables/disables SCE.
-   * @return {boolean} true if SCE is enabled, false otherwise.
-   *
-   * @description
-   * Enables/disables SCE and returns the current value.
-   */
-  this.enabled = function(value) {
-    if (arguments.length) {
-      enabled = !!value;
-    }
-    return enabled;
-  };
-
-
-  /* Design notes on the default implementation for SCE.
-   *
-   * The API contract for the SCE delegate
-   * -------------------------------------
-   * The SCE delegate object must provide the following 3 methods:
-   *
-   * - trustAs(contextEnum, value)
-   *     This method is used to tell the SCE service that the provided value is OK to use in the
-   *     contexts specified by contextEnum.  It must return an object that will be accepted by
-   *     getTrusted() for a compatible contextEnum and return this value.
-   *
-   * - valueOf(value)
-   *     For values that were not produced by trustAs(), return them as is.  For values that were
-   *     produced by trustAs(), return the corresponding input value to trustAs.  Basically, if
-   *     trustAs is wrapping the given values into some type, this operation unwraps it when given
-   *     such a value.
-   *
-   * - getTrusted(contextEnum, value)
-   *     This function should return the a value that is safe to use in the context specified by
-   *     contextEnum or throw and exception otherwise.
-   *
-   * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be
-   * opaque or wrapped in some holder object.  That happens to be an implementation detail.  For
-   * instance, an implementation could maintain a registry of all trusted objects by context.  In
-   * such a case, trustAs() would return the same object that was passed in.  getTrusted() would
-   * return the same object passed in if it was found in the registry under a compatible context or
-   * throw an exception otherwise.  An implementation might only wrap values some of the time based
-   * on some criteria.  getTrusted() might return a value and not throw an exception for special
-   * constants or objects even if not wrapped.  All such implementations fulfill this contract.
-   *
-   *
-   * A note on the inheritance model for SCE contexts
-   * ------------------------------------------------
-   * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types.  This
-   * is purely an implementation details.
-   *
-   * The contract is simply this:
-   *
-   *     getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value)
-   *     will also succeed.
-   *
-   * Inheritance happens to capture this in a natural way.  In some future, we
-   * may not use inheritance anymore.  That is OK because no code outside of
-   * sce.js and sceSpecs.js would need to be aware of this detail.
-   */
-
-  this.$get = ['$parse', '$sceDelegate', function(
-                $parse,   $sceDelegate) {
-    // Prereq: Ensure that we're not running in IE<11 quirks mode.  In that mode, IE < 11 allow
-    // the "expression(javascript expression)" syntax which is insecure.
-    if (enabled && msie < 8) {
-      throw $sceMinErr('iequirks',
-        'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' +
-        'mode.  You can fix this by adding the text <!doctype html> to the top of your HTML ' +
-        'document.  See http://docs.angularjs.org/api/ng.$sce for more information.');
-    }
-
-    var sce = shallowCopy(SCE_CONTEXTS);
-
-    /**
-     * @ngdoc method
-     * @name $sce#isEnabled
-     * @kind function
-     *
-     * @return {Boolean} true if SCE is enabled, false otherwise.  If you want to set the value, you
-     * have to do it at module config time on {@link ng.$sceProvider $sceProvider}.
-     *
-     * @description
-     * Returns a boolean indicating if SCE is enabled.
-     */
-    sce.isEnabled = function() {
-      return enabled;
-    };
-    sce.trustAs = $sceDelegate.trustAs;
-    sce.getTrusted = $sceDelegate.getTrusted;
-    sce.valueOf = $sceDelegate.valueOf;
-
-    if (!enabled) {
-      sce.trustAs = sce.getTrusted = function(type, value) { return value; };
-      sce.valueOf = identity;
-    }
-
-    /**
-     * @ngdoc method
-     * @name $sce#parseAs
-     *
-     * @description
-     * Converts Angular {@link guide/expression expression} into a function.  This is like {@link
-     * ng.$parse $parse} and is identical when the expression is a literal constant.  Otherwise, it
-     * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*,
-     * *result*)}
-     *
-     * @param {string} type The kind of SCE context in which this result will be used.
-     * @param {string} expression String expression to compile.
-     * @returns {function(context, locals)} a function which represents the compiled expression:
-     *
-     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
-     *      are evaluated against (typically a scope object).
-     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
-     *      `context`.
-     */
-    sce.parseAs = function sceParseAs(type, expr) {
-      var parsed = $parse(expr);
-      if (parsed.literal && parsed.constant) {
-        return parsed;
-      } else {
-        return $parse(expr, function(value) {
-          return sce.getTrusted(type, value);
-        });
-      }
-    };
-
-    /**
-     * @ngdoc method
-     * @name $sce#trustAs
-     *
-     * @description
-     * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.  As such,
-     * returns an object that is trusted by angular for use in specified strict contextual
-     * escaping contexts (such as ng-bind-html, ng-include, any src attribute
-     * interpolation, any dom event binding attribute interpolation such as for onclick,  etc.)
-     * that uses the provided value.  See * {@link ng.$sce $sce} for enabling strict contextual
-     * escaping.
-     *
-     * @param {string} type The kind of context in which this value is safe for use.  e.g. url,
-     *   resourceUrl, html, js and css.
-     * @param {*} value The value that that should be considered trusted/safe.
-     * @returns {*} A value that can be used to stand in for the provided `value` in places
-     * where Angular expects a $sce.trustAs() return value.
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#trustAsHtml
-     *
-     * @description
-     * Shorthand method.  `$sce.trustAsHtml(value)` →
-     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`}
-     *
-     * @param {*} value The value to trustAs.
-     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedHtml
-     *     $sce.getTrustedHtml(value)} to obtain the original value.  (privileged directives
-     *     only accept expressions that are either literal constants or are the
-     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#trustAsUrl
-     *
-     * @description
-     * Shorthand method.  `$sce.trustAsUrl(value)` →
-     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`}
-     *
-     * @param {*} value The value to trustAs.
-     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedUrl
-     *     $sce.getTrustedUrl(value)} to obtain the original value.  (privileged directives
-     *     only accept expressions that are either literal constants or are the
-     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#trustAsResourceUrl
-     *
-     * @description
-     * Shorthand method.  `$sce.trustAsResourceUrl(value)` →
-     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`}
-     *
-     * @param {*} value The value to trustAs.
-     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedResourceUrl
-     *     $sce.getTrustedResourceUrl(value)} to obtain the original value.  (privileged directives
-     *     only accept expressions that are either literal constants or are the return
-     *     value of {@link ng.$sce#trustAs $sce.trustAs}.)
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#trustAsJs
-     *
-     * @description
-     * Shorthand method.  `$sce.trustAsJs(value)` →
-     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`}
-     *
-     * @param {*} value The value to trustAs.
-     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedJs
-     *     $sce.getTrustedJs(value)} to obtain the original value.  (privileged directives
-     *     only accept expressions that are either literal constants or are the
-     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#getTrusted
-     *
-     * @description
-     * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}.  As such,
-     * takes the result of a {@link ng.$sce#trustAs `$sce.trustAs`}() call and returns the
-     * originally supplied value if the queried context type is a supertype of the created type.
-     * If this condition isn't satisfied, throws an exception.
-     *
-     * @param {string} type The kind of context in which this value is to be used.
-     * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs `$sce.trustAs`}
-     *                         call.
-     * @returns {*} The value the was originally provided to
-     *              {@link ng.$sce#trustAs `$sce.trustAs`} if valid in this context.
-     *              Otherwise, throws an exception.
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#getTrustedHtml
-     *
-     * @description
-     * Shorthand method.  `$sce.getTrustedHtml(value)` →
-     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`}
-     *
-     * @param {*} value The value to pass to `$sce.getTrusted`.
-     * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)`
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#getTrustedCss
-     *
-     * @description
-     * Shorthand method.  `$sce.getTrustedCss(value)` →
-     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`}
-     *
-     * @param {*} value The value to pass to `$sce.getTrusted`.
-     * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)`
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#getTrustedUrl
-     *
-     * @description
-     * Shorthand method.  `$sce.getTrustedUrl(value)` →
-     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`}
-     *
-     * @param {*} value The value to pass to `$sce.getTrusted`.
-     * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)`
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#getTrustedResourceUrl
-     *
-     * @description
-     * Shorthand method.  `$sce.getTrustedResourceUrl(value)` →
-     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`}
-     *
-     * @param {*} value The value to pass to `$sceDelegate.getTrusted`.
-     * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)`
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#getTrustedJs
-     *
-     * @description
-     * Shorthand method.  `$sce.getTrustedJs(value)` →
-     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`}
-     *
-     * @param {*} value The value to pass to `$sce.getTrusted`.
-     * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)`
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#parseAsHtml
-     *
-     * @description
-     * Shorthand method.  `$sce.parseAsHtml(expression string)` →
-     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`}
-     *
-     * @param {string} expression String expression to compile.
-     * @returns {function(context, locals)} a function which represents the compiled expression:
-     *
-     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
-     *      are evaluated against (typically a scope object).
-     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
-     *      `context`.
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#parseAsCss
-     *
-     * @description
-     * Shorthand method.  `$sce.parseAsCss(value)` →
-     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`}
-     *
-     * @param {string} expression String expression to compile.
-     * @returns {function(context, locals)} a function which represents the compiled expression:
-     *
-     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
-     *      are evaluated against (typically a scope object).
-     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
-     *      `context`.
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#parseAsUrl
-     *
-     * @description
-     * Shorthand method.  `$sce.parseAsUrl(value)` →
-     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`}
-     *
-     * @param {string} expression String expression to compile.
-     * @returns {function(context, locals)} a function which represents the compiled expression:
-     *
-     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
-     *      are evaluated against (typically a scope object).
-     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
-     *      `context`.
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#parseAsResourceUrl
-     *
-     * @description
-     * Shorthand method.  `$sce.parseAsResourceUrl(value)` →
-     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`}
-     *
-     * @param {string} expression String expression to compile.
-     * @returns {function(context, locals)} a function which represents the compiled expression:
-     *
-     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
-     *      are evaluated against (typically a scope object).
-     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
-     *      `context`.
-     */
-
-    /**
-     * @ngdoc method
-     * @name $sce#parseAsJs
-     *
-     * @description
-     * Shorthand method.  `$sce.parseAsJs(value)` →
-     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`}
-     *
-     * @param {string} expression String expression to compile.
-     * @returns {function(context, locals)} a function which represents the compiled expression:
-     *
-     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
-     *      are evaluated against (typically a scope object).
-     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
-     *      `context`.
-     */
-
-    // Shorthand delegations.
-    var parse = sce.parseAs,
-        getTrusted = sce.getTrusted,
-        trustAs = sce.trustAs;
-
-    forEach(SCE_CONTEXTS, function(enumValue, name) {
-      var lName = lowercase(name);
-      sce[camelCase("parse_as_" + lName)] = function(expr) {
-        return parse(enumValue, expr);
-      };
-      sce[camelCase("get_trusted_" + lName)] = function(value) {
-        return getTrusted(enumValue, value);
-      };
-      sce[camelCase("trust_as_" + lName)] = function(value) {
-        return trustAs(enumValue, value);
-      };
-    });
-
-    return sce;
-  }];
-}
-
-/**
- * !!! This is an undocumented "private" service !!!
- *
- * @name $sniffer
- * @requires $window
- * @requires $document
- *
- * @property {boolean} history Does the browser support html5 history api ?
- * @property {boolean} transitions Does the browser support CSS transition events ?
- * @property {boolean} animations Does the browser support CSS animation events ?
- *
- * @description
- * This is very simple implementation of testing browser's features.
- */
-function $SnifferProvider() {
-  this.$get = ['$window', '$document', function($window, $document) {
-    var eventSupport = {},
-        android =
-          toInt((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),
-        boxee = /Boxee/i.test(($window.navigator || {}).userAgent),
-        document = $document[0] || {},
-        vendorPrefix,
-        vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/,
-        bodyStyle = document.body && document.body.style,
-        transitions = false,
-        animations = false,
-        match;
-
-    if (bodyStyle) {
-      for (var prop in bodyStyle) {
-        if (match = vendorRegex.exec(prop)) {
-          vendorPrefix = match[0];
-          vendorPrefix = vendorPrefix.substr(0, 1).toUpperCase() + vendorPrefix.substr(1);
-          break;
-        }
-      }
-
-      if (!vendorPrefix) {
-        vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit';
-      }
-
-      transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));
-      animations  = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle));
-
-      if (android && (!transitions ||  !animations)) {
-        transitions = isString(bodyStyle.webkitTransition);
-        animations = isString(bodyStyle.webkitAnimation);
-      }
-    }
-
-
-    return {
-      // Android has history.pushState, but it does not update location correctly
-      // so let's not use the history API at all.
-      // http://code.google.com/p/android/issues/detail?id=17471
-      // https://github.com/angular/angular.js/issues/904
-
-      // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has
-      // so let's not use the history API also
-      // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined
-      // jshint -W018
-      history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee),
-      // jshint +W018
-      hasEvent: function(event) {
-        // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have
-        // it. In particular the event is not fired when backspace or delete key are pressed or
-        // when cut operation is performed.
-        // IE10+ implements 'input' event but it erroneously fires under various situations,
-        // e.g. when placeholder changes, or a form is focused.
-        if (event === 'input' && msie <= 11) return false;
-
-        if (isUndefined(eventSupport[event])) {
-          var divElm = document.createElement('div');
-          eventSupport[event] = 'on' + event in divElm;
-        }
-
-        return eventSupport[event];
-      },
-      csp: csp(),
-      vendorPrefix: vendorPrefix,
-      transitions: transitions,
-      animations: animations,
-      android: android
-    };
-  }];
-}
-
-var $compileMinErr = minErr('$compile');
-
-/**
- * @ngdoc service
- * @name $templateRequest
- *
- * @description
- * The `$templateRequest` service runs security checks then downloads the provided template using
- * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request
- * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the
- * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the
- * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted
- * when `tpl` is of type string and `$templateCache` has the matching entry.
- *
- * @param {string|TrustedResourceUrl} tpl The HTTP request template URL
- * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty
- *
- * @return {Promise} a promise for the HTTP response data of the given URL.
- *
- * @property {number} totalPendingRequests total amount of pending template requests being downloaded.
- */
-function $TemplateRequestProvider() {
-  this.$get = ['$templateCache', '$http', '$q', '$sce', function($templateCache, $http, $q, $sce) {
-    function handleRequestFn(tpl, ignoreRequestError) {
-      handleRequestFn.totalPendingRequests++;
-
-      // We consider the template cache holds only trusted templates, so
-      // there's no need to go through whitelisting again for keys that already
-      // are included in there. This also makes Angular accept any script
-      // directive, no matter its name. However, we still need to unwrap trusted
-      // types.
-      if (!isString(tpl) || !$templateCache.get(tpl)) {
-        tpl = $sce.getTrustedResourceUrl(tpl);
-      }
-
-      var transformResponse = $http.defaults && $http.defaults.transformResponse;
-
-      if (isArray(transformResponse)) {
-        transformResponse = transformResponse.filter(function(transformer) {
-          return transformer !== defaultHttpResponseTransform;
-        });
-      } else if (transformResponse === defaultHttpResponseTransform) {
-        transformResponse = null;
-      }
-
-      var httpOptions = {
-        cache: $templateCache,
-        transformResponse: transformResponse
-      };
-
-      return $http.get(tpl, httpOptions)
-        ['finally'](function() {
-          handleRequestFn.totalPendingRequests--;
-        })
-        .then(function(response) {
-          $templateCache.put(tpl, response.data);
-          return response.data;
-        }, handleError);
-
-      function handleError(resp) {
-        if (!ignoreRequestError) {
-          throw $compileMinErr('tpload', 'Failed to load template: {0} (HTTP status: {1} {2})',
-            tpl, resp.status, resp.statusText);
-        }
-        return $q.reject(resp);
-      }
-    }
-
-    handleRequestFn.totalPendingRequests = 0;
-
-    return handleRequestFn;
-  }];
-}
-
-function $$TestabilityProvider() {
-  this.$get = ['$rootScope', '$browser', '$location',
-       function($rootScope,   $browser,   $location) {
-
-    /**
-     * @name $testability
-     *
-     * @description
-     * The private $$testability service provides a collection of methods for use when debugging
-     * or by automated test and debugging tools.
-     */
-    var testability = {};
-
-    /**
-     * @name $$testability#findBindings
-     *
-     * @description
-     * Returns an array of elements that are bound (via ng-bind or {{}})
-     * to expressions matching the input.
-     *
-     * @param {Element} element The element root to search from.
-     * @param {string} expression The binding expression to match.
-     * @param {boolean} opt_exactMatch If true, only returns exact matches
-     *     for the expression. Filters and whitespace are ignored.
-     */
-    testability.findBindings = function(element, expression, opt_exactMatch) {
-      var bindings = element.getElementsByClassName('ng-binding');
-      var matches = [];
-      forEach(bindings, function(binding) {
-        var dataBinding = angular.element(binding).data('$binding');
-        if (dataBinding) {
-          forEach(dataBinding, function(bindingName) {
-            if (opt_exactMatch) {
-              var matcher = new RegExp('(^|\\s)' + escapeForRegexp(expression) + '(\\s|\\||$)');
-              if (matcher.test(bindingName)) {
-                matches.push(binding);
-              }
-            } else {
-              if (bindingName.indexOf(expression) != -1) {
-                matches.push(binding);
-              }
-            }
-          });
-        }
-      });
-      return matches;
-    };
-
-    /**
-     * @name $$testability#findModels
-     *
-     * @description
-     * Returns an array of elements that are two-way found via ng-model to
-     * expressions matching the input.
-     *
-     * @param {Element} element The element root to search from.
-     * @param {string} expression The model expression to match.
-     * @param {boolean} opt_exactMatch If true, only returns exact matches
-     *     for the expression.
-     */
-    testability.findModels = function(element, expression, opt_exactMatch) {
-      var prefixes = ['ng-', 'data-ng-', 'ng\\:'];
-      for (var p = 0; p < prefixes.length; ++p) {
-        var attributeEquals = opt_exactMatch ? '=' : '*=';
-        var selector = '[' + prefixes[p] + 'model' + attributeEquals + '"' + expression + '"]';
-        var elements = element.querySelectorAll(selector);
-        if (elements.length) {
-          return elements;
-        }
-      }
-    };
-
-    /**
-     * @name $$testability#getLocation
-     *
-     * @description
-     * Shortcut for getting the location in a browser agnostic way. Returns
-     *     the path, search, and hash. (e.g. /path?a=b#hash)
-     */
-    testability.getLocation = function() {
-      return $location.url();
-    };
-
-    /**
-     * @name $$testability#setLocation
-     *
-     * @description
-     * Shortcut for navigating to a location without doing a full page reload.
-     *
-     * @param {string} url The location url (path, search and hash,
-     *     e.g. /path?a=b#hash) to go to.
-     */
-    testability.setLocation = function(url) {
-      if (url !== $location.url()) {
-        $location.url(url);
-        $rootScope.$digest();
-      }
-    };
-
-    /**
-     * @name $$testability#whenStable
-     *
-     * @description
-     * Calls the callback when $timeout and $http requests are completed.
-     *
-     * @param {function} callback
-     */
-    testability.whenStable = function(callback) {
-      $browser.notifyWhenNoOutstandingRequests(callback);
-    };
-
-    return testability;
-  }];
-}
-
-function $TimeoutProvider() {
-  this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',
-       function($rootScope,   $browser,   $q,   $$q,   $exceptionHandler) {
-
-    var deferreds = {};
-
-
-     /**
-      * @ngdoc service
-      * @name $timeout
-      *
-      * @description
-      * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch
-      * block and delegates any exceptions to
-      * {@link ng.$exceptionHandler $exceptionHandler} service.
-      *
-      * The return value of calling `$timeout` is a promise, which will be resolved when
-      * the delay has passed and the timeout function, if provided, is executed.
-      *
-      * To cancel a timeout request, call `$timeout.cancel(promise)`.
-      *
-      * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to
-      * synchronously flush the queue of deferred functions.
-      *
-      * If you only want a promise that will be resolved after some specified delay
-      * then you can call `$timeout` without the `fn` function.
-      *
-      * @param {function()=} fn A function, whose execution should be delayed.
-      * @param {number=} [delay=0] Delay in milliseconds.
-      * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise
-      *   will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
-      * @param {...*=} Pass additional parameters to the executed function.
-      * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this
-      *   promise will be resolved with is the return value of the `fn` function.
-      *
-      */
-    function timeout(fn, delay, invokeApply) {
-      if (!isFunction(fn)) {
-        invokeApply = delay;
-        delay = fn;
-        fn = noop;
-      }
-
-      var args = sliceArgs(arguments, 3),
-          skipApply = (isDefined(invokeApply) && !invokeApply),
-          deferred = (skipApply ? $$q : $q).defer(),
-          promise = deferred.promise,
-          timeoutId;
-
-      timeoutId = $browser.defer(function() {
-        try {
-          deferred.resolve(fn.apply(null, args));
-        } catch (e) {
-          deferred.reject(e);
-          $exceptionHandler(e);
-        }
-        finally {
-          delete deferreds[promise.$$timeoutId];
-        }
-
-        if (!skipApply) $rootScope.$apply();
-      }, delay);
-
-      promise.$$timeoutId = timeoutId;
-      deferreds[timeoutId] = deferred;
-
-      return promise;
-    }
-
-
-     /**
-      * @ngdoc method
-      * @name $timeout#cancel
-      *
-      * @description
-      * Cancels a task associated with the `promise`. As a result of this, the promise will be
-      * resolved with a rejection.
-      *
-      * @param {Promise=} promise Promise returned by the `$timeout` function.
-      * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully
-      *   canceled.
-      */
-    timeout.cancel = function(promise) {
-      if (promise && promise.$$timeoutId in deferreds) {
-        deferreds[promise.$$timeoutId].reject('canceled');
-        delete deferreds[promise.$$timeoutId];
-        return $browser.defer.cancel(promise.$$timeoutId);
-      }
-      return false;
-    };
-
-    return timeout;
-  }];
-}
-
-// NOTE:  The usage of window and document instead of $window and $document here is
-// deliberate.  This service depends on the specific behavior of anchor nodes created by the
-// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and
-// cause us to break tests.  In addition, when the browser resolves a URL for XHR, it
-// doesn't know about mocked locations and resolves URLs to the real document - which is
-// exactly the behavior needed here.  There is little value is mocking these out for this
-// service.
-var urlParsingNode = document.createElement("a");
-var originUrl = urlResolve(window.location.href);
-
-
-/**
- *
- * Implementation Notes for non-IE browsers
- * ----------------------------------------
- * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,
- * results both in the normalizing and parsing of the URL.  Normalizing means that a relative
- * URL will be resolved into an absolute URL in the context of the application document.
- * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related
- * properties are all populated to reflect the normalized URL.  This approach has wide
- * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc.  See
- * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html
- *
- * Implementation Notes for IE
- * ---------------------------
- * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other
- * browsers.  However, the parsed components will not be set if the URL assigned did not specify
- * them.  (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.)  We
- * work around that by performing the parsing in a 2nd step by taking a previously normalized
- * URL (e.g. by assigning to a.href) and assigning it a.href again.  This correctly populates the
- * properties such as protocol, hostname, port, etc.
- *
- * References:
- *   http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement
- *   http://www.aptana.com/reference/html/api/HTMLAnchorElement.html
- *   http://url.spec.whatwg.org/#urlutils
- *   https://github.com/angular/angular.js/pull/2902
- *   http://james.padolsey.com/javascript/parsing-urls-with-the-dom/
- *
- * @kind function
- * @param {string} url The URL to be parsed.
- * @description Normalizes and parses a URL.
- * @returns {object} Returns the normalized URL as a dictionary.
- *
- *   | member name   | Description    |
- *   |---------------|----------------|
- *   | href          | A normalized version of the provided URL if it was not an absolute URL |
- *   | protocol      | The protocol including the trailing colon                              |
- *   | host          | The host and port (if the port is non-default) of the normalizedUrl    |
- *   | search        | The search params, minus the question mark                             |
- *   | hash          | The hash string, minus the hash symbol
- *   | hostname      | The hostname
- *   | port          | The port, without ":"
- *   | pathname      | The pathname, beginning with "/"
- *
- */
-function urlResolve(url) {
-  var href = url;
-
-  if (msie) {
-    // Normalize before parse.  Refer Implementation Notes on why this is
-    // done in two steps on IE.
-    urlParsingNode.setAttribute("href", href);
-    href = urlParsingNode.href;
-  }
-
-  urlParsingNode.setAttribute('href', href);
-
-  // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
-  return {
-    href: urlParsingNode.href,
-    protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
-    host: urlParsingNode.host,
-    search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
-    hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
-    hostname: urlParsingNode.hostname,
-    port: urlParsingNode.port,
-    pathname: (urlParsingNode.pathname.charAt(0) === '/')
-      ? urlParsingNode.pathname
-      : '/' + urlParsingNode.pathname
-  };
-}
-
-/**
- * Parse a request URL and determine whether this is a same-origin request as the application document.
- *
- * @param {string|object} requestUrl The url of the request as a string that will be resolved
- * or a parsed URL object.
- * @returns {boolean} Whether the request is for the same origin as the application document.
- */
-function urlIsSameOrigin(requestUrl) {
-  var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;
-  return (parsed.protocol === originUrl.protocol &&
-          parsed.host === originUrl.host);
-}
-
-/**
- * @ngdoc service
- * @name $window
- *
- * @description
- * A reference to the browser's `window` object. While `window`
- * is globally available in JavaScript, it causes testability problems, because
- * it is a global variable. In angular we always refer to it through the
- * `$window` service, so it may be overridden, removed or mocked for testing.
- *
- * Expressions, like the one defined for the `ngClick` directive in the example
- * below, are evaluated with respect to the current scope.  Therefore, there is
- * no risk of inadvertently coding in a dependency on a global value in such an
- * expression.
- *
- * @example
-   <example module="windowExample">
-     <file name="index.html">
-       <script>
-         angular.module('windowExample', [])
-           .controller('ExampleController', ['$scope', '$window', function($scope, $window) {
-             $scope.greeting = 'Hello, World!';
-             $scope.doGreeting = function(greeting) {
-               $window.alert(greeting);
-             };
-           }]);
-       </script>
-       <div ng-controller="ExampleController">
-         <input type="text" ng-model="greeting" aria-label="greeting" />
-         <button ng-click="doGreeting(greeting)">ALERT</button>
-       </div>
-     </file>
-     <file name="protractor.js" type="protractor">
-      it('should display the greeting in the input box', function() {
-       element(by.model('greeting')).sendKeys('Hello, E2E Tests');
-       // If we click the button it will block the test runner
-       // element(':button').click();
-      });
-     </file>
-   </example>
- */
-function $WindowProvider() {
-  this.$get = valueFn(window);
-}
-
-/**
- * @name $$cookieReader
- * @requires $document
- *
- * @description
- * This is a private service for reading cookies used by $http and ngCookies
- *
- * @return {Object} a key/value map of the current cookies
- */
-function $$CookieReader($document) {
-  var rawDocument = $document[0] || {};
-  var lastCookies = {};
-  var lastCookieString = '';
-
-  function safeDecodeURIComponent(str) {
-    try {
-      return decodeURIComponent(str);
-    } catch (e) {
-      return str;
-    }
-  }
-
-  return function() {
-    var cookieArray, cookie, i, index, name;
-    var currentCookieString = rawDocument.cookie || '';
-
-    if (currentCookieString !== lastCookieString) {
-      lastCookieString = currentCookieString;
-      cookieArray = lastCookieString.split('; ');
-      lastCookies = {};
-
-      for (i = 0; i < cookieArray.length; i++) {
-        cookie = cookieArray[i];
-        index = cookie.indexOf('=');
-        if (index > 0) { //ignore nameless cookies
-          name = safeDecodeURIComponent(cookie.substring(0, index));
-          // the first value that is seen for a cookie is the most
-          // specific one.  values for the same cookie name that
-          // follow are for less specific paths.
-          if (isUndefined(lastCookies[name])) {
-            lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));
-          }
-        }
-      }
-    }
-    return lastCookies;
-  };
-}
-
-$$CookieReader.$inject = ['$document'];
-
-function $$CookieReaderProvider() {
-  this.$get = $$CookieReader;
-}
-
-/* global currencyFilter: true,
- dateFilter: true,
- filterFilter: true,
- jsonFilter: true,
- limitToFilter: true,
- lowercaseFilter: true,
- numberFilter: true,
- orderByFilter: true,
- uppercaseFilter: true,
- */
-
-/**
- * @ngdoc provider
- * @name $filterProvider
- * @description
- *
- * Filters are just functions which transform input to an output. However filters need to be
- * Dependency Injected. To achieve this a filter definition consists of a factory function which is
- * annotated with dependencies and is responsible for creating a filter function.
- *
- * <div class="alert alert-warning">
- * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.
- * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace
- * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores
- * (`myapp_subsection_filterx`).
- * </div>
- *
- * ```js
- *   // Filter registration
- *   function MyModule($provide, $filterProvider) {
- *     // create a service to demonstrate injection (not always needed)
- *     $provide.value('greet', function(name){
- *       return 'Hello ' + name + '!';
- *     });
- *
- *     // register a filter factory which uses the
- *     // greet service to demonstrate DI.
- *     $filterProvider.register('greet', function(greet){
- *       // return the filter function which uses the greet service
- *       // to generate salutation
- *       return function(text) {
- *         // filters need to be forgiving so check input validity
- *         return text && greet(text) || text;
- *       };
- *     });
- *   }
- * ```
- *
- * The filter function is registered with the `$injector` under the filter name suffix with
- * `Filter`.
- *
- * ```js
- *   it('should be the same instance', inject(
- *     function($filterProvider) {
- *       $filterProvider.register('reverse', function(){
- *         return ...;
- *       });
- *     },
- *     function($filter, reverseFilter) {
- *       expect($filter('reverse')).toBe(reverseFilter);
- *     });
- * ```
- *
- *
- * For more information about how angular filters work, and how to create your own filters, see
- * {@link guide/filter Filters} in the Angular Developer Guide.
- */
-
-/**
- * @ngdoc service
- * @name $filter
- * @kind function
- * @description
- * Filters are used for formatting data displayed to the user.
- *
- * The general syntax in templates is as follows:
- *
- *         {{ expression [| filter_name[:parameter_value] ... ] }}
- *
- * @param {String} name Name of the filter function to retrieve
- * @return {Function} the filter function
- * @example
-   <example name="$filter" module="filterExample">
-     <file name="index.html">
-       <div ng-controller="MainCtrl">
-        <h3>{{ originalText }}</h3>
-        <h3>{{ filteredText }}</h3>
-       </div>
-     </file>
-
-     <file name="script.js">
-      angular.module('filterExample', [])
-      .controller('MainCtrl', function($scope, $filter) {
-        $scope.originalText = 'hello';
-        $scope.filteredText = $filter('uppercase')($scope.originalText);
-      });
-     </file>
-   </example>
-  */
-$FilterProvider.$inject = ['$provide'];
-function $FilterProvider($provide) {
-  var suffix = 'Filter';
-
-  /**
-   * @ngdoc method
-   * @name $filterProvider#register
-   * @param {string|Object} name Name of the filter function, or an object map of filters where
-   *    the keys are the filter names and the values are the filter factories.
-   *
-   *    <div class="alert alert-warning">
-   *    **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.
-   *    Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace
-   *    your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores
-   *    (`myapp_subsection_filterx`).
-   *    </div>
-    * @param {Function} factory If the first argument was a string, a factory function for the filter to be registered.
-   * @returns {Object} Registered filter instance, or if a map of filters was provided then a map
-   *    of the registered filter instances.
-   */
-  function register(name, factory) {
-    if (isObject(name)) {
-      var filters = {};
-      forEach(name, function(filter, key) {
-        filters[key] = register(key, filter);
-      });
-      return filters;
-    } else {
-      return $provide.factory(name + suffix, factory);
-    }
-  }
-  this.register = register;
-
-  this.$get = ['$injector', function($injector) {
-    return function(name) {
-      return $injector.get(name + suffix);
-    };
-  }];
-
-  ////////////////////////////////////////
-
-  /* global
-    currencyFilter: false,
-    dateFilter: false,
-    filterFilter: false,
-    jsonFilter: false,
-    limitToFilter: false,
-    lowercaseFilter: false,
-    numberFilter: false,
-    orderByFilter: false,
-    uppercaseFilter: false,
-  */
-
-  register('currency', currencyFilter);
-  register('date', dateFilter);
-  register('filter', filterFilter);
-  register('json', jsonFilter);
-  register('limitTo', limitToFilter);
-  register('lowercase', lowercaseFilter);
-  register('number', numberFilter);
-  register('orderBy', orderByFilter);
-  register('uppercase', uppercaseFilter);
-}
-
-/**
- * @ngdoc filter
- * @name filter
- * @kind function
- *
- * @description
- * Selects a subset of items from `array` and returns it as a new array.
- *
- * @param {Array} array The source array.
- * @param {string|Object|function()} expression The predicate to be used for selecting items from
- *   `array`.
- *
- *   Can be one of:
- *
- *   - `string`: The string is used for matching against the contents of the `array`. All strings or
- *     objects with string properties in `array` that match this string will be returned. This also
- *     applies to nested object properties.
- *     The predicate can be negated by prefixing the string with `!`.
- *
- *   - `Object`: A pattern object can be used to filter specific properties on objects contained
- *     by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items
- *     which have property `name` containing "M" and property `phone` containing "1". A special
- *     property name `$` can be used (as in `{$:"text"}`) to accept a match against any
- *     property of the object or its nested object properties. That's equivalent to the simple
- *     substring match with a `string` as described above. The predicate can be negated by prefixing
- *     the string with `!`.
- *     For example `{name: "!M"}` predicate will return an array of items which have property `name`
- *     not containing "M".
- *
- *     Note that a named property will match properties on the same level only, while the special
- *     `$` property will match properties on the same level or deeper. E.g. an array item like
- *     `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but
- *     **will** be matched by `{$: 'John'}`.
- *
- *   - `function(value, index, array)`: A predicate function can be used to write arbitrary filters.
- *     The function is called for each element of the array, with the element, its index, and
- *     the entire array itself as arguments.
- *
- *     The final result is an array of those elements that the predicate returned true for.
- *
- * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in
- *     determining if the expected value (from the filter expression) and actual value (from
- *     the object in the array) should be considered a match.
- *
- *   Can be one of:
- *
- *   - `function(actual, expected)`:
- *     The function will be given the object value and the predicate value to compare and
- *     should return true if both values should be considered equal.
- *
- *   - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.
- *     This is essentially strict comparison of expected and actual.
- *
- *   - `false|undefined`: A short hand for a function which will look for a substring match in case
- *     insensitive way.
- *
- *     Primitive values are converted to strings. Objects are not compared against primitives,
- *     unless they have a custom `toString` method (e.g. `Date` objects).
- *
- * @example
-   <example>
-     <file name="index.html">
-       <div ng-init="friends = [{name:'John', phone:'555-1276'},
-                                {name:'Mary', phone:'800-BIG-MARY'},
-                                {name:'Mike', phone:'555-4321'},
-                                {name:'Adam', phone:'555-5678'},
-                                {name:'Julie', phone:'555-8765'},
-                                {name:'Juliette', phone:'555-5678'}]"></div>
-
-       <label>Search: <input ng-model="searchText"></label>
-       <table id="searchTextResults">
-         <tr><th>Name</th><th>Phone</th></tr>
-         <tr ng-repeat="friend in friends | filter:searchText">
-           <td>{{friend.name}}</td>
-           <td>{{friend.phone}}</td>
-         </tr>
-       </table>
-       <hr>
-       <label>Any: <input ng-model="search.$"></label> <br>
-       <label>Name only <input ng-model="search.name"></label><br>
-       <label>Phone only <input ng-model="search.phone"></label><br>
-       <label>Equality <input type="checkbox" ng-model="strict"></label><br>
-       <table id="searchObjResults">
-         <tr><th>Name</th><th>Phone</th></tr>
-         <tr ng-repeat="friendObj in friends | filter:search:strict">
-           <td>{{friendObj.name}}</td>
-           <td>{{friendObj.phone}}</td>
-         </tr>
-       </table>
-     </file>
-     <file name="protractor.js" type="protractor">
-       var expectFriendNames = function(expectedNames, key) {
-         element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) {
-           arr.forEach(function(wd, i) {
-             expect(wd.getText()).toMatch(expectedNames[i]);
-           });
-         });
-       };
-
-       it('should search across all fields when filtering with a string', function() {
-         var searchText = element(by.model('searchText'));
-         searchText.clear();
-         searchText.sendKeys('m');
-         expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend');
-
-         searchText.clear();
-         searchText.sendKeys('76');
-         expectFriendNames(['John', 'Julie'], 'friend');
-       });
-
-       it('should search in specific fields when filtering with a predicate object', function() {
-         var searchAny = element(by.model('search.$'));
-         searchAny.clear();
-         searchAny.sendKeys('i');
-         expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj');
-       });
-       it('should use a equal comparison when comparator is true', function() {
-         var searchName = element(by.model('search.name'));
-         var strict = element(by.model('strict'));
-         searchName.clear();
-         searchName.sendKeys('Julie');
-         strict.click();
-         expectFriendNames(['Julie'], 'friendObj');
-       });
-     </file>
-   </example>
- */
-function filterFilter() {
-  return function(array, expression, comparator) {
-    if (!isArrayLike(array)) {
-      if (array == null) {
-        return array;
-      } else {
-        throw minErr('filter')('notarray', 'Expected array but received: {0}', array);
-      }
-    }
-
-    var expressionType = getTypeForFilter(expression);
-    var predicateFn;
-    var matchAgainstAnyProp;
-
-    switch (expressionType) {
-      case 'function':
-        predicateFn = expression;
-        break;
-      case 'boolean':
-      case 'null':
-      case 'number':
-      case 'string':
-        matchAgainstAnyProp = true;
-        //jshint -W086
-      case 'object':
-        //jshint +W086
-        predicateFn = createPredicateFn(expression, comparator, matchAgainstAnyProp);
-        break;
-      default:
-        return array;
-    }
-
-    return Array.prototype.filter.call(array, predicateFn);
-  };
-}
-
-// Helper functions for `filterFilter`
-function createPredicateFn(expression, comparator, matchAgainstAnyProp) {
-  var shouldMatchPrimitives = isObject(expression) && ('$' in expression);
-  var predicateFn;
-
-  if (comparator === true) {
-    comparator = equals;
-  } else if (!isFunction(comparator)) {
-    comparator = function(actual, expected) {
-      if (isUndefined(actual)) {
-        // No substring matching against `undefined`
-        return false;
-      }
-      if ((actual === null) || (expected === null)) {
-        // No substring matching against `null`; only match against `null`
-        return actual === expected;
-      }
-      if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {
-        // Should not compare primitives against objects, unless they have custom `toString` method
-        return false;
-      }
-
-      actual = lowercase('' + actual);
-      expected = lowercase('' + expected);
-      return actual.indexOf(expected) !== -1;
-    };
-  }
-
-  predicateFn = function(item) {
-    if (shouldMatchPrimitives && !isObject(item)) {
-      return deepCompare(item, expression.$, comparator, false);
-    }
-    return deepCompare(item, expression, comparator, matchAgainstAnyProp);
-  };
-
-  return predicateFn;
-}
-
-function deepCompare(actual, expected, comparator, matchAgainstAnyProp, dontMatchWholeObject) {
-  var actualType = getTypeForFilter(actual);
-  var expectedType = getTypeForFilter(expected);
-
-  if ((expectedType === 'string') && (expected.charAt(0) === '!')) {
-    return !deepCompare(actual, expected.substring(1), comparator, matchAgainstAnyProp);
-  } else if (isArray(actual)) {
-    // In case `actual` is an array, consider it a match
-    // if ANY of it's items matches `expected`
-    return actual.some(function(item) {
-      return deepCompare(item, expected, comparator, matchAgainstAnyProp);
-    });
-  }
-
-  switch (actualType) {
-    case 'object':
-      var key;
-      if (matchAgainstAnyProp) {
-        for (key in actual) {
-          if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, true)) {
-            return true;
-          }
-        }
-        return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, false);
-      } else if (expectedType === 'object') {
-        for (key in expected) {
-          var expectedVal = expected[key];
-          if (isFunction(expectedVal) || isUndefined(expectedVal)) {
-            continue;
-          }
-
-          var matchAnyProperty = key === '$';
-          var actualVal = matchAnyProperty ? actual : actual[key];
-          if (!deepCompare(actualVal, expectedVal, comparator, matchAnyProperty, matchAnyProperty)) {
-            return false;
-          }
-        }
-        return true;
-      } else {
-        return comparator(actual, expected);
-      }
-      break;
-    case 'function':
-      return false;
-    default:
-      return comparator(actual, expected);
-  }
-}
-
-// Used for easily differentiating between `null` and actual `object`
-function getTypeForFilter(val) {
-  return (val === null) ? 'null' : typeof val;
-}
-
-/**
- * @ngdoc filter
- * @name currency
- * @kind function
- *
- * @description
- * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default
- * symbol for current locale is used.
- *
- * @param {number} amount Input to filter.
- * @param {string=} symbol Currency symbol or identifier to be displayed.
- * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale
- * @returns {string} Formatted number.
- *
- *
- * @example
-   <example module="currencyExample">
-     <file name="index.html">
-       <script>
-         angular.module('currencyExample', [])
-           .controller('ExampleController', ['$scope', function($scope) {
-             $scope.amount = 1234.56;
-           }]);
-       </script>
-       <div ng-controller="ExampleController">
-         <input type="number" ng-model="amount" aria-label="amount"> <br>
-         default currency symbol ($): <span id="currency-default">{{amount | currency}}</span><br>
-         custom currency identifier (USD$): <span id="currency-custom">{{amount | currency:"USD$"}}</span>
-         no fractions (0): <span id="currency-no-fractions">{{amount | currency:"USD$":0}}</span>
-       </div>
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should init with 1234.56', function() {
-         expect(element(by.id('currency-default')).getText()).toBe('$1,234.56');
-         expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56');
-         expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235');
-       });
-       it('should update', function() {
-         if (browser.params.browser == 'safari') {
-           // Safari does not understand the minus key. See
-           // https://github.com/angular/protractor/issues/481
-           return;
-         }
-         element(by.model('amount')).clear();
-         element(by.model('amount')).sendKeys('-1234');
-         expect(element(by.id('currency-default')).getText()).toBe('-$1,234.00');
-         expect(element(by.id('currency-custom')).getText()).toBe('-USD$1,234.00');
-         expect(element(by.id('currency-no-fractions')).getText()).toBe('-USD$1,234');
-       });
-     </file>
-   </example>
- */
-currencyFilter.$inject = ['$locale'];
-function currencyFilter($locale) {
-  var formats = $locale.NUMBER_FORMATS;
-  return function(amount, currencySymbol, fractionSize) {
-    if (isUndefined(currencySymbol)) {
-      currencySymbol = formats.CURRENCY_SYM;
-    }
-
-    if (isUndefined(fractionSize)) {
-      fractionSize = formats.PATTERNS[1].maxFrac;
-    }
-
-    // if null or undefined pass it through
-    return (amount == null)
-        ? amount
-        : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize).
-            replace(/\u00A4/g, currencySymbol);
-  };
-}
-
-/**
- * @ngdoc filter
- * @name number
- * @kind function
- *
- * @description
- * Formats a number as text.
- *
- * If the input is null or undefined, it will just be returned.
- * If the input is infinite (Infinity/-Infinity) the Infinity symbol '∞' is returned.
- * If the input is not a number an empty string is returned.
- *
- *
- * @param {number|string} number Number to format.
- * @param {(number|string)=} fractionSize Number of decimal places to round the number to.
- * If this is not provided then the fraction size is computed from the current locale's number
- * formatting pattern. In the case of the default locale, it will be 3.
- * @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit.
- *
- * @example
-   <example module="numberFilterExample">
-     <file name="index.html">
-       <script>
-         angular.module('numberFilterExample', [])
-           .controller('ExampleController', ['$scope', function($scope) {
-             $scope.val = 1234.56789;
-           }]);
-       </script>
-       <div ng-controller="ExampleController">
-         <label>Enter number: <input ng-model='val'></label><br>
-         Default formatting: <span id='number-default'>{{val | number}}</span><br>
-         No fractions: <span>{{val | number:0}}</span><br>
-         Negative number: <span>{{-val | number:4}}</span>
-       </div>
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should format numbers', function() {
-         expect(element(by.id('number-default')).getText()).toBe('1,234.568');
-         expect(element(by.binding('val | number:0')).getText()).toBe('1,235');
-         expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679');
-       });
-
-       it('should update', function() {
-         element(by.model('val')).clear();
-         element(by.model('val')).sendKeys('3374.333');
-         expect(element(by.id('number-default')).getText()).toBe('3,374.333');
-         expect(element(by.binding('val | number:0')).getText()).toBe('3,374');
-         expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330');
-      });
-     </file>
-   </example>
- */
-
-
-numberFilter.$inject = ['$locale'];
-function numberFilter($locale) {
-  var formats = $locale.NUMBER_FORMATS;
-  return function(number, fractionSize) {
-
-    // if null or undefined pass it through
-    return (number == null)
-        ? number
-        : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,
-                       fractionSize);
-  };
-}
-
-var DECIMAL_SEP = '.';
-function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
-  if (isObject(number)) return '';
-
-  var isNegative = number < 0;
-  number = Math.abs(number);
-
-  var isInfinity = number === Infinity;
-  if (!isInfinity && !isFinite(number)) return '';
-
-  var numStr = number + '',
-      formatedText = '',
-      hasExponent = false,
-      parts = [];
-
-  if (isInfinity) formatedText = '\u221e';
-
-  if (!isInfinity && numStr.indexOf('e') !== -1) {
-    var match = numStr.match(/([\d\.]+)e(-?)(\d+)/);
-    if (match && match[2] == '-' && match[3] > fractionSize + 1) {
-      number = 0;
-    } else {
-      formatedText = numStr;
-      hasExponent = true;
-    }
-  }
-
-  if (!isInfinity && !hasExponent) {
-    var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length;
-
-    // determine fractionSize if it is not specified
-    if (isUndefined(fractionSize)) {
-      fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac);
-    }
-
-    // safely round numbers in JS without hitting imprecisions of floating-point arithmetics
-    // inspired by:
-    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
-    number = +(Math.round(+(number.toString() + 'e' + fractionSize)).toString() + 'e' + -fractionSize);
-
-    var fraction = ('' + number).split(DECIMAL_SEP);
-    var whole = fraction[0];
-    fraction = fraction[1] || '';
-
-    var i, pos = 0,
-        lgroup = pattern.lgSize,
-        group = pattern.gSize;
-
-    if (whole.length >= (lgroup + group)) {
-      pos = whole.length - lgroup;
-      for (i = 0; i < pos; i++) {
-        if ((pos - i) % group === 0 && i !== 0) {
-          formatedText += groupSep;
-        }
-        formatedText += whole.charAt(i);
-      }
-    }
-
-    for (i = pos; i < whole.length; i++) {
-      if ((whole.length - i) % lgroup === 0 && i !== 0) {
-        formatedText += groupSep;
-      }
-      formatedText += whole.charAt(i);
-    }
-
-    // format fraction part.
-    while (fraction.length < fractionSize) {
-      fraction += '0';
-    }
-
-    if (fractionSize && fractionSize !== "0") formatedText += decimalSep + fraction.substr(0, fractionSize);
-  } else {
-    if (fractionSize > 0 && number < 1) {
-      formatedText = number.toFixed(fractionSize);
-      number = parseFloat(formatedText);
-      formatedText = formatedText.replace(DECIMAL_SEP, decimalSep);
-    }
-  }
-
-  if (number === 0) {
-    isNegative = false;
-  }
-
-  parts.push(isNegative ? pattern.negPre : pattern.posPre,
-             formatedText,
-             isNegative ? pattern.negSuf : pattern.posSuf);
-  return parts.join('');
-}
-
-function padNumber(num, digits, trim) {
-  var neg = '';
-  if (num < 0) {
-    neg =  '-';
-    num = -num;
-  }
-  num = '' + num;
-  while (num.length < digits) num = '0' + num;
-  if (trim) {
-    num = num.substr(num.length - digits);
-  }
-  return neg + num;
-}
-
-
-function dateGetter(name, size, offset, trim) {
-  offset = offset || 0;
-  return function(date) {
-    var value = date['get' + name]();
-    if (offset > 0 || value > -offset) {
-      value += offset;
-    }
-    if (value === 0 && offset == -12) value = 12;
-    return padNumber(value, size, trim);
-  };
-}
-
-function dateStrGetter(name, shortForm) {
-  return function(date, formats) {
-    var value = date['get' + name]();
-    var get = uppercase(shortForm ? ('SHORT' + name) : name);
-
-    return formats[get][value];
-  };
-}
-
-function timeZoneGetter(date, formats, offset) {
-  var zone = -1 * offset;
-  var paddedZone = (zone >= 0) ? "+" : "";
-
-  paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) +
-                padNumber(Math.abs(zone % 60), 2);
-
-  return paddedZone;
-}
-
-function getFirstThursdayOfYear(year) {
-    // 0 = index of January
-    var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay();
-    // 4 = index of Thursday (+1 to account for 1st = 5)
-    // 11 = index of *next* Thursday (+1 account for 1st = 12)
-    return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst);
-}
-
-function getThursdayThisWeek(datetime) {
-    return new Date(datetime.getFullYear(), datetime.getMonth(),
-      // 4 = index of Thursday
-      datetime.getDate() + (4 - datetime.getDay()));
-}
-
-function weekGetter(size) {
-   return function(date) {
-      var firstThurs = getFirstThursdayOfYear(date.getFullYear()),
-         thisThurs = getThursdayThisWeek(date);
-
-      var diff = +thisThurs - +firstThurs,
-         result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week
-
-      return padNumber(result, size);
-   };
-}
-
-function ampmGetter(date, formats) {
-  return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];
-}
-
-function eraGetter(date, formats) {
-  return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1];
-}
-
-function longEraGetter(date, formats) {
-  return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1];
-}
-
-var DATE_FORMATS = {
-  yyyy: dateGetter('FullYear', 4),
-    yy: dateGetter('FullYear', 2, 0, true),
-     y: dateGetter('FullYear', 1),
-  MMMM: dateStrGetter('Month'),
-   MMM: dateStrGetter('Month', true),
-    MM: dateGetter('Month', 2, 1),
-     M: dateGetter('Month', 1, 1),
-    dd: dateGetter('Date', 2),
-     d: dateGetter('Date', 1),
-    HH: dateGetter('Hours', 2),
-     H: dateGetter('Hours', 1),
-    hh: dateGetter('Hours', 2, -12),
-     h: dateGetter('Hours', 1, -12),
-    mm: dateGetter('Minutes', 2),
-     m: dateGetter('Minutes', 1),
-    ss: dateGetter('Seconds', 2),
-     s: dateGetter('Seconds', 1),
-     // while ISO 8601 requires fractions to be prefixed with `.` or `,`
-     // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions
-   sss: dateGetter('Milliseconds', 3),
-  EEEE: dateStrGetter('Day'),
-   EEE: dateStrGetter('Day', true),
-     a: ampmGetter,
-     Z: timeZoneGetter,
-    ww: weekGetter(2),
-     w: weekGetter(1),
-     G: eraGetter,
-     GG: eraGetter,
-     GGG: eraGetter,
-     GGGG: longEraGetter
-};
-
-var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,
-    NUMBER_STRING = /^\-?\d+$/;
-
-/**
- * @ngdoc filter
- * @name date
- * @kind function
- *
- * @description
- *   Formats `date` to a string based on the requested `format`.
- *
- *   `format` string can be composed of the following elements:
- *
- *   * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)
- *   * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
- *   * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)
- *   * `'MMMM'`: Month in year (January-December)
- *   * `'MMM'`: Month in year (Jan-Dec)
- *   * `'MM'`: Month in year, padded (01-12)
- *   * `'M'`: Month in year (1-12)
- *   * `'dd'`: Day in month, padded (01-31)
- *   * `'d'`: Day in month (1-31)
- *   * `'EEEE'`: Day in Week,(Sunday-Saturday)
- *   * `'EEE'`: Day in Week, (Sun-Sat)
- *   * `'HH'`: Hour in day, padded (00-23)
- *   * `'H'`: Hour in day (0-23)
- *   * `'hh'`: Hour in AM/PM, padded (01-12)
- *   * `'h'`: Hour in AM/PM, (1-12)
- *   * `'mm'`: Minute in hour, padded (00-59)
- *   * `'m'`: Minute in hour (0-59)
- *   * `'ss'`: Second in minute, padded (00-59)
- *   * `'s'`: Second in minute (0-59)
- *   * `'sss'`: Millisecond in second, padded (000-999)
- *   * `'a'`: AM/PM marker
- *   * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200)
- *   * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year
- *   * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year
- *   * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD')
- *   * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini')
- *
- *   `format` string can also be one of the following predefined
- *   {@link guide/i18n localizable formats}:
- *
- *   * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale
- *     (e.g. Sep 3, 2010 12:05:08 PM)
- *   * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US  locale (e.g. 9/3/10 12:05 PM)
- *   * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US  locale
- *     (e.g. Friday, September 3, 2010)
- *   * `'longDate'`: equivalent to `'MMMM d, y'` for en_US  locale (e.g. September 3, 2010)
- *   * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US  locale (e.g. Sep 3, 2010)
- *   * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)
- *   * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM)
- *   * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM)
- *
- *   `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g.
- *   `"h 'in the morning'"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence
- *   (e.g. `"h 'o''clock'"`).
- *
- * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or
- *    number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its
- *    shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is
- *    specified in the string input, the time is considered to be in the local timezone.
- * @param {string=} format Formatting rules (see Description). If not specified,
- *    `mediumDate` is used.
- * @param {string=} timezone Timezone to be used for formatting. It understands UTC/GMT and the
- *    continental US time zone abbreviations, but for general use, use a time zone offset, for
- *    example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)
- *    If not specified, the timezone of the browser will be used.
- * @returns {string} Formatted string or the input if input is not recognized as date/millis.
- *
- * @example
-   <example>
-     <file name="index.html">
-       <span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>:
-           <span>{{1288323623006 | date:'medium'}}</span><br>
-       <span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:
-          <span>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span><br>
-       <span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:
-          <span>{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}</span><br>
-       <span ng-non-bindable>{{1288323623006 | date:"MM/dd/yyyy 'at' h:mma"}}</span>:
-          <span>{{'1288323623006' | date:"MM/dd/yyyy 'at' h:mma"}}</span><br>
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should format date', function() {
-         expect(element(by.binding("1288323623006 | date:'medium'")).getText()).
-            toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/);
-         expect(element(by.binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).getText()).
-            toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} (\-|\+)?\d{4}/);
-         expect(element(by.binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).getText()).
-            toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/);
-         expect(element(by.binding("'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"")).getText()).
-            toMatch(/10\/2\d\/2010 at \d{1,2}:\d{2}(AM|PM)/);
-       });
-     </file>
-   </example>
- */
-dateFilter.$inject = ['$locale'];
-function dateFilter($locale) {
-
-
-  var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
-                     // 1        2       3         4          5          6          7          8  9     10      11
-  function jsonStringToDate(string) {
-    var match;
-    if (match = string.match(R_ISO8601_STR)) {
-      var date = new Date(0),
-          tzHour = 0,
-          tzMin  = 0,
-          dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,
-          timeSetter = match[8] ? date.setUTCHours : date.setHours;
-
-      if (match[9]) {
-        tzHour = toInt(match[9] + match[10]);
-        tzMin = toInt(match[9] + match[11]);
-      }
-      dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));
-      var h = toInt(match[4] || 0) - tzHour;
-      var m = toInt(match[5] || 0) - tzMin;
-      var s = toInt(match[6] || 0);
-      var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);
-      timeSetter.call(date, h, m, s, ms);
-      return date;
-    }
-    return string;
-  }
-
-
-  return function(date, format, timezone) {
-    var text = '',
-        parts = [],
-        fn, match;
-
-    format = format || 'mediumDate';
-    format = $locale.DATETIME_FORMATS[format] || format;
-    if (isString(date)) {
-      date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date);
-    }
-
-    if (isNumber(date)) {
-      date = new Date(date);
-    }
-
-    if (!isDate(date) || !isFinite(date.getTime())) {
-      return date;
-    }
-
-    while (format) {
-      match = DATE_FORMATS_SPLIT.exec(format);
-      if (match) {
-        parts = concat(parts, match, 1);
-        format = parts.pop();
-      } else {
-        parts.push(format);
-        format = null;
-      }
-    }
-
-    var dateTimezoneOffset = date.getTimezoneOffset();
-    if (timezone) {
-      dateTimezoneOffset = timezoneToOffset(timezone, date.getTimezoneOffset());
-      date = convertTimezoneToLocal(date, timezone, true);
-    }
-    forEach(parts, function(value) {
-      fn = DATE_FORMATS[value];
-      text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset)
-                 : value.replace(/(^'|'$)/g, '').replace(/''/g, "'");
-    });
-
-    return text;
-  };
-}
-
-
-/**
- * @ngdoc filter
- * @name json
- * @kind function
- *
- * @description
- *   Allows you to convert a JavaScript object into JSON string.
- *
- *   This filter is mostly useful for debugging. When using the double curly {{value}} notation
- *   the binding is automatically converted to JSON.
- *
- * @param {*} object Any JavaScript object (including arrays and primitive types) to filter.
- * @param {number=} spacing The number of spaces to use per indentation, defaults to 2.
- * @returns {string} JSON string.
- *
- *
- * @example
-   <example>
-     <file name="index.html">
-       <pre id="default-spacing">{{ {'name':'value'} | json }}</pre>
-       <pre id="custom-spacing">{{ {'name':'value'} | json:4 }}</pre>
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should jsonify filtered objects', function() {
-         expect(element(by.id('default-spacing')).getText()).toMatch(/\{\n  "name": ?"value"\n}/);
-         expect(element(by.id('custom-spacing')).getText()).toMatch(/\{\n    "name": ?"value"\n}/);
-       });
-     </file>
-   </example>
- *
- */
-function jsonFilter() {
-  return function(object, spacing) {
-    if (isUndefined(spacing)) {
-        spacing = 2;
-    }
-    return toJson(object, spacing);
-  };
-}
-
-
-/**
- * @ngdoc filter
- * @name lowercase
- * @kind function
- * @description
- * Converts string to lowercase.
- * @see angular.lowercase
- */
-var lowercaseFilter = valueFn(lowercase);
-
-
-/**
- * @ngdoc filter
- * @name uppercase
- * @kind function
- * @description
- * Converts string to uppercase.
- * @see angular.uppercase
- */
-var uppercaseFilter = valueFn(uppercase);
-
-/**
- * @ngdoc filter
- * @name limitTo
- * @kind function
- *
- * @description
- * Creates a new array or string containing only a specified number of elements. The elements
- * are taken from either the beginning or the end of the source array, string or number, as specified by
- * the value and sign (positive or negative) of `limit`. If a number is used as input, it is
- * converted to a string.
- *
- * @param {Array|string|number} input Source array, string or number to be limited.
- * @param {string|number} limit The length of the returned array or string. If the `limit` number
- *     is positive, `limit` number of items from the beginning of the source array/string are copied.
- *     If the number is negative, `limit` number  of items from the end of the source array/string
- *     are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined,
- *     the input will be returned unchanged.
- * @param {(string|number)=} begin Index at which to begin limitation. As a negative index, `begin`
- *     indicates an offset from the end of `input`. Defaults to `0`.
- * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array
- *     had less than `limit` elements.
- *
- * @example
-   <example module="limitToExample">
-     <file name="index.html">
-       <script>
-         angular.module('limitToExample', [])
-           .controller('ExampleController', ['$scope', function($scope) {
-             $scope.numbers = [1,2,3,4,5,6,7,8,9];
-             $scope.letters = "abcdefghi";
-             $scope.longNumber = 2345432342;
-             $scope.numLimit = 3;
-             $scope.letterLimit = 3;
-             $scope.longNumberLimit = 3;
-           }]);
-       </script>
-       <div ng-controller="ExampleController">
-         <label>
-            Limit {{numbers}} to:
-            <input type="number" step="1" ng-model="numLimit">
-         </label>
-         <p>Output numbers: {{ numbers | limitTo:numLimit }}</p>
-         <label>
-            Limit {{letters}} to:
-            <input type="number" step="1" ng-model="letterLimit">
-         </label>
-         <p>Output letters: {{ letters | limitTo:letterLimit }}</p>
-         <label>
-            Limit {{longNumber}} to:
-            <input type="number" step="1" ng-model="longNumberLimit">
-         </label>
-         <p>Output long number: {{ longNumber | limitTo:longNumberLimit }}</p>
-       </div>
-     </file>
-     <file name="protractor.js" type="protractor">
-       var numLimitInput = element(by.model('numLimit'));
-       var letterLimitInput = element(by.model('letterLimit'));
-       var longNumberLimitInput = element(by.model('longNumberLimit'));
-       var limitedNumbers = element(by.binding('numbers | limitTo:numLimit'));
-       var limitedLetters = element(by.binding('letters | limitTo:letterLimit'));
-       var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit'));
-
-       it('should limit the number array to first three items', function() {
-         expect(numLimitInput.getAttribute('value')).toBe('3');
-         expect(letterLimitInput.getAttribute('value')).toBe('3');
-         expect(longNumberLimitInput.getAttribute('value')).toBe('3');
-         expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]');
-         expect(limitedLetters.getText()).toEqual('Output letters: abc');
-         expect(limitedLongNumber.getText()).toEqual('Output long number: 234');
-       });
-
-       // There is a bug in safari and protractor that doesn't like the minus key
-       // it('should update the output when -3 is entered', function() {
-       //   numLimitInput.clear();
-       //   numLimitInput.sendKeys('-3');
-       //   letterLimitInput.clear();
-       //   letterLimitInput.sendKeys('-3');
-       //   longNumberLimitInput.clear();
-       //   longNumberLimitInput.sendKeys('-3');
-       //   expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]');
-       //   expect(limitedLetters.getText()).toEqual('Output letters: ghi');
-       //   expect(limitedLongNumber.getText()).toEqual('Output long number: 342');
-       // });
-
-       it('should not exceed the maximum size of input array', function() {
-         numLimitInput.clear();
-         numLimitInput.sendKeys('100');
-         letterLimitInput.clear();
-         letterLimitInput.sendKeys('100');
-         longNumberLimitInput.clear();
-         longNumberLimitInput.sendKeys('100');
-         expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]');
-         expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi');
-         expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342');
-       });
-     </file>
-   </example>
-*/
-function limitToFilter() {
-  return function(input, limit, begin) {
-    if (Math.abs(Number(limit)) === Infinity) {
-      limit = Number(limit);
-    } else {
-      limit = toInt(limit);
-    }
-    if (isNaN(limit)) return input;
-
-    if (isNumber(input)) input = input.toString();
-    if (!isArray(input) && !isString(input)) return input;
-
-    begin = (!begin || isNaN(begin)) ? 0 : toInt(begin);
-    begin = (begin < 0 && begin >= -input.length) ? input.length + begin : begin;
-
-    if (limit >= 0) {
-      return input.slice(begin, begin + limit);
-    } else {
-      if (begin === 0) {
-        return input.slice(limit, input.length);
-      } else {
-        return input.slice(Math.max(0, begin + limit), begin);
-      }
-    }
-  };
-}
-
-/**
- * @ngdoc filter
- * @name orderBy
- * @kind function
- *
- * @description
- * Orders a specified `array` by the `expression` predicate. It is ordered alphabetically
- * for strings and numerically for numbers. Note: if you notice numbers are not being sorted
- * as expected, make sure they are actually being saved as numbers and not strings.
- *
- * @param {Array} array The array to sort.
- * @param {function(*)|string|Array.<(function(*)|string)>=} expression A predicate to be
- *    used by the comparator to determine the order of elements.
- *
- *    Can be one of:
- *
- *    - `function`: Getter function. The result of this function will be sorted using the
- *      `<`, `===`, `>` operator.
- *    - `string`: An Angular expression. The result of this expression is used to compare elements
- *      (for example `name` to sort by a property called `name` or `name.substr(0, 3)` to sort by
- *      3 first characters of a property called `name`). The result of a constant expression
- *      is interpreted as a property name to be used in comparisons (for example `"special name"`
- *      to sort object by the value of their `special name` property). An expression can be
- *      optionally prefixed with `+` or `-` to control ascending or descending sort order
- *      (for example, `+name` or `-name`). If no property is provided, (e.g. `'+'`) then the array
- *      element itself is used to compare where sorting.
- *    - `Array`: An array of function or string predicates. The first predicate in the array
- *      is used for sorting, but when two items are equivalent, the next predicate is used.
- *
- *    If the predicate is missing or empty then it defaults to `'+'`.
- *
- * @param {boolean=} reverse Reverse the order of the array.
- * @returns {Array} Sorted copy of the source array.
- *
- *
- * @example
- * The example below demonstrates a simple ngRepeat, where the data is sorted
- * by age in descending order (predicate is set to `'-age'`).
- * `reverse` is not set, which means it defaults to `false`.
-   <example module="orderByExample">
-     <file name="index.html">
-       <script>
-         angular.module('orderByExample', [])
-           .controller('ExampleController', ['$scope', function($scope) {
-             $scope.friends =
-                 [{name:'John', phone:'555-1212', age:10},
-                  {name:'Mary', phone:'555-9876', age:19},
-                  {name:'Mike', phone:'555-4321', age:21},
-                  {name:'Adam', phone:'555-5678', age:35},
-                  {name:'Julie', phone:'555-8765', age:29}];
-           }]);
-       </script>
-       <div ng-controller="ExampleController">
-         <table class="friend">
-           <tr>
-             <th>Name</th>
-             <th>Phone Number</th>
-             <th>Age</th>
-           </tr>
-           <tr ng-repeat="friend in friends | orderBy:'-age'">
-             <td>{{friend.name}}</td>
-             <td>{{friend.phone}}</td>
-             <td>{{friend.age}}</td>
-           </tr>
-         </table>
-       </div>
-     </file>
-   </example>
- *
- * The predicate and reverse parameters can be controlled dynamically through scope properties,
- * as shown in the next example.
- * @example
-   <example module="orderByExample">
-     <file name="index.html">
-       <script>
-         angular.module('orderByExample', [])
-           .controller('ExampleController', ['$scope', function($scope) {
-             $scope.friends =
-                 [{name:'John', phone:'555-1212', age:10},
-                  {name:'Mary', phone:'555-9876', age:19},
-                  {name:'Mike', phone:'555-4321', age:21},
-                  {name:'Adam', phone:'555-5678', age:35},
-                  {name:'Julie', phone:'555-8765', age:29}];
-             $scope.predicate = 'age';
-             $scope.reverse = true;
-             $scope.order = function(predicate) {
-               $scope.reverse = ($scope.predicate === predicate) ? !$scope.reverse : false;
-               $scope.predicate = predicate;
-             };
-           }]);
-       </script>
-       <style type="text/css">
-         .sortorder:after {
-           content: '\25b2';
-         }
-         .sortorder.reverse:after {
-           content: '\25bc';
-         }
-       </style>
-       <div ng-controller="ExampleController">
-         <pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>
-         <hr/>
-         [ <a href="" ng-click="predicate=''">unsorted</a> ]
-         <table class="friend">
-           <tr>
-             <th>
-               <a href="" ng-click="order('name')">Name</a>
-               <span class="sortorder" ng-show="predicate === 'name'" ng-class="{reverse:reverse}"></span>
-             </th>
-             <th>
-               <a href="" ng-click="order('phone')">Phone Number</a>
-               <span class="sortorder" ng-show="predicate === 'phone'" ng-class="{reverse:reverse}"></span>
-             </th>
-             <th>
-               <a href="" ng-click="order('age')">Age</a>
-               <span class="sortorder" ng-show="predicate === 'age'" ng-class="{reverse:reverse}"></span>
-             </th>
-           </tr>
-           <tr ng-repeat="friend in friends | orderBy:predicate:reverse">
-             <td>{{friend.name}}</td>
-             <td>{{friend.phone}}</td>
-             <td>{{friend.age}}</td>
-           </tr>
-         </table>
-       </div>
-     </file>
-   </example>
- *
- * It's also possible to call the orderBy filter manually, by injecting `$filter`, retrieving the
- * filter routine with `$filter('orderBy')`, and calling the returned filter routine with the
- * desired parameters.
- *
- * Example:
- *
- * @example
-  <example module="orderByExample">
-    <file name="index.html">
-      <div ng-controller="ExampleController">
-        <table class="friend">
-          <tr>
-            <th><a href="" ng-click="reverse=false;order('name', false)">Name</a>
-              (<a href="" ng-click="order('-name',false)">^</a>)</th>
-            <th><a href="" ng-click="reverse=!reverse;order('phone', reverse)">Phone Number</a></th>
-            <th><a href="" ng-click="reverse=!reverse;order('age',reverse)">Age</a></th>
-          </tr>
-          <tr ng-repeat="friend in friends">
-            <td>{{friend.name}}</td>
-            <td>{{friend.phone}}</td>
-            <td>{{friend.age}}</td>
-          </tr>
-        </table>
-      </div>
-    </file>
-
-    <file name="script.js">
-      angular.module('orderByExample', [])
-        .controller('ExampleController', ['$scope', '$filter', function($scope, $filter) {
-          var orderBy = $filter('orderBy');
-          $scope.friends = [
-            { name: 'John',    phone: '555-1212',    age: 10 },
-            { name: 'Mary',    phone: '555-9876',    age: 19 },
-            { name: 'Mike',    phone: '555-4321',    age: 21 },
-            { name: 'Adam',    phone: '555-5678',    age: 35 },
-            { name: 'Julie',   phone: '555-8765',    age: 29 }
-          ];
-          $scope.order = function(predicate, reverse) {
-            $scope.friends = orderBy($scope.friends, predicate, reverse);
-          };
-          $scope.order('-age',false);
-        }]);
-    </file>
-</example>
- */
-orderByFilter.$inject = ['$parse'];
-function orderByFilter($parse) {
-  return function(array, sortPredicate, reverseOrder) {
-
-    if (!(isArrayLike(array))) return array;
-
-    if (!isArray(sortPredicate)) { sortPredicate = [sortPredicate]; }
-    if (sortPredicate.length === 0) { sortPredicate = ['+']; }
-
-    var predicates = processPredicates(sortPredicate, reverseOrder);
-    // Add a predicate at the end that evaluates to the element index. This makes the
-    // sort stable as it works as a tie-breaker when all the input predicates cannot
-    // distinguish between two elements.
-    predicates.push({ get: function() { return {}; }, descending: reverseOrder ? -1 : 1});
-
-    // The next three lines are a version of a Swartzian Transform idiom from Perl
-    // (sometimes called the Decorate-Sort-Undecorate idiom)
-    // See https://en.wikipedia.org/wiki/Schwartzian_transform
-    var compareValues = Array.prototype.map.call(array, getComparisonObject);
-    compareValues.sort(doComparison);
-    array = compareValues.map(function(item) { return item.value; });
-
-    return array;
-
-    function getComparisonObject(value, index) {
-      return {
-        value: value,
-        predicateValues: predicates.map(function(predicate) {
-          return getPredicateValue(predicate.get(value), index);
-        })
-      };
-    }
-
-    function doComparison(v1, v2) {
-      var result = 0;
-      for (var index=0, length = predicates.length; index < length; ++index) {
-        result = compare(v1.predicateValues[index], v2.predicateValues[index]) * predicates[index].descending;
-        if (result) break;
-      }
-      return result;
-    }
-  };
-
-  function processPredicates(sortPredicate, reverseOrder) {
-    reverseOrder = reverseOrder ? -1 : 1;
-    return sortPredicate.map(function(predicate) {
-      var descending = 1, get = identity;
-
-      if (isFunction(predicate)) {
-        get = predicate;
-      } else if (isString(predicate)) {
-        if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {
-          descending = predicate.charAt(0) == '-' ? -1 : 1;
-          predicate = predicate.substring(1);
-        }
-        if (predicate !== '') {
-          get = $parse(predicate);
-          if (get.constant) {
-            var key = get();
-            get = function(value) { return value[key]; };
-          }
-        }
-      }
-      return { get: get, descending: descending * reverseOrder };
-    });
-  }
-
-  function isPrimitive(value) {
-    switch (typeof value) {
-      case 'number': /* falls through */
-      case 'boolean': /* falls through */
-      case 'string':
-        return true;
-      default:
-        return false;
-    }
-  }
-
-  function objectValue(value, index) {
-    // If `valueOf` is a valid function use that
-    if (typeof value.valueOf === 'function') {
-      value = value.valueOf();
-      if (isPrimitive(value)) return value;
-    }
-    // If `toString` is a valid function and not the one from `Object.prototype` use that
-    if (hasCustomToString(value)) {
-      value = value.toString();
-      if (isPrimitive(value)) return value;
-    }
-    // We have a basic object so we use the position of the object in the collection
-    return index;
-  }
-
-  function getPredicateValue(value, index) {
-    var type = typeof value;
-    if (value === null) {
-      type = 'string';
-      value = 'null';
-    } else if (type === 'string') {
-      value = value.toLowerCase();
-    } else if (type === 'object') {
-      value = objectValue(value, index);
-    }
-    return { value: value, type: type };
-  }
-
-  function compare(v1, v2) {
-    var result = 0;
-    if (v1.type === v2.type) {
-      if (v1.value !== v2.value) {
-        result = v1.value < v2.value ? -1 : 1;
-      }
-    } else {
-      result = v1.type < v2.type ? -1 : 1;
-    }
-    return result;
-  }
-}
-
-function ngDirective(directive) {
-  if (isFunction(directive)) {
-    directive = {
-      link: directive
-    };
-  }
-  directive.restrict = directive.restrict || 'AC';
-  return valueFn(directive);
-}
-
-/**
- * @ngdoc directive
- * @name a
- * @restrict E
- *
- * @description
- * Modifies the default behavior of the html A tag so that the default action is prevented when
- * the href attribute is empty.
- *
- * This change permits the easy creation of action links with the `ngClick` directive
- * without changing the location or causing page reloads, e.g.:
- * `<a href="" ng-click="list.addItem()">Add Item</a>`
- */
-var htmlAnchorDirective = valueFn({
-  restrict: 'E',
-  compile: function(element, attr) {
-    if (!attr.href && !attr.xlinkHref) {
-      return function(scope, element) {
-        // If the linked element is not an anchor tag anymore, do nothing
-        if (element[0].nodeName.toLowerCase() !== 'a') return;
-
-        // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
-        var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?
-                   'xlink:href' : 'href';
-        element.on('click', function(event) {
-          // if we have no href url, then don't navigate anywhere.
-          if (!element.attr(href)) {
-            event.preventDefault();
-          }
-        });
-      };
-    }
-  }
-});
-
-/**
- * @ngdoc directive
- * @name ngHref
- * @restrict A
- * @priority 99
- *
- * @description
- * Using Angular markup like `{{hash}}` in an href attribute will
- * make the link go to the wrong URL if the user clicks it before
- * Angular has a chance to replace the `{{hash}}` markup with its
- * value. Until Angular replaces the markup the link will be broken
- * and will most likely return a 404 error. The `ngHref` directive
- * solves this problem.
- *
- * The wrong way to write it:
- * ```html
- * <a href="http://www.gravatar.com/avatar/{{hash}}">link1</a>
- * ```
- *
- * The correct way to write it:
- * ```html
- * <a ng-href="http://www.gravatar.com/avatar/{{hash}}">link1</a>
- * ```
- *
- * @element A
- * @param {template} ngHref any string which can contain `{{}}` markup.
- *
- * @example
- * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes
- * in links and their different behaviors:
-    <example>
-      <file name="index.html">
-        <input ng-model="value" /><br />
-        <a id="link-1" href ng-click="value = 1">link 1</a> (link, don't reload)<br />
-        <a id="link-2" href="" ng-click="value = 2">link 2</a> (link, don't reload)<br />
-        <a id="link-3" ng-href="/{{'123'}}">link 3</a> (link, reload!)<br />
-        <a id="link-4" href="" name="xx" ng-click="value = 4">anchor</a> (link, don't reload)<br />
-        <a id="link-5" name="xxx" ng-click="value = 5">anchor</a> (no link)<br />
-        <a id="link-6" ng-href="{{value}}">link</a> (link, change location)
-      </file>
-      <file name="protractor.js" type="protractor">
-        it('should execute ng-click but not reload when href without value', function() {
-          element(by.id('link-1')).click();
-          expect(element(by.model('value')).getAttribute('value')).toEqual('1');
-          expect(element(by.id('link-1')).getAttribute('href')).toBe('');
-        });
-
-        it('should execute ng-click but not reload when href empty string', function() {
-          element(by.id('link-2')).click();
-          expect(element(by.model('value')).getAttribute('value')).toEqual('2');
-          expect(element(by.id('link-2')).getAttribute('href')).toBe('');
-        });
-
-        it('should execute ng-click and change url when ng-href specified', function() {
-          expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\/123$/);
-
-          element(by.id('link-3')).click();
-
-          // At this point, we navigate away from an Angular page, so we need
-          // to use browser.driver to get the base webdriver.
-
-          browser.wait(function() {
-            return browser.driver.getCurrentUrl().then(function(url) {
-              return url.match(/\/123$/);
-            });
-          }, 5000, 'page should navigate to /123');
-        });
-
-        it('should execute ng-click but not reload when href empty string and name specified', function() {
-          element(by.id('link-4')).click();
-          expect(element(by.model('value')).getAttribute('value')).toEqual('4');
-          expect(element(by.id('link-4')).getAttribute('href')).toBe('');
-        });
-
-        it('should execute ng-click but not reload when no href but name specified', function() {
-          element(by.id('link-5')).click();
-          expect(element(by.model('value')).getAttribute('value')).toEqual('5');
-          expect(element(by.id('link-5')).getAttribute('href')).toBe(null);
-        });
-
-        it('should only change url when only ng-href', function() {
-          element(by.model('value')).clear();
-          element(by.model('value')).sendKeys('6');
-          expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\/6$/);
-
-          element(by.id('link-6')).click();
-
-          // At this point, we navigate away from an Angular page, so we need
-          // to use browser.driver to get the base webdriver.
-          browser.wait(function() {
-            return browser.driver.getCurrentUrl().then(function(url) {
-              return url.match(/\/6$/);
-            });
-          }, 5000, 'page should navigate to /6');
-        });
-      </file>
-    </example>
- */
-
-/**
- * @ngdoc directive
- * @name ngSrc
- * @restrict A
- * @priority 99
- *
- * @description
- * Using Angular markup like `{{hash}}` in a `src` attribute doesn't
- * work right: The browser will fetch from the URL with the literal
- * text `{{hash}}` until Angular replaces the expression inside
- * `{{hash}}`. The `ngSrc` directive solves this problem.
- *
- * The buggy way to write it:
- * ```html
- * <img src="http://www.gravatar.com/avatar/{{hash}}" alt="Description"/>
- * ```
- *
- * The correct way to write it:
- * ```html
- * <img ng-src="http://www.gravatar.com/avatar/{{hash}}" alt="Description" />
- * ```
- *
- * @element IMG
- * @param {template} ngSrc any string which can contain `{{}}` markup.
- */
-
-/**
- * @ngdoc directive
- * @name ngSrcset
- * @restrict A
- * @priority 99
- *
- * @description
- * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't
- * work right: The browser will fetch from the URL with the literal
- * text `{{hash}}` until Angular replaces the expression inside
- * `{{hash}}`. The `ngSrcset` directive solves this problem.
- *
- * The buggy way to write it:
- * ```html
- * <img srcset="http://www.gravatar.com/avatar/{{hash}} 2x" alt="Description"/>
- * ```
- *
- * The correct way to write it:
- * ```html
- * <img ng-srcset="http://www.gravatar.com/avatar/{{hash}} 2x" alt="Description" />
- * ```
- *
- * @element IMG
- * @param {template} ngSrcset any string which can contain `{{}}` markup.
- */
-
-/**
- * @ngdoc directive
- * @name ngDisabled
- * @restrict A
- * @priority 100
- *
- * @description
- *
- * This directive sets the `disabled` attribute on the element if the
- * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy.
- *
- * A special directive is necessary because we cannot use interpolation inside the `disabled`
- * attribute.  The following example would make the button enabled on Chrome/Firefox
- * but not on older IEs:
- *
- * ```html
- * <!-- See below for an example of ng-disabled being used correctly -->
- * <div ng-init="isDisabled = false">
- *  <button disabled="{{isDisabled}}">Disabled</button>
- * </div>
- * ```
- *
- * This is because the HTML specification does not require browsers to preserve the values of
- * boolean attributes such as `disabled` (Their presence means true and their absence means false.)
- * If we put an Angular interpolation expression into such an attribute then the
- * binding information would be lost when the browser removes the attribute.
- *
- * @example
-    <example>
-      <file name="index.html">
-        <label>Click me to toggle: <input type="checkbox" ng-model="checked"></label><br/>
-        <button ng-model="button" ng-disabled="checked">Button</button>
-      </file>
-      <file name="protractor.js" type="protractor">
-        it('should toggle button', function() {
-          expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy();
-          element(by.model('checked')).click();
-          expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy();
-        });
-      </file>
-    </example>
- *
- * @element INPUT
- * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,
- *     then the `disabled` attribute will be set on the element
- */
-
-
-/**
- * @ngdoc directive
- * @name ngChecked
- * @restrict A
- * @priority 100
- *
- * @description
- * Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy.
- *
- * Note that this directive should not be used together with {@link ngModel `ngModel`},
- * as this can lead to unexpected behavior.
- *
- * ### Why do we need `ngChecked`?
- *
- * The HTML specification does not require browsers to preserve the values of boolean attributes
- * such as checked. (Their presence means true and their absence means false.)
- * If we put an Angular interpolation expression into such an attribute then the
- * binding information would be lost when the browser removes the attribute.
- * The `ngChecked` directive solves this problem for the `checked` attribute.
- * This complementary directive is not removed by the browser and so provides
- * a permanent reliable place to store the binding information.
- * @example
-    <example>
-      <file name="index.html">
-        <label>Check me to check both: <input type="checkbox" ng-model="master"></label><br/>
-        <input id="checkSlave" type="checkbox" ng-checked="master" aria-label="Slave input">
-      </file>
-      <file name="protractor.js" type="protractor">
-        it('should check both checkBoxes', function() {
-          expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();
-          element(by.model('master')).click();
-          expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();
-        });
-      </file>
-    </example>
- *
- * @element INPUT
- * @param {expression} ngChecked If the {@link guide/expression expression} is truthy,
- *     then the `checked` attribute will be set on the element
- */
-
-
-/**
- * @ngdoc directive
- * @name ngReadonly
- * @restrict A
- * @priority 100
- *
- * @description
- * The HTML specification does not require browsers to preserve the values of boolean attributes
- * such as readonly. (Their presence means true and their absence means false.)
- * If we put an Angular interpolation expression into such an attribute then the
- * binding information would be lost when the browser removes the attribute.
- * The `ngReadonly` directive solves this problem for the `readonly` attribute.
- * This complementary directive is not removed by the browser and so provides
- * a permanent reliable place to store the binding information.
- * @example
-    <example>
-      <file name="index.html">
-        <label>Check me to make text readonly: <input type="checkbox" ng-model="checked"></label><br/>
-        <input type="text" ng-readonly="checked" value="I'm Angular" aria-label="Readonly field" />
-      </file>
-      <file name="protractor.js" type="protractor">
-        it('should toggle readonly attr', function() {
-          expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeFalsy();
-          element(by.model('checked')).click();
-          expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeTruthy();
-        });
-      </file>
-    </example>
- *
- * @element INPUT
- * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,
- *     then special attribute "readonly" will be set on the element
- */
-
-
-/**
- * @ngdoc directive
- * @name ngSelected
- * @restrict A
- * @priority 100
- *
- * @description
- * The HTML specification does not require browsers to preserve the values of boolean attributes
- * such as selected. (Their presence means true and their absence means false.)
- * If we put an Angular interpolation expression into such an attribute then the
- * binding information would be lost when the browser removes the attribute.
- * The `ngSelected` directive solves this problem for the `selected` attribute.
- * This complementary directive is not removed by the browser and so provides
- * a permanent reliable place to store the binding information.
- *
- * @example
-    <example>
-      <file name="index.html">
-        <label>Check me to select: <input type="checkbox" ng-model="selected"></label><br/>
-        <select aria-label="ngSelected demo">
-          <option>Hello!</option>
-          <option id="greet" ng-selected="selected">Greetings!</option>
-        </select>
-      </file>
-      <file name="protractor.js" type="protractor">
-        it('should select Greetings!', function() {
-          expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();
-          element(by.model('selected')).click();
-          expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();
-        });
-      </file>
-    </example>
- *
- * @element OPTION
- * @param {expression} ngSelected If the {@link guide/expression expression} is truthy,
- *     then special attribute "selected" will be set on the element
- */
-
-/**
- * @ngdoc directive
- * @name ngOpen
- * @restrict A
- * @priority 100
- *
- * @description
- * The HTML specification does not require browsers to preserve the values of boolean attributes
- * such as open. (Their presence means true and their absence means false.)
- * If we put an Angular interpolation expression into such an attribute then the
- * binding information would be lost when the browser removes the attribute.
- * The `ngOpen` directive solves this problem for the `open` attribute.
- * This complementary directive is not removed by the browser and so provides
- * a permanent reliable place to store the binding information.
- * @example
-     <example>
-       <file name="index.html">
-         <label>Check me check multiple: <input type="checkbox" ng-model="open"></label><br/>
-         <details id="details" ng-open="open">
-            <summary>Show/Hide me</summary>
-         </details>
-       </file>
-       <file name="protractor.js" type="protractor">
-         it('should toggle open', function() {
-           expect(element(by.id('details')).getAttribute('open')).toBeFalsy();
-           element(by.model('open')).click();
-           expect(element(by.id('details')).getAttribute('open')).toBeTruthy();
-         });
-       </file>
-     </example>
- *
- * @element DETAILS
- * @param {expression} ngOpen If the {@link guide/expression expression} is truthy,
- *     then special attribute "open" will be set on the element
- */
-
-var ngAttributeAliasDirectives = {};
-
-// boolean attrs are evaluated
-forEach(BOOLEAN_ATTR, function(propName, attrName) {
-  // binding to multiple is not supported
-  if (propName == "multiple") return;
-
-  function defaultLinkFn(scope, element, attr) {
-    scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
-      attr.$set(attrName, !!value);
-    });
-  }
-
-  var normalized = directiveNormalize('ng-' + attrName);
-  var linkFn = defaultLinkFn;
-
-  if (propName === 'checked') {
-    linkFn = function(scope, element, attr) {
-      // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input
-      if (attr.ngModel !== attr[normalized]) {
-        defaultLinkFn(scope, element, attr);
-      }
-    };
-  }
-
-  ngAttributeAliasDirectives[normalized] = function() {
-    return {
-      restrict: 'A',
-      priority: 100,
-      link: linkFn
-    };
-  };
-});
-
-// aliased input attrs are evaluated
-forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {
-  ngAttributeAliasDirectives[ngAttr] = function() {
-    return {
-      priority: 100,
-      link: function(scope, element, attr) {
-        //special case ngPattern when a literal regular expression value
-        //is used as the expression (this way we don't have to watch anything).
-        if (ngAttr === "ngPattern" && attr.ngPattern.charAt(0) == "/") {
-          var match = attr.ngPattern.match(REGEX_STRING_REGEXP);
-          if (match) {
-            attr.$set("ngPattern", new RegExp(match[1], match[2]));
-            return;
-          }
-        }
-
-        scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) {
-          attr.$set(ngAttr, value);
-        });
-      }
-    };
-  };
-});
-
-// ng-src, ng-srcset, ng-href are interpolated
-forEach(['src', 'srcset', 'href'], function(attrName) {
-  var normalized = directiveNormalize('ng-' + attrName);
-  ngAttributeAliasDirectives[normalized] = function() {
-    return {
-      priority: 99, // it needs to run after the attributes are interpolated
-      link: function(scope, element, attr) {
-        var propName = attrName,
-            name = attrName;
-
-        if (attrName === 'href' &&
-            toString.call(element.prop('href')) === '[object SVGAnimatedString]') {
-          name = 'xlinkHref';
-          attr.$attr[name] = 'xlink:href';
-          propName = null;
-        }
-
-        attr.$observe(normalized, function(value) {
-          if (!value) {
-            if (attrName === 'href') {
-              attr.$set(name, null);
-            }
-            return;
-          }
-
-          attr.$set(name, value);
-
-          // on IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist
-          // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need
-          // to set the property as well to achieve the desired effect.
-          // we use attr[attrName] value since $set can sanitize the url.
-          if (msie && propName) element.prop(propName, attr[name]);
-        });
-      }
-    };
-  };
-});
-
-/* global -nullFormCtrl, -SUBMITTED_CLASS, addSetValidityMethod: true
- */
-var nullFormCtrl = {
-  $addControl: noop,
-  $$renameControl: nullFormRenameControl,
-  $removeControl: noop,
-  $setValidity: noop,
-  $setDirty: noop,
-  $setPristine: noop,
-  $setSubmitted: noop
-},
-SUBMITTED_CLASS = 'ng-submitted';
-
-function nullFormRenameControl(control, name) {
-  control.$name = name;
-}
-
-/**
- * @ngdoc type
- * @name form.FormController
- *
- * @property {boolean} $pristine True if user has not interacted with the form yet.
- * @property {boolean} $dirty True if user has already interacted with the form.
- * @property {boolean} $valid True if all of the containing forms and controls are valid.
- * @property {boolean} $invalid True if at least one containing control or form is invalid.
- * @property {boolean} $pending True if at least one containing control or form is pending.
- * @property {boolean} $submitted True if user has submitted the form even if its invalid.
- *
- * @property {Object} $error Is an object hash, containing references to controls or
- *  forms with failing validators, where:
- *
- *  - keys are validation tokens (error names),
- *  - values are arrays of controls or forms that have a failing validator for given error name.
- *
- *  Built-in validation tokens:
- *
- *  - `email`
- *  - `max`
- *  - `maxlength`
- *  - `min`
- *  - `minlength`
- *  - `number`
- *  - `pattern`
- *  - `required`
- *  - `url`
- *  - `date`
- *  - `datetimelocal`
- *  - `time`
- *  - `week`
- *  - `month`
- *
- * @description
- * `FormController` keeps track of all its controls and nested forms as well as the state of them,
- * such as being valid/invalid or dirty/pristine.
- *
- * Each {@link ng.directive:form form} directive creates an instance
- * of `FormController`.
- *
- */
-//asks for $scope to fool the BC controller module
-FormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate'];
-function FormController(element, attrs, $scope, $animate, $interpolate) {
-  var form = this,
-      controls = [];
-
-  // init state
-  form.$error = {};
-  form.$$success = {};
-  form.$pending = undefined;
-  form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope);
-  form.$dirty = false;
-  form.$pristine = true;
-  form.$valid = true;
-  form.$invalid = false;
-  form.$submitted = false;
-  form.$$parentForm = nullFormCtrl;
-
-  /**
-   * @ngdoc method
-   * @name form.FormController#$rollbackViewValue
-   *
-   * @description
-   * Rollback all form controls pending updates to the `$modelValue`.
-   *
-   * Updates may be pending by a debounced event or because the input is waiting for a some future
-   * event defined in `ng-model-options`. This method is typically needed by the reset button of
-   * a form that uses `ng-model-options` to pend updates.
-   */
-  form.$rollbackViewValue = function() {
-    forEach(controls, function(control) {
-      control.$rollbackViewValue();
-    });
-  };
-
-  /**
-   * @ngdoc method
-   * @name form.FormController#$commitViewValue
-   *
-   * @description
-   * Commit all form controls pending updates to the `$modelValue`.
-   *
-   * Updates may be pending by a debounced event or because the input is waiting for a some future
-   * event defined in `ng-model-options`. This method is rarely needed as `NgModelController`
-   * usually handles calling this in response to input events.
-   */
-  form.$commitViewValue = function() {
-    forEach(controls, function(control) {
-      control.$commitViewValue();
-    });
-  };
-
-  /**
-   * @ngdoc method
-   * @name form.FormController#$addControl
-   * @param {object} control control object, either a {@link form.FormController} or an
-   * {@link ngModel.NgModelController}
-   *
-   * @description
-   * Register a control with the form. Input elements using ngModelController do this automatically
-   * when they are linked.
-   *
-   * Note that the current state of the control will not be reflected on the new parent form. This
-   * is not an issue with normal use, as freshly compiled and linked controls are in a `$pristine`
-   * state.
-   *
-   * However, if the method is used programmatically, for example by adding dynamically created controls,
-   * or controls that have been previously removed without destroying their corresponding DOM element,
-   * it's the developers responsiblity to make sure the current state propagates to the parent form.
-   *
-   * For example, if an input control is added that is already `$dirty` and has `$error` properties,
-   * calling `$setDirty()` and `$validate()` afterwards will propagate the state to the parent form.
-   */
-  form.$addControl = function(control) {
-    // Breaking change - before, inputs whose name was "hasOwnProperty" were quietly ignored
-    // and not added to the scope.  Now we throw an error.
-    assertNotHasOwnProperty(control.$name, 'input');
-    controls.push(control);
-
-    if (control.$name) {
-      form[control.$name] = control;
-    }
-
-    control.$$parentForm = form;
-  };
-
-  // Private API: rename a form control
-  form.$$renameControl = function(control, newName) {
-    var oldName = control.$name;
-
-    if (form[oldName] === control) {
-      delete form[oldName];
-    }
-    form[newName] = control;
-    control.$name = newName;
-  };
-
-  /**
-   * @ngdoc method
-   * @name form.FormController#$removeControl
-   * @param {object} control control object, either a {@link form.FormController} or an
-   * {@link ngModel.NgModelController}
-   *
-   * @description
-   * Deregister a control from the form.
-   *
-   * Input elements using ngModelController do this automatically when they are destroyed.
-   *
-   * Note that only the removed control's validation state (`$errors`etc.) will be removed from the
-   * form. `$dirty`, `$submitted` states will not be changed, because the expected behavior can be
-   * different from case to case. For example, removing the only `$dirty` control from a form may or
-   * may not mean that the form is still `$dirty`.
-   */
-  form.$removeControl = function(control) {
-    if (control.$name && form[control.$name] === control) {
-      delete form[control.$name];
-    }
-    forEach(form.$pending, function(value, name) {
-      form.$setValidity(name, null, control);
-    });
-    forEach(form.$error, function(value, name) {
-      form.$setValidity(name, null, control);
-    });
-    forEach(form.$$success, function(value, name) {
-      form.$setValidity(name, null, control);
-    });
-
-    arrayRemove(controls, control);
-    control.$$parentForm = nullFormCtrl;
-  };
-
-
-  /**
-   * @ngdoc method
-   * @name form.FormController#$setValidity
-   *
-   * @description
-   * Sets the validity of a form control.
-   *
-   * This method will also propagate to parent forms.
-   */
-  addSetValidityMethod({
-    ctrl: this,
-    $element: element,
-    set: function(object, property, controller) {
-      var list = object[property];
-      if (!list) {
-        object[property] = [controller];
-      } else {
-        var index = list.indexOf(controller);
-        if (index === -1) {
-          list.push(controller);
-        }
-      }
-    },
-    unset: function(object, property, controller) {
-      var list = object[property];
-      if (!list) {
-        return;
-      }
-      arrayRemove(list, controller);
-      if (list.length === 0) {
-        delete object[property];
-      }
-    },
-    $animate: $animate
-  });
-
-  /**
-   * @ngdoc method
-   * @name form.FormController#$setDirty
-   *
-   * @description
-   * Sets the form to a dirty state.
-   *
-   * This method can be called to add the 'ng-dirty' class and set the form to a dirty
-   * state (ng-dirty class). This method will also propagate to parent forms.
-   */
-  form.$setDirty = function() {
-    $animate.removeClass(element, PRISTINE_CLASS);
-    $animate.addClass(element, DIRTY_CLASS);
-    form.$dirty = true;
-    form.$pristine = false;
-    form.$$parentForm.$setDirty();
-  };
-
-  /**
-   * @ngdoc method
-   * @name form.FormController#$setPristine
-   *
-   * @description
-   * Sets the form to its pristine state.
-   *
-   * This method can be called to remove the 'ng-dirty' class and set the form to its pristine
-   * state (ng-pristine class). This method will also propagate to all the controls contained
-   * in this form.
-   *
-   * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after
-   * saving or resetting it.
-   */
-  form.$setPristine = function() {
-    $animate.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS);
-    form.$dirty = false;
-    form.$pristine = true;
-    form.$submitted = false;
-    forEach(controls, function(control) {
-      control.$setPristine();
-    });
-  };
-
-  /**
-   * @ngdoc method
-   * @name form.FormController#$setUntouched
-   *
-   * @description
-   * Sets the form to its untouched state.
-   *
-   * This method can be called to remove the 'ng-touched' class and set the form controls to their
-   * untouched state (ng-untouched class).
-   *
-   * Setting a form controls back to their untouched state is often useful when setting the form
-   * back to its pristine state.
-   */
-  form.$setUntouched = function() {
-    forEach(controls, function(control) {
-      control.$setUntouched();
-    });
-  };
-
-  /**
-   * @ngdoc method
-   * @name form.FormController#$setSubmitted
-   *
-   * @description
-   * Sets the form to its submitted state.
-   */
-  form.$setSubmitted = function() {
-    $animate.addClass(element, SUBMITTED_CLASS);
-    form.$submitted = true;
-    form.$$parentForm.$setSubmitted();
-  };
-}
-
-/**
- * @ngdoc directive
- * @name ngForm
- * @restrict EAC
- *
- * @description
- * Nestable alias of {@link ng.directive:form `form`} directive. HTML
- * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a
- * sub-group of controls needs to be determined.
- *
- * Note: the purpose of `ngForm` is to group controls,
- * but not to be a replacement for the `<form>` tag with all of its capabilities
- * (e.g. posting to the server, ...).
- *
- * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into
- *                       related scope, under this name.
- *
- */
-
- /**
- * @ngdoc directive
- * @name form
- * @restrict E
- *
- * @description
- * Directive that instantiates
- * {@link form.FormController FormController}.
- *
- * If the `name` attribute is specified, the form controller is published onto the current scope under
- * this name.
- *
- * # Alias: {@link ng.directive:ngForm `ngForm`}
- *
- * In Angular, forms can be nested. This means that the outer form is valid when all of the child
- * forms are valid as well. However, browsers do not allow nesting of `<form>` elements, so
- * Angular provides the {@link ng.directive:ngForm `ngForm`} directive which behaves identically to
- * `<form>` but can be nested.  This allows you to have nested forms, which is very useful when
- * using Angular validation directives in forms that are dynamically generated using the
- * {@link ng.directive:ngRepeat `ngRepeat`} directive. Since you cannot dynamically generate the `name`
- * attribute of input elements using interpolation, you have to wrap each set of repeated inputs in an
- * `ngForm` directive and nest these in an outer `form` element.
- *
- *
- * # CSS classes
- *  - `ng-valid` is set if the form is valid.
- *  - `ng-invalid` is set if the form is invalid.
- *  - `ng-pending` is set if the form is pending.
- *  - `ng-pristine` is set if the form is pristine.
- *  - `ng-dirty` is set if the form is dirty.
- *  - `ng-submitted` is set if the form was submitted.
- *
- * Keep in mind that ngAnimate can detect each of these classes when added and removed.
- *
- *
- * # Submitting a form and preventing the default action
- *
- * Since the role of forms in client-side Angular applications is different than in classical
- * roundtrip apps, it is desirable for the browser not to translate the form submission into a full
- * page reload that sends the data to the server. Instead some javascript logic should be triggered
- * to handle the form submission in an application-specific way.
- *
- * For this reason, Angular prevents the default action (form submission to the server) unless the
- * `<form>` element has an `action` attribute specified.
- *
- * You can use one of the following two ways to specify what javascript method should be called when
- * a form is submitted:
- *
- * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element
- * - {@link ng.directive:ngClick ngClick} directive on the first
-  *  button or input field of type submit (input[type=submit])
- *
- * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit}
- * or {@link ng.directive:ngClick ngClick} directives.
- * This is because of the following form submission rules in the HTML specification:
- *
- * - If a form has only one input field then hitting enter in this field triggers form submit
- * (`ngSubmit`)
- * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter
- * doesn't trigger submit
- * - if a form has one or more input fields and one or more buttons or input[type=submit] then
- * hitting enter in any of the input fields will trigger the click handler on the *first* button or
- * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`)
- *
- * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is
- * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`
- * to have access to the updated model.
- *
- * ## Animation Hooks
- *
- * Animations in ngForm are triggered when any of the associated CSS classes are added and removed.
- * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any
- * other validations that are performed within the form. Animations in ngForm are similar to how
- * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well
- * as JS animations.
- *
- * The following example shows a simple way to utilize CSS transitions to style a form element
- * that has been rendered as invalid after it has been validated:
- *
- * <pre>
- * //be sure to include ngAnimate as a module to hook into more
- * //advanced animations
- * .my-form {
- *   transition:0.5s linear all;
- *   background: white;
- * }
- * .my-form.ng-invalid {
- *   background: red;
- *   color:white;
- * }
- * </pre>
- *
- * @example
-    <example deps="angular-animate.js" animations="true" fixBase="true" module="formExample">
-      <file name="index.html">
-       <script>
-         angular.module('formExample', [])
-           .controller('FormController', ['$scope', function($scope) {
-             $scope.userType = 'guest';
-           }]);
-       </script>
-       <style>
-        .my-form {
-          transition:all linear 0.5s;
-          background: transparent;
-        }
-        .my-form.ng-invalid {
-          background: red;
-        }
-       </style>
-       <form name="myForm" ng-controller="FormController" class="my-form">
-         userType: <input name="input" ng-model="userType" required>
-         <span class="error" ng-show="myForm.input.$error.required">Required!</span><br>
-         <code>userType = {{userType}}</code><br>
-         <code>myForm.input.$valid = {{myForm.input.$valid}}</code><br>
-         <code>myForm.input.$error = {{myForm.input.$error}}</code><br>
-         <code>myForm.$valid = {{myForm.$valid}}</code><br>
-         <code>myForm.$error.required = {{!!myForm.$error.required}}</code><br>
-        </form>
-      </file>
-      <file name="protractor.js" type="protractor">
-        it('should initialize to model', function() {
-          var userType = element(by.binding('userType'));
-          var valid = element(by.binding('myForm.input.$valid'));
-
-          expect(userType.getText()).toContain('guest');
-          expect(valid.getText()).toContain('true');
-        });
-
-        it('should be invalid if empty', function() {
-          var userType = element(by.binding('userType'));
-          var valid = element(by.binding('myForm.input.$valid'));
-          var userInput = element(by.model('userType'));
-
-          userInput.clear();
-          userInput.sendKeys('');
-
-          expect(userType.getText()).toEqual('userType =');
-          expect(valid.getText()).toContain('false');
-        });
-      </file>
-    </example>
- *
- * @param {string=} name Name of the form. If specified, the form controller will be published into
- *                       related scope, under this name.
- */
-var formDirectiveFactory = function(isNgForm) {
-  return ['$timeout', '$parse', function($timeout, $parse) {
-    var formDirective = {
-      name: 'form',
-      restrict: isNgForm ? 'EAC' : 'E',
-      require: ['form', '^^?form'], //first is the form's own ctrl, second is an optional parent form
-      controller: FormController,
-      compile: function ngFormCompile(formElement, attr) {
-        // Setup initial state of the control
-        formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);
-
-        var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false);
-
-        return {
-          pre: function ngFormPreLink(scope, formElement, attr, ctrls) {
-            var controller = ctrls[0];
-
-            // if `action` attr is not present on the form, prevent the default action (submission)
-            if (!('action' in attr)) {
-              // we can't use jq events because if a form is destroyed during submission the default
-              // action is not prevented. see #1238
-              //
-              // IE 9 is not affected because it doesn't fire a submit event and try to do a full
-              // page reload if the form was destroyed by submission of the form via a click handler
-              // on a button in the form. Looks like an IE9 specific bug.
-              var handleFormSubmission = function(event) {
-                scope.$apply(function() {
-                  controller.$commitViewValue();
-                  controller.$setSubmitted();
-                });
-
-                event.preventDefault();
-              };
-
-              addEventListenerFn(formElement[0], 'submit', handleFormSubmission);
-
-              // unregister the preventDefault listener so that we don't not leak memory but in a
-              // way that will achieve the prevention of the default action.
-              formElement.on('$destroy', function() {
-                $timeout(function() {
-                  removeEventListenerFn(formElement[0], 'submit', handleFormSubmission);
-                }, 0, false);
-              });
-            }
-
-            var parentFormCtrl = ctrls[1] || controller.$$parentForm;
-            parentFormCtrl.$addControl(controller);
-
-            var setter = nameAttr ? getSetter(controller.$name) : noop;
-
-            if (nameAttr) {
-              setter(scope, controller);
-              attr.$observe(nameAttr, function(newValue) {
-                if (controller.$name === newValue) return;
-                setter(scope, undefined);
-                controller.$$parentForm.$$renameControl(controller, newValue);
-                setter = getSetter(controller.$name);
-                setter(scope, controller);
-              });
-            }
-            formElement.on('$destroy', function() {
-              controller.$$parentForm.$removeControl(controller);
-              setter(scope, undefined);
-              extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards
-            });
-          }
-        };
-      }
-    };
-
-    return formDirective;
-
-    function getSetter(expression) {
-      if (expression === '') {
-        //create an assignable expression, so forms with an empty name can be renamed later
-        return $parse('this[""]').assign;
-      }
-      return $parse(expression).assign || noop;
-    }
-  }];
-};
-
-var formDirective = formDirectiveFactory();
-var ngFormDirective = formDirectiveFactory(true);
-
-/* global VALID_CLASS: false,
-  INVALID_CLASS: false,
-  PRISTINE_CLASS: false,
-  DIRTY_CLASS: false,
-  UNTOUCHED_CLASS: false,
-  TOUCHED_CLASS: false,
-  ngModelMinErr: false,
-*/
-
-// Regex code is obtained from SO: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231
-var ISO_DATE_REGEXP = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/;
-var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
-var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;
-var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/;
-var DATE_REGEXP = /^(\d{4})-(\d{2})-(\d{2})$/;
-var DATETIMELOCAL_REGEXP = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/;
-var WEEK_REGEXP = /^(\d{4})-W(\d\d)$/;
-var MONTH_REGEXP = /^(\d{4})-(\d\d)$/;
-var TIME_REGEXP = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/;
-
-var inputType = {
-
-  /**
-   * @ngdoc input
-   * @name input[text]
-   *
-   * @description
-   * Standard HTML text input with angular data binding, inherited by most of the `input` elements.
-   *
-   *
-   * @param {string} ngModel Assignable angular expression to data-bind to.
-   * @param {string=} name Property name of the form under which the control is published.
-   * @param {string=} required Adds `required` validation error key if the value is not entered.
-   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
-   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
-   *    `required` when you want to data-bind to the `required` attribute.
-   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
-   *    minlength.
-   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
-   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
-   *    any length.
-   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
-   *    that contains the regular expression body that will be converted to a regular expression
-   *    as in the ngPattern directive.
-   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
-   *    a RegExp found by evaluating the Angular expression given in the attribute value.
-   *    If the expression evaluates to a RegExp object, then this is used directly.
-   *    If the expression evaluates to a string, then it will be converted to a RegExp
-   *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
-   *    `new RegExp('^abc$')`.<br />
-   *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
-   *    start at the index of the last search's match, thus not taking the whole input value into
-   *    account.
-   * @param {string=} ngChange Angular expression to be executed when input changes due to user
-   *    interaction with the input element.
-   * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.
-   *    This parameter is ignored for input[type=password] controls, which will never trim the
-   *    input.
-   *
-   * @example
-      <example name="text-input-directive" module="textInputExample">
-        <file name="index.html">
-         <script>
-           angular.module('textInputExample', [])
-             .controller('ExampleController', ['$scope', function($scope) {
-               $scope.example = {
-                 text: 'guest',
-                 word: /^\s*\w*\s*$/
-               };
-             }]);
-         </script>
-         <form name="myForm" ng-controller="ExampleController">
-           <label>Single word:
-             <input type="text" name="input" ng-model="example.text"
-                    ng-pattern="example.word" required ng-trim="false">
-           </label>
-           <div role="alert">
-             <span class="error" ng-show="myForm.input.$error.required">
-               Required!</span>
-             <span class="error" ng-show="myForm.input.$error.pattern">
-               Single word only!</span>
-           </div>
-           <tt>text = {{example.text}}</tt><br/>
-           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
-           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
-           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
-           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
-          </form>
-        </file>
-        <file name="protractor.js" type="protractor">
-          var text = element(by.binding('example.text'));
-          var valid = element(by.binding('myForm.input.$valid'));
-          var input = element(by.model('example.text'));
-
-          it('should initialize to model', function() {
-            expect(text.getText()).toContain('guest');
-            expect(valid.getText()).toContain('true');
-          });
-
-          it('should be invalid if empty', function() {
-            input.clear();
-            input.sendKeys('');
-
-            expect(text.getText()).toEqual('text =');
-            expect(valid.getText()).toContain('false');
-          });
-
-          it('should be invalid if multi word', function() {
-            input.clear();
-            input.sendKeys('hello world');
-
-            expect(valid.getText()).toContain('false');
-          });
-        </file>
-      </example>
-   */
-  'text': textInputType,
-
-    /**
-     * @ngdoc input
-     * @name input[date]
-     *
-     * @description
-     * Input with date validation and transformation. In browsers that do not yet support
-     * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601
-     * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many
-     * modern browsers do not yet support this input type, it is important to provide cues to users on the
-     * expected input format via a placeholder or label.
-     *
-     * The model must always be a Date object, otherwise Angular will throw an error.
-     * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
-     *
-     * The timezone to be used to read/write the `Date` instance in the model can be defined using
-     * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
-     *
-     * @param {string} ngModel Assignable angular expression to data-bind to.
-     * @param {string=} name Property name of the form under which the control is published.
-     * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a
-     *   valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute
-     *   (e.g. `min="{{minDate | date:'yyyy-MM-dd'}}"`). Note that `min` will also add native HTML5
-     *   constraint validation.
-     * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be
-     *   a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute
-     *   (e.g. `max="{{maxDate | date:'yyyy-MM-dd'}}"`). Note that `max` will also add native HTML5
-     *   constraint validation.
-     * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO date string
-     *   the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
-     * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO date string
-     *   the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
-     * @param {string=} required Sets `required` validation error key if the value is not entered.
-     * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
-     *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
-     *    `required` when you want to data-bind to the `required` attribute.
-     * @param {string=} ngChange Angular expression to be executed when input changes due to user
-     *    interaction with the input element.
-     *
-     * @example
-     <example name="date-input-directive" module="dateInputExample">
-     <file name="index.html">
-       <script>
-          angular.module('dateInputExample', [])
-            .controller('DateController', ['$scope', function($scope) {
-              $scope.example = {
-                value: new Date(2013, 9, 22)
-              };
-            }]);
-       </script>
-       <form name="myForm" ng-controller="DateController as dateCtrl">
-          <label for="exampleInput">Pick a date in 2013:</label>
-          <input type="date" id="exampleInput" name="input" ng-model="example.value"
-              placeholder="yyyy-MM-dd" min="2013-01-01" max="2013-12-31" required />
-          <div role="alert">
-            <span class="error" ng-show="myForm.input.$error.required">
-                Required!</span>
-            <span class="error" ng-show="myForm.input.$error.date">
-                Not a valid date!</span>
-           </div>
-           <tt>value = {{example.value | date: "yyyy-MM-dd"}}</tt><br/>
-           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
-           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
-           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
-           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
-       </form>
-     </file>
-     <file name="protractor.js" type="protractor">
-        var value = element(by.binding('example.value | date: "yyyy-MM-dd"'));
-        var valid = element(by.binding('myForm.input.$valid'));
-        var input = element(by.model('example.value'));
-
-        // currently protractor/webdriver does not support
-        // sending keys to all known HTML5 input controls
-        // for various browsers (see https://github.com/angular/protractor/issues/562).
-        function setInput(val) {
-          // set the value of the element and force validation.
-          var scr = "var ipt = document.getElementById('exampleInput'); " +
-          "ipt.value = '" + val + "';" +
-          "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });";
-          browser.executeScript(scr);
-        }
-
-        it('should initialize to model', function() {
-          expect(value.getText()).toContain('2013-10-22');
-          expect(valid.getText()).toContain('myForm.input.$valid = true');
-        });
-
-        it('should be invalid if empty', function() {
-          setInput('');
-          expect(value.getText()).toEqual('value =');
-          expect(valid.getText()).toContain('myForm.input.$valid = false');
-        });
-
-        it('should be invalid if over max', function() {
-          setInput('2015-01-01');
-          expect(value.getText()).toContain('');
-          expect(valid.getText()).toContain('myForm.input.$valid = false');
-        });
-     </file>
-     </example>
-     */
-  'date': createDateInputType('date', DATE_REGEXP,
-         createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']),
-         'yyyy-MM-dd'),
-
-   /**
-    * @ngdoc input
-    * @name input[datetime-local]
-    *
-    * @description
-    * Input with datetime validation and transformation. In browsers that do not yet support
-    * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
-    * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`.
-    *
-    * The model must always be a Date object, otherwise Angular will throw an error.
-    * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
-    *
-    * The timezone to be used to read/write the `Date` instance in the model can be defined using
-    * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
-    *
-    * @param {string} ngModel Assignable angular expression to data-bind to.
-    * @param {string=} name Property name of the form under which the control is published.
-    * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
-    *   This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation
-    *   inside this attribute (e.g. `min="{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`).
-    *   Note that `min` will also add native HTML5 constraint validation.
-    * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
-    *   This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation
-    *   inside this attribute (e.g. `max="{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`).
-    *   Note that `max` will also add native HTML5 constraint validation.
-    * @param {(date|string)=} ngMin Sets the `min` validation error key to the Date / ISO datetime string
-    *   the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
-    * @param {(date|string)=} ngMax Sets the `max` validation error key to the Date / ISO datetime string
-    *   the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
-    * @param {string=} required Sets `required` validation error key if the value is not entered.
-    * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
-    *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
-    *    `required` when you want to data-bind to the `required` attribute.
-    * @param {string=} ngChange Angular expression to be executed when input changes due to user
-    *    interaction with the input element.
-    *
-    * @example
-    <example name="datetimelocal-input-directive" module="dateExample">
-    <file name="index.html">
-      <script>
-        angular.module('dateExample', [])
-          .controller('DateController', ['$scope', function($scope) {
-            $scope.example = {
-              value: new Date(2010, 11, 28, 14, 57)
-            };
-          }]);
-      </script>
-      <form name="myForm" ng-controller="DateController as dateCtrl">
-        <label for="exampleInput">Pick a date between in 2013:</label>
-        <input type="datetime-local" id="exampleInput" name="input" ng-model="example.value"
-            placeholder="yyyy-MM-ddTHH:mm:ss" min="2001-01-01T00:00:00" max="2013-12-31T00:00:00" required />
-        <div role="alert">
-          <span class="error" ng-show="myForm.input.$error.required">
-              Required!</span>
-          <span class="error" ng-show="myForm.input.$error.datetimelocal">
-              Not a valid date!</span>
-        </div>
-        <tt>value = {{example.value | date: "yyyy-MM-ddTHH:mm:ss"}}</tt><br/>
-        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
-        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
-        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
-        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
-      </form>
-    </file>
-    <file name="protractor.js" type="protractor">
-      var value = element(by.binding('example.value | date: "yyyy-MM-ddTHH:mm:ss"'));
-      var valid = element(by.binding('myForm.input.$valid'));
-      var input = element(by.model('example.value'));
-
-      // currently protractor/webdriver does not support
-      // sending keys to all known HTML5 input controls
-      // for various browsers (https://github.com/angular/protractor/issues/562).
-      function setInput(val) {
-        // set the value of the element and force validation.
-        var scr = "var ipt = document.getElementById('exampleInput'); " +
-        "ipt.value = '" + val + "';" +
-        "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });";
-        browser.executeScript(scr);
-      }
-
-      it('should initialize to model', function() {
-        expect(value.getText()).toContain('2010-12-28T14:57:00');
-        expect(valid.getText()).toContain('myForm.input.$valid = true');
-      });
-
-      it('should be invalid if empty', function() {
-        setInput('');
-        expect(value.getText()).toEqual('value =');
-        expect(valid.getText()).toContain('myForm.input.$valid = false');
-      });
-
-      it('should be invalid if over max', function() {
-        setInput('2015-01-01T23:59:00');
-        expect(value.getText()).toContain('');
-        expect(valid.getText()).toContain('myForm.input.$valid = false');
-      });
-    </file>
-    </example>
-    */
-  'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP,
-      createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']),
-      'yyyy-MM-ddTHH:mm:ss.sss'),
-
-  /**
-   * @ngdoc input
-   * @name input[time]
-   *
-   * @description
-   * Input with time validation and transformation. In browsers that do not yet support
-   * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
-   * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a
-   * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.
-   *
-   * The model must always be a Date object, otherwise Angular will throw an error.
-   * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
-   *
-   * The timezone to be used to read/write the `Date` instance in the model can be defined using
-   * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
-   *
-   * @param {string} ngModel Assignable angular expression to data-bind to.
-   * @param {string=} name Property name of the form under which the control is published.
-   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
-   *   This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this
-   *   attribute (e.g. `min="{{minTime | date:'HH:mm:ss'}}"`). Note that `min` will also add
-   *   native HTML5 constraint validation.
-   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
-   *   This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this
-   *   attribute (e.g. `max="{{maxTime | date:'HH:mm:ss'}}"`). Note that `max` will also add
-   *   native HTML5 constraint validation.
-   * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO time string the
-   *   `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
-   * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO time string the
-   *   `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
-   * @param {string=} required Sets `required` validation error key if the value is not entered.
-   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
-   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
-   *    `required` when you want to data-bind to the `required` attribute.
-   * @param {string=} ngChange Angular expression to be executed when input changes due to user
-   *    interaction with the input element.
-   *
-   * @example
-   <example name="time-input-directive" module="timeExample">
-   <file name="index.html">
-     <script>
-      angular.module('timeExample', [])
-        .controller('DateController', ['$scope', function($scope) {
-          $scope.example = {
-            value: new Date(1970, 0, 1, 14, 57, 0)
-          };
-        }]);
-     </script>
-     <form name="myForm" ng-controller="DateController as dateCtrl">
-        <label for="exampleInput">Pick a between 8am and 5pm:</label>
-        <input type="time" id="exampleInput" name="input" ng-model="example.value"
-            placeholder="HH:mm:ss" min="08:00:00" max="17:00:00" required />
-        <div role="alert">
-          <span class="error" ng-show="myForm.input.$error.required">
-              Required!</span>
-          <span class="error" ng-show="myForm.input.$error.time">
-              Not a valid date!</span>
-        </div>
-        <tt>value = {{example.value | date: "HH:mm:ss"}}</tt><br/>
-        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
-        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
-        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
-        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
-     </form>
-   </file>
-   <file name="protractor.js" type="protractor">
-      var value = element(by.binding('example.value | date: "HH:mm:ss"'));
-      var valid = element(by.binding('myForm.input.$valid'));
-      var input = element(by.model('example.value'));
-
-      // currently protractor/webdriver does not support
-      // sending keys to all known HTML5 input controls
-      // for various browsers (https://github.com/angular/protractor/issues/562).
-      function setInput(val) {
-        // set the value of the element and force validation.
-        var scr = "var ipt = document.getElementById('exampleInput'); " +
-        "ipt.value = '" + val + "';" +
-        "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });";
-        browser.executeScript(scr);
-      }
-
-      it('should initialize to model', function() {
-        expect(value.getText()).toContain('14:57:00');
-        expect(valid.getText()).toContain('myForm.input.$valid = true');
-      });
-
-      it('should be invalid if empty', function() {
-        setInput('');
-        expect(value.getText()).toEqual('value =');
-        expect(valid.getText()).toContain('myForm.input.$valid = false');
-      });
-
-      it('should be invalid if over max', function() {
-        setInput('23:59:00');
-        expect(value.getText()).toContain('');
-        expect(valid.getText()).toContain('myForm.input.$valid = false');
-      });
-   </file>
-   </example>
-   */
-  'time': createDateInputType('time', TIME_REGEXP,
-      createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']),
-     'HH:mm:ss.sss'),
-
-   /**
-    * @ngdoc input
-    * @name input[week]
-    *
-    * @description
-    * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support
-    * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
-    * week format (yyyy-W##), for example: `2013-W02`.
-    *
-    * The model must always be a Date object, otherwise Angular will throw an error.
-    * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
-    *
-    * The timezone to be used to read/write the `Date` instance in the model can be defined using
-    * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
-    *
-    * @param {string} ngModel Assignable angular expression to data-bind to.
-    * @param {string=} name Property name of the form under which the control is published.
-    * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
-    *   This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this
-    *   attribute (e.g. `min="{{minWeek | date:'yyyy-Www'}}"`). Note that `min` will also add
-    *   native HTML5 constraint validation.
-    * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
-    *   This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this
-    *   attribute (e.g. `max="{{maxWeek | date:'yyyy-Www'}}"`). Note that `max` will also add
-    *   native HTML5 constraint validation.
-    * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string
-    *   the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
-    * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string
-    *   the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
-    * @param {string=} required Sets `required` validation error key if the value is not entered.
-    * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
-    *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
-    *    `required` when you want to data-bind to the `required` attribute.
-    * @param {string=} ngChange Angular expression to be executed when input changes due to user
-    *    interaction with the input element.
-    *
-    * @example
-    <example name="week-input-directive" module="weekExample">
-    <file name="index.html">
-      <script>
-      angular.module('weekExample', [])
-        .controller('DateController', ['$scope', function($scope) {
-          $scope.example = {
-            value: new Date(2013, 0, 3)
-          };
-        }]);
-      </script>
-      <form name="myForm" ng-controller="DateController as dateCtrl">
-        <label>Pick a date between in 2013:
-          <input id="exampleInput" type="week" name="input" ng-model="example.value"
-                 placeholder="YYYY-W##" min="2012-W32"
-                 max="2013-W52" required />
-        </label>
-        <div role="alert">
-          <span class="error" ng-show="myForm.input.$error.required">
-              Required!</span>
-          <span class="error" ng-show="myForm.input.$error.week">
-              Not a valid date!</span>
-        </div>
-        <tt>value = {{example.value | date: "yyyy-Www"}}</tt><br/>
-        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
-        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
-        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
-        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
-      </form>
-    </file>
-    <file name="protractor.js" type="protractor">
-      var value = element(by.binding('example.value | date: "yyyy-Www"'));
-      var valid = element(by.binding('myForm.input.$valid'));
-      var input = element(by.model('example.value'));
-
-      // currently protractor/webdriver does not support
-      // sending keys to all known HTML5 input controls
-      // for various browsers (https://github.com/angular/protractor/issues/562).
-      function setInput(val) {
-        // set the value of the element and force validation.
-        var scr = "var ipt = document.getElementById('exampleInput'); " +
-        "ipt.value = '" + val + "';" +
-        "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });";
-        browser.executeScript(scr);
-      }
-
-      it('should initialize to model', function() {
-        expect(value.getText()).toContain('2013-W01');
-        expect(valid.getText()).toContain('myForm.input.$valid = true');
-      });
-
-      it('should be invalid if empty', function() {
-        setInput('');
-        expect(value.getText()).toEqual('value =');
-        expect(valid.getText()).toContain('myForm.input.$valid = false');
-      });
-
-      it('should be invalid if over max', function() {
-        setInput('2015-W01');
-        expect(value.getText()).toContain('');
-        expect(valid.getText()).toContain('myForm.input.$valid = false');
-      });
-    </file>
-    </example>
-    */
-  'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'),
-
-  /**
-   * @ngdoc input
-   * @name input[month]
-   *
-   * @description
-   * Input with month validation and transformation. In browsers that do not yet support
-   * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
-   * month format (yyyy-MM), for example: `2009-01`.
-   *
-   * The model must always be a Date object, otherwise Angular will throw an error.
-   * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
-   * If the model is not set to the first of the month, the next view to model update will set it
-   * to the first of the month.
-   *
-   * The timezone to be used to read/write the `Date` instance in the model can be defined using
-   * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
-   *
-   * @param {string} ngModel Assignable angular expression to data-bind to.
-   * @param {string=} name Property name of the form under which the control is published.
-   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
-   *   This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this
-   *   attribute (e.g. `min="{{minMonth | date:'yyyy-MM'}}"`). Note that `min` will also add
-   *   native HTML5 constraint validation.
-   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
-   *   This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this
-   *   attribute (e.g. `max="{{maxMonth | date:'yyyy-MM'}}"`). Note that `max` will also add
-   *   native HTML5 constraint validation.
-   * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string
-   *   the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
-   * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string
-   *   the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
-
-   * @param {string=} required Sets `required` validation error key if the value is not entered.
-   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
-   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
-   *    `required` when you want to data-bind to the `required` attribute.
-   * @param {string=} ngChange Angular expression to be executed when input changes due to user
-   *    interaction with the input element.
-   *
-   * @example
-   <example name="month-input-directive" module="monthExample">
-   <file name="index.html">
-     <script>
-      angular.module('monthExample', [])
-        .controller('DateController', ['$scope', function($scope) {
-          $scope.example = {
-            value: new Date(2013, 9, 1)
-          };
-        }]);
-     </script>
-     <form name="myForm" ng-controller="DateController as dateCtrl">
-       <label for="exampleInput">Pick a month in 2013:</label>
-       <input id="exampleInput" type="month" name="input" ng-model="example.value"
-          placeholder="yyyy-MM" min="2013-01" max="2013-12" required />
-       <div role="alert">
-         <span class="error" ng-show="myForm.input.$error.required">
-            Required!</span>
-         <span class="error" ng-show="myForm.input.$error.month">
-            Not a valid month!</span>
-       </div>
-       <tt>value = {{example.value | date: "yyyy-MM"}}</tt><br/>
-       <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
-       <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
-       <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
-       <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
-     </form>
-   </file>
-   <file name="protractor.js" type="protractor">
-      var value = element(by.binding('example.value | date: "yyyy-MM"'));
-      var valid = element(by.binding('myForm.input.$valid'));
-      var input = element(by.model('example.value'));
-
-      // currently protractor/webdriver does not support
-      // sending keys to all known HTML5 input controls
-      // for various browsers (https://github.com/angular/protractor/issues/562).
-      function setInput(val) {
-        // set the value of the element and force validation.
-        var scr = "var ipt = document.getElementById('exampleInput'); " +
-        "ipt.value = '" + val + "';" +
-        "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });";
-        browser.executeScript(scr);
-      }
-
-      it('should initialize to model', function() {
-        expect(value.getText()).toContain('2013-10');
-        expect(valid.getText()).toContain('myForm.input.$valid = true');
-      });
-
-      it('should be invalid if empty', function() {
-        setInput('');
-        expect(value.getText()).toEqual('value =');
-        expect(valid.getText()).toContain('myForm.input.$valid = false');
-      });
-
-      it('should be invalid if over max', function() {
-        setInput('2015-01');
-        expect(value.getText()).toContain('');
-        expect(valid.getText()).toContain('myForm.input.$valid = false');
-      });
-   </file>
-   </example>
-   */
-  'month': createDateInputType('month', MONTH_REGEXP,
-     createDateParser(MONTH_REGEXP, ['yyyy', 'MM']),
-     'yyyy-MM'),
-
-  /**
-   * @ngdoc input
-   * @name input[number]
-   *
-   * @description
-   * Text input with number validation and transformation. Sets the `number` validation
-   * error if not a valid number.
-   *
-   * <div class="alert alert-warning">
-   * The model must always be of type `number` otherwise Angular will throw an error.
-   * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt}
-   * error docs for more information and an example of how to convert your model if necessary.
-   * </div>
-   *
-   * ## Issues with HTML5 constraint validation
-   *
-   * In browsers that follow the
-   * [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29),
-   * `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}.
-   * If a non-number is entered in the input, the browser will report the value as an empty string,
-   * which means the view / model values in `ngModel` and subsequently the scope value
-   * will also be an empty string.
-   *
-   *
-   * @param {string} ngModel Assignable angular expression to data-bind to.
-   * @param {string=} name Property name of the form under which the control is published.
-   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
-   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
-   * @param {string=} required Sets `required` validation error key if the value is not entered.
-   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
-   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
-   *    `required` when you want to data-bind to the `required` attribute.
-   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
-   *    minlength.
-   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
-   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
-   *    any length.
-   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
-   *    that contains the regular expression body that will be converted to a regular expression
-   *    as in the ngPattern directive.
-   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
-   *    a RegExp found by evaluating the Angular expression given in the attribute value.
-   *    If the expression evaluates to a RegExp object, then this is used directly.
-   *    If the expression evaluates to a string, then it will be converted to a RegExp
-   *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
-   *    `new RegExp('^abc$')`.<br />
-   *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
-   *    start at the index of the last search's match, thus not taking the whole input value into
-   *    account.
-   * @param {string=} ngChange Angular expression to be executed when input changes due to user
-   *    interaction with the input element.
-   *
-   * @example
-      <example name="number-input-directive" module="numberExample">
-        <file name="index.html">
-         <script>
-           angular.module('numberExample', [])
-             .controller('ExampleController', ['$scope', function($scope) {
-               $scope.example = {
-                 value: 12
-               };
-             }]);
-         </script>
-         <form name="myForm" ng-controller="ExampleController">
-           <label>Number:
-             <input type="number" name="input" ng-model="example.value"
-                    min="0" max="99" required>
-          </label>
-           <div role="alert">
-             <span class="error" ng-show="myForm.input.$error.required">
-               Required!</span>
-             <span class="error" ng-show="myForm.input.$error.number">
-               Not valid number!</span>
-           </div>
-           <tt>value = {{example.value}}</tt><br/>
-           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
-           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
-           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
-           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
-          </form>
-        </file>
-        <file name="protractor.js" type="protractor">
-          var value = element(by.binding('example.value'));
-          var valid = element(by.binding('myForm.input.$valid'));
-          var input = element(by.model('example.value'));
-
-          it('should initialize to model', function() {
-            expect(value.getText()).toContain('12');
-            expect(valid.getText()).toContain('true');
-          });
-
-          it('should be invalid if empty', function() {
-            input.clear();
-            input.sendKeys('');
-            expect(value.getText()).toEqual('value =');
-            expect(valid.getText()).toContain('false');
-          });
-
-          it('should be invalid if over max', function() {
-            input.clear();
-            input.sendKeys('123');
-            expect(value.getText()).toEqual('value =');
-            expect(valid.getText()).toContain('false');
-          });
-        </file>
-      </example>
-   */
-  'number': numberInputType,
-
-
-  /**
-   * @ngdoc input
-   * @name input[url]
-   *
-   * @description
-   * Text input with URL validation. Sets the `url` validation error key if the content is not a
-   * valid URL.
-   *
-   * <div class="alert alert-warning">
-   * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex
-   * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify
-   * the built-in validators (see the {@link guide/forms Forms guide})
-   * </div>
-   *
-   * @param {string} ngModel Assignable angular expression to data-bind to.
-   * @param {string=} name Property name of the form under which the control is published.
-   * @param {string=} required Sets `required` validation error key if the value is not entered.
-   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
-   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
-   *    `required` when you want to data-bind to the `required` attribute.
-   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
-   *    minlength.
-   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
-   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
-   *    any length.
-   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
-   *    that contains the regular expression body that will be converted to a regular expression
-   *    as in the ngPattern directive.
-   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
-   *    a RegExp found by evaluating the Angular expression given in the attribute value.
-   *    If the expression evaluates to a RegExp object, then this is used directly.
-   *    If the expression evaluates to a string, then it will be converted to a RegExp
-   *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
-   *    `new RegExp('^abc$')`.<br />
-   *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
-   *    start at the index of the last search's match, thus not taking the whole input value into
-   *    account.
-   * @param {string=} ngChange Angular expression to be executed when input changes due to user
-   *    interaction with the input element.
-   *
-   * @example
-      <example name="url-input-directive" module="urlExample">
-        <file name="index.html">
-         <script>
-           angular.module('urlExample', [])
-             .controller('ExampleController', ['$scope', function($scope) {
-               $scope.url = {
-                 text: 'http://google.com'
-               };
-             }]);
-         </script>
-         <form name="myForm" ng-controller="ExampleController">
-           <label>URL:
-             <input type="url" name="input" ng-model="url.text" required>
-           <label>
-           <div role="alert">
-             <span class="error" ng-show="myForm.input.$error.required">
-               Required!</span>
-             <span class="error" ng-show="myForm.input.$error.url">
-               Not valid url!</span>
-           </div>
-           <tt>text = {{url.text}}</tt><br/>
-           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
-           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
-           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
-           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
-           <tt>myForm.$error.url = {{!!myForm.$error.url}}</tt><br/>
-          </form>
-        </file>
-        <file name="protractor.js" type="protractor">
-          var text = element(by.binding('url.text'));
-          var valid = element(by.binding('myForm.input.$valid'));
-          var input = element(by.model('url.text'));
-
-          it('should initialize to model', function() {
-            expect(text.getText()).toContain('http://google.com');
-            expect(valid.getText()).toContain('true');
-          });
-
-          it('should be invalid if empty', function() {
-            input.clear();
-            input.sendKeys('');
-
-            expect(text.getText()).toEqual('text =');
-            expect(valid.getText()).toContain('false');
-          });
-
-          it('should be invalid if not url', function() {
-            input.clear();
-            input.sendKeys('box');
-
-            expect(valid.getText()).toContain('false');
-          });
-        </file>
-      </example>
-   */
-  'url': urlInputType,
-
-
-  /**
-   * @ngdoc input
-   * @name input[email]
-   *
-   * @description
-   * Text input with email validation. Sets the `email` validation error key if not a valid email
-   * address.
-   *
-   * <div class="alert alert-warning">
-   * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex
-   * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can
-   * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide})
-   * </div>
-   *
-   * @param {string} ngModel Assignable angular expression to data-bind to.
-   * @param {string=} name Property name of the form under which the control is published.
-   * @param {string=} required Sets `required` validation error key if the value is not entered.
-   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
-   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
-   *    `required` when you want to data-bind to the `required` attribute.
-   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
-   *    minlength.
-   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
-   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
-   *    any length.
-   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
-   *    that contains the regular expression body that will be converted to a regular expression
-   *    as in the ngPattern directive.
-   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
-   *    a RegExp found by evaluating the Angular expression given in the attribute value.
-   *    If the expression evaluates to a RegExp object, then this is used directly.
-   *    If the expression evaluates to a string, then it will be converted to a RegExp
-   *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
-   *    `new RegExp('^abc$')`.<br />
-   *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
-   *    start at the index of the last search's match, thus not taking the whole input value into
-   *    account.
-   * @param {string=} ngChange Angular expression to be executed when input changes due to user
-   *    interaction with the input element.
-   *
-   * @example
-      <example name="email-input-directive" module="emailExample">
-        <file name="index.html">
-         <script>
-           angular.module('emailExample', [])
-             .controller('ExampleController', ['$scope', function($scope) {
-               $scope.email = {
-                 text: 'me@example.com'
-               };
-             }]);
-         </script>
-           <form name="myForm" ng-controller="ExampleController">
-             <label>Email:
-               <input type="email" name="input" ng-model="email.text" required>
-             </label>
-             <div role="alert">
-               <span class="error" ng-show="myForm.input.$error.required">
-                 Required!</span>
-               <span class="error" ng-show="myForm.input.$error.email">
-                 Not valid email!</span>
-             </div>
-             <tt>text = {{email.text}}</tt><br/>
-             <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
-             <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
-             <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
-             <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
-             <tt>myForm.$error.email = {{!!myForm.$error.email}}</tt><br/>
-           </form>
-         </file>
-        <file name="protractor.js" type="protractor">
-          var text = element(by.binding('email.text'));
-          var valid = element(by.binding('myForm.input.$valid'));
-          var input = element(by.model('email.text'));
-
-          it('should initialize to model', function() {
-            expect(text.getText()).toContain('me@example.com');
-            expect(valid.getText()).toContain('true');
-          });
-
-          it('should be invalid if empty', function() {
-            input.clear();
-            input.sendKeys('');
-            expect(text.getText()).toEqual('text =');
-            expect(valid.getText()).toContain('false');
-          });
-
-          it('should be invalid if not email', function() {
-            input.clear();
-            input.sendKeys('xxx');
-
-            expect(valid.getText()).toContain('false');
-          });
-        </file>
-      </example>
-   */
-  'email': emailInputType,
-
-
-  /**
-   * @ngdoc input
-   * @name input[radio]
-   *
-   * @description
-   * HTML radio button.
-   *
-   * @param {string} ngModel Assignable angular expression to data-bind to.
-   * @param {string} value The value to which the `ngModel` expression should be set when selected.
-   *    Note that `value` only supports `string` values, i.e. the scope model needs to be a string,
-   *    too. Use `ngValue` if you need complex models (`number`, `object`, ...).
-   * @param {string=} name Property name of the form under which the control is published.
-   * @param {string=} ngChange Angular expression to be executed when input changes due to user
-   *    interaction with the input element.
-   * @param {string} ngValue Angular expression to which `ngModel` will be be set when the radio
-   *    is selected. Should be used instead of the `value` attribute if you need
-   *    a non-string `ngModel` (`boolean`, `array`, ...).
-   *
-   * @example
-      <example name="radio-input-directive" module="radioExample">
-        <file name="index.html">
-         <script>
-           angular.module('radioExample', [])
-             .controller('ExampleController', ['$scope', function($scope) {
-               $scope.color = {
-                 name: 'blue'
-               };
-               $scope.specialValue = {
-                 "id": "12345",
-                 "value": "green"
-               };
-             }]);
-         </script>
-         <form name="myForm" ng-controller="ExampleController">
-           <label>
-             <input type="radio" ng-model="color.name" value="red">
-             Red
-           </label><br/>
-           <label>
-             <input type="radio" ng-model="color.name" ng-value="specialValue">
-             Green
-           </label><br/>
-           <label>
-             <input type="radio" ng-model="color.name" value="blue">
-             Blue
-           </label><br/>
-           <tt>color = {{color.name | json}}</tt><br/>
-          </form>
-          Note that `ng-value="specialValue"` sets radio item's value to be the value of `$scope.specialValue`.
-        </file>
-        <file name="protractor.js" type="protractor">
-          it('should change state', function() {
-            var color = element(by.binding('color.name'));
-
-            expect(color.getText()).toContain('blue');
-
-            element.all(by.model('color.name')).get(0).click();
-
-            expect(color.getText()).toContain('red');
-          });
-        </file>
-      </example>
-   */
-  'radio': radioInputType,
-
-
-  /**
-   * @ngdoc input
-   * @name input[checkbox]
-   *
-   * @description
-   * HTML checkbox.
-   *
-   * @param {string} ngModel Assignable angular expression to data-bind to.
-   * @param {string=} name Property name of the form under which the control is published.
-   * @param {expression=} ngTrueValue The value to which the expression should be set when selected.
-   * @param {expression=} ngFalseValue The value to which the expression should be set when not selected.
-   * @param {string=} ngChange Angular expression to be executed when input changes due to user
-   *    interaction with the input element.
-   *
-   * @example
-      <example name="checkbox-input-directive" module="checkboxExample">
-        <file name="index.html">
-         <script>
-           angular.module('checkboxExample', [])
-             .controller('ExampleController', ['$scope', function($scope) {
-               $scope.checkboxModel = {
-                value1 : true,
-                value2 : 'YES'
-              };
-             }]);
-         </script>
-         <form name="myForm" ng-controller="ExampleController">
-           <label>Value1:
-             <input type="checkbox" ng-model="checkboxModel.value1">
-           </label><br/>
-           <label>Value2:
-             <input type="checkbox" ng-model="checkboxModel.value2"
-                    ng-true-value="'YES'" ng-false-value="'NO'">
-            </label><br/>
-           <tt>value1 = {{checkboxModel.value1}}</tt><br/>
-           <tt>value2 = {{checkboxModel.value2}}</tt><br/>
-          </form>
-        </file>
-        <file name="protractor.js" type="protractor">
-          it('should change state', function() {
-            var value1 = element(by.binding('checkboxModel.value1'));
-            var value2 = element(by.binding('checkboxModel.value2'));
-
-            expect(value1.getText()).toContain('true');
-            expect(value2.getText()).toContain('YES');
-
-            element(by.model('checkboxModel.value1')).click();
-            element(by.model('checkboxModel.value2')).click();
-
-            expect(value1.getText()).toContain('false');
-            expect(value2.getText()).toContain('NO');
-          });
-        </file>
-      </example>
-   */
-  'checkbox': checkboxInputType,
-
-  'hidden': noop,
-  'button': noop,
-  'submit': noop,
-  'reset': noop,
-  'file': noop
-};
-
-function stringBasedInputType(ctrl) {
-  ctrl.$formatters.push(function(value) {
-    return ctrl.$isEmpty(value) ? value : value.toString();
-  });
-}
-
-function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
-  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
-  stringBasedInputType(ctrl);
-}
-
-function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
-  var type = lowercase(element[0].type);
-
-  // In composition mode, users are still inputing intermediate text buffer,
-  // hold the listener until composition is done.
-  // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent
-  if (!$sniffer.android) {
-    var composing = false;
-
-    element.on('compositionstart', function(data) {
-      composing = true;
-    });
-
-    element.on('compositionend', function() {
-      composing = false;
-      listener();
-    });
-  }
-
-  var listener = function(ev) {
-    if (timeout) {
-      $browser.defer.cancel(timeout);
-      timeout = null;
-    }
-    if (composing) return;
-    var value = element.val(),
-        event = ev && ev.type;
-
-    // By default we will trim the value
-    // If the attribute ng-trim exists we will avoid trimming
-    // If input type is 'password', the value is never trimmed
-    if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) {
-      value = trim(value);
-    }
-
-    // If a control is suffering from bad input (due to native validators), browsers discard its
-    // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the
-    // control's value is the same empty value twice in a row.
-    if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) {
-      ctrl.$setViewValue(value, event);
-    }
-  };
-
-  // if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the
-  // input event on backspace, delete or cut
-  if ($sniffer.hasEvent('input')) {
-    element.on('input', listener);
-  } else {
-    var timeout;
-
-    var deferListener = function(ev, input, origValue) {
-      if (!timeout) {
-        timeout = $browser.defer(function() {
-          timeout = null;
-          if (!input || input.value !== origValue) {
-            listener(ev);
-          }
-        });
-      }
-    };
-
-    element.on('keydown', function(event) {
-      var key = event.keyCode;
-
-      // ignore
-      //    command            modifiers                   arrows
-      if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;
-
-      deferListener(event, this, this.value);
-    });
-
-    // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it
-    if ($sniffer.hasEvent('paste')) {
-      element.on('paste cut', deferListener);
-    }
-  }
-
-  // if user paste into input using mouse on older browser
-  // or form autocomplete on newer browser, we need "change" event to catch it
-  element.on('change', listener);
-
-  ctrl.$render = function() {
-    // Workaround for Firefox validation #12102.
-    var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue;
-    if (element.val() !== value) {
-      element.val(value);
-    }
-  };
-}
-
-function weekParser(isoWeek, existingDate) {
-  if (isDate(isoWeek)) {
-    return isoWeek;
-  }
-
-  if (isString(isoWeek)) {
-    WEEK_REGEXP.lastIndex = 0;
-    var parts = WEEK_REGEXP.exec(isoWeek);
-    if (parts) {
-      var year = +parts[1],
-          week = +parts[2],
-          hours = 0,
-          minutes = 0,
-          seconds = 0,
-          milliseconds = 0,
-          firstThurs = getFirstThursdayOfYear(year),
-          addDays = (week - 1) * 7;
-
-      if (existingDate) {
-        hours = existingDate.getHours();
-        minutes = existingDate.getMinutes();
-        seconds = existingDate.getSeconds();
-        milliseconds = existingDate.getMilliseconds();
-      }
-
-      return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds);
-    }
-  }
-
-  return NaN;
-}
-
-function createDateParser(regexp, mapping) {
-  return function(iso, date) {
-    var parts, map;
-
-    if (isDate(iso)) {
-      return iso;
-    }
-
-    if (isString(iso)) {
-      // When a date is JSON'ified to wraps itself inside of an extra
-      // set of double quotes. This makes the date parsing code unable
-      // to match the date string and parse it as a date.
-      if (iso.charAt(0) == '"' && iso.charAt(iso.length - 1) == '"') {
-        iso = iso.substring(1, iso.length - 1);
-      }
-      if (ISO_DATE_REGEXP.test(iso)) {
-        return new Date(iso);
-      }
-      regexp.lastIndex = 0;
-      parts = regexp.exec(iso);
-
-      if (parts) {
-        parts.shift();
-        if (date) {
-          map = {
-            yyyy: date.getFullYear(),
-            MM: date.getMonth() + 1,
-            dd: date.getDate(),
-            HH: date.getHours(),
-            mm: date.getMinutes(),
-            ss: date.getSeconds(),
-            sss: date.getMilliseconds() / 1000
-          };
-        } else {
-          map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 };
-        }
-
-        forEach(parts, function(part, index) {
-          if (index < mapping.length) {
-            map[mapping[index]] = +part;
-          }
-        });
-        return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0);
-      }
-    }
-
-    return NaN;
-  };
-}
-
-function createDateInputType(type, regexp, parseDate, format) {
-  return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) {
-    badInputChecker(scope, element, attr, ctrl);
-    baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
-    var timezone = ctrl && ctrl.$options && ctrl.$options.timezone;
-    var previousDate;
-
-    ctrl.$$parserName = type;
-    ctrl.$parsers.push(function(value) {
-      if (ctrl.$isEmpty(value)) return null;
-      if (regexp.test(value)) {
-        // Note: We cannot read ctrl.$modelValue, as there might be a different
-        // parser/formatter in the processing chain so that the model
-        // contains some different data format!
-        var parsedDate = parseDate(value, previousDate);
-        if (timezone) {
-          parsedDate = convertTimezoneToLocal(parsedDate, timezone);
-        }
-        return parsedDate;
-      }
-      return undefined;
-    });
-
-    ctrl.$formatters.push(function(value) {
-      if (value && !isDate(value)) {
-        throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value);
-      }
-      if (isValidDate(value)) {
-        previousDate = value;
-        if (previousDate && timezone) {
-          previousDate = convertTimezoneToLocal(previousDate, timezone, true);
-        }
-        return $filter('date')(value, format, timezone);
-      } else {
-        previousDate = null;
-        return '';
-      }
-    });
-
-    if (isDefined(attr.min) || attr.ngMin) {
-      var minVal;
-      ctrl.$validators.min = function(value) {
-        return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal;
-      };
-      attr.$observe('min', function(val) {
-        minVal = parseObservedDateValue(val);
-        ctrl.$validate();
-      });
-    }
-
-    if (isDefined(attr.max) || attr.ngMax) {
-      var maxVal;
-      ctrl.$validators.max = function(value) {
-        return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal;
-      };
-      attr.$observe('max', function(val) {
-        maxVal = parseObservedDateValue(val);
-        ctrl.$validate();
-      });
-    }
-
-    function isValidDate(value) {
-      // Invalid Date: getTime() returns NaN
-      return value && !(value.getTime && value.getTime() !== value.getTime());
-    }
-
-    function parseObservedDateValue(val) {
-      return isDefined(val) && !isDate(val) ? parseDate(val) || undefined : val;
-    }
-  };
-}
-
-function badInputChecker(scope, element, attr, ctrl) {
-  var node = element[0];
-  var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity);
-  if (nativeValidation) {
-    ctrl.$parsers.push(function(value) {
-      var validity = element.prop(VALIDITY_STATE_PROPERTY) || {};
-      // Detect bug in FF35 for input[email] (https://bugzilla.mozilla.org/show_bug.cgi?id=1064430):
-      // - also sets validity.badInput (should only be validity.typeMismatch).
-      // - see http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email)
-      // - can ignore this case as we can still read out the erroneous email...
-      return validity.badInput && !validity.typeMismatch ? undefined : value;
-    });
-  }
-}
-
-function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
-  badInputChecker(scope, element, attr, ctrl);
-  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
-
-  ctrl.$$parserName = 'number';
-  ctrl.$parsers.push(function(value) {
-    if (ctrl.$isEmpty(value))      return null;
-    if (NUMBER_REGEXP.test(value)) return parseFloat(value);
-    return undefined;
-  });
-
-  ctrl.$formatters.push(function(value) {
-    if (!ctrl.$isEmpty(value)) {
-      if (!isNumber(value)) {
-        throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);
-      }
-      value = value.toString();
-    }
-    return value;
-  });
-
-  if (isDefined(attr.min) || attr.ngMin) {
-    var minVal;
-    ctrl.$validators.min = function(value) {
-      return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal;
-    };
-
-    attr.$observe('min', function(val) {
-      if (isDefined(val) && !isNumber(val)) {
-        val = parseFloat(val, 10);
-      }
-      minVal = isNumber(val) && !isNaN(val) ? val : undefined;
-      // TODO(matsko): implement validateLater to reduce number of validations
-      ctrl.$validate();
-    });
-  }
-
-  if (isDefined(attr.max) || attr.ngMax) {
-    var maxVal;
-    ctrl.$validators.max = function(value) {
-      return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal;
-    };
-
-    attr.$observe('max', function(val) {
-      if (isDefined(val) && !isNumber(val)) {
-        val = parseFloat(val, 10);
-      }
-      maxVal = isNumber(val) && !isNaN(val) ? val : undefined;
-      // TODO(matsko): implement validateLater to reduce number of validations
-      ctrl.$validate();
-    });
-  }
-}
-
-function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
-  // Note: no badInputChecker here by purpose as `url` is only a validation
-  // in browsers, i.e. we can always read out input.value even if it is not valid!
-  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
-  stringBasedInputType(ctrl);
-
-  ctrl.$$parserName = 'url';
-  ctrl.$validators.url = function(modelValue, viewValue) {
-    var value = modelValue || viewValue;
-    return ctrl.$isEmpty(value) || URL_REGEXP.test(value);
-  };
-}
-
-function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
-  // Note: no badInputChecker here by purpose as `url` is only a validation
-  // in browsers, i.e. we can always read out input.value even if it is not valid!
-  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
-  stringBasedInputType(ctrl);
-
-  ctrl.$$parserName = 'email';
-  ctrl.$validators.email = function(modelValue, viewValue) {
-    var value = modelValue || viewValue;
-    return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);
-  };
-}
-
-function radioInputType(scope, element, attr, ctrl) {
-  // make the name unique, if not defined
-  if (isUndefined(attr.name)) {
-    element.attr('name', nextUid());
-  }
-
-  var listener = function(ev) {
-    if (element[0].checked) {
-      ctrl.$setViewValue(attr.value, ev && ev.type);
-    }
-  };
-
-  element.on('click', listener);
-
-  ctrl.$render = function() {
-    var value = attr.value;
-    element[0].checked = (value == ctrl.$viewValue);
-  };
-
-  attr.$observe('value', ctrl.$render);
-}
-
-function parseConstantExpr($parse, context, name, expression, fallback) {
-  var parseFn;
-  if (isDefined(expression)) {
-    parseFn = $parse(expression);
-    if (!parseFn.constant) {
-      throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' +
-                                   '`{1}`.', name, expression);
-    }
-    return parseFn(context);
-  }
-  return fallback;
-}
-
-function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {
-  var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true);
-  var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false);
-
-  var listener = function(ev) {
-    ctrl.$setViewValue(element[0].checked, ev && ev.type);
-  };
-
-  element.on('click', listener);
-
-  ctrl.$render = function() {
-    element[0].checked = ctrl.$viewValue;
-  };
-
-  // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false`
-  // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert
-  // it to a boolean.
-  ctrl.$isEmpty = function(value) {
-    return value === false;
-  };
-
-  ctrl.$formatters.push(function(value) {
-    return equals(value, trueValue);
-  });
-
-  ctrl.$parsers.push(function(value) {
-    return value ? trueValue : falseValue;
-  });
-}
-
-
-/**
- * @ngdoc directive
- * @name textarea
- * @restrict E
- *
- * @description
- * HTML textarea element control with angular data-binding. The data-binding and validation
- * properties of this element are exactly the same as those of the
- * {@link ng.directive:input input element}.
- *
- * @param {string} ngModel Assignable angular expression to data-bind to.
- * @param {string=} name Property name of the form under which the control is published.
- * @param {string=} required Sets `required` validation error key if the value is not entered.
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
- *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
- *    `required` when you want to data-bind to the `required` attribute.
- * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
- *    minlength.
- * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
- *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any
- *    length.
- * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
- *    a RegExp found by evaluating the Angular expression given in the attribute value.
- *    If the expression evaluates to a RegExp object, then this is used directly.
- *    If the expression evaluates to a string, then it will be converted to a RegExp
- *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
- *    `new RegExp('^abc$')`.<br />
- *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
- *    start at the index of the last search's match, thus not taking the whole input value into
- *    account.
- * @param {string=} ngChange Angular expression to be executed when input changes due to user
- *    interaction with the input element.
- * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.
- */
-
-
-/**
- * @ngdoc directive
- * @name input
- * @restrict E
- *
- * @description
- * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding,
- * input state control, and validation.
- * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.
- *
- * <div class="alert alert-warning">
- * **Note:** Not every feature offered is available for all input types.
- * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`.
- * </div>
- *
- * @param {string} ngModel Assignable angular expression to data-bind to.
- * @param {string=} name Property name of the form under which the control is published.
- * @param {string=} required Sets `required` validation error key if the value is not entered.
- * @param {boolean=} ngRequired Sets `required` attribute if set to true
- * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
- *    minlength.
- * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
- *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any
- *    length.
- * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
- *    a RegExp found by evaluating the Angular expression given in the attribute value.
- *    If the expression evaluates to a RegExp object, then this is used directly.
- *    If the expression evaluates to a string, then it will be converted to a RegExp
- *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
- *    `new RegExp('^abc$')`.<br />
- *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
- *    start at the index of the last search's match, thus not taking the whole input value into
- *    account.
- * @param {string=} ngChange Angular expression to be executed when input changes due to user
- *    interaction with the input element.
- * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.
- *    This parameter is ignored for input[type=password] controls, which will never trim the
- *    input.
- *
- * @example
-    <example name="input-directive" module="inputExample">
-      <file name="index.html">
-       <script>
-          angular.module('inputExample', [])
-            .controller('ExampleController', ['$scope', function($scope) {
-              $scope.user = {name: 'guest', last: 'visitor'};
-            }]);
-       </script>
-       <div ng-controller="ExampleController">
-         <form name="myForm">
-           <label>
-              User name:
-              <input type="text" name="userName" ng-model="user.name" required>
-           </label>
-           <div role="alert">
-             <span class="error" ng-show="myForm.userName.$error.required">
-              Required!</span>
-           </div>
-           <label>
-              Last name:
-              <input type="text" name="lastName" ng-model="user.last"
-              ng-minlength="3" ng-maxlength="10">
-           </label>
-           <div role="alert">
-             <span class="error" ng-show="myForm.lastName.$error.minlength">
-               Too short!</span>
-             <span class="error" ng-show="myForm.lastName.$error.maxlength">
-               Too long!</span>
-           </div>
-         </form>
-         <hr>
-         <tt>user = {{user}}</tt><br/>
-         <tt>myForm.userName.$valid = {{myForm.userName.$valid}}</tt><br/>
-         <tt>myForm.userName.$error = {{myForm.userName.$error}}</tt><br/>
-         <tt>myForm.lastName.$valid = {{myForm.lastName.$valid}}</tt><br/>
-         <tt>myForm.lastName.$error = {{myForm.lastName.$error}}</tt><br/>
-         <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
-         <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
-         <tt>myForm.$error.minlength = {{!!myForm.$error.minlength}}</tt><br/>
-         <tt>myForm.$error.maxlength = {{!!myForm.$error.maxlength}}</tt><br/>
-       </div>
-      </file>
-      <file name="protractor.js" type="protractor">
-        var user = element(by.exactBinding('user'));
-        var userNameValid = element(by.binding('myForm.userName.$valid'));
-        var lastNameValid = element(by.binding('myForm.lastName.$valid'));
-        var lastNameError = element(by.binding('myForm.lastName.$error'));
-        var formValid = element(by.binding('myForm.$valid'));
-        var userNameInput = element(by.model('user.name'));
-        var userLastInput = element(by.model('user.last'));
-
-        it('should initialize to model', function() {
-          expect(user.getText()).toContain('{"name":"guest","last":"visitor"}');
-          expect(userNameValid.getText()).toContain('true');
-          expect(formValid.getText()).toContain('true');
-        });
-
-        it('should be invalid if empty when required', function() {
-          userNameInput.clear();
-          userNameInput.sendKeys('');
-
-          expect(user.getText()).toContain('{"last":"visitor"}');
-          expect(userNameValid.getText()).toContain('false');
-          expect(formValid.getText()).toContain('false');
-        });
-
-        it('should be valid if empty when min length is set', function() {
-          userLastInput.clear();
-          userLastInput.sendKeys('');
-
-          expect(user.getText()).toContain('{"name":"guest","last":""}');
-          expect(lastNameValid.getText()).toContain('true');
-          expect(formValid.getText()).toContain('true');
-        });
-
-        it('should be invalid if less than required min length', function() {
-          userLastInput.clear();
-          userLastInput.sendKeys('xx');
-
-          expect(user.getText()).toContain('{"name":"guest"}');
-          expect(lastNameValid.getText()).toContain('false');
-          expect(lastNameError.getText()).toContain('minlength');
-          expect(formValid.getText()).toContain('false');
-        });
-
-        it('should be invalid if longer than max length', function() {
-          userLastInput.clear();
-          userLastInput.sendKeys('some ridiculously long name');
-
-          expect(user.getText()).toContain('{"name":"guest"}');
-          expect(lastNameValid.getText()).toContain('false');
-          expect(lastNameError.getText()).toContain('maxlength');
-          expect(formValid.getText()).toContain('false');
-        });
-      </file>
-    </example>
- */
-var inputDirective = ['$browser', '$sniffer', '$filter', '$parse',
-    function($browser, $sniffer, $filter, $parse) {
-  return {
-    restrict: 'E',
-    require: ['?ngModel'],
-    link: {
-      pre: function(scope, element, attr, ctrls) {
-        if (ctrls[0]) {
-          (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer,
-                                                              $browser, $filter, $parse);
-        }
-      }
-    }
-  };
-}];
-
-
-
-var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
-/**
- * @ngdoc directive
- * @name ngValue
- *
- * @description
- * Binds the given expression to the value of `<option>` or {@link input[radio] `input[radio]`},
- * so that when the element is selected, the {@link ngModel `ngModel`} of that element is set to
- * the bound value.
- *
- * `ngValue` is useful when dynamically generating lists of radio buttons using
- * {@link ngRepeat `ngRepeat`}, as shown below.
- *
- * Likewise, `ngValue` can be used to generate `<option>` elements for
- * the {@link select `select`} element. In that case however, only strings are supported
- * for the `value `attribute, so the resulting `ngModel` will always be a string.
- * Support for `select` models with non-string values is available via `ngOptions`.
- *
- * @element input
- * @param {string=} ngValue angular expression, whose value will be bound to the `value` attribute
- *   of the `input` element
- *
- * @example
-    <example name="ngValue-directive" module="valueExample">
-      <file name="index.html">
-       <script>
-          angular.module('valueExample', [])
-            .controller('ExampleController', ['$scope', function($scope) {
-              $scope.names = ['pizza', 'unicorns', 'robots'];
-              $scope.my = { favorite: 'unicorns' };
-            }]);
-       </script>
-        <form ng-controller="ExampleController">
-          <h2>Which is your favorite?</h2>
-            <label ng-repeat="name in names" for="{{name}}">
-              {{name}}
-              <input type="radio"
-                     ng-model="my.favorite"
-                     ng-value="name"
-                     id="{{name}}"
-                     name="favorite">
-            </label>
-          <div>You chose {{my.favorite}}</div>
-        </form>
-      </file>
-      <file name="protractor.js" type="protractor">
-        var favorite = element(by.binding('my.favorite'));
-
-        it('should initialize to model', function() {
-          expect(favorite.getText()).toContain('unicorns');
-        });
-        it('should bind the values to the inputs', function() {
-          element.all(by.model('my.favorite')).get(0).click();
-          expect(favorite.getText()).toContain('pizza');
-        });
-      </file>
-    </example>
- */
-var ngValueDirective = function() {
-  return {
-    restrict: 'A',
-    priority: 100,
-    compile: function(tpl, tplAttr) {
-      if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) {
-        return function ngValueConstantLink(scope, elm, attr) {
-          attr.$set('value', scope.$eval(attr.ngValue));
-        };
-      } else {
-        return function ngValueLink(scope, elm, attr) {
-          scope.$watch(attr.ngValue, function valueWatchAction(value) {
-            attr.$set('value', value);
-          });
-        };
-      }
-    }
-  };
-};
-
-/**
- * @ngdoc directive
- * @name ngBind
- * @restrict AC
- *
- * @description
- * The `ngBind` attribute tells Angular to replace the text content of the specified HTML element
- * with the value of a given expression, and to update the text content when the value of that
- * expression changes.
- *
- * Typically, you don't use `ngBind` directly, but instead you use the double curly markup like
- * `{{ expression }}` which is similar but less verbose.
- *
- * It is preferable to use `ngBind` instead of `{{ expression }}` if a template is momentarily
- * displayed by the browser in its raw state before Angular compiles it. Since `ngBind` is an
- * element attribute, it makes the bindings invisible to the user while the page is loading.
- *
- * An alternative solution to this problem would be using the
- * {@link ng.directive:ngCloak ngCloak} directive.
- *
- *
- * @element ANY
- * @param {expression} ngBind {@link guide/expression Expression} to evaluate.
- *
- * @example
- * Enter a name in the Live Preview text box; the greeting below the text box changes instantly.
-   <example module="bindExample">
-     <file name="index.html">
-       <script>
-         angular.module('bindExample', [])
-           .controller('ExampleController', ['$scope', function($scope) {
-             $scope.name = 'Whirled';
-           }]);
-       </script>
-       <div ng-controller="ExampleController">
-         <label>Enter name: <input type="text" ng-model="name"></label><br>
-         Hello <span ng-bind="name"></span>!
-       </div>
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should check ng-bind', function() {
-         var nameInput = element(by.model('name'));
-
-         expect(element(by.binding('name')).getText()).toBe('Whirled');
-         nameInput.clear();
-         nameInput.sendKeys('world');
-         expect(element(by.binding('name')).getText()).toBe('world');
-       });
-     </file>
-   </example>
- */
-var ngBindDirective = ['$compile', function($compile) {
-  return {
-    restrict: 'AC',
-    compile: function ngBindCompile(templateElement) {
-      $compile.$$addBindingClass(templateElement);
-      return function ngBindLink(scope, element, attr) {
-        $compile.$$addBindingInfo(element, attr.ngBind);
-        element = element[0];
-        scope.$watch(attr.ngBind, function ngBindWatchAction(value) {
-          element.textContent = isUndefined(value) ? '' : value;
-        });
-      };
-    }
-  };
-}];
-
-
-/**
- * @ngdoc directive
- * @name ngBindTemplate
- *
- * @description
- * The `ngBindTemplate` directive specifies that the element
- * text content should be replaced with the interpolation of the template
- * in the `ngBindTemplate` attribute.
- * Unlike `ngBind`, the `ngBindTemplate` can contain multiple `{{` `}}`
- * expressions. This directive is needed since some HTML elements
- * (such as TITLE and OPTION) cannot contain SPAN elements.
- *
- * @element ANY
- * @param {string} ngBindTemplate template of form
- *   <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval.
- *
- * @example
- * Try it here: enter text in text box and watch the greeting change.
-   <example module="bindExample">
-     <file name="index.html">
-       <script>
-         angular.module('bindExample', [])
-           .controller('ExampleController', ['$scope', function($scope) {
-             $scope.salutation = 'Hello';
-             $scope.name = 'World';
-           }]);
-       </script>
-       <div ng-controller="ExampleController">
-        <label>Salutation: <input type="text" ng-model="salutation"></label><br>
-        <label>Name: <input type="text" ng-model="name"></label><br>
-        <pre ng-bind-template="{{salutation}} {{name}}!"></pre>
-       </div>
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should check ng-bind', function() {
-         var salutationElem = element(by.binding('salutation'));
-         var salutationInput = element(by.model('salutation'));
-         var nameInput = element(by.model('name'));
-
-         expect(salutationElem.getText()).toBe('Hello World!');
-
-         salutationInput.clear();
-         salutationInput.sendKeys('Greetings');
-         nameInput.clear();
-         nameInput.sendKeys('user');
-
-         expect(salutationElem.getText()).toBe('Greetings user!');
-       });
-     </file>
-   </example>
- */
-var ngBindTemplateDirective = ['$interpolate', '$compile', function($interpolate, $compile) {
-  return {
-    compile: function ngBindTemplateCompile(templateElement) {
-      $compile.$$addBindingClass(templateElement);
-      return function ngBindTemplateLink(scope, element, attr) {
-        var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));
-        $compile.$$addBindingInfo(element, interpolateFn.expressions);
-        element = element[0];
-        attr.$observe('ngBindTemplate', function(value) {
-          element.textContent = isUndefined(value) ? '' : value;
-        });
-      };
-    }
-  };
-}];
-
-
-/**
- * @ngdoc directive
- * @name ngBindHtml
- *
- * @description
- * Evaluates the expression and inserts the resulting HTML into the element in a secure way. By default,
- * the resulting HTML content will be sanitized using the {@link ngSanitize.$sanitize $sanitize} service.
- * To utilize this functionality, ensure that `$sanitize` is available, for example, by including {@link
- * ngSanitize} in your module's dependencies (not in core Angular). In order to use {@link ngSanitize}
- * in your module's dependencies, you need to include "angular-sanitize.js" in your application.
- *
- * You may also bypass sanitization for values you know are safe. To do so, bind to
- * an explicitly trusted value via {@link ng.$sce#trustAsHtml $sce.trustAsHtml}.  See the example
- * under {@link ng.$sce#show-me-an-example-using-sce- Strict Contextual Escaping (SCE)}.
- *
- * Note: If a `$sanitize` service is unavailable and the bound value isn't explicitly trusted, you
- * will have an exception (instead of an exploit.)
- *
- * @element ANY
- * @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate.
- *
- * @example
-
-   <example module="bindHtmlExample" deps="angular-sanitize.js">
-     <file name="index.html">
-       <div ng-controller="ExampleController">
-        <p ng-bind-html="myHTML"></p>
-       </div>
-     </file>
-
-     <file name="script.js">
-       angular.module('bindHtmlExample', ['ngSanitize'])
-         .controller('ExampleController', ['$scope', function($scope) {
-           $scope.myHTML =
-              'I am an <code>HTML</code>string with ' +
-              '<a href="#">links!</a> and other <em>stuff</em>';
-         }]);
-     </file>
-
-     <file name="protractor.js" type="protractor">
-       it('should check ng-bind-html', function() {
-         expect(element(by.binding('myHTML')).getText()).toBe(
-             'I am an HTMLstring with links! and other stuff');
-       });
-     </file>
-   </example>
- */
-var ngBindHtmlDirective = ['$sce', '$parse', '$compile', function($sce, $parse, $compile) {
-  return {
-    restrict: 'A',
-    compile: function ngBindHtmlCompile(tElement, tAttrs) {
-      var ngBindHtmlGetter = $parse(tAttrs.ngBindHtml);
-      var ngBindHtmlWatch = $parse(tAttrs.ngBindHtml, function getStringValue(value) {
-        return (value || '').toString();
-      });
-      $compile.$$addBindingClass(tElement);
-
-      return function ngBindHtmlLink(scope, element, attr) {
-        $compile.$$addBindingInfo(element, attr.ngBindHtml);
-
-        scope.$watch(ngBindHtmlWatch, function ngBindHtmlWatchAction() {
-          // we re-evaluate the expr because we want a TrustedValueHolderType
-          // for $sce, not a string
-          element.html($sce.getTrustedHtml(ngBindHtmlGetter(scope)) || '');
-        });
-      };
-    }
-  };
-}];
-
-/**
- * @ngdoc directive
- * @name ngChange
- *
- * @description
- * Evaluate the given expression when the user changes the input.
- * The expression is evaluated immediately, unlike the JavaScript onchange event
- * which only triggers at the end of a change (usually, when the user leaves the
- * form element or presses the return key).
- *
- * The `ngChange` expression is only evaluated when a change in the input value causes
- * a new value to be committed to the model.
- *
- * It will not be evaluated:
- * * if the value returned from the `$parsers` transformation pipeline has not changed
- * * if the input has continued to be invalid since the model will stay `null`
- * * if the model is changed programmatically and not by a change to the input value
- *
- *
- * Note, this directive requires `ngModel` to be present.
- *
- * @element input
- * @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change
- * in input value.
- *
- * @example
- * <example name="ngChange-directive" module="changeExample">
- *   <file name="index.html">
- *     <script>
- *       angular.module('changeExample', [])
- *         .controller('ExampleController', ['$scope', function($scope) {
- *           $scope.counter = 0;
- *           $scope.change = function() {
- *             $scope.counter++;
- *           };
- *         }]);
- *     </script>
- *     <div ng-controller="ExampleController">
- *       <input type="checkbox" ng-model="confirmed" ng-change="change()" id="ng-change-example1" />
- *       <input type="checkbox" ng-model="confirmed" id="ng-change-example2" />
- *       <label for="ng-change-example2">Confirmed</label><br />
- *       <tt>debug = {{confirmed}}</tt><br/>
- *       <tt>counter = {{counter}}</tt><br/>
- *     </div>
- *   </file>
- *   <file name="protractor.js" type="protractor">
- *     var counter = element(by.binding('counter'));
- *     var debug = element(by.binding('confirmed'));
- *
- *     it('should evaluate the expression if changing from view', function() {
- *       expect(counter.getText()).toContain('0');
- *
- *       element(by.id('ng-change-example1')).click();
- *
- *       expect(counter.getText()).toContain('1');
- *       expect(debug.getText()).toContain('true');
- *     });
- *
- *     it('should not evaluate the expression if changing from model', function() {
- *       element(by.id('ng-change-example2')).click();
-
- *       expect(counter.getText()).toContain('0');
- *       expect(debug.getText()).toContain('true');
- *     });
- *   </file>
- * </example>
- */
-var ngChangeDirective = valueFn({
-  restrict: 'A',
-  require: 'ngModel',
-  link: function(scope, element, attr, ctrl) {
-    ctrl.$viewChangeListeners.push(function() {
-      scope.$eval(attr.ngChange);
-    });
-  }
-});
-
-function classDirective(name, selector) {
-  name = 'ngClass' + name;
-  return ['$animate', function($animate) {
-    return {
-      restrict: 'AC',
-      link: function(scope, element, attr) {
-        var oldVal;
-
-        scope.$watch(attr[name], ngClassWatchAction, true);
-
-        attr.$observe('class', function(value) {
-          ngClassWatchAction(scope.$eval(attr[name]));
-        });
-
-
-        if (name !== 'ngClass') {
-          scope.$watch('$index', function($index, old$index) {
-            // jshint bitwise: false
-            var mod = $index & 1;
-            if (mod !== (old$index & 1)) {
-              var classes = arrayClasses(scope.$eval(attr[name]));
-              mod === selector ?
-                addClasses(classes) :
-                removeClasses(classes);
-            }
-          });
-        }
-
-        function addClasses(classes) {
-          var newClasses = digestClassCounts(classes, 1);
-          attr.$addClass(newClasses);
-        }
-
-        function removeClasses(classes) {
-          var newClasses = digestClassCounts(classes, -1);
-          attr.$removeClass(newClasses);
-        }
-
-        function digestClassCounts(classes, count) {
-          // Use createMap() to prevent class assumptions involving property
-          // names in Object.prototype
-          var classCounts = element.data('$classCounts') || createMap();
-          var classesToUpdate = [];
-          forEach(classes, function(className) {
-            if (count > 0 || classCounts[className]) {
-              classCounts[className] = (classCounts[className] || 0) + count;
-              if (classCounts[className] === +(count > 0)) {
-                classesToUpdate.push(className);
-              }
-            }
-          });
-          element.data('$classCounts', classCounts);
-          return classesToUpdate.join(' ');
-        }
-
-        function updateClasses(oldClasses, newClasses) {
-          var toAdd = arrayDifference(newClasses, oldClasses);
-          var toRemove = arrayDifference(oldClasses, newClasses);
-          toAdd = digestClassCounts(toAdd, 1);
-          toRemove = digestClassCounts(toRemove, -1);
-          if (toAdd && toAdd.length) {
-            $animate.addClass(element, toAdd);
-          }
-          if (toRemove && toRemove.length) {
-            $animate.removeClass(element, toRemove);
-          }
-        }
-
-        function ngClassWatchAction(newVal) {
-          if (selector === true || scope.$index % 2 === selector) {
-            var newClasses = arrayClasses(newVal || []);
-            if (!oldVal) {
-              addClasses(newClasses);
-            } else if (!equals(newVal,oldVal)) {
-              var oldClasses = arrayClasses(oldVal);
-              updateClasses(oldClasses, newClasses);
-            }
-          }
-          oldVal = shallowCopy(newVal);
-        }
-      }
-    };
-
-    function arrayDifference(tokens1, tokens2) {
-      var values = [];
-
-      outer:
-      for (var i = 0; i < tokens1.length; i++) {
-        var token = tokens1[i];
-        for (var j = 0; j < tokens2.length; j++) {
-          if (token == tokens2[j]) continue outer;
-        }
-        values.push(token);
-      }
-      return values;
-    }
-
-    function arrayClasses(classVal) {
-      var classes = [];
-      if (isArray(classVal)) {
-        forEach(classVal, function(v) {
-          classes = classes.concat(arrayClasses(v));
-        });
-        return classes;
-      } else if (isString(classVal)) {
-        return classVal.split(' ');
-      } else if (isObject(classVal)) {
-        forEach(classVal, function(v, k) {
-          if (v) {
-            classes = classes.concat(k.split(' '));
-          }
-        });
-        return classes;
-      }
-      return classVal;
-    }
-  }];
-}
-
-/**
- * @ngdoc directive
- * @name ngClass
- * @restrict AC
- *
- * @description
- * The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding
- * an expression that represents all classes to be added.
- *
- * The directive operates in three different ways, depending on which of three types the expression
- * evaluates to:
- *
- * 1. If the expression evaluates to a string, the string should be one or more space-delimited class
- * names.
- *
- * 2. If the expression evaluates to an object, then for each key-value pair of the
- * object with a truthy value the corresponding key is used as a class name.
- *
- * 3. If the expression evaluates to an array, each element of the array should either be a string as in
- * type 1 or an object as in type 2. This means that you can mix strings and objects together in an array
- * to give you more control over what CSS classes appear. See the code below for an example of this.
- *
- *
- * The directive won't add duplicate classes if a particular class was already set.
- *
- * When the expression changes, the previously added classes are removed and only then are the
- * new classes added.
- *
- * @animations
- * **add** - happens just before the class is applied to the elements
- *
- * **remove** - happens just before the class is removed from the element
- *
- * @element ANY
- * @param {expression} ngClass {@link guide/expression Expression} to eval. The result
- *   of the evaluation can be a string representing space delimited class
- *   names, an array, or a map of class names to boolean values. In the case of a map, the
- *   names of the properties whose values are truthy will be added as css classes to the
- *   element.
- *
- * @example Example that demonstrates basic bindings via ngClass directive.
-   <example>
-     <file name="index.html">
-       <p ng-class="{strike: deleted, bold: important, 'has-error': error}">Map Syntax Example</p>
-       <label>
-          <input type="checkbox" ng-model="deleted">
-          deleted (apply "strike" class)
-       </label><br>
-       <label>
-          <input type="checkbox" ng-model="important">
-          important (apply "bold" class)
-       </label><br>
-       <label>
-          <input type="checkbox" ng-model="error">
-          error (apply "has-error" class)
-       </label>
-       <hr>
-       <p ng-class="style">Using String Syntax</p>
-       <input type="text" ng-model="style"
-              placeholder="Type: bold strike red" aria-label="Type: bold strike red">
-       <hr>
-       <p ng-class="[style1, style2, style3]">Using Array Syntax</p>
-       <input ng-model="style1"
-              placeholder="Type: bold, strike or red" aria-label="Type: bold, strike or red"><br>
-       <input ng-model="style2"
-              placeholder="Type: bold, strike or red" aria-label="Type: bold, strike or red 2"><br>
-       <input ng-model="style3"
-              placeholder="Type: bold, strike or red" aria-label="Type: bold, strike or red 3"><br>
-       <hr>
-       <p ng-class="[style4, {orange: warning}]">Using Array and Map Syntax</p>
-       <input ng-model="style4" placeholder="Type: bold, strike" aria-label="Type: bold, strike"><br>
-       <label><input type="checkbox" ng-model="warning"> warning (apply "orange" class)</label>
-     </file>
-     <file name="style.css">
-       .strike {
-           text-decoration: line-through;
-       }
-       .bold {
-           font-weight: bold;
-       }
-       .red {
-           color: red;
-       }
-       .has-error {
-           color: red;
-           background-color: yellow;
-       }
-       .orange {
-           color: orange;
-       }
-     </file>
-     <file name="protractor.js" type="protractor">
-       var ps = element.all(by.css('p'));
-
-       it('should let you toggle the class', function() {
-
-         expect(ps.first().getAttribute('class')).not.toMatch(/bold/);
-         expect(ps.first().getAttribute('class')).not.toMatch(/has-error/);
-
-         element(by.model('important')).click();
-         expect(ps.first().getAttribute('class')).toMatch(/bold/);
-
-         element(by.model('error')).click();
-         expect(ps.first().getAttribute('class')).toMatch(/has-error/);
-       });
-
-       it('should let you toggle string example', function() {
-         expect(ps.get(1).getAttribute('class')).toBe('');
-         element(by.model('style')).clear();
-         element(by.model('style')).sendKeys('red');
-         expect(ps.get(1).getAttribute('class')).toBe('red');
-       });
-
-       it('array example should have 3 classes', function() {
-         expect(ps.get(2).getAttribute('class')).toBe('');
-         element(by.model('style1')).sendKeys('bold');
-         element(by.model('style2')).sendKeys('strike');
-         element(by.model('style3')).sendKeys('red');
-         expect(ps.get(2).getAttribute('class')).toBe('bold strike red');
-       });
-
-       it('array with map example should have 2 classes', function() {
-         expect(ps.last().getAttribute('class')).toBe('');
-         element(by.model('style4')).sendKeys('bold');
-         element(by.model('warning')).click();
-         expect(ps.last().getAttribute('class')).toBe('bold orange');
-       });
-     </file>
-   </example>
-
-   ## Animations
-
-   The example below demonstrates how to perform animations using ngClass.
-
-   <example module="ngAnimate" deps="angular-animate.js" animations="true">
-     <file name="index.html">
-      <input id="setbtn" type="button" value="set" ng-click="myVar='my-class'">
-      <input id="clearbtn" type="button" value="clear" ng-click="myVar=''">
-      <br>
-      <span class="base-class" ng-class="myVar">Sample Text</span>
-     </file>
-     <file name="style.css">
-       .base-class {
-         transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
-       }
-
-       .base-class.my-class {
-         color: red;
-         font-size:3em;
-       }
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should check ng-class', function() {
-         expect(element(by.css('.base-class')).getAttribute('class')).not.
-           toMatch(/my-class/);
-
-         element(by.id('setbtn')).click();
-
-         expect(element(by.css('.base-class')).getAttribute('class')).
-           toMatch(/my-class/);
-
-         element(by.id('clearbtn')).click();
-
-         expect(element(by.css('.base-class')).getAttribute('class')).not.
-           toMatch(/my-class/);
-       });
-     </file>
-   </example>
-
-
-   ## ngClass and pre-existing CSS3 Transitions/Animations
-   The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.
-   Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder
-   any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure
-   to view the step by step details of {@link $animate#addClass $animate.addClass} and
-   {@link $animate#removeClass $animate.removeClass}.
- */
-var ngClassDirective = classDirective('', true);
-
-/**
- * @ngdoc directive
- * @name ngClassOdd
- * @restrict AC
- *
- * @description
- * The `ngClassOdd` and `ngClassEven` directives work exactly as
- * {@link ng.directive:ngClass ngClass}, except they work in
- * conjunction with `ngRepeat` and take effect only on odd (even) rows.
- *
- * This directive can be applied only within the scope of an
- * {@link ng.directive:ngRepeat ngRepeat}.
- *
- * @element ANY
- * @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result
- *   of the evaluation can be a string representing space delimited class names or an array.
- *
- * @example
-   <example>
-     <file name="index.html">
-        <ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
-          <li ng-repeat="name in names">
-           <span ng-class-odd="'odd'" ng-class-even="'even'">
-             {{name}}
-           </span>
-          </li>
-        </ol>
-     </file>
-     <file name="style.css">
-       .odd {
-         color: red;
-       }
-       .even {
-         color: blue;
-       }
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should check ng-class-odd and ng-class-even', function() {
-         expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).
-           toMatch(/odd/);
-         expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).
-           toMatch(/even/);
-       });
-     </file>
-   </example>
- */
-var ngClassOddDirective = classDirective('Odd', 0);
-
-/**
- * @ngdoc directive
- * @name ngClassEven
- * @restrict AC
- *
- * @description
- * The `ngClassOdd` and `ngClassEven` directives work exactly as
- * {@link ng.directive:ngClass ngClass}, except they work in
- * conjunction with `ngRepeat` and take effect only on odd (even) rows.
- *
- * This directive can be applied only within the scope of an
- * {@link ng.directive:ngRepeat ngRepeat}.
- *
- * @element ANY
- * @param {expression} ngClassEven {@link guide/expression Expression} to eval. The
- *   result of the evaluation can be a string representing space delimited class names or an array.
- *
- * @example
-   <example>
-     <file name="index.html">
-        <ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
-          <li ng-repeat="name in names">
-           <span ng-class-odd="'odd'" ng-class-even="'even'">
-             {{name}} &nbsp; &nbsp; &nbsp;
-           </span>
-          </li>
-        </ol>
-     </file>
-     <file name="style.css">
-       .odd {
-         color: red;
-       }
-       .even {
-         color: blue;
-       }
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should check ng-class-odd and ng-class-even', function() {
-         expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).
-           toMatch(/odd/);
-         expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).
-           toMatch(/even/);
-       });
-     </file>
-   </example>
- */
-var ngClassEvenDirective = classDirective('Even', 1);
-
-/**
- * @ngdoc directive
- * @name ngCloak
- * @restrict AC
- *
- * @description
- * The `ngCloak` directive is used to prevent the Angular html template from being briefly
- * displayed by the browser in its raw (uncompiled) form while your application is loading. Use this
- * directive to avoid the undesirable flicker effect caused by the html template display.
- *
- * The directive can be applied to the `<body>` element, but the preferred usage is to apply
- * multiple `ngCloak` directives to small portions of the page to permit progressive rendering
- * of the browser view.
- *
- * `ngCloak` works in cooperation with the following css rule embedded within `angular.js` and
- * `angular.min.js`.
- * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).
- *
- * ```css
- * [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
- *   display: none !important;
- * }
- * ```
- *
- * When this css rule is loaded by the browser, all html elements (including their children) that
- * are tagged with the `ngCloak` directive are hidden. When Angular encounters this directive
- * during the compilation of the template it deletes the `ngCloak` element attribute, making
- * the compiled element visible.
- *
- * For the best result, the `angular.js` script must be loaded in the head section of the html
- * document; alternatively, the css rule above must be included in the external stylesheet of the
- * application.
- *
- * @element ANY
- *
- * @example
-   <example>
-     <file name="index.html">
-        <div id="template1" ng-cloak>{{ 'hello' }}</div>
-        <div id="template2" class="ng-cloak">{{ 'world' }}</div>
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should remove the template directive and css class', function() {
-         expect($('#template1').getAttribute('ng-cloak')).
-           toBeNull();
-         expect($('#template2').getAttribute('ng-cloak')).
-           toBeNull();
-       });
-     </file>
-   </example>
- *
- */
-var ngCloakDirective = ngDirective({
-  compile: function(element, attr) {
-    attr.$set('ngCloak', undefined);
-    element.removeClass('ng-cloak');
-  }
-});
-
-/**
- * @ngdoc directive
- * @name ngController
- *
- * @description
- * The `ngController` directive attaches a controller class to the view. This is a key aspect of how angular
- * supports the principles behind the Model-View-Controller design pattern.
- *
- * MVC components in angular:
- *
- * * Model — Models are the properties of a scope; scopes are attached to the DOM where scope properties
- *   are accessed through bindings.
- * * View — The template (HTML with data bindings) that is rendered into the View.
- * * Controller — The `ngController` directive specifies a Controller class; the class contains business
- *   logic behind the application to decorate the scope with functions and values
- *
- * Note that you can also attach controllers to the DOM by declaring it in a route definition
- * via the {@link ngRoute.$route $route} service. A common mistake is to declare the controller
- * again using `ng-controller` in the template itself.  This will cause the controller to be attached
- * and executed twice.
- *
- * @element ANY
- * @scope
- * @priority 500
- * @param {expression} ngController Name of a constructor function registered with the current
- * {@link ng.$controllerProvider $controllerProvider} or an {@link guide/expression expression}
- * that on the current scope evaluates to a constructor function.
- *
- * The controller instance can be published into a scope property by specifying
- * `ng-controller="as propertyName"`.
- *
- * If the current `$controllerProvider` is configured to use globals (via
- * {@link ng.$controllerProvider#allowGlobals `$controllerProvider.allowGlobals()` }), this may
- * also be the name of a globally accessible constructor function (not recommended).
- *
- * @example
- * Here is a simple form for editing user contact information. Adding, removing, clearing, and
- * greeting are methods declared on the controller (see source tab). These methods can
- * easily be called from the angular markup. Any changes to the data are automatically reflected
- * in the View without the need for a manual update.
- *
- * Two different declaration styles are included below:
- *
- * * one binds methods and properties directly onto the controller using `this`:
- * `ng-controller="SettingsController1 as settings"`
- * * one injects `$scope` into the controller:
- * `ng-controller="SettingsController2"`
- *
- * The second option is more common in the Angular community, and is generally used in boilerplates
- * and in this guide. However, there are advantages to binding properties directly to the controller
- * and avoiding scope.
- *
- * * Using `controller as` makes it obvious which controller you are accessing in the template when
- * multiple controllers apply to an element.
- * * If you are writing your controllers as classes you have easier access to the properties and
- * methods, which will appear on the scope, from inside the controller code.
- * * Since there is always a `.` in the bindings, you don't have to worry about prototypal
- * inheritance masking primitives.
- *
- * This example demonstrates the `controller as` syntax.
- *
- * <example name="ngControllerAs" module="controllerAsExample">
- *   <file name="index.html">
- *    <div id="ctrl-as-exmpl" ng-controller="SettingsController1 as settings">
- *      <label>Name: <input type="text" ng-model="settings.name"/></label>
- *      <button ng-click="settings.greet()">greet</button><br/>
- *      Contact:
- *      <ul>
- *        <li ng-repeat="contact in settings.contacts">
- *          <select ng-model="contact.type" aria-label="Contact method" id="select_{{$index}}">
- *             <option>phone</option>
- *             <option>email</option>
- *          </select>
- *          <input type="text" ng-model="contact.value" aria-labelledby="select_{{$index}}" />
- *          <button ng-click="settings.clearContact(contact)">clear</button>
- *          <button ng-click="settings.removeContact(contact)" aria-label="Remove">X</button>
- *        </li>
- *        <li><button ng-click="settings.addContact()">add</button></li>
- *     </ul>
- *    </div>
- *   </file>
- *   <file name="app.js">
- *    angular.module('controllerAsExample', [])
- *      .controller('SettingsController1', SettingsController1);
- *
- *    function SettingsController1() {
- *      this.name = "John Smith";
- *      this.contacts = [
- *        {type: 'phone', value: '408 555 1212'},
- *        {type: 'email', value: 'john.smith@example.org'} ];
- *    }
- *
- *    SettingsController1.prototype.greet = function() {
- *      alert(this.name);
- *    };
- *
- *    SettingsController1.prototype.addContact = function() {
- *      this.contacts.push({type: 'email', value: 'yourname@example.org'});
- *    };
- *
- *    SettingsController1.prototype.removeContact = function(contactToRemove) {
- *     var index = this.contacts.indexOf(contactToRemove);
- *      this.contacts.splice(index, 1);
- *    };
- *
- *    SettingsController1.prototype.clearContact = function(contact) {
- *      contact.type = 'phone';
- *      contact.value = '';
- *    };
- *   </file>
- *   <file name="protractor.js" type="protractor">
- *     it('should check controller as', function() {
- *       var container = element(by.id('ctrl-as-exmpl'));
- *         expect(container.element(by.model('settings.name'))
- *           .getAttribute('value')).toBe('John Smith');
- *
- *       var firstRepeat =
- *           container.element(by.repeater('contact in settings.contacts').row(0));
- *       var secondRepeat =
- *           container.element(by.repeater('contact in settings.contacts').row(1));
- *
- *       expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
- *           .toBe('408 555 1212');
- *
- *       expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))
- *           .toBe('john.smith@example.org');
- *
- *       firstRepeat.element(by.buttonText('clear')).click();
- *
- *       expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
- *           .toBe('');
- *
- *       container.element(by.buttonText('add')).click();
- *
- *       expect(container.element(by.repeater('contact in settings.contacts').row(2))
- *           .element(by.model('contact.value'))
- *           .getAttribute('value'))
- *           .toBe('yourname@example.org');
- *     });
- *   </file>
- * </example>
- *
- * This example demonstrates the "attach to `$scope`" style of controller.
- *
- * <example name="ngController" module="controllerExample">
- *  <file name="index.html">
- *   <div id="ctrl-exmpl" ng-controller="SettingsController2">
- *     <label>Name: <input type="text" ng-model="name"/></label>
- *     <button ng-click="greet()">greet</button><br/>
- *     Contact:
- *     <ul>
- *       <li ng-repeat="contact in contacts">
- *         <select ng-model="contact.type" id="select_{{$index}}">
- *            <option>phone</option>
- *            <option>email</option>
- *         </select>
- *         <input type="text" ng-model="contact.value" aria-labelledby="select_{{$index}}" />
- *         <button ng-click="clearContact(contact)">clear</button>
- *         <button ng-click="removeContact(contact)">X</button>
- *       </li>
- *       <li>[ <button ng-click="addContact()">add</button> ]</li>
- *    </ul>
- *   </div>
- *  </file>
- *  <file name="app.js">
- *   angular.module('controllerExample', [])
- *     .controller('SettingsController2', ['$scope', SettingsController2]);
- *
- *   function SettingsController2($scope) {
- *     $scope.name = "John Smith";
- *     $scope.contacts = [
- *       {type:'phone', value:'408 555 1212'},
- *       {type:'email', value:'john.smith@example.org'} ];
- *
- *     $scope.greet = function() {
- *       alert($scope.name);
- *     };
- *
- *     $scope.addContact = function() {
- *       $scope.contacts.push({type:'email', value:'yourname@example.org'});
- *     };
- *
- *     $scope.removeContact = function(contactToRemove) {
- *       var index = $scope.contacts.indexOf(contactToRemove);
- *       $scope.contacts.splice(index, 1);
- *     };
- *
- *     $scope.clearContact = function(contact) {
- *       contact.type = 'phone';
- *       contact.value = '';
- *     };
- *   }
- *  </file>
- *  <file name="protractor.js" type="protractor">
- *    it('should check controller', function() {
- *      var container = element(by.id('ctrl-exmpl'));
- *
- *      expect(container.element(by.model('name'))
- *          .getAttribute('value')).toBe('John Smith');
- *
- *      var firstRepeat =
- *          container.element(by.repeater('contact in contacts').row(0));
- *      var secondRepeat =
- *          container.element(by.repeater('contact in contacts').row(1));
- *
- *      expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
- *          .toBe('408 555 1212');
- *      expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))
- *          .toBe('john.smith@example.org');
- *
- *      firstRepeat.element(by.buttonText('clear')).click();
- *
- *      expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
- *          .toBe('');
- *
- *      container.element(by.buttonText('add')).click();
- *
- *      expect(container.element(by.repeater('contact in contacts').row(2))
- *          .element(by.model('contact.value'))
- *          .getAttribute('value'))
- *          .toBe('yourname@example.org');
- *    });
- *  </file>
- *</example>
-
- */
-var ngControllerDirective = [function() {
-  return {
-    restrict: 'A',
-    scope: true,
-    controller: '@',
-    priority: 500
-  };
-}];
-
-/**
- * @ngdoc directive
- * @name ngCsp
- *
- * @element html
- * @description
- *
- * Angular has some features that can break certain
- * [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) rules.
- *
- * If you intend to implement these rules then you must tell Angular not to use these features.
- *
- * This is necessary when developing things like Google Chrome Extensions or Universal Windows Apps.
- *
- *
- * The following rules affect Angular:
- *
- * * `unsafe-eval`: this rule forbids apps to use `eval` or `Function(string)` generated functions
- * (among other things). Angular makes use of this in the {@link $parse} service to provide a 30%
- * increase in the speed of evaluating Angular expressions.
- *
- * * `unsafe-inline`: this rule forbids apps from inject custom styles into the document. Angular
- * makes use of this to include some CSS rules (e.g. {@link ngCloak} and {@link ngHide}).
- * To make these directives work when a CSP rule is blocking inline styles, you must link to the
- * `angular-csp.css` in your HTML manually.
- *
- * If you do not provide `ngCsp` then Angular tries to autodetect if CSP is blocking unsafe-eval
- * and automatically deactivates this feature in the {@link $parse} service. This autodetection,
- * however, triggers a CSP error to be logged in the console:
- *
- * ```
- * Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of
- * script in the following Content Security Policy directive: "default-src 'self'". Note that
- * 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
- * ```
- *
- * This error is harmless but annoying. To prevent the error from showing up, put the `ngCsp`
- * directive on an element of the HTML document that appears before the `<script>` tag that loads
- * the `angular.js` file.
- *
- * *Note: This directive is only available in the `ng-csp` and `data-ng-csp` attribute form.*
- *
- * You can specify which of the CSP related Angular features should be deactivated by providing
- * a value for the `ng-csp` attribute. The options are as follows:
- *
- * * no-inline-style: this stops Angular from injecting CSS styles into the DOM
- *
- * * no-unsafe-eval: this stops Angular from optimising $parse with unsafe eval of strings
- *
- * You can use these values in the following combinations:
- *
- *
- * * No declaration means that Angular will assume that you can do inline styles, but it will do
- * a runtime check for unsafe-eval. E.g. `<body>`. This is backwardly compatible with previous versions
- * of Angular.
- *
- * * A simple `ng-csp` (or `data-ng-csp`) attribute will tell Angular to deactivate both inline
- * styles and unsafe eval. E.g. `<body ng-csp>`. This is backwardly compatible with previous versions
- * of Angular.
- *
- * * Specifying only `no-unsafe-eval` tells Angular that we must not use eval, but that we can inject
- * inline styles. E.g. `<body ng-csp="no-unsafe-eval">`.
- *
- * * Specifying only `no-inline-style` tells Angular that we must not inject styles, but that we can
- * run eval - no automcatic check for unsafe eval will occur. E.g. `<body ng-csp="no-inline-style">`
- *
- * * Specifying both `no-unsafe-eval` and `no-inline-style` tells Angular that we must not inject
- * styles nor use eval, which is the same as an empty: ng-csp.
- * E.g.`<body ng-csp="no-inline-style;no-unsafe-eval">`
- *
- * @example
- * This example shows how to apply the `ngCsp` directive to the `html` tag.
-   ```html
-     <!doctype html>
-     <html ng-app ng-csp>
-     ...
-     ...
-     </html>
-   ```
-  * @example
-      // Note: the suffix `.csp` in the example name triggers
-      // csp mode in our http server!
-      <example name="example.csp" module="cspExample" ng-csp="true">
-        <file name="index.html">
-          <div ng-controller="MainController as ctrl">
-            <div>
-              <button ng-click="ctrl.inc()" id="inc">Increment</button>
-              <span id="counter">
-                {{ctrl.counter}}
-              </span>
-            </div>
-
-            <div>
-              <button ng-click="ctrl.evil()" id="evil">Evil</button>
-              <span id="evilError">
-                {{ctrl.evilError}}
-              </span>
-            </div>
-          </div>
-        </file>
-        <file name="script.js">
-           angular.module('cspExample', [])
-             .controller('MainController', function() {
-                this.counter = 0;
-                this.inc = function() {
-                  this.counter++;
-                };
-                this.evil = function() {
-                  // jshint evil:true
-                  try {
-                    eval('1+2');
-                  } catch (e) {
-                    this.evilError = e.message;
-                  }
-                };
-              });
-        </file>
-        <file name="protractor.js" type="protractor">
-          var util, webdriver;
-
-          var incBtn = element(by.id('inc'));
-          var counter = element(by.id('counter'));
-          var evilBtn = element(by.id('evil'));
-          var evilError = element(by.id('evilError'));
-
-          function getAndClearSevereErrors() {
-            return browser.manage().logs().get('browser').then(function(browserLog) {
-              return browserLog.filter(function(logEntry) {
-                return logEntry.level.value > webdriver.logging.Level.WARNING.value;
-              });
-            });
-          }
-
-          function clearErrors() {
-            getAndClearSevereErrors();
-          }
-
-          function expectNoErrors() {
-            getAndClearSevereErrors().then(function(filteredLog) {
-              expect(filteredLog.length).toEqual(0);
-              if (filteredLog.length) {
-                console.log('browser console errors: ' + util.inspect(filteredLog));
-              }
-            });
-          }
-
-          function expectError(regex) {
-            getAndClearSevereErrors().then(function(filteredLog) {
-              var found = false;
-              filteredLog.forEach(function(log) {
-                if (log.message.match(regex)) {
-                  found = true;
-                }
-              });
-              if (!found) {
-                throw new Error('expected an error that matches ' + regex);
-              }
-            });
-          }
-
-          beforeEach(function() {
-            util = require('util');
-            webdriver = require('protractor/node_modules/selenium-webdriver');
-          });
-
-          // For now, we only test on Chrome,
-          // as Safari does not load the page with Protractor's injected scripts,
-          // and Firefox webdriver always disables content security policy (#6358)
-          if (browser.params.browser !== 'chrome') {
-            return;
-          }
-
-          it('should not report errors when the page is loaded', function() {
-            // clear errors so we are not dependent on previous tests
-            clearErrors();
-            // Need to reload the page as the page is already loaded when
-            // we come here
-            browser.driver.getCurrentUrl().then(function(url) {
-              browser.get(url);
-            });
-            expectNoErrors();
-          });
-
-          it('should evaluate expressions', function() {
-            expect(counter.getText()).toEqual('0');
-            incBtn.click();
-            expect(counter.getText()).toEqual('1');
-            expectNoErrors();
-          });
-
-          it('should throw and report an error when using "eval"', function() {
-            evilBtn.click();
-            expect(evilError.getText()).toMatch(/Content Security Policy/);
-            expectError(/Content Security Policy/);
-          });
-        </file>
-      </example>
-  */
-
-// ngCsp is not implemented as a proper directive any more, because we need it be processed while we
-// bootstrap the system (before $parse is instantiated), for this reason we just have
-// the csp() fn that looks for the `ng-csp` attribute anywhere in the current doc
-
-/**
- * @ngdoc directive
- * @name ngClick
- *
- * @description
- * The ngClick directive allows you to specify custom behavior when
- * an element is clicked.
- *
- * @element ANY
- * @priority 0
- * @param {expression} ngClick {@link guide/expression Expression} to evaluate upon
- * click. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
-   <example>
-     <file name="index.html">
-      <button ng-click="count = count + 1" ng-init="count=0">
-        Increment
-      </button>
-      <span>
-        count: {{count}}
-      </span>
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should check ng-click', function() {
-         expect(element(by.binding('count')).getText()).toMatch('0');
-         element(by.css('button')).click();
-         expect(element(by.binding('count')).getText()).toMatch('1');
-       });
-     </file>
-   </example>
- */
-/*
- * A collection of directives that allows creation of custom event handlers that are defined as
- * angular expressions and are compiled and executed within the current scope.
- */
-var ngEventDirectives = {};
-
-// For events that might fire synchronously during DOM manipulation
-// we need to execute their event handlers asynchronously using $evalAsync,
-// so that they are not executed in an inconsistent state.
-var forceAsyncEvents = {
-  'blur': true,
-  'focus': true
-};
-forEach(
-  'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),
-  function(eventName) {
-    var directiveName = directiveNormalize('ng-' + eventName);
-    ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) {
-      return {
-        restrict: 'A',
-        compile: function($element, attr) {
-          // We expose the powerful $event object on the scope that provides access to the Window,
-          // etc. that isn't protected by the fast paths in $parse.  We explicitly request better
-          // checks at the cost of speed since event handler expressions are not executed as
-          // frequently as regular change detection.
-          var fn = $parse(attr[directiveName], /* interceptorFn */ null, /* expensiveChecks */ true);
-          return function ngEventHandler(scope, element) {
-            element.on(eventName, function(event) {
-              var callback = function() {
-                fn(scope, {$event:event});
-              };
-              if (forceAsyncEvents[eventName] && $rootScope.$$phase) {
-                scope.$evalAsync(callback);
-              } else {
-                scope.$apply(callback);
-              }
-            });
-          };
-        }
-      };
-    }];
-  }
-);
-
-/**
- * @ngdoc directive
- * @name ngDblclick
- *
- * @description
- * The `ngDblclick` directive allows you to specify custom behavior on a dblclick event.
- *
- * @element ANY
- * @priority 0
- * @param {expression} ngDblclick {@link guide/expression Expression} to evaluate upon
- * a dblclick. (The Event object is available as `$event`)
- *
- * @example
-   <example>
-     <file name="index.html">
-      <button ng-dblclick="count = count + 1" ng-init="count=0">
-        Increment (on double click)
-      </button>
-      count: {{count}}
-     </file>
-   </example>
- */
-
-
-/**
- * @ngdoc directive
- * @name ngMousedown
- *
- * @description
- * The ngMousedown directive allows you to specify custom behavior on mousedown event.
- *
- * @element ANY
- * @priority 0
- * @param {expression} ngMousedown {@link guide/expression Expression} to evaluate upon
- * mousedown. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
-   <example>
-     <file name="index.html">
-      <button ng-mousedown="count = count + 1" ng-init="count=0">
-        Increment (on mouse down)
-      </button>
-      count: {{count}}
-     </file>
-   </example>
- */
-
-
-/**
- * @ngdoc directive
- * @name ngMouseup
- *
- * @description
- * Specify custom behavior on mouseup event.
- *
- * @element ANY
- * @priority 0
- * @param {expression} ngMouseup {@link guide/expression Expression} to evaluate upon
- * mouseup. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
-   <example>
-     <file name="index.html">
-      <button ng-mouseup="count = count + 1" ng-init="count=0">
-        Increment (on mouse up)
-      </button>
-      count: {{count}}
-     </file>
-   </example>
- */
-
-/**
- * @ngdoc directive
- * @name ngMouseover
- *
- * @description
- * Specify custom behavior on mouseover event.
- *
- * @element ANY
- * @priority 0
- * @param {expression} ngMouseover {@link guide/expression Expression} to evaluate upon
- * mouseover. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
-   <example>
-     <file name="index.html">
-      <button ng-mouseover="count = count + 1" ng-init="count=0">
-        Increment (when mouse is over)
-      </button>
-      count: {{count}}
-     </file>
-   </example>
- */
-
-
-/**
- * @ngdoc directive
- * @name ngMouseenter
- *
- * @description
- * Specify custom behavior on mouseenter event.
- *
- * @element ANY
- * @priority 0
- * @param {expression} ngMouseenter {@link guide/expression Expression} to evaluate upon
- * mouseenter. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
-   <example>
-     <file name="index.html">
-      <button ng-mouseenter="count = count + 1" ng-init="count=0">
-        Increment (when mouse enters)
-      </button>
-      count: {{count}}
-     </file>
-   </example>
- */
-
-
-/**
- * @ngdoc directive
- * @name ngMouseleave
- *
- * @description
- * Specify custom behavior on mouseleave event.
- *
- * @element ANY
- * @priority 0
- * @param {expression} ngMouseleave {@link guide/expression Expression} to evaluate upon
- * mouseleave. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
-   <example>
-     <file name="index.html">
-      <button ng-mouseleave="count = count + 1" ng-init="count=0">
-        Increment (when mouse leaves)
-      </button>
-      count: {{count}}
-     </file>
-   </example>
- */
-
-
-/**
- * @ngdoc directive
- * @name ngMousemove
- *
- * @description
- * Specify custom behavior on mousemove event.
- *
- * @element ANY
- * @priority 0
- * @param {expression} ngMousemove {@link guide/expression Expression} to evaluate upon
- * mousemove. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
-   <example>
-     <file name="index.html">
-      <button ng-mousemove="count = count + 1" ng-init="count=0">
-        Increment (when mouse moves)
-      </button>
-      count: {{count}}
-     </file>
-   </example>
- */
-
-
-/**
- * @ngdoc directive
- * @name ngKeydown
- *
- * @description
- * Specify custom behavior on keydown event.
- *
- * @element ANY
- * @priority 0
- * @param {expression} ngKeydown {@link guide/expression Expression} to evaluate upon
- * keydown. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)
- *
- * @example
-   <example>
-     <file name="index.html">
-      <input ng-keydown="count = count + 1" ng-init="count=0">
-      key down count: {{count}}
-     </file>
-   </example>
- */
-
-
-/**
- * @ngdoc directive
- * @name ngKeyup
- *
- * @description
- * Specify custom behavior on keyup event.
- *
- * @element ANY
- * @priority 0
- * @param {expression} ngKeyup {@link guide/expression Expression} to evaluate upon
- * keyup. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)
- *
- * @example
-   <example>
-     <file name="index.html">
-       <p>Typing in the input box below updates the key count</p>
-       <input ng-keyup="count = count + 1" ng-init="count=0"> key up count: {{count}}
-
-       <p>Typing in the input box below updates the keycode</p>
-       <input ng-keyup="event=$event">
-       <p>event keyCode: {{ event.keyCode }}</p>
-       <p>event altKey: {{ event.altKey }}</p>
-     </file>
-   </example>
- */
-
-
-/**
- * @ngdoc directive
- * @name ngKeypress
- *
- * @description
- * Specify custom behavior on keypress event.
- *
- * @element ANY
- * @param {expression} ngKeypress {@link guide/expression Expression} to evaluate upon
- * keypress. ({@link guide/expression#-event- Event object is available as `$event`}
- * and can be interrogated for keyCode, altKey, etc.)
- *
- * @example
-   <example>
-     <file name="index.html">
-      <input ng-keypress="count = count + 1" ng-init="count=0">
-      key press count: {{count}}
-     </file>
-   </example>
- */
-
-
-/**
- * @ngdoc directive
- * @name ngSubmit
- *
- * @description
- * Enables binding angular expressions to onsubmit events.
- *
- * Additionally it prevents the default action (which for form means sending the request to the
- * server and reloading the current page), but only if the form does not contain `action`,
- * `data-action`, or `x-action` attributes.
- *
- * <div class="alert alert-warning">
- * **Warning:** Be careful not to cause "double-submission" by using both the `ngClick` and
- * `ngSubmit` handlers together. See the
- * {@link form#submitting-a-form-and-preventing-the-default-action `form` directive documentation}
- * for a detailed discussion of when `ngSubmit` may be triggered.
- * </div>
- *
- * @element form
- * @priority 0
- * @param {expression} ngSubmit {@link guide/expression Expression} to eval.
- * ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
-   <example module="submitExample">
-     <file name="index.html">
-      <script>
-        angular.module('submitExample', [])
-          .controller('ExampleController', ['$scope', function($scope) {
-            $scope.list = [];
-            $scope.text = 'hello';
-            $scope.submit = function() {
-              if ($scope.text) {
-                $scope.list.push(this.text);
-                $scope.text = '';
-              }
-            };
-          }]);
-      </script>
-      <form ng-submit="submit()" ng-controller="ExampleController">
-        Enter text and hit enter:
-        <input type="text" ng-model="text" name="text" />
-        <input type="submit" id="submit" value="Submit" />
-        <pre>list={{list}}</pre>
-      </form>
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should check ng-submit', function() {
-         expect(element(by.binding('list')).getText()).toBe('list=[]');
-         element(by.css('#submit')).click();
-         expect(element(by.binding('list')).getText()).toContain('hello');
-         expect(element(by.model('text')).getAttribute('value')).toBe('');
-       });
-       it('should ignore empty strings', function() {
-         expect(element(by.binding('list')).getText()).toBe('list=[]');
-         element(by.css('#submit')).click();
-         element(by.css('#submit')).click();
-         expect(element(by.binding('list')).getText()).toContain('hello');
-        });
-     </file>
-   </example>
- */
-
-/**
- * @ngdoc directive
- * @name ngFocus
- *
- * @description
- * Specify custom behavior on focus event.
- *
- * Note: As the `focus` event is executed synchronously when calling `input.focus()`
- * AngularJS executes the expression using `scope.$evalAsync` if the event is fired
- * during an `$apply` to ensure a consistent state.
- *
- * @element window, input, select, textarea, a
- * @priority 0
- * @param {expression} ngFocus {@link guide/expression Expression} to evaluate upon
- * focus. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
- * See {@link ng.directive:ngClick ngClick}
- */
-
-/**
- * @ngdoc directive
- * @name ngBlur
- *
- * @description
- * Specify custom behavior on blur event.
- *
- * A [blur event](https://developer.mozilla.org/en-US/docs/Web/Events/blur) fires when
- * an element has lost focus.
- *
- * Note: As the `blur` event is executed synchronously also during DOM manipulations
- * (e.g. removing a focussed input),
- * AngularJS executes the expression using `scope.$evalAsync` if the event is fired
- * during an `$apply` to ensure a consistent state.
- *
- * @element window, input, select, textarea, a
- * @priority 0
- * @param {expression} ngBlur {@link guide/expression Expression} to evaluate upon
- * blur. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
- * See {@link ng.directive:ngClick ngClick}
- */
-
-/**
- * @ngdoc directive
- * @name ngCopy
- *
- * @description
- * Specify custom behavior on copy event.
- *
- * @element window, input, select, textarea, a
- * @priority 0
- * @param {expression} ngCopy {@link guide/expression Expression} to evaluate upon
- * copy. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
-   <example>
-     <file name="index.html">
-      <input ng-copy="copied=true" ng-init="copied=false; value='copy me'" ng-model="value">
-      copied: {{copied}}
-     </file>
-   </example>
- */
-
-/**
- * @ngdoc directive
- * @name ngCut
- *
- * @description
- * Specify custom behavior on cut event.
- *
- * @element window, input, select, textarea, a
- * @priority 0
- * @param {expression} ngCut {@link guide/expression Expression} to evaluate upon
- * cut. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
-   <example>
-     <file name="index.html">
-      <input ng-cut="cut=true" ng-init="cut=false; value='cut me'" ng-model="value">
-      cut: {{cut}}
-     </file>
-   </example>
- */
-
-/**
- * @ngdoc directive
- * @name ngPaste
- *
- * @description
- * Specify custom behavior on paste event.
- *
- * @element window, input, select, textarea, a
- * @priority 0
- * @param {expression} ngPaste {@link guide/expression Expression} to evaluate upon
- * paste. ({@link guide/expression#-event- Event object is available as `$event`})
- *
- * @example
-   <example>
-     <file name="index.html">
-      <input ng-paste="paste=true" ng-init="paste=false" placeholder='paste here'>
-      pasted: {{paste}}
-     </file>
-   </example>
- */
-
-/**
- * @ngdoc directive
- * @name ngIf
- * @restrict A
- * @multiElement
- *
- * @description
- * The `ngIf` directive removes or recreates a portion of the DOM tree based on an
- * {expression}. If the expression assigned to `ngIf` evaluates to a false
- * value then the element is removed from the DOM, otherwise a clone of the
- * element is reinserted into the DOM.
- *
- * `ngIf` differs from `ngShow` and `ngHide` in that `ngIf` completely removes and recreates the
- * element in the DOM rather than changing its visibility via the `display` css property.  A common
- * case when this difference is significant is when using css selectors that rely on an element's
- * position within the DOM, such as the `:first-child` or `:last-child` pseudo-classes.
- *
- * Note that when an element is removed using `ngIf` its scope is destroyed and a new scope
- * is created when the element is restored.  The scope created within `ngIf` inherits from
- * its parent scope using
- * [prototypal inheritance](https://github.com/angular/angular.js/wiki/Understanding-Scopes#javascript-prototypal-inheritance).
- * An important implication of this is if `ngModel` is used within `ngIf` to bind to
- * a javascript primitive defined in the parent scope. In this case any modifications made to the
- * variable within the child scope will override (hide) the value in the parent scope.
- *
- * Also, `ngIf` recreates elements using their compiled state. An example of this behavior
- * is if an element's class attribute is directly modified after it's compiled, using something like
- * jQuery's `.addClass()` method, and the element is later removed. When `ngIf` recreates the element
- * the added class will be lost because the original compiled state is used to regenerate the element.
- *
- * Additionally, you can provide animations via the `ngAnimate` module to animate the `enter`
- * and `leave` effects.
- *
- * @animations
- * enter - happens just after the `ngIf` contents change and a new DOM element is created and injected into the `ngIf` container
- * leave - happens just before the `ngIf` contents are removed from the DOM
- *
- * @element ANY
- * @scope
- * @priority 600
- * @param {expression} ngIf If the {@link guide/expression expression} is falsy then
- *     the element is removed from the DOM tree. If it is truthy a copy of the compiled
- *     element is added to the DOM tree.
- *
- * @example
-  <example module="ngAnimate" deps="angular-animate.js" animations="true">
-    <file name="index.html">
-      <label>Click me: <input type="checkbox" ng-model="checked" ng-init="checked=true" /></label><br/>
-      Show when checked:
-      <span ng-if="checked" class="animate-if">
-        This is removed when the checkbox is unchecked.
-      </span>
-    </file>
-    <file name="animations.css">
-      .animate-if {
-        background:white;
-        border:1px solid black;
-        padding:10px;
-      }
-
-      .animate-if.ng-enter, .animate-if.ng-leave {
-        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
-      }
-
-      .animate-if.ng-enter,
-      .animate-if.ng-leave.ng-leave-active {
-        opacity:0;
-      }
-
-      .animate-if.ng-leave,
-      .animate-if.ng-enter.ng-enter-active {
-        opacity:1;
-      }
-    </file>
-  </example>
- */
-var ngIfDirective = ['$animate', function($animate) {
-  return {
-    multiElement: true,
-    transclude: 'element',
-    priority: 600,
-    terminal: true,
-    restrict: 'A',
-    $$tlb: true,
-    link: function($scope, $element, $attr, ctrl, $transclude) {
-        var block, childScope, previousElements;
-        $scope.$watch($attr.ngIf, function ngIfWatchAction(value) {
-
-          if (value) {
-            if (!childScope) {
-              $transclude(function(clone, newScope) {
-                childScope = newScope;
-                clone[clone.length++] = document.createComment(' end ngIf: ' + $attr.ngIf + ' ');
-                // Note: We only need the first/last node of the cloned nodes.
-                // However, we need to keep the reference to the jqlite wrapper as it might be changed later
-                // by a directive with templateUrl when its template arrives.
-                block = {
-                  clone: clone
-                };
-                $animate.enter(clone, $element.parent(), $element);
-              });
-            }
-          } else {
-            if (previousElements) {
-              previousElements.remove();
-              previousElements = null;
-            }
-            if (childScope) {
-              childScope.$destroy();
-              childScope = null;
-            }
-            if (block) {
-              previousElements = getBlockNodes(block.clone);
-              $animate.leave(previousElements).then(function() {
-                previousElements = null;
-              });
-              block = null;
-            }
-          }
-        });
-    }
-  };
-}];
-
-/**
- * @ngdoc directive
- * @name ngInclude
- * @restrict ECA
- *
- * @description
- * Fetches, compiles and includes an external HTML fragment.
- *
- * By default, the template URL is restricted to the same domain and protocol as the
- * application document. This is done by calling {@link $sce#getTrustedResourceUrl
- * $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols
- * you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist them} or
- * {@link $sce#trustAsResourceUrl wrap them} as trusted values. Refer to Angular's {@link
- * ng.$sce Strict Contextual Escaping}.
- *
- * In addition, the browser's
- * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)
- * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)
- * policy may further restrict whether the template is successfully loaded.
- * For example, `ngInclude` won't work for cross-domain requests on all browsers and for `file://`
- * access on some browsers.
- *
- * @animations
- * enter - animation is used to bring new content into the browser.
- * leave - animation is used to animate existing content away.
- *
- * The enter and leave animation occur concurrently.
- *
- * @scope
- * @priority 400
- *
- * @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant,
- *                 make sure you wrap it in **single** quotes, e.g. `src="'myPartialTemplate.html'"`.
- * @param {string=} onload Expression to evaluate when a new partial is loaded.
- *
- * @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll
- *                  $anchorScroll} to scroll the viewport after the content is loaded.
- *
- *                  - If the attribute is not set, disable scrolling.
- *                  - If the attribute is set without value, enable scrolling.
- *                  - Otherwise enable scrolling only if the expression evaluates to truthy value.
- *
- * @example
-  <example module="includeExample" deps="angular-animate.js" animations="true">
-    <file name="index.html">
-     <div ng-controller="ExampleController">
-       <select ng-model="template" ng-options="t.name for t in templates">
-        <option value="">(blank)</option>
-       </select>
-       url of the template: <code>{{template.url}}</code>
-       <hr/>
-       <div class="slide-animate-container">
-         <div class="slide-animate" ng-include="template.url"></div>
-       </div>
-     </div>
-    </file>
-    <file name="script.js">
-      angular.module('includeExample', ['ngAnimate'])
-        .controller('ExampleController', ['$scope', function($scope) {
-          $scope.templates =
-            [ { name: 'template1.html', url: 'template1.html'},
-              { name: 'template2.html', url: 'template2.html'} ];
-          $scope.template = $scope.templates[0];
-        }]);
-     </file>
-    <file name="template1.html">
-      Content of template1.html
-    </file>
-    <file name="template2.html">
-      Content of template2.html
-    </file>
-    <file name="animations.css">
-      .slide-animate-container {
-        position:relative;
-        background:white;
-        border:1px solid black;
-        height:40px;
-        overflow:hidden;
-      }
-
-      .slide-animate {
-        padding:10px;
-      }
-
-      .slide-animate.ng-enter, .slide-animate.ng-leave {
-        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
-
-        position:absolute;
-        top:0;
-        left:0;
-        right:0;
-        bottom:0;
-        display:block;
-        padding:10px;
-      }
-
-      .slide-animate.ng-enter {
-        top:-50px;
-      }
-      .slide-animate.ng-enter.ng-enter-active {
-        top:0;
-      }
-
-      .slide-animate.ng-leave {
-        top:0;
-      }
-      .slide-animate.ng-leave.ng-leave-active {
-        top:50px;
-      }
-    </file>
-    <file name="protractor.js" type="protractor">
-      var templateSelect = element(by.model('template'));
-      var includeElem = element(by.css('[ng-include]'));
-
-      it('should load template1.html', function() {
-        expect(includeElem.getText()).toMatch(/Content of template1.html/);
-      });
-
-      it('should load template2.html', function() {
-        if (browser.params.browser == 'firefox') {
-          // Firefox can't handle using selects
-          // See https://github.com/angular/protractor/issues/480
-          return;
-        }
-        templateSelect.click();
-        templateSelect.all(by.css('option')).get(2).click();
-        expect(includeElem.getText()).toMatch(/Content of template2.html/);
-      });
-
-      it('should change to blank', function() {
-        if (browser.params.browser == 'firefox') {
-          // Firefox can't handle using selects
-          return;
-        }
-        templateSelect.click();
-        templateSelect.all(by.css('option')).get(0).click();
-        expect(includeElem.isPresent()).toBe(false);
-      });
-    </file>
-  </example>
- */
-
-
-/**
- * @ngdoc event
- * @name ngInclude#$includeContentRequested
- * @eventType emit on the scope ngInclude was declared in
- * @description
- * Emitted every time the ngInclude content is requested.
- *
- * @param {Object} angularEvent Synthetic event object.
- * @param {String} src URL of content to load.
- */
-
-
-/**
- * @ngdoc event
- * @name ngInclude#$includeContentLoaded
- * @eventType emit on the current ngInclude scope
- * @description
- * Emitted every time the ngInclude content is reloaded.
- *
- * @param {Object} angularEvent Synthetic event object.
- * @param {String} src URL of content to load.
- */
-
-
-/**
- * @ngdoc event
- * @name ngInclude#$includeContentError
- * @eventType emit on the scope ngInclude was declared in
- * @description
- * Emitted when a template HTTP request yields an erroneous response (status < 200 || status > 299)
- *
- * @param {Object} angularEvent Synthetic event object.
- * @param {String} src URL of content to load.
- */
-var ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate',
-                  function($templateRequest,   $anchorScroll,   $animate) {
-  return {
-    restrict: 'ECA',
-    priority: 400,
-    terminal: true,
-    transclude: 'element',
-    controller: angular.noop,
-    compile: function(element, attr) {
-      var srcExp = attr.ngInclude || attr.src,
-          onloadExp = attr.onload || '',
-          autoScrollExp = attr.autoscroll;
-
-      return function(scope, $element, $attr, ctrl, $transclude) {
-        var changeCounter = 0,
-            currentScope,
-            previousElement,
-            currentElement;
-
-        var cleanupLastIncludeContent = function() {
-          if (previousElement) {
-            previousElement.remove();
-            previousElement = null;
-          }
-          if (currentScope) {
-            currentScope.$destroy();
-            currentScope = null;
-          }
-          if (currentElement) {
-            $animate.leave(currentElement).then(function() {
-              previousElement = null;
-            });
-            previousElement = currentElement;
-            currentElement = null;
-          }
-        };
-
-        scope.$watch(srcExp, function ngIncludeWatchAction(src) {
-          var afterAnimation = function() {
-            if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
-              $anchorScroll();
-            }
-          };
-          var thisChangeId = ++changeCounter;
-
-          if (src) {
-            //set the 2nd param to true to ignore the template request error so that the inner
-            //contents and scope can be cleaned up.
-            $templateRequest(src, true).then(function(response) {
-              if (thisChangeId !== changeCounter) return;
-              var newScope = scope.$new();
-              ctrl.template = response;
-
-              // Note: This will also link all children of ng-include that were contained in the original
-              // html. If that content contains controllers, ... they could pollute/change the scope.
-              // However, using ng-include on an element with additional content does not make sense...
-              // Note: We can't remove them in the cloneAttchFn of $transclude as that
-              // function is called before linking the content, which would apply child
-              // directives to non existing elements.
-              var clone = $transclude(newScope, function(clone) {
-                cleanupLastIncludeContent();
-                $animate.enter(clone, null, $element).then(afterAnimation);
-              });
-
-              currentScope = newScope;
-              currentElement = clone;
-
-              currentScope.$emit('$includeContentLoaded', src);
-              scope.$eval(onloadExp);
-            }, function() {
-              if (thisChangeId === changeCounter) {
-                cleanupLastIncludeContent();
-                scope.$emit('$includeContentError', src);
-              }
-            });
-            scope.$emit('$includeContentRequested', src);
-          } else {
-            cleanupLastIncludeContent();
-            ctrl.template = null;
-          }
-        });
-      };
-    }
-  };
-}];
-
-// This directive is called during the $transclude call of the first `ngInclude` directive.
-// It will replace and compile the content of the element with the loaded template.
-// We need this directive so that the element content is already filled when
-// the link function of another directive on the same element as ngInclude
-// is called.
-var ngIncludeFillContentDirective = ['$compile',
-  function($compile) {
-    return {
-      restrict: 'ECA',
-      priority: -400,
-      require: 'ngInclude',
-      link: function(scope, $element, $attr, ctrl) {
-        if (/SVG/.test($element[0].toString())) {
-          // WebKit: https://bugs.webkit.org/show_bug.cgi?id=135698 --- SVG elements do not
-          // support innerHTML, so detect this here and try to generate the contents
-          // specially.
-          $element.empty();
-          $compile(jqLiteBuildFragment(ctrl.template, document).childNodes)(scope,
-              function namespaceAdaptedClone(clone) {
-            $element.append(clone);
-          }, {futureParentElement: $element});
-          return;
-        }
-
-        $element.html(ctrl.template);
-        $compile($element.contents())(scope);
-      }
-    };
-  }];
-
-/**
- * @ngdoc directive
- * @name ngInit
- * @restrict AC
- *
- * @description
- * The `ngInit` directive allows you to evaluate an expression in the
- * current scope.
- *
- * <div class="alert alert-danger">
- * This directive can be abused to add unnecessary amounts of logic into your templates.
- * There are only a few appropriate uses of `ngInit`, such as for aliasing special properties of
- * {@link ng.directive:ngRepeat `ngRepeat`}, as seen in the demo below; and for injecting data via
- * server side scripting. Besides these few cases, you should use {@link guide/controller controllers}
- * rather than `ngInit` to initialize values on a scope.
- * </div>
- *
- * <div class="alert alert-warning">
- * **Note**: If you have assignment in `ngInit` along with a {@link ng.$filter `filter`}, make
- * sure you have parentheses to ensure correct operator precedence:
- * <pre class="prettyprint">
- * `<div ng-init="test1 = ($index | toString)"></div>`
- * </pre>
- * </div>
- *
- * @priority 450
- *
- * @element ANY
- * @param {expression} ngInit {@link guide/expression Expression} to eval.
- *
- * @example
-   <example module="initExample">
-     <file name="index.html">
-   <script>
-     angular.module('initExample', [])
-       .controller('ExampleController', ['$scope', function($scope) {
-         $scope.list = [['a', 'b'], ['c', 'd']];
-       }]);
-   </script>
-   <div ng-controller="ExampleController">
-     <div ng-repeat="innerList in list" ng-init="outerIndex = $index">
-       <div ng-repeat="value in innerList" ng-init="innerIndex = $index">
-          <span class="example-init">list[ {{outerIndex}} ][ {{innerIndex}} ] = {{value}};</span>
-       </div>
-     </div>
-   </div>
-     </file>
-     <file name="protractor.js" type="protractor">
-       it('should alias index positions', function() {
-         var elements = element.all(by.css('.example-init'));
-         expect(elements.get(0).getText()).toBe('list[ 0 ][ 0 ] = a;');
-         expect(elements.get(1).getText()).toBe('list[ 0 ][ 1 ] = b;');
-         expect(elements.get(2).getText()).toBe('list[ 1 ][ 0 ] = c;');
-         expect(elements.get(3).getText()).toBe('list[ 1 ][ 1 ] = d;');
-       });
-     </file>
-   </example>
- */
-var ngInitDirective = ngDirective({
-  priority: 450,
-  compile: function() {
-    return {
-      pre: function(scope, element, attrs) {
-        scope.$eval(attrs.ngInit);
-      }
-    };
-  }
-});
-
-/**
- * @ngdoc directive
- * @name ngList
- *
- * @description
- * Text input that converts between a delimited string and an array of strings. The default
- * delimiter is a comma followed by a space - equivalent to `ng-list=", "`. You can specify a custom
- * delimiter as the value of the `ngList` attribute - for example, `ng-list=" | "`.
- *
- * The behaviour of the directive is affected by the use of the `ngTrim` attribute.
- * * If `ngTrim` is set to `"false"` then whitespace around both the separator and each
- *   list item is respected. This implies that the user of the directive is responsible for
- *   dealing with whitespace but also allows you to use whitespace as a delimiter, such as a
- *   tab or newline character.
- * * Otherwise whitespace around the delimiter is ignored when splitting (although it is respected
- *   when joining the list items back together) and whitespace around each list item is stripped
- *   before it is added to the model.
- *
- * ### Example with Validation
- *
- * <example name="ngList-directive" module="listExample">
- *   <file name="app.js">
- *      angular.module('listExample', [])
- *        .controller('ExampleController', ['$scope', function($scope) {
- *          $scope.names = ['morpheus', 'neo', 'trinity'];
- *        }]);
- *   </file>
- *   <file name="index.html">
- *    <form name="myForm" ng-controller="ExampleController">
- *      <label>List: <input name="namesInput" ng-model="names" ng-list required></label>
- *      <span role="alert">
- *        <span class="error" ng-show="myForm.namesInput.$error.required">
- *        Required!</span>
- *      </span>
- *      <br>
- *      <tt>names = {{names}}</tt><br/>
- *      <tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>
- *      <tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>
- *      <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
- *      <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
- *     </form>
- *   </file>
- *   <file name="protractor.js" type="protractor">
- *     var listInput = element(by.model('names'));
- *     var names = element(by.exactBinding('names'));
- *     var valid = element(by.binding('myForm.namesInput.$valid'));
- *     var error = element(by.css('span.error'));
- *
- *     it('should initialize to model', function() {
- *       expect(names.getText()).toContain('["morpheus","neo","trinity"]');
- *       expect(valid.getText()).toContain('true');
- *       expect(error.getCssValue('display')).toBe('none');
- *     });
- *
- *     it('should be invalid if empty', function() {
- *       listInput.clear();
- *       listInput.sendKeys('');
- *
- *       expect(names.getText()).toContain('');
- *       expect(valid.getText()).toContain('false');
- *       expect(error.getCssValue('display')).not.toBe('none');
- *     });
- *   </file>
- * </example>
- *
- * ### Example - splitting on newline
- * <example name="ngList-directive-newlines">
- *   <file name="index.html">
- *    <textarea ng-model="list" ng-list="&#10;" ng-trim="false"></textarea>
- *    <pre>{{ list | json }}</pre>
- *   </file>
- *   <file name="protractor.js" type="protractor">
- *     it("should split the text by newlines", function() {
- *       var listInput = element(by.model('list'));
- *       var output = element(by.binding('list | json'));
- *       listInput.sendKeys('abc\ndef\nghi');
- *       expect(output.getText()).toContain('[\n  "abc",\n  "def",\n  "ghi"\n]');
- *     });
- *   </file>
- * </example>
- *
- * @element input
- * @param {string=} ngList optional delimiter that should be used to split the value.
- */
-var ngListDirective = function() {
-  return {
-    restrict: 'A',
-    priority: 100,
-    require: 'ngModel',
-    link: function(scope, element, attr, ctrl) {
-      // We want to control whitespace trimming so we use this convoluted approach
-      // to access the ngList attribute, which doesn't pre-trim the attribute
-      var ngList = element.attr(attr.$attr.ngList) || ', ';
-      var trimValues = attr.ngTrim !== 'false';
-      var separator = trimValues ? trim(ngList) : ngList;
-
-      var parse = function(viewValue) {
-        // If the viewValue is invalid (say required but empty) it will be `undefined`
-        if (isUndefined(viewValue)) return;
-
-        var list = [];
-
-        if (viewValue) {
-          forEach(viewValue.split(separator), function(value) {
-            if (value) list.push(trimValues ? trim(value) : value);
-          });
-        }
-
-        return list;
-      };
-
-      ctrl.$parsers.push(parse);
-      ctrl.$formatters.push(function(value) {
-        if (isArray(value)) {
-          return value.join(ngList);
-        }
-
-        return undefined;
-      });
-
-      // Override the standard $isEmpty because an empty array means the input is empty.
-      ctrl.$isEmpty = function(value) {
-        return !value || !value.length;
-      };
-    }
-  };
-};
-
-/* global VALID_CLASS: true,
-  INVALID_CLASS: true,
-  PRISTINE_CLASS: true,
-  DIRTY_CLASS: true,
-  UNTOUCHED_CLASS: true,
-  TOUCHED_CLASS: true,
-*/
-
-var VALID_CLASS = 'ng-valid',
-    INVALID_CLASS = 'ng-invalid',
-    PRISTINE_CLASS = 'ng-pristine',
-    DIRTY_CLASS = 'ng-dirty',
-    UNTOUCHED_CLASS = 'ng-untouched',
-    TOUCHED_CLASS = 'ng-touched',
-    PENDING_CLASS = 'ng-pending';
-
-var ngModelMinErr = minErr('ngModel');
-
-/**
- * @ngdoc type
- * @name ngModel.NgModelController
- *
- * @property {*} $viewValue The actual value from the control's view. For `input` elements, this is a
- * String. See {@link ngModel.NgModelController#$setViewValue} for information about when the $viewValue
- * is set.
- * @property {*} $modelValue The value in the model that the control is bound to.
- * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever
-       the control reads value from the DOM. The functions are called in array order, each passing
-       its return value through to the next. The last return value is forwarded to the
-       {@link ngModel.NgModelController#$validators `$validators`} collection.
-
-Parsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue
-`$viewValue`}.
-
-Returning `undefined` from a parser means a parse error occurred. In that case,
-no {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel`
-will be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`}
-is set to `true`. The parse error is stored in `ngModel.$error.parse`.
-
- *
- * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever
-       the model value changes. The functions are called in reverse array order, each passing the value through to the
-       next. The last return value is used as the actual DOM value.
-       Used to format / convert values for display in the control.
- * ```js
- * function formatter(value) {
- *   if (value) {
- *     return value.toUpperCase();
- *   }
- * }
- * ngModel.$formatters.push(formatter);
- * ```
- *
- * @property {Object.<string, function>} $validators A collection of validators that are applied
- *      whenever the model value changes. The key value within the object refers to the name of the
- *      validator while the function refers to the validation operation. The validation operation is
- *      provided with the model value as an argument and must return a true or false value depending
- *      on the response of that validation.
- *
- * ```js
- * ngModel.$validators.validCharacters = function(modelValue, viewValue) {
- *   var value = modelValue || viewValue;
- *   return /[0-9]+/.test(value) &&
- *          /[a-z]+/.test(value) &&
- *          /[A-Z]+/.test(value) &&
- *          /\W+/.test(value);
- * };
- * ```
- *
- * @property {Object.<string, function>} $asyncValidators A collection of validations that are expected to
- *      perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided
- *      is expected to return a promise when it is run during the model validation process. Once the promise
- *      is delivered then the validation status will be set to true when fulfilled and false when rejected.
- *      When the asynchronous validators are triggered, each of the validators will run in parallel and the model
- *      value will only be updated once all validators have been fulfilled. As long as an asynchronous validator
- *      is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators
- *      will only run once all synchronous validators have passed.
- *
- * Please note that if $http is used then it is important that the server returns a success HTTP response code
- * in order to fulfill the validation and a status level of `4xx` in order to reject the validation.
- *
- * ```js
- * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) {
- *   var value = modelValue || viewValue;
- *
- *   // Lookup user by username
- *   return $http.get('/api/users/' + value).
- *      then(function resolved() {
- *        //username exists, this means validation fails
- *        return $q.reject('exists');
- *      }, function rejected() {
- *        //username does not exist, therefore this validation passes
- *        return true;
- *      });
- * };
- * ```
- *
- * @property {Array.<Function>} $viewChangeListeners Array of functions to execute whenever the
- *     view value has changed. It is called with no arguments, and its return value is ignored.
- *     This can be used in place of additional $watches against the model value.
- *
- * @property {Object} $error An object hash with all failing validator ids as keys.
- * @property {Object} $pending An object hash with all pending validator ids as keys.
- *
- * @property {boolean} $untouched True if control has not lost focus yet.
- * @property {boolean} $touched True if control has lost focus.
- * @property {boolean} $pristine True if user has not interacted with the control yet.
- * @property {boolean} $dirty True if user has already interacted with the control.
- * @property {boolean} $valid True if there is no error.
- * @property {boolean} $invalid True if at least one error on the control.
- * @property {string} $name The name attribute of the control.
- *
- * @description
- *
- * `NgModelController` provides API for the {@link ngModel `ngModel`} directive.
- * The controller contains services for data-binding, validation, CSS updates, and value formatting
- * and parsing. It purposefully does not contain any logic which deals with DOM rendering or
- * listening to DOM events.
- * Such DOM related logic should be provided by other directives which make use of
- * `NgModelController` for data-binding to control elements.
- * Angular provides this DOM logic for most {@link input `input`} elements.
- * At the end of this page you can find a {@link ngModel.NgModelController#custom-control-example
- * custom control example} that uses `ngModelController` to bind to `contenteditable` elements.
- *
- * @example
- * ### Custom Control Example
- * This example shows how to use `NgModelController` with a custom control to achieve
- * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`)
- * collaborate together to achieve the desired result.
- *
- * `contenteditable` is an HTML5 attribute, which tells the browser to let the element
- * contents be edited in place by the user.
- *
- * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize}
- * module to automatically remove "bad" content like inline event listener (e.g. `<span onclick="...">`).
- * However, as we are using `$sce` the model can still decide to provide unsafe content if it marks
- * that content using the `$sce` service.
- *
- * <example name="NgModelController" module="customControl" deps="angular-sanitize.js">
-    <file name="style.css">
-      [contenteditable] {
-        border: 1px solid black;
-        background-color: white;
-        min-height: 20px;
-      }
-
-      .ng-invalid {
-        border: 1px solid red;
-      }
-
-    </file>
-    <file name="script.js">
-      angular.module('customControl', ['ngSanitize']).
-        directive('contenteditable', ['$sce', function($sce) {
-          return {
-            restrict: 'A', // only activate on element attribute
-            require: '?ngModel', // get a hold of NgModelController
-            link: function(scope, element, attrs, ngModel) {
-              if (!ngModel) return; // do nothing if no ng-model
-
-              // Specify how UI should be updated
-              ngModel.$render = function() {
-                element.html($sce.getTrustedHtml(ngModel.$viewValue || ''));
-              };
-
-              // Listen for change events to enable binding
-              element.on('blur keyup change', function() {
-                scope.$evalAsync(read);
-              });
-              read(); // initialize
-
-              // Write data to the model
-              function read() {
-                var html = element.html();
-                // When we clear the content editable the browser leaves a <br> behind
-                // If strip-br attribute is provided then we strip this out
-                if ( attrs.stripBr && html == '<br>' ) {
-                  html = '';
-                }
-                ngModel.$setViewValue(html);
-              }
-            }
-          };
-        }]);
-    </file>
-    <file name="index.html">
-      <form name="myForm">
-       <div contenteditable
-            name="myWidget" ng-model="userContent"
-            strip-br="true"
-            required>Change me!</div>
-        <span ng-show="myForm.myWidget.$error.required">Required!</span>
-       <hr>
-       <textarea ng-model="userContent" aria-label="Dynamic textarea"></textarea>
-      </form>
-    </file>
-    <file name="protractor.js" type="protractor">
-    it('should data-bind and become invalid', function() {
-      if (browser.params.browser == 'safari' || browser.params.browser == 'firefox') {
-        // SafariDriver can't handle contenteditable
-        // and Firefox driver can't clear contenteditables very well
-        return;
-      }
-      var contentEditable = element(by.css('[contenteditable]'));
-      var content = 'Change me!';
-
-      expect(contentEditable.getText()).toEqual(content);
-
-      contentEditable.clear();
-      contentEditable.sendKeys(protractor.Key.BACK_SPACE);
-      expect(contentEditable.getText()).toEqual('');
-      expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/);
-    });
-    </file>
- * </example>
- *
- *
- */
-var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$rootScope', '$q', '$interpolate',
-    function($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $rootScope, $q, $interpolate) {
-  this.$viewValue = Number.NaN;
-  this.$modelValue = Number.NaN;
-  this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.
-  this.$validators = {};
-  this.$asyncValidators = {};
-  this.$parsers = [];
-  this.$formatters = [];
-  this.$viewChangeListeners = [];
-  this.$untouched = true;
-  this.$touched = false;
-  this.$pristine = true;
-  this.$dirty = false;
-  this.$valid = true;
-  this.$invalid = false;
-  this.$error = {}; // keep invalid keys here
-  this.$$success = {}; // keep valid keys here
-  this.$pending = undefined; // keep pending keys here
-  this.$name = $interpolate($attr.name || '', false)($scope);
-  this.$$parentForm = nullFormCtrl;
-
-  var parsedNgModel = $parse($attr.ngModel),
-      parsedNgModelAssign = parsedNgModel.assign,
-      ngModelGet = parsedNgModel,
-      ngModelSet = parsedNgModelAssign,
-      pendingDebounce = null,
-      parserValid,
-      ctrl = this;
-
-  this.$$setOptions = function(options) {
-    ctrl.$options = options;
-    if (options && options.getterSetter) {
-      var invokeModelGetter = $parse($attr.ngModel + '()'),
-          invokeModelSetter = $parse($attr.ngModel + '($$$p)');
-
-      ngModelGet = function($scope) {
-        var modelValue = parsedNgModel($scope);
-        if (isFunction(modelValue)) {
-          modelValue = invokeModelGetter($scope);
-        }
-        return modelValue;
-      };
-      ngModelSet = function($scope, newValue) {
-        if (isFunction(parsedNgModel($scope))) {
-          invokeModelSetter($scope, {$$$p: ctrl.$modelValue});
-        } else {
-          parsedNgModelAssign($scope, ctrl.$modelValue);
-        }
-      };
-    } else if (!parsedNgModel.assign) {
-      throw ngModelMinErr('nonassign', "Expression '{0}' is non-assignable. Element: {1}",
-          $attr.ngModel, startingTag($element));
-    }
-  };
-
-  /**
-   * @ngdoc method
-   * @name ngModel.NgModelController#$render
-   *
-   * @description
-   * Called when the view needs to be updated. It is expected that the user of the ng-model
-   * directive will implement this method.
-   *
-   * The `$render()` method is invoked in the following situations:
-   *
-   * * `$rollbackViewValue()` is called.  If we are rolling back the view value to the last
-   *   committed value then `$render()` is called to update the input control.
-   * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and
-   *   the `$viewValue` are different from last time.
-   *
-   * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of
-   * `$modelValue` and `$viewValue` are actually different from their previous value. If `$modelValue`
-   * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be
-   * invoked if you only change a property on the objects.
-   */
-  this.$render = noop;
-
-  /**
-   * @ngdoc method
-   * @name ngModel.NgModelController#$isEmpty
-   *
-   * @description
-   * This is called when we need to determine if the value of an input is empty.
-   *
-   * For instance, the required directive does this to work out if the input has data or not.
-   *
-   * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`.
-   *
-   * You can override this for input directives whose concept of being empty is different from the
-   * default. The `checkboxInputType` directive does this because in its case a value of `false`
-   * implies empty.
-   *
-   * @param {*} value The value of the input to check for emptiness.
-   * @returns {boolean} True if `value` is "empty".
-   */
-  this.$isEmpty = function(value) {
-    return isUndefined(value) || value === '' || value === null || value !== value;
-  };
-
-  var currentValidationRunId = 0;
-
-  /**
-   * @ngdoc method
-   * @name ngModel.NgModelController#$setValidity
-   *
-   * @description
-   * Change the validity state, and notify the form.
-   *
-   * This method can be called within $parsers/$formatters or a custom validation implementation.
-   * However, in most cases it should be sufficient to use the `ngModel.$validators` and
-   * `ngModel.$asyncValidators` collections which will call `$setValidity` automatically.
-   *
-   * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be assigned
-   *        to either `$error[validationErrorKey]` or `$pending[validationErrorKey]`
-   *        (for unfulfilled `$asyncValidators`), so that it is available for data-binding.
-   *        The `validationErrorKey` should be in camelCase and will get converted into dash-case
-   *        for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`
-   *        class and can be bound to as  `{{someForm.someControl.$error.myError}}` .
-   * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined),
-   *                          or skipped (null). Pending is used for unfulfilled `$asyncValidators`.
-   *                          Skipped is used by Angular when validators do not run because of parse errors and
-   *                          when `$asyncValidators` do not run because any of the `$validators` failed.
-   */
-  addSetValidityMethod({
-    ctrl: this,
-    $element: $element,
-    set: function(object, property) {
-      object[property] = true;
-    },
-    unset: function(object, property) {
-      delete object[property];
-    },
-    $animate: $animate
-  });
-
-  /**
-   * @ngdoc method
-   * @name ngModel.NgModelController#$setPristine
-   *
-   * @description
-   * Sets the control to its pristine state.
-   *
-   * This method can be called to remove the `ng-dirty` class and set the control to its pristine
-   * state (`ng-pristine` class). A model is considered to be pristine when the control
-   * has not been changed from when first compiled.
-   */
-  this.$setPristine = function() {
-    ctrl.$dirty = false;
-    ctrl.$pristine = true;
-    $animate.removeClass($element, DIRTY_CLASS);
-    $animate.addClass($element, PRISTINE_CLASS);
-  };
-
-  /**
-   * @ngdoc method
-   * @name ngModel.NgModelController#$setDirty
-   *
-   * @description
-   * Sets the control to its dirty state.
-   *
-   * This method can be called to remove the `ng-pristine` class and set the control to its dirty
-   * state (`ng-dirty` class). A model is considered to be dirty when the control has been changed
-   * from when first compiled.
-   */
-  this.$setDirty = function() {
-    ctrl.$dirty = true;
-    ctrl.$pristine = false;
-    $animate.removeClass($element, PRISTINE_CLASS);
-    $animate.addClass($element, DIRTY_CLASS);
-    ctrl.$$parentForm.$setDirty();
-  };
-
-  /**
-   * @ngdoc method
-   * @name ngModel.NgModelController#$setUntouched
-   *
-   * @description
-   * Sets the control to its untouched state.
-   *
-   * This method can be called to remove the `ng-touched` class and set the control to its
-   * untouched state (`ng-untouched` class). Upon compilation, a model is set as untouched
-   * by default, however this function can be used to restore that state if the model has
-   * already been touched by the user.
-   */
-  this.$setUntouched = function() {
-    ctrl.$touched = false;
-    ctrl.$untouched = true;
-    $animate.setClass($element, UNTOUCHED_CLASS, TOUCHED_CLASS);
-  };
-
-  /**
-   * @ngdoc method
-   * @name ngModel.NgModelController#$setTouched
-   *
-   * @description
-   * Sets the control to its touched state.
-   *
-   * This method can be called to remove the `ng-untouched` class and set the control to its
-   * touched state (`ng-touched` class). A model is considered to be touched when the user has
-   * first focused the control element and then shifted focus away from the control (blur event).
-   */
-  this.$setTouched = function() {
-    ctrl.$touched = true;
-    ctrl.$untouched = false;
-    $animate.setClass($element, TOUCHED_CLASS, UNTOUCHED_CLASS);
-  };
-
-  /**
-   * @ngdoc method
-   * @name ngModel.NgModelController#$rollbackViewValue
-   *
-   * @description
-   * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`,
-   * which may be caused by a pending debounced event or because the input is waiting for a some
-   * future event.
-   *
-   * If you have an input that uses `ng-model-options` to set up debounced events or events such
-   * as blur you can have a situation where there is a period when the `$viewValue`
-   * is out of synch with the ngModel's `$modelValue`.
-   *
-   * In this case, you can run into difficulties if you try to update the ngModel's `$modelValue`
-   * programmatically before these debounced/future events have resolved/occurred, because Angular's
-   * dirty checking mechanism is not able to tell whether the model has actually changed or not.
-   *
-   * The `$rollbackViewValue()` method should be called before programmatically changing the model of an
-   * input which may have such events pending. This is important in order to make sure that the
-   * input field will be updated with the new model value and any pending operations are cancelled.
-   *
-   * <example name="ng-model-cancel-update" module="cancel-update-example">
-   *   <file name="app.js">
-   *     angular.module('cancel-update-example', [])
-   *
-   *     .controller('CancelUpdateController', ['$scope', function($scope) {
-   *       $scope.resetWithCancel = function(e) {
-   *         if (e.keyCode == 27) {
-   *           $scope.myForm.myInput1.$rollbackViewValue();
-   *           $scope.myValue = '';
-   *         }
-   *       };
-   *       $scope.resetWithoutCancel = function(e) {
-   *         if (e.keyCode == 27) {
-   *           $scope.myValue = '';
-   *         }
-   *       };
-   *     }]);
-   *   </file>
-   *   <file name="index.html">
-   *     <div ng-controller="CancelUpdateController">
-   *       <p>Try typing something in each input.  See that the model only updates when you
-   *          blur off the input.
-   *        </p>
-   *        <p>Now see what happens if you start typing then press the Escape key</p>
-   *
-   *       <form name="myForm" ng-model-options="{ updateOn: 'blur' }">
-   *         <p id="inputDescription1">With $rollbackViewValue()</p>
-   *         <input name="myInput1" aria-describedby="inputDescription1" ng-model="myValue"
-   *                ng-keydown="resetWithCancel($event)"><br/>
-   *         myValue: "{{ myValue }}"
-   *
-   *         <p id="inputDescription2">Without $rollbackViewValue()</p>
-   *         <input name="myInput2" aria-describedby="inputDescription2" ng-model="myValue"
-   *                ng-keydown="resetWithoutCancel($event)"><br/>
-   *         myValue: "{{ myValue }}"
-   *       </form>
-   *     </div>
-   *   </file>
-   * </example>
-   */
-  this.$rollbackViewValue = function() {
-    $timeout.cancel(pendingDebounce);
-    ctrl.$viewValue = ctrl.$$lastCommittedViewValue;
-    ctrl.$render();
-  };
-
-  /**
-   * @ngdoc method
-   * @name ngModel.NgModelController#$validate
-   *
-   * @description
-   * Runs each of the registered validators (first synchronous validators and then
-   * asynchronous validators).
-   * If the validity changes to invalid, the model will be set to `undefined`,
-   * unless {@link ngModelOptions `ngModelOptions.allowInvalid`} is `true`.
-   * If the validity changes to valid, it will set the model to the last available valid
-   * `$modelValue`, i.e. either the last parsed value or the last value set from the scope.
-   */
-  this.$validate = function() {
-    // ignore $validate before model is initialized
-    if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) {
-      return;
-    }
-
-    var viewValue = ctrl.$$lastCommittedViewValue;
-    // Note: we use the $$rawModelValue as $modelValue might have been
-    // set to undefined during a view -> model update that found validation
-    // errors. We can't parse the view here, since that could change
-    // the model although neither viewValue nor the model on the scope changed
-    var modelValue = ctrl.$$rawModelValue;
-
-    var prevValid = ctrl.$valid;
-    var prevModelValue = ctrl.$modelValue;
-
-    var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;
-
-    ctrl.$$runValidators(modelValue, viewValue, function(allValid) {
-      // If there was no change in validity, don't update the model
-      // This prevents changing an invalid modelValue to undefined
-      if (!allowInvalid && prevValid !== allValid) {
-        // Note: Don't check ctrl.$valid here, as we could have
-        // external validators (e.g. calculated on the server),
-        // that just call $setValidity and need the model value
-        // to calculate their validity.
-        ctrl.$modelValue = allValid ? modelValue : undefined;
-
-        if (ctrl.$modelValue !== prevModelValue) {
-          ctrl.$$writeModelToScope();
-        }
-      }
-    });
-
-  };
-
-  this.$$runValidators = function(modelValue, viewValue, doneCallback) {
-    currentValidationRunId++;
-    var localValidationRunId = currentValidationRunId;
-
-    // check parser error
-    if (!processParseErrors()) {
-      validationDone(false);
-      return;
-    }
-    if (!processSyncValidators()) {
-      validationDone(false);
-      return;
-    }
-    processAsyncValidators();
-
-    function processParseErrors() {
-      var errorKey = ctrl.$$parserName || 'parse';
-      if (isUndefined(parserValid)) {
-        setValidity(errorKey, null);
-      } else {
-        if (!parserValid) {
-          forEach(ctrl.$validators, function(v, name) {
-            setValidity(name, null);
-          });
-          forEach(ctrl.$asyncValidators, function(v, name) {
-            setValidity(name, null);
-          });
-        }
-        // Set the parse error last, to prevent unsetting it, should a $validators key == parserName
-        setValidity(errorKey, parserValid);
-        return parserValid;
-      }
-      return true;
-    }
-
-    function processSyncValidators() {
-      var syncValidatorsValid = true;
-      forEach(ctrl.$validators, function(validator, name) {
-        var result = validator(modelValue, viewValue);
-        syncValidatorsValid = syncValidatorsValid && result;
-        setValidity(name, result);
-      });
-      if (!syncValidatorsValid) {
-        forEach(ctrl.$asyncValidators, function(v, name) {
-          setValidity(name, null);
-        });
-        return false;
-      }
-      return true;
-    }
-
-    function processAsyncValidators() {
-      var validatorPromises = [];
-      var allValid = true;
-      forEach(ctrl.$asyncValidators, function(validator, name) {
-        var promise = validator(modelValue, viewValue);
-        if (!isPromiseLike(promise)) {
-          throw ngModelMinErr("$asyncValidators",
-            "Expected asynchronous validator to return a promise but got '{0}' instead.", promise);
-        }
-        setValidity(name, undefined);
-        validatorPromises.push(promise.then(function() {
-          setValidity(name, true);
-        }, function(error) {
-          allValid = false;
-          setValidity(name, false);
-        }));
-      });
-      if (!validatorPromises.length) {
-        validationDone(true);
-      } else {
-        $q.all(validatorPromises).then(function() {
-          validationDone(allValid);
-        }, noop);
-      }
-    }
-
-    function setValidity(name, isValid) {
-      if (localValidationRunId === currentValidationRunId) {
-        ctrl.$setValidity(name, isValid);
-      }
-    }
-
-    function validationDone(allValid) {
-      if (localValidationRunId === currentValidationRunId) {
-
-        doneCallback(allValid);
-      }
-    }
-  };
-
-  /**
-   * @ngdoc method
-   * @name ngModel.NgModelController#$commitViewValue
-   *
-   * @description
-   * Commit a pending update to the `$modelValue`.
-   *
-   * Updates may be pending by a debounced event or because the input is waiting for a some future
-   * event defined in `ng-model-options`. this method is rarely needed as `NgModelController`
-   * usually handles calling this in response to input events.
-   */
-  this.$commitViewValue = function() {
-    var viewValue = ctrl.$viewValue;
-
-    $timeout.cancel(pendingDebounce);
-
-    // If the view value has not changed then we should just exit, except in the case where there is
-    // a native validator on the element. In this case the validation state may have changed even though
-    // the viewValue has stayed empty.
-    if (ctrl.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !ctrl.$$hasNativeValidators)) {
-      return;
-    }
-    ctrl.$$lastCommittedViewValue = viewValue;
-
-    // change to dirty
-    if (ctrl.$pristine) {
-      this.$setDirty();
-    }
-    this.$$parseAndValidate();
-  };
-
-  this.$$parseAndValidate = function() {
-    var viewValue = ctrl.$$lastCommittedViewValue;
-    var modelValue = viewValue;
-    parserValid = isUndefined(modelValue) ? undefined : true;
-
-    if (parserValid) {
-      for (var i = 0; i < ctrl.$parsers.length; i++) {
-        modelValue = ctrl.$parsers[i](modelValue);
-        if (isUndefined(modelValue)) {
-          parserValid = false;
-          break;
-        }
-      }
-    }
-    if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) {
-      // ctrl.$modelValue has not been touched yet...
-      ctrl.$modelValue = ngModelGet($scope);
-    }
-    var prevModelValue = ctrl.$modelValue;
-    var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;
-    ctrl.$$rawModelValue = modelValue;
-
-    if (allowInvalid) {
-      ctrl.$modelValue = modelValue;
-      writeToModelIfNeeded();
-    }
-
-    // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date.
-    // This can happen if e.g. $setViewValue is called from inside a parser
-    ctrl.$$runValidators(modelValue, ctrl.$$lastCommittedViewValue, function(allValid) {
-      if (!allowInvalid) {
-        // Note: Don't check ctrl.$valid here, as we could have
-        // external validators (e.g. calculated on the server),
-        // that just call $setValidity and need the model value
-        // to calculate their validity.
-        ctrl.$modelValue = allValid ? modelValue : undefined;
-        writeToModelIfNeeded();
-      }
-    });
-
-    function writeToModelIfNeeded() {
-      if (ctrl.$modelValue !== prevModelValue) {
-        ctrl.$$writeModelToScope();
-      }
-    }
-  };
-
-  this.$$writeModelToScope = function() {
-    ngModelSet($scope, ctrl.$modelValue);
-    forEach(ctrl.$viewChangeListeners, function(listener) {
-      try {
-        listener();
-      } catch (e) {
-        $exceptionHandler(e);
-      }
-    });
-  };
-
-  /**
-   * @ngdoc method
-   * @name ngModel.NgModelController#$setViewValue
-   *
-   * @description
-   * Update the view value.
-   *
-   * This method should be called when a control wants to change the view value; typically,
-   * this is done from within a DOM event handler. For example, the {@link ng.directive:input input}
-   * directive calls it when the value of the input changes and {@link ng.directive:select select}
-   * calls it when an option is selected.
-   *
-   * When `$setViewValue` is called, the new `value` will be staged for committing through the `$parsers`
-   * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged
-   * value sent directly for processing, finally to be applied to `$modelValue` and then the
-   * **expression** specified in the `ng-model` attribute. Lastly, all the registered change listeners,
-   * in the `$viewChangeListeners` list, are called.
-   *
-   * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn`
-   * and the `default` trigger is not listed, all those actions will remain pending until one of the
-   * `updateOn` events is triggered on the DOM element.
-   * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions}
-   * directive is used with a custom debounce for this particular event.
-   * Note that a `$digest` is only triggered once the `updateOn` events are fired, or if `debounce`
-   * is specified, once the timer runs out.
-   *
-   * When used with standard inputs, the view value will always be a string (which is in some cases
-   * parsed into another type, such as a `Date` object for `input[date]`.)
-   * However, custom controls might also pass objects to this method. In this case, we should make
-   * a copy of the object before passing it to `$setViewValue`. This is because `ngModel` does not
-   * perform a deep watch of objects, it only looks for a change of identity. If you only change
-   * the property of the object then ngModel will not realise that the object has changed and
-   * will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should
-   * not change properties of the copy once it has been passed to `$setViewValue`.
-   * Otherwise you may cause the model value on the scope to change incorrectly.
-   *
-   * <div class="alert alert-info">
-   * In any case, the value passed to the method should always reflect the current value
-   * of the control. For example, if you are calling `$setViewValue` for an input element,
-   * you should pass the input DOM value. Otherwise, the control and the scope model become
-   * out of sync. It's also important to note that `$setViewValue` does not call `$render` or change
-   * the control's DOM value in any way. If we want to change the control's DOM value
-   * programmatically, we should update the `ngModel` scope expression. Its new value will be
-   * picked up by the model controller, which will run it through the `$formatters`, `$render` it
-   * to update the DOM, and finally call `$validate` on it.
-   * </div>
-   *
-   * @param {*} value value from the view.
-   * @param {string} trigger Event that triggered the update.
-   */
-  this.$setViewValue = function(value, trigger) {
-    ctrl.$viewValue = value;
-    if (!ctrl.$options || ctrl.$options.updateOnDefault) {
-      ctrl.$$debounceViewValueCommit(trigger);
-    }
-  };
-
-  this.$$debounceViewValueCommit = function(trigger) {
-    var debounceDelay = 0,
-        options = ctrl.$options,
-        debounce;
-
-    if (options && isDefined(options.debounce)) {
-      debounce = options.debounce;
-      if (isNumber(debounce)) {
-        debounceDelay = debounce;
-      } else if (isNumber(debounce[trigger])) {
-        debounceDelay = debounce[trigger];
-      } else if (isNumber(debounce['default'])) {
-        debounceDelay = debounce['default'];
-      }
-    }
-
-    $timeout.cancel(pendingDebounce);
-    if (debounceDelay) {
-      pendingDebounce = $timeout(function() {
-        ctrl.$commitViewValue();
-      }, debounceDelay);
-    } else if ($rootScope.$$phase) {
-      ctrl.$commitViewValue();
-    } else {
-      $scope.$apply(function() {
-        ctrl.$commitViewValue();
-      });
-    }
-  };
-
-  // model -> value
-  // Note: we cannot use a normal scope.$watch as we want to detect the following:
-  // 1. scope value is 'a'
-  // 2. user enters 'b'
-  // 3. ng-change kicks in and reverts scope value to 'a'
-  //    -> scope value did not change since the last digest as
-  //       ng-change executes in apply phase
-  // 4. view should be changed back to 'a'
-  $scope.$watch(function ngModelWatch() {
-    var modelValue = ngModelGet($scope);
-
-    // if scope model value and ngModel value are out of sync
-    // TODO(perf): why not move this to the action fn?
-    if (modelValue !== ctrl.$modelValue &&
-       // checks for NaN is needed to allow setting the model to NaN when there's an asyncValidator
-       (ctrl.$modelValue === ctrl.$modelValue || modelValue === modelValue)
-    ) {
-      ctrl.$modelValue = ctrl.$$rawModelValue = modelValue;
-      parserValid = undefined;
-
-      var formatters = ctrl.$formatters,
-          idx = formatters.length;
-
-      var viewValue = modelValue;
-      while (idx--) {
-        viewValue = formatters[idx](viewValue);
-      }
-      if (ctrl.$viewValue !== viewValue) {
-        ctrl.$viewValue = ctrl.$$lastCommittedViewValue = viewValue;
-        ctrl.$render();
-
-        ctrl.$$runValidators(modelValue, viewValue, noop);
-      }
-    }
-
-    return modelValue;
-  });
-}];
-
-
-/**
- * @ngdoc directive
- * @name ngModel
- *
- * @element input
- * @priority 1
- *
- * @description
- * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a
- * property on the scope using {@link ngModel.NgModelController NgModelController},
- * which is created and exposed by this directive.
- *
- * `ngModel` is responsible for:
- *
- * - Binding the view into the model, which other directives such as `input`, `textarea` or `select`
- *   require.
- * - Providing validation behavior (i.e. required, number, email, url).
- * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).
- * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`, `ng-untouched`) including animations.
- * - Registering the control with its parent {@link ng.directive:form form}.
- *
- * Note: `ngModel` will try to bind to the property given by evaluating the expression on the
- * current scope. If the property doesn't already exist on this scope, it will be created
- * implicitly and added to the scope.
- *
- * For best practices on using `ngModel`, see:
- *
- *  - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes)
- *
- * For basic examples, how to use `ngModel`, see:
- *
- *  - {@link ng.directive:input input}
- *    - {@link input[text] text}
- *    - {@link input[checkbox] checkbox}
- *    - {@link input[radio] radio}
- *    - {@link input[number] number}
- *    - {@link input[email] email}
- *    - {@link input[url] url}
- *    - {@link input[date] date}
- *    - {@link input[datetime-local] datetime-local}
- *    - {@link input[time] time}
- *    - {@link input[month] month}
- *    - {@link input[week] week}
- *  - {@link ng.directive:select select}
- *  - {@link ng.directive:textarea textarea}
- *
- * # CSS classes
- * The following CSS classes are added and removed on the associated input/select/textarea element
- * depending on the validity of the model.
- *
- *  - `ng-valid`: the model is valid
- *  - `ng-invalid`: the model is invalid
- *  - `ng-valid-[key]`: for each valid key added by `$setValidity`
- *  - `ng-invalid-[key]`: for each invalid key added by `$setValidity`
- *  - `ng-pristine`: the control hasn't been interacted with yet
- *  - `ng-dirty`: the control has been interacted with
- *  - `ng-touched`: the control has been blurred
- *  - `ng-untouched`: the control hasn't been blurred
- *  - `ng-pending`: any `$asyncValidators` are unfulfilled
- *
- * Keep in mind that ngAnimate can detect each of these classes when added and removed.
- *
- * ## Animation Hooks
- *
- * Animations within models are triggered when any of the associated CSS classes are added and removed
- * on the input element which is attached to the model. These classes are: `.ng-pristine`, `.ng-dirty`,
- * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.
- * The animations that are triggered within ngModel are similar to how they work in ngClass and
- * animations can be hooked into using CSS transitions, keyframes as well as JS animations.
- *
- * The following example shows a simple way to utilize CSS transitions to style an input element
- * that has been rendered as invalid after it has been validated:
- *
- * <pre>
- * //be sure to include ngAnimate as a module to hook into more
- * //advanced animations
- * .my-input {
- *   transition:0.5s linear all;
- *   background: white;
- * }
- * .my-input.ng-invalid {
- *   background: red;
- *   color:white;
- * }
- * </pre>
- *
- * @example
- * <example deps="angular-animate.js" animations="true" fixBase="true" module="inputExample">
-     <file name="index.html">
-       <script>
-        angular.module('inputExample', [])
-          .controller('ExampleController', ['$scope', function($scope) {
-            $scope.val = '1';
-          }]);
-       </script>
-       <style>
-         .my-input {
-           transition:all linear 0.5s;
-           background: transparent;
-         }
-         .my-input.ng-invalid {
-           color:white;
-           background: red;
-         }
-       </style>
-       <p id="inputDescription">
-        Update input to see transitions when valid/invalid.
-        Integer is a valid value.
-       </p>
-       <form name="testForm" ng-controller="ExampleController">
-         <input ng-model="val" ng-pattern="/^\d+$/" name="anim" class="my-input"
-                aria-describedby="inputDescription" />
-       </form>
-     </file>
- * </example>
- *
- * ## Binding to a getter/setter
- *
- * Sometimes it's helpful to bind `ngModel` to a getter/setter function.  A getter/setter is a
- * function that returns a representation of the model when called with zero arguments, and sets
- * the internal state of a model when called with an argument. It's sometimes useful to use this
- * for models that have an internal representation that's different from what the model exposes
- * to the view.
- *
- * <div class="alert alert-success">
- * **Best Practice:** It's best to keep getters fast because Angular is likely to call them more
- * frequently than other parts of your code.
- * </div>
- *
- * You use this behavior by adding `ng-model-options="{ getterSetter: true }"` to an element that
- * has `ng-model` attached to it. You can also add `ng-model-options="{ getterSetter: true }"` to
- * a `<form>`, which will enable this behavior for all `<input>`s within it. See
- * {@link ng.directive:ngModelOptions `ngModelOptions`} for more.
- *
- * The following example shows how to use `ngModel` with a getter/setter:
- *
- * @example
- * <example name="ngModel-getter-setter" module="getterSetterExample">
-     <file name="index.html">
-       <div ng-controller="ExampleController">
-         <form name="userForm">
-           <label>Name:
-             <input type="text" name="userName"
-                    ng-model="user.name"
-                    ng-model-options="{ getterSetter: true }" />
-           </label>
-         </form>
-         <pre>user.name = <span ng-bind="user.name()"></span></pre>
-       </div>
-     </file>
-     <file name="app.js">
-       angular.module('getterSetterExample', [])
-         .controller('ExampleController', ['$scope', function($scope) {
-           var _name = 'Brian';
-           $scope.user = {
-             name: function(newName) {
-              // Note that newName can be undefined for two reasons:
-              // 1. Because it is called as a getter and thus called with no arguments
-              // 2. Because the property should actually be set to undefined. This happens e.g. if the
-              //    input is invalid
-              return arguments.length ? (_name = newName) : _name;
-             }
-           };
-         }]);
-     </file>
- * </example>
- */
-var ngModelDirective = ['$rootScope', function($rootScope) {
-  return {
-    restrict: 'A',
-    require: ['ngModel', '^?form', '^?ngModelOptions'],
-    controller: NgModelController,
-    // Prelink needs to run before any input directive
-    // so that we can set the NgModelOptions in NgModelController
-    // before anyone else uses it.
-    priority: 1,
-    compile: function ngModelCompile(element) {
-      // Setup initial state of the control
-      element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS);
-
-      return {
-        pre: function ngModelPreLink(scope, element, attr, ctrls) {
-          var modelCtrl = ctrls[0],
-              formCtrl = ctrls[1] || modelCtrl.$$parentForm;
-
-          modelCtrl.$$setOptions(ctrls[2] && ctrls[2].$options);
-
-          // notify others, especially parent forms
-          formCtrl.$addControl(modelCtrl);
-
-          attr.$observe('name', function(newValue) {
-            if (modelCtrl.$name !== newValue) {
-              modelCtrl.$$parentForm.$$renameControl(modelCtrl, newValue);
-            }
-          });
-
-          scope.$on('$destroy', function() {
-            modelCtrl.$$parentForm.$removeControl(modelCtrl);
-          });
-        },
-        post: function ngModelPostLink(scope, element, attr, ctrls) {
-          var modelCtrl = ctrls[0];
-          if (modelCtrl.$options && modelCtrl.$options.updateOn) {
-            element.on(modelCtrl.$options.updateOn, function(ev) {
-              modelCtrl.$$debounceViewValueCommit(ev && ev.type);
-            });
-          }
-
-          element.on('blur', function(ev) {
-            if (modelCtrl.$touched) return;
-
-            if ($rootScope.$$phase) {
-              scope.$evalAsync(modelCtrl.$setTouched);
-            } else {
-              scope.$apply(modelCtrl.$setTouched);
-            }
-          });
-        }
-      };
-    }
-  };
-}];
-
-var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/;
-
-/**
- * @ngdoc directive
- * @name ngModelOptions
- *
- * @description
- * Allows tuning how model updates are done. Using `ngModelOptions` you can specify a custom list of
- * events that will trigger a model update and/or a debouncing delay so that the actual update only
- * takes place when a timer expires; this timer will be reset after another change takes place.
- *
- * Given the nature of `ngModelOptions`, the value displayed inside input fields in the view might
- * be different from the value in the actual model. This means that if you update the model you
- * should also invoke {@link ngModel.NgModelController `$rollbackViewValue`} on the relevant input field in
- * order to make sure it is synchronized with the model and that any debounced action is canceled.
- *
- * The easiest way to reference the control's {@link ngModel.NgModelController `$rollbackViewValue`}
- * method is by making sure the input is placed inside a form that has a `name` attribute. This is
- * important because `form` controllers are published to the related scope under the name in their
- * `name` attribute.
- *
- * Any pending changes will take place immediately when an enclosing form is submitted via the
- * `submit` event. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`
- * to have access to the updated model.
- *
- * `ngModelOptions` has an effect on the element it's declared on and its descendants.
- *
- * @param {Object} ngModelOptions options to apply to the current model. Valid keys are:
- *   - `updateOn`: string specifying which event should the input be bound to. You can set several
- *     events using an space delimited list. There is a special event called `default` that
- *     matches the default events belonging of the control.
- *   - `debounce`: integer value which contains the debounce model update value in milliseconds. A
- *     value of 0 triggers an immediate update. If an object is supplied instead, you can specify a
- *     custom value for each event. For example:
- *     `ng-model-options="{ updateOn: 'default blur', debounce: { 'default': 500, 'blur': 0 } }"`
- *   - `allowInvalid`: boolean value which indicates that the model can be set with values that did
- *     not validate correctly instead of the default behavior of setting the model to undefined.
- *   - `getterSetter`: boolean value which determines whether or not to treat functions bound to
-       `ngModel` as getters/setters.
- *   - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for
- *     `<input type="date">`, `<input type="time">`, ... . It understands UTC/GMT and the
- *     continental US time zone abbreviations, but for general use, use a time zone offset, for
- *     example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)
- *     If not specified, the timezone of the browser will be used.
- *
- * @example
-
-  The following example shows how to override immediate updates. Changes on the inputs within the
-  form will update the model only when the control loses focus (blur event). If `escape` key is
-  pressed while the input field is focused, the value is reset to the value in the current model.
-
-  <example name="ngModelOptions-directive-blur" module="optionsExample">
-    <file name="index.html">
-      <div ng-controller="ExampleController">
-        <form name="userForm">
-          <label>Name:
-            <input type="text" name="userName"
-                   ng-model="user.name"
-                   ng-model-options="{ updateOn: 'blur' }"
-                   ng-keyup="cancel($event)" />
-          </label><br />
-          <label>Other data:
-            <input type="text" ng-model="user.data" />
-          </label><br />
-        </form>
-        <pre>user.name = <span ng-bind="user.name"></span></pre>
-      </div>
-    </file>
-    <file name="app.js">
-      angular.module('optionsExample', [])
-        .controller('ExampleController', ['$scope', function($scope) {
-          $scope.user = { name: 'say', data: '' };
-
-          $scope.cancel = function(e) {
-            if (e.keyCode == 27) {
-              $scope.userForm.userName.$rollbackViewValue();
-            }
-          };
-        }]);
-    </file>
-    <file name="protractor.js" type="protractor">
-      var model = element(by.binding('user.name'));
-      var input = element(by.model('user.name'));
-      var other = element(by.model('user.data'));
-
-      it('should allow custom events', function() {
-        input.sendKeys(' hello');
-        input.click();
-        expect(model.getText()).toEqual('say');
-        other.click();
-        expect(model.getText()).toEqual('say hello');
-      });
-
-      it('should $rollbackViewValue when model changes', function() {
-        input.sendKeys(' hello');
-        expect(input.getAttribute('value')).toEqual('say hello');
-        input.sendKeys(protractor.Key.ESCAPE);
-        expect(input.getAttribute('value')).toEqual('say');
-        other.click();
-        expect(model.getText()).toEqual('say');
-      });
-    </file>
-  </example>
-
-  This one shows how to debounce model changes. Model will be updated only 1 sec after last change.
-  If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty.
-
-  <example name="ngModelOptions-directive-debounce" module="optionsExample">
-    <file name="index.html">
-      <div ng-controller="ExampleController">
-        <form name="userForm">
-          <label>Name:
-            <input type="text" name="userName"
-                   ng-model="user.name"
-                   ng-model-options="{ debounce: 1000 }" />
-          </label>
-          <button ng-click="userForm.userName.$rollbackViewValue(); user.name=''">Clear</button>
-          <br />
-        </form>
-        <pre>user.name = <span ng-bind="user.name"></span></pre>
-      </div>
-    </file>
-    <file name="app.js">
-      angular.module('optionsExample', [])
-        .controller('ExampleController', ['$scope', function($scope) {
-          $scope.user = { name: 'say' };
-        }]);
-    </file>
-  </example>
-
-  This one shows how to bind to getter/setters:
-
-  <example name="ngModelOptions-directive-getter-setter" module="getterSetterExample">
-    <file name="index.html">
-      <div ng-controller="ExampleController">
-        <form name="userForm">
-          <label>Name:
-            <input type="text" name="userName"
-                   ng-model="user.name"
-                   ng-model-options="{ getterSetter: true }" />
-          </label>
-        </form>
-        <pre>user.name = <span ng-bind="user.name()"></span></pre>
-      </div>
-    </file>
-    <file name="app.js">
-      angular.module('getterSetterExample', [])
-        .controller('ExampleController', ['$scope', function($scope) {
-          var _name = 'Brian';
-          $scope.user = {
-            name: function(newName) {
-              // Note that newName can be undefined for two reasons:
-              // 1. Because it is called as a getter and thus called with no arguments
-              // 2. Because the property should actually be set to undefined. This happens e.g. if the
-              //    input is invalid
-              return arguments.length ? (_name = newName) : _name;
-            }
-          };
-        }]);
-    </file>
-  </example>
- */
-var ngModelOptionsDirective = function() {
-  return {
-    restrict: 'A',
-    controller: ['$scope', '$attrs', function($scope, $attrs) {
-      var that = this;
-      this.$options = copy($scope.$eval($attrs.ngModelOptions));
-      // Allow adding/overriding bound events
-      if (isDefined(this.$options.updateOn)) {
-        this.$options.updateOnDefault = false;
-        // extract "default" pseudo-event from list of events that can trigger a model update
-        this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP, function() {
-          that.$options.updateOnDefault = true;
-          return ' ';
-        }));
-      } else {
-        this.$options.updateOnDefault = true;
-      }
-    }]
-  };
-};
-
-
-
-// helper methods
-function addSetValidityMethod(context) {
-  var ctrl = context.ctrl,
-      $element = context.$element,
-      classCache = {},
-      set = context.set,
-      unset = context.unset,
-      $animate = context.$animate;
-
-  classCache[INVALID_CLASS] = !(classCache[VALID_CLASS] = $element.hasClass(VALID_CLASS));
-
-  ctrl.$setValidity = setValidity;
-
-  function setValidity(validationErrorKey, state, controller) {
-    if (isUndefined(state)) {
-      createAndSet('$pending', validationErrorKey, controller);
-    } else {
-      unsetAndCleanup('$pending', validationErrorKey, controller);
-    }
-    if (!isBoolean(state)) {
-      unset(ctrl.$error, validationErrorKey, controller);
-      unset(ctrl.$$success, validationErrorKey, controller);
-    } else {
-      if (state) {
-        unset(ctrl.$error, validationErrorKey, controller);
-        set(ctrl.$$success, validationErrorKey, controller);
-      } else {
-        set(ctrl.$error, validationErrorKey, controller);
-        unset(ctrl.$$success, validationErrorKey, controller);
-      }
-    }
-    if (ctrl.$pending) {
-      cachedToggleClass(PENDING_CLASS, true);
-      ctrl.$valid = ctrl.$invalid = undefined;
-      toggleValidationCss('', null);
-    } else {
-      cachedToggleClass(PENDING_CLASS, false);
-      ctrl.$valid = isObjectEmpty(ctrl.$error);
-      ctrl.$invalid = !ctrl.$valid;
-      toggleValidationCss('', ctrl.$valid);
-    }
-
-    // re-read the state as the set/unset methods could have
-    // combined state in ctrl.$error[validationError] (used for forms),
-    // where setting/unsetting only increments/decrements the value,
-    // and does not replace it.
-    var combinedState;
-    if (ctrl.$pending && ctrl.$pending[validationErrorKey]) {
-      combinedState = undefined;
-    } else if (ctrl.$error[validationErrorKey]) {
-      combinedState = false;
-    } else if (ctrl.$$success[validationErrorKey]) {
-      combinedState = true;
-    } else {
-      combinedState = null;
-    }
-
-    toggleValidationCss(validationErrorKey, combinedState);
-    ctrl.$$parentForm.$setValidity(validationErrorKey, combinedState, ctrl);
-  }
-
-  function createAndSet(name, value, controller) {
-    if (!ctrl[name]) {
-      ctrl[name] = {};
-    }
-    set(ctrl[name], value, controller);
-  }
-
-  function unsetAndCleanup(name, value, controller) {
-    if (ctrl[name]) {
-      unset(ctrl[name], value, controller);
-    }
-    if (isObjectEmpty(ctrl[name])) {
-      ctrl[name] = undefined;
-    }
-  }
-
-  function cachedToggleClass(className, switchValue) {
-    if (switchValue && !classCache[className]) {
-      $animate.addClass($element, className);
-      classCache[className] = true;
-    } else if (!switchValue && classCache[className]) {
-      $animate.removeClass($element, className);
-      classCache[className] = false;
-    }
-  }
-
-  function toggleValidationCss(validationErrorKey, isValid) {
-    validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';
-
-    cachedToggleClass(VALID_CLASS + validationErrorKey, isValid === true);
-    cachedToggleClass(INVALID_CLASS + validationErrorKey, isValid === false);
-  }
-}
-
-function isObjectEmpty(obj) {
-  if (obj) {
-    for (var prop in obj) {
-      if (obj.hasOwnProperty(prop)) {
-        return false;
-      }
-    }
-  }
-  return true;
-}
-
-/**
- * @ngdoc directive
- * @name ngNonBindable
- * @restrict AC
- * @priority 1000
- *
- * @description
- * The `ngNonBindable` directive tells Angular not to compile or bind the contents of the current
- * DOM element. This is useful if the element contains what appears to be Angular directives and
- * bindings but which should be ignored by Angular. This could be the case if you have a site that
- * displays snippets of code, for instance.
- *
- * @element ANY
- *
- * @example
- * In this example there are two locations where a simple interpolation binding (`{{}}`) is present,
- * but the one wrapped in `ngNonBindable` is left alone.
- *
- * @example
-    <example>
-      <file name="index.html">
-        <div>Normal: {{1 + 2}}</div>
-        <div ng-non-bindable>Ignored: {{1 + 2}}</div>
-      </file>
-      <file name="protractor.js" type="protractor">
-       it('should check ng-non-bindable', function() {
-         expect(element(by.binding('1 + 2')).getText()).toContain('3');
-         expect(element.all(by.css('div')).last().getText()).toMatch(/1 \+ 2/);
-       });
-      </file>
-    </example>
- */
-var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });
-
-/* global jqLiteRemove */
-
-var ngOptionsMinErr = minErr('ngOptions');
-
-/**
- * @ngdoc directive
- * @name ngOptions
- * @restrict A
- *
- * @description
- *
- * The `ngOptions` attribute can be used to dynamically generate a list of `<option>`
- * elements for the `<select>` element using the array or object obtained by evaluating the
- * `ngOptions` comprehension expression.
- *
- * In many cases, `ngRepeat` can be used on `<option>` elements instead of `ngOptions` to achieve a
- * similar result. However, `ngOptions` provides some benefits such as reducing memory and
- * increasing speed by not creating a new scope for each repeated instance, as well as providing
- * more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the
- * comprehension expression. `ngOptions` should be used when the `<select>` model needs to be bound
- *  to a non-string value. This is because an option element can only be bound to string values at
- * present.
- *
- * When an item in the `<select>` menu is selected, the array element or object property
- * represented by the selected option will be bound to the model identified by the `ngModel`
- * directive.
- *
- * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can
- * be nested into the `<select>` element. This element will then represent the `null` or "not selected"
- * option. See example below for demonstration.
- *
- * ## Complex Models (objects or collections)
- *
- * **Note:** By default, `ngModel` watches the model by reference, not value. This is important when
- * binding any input directive to a model that is an object or a collection.
- *
- * Since this is a common situation for `ngOptions` the directive additionally watches the model using
- * `$watchCollection` when the select has the `multiple` attribute or when there is a `track by` clause in
- * the options expression. This allows ngOptions to trigger a re-rendering of the options even if the actual
- * object/collection has not changed identity but only a property on the object or an item in the collection
- * changes.
- *
- * Note that `$watchCollection` does a shallow comparison of the properties of the object (or the items in the collection
- * if the model is an array). This means that changing a property deeper inside the object/collection that the
- * first level will not trigger a re-rendering.
- *
- *
- * ## `select` **`as`**
- *
- * Using `select` **`as`** will bind the result of the `select` expression to the model, but
- * the value of the `<select>` and `<option>` html elements will be either the index (for array data sources)
- * or property name (for object data sources) of the value within the collection. If a **`track by`** expression
- * is used, the result of that expression will be set as the value of the `option` and `select` elements.
- *
- *
- * ### `select` **`as`** and **`track by`**
- *
- * <div class="alert alert-warning">
- * Do not use `select` **`as`** and **`track by`** in the same expression. They are not designed to work together.
- * </div>
- *
- * Consider the following example:
- *
- * ```html
- * <select ng-options="item.subItem as item.label for item in values track by item.id" ng-model="selected"></select>
- * ```
- *
- * ```js
- * $scope.values = [{
- *   id: 1,
- *   label: 'aLabel',
- *   subItem: { name: 'aSubItem' }
- * }, {
- *   id: 2,
- *   label: 'bLabel',
- *   subItem: { name: 'bSubItem' }
- * }];
- *
- * $scope.selected = { name: 'aSubItem' };
- * ```
- *
- * With the purpose of preserving the selection, the **`track by`** expression is always applied to the element
- * of the data source (to `item` in this example). To calculate whether an element is selected, we do the
- * following:
- *
- * 1. Apply **`track by`** to the elements in the array. In the example: `[1, 2]`
- * 2. Apply **`track by`** to the already selected value in `ngModel`.
- *    In the example: this is not possible as **`track by`** refers to `item.id`, but the selected
- *    value from `ngModel` is `{name: 'aSubItem'}`, so the **`track by`** expression is applied to
- *    a wrong object, the selected element can't be found, `<select>` is always reset to the "not
- *    selected" option.
- *
- *
- * @param {string} ngModel Assignable angular expression to data-bind to.
- * @param {string=} name Property name of the form under which the control is published.
- * @param {string=} required The control is considered valid only if value is entered.
- * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
- *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
- *    `required` when you want to data-bind to the `required` attribute.
- * @param {comprehension_expression=} ngOptions in one of the following forms:
- *
- *   * for array data sources:
- *     * `label` **`for`** `value` **`in`** `array`
- *     * `select` **`as`** `label` **`for`** `value` **`in`** `array`
- *     * `label` **`group by`** `group` **`for`** `value` **`in`** `array`
- *     * `label` **`disable when`** `disable` **`for`** `value` **`in`** `array`
- *     * `label` **`group by`** `group` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`
- *     * `label` **`disable when`** `disable` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`
- *     * `label` **`for`** `value` **`in`** `array` | orderBy:`orderexpr` **`track by`** `trackexpr`
- *        (for including a filter with `track by`)
- *   * for object data sources:
- *     * `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
- *     * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
- *     * `label` **`group by`** `group` **`for (`**`key`**`,`** `value`**`) in`** `object`
- *     * `label` **`disable when`** `disable` **`for (`**`key`**`,`** `value`**`) in`** `object`
- *     * `select` **`as`** `label` **`group by`** `group`
- *         **`for` `(`**`key`**`,`** `value`**`) in`** `object`
- *     * `select` **`as`** `label` **`disable when`** `disable`
- *         **`for` `(`**`key`**`,`** `value`**`) in`** `object`
- *
- * Where:
- *
- *   * `array` / `object`: an expression which evaluates to an array / object to iterate over.
- *   * `value`: local variable which will refer to each item in the `array` or each property value
- *      of `object` during iteration.
- *   * `key`: local variable which will refer to a property name in `object` during iteration.
- *   * `label`: The result of this expression will be the label for `<option>` element. The
- *     `expression` will most likely refer to the `value` variable (e.g. `value.propertyName`).
- *   * `select`: The result of this expression will be bound to the model of the parent `<select>`
- *      element. If not specified, `select` expression will default to `value`.
- *   * `group`: The result of this expression will be used to group options using the `<optgroup>`
- *      DOM element.
- *   * `disable`: The result of this expression will be used to disable the rendered `<option>`
- *      element. Return `true` to disable.
- *   * `trackexpr`: Used when working with an array of objects. The result of this expression will be
- *      used to identify the objects in the array. The `trackexpr` will most likely refer to the
- *     `value` variable (e.g. `value.propertyName`). With this the selection is preserved
- *      even when the options are recreated (e.g. reloaded from the server).
- *
- * @example
-    <example module="selectExample">
-      <file name="index.html">
-        <script>
-        angular.module('selectExample', [])
-          .controller('ExampleController', ['$scope', function($scope) {
-            $scope.colors = [
-              {name:'black', shade:'dark'},
-              {name:'white', shade:'light', notAnOption: true},
-              {name:'red', shade:'dark'},
-              {name:'blue', shade:'dark', notAnOption: true},
-              {name:'yellow', shade:'light', notAnOption: false}
-            ];
-            $scope.myColor = $scope.colors[2]; // red
-          }]);
-        </script>
-        <div ng-controller="ExampleController">
-          <ul>
-            <li ng-repeat="color in colors">
-              <label>Name: <input ng-model="color.name"></label>
-              <label><input type="checkbox" ng-model="color.notAnOption"> Disabled?</label>
-              <button ng-click="colors.splice($index, 1)" aria-label="Remove">X</button>
-            </li>
-            <li>
-              <button ng-click="colors.push({})">add</button>
-            </li>
-          </ul>
-          <hr/>
-          <label>Color (null not allowed):
-            <select ng-model="myColor" ng-options="color.name for color in colors"></select>
-          </label><br/>
-          <label>Color (null allowed):
-          <span  class="nullable">
-            <select ng-model="myColor" ng-options="color.name for color in colors">
-              <option value="">-- choose color --</option>
-            </select>
-          </span></label><br/>
-
-          <label>Color grouped by shade:
-            <select ng-model="myColor" ng-options="color.name group by color.shade for color in colors">
-            </select>
-          </label><br/>
-
-          <label>Color grouped by shade, with some disabled:
-            <select ng-model="myColor"
-                  ng-options="color.name group by color.shade disable when color.notAnOption for color in colors">
-            </select>
-          </label><br/>
-
-
-
-          Select <button ng-click="myColor = { name:'not in list', shade: 'other' }">bogus</button>.
-          <br/>
-          <hr/>
-          Currently selected: {{ {selected_color:myColor} }}
-          <div style="border:solid 1px black; height:20px"
-               ng-style="{'background-color':myColor.name}">
-          </div>
-        </div>
-      </file>
-      <file name="protractor.js" type="protractor">
-         it('should check ng-options', function() {
-           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('red');
-           element.all(by.model('myColor')).first().click();
-           element.all(by.css('select[ng-model="myColor"] option')).first().click();
-           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('black');
-           element(by.css('.nullable select[ng-model="myColor"]')).click();
-           element.all(by.css('.nullable select[ng-model="myColor"] option')).first().click();
-           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('null');
-         });
-      </file>
-    </example>
- */
-
-// jshint maxlen: false
-//                     //00001111111111000000000002222222222000000000000000000000333333333300000000000000000000000004444444444400000000000005555555555555550000000006666666666666660000000777777777777777000000000000000888888888800000000000000000009999999999
-var NG_OPTIONS_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/;
-                        // 1: value expression (valueFn)
-                        // 2: label expression (displayFn)
-                        // 3: group by expression (groupByFn)
-                        // 4: disable when expression (disableWhenFn)
-                        // 5: array item variable name
-                        // 6: object item key variable name
-                        // 7: object item value variable name
-                        // 8: collection expression
-                        // 9: track by expression
-// jshint maxlen: 100
-
-
-var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) {
-
-  function parseOptionsExpression(optionsExp, selectElement, scope) {
-
-    var match = optionsExp.match(NG_OPTIONS_REGEXP);
-    if (!(match)) {
-      throw ngOptionsMinErr('iexp',
-        "Expected expression in form of " +
-        "'_select_ (as _label_)? for (_key_,)?_value_ in _collection_'" +
-        " but got '{0}'. Element: {1}",
-        optionsExp, startingTag(selectElement));
-    }
-
-    // Extract the parts from the ngOptions expression
-
-    // The variable name for the value of the item in the collection
-    var valueName = match[5] || match[7];
-    // The variable name for the key of the item in the collection
-    var keyName = match[6];
-
-    // An expression that generates the viewValue for an option if there is a label expression
-    var selectAs = / as /.test(match[0]) && match[1];
-    // An expression that is used to track the id of each object in the options collection
-    var trackBy = match[9];
-    // An expression that generates the viewValue for an option if there is no label expression
-    var valueFn = $parse(match[2] ? match[1] : valueName);
-    var selectAsFn = selectAs && $parse(selectAs);
-    var viewValueFn = selectAsFn || valueFn;
-    var trackByFn = trackBy && $parse(trackBy);
-
-    // Get the value by which we are going to track the option
-    // if we have a trackFn then use that (passing scope and locals)
-    // otherwise just hash the given viewValue
-    var getTrackByValueFn = trackBy ?
-                              function(value, locals) { return trackByFn(scope, locals); } :
-                              function getHashOfValue(value) { return hashKey(value); };
-    var getTrackByValue = function(value, key) {
-      return getTrackByValueFn(value, getLocals(value, key));
-    };
-
-    var displayFn = $parse(match[2] || match[1]);
-    var groupByFn = $parse(match[3] || '');
-    var disableWhenFn = $parse(match[4] || '');
-    var valuesFn = $parse(match[8]);
-
-    var locals = {};
-    var getLocals = keyName ? function(value, key) {
-      locals[keyName] = key;
-      locals[valueName] = value;
-      return locals;
-    } : function(value) {
-      locals[valueName] = value;
-      return locals;
-    };
-
-
-    function Option(selectValue, viewValue, label, group, disabled) {
-      this.selectValue = selectValue;
-      this.viewValue = viewValue;
-      this.label = label;
-      this.group = group;
-      this.disabled = disabled;
-    }
-
-    function getOptionValuesKeys(optionValues) {
-      var optionValuesKeys;
-
-      if (!keyName && isArrayLike(optionValues)) {
-        optionValuesKeys = optionValues;
-      } else {
-        // if object, extract keys, in enumeration order, unsorted
-        optionValuesKeys = [];
-        for (var itemKey in optionValues) {
-          if (optionValues.hasOwnProperty(itemKey) && itemKey.charAt(0) !== '$') {
-            optionValuesKeys.push(itemKey);
-          }
-        }
-      }
-      return optionValuesKeys;
-    }
-
-    return {
-      trackBy: trackBy,
-      getTrackByValue: getTrackByValue,
-      getWatchables: $parse(valuesFn, function(optionValues) {
-        // Create a collection of things that we would like to watch (watchedArray)
-        // so that they can all be watched using a single $watchCollection
-        // that only runs the handler once if anything changes
-        var watchedArray = [];
-        optionValues = optionValues || [];
-
-        var optionValuesKeys = getOptionValuesKeys(optionValues);
-        var optionValuesLength = optionValuesKeys.length;
-        for (var index = 0; index < optionValuesLength; index++) {
-          var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index];
-          var value = optionValues[key];
-
-          var locals = getLocals(optionValues[key], key);
-          var selectValue = getTrackByValueFn(optionValues[key], locals);
-          watchedArray.push(selectValue);
-
-          // Only need to watch the displayFn if there is a specific label expression
-          if (match[2] || match[1]) {
-            var label = displayFn(scope, locals);
-            watchedArray.push(label);
-          }
-
-          // Only need to watch the disableWhenFn if there is a specific disable expression
-          if (match[4]) {
-            var disableWhen = disableWhenFn(scope, locals);
-            watchedArray.push(disableWhen);
-          }
-        }
-        return watchedArray;
-      }),
-
-      getOptions: function() {
-
-        var optionItems = [];
-        var selectValueMap = {};
-
-        // The option values were already computed in the `getWatchables` fn,
-        // which must have been called to trigger `getOptions`
-        var optionValues = valuesFn(scope) || [];
-        var optionValuesKeys = getOptionValuesKeys(optionValues);
-        var optionValuesLength = optionValuesKeys.length;
-
-        for (var index = 0; index < optionValuesLength; index++) {
-          var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index];
-          var value = optionValues[key];
-          var locals = getLocals(value, key);
-          var viewValue = viewValueFn(scope, locals);
-          var selectValue = getTrackByValueFn(viewValue, locals);
-          var label = displayFn(scope, locals);
-          var group = groupByFn(scope, locals);
-          var disabled = disableWhenFn(scope, locals);
-          var optionItem = new Option(selectValue, viewValue, label, group, disabled);
-
-          optionItems.push(optionItem);
-          selectValueMap[selectValue] = optionItem;
-        }
-
-        return {
-          items: optionItems,
-          selectValueMap: selectValueMap,
-          getOptionFromViewValue: function(value) {
-            return selectValueMap[getTrackByValue(value)];
-          },
-          getViewValueFromOption: function(option) {
-            // If the viewValue could be an object that may be mutated by the application,
-            // we need to make a copy and not return the reference to the value on the option.
-            return trackBy ? angular.copy(option.viewValue) : option.viewValue;
-          }
-        };
-      }
-    };
-  }
-
-
-  // we can't just jqLite('<option>') since jqLite is not smart enough
-  // to create it in <select> and IE barfs otherwise.
-  var optionTemplate = document.createElement('option'),
-      optGroupTemplate = document.createElement('optgroup');
-
-  return {
-    restrict: 'A',
-    terminal: true,
-    require: ['select', '?ngModel'],
-    link: function(scope, selectElement, attr, ctrls) {
-
-      // if ngModel is not defined, we don't need to do anything
-      var ngModelCtrl = ctrls[1];
-      if (!ngModelCtrl) return;
-
-      var selectCtrl = ctrls[0];
-      var multiple = attr.multiple;
-
-      // The emptyOption allows the application developer to provide their own custom "empty"
-      // option when the viewValue does not match any of the option values.
-      var emptyOption;
-      for (var i = 0, children = selectElement.children(), ii = children.length; i < ii; i++) {
-        if (children[i].value === '') {
-          emptyOption = children.eq(i);
-          break;
-        }
-      }
-
-      var providedEmptyOption = !!emptyOption;
-
-      var unknownOption = jqLite(optionTemplate.cloneNode(false));
-      unknownOption.val('?');
-
-      var options;
-      var ngOptions = parseOptionsExpression(attr.ngOptions, selectElement, scope);
-
-
-      var renderEmptyOption = function() {
-        if (!providedEmptyOption) {
-          selectElement.prepend(emptyOption);
-        }
-        selectElement.val('');
-        emptyOption.prop('selected', true); // needed for IE
-        emptyOption.attr('selected', true);
-      };
-
-      var removeEmptyOption = function() {
-        if (!providedEmptyOption) {
-          emptyOption.remove();
-        }
-      };
-
-
-      var renderUnknownOption = function() {
-        selectElement.prepend(unknownOption);
-        selectElement.val('?');
-        unknownOption.prop('selected', true); // needed for IE
-        unknownOption.attr('selected', true);
-      };
-
-      var removeUnknownOption = function() {
-        unknownOption.remove();
-      };
-
-
-      // Update the controller methods for multiple selectable options
-      if (!multiple) {
-
-        selectCtrl.writeValue = function writeNgOptionsValue(value) {
-          var option = options.getOptionFromViewValue(value);
-
-          if (option && !option.disabled) {
-            if (selectElement[0].value !== option.selectValue) {
-              removeUnknownOption();
-              removeEmptyOption();
-
-              selectElement[0].value = option.selectValue;
-              option.element.selected = true;
-              option.element.setAttribute('selected', 'selected');
-            }
-          } else {
-            if (value === null || providedEmptyOption) {
-              removeUnknownOption();
-              renderEmptyOption();
-            } else {
-              removeEmptyOption();
-              renderUnknownOption();
-            }
-          }
-        };
-
-        selectCtrl.readValue = function readNgOptionsValue() {
-
-          var selectedOption = options.selectValueMap[selectElement.val()];
-
-          if (selectedOption && !selectedOption.disabled) {
-            removeEmptyOption();
-            removeUnknownOption();
-            return options.getViewValueFromOption(selectedOption);
-          }
-          return null;
-        };
-
-        // If we are using `track by` then we must watch the tracked value on the model
-        // since ngModel only watches for object identity change
-        if (ngOptions.trackBy) {
-          scope.$watch(
-            function() { return ngOptions.getTrackByValue(ngModelCtrl.$viewValue); },
-            function() { ngModelCtrl.$render(); }
-          );
-        }
-
-      } else {
-
-        ngModelCtrl.$isEmpty = function(value) {
-          return !value || value.length === 0;
-        };
-
-
-        selectCtrl.writeValue = function writeNgOptionsMultiple(value) {
-          options.items.forEach(function(option) {
-            option.element.selected = false;
-          });
-
-          if (value) {
-            value.forEach(function(item) {
-              var option = options.getOptionFromViewValue(item);
-              if (option && !option.disabled) option.element.selected = true;
-            });
-          }
-        };
-
-
-        selectCtrl.readValue = function readNgOptionsMultiple() {
-          var selectedValues = selectElement.val() || [],
-              selections = [];
-
-          forEach(selectedValues, function(value) {
-            var option = options.selectValueMap[value];
-            if (option && !option.disabled) selections.push(options.getViewValueFromOption(option));
-          });
-
-          return selections;
-        };
-
-        // If we are using `track by` then we must watch these tracked values on the model
-        // since ngModel only watches for object identity change
-        if (ngOptions.trackBy) {
-
-          scope.$watchCollection(function() {
-            if (isArray(ngModelCtrl.$viewValue)) {
-              return ngModelCtrl.$viewValue.map(function(value) {
-                return ngOptions.getTrackByValue(value);
-              });
-            }
-          }, function() {
-            ngModelCtrl.$render();
-          });
-
-        }
-      }
-
-
-      if (providedEmptyOption) {
-
-        // we need to remove it before calling selectElement.empty() because otherwise IE will
-        // remove the label from the element. wtf?
-        emptyOption.remove();
-
-        // compile the element since there might be bindings in it
-        $compile(emptyOption)(scope);
-
-        // remove the class, which is added automatically because we recompile the element and it
-        // becomes the compilation root
-        emptyOption.removeClass('ng-scope');
-      } else {
-        emptyOption = jqLite(optionTemplate.cloneNode(false));
-      }
-
-      // We need to do this here to ensure that the options object is defined
-      // when we first hit it in writeNgOptionsValue
-      updateOptions();
-
-      // We will re-render the option elements if the option values or labels change
-      scope.$watchCollection(ngOptions.getWatchables, updateOptions);
-
-      // ------------------------------------------------------------------ //
-
-
-      function updateOptionElement(option, element) {
-        option.element = element;
-        element.disabled = option.disabled;
-        // NOTE: The label must be set before the value, otherwise IE10/11/EDGE create unresponsive
-        // selects in certain circumstances when multiple selects are next to each other and display
-        // the option list in listbox style, i.e. the select is [multiple], or specifies a [size].
-        // See https://github.com/angular/angular.js/issues/11314 for more info.
-        // This is unfortunately untestable with unit / e2e tests
-        if (option.label !== element.label) {
-          element.label = option.label;
-          element.textContent = option.label;
-        }
-        if (option.value !== element.value) element.value = option.selectValue;
-      }
-
-      function addOrReuseElement(parent, current, type, templateElement) {
-        var element;
-        // Check whether we can reuse the next element
-        if (current && lowercase(current.nodeName) === type) {
-          // The next element is the right type so reuse it
-          element = current;
-        } else {
-          // The next element is not the right type so create a new one
-          element = templateElement.cloneNode(false);
-          if (!current) {
-            // There are no more elements so just append it to the select
-            parent.appendChild(element);
-          } else {
-            // The next element is not a group so insert the new one
-            parent.insertBefore(element, current);
-          }
-        }
-        return element;
-      }
-
-
-      function removeExcessElements(current) {
-        var next;
-        while (current) {
-          next = current.nextSibling;
-          jqLiteRemove(current);
-          current = next;
-        }
-      }
-
-
-      function skipEmptyAndUnknownOptions(current) {
-        var emptyOption_ = emptyOption && emptyOption[0];
-        var unknownOption_ = unknownOption && unknownOption[0];
-
-        if (emptyOption_ || unknownOption_) {
-          while (current &&
-                (current === emptyOption_ ||
-                current === unknownOption_ ||
-                emptyOption_ && emptyOption_.nodeType === NODE_TYPE_COMMENT)) {
-            // Empty options might have directives that transclude
-            // and insert comments (e.g. ngIf)
-            current = current.nextSibling;
-          }
-        }
-        return current;
-      }
-
-
-      function updateOptions() {
-
-        var previousValue = options && selectCtrl.readValue();
-
-        options = ngOptions.getOptions();
-
-        var groupMap = {};
-        var currentElement = selectElement[0].firstChild;
-
-        // Ensure that the empty option is always there if it was explicitly provided
-        if (providedEmptyOption) {
-          selectElement.prepend(emptyOption);
-        }
-
-        currentElement = skipEmptyAndUnknownOptions(currentElement);
-
-        options.items.forEach(function updateOption(option) {
-          var group;
-          var groupElement;
-          var optionElement;
-
-          if (option.group) {
-
-            // This option is to live in a group
-            // See if we have already created this group
-            group = groupMap[option.group];
-
-            if (!group) {
-
-              // We have not already created this group
-              groupElement = addOrReuseElement(selectElement[0],
-                                               currentElement,
-                                               'optgroup',
-                                               optGroupTemplate);
-              // Move to the next element
-              currentElement = groupElement.nextSibling;
-
-              // Update the label on the group element
-              groupElement.label = option.group;
-
-              // Store it for use later
-              group = groupMap[option.group] = {
-                groupElement: groupElement,
-                currentOptionElement: groupElement.firstChild
-              };
-
-            }
-
-            // So now we have a group for this option we add the option to the group
-            optionElement = addOrReuseElement(group.groupElement,
-                                              group.currentOptionElement,
-                                              'option',
-                                              optionTemplate);
-            updateOptionElement(option, optionElement);
-            // Move to the next element
-            group.currentOptionElement = optionElement.nextSibling;
-
-          } else {
-
-            // This option is not in a group
-            optionElement = addOrReuseElement(selectElement[0],
-                                              currentElement,
-                                              'option',
-                                              optionTemplate);
-            updateOptionElement(option, optionElement);
-            // Move to the next element
-            currentElement = optionElement.nextSibling;
-          }
-        });
-
-
-        // Now remove all excess options and group
-        Object.keys(groupMap).forEach(function(key) {
-          removeExcessElements(groupMap[key].currentOptionElement);
-        });
-        removeExcessElements(currentElement);
-
-        ngModelCtrl.$render();
-
-        // Check to see if the value has changed due to the update to the options
-        if (!ngModelCtrl.$isEmpty(previousValue)) {
-          var nextValue = selectCtrl.readValue();
-          if (ngOptions.trackBy ? !equals(previousValue, nextValue) : previousValue !== nextValue) {
-            ngModelCtrl.$setViewValue(nextValue);
-            ngModelCtrl.$render();
-          }
-        }
-
-      }
-
-    }
-  };
-}];
-
-/**
- * @ngdoc directive
- * @name ngPluralize
- * @restrict EA
- *
- * @description
- * `ngPluralize` is a directive that displays messages according to en-US localization rules.
- * These rules are bundled with angular.js, but can be overridden
- * (see {@link guide/i18n Angular i18n} dev guide). You configure ngPluralize directive
- * by specifying the mappings between
- * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)
- * and the strings to be displayed.
- *
- * # Plural categories and explicit number rules
- * There are two
- * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)
- * in Angular's default en-US locale: "one" and "other".
- *
- * While a plural category may match many numbers (for example, in en-US locale, "other" can match
- * any number that is not 1), an explicit number rule can only match one number. For example, the
- * explicit number rule for "3" matches the number 3. There are examples of plural categories
- * and explicit number rules throughout the rest of this documentation.
- *
- * # Configuring ngPluralize
- * You configure ngPluralize by providing 2 attributes: `count` and `when`.
- * You can also provide an optional attribute, `offset`.
- *
- * The value of the `count` attribute can be either a string or an {@link guide/expression
- * Angular expression}; these are evaluated on the current scope for its bound value.
- *
- * The `when` attribute specifies the mappings between plural categories and the actual
- * string to be displayed. The value of the attribute should be a JSON object.
- *
- * The following example shows how to configure ngPluralize:
- *
- * ```html
- * <ng-pluralize count="personCount"
-                 when="{'0': 'Nobody is viewing.',
- *                      'one': '1 person is viewing.',
- *                      'other': '{} people are viewing.'}">
- * </ng-pluralize>
- *```
- *
- * In the example, `"0: Nobody is viewing."` is an explicit number rule. If you did not
- * specify this rule, 0 would be matched to the "other" category and "0 people are viewing"
- * would be shown instead of "Nobody is viewing". You can specify an explicit number rule for
- * other numbers, for example 12, so that instead of showing "12 people are viewing", you can
- * show "a dozen people are viewing".
- *
- * You can use a set of closed braces (`{}`) as a placeholder for the number that you want substituted
- * into pluralized strings. In the previous example, Angular will replace `{}` with
- * <span ng-non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder
- * for <span ng-non-bindable>{{numberExpression}}</span>.
- *
- * If no rule is defined for a category, then an empty string is displayed and a warning is generated.
- * Note that some locales define more categories than `one` and `other`. For example, fr-fr defines `few` and `many`.
- *
- * # Configuring ngPluralize with offset
- * The `offset` attribute allows further customization of pluralized text, which can result in
- * a better user experience. For example, instead of the message "4 people are viewing this document",
- * you might display "John, Kate and 2 others are viewing this document".
- * The offset attribute allows you to offset a number by any desired value.
- * Let's take a look at an example:
- *
- * ```html
- * <ng-pluralize count="personCount" offset=2
- *               when="{'0': 'Nobody is viewing.',
- *                      '1': '{{person1}} is viewing.',
- *                      '2': '{{person1}} and {{person2}} are viewing.',
- *                      'one': '{{person1}}, {{person2}} and one other person are viewing.',
- *                      'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
- * </ng-pluralize>
- * ```
- *
- * Notice that we are still using two plural categories(one, other), but we added
- * three explicit number rules 0, 1 and 2.
- * When one person, perhaps John, views the document, "John is viewing" will be shown.
- * When three people view the document, no explicit number rule is found, so
- * an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category.
- * In this case, plural category 'one' is matched and "John, Mary and one other person are viewing"
- * is shown.
- *
- * Note that when you specify offsets, you must provide explicit number rules for
- * numbers from 0 up to and including the offset. If you use an offset of 3, for example,
- * you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for
- * plural categories "one" and "other".
- *
- * @param {string|expression} count The variable to be bound to.
- * @param {string} when The mapping between plural category to its corresponding strings.
- * @param {number=} offset Offset to deduct from the total number.
- *
- * @example
-    <example module="pluralizeExample">
-      <file name="index.html">
-        <script>
-          angular.module('pluralizeExample', [])
-            .controller('ExampleController', ['$scope', function($scope) {
-              $scope.person1 = 'Igor';
-              $scope.person2 = 'Misko';
-              $scope.personCount = 1;
-            }]);
-        </script>
-        <div ng-controller="ExampleController">
-          <label>Person 1:<input type="text" ng-model="person1" value="Igor" /></label><br/>
-          <label>Person 2:<input type="text" ng-model="person2" value="Misko" /></label><br/>
-          <label>Number of People:<input type="text" ng-model="personCount" value="1" /></label><br/>
-
-          <!--- Example with simple pluralization rules for en locale --->
-          Without Offset:
-          <ng-pluralize count="personCount"
-                        when="{'0': 'Nobody is viewing.',
-                               'one': '1 person is viewing.',
-                               'other': '{} people are viewing.'}">
-          </ng-pluralize><br>
-
-          <!--- Example with offset --->
-          With Offset(2):
-          <ng-pluralize count="personCount" offset=2
-                        when="{'0': 'Nobody is viewing.',
-                               '1': '{{person1}} is viewing.',
-                               '2': '{{person1}} and {{person2}} are viewing.',
-                               'one': '{{person1}}, {{person2}} and one other person are viewing.',
-                               'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
-          </ng-pluralize>
-        </div>
-      </file>
-      <file name="protractor.js" type="protractor">
-        it('should show correct pluralized string', function() {
-          var withoutOffset = element.all(by.css('ng-pluralize')).get(0);
-          var withOffset = element.all(by.css('ng-pluralize')).get(1);
-          var countInput = element(by.model('personCount'));
-
-          expect(withoutOffset.getText()).toEqual('1 person is viewing.');
-          expect(withOffset.getText()).toEqual('Igor is viewing.');
-
-          countInput.clear();
-          countInput.sendKeys('0');
-
-          expect(withoutOffset.getText()).toEqual('Nobody is viewing.');
-          expect(withOffset.getText()).toEqual('Nobody is viewing.');
-
-          countInput.clear();
-          countInput.sendKeys('2');
-
-          expect(withoutOffset.getText()).toEqual('2 people are viewing.');
-          expect(withOffset.getText()).toEqual('Igor and Misko are viewing.');
-
-          countInput.clear();
-          countInput.sendKeys('3');
-
-          expect(withoutOffset.getText()).toEqual('3 people are viewing.');
-          expect(withOffset.getText()).toEqual('Igor, Misko and one other person are viewing.');
-
-          countInput.clear();
-          countInput.sendKeys('4');
-
-          expect(withoutOffset.getText()).toEqual('4 people are viewing.');
-          expect(withOffset.getText()).toEqual('Igor, Misko and 2 other people are viewing.');
-        });
-        it('should show data-bound names', function() {
-          var withOffset = element.all(by.css('ng-pluralize')).get(1);
-          var personCount = element(by.model('personCount'));
-          var person1 = element(by.model('person1'));
-          var person2 = element(by.model('person2'));
-          personCount.clear();
-          personCount.sendKeys('4');
-          person1.clear();
-          person1.sendKeys('Di');
-          person2.clear();
-          person2.sendKeys('Vojta');
-          expect(withOffset.getText()).toEqual('Di, Vojta and 2 other people are viewing.');
-        });
-      </file>
-    </example>
- */
-var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale, $interpolate, $log) {
-  var BRACE = /{}/g,
-      IS_WHEN = /^when(Minus)?(.+)$/;
-
-  return {
-    link: function(scope, element, attr) {
-      var numberExp = attr.count,
-          whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs
-          offset = attr.offset || 0,
-          whens = scope.$eval(whenExp) || {},
-          whensExpFns = {},
-          startSymbol = $interpolate.startSymbol(),
-          endSymbol = $interpolate.endSymbol(),
-          braceReplacement = startSymbol + numberExp + '-' + offset + endSymbol,
-          watchRemover = angular.noop,
-          lastCount;
-
-      forEach(attr, function(expression, attributeName) {
-        var tmpMatch = IS_WHEN.exec(attributeName);
-        if (tmpMatch) {
-          var whenKey = (tmpMatch[1] ? '-' : '') + lowercase(tmpMatch[2]);
-          whens[whenKey] = element.attr(attr.$attr[attributeName]);
-        }
-      });
-      forEach(whens, function(expression, key) {
-        whensExpFns[key] = $interpolate(expression.replace(BRACE, braceReplacement));
-
-      });
-
-      scope.$watch(numberExp, function ngPluralizeWatchAction(newVal) {
-        var count = parseFloat(newVal);
-        var countIsNaN = isNaN(count);
-
-        if (!countIsNaN && !(count in whens)) {
-          // If an explicit number rule such as 1, 2, 3... is defined, just use it.
-          // Otherwise, check it against pluralization rules in $locale service.
-          count = $locale.pluralCat(count - offset);
-        }
-
-        // If both `count` and `lastCount` are NaN, we don't need to re-register a watch.
-        // In JS `NaN !== NaN`, so we have to exlicitly check.
-        if ((count !== lastCount) && !(countIsNaN && isNumber(lastCount) && isNaN(lastCount))) {
-          watchRemover();
-          var whenExpFn = whensExpFns[count];
-          if (isUndefined(whenExpFn)) {
-            if (newVal != null) {
-              $log.debug("ngPluralize: no rule defined for '" + count + "' in " + whenExp);
-            }
-            watchRemover = noop;
-            updateElementText();
-          } else {
-            watchRemover = scope.$watch(whenExpFn, updateElementText);
-          }
-          lastCount = count;
-        }
-      });
-
-      function updateElementText(newText) {
-        element.text(newText || '');
-      }
-    }
-  };
-}];
-
-/**
- * @ngdoc directive
- * @name ngRepeat
- * @multiElement
- *
- * @description
- * The `ngRepeat` directive instantiates a template once per item from a collection. Each template
- * instance gets its own scope, where the given loop variable is set to the current collection item,
- * and `$index` is set to the item index or key.
- *
- * Special properties are exposed on the local scope of each template instance, including:
- *
- * | Variable  | Type            | Details                                                                     |
- * |-----------|-----------------|-----------------------------------------------------------------------------|
- * | `$index`  | {@type number}  | iterator offset of the repeated element (0..length-1)                       |
- * | `$first`  | {@type boolean} | true if the repeated element is first in the iterator.                      |
- * | `$middle` | {@type boolean} | true if the repeated element is between the first and last in the iterator. |
- * | `$last`   | {@type boolean} | true if the repeated element is last in the iterator.                       |
- * | `$even`   | {@type boolean} | true if the iterator position `$index` is even (otherwise false).           |
- * | `$odd`    | {@type boolean} | true if the iterator position `$index` is odd (otherwise false).            |
- *
- * <div class="alert alert-info">
- *   Creating aliases for these properties is possible with {@link ng.directive:ngInit `ngInit`}.
- *   This may be useful when, for instance, nesting ngRepeats.
- * </div>
- *
- *
- * # Iterating over object properties
- *
- * It is possible to get `ngRepeat` to iterate over the properties of an object using the following
- * syntax:
- *
- * ```js
- * <div ng-repeat="(key, value) in myObj"> ... </div>
- * ```
- *
- * You need to be aware that the JavaScript specification does not define the order of keys
- * returned for an object. (To mitigate this in Angular 1.3 the `ngRepeat` directive
- * used to sort the keys alphabetically.)
- *
- * Version 1.4 removed the alphabetic sorting. We now rely on the order returned by the browser
- * when running `for key in myObj`. It seems that browsers generally follow the strategy of providing
- * keys in the order in which they were defined, although there are exceptions when keys are deleted
- * and reinstated. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete#Cross-browser_issues
- *
- * If this is not desired, the recommended workaround is to convert your object into an array
- * that is sorted into the order that you prefer before providing it to `ngRepeat`.  You could
- * do this with a filter such as [toArrayFilter](http://ngmodules.org/modules/angular-toArrayFilter)
- * or implement a `$watch` on the object yourself.
- *
- *
- * # Tracking and Duplicates
- *
- * When the contents of the collection change, `ngRepeat` makes the corresponding changes to the DOM:
- *
- * * When an item is added, a new instance of the template is added to the DOM.
- * * When an item is removed, its template instance is removed from the DOM.
- * * When items are reordered, their respective templates are reordered in the DOM.
- *
- * By default, `ngRepeat` does not allow duplicate items in arrays. This is because when
- * there are duplicates, it is not possible to maintain a one-to-one mapping between collection
- * items and DOM elements.
- *
- * If you do need to repeat duplicate items, you can substitute the default tracking behavior
- * with your own using the `track by` expression.
- *
- * For example, you may track items by the index of each item in the collection, using the
- * special scope property `$index`:
- * ```html
- *    <div ng-repeat="n in [42, 42, 43, 43] track by $index">
- *      {{n}}
- *    </div>
- * ```
- *
- * You may use arbitrary expressions in `track by`, including references to custom functions
- * on the scope:
- * ```html
- *    <div ng-repeat="n in [42, 42, 43, 43] track by myTrackingFunction(n)">
- *      {{n}}
- *    </div>
- * ```
- *
- * If you are working with objects that have an identifier property, you can track
- * by the identifier instead of the whole object. Should you reload your data later, `ngRepeat`
- * will not have to rebuild the DOM elements for items it has already rendered, even if the
- * JavaScript objects in the collection have been substituted for new ones:
- * ```html
- *    <div ng-repeat="model in collection track by model.id">
- *      {{model.name}}
- *    </div>
- * ```
- *
- * When no `track by` expression is provided, it is equivalent to tracking by the built-in
- * `$id` function, which tracks items by their identity:
- * ```html
- *    <div ng-repeat="obj in collection track by $id(obj)">
- *      {{obj.prop}}
- *    </div>
- * ```
- *
- * <div class="alert alert-warning">
- * **Note:** `track by` must always be the last expression:
- * </div>
- * ```
- * <div ng-repeat="model in collection | orderBy: 'id' as filtered_result track by model.id">
- *     {{model.name}}
- * </div>
- * ```
- *
- * # Special repeat start and end points
- * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending
- * the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.
- * The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on)
- * up to and including the ending HTML tag where **ng-repeat-end** is placed.
- *
- * The example below makes use of this feature:
- * ```html
- *   <header ng-repeat-start="item in items">
- *     Header {{ item }}
- *   </header>
- *   <div class="body">
- *     Body {{ item }}
- *   </div>
- *   <footer ng-repeat-end>
- *     Footer {{ item }}
- *   </footer>
- * ```
- *
- * And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to:
- * ```html
- *   <header>
- *     Header A
- *   </header>
- *   <div class="body">
- *     Body A
- *   </div>
- *   <footer>
- *     Footer A
- *   </footer>
- *   <header>
- *     Header B
- *   </header>
- *   <div class="body">
- *     Body B
- *   </div>
- *   <footer>
- *     Footer B
- *   </footer>
- * ```
- *
- * The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such
- * as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).
- *
- * @animations
- * **.enter** - when a new item is added to the list or when an item is revealed after a filter
- *
- * **.leave** - when an item is removed from the list or when an item is filtered out
- *
- * **.move** - when an adjacent item is filtered out causing a reorder or when the item contents are reordered
- *
- * @element ANY
- * @scope
- * @priority 1000
- * @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. These
- *   formats are currently supported:
- *
- *   * `variable in expression` – where variable is the user defined loop variable and `expression`
- *     is a scope expression giving the collection to enumerate.
- *
- *     For example: `album in artist.albums`.
- *
- *   * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,
- *     and `expression` is the scope expression giving the collection to enumerate.
- *
- *     For example: `(name, age) in {'adam':10, 'amalie':12}`.
- *
- *   * `variable in expression track by tracking_expression` – You can also provide an optional tracking expression
- *     which can be used to associate the objects in the collection with the DOM elements. If no tracking expression
- *     is specified, ng-repeat associates elements by identity. It is an error to have
- *     more than one tracking expression value resolve to the same key. (This would mean that two distinct objects are
- *     mapped to the same DOM element, which is not possible.)
- *
- *     Note that the tracking expression must come last, after any filters, and the alias expression.
- *
- *     For example: `item in items` is equivalent to `item in items track by $id(item)`. This implies that the DOM elements
- *     will be associated by item identity in the array.
- *
- *     For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique
- *     `$$hashKey` property to each item in the array. This property is then used as a key to associated DOM elements
- *     with the corresponding item in the array by identity. Moving the same object in array would move the DOM
- *     element in the same way in the DOM.
- *
- *     For example: `item in items track by item.id` is a typical pattern when the items come from the database. In this
- *     case the object identity does not matter. Two objects are considered equivalent as long as their `id`
- *     property is same.
- *
- *     For example: `item in items | filter:searchText track by item.id` is a pattern that might be used to apply a filter
- *     to items in conjunction with a tracking expression.
- *
- *   * `variable in expression as alias_expression` – You can also provide an optional alias expression which will then store the
- *     intermediate results of the repeater after the filters have been applied. Typically this is used to render a special message
- *     when a filter is active on the repeater, but the filtered result set is empty.
- *
- *     For example: `item in items | filter:x as results` will store the fragment of the repeated items as `results`, but only after
- *     the items have been processed through the filter.
- *
- *     Please note that `as [variable name] is not an operator but rather a part of ngRepeat micro-syntax so it can be used only at the end
- *     (and not as operator, inside an expression).
- *
- *     For example: `item in items | filter : x | orderBy : order | limitTo : limit as results` .
- *
- * @example
- * This example initializes the scope to a list of names and
- * then uses `ngRepeat` to display every person:
-  <example module="ngAnimate" deps="angular-animate.js" animations="true">
-    <file name="index.html">
-      <div ng-init="friends = [
-        {name:'John', age:25, gender:'boy'},
-        {name:'Jessie', age:30, gender:'girl'},
-        {name:'Johanna', age:28, gender:'girl'},
-        {name:'Joy', age:15, gender:'girl'},
-        {name:'Mary', age:28, gender:'girl'},
-        {name:'Peter', age:95, gender:'boy'},
-        {name:'Sebastian', age:50, gender:'boy'},
-        {name:'Erika', age:27, gender:'girl'},
-        {name:'Patrick', age:40, gender:'boy'},
-        {name:'Samantha', age:60, gender:'girl'}
-      ]">
-        I have {{friends.length}} friends. They are:
-        <input type="search" ng-model="q" placeholder="filter friends..." aria-label="filter friends" />
-        <ul class="example-animate-container">
-          <li class="animate-repeat" ng-repeat="friend in friends | filter:q as results">
-            [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.
-          </li>
-          <li class="animate-repeat" ng-if="results.length == 0">
-            <strong>No results found...</strong>
-          </li>
-        </ul>
-      </div>
-    </file>
-    <file name="animations.css">
-      .example-animate-container {
-        background:white;
-        border:1px solid black;
-        list-style:none;
-        margin:0;
-        padding:0 10px;
-      }
-
-      .animate-repeat {
-        line-height:40px;
-        list-style:none;
-        box-sizing:border-box;
-      }
-
-      .animate-repeat.ng-move,
-      .animate-repeat.ng-enter,
-      .animate-repeat.ng-leave {
-        transition:all linear 0.5s;
-      }
-
-      .animate-repeat.ng-leave.ng-leave-active,
-      .animate-repeat.ng-move,
-      .animate-repeat.ng-enter {
-        opacity:0;
-        max-height:0;
-      }
-
-      .animate-repeat.ng-leave,
-      .animate-repeat.ng-move.ng-move-active,
-      .animate-repeat.ng-enter.ng-enter-active {
-        opacity:1;
-        max-height:40px;
-      }
-    </file>
-    <file name="protractor.js" type="protractor">
-      var friends = element.all(by.repeater('friend in friends'));
-
-      it('should render initial data set', function() {
-        expect(friends.count()).toBe(10);
-        expect(friends.get(0).getText()).toEqual('[1] John who is 25 years old.');
-        expect(friends.get(1).getText()).toEqual('[2] Jessie who is 30 years old.');
-        expect(friends.last().getText()).toEqual('[10] Samantha who is 60 years old.');
-        expect(element(by.binding('friends.length')).getText())
-            .toMatch("I have 10 friends. They are:");
-      });
-
-       it('should update repeater when filter predicate changes', function() {
-         expect(friends.count()).toBe(10);
-
-         element(by.model('q')).sendKeys('ma');
-
-         expect(friends.count()).toBe(2);
-         expect(friends.get(0).getText()).toEqual('[1] Mary who is 28 years old.');
-         expect(friends.last().getText()).toEqual('[2] Samantha who is 60 years old.');
-       });
-      </file>
-    </example>
- */
-var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
-  var NG_REMOVED = '$$NG_REMOVED';
-  var ngRepeatMinErr = minErr('ngRepeat');
-
-  var updateScope = function(scope, index, valueIdentifier, value, keyIdentifier, key, arrayLength) {
-    // TODO(perf): generate setters to shave off ~40ms or 1-1.5%
-    scope[valueIdentifier] = value;
-    if (keyIdentifier) scope[keyIdentifier] = key;
-    scope.$index = index;
-    scope.$first = (index === 0);
-    scope.$last = (index === (arrayLength - 1));
-    scope.$middle = !(scope.$first || scope.$last);
-    // jshint bitwise: false
-    scope.$odd = !(scope.$even = (index&1) === 0);
-    // jshint bitwise: true
-  };
-
-  var getBlockStart = function(block) {
-    return block.clone[0];
-  };
-
-  var getBlockEnd = function(block) {
-    return block.clone[block.clone.length - 1];
-  };
-
-
-  return {
-    restrict: 'A',
-    multiElement: true,
-    transclude: 'element',
-    priority: 1000,
-    terminal: true,
-    $$tlb: true,
-    compile: function ngRepeatCompile($element, $attr) {
-      var expression = $attr.ngRepeat;
-      var ngRepeatEndComment = document.createComment(' end ngRepeat: ' + expression + ' ');
-
-      var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
-
-      if (!match) {
-        throw ngRepeatMinErr('iexp', "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",
-            expression);
-      }
-
-      var lhs = match[1];
-      var rhs = match[2];
-      var aliasAs = match[3];
-      var trackByExp = match[4];
-
-      match = lhs.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);
-
-      if (!match) {
-        throw ngRepeatMinErr('iidexp', "'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",
-            lhs);
-      }
-      var valueIdentifier = match[3] || match[1];
-      var keyIdentifier = match[2];
-
-      if (aliasAs && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs) ||
-          /^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(aliasAs))) {
-        throw ngRepeatMinErr('badident', "alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",
-          aliasAs);
-      }
-
-      var trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn;
-      var hashFnLocals = {$id: hashKey};
-
-      if (trackByExp) {
-        trackByExpGetter = $parse(trackByExp);
-      } else {
-        trackByIdArrayFn = function(key, value) {
-          return hashKey(value);
-        };
-        trackByIdObjFn = function(key) {
-          return key;
-        };
-      }
-
-      return function ngRepeatLink($scope, $element, $attr, ctrl, $transclude) {
-
-        if (trackByExpGetter) {
-          trackByIdExpFn = function(key, value, index) {
-            // assign key, value, and $index to the locals so that they can be used in hash functions
-            if (keyIdentifier) hashFnLocals[keyIdentifier] = key;
-            hashFnLocals[valueIdentifier] = value;
-            hashFnLocals.$index = index;
-            return trackByExpGetter($scope, hashFnLocals);
-          };
-        }
-
-        // Store a list of elements from previous run. This is a hash where key is the item from the
-        // iterator, and the value is objects with following properties.
-        //   - scope: bound scope
-        //   - element: previous element.
-        //   - index: position
-        //
-        // We are using no-proto object so that we don't need to guard against inherited props via
-        // hasOwnProperty.
-        var lastBlockMap = createMap();
-
-        //watch props
-        $scope.$watchCollection(rhs, function ngRepeatAction(collection) {
-          var index, length,
-              previousNode = $element[0],     // node that cloned nodes should be inserted after
-                                              // initialized to the comment node anchor
-              nextNode,
-              // Same as lastBlockMap but it has the current state. It will become the
-              // lastBlockMap on the next iteration.
-              nextBlockMap = createMap(),
-              collectionLength,
-              key, value, // key/value of iteration
-              trackById,
-              trackByIdFn,
-              collectionKeys,
-              block,       // last object information {scope, element, id}
-              nextBlockOrder,
-              elementsToRemove;
-
-          if (aliasAs) {
-            $scope[aliasAs] = collection;
-          }
-
-          if (isArrayLike(collection)) {
-            collectionKeys = collection;
-            trackByIdFn = trackByIdExpFn || trackByIdArrayFn;
-          } else {
-            trackByIdFn = trackByIdExpFn || trackByIdObjFn;
-            // if object, extract keys, in enumeration order, unsorted
-            collectionKeys = [];
-            for (var itemKey in collection) {
-              if (hasOwnProperty.call(collection, itemKey) && itemKey.charAt(0) !== '$') {
-                collectionKeys.push(itemKey);
-              }
-            }
-          }
-
-          collectionLength = collectionKeys.length;
-          nextBlockOrder = new Array(collectionLength);
-
-          // locate existing items
-          for (index = 0; index < collectionLength; index++) {
-            key = (collection === collectionKeys) ? index : collectionKeys[index];
-            value = collection[key];
-            trackById = trackByIdFn(key, value, index);
-            if (lastBlockMap[trackById]) {
-              // found previously seen block
-              block = lastBlockMap[trackById];
-              delete lastBlockMap[trackById];
-              nextBlockMap[trackById] = block;
-              nextBlockOrder[index] = block;
-            } else if (nextBlockMap[trackById]) {
-              // if collision detected. restore lastBlockMap and throw an error
-              forEach(nextBlockOrder, function(block) {
-                if (block && block.scope) lastBlockMap[block.id] = block;
-              });
-              throw ngRepeatMinErr('dupes',
-                  "Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",
-                  expression, trackById, value);
-            } else {
-              // new never before seen block
-              nextBlockOrder[index] = {id: trackById, scope: undefined, clone: undefined};
-              nextBlockMap[trackById] = true;
-            }
-          }
-
-          // remove leftover items
-          for (var blockKey in lastBlockMap) {
-            block = lastBlockMap[blockKey];
-            elementsToRemove = getBlockNodes(block.clone);
-            $animate.leave(elementsToRemove);
-            if (elementsToRemove[0].parentNode) {
-              // if the element was not removed yet because of pending animation, mark it as deleted
-              // so that we can ignore it later
-              for (index = 0, length = elementsToRemove.length; index < length; index++) {
-                elementsToRemove[index][NG_REMOVED] = true;
-              }
-            }
-            block.scope.$destroy();
-          }
-
-          // we are not using forEach for perf reasons (trying to avoid #call)
-          for (index = 0; index < collectionLength; index++) {
-            key = (collection === collectionKeys) ? index : collectionKeys[index];
-            value = collection[key];
-            block = nextBlockOrder[index];
-
-            if (block.scope) {
-              // if we have already seen this object, then we need to reuse the
-              // associated scope/element
-
-              nextNode = previousNode;
-
-              // skip nodes that are already pending removal via leave animation
-              do {
-                nextNode = nextNode.nextSibling;
-              } while (nextNode && nextNode[NG_REMOVED]);
-
-              if (getBlockStart(block) != nextNode) {
-                // existing item which got moved
-                $animate.move(getBlockNodes(block.clone), null, jqLite(previousNode));
-              }
-              previousNode = getBlockEnd(block);
-              updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);
-            } else {
-              // new item which we don't know about
-              $transclude(function ngRepeatTransclude(clone, scope) {
-                block.scope = scope;
-                // http://jsperf.com/clone-vs-createcomment
-                var endNode = ngRepeatEndComment.cloneNode(false);
-                clone[clone.length++] = endNode;
-
-                // TODO(perf): support naked previousNode in `enter` to avoid creation of jqLite wrapper?
-                $animate.enter(clone, null, jqLite(previousNode));
-                previousNode = endNode;
-                // Note: We only need the first/last node of the cloned nodes.
-                // However, we need to keep the reference to the jqlite wrapper as it might be changed later
-                // by a directive with templateUrl when its template arrives.
-                block.clone = clone;
-                nextBlockMap[block.id] = block;
-                updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);
-              });
-            }
-          }
-          lastBlockMap = nextBlockMap;
-        });
-      };
-    }
-  };
-}];
-
-var NG_HIDE_CLASS = 'ng-hide';
-var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';
-/**
- * @ngdoc directive
- * @name ngShow
- * @multiElement
- *
- * @description
- * The `ngShow` directive shows or hides the given HTML element based on the expression
- * provided to the `ngShow` attribute. The element is shown or hidden by removing or adding
- * the `.ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined
- * in AngularJS and sets the display style to none (using an !important flag).
- * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).
- *
- * ```html
- * <!-- when $scope.myValue is truthy (element is visible) -->
- * <div ng-show="myValue"></div>
- *
- * <!-- when $scope.myValue is falsy (element is hidden) -->
- * <div ng-show="myValue" class="ng-hide"></div>
- * ```
- *
- * When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added to the class
- * attribute on the element causing it to become hidden. When truthy, the `.ng-hide` CSS class is removed
- * from the element causing the element not to appear hidden.
- *
- * ## Why is !important used?
- *
- * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector
- * can be easily overridden by heavier selectors. For example, something as simple
- * as changing the display style on a HTML list item would make hidden elements appear visible.
- * This also becomes a bigger issue when dealing with CSS frameworks.
- *
- * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector
- * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the
- * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.
- *
- * ### Overriding `.ng-hide`
- *
- * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change
- * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`
- * class CSS. Note that the selector that needs to be used is actually `.ng-hide:not(.ng-hide-animate)` to cope
- * with extra animation classes that can be added.
- *
- * ```css
- * .ng-hide:not(.ng-hide-animate) {
- *   /&#42; this is just another form of hiding an element &#42;/
- *   display: block!important;
- *   position: absolute;
- *   top: -9999px;
- *   left: -9999px;
- * }
- * ```
- *
- * By default you don't need to override in CSS anything and the animations will work around the display style.
- *
- * ## A note about animations with `ngShow`
- *
- * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression
- * is true and false. This system works like the animation system present with ngClass except that
- * you must also include the !important flag to override the display property
- * so that you can perform an animation when the element is hidden during the time of the animation.
- *
- * ```css
- * //
- * //a working example can be found at the bottom of this page
- * //
- * .my-element.ng-hide-add, .my-element.ng-hide-remove {
- *   /&#42; this is required as of 1.3x to properly
- *      apply all styling in a show/hide animation &#42;/
- *   transition: 0s linear all;
- * }
- *
- * .my-element.ng-hide-add-active,
- * .my-element.ng-hide-remove-active {
- *   /&#42; the transition is defined in the active class &#42;/
- *   transition: 1s linear all;
- * }
- *
- * .my-element.ng-hide-add { ... }
- * .my-element.ng-hide-add.ng-hide-add-active { ... }
- * .my-element.ng-hide-remove { ... }
- * .my-element.ng-hide-remove.ng-hide-remove-active { ... }
- * ```
- *
- * Keep in mind that, as of AngularJS version 1.3.0-beta.11, there is no need to change the display
- * property to block during animation states--ngAnimate will handle the style toggling automatically for you.
- *
- * @animations
- * addClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a truthy value and the just before contents are set to visible
- * removeClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden
- *
- * @element ANY
- * @param {expression} ngShow If the {@link guide/expression expression} is truthy
- *     then the element is shown or hidden respectively.
- *
- * @example
-  <example module="ngAnimate" deps="angular-animate.js" animations="true">
-    <file name="index.html">
-      Click me: <input type="checkbox" ng-model="checked" aria-label="Toggle ngHide"><br/>
-      <div>
-        Show:
-        <div class="check-element animate-show" ng-show="checked">
-          <span class="glyphicon glyphicon-thumbs-up"></span> I show up when your checkbox is checked.
-        </div>
-      </div>
-      <div>
-        Hide:
-        <div class="check-element animate-show" ng-hide="checked">
-          <span class="glyphicon glyphicon-thumbs-down"></span> I hide when your checkbox is checked.
-        </div>
-      </div>
-    </file>
-    <file name="glyphicons.css">
-      @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);
-    </file>
-    <file name="animations.css">
-      .animate-show {
-        line-height: 20px;
-        opacity: 1;
-        padding: 10px;
-        border: 1px solid black;
-        background: white;
-      }
-
-      .animate-show.ng-hide-add, .animate-show.ng-hide-remove {
-        transition: all linear 0.5s;
-      }
-
-      .animate-show.ng-hide {
-        line-height: 0;
-        opacity: 0;
-        padding: 0 10px;
-      }
-
-      .check-element {
-        padding: 10px;
-        border: 1px solid black;
-        background: white;
-      }
-    </file>
-    <file name="protractor.js" type="protractor">
-      var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));
-      var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));
-
-      it('should check ng-show / ng-hide', function() {
-        expect(thumbsUp.isDisplayed()).toBeFalsy();
-        expect(thumbsDown.isDisplayed()).toBeTruthy();
-
-        element(by.model('checked')).click();
-
-        expect(thumbsUp.isDisplayed()).toBeTruthy();
-        expect(thumbsDown.isDisplayed()).toBeFalsy();
-      });
-    </file>
-  </example>
- */
-var ngShowDirective = ['$animate', function($animate) {
-  return {
-    restrict: 'A',
-    multiElement: true,
-    link: function(scope, element, attr) {
-      scope.$watch(attr.ngShow, function ngShowWatchAction(value) {
-        // we're adding a temporary, animation-specific class for ng-hide since this way
-        // we can control when the element is actually displayed on screen without having
-        // to have a global/greedy CSS selector that breaks when other animations are run.
-        // Read: https://github.com/angular/angular.js/issues/9103#issuecomment-58335845
-        $animate[value ? 'removeClass' : 'addClass'](element, NG_HIDE_CLASS, {
-          tempClasses: NG_HIDE_IN_PROGRESS_CLASS
-        });
-      });
-    }
-  };
-}];
-
-
-/**
- * @ngdoc directive
- * @name ngHide
- * @multiElement
- *
- * @description
- * The `ngHide` directive shows or hides the given HTML element based on the expression
- * provided to the `ngHide` attribute. The element is shown or hidden by removing or adding
- * the `ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined
- * in AngularJS and sets the display style to none (using an !important flag).
- * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).
- *
- * ```html
- * <!-- when $scope.myValue is truthy (element is hidden) -->
- * <div ng-hide="myValue" class="ng-hide"></div>
- *
- * <!-- when $scope.myValue is falsy (element is visible) -->
- * <div ng-hide="myValue"></div>
- * ```
- *
- * When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added to the class
- * attribute on the element causing it to become hidden. When falsy, the `.ng-hide` CSS class is removed
- * from the element causing the element not to appear hidden.
- *
- * ## Why is !important used?
- *
- * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector
- * can be easily overridden by heavier selectors. For example, something as simple
- * as changing the display style on a HTML list item would make hidden elements appear visible.
- * This also becomes a bigger issue when dealing with CSS frameworks.
- *
- * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector
- * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the
- * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.
- *
- * ### Overriding `.ng-hide`
- *
- * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change
- * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`
- * class in CSS:
- *
- * ```css
- * .ng-hide {
- *   /&#42; this is just another form of hiding an element &#42;/
- *   display: block!important;
- *   position: absolute;
- *   top: -9999px;
- *   left: -9999px;
- * }
- * ```
- *
- * By default you don't need to override in CSS anything and the animations will work around the display style.
- *
- * ## A note about animations with `ngHide`
- *
- * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression
- * is true and false. This system works like the animation system present with ngClass, except that the `.ng-hide`
- * CSS class is added and removed for you instead of your own CSS class.
- *
- * ```css
- * //
- * //a working example can be found at the bottom of this page
- * //
- * .my-element.ng-hide-add, .my-element.ng-hide-remove {
- *   transition: 0.5s linear all;
- * }
- *
- * .my-element.ng-hide-add { ... }
- * .my-element.ng-hide-add.ng-hide-add-active { ... }
- * .my-element.ng-hide-remove { ... }
- * .my-element.ng-hide-remove.ng-hide-remove-active { ... }
- * ```
- *
- * Keep in mind that, as of AngularJS version 1.3.0-beta.11, there is no need to change the display
- * property to block during animation states--ngAnimate will handle the style toggling automatically for you.
- *
- * @animations
- * removeClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden
- * addClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a non truthy value and just before the contents are set to visible
- *
- * @element ANY
- * @param {expression} ngHide If the {@link guide/expression expression} is truthy then
- *     the element is shown or hidden respectively.
- *
- * @example
-  <example module="ngAnimate" deps="angular-animate.js" animations="true">
-    <file name="index.html">
-      Click me: <input type="checkbox" ng-model="checked" aria-label="Toggle ngShow"><br/>
-      <div>
-        Show:
-        <div class="check-element animate-hide" ng-show="checked">
-          <span class="glyphicon glyphicon-thumbs-up"></span> I show up when your checkbox is checked.
-        </div>
-      </div>
-      <div>
-        Hide:
-        <div class="check-element animate-hide" ng-hide="checked">
-          <span class="glyphicon glyphicon-thumbs-down"></span> I hide when your checkbox is checked.
-        </div>
-      </div>
-    </file>
-    <file name="glyphicons.css">
-      @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);
-    </file>
-    <file name="animations.css">
-      .animate-hide {
-        transition: all linear 0.5s;
-        line-height: 20px;
-        opacity: 1;
-        padding: 10px;
-        border: 1px solid black;
-        background: white;
-      }
-
-      .animate-hide.ng-hide {
-        line-height: 0;
-        opacity: 0;
-        padding: 0 10px;
-      }
-
-      .check-element {
-        padding: 10px;
-        border: 1px solid black;
-        background: white;
-      }
-    </file>
-    <file name="protractor.js" type="protractor">
-      var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));
-      var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));
-
-      it('should check ng-show / ng-hide', function() {
-        expect(thumbsUp.isDisplayed()).toBeFalsy();
-        expect(thumbsDown.isDisplayed()).toBeTruthy();
-
-        element(by.model('checked')).click();
-
-        expect(thumbsUp.isDisplayed()).toBeTruthy();
-        expect(thumbsDown.isDisplayed()).toBeFalsy();
-      });
-    </file>
-  </example>
- */
-var ngHideDirective = ['$animate', function($animate) {
-  return {
-    restrict: 'A',
-    multiElement: true,
-    link: function(scope, element, attr) {
-      scope.$watch(attr.ngHide, function ngHideWatchAction(value) {
-        // The comment inside of the ngShowDirective explains why we add and
-        // remove a temporary class for the show/hide animation
-        $animate[value ? 'addClass' : 'removeClass'](element,NG_HIDE_CLASS, {
-          tempClasses: NG_HIDE_IN_PROGRESS_CLASS
-        });
-      });
-    }
-  };
-}];
-
-/**
- * @ngdoc directive
- * @name ngStyle
- * @restrict AC
- *
- * @description
- * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally.
- *
- * @element ANY
- * @param {expression} ngStyle
- *
- * {@link guide/expression Expression} which evals to an
- * object whose keys are CSS style names and values are corresponding values for those CSS
- * keys.
- *
- * Since some CSS style names are not valid keys for an object, they must be quoted.
- * See the 'background-color' style in the example below.
- *
- * @example
-   <example>
-     <file name="index.html">
-        <input type="button" value="set color" ng-click="myStyle={color:'red'}">
-        <input type="button" value="set background" ng-click="myStyle={'background-color':'blue'}">
-        <input type="button" value="clear" ng-click="myStyle={}">
-        <br/>
-        <span ng-style="myStyle">Sample Text</span>
-        <pre>myStyle={{myStyle}}</pre>
-     </file>
-     <file name="style.css">
-       span {
-         color: black;
-       }
-     </file>
-     <file name="protractor.js" type="protractor">
-       var colorSpan = element(by.css('span'));
-
-       it('should check ng-style', function() {
-         expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');
-         element(by.css('input[value=\'set color\']')).click();
-         expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)');
-         element(by.css('input[value=clear]')).click();
-         expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');
-       });
-     </file>
-   </example>
- */
-var ngStyleDirective = ngDirective(function(scope, element, attr) {
-  scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) {
-    if (oldStyles && (newStyles !== oldStyles)) {
-      forEach(oldStyles, function(val, style) { element.css(style, '');});
-    }
-    if (newStyles) element.css(newStyles);
-  }, true);
-});
-
-/**
- * @ngdoc directive
- * @name ngSwitch
- * @restrict EA
- *
- * @description
- * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression.
- * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location
- * as specified in the template.
- *
- * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it
- * from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element
- * matches the value obtained from the evaluated expression. In other words, you define a container element
- * (where you place the directive), place an expression on the **`on="..."` attribute**
- * (or the **`ng-switch="..."` attribute**), define any inner elements inside of the directive and place
- * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on
- * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default
- * attribute is displayed.
- *
- * <div class="alert alert-info">
- * Be aware that the attribute values to match against cannot be expressions. They are interpreted
- * as literal string values to match against.
- * For example, **`ng-switch-when="someVal"`** will match against the string `"someVal"` not against the
- * value of the expression `$scope.someVal`.
- * </div>
-
- * @animations
- * enter - happens after the ngSwitch contents change and the matched child element is placed inside the container
- * leave - happens just after the ngSwitch contents change and just before the former contents are removed from the DOM
- *
- * @usage
- *
- * ```
- * <ANY ng-switch="expression">
- *   <ANY ng-switch-when="matchValue1">...</ANY>
- *   <ANY ng-switch-when="matchValue2">...</ANY>
- *   <ANY ng-switch-default>...</ANY>
- * </ANY>
- * ```
- *
- *
- * @scope
- * @priority 1200
- * @param {*} ngSwitch|on expression to match against <code>ng-switch-when</code>.
- * On child elements add:
- *
- * * `ngSwitchWhen`: the case statement to match against. If match then this
- *   case will be displayed. If the same match appears multiple times, all the
- *   elements will be displayed.
- * * `ngSwitchDefault`: the default case when no other case match. If there
- *   are multiple default cases, all of them will be displayed when no other
- *   case match.
- *
- *
- * @example
-  <example module="switchExample" deps="angular-animate.js" animations="true">
-    <file name="index.html">
-      <div ng-controller="ExampleController">
-        <select ng-model="selection" ng-options="item for item in items">
-        </select>
-        <code>selection={{selection}}</code>
-        <hr/>
-        <div class="animate-switch-container"
-          ng-switch on="selection">
-            <div class="animate-switch" ng-switch-when="settings">Settings Div</div>
-            <div class="animate-switch" ng-switch-when="home">Home Span</div>
-            <div class="animate-switch" ng-switch-default>default</div>
-        </div>
-      </div>
-    </file>
-    <file name="script.js">
-      angular.module('switchExample', ['ngAnimate'])
-        .controller('ExampleController', ['$scope', function($scope) {
-          $scope.items = ['settings', 'home', 'other'];
-          $scope.selection = $scope.items[0];
-        }]);
-    </file>
-    <file name="animations.css">
-      .animate-switch-container {
-        position:relative;
-        background:white;
-        border:1px solid black;
-        height:40px;
-        overflow:hidden;
-      }
-
-      .animate-switch {
-        padding:10px;
-      }
-
-      .animate-switch.ng-animate {
-        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
-
-        position:absolute;
-        top:0;
-        left:0;
-        right:0;
-        bottom:0;
-      }
-
-      .animate-switch.ng-leave.ng-leave-active,
-      .animate-switch.ng-enter {
-        top:-50px;
-      }
-      .animate-switch.ng-leave,
-      .animate-switch.ng-enter.ng-enter-active {
-        top:0;
-      }
-    </file>
-    <file name="protractor.js" type="protractor">
-      var switchElem = element(by.css('[ng-switch]'));
-      var select = element(by.model('selection'));
-
-      it('should start in settings', function() {
-        expect(switchElem.getText()).toMatch(/Settings Div/);
-      });
-      it('should change to home', function() {
-        select.all(by.css('option')).get(1).click();
-        expect(switchElem.getText()).toMatch(/Home Span/);
-      });
-      it('should select default', function() {
-        select.all(by.css('option')).get(2).click();
-        expect(switchElem.getText()).toMatch(/default/);
-      });
-    </file>
-  </example>
- */
-var ngSwitchDirective = ['$animate', function($animate) {
-  return {
-    require: 'ngSwitch',
-
-    // asks for $scope to fool the BC controller module
-    controller: ['$scope', function ngSwitchController() {
-     this.cases = {};
-    }],
-    link: function(scope, element, attr, ngSwitchController) {
-      var watchExpr = attr.ngSwitch || attr.on,
-          selectedTranscludes = [],
-          selectedElements = [],
-          previousLeaveAnimations = [],
-          selectedScopes = [];
-
-      var spliceFactory = function(array, index) {
-          return function() { array.splice(index, 1); };
-      };
-
-      scope.$watch(watchExpr, function ngSwitchWatchAction(value) {
-        var i, ii;
-        for (i = 0, ii = previousLeaveAnimations.length; i < ii; ++i) {
-          $animate.cancel(previousLeaveAnimations[i]);
-        }
-        previousLeaveAnimations.length = 0;
-
-        for (i = 0, ii = selectedScopes.length; i < ii; ++i) {
-          var selected = getBlockNodes(selectedElements[i].clone);
-          selectedScopes[i].$destroy();
-          var promise = previousLeaveAnimations[i] = $animate.leave(selected);
-          promise.then(spliceFactory(previousLeaveAnimations, i));
-        }
-
-        selectedElements.length = 0;
-        selectedScopes.length = 0;
-
-        if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {
-          forEach(selectedTranscludes, function(selectedTransclude) {
-            selectedTransclude.transclude(function(caseElement, selectedScope) {
-              selectedScopes.push(selectedScope);
-              var anchor = selectedTransclude.element;
-              caseElement[caseElement.length++] = document.createComment(' end ngSwitchWhen: ');
-              var block = { clone: caseElement };
-
-              selectedElements.push(block);
-              $animate.enter(caseElement, anchor.parent(), anchor);
-            });
-          });
-        }
-      });
-    }
-  };
-}];
-
-var ngSwitchWhenDirective = ngDirective({
-  transclude: 'element',
-  priority: 1200,
-  require: '^ngSwitch',
-  multiElement: true,
-  link: function(scope, element, attrs, ctrl, $transclude) {
-    ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);
-    ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });
-  }
-});
-
-var ngSwitchDefaultDirective = ngDirective({
-  transclude: 'element',
-  priority: 1200,
-  require: '^ngSwitch',
-  multiElement: true,
-  link: function(scope, element, attr, ctrl, $transclude) {
-    ctrl.cases['?'] = (ctrl.cases['?'] || []);
-    ctrl.cases['?'].push({ transclude: $transclude, element: element });
-   }
-});
-
-/**
- * @ngdoc directive
- * @name ngTransclude
- * @restrict EAC
- *
- * @description
- * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.
- *
- * Any existing content of the element that this directive is placed on will be removed before the transcluded content is inserted.
- *
- * @element ANY
- *
- * @example
-   <example module="transcludeExample">
-     <file name="index.html">
-       <script>
-         angular.module('transcludeExample', [])
-          .directive('pane', function(){
-             return {
-               restrict: 'E',
-               transclude: true,
-               scope: { title:'@' },
-               template: '<div style="border: 1px solid black;">' +
-                           '<div style="background-color: gray">{{title}}</div>' +
-                           '<ng-transclude></ng-transclude>' +
-                         '</div>'
-             };
-         })
-         .controller('ExampleController', ['$scope', function($scope) {
-           $scope.title = 'Lorem Ipsum';
-           $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';
-         }]);
-       </script>
-       <div ng-controller="ExampleController">
-         <input ng-model="title" aria-label="title"> <br/>
-         <textarea ng-model="text" aria-label="text"></textarea> <br/>
-         <pane title="{{title}}">{{text}}</pane>
-       </div>
-     </file>
-     <file name="protractor.js" type="protractor">
-        it('should have transcluded', function() {
-          var titleElement = element(by.model('title'));
-          titleElement.clear();
-          titleElement.sendKeys('TITLE');
-          var textElement = element(by.model('text'));
-          textElement.clear();
-          textElement.sendKeys('TEXT');
-          expect(element(by.binding('title')).getText()).toEqual('TITLE');
-          expect(element(by.binding('text')).getText()).toEqual('TEXT');
-        });
-     </file>
-   </example>
- *
- */
-var ngTranscludeDirective = ngDirective({
-  restrict: 'EAC',
-  link: function($scope, $element, $attrs, controller, $transclude) {
-    if (!$transclude) {
-      throw minErr('ngTransclude')('orphan',
-       'Illegal use of ngTransclude directive in the template! ' +
-       'No parent directive that requires a transclusion found. ' +
-       'Element: {0}',
-       startingTag($element));
-    }
-
-    $transclude(function(clone) {
-      $element.empty();
-      $element.append(clone);
-    });
-  }
-});
-
-/**
- * @ngdoc directive
- * @name script
- * @restrict E
- *
- * @description
- * Load the content of a `<script>` element into {@link ng.$templateCache `$templateCache`}, so that the
- * template can be used by {@link ng.directive:ngInclude `ngInclude`},
- * {@link ngRoute.directive:ngView `ngView`}, or {@link guide/directive directives}. The type of the
- * `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be
- * assigned through the element's `id`, which can then be used as a directive's `templateUrl`.
- *
- * @param {string} type Must be set to `'text/ng-template'`.
- * @param {string} id Cache name of the template.
- *
- * @example
-  <example>
-    <file name="index.html">
-      <script type="text/ng-template" id="/tpl.html">
-        Content of the template.
-      </script>
-
-      <a ng-click="currentTpl='/tpl.html'" id="tpl-link">Load inlined template</a>
-      <div id="tpl-content" ng-include src="currentTpl"></div>
-    </file>
-    <file name="protractor.js" type="protractor">
-      it('should load template defined inside script tag', function() {
-        element(by.css('#tpl-link')).click();
-        expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/);
-      });
-    </file>
-  </example>
- */
-var scriptDirective = ['$templateCache', function($templateCache) {
-  return {
-    restrict: 'E',
-    terminal: true,
-    compile: function(element, attr) {
-      if (attr.type == 'text/ng-template') {
-        var templateUrl = attr.id,
-            text = element[0].text;
-
-        $templateCache.put(templateUrl, text);
-      }
-    }
-  };
-}];
-
-var noopNgModelController = { $setViewValue: noop, $render: noop };
-
-/**
- * @ngdoc type
- * @name  select.SelectController
- * @description
- * The controller for the `<select>` directive. This provides support for reading
- * and writing the selected value(s) of the control and also coordinates dynamically
- * added `<option>` elements, perhaps by an `ngRepeat` directive.
- */
-var SelectController =
-        ['$element', '$scope', '$attrs', function($element, $scope, $attrs) {
-
-  var self = this,
-      optionsMap = new HashMap();
-
-  // If the ngModel doesn't get provided then provide a dummy noop version to prevent errors
-  self.ngModelCtrl = noopNgModelController;
-
-  // The "unknown" option is one that is prepended to the list if the viewValue
-  // does not match any of the options. When it is rendered the value of the unknown
-  // option is '? XXX ?' where XXX is the hashKey of the value that is not known.
-  //
-  // We can't just jqLite('<option>') since jqLite is not smart enough
-  // to create it in <select> and IE barfs otherwise.
-  self.unknownOption = jqLite(document.createElement('option'));
-  self.renderUnknownOption = function(val) {
-    var unknownVal = '? ' + hashKey(val) + ' ?';
-    self.unknownOption.val(unknownVal);
-    $element.prepend(self.unknownOption);
-    $element.val(unknownVal);
-  };
-
-  $scope.$on('$destroy', function() {
-    // disable unknown option so that we don't do work when the whole select is being destroyed
-    self.renderUnknownOption = noop;
-  });
-
-  self.removeUnknownOption = function() {
-    if (self.unknownOption.parent()) self.unknownOption.remove();
-  };
-
-
-  // Read the value of the select control, the implementation of this changes depending
-  // upon whether the select can have multiple values and whether ngOptions is at work.
-  self.readValue = function readSingleValue() {
-    self.removeUnknownOption();
-    return $element.val();
-  };
-
-
-  // Write the value to the select control, the implementation of this changes depending
-  // upon whether the select can have multiple values and whether ngOptions is at work.
-  self.writeValue = function writeSingleValue(value) {
-    if (self.hasOption(value)) {
-      self.removeUnknownOption();
-      $element.val(value);
-      if (value === '') self.emptyOption.prop('selected', true); // to make IE9 happy
-    } else {
-      if (value == null && self.emptyOption) {
-        self.removeUnknownOption();
-        $element.val('');
-      } else {
-        self.renderUnknownOption(value);
-      }
-    }
-  };
-
-
-  // Tell the select control that an option, with the given value, has been added
-  self.addOption = function(value, element) {
-    assertNotHasOwnProperty(value, '"option value"');
-    if (value === '') {
-      self.emptyOption = element;
-    }
-    var count = optionsMap.get(value) || 0;
-    optionsMap.put(value, count + 1);
-  };
-
-  // Tell the select control that an option, with the given value, has been removed
-  self.removeOption = function(value) {
-    var count = optionsMap.get(value);
-    if (count) {
-      if (count === 1) {
-        optionsMap.remove(value);
-        if (value === '') {
-          self.emptyOption = undefined;
-        }
-      } else {
-        optionsMap.put(value, count - 1);
-      }
-    }
-  };
-
-  // Check whether the select control has an option matching the given value
-  self.hasOption = function(value) {
-    return !!optionsMap.get(value);
-  };
-}];
-
-/**
- * @ngdoc directive
- * @name select
- * @restrict E
- *
- * @description
- * HTML `SELECT` element with angular data-binding.
- *
- * The `select` directive is used together with {@link ngModel `ngModel`} to provide data-binding
- * between the scope and the `<select>` control (including setting default values).
- * Ìt also handles dynamic `<option>` elements, which can be added using the {@link ngRepeat `ngRepeat}` or
- * {@link ngOptions `ngOptions`} directives.
- *
- * When an item in the `<select>` menu is selected, the value of the selected option will be bound
- * to the model identified by the `ngModel` directive. With static or repeated options, this is
- * the content of the `value` attribute or the textContent of the `<option>`, if the value attribute is missing.
- * If you want dynamic value attributes, you can use interpolation inside the value attribute.
- *
- * <div class="alert alert-warning">
- * Note that the value of a `select` directive used without `ngOptions` is always a string.
- * When the model needs to be bound to a non-string value, you must either explictly convert it
- * using a directive (see example below) or use `ngOptions` to specify the set of options.
- * This is because an option element can only be bound to string values at present.
- * </div>
- *
- * If the viewValue of `ngModel` does not match any of the options, then the control
- * will automatically add an "unknown" option, which it then removes when the mismatch is resolved.
- *
- * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can
- * be nested into the `<select>` element. This element will then represent the `null` or "not selected"
- * option. See example below for demonstration.
- *
- * <div class="alert alert-info">
- * In many cases, `ngRepeat` can be used on `<option>` elements instead of {@link ng.directive:ngOptions
- * ngOptions} to achieve a similar result. However, `ngOptions` provides some benefits, such as
- * more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the
- * comprehension expression, and additionally in reducing memory and increasing speed by not creating
- * a new scope for each repeated instance.
- * </div>
- *
- *
- * @param {string} ngModel Assignable angular expression to data-bind to.
- * @param {string=} name Property name of the form under which the control is published.
- * @param {string=} required Sets `required` validation error key if the value is not entered.
- * @param {string=} ngRequired Adds required attribute and required validation constraint to
- * the element when the ngRequired expression evaluates to true. Use ngRequired instead of required
- * when you want to data-bind to the required attribute.
- * @param {string=} ngChange Angular expression to be executed when selected option(s) changes due to user
- *    interaction with the select element.
- * @param {string=} ngOptions sets the options that the select is populated with and defines what is
- * set on the model on selection. See {@link ngOptions `ngOptions`}.
- *
- * @example
- * ### Simple `select` elements with static options
- *
- * <example name="static-select" module="staticSelect">
- * <file name="index.html">
- * <div ng-controller="ExampleController">
- *   <form name="myForm">
- *     <label for="singleSelect"> Single select: </label><br>
- *     <select name="singleSelect" ng-model="data.singleSelect">
- *       <option value="option-1">Option 1</option>
- *       <option value="option-2">Option 2</option>
- *     </select><br>
- *
- *     <label for="singleSelect"> Single select with "not selected" option and dynamic option values: </label><br>
- *     <select name="singleSelect" id="singleSelect" ng-model="data.singleSelect">
- *       <option value="">---Please select---</option> <!-- not selected / blank option -->
- *       <option value="{{data.option1}}">Option 1</option> <!-- interpolation -->
- *       <option value="option-2">Option 2</option>
- *     </select><br>
- *     <button ng-click="forceUnknownOption()">Force unknown option</button><br>
- *     <tt>singleSelect = {{data.singleSelect}}</tt>
- *
- *     <hr>
- *     <label for="multipleSelect"> Multiple select: </label><br>
- *     <select name="multipleSelect" id="multipleSelect" ng-model="data.multipleSelect" multiple>
- *       <option value="option-1">Option 1</option>
- *       <option value="option-2">Option 2</option>
- *       <option value="option-3">Option 3</option>
- *     </select><br>
- *     <tt>multipleSelect = {{data.multipleSelect}}</tt><br/>
- *   </form>
- * </div>
- * </file>
- * <file name="app.js">
- *  angular.module('staticSelect', [])
- *    .controller('ExampleController', ['$scope', function($scope) {
- *      $scope.data = {
- *       singleSelect: null,
- *       multipleSelect: [],
- *       option1: 'option-1',
- *      };
- *
- *      $scope.forceUnknownOption = function() {
- *        $scope.data.singleSelect = 'nonsense';
- *      };
- *   }]);
- * </file>
- *</example>
- *
- * ### Using `ngRepeat` to generate `select` options
- * <example name="ngrepeat-select" module="ngrepeatSelect">
- * <file name="index.html">
- * <div ng-controller="ExampleController">
- *   <form name="myForm">
- *     <label for="repeatSelect"> Repeat select: </label>
- *     <select name="repeatSelect" id="repeatSelect" ng-model="data.repeatSelect">
- *       <option ng-repeat="option in data.availableOptions" value="{{option.id}}">{{option.name}}</option>
- *     </select>
- *   </form>
- *   <hr>
- *   <tt>repeatSelect = {{data.repeatSelect}}</tt><br/>
- * </div>
- * </file>
- * <file name="app.js">
- *  angular.module('ngrepeatSelect', [])
- *    .controller('ExampleController', ['$scope', function($scope) {
- *      $scope.data = {
- *       repeatSelect: null,
- *       availableOptions: [
- *         {id: '1', name: 'Option A'},
- *         {id: '2', name: 'Option B'},
- *         {id: '3', name: 'Option C'}
- *       ],
- *      };
- *   }]);
- * </file>
- *</example>
- *
- *
- * ### Using `select` with `ngOptions` and setting a default value
- * See the {@link ngOptions ngOptions documentation} for more `ngOptions` usage examples.
- *
- * <example name="select-with-default-values" module="defaultValueSelect">
- * <file name="index.html">
- * <div ng-controller="ExampleController">
- *   <form name="myForm">
- *     <label for="mySelect">Make a choice:</label>
- *     <select name="mySelect" id="mySelect"
- *       ng-options="option.name for option in data.availableOptions track by option.id"
- *       ng-model="data.selectedOption"></select>
- *   </form>
- *   <hr>
- *   <tt>option = {{data.selectedOption}}</tt><br/>
- * </div>
- * </file>
- * <file name="app.js">
- *  angular.module('defaultValueSelect', [])
- *    .controller('ExampleController', ['$scope', function($scope) {
- *      $scope.data = {
- *       availableOptions: [
- *         {id: '1', name: 'Option A'},
- *         {id: '2', name: 'Option B'},
- *         {id: '3', name: 'Option C'}
- *       ],
- *       selectedOption: {id: '3', name: 'Option C'} //This sets the default value of the select in the ui
- *       };
- *   }]);
- * </file>
- *</example>
- *
- *
- * ### Binding `select` to a non-string value via `ngModel` parsing / formatting
- *
- * <example name="select-with-non-string-options" module="nonStringSelect">
- *   <file name="index.html">
- *     <select ng-model="model.id" convert-to-number>
- *       <option value="0">Zero</option>
- *       <option value="1">One</option>
- *       <option value="2">Two</option>
- *     </select>
- *     {{ model }}
- *   </file>
- *   <file name="app.js">
- *     angular.module('nonStringSelect', [])
- *       .run(function($rootScope) {
- *         $rootScope.model = { id: 2 };
- *       })
- *       .directive('convertToNumber', function() {
- *         return {
- *           require: 'ngModel',
- *           link: function(scope, element, attrs, ngModel) {
- *             ngModel.$parsers.push(function(val) {
- *               return parseInt(val, 10);
- *             });
- *             ngModel.$formatters.push(function(val) {
- *               return '' + val;
- *             });
- *           }
- *         };
- *       });
- *   </file>
- *   <file name="protractor.js" type="protractor">
- *     it('should initialize to model', function() {
- *       var select = element(by.css('select'));
- *       expect(element(by.model('model.id')).$('option:checked').getText()).toEqual('Two');
- *     });
- *   </file>
- * </example>
- *
- */
-var selectDirective = function() {
-
-  return {
-    restrict: 'E',
-    require: ['select', '?ngModel'],
-    controller: SelectController,
-    link: function(scope, element, attr, ctrls) {
-
-      // if ngModel is not defined, we don't need to do anything
-      var ngModelCtrl = ctrls[1];
-      if (!ngModelCtrl) return;
-
-      var selectCtrl = ctrls[0];
-
-      selectCtrl.ngModelCtrl = ngModelCtrl;
-
-      // We delegate rendering to the `writeValue` method, which can be changed
-      // if the select can have multiple selected values or if the options are being
-      // generated by `ngOptions`
-      ngModelCtrl.$render = function() {
-        selectCtrl.writeValue(ngModelCtrl.$viewValue);
-      };
-
-      // When the selected item(s) changes we delegate getting the value of the select control
-      // to the `readValue` method, which can be changed if the select can have multiple
-      // selected values or if the options are being generated by `ngOptions`
-      element.on('change', function() {
-        scope.$apply(function() {
-          ngModelCtrl.$setViewValue(selectCtrl.readValue());
-        });
-      });
-
-      // If the select allows multiple values then we need to modify how we read and write
-      // values from and to the control; also what it means for the value to be empty and
-      // we have to add an extra watch since ngModel doesn't work well with arrays - it
-      // doesn't trigger rendering if only an item in the array changes.
-      if (attr.multiple) {
-
-        // Read value now needs to check each option to see if it is selected
-        selectCtrl.readValue = function readMultipleValue() {
-          var array = [];
-          forEach(element.find('option'), function(option) {
-            if (option.selected) {
-              array.push(option.value);
-            }
-          });
-          return array;
-        };
-
-        // Write value now needs to set the selected property of each matching option
-        selectCtrl.writeValue = function writeMultipleValue(value) {
-          var items = new HashMap(value);
-          forEach(element.find('option'), function(option) {
-            option.selected = isDefined(items.get(option.value));
-          });
-        };
-
-        // we have to do it on each watch since ngModel watches reference, but
-        // we need to work of an array, so we need to see if anything was inserted/removed
-        var lastView, lastViewRef = NaN;
-        scope.$watch(function selectMultipleWatch() {
-          if (lastViewRef === ngModelCtrl.$viewValue && !equals(lastView, ngModelCtrl.$viewValue)) {
-            lastView = shallowCopy(ngModelCtrl.$viewValue);
-            ngModelCtrl.$render();
-          }
-          lastViewRef = ngModelCtrl.$viewValue;
-        });
-
-        // If we are a multiple select then value is now a collection
-        // so the meaning of $isEmpty changes
-        ngModelCtrl.$isEmpty = function(value) {
-          return !value || value.length === 0;
-        };
-
-      }
-    }
-  };
-};
-
-
-// The option directive is purely designed to communicate the existence (or lack of)
-// of dynamically created (and destroyed) option elements to their containing select
-// directive via its controller.
-var optionDirective = ['$interpolate', function($interpolate) {
-
-  function chromeHack(optionElement) {
-    // Workaround for https://code.google.com/p/chromium/issues/detail?id=381459
-    // Adding an <option selected="selected"> element to a <select required="required"> should
-    // automatically select the new element
-    if (optionElement[0].hasAttribute('selected')) {
-      optionElement[0].selected = true;
-    }
-  }
-
-  return {
-    restrict: 'E',
-    priority: 100,
-    compile: function(element, attr) {
-
-      if (isDefined(attr.value)) {
-        // If the value attribute is defined, check if it contains an interpolation
-        var valueInterpolated = $interpolate(attr.value, true);
-      } else {
-        // If the value attribute is not defined then we fall back to the
-        // text content of the option element, which may be interpolated
-        var interpolateFn = $interpolate(element.text(), true);
-        if (!interpolateFn) {
-          attr.$set('value', element.text());
-        }
-      }
-
-      return function(scope, element, attr) {
-
-        // This is an optimization over using ^^ since we don't want to have to search
-        // all the way to the root of the DOM for every single option element
-        var selectCtrlName = '$selectController',
-            parent = element.parent(),
-            selectCtrl = parent.data(selectCtrlName) ||
-              parent.parent().data(selectCtrlName); // in case we are in optgroup
-
-        function addOption(optionValue) {
-          selectCtrl.addOption(optionValue, element);
-          selectCtrl.ngModelCtrl.$render();
-          chromeHack(element);
-        }
-
-        // Only update trigger option updates if this is an option within a `select`
-        // that also has `ngModel` attached
-        if (selectCtrl && selectCtrl.ngModelCtrl) {
-
-          if (valueInterpolated) {
-            // The value attribute is interpolated
-            var oldVal;
-            attr.$observe('value', function valueAttributeObserveAction(newVal) {
-              if (isDefined(oldVal)) {
-                selectCtrl.removeOption(oldVal);
-              }
-              oldVal = newVal;
-              addOption(newVal);
-            });
-          } else if (interpolateFn) {
-            // The text content is interpolated
-            scope.$watch(interpolateFn, function interpolateWatchAction(newVal, oldVal) {
-              attr.$set('value', newVal);
-              if (oldVal !== newVal) {
-                selectCtrl.removeOption(oldVal);
-              }
-              addOption(newVal);
-            });
-          } else {
-            // The value attribute is static
-            addOption(attr.value);
-          }
-
-          element.on('$destroy', function() {
-            selectCtrl.removeOption(attr.value);
-            selectCtrl.ngModelCtrl.$render();
-          });
-        }
-      };
-    }
-  };
-}];
-
-var styleDirective = valueFn({
-  restrict: 'E',
-  terminal: false
-});
-
-var requiredDirective = function() {
-  return {
-    restrict: 'A',
-    require: '?ngModel',
-    link: function(scope, elm, attr, ctrl) {
-      if (!ctrl) return;
-      attr.required = true; // force truthy in case we are on non input element
-
-      ctrl.$validators.required = function(modelValue, viewValue) {
-        return !attr.required || !ctrl.$isEmpty(viewValue);
-      };
-
-      attr.$observe('required', function() {
-        ctrl.$validate();
-      });
-    }
-  };
-};
-
-
-var patternDirective = function() {
-  return {
-    restrict: 'A',
-    require: '?ngModel',
-    link: function(scope, elm, attr, ctrl) {
-      if (!ctrl) return;
-
-      var regexp, patternExp = attr.ngPattern || attr.pattern;
-      attr.$observe('pattern', function(regex) {
-        if (isString(regex) && regex.length > 0) {
-          regex = new RegExp('^' + regex + '$');
-        }
-
-        if (regex && !regex.test) {
-          throw minErr('ngPattern')('noregexp',
-            'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp,
-            regex, startingTag(elm));
-        }
-
-        regexp = regex || undefined;
-        ctrl.$validate();
-      });
-
-      ctrl.$validators.pattern = function(modelValue, viewValue) {
-        // HTML5 pattern constraint validates the input value, so we validate the viewValue
-        return ctrl.$isEmpty(viewValue) || isUndefined(regexp) || regexp.test(viewValue);
-      };
-    }
-  };
-};
-
-
-var maxlengthDirective = function() {
-  return {
-    restrict: 'A',
-    require: '?ngModel',
-    link: function(scope, elm, attr, ctrl) {
-      if (!ctrl) return;
-
-      var maxlength = -1;
-      attr.$observe('maxlength', function(value) {
-        var intVal = toInt(value);
-        maxlength = isNaN(intVal) ? -1 : intVal;
-        ctrl.$validate();
-      });
-      ctrl.$validators.maxlength = function(modelValue, viewValue) {
-        return (maxlength < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlength);
-      };
-    }
-  };
-};
-
-var minlengthDirective = function() {
-  return {
-    restrict: 'A',
-    require: '?ngModel',
-    link: function(scope, elm, attr, ctrl) {
-      if (!ctrl) return;
-
-      var minlength = 0;
-      attr.$observe('minlength', function(value) {
-        minlength = toInt(value) || 0;
-        ctrl.$validate();
-      });
-      ctrl.$validators.minlength = function(modelValue, viewValue) {
-        return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;
-      };
-    }
-  };
-};
-
-if (window.angular.bootstrap) {
-  //AngularJS is already loaded, so we can return here...
-  console.log('WARNING: Tried to load angular more than once.');
-  return;
-}
-
-//try to bind to jquery now so that one can write jqLite(document).ready()
-//but we will rebind on bootstrap again.
-bindJQuery();
-
-publishExternalAPI(angular);
-
-angular.module("ngLocale", [], ["$provide", function($provide) {
-var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
-function getDecimals(n) {
-  n = n + '';
-  var i = n.indexOf('.');
-  return (i == -1) ? 0 : n.length - i - 1;
-}
-
-function getVF(n, opt_precision) {
-  var v = opt_precision;
-
-  if (undefined === v) {
-    v = Math.min(getDecimals(n), 3);
-  }
-
-  var base = Math.pow(10, v);
-  var f = ((n * base) | 0) % base;
-  return {v: v, f: f};
-}
-
-$provide.value("$locale", {
-  "DATETIME_FORMATS": {
-    "AMPMS": [
-      "AM",
-      "PM"
-    ],
-    "DAY": [
-      "Sunday",
-      "Monday",
-      "Tuesday",
-      "Wednesday",
-      "Thursday",
-      "Friday",
-      "Saturday"
-    ],
-    "ERANAMES": [
-      "Before Christ",
-      "Anno Domini"
-    ],
-    "ERAS": [
-      "BC",
-      "AD"
-    ],
-    "FIRSTDAYOFWEEK": 6,
-    "MONTH": [
-      "January",
-      "February",
-      "March",
-      "April",
-      "May",
-      "June",
-      "July",
-      "August",
-      "September",
-      "October",
-      "November",
-      "December"
-    ],
-    "SHORTDAY": [
-      "Sun",
-      "Mon",
-      "Tue",
-      "Wed",
-      "Thu",
-      "Fri",
-      "Sat"
-    ],
-    "SHORTMONTH": [
-      "Jan",
-      "Feb",
-      "Mar",
-      "Apr",
-      "May",
-      "Jun",
-      "Jul",
-      "Aug",
-      "Sep",
-      "Oct",
-      "Nov",
-      "Dec"
-    ],
-    "WEEKENDRANGE": [
-      5,
-      6
-    ],
-    "fullDate": "EEEE, MMMM d, y",
-    "longDate": "MMMM d, y",
-    "medium": "MMM d, y h:mm:ss a",
-    "mediumDate": "MMM d, y",
-    "mediumTime": "h:mm:ss a",
-    "short": "M/d/yy h:mm a",
-    "shortDate": "M/d/yy",
-    "shortTime": "h:mm a"
-  },
-  "NUMBER_FORMATS": {
-    "CURRENCY_SYM": "$",
-    "DECIMAL_SEP": ".",
-    "GROUP_SEP": ",",
-    "PATTERNS": [
-      {
-        "gSize": 3,
-        "lgSize": 3,
-        "maxFrac": 3,
-        "minFrac": 0,
-        "minInt": 1,
-        "negPre": "-",
-        "negSuf": "",
-        "posPre": "",
-        "posSuf": ""
-      },
-      {
-        "gSize": 3,
-        "lgSize": 3,
-        "maxFrac": 2,
-        "minFrac": 2,
-        "minInt": 1,
-        "negPre": "-\u00a4",
-        "negSuf": "",
-        "posPre": "\u00a4",
-        "posSuf": ""
-      }
-    ]
-  },
-  "id": "en-us",
-  "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (i == 1 && vf.v == 0) {    return PLURAL_CATEGORY.ONE;  }  return PLURAL_CATEGORY.OTHER;}
-});
-}]);
-
-  jqLite(document).ready(function() {
-    angularInit(document, bootstrap);
-  });
-
-})(window, document);
-
-!window.angular.$$csp().noInlineStyle && window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular/angular.min.js b/views/ngXosViews/serviceGrid/src/vendor/angular/angular.min.js
deleted file mode 100644
index 272101e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular/angular.min.js
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- AngularJS v1.4.7
- (c) 2010-2015 Google, Inc. http://angularjs.org
- License: MIT
-*/
-(function(Q,X,w){'use strict';function I(b){return function(){var a=arguments[0],c;c="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.4.7/"+(b?b+"/":"")+a;for(a=1;a<arguments.length;a++){c=c+(1==a?"?":"&")+"p"+(a-1)+"=";var d=encodeURIComponent,e;e=arguments[a];e="function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?JSON.stringify(e):e;c+=d(e)}return Error(c)}}function Da(b){if(null==b||Za(b))return!1;var a="length"in Object(b)&&b.length;
-return b.nodeType===pa&&a?!0:G(b)||J(b)||0===a||"number"===typeof a&&0<a&&a-1 in b}function m(b,a,c){var d,e;if(b)if(x(b))for(d in b)"prototype"==d||"length"==d||"name"==d||b.hasOwnProperty&&!b.hasOwnProperty(d)||a.call(c,b[d],d,b);else if(J(b)||Da(b)){var f="object"!==typeof b;d=0;for(e=b.length;d<e;d++)(f||d in b)&&a.call(c,b[d],d,b)}else if(b.forEach&&b.forEach!==m)b.forEach(a,c,b);else if(mc(b))for(d in b)a.call(c,b[d],d,b);else if("function"===typeof b.hasOwnProperty)for(d in b)b.hasOwnProperty(d)&&
-a.call(c,b[d],d,b);else for(d in b)ta.call(b,d)&&a.call(c,b[d],d,b);return b}function nc(b,a,c){for(var d=Object.keys(b).sort(),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function oc(b){return function(a,c){b(c,a)}}function Ud(){return++nb}function pc(b,a){a?b.$$hashKey=a:delete b.$$hashKey}function Mb(b,a,c){for(var d=b.$$hashKey,e=0,f=a.length;e<f;++e){var h=a[e];if(C(h)||x(h))for(var g=Object.keys(h),l=0,k=g.length;l<k;l++){var n=g[l],p=h[n];c&&C(p)?ea(p)?b[n]=new Date(p.valueOf()):Oa(p)?
-b[n]=new RegExp(p):(C(b[n])||(b[n]=J(p)?[]:{}),Mb(b[n],[p],!0)):b[n]=p}}pc(b,d);return b}function P(b){return Mb(b,ua.call(arguments,1),!1)}function Vd(b){return Mb(b,ua.call(arguments,1),!0)}function Y(b){return parseInt(b,10)}function Nb(b,a){return P(Object.create(b),a)}function y(){}function $a(b){return b}function qa(b){return function(){return b}}function qc(b){return x(b.toString)&&b.toString!==Object.prototype.toString}function v(b){return"undefined"===typeof b}function A(b){return"undefined"!==
-typeof b}function C(b){return null!==b&&"object"===typeof b}function mc(b){return null!==b&&"object"===typeof b&&!rc(b)}function G(b){return"string"===typeof b}function V(b){return"number"===typeof b}function ea(b){return"[object Date]"===va.call(b)}function x(b){return"function"===typeof b}function Oa(b){return"[object RegExp]"===va.call(b)}function Za(b){return b&&b.window===b}function ab(b){return b&&b.$evalAsync&&b.$watch}function bb(b){return"boolean"===typeof b}function sc(b){return!(!b||!(b.nodeName||
-b.prop&&b.attr&&b.find))}function Wd(b){var a={};b=b.split(",");var c;for(c=0;c<b.length;c++)a[b[c]]=!0;return a}function wa(b){return F(b.nodeName||b[0]&&b[0].nodeName)}function cb(b,a){var c=b.indexOf(a);0<=c&&b.splice(c,1);return c}function ha(b,a,c,d){if(Za(b)||ab(b))throw Ea("cpws");if(tc.test(va.call(a)))throw Ea("cpta");if(a){if(b===a)throw Ea("cpi");c=c||[];d=d||[];C(b)&&(c.push(b),d.push(a));var e;if(J(b))for(e=a.length=0;e<b.length;e++)a.push(ha(b[e],null,c,d));else{var f=a.$$hashKey;J(a)?
-a.length=0:m(a,function(b,c){delete a[c]});if(mc(b))for(e in b)a[e]=ha(b[e],null,c,d);else if(b&&"function"===typeof b.hasOwnProperty)for(e in b)b.hasOwnProperty(e)&&(a[e]=ha(b[e],null,c,d));else for(e in b)ta.call(b,e)&&(a[e]=ha(b[e],null,c,d));pc(a,f)}}else if(a=b,C(b)){if(c&&-1!==(f=c.indexOf(b)))return d[f];if(J(b))return ha(b,[],c,d);if(tc.test(va.call(b)))a=new b.constructor(b);else if(ea(b))a=new Date(b.getTime());else if(Oa(b))a=new RegExp(b.source,b.toString().match(/[^\/]*$/)[0]),a.lastIndex=
-b.lastIndex;else if(x(b.cloneNode))a=b.cloneNode(!0);else return e=Object.create(rc(b)),ha(b,e,c,d);d&&(c.push(b),d.push(a))}return a}function ja(b,a){if(J(b)){a=a||[];for(var c=0,d=b.length;c<d;c++)a[c]=b[c]}else if(C(b))for(c in a=a||{},b)if("$"!==c.charAt(0)||"$"!==c.charAt(1))a[c]=b[c];return a||b}function ka(b,a){if(b===a)return!0;if(null===b||null===a)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&"object"==c)if(J(b)){if(!J(a))return!1;if((c=b.length)==a.length){for(d=0;d<
-c;d++)if(!ka(b[d],a[d]))return!1;return!0}}else{if(ea(b))return ea(a)?ka(b.getTime(),a.getTime()):!1;if(Oa(b))return Oa(a)?b.toString()==a.toString():!1;if(ab(b)||ab(a)||Za(b)||Za(a)||J(a)||ea(a)||Oa(a))return!1;c=fa();for(d in b)if("$"!==d.charAt(0)&&!x(b[d])){if(!ka(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!(d in c)&&"$"!==d.charAt(0)&&A(a[d])&&!x(a[d]))return!1;return!0}return!1}function db(b,a,c){return b.concat(ua.call(a,c))}function uc(b,a){var c=2<arguments.length?ua.call(arguments,2):[];
-return!x(a)||a instanceof RegExp?a:c.length?function(){return arguments.length?a.apply(b,db(c,arguments,0)):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}}function Xd(b,a){var c=a;"string"===typeof b&&"$"===b.charAt(0)&&"$"===b.charAt(1)?c=w:Za(a)?c="$WINDOW":a&&X===a?c="$DOCUMENT":ab(a)&&(c="$SCOPE");return c}function eb(b,a){if("undefined"===typeof b)return w;V(a)||(a=a?2:null);return JSON.stringify(b,Xd,a)}function vc(b){return G(b)?JSON.parse(b):b}function wc(b,
-a){var c=Date.parse("Jan 01, 1970 00:00:00 "+b)/6E4;return isNaN(c)?a:c}function Ob(b,a,c){c=c?-1:1;var d=wc(a,b.getTimezoneOffset());a=b;b=c*(d-b.getTimezoneOffset());a=new Date(a.getTime());a.setMinutes(a.getMinutes()+b);return a}function xa(b){b=B(b).clone();try{b.empty()}catch(a){}var c=B("<div>").append(b).html();try{return b[0].nodeType===Pa?F(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+F(b)})}catch(d){return F(c)}}function xc(b){try{return decodeURIComponent(b)}catch(a){}}
-function yc(b){var a={};m((b||"").split("&"),function(b){var d,e,f;b&&(e=b=b.replace(/\+/g,"%20"),d=b.indexOf("="),-1!==d&&(e=b.substring(0,d),f=b.substring(d+1)),e=xc(e),A(e)&&(f=A(f)?xc(f):!0,ta.call(a,e)?J(a[e])?a[e].push(f):a[e]=[a[e],f]:a[e]=f))});return a}function Pb(b){var a=[];m(b,function(b,d){J(b)?m(b,function(b){a.push(la(d,!0)+(!0===b?"":"="+la(b,!0)))}):a.push(la(d,!0)+(!0===b?"":"="+la(b,!0)))});return a.length?a.join("&"):""}function ob(b){return la(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,
-"=").replace(/%2B/gi,"+")}function la(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,a?"%20":"+")}function Yd(b,a){var c,d,e=Qa.length;for(d=0;d<e;++d)if(c=Qa[d]+a,G(c=b.getAttribute(c)))return c;return null}function Zd(b,a){var c,d,e={};m(Qa,function(a){a+="app";!c&&b.hasAttribute&&b.hasAttribute(a)&&(c=b,d=b.getAttribute(a))});m(Qa,function(a){a+="app";var e;!c&&(e=b.querySelector("["+a.replace(":",
-"\\:")+"]"))&&(c=e,d=e.getAttribute(a))});c&&(e.strictDi=null!==Yd(c,"strict-di"),a(c,d?[d]:[],e))}function zc(b,a,c){C(c)||(c={});c=P({strictDi:!1},c);var d=function(){b=B(b);if(b.injector()){var d=b[0]===X?"document":xa(b);throw Ea("btstrpd",d.replace(/</,"&lt;").replace(/>/,"&gt;"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);c.debugInfoEnabled&&a.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);a.unshift("ng");d=fb(a,c.strictDi);d.invoke(["$rootScope",
-"$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return d},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;Q&&e.test(Q.name)&&(c.debugInfoEnabled=!0,Q.name=Q.name.replace(e,""));if(Q&&!f.test(Q.name))return d();Q.name=Q.name.replace(f,"");da.resumeBootstrap=function(b){m(b,function(b){a.push(b)});return d()};x(da.resumeDeferredBootstrap)&&da.resumeDeferredBootstrap()}function $d(){Q.name="NG_ENABLE_DEBUG_INFO!"+Q.name;Q.location.reload()}
-function ae(b){b=da.element(b).injector();if(!b)throw Ea("test");return b.get("$$testability")}function Ac(b,a){a=a||"_";return b.replace(be,function(b,d){return(d?a:"")+b.toLowerCase()})}function ce(){var b;if(!Bc){var a=pb();(ra=v(a)?Q.jQuery:a?Q[a]:w)&&ra.fn.on?(B=ra,P(ra.fn,{scope:Ra.scope,isolateScope:Ra.isolateScope,controller:Ra.controller,injector:Ra.injector,inheritedData:Ra.inheritedData}),b=ra.cleanData,ra.cleanData=function(a){var d;if(Qb)Qb=!1;else for(var e=0,f;null!=(f=a[e]);e++)(d=
-ra._data(f,"events"))&&d.$destroy&&ra(f).triggerHandler("$destroy");b(a)}):B=R;da.element=B;Bc=!0}}function qb(b,a,c){if(!b)throw Ea("areq",a||"?",c||"required");return b}function Sa(b,a,c){c&&J(b)&&(b=b[b.length-1]);qb(x(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function Ta(b,a){if("hasOwnProperty"===b)throw Ea("badname",a);}function Cc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,h=0;h<f;h++)d=a[h],b&&(b=(e=b)[d]);return!c&&
-x(b)?uc(e,b):b}function rb(b){for(var a=b[0],c=b[b.length-1],d,e=1;a!==c&&(a=a.nextSibling);e++)if(d||b[e]!==a)d||(d=B(ua.call(b,0,e))),d.push(a);return d||b}function fa(){return Object.create(null)}function de(b){function a(a,b,c){return a[b]||(a[b]=c())}var c=I("$injector"),d=I("ng");b=a(b,"angular",Object);b.$$minErr=b.$$minErr||I;return a(b,"module",function(){var b={};return function(f,h,g){if("hasOwnProperty"===f)throw d("badname","module");h&&b.hasOwnProperty(f)&&(b[f]=null);return a(b,f,function(){function a(b,
-c,e,f){f||(f=d);return function(){f[e||"push"]([b,c,arguments]);return E}}function b(a,c){return function(b,e){e&&x(e)&&(e.$$moduleName=f);d.push([a,c,arguments]);return E}}if(!h)throw c("nomod",f);var d=[],e=[],r=[],t=a("$injector","invoke","push",e),E={_invokeQueue:d,_configBlocks:e,_runBlocks:r,requires:h,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide",
-"decorator"),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),config:t,run:function(a){r.push(a);return this}};g&&t(g);return E})}})}function ee(b){P(b,{bootstrap:zc,copy:ha,extend:P,merge:Vd,equals:ka,element:B,forEach:m,injector:fb,noop:y,bind:uc,toJson:eb,fromJson:vc,identity:$a,isUndefined:v,isDefined:A,isString:G,isFunction:x,isObject:C,isNumber:V,isElement:sc,isArray:J,
-version:fe,isDate:ea,lowercase:F,uppercase:sb,callbacks:{counter:0},getTestability:ae,$$minErr:I,$$csp:Fa,reloadWithDebugInfo:$d});Rb=de(Q);Rb("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:ge});a.provider("$compile",Dc).directive({a:he,input:Ec,textarea:Ec,form:ie,script:je,select:ke,style:le,option:me,ngBind:ne,ngBindHtml:oe,ngBindTemplate:pe,ngClass:qe,ngClassEven:re,ngClassOdd:se,ngCloak:te,ngController:ue,ngForm:ve,ngHide:we,ngIf:xe,ngInclude:ye,ngInit:ze,ngNonBindable:Ae,
-ngPluralize:Be,ngRepeat:Ce,ngShow:De,ngStyle:Ee,ngSwitch:Fe,ngSwitchWhen:Ge,ngSwitchDefault:He,ngOptions:Ie,ngTransclude:Je,ngModel:Ke,ngList:Le,ngChange:Me,pattern:Fc,ngPattern:Fc,required:Gc,ngRequired:Gc,minlength:Hc,ngMinlength:Hc,maxlength:Ic,ngMaxlength:Ic,ngValue:Ne,ngModelOptions:Oe}).directive({ngInclude:Pe}).directive(tb).directive(Jc);a.provider({$anchorScroll:Qe,$animate:Re,$animateCss:Se,$$animateQueue:Te,$$AnimateRunner:Ue,$browser:Ve,$cacheFactory:We,$controller:Xe,$document:Ye,$exceptionHandler:Ze,
-$filter:Kc,$$forceReflow:$e,$interpolate:af,$interval:bf,$http:cf,$httpParamSerializer:df,$httpParamSerializerJQLike:ef,$httpBackend:ff,$xhrFactory:gf,$location:hf,$log:jf,$parse:kf,$rootScope:lf,$q:mf,$$q:nf,$sce:of,$sceDelegate:pf,$sniffer:qf,$templateCache:rf,$templateRequest:sf,$$testability:tf,$timeout:uf,$window:vf,$$rAF:wf,$$jqLite:xf,$$HashMap:yf,$$cookieReader:zf})}])}function gb(b){return b.replace(Af,function(a,b,d,e){return e?d.toUpperCase():d}).replace(Bf,"Moz$1")}function Lc(b){b=b.nodeType;
-return b===pa||!b||9===b}function Mc(b,a){var c,d,e=a.createDocumentFragment(),f=[];if(Sb.test(b)){c=c||e.appendChild(a.createElement("div"));d=(Cf.exec(b)||["",""])[1].toLowerCase();d=ma[d]||ma._default;c.innerHTML=d[1]+b.replace(Df,"<$1></$2>")+d[2];for(d=d[0];d--;)c=c.lastChild;f=db(f,c.childNodes);c=e.firstChild;c.textContent=""}else f.push(a.createTextNode(b));e.textContent="";e.innerHTML="";m(f,function(a){e.appendChild(a)});return e}function R(b){if(b instanceof R)return b;var a;G(b)&&(b=T(b),
-a=!0);if(!(this instanceof R)){if(a&&"<"!=b.charAt(0))throw Tb("nosel");return new R(b)}if(a){a=X;var c;b=(c=Ef.exec(b))?[a.createElement(c[1])]:(c=Mc(b,a))?c.childNodes:[]}Nc(this,b)}function Ub(b){return b.cloneNode(!0)}function ub(b,a){a||vb(b);if(b.querySelectorAll)for(var c=b.querySelectorAll("*"),d=0,e=c.length;d<e;d++)vb(c[d])}function Oc(b,a,c,d){if(A(d))throw Tb("offargs");var e=(d=wb(b))&&d.events,f=d&&d.handle;if(f)if(a)m(a.split(" "),function(a){if(A(c)){var d=e[a];cb(d||[],c);if(d&&0<
-d.length)return}b.removeEventListener(a,f,!1);delete e[a]});else for(a in e)"$destroy"!==a&&b.removeEventListener(a,f,!1),delete e[a]}function vb(b,a){var c=b.ng339,d=c&&hb[c];d&&(a?delete d.data[a]:(d.handle&&(d.events.$destroy&&d.handle({},"$destroy"),Oc(b)),delete hb[c],b.ng339=w))}function wb(b,a){var c=b.ng339,c=c&&hb[c];a&&!c&&(b.ng339=c=++Ff,c=hb[c]={events:{},data:{},handle:w});return c}function Vb(b,a,c){if(Lc(b)){var d=A(c),e=!d&&a&&!C(a),f=!a;b=(b=wb(b,!e))&&b.data;if(d)b[a]=c;else{if(f)return b;
-if(e)return b&&b[a];P(b,a)}}}function xb(b,a){return b.getAttribute?-1<(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" "):!1}function yb(b,a){a&&b.setAttribute&&m(a.split(" "),function(a){b.setAttribute("class",T((" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+T(a)+" "," ")))})}function zb(b,a){if(a&&b.setAttribute){var c=(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");m(a.split(" "),function(a){a=T(a);-1===c.indexOf(" "+a+" ")&&
-(c+=a+" ")});b.setAttribute("class",T(c))}}function Nc(b,a){if(a)if(a.nodeType)b[b.length++]=a;else{var c=a.length;if("number"===typeof c&&a.window!==a){if(c)for(var d=0;d<c;d++)b[b.length++]=a[d]}else b[b.length++]=a}}function Pc(b,a){return Ab(b,"$"+(a||"ngController")+"Controller")}function Ab(b,a,c){9==b.nodeType&&(b=b.documentElement);for(a=J(a)?a:[a];b;){for(var d=0,e=a.length;d<e;d++)if(A(c=B.data(b,a[d])))return c;b=b.parentNode||11===b.nodeType&&b.host}}function Qc(b){for(ub(b,!0);b.firstChild;)b.removeChild(b.firstChild)}
-function Wb(b,a){a||ub(b);var c=b.parentNode;c&&c.removeChild(b)}function Gf(b,a){a=a||Q;if("complete"===a.document.readyState)a.setTimeout(b);else B(a).on("load",b)}function Rc(b,a){var c=Bb[a.toLowerCase()];return c&&Sc[wa(b)]&&c}function Hf(b,a){var c=function(c,e){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=a[e||c.type],h=f?f.length:0;if(h){if(v(c.immediatePropagationStopped)){var g=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=
-!0;c.stopPropagation&&c.stopPropagation();g&&g.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};1<h&&(f=ja(f));for(var l=0;l<h;l++)c.isImmediatePropagationStopped()||f[l].call(b,c)}};c.elem=b;return c}function xf(){this.$get=function(){return P(R,{hasClass:function(b,a){b.attr&&(b=b[0]);return xb(b,a)},addClass:function(b,a){b.attr&&(b=b[0]);return zb(b,a)},removeClass:function(b,a){b.attr&&(b=b[0]);return yb(b,a)}})}}function Ga(b,a){var c=b&&b.$$hashKey;
-if(c)return"function"===typeof c&&(c=b.$$hashKey()),c;c=typeof b;return c="function"==c||"object"==c&&null!==b?b.$$hashKey=c+":"+(a||Ud)():c+":"+b}function Ua(b,a){if(a){var c=0;this.nextUid=function(){return++c}}m(b,this.put,this)}function If(b){return(b=b.toString().replace(Tc,"").match(Uc))?"function("+(b[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function fb(b,a){function c(a){return function(b,c){if(C(b))m(b,oc(a));else return a(b,c)}}function d(a,b){Ta(a,"service");if(x(b)||J(b))b=r.instantiate(b);
-if(!b.$get)throw Ha("pget",a);return p[a+"Provider"]=b}function e(a,b){return function(){var c=E.invoke(b,this);if(v(c))throw Ha("undef",a);return c}}function f(a,b,c){return d(a,{$get:!1!==c?e(a,b):b})}function h(a){qb(v(a)||J(a),"modulesToLoad","not an array");var b=[],c;m(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=r.get(e[0]);f[e[1]].apply(f,e[2])}}if(!n.get(a)){n.put(a,!0);try{G(a)?(c=Rb(a),b=b.concat(h(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):
-x(a)?b.push(r.invoke(a)):J(a)?b.push(r.invoke(a)):Sa(a,"module")}catch(e){throw J(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ha("modulerr",a,e.stack||e.message||e);}}});return b}function g(b,c){function d(a,e){if(b.hasOwnProperty(a)){if(b[a]===l)throw Ha("cdep",a+" <- "+k.join(" <- "));return b[a]}try{return k.unshift(a),b[a]=l,b[a]=c(a,e)}catch(f){throw b[a]===l&&delete b[a],f;}finally{k.shift()}}function e(b,c,f,g){"string"===typeof f&&(g=
-f,f=null);var h=[],k=fb.$$annotate(b,a,g),l,r,p;r=0;for(l=k.length;r<l;r++){p=k[r];if("string"!==typeof p)throw Ha("itkn",p);h.push(f&&f.hasOwnProperty(p)?f[p]:d(p,g))}J(b)&&(b=b[l]);return b.apply(c,h)}return{invoke:e,instantiate:function(a,b,c){var d=Object.create((J(a)?a[a.length-1]:a).prototype||null);a=e(a,d,b,c);return C(a)||x(a)?a:d},get:d,annotate:fb.$$annotate,has:function(a){return p.hasOwnProperty(a+"Provider")||b.hasOwnProperty(a)}}}a=!0===a;var l={},k=[],n=new Ua([],!0),p={$provide:{provider:c(d),
-factory:c(f),service:c(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:c(function(a,b){return f(a,qa(b),!1)}),constant:c(function(a,b){Ta(a,"constant");p[a]=b;t[a]=b}),decorator:function(a,b){var c=r.get(a+"Provider"),d=c.$get;c.$get=function(){var a=E.invoke(d,c);return E.invoke(b,null,{$delegate:a})}}}},r=p.$injector=g(p,function(a,b){da.isString(b)&&k.push(b);throw Ha("unpr",k.join(" <- "));}),t={},E=t.$injector=g(t,function(a,b){var c=r.get(a+"Provider",b);
-return E.invoke(c.$get,c,w,a)});m(h(b),function(a){a&&E.invoke(a)});return E}function Qe(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===wa(a))return b=a,!0});return b}function f(b){if(b){b.scrollIntoView();var c;c=h.yOffset;x(c)?c=c():sc(c)?(c=c[0],c="fixed"!==a.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):V(c)||(c=0);c&&(b=b.getBoundingClientRect().top,
-a.scrollBy(0,b-c))}else a.scrollTo(0,0)}function h(a){a=G(a)?a:c.hash();var b;a?(b=g.getElementById(a))?f(b):(b=e(g.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var g=a.document;b&&d.$watch(function(){return c.hash()},function(a,b){a===b&&""===a||Gf(function(){d.$evalAsync(h)})});return h}]}function ib(b,a){if(!b&&!a)return"";if(!b)return a;if(!a)return b;J(b)&&(b=b.join(" "));J(a)&&(a=a.join(" "));return b+" "+a}function Jf(b){G(b)&&(b=b.split(" "));var a=fa();m(b,function(b){b.length&&
-(a[b]=!0)});return a}function Ia(b){return C(b)?b:{}}function Kf(b,a,c,d){function e(a){try{a.apply(null,ua.call(arguments,1))}finally{if(E--,0===E)for(;K.length;)try{K.pop()()}catch(b){c.error(b)}}}function f(){ia=null;h();g()}function h(){a:{try{u=n.state;break a}catch(a){}u=void 0}u=v(u)?null:u;ka(u,L)&&(u=L);L=u}function g(){if(z!==l.url()||q!==u)z=l.url(),q=u,m(O,function(a){a(l.url(),u)})}var l=this,k=b.location,n=b.history,p=b.setTimeout,r=b.clearTimeout,t={};l.isMock=!1;var E=0,K=[];l.$$completeOutstandingRequest=
-e;l.$$incOutstandingRequestCount=function(){E++};l.notifyWhenNoOutstandingRequests=function(a){0===E?a():K.push(a)};var u,q,z=k.href,N=a.find("base"),ia=null;h();q=u;l.url=function(a,c,e){v(e)&&(e=null);k!==b.location&&(k=b.location);n!==b.history&&(n=b.history);if(a){var f=q===e;if(z===a&&(!d.history||f))return l;var g=z&&Ja(z)===Ja(a);z=a;q=e;if(!d.history||g&&f){if(!g||ia)ia=a;c?k.replace(a):g?(c=k,e=a.indexOf("#"),e=-1===e?"":a.substr(e),c.hash=e):k.href=a;k.href!==a&&(ia=a)}else n[c?"replaceState":
-"pushState"](e,"",a),h(),q=u;return l}return ia||k.href.replace(/%27/g,"'")};l.state=function(){return u};var O=[],H=!1,L=null;l.onUrlChange=function(a){if(!H){if(d.history)B(b).on("popstate",f);B(b).on("hashchange",f);H=!0}O.push(a);return a};l.$$applicationDestroyed=function(){B(b).off("hashchange popstate",f)};l.$$checkUrlChange=g;l.baseHref=function(){var a=N.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};l.defer=function(a,b){var c;E++;c=p(function(){delete t[c];e(a)},b||0);
-t[c]=!0;return c};l.defer.cancel=function(a){return t[a]?(delete t[a],r(a),e(y),!0):!1}}function Ve(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new Kf(b,d,a,c)}]}function We(){this.$get=function(){function b(b,d){function e(a){a!=p&&(r?r==a&&(r=a.n):r=a,f(a.n,a.p),f(a,p),p=a,p.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(b in a)throw I("$cacheFactory")("iid",b);var h=0,g=P({},d,{id:b}),l={},k=d&&d.capacity||Number.MAX_VALUE,n={},p=null,r=null;return a[b]=
-{put:function(a,b){if(!v(b)){if(k<Number.MAX_VALUE){var c=n[a]||(n[a]={key:a});e(c)}a in l||h++;l[a]=b;h>k&&this.remove(r.key);return b}},get:function(a){if(k<Number.MAX_VALUE){var b=n[a];if(!b)return;e(b)}return l[a]},remove:function(a){if(k<Number.MAX_VALUE){var b=n[a];if(!b)return;b==p&&(p=b.p);b==r&&(r=b.n);f(b.n,b.p);delete n[a]}delete l[a];h--},removeAll:function(){l={};h=0;n={};p=r=null},destroy:function(){n=g=l=null;delete a[b]},info:function(){return P({},g,{size:h})}}}var a={};b.info=function(){var b=
-{};m(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function rf(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Dc(b,a){function c(a,b,c){var d=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,e={};m(a,function(a,f){var g=a.match(d);if(!g)throw ga("iscp",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f}});return e}function d(a){var b=a.charAt(0);if(!b||
-b!==F(b))throw ga("baddir",a);if(a!==a.trim())throw ga("baddir",a);}var e={},f=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,h=/(([\w\-]+)(?:\:([^;]+))?;?)/,g=Wd("ngSrc,ngSrcset,src,srcset"),l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,k=/^(on[a-z]+|formaction)$/;this.directive=function r(a,f){Ta(a,"directive");G(a)?(d(a),qb(f,"directiveFactory"),e.hasOwnProperty(a)||(e[a]=[],b.factory(a+"Directive",["$injector","$exceptionHandler",function(b,d){var f=[];m(e[a],function(e,g){try{var h=b.invoke(e);x(h)?h={compile:qa(h)}:
-!h.compile&&h.link&&(h.compile=qa(h.link));h.priority=h.priority||0;h.index=g;h.name=h.name||a;h.require=h.require||h.controller&&h.name;h.restrict=h.restrict||"EA";var k=h,l=h,r=h.name,n={isolateScope:null,bindToController:null};C(l.scope)&&(!0===l.bindToController?(n.bindToController=c(l.scope,r,!0),n.isolateScope={}):n.isolateScope=c(l.scope,r,!1));C(l.bindToController)&&(n.bindToController=c(l.bindToController,r,!0));if(C(n.bindToController)){var S=l.controller,E=l.controllerAs;if(!S)throw ga("noctrl",
-r);var ca;a:if(E&&G(E))ca=E;else{if(G(S)){var m=Vc.exec(S);if(m){ca=m[3];break a}}ca=void 0}if(!ca)throw ga("noident",r);}var s=k.$$bindings=n;C(s.isolateScope)&&(h.$$isolateBindings=s.isolateScope);h.$$moduleName=e.$$moduleName;f.push(h)}catch(w){d(w)}});return f}])),e[a].push(f)):m(a,oc(r));return this};this.aHrefSanitizationWhitelist=function(b){return A(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(b){return A(b)?(a.imgSrcSanitizationWhitelist(b),
-this):a.imgSrcSanitizationWhitelist()};var n=!0;this.debugInfoEnabled=function(a){return A(a)?(n=a,this):n};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,c,d,u,q,z,N,ia,O,H){function L(a,b){try{a.addClass(b)}catch(c){}}function W(a,b,c,d,e){a instanceof B||(a=B(a));m(a,function(b,c){b.nodeType==Pa&&b.nodeValue.match(/\S+/)&&(a[c]=B(b).wrap("<span></span>").parent()[0])});var f=
-S(a,b,a,c,d,e);W.$$addScopeClass(a);var g=null;return function(b,c,d){qb(b,"scope");d=d||{};var e=d.parentBoundTranscludeFn,h=d.transcludeControllers;d=d.futureParentElement;e&&e.$$boundTransclude&&(e=e.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==wa(d)&&d.toString().match(/SVG/)?"svg":"html":"html");d="html"!==g?B(Xb(g,B("<div>").append(a).html())):c?Ra.clone.call(a):a;if(h)for(var k in h)d.data("$"+k+"Controller",h[k].instance);W.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,e);return d}}function S(a,
-b,c,d,e,f){function g(a,c,d,e){var f,k,l,r,n,t,O;if(q)for(O=Array(c.length),r=0;r<h.length;r+=3)f=h[r],O[f]=c[f];else O=c;r=0;for(n=h.length;r<n;)if(k=O[h[r++]],c=h[r++],f=h[r++],c){if(c.scope){if(l=a.$new(),W.$$addScopeInfo(B(k),l),t=c.$$destroyBindings)c.$$destroyBindings=null,l.$on("$destroyed",t)}else l=a;t=c.transcludeOnThisElement?ba(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ba(a,b):null;c(f,l,k,d,t,c)}else f&&f(a,k.childNodes,w,e)}for(var h=[],k,l,r,n,q,t=0;t<a.length;t++){k=new Z;
-l=ca(a[t],[],k,0===t?d:w,e);(f=l.length?D(l,a[t],k,b,c,null,[],[],f):null)&&f.scope&&W.$$addScopeClass(k.$$element);k=f&&f.terminal||!(r=a[t].childNodes)||!r.length?null:S(r,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||k)h.push(t,f,k),n=!0,q=q||f;f=null}return n?g:null}function ba(a,b,c){return function(d,e,f,g,h){d||(d=a.$new(!1,h),d.$$transcluded=!0);return b(d,e,{parentBoundTranscludeFn:c,transcludeControllers:f,futureParentElement:g})}}function ca(a,b,c,d,e){var g=
-c.$attr,k;switch(a.nodeType){case pa:na(b,ya(wa(a)),"E",d,e);for(var l,r,n,q=a.attributes,t=0,O=q&&q.length;t<O;t++){var K=!1,H=!1;l=q[t];k=l.name;r=T(l.value);l=ya(k);if(n=ja.test(l))k=k.replace(Wc,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()});var S=l.replace(/(Start|End)$/,"");I(S)&&l===S+"Start"&&(K=k,H=k.substr(0,k.length-5)+"end",k=k.substr(0,k.length-6));l=ya(k.toLowerCase());g[l]=k;if(n||!c.hasOwnProperty(l))c[l]=r,Rc(a,l)&&(c[l]=!0);V(a,b,r,l,n);na(b,l,"A",d,e,K,H)}a=
-a.className;C(a)&&(a=a.animVal);if(G(a)&&""!==a)for(;k=h.exec(a);)l=ya(k[2]),na(b,l,"C",d,e)&&(c[l]=T(k[3])),a=a.substr(k.index+k[0].length);break;case Pa:if(11===Wa)for(;a.parentNode&&a.nextSibling&&a.nextSibling.nodeType===Pa;)a.nodeValue+=a.nextSibling.nodeValue,a.parentNode.removeChild(a.nextSibling);Ka(b,a.nodeValue);break;case 8:try{if(k=f.exec(a.nodeValue))l=ya(k[1]),na(b,l,"M",d,e)&&(c[l]=T(k[2]))}catch(E){}}b.sort(M);return b}function za(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ga("uterdir",
-b,c);a.nodeType==pa&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return B(d)}function s(a,b,c){return function(d,e,f,g,h){e=za(e[0],b,c);return a(d,e,f,g,h)}}function D(a,b,d,e,f,g,h,k,r){function n(a,b,c,d){if(a){c&&(a=s(a,c,d));a.require=D.require;a.directiveName=y;if(u===D||D.$$isolateScope)a=$(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=s(b,c,d));b.require=D.require;b.directiveName=y;if(u===D||D.$$isolateScope)b=$(b,{isolateScope:!0});k.push(b)}}
-function t(a,b,c,d){var e;if(G(b)){var f=b.match(l);b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;e||(d="$"+b+"Controller",e=g?c.inheritedData(d):c.data(d));if(!e&&!f)throw ga("ctreq",b,a);}else if(J(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=t(a,b[g],c,d);return e||null}function O(a,b,c,d,e,f){var g=fa(),h;for(h in d){var k=d[h],l={$scope:k===u||k.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},r=k.controller;"@"==r&&(r=b[k.name]);l=q(r,
-l,!0,k.controllerAs);g[k.name]=l;ia||a.data("$"+k.name+"Controller",l.instance)}return g}function K(a,c,e,f,g,l){function r(a,b,c){var d;ab(a)||(c=b,b=a,a=w);ia&&(d=ca);c||(c=ia?N.parent():N);return g(a,b,d,c,za)}var n,q,H,E,ca,z,N;b===e?(f=d,N=d.$$element):(N=B(e),f=new Z(N,d));u&&(E=c.$new(!0));g&&(z=r,z.$$boundTransclude=g);ba&&(ca=O(N,f,z,ba,E,c));u&&(W.$$addScopeInfo(N,E,!0,!(L&&(L===u||L===u.$$originalDirective))),W.$$addScopeClass(N,!0),E.$$isolateBindings=u.$$isolateBindings,Y(c,f,E,E.$$isolateBindings,
-u,E));if(ca){var Va=u||S,m;Va&&ca[Va.name]&&(q=Va.$$bindings.bindToController,(H=ca[Va.name])&&H.identifier&&q&&(m=H,l.$$destroyBindings=Y(c,f,H.instance,q,Va)));for(n in ca){H=ca[n];var D=H();D!==H.instance&&(H.instance=D,N.data("$"+n+"Controller",D),H===m&&(l.$$destroyBindings(),l.$$destroyBindings=Y(c,f,D,q,Va)))}}n=0;for(l=h.length;n<l;n++)q=h[n],aa(q,q.isolateScope?E:c,N,f,q.require&&t(q.directiveName,q.require,N,ca),z);var za=c;u&&(u.template||null===u.templateUrl)&&(za=E);a&&a(za,e.childNodes,
-w,g);for(n=k.length-1;0<=n;n--)q=k[n],aa(q,q.isolateScope?E:c,N,f,q.require&&t(q.directiveName,q.require,N,ca),z)}r=r||{};for(var H=-Number.MAX_VALUE,S=r.newScopeDirective,ba=r.controllerDirectives,u=r.newIsolateScopeDirective,L=r.templateDirective,z=r.nonTlbTranscludeDirective,N=!1,m=!1,ia=r.hasElementTranscludeDirective,v=d.$$element=B(b),D,y,M,Ka=e,na,I=0,F=a.length;I<F;I++){D=a[I];var P=D.$$start,R=D.$$end;P&&(v=za(b,P,R));M=w;if(H>D.priority)break;if(M=D.scope)D.templateUrl||(C(M)?(Q("new/isolated scope",
-u||S,D,v),u=D):Q("new/isolated scope",u,D,v)),S=S||D;y=D.name;!D.templateUrl&&D.controller&&(M=D.controller,ba=ba||fa(),Q("'"+y+"' controller",ba[y],D,v),ba[y]=D);if(M=D.transclude)N=!0,D.$$tlb||(Q("transclusion",z,D,v),z=D),"element"==M?(ia=!0,H=D.priority,M=v,v=d.$$element=B(X.createComment(" "+y+": "+d[y]+" ")),b=v[0],U(f,ua.call(M,0),b),Ka=W(M,e,H,g&&g.name,{nonTlbTranscludeDirective:z})):(M=B(Ub(b)).contents(),v.empty(),Ka=W(M,e));if(D.template)if(m=!0,Q("template",L,D,v),L=D,M=x(D.template)?
-D.template(v,d):D.template,M=ha(M),D.replace){g=D;M=Sb.test(M)?Xc(Xb(D.templateNamespace,T(M))):[];b=M[0];if(1!=M.length||b.nodeType!==pa)throw ga("tplrt",y,"");U(f,v,b);F={$attr:{}};M=ca(b,[],F);var Lf=a.splice(I+1,a.length-(I+1));u&&A(M);a=a.concat(M).concat(Lf);Yc(d,F);F=a.length}else v.html(M);if(D.templateUrl)m=!0,Q("template",L,D,v),L=D,D.replace&&(g=D),K=Mf(a.splice(I,a.length-I),v,d,f,N&&Ka,h,k,{controllerDirectives:ba,newScopeDirective:S!==D&&S,newIsolateScopeDirective:u,templateDirective:L,
-nonTlbTranscludeDirective:z}),F=a.length;else if(D.compile)try{na=D.compile(v,d,Ka),x(na)?n(null,na,P,R):na&&n(na.pre,na.post,P,R)}catch(V){c(V,xa(v))}D.terminal&&(K.terminal=!0,H=Math.max(H,D.priority))}K.scope=S&&!0===S.scope;K.transcludeOnThisElement=N;K.templateOnThisElement=m;K.transclude=Ka;r.hasElementTranscludeDirective=ia;return K}function A(a){for(var b=0,c=a.length;b<c;b++)a[b]=Nb(a[b],{$$isolateScope:!0})}function na(b,d,f,g,h,k,l){if(d===h)return null;h=null;if(e.hasOwnProperty(d)){var n;
-d=a.get(d+"Directive");for(var q=0,t=d.length;q<t;q++)try{n=d[q],(v(g)||g>n.priority)&&-1!=n.restrict.indexOf(f)&&(k&&(n=Nb(n,{$$start:k,$$end:l})),b.push(n),h=n)}catch(H){c(H)}}return h}function I(b){if(e.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,f=c.length;d<f;d++)if(b=c[d],b.multiElement)return!0;return!1}function Yc(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;m(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});m(b,function(b,f){"class"==
-f?(L(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function Mf(a,b,c,e,f,g,h,k){var l=[],r,n,q=b[0],t=a.shift(),H=Nb(t,{templateUrl:null,transclude:null,replace:null,$$originalDirective:t}),O=x(t.templateUrl)?t.templateUrl(b,c):t.templateUrl,E=t.templateNamespace;b.empty();d(O).then(function(d){var K,u;d=ha(d);if(t.replace){d=Sb.test(d)?Xc(Xb(E,T(d))):
-[];K=d[0];if(1!=d.length||K.nodeType!==pa)throw ga("tplrt",t.name,O);d={$attr:{}};U(e,b,K);var z=ca(K,[],d);C(t.scope)&&A(z);a=z.concat(a);Yc(c,d)}else K=q,b.html(d);a.unshift(H);r=D(a,K,c,f,b,t,g,h,k);m(e,function(a,c){a==K&&(e[c]=b[0])});for(n=S(b[0].childNodes,f);l.length;){d=l.shift();u=l.shift();var N=l.shift(),W=l.shift(),z=b[0];if(!d.$$destroyed){if(u!==q){var za=u.className;k.hasElementTranscludeDirective&&t.replace||(z=Ub(K));U(N,B(u),z);L(B(z),za)}u=r.transcludeOnThisElement?ba(d,r.transclude,
-W):W;r(n,d,z,e,u,r)}}l=null});return function(a,b,c,d,e){a=e;b.$$destroyed||(l?l.push(b,c,d,a):(r.transcludeOnThisElement&&(a=ba(b,r.transclude,e)),r(n,b,c,d,a,r)))}}function M(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function Q(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw ga("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,xa(d));}function Ka(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=
-a.parent();var b=!!a.length;b&&W.$$addBindingClass(a);return function(a,c){var e=c.parent();b||W.$$addBindingClass(e);W.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function Xb(a,b){a=F(a||"html");switch(a){case "svg":case "math":var c=X.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function R(a,b){if("srcdoc"==b)return ia.HTML;var c=wa(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||
-"ngSrc"==b))return ia.RESOURCE_URL}function V(a,c,d,e,f){var h=R(a,e);f=g[e]||f;var l=b(d,!0,h,f);if(l){if("multiple"===e&&"select"===wa(a))throw ga("selmulti",xa(a));c.push({priority:100,compile:function(){return{pre:function(a,c,g){c=g.$$observers||(g.$$observers=fa());if(k.test(e))throw ga("nodomevents");var r=g[e];r!==d&&(l=r&&b(r,!0,h,f),d=r);l&&(g[e]=l(a),(c[e]||(c[e]=[])).$$inter=!0,(g.$$observers&&g.$$observers[e].$$scope||a).$watch(l,function(a,b){"class"===e&&a!=b?g.$updateClass(a,b):g.$set(e,
-a)}))}}}})}}function U(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]==d){a[g++]=c;h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=c);break}f&&f.replaceChild(c,d);a=X.createDocumentFragment();a.appendChild(d);B.hasData(d)&&(B(c).data(B(d).data()),ra?(Qb=!0,ra.cleanData([d])):delete B.cache[d[B.expando]]);d=1;for(e=b.length;d<e;d++)f=b[d],B(f).remove(),a.appendChild(f),delete b[d];b[0]=c;b.length=1}function $(a,
-b){return P(function(){return a.apply(null,arguments)},a,b)}function aa(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,xa(d))}}function Y(a,c,d,e,f,g){var h;m(e,function(e,g){var k=e.attrName,l=e.optional,r,n,q,K;switch(e.mode){case "@":l||ta.call(c,k)||(d[g]=c[k]=void 0);c.$observe(k,function(a){G(a)&&(d[g]=a)});c.$$observers[k].$$scope=a;G(c[k])&&(d[g]=b(c[k])(a));break;case "=":if(!ta.call(c,k)){if(l)break;c[k]=void 0}if(l&&!c[k])break;n=u(c[k]);K=n.literal?ka:function(a,b){return a===b||a!==a&&b!==
-b};q=n.assign||function(){r=d[g]=n(a);throw ga("nonassign",c[k],f.name);};r=d[g]=n(a);l=function(b){K(b,d[g])||(K(b,r)?q(a,b=d[g]):d[g]=b);return r=b};l.$stateful=!0;l=e.collection?a.$watchCollection(c[k],l):a.$watch(u(c[k],l),null,n.literal);h=h||[];h.push(l);break;case "&":n=c.hasOwnProperty(k)?u(c[k]):y;if(n===y&&l)break;d[g]=function(b){return n(a,b)}}});e=h?function(){for(var a=0,b=h.length;a<b;++a)h[a]()}:y;return g&&e!==y?(g.$on("$destroy",e),y):e}var Z=function(a,b){if(b){var c=Object.keys(b),
-d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a};Z.prototype={$normalize:ya,$addClass:function(a){a&&0<a.length&&O.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&O.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=Zc(a,b);c&&c.length&&O.addClass(this.$$element,c);(c=Zc(b,a))&&c.length&&O.removeClass(this.$$element,c)},$set:function(a,b,d,e){var f=Rc(this.$$element[0],a),g=$c[a],h=a;f?(this.$$element.prop(a,b),e=f):g&&(this[g]=
-b,h=g);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=Ac(a,"-"));f=wa(this.$$element);if("a"===f&&"href"===a||"img"===f&&"src"===a)this[a]=b=H(b,"src"===a);else if("img"===f&&"srcset"===a){for(var f="",g=T(b),k=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,k=/\s/.test(g)?k:/(,)/,g=g.split(k),k=Math.floor(g.length/2),l=0;l<k;l++)var r=2*l,f=f+H(T(g[r]),!0),f=f+(" "+T(g[r+1]));g=T(g[2*l]).split(/\s/);f+=H(T(g[0]),!0);2===g.length&&(f+=" "+T(g[1]));this[a]=b=f}!1!==d&&(null===b||v(b)?this.$$element.removeAttr(e):
-this.$$element.attr(e,b));(a=this.$$observers)&&m(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=fa()),e=d[a]||(d[a]=[]);e.push(b);z.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||v(c[a])||b(c[a])});return function(){cb(e,b)}}};var da=b.startSymbol(),ea=b.endSymbol(),ha="{{"==da||"}}"==ea?$a:function(a){return a.replace(/\{\{/g,da).replace(/}}/g,ea)},ja=/^ngAttr[A-Z]/;W.$$addBindingInfo=n?function(a,b){var c=a.data("$binding")||
-[];J(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:y;W.$$addBindingClass=n?function(a){L(a,"ng-binding")}:y;W.$$addScopeInfo=n?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:y;W.$$addScopeClass=n?function(a,b){L(a,b?"ng-isolate-scope":"ng-scope")}:y;return W}]}function ya(b){return gb(b.replace(Wc,""))}function Zc(b,a){var c="",d=b.split(/\s+/),e=a.split(/\s+/),f=0;a:for(;f<d.length;f++){for(var h=d[f],g=0;g<e.length;g++)if(h==e[g])continue a;c+=(0<c.length?
-" ":"")+h}return c}function Xc(b){b=B(b);var a=b.length;if(1>=a)return b;for(;a--;)8===b[a].nodeType&&Nf.call(b,a,1);return b}function Xe(){var b={},a=!1;this.register=function(a,d){Ta(a,"controller");C(a)?P(b,a):b[a]=d};this.allowGlobals=function(){a=!0};this.$get=["$injector","$window",function(c,d){function e(a,b,c,d){if(!a||!C(a.$scope))throw I("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,h,g,l){var k,n,p;g=!0===g;l&&G(l)&&(p=l);if(G(f)){l=f.match(Vc);if(!l)throw Of("ctrlfmt",f);
-n=l[1];p=p||l[3];f=b.hasOwnProperty(n)?b[n]:Cc(h.$scope,n,!0)||(a?Cc(d,n,!0):w);Sa(f,n,!0)}if(g)return g=(J(f)?f[f.length-1]:f).prototype,k=Object.create(g||null),p&&e(h,p,k,n||f.name),P(function(){var a=c.invoke(f,k,h,n);a!==k&&(C(a)||x(a))&&(k=a,p&&e(h,p,k,n||f.name));return k},{instance:k,identifier:p});k=c.instantiate(f,h,n);p&&e(h,p,k,n||f.name);return k}}]}function Ye(){this.$get=["$window",function(b){return B(b.document)}]}function Ze(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,
-arguments)}}]}function Yb(b){return C(b)?ea(b)?b.toISOString():eb(b):b}function df(){this.$get=function(){return function(b){if(!b)return"";var a=[];nc(b,function(b,d){null===b||v(b)||(J(b)?m(b,function(b,c){a.push(la(d)+"="+la(Yb(b)))}):a.push(la(d)+"="+la(Yb(b))))});return a.join("&")}}}function ef(){this.$get=function(){return function(b){function a(b,e,f){null===b||v(b)||(J(b)?m(b,function(b,c){a(b,e+"["+(C(b)?c:"")+"]")}):C(b)&&!ea(b)?nc(b,function(b,c){a(b,e+(f?"":"[")+c+(f?"":"]"))}):c.push(la(e)+
-"="+la(Yb(b))))}if(!b)return"";var c=[];a(b,"",!0);return c.join("&")}}}function Zb(b,a){if(G(b)){var c=b.replace(Pf,"").trim();if(c){var d=a("Content-Type");(d=d&&0===d.indexOf(ad))||(d=(d=c.match(Qf))&&Rf[d[0]].test(c));d&&(b=vc(c))}}return b}function bd(b){var a=fa(),c;G(b)?m(b.split("\n"),function(b){c=b.indexOf(":");var e=F(T(b.substr(0,c)));b=T(b.substr(c+1));e&&(a[e]=a[e]?a[e]+", "+b:b)}):C(b)&&m(b,function(b,c){var f=F(c),h=T(b);f&&(a[f]=a[f]?a[f]+", "+h:h)});return a}function cd(b){var a;
-return function(c){a||(a=bd(b));return c?(c=a[F(c)],void 0===c&&(c=null),c):a}}function dd(b,a,c,d){if(x(d))return d(b,a,c);m(d,function(d){b=d(b,a,c)});return b}function cf(){var b=this.defaults={transformResponse:[Zb],transformRequest:[function(a){return C(a)&&"[object File]"!==va.call(a)&&"[object Blob]"!==va.call(a)&&"[object FormData]"!==va.call(a)?eb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ja($b),put:ja($b),patch:ja($b)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",
-paramSerializer:"$httpParamSerializer"},a=!1;this.useApplyAsync=function(b){return A(b)?(a=!!b,this):a};var c=!0;this.useLegacyPromiseExtensions=function(a){return A(a)?(c=!!a,this):c};var d=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(e,f,h,g,l,k){function n(a){function d(a){var b=P({},a);b.data=a.data?dd(a.data,a.headers,a.status,f.transformResponse):a.data;a=a.status;return 200<=a&&300>a?b:l.reject(b)}function e(a,b){var c,
-d={};m(a,function(a,e){x(a)?(c=a(b),null!=c&&(d[e]=c)):d[e]=a});return d}if(!da.isObject(a))throw I("$http")("badreq",a);var f=P({method:"get",transformRequest:b.transformRequest,transformResponse:b.transformResponse,paramSerializer:b.paramSerializer},a);f.headers=function(a){var c=b.headers,d=P({},a.headers),f,g,h,c=P({},c.common,c[F(a.method)]);a:for(f in c){g=F(f);for(h in d)if(F(h)===g)continue a;d[f]=c[f]}return e(d,ja(a))}(a);f.method=sb(f.method);f.paramSerializer=G(f.paramSerializer)?k.get(f.paramSerializer):
-f.paramSerializer;var g=[function(a){var c=a.headers,e=dd(a.data,cd(c),w,a.transformRequest);v(e)&&m(c,function(a,b){"content-type"===F(b)&&delete c[b]});v(a.withCredentials)&&!v(b.withCredentials)&&(a.withCredentials=b.withCredentials);return p(a,e).then(d,d)},w],h=l.when(f);for(m(E,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){a=g.shift();var r=g.shift(),h=h.then(a,r)}c?(h.success=function(a){Sa(a,
-"fn");h.then(function(b){a(b.data,b.status,b.headers,f)});return h},h.error=function(a){Sa(a,"fn");h.then(null,function(b){a(b.data,b.status,b.headers,f)});return h}):(h.success=ed("success"),h.error=ed("error"));return h}function p(c,d){function h(b,c,d,e){function f(){k(c,b,d,e)}L&&(200<=b&&300>b?L.put(ba,[b,c,bd(d),e]):L.remove(ba));a?g.$applyAsync(f):(f(),g.$$phase||g.$apply())}function k(a,b,d,e){b=-1<=b?b:0;(200<=b&&300>b?O.resolve:O.reject)({data:a,status:b,headers:cd(d),config:c,statusText:e})}
-function p(a){k(a.data,a.status,ja(a.headers()),a.statusText)}function E(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var O=l.defer(),H=O.promise,L,m,S=c.headers,ba=r(c.url,c.paramSerializer(c.params));n.pendingRequests.push(c);H.then(E,E);!c.cache&&!b.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(L=C(c.cache)?c.cache:C(b.cache)?b.cache:t);L&&(m=L.get(ba),A(m)?m&&x(m.then)?m.then(p,p):J(m)?k(m[1],m[0],ja(m[2]),m[3]):k(m,200,{},"OK"):L.put(ba,H));v(m)&&((m=
-fd(c.url)?f()[c.xsrfCookieName||b.xsrfCookieName]:w)&&(S[c.xsrfHeaderName||b.xsrfHeaderName]=m),e(c.method,ba,d,h,S,c.timeout,c.withCredentials,c.responseType));return H}function r(a,b){0<b.length&&(a+=(-1==a.indexOf("?")?"?":"&")+b);return a}var t=h("$http");b.paramSerializer=G(b.paramSerializer)?k.get(b.paramSerializer):b.paramSerializer;var E=[];m(d,function(a){E.unshift(G(a)?k.get(a):k.invoke(a))});n.pendingRequests=[];(function(a){m(arguments,function(a){n[a]=function(b,c){return n(P({},c||{},
-{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){m(arguments,function(a){n[a]=function(b,c,d){return n(P({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=b;return n}]}function gf(){this.$get=function(){return function(){return new Q.XMLHttpRequest}}}function ff(){this.$get=["$browser","$window","$document","$xhrFactory",function(b,a,c,d){return Sf(b,d,b.defer,a.angular.callbacks,c[0])}]}function Sf(b,a,c,d,e){function f(a,b,c){var f=e.createElement("script"),
-n=null;f.type="text/javascript";f.src=a;f.async=!0;n=function(a){f.removeEventListener("load",n,!1);f.removeEventListener("error",n,!1);e.body.removeChild(f);f=null;var h=-1,t="unknown";a&&("load"!==a.type||d[b].called||(a={type:"error"}),t=a.type,h="error"===a.type?404:200);c&&c(h,t)};f.addEventListener("load",n,!1);f.addEventListener("error",n,!1);e.body.appendChild(f);return n}return function(e,g,l,k,n,p,r,t){function E(){q&&q();z&&z.abort()}function K(a,d,e,f,g){A(s)&&c.cancel(s);q=z=null;a(d,
-e,f,g);b.$$completeOutstandingRequest(y)}b.$$incOutstandingRequestCount();g=g||b.url();if("jsonp"==F(e)){var u="_"+(d.counter++).toString(36);d[u]=function(a){d[u].data=a;d[u].called=!0};var q=f(g.replace("JSON_CALLBACK","angular.callbacks."+u),u,function(a,b){K(k,a,d[u].data,"",b);d[u]=y})}else{var z=a(e,g);z.open(e,g,!0);m(n,function(a,b){A(a)&&z.setRequestHeader(b,a)});z.onload=function(){var a=z.statusText||"",b="response"in z?z.response:z.responseText,c=1223===z.status?204:z.status;0===c&&(c=
-b?200:"file"==Aa(g).protocol?404:0);K(k,c,b,z.getAllResponseHeaders(),a)};e=function(){K(k,-1,null,null,"")};z.onerror=e;z.onabort=e;r&&(z.withCredentials=!0);if(t)try{z.responseType=t}catch(N){if("json"!==t)throw N;}z.send(v(l)?null:l)}if(0<p)var s=c(E,p);else p&&x(p.then)&&p.then(E)}}function af(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(a){return"\\\\\\"+
-a}function h(c){return c.replace(n,b).replace(p,a)}function g(f,g,n,p){function u(a){try{var b=a;a=n?e.getTrusted(n,b):e.valueOf(b);var c;if(p&&!A(a))c=a;else if(null==a)c="";else{switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=eb(a)}c=a}return c}catch(g){d(La.interr(f,g))}}p=!!p;for(var q,m,N=0,s=[],O=[],H=f.length,L=[],W=[];N<H;)if(-1!=(q=f.indexOf(b,N))&&-1!=(m=f.indexOf(a,q+l)))N!==q&&L.push(h(f.substring(N,q))),N=f.substring(q+l,m),s.push(N),O.push(c(N,u)),N=m+k,W.push(L.length),
-L.push("");else{N!==H&&L.push(h(f.substring(N)));break}n&&1<L.length&&La.throwNoconcat(f);if(!g||s.length){var S=function(a){for(var b=0,c=s.length;b<c;b++){if(p&&v(a[b]))return;L[W[b]]=a[b]}return L.join("")};return P(function(a){var b=0,c=s.length,e=Array(c);try{for(;b<c;b++)e[b]=O[b](a);return S(e)}catch(g){d(La.interr(f,g))}},{exp:f,expressions:s,$$watchDelegate:function(a,b){var c;return a.$watchGroup(O,function(d,e){var f=S(d);x(b)&&b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=b.length,k=a.length,
-n=new RegExp(b.replace(/./g,f),"g"),p=new RegExp(a.replace(/./g,f),"g");g.startSymbol=function(){return b};g.endSymbol=function(){return a};return g}]}function bf(){this.$get=["$rootScope","$window","$q","$$q",function(b,a,c,d){function e(e,g,l,k){var n=4<arguments.length,p=n?ua.call(arguments,4):[],r=a.setInterval,t=a.clearInterval,E=0,K=A(k)&&!k,u=(K?d:c).defer(),q=u.promise;l=A(l)?l:0;q.then(null,null,n?function(){e.apply(null,p)}:e);q.$$intervalId=r(function(){u.notify(E++);0<l&&E>=l&&(u.resolve(E),
-t(q.$$intervalId),delete f[q.$$intervalId]);K||b.$apply()},g);f[q.$$intervalId]=u;return q}var f={};e.cancel=function(b){return b&&b.$$intervalId in f?(f[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId),delete f[b.$$intervalId],!0):!1};return e}]}function ac(b){b=b.split("/");for(var a=b.length;a--;)b[a]=ob(b[a]);return b.join("/")}function gd(b,a){var c=Aa(b);a.$$protocol=c.protocol;a.$$host=c.hostname;a.$$port=Y(c.port)||Tf[c.protocol]||null}function hd(b,a){var c="/"!==b.charAt(0);
-c&&(b="/"+b);var d=Aa(b);a.$$path=decodeURIComponent(c&&"/"===d.pathname.charAt(0)?d.pathname.substring(1):d.pathname);a.$$search=yc(d.search);a.$$hash=decodeURIComponent(d.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function sa(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function Ja(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function Cb(b){return b.replace(/(#.+)|#$/,"$1")}function bc(b,a,c){this.$$html5=!0;c=c||"";gd(b,this);this.$$parse=function(b){var c=sa(a,
-b);if(!G(c))throw Db("ipthprfx",b,a);hd(c,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var b=Pb(this.$$search),c=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=ac(this.$$path)+(b?"?"+b:"")+c;this.$$absUrl=a+this.$$url.substr(1)};this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,h;A(f=sa(b,d))?(h=f,h=A(f=sa(c,f))?a+(sa("/",f)||f):b+h):A(f=sa(a,d))?h=a+f:a==d+"/"&&(h=a);h&&this.$$parse(h);return!!h}}function cc(b,a,c){gd(b,this);
-this.$$parse=function(d){var e=sa(b,d)||sa(a,d),f;v(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",v(e)&&(b=d,this.replace())):(f=sa(c,e),v(f)&&(f=e));hd(f,this);d=this.$$path;var e=b,h=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,""));h.exec(f)||(d=(f=h.exec(d))?f[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var a=Pb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=ac(this.$$path)+(a?"?"+a:"")+e;this.$$absUrl=b+(this.$$url?c+this.$$url:"")};this.$$parseLinkUrl=
-function(a,c){return Ja(b)==Ja(a)?(this.$$parse(a),!0):!1}}function id(b,a,c){this.$$html5=!0;cc.apply(this,arguments);this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,h;b==Ja(d)?f=d:(h=sa(a,d))?f=b+c+h:a===d+"/"&&(f=a);f&&this.$$parse(f);return!!f};this.$$compose=function(){var a=Pb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=ac(this.$$path)+(a?"?"+a:"")+e;this.$$absUrl=b+c+this.$$url}}function Eb(b){return function(){return this[b]}}function jd(b,
-a){return function(c){if(v(c))return this[b];this[b]=a(c);this.$$compose();return this}}function hf(){var b="",a={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(a){return A(a)?(b=a,this):b};this.html5Mode=function(b){return bb(b)?(a.enabled=b,this):C(b)?(bb(b.enabled)&&(a.enabled=b.enabled),bb(b.requireBase)&&(a.requireBase=b.requireBase),bb(b.rewriteLinks)&&(a.rewriteLinks=b.rewriteLinks),this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(c,
-d,e,f,h){function g(a,b,c){var e=k.url(),f=k.$$state;try{d.url(a,b,c),k.$$state=d.state()}catch(g){throw k.url(e),k.$$state=f,g;}}function l(a,b){c.$broadcast("$locationChangeSuccess",k.absUrl(),a,k.$$state,b)}var k,n;n=d.baseHref();var p=d.url(),r;if(a.enabled){if(!n&&a.requireBase)throw Db("nobase");r=p.substring(0,p.indexOf("/",p.indexOf("//")+2))+(n||"/");n=e.history?bc:id}else r=Ja(p),n=cc;var t=r.substr(0,Ja(r).lastIndexOf("/")+1);k=new n(r,t,"#"+b);k.$$parseLinkUrl(p,p);k.$$state=d.state();
-var E=/^\s*(javascript|mailto):/i;f.on("click",function(b){if(a.rewriteLinks&&!b.ctrlKey&&!b.metaKey&&!b.shiftKey&&2!=b.which&&2!=b.button){for(var e=B(b.target);"a"!==wa(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var g=e.prop("href"),l=e.attr("href")||e.attr("xlink:href");C(g)&&"[object SVGAnimatedString]"===g.toString()&&(g=Aa(g.animVal).href);E.test(g)||!g||e.attr("target")||b.isDefaultPrevented()||!k.$$parseLinkUrl(g,l)||(b.preventDefault(),k.absUrl()!=d.url()&&(c.$apply(),h.angular["ff-684208-preventDefault"]=
-!0))}});Cb(k.absUrl())!=Cb(p)&&d.url(k.absUrl(),!0);var K=!0;d.onUrlChange(function(a,b){v(sa(t,a))?h.location.href=a:(c.$evalAsync(function(){var d=k.absUrl(),e=k.$$state,f;k.$$parse(a);k.$$state=b;f=c.$broadcast("$locationChangeStart",a,d,b,e).defaultPrevented;k.absUrl()===a&&(f?(k.$$parse(d),k.$$state=e,g(d,!1,e)):(K=!1,l(d,e)))}),c.$$phase||c.$digest())});c.$watch(function(){var a=Cb(d.url()),b=Cb(k.absUrl()),f=d.state(),h=k.$$replace,r=a!==b||k.$$html5&&e.history&&f!==k.$$state;if(K||r)K=!1,
-c.$evalAsync(function(){var b=k.absUrl(),d=c.$broadcast("$locationChangeStart",b,a,k.$$state,f).defaultPrevented;k.absUrl()===b&&(d?(k.$$parse(a),k.$$state=f):(r&&g(b,h,f===k.$$state?null:k.$$state),l(a,f)))});k.$$replace=!1});return k}]}function jf(){var b=!0,a=this;this.debugEnabled=function(a){return A(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=
-a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||y;a=!1;try{a=!!e.apply}catch(l){}return a?function(){var a=[];m(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function Xa(b,a){if("__defineGetter__"===b||"__defineSetter__"===b||"__lookupGetter__"===b||"__lookupSetter__"===
-b||"__proto__"===b)throw Z("isecfld",a);return b}function kd(b,a){b+="";if(!G(b))throw Z("iseccst",a);return b}function Ba(b,a){if(b){if(b.constructor===b)throw Z("isecfn",a);if(b.window===b)throw Z("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw Z("isecdom",a);if(b===Object)throw Z("isecobj",a);}return b}function ld(b,a){if(b){if(b.constructor===b)throw Z("isecfn",a);if(b===Uf||b===Vf||b===Wf)throw Z("isecff",a);}}function md(b,a){if(b&&(b===(0).constructor||b===(!1).constructor||
-b==="".constructor||b==={}.constructor||b===[].constructor||b===Function.constructor))throw Z("isecaf",a);}function Xf(b,a){return"undefined"!==typeof b?b:a}function nd(b,a){return"undefined"===typeof b?a:"undefined"===typeof a?b:b+a}function U(b,a){var c,d;switch(b.type){case s.Program:c=!0;m(b.body,function(b){U(b.expression,a);c=c&&b.expression.constant});b.constant=c;break;case s.Literal:b.constant=!0;b.toWatch=[];break;case s.UnaryExpression:U(b.argument,a);b.constant=b.argument.constant;b.toWatch=
-b.argument.toWatch;break;case s.BinaryExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=b.left.toWatch.concat(b.right.toWatch);break;case s.LogicalExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=b.constant?[]:[b];break;case s.ConditionalExpression:U(b.test,a);U(b.alternate,a);U(b.consequent,a);b.constant=b.test.constant&&b.alternate.constant&&b.consequent.constant;b.toWatch=b.constant?[]:[b];break;case s.Identifier:b.constant=
-!1;b.toWatch=[b];break;case s.MemberExpression:U(b.object,a);b.computed&&U(b.property,a);b.constant=b.object.constant&&(!b.computed||b.property.constant);b.toWatch=[b];break;case s.CallExpression:c=b.filter?!a(b.callee.name).$stateful:!1;d=[];m(b.arguments,function(b){U(b,a);c=c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=b.filter&&!a(b.callee.name).$stateful?d:[b];break;case s.AssignmentExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;
-b.toWatch=[b];break;case s.ArrayExpression:c=!0;d=[];m(b.elements,function(b){U(b,a);c=c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=d;break;case s.ObjectExpression:c=!0;d=[];m(b.properties,function(b){U(b.value,a);c=c&&b.value.constant;b.value.constant||d.push.apply(d,b.value.toWatch)});b.constant=c;b.toWatch=d;break;case s.ThisExpression:b.constant=!1,b.toWatch=[]}}function od(b){if(1==b.length){b=b[0].expression;var a=b.toWatch;return 1!==a.length?a:a[0]!==b?a:w}}
-function pd(b){return b.type===s.Identifier||b.type===s.MemberExpression}function qd(b){if(1===b.body.length&&pd(b.body[0].expression))return{type:s.AssignmentExpression,left:b.body[0].expression,right:{type:s.NGValueParameter},operator:"="}}function rd(b){return 0===b.body.length||1===b.body.length&&(b.body[0].expression.type===s.Literal||b.body[0].expression.type===s.ArrayExpression||b.body[0].expression.type===s.ObjectExpression)}function sd(b,a){this.astBuilder=b;this.$filter=a}function td(b,
-a){this.astBuilder=b;this.$filter=a}function Fb(b){return"constructor"==b}function dc(b){return x(b.valueOf)?b.valueOf():Yf.call(b)}function kf(){var b=fa(),a=fa();this.$get=["$filter",function(c){function d(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=dc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function e(a,b,c,e,f){var g=e.inputs,h;if(1===g.length){var k=d,g=g[0];return a.$watch(function(a){var b=g(a);d(b,k)||(h=e(a,w,w,[b]),k=b&&dc(b));return h},b,c,f)}for(var l=[],n=[],p=0,
-m=g.length;p<m;p++)l[p]=d,n[p]=null;return a.$watch(function(a){for(var b=!1,c=0,f=g.length;c<f;c++){var k=g[c](a);if(b||(b=!d(k,l[c])))n[c]=k,l[c]=k&&dc(k)}b&&(h=e(a,w,w,n));return h},b,c,f)}function f(a,b,c,d){var e,f;return e=a.$watch(function(a){return d(a)},function(a,c,d){f=a;x(b)&&b.apply(this,arguments);A(a)&&d.$$postDigest(function(){A(f)&&e()})},c)}function h(a,b,c,d){function e(a){var b=!0;m(a,function(a){A(a)||(b=!1)});return b}var f,g;return f=a.$watch(function(a){return d(a)},function(a,
-c,d){g=a;x(b)&&b.call(this,a,c,d);e(a)&&d.$$postDigest(function(){e(g)&&f()})},c)}function g(a,b,c,d){var e;return e=a.$watch(function(a){return d(a)},function(a,c,d){x(b)&&b.apply(this,arguments);e()},c)}function l(a,b){if(!b)return a;var c=a.$$watchDelegate,c=c!==h&&c!==f?function(c,d,e,f){e=a(c,d,e,f);return b(e,c,d)}:function(c,d,e,f){e=a(c,d,e,f);c=b(e,c,d);return A(e)?c:e};a.$$watchDelegate&&a.$$watchDelegate!==e?c.$$watchDelegate=a.$$watchDelegate:b.$stateful||(c.$$watchDelegate=e,c.inputs=
-a.inputs?a.inputs:[a]);return c}var k=Fa().noUnsafeEval,n={csp:k,expensiveChecks:!1},p={csp:k,expensiveChecks:!0};return function(d,k,E){var m,u,q;switch(typeof d){case "string":q=d=d.trim();var s=E?a:b;m=s[q];m||(":"===d.charAt(0)&&":"===d.charAt(1)&&(u=!0,d=d.substring(2)),E=E?p:n,m=new ec(E),m=(new fc(m,c,E)).parse(d),m.constant?m.$$watchDelegate=g:u?m.$$watchDelegate=m.literal?h:f:m.inputs&&(m.$$watchDelegate=e),s[q]=m);return l(m,k);case "function":return l(d,k);default:return y}}}]}function mf(){this.$get=
-["$rootScope","$exceptionHandler",function(b,a){return ud(function(a){b.$evalAsync(a)},a)}]}function nf(){this.$get=["$browser","$exceptionHandler",function(b,a){return ud(function(a){b.defer(a)},a)}]}function ud(b,a){function c(a,b,c){function d(b){return function(c){e||(e=!0,b.call(a,c))}}var e=!1;return[d(b),d(c)]}function d(){this.$$state={status:0}}function e(a,b){return function(c){b.call(a,c)}}function f(c){!c.processScheduled&&c.pending&&(c.processScheduled=!0,b(function(){var b,d,e;e=c.pending;
-c.processScheduled=!1;c.pending=w;for(var f=0,g=e.length;f<g;++f){d=e[f][0];b=e[f][c.status];try{x(b)?d.resolve(b(c.value)):1===c.status?d.resolve(c.value):d.reject(c.value)}catch(h){d.reject(h),a(h)}}}))}function h(){this.promise=new d;this.resolve=e(this,this.resolve);this.reject=e(this,this.reject);this.notify=e(this,this.notify)}var g=I("$q",TypeError);P(d.prototype,{then:function(a,b,c){if(v(a)&&v(b)&&v(c))return this;var d=new h;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,
-a,b,c]);0<this.$$state.status&&f(this.$$state);return d.promise},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return k(b,!0,a)},function(b){return k(b,!1,a)},b)}});P(h.prototype,{resolve:function(a){this.promise.$$state.status||(a===this.promise?this.$$reject(g("qcycle",a)):this.$$resolve(a))},$$resolve:function(b){var d,e;e=c(this,this.$$resolve,this.$$reject);try{if(C(b)||x(b))d=b&&b.then;x(d)?(this.promise.$$state.status=-1,d.call(b,e[0],e[1],
-this.notify)):(this.promise.$$state.value=b,this.promise.$$state.status=1,f(this.promise.$$state))}catch(g){e[1](g),a(g)}},reject:function(a){this.promise.$$state.status||this.$$reject(a)},$$reject:function(a){this.promise.$$state.value=a;this.promise.$$state.status=2;f(this.promise.$$state)},notify:function(c){var d=this.promise.$$state.pending;0>=this.promise.$$state.status&&d&&d.length&&b(function(){for(var b,e,f=0,g=d.length;f<g;f++){e=d[f][0];b=d[f][3];try{e.notify(x(b)?b(c):c)}catch(h){a(h)}}})}});
-var l=function(a,b){var c=new h;b?c.resolve(a):c.reject(a);return c.promise},k=function(a,b,c){var d=null;try{x(c)&&(d=c())}catch(e){return l(e,!1)}return d&&x(d.then)?d.then(function(){return l(a,b)},function(a){return l(a,!1)}):l(a,b)},n=function(a,b,c,d){var e=new h;e.resolve(a);return e.promise.then(b,c,d)},p=function t(a){if(!x(a))throw g("norslvr",a);if(!(this instanceof t))return new t(a);var b=new h;a(function(a){b.resolve(a)},function(a){b.reject(a)});return b.promise};p.defer=function(){return new h};
-p.reject=function(a){var b=new h;b.reject(a);return b.promise};p.when=n;p.resolve=n;p.all=function(a){var b=new h,c=0,d=J(a)?[]:{};m(a,function(a,e){c++;n(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise};return p}function wf(){this.$get=["$window","$timeout",function(b,a){var c=b.requestAnimationFrame||b.webkitRequestAnimationFrame,d=b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.webkitCancelRequestAnimationFrame,
-e=!!c,f=e?function(a){var b=c(a);return function(){d(b)}}:function(b){var c=a(b,16.66,!1);return function(){a.cancel(c)}};f.supported=e;return f}]}function lf(){function b(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++nb;this.$$ChildScope=null}b.prototype=a;return b}var a=10,c=I("$rootScope"),d=null,e=null;this.digestTtl=function(b){arguments.length&&(a=b);return a};this.$get=
-["$injector","$exceptionHandler","$parse","$browser",function(f,h,g,l){function k(a){a.currentScope.$$destroyed=!0}function n(){this.$id=++nb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function p(a){if(q.$$phase)throw c("inprog",q.$$phase);q.$$phase=a}function r(a,b){do a.$$watchersCount+=b;while(a=
-a.$parent)}function t(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function E(){}function s(){for(;w.length;)try{w.shift()()}catch(a){h(a)}e=null}function u(){null===e&&(e=l.defer(function(){q.$apply(s)}))}n.prototype={constructor:n,$new:function(a,c){var d;c=c||this;a?(d=new n,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=b(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=
-d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(a||c!=this)&&d.$on("$destroy",k);return d},$watch:function(a,b,c,e){var f=g(a);if(f.$$watchDelegate)return f.$$watchDelegate(this,b,c,f,a);var h=this,k=h.$$watchers,l={fn:b,last:E,get:f,exp:e||a,eq:!!c};d=null;x(b)||(l.fn=y);k||(k=h.$$watchers=[]);k.unshift(l);r(this,1);return function(){0<=cb(k,l)&&r(h,-1);d=null}},$watchGroup:function(a,b){function c(){h=!1;k?(k=!1,b(e,e,g)):b(e,d,g)}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;
-if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});m(a,function(a,b){var k=g.$watch(a,function(a,f){e[b]=a;d[b]=f;h||(h=!0,g.$evalAsync(c))});f.push(k)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!v(e)){if(C(e))if(Da(e))for(f!==p&&(f=p,t=f.length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],
-g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==r&&(f=r={},t=0,l++);a=0;for(b in e)ta.call(e,b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(t>a)for(b in l++,f)ta.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,h,k=1<b.length,l=0,n=g(a,c),p=[],r={},q=!0,t=0;return this.$watch(n,function(){q?(q=!1,b(e,e,d)):b(e,h,d);if(k)if(C(e))if(Da(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h=
-{},e)ta.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var b,f,g,k,n,r,t=a,m,u=[],D,v;p("$digest");l.$$checkUrlChange();this===q&&null!==e&&(l.defer.cancel(e),s());d=null;do{r=!1;for(m=this;z.length;){try{v=z.shift(),v.scope.$eval(v.expression,v.locals)}catch(w){h(w)}d=null}a:do{if(k=m.$$watchers)for(n=k.length;n--;)try{if(b=k[n])if((f=b.get(m))!==(g=b.last)&&!(b.eq?ka(f,g):"number"===typeof f&&"number"===typeof g&&isNaN(f)&&isNaN(g)))r=!0,d=b,b.last=b.eq?ha(f,null):f,b.fn(f,g===E?f:g,m),5>
-t&&(D=4-t,u[D]||(u[D]=[]),u[D].push({msg:x(b.exp)?"fn: "+(b.exp.name||b.exp.toString()):b.exp,newVal:f,oldVal:g}));else if(b===d){r=!1;break a}}catch(y){h(y)}if(!(k=m.$$watchersCount&&m.$$childHead||m!==this&&m.$$nextSibling))for(;m!==this&&!(k=m.$$nextSibling);)m=m.$parent}while(m=k);if((r||z.length)&&!t--)throw q.$$phase=null,c("infdig",a,u);}while(r||z.length);for(q.$$phase=null;N.length;)try{N.shift()()}catch(A){h(A)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");
-this.$$destroyed=!0;this===q&&l.$$applicationDestroyed();r(this,-this.$$watchersCount);for(var b in this.$$listenerCount)t(this,this.$$listenerCount[b],b);a&&a.$$childHead==this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=y;this.$on=
-this.$watch=this.$watchGroup=function(){return y};this.$$listeners={};this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){q.$$phase||z.length||l.defer(function(){z.length&&q.$digest()});z.push({scope:this,expression:a,locals:b})},$$postDigest:function(a){N.push(a)},$apply:function(a){try{p("$apply");try{return this.$eval(a)}finally{q.$$phase=null}}catch(b){h(b)}finally{try{q.$digest()}catch(c){throw h(c),
-c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&w.push(b);u()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,t(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,f=!1,g={name:a,targetScope:e,stopPropagation:function(){f=!0},preventDefault:function(){g.defaultPrevented=!0},defaultPrevented:!1},
-k=db([g],arguments,1),l,n;do{d=e.$$listeners[a]||c;g.currentScope=e;l=0;for(n=d.length;l<n;l++)if(d[l])try{d[l].apply(null,k)}catch(p){h(p)}else d.splice(l,1),l--,n--;if(f)return g.currentScope=null,g;e=e.$parent}while(e);g.currentScope=null;return g},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var f=db([e],arguments,1),g,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||
-[];g=0;for(k=d.length;g<k;g++)if(d[g])try{d[g].apply(null,f)}catch(l){h(l)}else d.splice(g,1),g--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var q=new n,z=q.$$asyncQueue=[],N=q.$$postDigestQueue=[],w=q.$$applyAsyncQueue=[];return q}]}function ge(){var b=/^\s*(https?|ftp|mailto|tel|file):/,a=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(a){return A(a)?
-(b=a,this):b};this.imgSrcSanitizationWhitelist=function(b){return A(b)?(a=b,this):a};this.$get=function(){return function(c,d){var e=d?a:b,f;f=Aa(c).href;return""===f||f.match(e)?c:"unsafe:"+f}}}function Zf(b){if("self"===b)return b;if(G(b)){if(-1<b.indexOf("***"))throw Ca("iwcard",b);b=vd(b).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return new RegExp("^"+b+"$")}if(Oa(b))return new RegExp("^"+b.source+"$");throw Ca("imatcher");}function wd(b){var a=[];A(b)&&m(b,function(b){a.push(Zf(b))});
-return a}function pf(){this.SCE_CONTEXTS=oa;var b=["self"],a=[];this.resourceUrlWhitelist=function(a){arguments.length&&(b=wd(a));return b};this.resourceUrlBlacklist=function(b){arguments.length&&(a=wd(b));return a};this.$get=["$injector",function(c){function d(a,b){return"self"===a?fd(b):!!a.exec(b.href)}function e(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};
-return b}var f=function(a){throw Ca("unsafe");};c.has("$sanitize")&&(f=c.get("$sanitize"));var h=e(),g={};g[oa.HTML]=e(h);g[oa.CSS]=e(h);g[oa.URL]=e(h);g[oa.JS]=e(h);g[oa.RESOURCE_URL]=e(g[oa.URL]);return{trustAs:function(a,b){var c=g.hasOwnProperty(a)?g[a]:null;if(!c)throw Ca("icontext",a,b);if(null===b||v(b)||""===b)return b;if("string"!==typeof b)throw Ca("itype",a);return new c(b)},getTrusted:function(c,e){if(null===e||v(e)||""===e)return e;var h=g.hasOwnProperty(c)?g[c]:null;if(h&&e instanceof
-h)return e.$$unwrapTrustedValue();if(c===oa.RESOURCE_URL){var h=Aa(e.toString()),p,r,t=!1;p=0;for(r=b.length;p<r;p++)if(d(b[p],h)){t=!0;break}if(t)for(p=0,r=a.length;p<r;p++)if(d(a[p],h)){t=!1;break}if(t)return e;throw Ca("insecurl",e.toString());}if(c===oa.HTML)return f(e);throw Ca("unsafe");},valueOf:function(a){return a instanceof h?a.$$unwrapTrustedValue():a}}}]}function of(){var b=!0;this.enabled=function(a){arguments.length&&(b=!!a);return b};this.$get=["$parse","$sceDelegate",function(a,c){if(b&&
-8>Wa)throw Ca("iequirks");var d=ja(oa);d.isEnabled=function(){return b};d.trustAs=c.trustAs;d.getTrusted=c.getTrusted;d.valueOf=c.valueOf;b||(d.trustAs=d.getTrusted=function(a,b){return b},d.valueOf=$a);d.parseAs=function(b,c){var e=a(c);return e.literal&&e.constant?e:a(c,function(a){return d.getTrusted(b,a)})};var e=d.parseAs,f=d.getTrusted,h=d.trustAs;m(oa,function(a,b){var c=F(b);d[gb("parse_as_"+c)]=function(b){return e(a,b)};d[gb("get_trusted_"+c)]=function(b){return f(a,b)};d[gb("trust_as_"+
-c)]=function(b){return h(a,b)}});return d}]}function qf(){this.$get=["$window","$document",function(b,a){var c={},d=Y((/android (\d+)/.exec(F((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),f=a[0]||{},h,g=/^(Moz|webkit|ms)(?=[A-Z])/,l=f.body&&f.body.style,k=!1,n=!1;if(l){for(var p in l)if(k=g.exec(p)){h=k[0];h=h.substr(0,1).toUpperCase()+h.substr(1);break}h||(h="WebkitOpacity"in l&&"webkit");k=!!("transition"in l||h+"Transition"in l);n=!!("animation"in l||h+"Animation"in
-l);!d||k&&n||(k=G(l.webkitTransition),n=G(l.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hasEvent:function(a){if("input"===a&&11>=Wa)return!1;if(v(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:Fa(),vendorPrefix:h,transitions:k,animations:n,android:d}}]}function sf(){this.$get=["$templateCache","$http","$q","$sce",function(b,a,c,d){function e(f,h){e.totalPendingRequests++;G(f)&&b.get(f)||(f=d.getTrustedResourceUrl(f));var g=a.defaults&&a.defaults.transformResponse;
-J(g)?g=g.filter(function(a){return a!==Zb}):g===Zb&&(g=null);return a.get(f,{cache:b,transformResponse:g})["finally"](function(){e.totalPendingRequests--}).then(function(a){b.put(f,a.data);return a.data},function(a){if(!h)throw ga("tpload",f,a.status,a.statusText);return c.reject(a)})}e.totalPendingRequests=0;return e}]}function tf(){this.$get=["$rootScope","$browser","$location",function(b,a,c){return{findBindings:function(a,b,c){a=a.getElementsByClassName("ng-binding");var h=[];m(a,function(a){var d=
-da.element(a).data("$binding");d&&m(d,function(d){c?(new RegExp("(^|\\s)"+vd(b)+"(\\s|\\||$)")).test(d)&&h.push(a):-1!=d.indexOf(b)&&h.push(a)})});return h},findModels:function(a,b,c){for(var h=["ng-","data-ng-","ng\\:"],g=0;g<h.length;++g){var l=a.querySelectorAll("["+h[g]+"model"+(c?"=":"*=")+'"'+b+'"]');if(l.length)return l}},getLocation:function(){return c.url()},setLocation:function(a){a!==c.url()&&(c.url(a),b.$digest())},whenStable:function(b){a.notifyWhenNoOutstandingRequests(b)}}}]}function uf(){this.$get=
-["$rootScope","$browser","$q","$$q","$exceptionHandler",function(b,a,c,d,e){function f(f,l,k){x(f)||(k=l,l=f,f=y);var n=ua.call(arguments,3),p=A(k)&&!k,r=(p?d:c).defer(),t=r.promise,m;m=a.defer(function(){try{r.resolve(f.apply(null,n))}catch(a){r.reject(a),e(a)}finally{delete h[t.$$timeoutId]}p||b.$apply()},l);t.$$timeoutId=m;h[m]=r;return t}var h={};f.cancel=function(b){return b&&b.$$timeoutId in h?(h[b.$$timeoutId].reject("canceled"),delete h[b.$$timeoutId],a.defer.cancel(b.$$timeoutId)):!1};return f}]}
-function Aa(b){Wa&&($.setAttribute("href",b),b=$.href);$.setAttribute("href",b);return{href:$.href,protocol:$.protocol?$.protocol.replace(/:$/,""):"",host:$.host,search:$.search?$.search.replace(/^\?/,""):"",hash:$.hash?$.hash.replace(/^#/,""):"",hostname:$.hostname,port:$.port,pathname:"/"===$.pathname.charAt(0)?$.pathname:"/"+$.pathname}}function fd(b){b=G(b)?Aa(b):b;return b.protocol===xd.protocol&&b.host===xd.host}function vf(){this.$get=qa(Q)}function yd(b){function a(a){try{return decodeURIComponent(a)}catch(b){return a}}
-var c=b[0]||{},d={},e="";return function(){var b,h,g,l,k;b=c.cookie||"";if(b!==e)for(e=b,b=e.split("; "),d={},g=0;g<b.length;g++)h=b[g],l=h.indexOf("="),0<l&&(k=a(h.substring(0,l)),v(d[k])&&(d[k]=a(h.substring(l+1))));return d}}function zf(){this.$get=yd}function Kc(b){function a(c,d){if(C(c)){var e={};m(c,function(b,c){e[c]=a(c,b)});return e}return b.factory(c+"Filter",d)}this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];a("currency",zd);a("date",Ad);
-a("filter",$f);a("json",ag);a("limitTo",bg);a("lowercase",cg);a("number",Bd);a("orderBy",Cd);a("uppercase",dg)}function $f(){return function(b,a,c){if(!Da(b)){if(null==b)return b;throw I("filter")("notarray",b);}var d;switch(gc(a)){case "function":break;case "boolean":case "null":case "number":case "string":d=!0;case "object":a=eg(a,c,d);break;default:return b}return Array.prototype.filter.call(b,a)}}function eg(b,a,c){var d=C(b)&&"$"in b;!0===a?a=ka:x(a)||(a=function(a,b){if(v(a))return!1;if(null===
-a||null===b)return a===b;if(C(b)||C(a)&&!qc(a))return!1;a=F(""+a);b=F(""+b);return-1!==a.indexOf(b)});return function(e){return d&&!C(e)?Ma(e,b.$,a,!1):Ma(e,b,a,c)}}function Ma(b,a,c,d,e){var f=gc(b),h=gc(a);if("string"===h&&"!"===a.charAt(0))return!Ma(b,a.substring(1),c,d);if(J(b))return b.some(function(b){return Ma(b,a,c,d)});switch(f){case "object":var g;if(d){for(g in b)if("$"!==g.charAt(0)&&Ma(b[g],a,c,!0))return!0;return e?!1:Ma(b,a,c,!1)}if("object"===h){for(g in a)if(e=a[g],!x(e)&&!v(e)&&
-(f="$"===g,!Ma(f?b:b[g],e,c,f,f)))return!1;return!0}return c(b,a);case "function":return!1;default:return c(b,a)}}function gc(b){return null===b?"null":typeof b}function zd(b){var a=b.NUMBER_FORMATS;return function(b,d,e){v(d)&&(d=a.CURRENCY_SYM);v(e)&&(e=a.PATTERNS[1].maxFrac);return null==b?b:Dd(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,e).replace(/\u00A4/g,d)}}function Bd(b){var a=b.NUMBER_FORMATS;return function(b,d){return null==b?b:Dd(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Dd(b,
-a,c,d,e){if(C(b))return"";var f=0>b;b=Math.abs(b);var h=Infinity===b;if(!h&&!isFinite(b))return"";var g=b+"",l="",k=!1,n=[];h&&(l="\u221e");if(!h&&-1!==g.indexOf("e")){var p=g.match(/([\d\.]+)e(-?)(\d+)/);p&&"-"==p[2]&&p[3]>e+1?b=0:(l=g,k=!0)}if(h||k)0<e&&1>b&&(l=b.toFixed(e),b=parseFloat(l),l=l.replace(hc,d));else{h=(g.split(hc)[1]||"").length;v(e)&&(e=Math.min(Math.max(a.minFrac,h),a.maxFrac));b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);var h=(""+b).split(hc),g=h[0],h=h[1]||"",p=0,
-r=a.lgSize,t=a.gSize;if(g.length>=r+t)for(p=g.length-r,k=0;k<p;k++)0===(p-k)%t&&0!==k&&(l+=c),l+=g.charAt(k);for(k=p;k<g.length;k++)0===(g.length-k)%r&&0!==k&&(l+=c),l+=g.charAt(k);for(;h.length<e;)h+="0";e&&"0"!==e&&(l+=d+h.substr(0,e))}0===b&&(f=!1);n.push(f?a.negPre:a.posPre,l,f?a.negSuf:a.posSuf);return n.join("")}function Gb(b,a,c){var d="";0>b&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function aa(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(0<
-c||e>-c)e+=c;0===e&&-12==c&&(e=12);return Gb(e,a,d)}}function Hb(b,a){return function(c,d){var e=c["get"+b](),f=sb(a?"SHORT"+b:b);return d[f][e]}}function Ed(b){var a=(new Date(b,0,1)).getDay();return new Date(b,0,(4>=a?5:12)-a)}function Fd(b){return function(a){var c=Ed(a.getFullYear());a=+new Date(a.getFullYear(),a.getMonth(),a.getDate()+(4-a.getDay()))-+c;a=1+Math.round(a/6048E5);return Gb(a,b)}}function ic(b,a){return 0>=b.getFullYear()?a.ERAS[0]:a.ERAS[1]}function Ad(b){function a(a){var b;if(b=
-a.match(c)){a=new Date(0);var f=0,h=0,g=b[8]?a.setUTCFullYear:a.setFullYear,l=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=Y(b[9]+b[10]),h=Y(b[9]+b[11]));g.call(a,Y(b[1]),Y(b[2])-1,Y(b[3]));f=Y(b[4]||0)-f;h=Y(b[5]||0)-h;g=Y(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));l.call(a,f,h,g,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e,f){var h="",g=[],l,k;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;G(c)&&(c=
-fg.test(c)?Y(c):a(c));V(c)&&(c=new Date(c));if(!ea(c)||!isFinite(c.getTime()))return c;for(;e;)(k=gg.exec(e))?(g=db(g,k,1),e=g.pop()):(g.push(e),e=null);var n=c.getTimezoneOffset();f&&(n=wc(f,c.getTimezoneOffset()),c=Ob(c,f,!0));m(g,function(a){l=hg[a];h+=l?l(c,b.DATETIME_FORMATS,n):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return h}}function ag(){return function(b,a){v(a)&&(a=2);return eb(b,a)}}function bg(){return function(b,a,c){a=Infinity===Math.abs(Number(a))?Number(a):Y(a);if(isNaN(a))return b;
-V(b)&&(b=b.toString());if(!J(b)&&!G(b))return b;c=!c||isNaN(c)?0:Y(c);c=0>c&&c>=-b.length?b.length+c:c;return 0<=a?b.slice(c,c+a):0===c?b.slice(a,b.length):b.slice(Math.max(0,c+a),c)}}function Cd(b){function a(a,c){c=c?-1:1;return a.map(function(a){var d=1,g=$a;if(x(a))g=a;else if(G(a)){if("+"==a.charAt(0)||"-"==a.charAt(0))d="-"==a.charAt(0)?-1:1,a=a.substring(1);if(""!==a&&(g=b(a),g.constant))var l=g(),g=function(a){return a[l]}}return{get:g,descending:d*c}})}function c(a){switch(typeof a){case "number":case "boolean":case "string":return!0;
-default:return!1}}return function(b,e,f){if(!Da(b))return b;J(e)||(e=[e]);0===e.length&&(e=["+"]);var h=a(e,f);h.push({get:function(){return{}},descending:f?-1:1});b=Array.prototype.map.call(b,function(a,b){return{value:a,predicateValues:h.map(function(d){var e=d.get(a);d=typeof e;if(null===e)d="string",e="null";else if("string"===d)e=e.toLowerCase();else if("object"===d)a:{if("function"===typeof e.valueOf&&(e=e.valueOf(),c(e)))break a;if(qc(e)&&(e=e.toString(),c(e)))break a;e=b}return{value:e,type:d}})}});
-b.sort(function(a,b){for(var c=0,d=0,e=h.length;d<e;++d){var c=a.predicateValues[d],f=b.predicateValues[d],t=0;c.type===f.type?c.value!==f.value&&(t=c.value<f.value?-1:1):t=c.type<f.type?-1:1;if(c=t*h[d].descending)break}return c});return b=b.map(function(a){return a.value})}}function Na(b){x(b)&&(b={link:b});b.restrict=b.restrict||"AC";return qa(b)}function Gd(b,a,c,d,e){var f=this,h=[];f.$error={};f.$$success={};f.$pending=w;f.$name=e(a.name||a.ngForm||"")(c);f.$dirty=!1;f.$pristine=!0;f.$valid=
-!0;f.$invalid=!1;f.$submitted=!1;f.$$parentForm=Ib;f.$rollbackViewValue=function(){m(h,function(a){a.$rollbackViewValue()})};f.$commitViewValue=function(){m(h,function(a){a.$commitViewValue()})};f.$addControl=function(a){Ta(a.$name,"input");h.push(a);a.$name&&(f[a.$name]=a);a.$$parentForm=f};f.$$renameControl=function(a,b){var c=a.$name;f[c]===a&&delete f[c];f[b]=a;a.$name=b};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];m(f.$pending,function(b,c){f.$setValidity(c,null,a)});
-m(f.$error,function(b,c){f.$setValidity(c,null,a)});m(f.$$success,function(b,c){f.$setValidity(c,null,a)});cb(h,a);a.$$parentForm=Ib};Hd({ctrl:this,$element:b,set:function(a,b,c){var d=a[b];d?-1===d.indexOf(c)&&d.push(c):a[b]=[c]},unset:function(a,b,c){var d=a[b];d&&(cb(d,c),0===d.length&&delete a[b])},$animate:d});f.$setDirty=function(){d.removeClass(b,Ya);d.addClass(b,Jb);f.$dirty=!0;f.$pristine=!1;f.$$parentForm.$setDirty()};f.$setPristine=function(){d.setClass(b,Ya,Jb+" ng-submitted");f.$dirty=
-!1;f.$pristine=!0;f.$submitted=!1;m(h,function(a){a.$setPristine()})};f.$setUntouched=function(){m(h,function(a){a.$setUntouched()})};f.$setSubmitted=function(){d.addClass(b,"ng-submitted");f.$submitted=!0;f.$$parentForm.$setSubmitted()}}function jc(b){b.$formatters.push(function(a){return b.$isEmpty(a)?a:a.toString()})}function jb(b,a,c,d,e,f){var h=F(a[0].type);if(!e.android){var g=!1;a.on("compositionstart",function(a){g=!0});a.on("compositionend",function(){g=!1;l()})}var l=function(b){k&&(f.defer.cancel(k),
-k=null);if(!g){var e=a.val();b=b&&b.type;"password"===h||c.ngTrim&&"false"===c.ngTrim||(e=T(e));(d.$viewValue!==e||""===e&&d.$$hasNativeValidators)&&d.$setViewValue(e,b)}};if(e.hasEvent("input"))a.on("input",l);else{var k,n=function(a,b,c){k||(k=f.defer(function(){k=null;b&&b.value===c||l(a)}))};a.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||n(a,this,this.value)});if(e.hasEvent("paste"))a.on("paste cut",n)}a.on("change",l);d.$render=function(){var b=d.$isEmpty(d.$viewValue)?
-"":d.$viewValue;a.val()!==b&&a.val(b)}}function Kb(b,a){return function(c,d){var e,f;if(ea(c))return c;if(G(c)){'"'==c.charAt(0)&&'"'==c.charAt(c.length-1)&&(c=c.substring(1,c.length-1));if(ig.test(c))return new Date(c);b.lastIndex=0;if(e=b.exec(c))return e.shift(),f=d?{yyyy:d.getFullYear(),MM:d.getMonth()+1,dd:d.getDate(),HH:d.getHours(),mm:d.getMinutes(),ss:d.getSeconds(),sss:d.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},m(e,function(b,c){c<a.length&&(f[a[c]]=+b)}),new Date(f.yyyy,
-f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function kb(b,a,c,d){return function(e,f,h,g,l,k,n){function p(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function r(a){return A(a)&&!ea(a)?c(a)||w:a}Id(e,f,h,g);jb(e,f,h,g,l,k);var t=g&&g.$options&&g.$options.timezone,m;g.$$parserName=b;g.$parsers.push(function(b){return g.$isEmpty(b)?null:a.test(b)?(b=c(b,m),t&&(b=Ob(b,t)),b):w});g.$formatters.push(function(a){if(a&&!ea(a))throw lb("datefmt",a);if(p(a))return(m=a)&&t&&(m=Ob(m,t,!0)),
-n("date")(a,d,t);m=null;return""});if(A(h.min)||h.ngMin){var s;g.$validators.min=function(a){return!p(a)||v(s)||c(a)>=s};h.$observe("min",function(a){s=r(a);g.$validate()})}if(A(h.max)||h.ngMax){var u;g.$validators.max=function(a){return!p(a)||v(u)||c(a)<=u};h.$observe("max",function(a){u=r(a);g.$validate()})}}}function Id(b,a,c,d){(d.$$hasNativeValidators=C(a[0].validity))&&d.$parsers.push(function(b){var c=a.prop("validity")||{};return c.badInput&&!c.typeMismatch?w:b})}function Jd(b,a,c,d,e){if(A(d)){b=
-b(d);if(!b.constant)throw lb("constexpr",c,d);return b(a)}return e}function kc(b,a){b="ngClass"+b;return["$animate",function(c){function d(a,b){var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],n=0;n<b.length;n++)if(e==b[n])continue a;c.push(e)}return c}function e(a){var b=[];return J(a)?(m(a,function(a){b=b.concat(e(a))}),b):G(a)?a.split(" "):C(a)?(m(a,function(a,c){a&&(b=b.concat(c.split(" ")))}),b):a}return{restrict:"AC",link:function(f,h,g){function l(a,b){var c=h.data("$classCounts")||fa(),
-d=[];m(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<b)&&d.push(a)});h.data("$classCounts",c);return d.join(" ")}function k(b){if(!0===a||f.$index%2===a){var k=e(b||[]);if(!n){var m=l(k,1);g.$addClass(m)}else if(!ka(b,n)){var s=e(n),m=d(k,s),k=d(s,k),m=l(m,1),k=l(k,-1);m&&m.length&&c.addClass(h,m);k&&k.length&&c.removeClass(h,k)}}n=ja(b)}var n;f.$watch(g[b],k,!0);g.$observe("class",function(a){k(f.$eval(g[b]))});"ngClass"!==b&&f.$watch("$index",function(c,d){var h=c&1;if(h!==(d&1)){var k=
-e(f.$eval(g[b]));h===a?(h=l(k,1),g.$addClass(h)):(h=l(k,-1),g.$removeClass(h))}})}}}]}function Hd(b){function a(a,b){b&&!f[a]?(l.addClass(e,a),f[a]=!0):!b&&f[a]&&(l.removeClass(e,a),f[a]=!1)}function c(b,c){b=b?"-"+Ac(b,"-"):"";a(mb+b,!0===c);a(Kd+b,!1===c)}var d=b.ctrl,e=b.$element,f={},h=b.set,g=b.unset,l=b.$animate;f[Kd]=!(f[mb]=e.hasClass(mb));d.$setValidity=function(b,e,f){v(e)?(d.$pending||(d.$pending={}),h(d.$pending,b,f)):(d.$pending&&g(d.$pending,b,f),Ld(d.$pending)&&(d.$pending=w));bb(e)?
-e?(g(d.$error,b,f),h(d.$$success,b,f)):(h(d.$error,b,f),g(d.$$success,b,f)):(g(d.$error,b,f),g(d.$$success,b,f));d.$pending?(a(Md,!0),d.$valid=d.$invalid=w,c("",null)):(a(Md,!1),d.$valid=Ld(d.$error),d.$invalid=!d.$valid,c("",d.$valid));e=d.$pending&&d.$pending[b]?w:d.$error[b]?!1:d.$$success[b]?!0:null;c(b,e);d.$$parentForm.$setValidity(b,e,d)}}function Ld(b){if(b)for(var a in b)if(b.hasOwnProperty(a))return!1;return!0}var jg=/^\/(.+)\/([a-z]*)$/,F=function(b){return G(b)?b.toLowerCase():b},ta=Object.prototype.hasOwnProperty,
-sb=function(b){return G(b)?b.toUpperCase():b},Wa,B,ra,ua=[].slice,Nf=[].splice,kg=[].push,va=Object.prototype.toString,rc=Object.getPrototypeOf,Ea=I("ng"),da=Q.angular||(Q.angular={}),Rb,nb=0;Wa=X.documentMode;y.$inject=[];$a.$inject=[];var J=Array.isArray,tc=/^\[object (Uint8(Clamped)?)|(Uint16)|(Uint32)|(Int8)|(Int16)|(Int32)|(Float(32)|(64))Array\]$/,T=function(b){return G(b)?b.trim():b},vd=function(b){return b.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Fa=function(){if(!A(Fa.rules)){var b=
-X.querySelector("[ng-csp]")||X.querySelector("[data-ng-csp]");if(b){var a=b.getAttribute("ng-csp")||b.getAttribute("data-ng-csp");Fa.rules={noUnsafeEval:!a||-1!==a.indexOf("no-unsafe-eval"),noInlineStyle:!a||-1!==a.indexOf("no-inline-style")}}else{b=Fa;try{new Function(""),a=!1}catch(c){a=!0}b.rules={noUnsafeEval:a,noInlineStyle:!1}}}return Fa.rules},pb=function(){if(A(pb.name_))return pb.name_;var b,a,c=Qa.length,d,e;for(a=0;a<c;++a)if(d=Qa[a],b=X.querySelector("["+d.replace(":","\\:")+"jq]")){e=
-b.getAttribute(d+"jq");break}return pb.name_=e},Qa=["ng-","data-ng-","ng:","x-ng-"],be=/[A-Z]/g,Bc=!1,Qb,pa=1,Pa=3,fe={full:"1.4.7",major:1,minor:4,dot:7,codeName:"dark-luminescence"};R.expando="ng339";var hb=R.cache={},Ff=1;R._data=function(b){return this.cache[b[this.expando]]||{}};var Af=/([\:\-\_]+(.))/g,Bf=/^moz([A-Z])/,lg={mouseleave:"mouseout",mouseenter:"mouseover"},Tb=I("jqLite"),Ef=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Sb=/<|&#?\w+;/,Cf=/<([\w:-]+)/,Df=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
-ma={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ma.optgroup=ma.option;ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead;ma.th=ma.td;var Ra=R.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===X.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),R(Q).on("load",a))},
-toString:function(){var b=[];m(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?B(this[b]):B(this[this.length+b])},length:0,push:kg,sort:[].sort,splice:[].splice},Bb={};m("multiple selected checked disabled readOnly required open".split(" "),function(b){Bb[F(b)]=b});var Sc={};m("input select option textarea button form details".split(" "),function(b){Sc[b]=!0});var $c={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};
-m({data:Vb,removeData:vb,hasData:function(b){for(var a in hb[b.ng339])return!0;return!1}},function(b,a){R[a]=b});m({data:Vb,inheritedData:Ab,scope:function(b){return B.data(b,"$scope")||Ab(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return B.data(b,"$isolateScope")||B.data(b,"$isolateScopeNoTemplate")},controller:Pc,injector:function(b){return Ab(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:xb,css:function(b,a,c){a=gb(a);if(A(c))b.style[a]=c;else return b.style[a]},
-attr:function(b,a,c){var d=b.nodeType;if(d!==Pa&&2!==d&&8!==d)if(d=F(a),Bb[d])if(A(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||y).specified?d:w;else if(A(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?w:b},prop:function(b,a,c){if(A(c))b[a]=c;else return b[a]},text:function(){function b(a,b){if(v(b)){var d=a.nodeType;return d===pa||d===Pa?a.textContent:""}a.textContent=b}b.$dv="";return b}(),
-val:function(b,a){if(v(a)){if(b.multiple&&"select"===wa(b)){var c=[];m(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(v(a))return b.innerHTML;ub(b,!0);b.innerHTML=a},empty:Qc},function(b,a){R.prototype[a]=function(a,d){var e,f,h=this.length;if(b!==Qc&&v(2==b.length&&b!==xb&&b!==Pc?a:d)){if(C(a)){for(e=0;e<h;e++)if(b===Vb)b(this[e],a);else for(f in a)b(this[e],f,a[f]);return this}e=b.$dv;h=v(e)?Math.min(h,1):h;
-for(f=0;f<h;f++){var g=b(this[f],a,d);e=e?e+g:g}return e}for(e=0;e<h;e++)b(this[e],a,d);return this}});m({removeData:vb,on:function a(c,d,e,f){if(A(f))throw Tb("onargs");if(Lc(c)){var h=wb(c,!0);f=h.events;var g=h.handle;g||(g=h.handle=Hf(c,f));for(var h=0<=d.indexOf(" ")?d.split(" "):[d],l=h.length;l--;){d=h[l];var k=f[d];k||(f[d]=[],"mouseenter"===d||"mouseleave"===d?a(c,lg[d],function(a){var c=a.relatedTarget;c&&(c===this||this.contains(c))||g(a,d)}):"$destroy"!==d&&c.addEventListener(d,g,!1),
-k=f[d]);k.push(e)}}},off:Oc,one:function(a,c,d){a=B(a);a.on(c,function f(){a.off(c,d);a.off(c,f)});a.on(c,d)},replaceWith:function(a,c){var d,e=a.parentNode;ub(a);m(new R(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];m(a.childNodes,function(a){a.nodeType===pa&&c.push(a)});return c},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,c){var d=a.nodeType;if(d===pa||11===d){c=new R(c);for(var d=0,e=c.length;d<
-e;d++)a.appendChild(c[d])}},prepend:function(a,c){if(a.nodeType===pa){var d=a.firstChild;m(new R(c),function(c){a.insertBefore(c,d)})}},wrap:function(a,c){c=B(c).eq(0).clone()[0];var d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:Wb,detach:function(a){Wb(a,!0)},after:function(a,c){var d=a,e=a.parentNode;c=new R(c);for(var f=0,h=c.length;f<h;f++){var g=c[f];e.insertBefore(g,d.nextSibling);d=g}},addClass:zb,removeClass:yb,toggleClass:function(a,c,d){c&&m(c.split(" "),function(c){var f=
-d;v(f)&&(f=!xb(a,c));(f?zb:yb)(a,c)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,c){return a.getElementsByTagName?a.getElementsByTagName(c):[]},clone:Ub,triggerHandler:function(a,c,d){var e,f,h=c.type||c,g=wb(a);if(g=(g=g&&g.events)&&g[h])e={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=
-!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:y,type:h,target:a},c.type&&(e=P(e,c)),c=ja(g),f=d?[e].concat(d):[e],m(c,function(c){e.isImmediatePropagationStopped()||c.apply(a,f)})}},function(a,c){R.prototype[c]=function(c,e,f){for(var h,g=0,l=this.length;g<l;g++)v(h)?(h=a(this[g],c,e,f),A(h)&&(h=B(h))):Nc(h,a(this[g],c,e,f));return A(h)?h:this};R.prototype.bind=R.prototype.on;R.prototype.unbind=R.prototype.off});Ua.prototype={put:function(a,
-c){this[Ga(a,this.nextUid)]=c},get:function(a){return this[Ga(a,this.nextUid)]},remove:function(a){var c=this[a=Ga(a,this.nextUid)];delete this[a];return c}};var yf=[function(){this.$get=[function(){return Ua}]}],Uc=/^[^\(]*\(\s*([^\)]*)\)/m,mg=/,/,ng=/^\s*(_?)(\S+?)\1\s*$/,Tc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ha=I("$injector");fb.$$annotate=function(a,c,d){var e;if("function"===typeof a){if(!(e=a.$inject)){e=[];if(a.length){if(c)throw G(d)&&d||(d=a.name||If(a)),Ha("strictdi",d);c=a.toString().replace(Tc,
-"");c=c.match(Uc);m(c[1].split(mg),function(a){a.replace(ng,function(a,c,d){e.push(d)})})}a.$inject=e}}else J(a)?(c=a.length-1,Sa(a[c],"fn"),e=a.slice(0,c)):Sa(a,"fn",!0);return e};var Nd=I("$animate"),Ue=function(){this.$get=["$q","$$rAF",function(a,c){function d(){}d.all=y;d.chain=y;d.prototype={end:y,cancel:y,resume:y,pause:y,complete:y,then:function(d,f){return a(function(a){c(function(){a()})}).then(d,f)}};return d}]},Te=function(){var a=new Ua,c=[];this.$get=["$$AnimateRunner","$rootScope",
-function(d,e){function f(a,c,d){var e=!1;c&&(c=G(c)?c.split(" "):J(c)?c:[],m(c,function(c){c&&(e=!0,a[c]=d)}));return e}function h(){m(c,function(c){var d=a.get(c);if(d){var e=Jf(c.attr("class")),f="",h="";m(d,function(a,c){a!==!!e[c]&&(a?f+=(f.length?" ":"")+c:h+=(h.length?" ":"")+c)});m(c,function(a){f&&zb(a,f);h&&yb(a,h)});a.remove(c)}});c.length=0}return{enabled:y,on:y,off:y,pin:y,push:function(g,l,k,n){n&&n();k=k||{};k.from&&g.css(k.from);k.to&&g.css(k.to);if(k.addClass||k.removeClass)if(l=k.addClass,
-n=k.removeClass,k=a.get(g)||{},l=f(k,l,!0),n=f(k,n,!1),l||n)a.put(g,k),c.push(g),1===c.length&&e.$$postDigest(h);return new d}}}]},Re=["$provide",function(a){var c=this;this.$$registeredAnimations=Object.create(null);this.register=function(d,e){if(d&&"."!==d.charAt(0))throw Nd("notcsel",d);var f=d+"-animation";c.$$registeredAnimations[d.substr(1)]=f;a.factory(f,e)};this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Nd("nongcls",
-"ng-animate");return this.$$classNameFilter};this.$get=["$$animateQueue",function(a){function c(a,d,e){if(e){var l;a:{for(l=0;l<e.length;l++){var k=e[l];if(1===k.nodeType){l=k;break a}}l=void 0}!l||l.parentNode||l.previousElementSibling||(e=null)}e?e.after(a):d.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.end&&a.end()},enter:function(f,h,g,l){h=h&&B(h);g=g&&B(g);h=h||g.parent();c(f,h,g);return a.push(f,"enter",Ia(l))},move:function(f,h,g,l){h=h&&B(h);g=g&&B(g);
-h=h||g.parent();c(f,h,g);return a.push(f,"move",Ia(l))},leave:function(c,e){return a.push(c,"leave",Ia(e),function(){c.remove()})},addClass:function(c,e,g){g=Ia(g);g.addClass=ib(g.addclass,e);return a.push(c,"addClass",g)},removeClass:function(c,e,g){g=Ia(g);g.removeClass=ib(g.removeClass,e);return a.push(c,"removeClass",g)},setClass:function(c,e,g,l){l=Ia(l);l.addClass=ib(l.addClass,e);l.removeClass=ib(l.removeClass,g);return a.push(c,"setClass",l)},animate:function(c,e,g,l,k){k=Ia(k);k.from=k.from?
-P(k.from,e):e;k.to=k.to?P(k.to,g):g;k.tempClasses=ib(k.tempClasses,l||"ng-inline-animate");return a.push(c,"animate",k)}}}]}],Se=function(){this.$get=["$$rAF","$q",function(a,c){var d=function(){};d.prototype={done:function(a){this.defer&&this.defer[!0===a?"reject":"resolve"]()},end:function(){this.done()},cancel:function(){this.done(!0)},getPromise:function(){this.defer||(this.defer=c.defer());return this.defer.promise},then:function(a,c){return this.getPromise().then(a,c)},"catch":function(a){return this.getPromise()["catch"](a)},
-"finally":function(a){return this.getPromise()["finally"](a)}};return function(c,f){function h(){a(function(){f.addClass&&(c.addClass(f.addClass),f.addClass=null);f.removeClass&&(c.removeClass(f.removeClass),f.removeClass=null);f.to&&(c.css(f.to),f.to=null);g||l.done();g=!0});return l}f.cleanupStyles&&(f.from=f.to=null);f.from&&(c.css(f.from),f.from=null);var g,l=new d;return{start:h,end:h}}}]},ga=I("$compile");Dc.$inject=["$provide","$$sanitizeUriProvider"];var Wc=/^((?:x|data)[\:\-_])/i,Of=I("$controller"),
-Vc=/^(\S+)(\s+as\s+(\w+))?$/,$e=function(){this.$get=["$document",function(a){return function(c){c?!c.nodeType&&c instanceof B&&(c=c[0]):c=a[0].body;return c.offsetWidth+1}}]},ad="application/json",$b={"Content-Type":ad+";charset=utf-8"},Qf=/^\[|^\{(?!\{)/,Rf={"[":/]$/,"{":/}$/},Pf=/^\)\]\}',?\n/,og=I("$http"),ed=function(a){return function(){throw og("legacy",a);}},La=da.$interpolateMinErr=I("$interpolate");La.throwNoconcat=function(a){throw La("noconcat",a);};La.interr=function(a,c){return La("interr",
-a,c.toString())};var pg=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,Tf={http:80,https:443,ftp:21},Db=I("$location"),qg={$$html5:!1,$$replace:!1,absUrl:Eb("$$absUrl"),url:function(a){if(v(a))return this.$$url;var c=pg.exec(a);(c[1]||""===a)&&this.path(decodeURIComponent(c[1]));(c[2]||c[1]||""===a)&&this.search(c[3]||"");this.hash(c[5]||"");return this},protocol:Eb("$$protocol"),host:Eb("$$host"),port:Eb("$$port"),path:jd("$$path",function(a){a=null!==a?a.toString():"";return"/"==a.charAt(0)?a:"/"+a}),search:function(a,
-c){switch(arguments.length){case 0:return this.$$search;case 1:if(G(a)||V(a))a=a.toString(),this.$$search=yc(a);else if(C(a))a=ha(a,{}),m(a,function(c,e){null==c&&delete a[e]}),this.$$search=a;else throw Db("isrcharg");break;default:v(c)||null===c?delete this.$$search[a]:this.$$search[a]=c}this.$$compose();return this},hash:jd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};m([id,cc,bc],function(a){a.prototype=Object.create(qg);a.prototype.state=
-function(c){if(!arguments.length)return this.$$state;if(a!==bc||!this.$$html5)throw Db("nostate");this.$$state=v(c)?null:c;return this}});var Z=I("$parse"),Uf=Function.prototype.call,Vf=Function.prototype.apply,Wf=Function.prototype.bind,Lb=fa();m("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Lb[a]=!0});var rg={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},ec=function(a){this.options=a};ec.prototype={constructor:ec,lex:function(a){this.text=a;this.index=0;for(this.tokens=
-[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(a))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var c=a+this.peek(),d=c+this.peek(2),e=Lb[c],f=Lb[d];Lb[a]||e||f?(a=f?d:e?c:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=
-a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,c){return-1!==c.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===
-a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=A(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw Z("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index<this.text.length;){var d=F(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var e=this.peek();if("e"==d&&this.isExpOperator(e))a+=d;else if(this.isExpOperator(d)&&e&&this.isNumber(e)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||
-e&&this.isNumber(e)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:c,text:a,constant:!0,value:Number(a)})},readIdent:function(){for(var a=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index);if(!this.isIdent(c)&&!this.isNumber(c))break;this.index++}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var c=this.index;this.index++;for(var d="",e=a,f=!1;this.index<this.text.length;){var h=
-this.text.charAt(this.index),e=e+h;if(f)"u"===h?(f=this.text.substring(this.index+1,this.index+5),f.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+f+"]"),this.index+=4,d+=String.fromCharCode(parseInt(f,16))):d+=rg[h]||h,f=!1;else if("\\"===h)f=!0;else{if(h===a){this.index++;this.tokens.push({index:c,text:e,constant:!0,value:d});return}d+=h}this.index++}this.throwError("Unterminated quote",c)}};var s=function(a,c){this.lexer=a;this.options=c};s.Program="Program";s.ExpressionStatement=
-"ExpressionStatement";s.AssignmentExpression="AssignmentExpression";s.ConditionalExpression="ConditionalExpression";s.LogicalExpression="LogicalExpression";s.BinaryExpression="BinaryExpression";s.UnaryExpression="UnaryExpression";s.CallExpression="CallExpression";s.MemberExpression="MemberExpression";s.Identifier="Identifier";s.Literal="Literal";s.ArrayExpression="ArrayExpression";s.Property="Property";s.ObjectExpression="ObjectExpression";s.ThisExpression="ThisExpression";s.NGValueParameter="NGValueParameter";
-s.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:s.Program,body:a}},expressionStatement:function(){return{type:s.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=
-this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary();this.expect("=")&&(a={type:s.AssignmentExpression,left:a,right:this.assignment(),operator:"="});return a},ternary:function(){var a=this.logicalOR(),c,d;return this.expect("?")&&(c=this.expression(),this.consume(":"))?(d=this.expression(),{type:s.ConditionalExpression,test:a,alternate:c,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:s.LogicalExpression,
-operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=this.equality();this.expect("&&");)a={type:s.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),c;c=this.expect("==","!=","===","!==");)a={type:s.BinaryExpression,operator:c.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),c;c=this.expect("<",">","<=",">=");)a={type:s.BinaryExpression,operator:c.text,
-left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),c;c=this.expect("+","-");)a={type:s.BinaryExpression,operator:c.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a={type:s.BinaryExpression,operator:c.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:s.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},
-primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.constants.hasOwnProperty(this.peek().text)?a=ha(this.constants[this.consume().text]):this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var c;c=this.expect("(","[",".");)"("===c.text?(a={type:s.CallExpression,callee:a,arguments:this.parseArguments()},
-this.consume(")")):"["===c.text?(a={type:s.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===c.text?a={type:s.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var c={type:s.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return c},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.expression());
-while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:s.Identifier,name:a.text}},constant:function(){return{type:s.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:s.ArrayExpression,elements:a}},object:function(){var a=[],c;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;
-c={type:s.Property,kind:"init"};this.peek().constant?c.key=this.constant():this.peek().identifier?c.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");c.value=this.expression();a.push(c)}while(this.expect(","))}this.consume("}");return{type:s.ObjectExpression,properties:a}},throwError:function(a,c){throw Z("syntax",c.text,a,c.index+1,this.text,this.text.substring(c.index));},consume:function(a){if(0===this.tokens.length)throw Z("ueoe",this.text);var c=this.expect(a);
-c||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return c},peekToken:function(){if(0===this.tokens.length)throw Z("ueoe",this.text);return this.tokens[0]},peek:function(a,c,d,e){return this.peekAhead(0,a,c,d,e)},peekAhead:function(a,c,d,e,f){if(this.tokens.length>a){a=this.tokens[a];var h=a.text;if(h===c||h===d||h===e||h===f||!(c||d||e||f))return a}return!1},expect:function(a,c,d,e){return(a=this.peek(a,c,d,e))?(this.tokens.shift(),a):!1},constants:{"true":{type:s.Literal,value:!0},
-"false":{type:s.Literal,value:!1},"null":{type:s.Literal,value:null},undefined:{type:s.Literal,value:w},"this":{type:s.ThisExpression}}};sd.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:c,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};U(e,d.$filter);var f="",h;this.stage="assign";if(h=qd(e))this.state.computing="assign",f=this.nextId(),this.recurse(h,f),this.return_(f),f="fn.assign="+this.generateFunction("assign",
-"s,v,l");h=od(e.body);d.stage="inputs";m(h,function(a,c){var e="fn"+c;d.state[e]={vars:[],body:[],own:{}};d.state.computing=e;var f=d.nextId();d.recurse(a,f);d.return_(f);d.state.inputs.push(e);a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(e);f='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+f+this.watchFns()+"return fn;";f=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue",
-"ensureSafeAssignContext","ifDefined","plus","text",f))(this.$filter,Xa,Ba,ld,kd,md,Xf,nd,a);this.state=this.stage=w;f.literal=rd(e);f.constant=e.constant;return f},USE:"use",STRICT:"strict",watchFns:function(){var a=[],c=this.state.inputs,d=this;m(c,function(c){a.push("var "+c+"="+d.generateFunction(c,"s"))});c.length&&a.push("fn.inputs=["+c.join(",")+"];");return a.join("")},generateFunction:function(a,c){return"function("+c+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=
-[],c=this;m(this.state.filters,function(d,e){a.push(d+"=$filter("+c.escape(e)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,c,d,e,f,h){var g,l,k=this,n,p;e=e||y;if(!h&&A(a.watchId))c=c||this.nextId(),this.if_("i",this.lazyAssign(c,this.computedMember("i",a.watchId)),this.lazyRecurse(a,c,d,e,f,!0));else switch(a.type){case s.Program:m(a.body,
-function(c,d){k.recurse(c.expression,w,w,function(a){l=a});d!==a.body.length-1?k.current().body.push(l,";"):k.return_(l)});break;case s.Literal:p=this.escape(a.value);this.assign(c,p);e(p);break;case s.UnaryExpression:this.recurse(a.argument,w,w,function(a){l=a});p=a.operator+"("+this.ifDefined(l,0)+")";this.assign(c,p);e(p);break;case s.BinaryExpression:this.recurse(a.left,w,w,function(a){g=a});this.recurse(a.right,w,w,function(a){l=a});p="+"===a.operator?this.plus(g,l):"-"===a.operator?this.ifDefined(g,
-0)+a.operator+this.ifDefined(l,0):"("+g+")"+a.operator+"("+l+")";this.assign(c,p);e(p);break;case s.LogicalExpression:c=c||this.nextId();k.recurse(a.left,c);k.if_("&&"===a.operator?c:k.not(c),k.lazyRecurse(a.right,c));e(c);break;case s.ConditionalExpression:c=c||this.nextId();k.recurse(a.test,c);k.if_(c,k.lazyRecurse(a.alternate,c),k.lazyRecurse(a.consequent,c));e(c);break;case s.Identifier:c=c||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",
-a.name)+"?l:s"),d.computed=!1,d.name=a.name);Xa(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){f&&1!==f&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(c,k.nonComputedMember("s",a.name))})},c&&k.lazyAssign(c,k.nonComputedMember("l",a.name)));(k.state.expensiveChecks||Fb(a.name))&&k.addEnsureSafeObject(c);e(c);break;case s.MemberExpression:g=d&&(d.context=this.nextId())||
-this.nextId();c=c||this.nextId();k.recurse(a.object,g,w,function(){k.if_(k.notNull(g),function(){if(a.computed)l=k.nextId(),k.recurse(a.property,l),k.getStringValue(l),k.addEnsureSafeMemberName(l),f&&1!==f&&k.if_(k.not(k.computedMember(g,l)),k.lazyAssign(k.computedMember(g,l),"{}")),p=k.ensureSafeObject(k.computedMember(g,l)),k.assign(c,p),d&&(d.computed=!0,d.name=l);else{Xa(a.property.name);f&&1!==f&&k.if_(k.not(k.nonComputedMember(g,a.property.name)),k.lazyAssign(k.nonComputedMember(g,a.property.name),
-"{}"));p=k.nonComputedMember(g,a.property.name);if(k.state.expensiveChecks||Fb(a.property.name))p=k.ensureSafeObject(p);k.assign(c,p);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(c,"undefined")});e(c)},!!f);break;case s.CallExpression:c=c||this.nextId();a.filter?(l=k.filter(a.callee.name),n=[],m(a.arguments,function(a){var c=k.nextId();k.recurse(a,c);n.push(c)}),p=l+"("+n.join(",")+")",k.assign(c,p),e(c)):(l=k.nextId(),g={},n=[],k.recurse(a.callee,l,g,function(){k.if_(k.notNull(l),
-function(){k.addEnsureSafeFunction(l);m(a.arguments,function(a){k.recurse(a,k.nextId(),w,function(a){n.push(k.ensureSafeObject(a))})});g.name?(k.state.expensiveChecks||k.addEnsureSafeObject(g.context),p=k.member(g.context,g.name,g.computed)+"("+n.join(",")+")"):p=l+"("+n.join(",")+")";p=k.ensureSafeObject(p);k.assign(c,p)},function(){k.assign(c,"undefined")});e(c)}));break;case s.AssignmentExpression:l=this.nextId();g={};if(!pd(a.left))throw Z("lval");this.recurse(a.left,w,g,function(){k.if_(k.notNull(g.context),
-function(){k.recurse(a.right,l);k.addEnsureSafeObject(k.member(g.context,g.name,g.computed));k.addEnsureSafeAssignContext(g.context);p=k.member(g.context,g.name,g.computed)+a.operator+l;k.assign(c,p);e(c||p)})},1);break;case s.ArrayExpression:n=[];m(a.elements,function(a){k.recurse(a,k.nextId(),w,function(a){n.push(a)})});p="["+n.join(",")+"]";this.assign(c,p);e(p);break;case s.ObjectExpression:n=[];m(a.properties,function(a){k.recurse(a.value,k.nextId(),w,function(c){n.push(k.escape(a.key.type===
-s.Identifier?a.key.name:""+a.key.value)+":"+c)})});p="{"+n.join(",")+"}";this.assign(c,p);e(p);break;case s.ThisExpression:this.assign(c,"s");e("s");break;case s.NGValueParameter:this.assign(c,"v"),e("v")}},getHasOwnProperty:function(a,c){var d=a+"."+c,e=this.current().own;e.hasOwnProperty(d)||(e[d]=this.nextId(!1,a+"&&("+this.escape(c)+" in "+a+")"));return e[d]},assign:function(a,c){if(a)return this.current().body.push(a,"=",c,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=
-this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,c){return"ifDefined("+a+","+this.escape(c)+")"},plus:function(a,c){return"plus("+a+","+c+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,c,d){if(!0===a)c();else{var e=this.current().body;e.push("if(",a,"){");c();e.push("}");d&&(e.push("else{"),d(),e.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,c){return a+"."+c},computedMember:function(a,
-c){return a+"["+c+"]"},member:function(a,c,d){return d?this.computedMember(a,c):this.nonComputedMember(a,c)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),";")},addEnsureSafeAssignContext:function(a){this.current().body.push(this.ensureSafeAssignContext(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+
-a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},getStringValue:function(a){this.assign(a,"getStringValue("+a+",text)")},ensureSafeAssignContext:function(a){return"ensureSafeAssignContext("+a+",text)"},lazyRecurse:function(a,c,d,e,f,h){var g=this;return function(){g.recurse(a,c,d,e,f,h)}},lazyAssign:function(a,c){var d=this;return function(){d.assign(a,c)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,
-stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(G(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(V(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw Z("esc");},nextId:function(a,c){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(c?"="+c:""));return d},current:function(){return this.state[this.state.computing]}};
-td.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=c;U(e,d.$filter);var f,h;if(f=qd(e))h=this.recurse(f);f=od(e.body);var g;f&&(g=[],m(f,function(a,c){var e=d.recurse(a);a.input=e;g.push(e);a.watchId=c}));var l=[];m(e.body,function(a){l.push(d.recurse(a.expression))});f=0===e.body.length?function(){}:1===e.body.length?l[0]:function(a,c){var d;m(l,function(e){d=e(a,c)});return d};h&&(f.assign=function(a,c,d){return h(a,d,c)});g&&(f.inputs=
-g);f.literal=rd(e);f.constant=e.constant;return f},recurse:function(a,c,d){var e,f,h=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case s.Literal:return this.value(a.value,c);case s.UnaryExpression:return f=this.recurse(a.argument),this["unary"+a.operator](f,c);case s.BinaryExpression:return e=this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,f,c);case s.LogicalExpression:return e=this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,
-f,c);case s.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),c);case s.Identifier:return Xa(a.name,h.expression),h.identifier(a.name,h.expensiveChecks||Fb(a.name),c,d,h.expression);case s.MemberExpression:return e=this.recurse(a.object,!1,!!d),a.computed||(Xa(a.property.name,h.expression),f=a.property.name),a.computed&&(f=this.recurse(a.property)),a.computed?this.computedMember(e,f,c,d,h.expression):this.nonComputedMember(e,f,
-h.expensiveChecks,c,d,h.expression);case s.CallExpression:return g=[],m(a.arguments,function(a){g.push(h.recurse(a))}),a.filter&&(f=this.$filter(a.callee.name)),a.filter||(f=this.recurse(a.callee,!0)),a.filter?function(a,d,e,h){for(var r=[],m=0;m<g.length;++m)r.push(g[m](a,d,e,h));a=f.apply(w,r,h);return c?{context:w,name:w,value:a}:a}:function(a,d,e,p){var r=f(a,d,e,p),m;if(null!=r.value){Ba(r.context,h.expression);ld(r.value,h.expression);m=[];for(var s=0;s<g.length;++s)m.push(Ba(g[s](a,d,e,p),
-h.expression));m=Ba(r.value.apply(r.context,m),h.expression)}return c?{value:m}:m};case s.AssignmentExpression:return e=this.recurse(a.left,!0,1),f=this.recurse(a.right),function(a,d,g,p){var r=e(a,d,g,p);a=f(a,d,g,p);Ba(r.value,h.expression);md(r.context);r.context[r.name]=a;return c?{value:a}:a};case s.ArrayExpression:return g=[],m(a.elements,function(a){g.push(h.recurse(a))}),function(a,d,e,f){for(var h=[],m=0;m<g.length;++m)h.push(g[m](a,d,e,f));return c?{value:h}:h};case s.ObjectExpression:return g=
-[],m(a.properties,function(a){g.push({key:a.key.type===s.Identifier?a.key.name:""+a.key.value,value:h.recurse(a.value)})}),function(a,d,e,f){for(var h={},m=0;m<g.length;++m)h[g[m].key]=g[m].value(a,d,e,f);return c?{value:h}:h};case s.ThisExpression:return function(a){return c?{value:a}:a};case s.NGValueParameter:return function(a,d,e,f){return c?{value:e}:e}}},"unary+":function(a,c){return function(d,e,f,h){d=a(d,e,f,h);d=A(d)?+d:0;return c?{value:d}:d}},"unary-":function(a,c){return function(d,e,
-f,h){d=a(d,e,f,h);d=A(d)?-d:0;return c?{value:d}:d}},"unary!":function(a,c){return function(d,e,f,h){d=!a(d,e,f,h);return c?{value:d}:d}},"binary+":function(a,c,d){return function(e,f,h,g){var l=a(e,f,h,g);e=c(e,f,h,g);l=nd(l,e);return d?{value:l}:l}},"binary-":function(a,c,d){return function(e,f,h,g){var l=a(e,f,h,g);e=c(e,f,h,g);l=(A(l)?l:0)-(A(e)?e:0);return d?{value:l}:l}},"binary*":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)*c(e,f,h,g);return d?{value:e}:e}},"binary/":function(a,c,
-d){return function(e,f,h,g){e=a(e,f,h,g)/c(e,f,h,g);return d?{value:e}:e}},"binary%":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)%c(e,f,h,g);return d?{value:e}:e}},"binary===":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)===c(e,f,h,g);return d?{value:e}:e}},"binary!==":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)!==c(e,f,h,g);return d?{value:e}:e}},"binary==":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)==c(e,f,h,g);return d?{value:e}:e}},"binary!=":function(a,c,
-d){return function(e,f,h,g){e=a(e,f,h,g)!=c(e,f,h,g);return d?{value:e}:e}},"binary<":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)<c(e,f,h,g);return d?{value:e}:e}},"binary>":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)>c(e,f,h,g);return d?{value:e}:e}},"binary<=":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)<=c(e,f,h,g);return d?{value:e}:e}},"binary>=":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)>=c(e,f,h,g);return d?{value:e}:e}},"binary&&":function(a,c,d){return function(e,
-f,h,g){e=a(e,f,h,g)&&c(e,f,h,g);return d?{value:e}:e}},"binary||":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)||c(e,f,h,g);return d?{value:e}:e}},"ternary?:":function(a,c,d,e){return function(f,h,g,l){f=a(f,h,g,l)?c(f,h,g,l):d(f,h,g,l);return e?{value:f}:f}},value:function(a,c){return function(){return c?{context:w,name:w,value:a}:a}},identifier:function(a,c,d,e,f){return function(h,g,l,k){h=g&&a in g?g:h;e&&1!==e&&h&&!h[a]&&(h[a]={});g=h?h[a]:w;c&&Ba(g,f);return d?{context:h,name:a,value:g}:
-g}},computedMember:function(a,c,d,e,f){return function(h,g,l,k){var n=a(h,g,l,k),p,m;null!=n&&(p=c(h,g,l,k),p=kd(p),Xa(p,f),e&&1!==e&&n&&!n[p]&&(n[p]={}),m=n[p],Ba(m,f));return d?{context:n,name:p,value:m}:m}},nonComputedMember:function(a,c,d,e,f,h){return function(g,l,k,n){g=a(g,l,k,n);f&&1!==f&&g&&!g[c]&&(g[c]={});l=null!=g?g[c]:w;(d||Fb(c))&&Ba(l,h);return e?{context:g,name:c,value:l}:l}},inputs:function(a,c){return function(d,e,f,h){return h?h[c]:a(d,e,f)}}};var fc=function(a,c,d){this.lexer=
-a;this.$filter=c;this.options=d;this.ast=new s(this.lexer);this.astCompiler=d.csp?new td(this.ast,c):new sd(this.ast,c)};fc.prototype={constructor:fc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};fa();fa();var Yf=Object.prototype.valueOf,Ca=I("$sce"),oa={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},ga=I("$compile"),$=X.createElement("a"),xd=Aa(Q.location.href);yd.$inject=["$document"];Kc.$inject=["$provide"];zd.$inject=["$locale"];Bd.$inject=
-["$locale"];var hc=".",hg={yyyy:aa("FullYear",4),yy:aa("FullYear",2,0,!0),y:aa("FullYear",1),MMMM:Hb("Month"),MMM:Hb("Month",!0),MM:aa("Month",2,1),M:aa("Month",1,1),dd:aa("Date",2),d:aa("Date",1),HH:aa("Hours",2),H:aa("Hours",1),hh:aa("Hours",2,-12),h:aa("Hours",1,-12),mm:aa("Minutes",2),m:aa("Minutes",1),ss:aa("Seconds",2),s:aa("Seconds",1),sss:aa("Milliseconds",3),EEEE:Hb("Day"),EEE:Hb("Day",!0),a:function(a,c){return 12>a.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a,c,d){a=-1*d;return a=(0<=
-a?"+":"")+(Gb(Math[0<a?"floor":"ceil"](a/60),2)+Gb(Math.abs(a%60),2))},ww:Fd(2),w:Fd(1),G:ic,GG:ic,GGG:ic,GGGG:function(a,c){return 0>=a.getFullYear()?c.ERANAMES[0]:c.ERANAMES[1]}},gg=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,fg=/^\-?\d+$/;Ad.$inject=["$locale"];var cg=qa(F),dg=qa(sb);Cd.$inject=["$parse"];var he=qa({restrict:"E",compile:function(a,c){if(!c.href&&!c.xlinkHref)return function(a,c){if("a"===c[0].nodeName.toLowerCase()){var f="[object SVGAnimatedString]"===
-va.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}}),tb={};m(Bb,function(a,c){function d(a,d,f){a.$watch(f[e],function(a){f.$set(c,!!a)})}if("multiple"!=a){var e=ya("ng-"+c),f=d;"checked"===a&&(f=function(a,c,f){f.ngModel!==f[e]&&d(a,c,f)});tb[e]=function(){return{restrict:"A",priority:100,link:f}}}});m($c,function(a,c){tb[c]=function(){return{priority:100,link:function(a,e,f){if("ngPattern"===c&&"/"==f.ngPattern.charAt(0)&&(e=f.ngPattern.match(jg))){f.$set("ngPattern",
-new RegExp(e[1],e[2]));return}a.$watch(f[c],function(a){f.$set(c,a)})}}}});m(["src","srcset","href"],function(a){var c=ya("ng-"+a);tb[c]=function(){return{priority:99,link:function(d,e,f){var h=a,g=a;"href"===a&&"[object SVGAnimatedString]"===va.call(e.prop("href"))&&(g="xlinkHref",f.$attr[g]="xlink:href",h=null);f.$observe(c,function(c){c?(f.$set(g,c),Wa&&h&&e.prop(h,f[g])):"href"===a&&f.$set(g,null)})}}}});var Ib={$addControl:y,$$renameControl:function(a,c){a.$name=c},$removeControl:y,$setValidity:y,
-$setDirty:y,$setPristine:y,$setSubmitted:y};Gd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Od=function(a){return["$timeout","$parse",function(c,d){function e(a){return""===a?d('this[""]').assign:d(a).assign||y}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Gd,compile:function(d,h){d.addClass(Ya).addClass(mb);var g=h.name?"name":a&&h.ngForm?"ngForm":!1;return{pre:function(a,d,f,h){var m=h[0];if(!("action"in f)){var t=function(c){a.$apply(function(){m.$commitViewValue();
-m.$setSubmitted()});c.preventDefault()};d[0].addEventListener("submit",t,!1);d.on("$destroy",function(){c(function(){d[0].removeEventListener("submit",t,!1)},0,!1)})}(h[1]||m.$$parentForm).$addControl(m);var s=g?e(m.$name):y;g&&(s(a,m),f.$observe(g,function(c){m.$name!==c&&(s(a,w),m.$$parentForm.$$renameControl(m,c),s=e(m.$name),s(a,m))}));d.on("$destroy",function(){m.$$parentForm.$removeControl(m);s(a,w);P(m,Ib)})}}}}}]},ie=Od(),ve=Od(!0),ig=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,
-sg=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,tg=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,ug=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Pd=/^(\d{4})-(\d{2})-(\d{2})$/,Qd=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,lc=/^(\d{4})-W(\d\d)$/,Rd=/^(\d{4})-(\d\d)$/,Sd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Td={text:function(a,c,d,e,f,h){jb(a,c,d,e,f,h);jc(e)},date:kb("date",
-Pd,Kb(Pd,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":kb("datetimelocal",Qd,Kb(Qd,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:kb("time",Sd,Kb(Sd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:kb("week",lc,function(a,c){if(ea(a))return a;if(G(a)){lc.lastIndex=0;var d=lc.exec(a);if(d){var e=+d[1],f=+d[2],h=d=0,g=0,l=0,k=Ed(e),f=7*(f-1);c&&(d=c.getHours(),h=c.getMinutes(),g=c.getSeconds(),l=c.getMilliseconds());return new Date(e,0,k.getDate()+f,d,h,g,l)}}return NaN},"yyyy-Www"),
-month:kb("month",Rd,Kb(Rd,["yyyy","MM"]),"yyyy-MM"),number:function(a,c,d,e,f,h){Id(a,c,d,e);jb(a,c,d,e,f,h);e.$$parserName="number";e.$parsers.push(function(a){return e.$isEmpty(a)?null:ug.test(a)?parseFloat(a):w});e.$formatters.push(function(a){if(!e.$isEmpty(a)){if(!V(a))throw lb("numfmt",a);a=a.toString()}return a});if(A(d.min)||d.ngMin){var g;e.$validators.min=function(a){return e.$isEmpty(a)||v(g)||a>=g};d.$observe("min",function(a){A(a)&&!V(a)&&(a=parseFloat(a,10));g=V(a)&&!isNaN(a)?a:w;e.$validate()})}if(A(d.max)||
-d.ngMax){var l;e.$validators.max=function(a){return e.$isEmpty(a)||v(l)||a<=l};d.$observe("max",function(a){A(a)&&!V(a)&&(a=parseFloat(a,10));l=V(a)&&!isNaN(a)?a:w;e.$validate()})}},url:function(a,c,d,e,f,h){jb(a,c,d,e,f,h);jc(e);e.$$parserName="url";e.$validators.url=function(a,c){var d=a||c;return e.$isEmpty(d)||sg.test(d)}},email:function(a,c,d,e,f,h){jb(a,c,d,e,f,h);jc(e);e.$$parserName="email";e.$validators.email=function(a,c){var d=a||c;return e.$isEmpty(d)||tg.test(d)}},radio:function(a,c,
-d,e){v(d.name)&&c.attr("name",++nb);c.on("click",function(a){c[0].checked&&e.$setViewValue(d.value,a&&a.type)});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e,f,h,g,l){var k=Jd(l,a,"ngTrueValue",d.ngTrueValue,!0),n=Jd(l,a,"ngFalseValue",d.ngFalseValue,!1);c.on("click",function(a){e.$setViewValue(c[0].checked,a&&a.type)});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return!1===a};e.$formatters.push(function(a){return ka(a,
-k)});e.$parsers.push(function(a){return a?k:n})},hidden:y,button:y,submit:y,reset:y,file:y},Ec=["$browser","$sniffer","$filter","$parse",function(a,c,d,e){return{restrict:"E",require:["?ngModel"],link:{pre:function(f,h,g,l){l[0]&&(Td[F(g.type)]||Td.text)(f,h,g,l[0],c,a,d,e)}}}}],vg=/^(true|false|\d+)$/,Ne=function(){return{restrict:"A",priority:100,compile:function(a,c){return vg.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",
-a)})}}}},ne=["$compile",function(a){return{restrict:"AC",compile:function(c){a.$$addBindingClass(c);return function(c,e,f){a.$$addBindingInfo(e,f.ngBind);e=e[0];c.$watch(f.ngBind,function(a){e.textContent=v(a)?"":a})}}}}],pe=["$interpolate","$compile",function(a,c){return{compile:function(d){c.$$addBindingClass(d);return function(d,f,h){d=a(f.attr(h.$attr.ngBindTemplate));c.$$addBindingInfo(f,d.expressions);f=f[0];h.$observe("ngBindTemplate",function(a){f.textContent=v(a)?"":a})}}}}],oe=["$sce","$parse",
-"$compile",function(a,c,d){return{restrict:"A",compile:function(e,f){var h=c(f.ngBindHtml),g=c(f.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(e);return function(c,e,f){d.$$addBindingInfo(e,f.ngBindHtml);c.$watch(g,function(){e.html(a.getTrustedHtml(h(c))||"")})}}}}],Me=qa({restrict:"A",require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),qe=kc("",!0),se=kc("Odd",0),re=kc("Even",1),te=Na({compile:function(a,c){c.$set("ngCloak",
-w);a.removeClass("ng-cloak")}}),ue=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Jc={},wg={blur:!0,focus:!0};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=ya("ng-"+a);Jc[c]=["$parse","$rootScope",function(d,e){return{restrict:"A",compile:function(f,h){var g=d(h[c],null,!0);return function(c,d){d.on(a,function(d){var f=function(){g(c,{$event:d})};
-wg[a]&&e.$$phase?c.$evalAsync(f):c.$apply(f)})}}}}]});var xe=["$animate",function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,h){var g,l,k;c.$watch(e.ngIf,function(c){c?l||h(function(c,f){l=f;c[c.length++]=X.createComment(" end ngIf: "+e.ngIf+" ");g={clone:c};a.enter(c,d.parent(),d)}):(k&&(k.remove(),k=null),l&&(l.$destroy(),l=null),g&&(k=rb(g.clone),a.leave(k).then(function(){k=null}),g=null))})}}}],ye=["$templateRequest","$anchorScroll",
-"$animate",function(a,c,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:da.noop,compile:function(e,f){var h=f.ngInclude||f.src,g=f.onload||"",l=f.autoscroll;return function(e,f,m,r,t){var s=0,v,u,q,z=function(){u&&(u.remove(),u=null);v&&(v.$destroy(),v=null);q&&(d.leave(q).then(function(){u=null}),u=q,q=null)};e.$watch(h,function(h){var m=function(){!A(l)||l&&!e.$eval(l)||c()},p=++s;h?(a(h,!0).then(function(a){if(p===s){var c=e.$new();r.template=a;a=t(c,function(a){z();
-d.enter(a,null,f).then(m)});v=c;q=a;v.$emit("$includeContentLoaded",h);e.$eval(g)}},function(){p===s&&(z(),e.$emit("$includeContentError",h))}),e.$emit("$includeContentRequested",h)):(z(),r.template=null)})}}}}],Pe=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){/SVG/.test(d[0].toString())?(d.empty(),a(Mc(f.template,X).childNodes)(c,function(a){d.append(a)},{futureParentElement:d})):(d.html(f.template),a(d.contents())(c))}}}],ze=Na({priority:450,
-compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Le=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,c,d,e){var f=c.attr(d.$attr.ngList)||", ",h="false"!==d.ngTrim,g=h?T(f):f;e.$parsers.push(function(a){if(!v(a)){var c=[];a&&m(a.split(g),function(a){a&&c.push(h?T(a):a)});return c}});e.$formatters.push(function(a){return J(a)?a.join(f):w});e.$isEmpty=function(a){return!a||!a.length}}}},mb="ng-valid",Kd="ng-invalid",Ya="ng-pristine",Jb="ng-dirty",Md=
-"ng-pending",lb=I("ngModel"),xg=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,c,d,e,f,h,g,l,k,n){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=w;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=
-w;this.$name=n(d.name||"",!1)(a);this.$$parentForm=Ib;var p=f(d.ngModel),r=p.assign,t=p,s=r,K=null,u,q=this;this.$$setOptions=function(a){if((q.$options=a)&&a.getterSetter){var c=f(d.ngModel+"()"),g=f(d.ngModel+"($$$p)");t=function(a){var d=p(a);x(d)&&(d=c(a));return d};s=function(a,c){x(p(a))?g(a,{$$$p:q.$modelValue}):r(a,q.$modelValue)}}else if(!p.assign)throw lb("nonassign",d.ngModel,xa(e));};this.$render=y;this.$isEmpty=function(a){return v(a)||""===a||null===a||a!==a};var z=0;Hd({ctrl:this,$element:e,
-set:function(a,c){a[c]=!0},unset:function(a,c){delete a[c]},$animate:h});this.$setPristine=function(){q.$dirty=!1;q.$pristine=!0;h.removeClass(e,Jb);h.addClass(e,Ya)};this.$setDirty=function(){q.$dirty=!0;q.$pristine=!1;h.removeClass(e,Ya);h.addClass(e,Jb);q.$$parentForm.$setDirty()};this.$setUntouched=function(){q.$touched=!1;q.$untouched=!0;h.setClass(e,"ng-untouched","ng-touched")};this.$setTouched=function(){q.$touched=!0;q.$untouched=!1;h.setClass(e,"ng-touched","ng-untouched")};this.$rollbackViewValue=
-function(){g.cancel(K);q.$viewValue=q.$$lastCommittedViewValue;q.$render()};this.$validate=function(){if(!V(q.$modelValue)||!isNaN(q.$modelValue)){var a=q.$$rawModelValue,c=q.$valid,d=q.$modelValue,e=q.$options&&q.$options.allowInvalid;q.$$runValidators(a,q.$$lastCommittedViewValue,function(f){e||c===f||(q.$modelValue=f?a:w,q.$modelValue!==d&&q.$$writeModelToScope())})}};this.$$runValidators=function(a,c,d){function e(){var d=!0;m(q.$validators,function(e,f){var h=e(a,c);d=d&&h;g(f,h)});return d?
-!0:(m(q.$asyncValidators,function(a,c){g(c,null)}),!1)}function f(){var d=[],e=!0;m(q.$asyncValidators,function(f,h){var k=f(a,c);if(!k||!x(k.then))throw lb("$asyncValidators",k);g(h,w);d.push(k.then(function(){g(h,!0)},function(a){e=!1;g(h,!1)}))});d.length?k.all(d).then(function(){h(e)},y):h(!0)}function g(a,c){l===z&&q.$setValidity(a,c)}function h(a){l===z&&d(a)}z++;var l=z;(function(){var a=q.$$parserName||"parse";if(v(u))g(a,null);else return u||(m(q.$validators,function(a,c){g(c,null)}),m(q.$asyncValidators,
-function(a,c){g(c,null)})),g(a,u),u;return!0})()?e()?f():h(!1):h(!1)};this.$commitViewValue=function(){var a=q.$viewValue;g.cancel(K);if(q.$$lastCommittedViewValue!==a||""===a&&q.$$hasNativeValidators)q.$$lastCommittedViewValue=a,q.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var c=q.$$lastCommittedViewValue;if(u=v(c)?w:!0)for(var d=0;d<q.$parsers.length;d++)if(c=q.$parsers[d](c),v(c)){u=!1;break}V(q.$modelValue)&&isNaN(q.$modelValue)&&(q.$modelValue=t(a));
-var e=q.$modelValue,f=q.$options&&q.$options.allowInvalid;q.$$rawModelValue=c;f&&(q.$modelValue=c,q.$modelValue!==e&&q.$$writeModelToScope());q.$$runValidators(c,q.$$lastCommittedViewValue,function(a){f||(q.$modelValue=a?c:w,q.$modelValue!==e&&q.$$writeModelToScope())})};this.$$writeModelToScope=function(){s(a,q.$modelValue);m(q.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};this.$setViewValue=function(a,c){q.$viewValue=a;q.$options&&!q.$options.updateOnDefault||q.$$debounceViewValueCommit(c)};
-this.$$debounceViewValueCommit=function(c){var d=0,e=q.$options;e&&A(e.debounce)&&(e=e.debounce,V(e)?d=e:V(e[c])?d=e[c]:V(e["default"])&&(d=e["default"]));g.cancel(K);d?K=g(function(){q.$commitViewValue()},d):l.$$phase?q.$commitViewValue():a.$apply(function(){q.$commitViewValue()})};a.$watch(function(){var c=t(a);if(c!==q.$modelValue&&(q.$modelValue===q.$modelValue||c===c)){q.$modelValue=q.$$rawModelValue=c;u=w;for(var d=q.$formatters,e=d.length,f=c;e--;)f=d[e](f);q.$viewValue!==f&&(q.$viewValue=
-q.$$lastCommittedViewValue=f,q.$render(),q.$$runValidators(c,f,y))}return c})}],Ke=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:xg,priority:1,compile:function(c){c.addClass(Ya).addClass("ng-untouched").addClass(mb);return{pre:function(a,c,f,h){var g=h[0];c=h[1]||g.$$parentForm;g.$$setOptions(h[2]&&h[2].$options);c.$addControl(g);f.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},
-post:function(c,e,f,h){var g=h[0];if(g.$options&&g.$options.updateOn)e.on(g.$options.updateOn,function(a){g.$$debounceViewValueCommit(a&&a.type)});e.on("blur",function(e){g.$touched||(a.$$phase?c.$evalAsync(g.$setTouched):c.$apply(g.$setTouched))})}}}}}],yg=/(\s+|^)default(\s+|$)/,Oe=function(){return{restrict:"A",controller:["$scope","$attrs",function(a,c){var d=this;this.$options=ha(a.$eval(c.ngModelOptions));A(this.$options.updateOn)?(this.$options.updateOnDefault=!1,this.$options.updateOn=T(this.$options.updateOn.replace(yg,
-function(){d.$options.updateOnDefault=!0;return" "}))):this.$options.updateOnDefault=!0}]}},Ae=Na({terminal:!0,priority:1E3}),zg=I("ngOptions"),Ag=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,Ie=["$compile","$parse",function(a,c){function d(a,d,e){function f(a,c,d,e,g){this.selectValue=a;this.viewValue=c;this.label=
-d;this.group=e;this.disabled=g}function n(a){var c;if(!s&&Da(a))c=a;else{c=[];for(var d in a)a.hasOwnProperty(d)&&"$"!==d.charAt(0)&&c.push(d)}return c}var m=a.match(Ag);if(!m)throw zg("iexp",a,xa(d));var r=m[5]||m[7],s=m[6];a=/ as /.test(m[0])&&m[1];var v=m[9];d=c(m[2]?m[1]:r);var w=a&&c(a)||d,u=v&&c(v),q=v?function(a,c){return u(e,c)}:function(a){return Ga(a)},z=function(a,c){return q(a,x(a,c))},y=c(m[2]||m[1]),A=c(m[3]||""),O=c(m[4]||""),H=c(m[8]),B={},x=s?function(a,c){B[s]=c;B[r]=a;return B}:
-function(a){B[r]=a;return B};return{trackBy:v,getTrackByValue:z,getWatchables:c(H,function(a){var c=[];a=a||[];for(var d=n(a),f=d.length,g=0;g<f;g++){var h=a===d?g:d[g],k=x(a[h],h),h=q(a[h],k);c.push(h);if(m[2]||m[1])h=y(e,k),c.push(h);m[4]&&(k=O(e,k),c.push(k))}return c}),getOptions:function(){for(var a=[],c={},d=H(e)||[],g=n(d),h=g.length,m=0;m<h;m++){var p=d===g?m:g[m],r=x(d[p],p),s=w(e,r),p=q(s,r),t=y(e,r),u=A(e,r),r=O(e,r),s=new f(p,s,t,u,r);a.push(s);c[p]=s}return{items:a,selectValueMap:c,getOptionFromViewValue:function(a){return c[z(a)]},
-getViewValueFromOption:function(a){return v?da.copy(a.viewValue):a.viewValue}}}}}var e=X.createElement("option"),f=X.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","?ngModel"],link:function(c,g,l,k){function n(a,c){a.element=c;c.disabled=a.disabled;a.label!==c.label&&(c.label=a.label,c.textContent=a.label);a.value!==c.value&&(c.value=a.selectValue)}function p(a,c,d,e){c&&F(c.nodeName)===d?d=c:(d=e.cloneNode(!1),c?a.insertBefore(d,c):a.appendChild(d));return d}function r(a){for(var c;a;)c=
-a.nextSibling,Wb(a),a=c}function s(a){var c=q&&q[0],d=H&&H[0];if(c||d)for(;a&&(a===c||a===d||c&&8===c.nodeType);)a=a.nextSibling;return a}function v(){var a=x&&u.readValue();x=C.getOptions();var c={},d=g[0].firstChild;O&&g.prepend(q);d=s(d);x.items.forEach(function(a){var h,k;a.group?(h=c[a.group],h||(h=p(g[0],d,"optgroup",f),d=h.nextSibling,h.label=a.group,h=c[a.group]={groupElement:h,currentOptionElement:h.firstChild}),k=p(h.groupElement,h.currentOptionElement,"option",e),n(a,k),h.currentOptionElement=
-k.nextSibling):(k=p(g[0],d,"option",e),n(a,k),d=k.nextSibling)});Object.keys(c).forEach(function(a){r(c[a].currentOptionElement)});r(d);w.$render();if(!w.$isEmpty(a)){var h=u.readValue();(C.trackBy?ka(a,h):a===h)||(w.$setViewValue(h),w.$render())}}var w=k[1];if(w){var u=k[0];k=l.multiple;for(var q,z=0,y=g.children(),A=y.length;z<A;z++)if(""===y[z].value){q=y.eq(z);break}var O=!!q,H=B(e.cloneNode(!1));H.val("?");var x,C=d(l.ngOptions,g,c);k?(w.$isEmpty=function(a){return!a||0===a.length},u.writeValue=
-function(a){x.items.forEach(function(a){a.element.selected=!1});a&&a.forEach(function(a){(a=x.getOptionFromViewValue(a))&&!a.disabled&&(a.element.selected=!0)})},u.readValue=function(){var a=g.val()||[],c=[];m(a,function(a){(a=x.selectValueMap[a])&&!a.disabled&&c.push(x.getViewValueFromOption(a))});return c},C.trackBy&&c.$watchCollection(function(){if(J(w.$viewValue))return w.$viewValue.map(function(a){return C.getTrackByValue(a)})},function(){w.$render()})):(u.writeValue=function(a){var c=x.getOptionFromViewValue(a);
-c&&!c.disabled?g[0].value!==c.selectValue&&(H.remove(),O||q.remove(),g[0].value=c.selectValue,c.element.selected=!0,c.element.setAttribute("selected","selected")):null===a||O?(H.remove(),O||g.prepend(q),g.val(""),q.prop("selected",!0),q.attr("selected",!0)):(O||q.remove(),g.prepend(H),g.val("?"),H.prop("selected",!0),H.attr("selected",!0))},u.readValue=function(){var a=x.selectValueMap[g.val()];return a&&!a.disabled?(O||q.remove(),H.remove(),x.getViewValueFromOption(a)):null},C.trackBy&&c.$watch(function(){return C.getTrackByValue(w.$viewValue)},
-function(){w.$render()}));O?(q.remove(),a(q)(c),q.removeClass("ng-scope")):q=B(e.cloneNode(!1));v();c.$watchCollection(C.getWatchables,v)}}}}],Be=["$locale","$interpolate","$log",function(a,c,d){var e=/{}/g,f=/^when(Minus)?(.+)$/;return{link:function(h,g,l){function k(a){g.text(a||"")}var n=l.count,p=l.$attr.when&&g.attr(l.$attr.when),r=l.offset||0,s=h.$eval(p)||{},w={},A=c.startSymbol(),u=c.endSymbol(),q=A+n+"-"+r+u,z=da.noop,x;m(l,function(a,c){var d=f.exec(c);d&&(d=(d[1]?"-":"")+F(d[2]),s[d]=g.attr(l.$attr[c]))});
-m(s,function(a,d){w[d]=c(a.replace(e,q))});h.$watch(n,function(c){var e=parseFloat(c),f=isNaN(e);f||e in s||(e=a.pluralCat(e-r));e===x||f&&V(x)&&isNaN(x)||(z(),f=w[e],v(f)?(null!=c&&d.debug("ngPluralize: no rule defined for '"+e+"' in "+p),z=y,k()):z=h.$watch(f,k),x=e)})}}}],Ce=["$parse","$animate",function(a,c){var d=I("ngRepeat"),e=function(a,c,d,e,k,m,p){a[d]=e;k&&(a[k]=m);a.$index=c;a.$first=0===c;a.$last=c===p-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(c&1))};return{restrict:"A",
-multiElement:!0,transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,compile:function(f,h){var g=h.ngRepeat,l=X.createComment(" end ngRepeat: "+g+" "),k=g.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!k)throw d("iexp",g);var n=k[1],p=k[2],r=k[3],s=k[4],k=n.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);if(!k)throw d("iidexp",n);var v=k[3]||k[1],y=k[2];if(r&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(r)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(r)))throw d("badident",
-r);var u,q,z,A,x={$id:Ga};s?u=a(s):(z=function(a,c){return Ga(c)},A=function(a){return a});return function(a,f,h,k,n){u&&(q=function(c,d,e){y&&(x[y]=c);x[v]=d;x.$index=e;return u(a,x)});var s=fa();a.$watchCollection(p,function(h){var k,p,t=f[0],u,x=fa(),C,G,J,M,I,F,L;r&&(a[r]=h);if(Da(h))I=h,p=q||z;else for(L in p=q||A,I=[],h)ta.call(h,L)&&"$"!==L.charAt(0)&&I.push(L);C=I.length;L=Array(C);for(k=0;k<C;k++)if(G=h===I?k:I[k],J=h[G],M=p(G,J,k),s[M])F=s[M],delete s[M],x[M]=F,L[k]=F;else{if(x[M])throw m(L,
-function(a){a&&a.scope&&(s[a.id]=a)}),d("dupes",g,M,J);L[k]={id:M,scope:w,clone:w};x[M]=!0}for(u in s){F=s[u];M=rb(F.clone);c.leave(M);if(M[0].parentNode)for(k=0,p=M.length;k<p;k++)M[k].$$NG_REMOVED=!0;F.scope.$destroy()}for(k=0;k<C;k++)if(G=h===I?k:I[k],J=h[G],F=L[k],F.scope){u=t;do u=u.nextSibling;while(u&&u.$$NG_REMOVED);F.clone[0]!=u&&c.move(rb(F.clone),null,B(t));t=F.clone[F.clone.length-1];e(F.scope,k,v,J,y,G,C)}else n(function(a,d){F.scope=d;var f=l.cloneNode(!1);a[a.length++]=f;c.enter(a,
-null,B(t));t=f;F.clone=a;x[F.id]=F;e(F.scope,k,v,J,y,G,C)});s=x})}}}}],De=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngShow,function(c){a[c?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],we=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngHide,function(c){a[c?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ee=Na(function(a,c,d){a.$watch(d.ngStyle,
-function(a,d){d&&a!==d&&m(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Fe=["$animate",function(a){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,f){var h=[],g=[],l=[],k=[],n=function(a,c){return function(){a.splice(c,1)}};c.$watch(e.ngSwitch||e.on,function(c){var d,e;d=0;for(e=l.length;d<e;++d)a.cancel(l[d]);d=l.length=0;for(e=k.length;d<e;++d){var s=rb(g[d].clone);k[d].$destroy();(l[d]=a.leave(s)).then(n(l,d))}g.length=0;k.length=0;(h=f.cases["!"+
-c]||f.cases["?"])&&m(h,function(c){c.transclude(function(d,e){k.push(e);var f=c.element;d[d.length++]=X.createComment(" end ngSwitchWhen: ");g.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],Ge=Na({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,c,d,e,f){e.cases["!"+d.ngSwitchWhen]=e.cases["!"+d.ngSwitchWhen]||[];e.cases["!"+d.ngSwitchWhen].push({transclude:f,element:c})}}),He=Na({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,
-c,d,e,f){e.cases["?"]=e.cases["?"]||[];e.cases["?"].push({transclude:f,element:c})}}),Je=Na({restrict:"EAC",link:function(a,c,d,e,f){if(!f)throw I("ngTransclude")("orphan",xa(c));f(function(a){c.empty();c.append(a)})}}),je=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){"text/ng-template"==d.type&&a.put(d.id,c[0].text)}}}],Bg={$setViewValue:y,$render:y},Cg=["$element","$scope","$attrs",function(a,c,d){var e=this,f=new Ua;e.ngModelCtrl=Bg;e.unknownOption=B(X.createElement("option"));
-e.renderUnknownOption=function(c){c="? "+Ga(c)+" ?";e.unknownOption.val(c);a.prepend(e.unknownOption);a.val(c)};c.$on("$destroy",function(){e.renderUnknownOption=y});e.removeUnknownOption=function(){e.unknownOption.parent()&&e.unknownOption.remove()};e.readValue=function(){e.removeUnknownOption();return a.val()};e.writeValue=function(c){e.hasOption(c)?(e.removeUnknownOption(),a.val(c),""===c&&e.emptyOption.prop("selected",!0)):null==c&&e.emptyOption?(e.removeUnknownOption(),a.val("")):e.renderUnknownOption(c)};
-e.addOption=function(a,c){Ta(a,'"option value"');""===a&&(e.emptyOption=c);var d=f.get(a)||0;f.put(a,d+1)};e.removeOption=function(a){var c=f.get(a);c&&(1===c?(f.remove(a),""===a&&(e.emptyOption=w)):f.put(a,c-1))};e.hasOption=function(a){return!!f.get(a)}}],ke=function(){return{restrict:"E",require:["select","?ngModel"],controller:Cg,link:function(a,c,d,e){var f=e[1];if(f){var h=e[0];h.ngModelCtrl=f;f.$render=function(){h.writeValue(f.$viewValue)};c.on("change",function(){a.$apply(function(){f.$setViewValue(h.readValue())})});
-if(d.multiple){h.readValue=function(){var a=[];m(c.find("option"),function(c){c.selected&&a.push(c.value)});return a};h.writeValue=function(a){var d=new Ua(a);m(c.find("option"),function(a){a.selected=A(d.get(a.value))})};var g,l=NaN;a.$watch(function(){l!==f.$viewValue||ka(g,f.$viewValue)||(g=ja(f.$viewValue),f.$render());l=f.$viewValue});f.$isEmpty=function(a){return!a||0===a.length}}}}}},me=["$interpolate",function(a){return{restrict:"E",priority:100,compile:function(c,d){if(A(d.value))var e=a(d.value,
-!0);else{var f=a(c.text(),!0);f||d.$set("value",c.text())}return function(a,c,d){function k(a){p.addOption(a,c);p.ngModelCtrl.$render();c[0].hasAttribute("selected")&&(c[0].selected=!0)}var m=c.parent(),p=m.data("$selectController")||m.parent().data("$selectController");if(p&&p.ngModelCtrl){if(e){var r;d.$observe("value",function(a){A(r)&&p.removeOption(r);r=a;k(a)})}else f?a.$watch(f,function(a,c){d.$set("value",a);c!==a&&p.removeOption(c);k(a)}):k(d.value);c.on("$destroy",function(){p.removeOption(d.value);
-p.ngModelCtrl.$render()})}}}}}],le=qa({restrict:"E",terminal:!1}),Gc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){e&&(d.required=!0,e.$validators.required=function(a,c){return!d.required||!e.$isEmpty(c)},d.$observe("required",function(){e.$validate()}))}}},Fc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f,h=d.ngPattern||d.pattern;d.$observe("pattern",function(a){G(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw I("ngPattern")("noregexp",
-h,a,xa(c));f=a||w;e.$validate()});e.$validators.pattern=function(a,c){return e.$isEmpty(c)||v(f)||f.test(c)}}}}},Ic=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=-1;d.$observe("maxlength",function(a){a=Y(a);f=isNaN(a)?-1:a;e.$validate()});e.$validators.maxlength=function(a,c){return 0>f||e.$isEmpty(c)||c.length<=f}}}}},Hc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=0;d.$observe("minlength",function(a){f=Y(a)||0;e.$validate()});
-e.$validators.minlength=function(a,c){return e.$isEmpty(c)||c.length>=f}}}}};Q.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(ce(),ee(da),da.module("ngLocale",[],["$provide",function(a){function c(a){a+="";var c=a.indexOf(".");return-1==c?0:a.length-c-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),
-SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,
-maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",pluralCat:function(a,e){var f=a|0,h=e;w===h&&(h=Math.min(c(a),3));Math.pow(10,h);return 1==f&&0==h?"one":"other"}})}]),B(X).ready(function(){Zd(X,zc)}))})(window,document);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
-//# sourceMappingURL=angular.min.js.map
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular/angular.min.js.gzip b/views/ngXosViews/serviceGrid/src/vendor/angular/angular.min.js.gzip
deleted file mode 100644
index ede8ca3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular/angular.min.js.gzip
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular/angular.min.js.map b/views/ngXosViews/serviceGrid/src/vendor/angular/angular.min.js.map
deleted file mode 100644
index a57c997..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular/angular.min.js.map
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-"version":3,
-"file":"angular.min.js",
-"lineCount":293,
-"mappings":"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",
-"sources":["angular.js"],
-"names":["window","document","undefined","minErr","isArrayLike","obj","isWindow","length","Object","nodeType","NODE_TYPE_ELEMENT","isString","isArray","forEach","iterator","context","key","isFunction","hasOwnProperty","call","isPrimitive","isBlankObject","forEachSorted","keys","sort","i","reverseParams","iteratorFn","value","nextUid","uid","setHashKey","h","$$hashKey","baseExtend","dst","objs","deep","ii","isObject","j","jj","src","isDate","Date","valueOf","isRegExp","RegExp","extend","slice","arguments","merge","toInt","str","parseInt","inherit","parent","extra","create","noop","identity","$","valueFn","hasCustomToString","toString","prototype","isUndefined","isDefined","getPrototypeOf","isNumber","isScope","$evalAsync","$watch","isBoolean","isElement","node","nodeName","prop","attr","find","makeMap","items","split","nodeName_","element","lowercase","arrayRemove","array","index","indexOf","splice","copy","source","destination","stackSource","stackDest","ngMinErr","TYPED_ARRAY_REGEXP","test","push","constructor","getTime","match","lastIndex","cloneNode","emptyObject","shallowCopy","charAt","equals","o1","o2","t1","t2","keySet","createMap","concat","array1","array2","bind","self","fn","curryArgs","startIndex","apply","toJsonReplacer","val","toJson","pretty","JSON","stringify","fromJson","json","parse","timezoneToOffset","timezone","fallback","requestedTimezoneOffset","isNaN","convertTimezoneToLocal","date","reverse","timezoneOffset","getTimezoneOffset","setMinutes","getMinutes","minutes","startingTag","jqLite","clone","empty","e","elemHtml","append","html","NODE_TYPE_TEXT","replace","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","splitPoint","substring","toKeyValue","parts","arrayValue","encodeUriQuery","join","encodeUriSegment","pctEncodeSpaces","encodeURIComponent","getNgAttribute","ngAttr","ngAttrPrefixes","getAttribute","angularInit","bootstrap","appElement","module","config","prefix","name","hasAttribute","candidate","querySelector","strictDi","modules","defaultConfig","doBootstrap","injector","tag","unshift","$provide","debugInfoEnabled","$compileProvider","createInjector","invoke","bootstrapApply","scope","compile","$apply","data","NG_ENABLE_DEBUG_INFO","NG_DEFER_BOOTSTRAP","angular","resumeBootstrap","angular.resumeBootstrap","extraModules","resumeDeferredBootstrap","reloadWithDebugInfo","location","reload","getTestability","rootElement","get","snake_case","separator","SNAKE_CASE_REGEXP","letter","pos","toLowerCase","bindJQuery","originalCleanData","bindJQueryFired","jqName","jq","jQuery","on","JQLitePrototype","isolateScope","controller","inheritedData","cleanData","jQuery.cleanData","elems","events","skipDestroyOnNextJQueryCleanData","elem","_data","$destroy","triggerHandler","JQLite","assertArg","arg","reason","assertArgFn","acceptArrayAnnotation","assertNotHasOwnProperty","getter","path","bindFnToScope","lastInstance","len","getBlockNodes","nodes","endNode","blockNodes","nextSibling","setupModuleLoader","ensure","factory","$injectorMinErr","$$minErr","requires","configFn","invokeLater","provider","method","insertMethod","queue","invokeQueue","moduleInstance","invokeLaterAndSetModuleName","recipeName","factoryFunction","$$moduleName","configBlocks","runBlocks","_invokeQueue","_configBlocks","_runBlocks","service","constant","decorator","animation","filter","directive","run","block","publishExternalAPI","version","uppercase","counter","csp","angularModule","ngModule","$$sanitizeUri","$$SanitizeUriProvider","$CompileProvider","a","htmlAnchorDirective","input","inputDirective","textarea","form","formDirective","script","scriptDirective","select","selectDirective","style","styleDirective","option","optionDirective","ngBind","ngBindDirective","ngBindHtml","ngBindHtmlDirective","ngBindTemplate","ngBindTemplateDirective","ngClass","ngClassDirective","ngClassEven","ngClassEvenDirective","ngClassOdd","ngClassOddDirective","ngCloak","ngCloakDirective","ngController","ngControllerDirective","ngForm","ngFormDirective","ngHide","ngHideDirective","ngIf","ngIfDirective","ngInclude","ngIncludeDirective","ngInit","ngInitDirective","ngNonBindable","ngNonBindableDirective","ngPluralize","ngPluralizeDirective","ngRepeat","ngRepeatDirective","ngShow","ngShowDirective","ngStyle","ngStyleDirective","ngSwitch","ngSwitchDirective","ngSwitchWhen","ngSwitchWhenDirective","ngSwitchDefault","ngSwitchDefaultDirective","ngOptions","ngOptionsDirective","ngTransclude","ngTranscludeDirective","ngModel","ngModelDirective","ngList","ngListDirective","ngChange","ngChangeDirective","pattern","patternDirective","ngPattern","required","requiredDirective","ngRequired","minlength","minlengthDirective","ngMinlength","maxlength","maxlengthDirective","ngMaxlength","ngValue","ngValueDirective","ngModelOptions","ngModelOptionsDirective","ngIncludeFillContentDirective","ngAttributeAliasDirectives","ngEventDirectives","$anchorScroll","$AnchorScrollProvider","$animate","$AnimateProvider","$animateCss","$CoreAnimateCssProvider","$$animateQueue","$$CoreAnimateQueueProvider","$$AnimateRunner","$$CoreAnimateRunnerProvider","$browser","$BrowserProvider","$cacheFactory","$CacheFactoryProvider","$controller","$ControllerProvider","$document","$DocumentProvider","$exceptionHandler","$ExceptionHandlerProvider","$filter","$FilterProvider","$$forceReflow","$$ForceReflowProvider","$interpolate","$InterpolateProvider","$interval","$IntervalProvider","$http","$HttpProvider","$httpParamSerializer","$HttpParamSerializerProvider","$httpParamSerializerJQLike","$HttpParamSerializerJQLikeProvider","$httpBackend","$HttpBackendProvider","$xhrFactory","$xhrFactoryProvider","$location","$LocationProvider","$log","$LogProvider","$parse","$ParseProvider","$rootScope","$RootScopeProvider","$q","$QProvider","$$q","$$QProvider","$sce","$SceProvider","$sceDelegate","$SceDelegateProvider","$sniffer","$SnifferProvider","$templateCache","$TemplateCacheProvider","$templateRequest","$TemplateRequestProvider","$$testability","$$TestabilityProvider","$timeout","$TimeoutProvider","$window","$WindowProvider","$$rAF","$$RAFProvider","$$jqLite","$$jqLiteProvider","$$HashMap","$$HashMapProvider","$$cookieReader","$$CookieReaderProvider","camelCase","SPECIAL_CHARS_REGEXP","_","offset","toUpperCase","MOZ_HACK_REGEXP","jqLiteAcceptsData","NODE_TYPE_DOCUMENT","jqLiteBuildFragment","tmp","fragment","createDocumentFragment","HTML_REGEXP","appendChild","createElement","TAG_NAME_REGEXP","exec","wrap","wrapMap","_default","innerHTML","XHTML_TAG_REGEXP","lastChild","childNodes","firstChild","textContent","createTextNode","argIsString","trim","jqLiteMinErr","parsed","SINGLE_TAG_REGEXP","jqLiteAddNodes","jqLiteClone","jqLiteDealoc","onlyDescendants","jqLiteRemoveData","querySelectorAll","descendants","l","jqLiteOff","type","unsupported","expandoStore","jqLiteExpandoStore","handle","listenerFns","removeEventListener","expandoId","ng339","jqCache","createIfNecessary","jqId","jqLiteData","isSimpleSetter","isSimpleGetter","massGetter","jqLiteHasClass","selector","jqLiteRemoveClass","cssClasses","setAttribute","cssClass","jqLiteAddClass","existingClasses","root","elements","jqLiteController","jqLiteInheritedData","documentElement","names","parentNode","NODE_TYPE_DOCUMENT_FRAGMENT","host","jqLiteEmpty","removeChild","jqLiteRemove","keepData","jqLiteDocumentLoaded","action","win","readyState","setTimeout","getBooleanAttrName","booleanAttr","BOOLEAN_ATTR","BOOLEAN_ELEMENTS","createEventHandler","eventHandler","event","isDefaultPrevented","event.isDefaultPrevented","defaultPrevented","eventFns","eventFnsLength","immediatePropagationStopped","originalStopImmediatePropagation","stopImmediatePropagation","event.stopImmediatePropagation","stopPropagation","isImmediatePropagationStopped","event.isImmediatePropagationStopped","$get","this.$get","hasClass","classes","addClass","removeClass","hashKey","nextUidFn","objType","HashMap","isolatedUid","this.nextUid","put","anonFn","args","fnText","STRIP_COMMENTS","FN_ARGS","modulesToLoad","supportObject","delegate","provider_","providerInjector","instantiate","providerCache","providerSuffix","enforceReturnValue","enforcedReturnValue","result","instanceInjector","factoryFn","enforce","loadModules","moduleFn","runInvokeQueue","invokeArgs","loadedModules","message","stack","createInternalInjector","cache","getService","serviceName","caller","INSTANTIATING","err","shift","locals","$inject","$$annotate","Type","instance","returnedValue","annotate","has","$injector","instanceCache","decorFn","origProvider","orig$get","origProvider.$get","origInstance","$delegate","autoScrollingEnabled","disableAutoScrolling","this.disableAutoScrolling","getFirstAnchor","list","Array","some","scrollTo","scrollIntoView","scroll","yOffset","getComputedStyle","position","getBoundingClientRect","bottom","elemTop","top","scrollBy","hash","elm","getElementById","getElementsByName","autoScrollWatch","autoScrollWatchAction","newVal","oldVal","mergeClasses","b","splitClasses","klass","prepareAnimateOptions","options","Browser","completeOutstandingRequest","outstandingRequestCount","outstandingRequestCallbacks","pop","error","cacheStateAndFireUrlChange","pendingLocation","cacheState","fireUrlChange","history","state","cachedState","lastCachedState","lastBrowserUrl","url","lastHistoryState","urlChangeListeners","listener","clearTimeout","pendingDeferIds","isMock","$$completeOutstandingRequest","$$incOutstandingRequestCount","self.$$incOutstandingRequestCount","notifyWhenNoOutstandingRequests","self.notifyWhenNoOutstandingRequests","callback","href","baseElement","self.url","sameState","sameBase","stripHash","substr","self.state","urlChangeInit","onUrlChange","self.onUrlChange","$$applicationDestroyed","self.$$applicationDestroyed","off","$$checkUrlChange","baseHref","self.baseHref","defer","self.defer","delay","timeoutId","cancel","self.defer.cancel","deferId","cacheFactory","cacheId","refresh","entry","freshEnd","staleEnd","n","link","p","nextEntry","prevEntry","caches","size","stats","id","capacity","Number","MAX_VALUE","lruHash","lruEntry","remove","removeAll","destroy","info","cacheFactory.info","cacheFactory.get","$$sanitizeUriProvider","parseIsolateBindings","directiveName","isController","LOCAL_REGEXP","bindings","definition","scopeName","$compileMinErr","mode","collection","optional","attrName","assertValidDirectiveName","hasDirectives","COMMENT_DIRECTIVE_REGEXP","CLASS_DIRECTIVE_REGEXP","ALL_OR_NOTHING_ATTRS","REQUIRE_PREFIX_REGEXP","EVENT_HANDLER_ATTR_REGEXP","this.directive","registerDirective","directiveFactory","Suffix","directives","priority","require","restrict","bindToController","controllerAs","CNTRL_REG","$$bindings","$$isolateBindings","aHrefSanitizationWhitelist","this.aHrefSanitizationWhitelist","regexp","imgSrcSanitizationWhitelist","this.imgSrcSanitizationWhitelist","this.debugInfoEnabled","enabled","safeAddClass","$element","className","$compileNodes","transcludeFn","maxPriority","ignoreDirective","previousCompileContext","nodeValue","compositeLinkFn","compileNodes","$$addScopeClass","namespace","publicLinkFn","cloneConnectFn","parentBoundTranscludeFn","transcludeControllers","futureParentElement","$$boundTransclude","$linkNode","wrapTemplate","controllerName","$$addScopeInfo","nodeList","$rootElement","childLinkFn","childScope","childBoundTranscludeFn","stableNodeList","nodeLinkFnFound","linkFns","idx","nodeLinkFn","destroyBindings","$new","$$destroyBindings","$on","transcludeOnThisElement","createBoundTranscludeFn","transclude","templateOnThisElement","attrs","linkFnFound","Attributes","collectDirectives","applyDirectivesToNode","$$element","terminal","previousBoundTranscludeFn","boundTranscludeFn","transcludedScope","cloneFn","controllers","containingScope","$$transcluded","attrsMap","$attr","addDirective","directiveNormalize","isNgAttr","nAttrs","attributes","attrStartName","attrEndName","ngAttrName","NG_ATTR_BINDING","PREFIX_REGEXP","directiveNName","directiveIsMultiElement","nName","addAttrInterpolateDirective","animVal","msie","addTextInterpolateDirective","NODE_TYPE_COMMENT","byPriority","groupScan","attrStart","attrEnd","depth","groupElementsLinkFnWrapper","linkFn","compileNode","templateAttrs","jqCollection","originalReplaceDirective","preLinkFns","postLinkFns","addLinkFns","pre","post","newIsolateScopeDirective","$$isolateScope","cloneAndAnnotateFn","getControllers","elementControllers","inheritType","dataName","setupControllers","controllerDirectives","controllerKey","$scope","$attrs","$transclude","controllerInstance","hasElementTranscludeDirective","linkNode","thisLinkFn","controllersBoundTransclude","cloneAttachFn","scopeToChild","templateDirective","$$originalDirective","initializeDirectiveBindings","scopeDirective","newScopeDirective","controllerForBindings","identifier","controllerResult","invokeLinkFn","template","templateUrl","terminalPriority","nonTlbTranscludeDirective","hasTranscludeDirective","hasTemplate","$compileNode","$template","childTranscludeFn","$$start","$$end","directiveValue","assertNoDuplicate","$$tlb","createComment","replaceWith","replaceDirective","contents","denormalizeTemplate","removeComments","templateNamespace","newTemplateAttrs","templateDirectives","unprocessedDirectives","markDirectivesAsIsolate","mergeTemplateAttributes","compileTemplateUrl","Math","max","tDirectives","startAttrName","endAttrName","multiElement","srcAttr","dstAttr","$set","tAttrs","linkQueue","afterTemplateNodeLinkFn","afterTemplateChildLinkFn","beforeTemplateCompileNode","origAsyncDirective","derivedSyncDirective","then","content","tempTemplateAttrs","beforeTemplateLinkNode","linkRootElement","$$destroyed","oldClasses","delayedNodeLinkFn","ignoreChildLinkFn","diff","what","previousDirective","wrapModuleNameIfDefined","moduleName","text","interpolateFn","textInterpolateCompileFn","templateNode","templateNodeParent","hasCompileParent","$$addBindingClass","textInterpolateLinkFn","$$addBindingInfo","expressions","interpolateFnWatchAction","wrapper","getTrustedContext","attrNormalizedName","HTML","RESOURCE_URL","allOrNothing","trustedContext","attrInterpolatePreLinkFn","$$observers","newValue","$$inter","$$scope","oldValue","$updateClass","elementsToRemove","newNode","firstElementToRemove","removeCount","j2","replaceChild","hasData","expando","k","kk","annotation","newScope","onNewScopeDestroyed","lastValue","parentGet","parentSet","compare","$observe","literal","assign","parentValueWatch","parentValue","$stateful","unwatch","$watchCollection","attributesToCopy","$normalize","$addClass","classVal","$removeClass","newClasses","toAdd","tokenDifference","toRemove","writeAttr","booleanKey","aliasedKey","ALIASED_ATTR","observer","trimmedSrcset","srcPattern","rawUris","nbrUrisWith2parts","floor","innerIdx","lastTuple","removeAttr","listeners","startSymbol","endSymbol","binding","isolated","noTemplate","str1","str2","values","tokens1","tokens2","token","jqNodes","globals","register","this.register","allowGlobals","this.allowGlobals","addIdentifier","expression","later","ident","$controllerMinErr","controllerPrototype","exception","cause","serializeValue","v","toISOString","ngParamSerializer","params","jQueryLikeParamSerializer","serialize","toSerialize","topLevel","defaultHttpResponseTransform","headers","tempData","JSON_PROTECTION_PREFIX","contentType","jsonStart","JSON_START","JSON_ENDS","parseHeaders","line","headerVal","headerKey","headersGetter","headersObj","transformData","status","fns","defaults","transformResponse","transformRequest","d","common","CONTENT_TYPE_APPLICATION_JSON","patch","xsrfCookieName","xsrfHeaderName","paramSerializer","useApplyAsync","this.useApplyAsync","useLegacyPromise","useLegacyPromiseExtensions","this.useLegacyPromiseExtensions","interceptorFactories","interceptors","requestConfig","response","resp","reject","executeHeaderFns","headerContent","processedHeaders","headerFn","header","mergeHeaders","defHeaders","reqHeaders","defHeaderName","lowercaseDefHeaderName","reqHeaderName","chain","serverRequest","reqData","withCredentials","sendReq","promise","when","reversedInterceptors","interceptor","request","requestError","responseError","thenFn","rejectFn","success","promise.success","promise.error","$httpMinErrLegacyFn","done","headersString","statusText","resolveHttpPromise","resolvePromise","$applyAsync","$$phase","deferred","resolve","resolvePromiseWithResult","removePendingReq","pendingRequests","cachedResp","buildUrl","defaultCache","xsrfValue","urlIsSameOrigin","timeout","responseType","serializedParams","interceptorFactory","createShortMethods","createShortMethodsWithData","createXhr","XMLHttpRequest","createHttpBackend","callbacks","$browserDefer","rawDocument","jsonpReq","callbackId","async","body","called","addEventListener","timeoutRequest","jsonpDone","xhr","abort","completeRequest","open","setRequestHeader","onload","xhr.onload","responseText","urlResolve","protocol","getAllResponseHeaders","onerror","onabort","send","this.startSymbol","this.endSymbol","escape","ch","unescapeText","escapedStartRegexp","escapedEndRegexp","mustHaveExpression","parseStringifyInterceptor","getTrusted","$interpolateMinErr","interr","endIndex","parseFns","textLength","expressionPositions","startSymbolLength","exp","endSymbolLength","throwNoconcat","compute","interpolationFn","$$watchDelegate","$watchGroup","interpolateFnWatcher","oldValues","currValue","$interpolate.startSymbol","$interpolate.endSymbol","interval","count","invokeApply","hasParams","setInterval","clearInterval","iteration","skipApply","$$intervalId","tick","notify","intervals","interval.cancel","encodePath","segments","parseAbsoluteUrl","absoluteUrl","locationObj","parsedUrl","$$protocol","$$host","hostname","$$port","port","DEFAULT_PORTS","parseAppUrl","relativeUrl","prefixed","$$path","pathname","$$search","search","$$hash","beginsWith","begin","whole","trimEmptyHash","LocationHtml5Url","appBase","appBaseNoFile","basePrefix","$$html5","$$parse","this.$$parse","pathUrl","$locationMinErr","$$compose","this.$$compose","$$url","$$absUrl","$$parseLinkUrl","this.$$parseLinkUrl","relHref","appUrl","prevAppUrl","rewrittenUrl","LocationHashbangUrl","hashPrefix","withoutBaseUrl","withoutHashUrl","windowsFilePathExp","base","firstPathSegmentMatch","LocationHashbangInHtml5Url","locationGetter","property","locationGetterSetter","preprocess","html5Mode","requireBase","rewriteLinks","this.hashPrefix","this.html5Mode","setBrowserUrlWithFallback","oldUrl","oldState","$$state","afterLocationChange","$broadcast","absUrl","LocationMode","initialUrl","lastIndexOf","IGNORE_URI_REGEXP","ctrlKey","metaKey","shiftKey","which","button","target","absHref","preventDefault","initializing","newUrl","newState","$digest","$locationWatch","currentReplace","$$replace","urlOrStateChanged","debug","debugEnabled","this.debugEnabled","flag","formatError","Error","sourceURL","consoleLog","console","logFn","log","hasApply","arg1","arg2","warn","ensureSafeMemberName","fullExpression","$parseMinErr","getStringValue","ensureSafeObject","children","ensureSafeFunction","CALL","APPLY","BIND","ensureSafeAssignContext","Function","ifDefined","plusFn","r","findConstantAndWatchExpressions","ast","allConstants","argsToWatch","AST","Program","expr","Literal","toWatch","UnaryExpression","argument","BinaryExpression","left","right","LogicalExpression","ConditionalExpression","alternate","consequent","Identifier","MemberExpression","object","computed","CallExpression","callee","AssignmentExpression","ArrayExpression","ObjectExpression","properties","ThisExpression","getInputs","lastExpression","isAssignable","assignableAST","NGValueParameter","operator","isLiteral","ASTCompiler","astBuilder","ASTInterpreter","isPossiblyDangerousMemberName","getValueOf","objectValueOf","cacheDefault","cacheExpensive","expressionInputDirtyCheck","oldValueOfValue","inputsWatchDelegate","objectEquality","parsedExpression","prettyPrintExpression","inputExpressions","inputs","lastResult","oldInputValueOf","expressionInputWatch","newInputValue","oldInputValueOfValues","oldInputValues","expressionInputsWatch","changed","oneTimeWatchDelegate","oneTimeWatch","oneTimeListener","old","$$postDigest","oneTimeLiteralWatchDelegate","isAllDefined","allDefined","constantWatchDelegate","constantWatch","constantListener","addInterceptor","interceptorFn","watchDelegate","regularInterceptedExpression","oneTimeInterceptedExpression","noUnsafeEval","$parseOptions","expensiveChecks","$parseOptionsExpensive","oneTime","cacheKey","parseOptions","lexer","Lexer","parser","Parser","qFactory","nextTick","exceptionHandler","callOnce","resolveFn","Promise","simpleBind","scheduleProcessQueue","processScheduled","pending","Deferred","$qMinErr","TypeError","onFulfilled","onRejected","progressBack","catch","finally","handleCallback","$$reject","$$resolve","progress","makePromise","resolved","isResolved","callbackOutput","errback","$Q","Q","resolver","all","promises","results","requestAnimationFrame","webkitRequestAnimationFrame","cancelAnimationFrame","webkitCancelAnimationFrame","webkitCancelRequestAnimationFrame","rafSupported","raf","timer","supported","createChildScopeClass","ChildScope","$$watchers","$$nextSibling","$$childHead","$$childTail","$$listeners","$$listenerCount","$$watchersCount","$id","$$ChildScope","TTL","$rootScopeMinErr","lastDirtyWatch","applyAsyncId","digestTtl","this.digestTtl","destroyChildScope","$event","currentScope","Scope","$parent","$$prevSibling","$root","beginPhase","phase","incrementWatchersCount","current","decrementListenerCount","initWatchVal","flushApplyAsync","applyAsyncQueue","scheduleApplyAsync","isolate","child","watchExp","watcher","last","eq","deregisterWatch","watchExpressions","watchGroupAction","changeReactionScheduled","firstRun","newValues","deregisterFns","shouldCall","deregisterWatchGroup","unwatchFn","watchGroupSubAction","$watchCollectionInterceptor","_value","bothNaN","newItem","oldItem","internalArray","oldLength","changeDetected","newLength","internalObject","veryOldValue","trackVeryOldValue","changeDetector","initRun","$watchCollectionAction","watch","watchers","dirty","ttl","watchLog","logIdx","asyncTask","asyncQueue","$eval","msg","next","postDigestQueue","eventName","this.$watchGroup","$applyAsyncExpression","namedListeners","indexOfListener","$emit","targetScope","listenerArgs","$$asyncQueue","$$postDigestQueue","$$applyAsyncQueue","sanitizeUri","uri","isImage","regex","normalizedVal","adjustMatcher","matcher","$sceMinErr","escapeForRegexp","adjustMatchers","matchers","adjustedMatchers","SCE_CONTEXTS","resourceUrlWhitelist","resourceUrlBlacklist","this.resourceUrlWhitelist","this.resourceUrlBlacklist","matchUrl","generateHolderType","Base","holderType","trustedValue","$$unwrapTrustedValue","this.$$unwrapTrustedValue","holderType.prototype.valueOf","holderType.prototype.toString","htmlSanitizer","trustedValueHolderBase","byType","CSS","URL","JS","trustAs","Constructor","maybeTrusted","allowed","this.enabled","sce","isEnabled","sce.isEnabled","sce.getTrusted","parseAs","sce.parseAs","enumValue","lName","eventSupport","android","userAgent","navigator","boxee","vendorPrefix","vendorRegex","bodyStyle","transitions","animations","webkitTransition","webkitAnimation","pushState","hasEvent","divElm","handleRequestFn","tpl","ignoreRequestError","totalPendingRequests","getTrustedResourceUrl","transformer","httpOptions","handleError","testability","testability.findBindings","opt_exactMatch","getElementsByClassName","matches","dataBinding","bindingName","testability.findModels","prefixes","attributeEquals","testability.getLocation","testability.setLocation","testability.whenStable","deferreds","$$timeoutId","timeout.cancel","urlParsingNode","requestUrl","originUrl","$$CookieReader","safeDecodeURIComponent","lastCookies","lastCookieString","cookieArray","cookie","currentCookieString","filters","suffix","currencyFilter","dateFilter","filterFilter","jsonFilter","limitToFilter","lowercaseFilter","numberFilter","orderByFilter","uppercaseFilter","comparator","matchAgainstAnyProp","getTypeForFilter","expressionType","predicateFn","createPredicateFn","shouldMatchPrimitives","actual","expected","item","deepCompare","dontMatchWholeObject","actualType","expectedType","expectedVal","matchAnyProperty","actualVal","$locale","formats","NUMBER_FORMATS","amount","currencySymbol","fractionSize","CURRENCY_SYM","PATTERNS","maxFrac","formatNumber","GROUP_SEP","DECIMAL_SEP","number","groupSep","decimalSep","isNegative","abs","isInfinity","Infinity","isFinite","numStr","formatedText","hasExponent","toFixed","parseFloat","fractionLen","min","minFrac","round","fraction","lgroup","lgSize","group","gSize","negPre","posPre","negSuf","posSuf","padNumber","num","digits","neg","dateGetter","dateStrGetter","shortForm","getFirstThursdayOfYear","year","dayOfWeekOnFirst","getDay","weekGetter","firstThurs","getFullYear","thisThurs","getMonth","getDate","eraGetter","ERAS","jsonStringToDate","string","R_ISO8601_STR","tzHour","tzMin","dateSetter","setUTCFullYear","setFullYear","timeSetter","setUTCHours","setHours","m","s","ms","format","DATETIME_FORMATS","NUMBER_STRING","DATE_FORMATS_SPLIT","dateTimezoneOffset","DATE_FORMATS","spacing","limit","processPredicates","sortPredicate","reverseOrder","map","predicate","descending","predicates","compareValues","getComparisonObject","predicateValues","doComparison","v1","v2","ngDirective","FormController","controls","$error","$$success","$pending","$name","$dirty","$pristine","$valid","$invalid","$submitted","$$parentForm","nullFormCtrl","$rollbackViewValue","form.$rollbackViewValue","control","$commitViewValue","form.$commitViewValue","$addControl","form.$addControl","$$renameControl","form.$$renameControl","newName","oldName","$removeControl","form.$removeControl","$setValidity","addSetValidityMethod","ctrl","set","unset","$setDirty","form.$setDirty","PRISTINE_CLASS","DIRTY_CLASS","$setPristine","form.$setPristine","setClass","SUBMITTED_CLASS","$setUntouched","form.$setUntouched","$setSubmitted","form.$setSubmitted","stringBasedInputType","$formatters","$isEmpty","baseInputType","composing","ev","ngTrim","$viewValue","$$hasNativeValidators","$setViewValue","deferListener","origValue","keyCode","$render","ctrl.$render","createDateParser","mapping","iso","ISO_DATE_REGEXP","yyyy","MM","dd","HH","getHours","mm","ss","getSeconds","sss","getMilliseconds","part","NaN","createDateInputType","parseDate","dynamicDateInputType","isValidDate","parseObservedDateValue","badInputChecker","$options","previousDate","$$parserName","$parsers","parsedDate","ngModelMinErr","ngMin","minVal","$validators","ctrl.$validators.min","$validate","ngMax","maxVal","ctrl.$validators.max","validity","VALIDITY_STATE_PROPERTY","badInput","typeMismatch","parseConstantExpr","parseFn","classDirective","arrayDifference","arrayClasses","digestClassCounts","classCounts","classesToUpdate","ngClassWatchAction","$index","old$index","mod","cachedToggleClass","switchValue","classCache","toggleValidationCss","validationErrorKey","isValid","VALID_CLASS","INVALID_CLASS","setValidity","isObjectEmpty","PENDING_CLASS","combinedState","REGEX_STRING_REGEXP","documentMode","rules","ngCspElement","ngCspAttribute","noInlineStyle","name_","el","full","major","minor","dot","codeName","JQLite._data","MOUSE_EVENT_MAP","mouseleave","mouseenter","optgroup","tbody","tfoot","colgroup","caption","thead","th","td","ready","trigger","fired","removeData","jqLiteHasData","removeAttribute","css","NODE_TYPE_ATTRIBUTE","lowercasedName","specified","getNamedItem","ret","getText","$dv","multiple","selected","nodeCount","jqLiteOn","types","related","relatedTarget","contains","one","onFn","replaceNode","insertBefore","contentDocument","prepend","wrapNode","detach","after","newElement","toggleClass","condition","classCondition","nextElementSibling","getElementsByTagName","extraParameters","dummyEvent","handlerArgs","eventFnsCopy","arg3","unbind","FN_ARG_SPLIT","FN_ARG","argDecl","underscore","$animateMinErr","AnimateRunner","end","resume","pause","complete","pass","fail","postDigestElements","updateData","handleCSSClassChanges","existing","pin","domOperation","from","to","classesAdded","add","classesRemoved","$$registeredAnimations","classNameFilter","this.classNameFilter","$$classNameFilter","reservedRegex","NG_ANIMATE_CLASSNAME","domInsert","parentElement","afterElement","afterNode","ELEMENT_NODE","previousElementSibling","runner","enter","move","leave","addclass","animate","tempClasses","RAFPromise","getPromise","f1","f2","closed","cleanupStyles","start","domNode","offsetWidth","APPLICATION_JSON","$httpMinErr","$interpolateMinErr.throwNoconcat","$interpolateMinErr.interr","PATH_MATCH","locationPrototype","paramValue","Location","Location.prototype.state","OPERATORS","ESCAPE","lex","tokens","readString","peek","readNumber","isIdent","readIdent","is","isWhitespace","ch2","ch3","op2","op3","op1","throwError","chars","isExpOperator","colStr","peekCh","quote","rawString","hex","String","fromCharCode","rep","ExpressionStatement","Property","program","expressionStatement","expect","filterChain","assignment","ternary","logicalOR","consume","logicalAND","equality","relational","additive","multiplicative","unary","primary","arrayDeclaration","constants","parseArguments","baseExpression","peekToken","kind","e1","e2","e3","e4","peekAhead","t","nextId","vars","own","assignable","stage","computing","recurse","return_","generateFunction","fnKey","intoId","watchId","fnString","USE","STRICT","filterPrefix","watchFns","varsPrefix","section","nameId","recursionFn","skipWatchIdCheck","if_","lazyAssign","computedMember","lazyRecurse","plus","not","getHasOwnProperty","nonComputedMember","addEnsureSafeObject","notNull","addEnsureSafeMemberName","addEnsureSafeFunction","member","addEnsureSafeAssignContext","filterName","defaultValue","stringEscapeRegex","stringEscapeFn","c","charCodeAt","skip","init","fn.assign","rhs","lhs","unary+","unary-","unary!","binary+","binary-","binary*","binary/","binary%","binary===","binary!==","binary==","binary!=","binary<","binary>","binary<=","binary>=","binary&&","binary||","ternary?:","astCompiler","yy","y","MMMM","MMM","M","H","hh","EEEE","EEE","ampmGetter","AMPMS","Z","timeZoneGetter","zone","paddedZone","ww","w","G","GG","GGG","GGGG","longEraGetter","ERANAMES","xlinkHref","propName","defaultLinkFn","normalized","ngBooleanAttrWatchAction","htmlAttr","ngAttrAliasWatchAction","nullFormRenameControl","formDirectiveFactory","isNgForm","getSetter","ngFormCompile","formElement","nameAttr","ngFormPreLink","ctrls","handleFormSubmission","setter","URL_REGEXP","EMAIL_REGEXP","NUMBER_REGEXP","DATE_REGEXP","DATETIMELOCAL_REGEXP","WEEK_REGEXP","MONTH_REGEXP","TIME_REGEXP","inputType","textInputType","weekParser","isoWeek","existingDate","week","hours","seconds","milliseconds","addDays","numberInputType","urlInputType","ctrl.$validators.url","modelValue","viewValue","emailInputType","email","ctrl.$validators.email","radioInputType","checked","checkboxInputType","trueValue","ngTrueValue","falseValue","ngFalseValue","ctrl.$isEmpty","CONSTANT_VALUE_REGEXP","tplAttr","ngValueConstantLink","ngValueLink","valueWatchAction","$compile","ngBindCompile","templateElement","ngBindLink","ngBindWatchAction","ngBindTemplateCompile","ngBindTemplateLink","ngBindHtmlCompile","tElement","ngBindHtmlGetter","ngBindHtmlWatch","ngBindHtmlLink","ngBindHtmlWatchAction","getTrustedHtml","$viewChangeListeners","forceAsyncEvents","ngEventHandler","previousElements","ngIfWatchAction","srcExp","onloadExp","autoScrollExp","autoscroll","changeCounter","previousElement","currentElement","cleanupLastIncludeContent","ngIncludeWatchAction","afterAnimation","thisChangeId","namespaceAdaptedClone","trimValues","NgModelController","$modelValue","$$rawModelValue","$asyncValidators","$untouched","$touched","parsedNgModel","parsedNgModelAssign","ngModelGet","ngModelSet","pendingDebounce","parserValid","$$setOptions","this.$$setOptions","getterSetter","invokeModelGetter","invokeModelSetter","$$$p","this.$isEmpty","currentValidationRunId","this.$setPristine","this.$setDirty","this.$setUntouched","UNTOUCHED_CLASS","TOUCHED_CLASS","$setTouched","this.$setTouched","this.$rollbackViewValue","$$lastCommittedViewValue","this.$validate","prevValid","prevModelValue","allowInvalid","$$runValidators","allValid","$$writeModelToScope","this.$$runValidators","doneCallback","processSyncValidators","syncValidatorsValid","validator","processAsyncValidators","validatorPromises","validationDone","localValidationRunId","processParseErrors","errorKey","this.$commitViewValue","$$parseAndValidate","this.$$parseAndValidate","this.$$writeModelToScope","this.$setViewValue","updateOnDefault","$$debounceViewValueCommit","this.$$debounceViewValueCommit","debounceDelay","debounce","ngModelWatch","formatters","ngModelCompile","ngModelPreLink","modelCtrl","formCtrl","ngModelPostLink","updateOn","DEFAULT_REGEXP","that","ngOptionsMinErr","NG_OPTIONS_REGEXP","parseOptionsExpression","optionsExp","selectElement","Option","selectValue","label","disabled","getOptionValuesKeys","optionValues","optionValuesKeys","keyName","itemKey","valueName","selectAs","trackBy","viewValueFn","trackByFn","getTrackByValueFn","getHashOfValue","getTrackByValue","getLocals","displayFn","groupByFn","disableWhenFn","valuesFn","getWatchables","watchedArray","optionValuesLength","disableWhen","getOptions","optionItems","selectValueMap","optionItem","getOptionFromViewValue","getViewValueFromOption","optionTemplate","optGroupTemplate","updateOptionElement","addOrReuseElement","removeExcessElements","skipEmptyAndUnknownOptions","emptyOption_","emptyOption","unknownOption_","unknownOption","updateOptions","previousValue","selectCtrl","readValue","groupMap","providedEmptyOption","updateOption","optionElement","groupElement","currentOptionElement","ngModelCtrl","nextValue","ngModelCtrl.$isEmpty","writeValue","selectCtrl.writeValue","selectCtrl.readValue","selectedValues","selections","selectedOption","BRACE","IS_WHEN","updateElementText","newText","numberExp","whenExp","whens","whensExpFns","braceReplacement","watchRemover","lastCount","attributeName","tmpMatch","whenKey","ngPluralizeWatchAction","countIsNaN","pluralCat","whenExpFn","ngRepeatMinErr","updateScope","valueIdentifier","keyIdentifier","arrayLength","$first","$last","$middle","$odd","$even","ngRepeatCompile","ngRepeatEndComment","aliasAs","trackByExp","trackByExpGetter","trackByIdExpFn","trackByIdArrayFn","trackByIdObjFn","hashFnLocals","ngRepeatLink","lastBlockMap","ngRepeatAction","previousNode","nextNode","nextBlockMap","collectionLength","trackById","collectionKeys","nextBlockOrder","trackByIdFn","blockKey","ngRepeatTransclude","ngShowWatchAction","NG_HIDE_CLASS","NG_HIDE_IN_PROGRESS_CLASS","ngHideWatchAction","ngStyleWatchAction","newStyles","oldStyles","ngSwitchController","cases","selectedTranscludes","selectedElements","previousLeaveAnimations","selectedScopes","spliceFactory","ngSwitchWatchAction","selectedTransclude","caseElement","selectedScope","anchor","noopNgModelController","SelectController","optionsMap","renderUnknownOption","self.renderUnknownOption","unknownVal","removeUnknownOption","self.removeUnknownOption","self.readValue","self.writeValue","hasOption","addOption","self.addOption","removeOption","self.removeOption","self.hasOption","ngModelCtrl.$render","lastView","lastViewRef","selectMultipleWatch","valueInterpolated","optionValue","selectCtrlName","valueAttributeObserveAction","interpolateWatchAction","ctrl.$validators.required","patternExp","ctrl.$validators.pattern","intVal","ctrl.$validators.maxlength","ctrl.$validators.minlength","getDecimals","opt_precision","pow","ONE","OTHER","$$csp","head"]
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular/bower.json b/views/ngXosViews/serviceGrid/src/vendor/angular/bower.json
deleted file mode 100644
index 12b4e8c..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular/bower.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  "name": "angular",
-  "version": "1.4.7",
-  "main": "./angular.js",
-  "ignore": [],
-  "dependencies": {
-  }
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular/index.js b/views/ngXosViews/serviceGrid/src/vendor/angular/index.js
deleted file mode 100644
index 5c1aafc..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-require('./angular');
-module.exports = angular;
diff --git a/views/ngXosViews/serviceGrid/src/vendor/angular/package.json b/views/ngXosViews/serviceGrid/src/vendor/angular/package.json
deleted file mode 100644
index c39a534..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/angular/package.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
-  "name": "angular",
-  "version": "1.4.7",
-  "description": "HTML enhanced for web apps",
-  "main": "index.js",
-  "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
-  },
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/angular/angular.js.git"
-  },
-  "keywords": [
-    "angular",
-    "framework",
-    "browser",
-    "client-side"
-  ],
-  "author": "Angular Core Team <angular-core+npm@google.com>",
-  "license": "MIT",
-  "bugs": {
-    "url": "https://github.com/angular/angular.js/issues"
-  },
-  "homepage": "http://angularjs.org"
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/.bower.json
deleted file mode 100644
index c7c0207..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/.bower.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
-  "name": "bootstrap-css",
-  "version": "3.3.6",
-  "keywords": [
-    "css",
-    "js",
-    "less",
-    "mobile-first",
-    "responsive",
-    "front-end",
-    "framework",
-    "web",
-    "bootstrap",
-    "twitter-bootstrap",
-    "bootstrap.js"
-  ],
-  "main": [
-    "css/bootstrap.min.css",
-    "js/bootstrap.min.js"
-  ],
-  "homepage": "http://getbootstrap.com/",
-  "author": {
-    "name": "Twitter Inc."
-  },
-  "repository": {
-    "type": "git",
-    "url": "git://github.com/jozefizso/bower-bootstrap-css.git"
-  },
-  "license": "MIT",
-  "_release": "3.3.6",
-  "_resolution": {
-    "type": "version",
-    "tag": "v3.3.6",
-    "commit": "ef51118f6360259082a2e5f21ea6c5e5f552a09f"
-  },
-  "_source": "https://github.com/jozefizso/bower-bootstrap-css.git",
-  "_target": "3.3.6",
-  "_originalSource": "bootstrap-css"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/LICENSE b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/LICENSE
deleted file mode 100644
index 9858866..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2011-2015 Twitter, Inc
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/README.md b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/README.md
deleted file mode 100644
index 029a86c..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Bootstrap
-
-
-This is a Bower component for [Bootstrap 3](http://getbootstrap.com/) CSS library (v3.3.6).
-
-## Installation:
-
-`bower install bootstrap-css`
-
-## Bootstrap 3.0 versions
-
-```
-bower install bootstrap-css#3.3.6
-bower install bootstrap-css#3.3.5
-bower install bootstrap-css#3.3.4
-bower install bootstrap-css#3.3.2
-bower install bootstrap-css#3.2.0
-bower install bootstrap-css#3.1.1
-bower install bootstrap-css#3.1.0
-bower install bootstrap-css#3.0.0
-```
-
-
-## Bootstrap 2.3 versions
-
-```
-bower install bootstrap-css#2.3.2
-bower install bootstrap-css#2.3.1
-bower install bootstrap-css#2.3.0
-```
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/bower.json b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/bower.json
deleted file mode 100644
index 87e1905..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/bower.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "name": "bootstrap-css",
-  "version": "3.3.6",
-  "keywords": [
-        "css",
-        "js",
-        "less",
-        "mobile-first",
-        "responsive",
-        "front-end",
-        "framework",
-        "web",
-        "bootstrap",
-        "twitter-bootstrap",
-        "bootstrap.js"
-    ],
-    "main": [
-      "css/bootstrap.min.css",
-      "js/bootstrap.min.js"
-    ],
-    "homepage": "http://getbootstrap.com/",
-    "author": {
-        "name": "Twitter Inc."
-    },
-    "repository": {
-        "type": "git",
-        "url": "git://github.com/jozefizso/bower-bootstrap-css.git"
-    },
-    "license": "MIT"
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.css b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.css
deleted file mode 100644
index ebe57fb..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.css
+++ /dev/null
@@ -1,587 +0,0 @@
-/*!
- * Bootstrap v3.3.6 (http://getbootstrap.com)
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- */
-.btn-default,
-.btn-primary,
-.btn-success,
-.btn-info,
-.btn-warning,
-.btn-danger {
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, .2);
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
-}
-.btn-default:active,
-.btn-primary:active,
-.btn-success:active,
-.btn-info:active,
-.btn-warning:active,
-.btn-danger:active,
-.btn-default.active,
-.btn-primary.active,
-.btn-success.active,
-.btn-info.active,
-.btn-warning.active,
-.btn-danger.active {
-  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-          box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-}
-.btn-default.disabled,
-.btn-primary.disabled,
-.btn-success.disabled,
-.btn-info.disabled,
-.btn-warning.disabled,
-.btn-danger.disabled,
-.btn-default[disabled],
-.btn-primary[disabled],
-.btn-success[disabled],
-.btn-info[disabled],
-.btn-warning[disabled],
-.btn-danger[disabled],
-fieldset[disabled] .btn-default,
-fieldset[disabled] .btn-primary,
-fieldset[disabled] .btn-success,
-fieldset[disabled] .btn-info,
-fieldset[disabled] .btn-warning,
-fieldset[disabled] .btn-danger {
-  -webkit-box-shadow: none;
-          box-shadow: none;
-}
-.btn-default .badge,
-.btn-primary .badge,
-.btn-success .badge,
-.btn-info .badge,
-.btn-warning .badge,
-.btn-danger .badge {
-  text-shadow: none;
-}
-.btn:active,
-.btn.active {
-  background-image: none;
-}
-.btn-default {
-  text-shadow: 0 1px 0 #fff;
-  background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%);
-  background-image:      -o-linear-gradient(top, #fff 0%, #e0e0e0 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0));
-  background-image:         linear-gradient(to bottom, #fff 0%, #e0e0e0 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #dbdbdb;
-  border-color: #ccc;
-}
-.btn-default:hover,
-.btn-default:focus {
-  background-color: #e0e0e0;
-  background-position: 0 -15px;
-}
-.btn-default:active,
-.btn-default.active {
-  background-color: #e0e0e0;
-  border-color: #dbdbdb;
-}
-.btn-default.disabled,
-.btn-default[disabled],
-fieldset[disabled] .btn-default,
-.btn-default.disabled:hover,
-.btn-default[disabled]:hover,
-fieldset[disabled] .btn-default:hover,
-.btn-default.disabled:focus,
-.btn-default[disabled]:focus,
-fieldset[disabled] .btn-default:focus,
-.btn-default.disabled.focus,
-.btn-default[disabled].focus,
-fieldset[disabled] .btn-default.focus,
-.btn-default.disabled:active,
-.btn-default[disabled]:active,
-fieldset[disabled] .btn-default:active,
-.btn-default.disabled.active,
-.btn-default[disabled].active,
-fieldset[disabled] .btn-default.active {
-  background-color: #e0e0e0;
-  background-image: none;
-}
-.btn-primary {
-  background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);
-  background-image:      -o-linear-gradient(top, #337ab7 0%, #265a88 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88));
-  background-image:         linear-gradient(to bottom, #337ab7 0%, #265a88 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #245580;
-}
-.btn-primary:hover,
-.btn-primary:focus {
-  background-color: #265a88;
-  background-position: 0 -15px;
-}
-.btn-primary:active,
-.btn-primary.active {
-  background-color: #265a88;
-  border-color: #245580;
-}
-.btn-primary.disabled,
-.btn-primary[disabled],
-fieldset[disabled] .btn-primary,
-.btn-primary.disabled:hover,
-.btn-primary[disabled]:hover,
-fieldset[disabled] .btn-primary:hover,
-.btn-primary.disabled:focus,
-.btn-primary[disabled]:focus,
-fieldset[disabled] .btn-primary:focus,
-.btn-primary.disabled.focus,
-.btn-primary[disabled].focus,
-fieldset[disabled] .btn-primary.focus,
-.btn-primary.disabled:active,
-.btn-primary[disabled]:active,
-fieldset[disabled] .btn-primary:active,
-.btn-primary.disabled.active,
-.btn-primary[disabled].active,
-fieldset[disabled] .btn-primary.active {
-  background-color: #265a88;
-  background-image: none;
-}
-.btn-success {
-  background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
-  background-image:      -o-linear-gradient(top, #5cb85c 0%, #419641 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641));
-  background-image:         linear-gradient(to bottom, #5cb85c 0%, #419641 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #3e8f3e;
-}
-.btn-success:hover,
-.btn-success:focus {
-  background-color: #419641;
-  background-position: 0 -15px;
-}
-.btn-success:active,
-.btn-success.active {
-  background-color: #419641;
-  border-color: #3e8f3e;
-}
-.btn-success.disabled,
-.btn-success[disabled],
-fieldset[disabled] .btn-success,
-.btn-success.disabled:hover,
-.btn-success[disabled]:hover,
-fieldset[disabled] .btn-success:hover,
-.btn-success.disabled:focus,
-.btn-success[disabled]:focus,
-fieldset[disabled] .btn-success:focus,
-.btn-success.disabled.focus,
-.btn-success[disabled].focus,
-fieldset[disabled] .btn-success.focus,
-.btn-success.disabled:active,
-.btn-success[disabled]:active,
-fieldset[disabled] .btn-success:active,
-.btn-success.disabled.active,
-.btn-success[disabled].active,
-fieldset[disabled] .btn-success.active {
-  background-color: #419641;
-  background-image: none;
-}
-.btn-info {
-  background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
-  background-image:      -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2));
-  background-image:         linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #28a4c9;
-}
-.btn-info:hover,
-.btn-info:focus {
-  background-color: #2aabd2;
-  background-position: 0 -15px;
-}
-.btn-info:active,
-.btn-info.active {
-  background-color: #2aabd2;
-  border-color: #28a4c9;
-}
-.btn-info.disabled,
-.btn-info[disabled],
-fieldset[disabled] .btn-info,
-.btn-info.disabled:hover,
-.btn-info[disabled]:hover,
-fieldset[disabled] .btn-info:hover,
-.btn-info.disabled:focus,
-.btn-info[disabled]:focus,
-fieldset[disabled] .btn-info:focus,
-.btn-info.disabled.focus,
-.btn-info[disabled].focus,
-fieldset[disabled] .btn-info.focus,
-.btn-info.disabled:active,
-.btn-info[disabled]:active,
-fieldset[disabled] .btn-info:active,
-.btn-info.disabled.active,
-.btn-info[disabled].active,
-fieldset[disabled] .btn-info.active {
-  background-color: #2aabd2;
-  background-image: none;
-}
-.btn-warning {
-  background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
-  background-image:      -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316));
-  background-image:         linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #e38d13;
-}
-.btn-warning:hover,
-.btn-warning:focus {
-  background-color: #eb9316;
-  background-position: 0 -15px;
-}
-.btn-warning:active,
-.btn-warning.active {
-  background-color: #eb9316;
-  border-color: #e38d13;
-}
-.btn-warning.disabled,
-.btn-warning[disabled],
-fieldset[disabled] .btn-warning,
-.btn-warning.disabled:hover,
-.btn-warning[disabled]:hover,
-fieldset[disabled] .btn-warning:hover,
-.btn-warning.disabled:focus,
-.btn-warning[disabled]:focus,
-fieldset[disabled] .btn-warning:focus,
-.btn-warning.disabled.focus,
-.btn-warning[disabled].focus,
-fieldset[disabled] .btn-warning.focus,
-.btn-warning.disabled:active,
-.btn-warning[disabled]:active,
-fieldset[disabled] .btn-warning:active,
-.btn-warning.disabled.active,
-.btn-warning[disabled].active,
-fieldset[disabled] .btn-warning.active {
-  background-color: #eb9316;
-  background-image: none;
-}
-.btn-danger {
-  background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
-  background-image:      -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a));
-  background-image:         linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-color: #b92c28;
-}
-.btn-danger:hover,
-.btn-danger:focus {
-  background-color: #c12e2a;
-  background-position: 0 -15px;
-}
-.btn-danger:active,
-.btn-danger.active {
-  background-color: #c12e2a;
-  border-color: #b92c28;
-}
-.btn-danger.disabled,
-.btn-danger[disabled],
-fieldset[disabled] .btn-danger,
-.btn-danger.disabled:hover,
-.btn-danger[disabled]:hover,
-fieldset[disabled] .btn-danger:hover,
-.btn-danger.disabled:focus,
-.btn-danger[disabled]:focus,
-fieldset[disabled] .btn-danger:focus,
-.btn-danger.disabled.focus,
-.btn-danger[disabled].focus,
-fieldset[disabled] .btn-danger.focus,
-.btn-danger.disabled:active,
-.btn-danger[disabled]:active,
-fieldset[disabled] .btn-danger:active,
-.btn-danger.disabled.active,
-.btn-danger[disabled].active,
-fieldset[disabled] .btn-danger.active {
-  background-color: #c12e2a;
-  background-image: none;
-}
-.thumbnail,
-.img-thumbnail {
-  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
-          box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
-}
-.dropdown-menu > li > a:hover,
-.dropdown-menu > li > a:focus {
-  background-color: #e8e8e8;
-  background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
-  background-image:      -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
-  background-image:         linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
-  background-repeat: repeat-x;
-}
-.dropdown-menu > .active > a,
-.dropdown-menu > .active > a:hover,
-.dropdown-menu > .active > a:focus {
-  background-color: #2e6da4;
-  background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
-  background-image:      -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
-  background-image:         linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
-  background-repeat: repeat-x;
-}
-.navbar-default {
-  background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%);
-  background-image:      -o-linear-gradient(top, #fff 0%, #f8f8f8 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8));
-  background-image:         linear-gradient(to bottom, #fff 0%, #f8f8f8 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
-}
-.navbar-default .navbar-nav > .open > a,
-.navbar-default .navbar-nav > .active > a {
-  background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
-  background-image:      -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2));
-  background-image:         linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);
-  background-repeat: repeat-x;
-  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
-}
-.navbar-brand,
-.navbar-nav > li > a {
-  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
-}
-.navbar-inverse {
-  background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%);
-  background-image:      -o-linear-gradient(top, #3c3c3c 0%, #222 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222));
-  background-image:         linear-gradient(to bottom, #3c3c3c 0%, #222 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-  background-repeat: repeat-x;
-  border-radius: 4px;
-}
-.navbar-inverse .navbar-nav > .open > a,
-.navbar-inverse .navbar-nav > .active > a {
-  background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%);
-  background-image:      -o-linear-gradient(top, #080808 0%, #0f0f0f 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f));
-  background-image:         linear-gradient(to bottom, #080808 0%, #0f0f0f 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);
-  background-repeat: repeat-x;
-  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
-          box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
-}
-.navbar-inverse .navbar-brand,
-.navbar-inverse .navbar-nav > li > a {
-  text-shadow: 0 -1px 0 rgba(0, 0, 0, .25);
-}
-.navbar-static-top,
-.navbar-fixed-top,
-.navbar-fixed-bottom {
-  border-radius: 0;
-}
-@media (max-width: 767px) {
-  .navbar .navbar-nav .open .dropdown-menu > .active > a,
-  .navbar .navbar-nav .open .dropdown-menu > .active > a:hover,
-  .navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
-    color: #fff;
-    background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
-    background-image:      -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
-    background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
-    background-image:         linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
-    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
-    background-repeat: repeat-x;
-  }
-}
-.alert {
-  text-shadow: 0 1px 0 rgba(255, 255, 255, .2);
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
-}
-.alert-success {
-  background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
-  background-image:      -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc));
-  background-image:         linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #b2dba1;
-}
-.alert-info {
-  background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
-  background-image:      -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0));
-  background-image:         linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #9acfea;
-}
-.alert-warning {
-  background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
-  background-image:      -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0));
-  background-image:         linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #f5e79e;
-}
-.alert-danger {
-  background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
-  background-image:      -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3));
-  background-image:         linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #dca7a7;
-}
-.progress {
-  background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
-  background-image:      -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5));
-  background-image:         linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar {
-  background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%);
-  background-image:      -o-linear-gradient(top, #337ab7 0%, #286090 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#286090));
-  background-image:         linear-gradient(to bottom, #337ab7 0%, #286090 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar-success {
-  background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%);
-  background-image:      -o-linear-gradient(top, #5cb85c 0%, #449d44 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44));
-  background-image:         linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar-info {
-  background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
-  background-image:      -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5));
-  background-image:         linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar-warning {
-  background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
-  background-image:      -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f));
-  background-image:         linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar-danger {
-  background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%);
-  background-image:      -o-linear-gradient(top, #d9534f 0%, #c9302c 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c));
-  background-image:         linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
-  background-repeat: repeat-x;
-}
-.progress-bar-striped {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.list-group {
-  border-radius: 4px;
-  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
-          box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
-}
-.list-group-item.active,
-.list-group-item.active:hover,
-.list-group-item.active:focus {
-  text-shadow: 0 -1px 0 #286090;
-  background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%);
-  background-image:      -o-linear-gradient(top, #337ab7 0%, #2b669a 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2b669a));
-  background-image:         linear-gradient(to bottom, #337ab7 0%, #2b669a 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #2b669a;
-}
-.list-group-item.active .badge,
-.list-group-item.active:hover .badge,
-.list-group-item.active:focus .badge {
-  text-shadow: none;
-}
-.panel {
-  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
-          box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
-}
-.panel-default > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
-  background-image:      -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
-  background-image:         linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
-  background-repeat: repeat-x;
-}
-.panel-primary > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
-  background-image:      -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
-  background-image:         linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
-  background-repeat: repeat-x;
-}
-.panel-success > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
-  background-image:      -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6));
-  background-image:         linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);
-  background-repeat: repeat-x;
-}
-.panel-info > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
-  background-image:      -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3));
-  background-image:         linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);
-  background-repeat: repeat-x;
-}
-.panel-warning > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
-  background-image:      -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc));
-  background-image:         linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);
-  background-repeat: repeat-x;
-}
-.panel-danger > .panel-heading {
-  background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
-  background-image:      -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc));
-  background-image:         linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);
-  background-repeat: repeat-x;
-}
-.well {
-  background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
-  background-image:      -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
-  background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5));
-  background-image:         linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
-  background-repeat: repeat-x;
-  border-color: #dcdcdc;
-  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
-          box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
-}
-/*# sourceMappingURL=bootstrap-theme.css.map */
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.css.map b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.css.map
deleted file mode 100644
index 21e1910..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.css.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["bootstrap-theme.css","less/theme.less","less/mixins/vendor-prefixes.less","less/mixins/gradients.less","less/mixins/reset-filter.less"],"names":[],"mappings":"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","file":"bootstrap-theme.css","sourcesContent":["/*!\n * Bootstrap v3.3.6 (http://getbootstrap.com)\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n.btn-default,\n.btn-primary,\n.btn-success,\n.btn-info,\n.btn-warning,\n.btn-danger {\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);\n  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.btn-default:active,\n.btn-primary:active,\n.btn-success:active,\n.btn-info:active,\n.btn-warning:active,\n.btn-danger:active,\n.btn-default.active,\n.btn-primary.active,\n.btn-success.active,\n.btn-info.active,\n.btn-warning.active,\n.btn-danger.active {\n  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n}\n.btn-default.disabled,\n.btn-primary.disabled,\n.btn-success.disabled,\n.btn-info.disabled,\n.btn-warning.disabled,\n.btn-danger.disabled,\n.btn-default[disabled],\n.btn-primary[disabled],\n.btn-success[disabled],\n.btn-info[disabled],\n.btn-warning[disabled],\n.btn-danger[disabled],\nfieldset[disabled] .btn-default,\nfieldset[disabled] .btn-primary,\nfieldset[disabled] .btn-success,\nfieldset[disabled] .btn-info,\nfieldset[disabled] .btn-warning,\nfieldset[disabled] .btn-danger {\n  -webkit-box-shadow: none;\n  box-shadow: none;\n}\n.btn-default .badge,\n.btn-primary .badge,\n.btn-success .badge,\n.btn-info .badge,\n.btn-warning .badge,\n.btn-danger .badge {\n  text-shadow: none;\n}\n.btn:active,\n.btn.active {\n  background-image: none;\n}\n.btn-default {\n  background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%);\n  background-image: -o-linear-gradient(top, #fff 0%, #e0e0e0 100%);\n  background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%);\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);\n  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n  background-repeat: repeat-x;\n  border-color: #dbdbdb;\n  text-shadow: 0 1px 0 #fff;\n  border-color: #ccc;\n}\n.btn-default:hover,\n.btn-default:focus {\n  background-color: #e0e0e0;\n  background-position: 0 -15px;\n}\n.btn-default:active,\n.btn-default.active {\n  background-color: #e0e0e0;\n  border-color: #dbdbdb;\n}\n.btn-default.disabled,\n.btn-default[disabled],\nfieldset[disabled] .btn-default,\n.btn-default.disabled:hover,\n.btn-default[disabled]:hover,\nfieldset[disabled] .btn-default:hover,\n.btn-default.disabled:focus,\n.btn-default[disabled]:focus,\nfieldset[disabled] .btn-default:focus,\n.btn-default.disabled.focus,\n.btn-default[disabled].focus,\nfieldset[disabled] .btn-default.focus,\n.btn-default.disabled:active,\n.btn-default[disabled]:active,\nfieldset[disabled] .btn-default:active,\n.btn-default.disabled.active,\n.btn-default[disabled].active,\nfieldset[disabled] .btn-default.active {\n  background-color: #e0e0e0;\n  background-image: none;\n}\n.btn-primary {\n  background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);\n  background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%);\n  background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);\n  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n  background-repeat: repeat-x;\n  border-color: #245580;\n}\n.btn-primary:hover,\n.btn-primary:focus {\n  background-color: #265a88;\n  background-position: 0 -15px;\n}\n.btn-primary:active,\n.btn-primary.active {\n  background-color: #265a88;\n  border-color: #245580;\n}\n.btn-primary.disabled,\n.btn-primary[disabled],\nfieldset[disabled] .btn-primary,\n.btn-primary.disabled:hover,\n.btn-primary[disabled]:hover,\nfieldset[disabled] .btn-primary:hover,\n.btn-primary.disabled:focus,\n.btn-primary[disabled]:focus,\nfieldset[disabled] .btn-primary:focus,\n.btn-primary.disabled.focus,\n.btn-primary[disabled].focus,\nfieldset[disabled] .btn-primary.focus,\n.btn-primary.disabled:active,\n.btn-primary[disabled]:active,\nfieldset[disabled] .btn-primary:active,\n.btn-primary.disabled.active,\n.btn-primary[disabled].active,\nfieldset[disabled] .btn-primary.active {\n  background-color: #265a88;\n  background-image: none;\n}\n.btn-success {\n  background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);\n  background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%);\n  background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%);\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);\n  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n  background-repeat: repeat-x;\n  border-color: #3e8f3e;\n}\n.btn-success:hover,\n.btn-success:focus {\n  background-color: #419641;\n  background-position: 0 -15px;\n}\n.btn-success:active,\n.btn-success.active {\n  background-color: #419641;\n  border-color: #3e8f3e;\n}\n.btn-success.disabled,\n.btn-success[disabled],\nfieldset[disabled] .btn-success,\n.btn-success.disabled:hover,\n.btn-success[disabled]:hover,\nfieldset[disabled] .btn-success:hover,\n.btn-success.disabled:focus,\n.btn-success[disabled]:focus,\nfieldset[disabled] .btn-success:focus,\n.btn-success.disabled.focus,\n.btn-success[disabled].focus,\nfieldset[disabled] .btn-success.focus,\n.btn-success.disabled:active,\n.btn-success[disabled]:active,\nfieldset[disabled] .btn-success:active,\n.btn-success.disabled.active,\n.btn-success[disabled].active,\nfieldset[disabled] .btn-success.active {\n  background-color: #419641;\n  background-image: none;\n}\n.btn-info {\n  background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);\n  background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);\n  background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);\n  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n  background-repeat: repeat-x;\n  border-color: #28a4c9;\n}\n.btn-info:hover,\n.btn-info:focus {\n  background-color: #2aabd2;\n  background-position: 0 -15px;\n}\n.btn-info:active,\n.btn-info.active {\n  background-color: #2aabd2;\n  border-color: #28a4c9;\n}\n.btn-info.disabled,\n.btn-info[disabled],\nfieldset[disabled] .btn-info,\n.btn-info.disabled:hover,\n.btn-info[disabled]:hover,\nfieldset[disabled] .btn-info:hover,\n.btn-info.disabled:focus,\n.btn-info[disabled]:focus,\nfieldset[disabled] .btn-info:focus,\n.btn-info.disabled.focus,\n.btn-info[disabled].focus,\nfieldset[disabled] .btn-info.focus,\n.btn-info.disabled:active,\n.btn-info[disabled]:active,\nfieldset[disabled] .btn-info:active,\n.btn-info.disabled.active,\n.btn-info[disabled].active,\nfieldset[disabled] .btn-info.active {\n  background-color: #2aabd2;\n  background-image: none;\n}\n.btn-warning {\n  background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);\n  background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);\n  background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);\n  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n  background-repeat: repeat-x;\n  border-color: #e38d13;\n}\n.btn-warning:hover,\n.btn-warning:focus {\n  background-color: #eb9316;\n  background-position: 0 -15px;\n}\n.btn-warning:active,\n.btn-warning.active {\n  background-color: #eb9316;\n  border-color: #e38d13;\n}\n.btn-warning.disabled,\n.btn-warning[disabled],\nfieldset[disabled] .btn-warning,\n.btn-warning.disabled:hover,\n.btn-warning[disabled]:hover,\nfieldset[disabled] .btn-warning:hover,\n.btn-warning.disabled:focus,\n.btn-warning[disabled]:focus,\nfieldset[disabled] .btn-warning:focus,\n.btn-warning.disabled.focus,\n.btn-warning[disabled].focus,\nfieldset[disabled] .btn-warning.focus,\n.btn-warning.disabled:active,\n.btn-warning[disabled]:active,\nfieldset[disabled] .btn-warning:active,\n.btn-warning.disabled.active,\n.btn-warning[disabled].active,\nfieldset[disabled] .btn-warning.active {\n  background-color: #eb9316;\n  background-image: none;\n}\n.btn-danger {\n  background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);\n  background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);\n  background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);\n  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n  background-repeat: repeat-x;\n  border-color: #b92c28;\n}\n.btn-danger:hover,\n.btn-danger:focus {\n  background-color: #c12e2a;\n  background-position: 0 -15px;\n}\n.btn-danger:active,\n.btn-danger.active {\n  background-color: #c12e2a;\n  border-color: #b92c28;\n}\n.btn-danger.disabled,\n.btn-danger[disabled],\nfieldset[disabled] .btn-danger,\n.btn-danger.disabled:hover,\n.btn-danger[disabled]:hover,\nfieldset[disabled] .btn-danger:hover,\n.btn-danger.disabled:focus,\n.btn-danger[disabled]:focus,\nfieldset[disabled] .btn-danger:focus,\n.btn-danger.disabled.focus,\n.btn-danger[disabled].focus,\nfieldset[disabled] .btn-danger.focus,\n.btn-danger.disabled:active,\n.btn-danger[disabled]:active,\nfieldset[disabled] .btn-danger:active,\n.btn-danger.disabled.active,\n.btn-danger[disabled].active,\nfieldset[disabled] .btn-danger.active {\n  background-color: #c12e2a;\n  background-image: none;\n}\n.thumbnail,\n.img-thumbnail {\n  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n}\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n  background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n  background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n  background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);\n  background-color: #e8e8e8;\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n  background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n  background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n  background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);\n  background-color: #2e6da4;\n}\n.navbar-default {\n  background-image: -webkit-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);\n  background-image: -o-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);\n  background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);\n  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n  border-radius: 4px;\n  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);\n}\n.navbar-default .navbar-nav > .open > a,\n.navbar-default .navbar-nav > .active > a {\n  background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);\n  background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);\n  background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);\n  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);\n  box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);\n}\n.navbar-brand,\n.navbar-nav > li > a {\n  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);\n}\n.navbar-inverse {\n  background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%);\n  background-image: -o-linear-gradient(top, #3c3c3c 0%, #222 100%);\n  background-image: linear-gradient(to bottom, #3c3c3c 0%, #222 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);\n  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n  border-radius: 4px;\n}\n.navbar-inverse .navbar-nav > .open > a,\n.navbar-inverse .navbar-nav > .active > a {\n  background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%);\n  background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%);\n  background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);\n  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);\n  box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);\n}\n.navbar-inverse .navbar-brand,\n.navbar-inverse .navbar-nav > li > a {\n  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);\n}\n.navbar-static-top,\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n  border-radius: 0;\n}\n@media (max-width: 767px) {\n  .navbar .navbar-nav .open .dropdown-menu > .active > a,\n  .navbar .navbar-nav .open .dropdown-menu > .active > a:hover,\n  .navbar .navbar-nav .open .dropdown-menu > .active > a:focus {\n    color: #fff;\n    background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n    background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n    background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);\n    background-repeat: repeat-x;\n    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);\n  }\n}\n.alert {\n  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);\n  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);\n}\n.alert-success {\n  background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);\n  background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);\n  background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);\n  border-color: #b2dba1;\n}\n.alert-info {\n  background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);\n  background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%);\n  background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);\n  border-color: #9acfea;\n}\n.alert-warning {\n  background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);\n  background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);\n  background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);\n  border-color: #f5e79e;\n}\n.alert-danger {\n  background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);\n  background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);\n  background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);\n  border-color: #dca7a7;\n}\n.progress {\n  background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);\n  background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);\n  background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);\n}\n.progress-bar {\n  background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%);\n  background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%);\n  background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);\n}\n.progress-bar-success {\n  background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%);\n  background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%);\n  background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);\n}\n.progress-bar-info {\n  background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);\n  background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);\n  background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);\n}\n.progress-bar-warning {\n  background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);\n  background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);\n  background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);\n}\n.progress-bar-danger {\n  background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%);\n  background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%);\n  background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);\n}\n.progress-bar-striped {\n  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.list-group {\n  border-radius: 4px;\n  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n  text-shadow: 0 -1px 0 #286090;\n  background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%);\n  background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%);\n  background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);\n  border-color: #2b669a;\n}\n.list-group-item.active .badge,\n.list-group-item.active:hover .badge,\n.list-group-item.active:focus .badge {\n  text-shadow: none;\n}\n.panel {\n  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n}\n.panel-default > .panel-heading {\n  background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n  background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n  background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);\n}\n.panel-primary > .panel-heading {\n  background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n  background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n  background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);\n}\n.panel-success > .panel-heading {\n  background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);\n  background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);\n  background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);\n}\n.panel-info > .panel-heading {\n  background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);\n  background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);\n  background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);\n}\n.panel-warning > .panel-heading {\n  background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);\n  background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);\n  background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);\n}\n.panel-danger > .panel-heading {\n  background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%);\n  background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%);\n  background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);\n}\n.well {\n  background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);\n  background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);\n  background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);\n  border-color: #dcdcdc;\n  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);\n  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);\n}\n/*# sourceMappingURL=bootstrap-theme.css.map */","/*!\n * Bootstrap v3.3.6 (http://getbootstrap.com)\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n\n//\n// Load core variables and mixins\n// --------------------------------------------------\n\n@import \"variables.less\";\n@import \"mixins.less\";\n\n\n//\n// Buttons\n// --------------------------------------------------\n\n// Common styles\n.btn-default,\n.btn-primary,\n.btn-success,\n.btn-info,\n.btn-warning,\n.btn-danger {\n  text-shadow: 0 -1px 0 rgba(0,0,0,.2);\n  @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075);\n  .box-shadow(@shadow);\n\n  // Reset the shadow\n  &:active,\n  &.active {\n    .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n  }\n\n  &.disabled,\n  &[disabled],\n  fieldset[disabled] & {\n    .box-shadow(none);\n  }\n\n  .badge {\n    text-shadow: none;\n  }\n}\n\n// Mixin for generating new styles\n.btn-styles(@btn-color: #555) {\n  #gradient > .vertical(@start-color: @btn-color; @end-color: darken(@btn-color, 12%));\n  .reset-filter(); // Disable gradients for IE9 because filter bleeds through rounded corners; see https://github.com/twbs/bootstrap/issues/10620\n  background-repeat: repeat-x;\n  border-color: darken(@btn-color, 14%);\n\n  &:hover,\n  &:focus  {\n    background-color: darken(@btn-color, 12%);\n    background-position: 0 -15px;\n  }\n\n  &:active,\n  &.active {\n    background-color: darken(@btn-color, 12%);\n    border-color: darken(@btn-color, 14%);\n  }\n\n  &.disabled,\n  &[disabled],\n  fieldset[disabled] & {\n    &,\n    &:hover,\n    &:focus,\n    &.focus,\n    &:active,\n    &.active {\n      background-color: darken(@btn-color, 12%);\n      background-image: none;\n    }\n  }\n}\n\n// Common styles\n.btn {\n  // Remove the gradient for the pressed/active state\n  &:active,\n  &.active {\n    background-image: none;\n  }\n}\n\n// Apply the mixin to the buttons\n.btn-default { .btn-styles(@btn-default-bg); text-shadow: 0 1px 0 #fff; border-color: #ccc; }\n.btn-primary { .btn-styles(@btn-primary-bg); }\n.btn-success { .btn-styles(@btn-success-bg); }\n.btn-info    { .btn-styles(@btn-info-bg); }\n.btn-warning { .btn-styles(@btn-warning-bg); }\n.btn-danger  { .btn-styles(@btn-danger-bg); }\n\n\n//\n// Images\n// --------------------------------------------------\n\n.thumbnail,\n.img-thumbnail {\n  .box-shadow(0 1px 2px rgba(0,0,0,.075));\n}\n\n\n//\n// Dropdowns\n// --------------------------------------------------\n\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n  #gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%));\n  background-color: darken(@dropdown-link-hover-bg, 5%);\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n  #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));\n  background-color: darken(@dropdown-link-active-bg, 5%);\n}\n\n\n//\n// Navbar\n// --------------------------------------------------\n\n// Default navbar\n.navbar-default {\n  #gradient > .vertical(@start-color: lighten(@navbar-default-bg, 10%); @end-color: @navbar-default-bg);\n  .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered\n  border-radius: @navbar-border-radius;\n  @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075);\n  .box-shadow(@shadow);\n\n  .navbar-nav > .open > a,\n  .navbar-nav > .active > a {\n    #gradient > .vertical(@start-color: darken(@navbar-default-link-active-bg, 5%); @end-color: darken(@navbar-default-link-active-bg, 2%));\n    .box-shadow(inset 0 3px 9px rgba(0,0,0,.075));\n  }\n}\n.navbar-brand,\n.navbar-nav > li > a {\n  text-shadow: 0 1px 0 rgba(255,255,255,.25);\n}\n\n// Inverted navbar\n.navbar-inverse {\n  #gradient > .vertical(@start-color: lighten(@navbar-inverse-bg, 10%); @end-color: @navbar-inverse-bg);\n  .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered; see https://github.com/twbs/bootstrap/issues/10257\n  border-radius: @navbar-border-radius;\n  .navbar-nav > .open > a,\n  .navbar-nav > .active > a {\n    #gradient > .vertical(@start-color: @navbar-inverse-link-active-bg; @end-color: lighten(@navbar-inverse-link-active-bg, 2.5%));\n    .box-shadow(inset 0 3px 9px rgba(0,0,0,.25));\n  }\n\n  .navbar-brand,\n  .navbar-nav > li > a {\n    text-shadow: 0 -1px 0 rgba(0,0,0,.25);\n  }\n}\n\n// Undo rounded corners in static and fixed navbars\n.navbar-static-top,\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n  border-radius: 0;\n}\n\n// Fix active state of dropdown items in collapsed mode\n@media (max-width: @grid-float-breakpoint-max) {\n  .navbar .navbar-nav .open .dropdown-menu > .active > a {\n    &,\n    &:hover,\n    &:focus {\n      color: #fff;\n      #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));\n    }\n  }\n}\n\n\n//\n// Alerts\n// --------------------------------------------------\n\n// Common styles\n.alert {\n  text-shadow: 0 1px 0 rgba(255,255,255,.2);\n  @shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05);\n  .box-shadow(@shadow);\n}\n\n// Mixin for generating new styles\n.alert-styles(@color) {\n  #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 7.5%));\n  border-color: darken(@color, 15%);\n}\n\n// Apply the mixin to the alerts\n.alert-success    { .alert-styles(@alert-success-bg); }\n.alert-info       { .alert-styles(@alert-info-bg); }\n.alert-warning    { .alert-styles(@alert-warning-bg); }\n.alert-danger     { .alert-styles(@alert-danger-bg); }\n\n\n//\n// Progress bars\n// --------------------------------------------------\n\n// Give the progress background some depth\n.progress {\n  #gradient > .vertical(@start-color: darken(@progress-bg, 4%); @end-color: @progress-bg)\n}\n\n// Mixin for generating new styles\n.progress-bar-styles(@color) {\n  #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 10%));\n}\n\n// Apply the mixin to the progress bars\n.progress-bar            { .progress-bar-styles(@progress-bar-bg); }\n.progress-bar-success    { .progress-bar-styles(@progress-bar-success-bg); }\n.progress-bar-info       { .progress-bar-styles(@progress-bar-info-bg); }\n.progress-bar-warning    { .progress-bar-styles(@progress-bar-warning-bg); }\n.progress-bar-danger     { .progress-bar-styles(@progress-bar-danger-bg); }\n\n// Reset the striped class because our mixins don't do multiple gradients and\n// the above custom styles override the new `.progress-bar-striped` in v3.2.0.\n.progress-bar-striped {\n  #gradient > .striped();\n}\n\n\n//\n// List groups\n// --------------------------------------------------\n\n.list-group {\n  border-radius: @border-radius-base;\n  .box-shadow(0 1px 2px rgba(0,0,0,.075));\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n  text-shadow: 0 -1px 0 darken(@list-group-active-bg, 10%);\n  #gradient > .vertical(@start-color: @list-group-active-bg; @end-color: darken(@list-group-active-bg, 7.5%));\n  border-color: darken(@list-group-active-border, 7.5%);\n\n  .badge {\n    text-shadow: none;\n  }\n}\n\n\n//\n// Panels\n// --------------------------------------------------\n\n// Common styles\n.panel {\n  .box-shadow(0 1px 2px rgba(0,0,0,.05));\n}\n\n// Mixin for generating new styles\n.panel-heading-styles(@color) {\n  #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 5%));\n}\n\n// Apply the mixin to the panel headings only\n.panel-default > .panel-heading   { .panel-heading-styles(@panel-default-heading-bg); }\n.panel-primary > .panel-heading   { .panel-heading-styles(@panel-primary-heading-bg); }\n.panel-success > .panel-heading   { .panel-heading-styles(@panel-success-heading-bg); }\n.panel-info > .panel-heading      { .panel-heading-styles(@panel-info-heading-bg); }\n.panel-warning > .panel-heading   { .panel-heading-styles(@panel-warning-heading-bg); }\n.panel-danger > .panel-heading    { .panel-heading-styles(@panel-danger-heading-bg); }\n\n\n//\n// Wells\n// --------------------------------------------------\n\n.well {\n  #gradient > .vertical(@start-color: darken(@well-bg, 5%); @end-color: @well-bg);\n  border-color: darken(@well-bg, 10%);\n  @shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1);\n  .box-shadow(@shadow);\n}\n","// Vendor Prefixes\n//\n// All vendor mixins are deprecated as of v3.2.0 due to the introduction of\n// Autoprefixer in our Gruntfile. They have been removed in v4.\n\n// - Animations\n// - Backface visibility\n// - Box shadow\n// - Box sizing\n// - Content columns\n// - Hyphens\n// - Placeholder text\n// - Transformations\n// - Transitions\n// - User Select\n\n\n// Animations\n.animation(@animation) {\n  -webkit-animation: @animation;\n       -o-animation: @animation;\n          animation: @animation;\n}\n.animation-name(@name) {\n  -webkit-animation-name: @name;\n          animation-name: @name;\n}\n.animation-duration(@duration) {\n  -webkit-animation-duration: @duration;\n          animation-duration: @duration;\n}\n.animation-timing-function(@timing-function) {\n  -webkit-animation-timing-function: @timing-function;\n          animation-timing-function: @timing-function;\n}\n.animation-delay(@delay) {\n  -webkit-animation-delay: @delay;\n          animation-delay: @delay;\n}\n.animation-iteration-count(@iteration-count) {\n  -webkit-animation-iteration-count: @iteration-count;\n          animation-iteration-count: @iteration-count;\n}\n.animation-direction(@direction) {\n  -webkit-animation-direction: @direction;\n          animation-direction: @direction;\n}\n.animation-fill-mode(@fill-mode) {\n  -webkit-animation-fill-mode: @fill-mode;\n          animation-fill-mode: @fill-mode;\n}\n\n// Backface visibility\n// Prevent browsers from flickering when using CSS 3D transforms.\n// Default value is `visible`, but can be changed to `hidden`\n\n.backface-visibility(@visibility) {\n  -webkit-backface-visibility: @visibility;\n     -moz-backface-visibility: @visibility;\n          backface-visibility: @visibility;\n}\n\n// Drop shadows\n//\n// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's\n// supported browsers that have box shadow capabilities now support it.\n\n.box-shadow(@shadow) {\n  -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1\n          box-shadow: @shadow;\n}\n\n// Box sizing\n.box-sizing(@boxmodel) {\n  -webkit-box-sizing: @boxmodel;\n     -moz-box-sizing: @boxmodel;\n          box-sizing: @boxmodel;\n}\n\n// CSS3 Content Columns\n.content-columns(@column-count; @column-gap: @grid-gutter-width) {\n  -webkit-column-count: @column-count;\n     -moz-column-count: @column-count;\n          column-count: @column-count;\n  -webkit-column-gap: @column-gap;\n     -moz-column-gap: @column-gap;\n          column-gap: @column-gap;\n}\n\n// Optional hyphenation\n.hyphens(@mode: auto) {\n  word-wrap: break-word;\n  -webkit-hyphens: @mode;\n     -moz-hyphens: @mode;\n      -ms-hyphens: @mode; // IE10+\n       -o-hyphens: @mode;\n          hyphens: @mode;\n}\n\n// Placeholder text\n.placeholder(@color: @input-color-placeholder) {\n  // Firefox\n  &::-moz-placeholder {\n    color: @color;\n    opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526\n  }\n  &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+\n  &::-webkit-input-placeholder  { color: @color; } // Safari and Chrome\n}\n\n// Transformations\n.scale(@ratio) {\n  -webkit-transform: scale(@ratio);\n      -ms-transform: scale(@ratio); // IE9 only\n       -o-transform: scale(@ratio);\n          transform: scale(@ratio);\n}\n.scale(@ratioX; @ratioY) {\n  -webkit-transform: scale(@ratioX, @ratioY);\n      -ms-transform: scale(@ratioX, @ratioY); // IE9 only\n       -o-transform: scale(@ratioX, @ratioY);\n          transform: scale(@ratioX, @ratioY);\n}\n.scaleX(@ratio) {\n  -webkit-transform: scaleX(@ratio);\n      -ms-transform: scaleX(@ratio); // IE9 only\n       -o-transform: scaleX(@ratio);\n          transform: scaleX(@ratio);\n}\n.scaleY(@ratio) {\n  -webkit-transform: scaleY(@ratio);\n      -ms-transform: scaleY(@ratio); // IE9 only\n       -o-transform: scaleY(@ratio);\n          transform: scaleY(@ratio);\n}\n.skew(@x; @y) {\n  -webkit-transform: skewX(@x) skewY(@y);\n      -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+\n       -o-transform: skewX(@x) skewY(@y);\n          transform: skewX(@x) skewY(@y);\n}\n.translate(@x; @y) {\n  -webkit-transform: translate(@x, @y);\n      -ms-transform: translate(@x, @y); // IE9 only\n       -o-transform: translate(@x, @y);\n          transform: translate(@x, @y);\n}\n.translate3d(@x; @y; @z) {\n  -webkit-transform: translate3d(@x, @y, @z);\n          transform: translate3d(@x, @y, @z);\n}\n.rotate(@degrees) {\n  -webkit-transform: rotate(@degrees);\n      -ms-transform: rotate(@degrees); // IE9 only\n       -o-transform: rotate(@degrees);\n          transform: rotate(@degrees);\n}\n.rotateX(@degrees) {\n  -webkit-transform: rotateX(@degrees);\n      -ms-transform: rotateX(@degrees); // IE9 only\n       -o-transform: rotateX(@degrees);\n          transform: rotateX(@degrees);\n}\n.rotateY(@degrees) {\n  -webkit-transform: rotateY(@degrees);\n      -ms-transform: rotateY(@degrees); // IE9 only\n       -o-transform: rotateY(@degrees);\n          transform: rotateY(@degrees);\n}\n.perspective(@perspective) {\n  -webkit-perspective: @perspective;\n     -moz-perspective: @perspective;\n          perspective: @perspective;\n}\n.perspective-origin(@perspective) {\n  -webkit-perspective-origin: @perspective;\n     -moz-perspective-origin: @perspective;\n          perspective-origin: @perspective;\n}\n.transform-origin(@origin) {\n  -webkit-transform-origin: @origin;\n     -moz-transform-origin: @origin;\n      -ms-transform-origin: @origin; // IE9 only\n          transform-origin: @origin;\n}\n\n\n// Transitions\n\n.transition(@transition) {\n  -webkit-transition: @transition;\n       -o-transition: @transition;\n          transition: @transition;\n}\n.transition-property(@transition-property) {\n  -webkit-transition-property: @transition-property;\n          transition-property: @transition-property;\n}\n.transition-delay(@transition-delay) {\n  -webkit-transition-delay: @transition-delay;\n          transition-delay: @transition-delay;\n}\n.transition-duration(@transition-duration) {\n  -webkit-transition-duration: @transition-duration;\n          transition-duration: @transition-duration;\n}\n.transition-timing-function(@timing-function) {\n  -webkit-transition-timing-function: @timing-function;\n          transition-timing-function: @timing-function;\n}\n.transition-transform(@transition) {\n  -webkit-transition: -webkit-transform @transition;\n     -moz-transition: -moz-transform @transition;\n       -o-transition: -o-transform @transition;\n          transition: transform @transition;\n}\n\n\n// User select\n// For selecting text on the page\n\n.user-select(@select) {\n  -webkit-user-select: @select;\n     -moz-user-select: @select;\n      -ms-user-select: @select; // IE10+\n          user-select: @select;\n}\n","// Gradients\n\n#gradient {\n\n  // Horizontal gradient, from left to right\n  //\n  // Creates two color stops, start and end, by specifying a color and position for each color stop.\n  // Color stops are not available in IE9 and below.\n  .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n    background-image: -webkit-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n    background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12\n    background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n    background-repeat: repeat-x;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down\n  }\n\n  // Vertical gradient, from top to bottom\n  //\n  // Creates two color stops, start and end, by specifying a color and position for each color stop.\n  // Color stops are not available in IE9 and below.\n  .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n    background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent);  // Safari 5.1-6, Chrome 10+\n    background-image: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent);  // Opera 12\n    background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n    background-repeat: repeat-x;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down\n  }\n\n  .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {\n    background-repeat: repeat-x;\n    background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+\n    background-image: -o-linear-gradient(@deg, @start-color, @end-color); // Opera 12\n    background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n  }\n  .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n    background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n    background-image: -o-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n    background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);\n    background-repeat: no-repeat;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n  }\n  .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n    background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n    background-image: -o-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n    background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n    background-repeat: no-repeat;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n  }\n  .radial(@inner-color: #555; @outer-color: #333) {\n    background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);\n    background-image: radial-gradient(circle, @inner-color, @outer-color);\n    background-repeat: no-repeat;\n  }\n  .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {\n    background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n    background-image: -o-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n    background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n  }\n}\n","// Reset filters for IE\n//\n// When you need to remove a gradient background, do not forget to use this to reset\n// the IE filter for IE9 and below.\n\n.reset-filter() {\n  filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(enabled = false)\"));\n}\n"]}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.min.css b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.min.css
deleted file mode 100644
index dc95d8e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.min.css
+++ /dev/null
@@ -1,6 +0,0 @@
-/*!
- * Bootstrap v3.3.6 (http://getbootstrap.com)
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- */.btn-danger,.btn-default,.btn-info,.btn-primary,.btn-success,.btn-warning{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-primary.active,.btn-primary:active,.btn-success.active,.btn-success:active,.btn-warning.active,.btn-warning:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-danger.disabled,.btn-danger[disabled],.btn-default.disabled,.btn-default[disabled],.btn-info.disabled,.btn-info[disabled],.btn-primary.disabled,.btn-primary[disabled],.btn-success.disabled,.btn-success[disabled],.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-danger,fieldset[disabled] .btn-default,fieldset[disabled] .btn-info,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-success,fieldset[disabled] .btn-warning{-webkit-box-shadow:none;box-shadow:none}.btn-danger .badge,.btn-default .badge,.btn-info .badge,.btn-primary .badge,.btn-success .badge,.btn-warning .badge{text-shadow:none}.btn.active,.btn:active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-o-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#e0e0e0));background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc}.btn-default:focus,.btn-default:hover{background-color:#e0e0e0;background-position:0 -15px}.btn-default.active,.btn-default:active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-o-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#265a88));background-image:linear-gradient(to bottom,#337ab7 0,#265a88 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#245580}.btn-primary:focus,.btn-primary:hover{background-color:#265a88;background-position:0 -15px}.btn-primary.active,.btn-primary:active{background-color:#265a88;border-color:#245580}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#265a88;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#419641));background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:focus,.btn-success:hover{background-color:#419641;background-position:0 -15px}.btn-success.active,.btn-success:active{background-color:#419641;border-color:#3e8f3e}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled.focus,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled].focus,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#2aabd2));background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:focus,.btn-info:hover{background-color:#2aabd2;background-position:0 -15px}.btn-info.active,.btn-info:active{background-color:#2aabd2;border-color:#28a4c9}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled.focus,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled].focus,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#eb9316));background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:focus,.btn-warning:hover{background-color:#eb9316;background-position:0 -15px}.btn-warning.active,.btn-warning:active{background-color:#eb9316;border-color:#e38d13}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled.focus,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled].focus,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c12e2a));background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:focus,.btn-danger:hover{background-color:#c12e2a;background-position:0 -15px}.btn-danger.active,.btn-danger:active{background-color:#c12e2a;border-color:#b92c28}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled.focus,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled].focus,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#c12e2a;background-image:none}.img-thumbnail,.thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{background-color:#2e6da4;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-o-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f8f8f8));background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-o-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dbdbdb),to(#e2e2e2));background-image:linear-gradient(to bottom,#dbdbdb 0,#e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-o-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#222));background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-o-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#080808),to(#0f0f0f));background-image:linear-gradient(to bottom,#080808 0,#0f0f0f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-fixed-bottom,.navbar-fixed-top,.navbar-static-top{border-radius:0}@media (max-width:767px){.navbar .navbar-nav .open .dropdown-menu>.active>a,.navbar .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);background-repeat:repeat-x;border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#b9def0));background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);background-repeat:repeat-x;border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#f8efc0));background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);background-repeat:repeat-x;border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-o-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#e7c3c3));background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);background-repeat:repeat-x;border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f5f5f5));background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x}.progress-bar{background-image:-webkit-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-o-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#286090));background-image:linear-gradient(to bottom,#337ab7 0,#286090 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);background-repeat:repeat-x}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#449d44));background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);background-repeat:repeat-x}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#31b0d5));background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);background-repeat:repeat-x}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#ec971f));background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);background-repeat:repeat-x}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c9302c));background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);background-repeat:repeat-x}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{text-shadow:0 -1px 0 #286090;background-image:-webkit-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2b669a));background-image:linear-gradient(to bottom,#337ab7 0,#2b669a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);background-repeat:repeat-x;border-color:#2b669a}.list-group-item.active .badge,.list-group-item.active:focus .badge,.list-group-item.active:hover .badge{text-shadow:none}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#d0e9c6));background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);background-repeat:repeat-x}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#c4e3f3));background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);background-repeat:repeat-x}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#faf2cc));background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);background-repeat:repeat-x}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-o-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#ebcccc));background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);background-repeat:repeat-x}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#e8e8e8),to(#f5f5f5));background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x;border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}
-/*# sourceMappingURL=bootstrap-theme.min.css.map */
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.min.css.map b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.min.css.map
deleted file mode 100644
index 2c6b65a..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap-theme.min.css.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["less/theme.less","less/mixins/vendor-prefixes.less","less/mixins/gradients.less","less/mixins/reset-filter.less"],"names":[],"mappings":"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"}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.css b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.css
deleted file mode 100644
index 42c79d6..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.css
+++ /dev/null
@@ -1,6760 +0,0 @@
-/*!
- * Bootstrap v3.3.6 (http://getbootstrap.com)
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- */
-/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
-html {
-  font-family: sans-serif;
-  -webkit-text-size-adjust: 100%;
-      -ms-text-size-adjust: 100%;
-}
-body {
-  margin: 0;
-}
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-main,
-menu,
-nav,
-section,
-summary {
-  display: block;
-}
-audio,
-canvas,
-progress,
-video {
-  display: inline-block;
-  vertical-align: baseline;
-}
-audio:not([controls]) {
-  display: none;
-  height: 0;
-}
-[hidden],
-template {
-  display: none;
-}
-a {
-  background-color: transparent;
-}
-a:active,
-a:hover {
-  outline: 0;
-}
-abbr[title] {
-  border-bottom: 1px dotted;
-}
-b,
-strong {
-  font-weight: bold;
-}
-dfn {
-  font-style: italic;
-}
-h1 {
-  margin: .67em 0;
-  font-size: 2em;
-}
-mark {
-  color: #000;
-  background: #ff0;
-}
-small {
-  font-size: 80%;
-}
-sub,
-sup {
-  position: relative;
-  font-size: 75%;
-  line-height: 0;
-  vertical-align: baseline;
-}
-sup {
-  top: -.5em;
-}
-sub {
-  bottom: -.25em;
-}
-img {
-  border: 0;
-}
-svg:not(:root) {
-  overflow: hidden;
-}
-figure {
-  margin: 1em 40px;
-}
-hr {
-  height: 0;
-  -webkit-box-sizing: content-box;
-     -moz-box-sizing: content-box;
-          box-sizing: content-box;
-}
-pre {
-  overflow: auto;
-}
-code,
-kbd,
-pre,
-samp {
-  font-family: monospace, monospace;
-  font-size: 1em;
-}
-button,
-input,
-optgroup,
-select,
-textarea {
-  margin: 0;
-  font: inherit;
-  color: inherit;
-}
-button {
-  overflow: visible;
-}
-button,
-select {
-  text-transform: none;
-}
-button,
-html input[type="button"],
-input[type="reset"],
-input[type="submit"] {
-  -webkit-appearance: button;
-  cursor: pointer;
-}
-button[disabled],
-html input[disabled] {
-  cursor: default;
-}
-button::-moz-focus-inner,
-input::-moz-focus-inner {
-  padding: 0;
-  border: 0;
-}
-input {
-  line-height: normal;
-}
-input[type="checkbox"],
-input[type="radio"] {
-  -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-          box-sizing: border-box;
-  padding: 0;
-}
-input[type="number"]::-webkit-inner-spin-button,
-input[type="number"]::-webkit-outer-spin-button {
-  height: auto;
-}
-input[type="search"] {
-  -webkit-box-sizing: content-box;
-     -moz-box-sizing: content-box;
-          box-sizing: content-box;
-  -webkit-appearance: textfield;
-}
-input[type="search"]::-webkit-search-cancel-button,
-input[type="search"]::-webkit-search-decoration {
-  -webkit-appearance: none;
-}
-fieldset {
-  padding: .35em .625em .75em;
-  margin: 0 2px;
-  border: 1px solid #c0c0c0;
-}
-legend {
-  padding: 0;
-  border: 0;
-}
-textarea {
-  overflow: auto;
-}
-optgroup {
-  font-weight: bold;
-}
-table {
-  border-spacing: 0;
-  border-collapse: collapse;
-}
-td,
-th {
-  padding: 0;
-}
-/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
-@media print {
-  *,
-  *:before,
-  *:after {
-    color: #000 !important;
-    text-shadow: none !important;
-    background: transparent !important;
-    -webkit-box-shadow: none !important;
-            box-shadow: none !important;
-  }
-  a,
-  a:visited {
-    text-decoration: underline;
-  }
-  a[href]:after {
-    content: " (" attr(href) ")";
-  }
-  abbr[title]:after {
-    content: " (" attr(title) ")";
-  }
-  a[href^="#"]:after,
-  a[href^="javascript:"]:after {
-    content: "";
-  }
-  pre,
-  blockquote {
-    border: 1px solid #999;
-
-    page-break-inside: avoid;
-  }
-  thead {
-    display: table-header-group;
-  }
-  tr,
-  img {
-    page-break-inside: avoid;
-  }
-  img {
-    max-width: 100% !important;
-  }
-  p,
-  h2,
-  h3 {
-    orphans: 3;
-    widows: 3;
-  }
-  h2,
-  h3 {
-    page-break-after: avoid;
-  }
-  .navbar {
-    display: none;
-  }
-  .btn > .caret,
-  .dropup > .btn > .caret {
-    border-top-color: #000 !important;
-  }
-  .label {
-    border: 1px solid #000;
-  }
-  .table {
-    border-collapse: collapse !important;
-  }
-  .table td,
-  .table th {
-    background-color: #fff !important;
-  }
-  .table-bordered th,
-  .table-bordered td {
-    border: 1px solid #ddd !important;
-  }
-}
-@font-face {
-  font-family: 'Glyphicons Halflings';
-
-  src: url('../fonts/glyphicons-halflings-regular.eot');
-  src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
-}
-.glyphicon {
-  position: relative;
-  top: 1px;
-  display: inline-block;
-  font-family: 'Glyphicons Halflings';
-  font-style: normal;
-  font-weight: normal;
-  line-height: 1;
-
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-}
-.glyphicon-asterisk:before {
-  content: "\002a";
-}
-.glyphicon-plus:before {
-  content: "\002b";
-}
-.glyphicon-euro:before,
-.glyphicon-eur:before {
-  content: "\20ac";
-}
-.glyphicon-minus:before {
-  content: "\2212";
-}
-.glyphicon-cloud:before {
-  content: "\2601";
-}
-.glyphicon-envelope:before {
-  content: "\2709";
-}
-.glyphicon-pencil:before {
-  content: "\270f";
-}
-.glyphicon-glass:before {
-  content: "\e001";
-}
-.glyphicon-music:before {
-  content: "\e002";
-}
-.glyphicon-search:before {
-  content: "\e003";
-}
-.glyphicon-heart:before {
-  content: "\e005";
-}
-.glyphicon-star:before {
-  content: "\e006";
-}
-.glyphicon-star-empty:before {
-  content: "\e007";
-}
-.glyphicon-user:before {
-  content: "\e008";
-}
-.glyphicon-film:before {
-  content: "\e009";
-}
-.glyphicon-th-large:before {
-  content: "\e010";
-}
-.glyphicon-th:before {
-  content: "\e011";
-}
-.glyphicon-th-list:before {
-  content: "\e012";
-}
-.glyphicon-ok:before {
-  content: "\e013";
-}
-.glyphicon-remove:before {
-  content: "\e014";
-}
-.glyphicon-zoom-in:before {
-  content: "\e015";
-}
-.glyphicon-zoom-out:before {
-  content: "\e016";
-}
-.glyphicon-off:before {
-  content: "\e017";
-}
-.glyphicon-signal:before {
-  content: "\e018";
-}
-.glyphicon-cog:before {
-  content: "\e019";
-}
-.glyphicon-trash:before {
-  content: "\e020";
-}
-.glyphicon-home:before {
-  content: "\e021";
-}
-.glyphicon-file:before {
-  content: "\e022";
-}
-.glyphicon-time:before {
-  content: "\e023";
-}
-.glyphicon-road:before {
-  content: "\e024";
-}
-.glyphicon-download-alt:before {
-  content: "\e025";
-}
-.glyphicon-download:before {
-  content: "\e026";
-}
-.glyphicon-upload:before {
-  content: "\e027";
-}
-.glyphicon-inbox:before {
-  content: "\e028";
-}
-.glyphicon-play-circle:before {
-  content: "\e029";
-}
-.glyphicon-repeat:before {
-  content: "\e030";
-}
-.glyphicon-refresh:before {
-  content: "\e031";
-}
-.glyphicon-list-alt:before {
-  content: "\e032";
-}
-.glyphicon-lock:before {
-  content: "\e033";
-}
-.glyphicon-flag:before {
-  content: "\e034";
-}
-.glyphicon-headphones:before {
-  content: "\e035";
-}
-.glyphicon-volume-off:before {
-  content: "\e036";
-}
-.glyphicon-volume-down:before {
-  content: "\e037";
-}
-.glyphicon-volume-up:before {
-  content: "\e038";
-}
-.glyphicon-qrcode:before {
-  content: "\e039";
-}
-.glyphicon-barcode:before {
-  content: "\e040";
-}
-.glyphicon-tag:before {
-  content: "\e041";
-}
-.glyphicon-tags:before {
-  content: "\e042";
-}
-.glyphicon-book:before {
-  content: "\e043";
-}
-.glyphicon-bookmark:before {
-  content: "\e044";
-}
-.glyphicon-print:before {
-  content: "\e045";
-}
-.glyphicon-camera:before {
-  content: "\e046";
-}
-.glyphicon-font:before {
-  content: "\e047";
-}
-.glyphicon-bold:before {
-  content: "\e048";
-}
-.glyphicon-italic:before {
-  content: "\e049";
-}
-.glyphicon-text-height:before {
-  content: "\e050";
-}
-.glyphicon-text-width:before {
-  content: "\e051";
-}
-.glyphicon-align-left:before {
-  content: "\e052";
-}
-.glyphicon-align-center:before {
-  content: "\e053";
-}
-.glyphicon-align-right:before {
-  content: "\e054";
-}
-.glyphicon-align-justify:before {
-  content: "\e055";
-}
-.glyphicon-list:before {
-  content: "\e056";
-}
-.glyphicon-indent-left:before {
-  content: "\e057";
-}
-.glyphicon-indent-right:before {
-  content: "\e058";
-}
-.glyphicon-facetime-video:before {
-  content: "\e059";
-}
-.glyphicon-picture:before {
-  content: "\e060";
-}
-.glyphicon-map-marker:before {
-  content: "\e062";
-}
-.glyphicon-adjust:before {
-  content: "\e063";
-}
-.glyphicon-tint:before {
-  content: "\e064";
-}
-.glyphicon-edit:before {
-  content: "\e065";
-}
-.glyphicon-share:before {
-  content: "\e066";
-}
-.glyphicon-check:before {
-  content: "\e067";
-}
-.glyphicon-move:before {
-  content: "\e068";
-}
-.glyphicon-step-backward:before {
-  content: "\e069";
-}
-.glyphicon-fast-backward:before {
-  content: "\e070";
-}
-.glyphicon-backward:before {
-  content: "\e071";
-}
-.glyphicon-play:before {
-  content: "\e072";
-}
-.glyphicon-pause:before {
-  content: "\e073";
-}
-.glyphicon-stop:before {
-  content: "\e074";
-}
-.glyphicon-forward:before {
-  content: "\e075";
-}
-.glyphicon-fast-forward:before {
-  content: "\e076";
-}
-.glyphicon-step-forward:before {
-  content: "\e077";
-}
-.glyphicon-eject:before {
-  content: "\e078";
-}
-.glyphicon-chevron-left:before {
-  content: "\e079";
-}
-.glyphicon-chevron-right:before {
-  content: "\e080";
-}
-.glyphicon-plus-sign:before {
-  content: "\e081";
-}
-.glyphicon-minus-sign:before {
-  content: "\e082";
-}
-.glyphicon-remove-sign:before {
-  content: "\e083";
-}
-.glyphicon-ok-sign:before {
-  content: "\e084";
-}
-.glyphicon-question-sign:before {
-  content: "\e085";
-}
-.glyphicon-info-sign:before {
-  content: "\e086";
-}
-.glyphicon-screenshot:before {
-  content: "\e087";
-}
-.glyphicon-remove-circle:before {
-  content: "\e088";
-}
-.glyphicon-ok-circle:before {
-  content: "\e089";
-}
-.glyphicon-ban-circle:before {
-  content: "\e090";
-}
-.glyphicon-arrow-left:before {
-  content: "\e091";
-}
-.glyphicon-arrow-right:before {
-  content: "\e092";
-}
-.glyphicon-arrow-up:before {
-  content: "\e093";
-}
-.glyphicon-arrow-down:before {
-  content: "\e094";
-}
-.glyphicon-share-alt:before {
-  content: "\e095";
-}
-.glyphicon-resize-full:before {
-  content: "\e096";
-}
-.glyphicon-resize-small:before {
-  content: "\e097";
-}
-.glyphicon-exclamation-sign:before {
-  content: "\e101";
-}
-.glyphicon-gift:before {
-  content: "\e102";
-}
-.glyphicon-leaf:before {
-  content: "\e103";
-}
-.glyphicon-fire:before {
-  content: "\e104";
-}
-.glyphicon-eye-open:before {
-  content: "\e105";
-}
-.glyphicon-eye-close:before {
-  content: "\e106";
-}
-.glyphicon-warning-sign:before {
-  content: "\e107";
-}
-.glyphicon-plane:before {
-  content: "\e108";
-}
-.glyphicon-calendar:before {
-  content: "\e109";
-}
-.glyphicon-random:before {
-  content: "\e110";
-}
-.glyphicon-comment:before {
-  content: "\e111";
-}
-.glyphicon-magnet:before {
-  content: "\e112";
-}
-.glyphicon-chevron-up:before {
-  content: "\e113";
-}
-.glyphicon-chevron-down:before {
-  content: "\e114";
-}
-.glyphicon-retweet:before {
-  content: "\e115";
-}
-.glyphicon-shopping-cart:before {
-  content: "\e116";
-}
-.glyphicon-folder-close:before {
-  content: "\e117";
-}
-.glyphicon-folder-open:before {
-  content: "\e118";
-}
-.glyphicon-resize-vertical:before {
-  content: "\e119";
-}
-.glyphicon-resize-horizontal:before {
-  content: "\e120";
-}
-.glyphicon-hdd:before {
-  content: "\e121";
-}
-.glyphicon-bullhorn:before {
-  content: "\e122";
-}
-.glyphicon-bell:before {
-  content: "\e123";
-}
-.glyphicon-certificate:before {
-  content: "\e124";
-}
-.glyphicon-thumbs-up:before {
-  content: "\e125";
-}
-.glyphicon-thumbs-down:before {
-  content: "\e126";
-}
-.glyphicon-hand-right:before {
-  content: "\e127";
-}
-.glyphicon-hand-left:before {
-  content: "\e128";
-}
-.glyphicon-hand-up:before {
-  content: "\e129";
-}
-.glyphicon-hand-down:before {
-  content: "\e130";
-}
-.glyphicon-circle-arrow-right:before {
-  content: "\e131";
-}
-.glyphicon-circle-arrow-left:before {
-  content: "\e132";
-}
-.glyphicon-circle-arrow-up:before {
-  content: "\e133";
-}
-.glyphicon-circle-arrow-down:before {
-  content: "\e134";
-}
-.glyphicon-globe:before {
-  content: "\e135";
-}
-.glyphicon-wrench:before {
-  content: "\e136";
-}
-.glyphicon-tasks:before {
-  content: "\e137";
-}
-.glyphicon-filter:before {
-  content: "\e138";
-}
-.glyphicon-briefcase:before {
-  content: "\e139";
-}
-.glyphicon-fullscreen:before {
-  content: "\e140";
-}
-.glyphicon-dashboard:before {
-  content: "\e141";
-}
-.glyphicon-paperclip:before {
-  content: "\e142";
-}
-.glyphicon-heart-empty:before {
-  content: "\e143";
-}
-.glyphicon-link:before {
-  content: "\e144";
-}
-.glyphicon-phone:before {
-  content: "\e145";
-}
-.glyphicon-pushpin:before {
-  content: "\e146";
-}
-.glyphicon-usd:before {
-  content: "\e148";
-}
-.glyphicon-gbp:before {
-  content: "\e149";
-}
-.glyphicon-sort:before {
-  content: "\e150";
-}
-.glyphicon-sort-by-alphabet:before {
-  content: "\e151";
-}
-.glyphicon-sort-by-alphabet-alt:before {
-  content: "\e152";
-}
-.glyphicon-sort-by-order:before {
-  content: "\e153";
-}
-.glyphicon-sort-by-order-alt:before {
-  content: "\e154";
-}
-.glyphicon-sort-by-attributes:before {
-  content: "\e155";
-}
-.glyphicon-sort-by-attributes-alt:before {
-  content: "\e156";
-}
-.glyphicon-unchecked:before {
-  content: "\e157";
-}
-.glyphicon-expand:before {
-  content: "\e158";
-}
-.glyphicon-collapse-down:before {
-  content: "\e159";
-}
-.glyphicon-collapse-up:before {
-  content: "\e160";
-}
-.glyphicon-log-in:before {
-  content: "\e161";
-}
-.glyphicon-flash:before {
-  content: "\e162";
-}
-.glyphicon-log-out:before {
-  content: "\e163";
-}
-.glyphicon-new-window:before {
-  content: "\e164";
-}
-.glyphicon-record:before {
-  content: "\e165";
-}
-.glyphicon-save:before {
-  content: "\e166";
-}
-.glyphicon-open:before {
-  content: "\e167";
-}
-.glyphicon-saved:before {
-  content: "\e168";
-}
-.glyphicon-import:before {
-  content: "\e169";
-}
-.glyphicon-export:before {
-  content: "\e170";
-}
-.glyphicon-send:before {
-  content: "\e171";
-}
-.glyphicon-floppy-disk:before {
-  content: "\e172";
-}
-.glyphicon-floppy-saved:before {
-  content: "\e173";
-}
-.glyphicon-floppy-remove:before {
-  content: "\e174";
-}
-.glyphicon-floppy-save:before {
-  content: "\e175";
-}
-.glyphicon-floppy-open:before {
-  content: "\e176";
-}
-.glyphicon-credit-card:before {
-  content: "\e177";
-}
-.glyphicon-transfer:before {
-  content: "\e178";
-}
-.glyphicon-cutlery:before {
-  content: "\e179";
-}
-.glyphicon-header:before {
-  content: "\e180";
-}
-.glyphicon-compressed:before {
-  content: "\e181";
-}
-.glyphicon-earphone:before {
-  content: "\e182";
-}
-.glyphicon-phone-alt:before {
-  content: "\e183";
-}
-.glyphicon-tower:before {
-  content: "\e184";
-}
-.glyphicon-stats:before {
-  content: "\e185";
-}
-.glyphicon-sd-video:before {
-  content: "\e186";
-}
-.glyphicon-hd-video:before {
-  content: "\e187";
-}
-.glyphicon-subtitles:before {
-  content: "\e188";
-}
-.glyphicon-sound-stereo:before {
-  content: "\e189";
-}
-.glyphicon-sound-dolby:before {
-  content: "\e190";
-}
-.glyphicon-sound-5-1:before {
-  content: "\e191";
-}
-.glyphicon-sound-6-1:before {
-  content: "\e192";
-}
-.glyphicon-sound-7-1:before {
-  content: "\e193";
-}
-.glyphicon-copyright-mark:before {
-  content: "\e194";
-}
-.glyphicon-registration-mark:before {
-  content: "\e195";
-}
-.glyphicon-cloud-download:before {
-  content: "\e197";
-}
-.glyphicon-cloud-upload:before {
-  content: "\e198";
-}
-.glyphicon-tree-conifer:before {
-  content: "\e199";
-}
-.glyphicon-tree-deciduous:before {
-  content: "\e200";
-}
-.glyphicon-cd:before {
-  content: "\e201";
-}
-.glyphicon-save-file:before {
-  content: "\e202";
-}
-.glyphicon-open-file:before {
-  content: "\e203";
-}
-.glyphicon-level-up:before {
-  content: "\e204";
-}
-.glyphicon-copy:before {
-  content: "\e205";
-}
-.glyphicon-paste:before {
-  content: "\e206";
-}
-.glyphicon-alert:before {
-  content: "\e209";
-}
-.glyphicon-equalizer:before {
-  content: "\e210";
-}
-.glyphicon-king:before {
-  content: "\e211";
-}
-.glyphicon-queen:before {
-  content: "\e212";
-}
-.glyphicon-pawn:before {
-  content: "\e213";
-}
-.glyphicon-bishop:before {
-  content: "\e214";
-}
-.glyphicon-knight:before {
-  content: "\e215";
-}
-.glyphicon-baby-formula:before {
-  content: "\e216";
-}
-.glyphicon-tent:before {
-  content: "\26fa";
-}
-.glyphicon-blackboard:before {
-  content: "\e218";
-}
-.glyphicon-bed:before {
-  content: "\e219";
-}
-.glyphicon-apple:before {
-  content: "\f8ff";
-}
-.glyphicon-erase:before {
-  content: "\e221";
-}
-.glyphicon-hourglass:before {
-  content: "\231b";
-}
-.glyphicon-lamp:before {
-  content: "\e223";
-}
-.glyphicon-duplicate:before {
-  content: "\e224";
-}
-.glyphicon-piggy-bank:before {
-  content: "\e225";
-}
-.glyphicon-scissors:before {
-  content: "\e226";
-}
-.glyphicon-bitcoin:before {
-  content: "\e227";
-}
-.glyphicon-btc:before {
-  content: "\e227";
-}
-.glyphicon-xbt:before {
-  content: "\e227";
-}
-.glyphicon-yen:before {
-  content: "\00a5";
-}
-.glyphicon-jpy:before {
-  content: "\00a5";
-}
-.glyphicon-ruble:before {
-  content: "\20bd";
-}
-.glyphicon-rub:before {
-  content: "\20bd";
-}
-.glyphicon-scale:before {
-  content: "\e230";
-}
-.glyphicon-ice-lolly:before {
-  content: "\e231";
-}
-.glyphicon-ice-lolly-tasted:before {
-  content: "\e232";
-}
-.glyphicon-education:before {
-  content: "\e233";
-}
-.glyphicon-option-horizontal:before {
-  content: "\e234";
-}
-.glyphicon-option-vertical:before {
-  content: "\e235";
-}
-.glyphicon-menu-hamburger:before {
-  content: "\e236";
-}
-.glyphicon-modal-window:before {
-  content: "\e237";
-}
-.glyphicon-oil:before {
-  content: "\e238";
-}
-.glyphicon-grain:before {
-  content: "\e239";
-}
-.glyphicon-sunglasses:before {
-  content: "\e240";
-}
-.glyphicon-text-size:before {
-  content: "\e241";
-}
-.glyphicon-text-color:before {
-  content: "\e242";
-}
-.glyphicon-text-background:before {
-  content: "\e243";
-}
-.glyphicon-object-align-top:before {
-  content: "\e244";
-}
-.glyphicon-object-align-bottom:before {
-  content: "\e245";
-}
-.glyphicon-object-align-horizontal:before {
-  content: "\e246";
-}
-.glyphicon-object-align-left:before {
-  content: "\e247";
-}
-.glyphicon-object-align-vertical:before {
-  content: "\e248";
-}
-.glyphicon-object-align-right:before {
-  content: "\e249";
-}
-.glyphicon-triangle-right:before {
-  content: "\e250";
-}
-.glyphicon-triangle-left:before {
-  content: "\e251";
-}
-.glyphicon-triangle-bottom:before {
-  content: "\e252";
-}
-.glyphicon-triangle-top:before {
-  content: "\e253";
-}
-.glyphicon-console:before {
-  content: "\e254";
-}
-.glyphicon-superscript:before {
-  content: "\e255";
-}
-.glyphicon-subscript:before {
-  content: "\e256";
-}
-.glyphicon-menu-left:before {
-  content: "\e257";
-}
-.glyphicon-menu-right:before {
-  content: "\e258";
-}
-.glyphicon-menu-down:before {
-  content: "\e259";
-}
-.glyphicon-menu-up:before {
-  content: "\e260";
-}
-* {
-  -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-          box-sizing: border-box;
-}
-*:before,
-*:after {
-  -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-          box-sizing: border-box;
-}
-html {
-  font-size: 10px;
-
-  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-}
-body {
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 14px;
-  line-height: 1.42857143;
-  color: #333;
-  background-color: #fff;
-}
-input,
-button,
-select,
-textarea {
-  font-family: inherit;
-  font-size: inherit;
-  line-height: inherit;
-}
-a {
-  color: #337ab7;
-  text-decoration: none;
-}
-a:hover,
-a:focus {
-  color: #23527c;
-  text-decoration: underline;
-}
-a:focus {
-  outline: thin dotted;
-  outline: 5px auto -webkit-focus-ring-color;
-  outline-offset: -2px;
-}
-figure {
-  margin: 0;
-}
-img {
-  vertical-align: middle;
-}
-.img-responsive,
-.thumbnail > img,
-.thumbnail a > img,
-.carousel-inner > .item > img,
-.carousel-inner > .item > a > img {
-  display: block;
-  max-width: 100%;
-  height: auto;
-}
-.img-rounded {
-  border-radius: 6px;
-}
-.img-thumbnail {
-  display: inline-block;
-  max-width: 100%;
-  height: auto;
-  padding: 4px;
-  line-height: 1.42857143;
-  background-color: #fff;
-  border: 1px solid #ddd;
-  border-radius: 4px;
-  -webkit-transition: all .2s ease-in-out;
-       -o-transition: all .2s ease-in-out;
-          transition: all .2s ease-in-out;
-}
-.img-circle {
-  border-radius: 50%;
-}
-hr {
-  margin-top: 20px;
-  margin-bottom: 20px;
-  border: 0;
-  border-top: 1px solid #eee;
-}
-.sr-only {
-  position: absolute;
-  width: 1px;
-  height: 1px;
-  padding: 0;
-  margin: -1px;
-  overflow: hidden;
-  clip: rect(0, 0, 0, 0);
-  border: 0;
-}
-.sr-only-focusable:active,
-.sr-only-focusable:focus {
-  position: static;
-  width: auto;
-  height: auto;
-  margin: 0;
-  overflow: visible;
-  clip: auto;
-}
-[role="button"] {
-  cursor: pointer;
-}
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-.h1,
-.h2,
-.h3,
-.h4,
-.h5,
-.h6 {
-  font-family: inherit;
-  font-weight: 500;
-  line-height: 1.1;
-  color: inherit;
-}
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small,
-.h1 small,
-.h2 small,
-.h3 small,
-.h4 small,
-.h5 small,
-.h6 small,
-h1 .small,
-h2 .small,
-h3 .small,
-h4 .small,
-h5 .small,
-h6 .small,
-.h1 .small,
-.h2 .small,
-.h3 .small,
-.h4 .small,
-.h5 .small,
-.h6 .small {
-  font-weight: normal;
-  line-height: 1;
-  color: #777;
-}
-h1,
-.h1,
-h2,
-.h2,
-h3,
-.h3 {
-  margin-top: 20px;
-  margin-bottom: 10px;
-}
-h1 small,
-.h1 small,
-h2 small,
-.h2 small,
-h3 small,
-.h3 small,
-h1 .small,
-.h1 .small,
-h2 .small,
-.h2 .small,
-h3 .small,
-.h3 .small {
-  font-size: 65%;
-}
-h4,
-.h4,
-h5,
-.h5,
-h6,
-.h6 {
-  margin-top: 10px;
-  margin-bottom: 10px;
-}
-h4 small,
-.h4 small,
-h5 small,
-.h5 small,
-h6 small,
-.h6 small,
-h4 .small,
-.h4 .small,
-h5 .small,
-.h5 .small,
-h6 .small,
-.h6 .small {
-  font-size: 75%;
-}
-h1,
-.h1 {
-  font-size: 36px;
-}
-h2,
-.h2 {
-  font-size: 30px;
-}
-h3,
-.h3 {
-  font-size: 24px;
-}
-h4,
-.h4 {
-  font-size: 18px;
-}
-h5,
-.h5 {
-  font-size: 14px;
-}
-h6,
-.h6 {
-  font-size: 12px;
-}
-p {
-  margin: 0 0 10px;
-}
-.lead {
-  margin-bottom: 20px;
-  font-size: 16px;
-  font-weight: 300;
-  line-height: 1.4;
-}
-@media (min-width: 768px) {
-  .lead {
-    font-size: 21px;
-  }
-}
-small,
-.small {
-  font-size: 85%;
-}
-mark,
-.mark {
-  padding: .2em;
-  background-color: #fcf8e3;
-}
-.text-left {
-  text-align: left;
-}
-.text-right {
-  text-align: right;
-}
-.text-center {
-  text-align: center;
-}
-.text-justify {
-  text-align: justify;
-}
-.text-nowrap {
-  white-space: nowrap;
-}
-.text-lowercase {
-  text-transform: lowercase;
-}
-.text-uppercase {
-  text-transform: uppercase;
-}
-.text-capitalize {
-  text-transform: capitalize;
-}
-.text-muted {
-  color: #777;
-}
-.text-primary {
-  color: #337ab7;
-}
-a.text-primary:hover,
-a.text-primary:focus {
-  color: #286090;
-}
-.text-success {
-  color: #3c763d;
-}
-a.text-success:hover,
-a.text-success:focus {
-  color: #2b542c;
-}
-.text-info {
-  color: #31708f;
-}
-a.text-info:hover,
-a.text-info:focus {
-  color: #245269;
-}
-.text-warning {
-  color: #8a6d3b;
-}
-a.text-warning:hover,
-a.text-warning:focus {
-  color: #66512c;
-}
-.text-danger {
-  color: #a94442;
-}
-a.text-danger:hover,
-a.text-danger:focus {
-  color: #843534;
-}
-.bg-primary {
-  color: #fff;
-  background-color: #337ab7;
-}
-a.bg-primary:hover,
-a.bg-primary:focus {
-  background-color: #286090;
-}
-.bg-success {
-  background-color: #dff0d8;
-}
-a.bg-success:hover,
-a.bg-success:focus {
-  background-color: #c1e2b3;
-}
-.bg-info {
-  background-color: #d9edf7;
-}
-a.bg-info:hover,
-a.bg-info:focus {
-  background-color: #afd9ee;
-}
-.bg-warning {
-  background-color: #fcf8e3;
-}
-a.bg-warning:hover,
-a.bg-warning:focus {
-  background-color: #f7ecb5;
-}
-.bg-danger {
-  background-color: #f2dede;
-}
-a.bg-danger:hover,
-a.bg-danger:focus {
-  background-color: #e4b9b9;
-}
-.page-header {
-  padding-bottom: 9px;
-  margin: 40px 0 20px;
-  border-bottom: 1px solid #eee;
-}
-ul,
-ol {
-  margin-top: 0;
-  margin-bottom: 10px;
-}
-ul ul,
-ol ul,
-ul ol,
-ol ol {
-  margin-bottom: 0;
-}
-.list-unstyled {
-  padding-left: 0;
-  list-style: none;
-}
-.list-inline {
-  padding-left: 0;
-  margin-left: -5px;
-  list-style: none;
-}
-.list-inline > li {
-  display: inline-block;
-  padding-right: 5px;
-  padding-left: 5px;
-}
-dl {
-  margin-top: 0;
-  margin-bottom: 20px;
-}
-dt,
-dd {
-  line-height: 1.42857143;
-}
-dt {
-  font-weight: bold;
-}
-dd {
-  margin-left: 0;
-}
-@media (min-width: 768px) {
-  .dl-horizontal dt {
-    float: left;
-    width: 160px;
-    overflow: hidden;
-    clear: left;
-    text-align: right;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-  }
-  .dl-horizontal dd {
-    margin-left: 180px;
-  }
-}
-abbr[title],
-abbr[data-original-title] {
-  cursor: help;
-  border-bottom: 1px dotted #777;
-}
-.initialism {
-  font-size: 90%;
-  text-transform: uppercase;
-}
-blockquote {
-  padding: 10px 20px;
-  margin: 0 0 20px;
-  font-size: 17.5px;
-  border-left: 5px solid #eee;
-}
-blockquote p:last-child,
-blockquote ul:last-child,
-blockquote ol:last-child {
-  margin-bottom: 0;
-}
-blockquote footer,
-blockquote small,
-blockquote .small {
-  display: block;
-  font-size: 80%;
-  line-height: 1.42857143;
-  color: #777;
-}
-blockquote footer:before,
-blockquote small:before,
-blockquote .small:before {
-  content: '\2014 \00A0';
-}
-.blockquote-reverse,
-blockquote.pull-right {
-  padding-right: 15px;
-  padding-left: 0;
-  text-align: right;
-  border-right: 5px solid #eee;
-  border-left: 0;
-}
-.blockquote-reverse footer:before,
-blockquote.pull-right footer:before,
-.blockquote-reverse small:before,
-blockquote.pull-right small:before,
-.blockquote-reverse .small:before,
-blockquote.pull-right .small:before {
-  content: '';
-}
-.blockquote-reverse footer:after,
-blockquote.pull-right footer:after,
-.blockquote-reverse small:after,
-blockquote.pull-right small:after,
-.blockquote-reverse .small:after,
-blockquote.pull-right .small:after {
-  content: '\00A0 \2014';
-}
-address {
-  margin-bottom: 20px;
-  font-style: normal;
-  line-height: 1.42857143;
-}
-code,
-kbd,
-pre,
-samp {
-  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
-}
-code {
-  padding: 2px 4px;
-  font-size: 90%;
-  color: #c7254e;
-  background-color: #f9f2f4;
-  border-radius: 4px;
-}
-kbd {
-  padding: 2px 4px;
-  font-size: 90%;
-  color: #fff;
-  background-color: #333;
-  border-radius: 3px;
-  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
-          box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
-}
-kbd kbd {
-  padding: 0;
-  font-size: 100%;
-  font-weight: bold;
-  -webkit-box-shadow: none;
-          box-shadow: none;
-}
-pre {
-  display: block;
-  padding: 9.5px;
-  margin: 0 0 10px;
-  font-size: 13px;
-  line-height: 1.42857143;
-  color: #333;
-  word-break: break-all;
-  word-wrap: break-word;
-  background-color: #f5f5f5;
-  border: 1px solid #ccc;
-  border-radius: 4px;
-}
-pre code {
-  padding: 0;
-  font-size: inherit;
-  color: inherit;
-  white-space: pre-wrap;
-  background-color: transparent;
-  border-radius: 0;
-}
-.pre-scrollable {
-  max-height: 340px;
-  overflow-y: scroll;
-}
-.container {
-  padding-right: 15px;
-  padding-left: 15px;
-  margin-right: auto;
-  margin-left: auto;
-}
-@media (min-width: 768px) {
-  .container {
-    width: 750px;
-  }
-}
-@media (min-width: 992px) {
-  .container {
-    width: 970px;
-  }
-}
-@media (min-width: 1200px) {
-  .container {
-    width: 1170px;
-  }
-}
-.container-fluid {
-  padding-right: 15px;
-  padding-left: 15px;
-  margin-right: auto;
-  margin-left: auto;
-}
-.row {
-  margin-right: -15px;
-  margin-left: -15px;
-}
-.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
-  position: relative;
-  min-height: 1px;
-  padding-right: 15px;
-  padding-left: 15px;
-}
-.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
-  float: left;
-}
-.col-xs-12 {
-  width: 100%;
-}
-.col-xs-11 {
-  width: 91.66666667%;
-}
-.col-xs-10 {
-  width: 83.33333333%;
-}
-.col-xs-9 {
-  width: 75%;
-}
-.col-xs-8 {
-  width: 66.66666667%;
-}
-.col-xs-7 {
-  width: 58.33333333%;
-}
-.col-xs-6 {
-  width: 50%;
-}
-.col-xs-5 {
-  width: 41.66666667%;
-}
-.col-xs-4 {
-  width: 33.33333333%;
-}
-.col-xs-3 {
-  width: 25%;
-}
-.col-xs-2 {
-  width: 16.66666667%;
-}
-.col-xs-1 {
-  width: 8.33333333%;
-}
-.col-xs-pull-12 {
-  right: 100%;
-}
-.col-xs-pull-11 {
-  right: 91.66666667%;
-}
-.col-xs-pull-10 {
-  right: 83.33333333%;
-}
-.col-xs-pull-9 {
-  right: 75%;
-}
-.col-xs-pull-8 {
-  right: 66.66666667%;
-}
-.col-xs-pull-7 {
-  right: 58.33333333%;
-}
-.col-xs-pull-6 {
-  right: 50%;
-}
-.col-xs-pull-5 {
-  right: 41.66666667%;
-}
-.col-xs-pull-4 {
-  right: 33.33333333%;
-}
-.col-xs-pull-3 {
-  right: 25%;
-}
-.col-xs-pull-2 {
-  right: 16.66666667%;
-}
-.col-xs-pull-1 {
-  right: 8.33333333%;
-}
-.col-xs-pull-0 {
-  right: auto;
-}
-.col-xs-push-12 {
-  left: 100%;
-}
-.col-xs-push-11 {
-  left: 91.66666667%;
-}
-.col-xs-push-10 {
-  left: 83.33333333%;
-}
-.col-xs-push-9 {
-  left: 75%;
-}
-.col-xs-push-8 {
-  left: 66.66666667%;
-}
-.col-xs-push-7 {
-  left: 58.33333333%;
-}
-.col-xs-push-6 {
-  left: 50%;
-}
-.col-xs-push-5 {
-  left: 41.66666667%;
-}
-.col-xs-push-4 {
-  left: 33.33333333%;
-}
-.col-xs-push-3 {
-  left: 25%;
-}
-.col-xs-push-2 {
-  left: 16.66666667%;
-}
-.col-xs-push-1 {
-  left: 8.33333333%;
-}
-.col-xs-push-0 {
-  left: auto;
-}
-.col-xs-offset-12 {
-  margin-left: 100%;
-}
-.col-xs-offset-11 {
-  margin-left: 91.66666667%;
-}
-.col-xs-offset-10 {
-  margin-left: 83.33333333%;
-}
-.col-xs-offset-9 {
-  margin-left: 75%;
-}
-.col-xs-offset-8 {
-  margin-left: 66.66666667%;
-}
-.col-xs-offset-7 {
-  margin-left: 58.33333333%;
-}
-.col-xs-offset-6 {
-  margin-left: 50%;
-}
-.col-xs-offset-5 {
-  margin-left: 41.66666667%;
-}
-.col-xs-offset-4 {
-  margin-left: 33.33333333%;
-}
-.col-xs-offset-3 {
-  margin-left: 25%;
-}
-.col-xs-offset-2 {
-  margin-left: 16.66666667%;
-}
-.col-xs-offset-1 {
-  margin-left: 8.33333333%;
-}
-.col-xs-offset-0 {
-  margin-left: 0;
-}
-@media (min-width: 768px) {
-  .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
-    float: left;
-  }
-  .col-sm-12 {
-    width: 100%;
-  }
-  .col-sm-11 {
-    width: 91.66666667%;
-  }
-  .col-sm-10 {
-    width: 83.33333333%;
-  }
-  .col-sm-9 {
-    width: 75%;
-  }
-  .col-sm-8 {
-    width: 66.66666667%;
-  }
-  .col-sm-7 {
-    width: 58.33333333%;
-  }
-  .col-sm-6 {
-    width: 50%;
-  }
-  .col-sm-5 {
-    width: 41.66666667%;
-  }
-  .col-sm-4 {
-    width: 33.33333333%;
-  }
-  .col-sm-3 {
-    width: 25%;
-  }
-  .col-sm-2 {
-    width: 16.66666667%;
-  }
-  .col-sm-1 {
-    width: 8.33333333%;
-  }
-  .col-sm-pull-12 {
-    right: 100%;
-  }
-  .col-sm-pull-11 {
-    right: 91.66666667%;
-  }
-  .col-sm-pull-10 {
-    right: 83.33333333%;
-  }
-  .col-sm-pull-9 {
-    right: 75%;
-  }
-  .col-sm-pull-8 {
-    right: 66.66666667%;
-  }
-  .col-sm-pull-7 {
-    right: 58.33333333%;
-  }
-  .col-sm-pull-6 {
-    right: 50%;
-  }
-  .col-sm-pull-5 {
-    right: 41.66666667%;
-  }
-  .col-sm-pull-4 {
-    right: 33.33333333%;
-  }
-  .col-sm-pull-3 {
-    right: 25%;
-  }
-  .col-sm-pull-2 {
-    right: 16.66666667%;
-  }
-  .col-sm-pull-1 {
-    right: 8.33333333%;
-  }
-  .col-sm-pull-0 {
-    right: auto;
-  }
-  .col-sm-push-12 {
-    left: 100%;
-  }
-  .col-sm-push-11 {
-    left: 91.66666667%;
-  }
-  .col-sm-push-10 {
-    left: 83.33333333%;
-  }
-  .col-sm-push-9 {
-    left: 75%;
-  }
-  .col-sm-push-8 {
-    left: 66.66666667%;
-  }
-  .col-sm-push-7 {
-    left: 58.33333333%;
-  }
-  .col-sm-push-6 {
-    left: 50%;
-  }
-  .col-sm-push-5 {
-    left: 41.66666667%;
-  }
-  .col-sm-push-4 {
-    left: 33.33333333%;
-  }
-  .col-sm-push-3 {
-    left: 25%;
-  }
-  .col-sm-push-2 {
-    left: 16.66666667%;
-  }
-  .col-sm-push-1 {
-    left: 8.33333333%;
-  }
-  .col-sm-push-0 {
-    left: auto;
-  }
-  .col-sm-offset-12 {
-    margin-left: 100%;
-  }
-  .col-sm-offset-11 {
-    margin-left: 91.66666667%;
-  }
-  .col-sm-offset-10 {
-    margin-left: 83.33333333%;
-  }
-  .col-sm-offset-9 {
-    margin-left: 75%;
-  }
-  .col-sm-offset-8 {
-    margin-left: 66.66666667%;
-  }
-  .col-sm-offset-7 {
-    margin-left: 58.33333333%;
-  }
-  .col-sm-offset-6 {
-    margin-left: 50%;
-  }
-  .col-sm-offset-5 {
-    margin-left: 41.66666667%;
-  }
-  .col-sm-offset-4 {
-    margin-left: 33.33333333%;
-  }
-  .col-sm-offset-3 {
-    margin-left: 25%;
-  }
-  .col-sm-offset-2 {
-    margin-left: 16.66666667%;
-  }
-  .col-sm-offset-1 {
-    margin-left: 8.33333333%;
-  }
-  .col-sm-offset-0 {
-    margin-left: 0;
-  }
-}
-@media (min-width: 992px) {
-  .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
-    float: left;
-  }
-  .col-md-12 {
-    width: 100%;
-  }
-  .col-md-11 {
-    width: 91.66666667%;
-  }
-  .col-md-10 {
-    width: 83.33333333%;
-  }
-  .col-md-9 {
-    width: 75%;
-  }
-  .col-md-8 {
-    width: 66.66666667%;
-  }
-  .col-md-7 {
-    width: 58.33333333%;
-  }
-  .col-md-6 {
-    width: 50%;
-  }
-  .col-md-5 {
-    width: 41.66666667%;
-  }
-  .col-md-4 {
-    width: 33.33333333%;
-  }
-  .col-md-3 {
-    width: 25%;
-  }
-  .col-md-2 {
-    width: 16.66666667%;
-  }
-  .col-md-1 {
-    width: 8.33333333%;
-  }
-  .col-md-pull-12 {
-    right: 100%;
-  }
-  .col-md-pull-11 {
-    right: 91.66666667%;
-  }
-  .col-md-pull-10 {
-    right: 83.33333333%;
-  }
-  .col-md-pull-9 {
-    right: 75%;
-  }
-  .col-md-pull-8 {
-    right: 66.66666667%;
-  }
-  .col-md-pull-7 {
-    right: 58.33333333%;
-  }
-  .col-md-pull-6 {
-    right: 50%;
-  }
-  .col-md-pull-5 {
-    right: 41.66666667%;
-  }
-  .col-md-pull-4 {
-    right: 33.33333333%;
-  }
-  .col-md-pull-3 {
-    right: 25%;
-  }
-  .col-md-pull-2 {
-    right: 16.66666667%;
-  }
-  .col-md-pull-1 {
-    right: 8.33333333%;
-  }
-  .col-md-pull-0 {
-    right: auto;
-  }
-  .col-md-push-12 {
-    left: 100%;
-  }
-  .col-md-push-11 {
-    left: 91.66666667%;
-  }
-  .col-md-push-10 {
-    left: 83.33333333%;
-  }
-  .col-md-push-9 {
-    left: 75%;
-  }
-  .col-md-push-8 {
-    left: 66.66666667%;
-  }
-  .col-md-push-7 {
-    left: 58.33333333%;
-  }
-  .col-md-push-6 {
-    left: 50%;
-  }
-  .col-md-push-5 {
-    left: 41.66666667%;
-  }
-  .col-md-push-4 {
-    left: 33.33333333%;
-  }
-  .col-md-push-3 {
-    left: 25%;
-  }
-  .col-md-push-2 {
-    left: 16.66666667%;
-  }
-  .col-md-push-1 {
-    left: 8.33333333%;
-  }
-  .col-md-push-0 {
-    left: auto;
-  }
-  .col-md-offset-12 {
-    margin-left: 100%;
-  }
-  .col-md-offset-11 {
-    margin-left: 91.66666667%;
-  }
-  .col-md-offset-10 {
-    margin-left: 83.33333333%;
-  }
-  .col-md-offset-9 {
-    margin-left: 75%;
-  }
-  .col-md-offset-8 {
-    margin-left: 66.66666667%;
-  }
-  .col-md-offset-7 {
-    margin-left: 58.33333333%;
-  }
-  .col-md-offset-6 {
-    margin-left: 50%;
-  }
-  .col-md-offset-5 {
-    margin-left: 41.66666667%;
-  }
-  .col-md-offset-4 {
-    margin-left: 33.33333333%;
-  }
-  .col-md-offset-3 {
-    margin-left: 25%;
-  }
-  .col-md-offset-2 {
-    margin-left: 16.66666667%;
-  }
-  .col-md-offset-1 {
-    margin-left: 8.33333333%;
-  }
-  .col-md-offset-0 {
-    margin-left: 0;
-  }
-}
-@media (min-width: 1200px) {
-  .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
-    float: left;
-  }
-  .col-lg-12 {
-    width: 100%;
-  }
-  .col-lg-11 {
-    width: 91.66666667%;
-  }
-  .col-lg-10 {
-    width: 83.33333333%;
-  }
-  .col-lg-9 {
-    width: 75%;
-  }
-  .col-lg-8 {
-    width: 66.66666667%;
-  }
-  .col-lg-7 {
-    width: 58.33333333%;
-  }
-  .col-lg-6 {
-    width: 50%;
-  }
-  .col-lg-5 {
-    width: 41.66666667%;
-  }
-  .col-lg-4 {
-    width: 33.33333333%;
-  }
-  .col-lg-3 {
-    width: 25%;
-  }
-  .col-lg-2 {
-    width: 16.66666667%;
-  }
-  .col-lg-1 {
-    width: 8.33333333%;
-  }
-  .col-lg-pull-12 {
-    right: 100%;
-  }
-  .col-lg-pull-11 {
-    right: 91.66666667%;
-  }
-  .col-lg-pull-10 {
-    right: 83.33333333%;
-  }
-  .col-lg-pull-9 {
-    right: 75%;
-  }
-  .col-lg-pull-8 {
-    right: 66.66666667%;
-  }
-  .col-lg-pull-7 {
-    right: 58.33333333%;
-  }
-  .col-lg-pull-6 {
-    right: 50%;
-  }
-  .col-lg-pull-5 {
-    right: 41.66666667%;
-  }
-  .col-lg-pull-4 {
-    right: 33.33333333%;
-  }
-  .col-lg-pull-3 {
-    right: 25%;
-  }
-  .col-lg-pull-2 {
-    right: 16.66666667%;
-  }
-  .col-lg-pull-1 {
-    right: 8.33333333%;
-  }
-  .col-lg-pull-0 {
-    right: auto;
-  }
-  .col-lg-push-12 {
-    left: 100%;
-  }
-  .col-lg-push-11 {
-    left: 91.66666667%;
-  }
-  .col-lg-push-10 {
-    left: 83.33333333%;
-  }
-  .col-lg-push-9 {
-    left: 75%;
-  }
-  .col-lg-push-8 {
-    left: 66.66666667%;
-  }
-  .col-lg-push-7 {
-    left: 58.33333333%;
-  }
-  .col-lg-push-6 {
-    left: 50%;
-  }
-  .col-lg-push-5 {
-    left: 41.66666667%;
-  }
-  .col-lg-push-4 {
-    left: 33.33333333%;
-  }
-  .col-lg-push-3 {
-    left: 25%;
-  }
-  .col-lg-push-2 {
-    left: 16.66666667%;
-  }
-  .col-lg-push-1 {
-    left: 8.33333333%;
-  }
-  .col-lg-push-0 {
-    left: auto;
-  }
-  .col-lg-offset-12 {
-    margin-left: 100%;
-  }
-  .col-lg-offset-11 {
-    margin-left: 91.66666667%;
-  }
-  .col-lg-offset-10 {
-    margin-left: 83.33333333%;
-  }
-  .col-lg-offset-9 {
-    margin-left: 75%;
-  }
-  .col-lg-offset-8 {
-    margin-left: 66.66666667%;
-  }
-  .col-lg-offset-7 {
-    margin-left: 58.33333333%;
-  }
-  .col-lg-offset-6 {
-    margin-left: 50%;
-  }
-  .col-lg-offset-5 {
-    margin-left: 41.66666667%;
-  }
-  .col-lg-offset-4 {
-    margin-left: 33.33333333%;
-  }
-  .col-lg-offset-3 {
-    margin-left: 25%;
-  }
-  .col-lg-offset-2 {
-    margin-left: 16.66666667%;
-  }
-  .col-lg-offset-1 {
-    margin-left: 8.33333333%;
-  }
-  .col-lg-offset-0 {
-    margin-left: 0;
-  }
-}
-table {
-  background-color: transparent;
-}
-caption {
-  padding-top: 8px;
-  padding-bottom: 8px;
-  color: #777;
-  text-align: left;
-}
-th {
-  text-align: left;
-}
-.table {
-  width: 100%;
-  max-width: 100%;
-  margin-bottom: 20px;
-}
-.table > thead > tr > th,
-.table > tbody > tr > th,
-.table > tfoot > tr > th,
-.table > thead > tr > td,
-.table > tbody > tr > td,
-.table > tfoot > tr > td {
-  padding: 8px;
-  line-height: 1.42857143;
-  vertical-align: top;
-  border-top: 1px solid #ddd;
-}
-.table > thead > tr > th {
-  vertical-align: bottom;
-  border-bottom: 2px solid #ddd;
-}
-.table > caption + thead > tr:first-child > th,
-.table > colgroup + thead > tr:first-child > th,
-.table > thead:first-child > tr:first-child > th,
-.table > caption + thead > tr:first-child > td,
-.table > colgroup + thead > tr:first-child > td,
-.table > thead:first-child > tr:first-child > td {
-  border-top: 0;
-}
-.table > tbody + tbody {
-  border-top: 2px solid #ddd;
-}
-.table .table {
-  background-color: #fff;
-}
-.table-condensed > thead > tr > th,
-.table-condensed > tbody > tr > th,
-.table-condensed > tfoot > tr > th,
-.table-condensed > thead > tr > td,
-.table-condensed > tbody > tr > td,
-.table-condensed > tfoot > tr > td {
-  padding: 5px;
-}
-.table-bordered {
-  border: 1px solid #ddd;
-}
-.table-bordered > thead > tr > th,
-.table-bordered > tbody > tr > th,
-.table-bordered > tfoot > tr > th,
-.table-bordered > thead > tr > td,
-.table-bordered > tbody > tr > td,
-.table-bordered > tfoot > tr > td {
-  border: 1px solid #ddd;
-}
-.table-bordered > thead > tr > th,
-.table-bordered > thead > tr > td {
-  border-bottom-width: 2px;
-}
-.table-striped > tbody > tr:nth-of-type(odd) {
-  background-color: #f9f9f9;
-}
-.table-hover > tbody > tr:hover {
-  background-color: #f5f5f5;
-}
-table col[class*="col-"] {
-  position: static;
-  display: table-column;
-  float: none;
-}
-table td[class*="col-"],
-table th[class*="col-"] {
-  position: static;
-  display: table-cell;
-  float: none;
-}
-.table > thead > tr > td.active,
-.table > tbody > tr > td.active,
-.table > tfoot > tr > td.active,
-.table > thead > tr > th.active,
-.table > tbody > tr > th.active,
-.table > tfoot > tr > th.active,
-.table > thead > tr.active > td,
-.table > tbody > tr.active > td,
-.table > tfoot > tr.active > td,
-.table > thead > tr.active > th,
-.table > tbody > tr.active > th,
-.table > tfoot > tr.active > th {
-  background-color: #f5f5f5;
-}
-.table-hover > tbody > tr > td.active:hover,
-.table-hover > tbody > tr > th.active:hover,
-.table-hover > tbody > tr.active:hover > td,
-.table-hover > tbody > tr:hover > .active,
-.table-hover > tbody > tr.active:hover > th {
-  background-color: #e8e8e8;
-}
-.table > thead > tr > td.success,
-.table > tbody > tr > td.success,
-.table > tfoot > tr > td.success,
-.table > thead > tr > th.success,
-.table > tbody > tr > th.success,
-.table > tfoot > tr > th.success,
-.table > thead > tr.success > td,
-.table > tbody > tr.success > td,
-.table > tfoot > tr.success > td,
-.table > thead > tr.success > th,
-.table > tbody > tr.success > th,
-.table > tfoot > tr.success > th {
-  background-color: #dff0d8;
-}
-.table-hover > tbody > tr > td.success:hover,
-.table-hover > tbody > tr > th.success:hover,
-.table-hover > tbody > tr.success:hover > td,
-.table-hover > tbody > tr:hover > .success,
-.table-hover > tbody > tr.success:hover > th {
-  background-color: #d0e9c6;
-}
-.table > thead > tr > td.info,
-.table > tbody > tr > td.info,
-.table > tfoot > tr > td.info,
-.table > thead > tr > th.info,
-.table > tbody > tr > th.info,
-.table > tfoot > tr > th.info,
-.table > thead > tr.info > td,
-.table > tbody > tr.info > td,
-.table > tfoot > tr.info > td,
-.table > thead > tr.info > th,
-.table > tbody > tr.info > th,
-.table > tfoot > tr.info > th {
-  background-color: #d9edf7;
-}
-.table-hover > tbody > tr > td.info:hover,
-.table-hover > tbody > tr > th.info:hover,
-.table-hover > tbody > tr.info:hover > td,
-.table-hover > tbody > tr:hover > .info,
-.table-hover > tbody > tr.info:hover > th {
-  background-color: #c4e3f3;
-}
-.table > thead > tr > td.warning,
-.table > tbody > tr > td.warning,
-.table > tfoot > tr > td.warning,
-.table > thead > tr > th.warning,
-.table > tbody > tr > th.warning,
-.table > tfoot > tr > th.warning,
-.table > thead > tr.warning > td,
-.table > tbody > tr.warning > td,
-.table > tfoot > tr.warning > td,
-.table > thead > tr.warning > th,
-.table > tbody > tr.warning > th,
-.table > tfoot > tr.warning > th {
-  background-color: #fcf8e3;
-}
-.table-hover > tbody > tr > td.warning:hover,
-.table-hover > tbody > tr > th.warning:hover,
-.table-hover > tbody > tr.warning:hover > td,
-.table-hover > tbody > tr:hover > .warning,
-.table-hover > tbody > tr.warning:hover > th {
-  background-color: #faf2cc;
-}
-.table > thead > tr > td.danger,
-.table > tbody > tr > td.danger,
-.table > tfoot > tr > td.danger,
-.table > thead > tr > th.danger,
-.table > tbody > tr > th.danger,
-.table > tfoot > tr > th.danger,
-.table > thead > tr.danger > td,
-.table > tbody > tr.danger > td,
-.table > tfoot > tr.danger > td,
-.table > thead > tr.danger > th,
-.table > tbody > tr.danger > th,
-.table > tfoot > tr.danger > th {
-  background-color: #f2dede;
-}
-.table-hover > tbody > tr > td.danger:hover,
-.table-hover > tbody > tr > th.danger:hover,
-.table-hover > tbody > tr.danger:hover > td,
-.table-hover > tbody > tr:hover > .danger,
-.table-hover > tbody > tr.danger:hover > th {
-  background-color: #ebcccc;
-}
-.table-responsive {
-  min-height: .01%;
-  overflow-x: auto;
-}
-@media screen and (max-width: 767px) {
-  .table-responsive {
-    width: 100%;
-    margin-bottom: 15px;
-    overflow-y: hidden;
-    -ms-overflow-style: -ms-autohiding-scrollbar;
-    border: 1px solid #ddd;
-  }
-  .table-responsive > .table {
-    margin-bottom: 0;
-  }
-  .table-responsive > .table > thead > tr > th,
-  .table-responsive > .table > tbody > tr > th,
-  .table-responsive > .table > tfoot > tr > th,
-  .table-responsive > .table > thead > tr > td,
-  .table-responsive > .table > tbody > tr > td,
-  .table-responsive > .table > tfoot > tr > td {
-    white-space: nowrap;
-  }
-  .table-responsive > .table-bordered {
-    border: 0;
-  }
-  .table-responsive > .table-bordered > thead > tr > th:first-child,
-  .table-responsive > .table-bordered > tbody > tr > th:first-child,
-  .table-responsive > .table-bordered > tfoot > tr > th:first-child,
-  .table-responsive > .table-bordered > thead > tr > td:first-child,
-  .table-responsive > .table-bordered > tbody > tr > td:first-child,
-  .table-responsive > .table-bordered > tfoot > tr > td:first-child {
-    border-left: 0;
-  }
-  .table-responsive > .table-bordered > thead > tr > th:last-child,
-  .table-responsive > .table-bordered > tbody > tr > th:last-child,
-  .table-responsive > .table-bordered > tfoot > tr > th:last-child,
-  .table-responsive > .table-bordered > thead > tr > td:last-child,
-  .table-responsive > .table-bordered > tbody > tr > td:last-child,
-  .table-responsive > .table-bordered > tfoot > tr > td:last-child {
-    border-right: 0;
-  }
-  .table-responsive > .table-bordered > tbody > tr:last-child > th,
-  .table-responsive > .table-bordered > tfoot > tr:last-child > th,
-  .table-responsive > .table-bordered > tbody > tr:last-child > td,
-  .table-responsive > .table-bordered > tfoot > tr:last-child > td {
-    border-bottom: 0;
-  }
-}
-fieldset {
-  min-width: 0;
-  padding: 0;
-  margin: 0;
-  border: 0;
-}
-legend {
-  display: block;
-  width: 100%;
-  padding: 0;
-  margin-bottom: 20px;
-  font-size: 21px;
-  line-height: inherit;
-  color: #333;
-  border: 0;
-  border-bottom: 1px solid #e5e5e5;
-}
-label {
-  display: inline-block;
-  max-width: 100%;
-  margin-bottom: 5px;
-  font-weight: bold;
-}
-input[type="search"] {
-  -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-          box-sizing: border-box;
-}
-input[type="radio"],
-input[type="checkbox"] {
-  margin: 4px 0 0;
-  margin-top: 1px \9;
-  line-height: normal;
-}
-input[type="file"] {
-  display: block;
-}
-input[type="range"] {
-  display: block;
-  width: 100%;
-}
-select[multiple],
-select[size] {
-  height: auto;
-}
-input[type="file"]:focus,
-input[type="radio"]:focus,
-input[type="checkbox"]:focus {
-  outline: thin dotted;
-  outline: 5px auto -webkit-focus-ring-color;
-  outline-offset: -2px;
-}
-output {
-  display: block;
-  padding-top: 7px;
-  font-size: 14px;
-  line-height: 1.42857143;
-  color: #555;
-}
-.form-control {
-  display: block;
-  width: 100%;
-  height: 34px;
-  padding: 6px 12px;
-  font-size: 14px;
-  line-height: 1.42857143;
-  color: #555;
-  background-color: #fff;
-  background-image: none;
-  border: 1px solid #ccc;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-  -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
-       -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-          transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-}
-.form-control:focus {
-  border-color: #66afe9;
-  outline: 0;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
-          box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
-}
-.form-control::-moz-placeholder {
-  color: #999;
-  opacity: 1;
-}
-.form-control:-ms-input-placeholder {
-  color: #999;
-}
-.form-control::-webkit-input-placeholder {
-  color: #999;
-}
-.form-control::-ms-expand {
-  background-color: transparent;
-  border: 0;
-}
-.form-control[disabled],
-.form-control[readonly],
-fieldset[disabled] .form-control {
-  background-color: #eee;
-  opacity: 1;
-}
-.form-control[disabled],
-fieldset[disabled] .form-control {
-  cursor: not-allowed;
-}
-textarea.form-control {
-  height: auto;
-}
-input[type="search"] {
-  -webkit-appearance: none;
-}
-@media screen and (-webkit-min-device-pixel-ratio: 0) {
-  input[type="date"].form-control,
-  input[type="time"].form-control,
-  input[type="datetime-local"].form-control,
-  input[type="month"].form-control {
-    line-height: 34px;
-  }
-  input[type="date"].input-sm,
-  input[type="time"].input-sm,
-  input[type="datetime-local"].input-sm,
-  input[type="month"].input-sm,
-  .input-group-sm input[type="date"],
-  .input-group-sm input[type="time"],
-  .input-group-sm input[type="datetime-local"],
-  .input-group-sm input[type="month"] {
-    line-height: 30px;
-  }
-  input[type="date"].input-lg,
-  input[type="time"].input-lg,
-  input[type="datetime-local"].input-lg,
-  input[type="month"].input-lg,
-  .input-group-lg input[type="date"],
-  .input-group-lg input[type="time"],
-  .input-group-lg input[type="datetime-local"],
-  .input-group-lg input[type="month"] {
-    line-height: 46px;
-  }
-}
-.form-group {
-  margin-bottom: 15px;
-}
-.radio,
-.checkbox {
-  position: relative;
-  display: block;
-  margin-top: 10px;
-  margin-bottom: 10px;
-}
-.radio label,
-.checkbox label {
-  min-height: 20px;
-  padding-left: 20px;
-  margin-bottom: 0;
-  font-weight: normal;
-  cursor: pointer;
-}
-.radio input[type="radio"],
-.radio-inline input[type="radio"],
-.checkbox input[type="checkbox"],
-.checkbox-inline input[type="checkbox"] {
-  position: absolute;
-  margin-top: 4px \9;
-  margin-left: -20px;
-}
-.radio + .radio,
-.checkbox + .checkbox {
-  margin-top: -5px;
-}
-.radio-inline,
-.checkbox-inline {
-  position: relative;
-  display: inline-block;
-  padding-left: 20px;
-  margin-bottom: 0;
-  font-weight: normal;
-  vertical-align: middle;
-  cursor: pointer;
-}
-.radio-inline + .radio-inline,
-.checkbox-inline + .checkbox-inline {
-  margin-top: 0;
-  margin-left: 10px;
-}
-input[type="radio"][disabled],
-input[type="checkbox"][disabled],
-input[type="radio"].disabled,
-input[type="checkbox"].disabled,
-fieldset[disabled] input[type="radio"],
-fieldset[disabled] input[type="checkbox"] {
-  cursor: not-allowed;
-}
-.radio-inline.disabled,
-.checkbox-inline.disabled,
-fieldset[disabled] .radio-inline,
-fieldset[disabled] .checkbox-inline {
-  cursor: not-allowed;
-}
-.radio.disabled label,
-.checkbox.disabled label,
-fieldset[disabled] .radio label,
-fieldset[disabled] .checkbox label {
-  cursor: not-allowed;
-}
-.form-control-static {
-  min-height: 34px;
-  padding-top: 7px;
-  padding-bottom: 7px;
-  margin-bottom: 0;
-}
-.form-control-static.input-lg,
-.form-control-static.input-sm {
-  padding-right: 0;
-  padding-left: 0;
-}
-.input-sm {
-  height: 30px;
-  padding: 5px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-  border-radius: 3px;
-}
-select.input-sm {
-  height: 30px;
-  line-height: 30px;
-}
-textarea.input-sm,
-select[multiple].input-sm {
-  height: auto;
-}
-.form-group-sm .form-control {
-  height: 30px;
-  padding: 5px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-  border-radius: 3px;
-}
-.form-group-sm select.form-control {
-  height: 30px;
-  line-height: 30px;
-}
-.form-group-sm textarea.form-control,
-.form-group-sm select[multiple].form-control {
-  height: auto;
-}
-.form-group-sm .form-control-static {
-  height: 30px;
-  min-height: 32px;
-  padding: 6px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-}
-.input-lg {
-  height: 46px;
-  padding: 10px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-  border-radius: 6px;
-}
-select.input-lg {
-  height: 46px;
-  line-height: 46px;
-}
-textarea.input-lg,
-select[multiple].input-lg {
-  height: auto;
-}
-.form-group-lg .form-control {
-  height: 46px;
-  padding: 10px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-  border-radius: 6px;
-}
-.form-group-lg select.form-control {
-  height: 46px;
-  line-height: 46px;
-}
-.form-group-lg textarea.form-control,
-.form-group-lg select[multiple].form-control {
-  height: auto;
-}
-.form-group-lg .form-control-static {
-  height: 46px;
-  min-height: 38px;
-  padding: 11px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-}
-.has-feedback {
-  position: relative;
-}
-.has-feedback .form-control {
-  padding-right: 42.5px;
-}
-.form-control-feedback {
-  position: absolute;
-  top: 0;
-  right: 0;
-  z-index: 2;
-  display: block;
-  width: 34px;
-  height: 34px;
-  line-height: 34px;
-  text-align: center;
-  pointer-events: none;
-}
-.input-lg + .form-control-feedback,
-.input-group-lg + .form-control-feedback,
-.form-group-lg .form-control + .form-control-feedback {
-  width: 46px;
-  height: 46px;
-  line-height: 46px;
-}
-.input-sm + .form-control-feedback,
-.input-group-sm + .form-control-feedback,
-.form-group-sm .form-control + .form-control-feedback {
-  width: 30px;
-  height: 30px;
-  line-height: 30px;
-}
-.has-success .help-block,
-.has-success .control-label,
-.has-success .radio,
-.has-success .checkbox,
-.has-success .radio-inline,
-.has-success .checkbox-inline,
-.has-success.radio label,
-.has-success.checkbox label,
-.has-success.radio-inline label,
-.has-success.checkbox-inline label {
-  color: #3c763d;
-}
-.has-success .form-control {
-  border-color: #3c763d;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-}
-.has-success .form-control:focus {
-  border-color: #2b542c;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
-}
-.has-success .input-group-addon {
-  color: #3c763d;
-  background-color: #dff0d8;
-  border-color: #3c763d;
-}
-.has-success .form-control-feedback {
-  color: #3c763d;
-}
-.has-warning .help-block,
-.has-warning .control-label,
-.has-warning .radio,
-.has-warning .checkbox,
-.has-warning .radio-inline,
-.has-warning .checkbox-inline,
-.has-warning.radio label,
-.has-warning.checkbox label,
-.has-warning.radio-inline label,
-.has-warning.checkbox-inline label {
-  color: #8a6d3b;
-}
-.has-warning .form-control {
-  border-color: #8a6d3b;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-}
-.has-warning .form-control:focus {
-  border-color: #66512c;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
-}
-.has-warning .input-group-addon {
-  color: #8a6d3b;
-  background-color: #fcf8e3;
-  border-color: #8a6d3b;
-}
-.has-warning .form-control-feedback {
-  color: #8a6d3b;
-}
-.has-error .help-block,
-.has-error .control-label,
-.has-error .radio,
-.has-error .checkbox,
-.has-error .radio-inline,
-.has-error .checkbox-inline,
-.has-error.radio label,
-.has-error.checkbox label,
-.has-error.radio-inline label,
-.has-error.checkbox-inline label {
-  color: #a94442;
-}
-.has-error .form-control {
-  border-color: #a94442;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-}
-.has-error .form-control:focus {
-  border-color: #843534;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
-}
-.has-error .input-group-addon {
-  color: #a94442;
-  background-color: #f2dede;
-  border-color: #a94442;
-}
-.has-error .form-control-feedback {
-  color: #a94442;
-}
-.has-feedback label ~ .form-control-feedback {
-  top: 25px;
-}
-.has-feedback label.sr-only ~ .form-control-feedback {
-  top: 0;
-}
-.help-block {
-  display: block;
-  margin-top: 5px;
-  margin-bottom: 10px;
-  color: #737373;
-}
-@media (min-width: 768px) {
-  .form-inline .form-group {
-    display: inline-block;
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .form-inline .form-control {
-    display: inline-block;
-    width: auto;
-    vertical-align: middle;
-  }
-  .form-inline .form-control-static {
-    display: inline-block;
-  }
-  .form-inline .input-group {
-    display: inline-table;
-    vertical-align: middle;
-  }
-  .form-inline .input-group .input-group-addon,
-  .form-inline .input-group .input-group-btn,
-  .form-inline .input-group .form-control {
-    width: auto;
-  }
-  .form-inline .input-group > .form-control {
-    width: 100%;
-  }
-  .form-inline .control-label {
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .form-inline .radio,
-  .form-inline .checkbox {
-    display: inline-block;
-    margin-top: 0;
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .form-inline .radio label,
-  .form-inline .checkbox label {
-    padding-left: 0;
-  }
-  .form-inline .radio input[type="radio"],
-  .form-inline .checkbox input[type="checkbox"] {
-    position: relative;
-    margin-left: 0;
-  }
-  .form-inline .has-feedback .form-control-feedback {
-    top: 0;
-  }
-}
-.form-horizontal .radio,
-.form-horizontal .checkbox,
-.form-horizontal .radio-inline,
-.form-horizontal .checkbox-inline {
-  padding-top: 7px;
-  margin-top: 0;
-  margin-bottom: 0;
-}
-.form-horizontal .radio,
-.form-horizontal .checkbox {
-  min-height: 27px;
-}
-.form-horizontal .form-group {
-  margin-right: -15px;
-  margin-left: -15px;
-}
-@media (min-width: 768px) {
-  .form-horizontal .control-label {
-    padding-top: 7px;
-    margin-bottom: 0;
-    text-align: right;
-  }
-}
-.form-horizontal .has-feedback .form-control-feedback {
-  right: 15px;
-}
-@media (min-width: 768px) {
-  .form-horizontal .form-group-lg .control-label {
-    padding-top: 11px;
-    font-size: 18px;
-  }
-}
-@media (min-width: 768px) {
-  .form-horizontal .form-group-sm .control-label {
-    padding-top: 6px;
-    font-size: 12px;
-  }
-}
-.btn {
-  display: inline-block;
-  padding: 6px 12px;
-  margin-bottom: 0;
-  font-size: 14px;
-  font-weight: normal;
-  line-height: 1.42857143;
-  text-align: center;
-  white-space: nowrap;
-  vertical-align: middle;
-  -ms-touch-action: manipulation;
-      touch-action: manipulation;
-  cursor: pointer;
-  -webkit-user-select: none;
-     -moz-user-select: none;
-      -ms-user-select: none;
-          user-select: none;
-  background-image: none;
-  border: 1px solid transparent;
-  border-radius: 4px;
-}
-.btn:focus,
-.btn:active:focus,
-.btn.active:focus,
-.btn.focus,
-.btn:active.focus,
-.btn.active.focus {
-  outline: thin dotted;
-  outline: 5px auto -webkit-focus-ring-color;
-  outline-offset: -2px;
-}
-.btn:hover,
-.btn:focus,
-.btn.focus {
-  color: #333;
-  text-decoration: none;
-}
-.btn:active,
-.btn.active {
-  background-image: none;
-  outline: 0;
-  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-          box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-}
-.btn.disabled,
-.btn[disabled],
-fieldset[disabled] .btn {
-  cursor: not-allowed;
-  filter: alpha(opacity=65);
-  -webkit-box-shadow: none;
-          box-shadow: none;
-  opacity: .65;
-}
-a.btn.disabled,
-fieldset[disabled] a.btn {
-  pointer-events: none;
-}
-.btn-default {
-  color: #333;
-  background-color: #fff;
-  border-color: #ccc;
-}
-.btn-default:focus,
-.btn-default.focus {
-  color: #333;
-  background-color: #e6e6e6;
-  border-color: #8c8c8c;
-}
-.btn-default:hover {
-  color: #333;
-  background-color: #e6e6e6;
-  border-color: #adadad;
-}
-.btn-default:active,
-.btn-default.active,
-.open > .dropdown-toggle.btn-default {
-  color: #333;
-  background-color: #e6e6e6;
-  border-color: #adadad;
-}
-.btn-default:active:hover,
-.btn-default.active:hover,
-.open > .dropdown-toggle.btn-default:hover,
-.btn-default:active:focus,
-.btn-default.active:focus,
-.open > .dropdown-toggle.btn-default:focus,
-.btn-default:active.focus,
-.btn-default.active.focus,
-.open > .dropdown-toggle.btn-default.focus {
-  color: #333;
-  background-color: #d4d4d4;
-  border-color: #8c8c8c;
-}
-.btn-default:active,
-.btn-default.active,
-.open > .dropdown-toggle.btn-default {
-  background-image: none;
-}
-.btn-default.disabled:hover,
-.btn-default[disabled]:hover,
-fieldset[disabled] .btn-default:hover,
-.btn-default.disabled:focus,
-.btn-default[disabled]:focus,
-fieldset[disabled] .btn-default:focus,
-.btn-default.disabled.focus,
-.btn-default[disabled].focus,
-fieldset[disabled] .btn-default.focus {
-  background-color: #fff;
-  border-color: #ccc;
-}
-.btn-default .badge {
-  color: #fff;
-  background-color: #333;
-}
-.btn-primary {
-  color: #fff;
-  background-color: #337ab7;
-  border-color: #2e6da4;
-}
-.btn-primary:focus,
-.btn-primary.focus {
-  color: #fff;
-  background-color: #286090;
-  border-color: #122b40;
-}
-.btn-primary:hover {
-  color: #fff;
-  background-color: #286090;
-  border-color: #204d74;
-}
-.btn-primary:active,
-.btn-primary.active,
-.open > .dropdown-toggle.btn-primary {
-  color: #fff;
-  background-color: #286090;
-  border-color: #204d74;
-}
-.btn-primary:active:hover,
-.btn-primary.active:hover,
-.open > .dropdown-toggle.btn-primary:hover,
-.btn-primary:active:focus,
-.btn-primary.active:focus,
-.open > .dropdown-toggle.btn-primary:focus,
-.btn-primary:active.focus,
-.btn-primary.active.focus,
-.open > .dropdown-toggle.btn-primary.focus {
-  color: #fff;
-  background-color: #204d74;
-  border-color: #122b40;
-}
-.btn-primary:active,
-.btn-primary.active,
-.open > .dropdown-toggle.btn-primary {
-  background-image: none;
-}
-.btn-primary.disabled:hover,
-.btn-primary[disabled]:hover,
-fieldset[disabled] .btn-primary:hover,
-.btn-primary.disabled:focus,
-.btn-primary[disabled]:focus,
-fieldset[disabled] .btn-primary:focus,
-.btn-primary.disabled.focus,
-.btn-primary[disabled].focus,
-fieldset[disabled] .btn-primary.focus {
-  background-color: #337ab7;
-  border-color: #2e6da4;
-}
-.btn-primary .badge {
-  color: #337ab7;
-  background-color: #fff;
-}
-.btn-success {
-  color: #fff;
-  background-color: #5cb85c;
-  border-color: #4cae4c;
-}
-.btn-success:focus,
-.btn-success.focus {
-  color: #fff;
-  background-color: #449d44;
-  border-color: #255625;
-}
-.btn-success:hover {
-  color: #fff;
-  background-color: #449d44;
-  border-color: #398439;
-}
-.btn-success:active,
-.btn-success.active,
-.open > .dropdown-toggle.btn-success {
-  color: #fff;
-  background-color: #449d44;
-  border-color: #398439;
-}
-.btn-success:active:hover,
-.btn-success.active:hover,
-.open > .dropdown-toggle.btn-success:hover,
-.btn-success:active:focus,
-.btn-success.active:focus,
-.open > .dropdown-toggle.btn-success:focus,
-.btn-success:active.focus,
-.btn-success.active.focus,
-.open > .dropdown-toggle.btn-success.focus {
-  color: #fff;
-  background-color: #398439;
-  border-color: #255625;
-}
-.btn-success:active,
-.btn-success.active,
-.open > .dropdown-toggle.btn-success {
-  background-image: none;
-}
-.btn-success.disabled:hover,
-.btn-success[disabled]:hover,
-fieldset[disabled] .btn-success:hover,
-.btn-success.disabled:focus,
-.btn-success[disabled]:focus,
-fieldset[disabled] .btn-success:focus,
-.btn-success.disabled.focus,
-.btn-success[disabled].focus,
-fieldset[disabled] .btn-success.focus {
-  background-color: #5cb85c;
-  border-color: #4cae4c;
-}
-.btn-success .badge {
-  color: #5cb85c;
-  background-color: #fff;
-}
-.btn-info {
-  color: #fff;
-  background-color: #5bc0de;
-  border-color: #46b8da;
-}
-.btn-info:focus,
-.btn-info.focus {
-  color: #fff;
-  background-color: #31b0d5;
-  border-color: #1b6d85;
-}
-.btn-info:hover {
-  color: #fff;
-  background-color: #31b0d5;
-  border-color: #269abc;
-}
-.btn-info:active,
-.btn-info.active,
-.open > .dropdown-toggle.btn-info {
-  color: #fff;
-  background-color: #31b0d5;
-  border-color: #269abc;
-}
-.btn-info:active:hover,
-.btn-info.active:hover,
-.open > .dropdown-toggle.btn-info:hover,
-.btn-info:active:focus,
-.btn-info.active:focus,
-.open > .dropdown-toggle.btn-info:focus,
-.btn-info:active.focus,
-.btn-info.active.focus,
-.open > .dropdown-toggle.btn-info.focus {
-  color: #fff;
-  background-color: #269abc;
-  border-color: #1b6d85;
-}
-.btn-info:active,
-.btn-info.active,
-.open > .dropdown-toggle.btn-info {
-  background-image: none;
-}
-.btn-info.disabled:hover,
-.btn-info[disabled]:hover,
-fieldset[disabled] .btn-info:hover,
-.btn-info.disabled:focus,
-.btn-info[disabled]:focus,
-fieldset[disabled] .btn-info:focus,
-.btn-info.disabled.focus,
-.btn-info[disabled].focus,
-fieldset[disabled] .btn-info.focus {
-  background-color: #5bc0de;
-  border-color: #46b8da;
-}
-.btn-info .badge {
-  color: #5bc0de;
-  background-color: #fff;
-}
-.btn-warning {
-  color: #fff;
-  background-color: #f0ad4e;
-  border-color: #eea236;
-}
-.btn-warning:focus,
-.btn-warning.focus {
-  color: #fff;
-  background-color: #ec971f;
-  border-color: #985f0d;
-}
-.btn-warning:hover {
-  color: #fff;
-  background-color: #ec971f;
-  border-color: #d58512;
-}
-.btn-warning:active,
-.btn-warning.active,
-.open > .dropdown-toggle.btn-warning {
-  color: #fff;
-  background-color: #ec971f;
-  border-color: #d58512;
-}
-.btn-warning:active:hover,
-.btn-warning.active:hover,
-.open > .dropdown-toggle.btn-warning:hover,
-.btn-warning:active:focus,
-.btn-warning.active:focus,
-.open > .dropdown-toggle.btn-warning:focus,
-.btn-warning:active.focus,
-.btn-warning.active.focus,
-.open > .dropdown-toggle.btn-warning.focus {
-  color: #fff;
-  background-color: #d58512;
-  border-color: #985f0d;
-}
-.btn-warning:active,
-.btn-warning.active,
-.open > .dropdown-toggle.btn-warning {
-  background-image: none;
-}
-.btn-warning.disabled:hover,
-.btn-warning[disabled]:hover,
-fieldset[disabled] .btn-warning:hover,
-.btn-warning.disabled:focus,
-.btn-warning[disabled]:focus,
-fieldset[disabled] .btn-warning:focus,
-.btn-warning.disabled.focus,
-.btn-warning[disabled].focus,
-fieldset[disabled] .btn-warning.focus {
-  background-color: #f0ad4e;
-  border-color: #eea236;
-}
-.btn-warning .badge {
-  color: #f0ad4e;
-  background-color: #fff;
-}
-.btn-danger {
-  color: #fff;
-  background-color: #d9534f;
-  border-color: #d43f3a;
-}
-.btn-danger:focus,
-.btn-danger.focus {
-  color: #fff;
-  background-color: #c9302c;
-  border-color: #761c19;
-}
-.btn-danger:hover {
-  color: #fff;
-  background-color: #c9302c;
-  border-color: #ac2925;
-}
-.btn-danger:active,
-.btn-danger.active,
-.open > .dropdown-toggle.btn-danger {
-  color: #fff;
-  background-color: #c9302c;
-  border-color: #ac2925;
-}
-.btn-danger:active:hover,
-.btn-danger.active:hover,
-.open > .dropdown-toggle.btn-danger:hover,
-.btn-danger:active:focus,
-.btn-danger.active:focus,
-.open > .dropdown-toggle.btn-danger:focus,
-.btn-danger:active.focus,
-.btn-danger.active.focus,
-.open > .dropdown-toggle.btn-danger.focus {
-  color: #fff;
-  background-color: #ac2925;
-  border-color: #761c19;
-}
-.btn-danger:active,
-.btn-danger.active,
-.open > .dropdown-toggle.btn-danger {
-  background-image: none;
-}
-.btn-danger.disabled:hover,
-.btn-danger[disabled]:hover,
-fieldset[disabled] .btn-danger:hover,
-.btn-danger.disabled:focus,
-.btn-danger[disabled]:focus,
-fieldset[disabled] .btn-danger:focus,
-.btn-danger.disabled.focus,
-.btn-danger[disabled].focus,
-fieldset[disabled] .btn-danger.focus {
-  background-color: #d9534f;
-  border-color: #d43f3a;
-}
-.btn-danger .badge {
-  color: #d9534f;
-  background-color: #fff;
-}
-.btn-link {
-  font-weight: normal;
-  color: #337ab7;
-  border-radius: 0;
-}
-.btn-link,
-.btn-link:active,
-.btn-link.active,
-.btn-link[disabled],
-fieldset[disabled] .btn-link {
-  background-color: transparent;
-  -webkit-box-shadow: none;
-          box-shadow: none;
-}
-.btn-link,
-.btn-link:hover,
-.btn-link:focus,
-.btn-link:active {
-  border-color: transparent;
-}
-.btn-link:hover,
-.btn-link:focus {
-  color: #23527c;
-  text-decoration: underline;
-  background-color: transparent;
-}
-.btn-link[disabled]:hover,
-fieldset[disabled] .btn-link:hover,
-.btn-link[disabled]:focus,
-fieldset[disabled] .btn-link:focus {
-  color: #777;
-  text-decoration: none;
-}
-.btn-lg,
-.btn-group-lg > .btn {
-  padding: 10px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-  border-radius: 6px;
-}
-.btn-sm,
-.btn-group-sm > .btn {
-  padding: 5px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-  border-radius: 3px;
-}
-.btn-xs,
-.btn-group-xs > .btn {
-  padding: 1px 5px;
-  font-size: 12px;
-  line-height: 1.5;
-  border-radius: 3px;
-}
-.btn-block {
-  display: block;
-  width: 100%;
-}
-.btn-block + .btn-block {
-  margin-top: 5px;
-}
-input[type="submit"].btn-block,
-input[type="reset"].btn-block,
-input[type="button"].btn-block {
-  width: 100%;
-}
-.fade {
-  opacity: 0;
-  -webkit-transition: opacity .15s linear;
-       -o-transition: opacity .15s linear;
-          transition: opacity .15s linear;
-}
-.fade.in {
-  opacity: 1;
-}
-.collapse {
-  display: none;
-}
-.collapse.in {
-  display: block;
-}
-tr.collapse.in {
-  display: table-row;
-}
-tbody.collapse.in {
-  display: table-row-group;
-}
-.collapsing {
-  position: relative;
-  height: 0;
-  overflow: hidden;
-  -webkit-transition-timing-function: ease;
-       -o-transition-timing-function: ease;
-          transition-timing-function: ease;
-  -webkit-transition-duration: .35s;
-       -o-transition-duration: .35s;
-          transition-duration: .35s;
-  -webkit-transition-property: height, visibility;
-       -o-transition-property: height, visibility;
-          transition-property: height, visibility;
-}
-.caret {
-  display: inline-block;
-  width: 0;
-  height: 0;
-  margin-left: 2px;
-  vertical-align: middle;
-  border-top: 4px dashed;
-  border-top: 4px solid \9;
-  border-right: 4px solid transparent;
-  border-left: 4px solid transparent;
-}
-.dropup,
-.dropdown {
-  position: relative;
-}
-.dropdown-toggle:focus {
-  outline: 0;
-}
-.dropdown-menu {
-  position: absolute;
-  top: 100%;
-  left: 0;
-  z-index: 1000;
-  display: none;
-  float: left;
-  min-width: 160px;
-  padding: 5px 0;
-  margin: 2px 0 0;
-  font-size: 14px;
-  text-align: left;
-  list-style: none;
-  background-color: #fff;
-  -webkit-background-clip: padding-box;
-          background-clip: padding-box;
-  border: 1px solid #ccc;
-  border: 1px solid rgba(0, 0, 0, .15);
-  border-radius: 4px;
-  -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
-          box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
-}
-.dropdown-menu.pull-right {
-  right: 0;
-  left: auto;
-}
-.dropdown-menu .divider {
-  height: 1px;
-  margin: 9px 0;
-  overflow: hidden;
-  background-color: #e5e5e5;
-}
-.dropdown-menu > li > a {
-  display: block;
-  padding: 3px 20px;
-  clear: both;
-  font-weight: normal;
-  line-height: 1.42857143;
-  color: #333;
-  white-space: nowrap;
-}
-.dropdown-menu > li > a:hover,
-.dropdown-menu > li > a:focus {
-  color: #262626;
-  text-decoration: none;
-  background-color: #f5f5f5;
-}
-.dropdown-menu > .active > a,
-.dropdown-menu > .active > a:hover,
-.dropdown-menu > .active > a:focus {
-  color: #fff;
-  text-decoration: none;
-  background-color: #337ab7;
-  outline: 0;
-}
-.dropdown-menu > .disabled > a,
-.dropdown-menu > .disabled > a:hover,
-.dropdown-menu > .disabled > a:focus {
-  color: #777;
-}
-.dropdown-menu > .disabled > a:hover,
-.dropdown-menu > .disabled > a:focus {
-  text-decoration: none;
-  cursor: not-allowed;
-  background-color: transparent;
-  background-image: none;
-  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-}
-.open > .dropdown-menu {
-  display: block;
-}
-.open > a {
-  outline: 0;
-}
-.dropdown-menu-right {
-  right: 0;
-  left: auto;
-}
-.dropdown-menu-left {
-  right: auto;
-  left: 0;
-}
-.dropdown-header {
-  display: block;
-  padding: 3px 20px;
-  font-size: 12px;
-  line-height: 1.42857143;
-  color: #777;
-  white-space: nowrap;
-}
-.dropdown-backdrop {
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  z-index: 990;
-}
-.pull-right > .dropdown-menu {
-  right: 0;
-  left: auto;
-}
-.dropup .caret,
-.navbar-fixed-bottom .dropdown .caret {
-  content: "";
-  border-top: 0;
-  border-bottom: 4px dashed;
-  border-bottom: 4px solid \9;
-}
-.dropup .dropdown-menu,
-.navbar-fixed-bottom .dropdown .dropdown-menu {
-  top: auto;
-  bottom: 100%;
-  margin-bottom: 2px;
-}
-@media (min-width: 768px) {
-  .navbar-right .dropdown-menu {
-    right: 0;
-    left: auto;
-  }
-  .navbar-right .dropdown-menu-left {
-    right: auto;
-    left: 0;
-  }
-}
-.btn-group,
-.btn-group-vertical {
-  position: relative;
-  display: inline-block;
-  vertical-align: middle;
-}
-.btn-group > .btn,
-.btn-group-vertical > .btn {
-  position: relative;
-  float: left;
-}
-.btn-group > .btn:hover,
-.btn-group-vertical > .btn:hover,
-.btn-group > .btn:focus,
-.btn-group-vertical > .btn:focus,
-.btn-group > .btn:active,
-.btn-group-vertical > .btn:active,
-.btn-group > .btn.active,
-.btn-group-vertical > .btn.active {
-  z-index: 2;
-}
-.btn-group .btn + .btn,
-.btn-group .btn + .btn-group,
-.btn-group .btn-group + .btn,
-.btn-group .btn-group + .btn-group {
-  margin-left: -1px;
-}
-.btn-toolbar {
-  margin-left: -5px;
-}
-.btn-toolbar .btn,
-.btn-toolbar .btn-group,
-.btn-toolbar .input-group {
-  float: left;
-}
-.btn-toolbar > .btn,
-.btn-toolbar > .btn-group,
-.btn-toolbar > .input-group {
-  margin-left: 5px;
-}
-.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
-  border-radius: 0;
-}
-.btn-group > .btn:first-child {
-  margin-left: 0;
-}
-.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 0;
-}
-.btn-group > .btn:last-child:not(:first-child),
-.btn-group > .dropdown-toggle:not(:first-child) {
-  border-top-left-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.btn-group > .btn-group {
-  float: left;
-}
-.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
-  border-radius: 0;
-}
-.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
-.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 0;
-}
-.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
-  border-top-left-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.btn-group .dropdown-toggle:active,
-.btn-group.open .dropdown-toggle {
-  outline: 0;
-}
-.btn-group > .btn + .dropdown-toggle {
-  padding-right: 8px;
-  padding-left: 8px;
-}
-.btn-group > .btn-lg + .dropdown-toggle {
-  padding-right: 12px;
-  padding-left: 12px;
-}
-.btn-group.open .dropdown-toggle {
-  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-          box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
-}
-.btn-group.open .dropdown-toggle.btn-link {
-  -webkit-box-shadow: none;
-          box-shadow: none;
-}
-.btn .caret {
-  margin-left: 0;
-}
-.btn-lg .caret {
-  border-width: 5px 5px 0;
-  border-bottom-width: 0;
-}
-.dropup .btn-lg .caret {
-  border-width: 0 5px 5px;
-}
-.btn-group-vertical > .btn,
-.btn-group-vertical > .btn-group,
-.btn-group-vertical > .btn-group > .btn {
-  display: block;
-  float: none;
-  width: 100%;
-  max-width: 100%;
-}
-.btn-group-vertical > .btn-group > .btn {
-  float: none;
-}
-.btn-group-vertical > .btn + .btn,
-.btn-group-vertical > .btn + .btn-group,
-.btn-group-vertical > .btn-group + .btn,
-.btn-group-vertical > .btn-group + .btn-group {
-  margin-top: -1px;
-  margin-left: 0;
-}
-.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
-  border-radius: 0;
-}
-.btn-group-vertical > .btn:first-child:not(:last-child) {
-  border-top-left-radius: 4px;
-  border-top-right-radius: 4px;
-  border-bottom-right-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.btn-group-vertical > .btn:last-child:not(:first-child) {
-  border-top-left-radius: 0;
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 4px;
-  border-bottom-left-radius: 4px;
-}
-.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
-  border-radius: 0;
-}
-.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
-.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
-  border-bottom-right-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
-  border-top-left-radius: 0;
-  border-top-right-radius: 0;
-}
-.btn-group-justified {
-  display: table;
-  width: 100%;
-  table-layout: fixed;
-  border-collapse: separate;
-}
-.btn-group-justified > .btn,
-.btn-group-justified > .btn-group {
-  display: table-cell;
-  float: none;
-  width: 1%;
-}
-.btn-group-justified > .btn-group .btn {
-  width: 100%;
-}
-.btn-group-justified > .btn-group .dropdown-menu {
-  left: auto;
-}
-[data-toggle="buttons"] > .btn input[type="radio"],
-[data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
-[data-toggle="buttons"] > .btn input[type="checkbox"],
-[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
-  position: absolute;
-  clip: rect(0, 0, 0, 0);
-  pointer-events: none;
-}
-.input-group {
-  position: relative;
-  display: table;
-  border-collapse: separate;
-}
-.input-group[class*="col-"] {
-  float: none;
-  padding-right: 0;
-  padding-left: 0;
-}
-.input-group .form-control {
-  position: relative;
-  z-index: 2;
-  float: left;
-  width: 100%;
-  margin-bottom: 0;
-}
-.input-group .form-control:focus {
-  z-index: 3;
-}
-.input-group-lg > .form-control,
-.input-group-lg > .input-group-addon,
-.input-group-lg > .input-group-btn > .btn {
-  height: 46px;
-  padding: 10px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-  border-radius: 6px;
-}
-select.input-group-lg > .form-control,
-select.input-group-lg > .input-group-addon,
-select.input-group-lg > .input-group-btn > .btn {
-  height: 46px;
-  line-height: 46px;
-}
-textarea.input-group-lg > .form-control,
-textarea.input-group-lg > .input-group-addon,
-textarea.input-group-lg > .input-group-btn > .btn,
-select[multiple].input-group-lg > .form-control,
-select[multiple].input-group-lg > .input-group-addon,
-select[multiple].input-group-lg > .input-group-btn > .btn {
-  height: auto;
-}
-.input-group-sm > .form-control,
-.input-group-sm > .input-group-addon,
-.input-group-sm > .input-group-btn > .btn {
-  height: 30px;
-  padding: 5px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-  border-radius: 3px;
-}
-select.input-group-sm > .form-control,
-select.input-group-sm > .input-group-addon,
-select.input-group-sm > .input-group-btn > .btn {
-  height: 30px;
-  line-height: 30px;
-}
-textarea.input-group-sm > .form-control,
-textarea.input-group-sm > .input-group-addon,
-textarea.input-group-sm > .input-group-btn > .btn,
-select[multiple].input-group-sm > .form-control,
-select[multiple].input-group-sm > .input-group-addon,
-select[multiple].input-group-sm > .input-group-btn > .btn {
-  height: auto;
-}
-.input-group-addon,
-.input-group-btn,
-.input-group .form-control {
-  display: table-cell;
-}
-.input-group-addon:not(:first-child):not(:last-child),
-.input-group-btn:not(:first-child):not(:last-child),
-.input-group .form-control:not(:first-child):not(:last-child) {
-  border-radius: 0;
-}
-.input-group-addon,
-.input-group-btn {
-  width: 1%;
-  white-space: nowrap;
-  vertical-align: middle;
-}
-.input-group-addon {
-  padding: 6px 12px;
-  font-size: 14px;
-  font-weight: normal;
-  line-height: 1;
-  color: #555;
-  text-align: center;
-  background-color: #eee;
-  border: 1px solid #ccc;
-  border-radius: 4px;
-}
-.input-group-addon.input-sm {
-  padding: 5px 10px;
-  font-size: 12px;
-  border-radius: 3px;
-}
-.input-group-addon.input-lg {
-  padding: 10px 16px;
-  font-size: 18px;
-  border-radius: 6px;
-}
-.input-group-addon input[type="radio"],
-.input-group-addon input[type="checkbox"] {
-  margin-top: 0;
-}
-.input-group .form-control:first-child,
-.input-group-addon:first-child,
-.input-group-btn:first-child > .btn,
-.input-group-btn:first-child > .btn-group > .btn,
-.input-group-btn:first-child > .dropdown-toggle,
-.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
-.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 0;
-}
-.input-group-addon:first-child {
-  border-right: 0;
-}
-.input-group .form-control:last-child,
-.input-group-addon:last-child,
-.input-group-btn:last-child > .btn,
-.input-group-btn:last-child > .btn-group > .btn,
-.input-group-btn:last-child > .dropdown-toggle,
-.input-group-btn:first-child > .btn:not(:first-child),
-.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
-  border-top-left-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.input-group-addon:last-child {
-  border-left: 0;
-}
-.input-group-btn {
-  position: relative;
-  font-size: 0;
-  white-space: nowrap;
-}
-.input-group-btn > .btn {
-  position: relative;
-}
-.input-group-btn > .btn + .btn {
-  margin-left: -1px;
-}
-.input-group-btn > .btn:hover,
-.input-group-btn > .btn:focus,
-.input-group-btn > .btn:active {
-  z-index: 2;
-}
-.input-group-btn:first-child > .btn,
-.input-group-btn:first-child > .btn-group {
-  margin-right: -1px;
-}
-.input-group-btn:last-child > .btn,
-.input-group-btn:last-child > .btn-group {
-  z-index: 2;
-  margin-left: -1px;
-}
-.nav {
-  padding-left: 0;
-  margin-bottom: 0;
-  list-style: none;
-}
-.nav > li {
-  position: relative;
-  display: block;
-}
-.nav > li > a {
-  position: relative;
-  display: block;
-  padding: 10px 15px;
-}
-.nav > li > a:hover,
-.nav > li > a:focus {
-  text-decoration: none;
-  background-color: #eee;
-}
-.nav > li.disabled > a {
-  color: #777;
-}
-.nav > li.disabled > a:hover,
-.nav > li.disabled > a:focus {
-  color: #777;
-  text-decoration: none;
-  cursor: not-allowed;
-  background-color: transparent;
-}
-.nav .open > a,
-.nav .open > a:hover,
-.nav .open > a:focus {
-  background-color: #eee;
-  border-color: #337ab7;
-}
-.nav .nav-divider {
-  height: 1px;
-  margin: 9px 0;
-  overflow: hidden;
-  background-color: #e5e5e5;
-}
-.nav > li > a > img {
-  max-width: none;
-}
-.nav-tabs {
-  border-bottom: 1px solid #ddd;
-}
-.nav-tabs > li {
-  float: left;
-  margin-bottom: -1px;
-}
-.nav-tabs > li > a {
-  margin-right: 2px;
-  line-height: 1.42857143;
-  border: 1px solid transparent;
-  border-radius: 4px 4px 0 0;
-}
-.nav-tabs > li > a:hover {
-  border-color: #eee #eee #ddd;
-}
-.nav-tabs > li.active > a,
-.nav-tabs > li.active > a:hover,
-.nav-tabs > li.active > a:focus {
-  color: #555;
-  cursor: default;
-  background-color: #fff;
-  border: 1px solid #ddd;
-  border-bottom-color: transparent;
-}
-.nav-tabs.nav-justified {
-  width: 100%;
-  border-bottom: 0;
-}
-.nav-tabs.nav-justified > li {
-  float: none;
-}
-.nav-tabs.nav-justified > li > a {
-  margin-bottom: 5px;
-  text-align: center;
-}
-.nav-tabs.nav-justified > .dropdown .dropdown-menu {
-  top: auto;
-  left: auto;
-}
-@media (min-width: 768px) {
-  .nav-tabs.nav-justified > li {
-    display: table-cell;
-    width: 1%;
-  }
-  .nav-tabs.nav-justified > li > a {
-    margin-bottom: 0;
-  }
-}
-.nav-tabs.nav-justified > li > a {
-  margin-right: 0;
-  border-radius: 4px;
-}
-.nav-tabs.nav-justified > .active > a,
-.nav-tabs.nav-justified > .active > a:hover,
-.nav-tabs.nav-justified > .active > a:focus {
-  border: 1px solid #ddd;
-}
-@media (min-width: 768px) {
-  .nav-tabs.nav-justified > li > a {
-    border-bottom: 1px solid #ddd;
-    border-radius: 4px 4px 0 0;
-  }
-  .nav-tabs.nav-justified > .active > a,
-  .nav-tabs.nav-justified > .active > a:hover,
-  .nav-tabs.nav-justified > .active > a:focus {
-    border-bottom-color: #fff;
-  }
-}
-.nav-pills > li {
-  float: left;
-}
-.nav-pills > li > a {
-  border-radius: 4px;
-}
-.nav-pills > li + li {
-  margin-left: 2px;
-}
-.nav-pills > li.active > a,
-.nav-pills > li.active > a:hover,
-.nav-pills > li.active > a:focus {
-  color: #fff;
-  background-color: #337ab7;
-}
-.nav-stacked > li {
-  float: none;
-}
-.nav-stacked > li + li {
-  margin-top: 2px;
-  margin-left: 0;
-}
-.nav-justified {
-  width: 100%;
-}
-.nav-justified > li {
-  float: none;
-}
-.nav-justified > li > a {
-  margin-bottom: 5px;
-  text-align: center;
-}
-.nav-justified > .dropdown .dropdown-menu {
-  top: auto;
-  left: auto;
-}
-@media (min-width: 768px) {
-  .nav-justified > li {
-    display: table-cell;
-    width: 1%;
-  }
-  .nav-justified > li > a {
-    margin-bottom: 0;
-  }
-}
-.nav-tabs-justified {
-  border-bottom: 0;
-}
-.nav-tabs-justified > li > a {
-  margin-right: 0;
-  border-radius: 4px;
-}
-.nav-tabs-justified > .active > a,
-.nav-tabs-justified > .active > a:hover,
-.nav-tabs-justified > .active > a:focus {
-  border: 1px solid #ddd;
-}
-@media (min-width: 768px) {
-  .nav-tabs-justified > li > a {
-    border-bottom: 1px solid #ddd;
-    border-radius: 4px 4px 0 0;
-  }
-  .nav-tabs-justified > .active > a,
-  .nav-tabs-justified > .active > a:hover,
-  .nav-tabs-justified > .active > a:focus {
-    border-bottom-color: #fff;
-  }
-}
-.tab-content > .tab-pane {
-  display: none;
-}
-.tab-content > .active {
-  display: block;
-}
-.nav-tabs .dropdown-menu {
-  margin-top: -1px;
-  border-top-left-radius: 0;
-  border-top-right-radius: 0;
-}
-.navbar {
-  position: relative;
-  min-height: 50px;
-  margin-bottom: 20px;
-  border: 1px solid transparent;
-}
-@media (min-width: 768px) {
-  .navbar {
-    border-radius: 4px;
-  }
-}
-@media (min-width: 768px) {
-  .navbar-header {
-    float: left;
-  }
-}
-.navbar-collapse {
-  padding-right: 15px;
-  padding-left: 15px;
-  overflow-x: visible;
-  -webkit-overflow-scrolling: touch;
-  border-top: 1px solid transparent;
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
-}
-.navbar-collapse.in {
-  overflow-y: auto;
-}
-@media (min-width: 768px) {
-  .navbar-collapse {
-    width: auto;
-    border-top: 0;
-    -webkit-box-shadow: none;
-            box-shadow: none;
-  }
-  .navbar-collapse.collapse {
-    display: block !important;
-    height: auto !important;
-    padding-bottom: 0;
-    overflow: visible !important;
-  }
-  .navbar-collapse.in {
-    overflow-y: visible;
-  }
-  .navbar-fixed-top .navbar-collapse,
-  .navbar-static-top .navbar-collapse,
-  .navbar-fixed-bottom .navbar-collapse {
-    padding-right: 0;
-    padding-left: 0;
-  }
-}
-.navbar-fixed-top .navbar-collapse,
-.navbar-fixed-bottom .navbar-collapse {
-  max-height: 340px;
-}
-@media (max-device-width: 480px) and (orientation: landscape) {
-  .navbar-fixed-top .navbar-collapse,
-  .navbar-fixed-bottom .navbar-collapse {
-    max-height: 200px;
-  }
-}
-.container > .navbar-header,
-.container-fluid > .navbar-header,
-.container > .navbar-collapse,
-.container-fluid > .navbar-collapse {
-  margin-right: -15px;
-  margin-left: -15px;
-}
-@media (min-width: 768px) {
-  .container > .navbar-header,
-  .container-fluid > .navbar-header,
-  .container > .navbar-collapse,
-  .container-fluid > .navbar-collapse {
-    margin-right: 0;
-    margin-left: 0;
-  }
-}
-.navbar-static-top {
-  z-index: 1000;
-  border-width: 0 0 1px;
-}
-@media (min-width: 768px) {
-  .navbar-static-top {
-    border-radius: 0;
-  }
-}
-.navbar-fixed-top,
-.navbar-fixed-bottom {
-  position: fixed;
-  right: 0;
-  left: 0;
-  z-index: 1030;
-}
-@media (min-width: 768px) {
-  .navbar-fixed-top,
-  .navbar-fixed-bottom {
-    border-radius: 0;
-  }
-}
-.navbar-fixed-top {
-  top: 0;
-  border-width: 0 0 1px;
-}
-.navbar-fixed-bottom {
-  bottom: 0;
-  margin-bottom: 0;
-  border-width: 1px 0 0;
-}
-.navbar-brand {
-  float: left;
-  height: 50px;
-  padding: 15px 15px;
-  font-size: 18px;
-  line-height: 20px;
-}
-.navbar-brand:hover,
-.navbar-brand:focus {
-  text-decoration: none;
-}
-.navbar-brand > img {
-  display: block;
-}
-@media (min-width: 768px) {
-  .navbar > .container .navbar-brand,
-  .navbar > .container-fluid .navbar-brand {
-    margin-left: -15px;
-  }
-}
-.navbar-toggle {
-  position: relative;
-  float: right;
-  padding: 9px 10px;
-  margin-top: 8px;
-  margin-right: 15px;
-  margin-bottom: 8px;
-  background-color: transparent;
-  background-image: none;
-  border: 1px solid transparent;
-  border-radius: 4px;
-}
-.navbar-toggle:focus {
-  outline: 0;
-}
-.navbar-toggle .icon-bar {
-  display: block;
-  width: 22px;
-  height: 2px;
-  border-radius: 1px;
-}
-.navbar-toggle .icon-bar + .icon-bar {
-  margin-top: 4px;
-}
-@media (min-width: 768px) {
-  .navbar-toggle {
-    display: none;
-  }
-}
-.navbar-nav {
-  margin: 7.5px -15px;
-}
-.navbar-nav > li > a {
-  padding-top: 10px;
-  padding-bottom: 10px;
-  line-height: 20px;
-}
-@media (max-width: 767px) {
-  .navbar-nav .open .dropdown-menu {
-    position: static;
-    float: none;
-    width: auto;
-    margin-top: 0;
-    background-color: transparent;
-    border: 0;
-    -webkit-box-shadow: none;
-            box-shadow: none;
-  }
-  .navbar-nav .open .dropdown-menu > li > a,
-  .navbar-nav .open .dropdown-menu .dropdown-header {
-    padding: 5px 15px 5px 25px;
-  }
-  .navbar-nav .open .dropdown-menu > li > a {
-    line-height: 20px;
-  }
-  .navbar-nav .open .dropdown-menu > li > a:hover,
-  .navbar-nav .open .dropdown-menu > li > a:focus {
-    background-image: none;
-  }
-}
-@media (min-width: 768px) {
-  .navbar-nav {
-    float: left;
-    margin: 0;
-  }
-  .navbar-nav > li {
-    float: left;
-  }
-  .navbar-nav > li > a {
-    padding-top: 15px;
-    padding-bottom: 15px;
-  }
-}
-.navbar-form {
-  padding: 10px 15px;
-  margin-top: 8px;
-  margin-right: -15px;
-  margin-bottom: 8px;
-  margin-left: -15px;
-  border-top: 1px solid transparent;
-  border-bottom: 1px solid transparent;
-  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
-}
-@media (min-width: 768px) {
-  .navbar-form .form-group {
-    display: inline-block;
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .navbar-form .form-control {
-    display: inline-block;
-    width: auto;
-    vertical-align: middle;
-  }
-  .navbar-form .form-control-static {
-    display: inline-block;
-  }
-  .navbar-form .input-group {
-    display: inline-table;
-    vertical-align: middle;
-  }
-  .navbar-form .input-group .input-group-addon,
-  .navbar-form .input-group .input-group-btn,
-  .navbar-form .input-group .form-control {
-    width: auto;
-  }
-  .navbar-form .input-group > .form-control {
-    width: 100%;
-  }
-  .navbar-form .control-label {
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .navbar-form .radio,
-  .navbar-form .checkbox {
-    display: inline-block;
-    margin-top: 0;
-    margin-bottom: 0;
-    vertical-align: middle;
-  }
-  .navbar-form .radio label,
-  .navbar-form .checkbox label {
-    padding-left: 0;
-  }
-  .navbar-form .radio input[type="radio"],
-  .navbar-form .checkbox input[type="checkbox"] {
-    position: relative;
-    margin-left: 0;
-  }
-  .navbar-form .has-feedback .form-control-feedback {
-    top: 0;
-  }
-}
-@media (max-width: 767px) {
-  .navbar-form .form-group {
-    margin-bottom: 5px;
-  }
-  .navbar-form .form-group:last-child {
-    margin-bottom: 0;
-  }
-}
-@media (min-width: 768px) {
-  .navbar-form {
-    width: auto;
-    padding-top: 0;
-    padding-bottom: 0;
-    margin-right: 0;
-    margin-left: 0;
-    border: 0;
-    -webkit-box-shadow: none;
-            box-shadow: none;
-  }
-}
-.navbar-nav > li > .dropdown-menu {
-  margin-top: 0;
-  border-top-left-radius: 0;
-  border-top-right-radius: 0;
-}
-.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
-  margin-bottom: 0;
-  border-top-left-radius: 4px;
-  border-top-right-radius: 4px;
-  border-bottom-right-radius: 0;
-  border-bottom-left-radius: 0;
-}
-.navbar-btn {
-  margin-top: 8px;
-  margin-bottom: 8px;
-}
-.navbar-btn.btn-sm {
-  margin-top: 10px;
-  margin-bottom: 10px;
-}
-.navbar-btn.btn-xs {
-  margin-top: 14px;
-  margin-bottom: 14px;
-}
-.navbar-text {
-  margin-top: 15px;
-  margin-bottom: 15px;
-}
-@media (min-width: 768px) {
-  .navbar-text {
-    float: left;
-    margin-right: 15px;
-    margin-left: 15px;
-  }
-}
-@media (min-width: 768px) {
-  .navbar-left {
-    float: left !important;
-  }
-  .navbar-right {
-    float: right !important;
-    margin-right: -15px;
-  }
-  .navbar-right ~ .navbar-right {
-    margin-right: 0;
-  }
-}
-.navbar-default {
-  background-color: #f8f8f8;
-  border-color: #e7e7e7;
-}
-.navbar-default .navbar-brand {
-  color: #777;
-}
-.navbar-default .navbar-brand:hover,
-.navbar-default .navbar-brand:focus {
-  color: #5e5e5e;
-  background-color: transparent;
-}
-.navbar-default .navbar-text {
-  color: #777;
-}
-.navbar-default .navbar-nav > li > a {
-  color: #777;
-}
-.navbar-default .navbar-nav > li > a:hover,
-.navbar-default .navbar-nav > li > a:focus {
-  color: #333;
-  background-color: transparent;
-}
-.navbar-default .navbar-nav > .active > a,
-.navbar-default .navbar-nav > .active > a:hover,
-.navbar-default .navbar-nav > .active > a:focus {
-  color: #555;
-  background-color: #e7e7e7;
-}
-.navbar-default .navbar-nav > .disabled > a,
-.navbar-default .navbar-nav > .disabled > a:hover,
-.navbar-default .navbar-nav > .disabled > a:focus {
-  color: #ccc;
-  background-color: transparent;
-}
-.navbar-default .navbar-toggle {
-  border-color: #ddd;
-}
-.navbar-default .navbar-toggle:hover,
-.navbar-default .navbar-toggle:focus {
-  background-color: #ddd;
-}
-.navbar-default .navbar-toggle .icon-bar {
-  background-color: #888;
-}
-.navbar-default .navbar-collapse,
-.navbar-default .navbar-form {
-  border-color: #e7e7e7;
-}
-.navbar-default .navbar-nav > .open > a,
-.navbar-default .navbar-nav > .open > a:hover,
-.navbar-default .navbar-nav > .open > a:focus {
-  color: #555;
-  background-color: #e7e7e7;
-}
-@media (max-width: 767px) {
-  .navbar-default .navbar-nav .open .dropdown-menu > li > a {
-    color: #777;
-  }
-  .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
-  .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
-    color: #333;
-    background-color: transparent;
-  }
-  .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
-  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
-  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
-    color: #555;
-    background-color: #e7e7e7;
-  }
-  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
-  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
-  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
-    color: #ccc;
-    background-color: transparent;
-  }
-}
-.navbar-default .navbar-link {
-  color: #777;
-}
-.navbar-default .navbar-link:hover {
-  color: #333;
-}
-.navbar-default .btn-link {
-  color: #777;
-}
-.navbar-default .btn-link:hover,
-.navbar-default .btn-link:focus {
-  color: #333;
-}
-.navbar-default .btn-link[disabled]:hover,
-fieldset[disabled] .navbar-default .btn-link:hover,
-.navbar-default .btn-link[disabled]:focus,
-fieldset[disabled] .navbar-default .btn-link:focus {
-  color: #ccc;
-}
-.navbar-inverse {
-  background-color: #222;
-  border-color: #080808;
-}
-.navbar-inverse .navbar-brand {
-  color: #9d9d9d;
-}
-.navbar-inverse .navbar-brand:hover,
-.navbar-inverse .navbar-brand:focus {
-  color: #fff;
-  background-color: transparent;
-}
-.navbar-inverse .navbar-text {
-  color: #9d9d9d;
-}
-.navbar-inverse .navbar-nav > li > a {
-  color: #9d9d9d;
-}
-.navbar-inverse .navbar-nav > li > a:hover,
-.navbar-inverse .navbar-nav > li > a:focus {
-  color: #fff;
-  background-color: transparent;
-}
-.navbar-inverse .navbar-nav > .active > a,
-.navbar-inverse .navbar-nav > .active > a:hover,
-.navbar-inverse .navbar-nav > .active > a:focus {
-  color: #fff;
-  background-color: #080808;
-}
-.navbar-inverse .navbar-nav > .disabled > a,
-.navbar-inverse .navbar-nav > .disabled > a:hover,
-.navbar-inverse .navbar-nav > .disabled > a:focus {
-  color: #444;
-  background-color: transparent;
-}
-.navbar-inverse .navbar-toggle {
-  border-color: #333;
-}
-.navbar-inverse .navbar-toggle:hover,
-.navbar-inverse .navbar-toggle:focus {
-  background-color: #333;
-}
-.navbar-inverse .navbar-toggle .icon-bar {
-  background-color: #fff;
-}
-.navbar-inverse .navbar-collapse,
-.navbar-inverse .navbar-form {
-  border-color: #101010;
-}
-.navbar-inverse .navbar-nav > .open > a,
-.navbar-inverse .navbar-nav > .open > a:hover,
-.navbar-inverse .navbar-nav > .open > a:focus {
-  color: #fff;
-  background-color: #080808;
-}
-@media (max-width: 767px) {
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
-    border-color: #080808;
-  }
-  .navbar-inverse .navbar-nav .open .dropdown-menu .divider {
-    background-color: #080808;
-  }
-  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
-    color: #9d9d9d;
-  }
-  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
-  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
-    color: #fff;
-    background-color: transparent;
-  }
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
-    color: #fff;
-    background-color: #080808;
-  }
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
-  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
-    color: #444;
-    background-color: transparent;
-  }
-}
-.navbar-inverse .navbar-link {
-  color: #9d9d9d;
-}
-.navbar-inverse .navbar-link:hover {
-  color: #fff;
-}
-.navbar-inverse .btn-link {
-  color: #9d9d9d;
-}
-.navbar-inverse .btn-link:hover,
-.navbar-inverse .btn-link:focus {
-  color: #fff;
-}
-.navbar-inverse .btn-link[disabled]:hover,
-fieldset[disabled] .navbar-inverse .btn-link:hover,
-.navbar-inverse .btn-link[disabled]:focus,
-fieldset[disabled] .navbar-inverse .btn-link:focus {
-  color: #444;
-}
-.breadcrumb {
-  padding: 8px 15px;
-  margin-bottom: 20px;
-  list-style: none;
-  background-color: #f5f5f5;
-  border-radius: 4px;
-}
-.breadcrumb > li {
-  display: inline-block;
-}
-.breadcrumb > li + li:before {
-  padding: 0 5px;
-  color: #ccc;
-  content: "/\00a0";
-}
-.breadcrumb > .active {
-  color: #777;
-}
-.pagination {
-  display: inline-block;
-  padding-left: 0;
-  margin: 20px 0;
-  border-radius: 4px;
-}
-.pagination > li {
-  display: inline;
-}
-.pagination > li > a,
-.pagination > li > span {
-  position: relative;
-  float: left;
-  padding: 6px 12px;
-  margin-left: -1px;
-  line-height: 1.42857143;
-  color: #337ab7;
-  text-decoration: none;
-  background-color: #fff;
-  border: 1px solid #ddd;
-}
-.pagination > li:first-child > a,
-.pagination > li:first-child > span {
-  margin-left: 0;
-  border-top-left-radius: 4px;
-  border-bottom-left-radius: 4px;
-}
-.pagination > li:last-child > a,
-.pagination > li:last-child > span {
-  border-top-right-radius: 4px;
-  border-bottom-right-radius: 4px;
-}
-.pagination > li > a:hover,
-.pagination > li > span:hover,
-.pagination > li > a:focus,
-.pagination > li > span:focus {
-  z-index: 2;
-  color: #23527c;
-  background-color: #eee;
-  border-color: #ddd;
-}
-.pagination > .active > a,
-.pagination > .active > span,
-.pagination > .active > a:hover,
-.pagination > .active > span:hover,
-.pagination > .active > a:focus,
-.pagination > .active > span:focus {
-  z-index: 3;
-  color: #fff;
-  cursor: default;
-  background-color: #337ab7;
-  border-color: #337ab7;
-}
-.pagination > .disabled > span,
-.pagination > .disabled > span:hover,
-.pagination > .disabled > span:focus,
-.pagination > .disabled > a,
-.pagination > .disabled > a:hover,
-.pagination > .disabled > a:focus {
-  color: #777;
-  cursor: not-allowed;
-  background-color: #fff;
-  border-color: #ddd;
-}
-.pagination-lg > li > a,
-.pagination-lg > li > span {
-  padding: 10px 16px;
-  font-size: 18px;
-  line-height: 1.3333333;
-}
-.pagination-lg > li:first-child > a,
-.pagination-lg > li:first-child > span {
-  border-top-left-radius: 6px;
-  border-bottom-left-radius: 6px;
-}
-.pagination-lg > li:last-child > a,
-.pagination-lg > li:last-child > span {
-  border-top-right-radius: 6px;
-  border-bottom-right-radius: 6px;
-}
-.pagination-sm > li > a,
-.pagination-sm > li > span {
-  padding: 5px 10px;
-  font-size: 12px;
-  line-height: 1.5;
-}
-.pagination-sm > li:first-child > a,
-.pagination-sm > li:first-child > span {
-  border-top-left-radius: 3px;
-  border-bottom-left-radius: 3px;
-}
-.pagination-sm > li:last-child > a,
-.pagination-sm > li:last-child > span {
-  border-top-right-radius: 3px;
-  border-bottom-right-radius: 3px;
-}
-.pager {
-  padding-left: 0;
-  margin: 20px 0;
-  text-align: center;
-  list-style: none;
-}
-.pager li {
-  display: inline;
-}
-.pager li > a,
-.pager li > span {
-  display: inline-block;
-  padding: 5px 14px;
-  background-color: #fff;
-  border: 1px solid #ddd;
-  border-radius: 15px;
-}
-.pager li > a:hover,
-.pager li > a:focus {
-  text-decoration: none;
-  background-color: #eee;
-}
-.pager .next > a,
-.pager .next > span {
-  float: right;
-}
-.pager .previous > a,
-.pager .previous > span {
-  float: left;
-}
-.pager .disabled > a,
-.pager .disabled > a:hover,
-.pager .disabled > a:focus,
-.pager .disabled > span {
-  color: #777;
-  cursor: not-allowed;
-  background-color: #fff;
-}
-.label {
-  display: inline;
-  padding: .2em .6em .3em;
-  font-size: 75%;
-  font-weight: bold;
-  line-height: 1;
-  color: #fff;
-  text-align: center;
-  white-space: nowrap;
-  vertical-align: baseline;
-  border-radius: .25em;
-}
-a.label:hover,
-a.label:focus {
-  color: #fff;
-  text-decoration: none;
-  cursor: pointer;
-}
-.label:empty {
-  display: none;
-}
-.btn .label {
-  position: relative;
-  top: -1px;
-}
-.label-default {
-  background-color: #777;
-}
-.label-default[href]:hover,
-.label-default[href]:focus {
-  background-color: #5e5e5e;
-}
-.label-primary {
-  background-color: #337ab7;
-}
-.label-primary[href]:hover,
-.label-primary[href]:focus {
-  background-color: #286090;
-}
-.label-success {
-  background-color: #5cb85c;
-}
-.label-success[href]:hover,
-.label-success[href]:focus {
-  background-color: #449d44;
-}
-.label-info {
-  background-color: #5bc0de;
-}
-.label-info[href]:hover,
-.label-info[href]:focus {
-  background-color: #31b0d5;
-}
-.label-warning {
-  background-color: #f0ad4e;
-}
-.label-warning[href]:hover,
-.label-warning[href]:focus {
-  background-color: #ec971f;
-}
-.label-danger {
-  background-color: #d9534f;
-}
-.label-danger[href]:hover,
-.label-danger[href]:focus {
-  background-color: #c9302c;
-}
-.badge {
-  display: inline-block;
-  min-width: 10px;
-  padding: 3px 7px;
-  font-size: 12px;
-  font-weight: bold;
-  line-height: 1;
-  color: #fff;
-  text-align: center;
-  white-space: nowrap;
-  vertical-align: middle;
-  background-color: #777;
-  border-radius: 10px;
-}
-.badge:empty {
-  display: none;
-}
-.btn .badge {
-  position: relative;
-  top: -1px;
-}
-.btn-xs .badge,
-.btn-group-xs > .btn .badge {
-  top: 0;
-  padding: 1px 5px;
-}
-a.badge:hover,
-a.badge:focus {
-  color: #fff;
-  text-decoration: none;
-  cursor: pointer;
-}
-.list-group-item.active > .badge,
-.nav-pills > .active > a > .badge {
-  color: #337ab7;
-  background-color: #fff;
-}
-.list-group-item > .badge {
-  float: right;
-}
-.list-group-item > .badge + .badge {
-  margin-right: 5px;
-}
-.nav-pills > li > a > .badge {
-  margin-left: 3px;
-}
-.jumbotron {
-  padding-top: 30px;
-  padding-bottom: 30px;
-  margin-bottom: 30px;
-  color: inherit;
-  background-color: #eee;
-}
-.jumbotron h1,
-.jumbotron .h1 {
-  color: inherit;
-}
-.jumbotron p {
-  margin-bottom: 15px;
-  font-size: 21px;
-  font-weight: 200;
-}
-.jumbotron > hr {
-  border-top-color: #d5d5d5;
-}
-.container .jumbotron,
-.container-fluid .jumbotron {
-  padding-right: 15px;
-  padding-left: 15px;
-  border-radius: 6px;
-}
-.jumbotron .container {
-  max-width: 100%;
-}
-@media screen and (min-width: 768px) {
-  .jumbotron {
-    padding-top: 48px;
-    padding-bottom: 48px;
-  }
-  .container .jumbotron,
-  .container-fluid .jumbotron {
-    padding-right: 60px;
-    padding-left: 60px;
-  }
-  .jumbotron h1,
-  .jumbotron .h1 {
-    font-size: 63px;
-  }
-}
-.thumbnail {
-  display: block;
-  padding: 4px;
-  margin-bottom: 20px;
-  line-height: 1.42857143;
-  background-color: #fff;
-  border: 1px solid #ddd;
-  border-radius: 4px;
-  -webkit-transition: border .2s ease-in-out;
-       -o-transition: border .2s ease-in-out;
-          transition: border .2s ease-in-out;
-}
-.thumbnail > img,
-.thumbnail a > img {
-  margin-right: auto;
-  margin-left: auto;
-}
-a.thumbnail:hover,
-a.thumbnail:focus,
-a.thumbnail.active {
-  border-color: #337ab7;
-}
-.thumbnail .caption {
-  padding: 9px;
-  color: #333;
-}
-.alert {
-  padding: 15px;
-  margin-bottom: 20px;
-  border: 1px solid transparent;
-  border-radius: 4px;
-}
-.alert h4 {
-  margin-top: 0;
-  color: inherit;
-}
-.alert .alert-link {
-  font-weight: bold;
-}
-.alert > p,
-.alert > ul {
-  margin-bottom: 0;
-}
-.alert > p + p {
-  margin-top: 5px;
-}
-.alert-dismissable,
-.alert-dismissible {
-  padding-right: 35px;
-}
-.alert-dismissable .close,
-.alert-dismissible .close {
-  position: relative;
-  top: -2px;
-  right: -21px;
-  color: inherit;
-}
-.alert-success {
-  color: #3c763d;
-  background-color: #dff0d8;
-  border-color: #d6e9c6;
-}
-.alert-success hr {
-  border-top-color: #c9e2b3;
-}
-.alert-success .alert-link {
-  color: #2b542c;
-}
-.alert-info {
-  color: #31708f;
-  background-color: #d9edf7;
-  border-color: #bce8f1;
-}
-.alert-info hr {
-  border-top-color: #a6e1ec;
-}
-.alert-info .alert-link {
-  color: #245269;
-}
-.alert-warning {
-  color: #8a6d3b;
-  background-color: #fcf8e3;
-  border-color: #faebcc;
-}
-.alert-warning hr {
-  border-top-color: #f7e1b5;
-}
-.alert-warning .alert-link {
-  color: #66512c;
-}
-.alert-danger {
-  color: #a94442;
-  background-color: #f2dede;
-  border-color: #ebccd1;
-}
-.alert-danger hr {
-  border-top-color: #e4b9c0;
-}
-.alert-danger .alert-link {
-  color: #843534;
-}
-@-webkit-keyframes progress-bar-stripes {
-  from {
-    background-position: 40px 0;
-  }
-  to {
-    background-position: 0 0;
-  }
-}
-@-o-keyframes progress-bar-stripes {
-  from {
-    background-position: 40px 0;
-  }
-  to {
-    background-position: 0 0;
-  }
-}
-@keyframes progress-bar-stripes {
-  from {
-    background-position: 40px 0;
-  }
-  to {
-    background-position: 0 0;
-  }
-}
-.progress {
-  height: 20px;
-  margin-bottom: 20px;
-  overflow: hidden;
-  background-color: #f5f5f5;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
-          box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
-}
-.progress-bar {
-  float: left;
-  width: 0;
-  height: 100%;
-  font-size: 12px;
-  line-height: 20px;
-  color: #fff;
-  text-align: center;
-  background-color: #337ab7;
-  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
-          box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
-  -webkit-transition: width .6s ease;
-       -o-transition: width .6s ease;
-          transition: width .6s ease;
-}
-.progress-striped .progress-bar,
-.progress-bar-striped {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  -webkit-background-size: 40px 40px;
-          background-size: 40px 40px;
-}
-.progress.active .progress-bar,
-.progress-bar.active {
-  -webkit-animation: progress-bar-stripes 2s linear infinite;
-       -o-animation: progress-bar-stripes 2s linear infinite;
-          animation: progress-bar-stripes 2s linear infinite;
-}
-.progress-bar-success {
-  background-color: #5cb85c;
-}
-.progress-striped .progress-bar-success {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.progress-bar-info {
-  background-color: #5bc0de;
-}
-.progress-striped .progress-bar-info {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.progress-bar-warning {
-  background-color: #f0ad4e;
-}
-.progress-striped .progress-bar-warning {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.progress-bar-danger {
-  background-color: #d9534f;
-}
-.progress-striped .progress-bar-danger {
-  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
-}
-.media {
-  margin-top: 15px;
-}
-.media:first-child {
-  margin-top: 0;
-}
-.media,
-.media-body {
-  overflow: hidden;
-  zoom: 1;
-}
-.media-body {
-  width: 10000px;
-}
-.media-object {
-  display: block;
-}
-.media-object.img-thumbnail {
-  max-width: none;
-}
-.media-right,
-.media > .pull-right {
-  padding-left: 10px;
-}
-.media-left,
-.media > .pull-left {
-  padding-right: 10px;
-}
-.media-left,
-.media-right,
-.media-body {
-  display: table-cell;
-  vertical-align: top;
-}
-.media-middle {
-  vertical-align: middle;
-}
-.media-bottom {
-  vertical-align: bottom;
-}
-.media-heading {
-  margin-top: 0;
-  margin-bottom: 5px;
-}
-.media-list {
-  padding-left: 0;
-  list-style: none;
-}
-.list-group {
-  padding-left: 0;
-  margin-bottom: 20px;
-}
-.list-group-item {
-  position: relative;
-  display: block;
-  padding: 10px 15px;
-  margin-bottom: -1px;
-  background-color: #fff;
-  border: 1px solid #ddd;
-}
-.list-group-item:first-child {
-  border-top-left-radius: 4px;
-  border-top-right-radius: 4px;
-}
-.list-group-item:last-child {
-  margin-bottom: 0;
-  border-bottom-right-radius: 4px;
-  border-bottom-left-radius: 4px;
-}
-a.list-group-item,
-button.list-group-item {
-  color: #555;
-}
-a.list-group-item .list-group-item-heading,
-button.list-group-item .list-group-item-heading {
-  color: #333;
-}
-a.list-group-item:hover,
-button.list-group-item:hover,
-a.list-group-item:focus,
-button.list-group-item:focus {
-  color: #555;
-  text-decoration: none;
-  background-color: #f5f5f5;
-}
-button.list-group-item {
-  width: 100%;
-  text-align: left;
-}
-.list-group-item.disabled,
-.list-group-item.disabled:hover,
-.list-group-item.disabled:focus {
-  color: #777;
-  cursor: not-allowed;
-  background-color: #eee;
-}
-.list-group-item.disabled .list-group-item-heading,
-.list-group-item.disabled:hover .list-group-item-heading,
-.list-group-item.disabled:focus .list-group-item-heading {
-  color: inherit;
-}
-.list-group-item.disabled .list-group-item-text,
-.list-group-item.disabled:hover .list-group-item-text,
-.list-group-item.disabled:focus .list-group-item-text {
-  color: #777;
-}
-.list-group-item.active,
-.list-group-item.active:hover,
-.list-group-item.active:focus {
-  z-index: 2;
-  color: #fff;
-  background-color: #337ab7;
-  border-color: #337ab7;
-}
-.list-group-item.active .list-group-item-heading,
-.list-group-item.active:hover .list-group-item-heading,
-.list-group-item.active:focus .list-group-item-heading,
-.list-group-item.active .list-group-item-heading > small,
-.list-group-item.active:hover .list-group-item-heading > small,
-.list-group-item.active:focus .list-group-item-heading > small,
-.list-group-item.active .list-group-item-heading > .small,
-.list-group-item.active:hover .list-group-item-heading > .small,
-.list-group-item.active:focus .list-group-item-heading > .small {
-  color: inherit;
-}
-.list-group-item.active .list-group-item-text,
-.list-group-item.active:hover .list-group-item-text,
-.list-group-item.active:focus .list-group-item-text {
-  color: #c7ddef;
-}
-.list-group-item-success {
-  color: #3c763d;
-  background-color: #dff0d8;
-}
-a.list-group-item-success,
-button.list-group-item-success {
-  color: #3c763d;
-}
-a.list-group-item-success .list-group-item-heading,
-button.list-group-item-success .list-group-item-heading {
-  color: inherit;
-}
-a.list-group-item-success:hover,
-button.list-group-item-success:hover,
-a.list-group-item-success:focus,
-button.list-group-item-success:focus {
-  color: #3c763d;
-  background-color: #d0e9c6;
-}
-a.list-group-item-success.active,
-button.list-group-item-success.active,
-a.list-group-item-success.active:hover,
-button.list-group-item-success.active:hover,
-a.list-group-item-success.active:focus,
-button.list-group-item-success.active:focus {
-  color: #fff;
-  background-color: #3c763d;
-  border-color: #3c763d;
-}
-.list-group-item-info {
-  color: #31708f;
-  background-color: #d9edf7;
-}
-a.list-group-item-info,
-button.list-group-item-info {
-  color: #31708f;
-}
-a.list-group-item-info .list-group-item-heading,
-button.list-group-item-info .list-group-item-heading {
-  color: inherit;
-}
-a.list-group-item-info:hover,
-button.list-group-item-info:hover,
-a.list-group-item-info:focus,
-button.list-group-item-info:focus {
-  color: #31708f;
-  background-color: #c4e3f3;
-}
-a.list-group-item-info.active,
-button.list-group-item-info.active,
-a.list-group-item-info.active:hover,
-button.list-group-item-info.active:hover,
-a.list-group-item-info.active:focus,
-button.list-group-item-info.active:focus {
-  color: #fff;
-  background-color: #31708f;
-  border-color: #31708f;
-}
-.list-group-item-warning {
-  color: #8a6d3b;
-  background-color: #fcf8e3;
-}
-a.list-group-item-warning,
-button.list-group-item-warning {
-  color: #8a6d3b;
-}
-a.list-group-item-warning .list-group-item-heading,
-button.list-group-item-warning .list-group-item-heading {
-  color: inherit;
-}
-a.list-group-item-warning:hover,
-button.list-group-item-warning:hover,
-a.list-group-item-warning:focus,
-button.list-group-item-warning:focus {
-  color: #8a6d3b;
-  background-color: #faf2cc;
-}
-a.list-group-item-warning.active,
-button.list-group-item-warning.active,
-a.list-group-item-warning.active:hover,
-button.list-group-item-warning.active:hover,
-a.list-group-item-warning.active:focus,
-button.list-group-item-warning.active:focus {
-  color: #fff;
-  background-color: #8a6d3b;
-  border-color: #8a6d3b;
-}
-.list-group-item-danger {
-  color: #a94442;
-  background-color: #f2dede;
-}
-a.list-group-item-danger,
-button.list-group-item-danger {
-  color: #a94442;
-}
-a.list-group-item-danger .list-group-item-heading,
-button.list-group-item-danger .list-group-item-heading {
-  color: inherit;
-}
-a.list-group-item-danger:hover,
-button.list-group-item-danger:hover,
-a.list-group-item-danger:focus,
-button.list-group-item-danger:focus {
-  color: #a94442;
-  background-color: #ebcccc;
-}
-a.list-group-item-danger.active,
-button.list-group-item-danger.active,
-a.list-group-item-danger.active:hover,
-button.list-group-item-danger.active:hover,
-a.list-group-item-danger.active:focus,
-button.list-group-item-danger.active:focus {
-  color: #fff;
-  background-color: #a94442;
-  border-color: #a94442;
-}
-.list-group-item-heading {
-  margin-top: 0;
-  margin-bottom: 5px;
-}
-.list-group-item-text {
-  margin-bottom: 0;
-  line-height: 1.3;
-}
-.panel {
-  margin-bottom: 20px;
-  background-color: #fff;
-  border: 1px solid transparent;
-  border-radius: 4px;
-  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
-          box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
-}
-.panel-body {
-  padding: 15px;
-}
-.panel-heading {
-  padding: 10px 15px;
-  border-bottom: 1px solid transparent;
-  border-top-left-radius: 3px;
-  border-top-right-radius: 3px;
-}
-.panel-heading > .dropdown .dropdown-toggle {
-  color: inherit;
-}
-.panel-title {
-  margin-top: 0;
-  margin-bottom: 0;
-  font-size: 16px;
-  color: inherit;
-}
-.panel-title > a,
-.panel-title > small,
-.panel-title > .small,
-.panel-title > small > a,
-.panel-title > .small > a {
-  color: inherit;
-}
-.panel-footer {
-  padding: 10px 15px;
-  background-color: #f5f5f5;
-  border-top: 1px solid #ddd;
-  border-bottom-right-radius: 3px;
-  border-bottom-left-radius: 3px;
-}
-.panel > .list-group,
-.panel > .panel-collapse > .list-group {
-  margin-bottom: 0;
-}
-.panel > .list-group .list-group-item,
-.panel > .panel-collapse > .list-group .list-group-item {
-  border-width: 1px 0;
-  border-radius: 0;
-}
-.panel > .list-group:first-child .list-group-item:first-child,
-.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
-  border-top: 0;
-  border-top-left-radius: 3px;
-  border-top-right-radius: 3px;
-}
-.panel > .list-group:last-child .list-group-item:last-child,
-.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
-  border-bottom: 0;
-  border-bottom-right-radius: 3px;
-  border-bottom-left-radius: 3px;
-}
-.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {
-  border-top-left-radius: 0;
-  border-top-right-radius: 0;
-}
-.panel-heading + .list-group .list-group-item:first-child {
-  border-top-width: 0;
-}
-.list-group + .panel-footer {
-  border-top-width: 0;
-}
-.panel > .table,
-.panel > .table-responsive > .table,
-.panel > .panel-collapse > .table {
-  margin-bottom: 0;
-}
-.panel > .table caption,
-.panel > .table-responsive > .table caption,
-.panel > .panel-collapse > .table caption {
-  padding-right: 15px;
-  padding-left: 15px;
-}
-.panel > .table:first-child,
-.panel > .table-responsive:first-child > .table:first-child {
-  border-top-left-radius: 3px;
-  border-top-right-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
-  border-top-left-radius: 3px;
-  border-top-right-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
-.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
-  border-top-left-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
-.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
-  border-top-right-radius: 3px;
-}
-.panel > .table:last-child,
-.panel > .table-responsive:last-child > .table:last-child {
-  border-bottom-right-radius: 3px;
-  border-bottom-left-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
-  border-bottom-right-radius: 3px;
-  border-bottom-left-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
-.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
-  border-bottom-left-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
-.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
-  border-bottom-right-radius: 3px;
-}
-.panel > .panel-body + .table,
-.panel > .panel-body + .table-responsive,
-.panel > .table + .panel-body,
-.panel > .table-responsive + .panel-body {
-  border-top: 1px solid #ddd;
-}
-.panel > .table > tbody:first-child > tr:first-child th,
-.panel > .table > tbody:first-child > tr:first-child td {
-  border-top: 0;
-}
-.panel > .table-bordered,
-.panel > .table-responsive > .table-bordered {
-  border: 0;
-}
-.panel > .table-bordered > thead > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
-.panel > .table-bordered > tbody > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
-.panel > .table-bordered > tfoot > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
-.panel > .table-bordered > thead > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
-.panel > .table-bordered > tbody > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
-.panel > .table-bordered > tfoot > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
-  border-left: 0;
-}
-.panel > .table-bordered > thead > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
-.panel > .table-bordered > tbody > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
-.panel > .table-bordered > tfoot > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
-.panel > .table-bordered > thead > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
-.panel > .table-bordered > tbody > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
-.panel > .table-bordered > tfoot > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
-  border-right: 0;
-}
-.panel > .table-bordered > thead > tr:first-child > td,
-.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
-.panel > .table-bordered > tbody > tr:first-child > td,
-.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
-.panel > .table-bordered > thead > tr:first-child > th,
-.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
-.panel > .table-bordered > tbody > tr:first-child > th,
-.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
-  border-bottom: 0;
-}
-.panel > .table-bordered > tbody > tr:last-child > td,
-.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
-.panel > .table-bordered > tfoot > tr:last-child > td,
-.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,
-.panel > .table-bordered > tbody > tr:last-child > th,
-.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
-.panel > .table-bordered > tfoot > tr:last-child > th,
-.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
-  border-bottom: 0;
-}
-.panel > .table-responsive {
-  margin-bottom: 0;
-  border: 0;
-}
-.panel-group {
-  margin-bottom: 20px;
-}
-.panel-group .panel {
-  margin-bottom: 0;
-  border-radius: 4px;
-}
-.panel-group .panel + .panel {
-  margin-top: 5px;
-}
-.panel-group .panel-heading {
-  border-bottom: 0;
-}
-.panel-group .panel-heading + .panel-collapse > .panel-body,
-.panel-group .panel-heading + .panel-collapse > .list-group {
-  border-top: 1px solid #ddd;
-}
-.panel-group .panel-footer {
-  border-top: 0;
-}
-.panel-group .panel-footer + .panel-collapse .panel-body {
-  border-bottom: 1px solid #ddd;
-}
-.panel-default {
-  border-color: #ddd;
-}
-.panel-default > .panel-heading {
-  color: #333;
-  background-color: #f5f5f5;
-  border-color: #ddd;
-}
-.panel-default > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #ddd;
-}
-.panel-default > .panel-heading .badge {
-  color: #f5f5f5;
-  background-color: #333;
-}
-.panel-default > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #ddd;
-}
-.panel-primary {
-  border-color: #337ab7;
-}
-.panel-primary > .panel-heading {
-  color: #fff;
-  background-color: #337ab7;
-  border-color: #337ab7;
-}
-.panel-primary > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #337ab7;
-}
-.panel-primary > .panel-heading .badge {
-  color: #337ab7;
-  background-color: #fff;
-}
-.panel-primary > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #337ab7;
-}
-.panel-success {
-  border-color: #d6e9c6;
-}
-.panel-success > .panel-heading {
-  color: #3c763d;
-  background-color: #dff0d8;
-  border-color: #d6e9c6;
-}
-.panel-success > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #d6e9c6;
-}
-.panel-success > .panel-heading .badge {
-  color: #dff0d8;
-  background-color: #3c763d;
-}
-.panel-success > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #d6e9c6;
-}
-.panel-info {
-  border-color: #bce8f1;
-}
-.panel-info > .panel-heading {
-  color: #31708f;
-  background-color: #d9edf7;
-  border-color: #bce8f1;
-}
-.panel-info > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #bce8f1;
-}
-.panel-info > .panel-heading .badge {
-  color: #d9edf7;
-  background-color: #31708f;
-}
-.panel-info > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #bce8f1;
-}
-.panel-warning {
-  border-color: #faebcc;
-}
-.panel-warning > .panel-heading {
-  color: #8a6d3b;
-  background-color: #fcf8e3;
-  border-color: #faebcc;
-}
-.panel-warning > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #faebcc;
-}
-.panel-warning > .panel-heading .badge {
-  color: #fcf8e3;
-  background-color: #8a6d3b;
-}
-.panel-warning > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #faebcc;
-}
-.panel-danger {
-  border-color: #ebccd1;
-}
-.panel-danger > .panel-heading {
-  color: #a94442;
-  background-color: #f2dede;
-  border-color: #ebccd1;
-}
-.panel-danger > .panel-heading + .panel-collapse > .panel-body {
-  border-top-color: #ebccd1;
-}
-.panel-danger > .panel-heading .badge {
-  color: #f2dede;
-  background-color: #a94442;
-}
-.panel-danger > .panel-footer + .panel-collapse > .panel-body {
-  border-bottom-color: #ebccd1;
-}
-.embed-responsive {
-  position: relative;
-  display: block;
-  height: 0;
-  padding: 0;
-  overflow: hidden;
-}
-.embed-responsive .embed-responsive-item,
-.embed-responsive iframe,
-.embed-responsive embed,
-.embed-responsive object,
-.embed-responsive video {
-  position: absolute;
-  top: 0;
-  bottom: 0;
-  left: 0;
-  width: 100%;
-  height: 100%;
-  border: 0;
-}
-.embed-responsive-16by9 {
-  padding-bottom: 56.25%;
-}
-.embed-responsive-4by3 {
-  padding-bottom: 75%;
-}
-.well {
-  min-height: 20px;
-  padding: 19px;
-  margin-bottom: 20px;
-  background-color: #f5f5f5;
-  border: 1px solid #e3e3e3;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
-}
-.well blockquote {
-  border-color: #ddd;
-  border-color: rgba(0, 0, 0, .15);
-}
-.well-lg {
-  padding: 24px;
-  border-radius: 6px;
-}
-.well-sm {
-  padding: 9px;
-  border-radius: 3px;
-}
-.close {
-  float: right;
-  font-size: 21px;
-  font-weight: bold;
-  line-height: 1;
-  color: #000;
-  text-shadow: 0 1px 0 #fff;
-  filter: alpha(opacity=20);
-  opacity: .2;
-}
-.close:hover,
-.close:focus {
-  color: #000;
-  text-decoration: none;
-  cursor: pointer;
-  filter: alpha(opacity=50);
-  opacity: .5;
-}
-button.close {
-  -webkit-appearance: none;
-  padding: 0;
-  cursor: pointer;
-  background: transparent;
-  border: 0;
-}
-.modal-open {
-  overflow: hidden;
-}
-.modal {
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  z-index: 1050;
-  display: none;
-  overflow: hidden;
-  -webkit-overflow-scrolling: touch;
-  outline: 0;
-}
-.modal.fade .modal-dialog {
-  -webkit-transition: -webkit-transform .3s ease-out;
-       -o-transition:      -o-transform .3s ease-out;
-          transition:         transform .3s ease-out;
-  -webkit-transform: translate(0, -25%);
-      -ms-transform: translate(0, -25%);
-       -o-transform: translate(0, -25%);
-          transform: translate(0, -25%);
-}
-.modal.in .modal-dialog {
-  -webkit-transform: translate(0, 0);
-      -ms-transform: translate(0, 0);
-       -o-transform: translate(0, 0);
-          transform: translate(0, 0);
-}
-.modal-open .modal {
-  overflow-x: hidden;
-  overflow-y: auto;
-}
-.modal-dialog {
-  position: relative;
-  width: auto;
-  margin: 10px;
-}
-.modal-content {
-  position: relative;
-  background-color: #fff;
-  -webkit-background-clip: padding-box;
-          background-clip: padding-box;
-  border: 1px solid #999;
-  border: 1px solid rgba(0, 0, 0, .2);
-  border-radius: 6px;
-  outline: 0;
-  -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
-          box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
-}
-.modal-backdrop {
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  z-index: 1040;
-  background-color: #000;
-}
-.modal-backdrop.fade {
-  filter: alpha(opacity=0);
-  opacity: 0;
-}
-.modal-backdrop.in {
-  filter: alpha(opacity=50);
-  opacity: .5;
-}
-.modal-header {
-  padding: 15px;
-  border-bottom: 1px solid #e5e5e5;
-}
-.modal-header .close {
-  margin-top: -2px;
-}
-.modal-title {
-  margin: 0;
-  line-height: 1.42857143;
-}
-.modal-body {
-  position: relative;
-  padding: 15px;
-}
-.modal-footer {
-  padding: 15px;
-  text-align: right;
-  border-top: 1px solid #e5e5e5;
-}
-.modal-footer .btn + .btn {
-  margin-bottom: 0;
-  margin-left: 5px;
-}
-.modal-footer .btn-group .btn + .btn {
-  margin-left: -1px;
-}
-.modal-footer .btn-block + .btn-block {
-  margin-left: 0;
-}
-.modal-scrollbar-measure {
-  position: absolute;
-  top: -9999px;
-  width: 50px;
-  height: 50px;
-  overflow: scroll;
-}
-@media (min-width: 768px) {
-  .modal-dialog {
-    width: 600px;
-    margin: 30px auto;
-  }
-  .modal-content {
-    -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
-            box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
-  }
-  .modal-sm {
-    width: 300px;
-  }
-}
-@media (min-width: 992px) {
-  .modal-lg {
-    width: 900px;
-  }
-}
-.tooltip {
-  position: absolute;
-  z-index: 1070;
-  display: block;
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 12px;
-  font-style: normal;
-  font-weight: normal;
-  line-height: 1.42857143;
-  text-align: left;
-  text-align: start;
-  text-decoration: none;
-  text-shadow: none;
-  text-transform: none;
-  letter-spacing: normal;
-  word-break: normal;
-  word-spacing: normal;
-  word-wrap: normal;
-  white-space: normal;
-  filter: alpha(opacity=0);
-  opacity: 0;
-
-  line-break: auto;
-}
-.tooltip.in {
-  filter: alpha(opacity=90);
-  opacity: .9;
-}
-.tooltip.top {
-  padding: 5px 0;
-  margin-top: -3px;
-}
-.tooltip.right {
-  padding: 0 5px;
-  margin-left: 3px;
-}
-.tooltip.bottom {
-  padding: 5px 0;
-  margin-top: 3px;
-}
-.tooltip.left {
-  padding: 0 5px;
-  margin-left: -3px;
-}
-.tooltip-inner {
-  max-width: 200px;
-  padding: 3px 8px;
-  color: #fff;
-  text-align: center;
-  background-color: #000;
-  border-radius: 4px;
-}
-.tooltip-arrow {
-  position: absolute;
-  width: 0;
-  height: 0;
-  border-color: transparent;
-  border-style: solid;
-}
-.tooltip.top .tooltip-arrow {
-  bottom: 0;
-  left: 50%;
-  margin-left: -5px;
-  border-width: 5px 5px 0;
-  border-top-color: #000;
-}
-.tooltip.top-left .tooltip-arrow {
-  right: 5px;
-  bottom: 0;
-  margin-bottom: -5px;
-  border-width: 5px 5px 0;
-  border-top-color: #000;
-}
-.tooltip.top-right .tooltip-arrow {
-  bottom: 0;
-  left: 5px;
-  margin-bottom: -5px;
-  border-width: 5px 5px 0;
-  border-top-color: #000;
-}
-.tooltip.right .tooltip-arrow {
-  top: 50%;
-  left: 0;
-  margin-top: -5px;
-  border-width: 5px 5px 5px 0;
-  border-right-color: #000;
-}
-.tooltip.left .tooltip-arrow {
-  top: 50%;
-  right: 0;
-  margin-top: -5px;
-  border-width: 5px 0 5px 5px;
-  border-left-color: #000;
-}
-.tooltip.bottom .tooltip-arrow {
-  top: 0;
-  left: 50%;
-  margin-left: -5px;
-  border-width: 0 5px 5px;
-  border-bottom-color: #000;
-}
-.tooltip.bottom-left .tooltip-arrow {
-  top: 0;
-  right: 5px;
-  margin-top: -5px;
-  border-width: 0 5px 5px;
-  border-bottom-color: #000;
-}
-.tooltip.bottom-right .tooltip-arrow {
-  top: 0;
-  left: 5px;
-  margin-top: -5px;
-  border-width: 0 5px 5px;
-  border-bottom-color: #000;
-}
-.popover {
-  position: absolute;
-  top: 0;
-  left: 0;
-  z-index: 1060;
-  display: none;
-  max-width: 276px;
-  padding: 1px;
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 14px;
-  font-style: normal;
-  font-weight: normal;
-  line-height: 1.42857143;
-  text-align: left;
-  text-align: start;
-  text-decoration: none;
-  text-shadow: none;
-  text-transform: none;
-  letter-spacing: normal;
-  word-break: normal;
-  word-spacing: normal;
-  word-wrap: normal;
-  white-space: normal;
-  background-color: #fff;
-  -webkit-background-clip: padding-box;
-          background-clip: padding-box;
-  border: 1px solid #ccc;
-  border: 1px solid rgba(0, 0, 0, .2);
-  border-radius: 6px;
-  -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
-          box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
-
-  line-break: auto;
-}
-.popover.top {
-  margin-top: -10px;
-}
-.popover.right {
-  margin-left: 10px;
-}
-.popover.bottom {
-  margin-top: 10px;
-}
-.popover.left {
-  margin-left: -10px;
-}
-.popover-title {
-  padding: 8px 14px;
-  margin: 0;
-  font-size: 14px;
-  background-color: #f7f7f7;
-  border-bottom: 1px solid #ebebeb;
-  border-radius: 5px 5px 0 0;
-}
-.popover-content {
-  padding: 9px 14px;
-}
-.popover > .arrow,
-.popover > .arrow:after {
-  position: absolute;
-  display: block;
-  width: 0;
-  height: 0;
-  border-color: transparent;
-  border-style: solid;
-}
-.popover > .arrow {
-  border-width: 11px;
-}
-.popover > .arrow:after {
-  content: "";
-  border-width: 10px;
-}
-.popover.top > .arrow {
-  bottom: -11px;
-  left: 50%;
-  margin-left: -11px;
-  border-top-color: #999;
-  border-top-color: rgba(0, 0, 0, .25);
-  border-bottom-width: 0;
-}
-.popover.top > .arrow:after {
-  bottom: 1px;
-  margin-left: -10px;
-  content: " ";
-  border-top-color: #fff;
-  border-bottom-width: 0;
-}
-.popover.right > .arrow {
-  top: 50%;
-  left: -11px;
-  margin-top: -11px;
-  border-right-color: #999;
-  border-right-color: rgba(0, 0, 0, .25);
-  border-left-width: 0;
-}
-.popover.right > .arrow:after {
-  bottom: -10px;
-  left: 1px;
-  content: " ";
-  border-right-color: #fff;
-  border-left-width: 0;
-}
-.popover.bottom > .arrow {
-  top: -11px;
-  left: 50%;
-  margin-left: -11px;
-  border-top-width: 0;
-  border-bottom-color: #999;
-  border-bottom-color: rgba(0, 0, 0, .25);
-}
-.popover.bottom > .arrow:after {
-  top: 1px;
-  margin-left: -10px;
-  content: " ";
-  border-top-width: 0;
-  border-bottom-color: #fff;
-}
-.popover.left > .arrow {
-  top: 50%;
-  right: -11px;
-  margin-top: -11px;
-  border-right-width: 0;
-  border-left-color: #999;
-  border-left-color: rgba(0, 0, 0, .25);
-}
-.popover.left > .arrow:after {
-  right: 1px;
-  bottom: -10px;
-  content: " ";
-  border-right-width: 0;
-  border-left-color: #fff;
-}
-.carousel {
-  position: relative;
-}
-.carousel-inner {
-  position: relative;
-  width: 100%;
-  overflow: hidden;
-}
-.carousel-inner > .item {
-  position: relative;
-  display: none;
-  -webkit-transition: .6s ease-in-out left;
-       -o-transition: .6s ease-in-out left;
-          transition: .6s ease-in-out left;
-}
-.carousel-inner > .item > img,
-.carousel-inner > .item > a > img {
-  line-height: 1;
-}
-@media all and (transform-3d), (-webkit-transform-3d) {
-  .carousel-inner > .item {
-    -webkit-transition: -webkit-transform .6s ease-in-out;
-         -o-transition:      -o-transform .6s ease-in-out;
-            transition:         transform .6s ease-in-out;
-
-    -webkit-backface-visibility: hidden;
-            backface-visibility: hidden;
-    -webkit-perspective: 1000px;
-            perspective: 1000px;
-  }
-  .carousel-inner > .item.next,
-  .carousel-inner > .item.active.right {
-    left: 0;
-    -webkit-transform: translate3d(100%, 0, 0);
-            transform: translate3d(100%, 0, 0);
-  }
-  .carousel-inner > .item.prev,
-  .carousel-inner > .item.active.left {
-    left: 0;
-    -webkit-transform: translate3d(-100%, 0, 0);
-            transform: translate3d(-100%, 0, 0);
-  }
-  .carousel-inner > .item.next.left,
-  .carousel-inner > .item.prev.right,
-  .carousel-inner > .item.active {
-    left: 0;
-    -webkit-transform: translate3d(0, 0, 0);
-            transform: translate3d(0, 0, 0);
-  }
-}
-.carousel-inner > .active,
-.carousel-inner > .next,
-.carousel-inner > .prev {
-  display: block;
-}
-.carousel-inner > .active {
-  left: 0;
-}
-.carousel-inner > .next,
-.carousel-inner > .prev {
-  position: absolute;
-  top: 0;
-  width: 100%;
-}
-.carousel-inner > .next {
-  left: 100%;
-}
-.carousel-inner > .prev {
-  left: -100%;
-}
-.carousel-inner > .next.left,
-.carousel-inner > .prev.right {
-  left: 0;
-}
-.carousel-inner > .active.left {
-  left: -100%;
-}
-.carousel-inner > .active.right {
-  left: 100%;
-}
-.carousel-control {
-  position: absolute;
-  top: 0;
-  bottom: 0;
-  left: 0;
-  width: 15%;
-  font-size: 20px;
-  color: #fff;
-  text-align: center;
-  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
-  background-color: rgba(0, 0, 0, 0);
-  filter: alpha(opacity=50);
-  opacity: .5;
-}
-.carousel-control.left {
-  background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
-  background-image:      -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
-  background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001)));
-  background-image:         linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
-  background-repeat: repeat-x;
-}
-.carousel-control.right {
-  right: 0;
-  left: auto;
-  background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
-  background-image:      -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
-  background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5)));
-  background-image:         linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
-  background-repeat: repeat-x;
-}
-.carousel-control:hover,
-.carousel-control:focus {
-  color: #fff;
-  text-decoration: none;
-  filter: alpha(opacity=90);
-  outline: 0;
-  opacity: .9;
-}
-.carousel-control .icon-prev,
-.carousel-control .icon-next,
-.carousel-control .glyphicon-chevron-left,
-.carousel-control .glyphicon-chevron-right {
-  position: absolute;
-  top: 50%;
-  z-index: 5;
-  display: inline-block;
-  margin-top: -10px;
-}
-.carousel-control .icon-prev,
-.carousel-control .glyphicon-chevron-left {
-  left: 50%;
-  margin-left: -10px;
-}
-.carousel-control .icon-next,
-.carousel-control .glyphicon-chevron-right {
-  right: 50%;
-  margin-right: -10px;
-}
-.carousel-control .icon-prev,
-.carousel-control .icon-next {
-  width: 20px;
-  height: 20px;
-  font-family: serif;
-  line-height: 1;
-}
-.carousel-control .icon-prev:before {
-  content: '\2039';
-}
-.carousel-control .icon-next:before {
-  content: '\203a';
-}
-.carousel-indicators {
-  position: absolute;
-  bottom: 10px;
-  left: 50%;
-  z-index: 15;
-  width: 60%;
-  padding-left: 0;
-  margin-left: -30%;
-  text-align: center;
-  list-style: none;
-}
-.carousel-indicators li {
-  display: inline-block;
-  width: 10px;
-  height: 10px;
-  margin: 1px;
-  text-indent: -999px;
-  cursor: pointer;
-  background-color: #000 \9;
-  background-color: rgba(0, 0, 0, 0);
-  border: 1px solid #fff;
-  border-radius: 10px;
-}
-.carousel-indicators .active {
-  width: 12px;
-  height: 12px;
-  margin: 0;
-  background-color: #fff;
-}
-.carousel-caption {
-  position: absolute;
-  right: 15%;
-  bottom: 20px;
-  left: 15%;
-  z-index: 10;
-  padding-top: 20px;
-  padding-bottom: 20px;
-  color: #fff;
-  text-align: center;
-  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
-}
-.carousel-caption .btn {
-  text-shadow: none;
-}
-@media screen and (min-width: 768px) {
-  .carousel-control .glyphicon-chevron-left,
-  .carousel-control .glyphicon-chevron-right,
-  .carousel-control .icon-prev,
-  .carousel-control .icon-next {
-    width: 30px;
-    height: 30px;
-    margin-top: -10px;
-    font-size: 30px;
-  }
-  .carousel-control .glyphicon-chevron-left,
-  .carousel-control .icon-prev {
-    margin-left: -10px;
-  }
-  .carousel-control .glyphicon-chevron-right,
-  .carousel-control .icon-next {
-    margin-right: -10px;
-  }
-  .carousel-caption {
-    right: 20%;
-    left: 20%;
-    padding-bottom: 30px;
-  }
-  .carousel-indicators {
-    bottom: 20px;
-  }
-}
-.clearfix:before,
-.clearfix:after,
-.dl-horizontal dd:before,
-.dl-horizontal dd:after,
-.container:before,
-.container:after,
-.container-fluid:before,
-.container-fluid:after,
-.row:before,
-.row:after,
-.form-horizontal .form-group:before,
-.form-horizontal .form-group:after,
-.btn-toolbar:before,
-.btn-toolbar:after,
-.btn-group-vertical > .btn-group:before,
-.btn-group-vertical > .btn-group:after,
-.nav:before,
-.nav:after,
-.navbar:before,
-.navbar:after,
-.navbar-header:before,
-.navbar-header:after,
-.navbar-collapse:before,
-.navbar-collapse:after,
-.pager:before,
-.pager:after,
-.panel-body:before,
-.panel-body:after,
-.modal-header:before,
-.modal-header:after,
-.modal-footer:before,
-.modal-footer:after {
-  display: table;
-  content: " ";
-}
-.clearfix:after,
-.dl-horizontal dd:after,
-.container:after,
-.container-fluid:after,
-.row:after,
-.form-horizontal .form-group:after,
-.btn-toolbar:after,
-.btn-group-vertical > .btn-group:after,
-.nav:after,
-.navbar:after,
-.navbar-header:after,
-.navbar-collapse:after,
-.pager:after,
-.panel-body:after,
-.modal-header:after,
-.modal-footer:after {
-  clear: both;
-}
-.center-block {
-  display: block;
-  margin-right: auto;
-  margin-left: auto;
-}
-.pull-right {
-  float: right !important;
-}
-.pull-left {
-  float: left !important;
-}
-.hide {
-  display: none !important;
-}
-.show {
-  display: block !important;
-}
-.invisible {
-  visibility: hidden;
-}
-.text-hide {
-  font: 0/0 a;
-  color: transparent;
-  text-shadow: none;
-  background-color: transparent;
-  border: 0;
-}
-.hidden {
-  display: none !important;
-}
-.affix {
-  position: fixed;
-}
-@-ms-viewport {
-  width: device-width;
-}
-.visible-xs,
-.visible-sm,
-.visible-md,
-.visible-lg {
-  display: none !important;
-}
-.visible-xs-block,
-.visible-xs-inline,
-.visible-xs-inline-block,
-.visible-sm-block,
-.visible-sm-inline,
-.visible-sm-inline-block,
-.visible-md-block,
-.visible-md-inline,
-.visible-md-inline-block,
-.visible-lg-block,
-.visible-lg-inline,
-.visible-lg-inline-block {
-  display: none !important;
-}
-@media (max-width: 767px) {
-  .visible-xs {
-    display: block !important;
-  }
-  table.visible-xs {
-    display: table !important;
-  }
-  tr.visible-xs {
-    display: table-row !important;
-  }
-  th.visible-xs,
-  td.visible-xs {
-    display: table-cell !important;
-  }
-}
-@media (max-width: 767px) {
-  .visible-xs-block {
-    display: block !important;
-  }
-}
-@media (max-width: 767px) {
-  .visible-xs-inline {
-    display: inline !important;
-  }
-}
-@media (max-width: 767px) {
-  .visible-xs-inline-block {
-    display: inline-block !important;
-  }
-}
-@media (min-width: 768px) and (max-width: 991px) {
-  .visible-sm {
-    display: block !important;
-  }
-  table.visible-sm {
-    display: table !important;
-  }
-  tr.visible-sm {
-    display: table-row !important;
-  }
-  th.visible-sm,
-  td.visible-sm {
-    display: table-cell !important;
-  }
-}
-@media (min-width: 768px) and (max-width: 991px) {
-  .visible-sm-block {
-    display: block !important;
-  }
-}
-@media (min-width: 768px) and (max-width: 991px) {
-  .visible-sm-inline {
-    display: inline !important;
-  }
-}
-@media (min-width: 768px) and (max-width: 991px) {
-  .visible-sm-inline-block {
-    display: inline-block !important;
-  }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
-  .visible-md {
-    display: block !important;
-  }
-  table.visible-md {
-    display: table !important;
-  }
-  tr.visible-md {
-    display: table-row !important;
-  }
-  th.visible-md,
-  td.visible-md {
-    display: table-cell !important;
-  }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
-  .visible-md-block {
-    display: block !important;
-  }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
-  .visible-md-inline {
-    display: inline !important;
-  }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
-  .visible-md-inline-block {
-    display: inline-block !important;
-  }
-}
-@media (min-width: 1200px) {
-  .visible-lg {
-    display: block !important;
-  }
-  table.visible-lg {
-    display: table !important;
-  }
-  tr.visible-lg {
-    display: table-row !important;
-  }
-  th.visible-lg,
-  td.visible-lg {
-    display: table-cell !important;
-  }
-}
-@media (min-width: 1200px) {
-  .visible-lg-block {
-    display: block !important;
-  }
-}
-@media (min-width: 1200px) {
-  .visible-lg-inline {
-    display: inline !important;
-  }
-}
-@media (min-width: 1200px) {
-  .visible-lg-inline-block {
-    display: inline-block !important;
-  }
-}
-@media (max-width: 767px) {
-  .hidden-xs {
-    display: none !important;
-  }
-}
-@media (min-width: 768px) and (max-width: 991px) {
-  .hidden-sm {
-    display: none !important;
-  }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
-  .hidden-md {
-    display: none !important;
-  }
-}
-@media (min-width: 1200px) {
-  .hidden-lg {
-    display: none !important;
-  }
-}
-.visible-print {
-  display: none !important;
-}
-@media print {
-  .visible-print {
-    display: block !important;
-  }
-  table.visible-print {
-    display: table !important;
-  }
-  tr.visible-print {
-    display: table-row !important;
-  }
-  th.visible-print,
-  td.visible-print {
-    display: table-cell !important;
-  }
-}
-.visible-print-block {
-  display: none !important;
-}
-@media print {
-  .visible-print-block {
-    display: block !important;
-  }
-}
-.visible-print-inline {
-  display: none !important;
-}
-@media print {
-  .visible-print-inline {
-    display: inline !important;
-  }
-}
-.visible-print-inline-block {
-  display: none !important;
-}
-@media print {
-  .visible-print-inline-block {
-    display: inline-block !important;
-  }
-}
-@media print {
-  .hidden-print {
-    display: none !important;
-  }
-}
-/*# sourceMappingURL=bootstrap.css.map */
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.css.map b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.css.map
deleted file mode 100644
index 09f8cda..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.css.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["bootstrap.css","less/normalize.less","less/print.less","less/glyphicons.less","less/scaffolding.less","less/mixins/vendor-prefixes.less","less/mixins/tab-focus.less","less/mixins/image.less","less/type.less","less/mixins/text-emphasis.less","less/mixins/background-variant.less","less/mixins/text-overflow.less","less/code.less","less/grid.less","less/mixins/grid.less","less/mixins/grid-framework.less","less/tables.less","less/mixins/table-row.less","less/forms.less","less/mixins/forms.less","less/buttons.less","less/mixins/buttons.less","less/mixins/opacity.less","less/component-animations.less","less/dropdowns.less","less/mixins/nav-divider.less","less/mixins/reset-filter.less","less/button-groups.less","less/mixins/border-radius.less","less/input-groups.less","less/navs.less","less/navbar.less","less/mixins/nav-vertical-align.less","less/utilities.less","less/breadcrumbs.less","less/pagination.less","less/mixins/pagination.less","less/pager.less","less/labels.less","less/mixins/labels.less","less/badges.less","less/jumbotron.less","less/thumbnails.less","less/alerts.less","less/mixins/alerts.less","less/progress-bars.less","less/mixins/gradients.less","less/mixins/progress-bar.less","less/media.less","less/list-group.less","less/mixins/list-group.less","less/panels.less","less/mixins/panels.less","less/responsive-embed.less","less/wells.less","less/close.less","less/modals.less","less/tooltip.less","less/mixins/reset-text.less","less/popovers.less","less/carousel.less","less/mixins/clearfix.less","less/mixins/center-block.less","less/mixins/hide-text.less","less/responsive-utilities.less","less/mixins/responsive-visibility.less"],"names":[],"mappings":"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AW,iBAAA;CHsR9C;AGrRmC;EAAW,iBAAA;CHwR9C;AGvRmC;EAAW,iBAAA;CH0R9C;AGzRmC;EAAW,iBAAA;CH4R9C;AG3RmC;EAAW,iBAAA;CH8R9C;AG7RmC;EAAW,iBAAA;CHgS9C;AG/RmC;EAAW,iBAAA;CHkS9C;AGjSmC;EAAW,iBAAA;CHoS9C;AGnSmC;EAAW,iBAAA;CHsS9C;AGrSmC;EAAW,iBAAA;CHwS9C;AGvSmC;EAAW,iBAAA;CH0S9C;AGzSmC;EAAW,iBAAA;CH4S9C;AG3SmC;EAAW,iBAAA;CH8S9C;AG7SmC;EAAW,iBAAA;CHgT9C;AG/SmC;EAAW,iBAAA;CHkT9C;AGjTmC;EAAW,iBAAA;CHoT9C;AGnTmC;EAAW,iBAAA;CHsT9C;AGrTmC;EAAW,iBAAA;CHwT9C;AGvTmC;EAAW,iBAAA;CH0T9C;AGzTmC;EAAW,iBAAA;CH4T9C;AG3TmC;EAAW,iBAAA;CH8T9C;AG7TmC;EAAW,iBAAA;CHgU9C;AG/TmC;EAAW,iBAAA;CHkU9C;AGjUmC;EAAW,iBAAA;CHoU9C;AGnUmC;EAAW,iBAAA;CHsU9C;AGrUmC;EAAW,iBAAA;CHwU9C;AGvUmC;EAAW,iBAAA;CH0U9C;AGzUmC;EAAW,iBAAA;CH4U9C;AG3UmC;EAAW,iBAAA;CH8U9C;AG7UmC;EAAW,iBAAA;CHgV9C;AG/UmC;EAAW,iBAAA;CHkV9C;AGjVmC;EAAW,iBAAA;CHoV9C;AGnVmC;EAAW,iBAAA;CHsV9C;AGrVmC;EAAW,iBAAA;CHwV9C;AGvVmC;EAAW,iBAAA;CH0V9C;AGzVmC;EAAW,iBAAA;CH4V9C;AG3VmC;EAAW,iBAAA;CH8V9C;AG7VmC;EAAW,iBAAA;CHgW9C;AG/VmC;EAAW,iBAAA;CHkW9C;AGjWmC;EAAW,iBAAA;CHoW9C;AGnWmC;EAAW,iBAAA;CHsW9C;AGrWmC;EAAW,iBAAA;CHwW9C;AGvWmC;EAAW,iBAAA;CH0W9C;AGzWmC;EAAW,iBAAA;CH4W9C;AG3WmC;EAAW,iBAAA;CH8W9C;AG7WmC;EAAW,iBAAA;CHgX9C;AG/WmC;EAAW,iBAAA;CHkX9C;AGjXmC;EAAW,iBAAA;CHoX9C;AGnXmC;EAAW,iBAAA;CHsX9C;AGrXmC;EAAW,iBAAA;CHwX9C;AGvXmC;EAAW,iBAAA;CH0X9C;AGzXmC;EAAW,iBAAA;CH4X9C;AG3XmC;EAAW,iBAAA;CH8X9C;AG7XmC;EAAW,iBAAA;CHgY9C;AG/XmC;EAAW,iBAAA;CHkY9C;AGjYmC;EAAW,iBAAA;CHoY9C;AGnYmC;EAAW,iBAAA;CHsY9C;AGrYmC;EAAW,iBAAA;CHwY9C;AGvYmC;EAAW,iBAAA;CH0Y9C;AGzYmC;EAAW,iBAAA;CH4Y9C;AG3YmC;EAAW,iBAAA;CH8Y9C;AG7YmC;EAAW,iBAAA;CHgZ9C;AG/YmC;EAAW,iBAAA;CHkZ9C;AGjZmC;EAAW,iBAAA;CHoZ9C;AGnZmC;EAAW,iBAAA;CHsZ9C;AGrZmC;EAAW,iBAAA;CHwZ9C;AGvZmC;EAAW,iBAAA;CH0Z9C;AGzZmC;EAAW,iBAAA;CH4Z9C;AG3ZmC;EAAW,iBAAA;CH8Z9C;AG7ZmC;EAAW,iBAAA;CHga9C;AG/ZmC;EAAW,iBAAA;CHka9C;AGjamC;EAAW,iBAAA;CHoa9C;AGnamC;EAAW,iBAAA;CHsa9C;AGramC;EAAW,iBAAA;CHwa9C;AGvamC;EAAW,iBAAA;CH0a9C;AGzamC;EAAW,iBAAA;CH4a9C;AG3amC;EAAW,iBAAA;CH8a9C;AG7amC;EAAW,iBAAA;CHgb9C;AG/amC;EAAW,iBAAA;CHkb9C;AGjbmC;EAAW,iBAAA;CHob9C;AGnbmC;EAAW,iBAAA;CHsb9C;AGrbmC;EAAW,iBAAA;CHwb9C;AGvbmC;EAAW,iBAAA;CH0b9C;AGzbmC;EAAW,iBAAA;CH4b9C;AG3bmC;EAAW,iBAAA;CH8b9C;AG7bmC;EAAW,iBAAA;CHgc9C;AG/bmC;EAAW,iBAAA;CHkc9C;AGjcmC;EAAW,iBAAA;CHoc9C;AGncmC;EAAW,iBAAA;CHsc9C;AGrcmC;EAAW,iBAAA;CHwc9C;AGvcmC;EAAW,iBAAA;CH0c9C;AGzcmC;EAAW,iBAAA;CH4c9C;AG3cmC;EAAW,iBAAA;CH8c9C;AG7cmC;EAAW,iBAAA;CHgd9C;AG/cmC;EAAW,iBAAA;CHkd9C;AGjdmC;EAAW,iBAAA;CHod9C;AGndmC;EAAW,iBAAA;CHsd9C;AGrdmC;EAAW,iBAAA;CHwd9C;AGvdmC;EAAW,iBAAA;CH0d9C;AGzdmC;EAAW,iBAAA;CH4d9C;AG3dmC;EAAW,iBAAA;CH8d9C;AG7dmC;EAAW,iBAAA;CHge9C;AG/dmC;EAAW,iBAAA;CHke9C;AGjemC;EAAW,iBAAA;CHoe9C;AGnemC;EAAW,iBAAA;CHse9C;AGremC;EAAW,iBAAA;CHwe9C;AGvemC;EAAW,iBAAA;CH0e9C;AGzemC;EAAW,iBAAA;CH4e9C;AG3emC;EAAW,iBAAA;CH8e9C;AG7emC;EAAW,iBAAA;CHgf9C;AG/emC;EAAW,iBAAA;CHkf9C;AGjfmC;EAAW,iBAAA;CHof9C;AGnfmC;EAAW,iBAAA;CHsf9C;AGrfmC;EAAW,iBAAA;CHwf9C;AGvfmC;EAAW,iBAAA;CH0f9C;AGzfmC;EAAW,iBAAA;CH4f9C;AG3fmC;EAAW,iBAAA;CH8f9C;AG7fmC;EAAW,iBAAA;CHggB9C;AG/fmC;EAAW,iBAAA;CHkgB9C;AGjgBmC;EAAW,iBAAA;CHogB9C;AGngBmC;EAAW,iBAAA;CHsgB9C;AGrgBmC;EAAW,iBAAA;CHwgB9C;AGvgBmC;EAAW,iBAAA;CH0gB9C;AGzgBmC;EAAW,iBAAA;CH4gB9C;AG3gBmC;EAAW,iBAAA;CH8gB9C;AG7gBmC;EAAW,iBAAA;CHghB9C;AG/gBmC;EAAW,iBAAA;CHkhB9C;AGjhBmC;EAAW,iBAAA;CHohB9C;AGnhBmC;EAAW,iBAAA;CHshB9C;AGrhBmC;EAAW,iBAAA;CHwhB9C;AGvhBmC;EAAW,iBAAA;CH0hB9C;AGzhBmC;EAAW,iBAAA;CH4hB9C;AG3hBmC;EAAW,iBAAA;CH8hB9C;AG7hBmC;EAAW,iBAAA;CHgiB9C;AG/hBmC;EAAW,iBAAA;CHkiB9C;AGjiBmC;EAAW,iBAAA;CHoiB9C;AGniBmC;EAAW,iBAAA;CHsiB9C;AGriBmC;EAAW,iBAAA;CHwiB9C;AGviBmC;EAAW,iBAAA;CH0iB9C;AGziBmC;EAAW,iBAAA;CH4iB9C;AG3iBmC;EAAW,iBAAA;CH8iB9C;AG7iBmC;EAAW,iBAAA;CHgjB9C;AG/iBmC;EAAW,iBAAA;CHkjB9C;AGjjBmC;EAAW,iBAAA;CHojB9C;AGnjBmC;EAAW,iBAAA;CHsjB9C;AGrjBmC;EAAW,iBAAA;CHwjB9C;AGvjBmC;EAAW,iBAAA;CH0jB9C;AGzjBmC;EAAW,iBAAA;CH4jB9C;AG3jBmC;EAAW,iBAAA;CH8jB9C;AG7jBmC;EAAW,iBAAA;CHgkB9C;AG/jBmC;EAAW,iBAAA;CHkkB9C;AGjkBmC;EAAW,iBAAA;CHokB9C;AGnkBmC;EAAW,iBAAA;CHskB9C;AGrkBmC;EAAW,iBAAA;CHwkB9C;AGvkBmC;EAAW,iBAAA;CH0kB9C;AGzkBmC;EAAW,iBAAA;CH4kB9C;AG3kBmC;EAAW,iBAAA;CH8kB9C;AG7kBmC;EAAW,iBAAA;CHglB9C;AG/kBmC;EAAW,iBAAA;CHklB9C;AGjlBmC;EAAW,iBAAA;CHolB9C;AGnlBmC;EAAW,iBAAA;CHslB9C;AGrlBmC;EAAW,iBAAA;CHwlB9C;AGvlBmC;EAAW,iBAAA;CH0lB9C;AGzlBmC;EAAW,iBAAA;CH4lB9C;AG3lBmC;EAAW,iBAAA;CH8lB9C;AG7lBmC;EAAW,iBAAA;CHgmB9C;AG/lBmC;EAAW,iBAAA;CHkmB9C;AGjmBmC;EAAW,iBAAA;CHomB9C;AGnmBmC;EAAW,iBAAA;CHsmB9C;AGrmBmC;EAAW,iBAAA;CHwmB9C;AGvmBmC;EAAW,iBAAA;CH0mB9C;AGzmBmC;EAAW,iBAAA;CH4mB9C;AG3mBmC;EAAW,iBAAA;CH8mB9C;AG7mBmC;EAAW,iBAAA;CHgnB9C;AG/mBmC;EAAW,iBAAA;CHknB9C;AGjnBmC;EAAW,iBAAA;CHonB9C;AGnnBmC;EAAW,iBAAA;CHsnB9C;AGrnBmC;EAAW,iBAAA;CHwnB9C;AGvnBmC;EAAW,iBAAA;CH0nB9C;AGznBmC;EAAW,iBAAA;CH4nB9C;AG3nBmC;EAAW,iBAAA;CH8nB9C;AG7nBmC;EAAW,iBAAA;CHgoB9C;AG/nBmC;EAAW,iBAAA;CHkoB9C;AGjoBmC;EAAW,iBAAA;CHooB9C;AGnoBmC;EAAW,iBAAA;CHsoB9C;AGroBmC;EAAW,iBAAA;CHwoB9C;AG/nBmC;EAAW,iBAAA;CHkoB9C;AGjoBmC;EAAW,iBAAA;CHooB9C;AGnoBmC;EAAW,iBAAA;CHsoB9C;AGroBmC;EAAW,iBAAA;CHwoB9C;AGvoBmC;EAAW,iBAAA;CH0oB9C;AGzoBmC;EAAW,iBAAA;CH4oB9C;AG3oBmC;EAAW,iBAAA;CH8oB9C;AG7oBmC;EAAW,iBAAA;CHgpB9C;AG/oBmC;EAAW,iBAAA;CHkpB9C;AGjpBmC;EAAW,iBAAA;CHopB9C;AGnpBmC;EAAW,iBAAA;CHspB9C;AGrpBmC;EAAW,iBAAA;CHwpB9C;AGvpBmC;EAAW,iBAAA;CH0pB9C;AGzpBmC;EAAW,iBAAA;CH4pB9C;AG3pBmC;EAAW,iBAAA;CH8pB9C;AG7pBmC;EAAW,iBAAA;CHgqB9C;AG/pBmC;EAAW,iBAAA;CHkqB9C;AGjqBmC;EAAW,iBAAA;CHoqB9C;AGnqBmC;EAAW,iBAAA;CHsqB9C;AGrqBmC;EAAW,iBAAA;CHwqB9C;AGvqBmC;EAAW,iBAAA;CH0qB9C;AGzqBmC;EAAW,iBAAA;CH4qB9C;AG3qBmC;EAAW,iBAAA;CH8qB9C;AG7qBmC;EAAW,iBAAA;CHgrB9C;AG/qBmC;EAAW,iBAAA;CHkrB9C;AGjrBmC;EAAW,iBAAA;CHorB9C;AGnrBmC;EAAW,iBAAA;CHsrB9C;AGrrBmC;EAAW,iBAAA;CHwrB9C;AGvrBmC;EAAW,iBAAA;CH0rB9C;AGzrBmC;EAAW,iBAAA;CH4rB9C;AG3rBmC;EAAW,iBAAA;CH8rB9C;AG7rBmC;EAAW,iBAAA;CHgsB9C;AG/rBmC;EAAW,iBAAA;CHksB9C;AGjsBmC;EAAW,iBAAA;CHosB9C;AGnsBmC;EAAW,iBAAA;CHssB9C;AGrsBmC;EAAW,iBAAA;CHwsB9C;AGvsBmC;EAAW,iBAAA;CH0sB9C;AGzsBmC;EAAW,iBAAA;CH4sB9C;AG3sBmC;EAAW,iBAAA;CH8sB9C;AG7sBmC;EAAW,iBAAA;CHgtB9C;AG/sBmC;EAAW,iBAAA;CHktB9C;AGjtBmC;EAAW,iBAAA;CHotB9C;AGntBmC;EAAW,iBAAA;CHstB9C;AGrtBmC;EAAW,iBAAA;CHwtB9C;AGvtBmC;EAAW,iBAAA;CH0tB9C;AGztBmC;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CE,oBAAA;CfwkDH;AezkDC;EACE,oBAAA;Cf2kDH;Ae5kDC;EACE,WAAA;Cf8kDH;Ae/kDC;EACE,oBAAA;CfilDH;AellDC;EACE,mBAAA;CfolDH;AehlDC;EACE,YAAA;CfklDH;AelmDC;EACE,WAAA;CfomDH;AermDC;EACE,mBAAA;CfumDH;AexmDC;EACE,mBAAA;Cf0mDH;Ae3mDC;EACE,UAAA;Cf6mDH;Ae9mDC;EACE,mBAAA;CfgnDH;AejnDC;EACE,mBAAA;CfmnDH;AepnDC;EACE,UAAA;CfsnDH;AevnDC;EACE,mBAAA;CfynDH;Ae1nDC;EACE,mBAAA;Cf4nDH;Ae7nDC;EACE,UAAA;Cf+nDH;AehoDC;EACE,mBAAA;CfkoDH;AenoDC;EACE,kBAAA;CfqoDH;AejoDC;EACE,WAAA;CfmoDH;AernDC;EACE,kBAAA;CfunDH;AexnDC;EACE,0BAAA;Cf0nDH;Ae3nDC;EACE,0BAAA;Cf6nDH;Ae9nDC;EACE,iBAAA;CfgoDH;AejoDC;EACE,0BAAA;CfmoDH;AepoDC;EACE,0BAAA;CfsoDH;AevoDC;EACE,iBAAA;CfyoDH;Ae1oDC;EACE,0BAAA;Cf4oDH;Ae7oDC;EACE,0BAAA;Cf+oDH;AehpDC;EACE,iBAAA;CfkpDH;AenpDC;EACE,0BAAA;CfqpDH;AetpDC;EACE,yBAAA;CfwpDH;AezpDC;EACE,gBAAA;Cf2pDH;Aa3pDD;EElCI;IACE,YAAA;GfgsDH;EezrDD;IACE,YAAA;Gf2rDD;Ee5rDD;IACE,oBAAA;Gf8rDD;Ee/rDD;IACE,oBAAA;GfisDD;EelsDD;IACE,WAAA;GfosDD;EersDD;IACE,oBAAA;GfusDD;EexsDD;IACE,oBAAA;Gf0sDD;Ee3sDD;IACE,WAAA;Gf6sDD;Ee9sDD;IACE,oBAAA;GfgtDD;EejtDD;IACE,oBAAA;GfmtDD;EeptDD;IACE,WAAA;GfstDD;EevtDD;IACE,oBAAA;GfytDD;Ee1tDD;IACE,mBAAA;Gf4tDD;Ee9sDD;IACE,YAAA;GfgtDD;EejtDD;IACE,oBAAA;GfmtDD;EeptDD;IACE,oBAAA;GfstDD;EevtDD;IACE,WAAA;GfytDD;Ee1tDD;IACE,oBAAA;Gf4tDD;Ee7tDD;IACE,oBAAA;Gf+tDD;EehuDD;IACE,WAAA;GfkuDD;EenuDD;IACE,oBAAA;GfquDD;EetuDD;IACE,oBAAA;GfwuDD;EezuDD;IACE,WAAA;Gf2uDD;Ee5uDD;IACE,oBAAA;Gf8uDD;Ee/uDD;IACE,mBAAA;GfivDD;Ee7uDD;IACE,YAAA;Gf+uDD;Ee/vDD;IACE,WAAA;GfiwDD;EelwDD;IACE,mBAAA;GfowDD;EerwDD;IACE,mBAAA;GfuwDD;EexwDD;IACE,UAAA;Gf0wDD;Ee3wDD;IACE,mBAAA;Gf6wDD;Ee9wDD;IACE,mBAAA;GfgxDD;EejxDD;IACE,UAAA;GfmxDD;EepxDD;IACE,mBAAA;GfsxDD;EevxDD;IACE,mBAAA;GfyxDD;Ee1xDD;IACE,UAAA;Gf4xDD;Ee7xDD;IACE,mBAAA;Gf+xDD;EehyDD;IACE,kBAAA;GfkyDD;Ee9xDD;IACE,WAAA;GfgyDD;EelxDD;IACE,kBAAA;GfoxDD;EerxDD;IACE,0BAAA;GfuxDD;EexxDD;IACE,0BAAA;Gf0xDD;Ee3xDD;IACE,iBAAA;Gf6xDD;Ee9xDD;IACE,0BAAA;GfgyDD;EejyDD;IACE,0BAAA;GfmyDD;EepyDD;IACE,iBAAA;GfsyDD;EevyDD;IACE,0BAAA;GfyyDD;Ee1yDD;IACE,0BAAA;Gf4yDD;Ee7yDD;IACE,iBAAA;Gf+yDD;EehzDD;IACE,0BAAA;GfkzDD;EenzDD;IACE,yBAAA;GfqzDD;EetzDD;IACE,gBAAA;GfwzDD;CACF;AahzDD;EE3CI;IACE,YAAA;Gf81DH;Eev1DD;IACE,YAAA;Gfy1DD;Ee11DD;IACE,oBAAA;Gf41DD;Ee71DD;IACE,oBAAA;Gf+1DD;Eeh2DD;IACE,WAAA;Gfk2DD;Een2DD;IACE,oBAAA;Gfq2DD;Eet2DD;IACE,oBAAA;Gfw2DD;Eez2DD;IACE,WAAA;Gf22DD;Ee52DD;IACE,oBAAA;Gf82DD;Ee/2DD;IACE,oBAAA;Gfi3DD;Eel3DD;IACE,WAAA;Gfo3DD;Eer3DD;IACE,oBAAA;Gfu3DD;Eex3DD;IACE,mBAAA;Gf03DD;Ee52DD;IACE,YAAA;Gf82DD;Ee/2DD;IACE,oBAAA;Gfi3DD;Eel3DD;IACE,oBAAA;Gfo3DD;Eer3DD;IACE,WAAA;Gfu3DD;Eex3DD;IACE,oBAAA;Gf03DD;Ee33DD;IACE,oBAAA;Gf63DD;Ee93DD;IACE,WAAA;Gfg4DD;Eej4DD;IACE,oBAAA;Gfm4DD;Eep4DD;IACE,oBAAA;Gfs4DD;Eev4DD;IACE,WAAA;Gfy4DD;Ee14DD;IACE,oBAAA;Gf44DD;Ee74DD;IACE,mBAAA;Gf+4DD;Ee34DD;IACE,YAAA;Gf64DD;Ee75DD;IACE,WAAA;Gf+5DD;Eeh6DD;IACE,mBAAA;Gfk6DD;Een6DD;IACE,mBAAA;Gfq6DD;Eet6DD;IACE,UAAA;Gfw6DD;Eez6DD;IACE,mBAAA;Gf26DD;Ee56DD;IACE,mBAAA;Gf86DD;Ee/6DD;IACE,UAAA;Gfi7DD;Eel7DD;IACE,mBAAA;Gfo7DD;Eer7DD;IACE,mBAAA;Gfu7DD;Eex7DD;IACE,UAAA;Gf07DD;Ee37DD;IACE,mBAAA;Gf67DD;Ee97DD;IACE,kBAAA;Gfg8DD;Ee57DD;IACE,WAAA;Gf87DD;Eeh7DD;IACE,kBAAA;Gfk7DD;Een7DD;IACE,0BAAA;Gfq7DD;Eet7DD;IACE,0BAAA;Gfw7DD;Eez7DD;IACE,iBAAA;Gf27DD;Ee57DD;IACE,0BAAA;Gf87DD;Ee/7DD;IACE,0BAAA;Gfi8DD;Eel8DD;IACE,iBAAA;Gfo8DD;Eer8DD;IACE,0BAAA;Gfu8DD;Eex8DD;IACE,0BAAA;Gf08DD;Ee38DD;IACE,iBAAA;Gf68DD;Ee98DD;IACE,0BAAA;Gfg9DD;Eej9DD;IACE,yBAAA;Gfm9DD;Eep9DD;IACE,gBAAA;Gfs9DD;CACF;Aa38DD;EE9CI;IACE,YAAA;Gf4/DH;Eer/DD;IACE,YAAA;Gfu/DD;Eex/DD;IACE,oBAAA;Gf0/DD;Ee3/DD;IACE,oBAAA;Gf6/DD;Ee9/DD;IACE,WAAA;GfggED;EejgED;IACE,oBAAA;GfmgED;EepgED;IACE,oBAAA;GfsgED;EevgED;IACE,WAAA;GfygED;Ee1gED;IACE,oBAAA;Gf4gED;Ee7gED;IACE,oBAAA;Gf+gED;EehhED;IACE,WAAA;GfkhED;EenhED;IACE,oBAAA;GfqhED;EethED;IACE,mBAAA;GfwhED;Ee1gED;IACE,YAAA;Gf4gED;Ee7gED;IACE,oBAAA;Gf+gED;EehhED;IACE,oBAAA;GfkhED;EenhED;IACE,WAAA;GfqhED;EethED;IACE,oBAAA;GfwhED;EezhED;IACE,oBAAA;Gf2hED;Ee5hED;IACE,WAAA;Gf8hED;Ee/hED;IACE,oBAAA;GfiiED;EeliED;IACE,oBAAA;GfoiED;EeriED;IACE,WAAA;GfuiED;EexiED;IACE,oBAAA;Gf0iED;Ee3iED;IACE,mBAAA;Gf6iED;EeziED;IACE,YAAA;Gf2iED;Ee3jED;IACE,WAAA;Gf6jED;Ee9jED;IACE,mBAAA;GfgkED;EejkED;IACE,mBAAA;GfmkED;EepkED;IACE,UAAA;GfskED;EevkED;IACE,mBAAA;GfykED;Ee1kED;IACE,mBAAA;Gf4kED;Ee7kED;IACE,UAAA;Gf+kED;EehlED;IACE,mBAAA;GfklED;EenlED;IACE,mBAAA;GfqlED;EetlED;IACE,UAAA;GfwlED;EezlED;IACE,mBAAA;Gf2lED;Ee5lED;IACE,kBAAA;Gf8lED;Ee1lED;IACE,WAAA;Gf4lED;Ee9kED;IACE,kBAAA;GfglED;EejlED;IACE,0BAAA;GfmlED;EeplED;IACE,0BAAA;GfslED;EevlED;IACE,iBAAA;GfylED;Ee1lED;IACE,0BAAA;Gf4lED;Ee7lED;IACE,0BAAA;Gf+lED;EehmED;IACE,iBAAA;GfkmED;EenmED;IACE,0BAAA;GfqmED;EetmED;IACE,0BAAA;GfwmED;EezmED;IACE,iBAAA;Gf2mED;Ee5mED;IACE,0BAAA;Gf8mED;Ee/mED;IACE,yBAAA;GfinED;EelnED;IACE,gBAAA;GfonED;CACF;AgBxrED;EACE,8BAAA;ChB0rED;AgBxrED;EACE,iBAAA;EACA,oBAAA;EACA,eAAA;EACA,iBAAA;ChB0rED;AgBxrED;EACE,iBAAA;ChB0rED;AgBprED;EACE,YA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","file":"bootstrap.css","sourcesContent":["/*!\n * Bootstrap v3.3.6 (http://getbootstrap.com)\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\nhtml {\n  font-family: sans-serif;\n  -ms-text-size-adjust: 100%;\n  -webkit-text-size-adjust: 100%;\n}\nbody {\n  margin: 0;\n}\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nmenu,\nnav,\nsection,\nsummary {\n  display: block;\n}\naudio,\ncanvas,\nprogress,\nvideo {\n  display: inline-block;\n  vertical-align: baseline;\n}\naudio:not([controls]) {\n  display: none;\n  height: 0;\n}\n[hidden],\ntemplate {\n  display: none;\n}\na {\n  background-color: transparent;\n}\na:active,\na:hover {\n  outline: 0;\n}\nabbr[title] {\n  border-bottom: 1px dotted;\n}\nb,\nstrong {\n  font-weight: bold;\n}\ndfn {\n  font-style: italic;\n}\nh1 {\n  font-size: 2em;\n  margin: 0.67em 0;\n}\nmark {\n  background: #ff0;\n  color: #000;\n}\nsmall {\n  font-size: 80%;\n}\nsub,\nsup {\n  font-size: 75%;\n  line-height: 0;\n  position: relative;\n  vertical-align: baseline;\n}\nsup {\n  top: -0.5em;\n}\nsub {\n  bottom: -0.25em;\n}\nimg {\n  border: 0;\n}\nsvg:not(:root) {\n  overflow: hidden;\n}\nfigure {\n  margin: 1em 40px;\n}\nhr {\n  box-sizing: content-box;\n  height: 0;\n}\npre {\n  overflow: auto;\n}\ncode,\nkbd,\npre,\nsamp {\n  font-family: monospace, monospace;\n  font-size: 1em;\n}\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n  color: inherit;\n  font: inherit;\n  margin: 0;\n}\nbutton {\n  overflow: visible;\n}\nbutton,\nselect {\n  text-transform: none;\n}\nbutton,\nhtml input[type=\"button\"],\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n  -webkit-appearance: button;\n  cursor: pointer;\n}\nbutton[disabled],\nhtml input[disabled] {\n  cursor: default;\n}\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n  border: 0;\n  padding: 0;\n}\ninput {\n  line-height: normal;\n}\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n  box-sizing: border-box;\n  padding: 0;\n}\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n  height: auto;\n}\ninput[type=\"search\"] {\n  -webkit-appearance: textfield;\n  box-sizing: content-box;\n}\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n  -webkit-appearance: none;\n}\nfieldset {\n  border: 1px solid #c0c0c0;\n  margin: 0 2px;\n  padding: 0.35em 0.625em 0.75em;\n}\nlegend {\n  border: 0;\n  padding: 0;\n}\ntextarea {\n  overflow: auto;\n}\noptgroup {\n  font-weight: bold;\n}\ntable {\n  border-collapse: collapse;\n  border-spacing: 0;\n}\ntd,\nth {\n  padding: 0;\n}\n/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */\n@media print {\n  *,\n  *:before,\n  *:after {\n    background: transparent !important;\n    color: #000 !important;\n    box-shadow: none !important;\n    text-shadow: none !important;\n  }\n  a,\n  a:visited {\n    text-decoration: underline;\n  }\n  a[href]:after {\n    content: \" (\" attr(href) \")\";\n  }\n  abbr[title]:after {\n    content: \" (\" attr(title) \")\";\n  }\n  a[href^=\"#\"]:after,\n  a[href^=\"javascript:\"]:after {\n    content: \"\";\n  }\n  pre,\n  blockquote {\n    border: 1px solid #999;\n    page-break-inside: avoid;\n  }\n  thead {\n    display: table-header-group;\n  }\n  tr,\n  img {\n    page-break-inside: avoid;\n  }\n  img {\n    max-width: 100% !important;\n  }\n  p,\n  h2,\n  h3 {\n    orphans: 3;\n    widows: 3;\n  }\n  h2,\n  h3 {\n    page-break-after: avoid;\n  }\n  .navbar {\n    display: none;\n  }\n  .btn > .caret,\n  .dropup > .btn > .caret {\n    border-top-color: #000 !important;\n  }\n  .label {\n    border: 1px solid #000;\n  }\n  .table {\n    border-collapse: collapse !important;\n  }\n  .table td,\n  .table th {\n    background-color: #fff !important;\n  }\n  .table-bordered th,\n  .table-bordered td {\n    border: 1px solid #ddd !important;\n  }\n}\n@font-face {\n  font-family: 'Glyphicons Halflings';\n  src: url('../fonts/glyphicons-halflings-regular.eot');\n  src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');\n}\n.glyphicon {\n  position: relative;\n  top: 1px;\n  display: inline-block;\n  font-family: 'Glyphicons Halflings';\n  font-style: normal;\n  font-weight: normal;\n  line-height: 1;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n.glyphicon-asterisk:before {\n  content: \"\\002a\";\n}\n.glyphicon-plus:before {\n  content: \"\\002b\";\n}\n.glyphicon-euro:before,\n.glyphicon-eur:before {\n  content: \"\\20ac\";\n}\n.glyphicon-minus:before {\n  content: \"\\2212\";\n}\n.glyphicon-cloud:before {\n  content: \"\\2601\";\n}\n.glyphicon-envelope:before {\n  content: \"\\2709\";\n}\n.glyphicon-pencil:before {\n  content: \"\\270f\";\n}\n.glyphicon-glass:before {\n  content: \"\\e001\";\n}\n.glyphicon-music:before {\n  content: \"\\e002\";\n}\n.glyphicon-search:before {\n  content: \"\\e003\";\n}\n.glyphicon-heart:before {\n  content: \"\\e005\";\n}\n.glyphicon-star:before {\n  content: \"\\e006\";\n}\n.glyphicon-star-empty:before {\n  content: \"\\e007\";\n}\n.glyphicon-user:before {\n  content: \"\\e008\";\n}\n.glyphicon-film:before {\n  content: \"\\e009\";\n}\n.glyphicon-th-large:before {\n  content: \"\\e010\";\n}\n.glyphicon-th:before {\n  content: \"\\e011\";\n}\n.glyphicon-th-list:before {\n  content: \"\\e012\";\n}\n.glyphicon-ok:before {\n  content: \"\\e013\";\n}\n.glyphicon-remove:before {\n  content: \"\\e014\";\n}\n.glyphicon-zoom-in:before {\n  content: \"\\e015\";\n}\n.glyphicon-zoom-out:before {\n  content: \"\\e016\";\n}\n.glyphicon-off:before {\n  content: \"\\e017\";\n}\n.glyphicon-signal:before {\n  content: \"\\e018\";\n}\n.glyphicon-cog:before {\n  content: \"\\e019\";\n}\n.glyphicon-trash:before {\n  content: \"\\e020\";\n}\n.glyphicon-home:before {\n  content: \"\\e021\";\n}\n.glyphicon-file:before {\n  content: \"\\e022\";\n}\n.glyphicon-time:before {\n  content: \"\\e023\";\n}\n.glyphicon-road:before {\n  content: \"\\e024\";\n}\n.glyphicon-download-alt:before {\n  content: \"\\e025\";\n}\n.glyphicon-download:before {\n  content: \"\\e026\";\n}\n.glyphicon-upload:before {\n  content: \"\\e027\";\n}\n.glyphicon-inbox:before {\n  content: \"\\e028\";\n}\n.glyphicon-play-circle:before {\n  content: \"\\e029\";\n}\n.glyphicon-repeat:before {\n  content: \"\\e030\";\n}\n.glyphicon-refresh:before {\n  content: \"\\e031\";\n}\n.glyphicon-list-alt:before {\n  content: \"\\e032\";\n}\n.glyphicon-lock:before {\n  content: \"\\e033\";\n}\n.glyphicon-flag:before {\n  content: \"\\e034\";\n}\n.glyphicon-headphones:before {\n  content: \"\\e035\";\n}\n.glyphicon-volume-off:before {\n  content: \"\\e036\";\n}\n.glyphicon-volume-down:before {\n  content: \"\\e037\";\n}\n.glyphicon-volume-up:before {\n  content: \"\\e038\";\n}\n.glyphicon-qrcode:before {\n  content: \"\\e039\";\n}\n.glyphicon-barcode:before {\n  content: \"\\e040\";\n}\n.glyphicon-tag:before {\n  content: \"\\e041\";\n}\n.glyphicon-tags:before {\n  content: \"\\e042\";\n}\n.glyphicon-book:before {\n  content: \"\\e043\";\n}\n.glyphicon-bookmark:before {\n  content: \"\\e044\";\n}\n.glyphicon-print:before {\n  content: \"\\e045\";\n}\n.glyphicon-camera:before {\n  content: \"\\e046\";\n}\n.glyphicon-font:before {\n  content: \"\\e047\";\n}\n.glyphicon-bold:before {\n  content: \"\\e048\";\n}\n.glyphicon-italic:before {\n  content: \"\\e049\";\n}\n.glyphicon-text-height:before {\n  content: \"\\e050\";\n}\n.glyphicon-text-width:before {\n  content: \"\\e051\";\n}\n.glyphicon-align-left:before {\n  content: \"\\e052\";\n}\n.glyphicon-align-center:before {\n  content: \"\\e053\";\n}\n.glyphicon-align-right:before {\n  content: \"\\e054\";\n}\n.glyphicon-align-justify:before {\n  content: \"\\e055\";\n}\n.glyphicon-list:before {\n  content: \"\\e056\";\n}\n.glyphicon-indent-left:before {\n  content: \"\\e057\";\n}\n.glyphicon-indent-right:before {\n  content: \"\\e058\";\n}\n.glyphicon-facetime-video:before {\n  content: \"\\e059\";\n}\n.glyphicon-picture:before {\n  content: \"\\e060\";\n}\n.glyphicon-map-marker:before {\n  content: \"\\e062\";\n}\n.glyphicon-adjust:before {\n  content: \"\\e063\";\n}\n.glyphicon-tint:before {\n  content: \"\\e064\";\n}\n.glyphicon-edit:before {\n  content: \"\\e065\";\n}\n.glyphicon-share:before {\n  content: \"\\e066\";\n}\n.glyphicon-check:before {\n  content: \"\\e067\";\n}\n.glyphicon-move:before {\n  content: \"\\e068\";\n}\n.glyphicon-step-backward:before {\n  content: \"\\e069\";\n}\n.glyphicon-fast-backward:before {\n  content: \"\\e070\";\n}\n.glyphicon-backward:before {\n  content: \"\\e071\";\n}\n.glyphicon-play:before {\n  content: \"\\e072\";\n}\n.glyphicon-pause:before {\n  content: \"\\e073\";\n}\n.glyphicon-stop:before {\n  content: \"\\e074\";\n}\n.glyphicon-forward:before {\n  content: \"\\e075\";\n}\n.glyphicon-fast-forward:before {\n  content: \"\\e076\";\n}\n.glyphicon-step-forward:before {\n  content: \"\\e077\";\n}\n.glyphicon-eject:before {\n  content: \"\\e078\";\n}\n.glyphicon-chevron-left:before {\n  content: \"\\e079\";\n}\n.glyphicon-chevron-right:before {\n  content: \"\\e080\";\n}\n.glyphicon-plus-sign:before {\n  content: \"\\e081\";\n}\n.glyphicon-minus-sign:before {\n  content: \"\\e082\";\n}\n.glyphicon-remove-sign:before {\n  content: \"\\e083\";\n}\n.glyphicon-ok-sign:before {\n  content: \"\\e084\";\n}\n.glyphicon-question-sign:before {\n  content: \"\\e085\";\n}\n.glyphicon-info-sign:before {\n  content: \"\\e086\";\n}\n.glyphicon-screenshot:before {\n  content: \"\\e087\";\n}\n.glyphicon-remove-circle:before {\n  content: \"\\e088\";\n}\n.glyphicon-ok-circle:before {\n  content: \"\\e089\";\n}\n.glyphicon-ban-circle:before {\n  content: \"\\e090\";\n}\n.glyphicon-arrow-left:before {\n  content: \"\\e091\";\n}\n.glyphicon-arrow-right:before {\n  content: \"\\e092\";\n}\n.glyphicon-arrow-up:before {\n  content: \"\\e093\";\n}\n.glyphicon-arrow-down:before {\n  content: \"\\e094\";\n}\n.glyphicon-share-alt:before {\n  content: \"\\e095\";\n}\n.glyphicon-resize-full:before {\n  content: \"\\e096\";\n}\n.glyphicon-resize-small:before {\n  content: \"\\e097\";\n}\n.glyphicon-exclamation-sign:before {\n  content: \"\\e101\";\n}\n.glyphicon-gift:before {\n  content: \"\\e102\";\n}\n.glyphicon-leaf:before {\n  content: \"\\e103\";\n}\n.glyphicon-fire:before {\n  content: \"\\e104\";\n}\n.glyphicon-eye-open:before {\n  content: \"\\e105\";\n}\n.glyphicon-eye-close:before {\n  content: \"\\e106\";\n}\n.glyphicon-warning-sign:before {\n  content: \"\\e107\";\n}\n.glyphicon-plane:before {\n  content: \"\\e108\";\n}\n.glyphicon-calendar:before {\n  content: \"\\e109\";\n}\n.glyphicon-random:before {\n  content: \"\\e110\";\n}\n.glyphicon-comment:before {\n  content: \"\\e111\";\n}\n.glyphicon-magnet:before {\n  content: \"\\e112\";\n}\n.glyphicon-chevron-up:before {\n  content: \"\\e113\";\n}\n.glyphicon-chevron-down:before {\n  content: \"\\e114\";\n}\n.glyphicon-retweet:before {\n  content: \"\\e115\";\n}\n.glyphicon-shopping-cart:before {\n  content: \"\\e116\";\n}\n.glyphicon-folder-close:before {\n  content: \"\\e117\";\n}\n.glyphicon-folder-open:before {\n  content: \"\\e118\";\n}\n.glyphicon-resize-vertical:before {\n  content: \"\\e119\";\n}\n.glyphicon-resize-horizontal:before {\n  content: \"\\e120\";\n}\n.glyphicon-hdd:before {\n  content: \"\\e121\";\n}\n.glyphicon-bullhorn:before {\n  content: \"\\e122\";\n}\n.glyphicon-bell:before {\n  content: \"\\e123\";\n}\n.glyphicon-certificate:before {\n  content: \"\\e124\";\n}\n.glyphicon-thumbs-up:before {\n  content: \"\\e125\";\n}\n.glyphicon-thumbs-down:before {\n  content: \"\\e126\";\n}\n.glyphicon-hand-right:before {\n  content: \"\\e127\";\n}\n.glyphicon-hand-left:before {\n  content: \"\\e128\";\n}\n.glyphicon-hand-up:before {\n  content: \"\\e129\";\n}\n.glyphicon-hand-down:before {\n  content: \"\\e130\";\n}\n.glyphicon-circle-arrow-right:before {\n  content: \"\\e131\";\n}\n.glyphicon-circle-arrow-left:before {\n  content: \"\\e132\";\n}\n.glyphicon-circle-arrow-up:before {\n  content: \"\\e133\";\n}\n.glyphicon-circle-arrow-down:before {\n  content: \"\\e134\";\n}\n.glyphicon-globe:before {\n  content: \"\\e135\";\n}\n.glyphicon-wrench:before {\n  content: \"\\e136\";\n}\n.glyphicon-tasks:before {\n  content: \"\\e137\";\n}\n.glyphicon-filter:before {\n  content: \"\\e138\";\n}\n.glyphicon-briefcase:before {\n  content: \"\\e139\";\n}\n.glyphicon-fullscreen:before {\n  content: \"\\e140\";\n}\n.glyphicon-dashboard:before {\n  content: \"\\e141\";\n}\n.glyphicon-paperclip:before {\n  content: \"\\e142\";\n}\n.glyphicon-heart-empty:before {\n  content: \"\\e143\";\n}\n.glyphicon-link:before {\n  content: \"\\e144\";\n}\n.glyphicon-phone:before {\n  content: \"\\e145\";\n}\n.glyphicon-pushpin:before {\n  content: \"\\e146\";\n}\n.glyphicon-usd:before {\n  content: \"\\e148\";\n}\n.glyphicon-gbp:before {\n  content: \"\\e149\";\n}\n.glyphicon-sort:before {\n  content: \"\\e150\";\n}\n.glyphicon-sort-by-alphabet:before {\n  content: \"\\e151\";\n}\n.glyphicon-sort-by-alphabet-alt:before {\n  content: \"\\e152\";\n}\n.glyphicon-sort-by-order:before {\n  content: \"\\e153\";\n}\n.glyphicon-sort-by-order-alt:before {\n  content: \"\\e154\";\n}\n.glyphicon-sort-by-attributes:before {\n  content: \"\\e155\";\n}\n.glyphicon-sort-by-attributes-alt:before {\n  content: \"\\e156\";\n}\n.glyphicon-unchecked:before {\n  content: \"\\e157\";\n}\n.glyphicon-expand:before {\n  content: \"\\e158\";\n}\n.glyphicon-collapse-down:before {\n  content: \"\\e159\";\n}\n.glyphicon-collapse-up:before {\n  content: \"\\e160\";\n}\n.glyphicon-log-in:before {\n  content: \"\\e161\";\n}\n.glyphicon-flash:before {\n  content: \"\\e162\";\n}\n.glyphicon-log-out:before {\n  content: \"\\e163\";\n}\n.glyphicon-new-window:before {\n  content: \"\\e164\";\n}\n.glyphicon-record:before {\n  content: \"\\e165\";\n}\n.glyphicon-save:before {\n  content: \"\\e166\";\n}\n.glyphicon-open:before {\n  content: \"\\e167\";\n}\n.glyphicon-saved:before {\n  content: \"\\e168\";\n}\n.glyphicon-import:before {\n  content: \"\\e169\";\n}\n.glyphicon-export:before {\n  content: \"\\e170\";\n}\n.glyphicon-send:before {\n  content: \"\\e171\";\n}\n.glyphicon-floppy-disk:before {\n  content: \"\\e172\";\n}\n.glyphicon-floppy-saved:before {\n  content: \"\\e173\";\n}\n.glyphicon-floppy-remove:before {\n  content: \"\\e174\";\n}\n.glyphicon-floppy-save:before {\n  content: \"\\e175\";\n}\n.glyphicon-floppy-open:before {\n  content: \"\\e176\";\n}\n.glyphicon-credit-card:before {\n  content: \"\\e177\";\n}\n.glyphicon-transfer:before {\n  content: \"\\e178\";\n}\n.glyphicon-cutlery:before {\n  content: \"\\e179\";\n}\n.glyphicon-header:before {\n  content: \"\\e180\";\n}\n.glyphicon-compressed:before {\n  content: \"\\e181\";\n}\n.glyphicon-earphone:before {\n  content: \"\\e182\";\n}\n.glyphicon-phone-alt:before {\n  content: \"\\e183\";\n}\n.glyphicon-tower:before {\n  content: \"\\e184\";\n}\n.glyphicon-stats:before {\n  content: \"\\e185\";\n}\n.glyphicon-sd-video:before {\n  content: \"\\e186\";\n}\n.glyphicon-hd-video:before {\n  content: \"\\e187\";\n}\n.glyphicon-subtitles:before {\n  content: \"\\e188\";\n}\n.glyphicon-sound-stereo:before {\n  content: \"\\e189\";\n}\n.glyphicon-sound-dolby:before {\n  content: \"\\e190\";\n}\n.glyphicon-sound-5-1:before {\n  content: \"\\e191\";\n}\n.glyphicon-sound-6-1:before {\n  content: \"\\e192\";\n}\n.glyphicon-sound-7-1:before {\n  content: \"\\e193\";\n}\n.glyphicon-copyright-mark:before {\n  content: \"\\e194\";\n}\n.glyphicon-registration-mark:before {\n  content: \"\\e195\";\n}\n.glyphicon-cloud-download:before {\n  content: \"\\e197\";\n}\n.glyphicon-cloud-upload:before {\n  content: \"\\e198\";\n}\n.glyphicon-tree-conifer:before {\n  content: \"\\e199\";\n}\n.glyphicon-tree-deciduous:before {\n  content: \"\\e200\";\n}\n.glyphicon-cd:before {\n  content: \"\\e201\";\n}\n.glyphicon-save-file:before {\n  content: \"\\e202\";\n}\n.glyphicon-open-file:before {\n  content: \"\\e203\";\n}\n.glyphicon-level-up:before {\n  content: \"\\e204\";\n}\n.glyphicon-copy:before {\n  content: \"\\e205\";\n}\n.glyphicon-paste:before {\n  content: \"\\e206\";\n}\n.glyphicon-alert:before {\n  content: \"\\e209\";\n}\n.glyphicon-equalizer:before {\n  content: \"\\e210\";\n}\n.glyphicon-king:before {\n  content: \"\\e211\";\n}\n.glyphicon-queen:before {\n  content: \"\\e212\";\n}\n.glyphicon-pawn:before {\n  content: \"\\e213\";\n}\n.glyphicon-bishop:before {\n  content: \"\\e214\";\n}\n.glyphicon-knight:before {\n  content: \"\\e215\";\n}\n.glyphicon-baby-formula:before {\n  content: \"\\e216\";\n}\n.glyphicon-tent:before {\n  content: \"\\26fa\";\n}\n.glyphicon-blackboard:before {\n  content: \"\\e218\";\n}\n.glyphicon-bed:before {\n  content: \"\\e219\";\n}\n.glyphicon-apple:before {\n  content: \"\\f8ff\";\n}\n.glyphicon-erase:before {\n  content: \"\\e221\";\n}\n.glyphicon-hourglass:before {\n  content: \"\\231b\";\n}\n.glyphicon-lamp:before {\n  content: \"\\e223\";\n}\n.glyphicon-duplicate:before {\n  content: \"\\e224\";\n}\n.glyphicon-piggy-bank:before {\n  content: \"\\e225\";\n}\n.glyphicon-scissors:before {\n  content: \"\\e226\";\n}\n.glyphicon-bitcoin:before {\n  content: \"\\e227\";\n}\n.glyphicon-btc:before {\n  content: \"\\e227\";\n}\n.glyphicon-xbt:before {\n  content: \"\\e227\";\n}\n.glyphicon-yen:before {\n  content: \"\\00a5\";\n}\n.glyphicon-jpy:before {\n  content: \"\\00a5\";\n}\n.glyphicon-ruble:before {\n  content: \"\\20bd\";\n}\n.glyphicon-rub:before {\n  content: \"\\20bd\";\n}\n.glyphicon-scale:before {\n  content: \"\\e230\";\n}\n.glyphicon-ice-lolly:before {\n  content: \"\\e231\";\n}\n.glyphicon-ice-lolly-tasted:before {\n  content: \"\\e232\";\n}\n.glyphicon-education:before {\n  content: \"\\e233\";\n}\n.glyphicon-option-horizontal:before {\n  content: \"\\e234\";\n}\n.glyphicon-option-vertical:before {\n  content: \"\\e235\";\n}\n.glyphicon-menu-hamburger:before {\n  content: \"\\e236\";\n}\n.glyphicon-modal-window:before {\n  content: \"\\e237\";\n}\n.glyphicon-oil:before {\n  content: \"\\e238\";\n}\n.glyphicon-grain:before {\n  content: \"\\e239\";\n}\n.glyphicon-sunglasses:before {\n  content: \"\\e240\";\n}\n.glyphicon-text-size:before {\n  content: \"\\e241\";\n}\n.glyphicon-text-color:before {\n  content: \"\\e242\";\n}\n.glyphicon-text-background:before {\n  content: \"\\e243\";\n}\n.glyphicon-object-align-top:before {\n  content: \"\\e244\";\n}\n.glyphicon-object-align-bottom:before {\n  content: \"\\e245\";\n}\n.glyphicon-object-align-horizontal:before {\n  content: \"\\e246\";\n}\n.glyphicon-object-align-left:before {\n  content: \"\\e247\";\n}\n.glyphicon-object-align-vertical:before {\n  content: \"\\e248\";\n}\n.glyphicon-object-align-right:before {\n  content: \"\\e249\";\n}\n.glyphicon-triangle-right:before {\n  content: \"\\e250\";\n}\n.glyphicon-triangle-left:before {\n  content: \"\\e251\";\n}\n.glyphicon-triangle-bottom:before {\n  content: \"\\e252\";\n}\n.glyphicon-triangle-top:before {\n  content: \"\\e253\";\n}\n.glyphicon-console:before {\n  content: \"\\e254\";\n}\n.glyphicon-superscript:before {\n  content: \"\\e255\";\n}\n.glyphicon-subscript:before {\n  content: \"\\e256\";\n}\n.glyphicon-menu-left:before {\n  content: \"\\e257\";\n}\n.glyphicon-menu-right:before {\n  content: \"\\e258\";\n}\n.glyphicon-menu-down:before {\n  content: \"\\e259\";\n}\n.glyphicon-menu-up:before {\n  content: \"\\e260\";\n}\n* {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n}\n*:before,\n*:after {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n}\nhtml {\n  font-size: 10px;\n  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\nbody {\n  font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n  font-size: 14px;\n  line-height: 1.42857143;\n  color: #333333;\n  background-color: #fff;\n}\ninput,\nbutton,\nselect,\ntextarea {\n  font-family: inherit;\n  font-size: inherit;\n  line-height: inherit;\n}\na {\n  color: #337ab7;\n  text-decoration: none;\n}\na:hover,\na:focus {\n  color: #23527c;\n  text-decoration: underline;\n}\na:focus {\n  outline: thin dotted;\n  outline: 5px auto -webkit-focus-ring-color;\n  outline-offset: -2px;\n}\nfigure {\n  margin: 0;\n}\nimg {\n  vertical-align: middle;\n}\n.img-responsive,\n.thumbnail > img,\n.thumbnail a > img,\n.carousel-inner > .item > img,\n.carousel-inner > .item > a > img {\n  display: block;\n  max-width: 100%;\n  height: auto;\n}\n.img-rounded {\n  border-radius: 6px;\n}\n.img-thumbnail {\n  padding: 4px;\n  line-height: 1.42857143;\n  background-color: #fff;\n  border: 1px solid #ddd;\n  border-radius: 4px;\n  -webkit-transition: all 0.2s ease-in-out;\n  -o-transition: all 0.2s ease-in-out;\n  transition: all 0.2s ease-in-out;\n  display: inline-block;\n  max-width: 100%;\n  height: auto;\n}\n.img-circle {\n  border-radius: 50%;\n}\nhr {\n  margin-top: 20px;\n  margin-bottom: 20px;\n  border: 0;\n  border-top: 1px solid #eeeeee;\n}\n.sr-only {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  margin: -1px;\n  padding: 0;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  border: 0;\n}\n.sr-only-focusable:active,\n.sr-only-focusable:focus {\n  position: static;\n  width: auto;\n  height: auto;\n  margin: 0;\n  overflow: visible;\n  clip: auto;\n}\n[role=\"button\"] {\n  cursor: pointer;\n}\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\n.h1,\n.h2,\n.h3,\n.h4,\n.h5,\n.h6 {\n  font-family: inherit;\n  font-weight: 500;\n  line-height: 1.1;\n  color: inherit;\n}\nh1 small,\nh2 small,\nh3 small,\nh4 small,\nh5 small,\nh6 small,\n.h1 small,\n.h2 small,\n.h3 small,\n.h4 small,\n.h5 small,\n.h6 small,\nh1 .small,\nh2 .small,\nh3 .small,\nh4 .small,\nh5 .small,\nh6 .small,\n.h1 .small,\n.h2 .small,\n.h3 .small,\n.h4 .small,\n.h5 .small,\n.h6 .small {\n  font-weight: normal;\n  line-height: 1;\n  color: #777777;\n}\nh1,\n.h1,\nh2,\n.h2,\nh3,\n.h3 {\n  margin-top: 20px;\n  margin-bottom: 10px;\n}\nh1 small,\n.h1 small,\nh2 small,\n.h2 small,\nh3 small,\n.h3 small,\nh1 .small,\n.h1 .small,\nh2 .small,\n.h2 .small,\nh3 .small,\n.h3 .small {\n  font-size: 65%;\n}\nh4,\n.h4,\nh5,\n.h5,\nh6,\n.h6 {\n  margin-top: 10px;\n  margin-bottom: 10px;\n}\nh4 small,\n.h4 small,\nh5 small,\n.h5 small,\nh6 small,\n.h6 small,\nh4 .small,\n.h4 .small,\nh5 .small,\n.h5 .small,\nh6 .small,\n.h6 .small {\n  font-size: 75%;\n}\nh1,\n.h1 {\n  font-size: 36px;\n}\nh2,\n.h2 {\n  font-size: 30px;\n}\nh3,\n.h3 {\n  font-size: 24px;\n}\nh4,\n.h4 {\n  font-size: 18px;\n}\nh5,\n.h5 {\n  font-size: 14px;\n}\nh6,\n.h6 {\n  font-size: 12px;\n}\np {\n  margin: 0 0 10px;\n}\n.lead {\n  margin-bottom: 20px;\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.4;\n}\n@media (min-width: 768px) {\n  .lead {\n    font-size: 21px;\n  }\n}\nsmall,\n.small {\n  font-size: 85%;\n}\nmark,\n.mark {\n  background-color: #fcf8e3;\n  padding: .2em;\n}\n.text-left {\n  text-align: left;\n}\n.text-right {\n  text-align: right;\n}\n.text-center {\n  text-align: center;\n}\n.text-justify {\n  text-align: justify;\n}\n.text-nowrap {\n  white-space: nowrap;\n}\n.text-lowercase {\n  text-transform: lowercase;\n}\n.text-uppercase {\n  text-transform: uppercase;\n}\n.text-capitalize {\n  text-transform: capitalize;\n}\n.text-muted {\n  color: #777777;\n}\n.text-primary {\n  color: #337ab7;\n}\na.text-primary:hover,\na.text-primary:focus {\n  color: #286090;\n}\n.text-success {\n  color: #3c763d;\n}\na.text-success:hover,\na.text-success:focus {\n  color: #2b542c;\n}\n.text-info {\n  color: #31708f;\n}\na.text-info:hover,\na.text-info:focus {\n  color: #245269;\n}\n.text-warning {\n  color: #8a6d3b;\n}\na.text-warning:hover,\na.text-warning:focus {\n  color: #66512c;\n}\n.text-danger {\n  color: #a94442;\n}\na.text-danger:hover,\na.text-danger:focus {\n  color: #843534;\n}\n.bg-primary {\n  color: #fff;\n  background-color: #337ab7;\n}\na.bg-primary:hover,\na.bg-primary:focus {\n  background-color: #286090;\n}\n.bg-success {\n  background-color: #dff0d8;\n}\na.bg-success:hover,\na.bg-success:focus {\n  background-color: #c1e2b3;\n}\n.bg-info {\n  background-color: #d9edf7;\n}\na.bg-info:hover,\na.bg-info:focus {\n  background-color: #afd9ee;\n}\n.bg-warning {\n  background-color: #fcf8e3;\n}\na.bg-warning:hover,\na.bg-warning:focus {\n  background-color: #f7ecb5;\n}\n.bg-danger {\n  background-color: #f2dede;\n}\na.bg-danger:hover,\na.bg-danger:focus {\n  background-color: #e4b9b9;\n}\n.page-header {\n  padding-bottom: 9px;\n  margin: 40px 0 20px;\n  border-bottom: 1px solid #eeeeee;\n}\nul,\nol {\n  margin-top: 0;\n  margin-bottom: 10px;\n}\nul ul,\nol ul,\nul ol,\nol ol {\n  margin-bottom: 0;\n}\n.list-unstyled {\n  padding-left: 0;\n  list-style: none;\n}\n.list-inline {\n  padding-left: 0;\n  list-style: none;\n  margin-left: -5px;\n}\n.list-inline > li {\n  display: inline-block;\n  padding-left: 5px;\n  padding-right: 5px;\n}\ndl {\n  margin-top: 0;\n  margin-bottom: 20px;\n}\ndt,\ndd {\n  line-height: 1.42857143;\n}\ndt {\n  font-weight: bold;\n}\ndd {\n  margin-left: 0;\n}\n@media (min-width: 768px) {\n  .dl-horizontal dt {\n    float: left;\n    width: 160px;\n    clear: left;\n    text-align: right;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n  .dl-horizontal dd {\n    margin-left: 180px;\n  }\n}\nabbr[title],\nabbr[data-original-title] {\n  cursor: help;\n  border-bottom: 1px dotted #777777;\n}\n.initialism {\n  font-size: 90%;\n  text-transform: uppercase;\n}\nblockquote {\n  padding: 10px 20px;\n  margin: 0 0 20px;\n  font-size: 17.5px;\n  border-left: 5px solid #eeeeee;\n}\nblockquote p:last-child,\nblockquote ul:last-child,\nblockquote ol:last-child {\n  margin-bottom: 0;\n}\nblockquote footer,\nblockquote small,\nblockquote .small {\n  display: block;\n  font-size: 80%;\n  line-height: 1.42857143;\n  color: #777777;\n}\nblockquote footer:before,\nblockquote small:before,\nblockquote .small:before {\n  content: '\\2014 \\00A0';\n}\n.blockquote-reverse,\nblockquote.pull-right {\n  padding-right: 15px;\n  padding-left: 0;\n  border-right: 5px solid #eeeeee;\n  border-left: 0;\n  text-align: right;\n}\n.blockquote-reverse footer:before,\nblockquote.pull-right footer:before,\n.blockquote-reverse small:before,\nblockquote.pull-right small:before,\n.blockquote-reverse .small:before,\nblockquote.pull-right .small:before {\n  content: '';\n}\n.blockquote-reverse footer:after,\nblockquote.pull-right footer:after,\n.blockquote-reverse small:after,\nblockquote.pull-right small:after,\n.blockquote-reverse .small:after,\nblockquote.pull-right .small:after {\n  content: '\\00A0 \\2014';\n}\naddress {\n  margin-bottom: 20px;\n  font-style: normal;\n  line-height: 1.42857143;\n}\ncode,\nkbd,\npre,\nsamp {\n  font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\ncode {\n  padding: 2px 4px;\n  font-size: 90%;\n  color: #c7254e;\n  background-color: #f9f2f4;\n  border-radius: 4px;\n}\nkbd {\n  padding: 2px 4px;\n  font-size: 90%;\n  color: #fff;\n  background-color: #333;\n  border-radius: 3px;\n  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);\n}\nkbd kbd {\n  padding: 0;\n  font-size: 100%;\n  font-weight: bold;\n  box-shadow: none;\n}\npre {\n  display: block;\n  padding: 9.5px;\n  margin: 0 0 10px;\n  font-size: 13px;\n  line-height: 1.42857143;\n  word-break: break-all;\n  word-wrap: break-word;\n  color: #333333;\n  background-color: #f5f5f5;\n  border: 1px solid #ccc;\n  border-radius: 4px;\n}\npre code {\n  padding: 0;\n  font-size: inherit;\n  color: inherit;\n  white-space: pre-wrap;\n  background-color: transparent;\n  border-radius: 0;\n}\n.pre-scrollable {\n  max-height: 340px;\n  overflow-y: scroll;\n}\n.container {\n  margin-right: auto;\n  margin-left: auto;\n  padding-left: 15px;\n  padding-right: 15px;\n}\n@media (min-width: 768px) {\n  .container {\n    width: 750px;\n  }\n}\n@media (min-width: 992px) {\n  .container {\n    width: 970px;\n  }\n}\n@media (min-width: 1200px) {\n  .container {\n    width: 1170px;\n  }\n}\n.container-fluid {\n  margin-right: auto;\n  margin-left: auto;\n  padding-left: 15px;\n  padding-right: 15px;\n}\n.row {\n  margin-left: -15px;\n  margin-right: -15px;\n}\n.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {\n  position: relative;\n  min-height: 1px;\n  padding-left: 15px;\n  padding-right: 15px;\n}\n.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {\n  float: left;\n}\n.col-xs-12 {\n  width: 100%;\n}\n.col-xs-11 {\n  width: 91.66666667%;\n}\n.col-xs-10 {\n  width: 83.33333333%;\n}\n.col-xs-9 {\n  width: 75%;\n}\n.col-xs-8 {\n  width: 66.66666667%;\n}\n.col-xs-7 {\n  width: 58.33333333%;\n}\n.col-xs-6 {\n  width: 50%;\n}\n.col-xs-5 {\n  width: 41.66666667%;\n}\n.col-xs-4 {\n  width: 33.33333333%;\n}\n.col-xs-3 {\n  width: 25%;\n}\n.col-xs-2 {\n  width: 16.66666667%;\n}\n.col-xs-1 {\n  width: 8.33333333%;\n}\n.col-xs-pull-12 {\n  right: 100%;\n}\n.col-xs-pull-11 {\n  right: 91.66666667%;\n}\n.col-xs-pull-10 {\n  right: 83.33333333%;\n}\n.col-xs-pull-9 {\n  right: 75%;\n}\n.col-xs-pull-8 {\n  right: 66.66666667%;\n}\n.col-xs-pull-7 {\n  right: 58.33333333%;\n}\n.col-xs-pull-6 {\n  right: 50%;\n}\n.col-xs-pull-5 {\n  right: 41.66666667%;\n}\n.col-xs-pull-4 {\n  right: 33.33333333%;\n}\n.col-xs-pull-3 {\n  right: 25%;\n}\n.col-xs-pull-2 {\n  right: 16.66666667%;\n}\n.col-xs-pull-1 {\n  right: 8.33333333%;\n}\n.col-xs-pull-0 {\n  right: auto;\n}\n.col-xs-push-12 {\n  left: 100%;\n}\n.col-xs-push-11 {\n  left: 91.66666667%;\n}\n.col-xs-push-10 {\n  left: 83.33333333%;\n}\n.col-xs-push-9 {\n  left: 75%;\n}\n.col-xs-push-8 {\n  left: 66.66666667%;\n}\n.col-xs-push-7 {\n  left: 58.33333333%;\n}\n.col-xs-push-6 {\n  left: 50%;\n}\n.col-xs-push-5 {\n  left: 41.66666667%;\n}\n.col-xs-push-4 {\n  left: 33.33333333%;\n}\n.col-xs-push-3 {\n  left: 25%;\n}\n.col-xs-push-2 {\n  left: 16.66666667%;\n}\n.col-xs-push-1 {\n  left: 8.33333333%;\n}\n.col-xs-push-0 {\n  left: auto;\n}\n.col-xs-offset-12 {\n  margin-left: 100%;\n}\n.col-xs-offset-11 {\n  margin-left: 91.66666667%;\n}\n.col-xs-offset-10 {\n  margin-left: 83.33333333%;\n}\n.col-xs-offset-9 {\n  margin-left: 75%;\n}\n.col-xs-offset-8 {\n  margin-left: 66.66666667%;\n}\n.col-xs-offset-7 {\n  margin-left: 58.33333333%;\n}\n.col-xs-offset-6 {\n  margin-left: 50%;\n}\n.col-xs-offset-5 {\n  margin-left: 41.66666667%;\n}\n.col-xs-offset-4 {\n  margin-left: 33.33333333%;\n}\n.col-xs-offset-3 {\n  margin-left: 25%;\n}\n.col-xs-offset-2 {\n  margin-left: 16.66666667%;\n}\n.col-xs-offset-1 {\n  margin-left: 8.33333333%;\n}\n.col-xs-offset-0 {\n  margin-left: 0%;\n}\n@media (min-width: 768px) {\n  .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {\n    float: left;\n  }\n  .col-sm-12 {\n    width: 100%;\n  }\n  .col-sm-11 {\n    width: 91.66666667%;\n  }\n  .col-sm-10 {\n    width: 83.33333333%;\n  }\n  .col-sm-9 {\n    width: 75%;\n  }\n  .col-sm-8 {\n    width: 66.66666667%;\n  }\n  .col-sm-7 {\n    width: 58.33333333%;\n  }\n  .col-sm-6 {\n    width: 50%;\n  }\n  .col-sm-5 {\n    width: 41.66666667%;\n  }\n  .col-sm-4 {\n    width: 33.33333333%;\n  }\n  .col-sm-3 {\n    width: 25%;\n  }\n  .col-sm-2 {\n    width: 16.66666667%;\n  }\n  .col-sm-1 {\n    width: 8.33333333%;\n  }\n  .col-sm-pull-12 {\n    right: 100%;\n  }\n  .col-sm-pull-11 {\n    right: 91.66666667%;\n  }\n  .col-sm-pull-10 {\n    right: 83.33333333%;\n  }\n  .col-sm-pull-9 {\n    right: 75%;\n  }\n  .col-sm-pull-8 {\n    right: 66.66666667%;\n  }\n  .col-sm-pull-7 {\n    right: 58.33333333%;\n  }\n  .col-sm-pull-6 {\n    right: 50%;\n  }\n  .col-sm-pull-5 {\n    right: 41.66666667%;\n  }\n  .col-sm-pull-4 {\n    right: 33.33333333%;\n  }\n  .col-sm-pull-3 {\n    right: 25%;\n  }\n  .col-sm-pull-2 {\n    right: 16.66666667%;\n  }\n  .col-sm-pull-1 {\n    right: 8.33333333%;\n  }\n  .col-sm-pull-0 {\n    right: auto;\n  }\n  .col-sm-push-12 {\n    left: 100%;\n  }\n  .col-sm-push-11 {\n    left: 91.66666667%;\n  }\n  .col-sm-push-10 {\n    left: 83.33333333%;\n  }\n  .col-sm-push-9 {\n    left: 75%;\n  }\n  .col-sm-push-8 {\n    left: 66.66666667%;\n  }\n  .col-sm-push-7 {\n    left: 58.33333333%;\n  }\n  .col-sm-push-6 {\n    left: 50%;\n  }\n  .col-sm-push-5 {\n    left: 41.66666667%;\n  }\n  .col-sm-push-4 {\n    left: 33.33333333%;\n  }\n  .col-sm-push-3 {\n    left: 25%;\n  }\n  .col-sm-push-2 {\n    left: 16.66666667%;\n  }\n  .col-sm-push-1 {\n    left: 8.33333333%;\n  }\n  .col-sm-push-0 {\n    left: auto;\n  }\n  .col-sm-offset-12 {\n    margin-left: 100%;\n  }\n  .col-sm-offset-11 {\n    margin-left: 91.66666667%;\n  }\n  .col-sm-offset-10 {\n    margin-left: 83.33333333%;\n  }\n  .col-sm-offset-9 {\n    margin-left: 75%;\n  }\n  .col-sm-offset-8 {\n    margin-left: 66.66666667%;\n  }\n  .col-sm-offset-7 {\n    margin-left: 58.33333333%;\n  }\n  .col-sm-offset-6 {\n    margin-left: 50%;\n  }\n  .col-sm-offset-5 {\n    margin-left: 41.66666667%;\n  }\n  .col-sm-offset-4 {\n    margin-left: 33.33333333%;\n  }\n  .col-sm-offset-3 {\n    margin-left: 25%;\n  }\n  .col-sm-offset-2 {\n    margin-left: 16.66666667%;\n  }\n  .col-sm-offset-1 {\n    margin-left: 8.33333333%;\n  }\n  .col-sm-offset-0 {\n    margin-left: 0%;\n  }\n}\n@media (min-width: 992px) {\n  .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {\n    float: left;\n  }\n  .col-md-12 {\n    width: 100%;\n  }\n  .col-md-11 {\n    width: 91.66666667%;\n  }\n  .col-md-10 {\n    width: 83.33333333%;\n  }\n  .col-md-9 {\n    width: 75%;\n  }\n  .col-md-8 {\n    width: 66.66666667%;\n  }\n  .col-md-7 {\n    width: 58.33333333%;\n  }\n  .col-md-6 {\n    width: 50%;\n  }\n  .col-md-5 {\n    width: 41.66666667%;\n  }\n  .col-md-4 {\n    width: 33.33333333%;\n  }\n  .col-md-3 {\n    width: 25%;\n  }\n  .col-md-2 {\n    width: 16.66666667%;\n  }\n  .col-md-1 {\n    width: 8.33333333%;\n  }\n  .col-md-pull-12 {\n    right: 100%;\n  }\n  .col-md-pull-11 {\n    right: 91.66666667%;\n  }\n  .col-md-pull-10 {\n    right: 83.33333333%;\n  }\n  .col-md-pull-9 {\n    right: 75%;\n  }\n  .col-md-pull-8 {\n    right: 66.66666667%;\n  }\n  .col-md-pull-7 {\n    right: 58.33333333%;\n  }\n  .col-md-pull-6 {\n    right: 50%;\n  }\n  .col-md-pull-5 {\n    right: 41.66666667%;\n  }\n  .col-md-pull-4 {\n    right: 33.33333333%;\n  }\n  .col-md-pull-3 {\n    right: 25%;\n  }\n  .col-md-pull-2 {\n    right: 16.66666667%;\n  }\n  .col-md-pull-1 {\n    right: 8.33333333%;\n  }\n  .col-md-pull-0 {\n    right: auto;\n  }\n  .col-md-push-12 {\n    left: 100%;\n  }\n  .col-md-push-11 {\n    left: 91.66666667%;\n  }\n  .col-md-push-10 {\n    left: 83.33333333%;\n  }\n  .col-md-push-9 {\n    left: 75%;\n  }\n  .col-md-push-8 {\n    left: 66.66666667%;\n  }\n  .col-md-push-7 {\n    left: 58.33333333%;\n  }\n  .col-md-push-6 {\n    left: 50%;\n  }\n  .col-md-push-5 {\n    left: 41.66666667%;\n  }\n  .col-md-push-4 {\n    left: 33.33333333%;\n  }\n  .col-md-push-3 {\n    left: 25%;\n  }\n  .col-md-push-2 {\n    left: 16.66666667%;\n  }\n  .col-md-push-1 {\n    left: 8.33333333%;\n  }\n  .col-md-push-0 {\n    left: auto;\n  }\n  .col-md-offset-12 {\n    margin-left: 100%;\n  }\n  .col-md-offset-11 {\n    margin-left: 91.66666667%;\n  }\n  .col-md-offset-10 {\n    margin-left: 83.33333333%;\n  }\n  .col-md-offset-9 {\n    margin-left: 75%;\n  }\n  .col-md-offset-8 {\n    margin-left: 66.66666667%;\n  }\n  .col-md-offset-7 {\n    margin-left: 58.33333333%;\n  }\n  .col-md-offset-6 {\n    margin-left: 50%;\n  }\n  .col-md-offset-5 {\n    margin-left: 41.66666667%;\n  }\n  .col-md-offset-4 {\n    margin-left: 33.33333333%;\n  }\n  .col-md-offset-3 {\n    margin-left: 25%;\n  }\n  .col-md-offset-2 {\n    margin-left: 16.66666667%;\n  }\n  .col-md-offset-1 {\n    margin-left: 8.33333333%;\n  }\n  .col-md-offset-0 {\n    margin-left: 0%;\n  }\n}\n@media (min-width: 1200px) {\n  .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {\n    float: left;\n  }\n  .col-lg-12 {\n    width: 100%;\n  }\n  .col-lg-11 {\n    width: 91.66666667%;\n  }\n  .col-lg-10 {\n    width: 83.33333333%;\n  }\n  .col-lg-9 {\n    width: 75%;\n  }\n  .col-lg-8 {\n    width: 66.66666667%;\n  }\n  .col-lg-7 {\n    width: 58.33333333%;\n  }\n  .col-lg-6 {\n    width: 50%;\n  }\n  .col-lg-5 {\n    width: 41.66666667%;\n  }\n  .col-lg-4 {\n    width: 33.33333333%;\n  }\n  .col-lg-3 {\n    width: 25%;\n  }\n  .col-lg-2 {\n    width: 16.66666667%;\n  }\n  .col-lg-1 {\n    width: 8.33333333%;\n  }\n  .col-lg-pull-12 {\n    right: 100%;\n  }\n  .col-lg-pull-11 {\n    right: 91.66666667%;\n  }\n  .col-lg-pull-10 {\n    right: 83.33333333%;\n  }\n  .col-lg-pull-9 {\n    right: 75%;\n  }\n  .col-lg-pull-8 {\n    right: 66.66666667%;\n  }\n  .col-lg-pull-7 {\n    right: 58.33333333%;\n  }\n  .col-lg-pull-6 {\n    right: 50%;\n  }\n  .col-lg-pull-5 {\n    right: 41.66666667%;\n  }\n  .col-lg-pull-4 {\n    right: 33.33333333%;\n  }\n  .col-lg-pull-3 {\n    right: 25%;\n  }\n  .col-lg-pull-2 {\n    right: 16.66666667%;\n  }\n  .col-lg-pull-1 {\n    right: 8.33333333%;\n  }\n  .col-lg-pull-0 {\n    right: auto;\n  }\n  .col-lg-push-12 {\n    left: 100%;\n  }\n  .col-lg-push-11 {\n    left: 91.66666667%;\n  }\n  .col-lg-push-10 {\n    left: 83.33333333%;\n  }\n  .col-lg-push-9 {\n    left: 75%;\n  }\n  .col-lg-push-8 {\n    left: 66.66666667%;\n  }\n  .col-lg-push-7 {\n    left: 58.33333333%;\n  }\n  .col-lg-push-6 {\n    left: 50%;\n  }\n  .col-lg-push-5 {\n    left: 41.66666667%;\n  }\n  .col-lg-push-4 {\n    left: 33.33333333%;\n  }\n  .col-lg-push-3 {\n    left: 25%;\n  }\n  .col-lg-push-2 {\n    left: 16.66666667%;\n  }\n  .col-lg-push-1 {\n    left: 8.33333333%;\n  }\n  .col-lg-push-0 {\n    left: auto;\n  }\n  .col-lg-offset-12 {\n    margin-left: 100%;\n  }\n  .col-lg-offset-11 {\n    margin-left: 91.66666667%;\n  }\n  .col-lg-offset-10 {\n    margin-left: 83.33333333%;\n  }\n  .col-lg-offset-9 {\n    margin-left: 75%;\n  }\n  .col-lg-offset-8 {\n    margin-left: 66.66666667%;\n  }\n  .col-lg-offset-7 {\n    margin-left: 58.33333333%;\n  }\n  .col-lg-offset-6 {\n    margin-left: 50%;\n  }\n  .col-lg-offset-5 {\n    margin-left: 41.66666667%;\n  }\n  .col-lg-offset-4 {\n    margin-left: 33.33333333%;\n  }\n  .col-lg-offset-3 {\n    margin-left: 25%;\n  }\n  .col-lg-offset-2 {\n    margin-left: 16.66666667%;\n  }\n  .col-lg-offset-1 {\n    margin-left: 8.33333333%;\n  }\n  .col-lg-offset-0 {\n    margin-left: 0%;\n  }\n}\ntable {\n  background-color: transparent;\n}\ncaption {\n  padding-top: 8px;\n  padding-bottom: 8px;\n  color: #777777;\n  text-align: left;\n}\nth {\n  text-align: left;\n}\n.table {\n  width: 100%;\n  max-width: 100%;\n  margin-bottom: 20px;\n}\n.table > thead > tr > th,\n.table > tbody > tr > th,\n.table > tfoot > tr > th,\n.table > thead > tr > td,\n.table > tbody > tr > td,\n.table > tfoot > tr > td {\n  padding: 8px;\n  line-height: 1.42857143;\n  vertical-align: top;\n  border-top: 1px solid #ddd;\n}\n.table > thead > tr > th {\n  vertical-align: bottom;\n  border-bottom: 2px solid #ddd;\n}\n.table > caption + thead > tr:first-child > th,\n.table > colgroup + thead > tr:first-child > th,\n.table > thead:first-child > tr:first-child > th,\n.table > caption + thead > tr:first-child > td,\n.table > colgroup + thead > tr:first-child > td,\n.table > thead:first-child > tr:first-child > td {\n  border-top: 0;\n}\n.table > tbody + tbody {\n  border-top: 2px solid #ddd;\n}\n.table .table {\n  background-color: #fff;\n}\n.table-condensed > thead > tr > th,\n.table-condensed > tbody > tr > th,\n.table-condensed > tfoot > tr > th,\n.table-condensed > thead > tr > td,\n.table-condensed > tbody > tr > td,\n.table-condensed > tfoot > tr > td {\n  padding: 5px;\n}\n.table-bordered {\n  border: 1px solid #ddd;\n}\n.table-bordered > thead > tr > th,\n.table-bordered > tbody > tr > th,\n.table-bordered > tfoot > tr > th,\n.table-bordered > thead > tr > td,\n.table-bordered > tbody > tr > td,\n.table-bordered > tfoot > tr > td {\n  border: 1px solid #ddd;\n}\n.table-bordered > thead > tr > th,\n.table-bordered > thead > tr > td {\n  border-bottom-width: 2px;\n}\n.table-striped > tbody > tr:nth-of-type(odd) {\n  background-color: #f9f9f9;\n}\n.table-hover > tbody > tr:hover {\n  background-color: #f5f5f5;\n}\ntable col[class*=\"col-\"] {\n  position: static;\n  float: none;\n  display: table-column;\n}\ntable td[class*=\"col-\"],\ntable th[class*=\"col-\"] {\n  position: static;\n  float: none;\n  display: table-cell;\n}\n.table > thead > tr > td.active,\n.table > tbody > tr > td.active,\n.table > tfoot > tr > td.active,\n.table > thead > tr > th.active,\n.table > tbody > tr > th.active,\n.table > tfoot > tr > th.active,\n.table > thead > tr.active > td,\n.table > tbody > tr.active > td,\n.table > tfoot > tr.active > td,\n.table > thead > tr.active > th,\n.table > tbody > tr.active > th,\n.table > tfoot > tr.active > th {\n  background-color: #f5f5f5;\n}\n.table-hover > tbody > tr > td.active:hover,\n.table-hover > tbody > tr > th.active:hover,\n.table-hover > tbody > tr.active:hover > td,\n.table-hover > tbody > tr:hover > .active,\n.table-hover > tbody > tr.active:hover > th {\n  background-color: #e8e8e8;\n}\n.table > thead > tr > td.success,\n.table > tbody > tr > td.success,\n.table > tfoot > tr > td.success,\n.table > thead > tr > th.success,\n.table > tbody > tr > th.success,\n.table > tfoot > tr > th.success,\n.table > thead > tr.success > td,\n.table > tbody > tr.success > td,\n.table > tfoot > tr.success > td,\n.table > thead > tr.success > th,\n.table > tbody > tr.success > th,\n.table > tfoot > tr.success > th {\n  background-color: #dff0d8;\n}\n.table-hover > tbody > tr > td.success:hover,\n.table-hover > tbody > tr > th.success:hover,\n.table-hover > tbody > tr.success:hover > td,\n.table-hover > tbody > tr:hover > .success,\n.table-hover > tbody > tr.success:hover > th {\n  background-color: #d0e9c6;\n}\n.table > thead > tr > td.info,\n.table > tbody > tr > td.info,\n.table > tfoot > tr > td.info,\n.table > thead > tr > th.info,\n.table > tbody > tr > th.info,\n.table > tfoot > tr > th.info,\n.table > thead > tr.info > td,\n.table > tbody > tr.info > td,\n.table > tfoot > tr.info > td,\n.table > thead > tr.info > th,\n.table > tbody > tr.info > th,\n.table > tfoot > tr.info > th {\n  background-color: #d9edf7;\n}\n.table-hover > tbody > tr > td.info:hover,\n.table-hover > tbody > tr > th.info:hover,\n.table-hover > tbody > tr.info:hover > td,\n.table-hover > tbody > tr:hover > .info,\n.table-hover > tbody > tr.info:hover > th {\n  background-color: #c4e3f3;\n}\n.table > thead > tr > td.warning,\n.table > tbody > tr > td.warning,\n.table > tfoot > tr > td.warning,\n.table > thead > tr > th.warning,\n.table > tbody > tr > th.warning,\n.table > tfoot > tr > th.warning,\n.table > thead > tr.warning > td,\n.table > tbody > tr.warning > td,\n.table > tfoot > tr.warning > td,\n.table > thead > tr.warning > th,\n.table > tbody > tr.warning > th,\n.table > tfoot > tr.warning > th {\n  background-color: #fcf8e3;\n}\n.table-hover > tbody > tr > td.warning:hover,\n.table-hover > tbody > tr > th.warning:hover,\n.table-hover > tbody > tr.warning:hover > td,\n.table-hover > tbody > tr:hover > .warning,\n.table-hover > tbody > tr.warning:hover > th {\n  background-color: #faf2cc;\n}\n.table > thead > tr > td.danger,\n.table > tbody > tr > td.danger,\n.table > tfoot > tr > td.danger,\n.table > thead > tr > th.danger,\n.table > tbody > tr > th.danger,\n.table > tfoot > tr > th.danger,\n.table > thead > tr.danger > td,\n.table > tbody > tr.danger > td,\n.table > tfoot > tr.danger > td,\n.table > thead > tr.danger > th,\n.table > tbody > tr.danger > th,\n.table > tfoot > tr.danger > th {\n  background-color: #f2dede;\n}\n.table-hover > tbody > tr > td.danger:hover,\n.table-hover > tbody > tr > th.danger:hover,\n.table-hover > tbody > tr.danger:hover > td,\n.table-hover > tbody > tr:hover > .danger,\n.table-hover > tbody > tr.danger:hover > th {\n  background-color: #ebcccc;\n}\n.table-responsive {\n  overflow-x: auto;\n  min-height: 0.01%;\n}\n@media screen and (max-width: 767px) {\n  .table-responsive {\n    width: 100%;\n    margin-bottom: 15px;\n    overflow-y: hidden;\n    -ms-overflow-style: -ms-autohiding-scrollbar;\n    border: 1px solid #ddd;\n  }\n  .table-responsive > .table {\n    margin-bottom: 0;\n  }\n  .table-responsive > .table > thead > tr > th,\n  .table-responsive > .table > tbody > tr > th,\n  .table-responsive > .table > tfoot > tr > th,\n  .table-responsive > .table > thead > tr > td,\n  .table-responsive > .table > tbody > tr > td,\n  .table-responsive > .table > tfoot > tr > td {\n    white-space: nowrap;\n  }\n  .table-responsive > .table-bordered {\n    border: 0;\n  }\n  .table-responsive > .table-bordered > thead > tr > th:first-child,\n  .table-responsive > .table-bordered > tbody > tr > th:first-child,\n  .table-responsive > .table-bordered > tfoot > tr > th:first-child,\n  .table-responsive > .table-bordered > thead > tr > td:first-child,\n  .table-responsive > .table-bordered > tbody > tr > td:first-child,\n  .table-responsive > .table-bordered > tfoot > tr > td:first-child {\n    border-left: 0;\n  }\n  .table-responsive > .table-bordered > thead > tr > th:last-child,\n  .table-responsive > .table-bordered > tbody > tr > th:last-child,\n  .table-responsive > .table-bordered > tfoot > tr > th:last-child,\n  .table-responsive > .table-bordered > thead > tr > td:last-child,\n  .table-responsive > .table-bordered > tbody > tr > td:last-child,\n  .table-responsive > .table-bordered > tfoot > tr > td:last-child {\n    border-right: 0;\n  }\n  .table-responsive > .table-bordered > tbody > tr:last-child > th,\n  .table-responsive > .table-bordered > tfoot > tr:last-child > th,\n  .table-responsive > .table-bordered > tbody > tr:last-child > td,\n  .table-responsive > .table-bordered > tfoot > tr:last-child > td {\n    border-bottom: 0;\n  }\n}\nfieldset {\n  padding: 0;\n  margin: 0;\n  border: 0;\n  min-width: 0;\n}\nlegend {\n  display: block;\n  width: 100%;\n  padding: 0;\n  margin-bottom: 20px;\n  font-size: 21px;\n  line-height: inherit;\n  color: #333333;\n  border: 0;\n  border-bottom: 1px solid #e5e5e5;\n}\nlabel {\n  display: inline-block;\n  max-width: 100%;\n  margin-bottom: 5px;\n  font-weight: bold;\n}\ninput[type=\"search\"] {\n  -webkit-box-sizing: border-box;\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n}\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n  margin: 4px 0 0;\n  margin-top: 1px \\9;\n  line-height: normal;\n}\ninput[type=\"file\"] {\n  display: block;\n}\ninput[type=\"range\"] {\n  display: block;\n  width: 100%;\n}\nselect[multiple],\nselect[size] {\n  height: auto;\n}\ninput[type=\"file\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"checkbox\"]:focus {\n  outline: thin dotted;\n  outline: 5px auto -webkit-focus-ring-color;\n  outline-offset: -2px;\n}\noutput {\n  display: block;\n  padding-top: 7px;\n  font-size: 14px;\n  line-height: 1.42857143;\n  color: #555555;\n}\n.form-control {\n  display: block;\n  width: 100%;\n  height: 34px;\n  padding: 6px 12px;\n  font-size: 14px;\n  line-height: 1.42857143;\n  color: #555555;\n  background-color: #fff;\n  background-image: none;\n  border: 1px solid #ccc;\n  border-radius: 4px;\n  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n  -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n  -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n  transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n}\n.form-control:focus {\n  border-color: #66afe9;\n  outline: 0;\n  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);\n  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);\n}\n.form-control::-moz-placeholder {\n  color: #999;\n  opacity: 1;\n}\n.form-control:-ms-input-placeholder {\n  color: #999;\n}\n.form-control::-webkit-input-placeholder {\n  color: #999;\n}\n.form-control::-ms-expand {\n  border: 0;\n  background-color: transparent;\n}\n.form-control[disabled],\n.form-control[readonly],\nfieldset[disabled] .form-control {\n  background-color: #eeeeee;\n  opacity: 1;\n}\n.form-control[disabled],\nfieldset[disabled] .form-control {\n  cursor: not-allowed;\n}\ntextarea.form-control {\n  height: auto;\n}\ninput[type=\"search\"] {\n  -webkit-appearance: none;\n}\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n  input[type=\"date\"].form-control,\n  input[type=\"time\"].form-control,\n  input[type=\"datetime-local\"].form-control,\n  input[type=\"month\"].form-control {\n    line-height: 34px;\n  }\n  input[type=\"date\"].input-sm,\n  input[type=\"time\"].input-sm,\n  input[type=\"datetime-local\"].input-sm,\n  input[type=\"month\"].input-sm,\n  .input-group-sm input[type=\"date\"],\n  .input-group-sm input[type=\"time\"],\n  .input-group-sm input[type=\"datetime-local\"],\n  .input-group-sm input[type=\"month\"] {\n    line-height: 30px;\n  }\n  input[type=\"date\"].input-lg,\n  input[type=\"time\"].input-lg,\n  input[type=\"datetime-local\"].input-lg,\n  input[type=\"month\"].input-lg,\n  .input-group-lg input[type=\"date\"],\n  .input-group-lg input[type=\"time\"],\n  .input-group-lg input[type=\"datetime-local\"],\n  .input-group-lg input[type=\"month\"] {\n    line-height: 46px;\n  }\n}\n.form-group {\n  margin-bottom: 15px;\n}\n.radio,\n.checkbox {\n  position: relative;\n  display: block;\n  margin-top: 10px;\n  margin-bottom: 10px;\n}\n.radio label,\n.checkbox label {\n  min-height: 20px;\n  padding-left: 20px;\n  margin-bottom: 0;\n  font-weight: normal;\n  cursor: pointer;\n}\n.radio input[type=\"radio\"],\n.radio-inline input[type=\"radio\"],\n.checkbox input[type=\"checkbox\"],\n.checkbox-inline input[type=\"checkbox\"] {\n  position: absolute;\n  margin-left: -20px;\n  margin-top: 4px \\9;\n}\n.radio + .radio,\n.checkbox + .checkbox {\n  margin-top: -5px;\n}\n.radio-inline,\n.checkbox-inline {\n  position: relative;\n  display: inline-block;\n  padding-left: 20px;\n  margin-bottom: 0;\n  vertical-align: middle;\n  font-weight: normal;\n  cursor: pointer;\n}\n.radio-inline + .radio-inline,\n.checkbox-inline + .checkbox-inline {\n  margin-top: 0;\n  margin-left: 10px;\n}\ninput[type=\"radio\"][disabled],\ninput[type=\"checkbox\"][disabled],\ninput[type=\"radio\"].disabled,\ninput[type=\"checkbox\"].disabled,\nfieldset[disabled] input[type=\"radio\"],\nfieldset[disabled] input[type=\"checkbox\"] {\n  cursor: not-allowed;\n}\n.radio-inline.disabled,\n.checkbox-inline.disabled,\nfieldset[disabled] .radio-inline,\nfieldset[disabled] .checkbox-inline {\n  cursor: not-allowed;\n}\n.radio.disabled label,\n.checkbox.disabled label,\nfieldset[disabled] .radio label,\nfieldset[disabled] .checkbox label {\n  cursor: not-allowed;\n}\n.form-control-static {\n  padding-top: 7px;\n  padding-bottom: 7px;\n  margin-bottom: 0;\n  min-height: 34px;\n}\n.form-control-static.input-lg,\n.form-control-static.input-sm {\n  padding-left: 0;\n  padding-right: 0;\n}\n.input-sm {\n  height: 30px;\n  padding: 5px 10px;\n  font-size: 12px;\n  line-height: 1.5;\n  border-radius: 3px;\n}\nselect.input-sm {\n  height: 30px;\n  line-height: 30px;\n}\ntextarea.input-sm,\nselect[multiple].input-sm {\n  height: auto;\n}\n.form-group-sm .form-control {\n  height: 30px;\n  padding: 5px 10px;\n  font-size: 12px;\n  line-height: 1.5;\n  border-radius: 3px;\n}\n.form-group-sm select.form-control {\n  height: 30px;\n  line-height: 30px;\n}\n.form-group-sm textarea.form-control,\n.form-group-sm select[multiple].form-control {\n  height: auto;\n}\n.form-group-sm .form-control-static {\n  height: 30px;\n  min-height: 32px;\n  padding: 6px 10px;\n  font-size: 12px;\n  line-height: 1.5;\n}\n.input-lg {\n  height: 46px;\n  padding: 10px 16px;\n  font-size: 18px;\n  line-height: 1.3333333;\n  border-radius: 6px;\n}\nselect.input-lg {\n  height: 46px;\n  line-height: 46px;\n}\ntextarea.input-lg,\nselect[multiple].input-lg {\n  height: auto;\n}\n.form-group-lg .form-control {\n  height: 46px;\n  padding: 10px 16px;\n  font-size: 18px;\n  line-height: 1.3333333;\n  border-radius: 6px;\n}\n.form-group-lg select.form-control {\n  height: 46px;\n  line-height: 46px;\n}\n.form-group-lg textarea.form-control,\n.form-group-lg select[multiple].form-control {\n  height: auto;\n}\n.form-group-lg .form-control-static {\n  height: 46px;\n  min-height: 38px;\n  padding: 11px 16px;\n  font-size: 18px;\n  line-height: 1.3333333;\n}\n.has-feedback {\n  position: relative;\n}\n.has-feedback .form-control {\n  padding-right: 42.5px;\n}\n.form-control-feedback {\n  position: absolute;\n  top: 0;\n  right: 0;\n  z-index: 2;\n  display: block;\n  width: 34px;\n  height: 34px;\n  line-height: 34px;\n  text-align: center;\n  pointer-events: none;\n}\n.input-lg + .form-control-feedback,\n.input-group-lg + .form-control-feedback,\n.form-group-lg .form-control + .form-control-feedback {\n  width: 46px;\n  height: 46px;\n  line-height: 46px;\n}\n.input-sm + .form-control-feedback,\n.input-group-sm + .form-control-feedback,\n.form-group-sm .form-control + .form-control-feedback {\n  width: 30px;\n  height: 30px;\n  line-height: 30px;\n}\n.has-success .help-block,\n.has-success .control-label,\n.has-success .radio,\n.has-success .checkbox,\n.has-success .radio-inline,\n.has-success .checkbox-inline,\n.has-success.radio label,\n.has-success.checkbox label,\n.has-success.radio-inline label,\n.has-success.checkbox-inline label {\n  color: #3c763d;\n}\n.has-success .form-control {\n  border-color: #3c763d;\n  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-success .form-control:focus {\n  border-color: #2b542c;\n  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;\n}\n.has-success .input-group-addon {\n  color: #3c763d;\n  border-color: #3c763d;\n  background-color: #dff0d8;\n}\n.has-success .form-control-feedback {\n  color: #3c763d;\n}\n.has-warning .help-block,\n.has-warning .control-label,\n.has-warning .radio,\n.has-warning .checkbox,\n.has-warning .radio-inline,\n.has-warning .checkbox-inline,\n.has-warning.radio label,\n.has-warning.checkbox label,\n.has-warning.radio-inline label,\n.has-warning.checkbox-inline label {\n  color: #8a6d3b;\n}\n.has-warning .form-control {\n  border-color: #8a6d3b;\n  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-warning .form-control:focus {\n  border-color: #66512c;\n  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;\n}\n.has-warning .input-group-addon {\n  color: #8a6d3b;\n  border-color: #8a6d3b;\n  background-color: #fcf8e3;\n}\n.has-warning .form-control-feedback {\n  color: #8a6d3b;\n}\n.has-error .help-block,\n.has-error .control-label,\n.has-error .radio,\n.has-error .checkbox,\n.has-error .radio-inline,\n.has-error .checkbox-inline,\n.has-error.radio label,\n.has-error.checkbox label,\n.has-error.radio-inline label,\n.has-error.checkbox-inline label {\n  color: #a94442;\n}\n.has-error .form-control {\n  border-color: #a94442;\n  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-error .form-control:focus {\n  border-color: #843534;\n  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;\n}\n.has-error .input-group-addon {\n  color: #a94442;\n  border-color: #a94442;\n  background-color: #f2dede;\n}\n.has-error .form-control-feedback {\n  color: #a94442;\n}\n.has-feedback label ~ .form-control-feedback {\n  top: 25px;\n}\n.has-feedback label.sr-only ~ .form-control-feedback {\n  top: 0;\n}\n.help-block {\n  display: block;\n  margin-top: 5px;\n  margin-bottom: 10px;\n  color: #737373;\n}\n@media (min-width: 768px) {\n  .form-inline .form-group {\n    display: inline-block;\n    margin-bottom: 0;\n    vertical-align: middle;\n  }\n  .form-inline .form-control {\n    display: inline-block;\n    width: auto;\n    vertical-align: middle;\n  }\n  .form-inline .form-control-static {\n    display: inline-block;\n  }\n  .form-inline .input-group {\n    display: inline-table;\n    vertical-align: middle;\n  }\n  .form-inline .input-group .input-group-addon,\n  .form-inline .input-group .input-group-btn,\n  .form-inline .input-group .form-control {\n    width: auto;\n  }\n  .form-inline .input-group > .form-control {\n    width: 100%;\n  }\n  .form-inline .control-label {\n    margin-bottom: 0;\n    vertical-align: middle;\n  }\n  .form-inline .radio,\n  .form-inline .checkbox {\n    display: inline-block;\n    margin-top: 0;\n    margin-bottom: 0;\n    vertical-align: middle;\n  }\n  .form-inline .radio label,\n  .form-inline .checkbox label {\n    padding-left: 0;\n  }\n  .form-inline .radio input[type=\"radio\"],\n  .form-inline .checkbox input[type=\"checkbox\"] {\n    position: relative;\n    margin-left: 0;\n  }\n  .form-inline .has-feedback .form-control-feedback {\n    top: 0;\n  }\n}\n.form-horizontal .radio,\n.form-horizontal .checkbox,\n.form-horizontal .radio-inline,\n.form-horizontal .checkbox-inline {\n  margin-top: 0;\n  margin-bottom: 0;\n  padding-top: 7px;\n}\n.form-horizontal .radio,\n.form-horizontal .checkbox {\n  min-height: 27px;\n}\n.form-horizontal .form-group {\n  margin-left: -15px;\n  margin-right: -15px;\n}\n@media (min-width: 768px) {\n  .form-horizontal .control-label {\n    text-align: right;\n    margin-bottom: 0;\n    padding-top: 7px;\n  }\n}\n.form-horizontal .has-feedback .form-control-feedback {\n  right: 15px;\n}\n@media (min-width: 768px) {\n  .form-horizontal .form-group-lg .control-label {\n    padding-top: 11px;\n    font-size: 18px;\n  }\n}\n@media (min-width: 768px) {\n  .form-horizontal .form-group-sm .control-label {\n    padding-top: 6px;\n    font-size: 12px;\n  }\n}\n.btn {\n  display: inline-block;\n  margin-bottom: 0;\n  font-weight: normal;\n  text-align: center;\n  vertical-align: middle;\n  touch-action: manipulation;\n  cursor: pointer;\n  background-image: none;\n  border: 1px solid transparent;\n  white-space: nowrap;\n  padding: 6px 12px;\n  font-size: 14px;\n  line-height: 1.42857143;\n  border-radius: 4px;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n.btn:focus,\n.btn:active:focus,\n.btn.active:focus,\n.btn.focus,\n.btn:active.focus,\n.btn.active.focus {\n  outline: thin dotted;\n  outline: 5px auto -webkit-focus-ring-color;\n  outline-offset: -2px;\n}\n.btn:hover,\n.btn:focus,\n.btn.focus {\n  color: #333;\n  text-decoration: none;\n}\n.btn:active,\n.btn.active {\n  outline: 0;\n  background-image: none;\n  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n}\n.btn.disabled,\n.btn[disabled],\nfieldset[disabled] .btn {\n  cursor: not-allowed;\n  opacity: 0.65;\n  filter: alpha(opacity=65);\n  -webkit-box-shadow: none;\n  box-shadow: none;\n}\na.btn.disabled,\nfieldset[disabled] a.btn {\n  pointer-events: none;\n}\n.btn-default {\n  color: #333;\n  background-color: #fff;\n  border-color: #ccc;\n}\n.btn-default:focus,\n.btn-default.focus {\n  color: #333;\n  background-color: #e6e6e6;\n  border-color: #8c8c8c;\n}\n.btn-default:hover {\n  color: #333;\n  background-color: #e6e6e6;\n  border-color: #adadad;\n}\n.btn-default:active,\n.btn-default.active,\n.open > .dropdown-toggle.btn-default {\n  color: #333;\n  background-color: #e6e6e6;\n  border-color: #adadad;\n}\n.btn-default:active:hover,\n.btn-default.active:hover,\n.open > .dropdown-toggle.btn-default:hover,\n.btn-default:active:focus,\n.btn-default.active:focus,\n.open > .dropdown-toggle.btn-default:focus,\n.btn-default:active.focus,\n.btn-default.active.focus,\n.open > .dropdown-toggle.btn-default.focus {\n  color: #333;\n  background-color: #d4d4d4;\n  border-color: #8c8c8c;\n}\n.btn-default:active,\n.btn-default.active,\n.open > .dropdown-toggle.btn-default {\n  background-image: none;\n}\n.btn-default.disabled:hover,\n.btn-default[disabled]:hover,\nfieldset[disabled] .btn-default:hover,\n.btn-default.disabled:focus,\n.btn-default[disabled]:focus,\nfieldset[disabled] .btn-default:focus,\n.btn-default.disabled.focus,\n.btn-default[disabled].focus,\nfieldset[disabled] .btn-default.focus {\n  background-color: #fff;\n  border-color: #ccc;\n}\n.btn-default .badge {\n  color: #fff;\n  background-color: #333;\n}\n.btn-primary {\n  color: #fff;\n  background-color: #337ab7;\n  border-color: #2e6da4;\n}\n.btn-primary:focus,\n.btn-primary.focus {\n  color: #fff;\n  background-color: #286090;\n  border-color: #122b40;\n}\n.btn-primary:hover {\n  color: #fff;\n  background-color: #286090;\n  border-color: #204d74;\n}\n.btn-primary:active,\n.btn-primary.active,\n.open > .dropdown-toggle.btn-primary {\n  color: #fff;\n  background-color: #286090;\n  border-color: #204d74;\n}\n.btn-primary:active:hover,\n.btn-primary.active:hover,\n.open > .dropdown-toggle.btn-primary:hover,\n.btn-primary:active:focus,\n.btn-primary.active:focus,\n.open > .dropdown-toggle.btn-primary:focus,\n.btn-primary:active.focus,\n.btn-primary.active.focus,\n.open > .dropdown-toggle.btn-primary.focus {\n  color: #fff;\n  background-color: #204d74;\n  border-color: #122b40;\n}\n.btn-primary:active,\n.btn-primary.active,\n.open > .dropdown-toggle.btn-primary {\n  background-image: none;\n}\n.btn-primary.disabled:hover,\n.btn-primary[disabled]:hover,\nfieldset[disabled] .btn-primary:hover,\n.btn-primary.disabled:focus,\n.btn-primary[disabled]:focus,\nfieldset[disabled] .btn-primary:focus,\n.btn-primary.disabled.focus,\n.btn-primary[disabled].focus,\nfieldset[disabled] .btn-primary.focus {\n  background-color: #337ab7;\n  border-color: #2e6da4;\n}\n.btn-primary .badge {\n  color: #337ab7;\n  background-color: #fff;\n}\n.btn-success {\n  color: #fff;\n  background-color: #5cb85c;\n  border-color: #4cae4c;\n}\n.btn-success:focus,\n.btn-success.focus {\n  color: #fff;\n  background-color: #449d44;\n  border-color: #255625;\n}\n.btn-success:hover {\n  color: #fff;\n  background-color: #449d44;\n  border-color: #398439;\n}\n.btn-success:active,\n.btn-success.active,\n.open > .dropdown-toggle.btn-success {\n  color: #fff;\n  background-color: #449d44;\n  border-color: #398439;\n}\n.btn-success:active:hover,\n.btn-success.active:hover,\n.open > .dropdown-toggle.btn-success:hover,\n.btn-success:active:focus,\n.btn-success.active:focus,\n.open > .dropdown-toggle.btn-success:focus,\n.btn-success:active.focus,\n.btn-success.active.focus,\n.open > .dropdown-toggle.btn-success.focus {\n  color: #fff;\n  background-color: #398439;\n  border-color: #255625;\n}\n.btn-success:active,\n.btn-success.active,\n.open > .dropdown-toggle.btn-success {\n  background-image: none;\n}\n.btn-success.disabled:hover,\n.btn-success[disabled]:hover,\nfieldset[disabled] .btn-success:hover,\n.btn-success.disabled:focus,\n.btn-success[disabled]:focus,\nfieldset[disabled] .btn-success:focus,\n.btn-success.disabled.focus,\n.btn-success[disabled].focus,\nfieldset[disabled] .btn-success.focus {\n  background-color: #5cb85c;\n  border-color: #4cae4c;\n}\n.btn-success .badge {\n  color: #5cb85c;\n  background-color: #fff;\n}\n.btn-info {\n  color: #fff;\n  background-color: #5bc0de;\n  border-color: #46b8da;\n}\n.btn-info:focus,\n.btn-info.focus {\n  color: #fff;\n  background-color: #31b0d5;\n  border-color: #1b6d85;\n}\n.btn-info:hover {\n  color: #fff;\n  background-color: #31b0d5;\n  border-color: #269abc;\n}\n.btn-info:active,\n.btn-info.active,\n.open > .dropdown-toggle.btn-info {\n  color: #fff;\n  background-color: #31b0d5;\n  border-color: #269abc;\n}\n.btn-info:active:hover,\n.btn-info.active:hover,\n.open > .dropdown-toggle.btn-info:hover,\n.btn-info:active:focus,\n.btn-info.active:focus,\n.open > .dropdown-toggle.btn-info:focus,\n.btn-info:active.focus,\n.btn-info.active.focus,\n.open > .dropdown-toggle.btn-info.focus {\n  color: #fff;\n  background-color: #269abc;\n  border-color: #1b6d85;\n}\n.btn-info:active,\n.btn-info.active,\n.open > .dropdown-toggle.btn-info {\n  background-image: none;\n}\n.btn-info.disabled:hover,\n.btn-info[disabled]:hover,\nfieldset[disabled] .btn-info:hover,\n.btn-info.disabled:focus,\n.btn-info[disabled]:focus,\nfieldset[disabled] .btn-info:focus,\n.btn-info.disabled.focus,\n.btn-info[disabled].focus,\nfieldset[disabled] .btn-info.focus {\n  background-color: #5bc0de;\n  border-color: #46b8da;\n}\n.btn-info .badge {\n  color: #5bc0de;\n  background-color: #fff;\n}\n.btn-warning {\n  color: #fff;\n  background-color: #f0ad4e;\n  border-color: #eea236;\n}\n.btn-warning:focus,\n.btn-warning.focus {\n  color: #fff;\n  background-color: #ec971f;\n  border-color: #985f0d;\n}\n.btn-warning:hover {\n  color: #fff;\n  background-color: #ec971f;\n  border-color: #d58512;\n}\n.btn-warning:active,\n.btn-warning.active,\n.open > .dropdown-toggle.btn-warning {\n  color: #fff;\n  background-color: #ec971f;\n  border-color: #d58512;\n}\n.btn-warning:active:hover,\n.btn-warning.active:hover,\n.open > .dropdown-toggle.btn-warning:hover,\n.btn-warning:active:focus,\n.btn-warning.active:focus,\n.open > .dropdown-toggle.btn-warning:focus,\n.btn-warning:active.focus,\n.btn-warning.active.focus,\n.open > .dropdown-toggle.btn-warning.focus {\n  color: #fff;\n  background-color: #d58512;\n  border-color: #985f0d;\n}\n.btn-warning:active,\n.btn-warning.active,\n.open > .dropdown-toggle.btn-warning {\n  background-image: none;\n}\n.btn-warning.disabled:hover,\n.btn-warning[disabled]:hover,\nfieldset[disabled] .btn-warning:hover,\n.btn-warning.disabled:focus,\n.btn-warning[disabled]:focus,\nfieldset[disabled] .btn-warning:focus,\n.btn-warning.disabled.focus,\n.btn-warning[disabled].focus,\nfieldset[disabled] .btn-warning.focus {\n  background-color: #f0ad4e;\n  border-color: #eea236;\n}\n.btn-warning .badge {\n  color: #f0ad4e;\n  background-color: #fff;\n}\n.btn-danger {\n  color: #fff;\n  background-color: #d9534f;\n  border-color: #d43f3a;\n}\n.btn-danger:focus,\n.btn-danger.focus {\n  color: #fff;\n  background-color: #c9302c;\n  border-color: #761c19;\n}\n.btn-danger:hover {\n  color: #fff;\n  background-color: #c9302c;\n  border-color: #ac2925;\n}\n.btn-danger:active,\n.btn-danger.active,\n.open > .dropdown-toggle.btn-danger {\n  color: #fff;\n  background-color: #c9302c;\n  border-color: #ac2925;\n}\n.btn-danger:active:hover,\n.btn-danger.active:hover,\n.open > .dropdown-toggle.btn-danger:hover,\n.btn-danger:active:focus,\n.btn-danger.active:focus,\n.open > .dropdown-toggle.btn-danger:focus,\n.btn-danger:active.focus,\n.btn-danger.active.focus,\n.open > .dropdown-toggle.btn-danger.focus {\n  color: #fff;\n  background-color: #ac2925;\n  border-color: #761c19;\n}\n.btn-danger:active,\n.btn-danger.active,\n.open > .dropdown-toggle.btn-danger {\n  background-image: none;\n}\n.btn-danger.disabled:hover,\n.btn-danger[disabled]:hover,\nfieldset[disabled] .btn-danger:hover,\n.btn-danger.disabled:focus,\n.btn-danger[disabled]:focus,\nfieldset[disabled] .btn-danger:focus,\n.btn-danger.disabled.focus,\n.btn-danger[disabled].focus,\nfieldset[disabled] .btn-danger.focus {\n  background-color: #d9534f;\n  border-color: #d43f3a;\n}\n.btn-danger .badge {\n  color: #d9534f;\n  background-color: #fff;\n}\n.btn-link {\n  color: #337ab7;\n  font-weight: normal;\n  border-radius: 0;\n}\n.btn-link,\n.btn-link:active,\n.btn-link.active,\n.btn-link[disabled],\nfieldset[disabled] .btn-link {\n  background-color: transparent;\n  -webkit-box-shadow: none;\n  box-shadow: none;\n}\n.btn-link,\n.btn-link:hover,\n.btn-link:focus,\n.btn-link:active {\n  border-color: transparent;\n}\n.btn-link:hover,\n.btn-link:focus {\n  color: #23527c;\n  text-decoration: underline;\n  background-color: transparent;\n}\n.btn-link[disabled]:hover,\nfieldset[disabled] .btn-link:hover,\n.btn-link[disabled]:focus,\nfieldset[disabled] .btn-link:focus {\n  color: #777777;\n  text-decoration: none;\n}\n.btn-lg,\n.btn-group-lg > .btn {\n  padding: 10px 16px;\n  font-size: 18px;\n  line-height: 1.3333333;\n  border-radius: 6px;\n}\n.btn-sm,\n.btn-group-sm > .btn {\n  padding: 5px 10px;\n  font-size: 12px;\n  line-height: 1.5;\n  border-radius: 3px;\n}\n.btn-xs,\n.btn-group-xs > .btn {\n  padding: 1px 5px;\n  font-size: 12px;\n  line-height: 1.5;\n  border-radius: 3px;\n}\n.btn-block {\n  display: block;\n  width: 100%;\n}\n.btn-block + .btn-block {\n  margin-top: 5px;\n}\ninput[type=\"submit\"].btn-block,\ninput[type=\"reset\"].btn-block,\ninput[type=\"button\"].btn-block {\n  width: 100%;\n}\n.fade {\n  opacity: 0;\n  -webkit-transition: opacity 0.15s linear;\n  -o-transition: opacity 0.15s linear;\n  transition: opacity 0.15s linear;\n}\n.fade.in {\n  opacity: 1;\n}\n.collapse {\n  display: none;\n}\n.collapse.in {\n  display: block;\n}\ntr.collapse.in {\n  display: table-row;\n}\ntbody.collapse.in {\n  display: table-row-group;\n}\n.collapsing {\n  position: relative;\n  height: 0;\n  overflow: hidden;\n  -webkit-transition-property: height, visibility;\n  transition-property: height, visibility;\n  -webkit-transition-duration: 0.35s;\n  transition-duration: 0.35s;\n  -webkit-transition-timing-function: ease;\n  transition-timing-function: ease;\n}\n.caret {\n  display: inline-block;\n  width: 0;\n  height: 0;\n  margin-left: 2px;\n  vertical-align: middle;\n  border-top: 4px dashed;\n  border-top: 4px solid \\9;\n  border-right: 4px solid transparent;\n  border-left: 4px solid transparent;\n}\n.dropup,\n.dropdown {\n  position: relative;\n}\n.dropdown-toggle:focus {\n  outline: 0;\n}\n.dropdown-menu {\n  position: absolute;\n  top: 100%;\n  left: 0;\n  z-index: 1000;\n  display: none;\n  float: left;\n  min-width: 160px;\n  padding: 5px 0;\n  margin: 2px 0 0;\n  list-style: none;\n  font-size: 14px;\n  text-align: left;\n  background-color: #fff;\n  border: 1px solid #ccc;\n  border: 1px solid rgba(0, 0, 0, 0.15);\n  border-radius: 4px;\n  -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n  background-clip: padding-box;\n}\n.dropdown-menu.pull-right {\n  right: 0;\n  left: auto;\n}\n.dropdown-menu .divider {\n  height: 1px;\n  margin: 9px 0;\n  overflow: hidden;\n  background-color: #e5e5e5;\n}\n.dropdown-menu > li > a {\n  display: block;\n  padding: 3px 20px;\n  clear: both;\n  font-weight: normal;\n  line-height: 1.42857143;\n  color: #333333;\n  white-space: nowrap;\n}\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n  text-decoration: none;\n  color: #262626;\n  background-color: #f5f5f5;\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n  color: #fff;\n  text-decoration: none;\n  outline: 0;\n  background-color: #337ab7;\n}\n.dropdown-menu > .disabled > a,\n.dropdown-menu > .disabled > a:hover,\n.dropdown-menu > .disabled > a:focus {\n  color: #777777;\n}\n.dropdown-menu > .disabled > a:hover,\n.dropdown-menu > .disabled > a:focus {\n  text-decoration: none;\n  background-color: transparent;\n  background-image: none;\n  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n  cursor: not-allowed;\n}\n.open > .dropdown-menu {\n  display: block;\n}\n.open > a {\n  outline: 0;\n}\n.dropdown-menu-right {\n  left: auto;\n  right: 0;\n}\n.dropdown-menu-left {\n  left: 0;\n  right: auto;\n}\n.dropdown-header {\n  display: block;\n  padding: 3px 20px;\n  font-size: 12px;\n  line-height: 1.42857143;\n  color: #777777;\n  white-space: nowrap;\n}\n.dropdown-backdrop {\n  position: fixed;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  top: 0;\n  z-index: 990;\n}\n.pull-right > .dropdown-menu {\n  right: 0;\n  left: auto;\n}\n.dropup .caret,\n.navbar-fixed-bottom .dropdown .caret {\n  border-top: 0;\n  border-bottom: 4px dashed;\n  border-bottom: 4px solid \\9;\n  content: \"\";\n}\n.dropup .dropdown-menu,\n.navbar-fixed-bottom .dropdown .dropdown-menu {\n  top: auto;\n  bottom: 100%;\n  margin-bottom: 2px;\n}\n@media (min-width: 768px) {\n  .navbar-right .dropdown-menu {\n    left: auto;\n    right: 0;\n  }\n  .navbar-right .dropdown-menu-left {\n    left: 0;\n    right: auto;\n  }\n}\n.btn-group,\n.btn-group-vertical {\n  position: relative;\n  display: inline-block;\n  vertical-align: middle;\n}\n.btn-group > .btn,\n.btn-group-vertical > .btn {\n  position: relative;\n  float: left;\n}\n.btn-group > .btn:hover,\n.btn-group-vertical > .btn:hover,\n.btn-group > .btn:focus,\n.btn-group-vertical > .btn:focus,\n.btn-group > .btn:active,\n.btn-group-vertical > .btn:active,\n.btn-group > .btn.active,\n.btn-group-vertical > .btn.active {\n  z-index: 2;\n}\n.btn-group .btn + .btn,\n.btn-group .btn + .btn-group,\n.btn-group .btn-group + .btn,\n.btn-group .btn-group + .btn-group {\n  margin-left: -1px;\n}\n.btn-toolbar {\n  margin-left: -5px;\n}\n.btn-toolbar .btn,\n.btn-toolbar .btn-group,\n.btn-toolbar .input-group {\n  float: left;\n}\n.btn-toolbar > .btn,\n.btn-toolbar > .btn-group,\n.btn-toolbar > .input-group {\n  margin-left: 5px;\n}\n.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {\n  border-radius: 0;\n}\n.btn-group > .btn:first-child {\n  margin-left: 0;\n}\n.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {\n  border-bottom-right-radius: 0;\n  border-top-right-radius: 0;\n}\n.btn-group > .btn:last-child:not(:first-child),\n.btn-group > .dropdown-toggle:not(:first-child) {\n  border-bottom-left-radius: 0;\n  border-top-left-radius: 0;\n}\n.btn-group > .btn-group {\n  float: left;\n}\n.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {\n  border-radius: 0;\n}\n.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,\n.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {\n  border-bottom-right-radius: 0;\n  border-top-right-radius: 0;\n}\n.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {\n  border-bottom-left-radius: 0;\n  border-top-left-radius: 0;\n}\n.btn-group .dropdown-toggle:active,\n.btn-group.open .dropdown-toggle {\n  outline: 0;\n}\n.btn-group > .btn + .dropdown-toggle {\n  padding-left: 8px;\n  padding-right: 8px;\n}\n.btn-group > .btn-lg + .dropdown-toggle {\n  padding-left: 12px;\n  padding-right: 12px;\n}\n.btn-group.open .dropdown-toggle {\n  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n}\n.btn-group.open .dropdown-toggle.btn-link {\n  -webkit-box-shadow: none;\n  box-shadow: none;\n}\n.btn .caret {\n  margin-left: 0;\n}\n.btn-lg .caret {\n  border-width: 5px 5px 0;\n  border-bottom-width: 0;\n}\n.dropup .btn-lg .caret {\n  border-width: 0 5px 5px;\n}\n.btn-group-vertical > .btn,\n.btn-group-vertical > .btn-group,\n.btn-group-vertical > .btn-group > .btn {\n  display: block;\n  float: none;\n  width: 100%;\n  max-width: 100%;\n}\n.btn-group-vertical > .btn-group > .btn {\n  float: none;\n}\n.btn-group-vertical > .btn + .btn,\n.btn-group-vertical > .btn + .btn-group,\n.btn-group-vertical > .btn-group + .btn,\n.btn-group-vertical > .btn-group + .btn-group {\n  margin-top: -1px;\n  margin-left: 0;\n}\n.btn-group-vertical > .btn:not(:first-child):not(:last-child) {\n  border-radius: 0;\n}\n.btn-group-vertical > .btn:first-child:not(:last-child) {\n  border-top-right-radius: 4px;\n  border-top-left-radius: 4px;\n  border-bottom-right-radius: 0;\n  border-bottom-left-radius: 0;\n}\n.btn-group-vertical > .btn:last-child:not(:first-child) {\n  border-top-right-radius: 0;\n  border-top-left-radius: 0;\n  border-bottom-right-radius: 4px;\n  border-bottom-left-radius: 4px;\n}\n.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {\n  border-radius: 0;\n}\n.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,\n.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {\n  border-bottom-right-radius: 0;\n  border-bottom-left-radius: 0;\n}\n.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {\n  border-top-right-radius: 0;\n  border-top-left-radius: 0;\n}\n.btn-group-justified {\n  display: table;\n  width: 100%;\n  table-layout: fixed;\n  border-collapse: separate;\n}\n.btn-group-justified > .btn,\n.btn-group-justified > .btn-group {\n  float: none;\n  display: table-cell;\n  width: 1%;\n}\n.btn-group-justified > .btn-group .btn {\n  width: 100%;\n}\n.btn-group-justified > .btn-group .dropdown-menu {\n  left: auto;\n}\n[data-toggle=\"buttons\"] > .btn input[type=\"radio\"],\n[data-toggle=\"buttons\"] > .btn-group > .btn input[type=\"radio\"],\n[data-toggle=\"buttons\"] > .btn input[type=\"checkbox\"],\n[data-toggle=\"buttons\"] > .btn-group > .btn input[type=\"checkbox\"] {\n  position: absolute;\n  clip: rect(0, 0, 0, 0);\n  pointer-events: none;\n}\n.input-group {\n  position: relative;\n  display: table;\n  border-collapse: separate;\n}\n.input-group[class*=\"col-\"] {\n  float: none;\n  padding-left: 0;\n  padding-right: 0;\n}\n.input-group .form-control {\n  position: relative;\n  z-index: 2;\n  float: left;\n  width: 100%;\n  margin-bottom: 0;\n}\n.input-group .form-control:focus {\n  z-index: 3;\n}\n.input-group-lg > .form-control,\n.input-group-lg > .input-group-addon,\n.input-group-lg > .input-group-btn > .btn {\n  height: 46px;\n  padding: 10px 16px;\n  font-size: 18px;\n  line-height: 1.3333333;\n  border-radius: 6px;\n}\nselect.input-group-lg > .form-control,\nselect.input-group-lg > .input-group-addon,\nselect.input-group-lg > .input-group-btn > .btn {\n  height: 46px;\n  line-height: 46px;\n}\ntextarea.input-group-lg > .form-control,\ntextarea.input-group-lg > .input-group-addon,\ntextarea.input-group-lg > .input-group-btn > .btn,\nselect[multiple].input-group-lg > .form-control,\nselect[multiple].input-group-lg > .input-group-addon,\nselect[multiple].input-group-lg > .input-group-btn > .btn {\n  height: auto;\n}\n.input-group-sm > .form-control,\n.input-group-sm > .input-group-addon,\n.input-group-sm > .input-group-btn > .btn {\n  height: 30px;\n  padding: 5px 10px;\n  font-size: 12px;\n  line-height: 1.5;\n  border-radius: 3px;\n}\nselect.input-group-sm > .form-control,\nselect.input-group-sm > .input-group-addon,\nselect.input-group-sm > .input-group-btn > .btn {\n  height: 30px;\n  line-height: 30px;\n}\ntextarea.input-group-sm > .form-control,\ntextarea.input-group-sm > .input-group-addon,\ntextarea.input-group-sm > .input-group-btn > .btn,\nselect[multiple].input-group-sm > .form-control,\nselect[multiple].input-group-sm > .input-group-addon,\nselect[multiple].input-group-sm > .input-group-btn > .btn {\n  height: auto;\n}\n.input-group-addon,\n.input-group-btn,\n.input-group .form-control {\n  display: table-cell;\n}\n.input-group-addon:not(:first-child):not(:last-child),\n.input-group-btn:not(:first-child):not(:last-child),\n.input-group .form-control:not(:first-child):not(:last-child) {\n  border-radius: 0;\n}\n.input-group-addon,\n.input-group-btn {\n  width: 1%;\n  white-space: nowrap;\n  vertical-align: middle;\n}\n.input-group-addon {\n  padding: 6px 12px;\n  font-size: 14px;\n  font-weight: normal;\n  line-height: 1;\n  color: #555555;\n  text-align: center;\n  background-color: #eeeeee;\n  border: 1px solid #ccc;\n  border-radius: 4px;\n}\n.input-group-addon.input-sm {\n  padding: 5px 10px;\n  font-size: 12px;\n  border-radius: 3px;\n}\n.input-group-addon.input-lg {\n  padding: 10px 16px;\n  font-size: 18px;\n  border-radius: 6px;\n}\n.input-group-addon input[type=\"radio\"],\n.input-group-addon input[type=\"checkbox\"] {\n  margin-top: 0;\n}\n.input-group .form-control:first-child,\n.input-group-addon:first-child,\n.input-group-btn:first-child > .btn,\n.input-group-btn:first-child > .btn-group > .btn,\n.input-group-btn:first-child > .dropdown-toggle,\n.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),\n.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {\n  border-bottom-right-radius: 0;\n  border-top-right-radius: 0;\n}\n.input-group-addon:first-child {\n  border-right: 0;\n}\n.input-group .form-control:last-child,\n.input-group-addon:last-child,\n.input-group-btn:last-child > .btn,\n.input-group-btn:last-child > .btn-group > .btn,\n.input-group-btn:last-child > .dropdown-toggle,\n.input-group-btn:first-child > .btn:not(:first-child),\n.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {\n  border-bottom-left-radius: 0;\n  border-top-left-radius: 0;\n}\n.input-group-addon:last-child {\n  border-left: 0;\n}\n.input-group-btn {\n  position: relative;\n  font-size: 0;\n  white-space: nowrap;\n}\n.input-group-btn > .btn {\n  position: relative;\n}\n.input-group-btn > .btn + .btn {\n  margin-left: -1px;\n}\n.input-group-btn > .btn:hover,\n.input-group-btn > .btn:focus,\n.input-group-btn > .btn:active {\n  z-index: 2;\n}\n.input-group-btn:first-child > .btn,\n.input-group-btn:first-child > .btn-group {\n  margin-right: -1px;\n}\n.input-group-btn:last-child > .btn,\n.input-group-btn:last-child > .btn-group {\n  z-index: 2;\n  margin-left: -1px;\n}\n.nav {\n  margin-bottom: 0;\n  padding-left: 0;\n  list-style: none;\n}\n.nav > li {\n  position: relative;\n  display: block;\n}\n.nav > li > a {\n  position: relative;\n  display: block;\n  padding: 10px 15px;\n}\n.nav > li > a:hover,\n.nav > li > a:focus {\n  text-decoration: none;\n  background-color: #eeeeee;\n}\n.nav > li.disabled > a {\n  color: #777777;\n}\n.nav > li.disabled > a:hover,\n.nav > li.disabled > a:focus {\n  color: #777777;\n  text-decoration: none;\n  background-color: transparent;\n  cursor: not-allowed;\n}\n.nav .open > a,\n.nav .open > a:hover,\n.nav .open > a:focus {\n  background-color: #eeeeee;\n  border-color: #337ab7;\n}\n.nav .nav-divider {\n  height: 1px;\n  margin: 9px 0;\n  overflow: hidden;\n  background-color: #e5e5e5;\n}\n.nav > li > a > img {\n  max-width: none;\n}\n.nav-tabs {\n  border-bottom: 1px solid #ddd;\n}\n.nav-tabs > li {\n  float: left;\n  margin-bottom: -1px;\n}\n.nav-tabs > li > a {\n  margin-right: 2px;\n  line-height: 1.42857143;\n  border: 1px solid transparent;\n  border-radius: 4px 4px 0 0;\n}\n.nav-tabs > li > a:hover {\n  border-color: #eeeeee #eeeeee #ddd;\n}\n.nav-tabs > li.active > a,\n.nav-tabs > li.active > a:hover,\n.nav-tabs > li.active > a:focus {\n  color: #555555;\n  background-color: #fff;\n  border: 1px solid #ddd;\n  border-bottom-color: transparent;\n  cursor: default;\n}\n.nav-tabs.nav-justified {\n  width: 100%;\n  border-bottom: 0;\n}\n.nav-tabs.nav-justified > li {\n  float: none;\n}\n.nav-tabs.nav-justified > li > a {\n  text-align: center;\n  margin-bottom: 5px;\n}\n.nav-tabs.nav-justified > .dropdown .dropdown-menu {\n  top: auto;\n  left: auto;\n}\n@media (min-width: 768px) {\n  .nav-tabs.nav-justified > li {\n    display: table-cell;\n    width: 1%;\n  }\n  .nav-tabs.nav-justified > li > a {\n    margin-bottom: 0;\n  }\n}\n.nav-tabs.nav-justified > li > a {\n  margin-right: 0;\n  border-radius: 4px;\n}\n.nav-tabs.nav-justified > .active > a,\n.nav-tabs.nav-justified > .active > a:hover,\n.nav-tabs.nav-justified > .active > a:focus {\n  border: 1px solid #ddd;\n}\n@media (min-width: 768px) {\n  .nav-tabs.nav-justified > li > a {\n    border-bottom: 1px solid #ddd;\n    border-radius: 4px 4px 0 0;\n  }\n  .nav-tabs.nav-justified > .active > a,\n  .nav-tabs.nav-justified > .active > a:hover,\n  .nav-tabs.nav-justified > .active > a:focus {\n    border-bottom-color: #fff;\n  }\n}\n.nav-pills > li {\n  float: left;\n}\n.nav-pills > li > a {\n  border-radius: 4px;\n}\n.nav-pills > li + li {\n  margin-left: 2px;\n}\n.nav-pills > li.active > a,\n.nav-pills > li.active > a:hover,\n.nav-pills > li.active > a:focus {\n  color: #fff;\n  background-color: #337ab7;\n}\n.nav-stacked > li {\n  float: none;\n}\n.nav-stacked > li + li {\n  margin-top: 2px;\n  margin-left: 0;\n}\n.nav-justified {\n  width: 100%;\n}\n.nav-justified > li {\n  float: none;\n}\n.nav-justified > li > a {\n  text-align: center;\n  margin-bottom: 5px;\n}\n.nav-justified > .dropdown .dropdown-menu {\n  top: auto;\n  left: auto;\n}\n@media (min-width: 768px) {\n  .nav-justified > li {\n    display: table-cell;\n    width: 1%;\n  }\n  .nav-justified > li > a {\n    margin-bottom: 0;\n  }\n}\n.nav-tabs-justified {\n  border-bottom: 0;\n}\n.nav-tabs-justified > li > a {\n  margin-right: 0;\n  border-radius: 4px;\n}\n.nav-tabs-justified > .active > a,\n.nav-tabs-justified > .active > a:hover,\n.nav-tabs-justified > .active > a:focus {\n  border: 1px solid #ddd;\n}\n@media (min-width: 768px) {\n  .nav-tabs-justified > li > a {\n    border-bottom: 1px solid #ddd;\n    border-radius: 4px 4px 0 0;\n  }\n  .nav-tabs-justified > .active > a,\n  .nav-tabs-justified > .active > a:hover,\n  .nav-tabs-justified > .active > a:focus {\n    border-bottom-color: #fff;\n  }\n}\n.tab-content > .tab-pane {\n  display: none;\n}\n.tab-content > .active {\n  display: block;\n}\n.nav-tabs .dropdown-menu {\n  margin-top: -1px;\n  border-top-right-radius: 0;\n  border-top-left-radius: 0;\n}\n.navbar {\n  position: relative;\n  min-height: 50px;\n  margin-bottom: 20px;\n  border: 1px solid transparent;\n}\n@media (min-width: 768px) {\n  .navbar {\n    border-radius: 4px;\n  }\n}\n@media (min-width: 768px) {\n  .navbar-header {\n    float: left;\n  }\n}\n.navbar-collapse {\n  overflow-x: visible;\n  padding-right: 15px;\n  padding-left: 15px;\n  border-top: 1px solid transparent;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);\n  -webkit-overflow-scrolling: touch;\n}\n.navbar-collapse.in {\n  overflow-y: auto;\n}\n@media (min-width: 768px) {\n  .navbar-collapse {\n    width: auto;\n    border-top: 0;\n    box-shadow: none;\n  }\n  .navbar-collapse.collapse {\n    display: block !important;\n    height: auto !important;\n    padding-bottom: 0;\n    overflow: visible !important;\n  }\n  .navbar-collapse.in {\n    overflow-y: visible;\n  }\n  .navbar-fixed-top .navbar-collapse,\n  .navbar-static-top .navbar-collapse,\n  .navbar-fixed-bottom .navbar-collapse {\n    padding-left: 0;\n    padding-right: 0;\n  }\n}\n.navbar-fixed-top .navbar-collapse,\n.navbar-fixed-bottom .navbar-collapse {\n  max-height: 340px;\n}\n@media (max-device-width: 480px) and (orientation: landscape) {\n  .navbar-fixed-top .navbar-collapse,\n  .navbar-fixed-bottom .navbar-collapse {\n    max-height: 200px;\n  }\n}\n.container > .navbar-header,\n.container-fluid > .navbar-header,\n.container > .navbar-collapse,\n.container-fluid > .navbar-collapse {\n  margin-right: -15px;\n  margin-left: -15px;\n}\n@media (min-width: 768px) {\n  .container > .navbar-header,\n  .container-fluid > .navbar-header,\n  .container > .navbar-collapse,\n  .container-fluid > .navbar-collapse {\n    margin-right: 0;\n    margin-left: 0;\n  }\n}\n.navbar-static-top {\n  z-index: 1000;\n  border-width: 0 0 1px;\n}\n@media (min-width: 768px) {\n  .navbar-static-top {\n    border-radius: 0;\n  }\n}\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n  position: fixed;\n  right: 0;\n  left: 0;\n  z-index: 1030;\n}\n@media (min-width: 768px) {\n  .navbar-fixed-top,\n  .navbar-fixed-bottom {\n    border-radius: 0;\n  }\n}\n.navbar-fixed-top {\n  top: 0;\n  border-width: 0 0 1px;\n}\n.navbar-fixed-bottom {\n  bottom: 0;\n  margin-bottom: 0;\n  border-width: 1px 0 0;\n}\n.navbar-brand {\n  float: left;\n  padding: 15px 15px;\n  font-size: 18px;\n  line-height: 20px;\n  height: 50px;\n}\n.navbar-brand:hover,\n.navbar-brand:focus {\n  text-decoration: none;\n}\n.navbar-brand > img {\n  display: block;\n}\n@media (min-width: 768px) {\n  .navbar > .container .navbar-brand,\n  .navbar > .container-fluid .navbar-brand {\n    margin-left: -15px;\n  }\n}\n.navbar-toggle {\n  position: relative;\n  float: right;\n  margin-right: 15px;\n  padding: 9px 10px;\n  margin-top: 8px;\n  margin-bottom: 8px;\n  background-color: transparent;\n  background-image: none;\n  border: 1px solid transparent;\n  border-radius: 4px;\n}\n.navbar-toggle:focus {\n  outline: 0;\n}\n.navbar-toggle .icon-bar {\n  display: block;\n  width: 22px;\n  height: 2px;\n  border-radius: 1px;\n}\n.navbar-toggle .icon-bar + .icon-bar {\n  margin-top: 4px;\n}\n@media (min-width: 768px) {\n  .navbar-toggle {\n    display: none;\n  }\n}\n.navbar-nav {\n  margin: 7.5px -15px;\n}\n.navbar-nav > li > a {\n  padding-top: 10px;\n  padding-bottom: 10px;\n  line-height: 20px;\n}\n@media (max-width: 767px) {\n  .navbar-nav .open .dropdown-menu {\n    position: static;\n    float: none;\n    width: auto;\n    margin-top: 0;\n    background-color: transparent;\n    border: 0;\n    box-shadow: none;\n  }\n  .navbar-nav .open .dropdown-menu > li > a,\n  .navbar-nav .open .dropdown-menu .dropdown-header {\n    padding: 5px 15px 5px 25px;\n  }\n  .navbar-nav .open .dropdown-menu > li > a {\n    line-height: 20px;\n  }\n  .navbar-nav .open .dropdown-menu > li > a:hover,\n  .navbar-nav .open .dropdown-menu > li > a:focus {\n    background-image: none;\n  }\n}\n@media (min-width: 768px) {\n  .navbar-nav {\n    float: left;\n    margin: 0;\n  }\n  .navbar-nav > li {\n    float: left;\n  }\n  .navbar-nav > li > a {\n    padding-top: 15px;\n    padding-bottom: 15px;\n  }\n}\n.navbar-form {\n  margin-left: -15px;\n  margin-right: -15px;\n  padding: 10px 15px;\n  border-top: 1px solid transparent;\n  border-bottom: 1px solid transparent;\n  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);\n  margin-top: 8px;\n  margin-bottom: 8px;\n}\n@media (min-width: 768px) {\n  .navbar-form .form-group {\n    display: inline-block;\n    margin-bottom: 0;\n    vertical-align: middle;\n  }\n  .navbar-form .form-control {\n    display: inline-block;\n    width: auto;\n    vertical-align: middle;\n  }\n  .navbar-form .form-control-static {\n    display: inline-block;\n  }\n  .navbar-form .input-group {\n    display: inline-table;\n    vertical-align: middle;\n  }\n  .navbar-form .input-group .input-group-addon,\n  .navbar-form .input-group .input-group-btn,\n  .navbar-form .input-group .form-control {\n    width: auto;\n  }\n  .navbar-form .input-group > .form-control {\n    width: 100%;\n  }\n  .navbar-form .control-label {\n    margin-bottom: 0;\n    vertical-align: middle;\n  }\n  .navbar-form .radio,\n  .navbar-form .checkbox {\n    display: inline-block;\n    margin-top: 0;\n    margin-bottom: 0;\n    vertical-align: middle;\n  }\n  .navbar-form .radio label,\n  .navbar-form .checkbox label {\n    padding-left: 0;\n  }\n  .navbar-form .radio input[type=\"radio\"],\n  .navbar-form .checkbox input[type=\"checkbox\"] {\n    position: relative;\n    margin-left: 0;\n  }\n  .navbar-form .has-feedback .form-control-feedback {\n    top: 0;\n  }\n}\n@media (max-width: 767px) {\n  .navbar-form .form-group {\n    margin-bottom: 5px;\n  }\n  .navbar-form .form-group:last-child {\n    margin-bottom: 0;\n  }\n}\n@media (min-width: 768px) {\n  .navbar-form {\n    width: auto;\n    border: 0;\n    margin-left: 0;\n    margin-right: 0;\n    padding-top: 0;\n    padding-bottom: 0;\n    -webkit-box-shadow: none;\n    box-shadow: none;\n  }\n}\n.navbar-nav > li > .dropdown-menu {\n  margin-top: 0;\n  border-top-right-radius: 0;\n  border-top-left-radius: 0;\n}\n.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {\n  margin-bottom: 0;\n  border-top-right-radius: 4px;\n  border-top-left-radius: 4px;\n  border-bottom-right-radius: 0;\n  border-bottom-left-radius: 0;\n}\n.navbar-btn {\n  margin-top: 8px;\n  margin-bottom: 8px;\n}\n.navbar-btn.btn-sm {\n  margin-top: 10px;\n  margin-bottom: 10px;\n}\n.navbar-btn.btn-xs {\n  margin-top: 14px;\n  margin-bottom: 14px;\n}\n.navbar-text {\n  margin-top: 15px;\n  margin-bottom: 15px;\n}\n@media (min-width: 768px) {\n  .navbar-text {\n    float: left;\n    margin-left: 15px;\n    margin-right: 15px;\n  }\n}\n@media (min-width: 768px) {\n  .navbar-left {\n    float: left !important;\n  }\n  .navbar-right {\n    float: right !important;\n    margin-right: -15px;\n  }\n  .navbar-right ~ .navbar-right {\n    margin-right: 0;\n  }\n}\n.navbar-default {\n  background-color: #f8f8f8;\n  border-color: #e7e7e7;\n}\n.navbar-default .navbar-brand {\n  color: #777;\n}\n.navbar-default .navbar-brand:hover,\n.navbar-default .navbar-brand:focus {\n  color: #5e5e5e;\n  background-color: transparent;\n}\n.navbar-default .navbar-text {\n  color: #777;\n}\n.navbar-default .navbar-nav > li > a {\n  color: #777;\n}\n.navbar-default .navbar-nav > li > a:hover,\n.navbar-default .navbar-nav > li > a:focus {\n  color: #333;\n  background-color: transparent;\n}\n.navbar-default .navbar-nav > .active > a,\n.navbar-default .navbar-nav > .active > a:hover,\n.navbar-default .navbar-nav > .active > a:focus {\n  color: #555;\n  background-color: #e7e7e7;\n}\n.navbar-default .navbar-nav > .disabled > a,\n.navbar-default .navbar-nav > .disabled > a:hover,\n.navbar-default .navbar-nav > .disabled > a:focus {\n  color: #ccc;\n  background-color: transparent;\n}\n.navbar-default .navbar-toggle {\n  border-color: #ddd;\n}\n.navbar-default .navbar-toggle:hover,\n.navbar-default .navbar-toggle:focus {\n  background-color: #ddd;\n}\n.navbar-default .navbar-toggle .icon-bar {\n  background-color: #888;\n}\n.navbar-default .navbar-collapse,\n.navbar-default .navbar-form {\n  border-color: #e7e7e7;\n}\n.navbar-default .navbar-nav > .open > a,\n.navbar-default .navbar-nav > .open > a:hover,\n.navbar-default .navbar-nav > .open > a:focus {\n  background-color: #e7e7e7;\n  color: #555;\n}\n@media (max-width: 767px) {\n  .navbar-default .navbar-nav .open .dropdown-menu > li > a {\n    color: #777;\n  }\n  .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,\n  .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {\n    color: #333;\n    background-color: transparent;\n  }\n  .navbar-default .navbar-nav .open .dropdown-menu > .active > a,\n  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,\n  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {\n    color: #555;\n    background-color: #e7e7e7;\n  }\n  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,\n  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n    color: #ccc;\n    background-color: transparent;\n  }\n}\n.navbar-default .navbar-link {\n  color: #777;\n}\n.navbar-default .navbar-link:hover {\n  color: #333;\n}\n.navbar-default .btn-link {\n  color: #777;\n}\n.navbar-default .btn-link:hover,\n.navbar-default .btn-link:focus {\n  color: #333;\n}\n.navbar-default .btn-link[disabled]:hover,\nfieldset[disabled] .navbar-default .btn-link:hover,\n.navbar-default .btn-link[disabled]:focus,\nfieldset[disabled] .navbar-default .btn-link:focus {\n  color: #ccc;\n}\n.navbar-inverse {\n  background-color: #222;\n  border-color: #080808;\n}\n.navbar-inverse .navbar-brand {\n  color: #9d9d9d;\n}\n.navbar-inverse .navbar-brand:hover,\n.navbar-inverse .navbar-brand:focus {\n  color: #fff;\n  background-color: transparent;\n}\n.navbar-inverse .navbar-text {\n  color: #9d9d9d;\n}\n.navbar-inverse .navbar-nav > li > a {\n  color: #9d9d9d;\n}\n.navbar-inverse .navbar-nav > li > a:hover,\n.navbar-inverse .navbar-nav > li > a:focus {\n  color: #fff;\n  background-color: transparent;\n}\n.navbar-inverse .navbar-nav > .active > a,\n.navbar-inverse .navbar-nav > .active > a:hover,\n.navbar-inverse .navbar-nav > .active > a:focus {\n  color: #fff;\n  background-color: #080808;\n}\n.navbar-inverse .navbar-nav > .disabled > a,\n.navbar-inverse .navbar-nav > .disabled > a:hover,\n.navbar-inverse .navbar-nav > .disabled > a:focus {\n  color: #444;\n  background-color: transparent;\n}\n.navbar-inverse .navbar-toggle {\n  border-color: #333;\n}\n.navbar-inverse .navbar-toggle:hover,\n.navbar-inverse .navbar-toggle:focus {\n  background-color: #333;\n}\n.navbar-inverse .navbar-toggle .icon-bar {\n  background-color: #fff;\n}\n.navbar-inverse .navbar-collapse,\n.navbar-inverse .navbar-form {\n  border-color: #101010;\n}\n.navbar-inverse .navbar-nav > .open > a,\n.navbar-inverse .navbar-nav > .open > a:hover,\n.navbar-inverse .navbar-nav > .open > a:focus {\n  background-color: #080808;\n  color: #fff;\n}\n@media (max-width: 767px) {\n  .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {\n    border-color: #080808;\n  }\n  .navbar-inverse .navbar-nav .open .dropdown-menu .divider {\n    background-color: #080808;\n  }\n  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {\n    color: #9d9d9d;\n  }\n  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,\n  .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {\n    color: #fff;\n    background-color: transparent;\n  }\n  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,\n  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,\n  .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {\n    color: #fff;\n    background-color: #080808;\n  }\n  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,\n  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n  .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n    color: #444;\n    background-color: transparent;\n  }\n}\n.navbar-inverse .navbar-link {\n  color: #9d9d9d;\n}\n.navbar-inverse .navbar-link:hover {\n  color: #fff;\n}\n.navbar-inverse .btn-link {\n  color: #9d9d9d;\n}\n.navbar-inverse .btn-link:hover,\n.navbar-inverse .btn-link:focus {\n  color: #fff;\n}\n.navbar-inverse .btn-link[disabled]:hover,\nfieldset[disabled] .navbar-inverse .btn-link:hover,\n.navbar-inverse .btn-link[disabled]:focus,\nfieldset[disabled] .navbar-inverse .btn-link:focus {\n  color: #444;\n}\n.breadcrumb {\n  padding: 8px 15px;\n  margin-bottom: 20px;\n  list-style: none;\n  background-color: #f5f5f5;\n  border-radius: 4px;\n}\n.breadcrumb > li {\n  display: inline-block;\n}\n.breadcrumb > li + li:before {\n  content: \"/\\00a0\";\n  padding: 0 5px;\n  color: #ccc;\n}\n.breadcrumb > .active {\n  color: #777777;\n}\n.pagination {\n  display: inline-block;\n  padding-left: 0;\n  margin: 20px 0;\n  border-radius: 4px;\n}\n.pagination > li {\n  display: inline;\n}\n.pagination > li > a,\n.pagination > li > span {\n  position: relative;\n  float: left;\n  padding: 6px 12px;\n  line-height: 1.42857143;\n  text-decoration: none;\n  color: #337ab7;\n  background-color: #fff;\n  border: 1px solid #ddd;\n  margin-left: -1px;\n}\n.pagination > li:first-child > a,\n.pagination > li:first-child > span {\n  margin-left: 0;\n  border-bottom-left-radius: 4px;\n  border-top-left-radius: 4px;\n}\n.pagination > li:last-child > a,\n.pagination > li:last-child > span {\n  border-bottom-right-radius: 4px;\n  border-top-right-radius: 4px;\n}\n.pagination > li > a:hover,\n.pagination > li > span:hover,\n.pagination > li > a:focus,\n.pagination > li > span:focus {\n  z-index: 2;\n  color: #23527c;\n  background-color: #eeeeee;\n  border-color: #ddd;\n}\n.pagination > .active > a,\n.pagination > .active > span,\n.pagination > .active > a:hover,\n.pagination > .active > span:hover,\n.pagination > .active > a:focus,\n.pagination > .active > span:focus {\n  z-index: 3;\n  color: #fff;\n  background-color: #337ab7;\n  border-color: #337ab7;\n  cursor: default;\n}\n.pagination > .disabled > span,\n.pagination > .disabled > span:hover,\n.pagination > .disabled > span:focus,\n.pagination > .disabled > a,\n.pagination > .disabled > a:hover,\n.pagination > .disabled > a:focus {\n  color: #777777;\n  background-color: #fff;\n  border-color: #ddd;\n  cursor: not-allowed;\n}\n.pagination-lg > li > a,\n.pagination-lg > li > span {\n  padding: 10px 16px;\n  font-size: 18px;\n  line-height: 1.3333333;\n}\n.pagination-lg > li:first-child > a,\n.pagination-lg > li:first-child > span {\n  border-bottom-left-radius: 6px;\n  border-top-left-radius: 6px;\n}\n.pagination-lg > li:last-child > a,\n.pagination-lg > li:last-child > span {\n  border-bottom-right-radius: 6px;\n  border-top-right-radius: 6px;\n}\n.pagination-sm > li > a,\n.pagination-sm > li > span {\n  padding: 5px 10px;\n  font-size: 12px;\n  line-height: 1.5;\n}\n.pagination-sm > li:first-child > a,\n.pagination-sm > li:first-child > span {\n  border-bottom-left-radius: 3px;\n  border-top-left-radius: 3px;\n}\n.pagination-sm > li:last-child > a,\n.pagination-sm > li:last-child > span {\n  border-bottom-right-radius: 3px;\n  border-top-right-radius: 3px;\n}\n.pager {\n  padding-left: 0;\n  margin: 20px 0;\n  list-style: none;\n  text-align: center;\n}\n.pager li {\n  display: inline;\n}\n.pager li > a,\n.pager li > span {\n  display: inline-block;\n  padding: 5px 14px;\n  background-color: #fff;\n  border: 1px solid #ddd;\n  border-radius: 15px;\n}\n.pager li > a:hover,\n.pager li > a:focus {\n  text-decoration: none;\n  background-color: #eeeeee;\n}\n.pager .next > a,\n.pager .next > span {\n  float: right;\n}\n.pager .previous > a,\n.pager .previous > span {\n  float: left;\n}\n.pager .disabled > a,\n.pager .disabled > a:hover,\n.pager .disabled > a:focus,\n.pager .disabled > span {\n  color: #777777;\n  background-color: #fff;\n  cursor: not-allowed;\n}\n.label {\n  display: inline;\n  padding: .2em .6em .3em;\n  font-size: 75%;\n  font-weight: bold;\n  line-height: 1;\n  color: #fff;\n  text-align: center;\n  white-space: nowrap;\n  vertical-align: baseline;\n  border-radius: .25em;\n}\na.label:hover,\na.label:focus {\n  color: #fff;\n  text-decoration: none;\n  cursor: pointer;\n}\n.label:empty {\n  display: none;\n}\n.btn .label {\n  position: relative;\n  top: -1px;\n}\n.label-default {\n  background-color: #777777;\n}\n.label-default[href]:hover,\n.label-default[href]:focus {\n  background-color: #5e5e5e;\n}\n.label-primary {\n  background-color: #337ab7;\n}\n.label-primary[href]:hover,\n.label-primary[href]:focus {\n  background-color: #286090;\n}\n.label-success {\n  background-color: #5cb85c;\n}\n.label-success[href]:hover,\n.label-success[href]:focus {\n  background-color: #449d44;\n}\n.label-info {\n  background-color: #5bc0de;\n}\n.label-info[href]:hover,\n.label-info[href]:focus {\n  background-color: #31b0d5;\n}\n.label-warning {\n  background-color: #f0ad4e;\n}\n.label-warning[href]:hover,\n.label-warning[href]:focus {\n  background-color: #ec971f;\n}\n.label-danger {\n  background-color: #d9534f;\n}\n.label-danger[href]:hover,\n.label-danger[href]:focus {\n  background-color: #c9302c;\n}\n.badge {\n  display: inline-block;\n  min-width: 10px;\n  padding: 3px 7px;\n  font-size: 12px;\n  font-weight: bold;\n  color: #fff;\n  line-height: 1;\n  vertical-align: middle;\n  white-space: nowrap;\n  text-align: center;\n  background-color: #777777;\n  border-radius: 10px;\n}\n.badge:empty {\n  display: none;\n}\n.btn .badge {\n  position: relative;\n  top: -1px;\n}\n.btn-xs .badge,\n.btn-group-xs > .btn .badge {\n  top: 0;\n  padding: 1px 5px;\n}\na.badge:hover,\na.badge:focus {\n  color: #fff;\n  text-decoration: none;\n  cursor: pointer;\n}\n.list-group-item.active > .badge,\n.nav-pills > .active > a > .badge {\n  color: #337ab7;\n  background-color: #fff;\n}\n.list-group-item > .badge {\n  float: right;\n}\n.list-group-item > .badge + .badge {\n  margin-right: 5px;\n}\n.nav-pills > li > a > .badge {\n  margin-left: 3px;\n}\n.jumbotron {\n  padding-top: 30px;\n  padding-bottom: 30px;\n  margin-bottom: 30px;\n  color: inherit;\n  background-color: #eeeeee;\n}\n.jumbotron h1,\n.jumbotron .h1 {\n  color: inherit;\n}\n.jumbotron p {\n  margin-bottom: 15px;\n  font-size: 21px;\n  font-weight: 200;\n}\n.jumbotron > hr {\n  border-top-color: #d5d5d5;\n}\n.container .jumbotron,\n.container-fluid .jumbotron {\n  border-radius: 6px;\n  padding-left: 15px;\n  padding-right: 15px;\n}\n.jumbotron .container {\n  max-width: 100%;\n}\n@media screen and (min-width: 768px) {\n  .jumbotron {\n    padding-top: 48px;\n    padding-bottom: 48px;\n  }\n  .container .jumbotron,\n  .container-fluid .jumbotron {\n    padding-left: 60px;\n    padding-right: 60px;\n  }\n  .jumbotron h1,\n  .jumbotron .h1 {\n    font-size: 63px;\n  }\n}\n.thumbnail {\n  display: block;\n  padding: 4px;\n  margin-bottom: 20px;\n  line-height: 1.42857143;\n  background-color: #fff;\n  border: 1px solid #ddd;\n  border-radius: 4px;\n  -webkit-transition: border 0.2s ease-in-out;\n  -o-transition: border 0.2s ease-in-out;\n  transition: border 0.2s ease-in-out;\n}\n.thumbnail > img,\n.thumbnail a > img {\n  margin-left: auto;\n  margin-right: auto;\n}\na.thumbnail:hover,\na.thumbnail:focus,\na.thumbnail.active {\n  border-color: #337ab7;\n}\n.thumbnail .caption {\n  padding: 9px;\n  color: #333333;\n}\n.alert {\n  padding: 15px;\n  margin-bottom: 20px;\n  border: 1px solid transparent;\n  border-radius: 4px;\n}\n.alert h4 {\n  margin-top: 0;\n  color: inherit;\n}\n.alert .alert-link {\n  font-weight: bold;\n}\n.alert > p,\n.alert > ul {\n  margin-bottom: 0;\n}\n.alert > p + p {\n  margin-top: 5px;\n}\n.alert-dismissable,\n.alert-dismissible {\n  padding-right: 35px;\n}\n.alert-dismissable .close,\n.alert-dismissible .close {\n  position: relative;\n  top: -2px;\n  right: -21px;\n  color: inherit;\n}\n.alert-success {\n  background-color: #dff0d8;\n  border-color: #d6e9c6;\n  color: #3c763d;\n}\n.alert-success hr {\n  border-top-color: #c9e2b3;\n}\n.alert-success .alert-link {\n  color: #2b542c;\n}\n.alert-info {\n  background-color: #d9edf7;\n  border-color: #bce8f1;\n  color: #31708f;\n}\n.alert-info hr {\n  border-top-color: #a6e1ec;\n}\n.alert-info .alert-link {\n  color: #245269;\n}\n.alert-warning {\n  background-color: #fcf8e3;\n  border-color: #faebcc;\n  color: #8a6d3b;\n}\n.alert-warning hr {\n  border-top-color: #f7e1b5;\n}\n.alert-warning .alert-link {\n  color: #66512c;\n}\n.alert-danger {\n  background-color: #f2dede;\n  border-color: #ebccd1;\n  color: #a94442;\n}\n.alert-danger hr {\n  border-top-color: #e4b9c0;\n}\n.alert-danger .alert-link {\n  color: #843534;\n}\n@-webkit-keyframes progress-bar-stripes {\n  from {\n    background-position: 40px 0;\n  }\n  to {\n    background-position: 0 0;\n  }\n}\n@keyframes progress-bar-stripes {\n  from {\n    background-position: 40px 0;\n  }\n  to {\n    background-position: 0 0;\n  }\n}\n.progress {\n  overflow: hidden;\n  height: 20px;\n  margin-bottom: 20px;\n  background-color: #f5f5f5;\n  border-radius: 4px;\n  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.progress-bar {\n  float: left;\n  width: 0%;\n  height: 100%;\n  font-size: 12px;\n  line-height: 20px;\n  color: #fff;\n  text-align: center;\n  background-color: #337ab7;\n  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n  -webkit-transition: width 0.6s ease;\n  -o-transition: width 0.6s ease;\n  transition: width 0.6s ease;\n}\n.progress-striped .progress-bar,\n.progress-bar-striped {\n  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-size: 40px 40px;\n}\n.progress.active .progress-bar,\n.progress-bar.active {\n  -webkit-animation: progress-bar-stripes 2s linear infinite;\n  -o-animation: progress-bar-stripes 2s linear infinite;\n  animation: progress-bar-stripes 2s linear infinite;\n}\n.progress-bar-success {\n  background-color: #5cb85c;\n}\n.progress-striped .progress-bar-success {\n  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-info {\n  background-color: #5bc0de;\n}\n.progress-striped .progress-bar-info {\n  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-warning {\n  background-color: #f0ad4e;\n}\n.progress-striped .progress-bar-warning {\n  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-danger {\n  background-color: #d9534f;\n}\n.progress-striped .progress-bar-danger {\n  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.media {\n  margin-top: 15px;\n}\n.media:first-child {\n  margin-top: 0;\n}\n.media,\n.media-body {\n  zoom: 1;\n  overflow: hidden;\n}\n.media-body {\n  width: 10000px;\n}\n.media-object {\n  display: block;\n}\n.media-object.img-thumbnail {\n  max-width: none;\n}\n.media-right,\n.media > .pull-right {\n  padding-left: 10px;\n}\n.media-left,\n.media > .pull-left {\n  padding-right: 10px;\n}\n.media-left,\n.media-right,\n.media-body {\n  display: table-cell;\n  vertical-align: top;\n}\n.media-middle {\n  vertical-align: middle;\n}\n.media-bottom {\n  vertical-align: bottom;\n}\n.media-heading {\n  margin-top: 0;\n  margin-bottom: 5px;\n}\n.media-list {\n  padding-left: 0;\n  list-style: none;\n}\n.list-group {\n  margin-bottom: 20px;\n  padding-left: 0;\n}\n.list-group-item {\n  position: relative;\n  display: block;\n  padding: 10px 15px;\n  margin-bottom: -1px;\n  background-color: #fff;\n  border: 1px solid #ddd;\n}\n.list-group-item:first-child {\n  border-top-right-radius: 4px;\n  border-top-left-radius: 4px;\n}\n.list-group-item:last-child {\n  margin-bottom: 0;\n  border-bottom-right-radius: 4px;\n  border-bottom-left-radius: 4px;\n}\na.list-group-item,\nbutton.list-group-item {\n  color: #555;\n}\na.list-group-item .list-group-item-heading,\nbutton.list-group-item .list-group-item-heading {\n  color: #333;\n}\na.list-group-item:hover,\nbutton.list-group-item:hover,\na.list-group-item:focus,\nbutton.list-group-item:focus {\n  text-decoration: none;\n  color: #555;\n  background-color: #f5f5f5;\n}\nbutton.list-group-item {\n  width: 100%;\n  text-align: left;\n}\n.list-group-item.disabled,\n.list-group-item.disabled:hover,\n.list-group-item.disabled:focus {\n  background-color: #eeeeee;\n  color: #777777;\n  cursor: not-allowed;\n}\n.list-group-item.disabled .list-group-item-heading,\n.list-group-item.disabled:hover .list-group-item-heading,\n.list-group-item.disabled:focus .list-group-item-heading {\n  color: inherit;\n}\n.list-group-item.disabled .list-group-item-text,\n.list-group-item.disabled:hover .list-group-item-text,\n.list-group-item.disabled:focus .list-group-item-text {\n  color: #777777;\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n  z-index: 2;\n  color: #fff;\n  background-color: #337ab7;\n  border-color: #337ab7;\n}\n.list-group-item.active .list-group-item-heading,\n.list-group-item.active:hover .list-group-item-heading,\n.list-group-item.active:focus .list-group-item-heading,\n.list-group-item.active .list-group-item-heading > small,\n.list-group-item.active:hover .list-group-item-heading > small,\n.list-group-item.active:focus .list-group-item-heading > small,\n.list-group-item.active .list-group-item-heading > .small,\n.list-group-item.active:hover .list-group-item-heading > .small,\n.list-group-item.active:focus .list-group-item-heading > .small {\n  color: inherit;\n}\n.list-group-item.active .list-group-item-text,\n.list-group-item.active:hover .list-group-item-text,\n.list-group-item.active:focus .list-group-item-text {\n  color: #c7ddef;\n}\n.list-group-item-success {\n  color: #3c763d;\n  background-color: #dff0d8;\n}\na.list-group-item-success,\nbutton.list-group-item-success {\n  color: #3c763d;\n}\na.list-group-item-success .list-group-item-heading,\nbutton.list-group-item-success .list-group-item-heading {\n  color: inherit;\n}\na.list-group-item-success:hover,\nbutton.list-group-item-success:hover,\na.list-group-item-success:focus,\nbutton.list-group-item-success:focus {\n  color: #3c763d;\n  background-color: #d0e9c6;\n}\na.list-group-item-success.active,\nbutton.list-group-item-success.active,\na.list-group-item-success.active:hover,\nbutton.list-group-item-success.active:hover,\na.list-group-item-success.active:focus,\nbutton.list-group-item-success.active:focus {\n  color: #fff;\n  background-color: #3c763d;\n  border-color: #3c763d;\n}\n.list-group-item-info {\n  color: #31708f;\n  background-color: #d9edf7;\n}\na.list-group-item-info,\nbutton.list-group-item-info {\n  color: #31708f;\n}\na.list-group-item-info .list-group-item-heading,\nbutton.list-group-item-info .list-group-item-heading {\n  color: inherit;\n}\na.list-group-item-info:hover,\nbutton.list-group-item-info:hover,\na.list-group-item-info:focus,\nbutton.list-group-item-info:focus {\n  color: #31708f;\n  background-color: #c4e3f3;\n}\na.list-group-item-info.active,\nbutton.list-group-item-info.active,\na.list-group-item-info.active:hover,\nbutton.list-group-item-info.active:hover,\na.list-group-item-info.active:focus,\nbutton.list-group-item-info.active:focus {\n  color: #fff;\n  background-color: #31708f;\n  border-color: #31708f;\n}\n.list-group-item-warning {\n  color: #8a6d3b;\n  background-color: #fcf8e3;\n}\na.list-group-item-warning,\nbutton.list-group-item-warning {\n  color: #8a6d3b;\n}\na.list-group-item-warning .list-group-item-heading,\nbutton.list-group-item-warning .list-group-item-heading {\n  color: inherit;\n}\na.list-group-item-warning:hover,\nbutton.list-group-item-warning:hover,\na.list-group-item-warning:focus,\nbutton.list-group-item-warning:focus {\n  color: #8a6d3b;\n  background-color: #faf2cc;\n}\na.list-group-item-warning.active,\nbutton.list-group-item-warning.active,\na.list-group-item-warning.active:hover,\nbutton.list-group-item-warning.active:hover,\na.list-group-item-warning.active:focus,\nbutton.list-group-item-warning.active:focus {\n  color: #fff;\n  background-color: #8a6d3b;\n  border-color: #8a6d3b;\n}\n.list-group-item-danger {\n  color: #a94442;\n  background-color: #f2dede;\n}\na.list-group-item-danger,\nbutton.list-group-item-danger {\n  color: #a94442;\n}\na.list-group-item-danger .list-group-item-heading,\nbutton.list-group-item-danger .list-group-item-heading {\n  color: inherit;\n}\na.list-group-item-danger:hover,\nbutton.list-group-item-danger:hover,\na.list-group-item-danger:focus,\nbutton.list-group-item-danger:focus {\n  color: #a94442;\n  background-color: #ebcccc;\n}\na.list-group-item-danger.active,\nbutton.list-group-item-danger.active,\na.list-group-item-danger.active:hover,\nbutton.list-group-item-danger.active:hover,\na.list-group-item-danger.active:focus,\nbutton.list-group-item-danger.active:focus {\n  color: #fff;\n  background-color: #a94442;\n  border-color: #a94442;\n}\n.list-group-item-heading {\n  margin-top: 0;\n  margin-bottom: 5px;\n}\n.list-group-item-text {\n  margin-bottom: 0;\n  line-height: 1.3;\n}\n.panel {\n  margin-bottom: 20px;\n  background-color: #fff;\n  border: 1px solid transparent;\n  border-radius: 4px;\n  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);\n  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);\n}\n.panel-body {\n  padding: 15px;\n}\n.panel-heading {\n  padding: 10px 15px;\n  border-bottom: 1px solid transparent;\n  border-top-right-radius: 3px;\n  border-top-left-radius: 3px;\n}\n.panel-heading > .dropdown .dropdown-toggle {\n  color: inherit;\n}\n.panel-title {\n  margin-top: 0;\n  margin-bottom: 0;\n  font-size: 16px;\n  color: inherit;\n}\n.panel-title > a,\n.panel-title > small,\n.panel-title > .small,\n.panel-title > small > a,\n.panel-title > .small > a {\n  color: inherit;\n}\n.panel-footer {\n  padding: 10px 15px;\n  background-color: #f5f5f5;\n  border-top: 1px solid #ddd;\n  border-bottom-right-radius: 3px;\n  border-bottom-left-radius: 3px;\n}\n.panel > .list-group,\n.panel > .panel-collapse > .list-group {\n  margin-bottom: 0;\n}\n.panel > .list-group .list-group-item,\n.panel > .panel-collapse > .list-group .list-group-item {\n  border-width: 1px 0;\n  border-radius: 0;\n}\n.panel > .list-group:first-child .list-group-item:first-child,\n.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {\n  border-top: 0;\n  border-top-right-radius: 3px;\n  border-top-left-radius: 3px;\n}\n.panel > .list-group:last-child .list-group-item:last-child,\n.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {\n  border-bottom: 0;\n  border-bottom-right-radius: 3px;\n  border-bottom-left-radius: 3px;\n}\n.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {\n  border-top-right-radius: 0;\n  border-top-left-radius: 0;\n}\n.panel-heading + .list-group .list-group-item:first-child {\n  border-top-width: 0;\n}\n.list-group + .panel-footer {\n  border-top-width: 0;\n}\n.panel > .table,\n.panel > .table-responsive > .table,\n.panel > .panel-collapse > .table {\n  margin-bottom: 0;\n}\n.panel > .table caption,\n.panel > .table-responsive > .table caption,\n.panel > .panel-collapse > .table caption {\n  padding-left: 15px;\n  padding-right: 15px;\n}\n.panel > .table:first-child,\n.panel > .table-responsive:first-child > .table:first-child {\n  border-top-right-radius: 3px;\n  border-top-left-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {\n  border-top-left-radius: 3px;\n  border-top-right-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,\n.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {\n  border-top-left-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,\n.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {\n  border-top-right-radius: 3px;\n}\n.panel > .table:last-child,\n.panel > .table-responsive:last-child > .table:last-child {\n  border-bottom-right-radius: 3px;\n  border-bottom-left-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {\n  border-bottom-left-radius: 3px;\n  border-bottom-right-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,\n.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {\n  border-bottom-left-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,\n.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {\n  border-bottom-right-radius: 3px;\n}\n.panel > .panel-body + .table,\n.panel > .panel-body + .table-responsive,\n.panel > .table + .panel-body,\n.panel > .table-responsive + .panel-body {\n  border-top: 1px solid #ddd;\n}\n.panel > .table > tbody:first-child > tr:first-child th,\n.panel > .table > tbody:first-child > tr:first-child td {\n  border-top: 0;\n}\n.panel > .table-bordered,\n.panel > .table-responsive > .table-bordered {\n  border: 0;\n}\n.panel > .table-bordered > thead > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,\n.panel > .table-bordered > tbody > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,\n.panel > .table-bordered > tfoot > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,\n.panel > .table-bordered > thead > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,\n.panel > .table-bordered > tbody > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,\n.panel > .table-bordered > tfoot > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {\n  border-left: 0;\n}\n.panel > .table-bordered > thead > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,\n.panel > .table-bordered > tbody > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,\n.panel > .table-bordered > tfoot > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,\n.panel > .table-bordered > thead > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,\n.panel > .table-bordered > tbody > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,\n.panel > .table-bordered > tfoot > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {\n  border-right: 0;\n}\n.panel > .table-bordered > thead > tr:first-child > td,\n.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,\n.panel > .table-bordered > tbody > tr:first-child > td,\n.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,\n.panel > .table-bordered > thead > tr:first-child > th,\n.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,\n.panel > .table-bordered > tbody > tr:first-child > th,\n.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {\n  border-bottom: 0;\n}\n.panel > .table-bordered > tbody > tr:last-child > td,\n.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,\n.panel > .table-bordered > tfoot > tr:last-child > td,\n.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,\n.panel > .table-bordered > tbody > tr:last-child > th,\n.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,\n.panel > .table-bordered > tfoot > tr:last-child > th,\n.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {\n  border-bottom: 0;\n}\n.panel > .table-responsive {\n  border: 0;\n  margin-bottom: 0;\n}\n.panel-group {\n  margin-bottom: 20px;\n}\n.panel-group .panel {\n  margin-bottom: 0;\n  border-radius: 4px;\n}\n.panel-group .panel + .panel {\n  margin-top: 5px;\n}\n.panel-group .panel-heading {\n  border-bottom: 0;\n}\n.panel-group .panel-heading + .panel-collapse > .panel-body,\n.panel-group .panel-heading + .panel-collapse > .list-group {\n  border-top: 1px solid #ddd;\n}\n.panel-group .panel-footer {\n  border-top: 0;\n}\n.panel-group .panel-footer + .panel-collapse .panel-body {\n  border-bottom: 1px solid #ddd;\n}\n.panel-default {\n  border-color: #ddd;\n}\n.panel-default > .panel-heading {\n  color: #333333;\n  background-color: #f5f5f5;\n  border-color: #ddd;\n}\n.panel-default > .panel-heading + .panel-collapse > .panel-body {\n  border-top-color: #ddd;\n}\n.panel-default > .panel-heading .badge {\n  color: #f5f5f5;\n  background-color: #333333;\n}\n.panel-default > .panel-footer + .panel-collapse > .panel-body {\n  border-bottom-color: #ddd;\n}\n.panel-primary {\n  border-color: #337ab7;\n}\n.panel-primary > .panel-heading {\n  color: #fff;\n  background-color: #337ab7;\n  border-color: #337ab7;\n}\n.panel-primary > .panel-heading + .panel-collapse > .panel-body {\n  border-top-color: #337ab7;\n}\n.panel-primary > .panel-heading .badge {\n  color: #337ab7;\n  background-color: #fff;\n}\n.panel-primary > .panel-footer + .panel-collapse > .panel-body {\n  border-bottom-color: #337ab7;\n}\n.panel-success {\n  border-color: #d6e9c6;\n}\n.panel-success > .panel-heading {\n  color: #3c763d;\n  background-color: #dff0d8;\n  border-color: #d6e9c6;\n}\n.panel-success > .panel-heading + .panel-collapse > .panel-body {\n  border-top-color: #d6e9c6;\n}\n.panel-success > .panel-heading .badge {\n  color: #dff0d8;\n  background-color: #3c763d;\n}\n.panel-success > .panel-footer + .panel-collapse > .panel-body {\n  border-bottom-color: #d6e9c6;\n}\n.panel-info {\n  border-color: #bce8f1;\n}\n.panel-info > .panel-heading {\n  color: #31708f;\n  background-color: #d9edf7;\n  border-color: #bce8f1;\n}\n.panel-info > .panel-heading + .panel-collapse > .panel-body {\n  border-top-color: #bce8f1;\n}\n.panel-info > .panel-heading .badge {\n  color: #d9edf7;\n  background-color: #31708f;\n}\n.panel-info > .panel-footer + .panel-collapse > .panel-body {\n  border-bottom-color: #bce8f1;\n}\n.panel-warning {\n  border-color: #faebcc;\n}\n.panel-warning > .panel-heading {\n  color: #8a6d3b;\n  background-color: #fcf8e3;\n  border-color: #faebcc;\n}\n.panel-warning > .panel-heading + .panel-collapse > .panel-body {\n  border-top-color: #faebcc;\n}\n.panel-warning > .panel-heading .badge {\n  color: #fcf8e3;\n  background-color: #8a6d3b;\n}\n.panel-warning > .panel-footer + .panel-collapse > .panel-body {\n  border-bottom-color: #faebcc;\n}\n.panel-danger {\n  border-color: #ebccd1;\n}\n.panel-danger > .panel-heading {\n  color: #a94442;\n  background-color: #f2dede;\n  border-color: #ebccd1;\n}\n.panel-danger > .panel-heading + .panel-collapse > .panel-body {\n  border-top-color: #ebccd1;\n}\n.panel-danger > .panel-heading .badge {\n  color: #f2dede;\n  background-color: #a94442;\n}\n.panel-danger > .panel-footer + .panel-collapse > .panel-body {\n  border-bottom-color: #ebccd1;\n}\n.embed-responsive {\n  position: relative;\n  display: block;\n  height: 0;\n  padding: 0;\n  overflow: hidden;\n}\n.embed-responsive .embed-responsive-item,\n.embed-responsive iframe,\n.embed-responsive embed,\n.embed-responsive object,\n.embed-responsive video {\n  position: absolute;\n  top: 0;\n  left: 0;\n  bottom: 0;\n  height: 100%;\n  width: 100%;\n  border: 0;\n}\n.embed-responsive-16by9 {\n  padding-bottom: 56.25%;\n}\n.embed-responsive-4by3 {\n  padding-bottom: 75%;\n}\n.well {\n  min-height: 20px;\n  padding: 19px;\n  margin-bottom: 20px;\n  background-color: #f5f5f5;\n  border: 1px solid #e3e3e3;\n  border-radius: 4px;\n  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);\n}\n.well blockquote {\n  border-color: #ddd;\n  border-color: rgba(0, 0, 0, 0.15);\n}\n.well-lg {\n  padding: 24px;\n  border-radius: 6px;\n}\n.well-sm {\n  padding: 9px;\n  border-radius: 3px;\n}\n.close {\n  float: right;\n  font-size: 21px;\n  font-weight: bold;\n  line-height: 1;\n  color: #000;\n  text-shadow: 0 1px 0 #fff;\n  opacity: 0.2;\n  filter: alpha(opacity=20);\n}\n.close:hover,\n.close:focus {\n  color: #000;\n  text-decoration: none;\n  cursor: pointer;\n  opacity: 0.5;\n  filter: alpha(opacity=50);\n}\nbutton.close {\n  padding: 0;\n  cursor: pointer;\n  background: transparent;\n  border: 0;\n  -webkit-appearance: none;\n}\n.modal-open {\n  overflow: hidden;\n}\n.modal {\n  display: none;\n  overflow: hidden;\n  position: fixed;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  z-index: 1050;\n  -webkit-overflow-scrolling: touch;\n  outline: 0;\n}\n.modal.fade .modal-dialog {\n  -webkit-transform: translate(0, -25%);\n  -ms-transform: translate(0, -25%);\n  -o-transform: translate(0, -25%);\n  transform: translate(0, -25%);\n  -webkit-transition: -webkit-transform 0.3s ease-out;\n  -moz-transition: -moz-transform 0.3s ease-out;\n  -o-transition: -o-transform 0.3s ease-out;\n  transition: transform 0.3s ease-out;\n}\n.modal.in .modal-dialog {\n  -webkit-transform: translate(0, 0);\n  -ms-transform: translate(0, 0);\n  -o-transform: translate(0, 0);\n  transform: translate(0, 0);\n}\n.modal-open .modal {\n  overflow-x: hidden;\n  overflow-y: auto;\n}\n.modal-dialog {\n  position: relative;\n  width: auto;\n  margin: 10px;\n}\n.modal-content {\n  position: relative;\n  background-color: #fff;\n  border: 1px solid #999;\n  border: 1px solid rgba(0, 0, 0, 0.2);\n  border-radius: 6px;\n  -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);\n  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);\n  background-clip: padding-box;\n  outline: 0;\n}\n.modal-backdrop {\n  position: fixed;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  z-index: 1040;\n  background-color: #000;\n}\n.modal-backdrop.fade {\n  opacity: 0;\n  filter: alpha(opacity=0);\n}\n.modal-backdrop.in {\n  opacity: 0.5;\n  filter: alpha(opacity=50);\n}\n.modal-header {\n  padding: 15px;\n  border-bottom: 1px solid #e5e5e5;\n}\n.modal-header .close {\n  margin-top: -2px;\n}\n.modal-title {\n  margin: 0;\n  line-height: 1.42857143;\n}\n.modal-body {\n  position: relative;\n  padding: 15px;\n}\n.modal-footer {\n  padding: 15px;\n  text-align: right;\n  border-top: 1px solid #e5e5e5;\n}\n.modal-footer .btn + .btn {\n  margin-left: 5px;\n  margin-bottom: 0;\n}\n.modal-footer .btn-group .btn + .btn {\n  margin-left: -1px;\n}\n.modal-footer .btn-block + .btn-block {\n  margin-left: 0;\n}\n.modal-scrollbar-measure {\n  position: absolute;\n  top: -9999px;\n  width: 50px;\n  height: 50px;\n  overflow: scroll;\n}\n@media (min-width: 768px) {\n  .modal-dialog {\n    width: 600px;\n    margin: 30px auto;\n  }\n  .modal-content {\n    -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);\n    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);\n  }\n  .modal-sm {\n    width: 300px;\n  }\n}\n@media (min-width: 992px) {\n  .modal-lg {\n    width: 900px;\n  }\n}\n.tooltip {\n  position: absolute;\n  z-index: 1070;\n  display: block;\n  font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n  font-style: normal;\n  font-weight: normal;\n  letter-spacing: normal;\n  line-break: auto;\n  line-height: 1.42857143;\n  text-align: left;\n  text-align: start;\n  text-decoration: none;\n  text-shadow: none;\n  text-transform: none;\n  white-space: normal;\n  word-break: normal;\n  word-spacing: normal;\n  word-wrap: normal;\n  font-size: 12px;\n  opacity: 0;\n  filter: alpha(opacity=0);\n}\n.tooltip.in {\n  opacity: 0.9;\n  filter: alpha(opacity=90);\n}\n.tooltip.top {\n  margin-top: -3px;\n  padding: 5px 0;\n}\n.tooltip.right {\n  margin-left: 3px;\n  padding: 0 5px;\n}\n.tooltip.bottom {\n  margin-top: 3px;\n  padding: 5px 0;\n}\n.tooltip.left {\n  margin-left: -3px;\n  padding: 0 5px;\n}\n.tooltip-inner {\n  max-width: 200px;\n  padding: 3px 8px;\n  color: #fff;\n  text-align: center;\n  background-color: #000;\n  border-radius: 4px;\n}\n.tooltip-arrow {\n  position: absolute;\n  width: 0;\n  height: 0;\n  border-color: transparent;\n  border-style: solid;\n}\n.tooltip.top .tooltip-arrow {\n  bottom: 0;\n  left: 50%;\n  margin-left: -5px;\n  border-width: 5px 5px 0;\n  border-top-color: #000;\n}\n.tooltip.top-left .tooltip-arrow {\n  bottom: 0;\n  right: 5px;\n  margin-bottom: -5px;\n  border-width: 5px 5px 0;\n  border-top-color: #000;\n}\n.tooltip.top-right .tooltip-arrow {\n  bottom: 0;\n  left: 5px;\n  margin-bottom: -5px;\n  border-width: 5px 5px 0;\n  border-top-color: #000;\n}\n.tooltip.right .tooltip-arrow {\n  top: 50%;\n  left: 0;\n  margin-top: -5px;\n  border-width: 5px 5px 5px 0;\n  border-right-color: #000;\n}\n.tooltip.left .tooltip-arrow {\n  top: 50%;\n  right: 0;\n  margin-top: -5px;\n  border-width: 5px 0 5px 5px;\n  border-left-color: #000;\n}\n.tooltip.bottom .tooltip-arrow {\n  top: 0;\n  left: 50%;\n  margin-left: -5px;\n  border-width: 0 5px 5px;\n  border-bottom-color: #000;\n}\n.tooltip.bottom-left .tooltip-arrow {\n  top: 0;\n  right: 5px;\n  margin-top: -5px;\n  border-width: 0 5px 5px;\n  border-bottom-color: #000;\n}\n.tooltip.bottom-right .tooltip-arrow {\n  top: 0;\n  left: 5px;\n  margin-top: -5px;\n  border-width: 0 5px 5px;\n  border-bottom-color: #000;\n}\n.popover {\n  position: absolute;\n  top: 0;\n  left: 0;\n  z-index: 1060;\n  display: none;\n  max-width: 276px;\n  padding: 1px;\n  font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n  font-style: normal;\n  font-weight: normal;\n  letter-spacing: normal;\n  line-break: auto;\n  line-height: 1.42857143;\n  text-align: left;\n  text-align: start;\n  text-decoration: none;\n  text-shadow: none;\n  text-transform: none;\n  white-space: normal;\n  word-break: normal;\n  word-spacing: normal;\n  word-wrap: normal;\n  font-size: 14px;\n  background-color: #fff;\n  background-clip: padding-box;\n  border: 1px solid #ccc;\n  border: 1px solid rgba(0, 0, 0, 0.2);\n  border-radius: 6px;\n  -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n}\n.popover.top {\n  margin-top: -10px;\n}\n.popover.right {\n  margin-left: 10px;\n}\n.popover.bottom {\n  margin-top: 10px;\n}\n.popover.left {\n  margin-left: -10px;\n}\n.popover-title {\n  margin: 0;\n  padding: 8px 14px;\n  font-size: 14px;\n  background-color: #f7f7f7;\n  border-bottom: 1px solid #ebebeb;\n  border-radius: 5px 5px 0 0;\n}\n.popover-content {\n  padding: 9px 14px;\n}\n.popover > .arrow,\n.popover > .arrow:after {\n  position: absolute;\n  display: block;\n  width: 0;\n  height: 0;\n  border-color: transparent;\n  border-style: solid;\n}\n.popover > .arrow {\n  border-width: 11px;\n}\n.popover > .arrow:after {\n  border-width: 10px;\n  content: \"\";\n}\n.popover.top > .arrow {\n  left: 50%;\n  margin-left: -11px;\n  border-bottom-width: 0;\n  border-top-color: #999999;\n  border-top-color: rgba(0, 0, 0, 0.25);\n  bottom: -11px;\n}\n.popover.top > .arrow:after {\n  content: \" \";\n  bottom: 1px;\n  margin-left: -10px;\n  border-bottom-width: 0;\n  border-top-color: #fff;\n}\n.popover.right > .arrow {\n  top: 50%;\n  left: -11px;\n  margin-top: -11px;\n  border-left-width: 0;\n  border-right-color: #999999;\n  border-right-color: rgba(0, 0, 0, 0.25);\n}\n.popover.right > .arrow:after {\n  content: \" \";\n  left: 1px;\n  bottom: -10px;\n  border-left-width: 0;\n  border-right-color: #fff;\n}\n.popover.bottom > .arrow {\n  left: 50%;\n  margin-left: -11px;\n  border-top-width: 0;\n  border-bottom-color: #999999;\n  border-bottom-color: rgba(0, 0, 0, 0.25);\n  top: -11px;\n}\n.popover.bottom > .arrow:after {\n  content: \" \";\n  top: 1px;\n  margin-left: -10px;\n  border-top-width: 0;\n  border-bottom-color: #fff;\n}\n.popover.left > .arrow {\n  top: 50%;\n  right: -11px;\n  margin-top: -11px;\n  border-right-width: 0;\n  border-left-color: #999999;\n  border-left-color: rgba(0, 0, 0, 0.25);\n}\n.popover.left > .arrow:after {\n  content: \" \";\n  right: 1px;\n  border-right-width: 0;\n  border-left-color: #fff;\n  bottom: -10px;\n}\n.carousel {\n  position: relative;\n}\n.carousel-inner {\n  position: relative;\n  overflow: hidden;\n  width: 100%;\n}\n.carousel-inner > .item {\n  display: none;\n  position: relative;\n  -webkit-transition: 0.6s ease-in-out left;\n  -o-transition: 0.6s ease-in-out left;\n  transition: 0.6s ease-in-out left;\n}\n.carousel-inner > .item > img,\n.carousel-inner > .item > a > img {\n  line-height: 1;\n}\n@media all and (transform-3d), (-webkit-transform-3d) {\n  .carousel-inner > .item {\n    -webkit-transition: -webkit-transform 0.6s ease-in-out;\n    -moz-transition: -moz-transform 0.6s ease-in-out;\n    -o-transition: -o-transform 0.6s ease-in-out;\n    transition: transform 0.6s ease-in-out;\n    -webkit-backface-visibility: hidden;\n    -moz-backface-visibility: hidden;\n    backface-visibility: hidden;\n    -webkit-perspective: 1000px;\n    -moz-perspective: 1000px;\n    perspective: 1000px;\n  }\n  .carousel-inner > .item.next,\n  .carousel-inner > .item.active.right {\n    -webkit-transform: translate3d(100%, 0, 0);\n    transform: translate3d(100%, 0, 0);\n    left: 0;\n  }\n  .carousel-inner > .item.prev,\n  .carousel-inner > .item.active.left {\n    -webkit-transform: translate3d(-100%, 0, 0);\n    transform: translate3d(-100%, 0, 0);\n    left: 0;\n  }\n  .carousel-inner > .item.next.left,\n  .carousel-inner > .item.prev.right,\n  .carousel-inner > .item.active {\n    -webkit-transform: translate3d(0, 0, 0);\n    transform: translate3d(0, 0, 0);\n    left: 0;\n  }\n}\n.carousel-inner > .active,\n.carousel-inner > .next,\n.carousel-inner > .prev {\n  display: block;\n}\n.carousel-inner > .active {\n  left: 0;\n}\n.carousel-inner > .next,\n.carousel-inner > .prev {\n  position: absolute;\n  top: 0;\n  width: 100%;\n}\n.carousel-inner > .next {\n  left: 100%;\n}\n.carousel-inner > .prev {\n  left: -100%;\n}\n.carousel-inner > .next.left,\n.carousel-inner > .prev.right {\n  left: 0;\n}\n.carousel-inner > .active.left {\n  left: -100%;\n}\n.carousel-inner > .active.right {\n  left: 100%;\n}\n.carousel-control {\n  position: absolute;\n  top: 0;\n  left: 0;\n  bottom: 0;\n  width: 15%;\n  opacity: 0.5;\n  filter: alpha(opacity=50);\n  font-size: 20px;\n  color: #fff;\n  text-align: center;\n  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);\n  background-color: rgba(0, 0, 0, 0);\n}\n.carousel-control.left {\n  background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n  background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);\n}\n.carousel-control.right {\n  left: auto;\n  right: 0;\n  background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n  background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n  background-repeat: repeat-x;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);\n}\n.carousel-control:hover,\n.carousel-control:focus {\n  outline: 0;\n  color: #fff;\n  text-decoration: none;\n  opacity: 0.9;\n  filter: alpha(opacity=90);\n}\n.carousel-control .icon-prev,\n.carousel-control .icon-next,\n.carousel-control .glyphicon-chevron-left,\n.carousel-control .glyphicon-chevron-right {\n  position: absolute;\n  top: 50%;\n  margin-top: -10px;\n  z-index: 5;\n  display: inline-block;\n}\n.carousel-control .icon-prev,\n.carousel-control .glyphicon-chevron-left {\n  left: 50%;\n  margin-left: -10px;\n}\n.carousel-control .icon-next,\n.carousel-control .glyphicon-chevron-right {\n  right: 50%;\n  margin-right: -10px;\n}\n.carousel-control .icon-prev,\n.carousel-control .icon-next {\n  width: 20px;\n  height: 20px;\n  line-height: 1;\n  font-family: serif;\n}\n.carousel-control .icon-prev:before {\n  content: '\\2039';\n}\n.carousel-control .icon-next:before {\n  content: '\\203a';\n}\n.carousel-indicators {\n  position: absolute;\n  bottom: 10px;\n  left: 50%;\n  z-index: 15;\n  width: 60%;\n  margin-left: -30%;\n  padding-left: 0;\n  list-style: none;\n  text-align: center;\n}\n.carousel-indicators li {\n  display: inline-block;\n  width: 10px;\n  height: 10px;\n  margin: 1px;\n  text-indent: -999px;\n  border: 1px solid #fff;\n  border-radius: 10px;\n  cursor: pointer;\n  background-color: #000 \\9;\n  background-color: rgba(0, 0, 0, 0);\n}\n.carousel-indicators .active {\n  margin: 0;\n  width: 12px;\n  height: 12px;\n  background-color: #fff;\n}\n.carousel-caption {\n  position: absolute;\n  left: 15%;\n  right: 15%;\n  bottom: 20px;\n  z-index: 10;\n  padding-top: 20px;\n  padding-bottom: 20px;\n  color: #fff;\n  text-align: center;\n  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);\n}\n.carousel-caption .btn {\n  text-shadow: none;\n}\n@media screen and (min-width: 768px) {\n  .carousel-control .glyphicon-chevron-left,\n  .carousel-control .glyphicon-chevron-right,\n  .carousel-control .icon-prev,\n  .carousel-control .icon-next {\n    width: 30px;\n    height: 30px;\n    margin-top: -10px;\n    font-size: 30px;\n  }\n  .carousel-control .glyphicon-chevron-left,\n  .carousel-control .icon-prev {\n    margin-left: -10px;\n  }\n  .carousel-control .glyphicon-chevron-right,\n  .carousel-control .icon-next {\n    margin-right: -10px;\n  }\n  .carousel-caption {\n    left: 20%;\n    right: 20%;\n    padding-bottom: 30px;\n  }\n  .carousel-indicators {\n    bottom: 20px;\n  }\n}\n.clearfix:before,\n.clearfix:after,\n.dl-horizontal dd:before,\n.dl-horizontal dd:after,\n.container:before,\n.container:after,\n.container-fluid:before,\n.container-fluid:after,\n.row:before,\n.row:after,\n.form-horizontal .form-group:before,\n.form-horizontal .form-group:after,\n.btn-toolbar:before,\n.btn-toolbar:after,\n.btn-group-vertical > .btn-group:before,\n.btn-group-vertical > .btn-group:after,\n.nav:before,\n.nav:after,\n.navbar:before,\n.navbar:after,\n.navbar-header:before,\n.navbar-header:after,\n.navbar-collapse:before,\n.navbar-collapse:after,\n.pager:before,\n.pager:after,\n.panel-body:before,\n.panel-body:after,\n.modal-header:before,\n.modal-header:after,\n.modal-footer:before,\n.modal-footer:after {\n  content: \" \";\n  display: table;\n}\n.clearfix:after,\n.dl-horizontal dd:after,\n.container:after,\n.container-fluid:after,\n.row:after,\n.form-horizontal .form-group:after,\n.btn-toolbar:after,\n.btn-group-vertical > .btn-group:after,\n.nav:after,\n.navbar:after,\n.navbar-header:after,\n.navbar-collapse:after,\n.pager:after,\n.panel-body:after,\n.modal-header:after,\n.modal-footer:after {\n  clear: both;\n}\n.center-block {\n  display: block;\n  margin-left: auto;\n  margin-right: auto;\n}\n.pull-right {\n  float: right !important;\n}\n.pull-left {\n  float: left !important;\n}\n.hide {\n  display: none !important;\n}\n.show {\n  display: block !important;\n}\n.invisible {\n  visibility: hidden;\n}\n.text-hide {\n  font: 0/0 a;\n  color: transparent;\n  text-shadow: none;\n  background-color: transparent;\n  border: 0;\n}\n.hidden {\n  display: none !important;\n}\n.affix {\n  position: fixed;\n}\n@-ms-viewport {\n  width: device-width;\n}\n.visible-xs,\n.visible-sm,\n.visible-md,\n.visible-lg {\n  display: none !important;\n}\n.visible-xs-block,\n.visible-xs-inline,\n.visible-xs-inline-block,\n.visible-sm-block,\n.visible-sm-inline,\n.visible-sm-inline-block,\n.visible-md-block,\n.visible-md-inline,\n.visible-md-inline-block,\n.visible-lg-block,\n.visible-lg-inline,\n.visible-lg-inline-block {\n  display: none !important;\n}\n@media (max-width: 767px) {\n  .visible-xs {\n    display: block !important;\n  }\n  table.visible-xs {\n    display: table !important;\n  }\n  tr.visible-xs {\n    display: table-row !important;\n  }\n  th.visible-xs,\n  td.visible-xs {\n    display: table-cell !important;\n  }\n}\n@media (max-width: 767px) {\n  .visible-xs-block {\n    display: block !important;\n  }\n}\n@media (max-width: 767px) {\n  .visible-xs-inline {\n    display: inline !important;\n  }\n}\n@media (max-width: 767px) {\n  .visible-xs-inline-block {\n    display: inline-block !important;\n  }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n  .visible-sm {\n    display: block !important;\n  }\n  table.visible-sm {\n    display: table !important;\n  }\n  tr.visible-sm {\n    display: table-row !important;\n  }\n  th.visible-sm,\n  td.visible-sm {\n    display: table-cell !important;\n  }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n  .visible-sm-block {\n    display: block !important;\n  }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n  .visible-sm-inline {\n    display: inline !important;\n  }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n  .visible-sm-inline-block {\n    display: inline-block !important;\n  }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n  .visible-md {\n    display: block !important;\n  }\n  table.visible-md {\n    display: table !important;\n  }\n  tr.visible-md {\n    display: table-row !important;\n  }\n  th.visible-md,\n  td.visible-md {\n    display: table-cell !important;\n  }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n  .visible-md-block {\n    display: block !important;\n  }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n  .visible-md-inline {\n    display: inline !important;\n  }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n  .visible-md-inline-block {\n    display: inline-block !important;\n  }\n}\n@media (min-width: 1200px) {\n  .visible-lg {\n    display: block !important;\n  }\n  table.visible-lg {\n    display: table !important;\n  }\n  tr.visible-lg {\n    display: table-row !important;\n  }\n  th.visible-lg,\n  td.visible-lg {\n    display: table-cell !important;\n  }\n}\n@media (min-width: 1200px) {\n  .visible-lg-block {\n    display: block !important;\n  }\n}\n@media (min-width: 1200px) {\n  .visible-lg-inline {\n    display: inline !important;\n  }\n}\n@media (min-width: 1200px) {\n  .visible-lg-inline-block {\n    display: inline-block !important;\n  }\n}\n@media (max-width: 767px) {\n  .hidden-xs {\n    display: none !important;\n  }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n  .hidden-sm {\n    display: none !important;\n  }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n  .hidden-md {\n    display: none !important;\n  }\n}\n@media (min-width: 1200px) {\n  .hidden-lg {\n    display: none !important;\n  }\n}\n.visible-print {\n  display: none !important;\n}\n@media print {\n  .visible-print {\n    display: block !important;\n  }\n  table.visible-print {\n    display: table !important;\n  }\n  tr.visible-print {\n    display: table-row !important;\n  }\n  th.visible-print,\n  td.visible-print {\n    display: table-cell !important;\n  }\n}\n.visible-print-block {\n  display: none !important;\n}\n@media print {\n  .visible-print-block {\n    display: block !important;\n  }\n}\n.visible-print-inline {\n  display: none !important;\n}\n@media print {\n  .visible-print-inline {\n    display: inline !important;\n  }\n}\n.visible-print-inline-block {\n  display: none !important;\n}\n@media print {\n  .visible-print-inline-block {\n    display: inline-block !important;\n  }\n}\n@media print {\n  .hidden-print {\n    display: none !important;\n  }\n}\n/*# sourceMappingURL=bootstrap.css.map */","/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n\n//\n// 1. Set default font family to sans-serif.\n// 2. Prevent iOS and IE text size adjust after device orientation change,\n//    without disabling user zoom.\n//\n\nhtml {\n  font-family: sans-serif; // 1\n  -ms-text-size-adjust: 100%; // 2\n  -webkit-text-size-adjust: 100%; // 2\n}\n\n//\n// Remove default margin.\n//\n\nbody {\n  margin: 0;\n}\n\n// HTML5 display definitions\n// ==========================================================================\n\n//\n// Correct `block` display not defined for any HTML5 element in IE 8/9.\n// Correct `block` display not defined for `details` or `summary` in IE 10/11\n// and Firefox.\n// Correct `block` display not defined for `main` in IE 11.\n//\n\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nmenu,\nnav,\nsection,\nsummary {\n  display: block;\n}\n\n//\n// 1. Correct `inline-block` display not defined in IE 8/9.\n// 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n//\n\naudio,\ncanvas,\nprogress,\nvideo {\n  display: inline-block; // 1\n  vertical-align: baseline; // 2\n}\n\n//\n// Prevent modern browsers from displaying `audio` without controls.\n// Remove excess height in iOS 5 devices.\n//\n\naudio:not([controls]) {\n  display: none;\n  height: 0;\n}\n\n//\n// Address `[hidden]` styling not present in IE 8/9/10.\n// Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n//\n\n[hidden],\ntemplate {\n  display: none;\n}\n\n// Links\n// ==========================================================================\n\n//\n// Remove the gray background color from active links in IE 10.\n//\n\na {\n  background-color: transparent;\n}\n\n//\n// Improve readability of focused elements when they are also in an\n// active/hover state.\n//\n\na:active,\na:hover {\n  outline: 0;\n}\n\n// Text-level semantics\n// ==========================================================================\n\n//\n// Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n//\n\nabbr[title] {\n  border-bottom: 1px dotted;\n}\n\n//\n// Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n//\n\nb,\nstrong {\n  font-weight: bold;\n}\n\n//\n// Address styling not present in Safari and Chrome.\n//\n\ndfn {\n  font-style: italic;\n}\n\n//\n// Address variable `h1` font-size and margin within `section` and `article`\n// contexts in Firefox 4+, Safari, and Chrome.\n//\n\nh1 {\n  font-size: 2em;\n  margin: 0.67em 0;\n}\n\n//\n// Address styling not present in IE 8/9.\n//\n\nmark {\n  background: #ff0;\n  color: #000;\n}\n\n//\n// Address inconsistent and variable font size in all browsers.\n//\n\nsmall {\n  font-size: 80%;\n}\n\n//\n// Prevent `sub` and `sup` affecting `line-height` in all browsers.\n//\n\nsub,\nsup {\n  font-size: 75%;\n  line-height: 0;\n  position: relative;\n  vertical-align: baseline;\n}\n\nsup {\n  top: -0.5em;\n}\n\nsub {\n  bottom: -0.25em;\n}\n\n// Embedded content\n// ==========================================================================\n\n//\n// Remove border when inside `a` element in IE 8/9/10.\n//\n\nimg {\n  border: 0;\n}\n\n//\n// Correct overflow not hidden in IE 9/10/11.\n//\n\nsvg:not(:root) {\n  overflow: hidden;\n}\n\n// Grouping content\n// ==========================================================================\n\n//\n// Address margin not present in IE 8/9 and Safari.\n//\n\nfigure {\n  margin: 1em 40px;\n}\n\n//\n// Address differences between Firefox and other browsers.\n//\n\nhr {\n  box-sizing: content-box;\n  height: 0;\n}\n\n//\n// Contain overflow in all browsers.\n//\n\npre {\n  overflow: auto;\n}\n\n//\n// Address odd `em`-unit font size rendering in all browsers.\n//\n\ncode,\nkbd,\npre,\nsamp {\n  font-family: monospace, monospace;\n  font-size: 1em;\n}\n\n// Forms\n// ==========================================================================\n\n//\n// Known limitation: by default, Chrome and Safari on OS X allow very limited\n// styling of `select`, unless a `border` property is set.\n//\n\n//\n// 1. Correct color not being inherited.\n//    Known issue: affects color of disabled elements.\n// 2. Correct font properties not being inherited.\n// 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n//\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n  color: inherit; // 1\n  font: inherit; // 2\n  margin: 0; // 3\n}\n\n//\n// Address `overflow` set to `hidden` in IE 8/9/10/11.\n//\n\nbutton {\n  overflow: visible;\n}\n\n//\n// Address inconsistent `text-transform` inheritance for `button` and `select`.\n// All other form control elements do not inherit `text-transform` values.\n// Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n// Correct `select` style inheritance in Firefox.\n//\n\nbutton,\nselect {\n  text-transform: none;\n}\n\n//\n// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n//    and `video` controls.\n// 2. Correct inability to style clickable `input` types in iOS.\n// 3. Improve usability and consistency of cursor style between image-type\n//    `input` and others.\n//\n\nbutton,\nhtml input[type=\"button\"], // 1\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n  -webkit-appearance: button; // 2\n  cursor: pointer; // 3\n}\n\n//\n// Re-set default cursor for disabled elements.\n//\n\nbutton[disabled],\nhtml input[disabled] {\n  cursor: default;\n}\n\n//\n// Remove inner padding and border in Firefox 4+.\n//\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n  border: 0;\n  padding: 0;\n}\n\n//\n// Address Firefox 4+ setting `line-height` on `input` using `!important` in\n// the UA stylesheet.\n//\n\ninput {\n  line-height: normal;\n}\n\n//\n// It's recommended that you don't attempt to style these elements.\n// Firefox's implementation doesn't respect box-sizing, padding, or width.\n//\n// 1. Address box sizing set to `content-box` in IE 8/9/10.\n// 2. Remove excess padding in IE 8/9/10.\n//\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n  box-sizing: border-box; // 1\n  padding: 0; // 2\n}\n\n//\n// Fix the cursor style for Chrome's increment/decrement buttons. For certain\n// `font-size` values of the `input`, it causes the cursor style of the\n// decrement button to change from `default` to `text`.\n//\n\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n  height: auto;\n}\n\n//\n// 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n// 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\n//\n\ninput[type=\"search\"] {\n  -webkit-appearance: textfield; // 1\n  box-sizing: content-box; //2\n}\n\n//\n// Remove inner padding and search cancel button in Safari and Chrome on OS X.\n// Safari (but not Chrome) clips the cancel button when the search input has\n// padding (and `textfield` appearance).\n//\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n  -webkit-appearance: none;\n}\n\n//\n// Define consistent border, margin, and padding.\n//\n\nfieldset {\n  border: 1px solid #c0c0c0;\n  margin: 0 2px;\n  padding: 0.35em 0.625em 0.75em;\n}\n\n//\n// 1. Correct `color` not being inherited in IE 8/9/10/11.\n// 2. Remove padding so people aren't caught out if they zero out fieldsets.\n//\n\nlegend {\n  border: 0; // 1\n  padding: 0; // 2\n}\n\n//\n// Remove default vertical scrollbar in IE 8/9/10/11.\n//\n\ntextarea {\n  overflow: auto;\n}\n\n//\n// Don't inherit the `font-weight` (applied by a rule above).\n// NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n//\n\noptgroup {\n  font-weight: bold;\n}\n\n// Tables\n// ==========================================================================\n\n//\n// Remove most spacing between table cells.\n//\n\ntable {\n  border-collapse: collapse;\n  border-spacing: 0;\n}\n\ntd,\nth {\n  padding: 0;\n}\n","/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */\n\n// ==========================================================================\n// Print styles.\n// Inlined to avoid the additional HTTP request: h5bp.com/r\n// ==========================================================================\n\n@media print {\n    *,\n    *:before,\n    *:after {\n        background: transparent !important;\n        color: #000 !important; // Black prints faster: h5bp.com/s\n        box-shadow: none !important;\n        text-shadow: none !important;\n    }\n\n    a,\n    a:visited {\n        text-decoration: underline;\n    }\n\n    a[href]:after {\n        content: \" (\" attr(href) \")\";\n    }\n\n    abbr[title]:after {\n        content: \" (\" attr(title) \")\";\n    }\n\n    // Don't show links that are fragment identifiers,\n    // or use the `javascript:` pseudo protocol\n    a[href^=\"#\"]:after,\n    a[href^=\"javascript:\"]:after {\n        content: \"\";\n    }\n\n    pre,\n    blockquote {\n        border: 1px solid #999;\n        page-break-inside: avoid;\n    }\n\n    thead {\n        display: table-header-group; // h5bp.com/t\n    }\n\n    tr,\n    img {\n        page-break-inside: avoid;\n    }\n\n    img {\n        max-width: 100% !important;\n    }\n\n    p,\n    h2,\n    h3 {\n        orphans: 3;\n        widows: 3;\n    }\n\n    h2,\n    h3 {\n        page-break-after: avoid;\n    }\n\n    // Bootstrap specific changes start\n\n    // Bootstrap components\n    .navbar {\n        display: none;\n    }\n    .btn,\n    .dropup > .btn {\n        > .caret {\n            border-top-color: #000 !important;\n        }\n    }\n    .label {\n        border: 1px solid #000;\n    }\n\n    .table {\n        border-collapse: collapse !important;\n\n        td,\n        th {\n            background-color: #fff !important;\n        }\n    }\n    .table-bordered {\n        th,\n        td {\n            border: 1px solid #ddd !important;\n        }\n    }\n\n    // Bootstrap specific changes end\n}\n","//\n// Glyphicons for Bootstrap\n//\n// Since icons are fonts, they can be placed anywhere text is placed and are\n// thus automatically sized to match the surrounding child. To use, create an\n// inline element with the appropriate classes, like so:\n//\n// <a href=\"#\"><span class=\"glyphicon glyphicon-star\"></span> Star</a>\n\n// Import the fonts\n@font-face {\n  font-family: 'Glyphicons Halflings';\n  src: url('@{icon-font-path}@{icon-font-name}.eot');\n  src: url('@{icon-font-path}@{icon-font-name}.eot?#iefix') format('embedded-opentype'),\n       url('@{icon-font-path}@{icon-font-name}.woff2') format('woff2'),\n       url('@{icon-font-path}@{icon-font-name}.woff') format('woff'),\n       url('@{icon-font-path}@{icon-font-name}.ttf') format('truetype'),\n       url('@{icon-font-path}@{icon-font-name}.svg#@{icon-font-svg-id}') format('svg');\n}\n\n// Catchall baseclass\n.glyphicon {\n  position: relative;\n  top: 1px;\n  display: inline-block;\n  font-family: 'Glyphicons Halflings';\n  font-style: normal;\n  font-weight: normal;\n  line-height: 1;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\n// Individual icons\n.glyphicon-asterisk               { &:before { content: \"\\002a\"; } }\n.glyphicon-plus                   { &:before { content: \"\\002b\"; } }\n.glyphicon-euro,\n.glyphicon-eur                    { &:before { content: \"\\20ac\"; } }\n.glyphicon-minus                  { &:before { content: \"\\2212\"; } }\n.glyphicon-cloud                  { &:before { content: \"\\2601\"; } }\n.glyphicon-envelope               { &:before { content: \"\\2709\"; } }\n.glyphicon-pencil                 { &:before { content: \"\\270f\"; } }\n.glyphicon-glass                  { &:before { content: \"\\e001\"; } }\n.glyphicon-music                  { &:before { content: \"\\e002\"; } }\n.glyphicon-search                 { &:before { content: \"\\e003\"; } }\n.glyphicon-heart                  { &:before { content: \"\\e005\"; } }\n.glyphicon-star                   { &:before { content: \"\\e006\"; } }\n.glyphicon-star-empty             { &:before { content: \"\\e007\"; } }\n.glyphicon-user                   { &:before { content: \"\\e008\"; } }\n.glyphicon-film                   { &:before { content: \"\\e009\"; } }\n.glyphicon-th-large               { &:before { content: \"\\e010\"; } }\n.glyphicon-th                     { &:before { content: \"\\e011\"; } }\n.glyphicon-th-list                { &:before { content: \"\\e012\"; } }\n.glyphicon-ok                     { &:before { content: \"\\e013\"; } }\n.glyphicon-remove                 { &:before { content: \"\\e014\"; } }\n.glyphicon-zoom-in                { &:before { content: \"\\e015\"; } }\n.glyphicon-zoom-out               { &:before { content: \"\\e016\"; } }\n.glyphicon-off                    { &:before { content: \"\\e017\"; } }\n.glyphicon-signal                 { &:before { content: \"\\e018\"; } }\n.glyphicon-cog                    { &:before { content: \"\\e019\"; } }\n.glyphicon-trash                  { &:before { content: \"\\e020\"; } }\n.glyphicon-home                   { &:before { content: \"\\e021\"; } }\n.glyphicon-file                   { &:before { content: \"\\e022\"; } }\n.glyphicon-time                   { &:before { content: \"\\e023\"; } }\n.glyphicon-road                   { &:before { content: \"\\e024\"; } }\n.glyphicon-download-alt           { &:before { content: \"\\e025\"; } }\n.glyphicon-download               { &:before { content: \"\\e026\"; } }\n.glyphicon-upload                 { &:before { content: \"\\e027\"; } }\n.glyphicon-inbox                  { &:before { content: \"\\e028\"; } }\n.glyphicon-play-circle            { &:before { content: \"\\e029\"; } }\n.glyphicon-repeat                 { &:before { content: \"\\e030\"; } }\n.glyphicon-refresh                { &:before { content: \"\\e031\"; } }\n.glyphicon-list-alt               { &:before { content: \"\\e032\"; } }\n.glyphicon-lock                   { &:before { content: \"\\e033\"; } }\n.glyphicon-flag                   { &:before { content: \"\\e034\"; } }\n.glyphicon-headphones             { &:before { content: \"\\e035\"; } }\n.glyphicon-volume-off             { &:before { content: \"\\e036\"; } }\n.glyphicon-volume-down            { &:before { content: \"\\e037\"; } }\n.glyphicon-volume-up              { &:before { content: \"\\e038\"; } }\n.glyphicon-qrcode                 { &:before { content: \"\\e039\"; } }\n.glyphicon-barcode                { &:before { content: \"\\e040\"; } }\n.glyphicon-tag                    { &:before { content: \"\\e041\"; } }\n.glyphicon-tags                   { &:before { content: \"\\e042\"; } }\n.glyphicon-book                   { &:before { content: \"\\e043\"; } }\n.glyphicon-bookmark               { &:before { content: \"\\e044\"; } }\n.glyphicon-print                  { &:before { content: \"\\e045\"; } }\n.glyphicon-camera                 { &:before { content: \"\\e046\"; } }\n.glyphicon-font                   { &:before { content: \"\\e047\"; } }\n.glyphicon-bold                   { &:before { content: \"\\e048\"; } }\n.glyphicon-italic                 { &:before { content: \"\\e049\"; } }\n.glyphicon-text-height            { &:before { content: \"\\e050\"; } }\n.glyphicon-text-width             { &:before { content: \"\\e051\"; } }\n.glyphicon-align-left             { &:before { content: \"\\e052\"; } }\n.glyphicon-align-center           { &:before { content: \"\\e053\"; } }\n.glyphicon-align-right            { &:before { content: \"\\e054\"; } }\n.glyphicon-align-justify          { &:before { content: \"\\e055\"; } }\n.glyphicon-list                   { &:before { content: \"\\e056\"; } }\n.glyphicon-indent-left            { &:before { content: \"\\e057\"; } }\n.glyphicon-indent-right           { &:before { content: \"\\e058\"; } }\n.glyphicon-facetime-video         { &:before { content: \"\\e059\"; } }\n.glyphicon-picture                { &:before { content: \"\\e060\"; } }\n.glyphicon-map-marker             { &:before { content: \"\\e062\"; } }\n.glyphicon-adjust                 { &:before { content: \"\\e063\"; } }\n.glyphicon-tint                   { &:before { content: \"\\e064\"; } }\n.glyphicon-edit                   { &:before { content: \"\\e065\"; } }\n.glyphicon-share                  { &:before { content: \"\\e066\"; } }\n.glyphicon-check                  { &:before { content: \"\\e067\"; } }\n.glyphicon-move                   { &:before { content: \"\\e068\"; } }\n.glyphicon-step-backward          { &:before { content: \"\\e069\"; } }\n.glyphicon-fast-backward          { &:before { content: \"\\e070\"; } }\n.glyphicon-backward               { &:before { content: \"\\e071\"; } }\n.glyphicon-play                   { &:before { content: \"\\e072\"; } }\n.glyphicon-pause                  { &:before { content: \"\\e073\"; } }\n.glyphicon-stop                   { &:before { content: \"\\e074\"; } }\n.glyphicon-forward                { &:before { content: \"\\e075\"; } }\n.glyphicon-fast-forward           { &:before { content: \"\\e076\"; } }\n.glyphicon-step-forward           { &:before { content: \"\\e077\"; } }\n.glyphicon-eject                  { &:before { content: \"\\e078\"; } }\n.glyphicon-chevron-left           { &:before { content: \"\\e079\"; } }\n.glyphicon-chevron-right          { &:before { content: \"\\e080\"; } }\n.glyphicon-plus-sign              { &:before { content: \"\\e081\"; } }\n.glyphicon-minus-sign             { &:before { content: \"\\e082\"; } }\n.glyphicon-remove-sign            { &:before { content: \"\\e083\"; } }\n.glyphicon-ok-sign                { &:before { content: \"\\e084\"; } }\n.glyphicon-question-sign          { &:before { content: \"\\e085\"; } }\n.glyphicon-info-sign              { &:before { content: \"\\e086\"; } }\n.glyphicon-screenshot             { &:before { content: \"\\e087\"; } }\n.glyphicon-remove-circle          { &:before { content: \"\\e088\"; } }\n.glyphicon-ok-circle              { &:before { content: \"\\e089\"; } }\n.glyphicon-ban-circle             { &:before { content: \"\\e090\"; } }\n.glyphicon-arrow-left             { &:before { content: \"\\e091\"; } }\n.glyphicon-arrow-right            { &:before { content: \"\\e092\"; } }\n.glyphicon-arrow-up               { &:before { content: \"\\e093\"; } }\n.glyphicon-arrow-down             { &:before { content: \"\\e094\"; } }\n.glyphicon-share-alt              { &:before { content: \"\\e095\"; } }\n.glyphicon-resize-full            { &:before { content: \"\\e096\"; } }\n.glyphicon-resize-small           { &:before { content: \"\\e097\"; } }\n.glyphicon-exclamation-sign       { &:before { content: \"\\e101\"; } }\n.glyphicon-gift                   { &:before { content: \"\\e102\"; } }\n.glyphicon-leaf                   { &:before { content: \"\\e103\"; } }\n.glyphicon-fire                   { &:before { content: \"\\e104\"; } }\n.glyphicon-eye-open               { &:before { content: \"\\e105\"; } }\n.glyphicon-eye-close              { &:before { content: \"\\e106\"; } }\n.glyphicon-warning-sign           { &:before { content: \"\\e107\"; } }\n.glyphicon-plane                  { &:before { content: \"\\e108\"; } }\n.glyphicon-calendar               { &:before { content: \"\\e109\"; } }\n.glyphicon-random                 { &:before { content: \"\\e110\"; } }\n.glyphicon-comment                { &:before { content: \"\\e111\"; } }\n.glyphicon-magnet                 { &:before { content: \"\\e112\"; } }\n.glyphicon-chevron-up             { &:before { content: \"\\e113\"; } }\n.glyphicon-chevron-down           { &:before { content: \"\\e114\"; } }\n.glyphicon-retweet                { &:before { content: \"\\e115\"; } }\n.glyphicon-shopping-cart          { &:before { content: \"\\e116\"; } }\n.glyphicon-folder-close           { &:before { content: \"\\e117\"; } }\n.glyphicon-folder-open            { &:before { content: \"\\e118\"; } }\n.glyphicon-resize-vertical        { &:before { content: \"\\e119\"; } }\n.glyphicon-resize-horizontal      { &:before { content: \"\\e120\"; } }\n.glyphicon-hdd                    { &:before { content: \"\\e121\"; } }\n.glyphicon-bullhorn               { &:before { content: \"\\e122\"; } }\n.glyphicon-bell                   { &:before { content: \"\\e123\"; } }\n.glyphicon-certificate            { &:before { content: \"\\e124\"; } }\n.glyphicon-thumbs-up              { &:before { content: \"\\e125\"; } }\n.glyphicon-thumbs-down            { &:before { content: \"\\e126\"; } }\n.glyphicon-hand-right             { &:before { content: \"\\e127\"; } }\n.glyphicon-hand-left              { &:before { content: \"\\e128\"; } }\n.glyphicon-hand-up                { &:before { content: \"\\e129\"; } }\n.glyphicon-hand-down              { &:before { content: \"\\e130\"; } }\n.glyphicon-circle-arrow-right     { &:before { content: \"\\e131\"; } }\n.glyphicon-circle-arrow-left      { &:before { content: \"\\e132\"; } }\n.glyphicon-circle-arrow-up        { &:before { content: \"\\e133\"; } }\n.glyphicon-circle-arrow-down      { &:before { content: \"\\e134\"; } }\n.glyphicon-globe                  { &:before { content: \"\\e135\"; } }\n.glyphicon-wrench                 { &:before { content: \"\\e136\"; } }\n.glyphicon-tasks                  { &:before { content: \"\\e137\"; } }\n.glyphicon-filter                 { &:before { content: \"\\e138\"; } }\n.glyphicon-briefcase              { &:before { content: \"\\e139\"; } }\n.glyphicon-fullscreen             { &:before { content: \"\\e140\"; } }\n.glyphicon-dashboard              { &:before { content: \"\\e141\"; } }\n.glyphicon-paperclip              { &:before { content: \"\\e142\"; } }\n.glyphicon-heart-empty            { &:before { content: \"\\e143\"; } }\n.glyphicon-link                   { &:before { content: \"\\e144\"; } }\n.glyphicon-phone                  { &:before { content: \"\\e145\"; } }\n.glyphicon-pushpin                { &:before { content: \"\\e146\"; } }\n.glyphicon-usd                    { &:before { content: \"\\e148\"; } }\n.glyphicon-gbp                    { &:before { content: \"\\e149\"; } }\n.glyphicon-sort                   { &:before { content: \"\\e150\"; } }\n.glyphicon-sort-by-alphabet       { &:before { content: \"\\e151\"; } }\n.glyphicon-sort-by-alphabet-alt   { &:before { content: \"\\e152\"; } }\n.glyphicon-sort-by-order          { &:before { content: \"\\e153\"; } }\n.glyphicon-sort-by-order-alt      { &:before { content: \"\\e154\"; } }\n.glyphicon-sort-by-attributes     { &:before { content: \"\\e155\"; } }\n.glyphicon-sort-by-attributes-alt { &:before { content: \"\\e156\"; } }\n.glyphicon-unchecked              { &:before { content: \"\\e157\"; } }\n.glyphicon-expand                 { &:before { content: \"\\e158\"; } }\n.glyphicon-collapse-down          { &:before { content: \"\\e159\"; } }\n.glyphicon-collapse-up            { &:before { content: \"\\e160\"; } }\n.glyphicon-log-in                 { &:before { content: \"\\e161\"; } }\n.glyphicon-flash                  { &:before { content: \"\\e162\"; } }\n.glyphicon-log-out                { &:before { content: \"\\e163\"; } }\n.glyphicon-new-window             { &:before { content: \"\\e164\"; } }\n.glyphicon-record                 { &:before { content: \"\\e165\"; } }\n.glyphicon-save                   { &:before { content: \"\\e166\"; } }\n.glyphicon-open                   { &:before { content: \"\\e167\"; } }\n.glyphicon-saved                  { &:before { content: \"\\e168\"; } }\n.glyphicon-import                 { &:before { content: \"\\e169\"; } }\n.glyphicon-export                 { &:before { content: \"\\e170\"; } }\n.glyphicon-send                   { &:before { content: \"\\e171\"; } }\n.glyphicon-floppy-disk            { &:before { content: \"\\e172\"; } }\n.glyphicon-floppy-saved           { &:before { content: \"\\e173\"; } }\n.glyphicon-floppy-remove          { &:before { content: \"\\e174\"; } }\n.glyphicon-floppy-save            { &:before { content: \"\\e175\"; } }\n.glyphicon-floppy-open            { &:before { content: \"\\e176\"; } }\n.glyphicon-credit-card            { &:before { content: \"\\e177\"; } }\n.glyphicon-transfer               { &:before { content: \"\\e178\"; } }\n.glyphicon-cutlery                { &:before { content: \"\\e179\"; } }\n.glyphicon-header                 { &:before { content: \"\\e180\"; } }\n.glyphicon-compressed             { &:before { content: \"\\e181\"; } }\n.glyphicon-earphone               { &:before { content: \"\\e182\"; } }\n.glyphicon-phone-alt              { &:before { content: \"\\e183\"; } }\n.glyphicon-tower                  { &:before { content: \"\\e184\"; } }\n.glyphicon-stats                  { &:before { content: \"\\e185\"; } }\n.glyphicon-sd-video               { &:before { content: \"\\e186\"; } }\n.glyphicon-hd-video               { &:before { content: \"\\e187\"; } }\n.glyphicon-subtitles              { &:before { content: \"\\e188\"; } }\n.glyphicon-sound-stereo           { &:before { content: \"\\e189\"; } }\n.glyphicon-sound-dolby            { &:before { content: \"\\e190\"; } }\n.glyphicon-sound-5-1              { &:before { content: \"\\e191\"; } }\n.glyphicon-sound-6-1              { &:before { content: \"\\e192\"; } }\n.glyphicon-sound-7-1              { &:before { content: \"\\e193\"; } }\n.glyphicon-copyright-mark         { &:before { content: \"\\e194\"; } }\n.glyphicon-registration-mark      { &:before { content: \"\\e195\"; } }\n.glyphicon-cloud-download         { &:before { content: \"\\e197\"; } }\n.glyphicon-cloud-upload           { &:before { content: \"\\e198\"; } }\n.glyphicon-tree-conifer           { &:before { content: \"\\e199\"; } }\n.glyphicon-tree-deciduous         { &:before { content: \"\\e200\"; } }\n.glyphicon-cd                     { &:before { content: \"\\e201\"; } }\n.glyphicon-save-file              { &:before { content: \"\\e202\"; } }\n.glyphicon-open-file              { &:before { content: \"\\e203\"; } }\n.glyphicon-level-up               { &:before { content: \"\\e204\"; } }\n.glyphicon-copy                   { &:before { content: \"\\e205\"; } }\n.glyphicon-paste                  { &:before { content: \"\\e206\"; } }\n// The following 2 Glyphicons are omitted for the time being because\n// they currently use Unicode codepoints that are outside the\n// Basic Multilingual Plane (BMP). Older buggy versions of WebKit can't handle\n// non-BMP codepoints in CSS string escapes, and thus can't display these two icons.\n// Notably, the bug affects some older versions of the Android Browser.\n// More info: https://github.com/twbs/bootstrap/issues/10106\n// .glyphicon-door                   { &:before { content: \"\\1f6aa\"; } }\n// .glyphicon-key                    { &:before { content: \"\\1f511\"; } }\n.glyphicon-alert                  { &:before { content: \"\\e209\"; } }\n.glyphicon-equalizer              { &:before { content: \"\\e210\"; } }\n.glyphicon-king                   { &:before { content: \"\\e211\"; } }\n.glyphicon-queen                  { &:before { content: \"\\e212\"; } }\n.glyphicon-pawn                   { &:before { content: \"\\e213\"; } }\n.glyphicon-bishop                 { &:before { content: \"\\e214\"; } }\n.glyphicon-knight                 { &:before { content: \"\\e215\"; } }\n.glyphicon-baby-formula           { &:before { content: \"\\e216\"; } }\n.glyphicon-tent                   { &:before { content: \"\\26fa\"; } }\n.glyphicon-blackboard             { &:before { content: \"\\e218\"; } }\n.glyphicon-bed                    { &:before { content: \"\\e219\"; } }\n.glyphicon-apple                  { &:before { content: \"\\f8ff\"; } }\n.glyphicon-erase                  { &:before { content: \"\\e221\"; } }\n.glyphicon-hourglass              { &:before { content: \"\\231b\"; } }\n.glyphicon-lamp                   { &:before { content: \"\\e223\"; } }\n.glyphicon-duplicate              { &:before { content: \"\\e224\"; } }\n.glyphicon-piggy-bank             { &:before { content: \"\\e225\"; } }\n.glyphicon-scissors               { &:before { content: \"\\e226\"; } }\n.glyphicon-bitcoin                { &:before { content: \"\\e227\"; } }\n.glyphicon-btc                    { &:before { content: \"\\e227\"; } }\n.glyphicon-xbt                    { &:before { content: \"\\e227\"; } }\n.glyphicon-yen                    { &:before { content: \"\\00a5\"; } }\n.glyphicon-jpy                    { &:before { content: \"\\00a5\"; } }\n.glyphicon-ruble                  { &:before { content: \"\\20bd\"; } }\n.glyphicon-rub                    { &:before { content: \"\\20bd\"; } }\n.glyphicon-scale                  { &:before { content: \"\\e230\"; } }\n.glyphicon-ice-lolly              { &:before { content: \"\\e231\"; } }\n.glyphicon-ice-lolly-tasted       { &:before { content: \"\\e232\"; } }\n.glyphicon-education              { &:before { content: \"\\e233\"; } }\n.glyphicon-option-horizontal      { &:before { content: \"\\e234\"; } }\n.glyphicon-option-vertical        { &:before { content: \"\\e235\"; } }\n.glyphicon-menu-hamburger         { &:before { content: \"\\e236\"; } }\n.glyphicon-modal-window           { &:before { content: \"\\e237\"; } }\n.glyphicon-oil                    { &:before { content: \"\\e238\"; } }\n.glyphicon-grain                  { &:before { content: \"\\e239\"; } }\n.glyphicon-sunglasses             { &:before { content: \"\\e240\"; } }\n.glyphicon-text-size              { &:before { content: \"\\e241\"; } }\n.glyphicon-text-color             { &:before { content: \"\\e242\"; } }\n.glyphicon-text-background        { &:before { content: \"\\e243\"; } }\n.glyphicon-object-align-top       { &:before { content: \"\\e244\"; } }\n.glyphicon-object-align-bottom    { &:before { content: \"\\e245\"; } }\n.glyphicon-object-align-horizontal{ &:before { content: \"\\e246\"; } }\n.glyphicon-object-align-left      { &:before { content: \"\\e247\"; } }\n.glyphicon-object-align-vertical  { &:before { content: \"\\e248\"; } }\n.glyphicon-object-align-right     { &:before { content: \"\\e249\"; } }\n.glyphicon-triangle-right         { &:before { content: \"\\e250\"; } }\n.glyphicon-triangle-left          { &:before { content: \"\\e251\"; } }\n.glyphicon-triangle-bottom        { &:before { content: \"\\e252\"; } }\n.glyphicon-triangle-top           { &:before { content: \"\\e253\"; } }\n.glyphicon-console                { &:before { content: \"\\e254\"; } }\n.glyphicon-superscript            { &:before { content: \"\\e255\"; } }\n.glyphicon-subscript              { &:before { content: \"\\e256\"; } }\n.glyphicon-menu-left              { &:before { content: \"\\e257\"; } }\n.glyphicon-menu-right             { &:before { content: \"\\e258\"; } }\n.glyphicon-menu-down              { &:before { content: \"\\e259\"; } }\n.glyphicon-menu-up                { &:before { content: \"\\e260\"; } }\n","//\n// Scaffolding\n// --------------------------------------------------\n\n\n// Reset the box-sizing\n//\n// Heads up! This reset may cause conflicts with some third-party widgets.\n// For recommendations on resolving such conflicts, see\n// http://getbootstrap.com/getting-started/#third-box-sizing\n* {\n  .box-sizing(border-box);\n}\n*:before,\n*:after {\n  .box-sizing(border-box);\n}\n\n\n// Body reset\n\nhtml {\n  font-size: 10px;\n  -webkit-tap-highlight-color: rgba(0,0,0,0);\n}\n\nbody {\n  font-family: @font-family-base;\n  font-size: @font-size-base;\n  line-height: @line-height-base;\n  color: @text-color;\n  background-color: @body-bg;\n}\n\n// Reset fonts for relevant elements\ninput,\nbutton,\nselect,\ntextarea {\n  font-family: inherit;\n  font-size: inherit;\n  line-height: inherit;\n}\n\n\n// Links\n\na {\n  color: @link-color;\n  text-decoration: none;\n\n  &:hover,\n  &:focus {\n    color: @link-hover-color;\n    text-decoration: @link-hover-decoration;\n  }\n\n  &:focus {\n    .tab-focus();\n  }\n}\n\n\n// Figures\n//\n// We reset this here because previously Normalize had no `figure` margins. This\n// ensures we don't break anyone's use of the element.\n\nfigure {\n  margin: 0;\n}\n\n\n// Images\n\nimg {\n  vertical-align: middle;\n}\n\n// Responsive images (ensure images don't scale beyond their parents)\n.img-responsive {\n  .img-responsive();\n}\n\n// Rounded corners\n.img-rounded {\n  border-radius: @border-radius-large;\n}\n\n// Image thumbnails\n//\n// Heads up! This is mixin-ed into thumbnails.less for `.thumbnail`.\n.img-thumbnail {\n  padding: @thumbnail-padding;\n  line-height: @line-height-base;\n  background-color: @thumbnail-bg;\n  border: 1px solid @thumbnail-border;\n  border-radius: @thumbnail-border-radius;\n  .transition(all .2s ease-in-out);\n\n  // Keep them at most 100% wide\n  .img-responsive(inline-block);\n}\n\n// Perfect circle\n.img-circle {\n  border-radius: 50%; // set radius in percents\n}\n\n\n// Horizontal rules\n\nhr {\n  margin-top:    @line-height-computed;\n  margin-bottom: @line-height-computed;\n  border: 0;\n  border-top: 1px solid @hr-border;\n}\n\n\n// Only display content to screen readers\n//\n// See: http://a11yproject.com/posts/how-to-hide-content/\n\n.sr-only {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  margin: -1px;\n  padding: 0;\n  overflow: hidden;\n  clip: rect(0,0,0,0);\n  border: 0;\n}\n\n// Use in conjunction with .sr-only to only display content when it's focused.\n// Useful for \"Skip to main content\" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1\n// Credit: HTML5 Boilerplate\n\n.sr-only-focusable {\n  &:active,\n  &:focus {\n    position: static;\n    width: auto;\n    height: auto;\n    margin: 0;\n    overflow: visible;\n    clip: auto;\n  }\n}\n\n\n// iOS \"clickable elements\" fix for role=\"button\"\n//\n// Fixes \"clickability\" issue (and more generally, the firing of events such as focus as well)\n// for traditionally non-focusable elements with role=\"button\"\n// see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile\n\n[role=\"button\"] {\n  cursor: pointer;\n}\n","// Vendor Prefixes\n//\n// All vendor mixins are deprecated as of v3.2.0 due to the introduction of\n// Autoprefixer in our Gruntfile. They have been removed in v4.\n\n// - Animations\n// - Backface visibility\n// - Box shadow\n// - Box sizing\n// - Content columns\n// - Hyphens\n// - Placeholder text\n// - Transformations\n// - Transitions\n// - User Select\n\n\n// Animations\n.animation(@animation) {\n  -webkit-animation: @animation;\n       -o-animation: @animation;\n          animation: @animation;\n}\n.animation-name(@name) {\n  -webkit-animation-name: @name;\n          animation-name: @name;\n}\n.animation-duration(@duration) {\n  -webkit-animation-duration: @duration;\n          animation-duration: @duration;\n}\n.animation-timing-function(@timing-function) {\n  -webkit-animation-timing-function: @timing-function;\n          animation-timing-function: @timing-function;\n}\n.animation-delay(@delay) {\n  -webkit-animation-delay: @delay;\n          animation-delay: @delay;\n}\n.animation-iteration-count(@iteration-count) {\n  -webkit-animation-iteration-count: @iteration-count;\n          animation-iteration-count: @iteration-count;\n}\n.animation-direction(@direction) {\n  -webkit-animation-direction: @direction;\n          animation-direction: @direction;\n}\n.animation-fill-mode(@fill-mode) {\n  -webkit-animation-fill-mode: @fill-mode;\n          animation-fill-mode: @fill-mode;\n}\n\n// Backface visibility\n// Prevent browsers from flickering when using CSS 3D transforms.\n// Default value is `visible`, but can be changed to `hidden`\n\n.backface-visibility(@visibility) {\n  -webkit-backface-visibility: @visibility;\n     -moz-backface-visibility: @visibility;\n          backface-visibility: @visibility;\n}\n\n// Drop shadows\n//\n// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's\n// supported browsers that have box shadow capabilities now support it.\n\n.box-shadow(@shadow) {\n  -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1\n          box-shadow: @shadow;\n}\n\n// Box sizing\n.box-sizing(@boxmodel) {\n  -webkit-box-sizing: @boxmodel;\n     -moz-box-sizing: @boxmodel;\n          box-sizing: @boxmodel;\n}\n\n// CSS3 Content Columns\n.content-columns(@column-count; @column-gap: @grid-gutter-width) {\n  -webkit-column-count: @column-count;\n     -moz-column-count: @column-count;\n          column-count: @column-count;\n  -webkit-column-gap: @column-gap;\n     -moz-column-gap: @column-gap;\n          column-gap: @column-gap;\n}\n\n// Optional hyphenation\n.hyphens(@mode: auto) {\n  word-wrap: break-word;\n  -webkit-hyphens: @mode;\n     -moz-hyphens: @mode;\n      -ms-hyphens: @mode; // IE10+\n       -o-hyphens: @mode;\n          hyphens: @mode;\n}\n\n// Placeholder text\n.placeholder(@color: @input-color-placeholder) {\n  // Firefox\n  &::-moz-placeholder {\n    color: @color;\n    opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526\n  }\n  &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+\n  &::-webkit-input-placeholder  { color: @color; } // Safari and Chrome\n}\n\n// Transformations\n.scale(@ratio) {\n  -webkit-transform: scale(@ratio);\n      -ms-transform: scale(@ratio); // IE9 only\n       -o-transform: scale(@ratio);\n          transform: scale(@ratio);\n}\n.scale(@ratioX; @ratioY) {\n  -webkit-transform: scale(@ratioX, @ratioY);\n      -ms-transform: scale(@ratioX, @ratioY); // IE9 only\n       -o-transform: scale(@ratioX, @ratioY);\n          transform: scale(@ratioX, @ratioY);\n}\n.scaleX(@ratio) {\n  -webkit-transform: scaleX(@ratio);\n      -ms-transform: scaleX(@ratio); // IE9 only\n       -o-transform: scaleX(@ratio);\n          transform: scaleX(@ratio);\n}\n.scaleY(@ratio) {\n  -webkit-transform: scaleY(@ratio);\n      -ms-transform: scaleY(@ratio); // IE9 only\n       -o-transform: scaleY(@ratio);\n          transform: scaleY(@ratio);\n}\n.skew(@x; @y) {\n  -webkit-transform: skewX(@x) skewY(@y);\n      -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+\n       -o-transform: skewX(@x) skewY(@y);\n          transform: skewX(@x) skewY(@y);\n}\n.translate(@x; @y) {\n  -webkit-transform: translate(@x, @y);\n      -ms-transform: translate(@x, @y); // IE9 only\n       -o-transform: translate(@x, @y);\n          transform: translate(@x, @y);\n}\n.translate3d(@x; @y; @z) {\n  -webkit-transform: translate3d(@x, @y, @z);\n          transform: translate3d(@x, @y, @z);\n}\n.rotate(@degrees) {\n  -webkit-transform: rotate(@degrees);\n      -ms-transform: rotate(@degrees); // IE9 only\n       -o-transform: rotate(@degrees);\n          transform: rotate(@degrees);\n}\n.rotateX(@degrees) {\n  -webkit-transform: rotateX(@degrees);\n      -ms-transform: rotateX(@degrees); // IE9 only\n       -o-transform: rotateX(@degrees);\n          transform: rotateX(@degrees);\n}\n.rotateY(@degrees) {\n  -webkit-transform: rotateY(@degrees);\n      -ms-transform: rotateY(@degrees); // IE9 only\n       -o-transform: rotateY(@degrees);\n          transform: rotateY(@degrees);\n}\n.perspective(@perspective) {\n  -webkit-perspective: @perspective;\n     -moz-perspective: @perspective;\n          perspective: @perspective;\n}\n.perspective-origin(@perspective) {\n  -webkit-perspective-origin: @perspective;\n     -moz-perspective-origin: @perspective;\n          perspective-origin: @perspective;\n}\n.transform-origin(@origin) {\n  -webkit-transform-origin: @origin;\n     -moz-transform-origin: @origin;\n      -ms-transform-origin: @origin; // IE9 only\n          transform-origin: @origin;\n}\n\n\n// Transitions\n\n.transition(@transition) {\n  -webkit-transition: @transition;\n       -o-transition: @transition;\n          transition: @transition;\n}\n.transition-property(@transition-property) {\n  -webkit-transition-property: @transition-property;\n          transition-property: @transition-property;\n}\n.transition-delay(@transition-delay) {\n  -webkit-transition-delay: @transition-delay;\n          transition-delay: @transition-delay;\n}\n.transition-duration(@transition-duration) {\n  -webkit-transition-duration: @transition-duration;\n          transition-duration: @transition-duration;\n}\n.transition-timing-function(@timing-function) {\n  -webkit-transition-timing-function: @timing-function;\n          transition-timing-function: @timing-function;\n}\n.transition-transform(@transition) {\n  -webkit-transition: -webkit-transform @transition;\n     -moz-transition: -moz-transform @transition;\n       -o-transition: -o-transform @transition;\n          transition: transform @transition;\n}\n\n\n// User select\n// For selecting text on the page\n\n.user-select(@select) {\n  -webkit-user-select: @select;\n     -moz-user-select: @select;\n      -ms-user-select: @select; // IE10+\n          user-select: @select;\n}\n","// WebKit-style focus\n\n.tab-focus() {\n  // Default\n  outline: thin dotted;\n  // WebKit\n  outline: 5px auto -webkit-focus-ring-color;\n  outline-offset: -2px;\n}\n","// Image Mixins\n// - Responsive image\n// - Retina image\n\n\n// Responsive image\n//\n// Keep images from scaling beyond the width of their parents.\n.img-responsive(@display: block) {\n  display: @display;\n  max-width: 100%; // Part 1: Set a maximum relative to the parent\n  height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching\n}\n\n\n// Retina image\n//\n// Short retina mixin for setting background-image and -size. Note that the\n// spelling of `min--moz-device-pixel-ratio` is intentional.\n.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {\n  background-image: url(\"@{file-1x}\");\n\n  @media\n  only screen and (-webkit-min-device-pixel-ratio: 2),\n  only screen and (   min--moz-device-pixel-ratio: 2),\n  only screen and (     -o-min-device-pixel-ratio: 2/1),\n  only screen and (        min-device-pixel-ratio: 2),\n  only screen and (                min-resolution: 192dpi),\n  only screen and (                min-resolution: 2dppx) {\n    background-image: url(\"@{file-2x}\");\n    background-size: @width-1x @height-1x;\n  }\n}\n","//\n// Typography\n// --------------------------------------------------\n\n\n// Headings\n// -------------------------\n\nh1, h2, h3, h4, h5, h6,\n.h1, .h2, .h3, .h4, .h5, .h6 {\n  font-family: @headings-font-family;\n  font-weight: @headings-font-weight;\n  line-height: @headings-line-height;\n  color: @headings-color;\n\n  small,\n  .small {\n    font-weight: normal;\n    line-height: 1;\n    color: @headings-small-color;\n  }\n}\n\nh1, .h1,\nh2, .h2,\nh3, .h3 {\n  margin-top: @line-height-computed;\n  margin-bottom: (@line-height-computed / 2);\n\n  small,\n  .small {\n    font-size: 65%;\n  }\n}\nh4, .h4,\nh5, .h5,\nh6, .h6 {\n  margin-top: (@line-height-computed / 2);\n  margin-bottom: (@line-height-computed / 2);\n\n  small,\n  .small {\n    font-size: 75%;\n  }\n}\n\nh1, .h1 { font-size: @font-size-h1; }\nh2, .h2 { font-size: @font-size-h2; }\nh3, .h3 { font-size: @font-size-h3; }\nh4, .h4 { font-size: @font-size-h4; }\nh5, .h5 { font-size: @font-size-h5; }\nh6, .h6 { font-size: @font-size-h6; }\n\n\n// Body text\n// -------------------------\n\np {\n  margin: 0 0 (@line-height-computed / 2);\n}\n\n.lead {\n  margin-bottom: @line-height-computed;\n  font-size: floor((@font-size-base * 1.15));\n  font-weight: 300;\n  line-height: 1.4;\n\n  @media (min-width: @screen-sm-min) {\n    font-size: (@font-size-base * 1.5);\n  }\n}\n\n\n// Emphasis & misc\n// -------------------------\n\n// Ex: (12px small font / 14px base font) * 100% = about 85%\nsmall,\n.small {\n  font-size: floor((100% * @font-size-small / @font-size-base));\n}\n\nmark,\n.mark {\n  background-color: @state-warning-bg;\n  padding: .2em;\n}\n\n// Alignment\n.text-left           { text-align: left; }\n.text-right          { text-align: right; }\n.text-center         { text-align: center; }\n.text-justify        { text-align: justify; }\n.text-nowrap         { white-space: nowrap; }\n\n// Transformation\n.text-lowercase      { text-transform: lowercase; }\n.text-uppercase      { text-transform: uppercase; }\n.text-capitalize     { text-transform: capitalize; }\n\n// Contextual colors\n.text-muted {\n  color: @text-muted;\n}\n.text-primary {\n  .text-emphasis-variant(@brand-primary);\n}\n.text-success {\n  .text-emphasis-variant(@state-success-text);\n}\n.text-info {\n  .text-emphasis-variant(@state-info-text);\n}\n.text-warning {\n  .text-emphasis-variant(@state-warning-text);\n}\n.text-danger {\n  .text-emphasis-variant(@state-danger-text);\n}\n\n// Contextual backgrounds\n// For now we'll leave these alongside the text classes until v4 when we can\n// safely shift things around (per SemVer rules).\n.bg-primary {\n  // Given the contrast here, this is the only class to have its color inverted\n  // automatically.\n  color: #fff;\n  .bg-variant(@brand-primary);\n}\n.bg-success {\n  .bg-variant(@state-success-bg);\n}\n.bg-info {\n  .bg-variant(@state-info-bg);\n}\n.bg-warning {\n  .bg-variant(@state-warning-bg);\n}\n.bg-danger {\n  .bg-variant(@state-danger-bg);\n}\n\n\n// Page header\n// -------------------------\n\n.page-header {\n  padding-bottom: ((@line-height-computed / 2) - 1);\n  margin: (@line-height-computed * 2) 0 @line-height-computed;\n  border-bottom: 1px solid @page-header-border-color;\n}\n\n\n// Lists\n// -------------------------\n\n// Unordered and Ordered lists\nul,\nol {\n  margin-top: 0;\n  margin-bottom: (@line-height-computed / 2);\n  ul,\n  ol {\n    margin-bottom: 0;\n  }\n}\n\n// List options\n\n// Unstyled keeps list items block level, just removes default browser padding and list-style\n.list-unstyled {\n  padding-left: 0;\n  list-style: none;\n}\n\n// Inline turns list items into inline-block\n.list-inline {\n  .list-unstyled();\n  margin-left: -5px;\n\n  > li {\n    display: inline-block;\n    padding-left: 5px;\n    padding-right: 5px;\n  }\n}\n\n// Description Lists\ndl {\n  margin-top: 0; // Remove browser default\n  margin-bottom: @line-height-computed;\n}\ndt,\ndd {\n  line-height: @line-height-base;\n}\ndt {\n  font-weight: bold;\n}\ndd {\n  margin-left: 0; // Undo browser default\n}\n\n// Horizontal description lists\n//\n// Defaults to being stacked without any of the below styles applied, until the\n// grid breakpoint is reached (default of ~768px).\n\n.dl-horizontal {\n  dd {\n    &:extend(.clearfix all); // Clear the floated `dt` if an empty `dd` is present\n  }\n\n  @media (min-width: @dl-horizontal-breakpoint) {\n    dt {\n      float: left;\n      width: (@dl-horizontal-offset - 20);\n      clear: left;\n      text-align: right;\n      .text-overflow();\n    }\n    dd {\n      margin-left: @dl-horizontal-offset;\n    }\n  }\n}\n\n\n// Misc\n// -------------------------\n\n// Abbreviations and acronyms\nabbr[title],\n// Add data-* attribute to help out our tooltip plugin, per https://github.com/twbs/bootstrap/issues/5257\nabbr[data-original-title] {\n  cursor: help;\n  border-bottom: 1px dotted @abbr-border-color;\n}\n.initialism {\n  font-size: 90%;\n  .text-uppercase();\n}\n\n// Blockquotes\nblockquote {\n  padding: (@line-height-computed / 2) @line-height-computed;\n  margin: 0 0 @line-height-computed;\n  font-size: @blockquote-font-size;\n  border-left: 5px solid @blockquote-border-color;\n\n  p,\n  ul,\n  ol {\n    &:last-child {\n      margin-bottom: 0;\n    }\n  }\n\n  // Note: Deprecated small and .small as of v3.1.0\n  // Context: https://github.com/twbs/bootstrap/issues/11660\n  footer,\n  small,\n  .small {\n    display: block;\n    font-size: 80%; // back to default font-size\n    line-height: @line-height-base;\n    color: @blockquote-small-color;\n\n    &:before {\n      content: '\\2014 \\00A0'; // em dash, nbsp\n    }\n  }\n}\n\n// Opposite alignment of blockquote\n//\n// Heads up: `blockquote.pull-right` has been deprecated as of v3.1.0.\n.blockquote-reverse,\nblockquote.pull-right {\n  padding-right: 15px;\n  padding-left: 0;\n  border-right: 5px solid @blockquote-border-color;\n  border-left: 0;\n  text-align: right;\n\n  // Account for citation\n  footer,\n  small,\n  .small {\n    &:before { content: ''; }\n    &:after {\n      content: '\\00A0 \\2014'; // nbsp, em dash\n    }\n  }\n}\n\n// Addresses\naddress {\n  margin-bottom: @line-height-computed;\n  font-style: normal;\n  line-height: @line-height-base;\n}\n","// Typography\n\n.text-emphasis-variant(@color) {\n  color: @color;\n  a&:hover,\n  a&:focus {\n    color: darken(@color, 10%);\n  }\n}\n","// Contextual backgrounds\n\n.bg-variant(@color) {\n  background-color: @color;\n  a&:hover,\n  a&:focus {\n    background-color: darken(@color, 10%);\n  }\n}\n","// Text overflow\n// Requires inline-block or block for proper styling\n\n.text-overflow() {\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n","//\n// Code (inline and block)\n// --------------------------------------------------\n\n\n// Inline and block code styles\ncode,\nkbd,\npre,\nsamp {\n  font-family: @font-family-monospace;\n}\n\n// Inline code\ncode {\n  padding: 2px 4px;\n  font-size: 90%;\n  color: @code-color;\n  background-color: @code-bg;\n  border-radius: @border-radius-base;\n}\n\n// User input typically entered via keyboard\nkbd {\n  padding: 2px 4px;\n  font-size: 90%;\n  color: @kbd-color;\n  background-color: @kbd-bg;\n  border-radius: @border-radius-small;\n  box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);\n\n  kbd {\n    padding: 0;\n    font-size: 100%;\n    font-weight: bold;\n    box-shadow: none;\n  }\n}\n\n// Blocks of code\npre {\n  display: block;\n  padding: ((@line-height-computed - 1) / 2);\n  margin: 0 0 (@line-height-computed / 2);\n  font-size: (@font-size-base - 1); // 14px to 13px\n  line-height: @line-height-base;\n  word-break: break-all;\n  word-wrap: break-word;\n  color: @pre-color;\n  background-color: @pre-bg;\n  border: 1px solid @pre-border-color;\n  border-radius: @border-radius-base;\n\n  // Account for some code outputs that place code tags in pre tags\n  code {\n    padding: 0;\n    font-size: inherit;\n    color: inherit;\n    white-space: pre-wrap;\n    background-color: transparent;\n    border-radius: 0;\n  }\n}\n\n// Enable scrollable blocks of code\n.pre-scrollable {\n  max-height: @pre-scrollable-max-height;\n  overflow-y: scroll;\n}\n","//\n// Grid system\n// --------------------------------------------------\n\n\n// Container widths\n//\n// Set the container width, and override it for fixed navbars in media queries.\n\n.container {\n  .container-fixed();\n\n  @media (min-width: @screen-sm-min) {\n    width: @container-sm;\n  }\n  @media (min-width: @screen-md-min) {\n    width: @container-md;\n  }\n  @media (min-width: @screen-lg-min) {\n    width: @container-lg;\n  }\n}\n\n\n// Fluid container\n//\n// Utilizes the mixin meant for fixed width containers, but without any defined\n// width for fluid, full width layouts.\n\n.container-fluid {\n  .container-fixed();\n}\n\n\n// Row\n//\n// Rows contain and clear the floats of your columns.\n\n.row {\n  .make-row();\n}\n\n\n// Columns\n//\n// Common styles for small and large grid columns\n\n.make-grid-columns();\n\n\n// Extra small grid\n//\n// Columns, offsets, pushes, and pulls for extra small devices like\n// smartphones.\n\n.make-grid(xs);\n\n\n// Small grid\n//\n// Columns, offsets, pushes, and pulls for the small device range, from phones\n// to tablets.\n\n@media (min-width: @screen-sm-min) {\n  .make-grid(sm);\n}\n\n\n// Medium grid\n//\n// Columns, offsets, pushes, and pulls for the desktop device range.\n\n@media (min-width: @screen-md-min) {\n  .make-grid(md);\n}\n\n\n// Large grid\n//\n// Columns, offsets, pushes, and pulls for the large desktop device range.\n\n@media (min-width: @screen-lg-min) {\n  .make-grid(lg);\n}\n","// Grid system\n//\n// Generate semantic grid columns with these mixins.\n\n// Centered container element\n.container-fixed(@gutter: @grid-gutter-width) {\n  margin-right: auto;\n  margin-left: auto;\n  padding-left:  floor((@gutter / 2));\n  padding-right: ceil((@gutter / 2));\n  &:extend(.clearfix all);\n}\n\n// Creates a wrapper for a series of columns\n.make-row(@gutter: @grid-gutter-width) {\n  margin-left:  ceil((@gutter / -2));\n  margin-right: floor((@gutter / -2));\n  &:extend(.clearfix all);\n}\n\n// Generate the extra small columns\n.make-xs-column(@columns; @gutter: @grid-gutter-width) {\n  position: relative;\n  float: left;\n  width: percentage((@columns / @grid-columns));\n  min-height: 1px;\n  padding-left:  (@gutter / 2);\n  padding-right: (@gutter / 2);\n}\n.make-xs-column-offset(@columns) {\n  margin-left: percentage((@columns / @grid-columns));\n}\n.make-xs-column-push(@columns) {\n  left: percentage((@columns / @grid-columns));\n}\n.make-xs-column-pull(@columns) {\n  right: percentage((@columns / @grid-columns));\n}\n\n// Generate the small columns\n.make-sm-column(@columns; @gutter: @grid-gutter-width) {\n  position: relative;\n  min-height: 1px;\n  padding-left:  (@gutter / 2);\n  padding-right: (@gutter / 2);\n\n  @media (min-width: @screen-sm-min) {\n    float: left;\n    width: percentage((@columns / @grid-columns));\n  }\n}\n.make-sm-column-offset(@columns) {\n  @media (min-width: @screen-sm-min) {\n    margin-left: percentage((@columns / @grid-columns));\n  }\n}\n.make-sm-column-push(@columns) {\n  @media (min-width: @screen-sm-min) {\n    left: percentage((@columns / @grid-columns));\n  }\n}\n.make-sm-column-pull(@columns) {\n  @media (min-width: @screen-sm-min) {\n    right: percentage((@columns / @grid-columns));\n  }\n}\n\n// Generate the medium columns\n.make-md-column(@columns; @gutter: @grid-gutter-width) {\n  position: relative;\n  min-height: 1px;\n  padding-left:  (@gutter / 2);\n  padding-right: (@gutter / 2);\n\n  @media (min-width: @screen-md-min) {\n    float: left;\n    width: percentage((@columns / @grid-columns));\n  }\n}\n.make-md-column-offset(@columns) {\n  @media (min-width: @screen-md-min) {\n    margin-left: percentage((@columns / @grid-columns));\n  }\n}\n.make-md-column-push(@columns) {\n  @media (min-width: @screen-md-min) {\n    left: percentage((@columns / @grid-columns));\n  }\n}\n.make-md-column-pull(@columns) {\n  @media (min-width: @screen-md-min) {\n    right: percentage((@columns / @grid-columns));\n  }\n}\n\n// Generate the large columns\n.make-lg-column(@columns; @gutter: @grid-gutter-width) {\n  position: relative;\n  min-height: 1px;\n  padding-left:  (@gutter / 2);\n  padding-right: (@gutter / 2);\n\n  @media (min-width: @screen-lg-min) {\n    float: left;\n    width: percentage((@columns / @grid-columns));\n  }\n}\n.make-lg-column-offset(@columns) {\n  @media (min-width: @screen-lg-min) {\n    margin-left: percentage((@columns / @grid-columns));\n  }\n}\n.make-lg-column-push(@columns) {\n  @media (min-width: @screen-lg-min) {\n    left: percentage((@columns / @grid-columns));\n  }\n}\n.make-lg-column-pull(@columns) {\n  @media (min-width: @screen-lg-min) {\n    right: percentage((@columns / @grid-columns));\n  }\n}\n","// Framework grid generation\n//\n// Used only by Bootstrap to generate the correct number of grid classes given\n// any value of `@grid-columns`.\n\n.make-grid-columns() {\n  // Common styles for all sizes of grid columns, widths 1-12\n  .col(@index) { // initial\n    @item: ~\".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}\";\n    .col((@index + 1), @item);\n  }\n  .col(@index, @list) when (@index =< @grid-columns) { // general; \"=<\" isn't a typo\n    @item: ~\".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}\";\n    .col((@index + 1), ~\"@{list}, @{item}\");\n  }\n  .col(@index, @list) when (@index > @grid-columns) { // terminal\n    @{list} {\n      position: relative;\n      // Prevent columns from collapsing when empty\n      min-height: 1px;\n      // Inner gutter via padding\n      padding-left:  ceil((@grid-gutter-width / 2));\n      padding-right: floor((@grid-gutter-width / 2));\n    }\n  }\n  .col(1); // kickstart it\n}\n\n.float-grid-columns(@class) {\n  .col(@index) { // initial\n    @item: ~\".col-@{class}-@{index}\";\n    .col((@index + 1), @item);\n  }\n  .col(@index, @list) when (@index =< @grid-columns) { // general\n    @item: ~\".col-@{class}-@{index}\";\n    .col((@index + 1), ~\"@{list}, @{item}\");\n  }\n  .col(@index, @list) when (@index > @grid-columns) { // terminal\n    @{list} {\n      float: left;\n    }\n  }\n  .col(1); // kickstart it\n}\n\n.calc-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) {\n  .col-@{class}-@{index} {\n    width: percentage((@index / @grid-columns));\n  }\n}\n.calc-grid-column(@index, @class, @type) when (@type = push) and (@index > 0) {\n  .col-@{class}-push-@{index} {\n    left: percentage((@index / @grid-columns));\n  }\n}\n.calc-grid-column(@index, @class, @type) when (@type = push) and (@index = 0) {\n  .col-@{class}-push-0 {\n    left: auto;\n  }\n}\n.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index > 0) {\n  .col-@{class}-pull-@{index} {\n    right: percentage((@index / @grid-columns));\n  }\n}\n.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index = 0) {\n  .col-@{class}-pull-0 {\n    right: auto;\n  }\n}\n.calc-grid-column(@index, @class, @type) when (@type = offset) {\n  .col-@{class}-offset-@{index} {\n    margin-left: percentage((@index / @grid-columns));\n  }\n}\n\n// Basic looping in LESS\n.loop-grid-columns(@index, @class, @type) when (@index >= 0) {\n  .calc-grid-column(@index, @class, @type);\n  // next iteration\n  .loop-grid-columns((@index - 1), @class, @type);\n}\n\n// Create grid for specific class\n.make-grid(@class) {\n  .float-grid-columns(@class);\n  .loop-grid-columns(@grid-columns, @class, width);\n  .loop-grid-columns(@grid-columns, @class, pull);\n  .loop-grid-columns(@grid-columns, @class, push);\n  .loop-grid-columns(@grid-columns, @class, offset);\n}\n","//\n// Tables\n// --------------------------------------------------\n\n\ntable {\n  background-color: @table-bg;\n}\ncaption {\n  padding-top: @table-cell-padding;\n  padding-bottom: @table-cell-padding;\n  color: @text-muted;\n  text-align: left;\n}\nth {\n  text-align: left;\n}\n\n\n// Baseline styles\n\n.table {\n  width: 100%;\n  max-width: 100%;\n  margin-bottom: @line-height-computed;\n  // Cells\n  > thead,\n  > tbody,\n  > tfoot {\n    > tr {\n      > th,\n      > td {\n        padding: @table-cell-padding;\n        line-height: @line-height-base;\n        vertical-align: top;\n        border-top: 1px solid @table-border-color;\n      }\n    }\n  }\n  // Bottom align for column headings\n  > thead > tr > th {\n    vertical-align: bottom;\n    border-bottom: 2px solid @table-border-color;\n  }\n  // Remove top border from thead by default\n  > caption + thead,\n  > colgroup + thead,\n  > thead:first-child {\n    > tr:first-child {\n      > th,\n      > td {\n        border-top: 0;\n      }\n    }\n  }\n  // Account for multiple tbody instances\n  > tbody + tbody {\n    border-top: 2px solid @table-border-color;\n  }\n\n  // Nesting\n  .table {\n    background-color: @body-bg;\n  }\n}\n\n\n// Condensed table w/ half padding\n\n.table-condensed {\n  > thead,\n  > tbody,\n  > tfoot {\n    > tr {\n      > th,\n      > td {\n        padding: @table-condensed-cell-padding;\n      }\n    }\n  }\n}\n\n\n// Bordered version\n//\n// Add borders all around the table and between all the columns.\n\n.table-bordered {\n  border: 1px solid @table-border-color;\n  > thead,\n  > tbody,\n  > tfoot {\n    > tr {\n      > th,\n      > td {\n        border: 1px solid @table-border-color;\n      }\n    }\n  }\n  > thead > tr {\n    > th,\n    > td {\n      border-bottom-width: 2px;\n    }\n  }\n}\n\n\n// Zebra-striping\n//\n// Default zebra-stripe styles (alternating gray and transparent backgrounds)\n\n.table-striped {\n  > tbody > tr:nth-of-type(odd) {\n    background-color: @table-bg-accent;\n  }\n}\n\n\n// Hover effect\n//\n// Placed here since it has to come after the potential zebra striping\n\n.table-hover {\n  > tbody > tr:hover {\n    background-color: @table-bg-hover;\n  }\n}\n\n\n// Table cell sizing\n//\n// Reset default table behavior\n\ntable col[class*=\"col-\"] {\n  position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)\n  float: none;\n  display: table-column;\n}\ntable {\n  td,\n  th {\n    &[class*=\"col-\"] {\n      position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)\n      float: none;\n      display: table-cell;\n    }\n  }\n}\n\n\n// Table backgrounds\n//\n// Exact selectors below required to override `.table-striped` and prevent\n// inheritance to nested tables.\n\n// Generate the contextual variants\n.table-row-variant(active; @table-bg-active);\n.table-row-variant(success; @state-success-bg);\n.table-row-variant(info; @state-info-bg);\n.table-row-variant(warning; @state-warning-bg);\n.table-row-variant(danger; @state-danger-bg);\n\n\n// Responsive tables\n//\n// Wrap your tables in `.table-responsive` and we'll make them mobile friendly\n// by enabling horizontal scrolling. Only applies <768px. Everything above that\n// will display normally.\n\n.table-responsive {\n  overflow-x: auto;\n  min-height: 0.01%; // Workaround for IE9 bug (see https://github.com/twbs/bootstrap/issues/14837)\n\n  @media screen and (max-width: @screen-xs-max) {\n    width: 100%;\n    margin-bottom: (@line-height-computed * 0.75);\n    overflow-y: hidden;\n    -ms-overflow-style: -ms-autohiding-scrollbar;\n    border: 1px solid @table-border-color;\n\n    // Tighten up spacing\n    > .table {\n      margin-bottom: 0;\n\n      // Ensure the content doesn't wrap\n      > thead,\n      > tbody,\n      > tfoot {\n        > tr {\n          > th,\n          > td {\n            white-space: nowrap;\n          }\n        }\n      }\n    }\n\n    // Special overrides for the bordered tables\n    > .table-bordered {\n      border: 0;\n\n      // Nuke the appropriate borders so that the parent can handle them\n      > thead,\n      > tbody,\n      > tfoot {\n        > tr {\n          > th:first-child,\n          > td:first-child {\n            border-left: 0;\n          }\n          > th:last-child,\n          > td:last-child {\n            border-right: 0;\n          }\n        }\n      }\n\n      // Only nuke the last row's bottom-border in `tbody` and `tfoot` since\n      // chances are there will be only one `tr` in a `thead` and that would\n      // remove the border altogether.\n      > tbody,\n      > tfoot {\n        > tr:last-child {\n          > th,\n          > td {\n            border-bottom: 0;\n          }\n        }\n      }\n\n    }\n  }\n}\n","// Tables\n\n.table-row-variant(@state; @background) {\n  // Exact selectors below required to override `.table-striped` and prevent\n  // inheritance to nested tables.\n  .table > thead > tr,\n  .table > tbody > tr,\n  .table > tfoot > tr {\n    > td.@{state},\n    > th.@{state},\n    &.@{state} > td,\n    &.@{state} > th {\n      background-color: @background;\n    }\n  }\n\n  // Hover states for `.table-hover`\n  // Note: this is not available for cells or rows within `thead` or `tfoot`.\n  .table-hover > tbody > tr {\n    > td.@{state}:hover,\n    > th.@{state}:hover,\n    &.@{state}:hover > td,\n    &:hover > .@{state},\n    &.@{state}:hover > th {\n      background-color: darken(@background, 5%);\n    }\n  }\n}\n","//\n// Forms\n// --------------------------------------------------\n\n\n// Normalize non-controls\n//\n// Restyle and baseline non-control form elements.\n\nfieldset {\n  padding: 0;\n  margin: 0;\n  border: 0;\n  // Chrome and Firefox set a `min-width: min-content;` on fieldsets,\n  // so we reset that to ensure it behaves more like a standard block element.\n  // See https://github.com/twbs/bootstrap/issues/12359.\n  min-width: 0;\n}\n\nlegend {\n  display: block;\n  width: 100%;\n  padding: 0;\n  margin-bottom: @line-height-computed;\n  font-size: (@font-size-base * 1.5);\n  line-height: inherit;\n  color: @legend-color;\n  border: 0;\n  border-bottom: 1px solid @legend-border-color;\n}\n\nlabel {\n  display: inline-block;\n  max-width: 100%; // Force IE8 to wrap long content (see https://github.com/twbs/bootstrap/issues/13141)\n  margin-bottom: 5px;\n  font-weight: bold;\n}\n\n\n// Normalize form controls\n//\n// While most of our form styles require extra classes, some basic normalization\n// is required to ensure optimum display with or without those classes to better\n// address browser inconsistencies.\n\n// Override content-box in Normalize (* isn't specific enough)\ninput[type=\"search\"] {\n  .box-sizing(border-box);\n}\n\n// Position radios and checkboxes better\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n  margin: 4px 0 0;\n  margin-top: 1px \\9; // IE8-9\n  line-height: normal;\n}\n\ninput[type=\"file\"] {\n  display: block;\n}\n\n// Make range inputs behave like textual form controls\ninput[type=\"range\"] {\n  display: block;\n  width: 100%;\n}\n\n// Make multiple select elements height not fixed\nselect[multiple],\nselect[size] {\n  height: auto;\n}\n\n// Focus for file, radio, and checkbox\ninput[type=\"file\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"checkbox\"]:focus {\n  .tab-focus();\n}\n\n// Adjust output element\noutput {\n  display: block;\n  padding-top: (@padding-base-vertical + 1);\n  font-size: @font-size-base;\n  line-height: @line-height-base;\n  color: @input-color;\n}\n\n\n// Common form controls\n//\n// Shared size and type resets for form controls. Apply `.form-control` to any\n// of the following form controls:\n//\n// select\n// textarea\n// input[type=\"text\"]\n// input[type=\"password\"]\n// input[type=\"datetime\"]\n// input[type=\"datetime-local\"]\n// input[type=\"date\"]\n// input[type=\"month\"]\n// input[type=\"time\"]\n// input[type=\"week\"]\n// input[type=\"number\"]\n// input[type=\"email\"]\n// input[type=\"url\"]\n// input[type=\"search\"]\n// input[type=\"tel\"]\n// input[type=\"color\"]\n\n.form-control {\n  display: block;\n  width: 100%;\n  height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)\n  padding: @padding-base-vertical @padding-base-horizontal;\n  font-size: @font-size-base;\n  line-height: @line-height-base;\n  color: @input-color;\n  background-color: @input-bg;\n  background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214\n  border: 1px solid @input-border;\n  border-radius: @input-border-radius; // Note: This has no effect on <select>s in some browsers, due to the limited stylability of <select>s in CSS.\n  .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));\n  .transition(~\"border-color ease-in-out .15s, box-shadow ease-in-out .15s\");\n\n  // Customize the `:focus` state to imitate native WebKit styles.\n  .form-control-focus();\n\n  // Placeholder\n  .placeholder();\n\n  // Unstyle the caret on `<select>`s in IE10+.\n  &::-ms-expand {\n    border: 0;\n    background-color: transparent;\n  }\n\n  // Disabled and read-only inputs\n  //\n  // HTML5 says that controls under a fieldset > legend:first-child won't be\n  // disabled if the fieldset is disabled. Due to implementation difficulty, we\n  // don't honor that edge case; we style them as disabled anyway.\n  &[disabled],\n  &[readonly],\n  fieldset[disabled] & {\n    background-color: @input-bg-disabled;\n    opacity: 1; // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655\n  }\n\n  &[disabled],\n  fieldset[disabled] & {\n    cursor: @cursor-disabled;\n  }\n\n  // Reset height for `textarea`s\n  textarea& {\n    height: auto;\n  }\n}\n\n\n// Search inputs in iOS\n//\n// This overrides the extra rounded corners on search inputs in iOS so that our\n// `.form-control` class can properly style them. Note that this cannot simply\n// be added to `.form-control` as it's not specific enough. For details, see\n// https://github.com/twbs/bootstrap/issues/11586.\n\ninput[type=\"search\"] {\n  -webkit-appearance: none;\n}\n\n\n// Special styles for iOS temporal inputs\n//\n// In Mobile Safari, setting `display: block` on temporal inputs causes the\n// text within the input to become vertically misaligned. As a workaround, we\n// set a pixel line-height that matches the given height of the input, but only\n// for Safari. See https://bugs.webkit.org/show_bug.cgi?id=139848\n//\n// Note that as of 8.3, iOS doesn't support `datetime` or `week`.\n\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n  input[type=\"date\"],\n  input[type=\"time\"],\n  input[type=\"datetime-local\"],\n  input[type=\"month\"] {\n    &.form-control {\n      line-height: @input-height-base;\n    }\n\n    &.input-sm,\n    .input-group-sm & {\n      line-height: @input-height-small;\n    }\n\n    &.input-lg,\n    .input-group-lg & {\n      line-height: @input-height-large;\n    }\n  }\n}\n\n\n// Form groups\n//\n// Designed to help with the organization and spacing of vertical forms. For\n// horizontal forms, use the predefined grid classes.\n\n.form-group {\n  margin-bottom: @form-group-margin-bottom;\n}\n\n\n// Checkboxes and radios\n//\n// Indent the labels to position radios/checkboxes as hanging controls.\n\n.radio,\n.checkbox {\n  position: relative;\n  display: block;\n  margin-top: 10px;\n  margin-bottom: 10px;\n\n  label {\n    min-height: @line-height-computed; // Ensure the input doesn't jump when there is no text\n    padding-left: 20px;\n    margin-bottom: 0;\n    font-weight: normal;\n    cursor: pointer;\n  }\n}\n.radio input[type=\"radio\"],\n.radio-inline input[type=\"radio\"],\n.checkbox input[type=\"checkbox\"],\n.checkbox-inline input[type=\"checkbox\"] {\n  position: absolute;\n  margin-left: -20px;\n  margin-top: 4px \\9;\n}\n\n.radio + .radio,\n.checkbox + .checkbox {\n  margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing\n}\n\n// Radios and checkboxes on same line\n.radio-inline,\n.checkbox-inline {\n  position: relative;\n  display: inline-block;\n  padding-left: 20px;\n  margin-bottom: 0;\n  vertical-align: middle;\n  font-weight: normal;\n  cursor: pointer;\n}\n.radio-inline + .radio-inline,\n.checkbox-inline + .checkbox-inline {\n  margin-top: 0;\n  margin-left: 10px; // space out consecutive inline controls\n}\n\n// Apply same disabled cursor tweak as for inputs\n// Some special care is needed because <label>s don't inherit their parent's `cursor`.\n//\n// Note: Neither radios nor checkboxes can be readonly.\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n  &[disabled],\n  &.disabled,\n  fieldset[disabled] & {\n    cursor: @cursor-disabled;\n  }\n}\n// These classes are used directly on <label>s\n.radio-inline,\n.checkbox-inline {\n  &.disabled,\n  fieldset[disabled] & {\n    cursor: @cursor-disabled;\n  }\n}\n// These classes are used on elements with <label> descendants\n.radio,\n.checkbox {\n  &.disabled,\n  fieldset[disabled] & {\n    label {\n      cursor: @cursor-disabled;\n    }\n  }\n}\n\n\n// Static form control text\n//\n// Apply class to a `p` element to make any string of text align with labels in\n// a horizontal form layout.\n\n.form-control-static {\n  // Size it appropriately next to real form controls\n  padding-top: (@padding-base-vertical + 1);\n  padding-bottom: (@padding-base-vertical + 1);\n  // Remove default margin from `p`\n  margin-bottom: 0;\n  min-height: (@line-height-computed + @font-size-base);\n\n  &.input-lg,\n  &.input-sm {\n    padding-left: 0;\n    padding-right: 0;\n  }\n}\n\n\n// Form control sizing\n//\n// Build on `.form-control` with modifier classes to decrease or increase the\n// height and font-size of form controls.\n//\n// The `.form-group-* form-control` variations are sadly duplicated to avoid the\n// issue documented in https://github.com/twbs/bootstrap/issues/15074.\n\n.input-sm {\n  .input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @input-border-radius-small);\n}\n.form-group-sm {\n  .form-control {\n    height: @input-height-small;\n    padding: @padding-small-vertical @padding-small-horizontal;\n    font-size: @font-size-small;\n    line-height: @line-height-small;\n    border-radius: @input-border-radius-small;\n  }\n  select.form-control {\n    height: @input-height-small;\n    line-height: @input-height-small;\n  }\n  textarea.form-control,\n  select[multiple].form-control {\n    height: auto;\n  }\n  .form-control-static {\n    height: @input-height-small;\n    min-height: (@line-height-computed + @font-size-small);\n    padding: (@padding-small-vertical + 1) @padding-small-horizontal;\n    font-size: @font-size-small;\n    line-height: @line-height-small;\n  }\n}\n\n.input-lg {\n  .input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @input-border-radius-large);\n}\n.form-group-lg {\n  .form-control {\n    height: @input-height-large;\n    padding: @padding-large-vertical @padding-large-horizontal;\n    font-size: @font-size-large;\n    line-height: @line-height-large;\n    border-radius: @input-border-radius-large;\n  }\n  select.form-control {\n    height: @input-height-large;\n    line-height: @input-height-large;\n  }\n  textarea.form-control,\n  select[multiple].form-control {\n    height: auto;\n  }\n  .form-control-static {\n    height: @input-height-large;\n    min-height: (@line-height-computed + @font-size-large);\n    padding: (@padding-large-vertical + 1) @padding-large-horizontal;\n    font-size: @font-size-large;\n    line-height: @line-height-large;\n  }\n}\n\n\n// Form control feedback states\n//\n// Apply contextual and semantic states to individual form controls.\n\n.has-feedback {\n  // Enable absolute positioning\n  position: relative;\n\n  // Ensure icons don't overlap text\n  .form-control {\n    padding-right: (@input-height-base * 1.25);\n  }\n}\n// Feedback icon (requires .glyphicon classes)\n.form-control-feedback {\n  position: absolute;\n  top: 0;\n  right: 0;\n  z-index: 2; // Ensure icon is above input groups\n  display: block;\n  width: @input-height-base;\n  height: @input-height-base;\n  line-height: @input-height-base;\n  text-align: center;\n  pointer-events: none;\n}\n.input-lg + .form-control-feedback,\n.input-group-lg + .form-control-feedback,\n.form-group-lg .form-control + .form-control-feedback {\n  width: @input-height-large;\n  height: @input-height-large;\n  line-height: @input-height-large;\n}\n.input-sm + .form-control-feedback,\n.input-group-sm + .form-control-feedback,\n.form-group-sm .form-control + .form-control-feedback {\n  width: @input-height-small;\n  height: @input-height-small;\n  line-height: @input-height-small;\n}\n\n// Feedback states\n.has-success {\n  .form-control-validation(@state-success-text; @state-success-text; @state-success-bg);\n}\n.has-warning {\n  .form-control-validation(@state-warning-text; @state-warning-text; @state-warning-bg);\n}\n.has-error {\n  .form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);\n}\n\n// Reposition feedback icon if input has visible label above\n.has-feedback label {\n\n  & ~ .form-control-feedback {\n    top: (@line-height-computed + 5); // Height of the `label` and its margin\n  }\n  &.sr-only ~ .form-control-feedback {\n    top: 0;\n  }\n}\n\n\n// Help text\n//\n// Apply to any element you wish to create light text for placement immediately\n// below a form control. Use for general help, formatting, or instructional text.\n\n.help-block {\n  display: block; // account for any element using help-block\n  margin-top: 5px;\n  margin-bottom: 10px;\n  color: lighten(@text-color, 25%); // lighten the text some for contrast\n}\n\n\n// Inline forms\n//\n// Make forms appear inline(-block) by adding the `.form-inline` class. Inline\n// forms begin stacked on extra small (mobile) devices and then go inline when\n// viewports reach <768px.\n//\n// Requires wrapping inputs and labels with `.form-group` for proper display of\n// default HTML form controls and our custom form controls (e.g., input groups).\n//\n// Heads up! This is mixin-ed into `.navbar-form` in navbars.less.\n\n.form-inline {\n\n  // Kick in the inline\n  @media (min-width: @screen-sm-min) {\n    // Inline-block all the things for \"inline\"\n    .form-group {\n      display: inline-block;\n      margin-bottom: 0;\n      vertical-align: middle;\n    }\n\n    // In navbar-form, allow folks to *not* use `.form-group`\n    .form-control {\n      display: inline-block;\n      width: auto; // Prevent labels from stacking above inputs in `.form-group`\n      vertical-align: middle;\n    }\n\n    // Make static controls behave like regular ones\n    .form-control-static {\n      display: inline-block;\n    }\n\n    .input-group {\n      display: inline-table;\n      vertical-align: middle;\n\n      .input-group-addon,\n      .input-group-btn,\n      .form-control {\n        width: auto;\n      }\n    }\n\n    // Input groups need that 100% width though\n    .input-group > .form-control {\n      width: 100%;\n    }\n\n    .control-label {\n      margin-bottom: 0;\n      vertical-align: middle;\n    }\n\n    // Remove default margin on radios/checkboxes that were used for stacking, and\n    // then undo the floating of radios and checkboxes to match.\n    .radio,\n    .checkbox {\n      display: inline-block;\n      margin-top: 0;\n      margin-bottom: 0;\n      vertical-align: middle;\n\n      label {\n        padding-left: 0;\n      }\n    }\n    .radio input[type=\"radio\"],\n    .checkbox input[type=\"checkbox\"] {\n      position: relative;\n      margin-left: 0;\n    }\n\n    // Re-override the feedback icon.\n    .has-feedback .form-control-feedback {\n      top: 0;\n    }\n  }\n}\n\n\n// Horizontal forms\n//\n// Horizontal forms are built on grid classes and allow you to create forms with\n// labels on the left and inputs on the right.\n\n.form-horizontal {\n\n  // Consistent vertical alignment of radios and checkboxes\n  //\n  // Labels also get some reset styles, but that is scoped to a media query below.\n  .radio,\n  .checkbox,\n  .radio-inline,\n  .checkbox-inline {\n    margin-top: 0;\n    margin-bottom: 0;\n    padding-top: (@padding-base-vertical + 1); // Default padding plus a border\n  }\n  // Account for padding we're adding to ensure the alignment and of help text\n  // and other content below items\n  .radio,\n  .checkbox {\n    min-height: (@line-height-computed + (@padding-base-vertical + 1));\n  }\n\n  // Make form groups behave like rows\n  .form-group {\n    .make-row();\n  }\n\n  // Reset spacing and right align labels, but scope to media queries so that\n  // labels on narrow viewports stack the same as a default form example.\n  @media (min-width: @screen-sm-min) {\n    .control-label {\n      text-align: right;\n      margin-bottom: 0;\n      padding-top: (@padding-base-vertical + 1); // Default padding plus a border\n    }\n  }\n\n  // Validation states\n  //\n  // Reposition the icon because it's now within a grid column and columns have\n  // `position: relative;` on them. Also accounts for the grid gutter padding.\n  .has-feedback .form-control-feedback {\n    right: floor((@grid-gutter-width / 2));\n  }\n\n  // Form group sizes\n  //\n  // Quick utility class for applying `.input-lg` and `.input-sm` styles to the\n  // inputs and labels within a `.form-group`.\n  .form-group-lg {\n    @media (min-width: @screen-sm-min) {\n      .control-label {\n        padding-top: (@padding-large-vertical + 1);\n        font-size: @font-size-large;\n      }\n    }\n  }\n  .form-group-sm {\n    @media (min-width: @screen-sm-min) {\n      .control-label {\n        padding-top: (@padding-small-vertical + 1);\n        font-size: @font-size-small;\n      }\n    }\n  }\n}\n","// Form validation states\n//\n// Used in forms.less to generate the form validation CSS for warnings, errors,\n// and successes.\n\n.form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) {\n  // Color the label and help text\n  .help-block,\n  .control-label,\n  .radio,\n  .checkbox,\n  .radio-inline,\n  .checkbox-inline,\n  &.radio label,\n  &.checkbox label,\n  &.radio-inline label,\n  &.checkbox-inline label  {\n    color: @text-color;\n  }\n  // Set the border and box shadow on specific inputs to match\n  .form-control {\n    border-color: @border-color;\n    .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work\n    &:focus {\n      border-color: darken(@border-color, 10%);\n      @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);\n      .box-shadow(@shadow);\n    }\n  }\n  // Set validation states also for addons\n  .input-group-addon {\n    color: @text-color;\n    border-color: @border-color;\n    background-color: @background-color;\n  }\n  // Optional feedback icon\n  .form-control-feedback {\n    color: @text-color;\n  }\n}\n\n\n// Form control focus state\n//\n// Generate a customized focus state and for any input with the specified color,\n// which defaults to the `@input-border-focus` variable.\n//\n// We highly encourage you to not customize the default value, but instead use\n// this to tweak colors on an as-needed basis. This aesthetic change is based on\n// WebKit's default styles, but applicable to a wider range of browsers. Its\n// usability and accessibility should be taken into account with any change.\n//\n// Example usage: change the default blue border and shadow to white for better\n// contrast against a dark gray background.\n.form-control-focus(@color: @input-border-focus) {\n  @color-rgba: rgba(red(@color), green(@color), blue(@color), .6);\n  &:focus {\n    border-color: @color;\n    outline: 0;\n    .box-shadow(~\"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}\");\n  }\n}\n\n// Form control sizing\n//\n// Relative text size, padding, and border-radii changes for form controls. For\n// horizontal sizing, wrap controls in the predefined grid classes. `<select>`\n// element gets special love because it's special, and that's a fact!\n.input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {\n  height: @input-height;\n  padding: @padding-vertical @padding-horizontal;\n  font-size: @font-size;\n  line-height: @line-height;\n  border-radius: @border-radius;\n\n  select& {\n    height: @input-height;\n    line-height: @input-height;\n  }\n\n  textarea&,\n  select[multiple]& {\n    height: auto;\n  }\n}\n","//\n// Buttons\n// --------------------------------------------------\n\n\n// Base styles\n// --------------------------------------------------\n\n.btn {\n  display: inline-block;\n  margin-bottom: 0; // For input.btn\n  font-weight: @btn-font-weight;\n  text-align: center;\n  vertical-align: middle;\n  touch-action: manipulation;\n  cursor: pointer;\n  background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214\n  border: 1px solid transparent;\n  white-space: nowrap;\n  .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @btn-border-radius-base);\n  .user-select(none);\n\n  &,\n  &:active,\n  &.active {\n    &:focus,\n    &.focus {\n      .tab-focus();\n    }\n  }\n\n  &:hover,\n  &:focus,\n  &.focus {\n    color: @btn-default-color;\n    text-decoration: none;\n  }\n\n  &:active,\n  &.active {\n    outline: 0;\n    background-image: none;\n    .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n  }\n\n  &.disabled,\n  &[disabled],\n  fieldset[disabled] & {\n    cursor: @cursor-disabled;\n    .opacity(.65);\n    .box-shadow(none);\n  }\n\n  a& {\n    &.disabled,\n    fieldset[disabled] & {\n      pointer-events: none; // Future-proof disabling of clicks on `<a>` elements\n    }\n  }\n}\n\n\n// Alternate buttons\n// --------------------------------------------------\n\n.btn-default {\n  .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border);\n}\n.btn-primary {\n  .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);\n}\n// Success appears as green\n.btn-success {\n  .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border);\n}\n// Info appears as blue-green\n.btn-info {\n  .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);\n}\n// Warning appears as orange\n.btn-warning {\n  .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border);\n}\n// Danger and error appear as red\n.btn-danger {\n  .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border);\n}\n\n\n// Link buttons\n// -------------------------\n\n// Make a button look and behave like a link\n.btn-link {\n  color: @link-color;\n  font-weight: normal;\n  border-radius: 0;\n\n  &,\n  &:active,\n  &.active,\n  &[disabled],\n  fieldset[disabled] & {\n    background-color: transparent;\n    .box-shadow(none);\n  }\n  &,\n  &:hover,\n  &:focus,\n  &:active {\n    border-color: transparent;\n  }\n  &:hover,\n  &:focus {\n    color: @link-hover-color;\n    text-decoration: @link-hover-decoration;\n    background-color: transparent;\n  }\n  &[disabled],\n  fieldset[disabled] & {\n    &:hover,\n    &:focus {\n      color: @btn-link-disabled-color;\n      text-decoration: none;\n    }\n  }\n}\n\n\n// Button Sizes\n// --------------------------------------------------\n\n.btn-lg {\n  // line-height: ensure even-numbered height of button next to large input\n  .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @btn-border-radius-large);\n}\n.btn-sm {\n  // line-height: ensure proper height of button next to small input\n  .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small);\n}\n.btn-xs {\n  .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small);\n}\n\n\n// Block button\n// --------------------------------------------------\n\n.btn-block {\n  display: block;\n  width: 100%;\n}\n\n// Vertically space out multiple block buttons\n.btn-block + .btn-block {\n  margin-top: 5px;\n}\n\n// Specificity overrides\ninput[type=\"submit\"],\ninput[type=\"reset\"],\ninput[type=\"button\"] {\n  &.btn-block {\n    width: 100%;\n  }\n}\n","// Button variants\n//\n// Easily pump out default styles, as well as :hover, :focus, :active,\n// and disabled options for all buttons\n\n.button-variant(@color; @background; @border) {\n  color: @color;\n  background-color: @background;\n  border-color: @border;\n\n  &:focus,\n  &.focus {\n    color: @color;\n    background-color: darken(@background, 10%);\n        border-color: darken(@border, 25%);\n  }\n  &:hover {\n    color: @color;\n    background-color: darken(@background, 10%);\n        border-color: darken(@border, 12%);\n  }\n  &:active,\n  &.active,\n  .open > .dropdown-toggle& {\n    color: @color;\n    background-color: darken(@background, 10%);\n        border-color: darken(@border, 12%);\n\n    &:hover,\n    &:focus,\n    &.focus {\n      color: @color;\n      background-color: darken(@background, 17%);\n          border-color: darken(@border, 25%);\n    }\n  }\n  &:active,\n  &.active,\n  .open > .dropdown-toggle& {\n    background-image: none;\n  }\n  &.disabled,\n  &[disabled],\n  fieldset[disabled] & {\n    &:hover,\n    &:focus,\n    &.focus {\n      background-color: @background;\n          border-color: @border;\n    }\n  }\n\n  .badge {\n    color: @background;\n    background-color: @color;\n  }\n}\n\n// Button sizes\n.button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {\n  padding: @padding-vertical @padding-horizontal;\n  font-size: @font-size;\n  line-height: @line-height;\n  border-radius: @border-radius;\n}\n","// Opacity\n\n.opacity(@opacity) {\n  opacity: @opacity;\n  // IE8 filter\n  @opacity-ie: (@opacity * 100);\n  filter: ~\"alpha(opacity=@{opacity-ie})\";\n}\n","//\n// Component animations\n// --------------------------------------------------\n\n// Heads up!\n//\n// We don't use the `.opacity()` mixin here since it causes a bug with text\n// fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552.\n\n.fade {\n  opacity: 0;\n  .transition(opacity .15s linear);\n  &.in {\n    opacity: 1;\n  }\n}\n\n.collapse {\n  display: none;\n\n  &.in      { display: block; }\n  tr&.in    { display: table-row; }\n  tbody&.in { display: table-row-group; }\n}\n\n.collapsing {\n  position: relative;\n  height: 0;\n  overflow: hidden;\n  .transition-property(~\"height, visibility\");\n  .transition-duration(.35s);\n  .transition-timing-function(ease);\n}\n","//\n// Dropdown menus\n// --------------------------------------------------\n\n\n// Dropdown arrow/caret\n.caret {\n  display: inline-block;\n  width: 0;\n  height: 0;\n  margin-left: 2px;\n  vertical-align: middle;\n  border-top:   @caret-width-base dashed;\n  border-top:   @caret-width-base solid ~\"\\9\"; // IE8\n  border-right: @caret-width-base solid transparent;\n  border-left:  @caret-width-base solid transparent;\n}\n\n// The dropdown wrapper (div)\n.dropup,\n.dropdown {\n  position: relative;\n}\n\n// Prevent the focus on the dropdown toggle when closing dropdowns\n.dropdown-toggle:focus {\n  outline: 0;\n}\n\n// The dropdown menu (ul)\n.dropdown-menu {\n  position: absolute;\n  top: 100%;\n  left: 0;\n  z-index: @zindex-dropdown;\n  display: none; // none by default, but block on \"open\" of the menu\n  float: left;\n  min-width: 160px;\n  padding: 5px 0;\n  margin: 2px 0 0; // override default ul\n  list-style: none;\n  font-size: @font-size-base;\n  text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)\n  background-color: @dropdown-bg;\n  border: 1px solid @dropdown-fallback-border; // IE8 fallback\n  border: 1px solid @dropdown-border;\n  border-radius: @border-radius-base;\n  .box-shadow(0 6px 12px rgba(0,0,0,.175));\n  background-clip: padding-box;\n\n  // Aligns the dropdown menu to right\n  //\n  // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`\n  &.pull-right {\n    right: 0;\n    left: auto;\n  }\n\n  // Dividers (basically an hr) within the dropdown\n  .divider {\n    .nav-divider(@dropdown-divider-bg);\n  }\n\n  // Links within the dropdown menu\n  > li > a {\n    display: block;\n    padding: 3px 20px;\n    clear: both;\n    font-weight: normal;\n    line-height: @line-height-base;\n    color: @dropdown-link-color;\n    white-space: nowrap; // prevent links from randomly breaking onto new lines\n  }\n}\n\n// Hover/Focus state\n.dropdown-menu > li > a {\n  &:hover,\n  &:focus {\n    text-decoration: none;\n    color: @dropdown-link-hover-color;\n    background-color: @dropdown-link-hover-bg;\n  }\n}\n\n// Active state\n.dropdown-menu > .active > a {\n  &,\n  &:hover,\n  &:focus {\n    color: @dropdown-link-active-color;\n    text-decoration: none;\n    outline: 0;\n    background-color: @dropdown-link-active-bg;\n  }\n}\n\n// Disabled state\n//\n// Gray out text and ensure the hover/focus state remains gray\n\n.dropdown-menu > .disabled > a {\n  &,\n  &:hover,\n  &:focus {\n    color: @dropdown-link-disabled-color;\n  }\n\n  // Nuke hover/focus effects\n  &:hover,\n  &:focus {\n    text-decoration: none;\n    background-color: transparent;\n    background-image: none; // Remove CSS gradient\n    .reset-filter();\n    cursor: @cursor-disabled;\n  }\n}\n\n// Open state for the dropdown\n.open {\n  // Show the menu\n  > .dropdown-menu {\n    display: block;\n  }\n\n  // Remove the outline when :focus is triggered\n  > a {\n    outline: 0;\n  }\n}\n\n// Menu positioning\n//\n// Add extra class to `.dropdown-menu` to flip the alignment of the dropdown\n// menu with the parent.\n.dropdown-menu-right {\n  left: auto; // Reset the default from `.dropdown-menu`\n  right: 0;\n}\n// With v3, we enabled auto-flipping if you have a dropdown within a right\n// aligned nav component. To enable the undoing of that, we provide an override\n// to restore the default dropdown menu alignment.\n//\n// This is only for left-aligning a dropdown menu within a `.navbar-right` or\n// `.pull-right` nav component.\n.dropdown-menu-left {\n  left: 0;\n  right: auto;\n}\n\n// Dropdown section headers\n.dropdown-header {\n  display: block;\n  padding: 3px 20px;\n  font-size: @font-size-small;\n  line-height: @line-height-base;\n  color: @dropdown-header-color;\n  white-space: nowrap; // as with > li > a\n}\n\n// Backdrop to catch body clicks on mobile, etc.\n.dropdown-backdrop {\n  position: fixed;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  top: 0;\n  z-index: (@zindex-dropdown - 10);\n}\n\n// Right aligned dropdowns\n.pull-right > .dropdown-menu {\n  right: 0;\n  left: auto;\n}\n\n// Allow for dropdowns to go bottom up (aka, dropup-menu)\n//\n// Just add .dropup after the standard .dropdown class and you're set, bro.\n// TODO: abstract this so that the navbar fixed styles are not placed here?\n\n.dropup,\n.navbar-fixed-bottom .dropdown {\n  // Reverse the caret\n  .caret {\n    border-top: 0;\n    border-bottom: @caret-width-base dashed;\n    border-bottom: @caret-width-base solid ~\"\\9\"; // IE8\n    content: \"\";\n  }\n  // Different positioning for bottom up menu\n  .dropdown-menu {\n    top: auto;\n    bottom: 100%;\n    margin-bottom: 2px;\n  }\n}\n\n\n// Component alignment\n//\n// Reiterate per navbar.less and the modified component alignment there.\n\n@media (min-width: @grid-float-breakpoint) {\n  .navbar-right {\n    .dropdown-menu {\n      .dropdown-menu-right();\n    }\n    // Necessary for overrides of the default right aligned menu.\n    // Will remove come v4 in all likelihood.\n    .dropdown-menu-left {\n      .dropdown-menu-left();\n    }\n  }\n}\n","// Horizontal dividers\n//\n// Dividers (basically an hr) within dropdowns and nav lists\n\n.nav-divider(@color: #e5e5e5) {\n  height: 1px;\n  margin: ((@line-height-computed / 2) - 1) 0;\n  overflow: hidden;\n  background-color: @color;\n}\n","// Reset filters for IE\n//\n// When you need to remove a gradient background, do not forget to use this to reset\n// the IE filter for IE9 and below.\n\n.reset-filter() {\n  filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(enabled = false)\"));\n}\n","//\n// Button groups\n// --------------------------------------------------\n\n// Make the div behave like a button\n.btn-group,\n.btn-group-vertical {\n  position: relative;\n  display: inline-block;\n  vertical-align: middle; // match .btn alignment given font-size hack above\n  > .btn {\n    position: relative;\n    float: left;\n    // Bring the \"active\" button to the front\n    &:hover,\n    &:focus,\n    &:active,\n    &.active {\n      z-index: 2;\n    }\n  }\n}\n\n// Prevent double borders when buttons are next to each other\n.btn-group {\n  .btn + .btn,\n  .btn + .btn-group,\n  .btn-group + .btn,\n  .btn-group + .btn-group {\n    margin-left: -1px;\n  }\n}\n\n// Optional: Group multiple button groups together for a toolbar\n.btn-toolbar {\n  margin-left: -5px; // Offset the first child's margin\n  &:extend(.clearfix all);\n\n  .btn,\n  .btn-group,\n  .input-group {\n    float: left;\n  }\n  > .btn,\n  > .btn-group,\n  > .input-group {\n    margin-left: 5px;\n  }\n}\n\n.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {\n  border-radius: 0;\n}\n\n// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match\n.btn-group > .btn:first-child {\n  margin-left: 0;\n  &:not(:last-child):not(.dropdown-toggle) {\n    .border-right-radius(0);\n  }\n}\n// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it\n.btn-group > .btn:last-child:not(:first-child),\n.btn-group > .dropdown-toggle:not(:first-child) {\n  .border-left-radius(0);\n}\n\n// Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group)\n.btn-group > .btn-group {\n  float: left;\n}\n.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {\n  border-radius: 0;\n}\n.btn-group > .btn-group:first-child:not(:last-child) {\n  > .btn:last-child,\n  > .dropdown-toggle {\n    .border-right-radius(0);\n  }\n}\n.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {\n  .border-left-radius(0);\n}\n\n// On active and open, don't show outline\n.btn-group .dropdown-toggle:active,\n.btn-group.open .dropdown-toggle {\n  outline: 0;\n}\n\n\n// Sizing\n//\n// Remix the default button sizing classes into new ones for easier manipulation.\n\n.btn-group-xs > .btn { &:extend(.btn-xs); }\n.btn-group-sm > .btn { &:extend(.btn-sm); }\n.btn-group-lg > .btn { &:extend(.btn-lg); }\n\n\n// Split button dropdowns\n// ----------------------\n\n// Give the line between buttons some depth\n.btn-group > .btn + .dropdown-toggle {\n  padding-left: 8px;\n  padding-right: 8px;\n}\n.btn-group > .btn-lg + .dropdown-toggle {\n  padding-left: 12px;\n  padding-right: 12px;\n}\n\n// The clickable button for toggling the menu\n// Remove the gradient and set the same inset shadow as the :active state\n.btn-group.open .dropdown-toggle {\n  .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n\n  // Show no shadow for `.btn-link` since it has no other button styles.\n  &.btn-link {\n    .box-shadow(none);\n  }\n}\n\n\n// Reposition the caret\n.btn .caret {\n  margin-left: 0;\n}\n// Carets in other button sizes\n.btn-lg .caret {\n  border-width: @caret-width-large @caret-width-large 0;\n  border-bottom-width: 0;\n}\n// Upside down carets for .dropup\n.dropup .btn-lg .caret {\n  border-width: 0 @caret-width-large @caret-width-large;\n}\n\n\n// Vertical button groups\n// ----------------------\n\n.btn-group-vertical {\n  > .btn,\n  > .btn-group,\n  > .btn-group > .btn {\n    display: block;\n    float: none;\n    width: 100%;\n    max-width: 100%;\n  }\n\n  // Clear floats so dropdown menus can be properly placed\n  > .btn-group {\n    &:extend(.clearfix all);\n    > .btn {\n      float: none;\n    }\n  }\n\n  > .btn + .btn,\n  > .btn + .btn-group,\n  > .btn-group + .btn,\n  > .btn-group + .btn-group {\n    margin-top: -1px;\n    margin-left: 0;\n  }\n}\n\n.btn-group-vertical > .btn {\n  &:not(:first-child):not(:last-child) {\n    border-radius: 0;\n  }\n  &:first-child:not(:last-child) {\n    .border-top-radius(@btn-border-radius-base);\n    .border-bottom-radius(0);\n  }\n  &:last-child:not(:first-child) {\n    .border-top-radius(0);\n    .border-bottom-radius(@btn-border-radius-base);\n  }\n}\n.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {\n  border-radius: 0;\n}\n.btn-group-vertical > .btn-group:first-child:not(:last-child) {\n  > .btn:last-child,\n  > .dropdown-toggle {\n    .border-bottom-radius(0);\n  }\n}\n.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {\n  .border-top-radius(0);\n}\n\n\n// Justified button groups\n// ----------------------\n\n.btn-group-justified {\n  display: table;\n  width: 100%;\n  table-layout: fixed;\n  border-collapse: separate;\n  > .btn,\n  > .btn-group {\n    float: none;\n    display: table-cell;\n    width: 1%;\n  }\n  > .btn-group .btn {\n    width: 100%;\n  }\n\n  > .btn-group .dropdown-menu {\n    left: auto;\n  }\n}\n\n\n// Checkbox and radio options\n//\n// In order to support the browser's form validation feedback, powered by the\n// `required` attribute, we have to \"hide\" the inputs via `clip`. We cannot use\n// `display: none;` or `visibility: hidden;` as that also hides the popover.\n// Simply visually hiding the inputs via `opacity` would leave them clickable in\n// certain cases which is prevented by using `clip` and `pointer-events`.\n// This way, we ensure a DOM element is visible to position the popover from.\n//\n// See https://github.com/twbs/bootstrap/pull/12794 and\n// https://github.com/twbs/bootstrap/pull/14559 for more information.\n\n[data-toggle=\"buttons\"] {\n  > .btn,\n  > .btn-group > .btn {\n    input[type=\"radio\"],\n    input[type=\"checkbox\"] {\n      position: absolute;\n      clip: rect(0,0,0,0);\n      pointer-events: none;\n    }\n  }\n}\n","// Single side border-radius\n\n.border-top-radius(@radius) {\n  border-top-right-radius: @radius;\n   border-top-left-radius: @radius;\n}\n.border-right-radius(@radius) {\n  border-bottom-right-radius: @radius;\n     border-top-right-radius: @radius;\n}\n.border-bottom-radius(@radius) {\n  border-bottom-right-radius: @radius;\n   border-bottom-left-radius: @radius;\n}\n.border-left-radius(@radius) {\n  border-bottom-left-radius: @radius;\n     border-top-left-radius: @radius;\n}\n","//\n// Input groups\n// --------------------------------------------------\n\n// Base styles\n// -------------------------\n.input-group {\n  position: relative; // For dropdowns\n  display: table;\n  border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table\n\n  // Undo padding and float of grid classes\n  &[class*=\"col-\"] {\n    float: none;\n    padding-left: 0;\n    padding-right: 0;\n  }\n\n  .form-control {\n    // Ensure that the input is always above the *appended* addon button for\n    // proper border colors.\n    position: relative;\n    z-index: 2;\n\n    // IE9 fubars the placeholder attribute in text inputs and the arrows on\n    // select elements in input groups. To fix it, we float the input. Details:\n    // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855\n    float: left;\n\n    width: 100%;\n    margin-bottom: 0;\n    \n    &:focus {\n      z-index: 3;\n    }\n  }\n}\n\n// Sizing options\n//\n// Remix the default form control sizing classes into new ones for easier\n// manipulation.\n\n.input-group-lg > .form-control,\n.input-group-lg > .input-group-addon,\n.input-group-lg > .input-group-btn > .btn {\n  .input-lg();\n}\n.input-group-sm > .form-control,\n.input-group-sm > .input-group-addon,\n.input-group-sm > .input-group-btn > .btn {\n  .input-sm();\n}\n\n\n// Display as table-cell\n// -------------------------\n.input-group-addon,\n.input-group-btn,\n.input-group .form-control {\n  display: table-cell;\n\n  &:not(:first-child):not(:last-child) {\n    border-radius: 0;\n  }\n}\n// Addon and addon wrapper for buttons\n.input-group-addon,\n.input-group-btn {\n  width: 1%;\n  white-space: nowrap;\n  vertical-align: middle; // Match the inputs\n}\n\n// Text input groups\n// -------------------------\n.input-group-addon {\n  padding: @padding-base-vertical @padding-base-horizontal;\n  font-size: @font-size-base;\n  font-weight: normal;\n  line-height: 1;\n  color: @input-color;\n  text-align: center;\n  background-color: @input-group-addon-bg;\n  border: 1px solid @input-group-addon-border-color;\n  border-radius: @input-border-radius;\n\n  // Sizing\n  &.input-sm {\n    padding: @padding-small-vertical @padding-small-horizontal;\n    font-size: @font-size-small;\n    border-radius: @input-border-radius-small;\n  }\n  &.input-lg {\n    padding: @padding-large-vertical @padding-large-horizontal;\n    font-size: @font-size-large;\n    border-radius: @input-border-radius-large;\n  }\n\n  // Nuke default margins from checkboxes and radios to vertically center within.\n  input[type=\"radio\"],\n  input[type=\"checkbox\"] {\n    margin-top: 0;\n  }\n}\n\n// Reset rounded corners\n.input-group .form-control:first-child,\n.input-group-addon:first-child,\n.input-group-btn:first-child > .btn,\n.input-group-btn:first-child > .btn-group > .btn,\n.input-group-btn:first-child > .dropdown-toggle,\n.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),\n.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {\n  .border-right-radius(0);\n}\n.input-group-addon:first-child {\n  border-right: 0;\n}\n.input-group .form-control:last-child,\n.input-group-addon:last-child,\n.input-group-btn:last-child > .btn,\n.input-group-btn:last-child > .btn-group > .btn,\n.input-group-btn:last-child > .dropdown-toggle,\n.input-group-btn:first-child > .btn:not(:first-child),\n.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {\n  .border-left-radius(0);\n}\n.input-group-addon:last-child {\n  border-left: 0;\n}\n\n// Button input groups\n// -------------------------\n.input-group-btn {\n  position: relative;\n  // Jankily prevent input button groups from wrapping with `white-space` and\n  // `font-size` in combination with `inline-block` on buttons.\n  font-size: 0;\n  white-space: nowrap;\n\n  // Negative margin for spacing, position for bringing hovered/focused/actived\n  // element above the siblings.\n  > .btn {\n    position: relative;\n    + .btn {\n      margin-left: -1px;\n    }\n    // Bring the \"active\" button to the front\n    &:hover,\n    &:focus,\n    &:active {\n      z-index: 2;\n    }\n  }\n\n  // Negative margin to only have a 1px border between the two\n  &:first-child {\n    > .btn,\n    > .btn-group {\n      margin-right: -1px;\n    }\n  }\n  &:last-child {\n    > .btn,\n    > .btn-group {\n      z-index: 2;\n      margin-left: -1px;\n    }\n  }\n}\n","//\n// Navs\n// --------------------------------------------------\n\n\n// Base class\n// --------------------------------------------------\n\n.nav {\n  margin-bottom: 0;\n  padding-left: 0; // Override default ul/ol\n  list-style: none;\n  &:extend(.clearfix all);\n\n  > li {\n    position: relative;\n    display: block;\n\n    > a {\n      position: relative;\n      display: block;\n      padding: @nav-link-padding;\n      &:hover,\n      &:focus {\n        text-decoration: none;\n        background-color: @nav-link-hover-bg;\n      }\n    }\n\n    // Disabled state sets text to gray and nukes hover/tab effects\n    &.disabled > a {\n      color: @nav-disabled-link-color;\n\n      &:hover,\n      &:focus {\n        color: @nav-disabled-link-hover-color;\n        text-decoration: none;\n        background-color: transparent;\n        cursor: @cursor-disabled;\n      }\n    }\n  }\n\n  // Open dropdowns\n  .open > a {\n    &,\n    &:hover,\n    &:focus {\n      background-color: @nav-link-hover-bg;\n      border-color: @link-color;\n    }\n  }\n\n  // Nav dividers (deprecated with v3.0.1)\n  //\n  // This should have been removed in v3 with the dropping of `.nav-list`, but\n  // we missed it. We don't currently support this anywhere, but in the interest\n  // of maintaining backward compatibility in case you use it, it's deprecated.\n  .nav-divider {\n    .nav-divider();\n  }\n\n  // Prevent IE8 from misplacing imgs\n  //\n  // See https://github.com/h5bp/html5-boilerplate/issues/984#issuecomment-3985989\n  > li > a > img {\n    max-width: none;\n  }\n}\n\n\n// Tabs\n// -------------------------\n\n// Give the tabs something to sit on\n.nav-tabs {\n  border-bottom: 1px solid @nav-tabs-border-color;\n  > li {\n    float: left;\n    // Make the list-items overlay the bottom border\n    margin-bottom: -1px;\n\n    // Actual tabs (as links)\n    > a {\n      margin-right: 2px;\n      line-height: @line-height-base;\n      border: 1px solid transparent;\n      border-radius: @border-radius-base @border-radius-base 0 0;\n      &:hover {\n        border-color: @nav-tabs-link-hover-border-color @nav-tabs-link-hover-border-color @nav-tabs-border-color;\n      }\n    }\n\n    // Active state, and its :hover to override normal :hover\n    &.active > a {\n      &,\n      &:hover,\n      &:focus {\n        color: @nav-tabs-active-link-hover-color;\n        background-color: @nav-tabs-active-link-hover-bg;\n        border: 1px solid @nav-tabs-active-link-hover-border-color;\n        border-bottom-color: transparent;\n        cursor: default;\n      }\n    }\n  }\n  // pulling this in mainly for less shorthand\n  &.nav-justified {\n    .nav-justified();\n    .nav-tabs-justified();\n  }\n}\n\n\n// Pills\n// -------------------------\n.nav-pills {\n  > li {\n    float: left;\n\n    // Links rendered as pills\n    > a {\n      border-radius: @nav-pills-border-radius;\n    }\n    + li {\n      margin-left: 2px;\n    }\n\n    // Active state\n    &.active > a {\n      &,\n      &:hover,\n      &:focus {\n        color: @nav-pills-active-link-hover-color;\n        background-color: @nav-pills-active-link-hover-bg;\n      }\n    }\n  }\n}\n\n\n// Stacked pills\n.nav-stacked {\n  > li {\n    float: none;\n    + li {\n      margin-top: 2px;\n      margin-left: 0; // no need for this gap between nav items\n    }\n  }\n}\n\n\n// Nav variations\n// --------------------------------------------------\n\n// Justified nav links\n// -------------------------\n\n.nav-justified {\n  width: 100%;\n\n  > li {\n    float: none;\n    > a {\n      text-align: center;\n      margin-bottom: 5px;\n    }\n  }\n\n  > .dropdown .dropdown-menu {\n    top: auto;\n    left: auto;\n  }\n\n  @media (min-width: @screen-sm-min) {\n    > li {\n      display: table-cell;\n      width: 1%;\n      > a {\n        margin-bottom: 0;\n      }\n    }\n  }\n}\n\n// Move borders to anchors instead of bottom of list\n//\n// Mixin for adding on top the shared `.nav-justified` styles for our tabs\n.nav-tabs-justified {\n  border-bottom: 0;\n\n  > li > a {\n    // Override margin from .nav-tabs\n    margin-right: 0;\n    border-radius: @border-radius-base;\n  }\n\n  > .active > a,\n  > .active > a:hover,\n  > .active > a:focus {\n    border: 1px solid @nav-tabs-justified-link-border-color;\n  }\n\n  @media (min-width: @screen-sm-min) {\n    > li > a {\n      border-bottom: 1px solid @nav-tabs-justified-link-border-color;\n      border-radius: @border-radius-base @border-radius-base 0 0;\n    }\n    > .active > a,\n    > .active > a:hover,\n    > .active > a:focus {\n      border-bottom-color: @nav-tabs-justified-active-link-border-color;\n    }\n  }\n}\n\n\n// Tabbable tabs\n// -------------------------\n\n// Hide tabbable panes to start, show them when `.active`\n.tab-content {\n  > .tab-pane {\n    display: none;\n  }\n  > .active {\n    display: block;\n  }\n}\n\n\n// Dropdowns\n// -------------------------\n\n// Specific dropdowns\n.nav-tabs .dropdown-menu {\n  // make dropdown border overlap tab border\n  margin-top: -1px;\n  // Remove the top rounded corners here since there is a hard edge above the menu\n  .border-top-radius(0);\n}\n","//\n// Navbars\n// --------------------------------------------------\n\n\n// Wrapper and base class\n//\n// Provide a static navbar from which we expand to create full-width, fixed, and\n// other navbar variations.\n\n.navbar {\n  position: relative;\n  min-height: @navbar-height; // Ensure a navbar always shows (e.g., without a .navbar-brand in collapsed mode)\n  margin-bottom: @navbar-margin-bottom;\n  border: 1px solid transparent;\n\n  // Prevent floats from breaking the navbar\n  &:extend(.clearfix all);\n\n  @media (min-width: @grid-float-breakpoint) {\n    border-radius: @navbar-border-radius;\n  }\n}\n\n\n// Navbar heading\n//\n// Groups `.navbar-brand` and `.navbar-toggle` into a single component for easy\n// styling of responsive aspects.\n\n.navbar-header {\n  &:extend(.clearfix all);\n\n  @media (min-width: @grid-float-breakpoint) {\n    float: left;\n  }\n}\n\n\n// Navbar collapse (body)\n//\n// Group your navbar content into this for easy collapsing and expanding across\n// various device sizes. By default, this content is collapsed when <768px, but\n// will expand past that for a horizontal display.\n//\n// To start (on mobile devices) the navbar links, forms, and buttons are stacked\n// vertically and include a `max-height` to overflow in case you have too much\n// content for the user's viewport.\n\n.navbar-collapse {\n  overflow-x: visible;\n  padding-right: @navbar-padding-horizontal;\n  padding-left:  @navbar-padding-horizontal;\n  border-top: 1px solid transparent;\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);\n  &:extend(.clearfix all);\n  -webkit-overflow-scrolling: touch;\n\n  &.in {\n    overflow-y: auto;\n  }\n\n  @media (min-width: @grid-float-breakpoint) {\n    width: auto;\n    border-top: 0;\n    box-shadow: none;\n\n    &.collapse {\n      display: block !important;\n      height: auto !important;\n      padding-bottom: 0; // Override default setting\n      overflow: visible !important;\n    }\n\n    &.in {\n      overflow-y: visible;\n    }\n\n    // Undo the collapse side padding for navbars with containers to ensure\n    // alignment of right-aligned contents.\n    .navbar-fixed-top &,\n    .navbar-static-top &,\n    .navbar-fixed-bottom & {\n      padding-left: 0;\n      padding-right: 0;\n    }\n  }\n}\n\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n  .navbar-collapse {\n    max-height: @navbar-collapse-max-height;\n\n    @media (max-device-width: @screen-xs-min) and (orientation: landscape) {\n      max-height: 200px;\n    }\n  }\n}\n\n\n// Both navbar header and collapse\n//\n// When a container is present, change the behavior of the header and collapse.\n\n.container,\n.container-fluid {\n  > .navbar-header,\n  > .navbar-collapse {\n    margin-right: -@navbar-padding-horizontal;\n    margin-left:  -@navbar-padding-horizontal;\n\n    @media (min-width: @grid-float-breakpoint) {\n      margin-right: 0;\n      margin-left:  0;\n    }\n  }\n}\n\n\n//\n// Navbar alignment options\n//\n// Display the navbar across the entirety of the page or fixed it to the top or\n// bottom of the page.\n\n// Static top (unfixed, but 100% wide) navbar\n.navbar-static-top {\n  z-index: @zindex-navbar;\n  border-width: 0 0 1px;\n\n  @media (min-width: @grid-float-breakpoint) {\n    border-radius: 0;\n  }\n}\n\n// Fix the top/bottom navbars when screen real estate supports it\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n  position: fixed;\n  right: 0;\n  left: 0;\n  z-index: @zindex-navbar-fixed;\n\n  // Undo the rounded corners\n  @media (min-width: @grid-float-breakpoint) {\n    border-radius: 0;\n  }\n}\n.navbar-fixed-top {\n  top: 0;\n  border-width: 0 0 1px;\n}\n.navbar-fixed-bottom {\n  bottom: 0;\n  margin-bottom: 0; // override .navbar defaults\n  border-width: 1px 0 0;\n}\n\n\n// Brand/project name\n\n.navbar-brand {\n  float: left;\n  padding: @navbar-padding-vertical @navbar-padding-horizontal;\n  font-size: @font-size-large;\n  line-height: @line-height-computed;\n  height: @navbar-height;\n\n  &:hover,\n  &:focus {\n    text-decoration: none;\n  }\n\n  > img {\n    display: block;\n  }\n\n  @media (min-width: @grid-float-breakpoint) {\n    .navbar > .container &,\n    .navbar > .container-fluid & {\n      margin-left: -@navbar-padding-horizontal;\n    }\n  }\n}\n\n\n// Navbar toggle\n//\n// Custom button for toggling the `.navbar-collapse`, powered by the collapse\n// JavaScript plugin.\n\n.navbar-toggle {\n  position: relative;\n  float: right;\n  margin-right: @navbar-padding-horizontal;\n  padding: 9px 10px;\n  .navbar-vertical-align(34px);\n  background-color: transparent;\n  background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214\n  border: 1px solid transparent;\n  border-radius: @border-radius-base;\n\n  // We remove the `outline` here, but later compensate by attaching `:hover`\n  // styles to `:focus`.\n  &:focus {\n    outline: 0;\n  }\n\n  // Bars\n  .icon-bar {\n    display: block;\n    width: 22px;\n    height: 2px;\n    border-radius: 1px;\n  }\n  .icon-bar + .icon-bar {\n    margin-top: 4px;\n  }\n\n  @media (min-width: @grid-float-breakpoint) {\n    display: none;\n  }\n}\n\n\n// Navbar nav links\n//\n// Builds on top of the `.nav` components with its own modifier class to make\n// the nav the full height of the horizontal nav (above 768px).\n\n.navbar-nav {\n  margin: (@navbar-padding-vertical / 2) -@navbar-padding-horizontal;\n\n  > li > a {\n    padding-top:    10px;\n    padding-bottom: 10px;\n    line-height: @line-height-computed;\n  }\n\n  @media (max-width: @grid-float-breakpoint-max) {\n    // Dropdowns get custom display when collapsed\n    .open .dropdown-menu {\n      position: static;\n      float: none;\n      width: auto;\n      margin-top: 0;\n      background-color: transparent;\n      border: 0;\n      box-shadow: none;\n      > li > a,\n      .dropdown-header {\n        padding: 5px 15px 5px 25px;\n      }\n      > li > a {\n        line-height: @line-height-computed;\n        &:hover,\n        &:focus {\n          background-image: none;\n        }\n      }\n    }\n  }\n\n  // Uncollapse the nav\n  @media (min-width: @grid-float-breakpoint) {\n    float: left;\n    margin: 0;\n\n    > li {\n      float: left;\n      > a {\n        padding-top:    @navbar-padding-vertical;\n        padding-bottom: @navbar-padding-vertical;\n      }\n    }\n  }\n}\n\n\n// Navbar form\n//\n// Extension of the `.form-inline` with some extra flavor for optimum display in\n// our navbars.\n\n.navbar-form {\n  margin-left: -@navbar-padding-horizontal;\n  margin-right: -@navbar-padding-horizontal;\n  padding: 10px @navbar-padding-horizontal;\n  border-top: 1px solid transparent;\n  border-bottom: 1px solid transparent;\n  @shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);\n  .box-shadow(@shadow);\n\n  // Mixin behavior for optimum display\n  .form-inline();\n\n  .form-group {\n    @media (max-width: @grid-float-breakpoint-max) {\n      margin-bottom: 5px;\n\n      &:last-child {\n        margin-bottom: 0;\n      }\n    }\n  }\n\n  // Vertically center in expanded, horizontal navbar\n  .navbar-vertical-align(@input-height-base);\n\n  // Undo 100% width for pull classes\n  @media (min-width: @grid-float-breakpoint) {\n    width: auto;\n    border: 0;\n    margin-left: 0;\n    margin-right: 0;\n    padding-top: 0;\n    padding-bottom: 0;\n    .box-shadow(none);\n  }\n}\n\n\n// Dropdown menus\n\n// Menu position and menu carets\n.navbar-nav > li > .dropdown-menu {\n  margin-top: 0;\n  .border-top-radius(0);\n}\n// Menu position and menu caret support for dropups via extra dropup class\n.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {\n  margin-bottom: 0;\n  .border-top-radius(@navbar-border-radius);\n  .border-bottom-radius(0);\n}\n\n\n// Buttons in navbars\n//\n// Vertically center a button within a navbar (when *not* in a form).\n\n.navbar-btn {\n  .navbar-vertical-align(@input-height-base);\n\n  &.btn-sm {\n    .navbar-vertical-align(@input-height-small);\n  }\n  &.btn-xs {\n    .navbar-vertical-align(22);\n  }\n}\n\n\n// Text in navbars\n//\n// Add a class to make any element properly align itself vertically within the navbars.\n\n.navbar-text {\n  .navbar-vertical-align(@line-height-computed);\n\n  @media (min-width: @grid-float-breakpoint) {\n    float: left;\n    margin-left: @navbar-padding-horizontal;\n    margin-right: @navbar-padding-horizontal;\n  }\n}\n\n\n// Component alignment\n//\n// Repurpose the pull utilities as their own navbar utilities to avoid specificity\n// issues with parents and chaining. Only do this when the navbar is uncollapsed\n// though so that navbar contents properly stack and align in mobile.\n//\n// Declared after the navbar components to ensure more specificity on the margins.\n\n@media (min-width: @grid-float-breakpoint) {\n  .navbar-left  { .pull-left(); }\n  .navbar-right {\n    .pull-right();\n    margin-right: -@navbar-padding-horizontal;\n\n    ~ .navbar-right {\n      margin-right: 0;\n    }\n  }\n}\n\n\n// Alternate navbars\n// --------------------------------------------------\n\n// Default navbar\n.navbar-default {\n  background-color: @navbar-default-bg;\n  border-color: @navbar-default-border;\n\n  .navbar-brand {\n    color: @navbar-default-brand-color;\n    &:hover,\n    &:focus {\n      color: @navbar-default-brand-hover-color;\n      background-color: @navbar-default-brand-hover-bg;\n    }\n  }\n\n  .navbar-text {\n    color: @navbar-default-color;\n  }\n\n  .navbar-nav {\n    > li > a {\n      color: @navbar-default-link-color;\n\n      &:hover,\n      &:focus {\n        color: @navbar-default-link-hover-color;\n        background-color: @navbar-default-link-hover-bg;\n      }\n    }\n    > .active > a {\n      &,\n      &:hover,\n      &:focus {\n        color: @navbar-default-link-active-color;\n        background-color: @navbar-default-link-active-bg;\n      }\n    }\n    > .disabled > a {\n      &,\n      &:hover,\n      &:focus {\n        color: @navbar-default-link-disabled-color;\n        background-color: @navbar-default-link-disabled-bg;\n      }\n    }\n  }\n\n  .navbar-toggle {\n    border-color: @navbar-default-toggle-border-color;\n    &:hover,\n    &:focus {\n      background-color: @navbar-default-toggle-hover-bg;\n    }\n    .icon-bar {\n      background-color: @navbar-default-toggle-icon-bar-bg;\n    }\n  }\n\n  .navbar-collapse,\n  .navbar-form {\n    border-color: @navbar-default-border;\n  }\n\n  // Dropdown menu items\n  .navbar-nav {\n    // Remove background color from open dropdown\n    > .open > a {\n      &,\n      &:hover,\n      &:focus {\n        background-color: @navbar-default-link-active-bg;\n        color: @navbar-default-link-active-color;\n      }\n    }\n\n    @media (max-width: @grid-float-breakpoint-max) {\n      // Dropdowns get custom display when collapsed\n      .open .dropdown-menu {\n        > li > a {\n          color: @navbar-default-link-color;\n          &:hover,\n          &:focus {\n            color: @navbar-default-link-hover-color;\n            background-color: @navbar-default-link-hover-bg;\n          }\n        }\n        > .active > a {\n          &,\n          &:hover,\n          &:focus {\n            color: @navbar-default-link-active-color;\n            background-color: @navbar-default-link-active-bg;\n          }\n        }\n        > .disabled > a {\n          &,\n          &:hover,\n          &:focus {\n            color: @navbar-default-link-disabled-color;\n            background-color: @navbar-default-link-disabled-bg;\n          }\n        }\n      }\n    }\n  }\n\n\n  // Links in navbars\n  //\n  // Add a class to ensure links outside the navbar nav are colored correctly.\n\n  .navbar-link {\n    color: @navbar-default-link-color;\n    &:hover {\n      color: @navbar-default-link-hover-color;\n    }\n  }\n\n  .btn-link {\n    color: @navbar-default-link-color;\n    &:hover,\n    &:focus {\n      color: @navbar-default-link-hover-color;\n    }\n    &[disabled],\n    fieldset[disabled] & {\n      &:hover,\n      &:focus {\n        color: @navbar-default-link-disabled-color;\n      }\n    }\n  }\n}\n\n// Inverse navbar\n\n.navbar-inverse {\n  background-color: @navbar-inverse-bg;\n  border-color: @navbar-inverse-border;\n\n  .navbar-brand {\n    color: @navbar-inverse-brand-color;\n    &:hover,\n    &:focus {\n      color: @navbar-inverse-brand-hover-color;\n      background-color: @navbar-inverse-brand-hover-bg;\n    }\n  }\n\n  .navbar-text {\n    color: @navbar-inverse-color;\n  }\n\n  .navbar-nav {\n    > li > a {\n      color: @navbar-inverse-link-color;\n\n      &:hover,\n      &:focus {\n        color: @navbar-inverse-link-hover-color;\n        background-color: @navbar-inverse-link-hover-bg;\n      }\n    }\n    > .active > a {\n      &,\n      &:hover,\n      &:focus {\n        color: @navbar-inverse-link-active-color;\n        background-color: @navbar-inverse-link-active-bg;\n      }\n    }\n    > .disabled > a {\n      &,\n      &:hover,\n      &:focus {\n        color: @navbar-inverse-link-disabled-color;\n        background-color: @navbar-inverse-link-disabled-bg;\n      }\n    }\n  }\n\n  // Darken the responsive nav toggle\n  .navbar-toggle {\n    border-color: @navbar-inverse-toggle-border-color;\n    &:hover,\n    &:focus {\n      background-color: @navbar-inverse-toggle-hover-bg;\n    }\n    .icon-bar {\n      background-color: @navbar-inverse-toggle-icon-bar-bg;\n    }\n  }\n\n  .navbar-collapse,\n  .navbar-form {\n    border-color: darken(@navbar-inverse-bg, 7%);\n  }\n\n  // Dropdowns\n  .navbar-nav {\n    > .open > a {\n      &,\n      &:hover,\n      &:focus {\n        background-color: @navbar-inverse-link-active-bg;\n        color: @navbar-inverse-link-active-color;\n      }\n    }\n\n    @media (max-width: @grid-float-breakpoint-max) {\n      // Dropdowns get custom display\n      .open .dropdown-menu {\n        > .dropdown-header {\n          border-color: @navbar-inverse-border;\n        }\n        .divider {\n          background-color: @navbar-inverse-border;\n        }\n        > li > a {\n          color: @navbar-inverse-link-color;\n          &:hover,\n          &:focus {\n            color: @navbar-inverse-link-hover-color;\n            background-color: @navbar-inverse-link-hover-bg;\n          }\n        }\n        > .active > a {\n          &,\n          &:hover,\n          &:focus {\n            color: @navbar-inverse-link-active-color;\n            background-color: @navbar-inverse-link-active-bg;\n          }\n        }\n        > .disabled > a {\n          &,\n          &:hover,\n          &:focus {\n            color: @navbar-inverse-link-disabled-color;\n            background-color: @navbar-inverse-link-disabled-bg;\n          }\n        }\n      }\n    }\n  }\n\n  .navbar-link {\n    color: @navbar-inverse-link-color;\n    &:hover {\n      color: @navbar-inverse-link-hover-color;\n    }\n  }\n\n  .btn-link {\n    color: @navbar-inverse-link-color;\n    &:hover,\n    &:focus {\n      color: @navbar-inverse-link-hover-color;\n    }\n    &[disabled],\n    fieldset[disabled] & {\n      &:hover,\n      &:focus {\n        color: @navbar-inverse-link-disabled-color;\n      }\n    }\n  }\n}\n","// Navbar vertical align\n//\n// Vertically center elements in the navbar.\n// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.\n\n.navbar-vertical-align(@element-height) {\n  margin-top: ((@navbar-height - @element-height) / 2);\n  margin-bottom: ((@navbar-height - @element-height) / 2);\n}\n","//\n// Utility classes\n// --------------------------------------------------\n\n\n// Floats\n// -------------------------\n\n.clearfix {\n  .clearfix();\n}\n.center-block {\n  .center-block();\n}\n.pull-right {\n  float: right !important;\n}\n.pull-left {\n  float: left !important;\n}\n\n\n// Toggling content\n// -------------------------\n\n// Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1\n.hide {\n  display: none !important;\n}\n.show {\n  display: block !important;\n}\n.invisible {\n  visibility: hidden;\n}\n.text-hide {\n  .text-hide();\n}\n\n\n// Hide from screenreaders and browsers\n//\n// Credit: HTML5 Boilerplate\n\n.hidden {\n  display: none !important;\n}\n\n\n// For Affix plugin\n// -------------------------\n\n.affix {\n  position: fixed;\n}\n","//\n// Breadcrumbs\n// --------------------------------------------------\n\n\n.breadcrumb {\n  padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal;\n  margin-bottom: @line-height-computed;\n  list-style: none;\n  background-color: @breadcrumb-bg;\n  border-radius: @border-radius-base;\n\n  > li {\n    display: inline-block;\n\n    + li:before {\n      content: \"@{breadcrumb-separator}\\00a0\"; // Unicode space added since inline-block means non-collapsing white-space\n      padding: 0 5px;\n      color: @breadcrumb-color;\n    }\n  }\n\n  > .active {\n    color: @breadcrumb-active-color;\n  }\n}\n","//\n// Pagination (multiple pages)\n// --------------------------------------------------\n.pagination {\n  display: inline-block;\n  padding-left: 0;\n  margin: @line-height-computed 0;\n  border-radius: @border-radius-base;\n\n  > li {\n    display: inline; // Remove list-style and block-level defaults\n    > a,\n    > span {\n      position: relative;\n      float: left; // Collapse white-space\n      padding: @padding-base-vertical @padding-base-horizontal;\n      line-height: @line-height-base;\n      text-decoration: none;\n      color: @pagination-color;\n      background-color: @pagination-bg;\n      border: 1px solid @pagination-border;\n      margin-left: -1px;\n    }\n    &:first-child {\n      > a,\n      > span {\n        margin-left: 0;\n        .border-left-radius(@border-radius-base);\n      }\n    }\n    &:last-child {\n      > a,\n      > span {\n        .border-right-radius(@border-radius-base);\n      }\n    }\n  }\n\n  > li > a,\n  > li > span {\n    &:hover,\n    &:focus {\n      z-index: 2;\n      color: @pagination-hover-color;\n      background-color: @pagination-hover-bg;\n      border-color: @pagination-hover-border;\n    }\n  }\n\n  > .active > a,\n  > .active > span {\n    &,\n    &:hover,\n    &:focus {\n      z-index: 3;\n      color: @pagination-active-color;\n      background-color: @pagination-active-bg;\n      border-color: @pagination-active-border;\n      cursor: default;\n    }\n  }\n\n  > .disabled {\n    > span,\n    > span:hover,\n    > span:focus,\n    > a,\n    > a:hover,\n    > a:focus {\n      color: @pagination-disabled-color;\n      background-color: @pagination-disabled-bg;\n      border-color: @pagination-disabled-border;\n      cursor: @cursor-disabled;\n    }\n  }\n}\n\n// Sizing\n// --------------------------------------------------\n\n// Large\n.pagination-lg {\n  .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);\n}\n\n// Small\n.pagination-sm {\n  .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);\n}\n","// Pagination\n\n.pagination-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {\n  > li {\n    > a,\n    > span {\n      padding: @padding-vertical @padding-horizontal;\n      font-size: @font-size;\n      line-height: @line-height;\n    }\n    &:first-child {\n      > a,\n      > span {\n        .border-left-radius(@border-radius);\n      }\n    }\n    &:last-child {\n      > a,\n      > span {\n        .border-right-radius(@border-radius);\n      }\n    }\n  }\n}\n","//\n// Pager pagination\n// --------------------------------------------------\n\n\n.pager {\n  padding-left: 0;\n  margin: @line-height-computed 0;\n  list-style: none;\n  text-align: center;\n  &:extend(.clearfix all);\n  li {\n    display: inline;\n    > a,\n    > span {\n      display: inline-block;\n      padding: 5px 14px;\n      background-color: @pager-bg;\n      border: 1px solid @pager-border;\n      border-radius: @pager-border-radius;\n    }\n\n    > a:hover,\n    > a:focus {\n      text-decoration: none;\n      background-color: @pager-hover-bg;\n    }\n  }\n\n  .next {\n    > a,\n    > span {\n      float: right;\n    }\n  }\n\n  .previous {\n    > a,\n    > span {\n      float: left;\n    }\n  }\n\n  .disabled {\n    > a,\n    > a:hover,\n    > a:focus,\n    > span {\n      color: @pager-disabled-color;\n      background-color: @pager-bg;\n      cursor: @cursor-disabled;\n    }\n  }\n}\n","//\n// Labels\n// --------------------------------------------------\n\n.label {\n  display: inline;\n  padding: .2em .6em .3em;\n  font-size: 75%;\n  font-weight: bold;\n  line-height: 1;\n  color: @label-color;\n  text-align: center;\n  white-space: nowrap;\n  vertical-align: baseline;\n  border-radius: .25em;\n\n  // Add hover effects, but only for links\n  a& {\n    &:hover,\n    &:focus {\n      color: @label-link-hover-color;\n      text-decoration: none;\n      cursor: pointer;\n    }\n  }\n\n  // Empty labels collapse automatically (not available in IE8)\n  &:empty {\n    display: none;\n  }\n\n  // Quick fix for labels in buttons\n  .btn & {\n    position: relative;\n    top: -1px;\n  }\n}\n\n// Colors\n// Contextual variations (linked labels get darker on :hover)\n\n.label-default {\n  .label-variant(@label-default-bg);\n}\n\n.label-primary {\n  .label-variant(@label-primary-bg);\n}\n\n.label-success {\n  .label-variant(@label-success-bg);\n}\n\n.label-info {\n  .label-variant(@label-info-bg);\n}\n\n.label-warning {\n  .label-variant(@label-warning-bg);\n}\n\n.label-danger {\n  .label-variant(@label-danger-bg);\n}\n","// Labels\n\n.label-variant(@color) {\n  background-color: @color;\n\n  &[href] {\n    &:hover,\n    &:focus {\n      background-color: darken(@color, 10%);\n    }\n  }\n}\n","//\n// Badges\n// --------------------------------------------------\n\n\n// Base class\n.badge {\n  display: inline-block;\n  min-width: 10px;\n  padding: 3px 7px;\n  font-size: @font-size-small;\n  font-weight: @badge-font-weight;\n  color: @badge-color;\n  line-height: @badge-line-height;\n  vertical-align: middle;\n  white-space: nowrap;\n  text-align: center;\n  background-color: @badge-bg;\n  border-radius: @badge-border-radius;\n\n  // Empty badges collapse automatically (not available in IE8)\n  &:empty {\n    display: none;\n  }\n\n  // Quick fix for badges in buttons\n  .btn & {\n    position: relative;\n    top: -1px;\n  }\n\n  .btn-xs &,\n  .btn-group-xs > .btn & {\n    top: 0;\n    padding: 1px 5px;\n  }\n\n  // Hover state, but only for links\n  a& {\n    &:hover,\n    &:focus {\n      color: @badge-link-hover-color;\n      text-decoration: none;\n      cursor: pointer;\n    }\n  }\n\n  // Account for badges in navs\n  .list-group-item.active > &,\n  .nav-pills > .active > a > & {\n    color: @badge-active-color;\n    background-color: @badge-active-bg;\n  }\n\n  .list-group-item > & {\n    float: right;\n  }\n\n  .list-group-item > & + & {\n    margin-right: 5px;\n  }\n\n  .nav-pills > li > a > & {\n    margin-left: 3px;\n  }\n}\n","//\n// Jumbotron\n// --------------------------------------------------\n\n\n.jumbotron {\n  padding-top:    @jumbotron-padding;\n  padding-bottom: @jumbotron-padding;\n  margin-bottom: @jumbotron-padding;\n  color: @jumbotron-color;\n  background-color: @jumbotron-bg;\n\n  h1,\n  .h1 {\n    color: @jumbotron-heading-color;\n  }\n\n  p {\n    margin-bottom: (@jumbotron-padding / 2);\n    font-size: @jumbotron-font-size;\n    font-weight: 200;\n  }\n\n  > hr {\n    border-top-color: darken(@jumbotron-bg, 10%);\n  }\n\n  .container &,\n  .container-fluid & {\n    border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container\n    padding-left:  (@grid-gutter-width / 2);\n    padding-right: (@grid-gutter-width / 2);\n  }\n\n  .container {\n    max-width: 100%;\n  }\n\n  @media screen and (min-width: @screen-sm-min) {\n    padding-top:    (@jumbotron-padding * 1.6);\n    padding-bottom: (@jumbotron-padding * 1.6);\n\n    .container &,\n    .container-fluid & {\n      padding-left:  (@jumbotron-padding * 2);\n      padding-right: (@jumbotron-padding * 2);\n    }\n\n    h1,\n    .h1 {\n      font-size: @jumbotron-heading-font-size;\n    }\n  }\n}\n","//\n// Thumbnails\n// --------------------------------------------------\n\n\n// Mixin and adjust the regular image class\n.thumbnail {\n  display: block;\n  padding: @thumbnail-padding;\n  margin-bottom: @line-height-computed;\n  line-height: @line-height-base;\n  background-color: @thumbnail-bg;\n  border: 1px solid @thumbnail-border;\n  border-radius: @thumbnail-border-radius;\n  .transition(border .2s ease-in-out);\n\n  > img,\n  a > img {\n    &:extend(.img-responsive);\n    margin-left: auto;\n    margin-right: auto;\n  }\n\n  // Add a hover state for linked versions only\n  a&:hover,\n  a&:focus,\n  a&.active {\n    border-color: @link-color;\n  }\n\n  // Image captions\n  .caption {\n    padding: @thumbnail-caption-padding;\n    color: @thumbnail-caption-color;\n  }\n}\n","//\n// Alerts\n// --------------------------------------------------\n\n\n// Base styles\n// -------------------------\n\n.alert {\n  padding: @alert-padding;\n  margin-bottom: @line-height-computed;\n  border: 1px solid transparent;\n  border-radius: @alert-border-radius;\n\n  // Headings for larger alerts\n  h4 {\n    margin-top: 0;\n    // Specified for the h4 to prevent conflicts of changing @headings-color\n    color: inherit;\n  }\n\n  // Provide class for links that match alerts\n  .alert-link {\n    font-weight: @alert-link-font-weight;\n  }\n\n  // Improve alignment and spacing of inner content\n  > p,\n  > ul {\n    margin-bottom: 0;\n  }\n\n  > p + p {\n    margin-top: 5px;\n  }\n}\n\n// Dismissible alerts\n//\n// Expand the right padding and account for the close button's positioning.\n\n.alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0.\n.alert-dismissible {\n  padding-right: (@alert-padding + 20);\n\n  // Adjust close link position\n  .close {\n    position: relative;\n    top: -2px;\n    right: -21px;\n    color: inherit;\n  }\n}\n\n// Alternate styles\n//\n// Generate contextual modifier classes for colorizing the alert.\n\n.alert-success {\n  .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text);\n}\n\n.alert-info {\n  .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text);\n}\n\n.alert-warning {\n  .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text);\n}\n\n.alert-danger {\n  .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text);\n}\n","// Alerts\n\n.alert-variant(@background; @border; @text-color) {\n  background-color: @background;\n  border-color: @border;\n  color: @text-color;\n\n  hr {\n    border-top-color: darken(@border, 5%);\n  }\n  .alert-link {\n    color: darken(@text-color, 10%);\n  }\n}\n","//\n// Progress bars\n// --------------------------------------------------\n\n\n// Bar animations\n// -------------------------\n\n// WebKit\n@-webkit-keyframes progress-bar-stripes {\n  from  { background-position: 40px 0; }\n  to    { background-position: 0 0; }\n}\n\n// Spec and IE10+\n@keyframes progress-bar-stripes {\n  from  { background-position: 40px 0; }\n  to    { background-position: 0 0; }\n}\n\n\n// Bar itself\n// -------------------------\n\n// Outer container\n.progress {\n  overflow: hidden;\n  height: @line-height-computed;\n  margin-bottom: @line-height-computed;\n  background-color: @progress-bg;\n  border-radius: @progress-border-radius;\n  .box-shadow(inset 0 1px 2px rgba(0,0,0,.1));\n}\n\n// Bar of progress\n.progress-bar {\n  float: left;\n  width: 0%;\n  height: 100%;\n  font-size: @font-size-small;\n  line-height: @line-height-computed;\n  color: @progress-bar-color;\n  text-align: center;\n  background-color: @progress-bar-bg;\n  .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));\n  .transition(width .6s ease);\n}\n\n// Striped bars\n//\n// `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the\n// `.progress-bar-striped` class, which you just add to an existing\n// `.progress-bar`.\n.progress-striped .progress-bar,\n.progress-bar-striped {\n  #gradient > .striped();\n  background-size: 40px 40px;\n}\n\n// Call animation for the active one\n//\n// `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the\n// `.progress-bar.active` approach.\n.progress.active .progress-bar,\n.progress-bar.active {\n  .animation(progress-bar-stripes 2s linear infinite);\n}\n\n\n// Variations\n// -------------------------\n\n.progress-bar-success {\n  .progress-bar-variant(@progress-bar-success-bg);\n}\n\n.progress-bar-info {\n  .progress-bar-variant(@progress-bar-info-bg);\n}\n\n.progress-bar-warning {\n  .progress-bar-variant(@progress-bar-warning-bg);\n}\n\n.progress-bar-danger {\n  .progress-bar-variant(@progress-bar-danger-bg);\n}\n","// Gradients\n\n#gradient {\n\n  // Horizontal gradient, from left to right\n  //\n  // Creates two color stops, start and end, by specifying a color and position for each color stop.\n  // Color stops are not available in IE9 and below.\n  .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n    background-image: -webkit-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n    background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12\n    background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n    background-repeat: repeat-x;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down\n  }\n\n  // Vertical gradient, from top to bottom\n  //\n  // Creates two color stops, start and end, by specifying a color and position for each color stop.\n  // Color stops are not available in IE9 and below.\n  .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n    background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent);  // Safari 5.1-6, Chrome 10+\n    background-image: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent);  // Opera 12\n    background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n    background-repeat: repeat-x;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down\n  }\n\n  .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {\n    background-repeat: repeat-x;\n    background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+\n    background-image: -o-linear-gradient(@deg, @start-color, @end-color); // Opera 12\n    background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n  }\n  .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n    background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n    background-image: -o-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n    background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);\n    background-repeat: no-repeat;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n  }\n  .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n    background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n    background-image: -o-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n    background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n    background-repeat: no-repeat;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n  }\n  .radial(@inner-color: #555; @outer-color: #333) {\n    background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);\n    background-image: radial-gradient(circle, @inner-color, @outer-color);\n    background-repeat: no-repeat;\n  }\n  .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {\n    background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n    background-image: -o-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n    background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n  }\n}\n","// Progress bars\n\n.progress-bar-variant(@color) {\n  background-color: @color;\n\n  // Deprecated parent class requirement as of v3.2.0\n  .progress-striped & {\n    #gradient > .striped();\n  }\n}\n",".media {\n  // Proper spacing between instances of .media\n  margin-top: 15px;\n\n  &:first-child {\n    margin-top: 0;\n  }\n}\n\n.media,\n.media-body {\n  zoom: 1;\n  overflow: hidden;\n}\n\n.media-body {\n  width: 10000px;\n}\n\n.media-object {\n  display: block;\n\n  // Fix collapse in webkit from max-width: 100% and display: table-cell.\n  &.img-thumbnail {\n    max-width: none;\n  }\n}\n\n.media-right,\n.media > .pull-right {\n  padding-left: 10px;\n}\n\n.media-left,\n.media > .pull-left {\n  padding-right: 10px;\n}\n\n.media-left,\n.media-right,\n.media-body {\n  display: table-cell;\n  vertical-align: top;\n}\n\n.media-middle {\n  vertical-align: middle;\n}\n\n.media-bottom {\n  vertical-align: bottom;\n}\n\n// Reset margins on headings for tighter default spacing\n.media-heading {\n  margin-top: 0;\n  margin-bottom: 5px;\n}\n\n// Media list variation\n//\n// Undo default ul/ol styles\n.media-list {\n  padding-left: 0;\n  list-style: none;\n}\n","//\n// List groups\n// --------------------------------------------------\n\n\n// Base class\n//\n// Easily usable on <ul>, <ol>, or <div>.\n\n.list-group {\n  // No need to set list-style: none; since .list-group-item is block level\n  margin-bottom: 20px;\n  padding-left: 0; // reset padding because ul and ol\n}\n\n\n// Individual list items\n//\n// Use on `li`s or `div`s within the `.list-group` parent.\n\n.list-group-item {\n  position: relative;\n  display: block;\n  padding: 10px 15px;\n  // Place the border on the list items and negative margin up for better styling\n  margin-bottom: -1px;\n  background-color: @list-group-bg;\n  border: 1px solid @list-group-border;\n\n  // Round the first and last items\n  &:first-child {\n    .border-top-radius(@list-group-border-radius);\n  }\n  &:last-child {\n    margin-bottom: 0;\n    .border-bottom-radius(@list-group-border-radius);\n  }\n}\n\n\n// Interactive list items\n//\n// Use anchor or button elements instead of `li`s or `div`s to create interactive items.\n// Includes an extra `.active` modifier class for showing selected items.\n\na.list-group-item,\nbutton.list-group-item {\n  color: @list-group-link-color;\n\n  .list-group-item-heading {\n    color: @list-group-link-heading-color;\n  }\n\n  // Hover state\n  &:hover,\n  &:focus {\n    text-decoration: none;\n    color: @list-group-link-hover-color;\n    background-color: @list-group-hover-bg;\n  }\n}\n\nbutton.list-group-item {\n  width: 100%;\n  text-align: left;\n}\n\n.list-group-item {\n  // Disabled state\n  &.disabled,\n  &.disabled:hover,\n  &.disabled:focus {\n    background-color: @list-group-disabled-bg;\n    color: @list-group-disabled-color;\n    cursor: @cursor-disabled;\n\n    // Force color to inherit for custom content\n    .list-group-item-heading {\n      color: inherit;\n    }\n    .list-group-item-text {\n      color: @list-group-disabled-text-color;\n    }\n  }\n\n  // Active class on item itself, not parent\n  &.active,\n  &.active:hover,\n  &.active:focus {\n    z-index: 2; // Place active items above their siblings for proper border styling\n    color: @list-group-active-color;\n    background-color: @list-group-active-bg;\n    border-color: @list-group-active-border;\n\n    // Force color to inherit for custom content\n    .list-group-item-heading,\n    .list-group-item-heading > small,\n    .list-group-item-heading > .small {\n      color: inherit;\n    }\n    .list-group-item-text {\n      color: @list-group-active-text-color;\n    }\n  }\n}\n\n\n// Contextual variants\n//\n// Add modifier classes to change text and background color on individual items.\n// Organizationally, this must come after the `:hover` states.\n\n.list-group-item-variant(success; @state-success-bg; @state-success-text);\n.list-group-item-variant(info; @state-info-bg; @state-info-text);\n.list-group-item-variant(warning; @state-warning-bg; @state-warning-text);\n.list-group-item-variant(danger; @state-danger-bg; @state-danger-text);\n\n\n// Custom content options\n//\n// Extra classes for creating well-formatted content within `.list-group-item`s.\n\n.list-group-item-heading {\n  margin-top: 0;\n  margin-bottom: 5px;\n}\n.list-group-item-text {\n  margin-bottom: 0;\n  line-height: 1.3;\n}\n","// List Groups\n\n.list-group-item-variant(@state; @background; @color) {\n  .list-group-item-@{state} {\n    color: @color;\n    background-color: @background;\n\n    a&,\n    button& {\n      color: @color;\n\n      .list-group-item-heading {\n        color: inherit;\n      }\n\n      &:hover,\n      &:focus {\n        color: @color;\n        background-color: darken(@background, 5%);\n      }\n      &.active,\n      &.active:hover,\n      &.active:focus {\n        color: #fff;\n        background-color: @color;\n        border-color: @color;\n      }\n    }\n  }\n}\n","//\n// Panels\n// --------------------------------------------------\n\n\n// Base class\n.panel {\n  margin-bottom: @line-height-computed;\n  background-color: @panel-bg;\n  border: 1px solid transparent;\n  border-radius: @panel-border-radius;\n  .box-shadow(0 1px 1px rgba(0,0,0,.05));\n}\n\n// Panel contents\n.panel-body {\n  padding: @panel-body-padding;\n  &:extend(.clearfix all);\n}\n\n// Optional heading\n.panel-heading {\n  padding: @panel-heading-padding;\n  border-bottom: 1px solid transparent;\n  .border-top-radius((@panel-border-radius - 1));\n\n  > .dropdown .dropdown-toggle {\n    color: inherit;\n  }\n}\n\n// Within heading, strip any `h*` tag of its default margins for spacing.\n.panel-title {\n  margin-top: 0;\n  margin-bottom: 0;\n  font-size: ceil((@font-size-base * 1.125));\n  color: inherit;\n\n  > a,\n  > small,\n  > .small,\n  > small > a,\n  > .small > a {\n    color: inherit;\n  }\n}\n\n// Optional footer (stays gray in every modifier class)\n.panel-footer {\n  padding: @panel-footer-padding;\n  background-color: @panel-footer-bg;\n  border-top: 1px solid @panel-inner-border;\n  .border-bottom-radius((@panel-border-radius - 1));\n}\n\n\n// List groups in panels\n//\n// By default, space out list group content from panel headings to account for\n// any kind of custom content between the two.\n\n.panel {\n  > .list-group,\n  > .panel-collapse > .list-group {\n    margin-bottom: 0;\n\n    .list-group-item {\n      border-width: 1px 0;\n      border-radius: 0;\n    }\n\n    // Add border top radius for first one\n    &:first-child {\n      .list-group-item:first-child {\n        border-top: 0;\n        .border-top-radius((@panel-border-radius - 1));\n      }\n    }\n\n    // Add border bottom radius for last one\n    &:last-child {\n      .list-group-item:last-child {\n        border-bottom: 0;\n        .border-bottom-radius((@panel-border-radius - 1));\n      }\n    }\n  }\n  > .panel-heading + .panel-collapse > .list-group {\n    .list-group-item:first-child {\n      .border-top-radius(0);\n    }\n  }\n}\n// Collapse space between when there's no additional content.\n.panel-heading + .list-group {\n  .list-group-item:first-child {\n    border-top-width: 0;\n  }\n}\n.list-group + .panel-footer {\n  border-top-width: 0;\n}\n\n// Tables in panels\n//\n// Place a non-bordered `.table` within a panel (not within a `.panel-body`) and\n// watch it go full width.\n\n.panel {\n  > .table,\n  > .table-responsive > .table,\n  > .panel-collapse > .table {\n    margin-bottom: 0;\n\n    caption {\n      padding-left: @panel-body-padding;\n      padding-right: @panel-body-padding;\n    }\n  }\n  // Add border top radius for first one\n  > .table:first-child,\n  > .table-responsive:first-child > .table:first-child {\n    .border-top-radius((@panel-border-radius - 1));\n\n    > thead:first-child,\n    > tbody:first-child {\n      > tr:first-child {\n        border-top-left-radius: (@panel-border-radius - 1);\n        border-top-right-radius: (@panel-border-radius - 1);\n\n        td:first-child,\n        th:first-child {\n          border-top-left-radius: (@panel-border-radius - 1);\n        }\n        td:last-child,\n        th:last-child {\n          border-top-right-radius: (@panel-border-radius - 1);\n        }\n      }\n    }\n  }\n  // Add border bottom radius for last one\n  > .table:last-child,\n  > .table-responsive:last-child > .table:last-child {\n    .border-bottom-radius((@panel-border-radius - 1));\n\n    > tbody:last-child,\n    > tfoot:last-child {\n      > tr:last-child {\n        border-bottom-left-radius: (@panel-border-radius - 1);\n        border-bottom-right-radius: (@panel-border-radius - 1);\n\n        td:first-child,\n        th:first-child {\n          border-bottom-left-radius: (@panel-border-radius - 1);\n        }\n        td:last-child,\n        th:last-child {\n          border-bottom-right-radius: (@panel-border-radius - 1);\n        }\n      }\n    }\n  }\n  > .panel-body + .table,\n  > .panel-body + .table-responsive,\n  > .table + .panel-body,\n  > .table-responsive + .panel-body {\n    border-top: 1px solid @table-border-color;\n  }\n  > .table > tbody:first-child > tr:first-child th,\n  > .table > tbody:first-child > tr:first-child td {\n    border-top: 0;\n  }\n  > .table-bordered,\n  > .table-responsive > .table-bordered {\n    border: 0;\n    > thead,\n    > tbody,\n    > tfoot {\n      > tr {\n        > th:first-child,\n        > td:first-child {\n          border-left: 0;\n        }\n        > th:last-child,\n        > td:last-child {\n          border-right: 0;\n        }\n      }\n    }\n    > thead,\n    > tbody {\n      > tr:first-child {\n        > td,\n        > th {\n          border-bottom: 0;\n        }\n      }\n    }\n    > tbody,\n    > tfoot {\n      > tr:last-child {\n        > td,\n        > th {\n          border-bottom: 0;\n        }\n      }\n    }\n  }\n  > .table-responsive {\n    border: 0;\n    margin-bottom: 0;\n  }\n}\n\n\n// Collapsable panels (aka, accordion)\n//\n// Wrap a series of panels in `.panel-group` to turn them into an accordion with\n// the help of our collapse JavaScript plugin.\n\n.panel-group {\n  margin-bottom: @line-height-computed;\n\n  // Tighten up margin so it's only between panels\n  .panel {\n    margin-bottom: 0;\n    border-radius: @panel-border-radius;\n\n    + .panel {\n      margin-top: 5px;\n    }\n  }\n\n  .panel-heading {\n    border-bottom: 0;\n\n    + .panel-collapse > .panel-body,\n    + .panel-collapse > .list-group {\n      border-top: 1px solid @panel-inner-border;\n    }\n  }\n\n  .panel-footer {\n    border-top: 0;\n    + .panel-collapse .panel-body {\n      border-bottom: 1px solid @panel-inner-border;\n    }\n  }\n}\n\n\n// Contextual variations\n.panel-default {\n  .panel-variant(@panel-default-border; @panel-default-text; @panel-default-heading-bg; @panel-default-border);\n}\n.panel-primary {\n  .panel-variant(@panel-primary-border; @panel-primary-text; @panel-primary-heading-bg; @panel-primary-border);\n}\n.panel-success {\n  .panel-variant(@panel-success-border; @panel-success-text; @panel-success-heading-bg; @panel-success-border);\n}\n.panel-info {\n  .panel-variant(@panel-info-border; @panel-info-text; @panel-info-heading-bg; @panel-info-border);\n}\n.panel-warning {\n  .panel-variant(@panel-warning-border; @panel-warning-text; @panel-warning-heading-bg; @panel-warning-border);\n}\n.panel-danger {\n  .panel-variant(@panel-danger-border; @panel-danger-text; @panel-danger-heading-bg; @panel-danger-border);\n}\n","// Panels\n\n.panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) {\n  border-color: @border;\n\n  & > .panel-heading {\n    color: @heading-text-color;\n    background-color: @heading-bg-color;\n    border-color: @heading-border;\n\n    + .panel-collapse > .panel-body {\n      border-top-color: @border;\n    }\n    .badge {\n      color: @heading-bg-color;\n      background-color: @heading-text-color;\n    }\n  }\n  & > .panel-footer {\n    + .panel-collapse > .panel-body {\n      border-bottom-color: @border;\n    }\n  }\n}\n","// Embeds responsive\n//\n// Credit: Nicolas Gallagher and SUIT CSS.\n\n.embed-responsive {\n  position: relative;\n  display: block;\n  height: 0;\n  padding: 0;\n  overflow: hidden;\n\n  .embed-responsive-item,\n  iframe,\n  embed,\n  object,\n  video {\n    position: absolute;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    height: 100%;\n    width: 100%;\n    border: 0;\n  }\n}\n\n// Modifier class for 16:9 aspect ratio\n.embed-responsive-16by9 {\n  padding-bottom: 56.25%;\n}\n\n// Modifier class for 4:3 aspect ratio\n.embed-responsive-4by3 {\n  padding-bottom: 75%;\n}\n","//\n// Wells\n// --------------------------------------------------\n\n\n// Base class\n.well {\n  min-height: 20px;\n  padding: 19px;\n  margin-bottom: 20px;\n  background-color: @well-bg;\n  border: 1px solid @well-border;\n  border-radius: @border-radius-base;\n  .box-shadow(inset 0 1px 1px rgba(0,0,0,.05));\n  blockquote {\n    border-color: #ddd;\n    border-color: rgba(0,0,0,.15);\n  }\n}\n\n// Sizes\n.well-lg {\n  padding: 24px;\n  border-radius: @border-radius-large;\n}\n.well-sm {\n  padding: 9px;\n  border-radius: @border-radius-small;\n}\n","//\n// Close icons\n// --------------------------------------------------\n\n\n.close {\n  float: right;\n  font-size: (@font-size-base * 1.5);\n  font-weight: @close-font-weight;\n  line-height: 1;\n  color: @close-color;\n  text-shadow: @close-text-shadow;\n  .opacity(.2);\n\n  &:hover,\n  &:focus {\n    color: @close-color;\n    text-decoration: none;\n    cursor: pointer;\n    .opacity(.5);\n  }\n\n  // Additional properties for button version\n  // iOS requires the button element instead of an anchor tag.\n  // If you want the anchor version, it requires `href=\"#\"`.\n  // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile\n  button& {\n    padding: 0;\n    cursor: pointer;\n    background: transparent;\n    border: 0;\n    -webkit-appearance: none;\n  }\n}\n","//\n// Modals\n// --------------------------------------------------\n\n// .modal-open      - body class for killing the scroll\n// .modal           - container to scroll within\n// .modal-dialog    - positioning shell for the actual modal\n// .modal-content   - actual modal w/ bg and corners and shit\n\n// Kill the scroll on the body\n.modal-open {\n  overflow: hidden;\n}\n\n// Container that the modal scrolls within\n.modal {\n  display: none;\n  overflow: hidden;\n  position: fixed;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  z-index: @zindex-modal;\n  -webkit-overflow-scrolling: touch;\n\n  // Prevent Chrome on Windows from adding a focus outline. For details, see\n  // https://github.com/twbs/bootstrap/pull/10951.\n  outline: 0;\n\n  // When fading in the modal, animate it to slide down\n  &.fade .modal-dialog {\n    .translate(0, -25%);\n    .transition-transform(~\"0.3s ease-out\");\n  }\n  &.in .modal-dialog { .translate(0, 0) }\n}\n.modal-open .modal {\n  overflow-x: hidden;\n  overflow-y: auto;\n}\n\n// Shell div to position the modal with bottom padding\n.modal-dialog {\n  position: relative;\n  width: auto;\n  margin: 10px;\n}\n\n// Actual modal\n.modal-content {\n  position: relative;\n  background-color: @modal-content-bg;\n  border: 1px solid @modal-content-fallback-border-color; //old browsers fallback (ie8 etc)\n  border: 1px solid @modal-content-border-color;\n  border-radius: @border-radius-large;\n  .box-shadow(0 3px 9px rgba(0,0,0,.5));\n  background-clip: padding-box;\n  // Remove focus outline from opened modal\n  outline: 0;\n}\n\n// Modal background\n.modal-backdrop {\n  position: fixed;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  z-index: @zindex-modal-background;\n  background-color: @modal-backdrop-bg;\n  // Fade for backdrop\n  &.fade { .opacity(0); }\n  &.in { .opacity(@modal-backdrop-opacity); }\n}\n\n// Modal header\n// Top section of the modal w/ title and dismiss\n.modal-header {\n  padding: @modal-title-padding;\n  border-bottom: 1px solid @modal-header-border-color;\n  &:extend(.clearfix all);\n}\n// Close icon\n.modal-header .close {\n  margin-top: -2px;\n}\n\n// Title text within header\n.modal-title {\n  margin: 0;\n  line-height: @modal-title-line-height;\n}\n\n// Modal body\n// Where all modal content resides (sibling of .modal-header and .modal-footer)\n.modal-body {\n  position: relative;\n  padding: @modal-inner-padding;\n}\n\n// Footer (for actions)\n.modal-footer {\n  padding: @modal-inner-padding;\n  text-align: right; // right align buttons\n  border-top: 1px solid @modal-footer-border-color;\n  &:extend(.clearfix all); // clear it in case folks use .pull-* classes on buttons\n\n  // Properly space out buttons\n  .btn + .btn {\n    margin-left: 5px;\n    margin-bottom: 0; // account for input[type=\"submit\"] which gets the bottom margin like all other inputs\n  }\n  // but override that for button groups\n  .btn-group .btn + .btn {\n    margin-left: -1px;\n  }\n  // and override it for block buttons as well\n  .btn-block + .btn-block {\n    margin-left: 0;\n  }\n}\n\n// Measure scrollbar width for padding body during modal show/hide\n.modal-scrollbar-measure {\n  position: absolute;\n  top: -9999px;\n  width: 50px;\n  height: 50px;\n  overflow: scroll;\n}\n\n// Scale up the modal\n@media (min-width: @screen-sm-min) {\n  // Automatically set modal's width for larger viewports\n  .modal-dialog {\n    width: @modal-md;\n    margin: 30px auto;\n  }\n  .modal-content {\n    .box-shadow(0 5px 15px rgba(0,0,0,.5));\n  }\n\n  // Modal sizes\n  .modal-sm { width: @modal-sm; }\n}\n\n@media (min-width: @screen-md-min) {\n  .modal-lg { width: @modal-lg; }\n}\n","//\n// Tooltips\n// --------------------------------------------------\n\n\n// Base class\n.tooltip {\n  position: absolute;\n  z-index: @zindex-tooltip;\n  display: block;\n  // Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element.\n  // So reset our font and text properties to avoid inheriting weird values.\n  .reset-text();\n  font-size: @font-size-small;\n\n  .opacity(0);\n\n  &.in     { .opacity(@tooltip-opacity); }\n  &.top    { margin-top:  -3px; padding: @tooltip-arrow-width 0; }\n  &.right  { margin-left:  3px; padding: 0 @tooltip-arrow-width; }\n  &.bottom { margin-top:   3px; padding: @tooltip-arrow-width 0; }\n  &.left   { margin-left: -3px; padding: 0 @tooltip-arrow-width; }\n}\n\n// Wrapper for the tooltip content\n.tooltip-inner {\n  max-width: @tooltip-max-width;\n  padding: 3px 8px;\n  color: @tooltip-color;\n  text-align: center;\n  background-color: @tooltip-bg;\n  border-radius: @border-radius-base;\n}\n\n// Arrows\n.tooltip-arrow {\n  position: absolute;\n  width: 0;\n  height: 0;\n  border-color: transparent;\n  border-style: solid;\n}\n// Note: Deprecated .top-left, .top-right, .bottom-left, and .bottom-right as of v3.3.1\n.tooltip {\n  &.top .tooltip-arrow {\n    bottom: 0;\n    left: 50%;\n    margin-left: -@tooltip-arrow-width;\n    border-width: @tooltip-arrow-width @tooltip-arrow-width 0;\n    border-top-color: @tooltip-arrow-color;\n  }\n  &.top-left .tooltip-arrow {\n    bottom: 0;\n    right: @tooltip-arrow-width;\n    margin-bottom: -@tooltip-arrow-width;\n    border-width: @tooltip-arrow-width @tooltip-arrow-width 0;\n    border-top-color: @tooltip-arrow-color;\n  }\n  &.top-right .tooltip-arrow {\n    bottom: 0;\n    left: @tooltip-arrow-width;\n    margin-bottom: -@tooltip-arrow-width;\n    border-width: @tooltip-arrow-width @tooltip-arrow-width 0;\n    border-top-color: @tooltip-arrow-color;\n  }\n  &.right .tooltip-arrow {\n    top: 50%;\n    left: 0;\n    margin-top: -@tooltip-arrow-width;\n    border-width: @tooltip-arrow-width @tooltip-arrow-width @tooltip-arrow-width 0;\n    border-right-color: @tooltip-arrow-color;\n  }\n  &.left .tooltip-arrow {\n    top: 50%;\n    right: 0;\n    margin-top: -@tooltip-arrow-width;\n    border-width: @tooltip-arrow-width 0 @tooltip-arrow-width @tooltip-arrow-width;\n    border-left-color: @tooltip-arrow-color;\n  }\n  &.bottom .tooltip-arrow {\n    top: 0;\n    left: 50%;\n    margin-left: -@tooltip-arrow-width;\n    border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;\n    border-bottom-color: @tooltip-arrow-color;\n  }\n  &.bottom-left .tooltip-arrow {\n    top: 0;\n    right: @tooltip-arrow-width;\n    margin-top: -@tooltip-arrow-width;\n    border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;\n    border-bottom-color: @tooltip-arrow-color;\n  }\n  &.bottom-right .tooltip-arrow {\n    top: 0;\n    left: @tooltip-arrow-width;\n    margin-top: -@tooltip-arrow-width;\n    border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;\n    border-bottom-color: @tooltip-arrow-color;\n  }\n}\n",".reset-text() {\n  font-family: @font-family-base;\n  // We deliberately do NOT reset font-size.\n  font-style: normal;\n  font-weight: normal;\n  letter-spacing: normal;\n  line-break: auto;\n  line-height: @line-height-base;\n  text-align: left; // Fallback for where `start` is not supported\n  text-align: start;\n  text-decoration: none;\n  text-shadow: none;\n  text-transform: none;\n  white-space: normal;\n  word-break: normal;\n  word-spacing: normal;\n  word-wrap: normal;\n}\n","//\n// Popovers\n// --------------------------------------------------\n\n\n.popover {\n  position: absolute;\n  top: 0;\n  left: 0;\n  z-index: @zindex-popover;\n  display: none;\n  max-width: @popover-max-width;\n  padding: 1px;\n  // Our parent element can be arbitrary since popovers are by default inserted as a sibling of their target element.\n  // So reset our font and text properties to avoid inheriting weird values.\n  .reset-text();\n  font-size: @font-size-base;\n\n  background-color: @popover-bg;\n  background-clip: padding-box;\n  border: 1px solid @popover-fallback-border-color;\n  border: 1px solid @popover-border-color;\n  border-radius: @border-radius-large;\n  .box-shadow(0 5px 10px rgba(0,0,0,.2));\n\n  // Offset the popover to account for the popover arrow\n  &.top     { margin-top: -@popover-arrow-width; }\n  &.right   { margin-left: @popover-arrow-width; }\n  &.bottom  { margin-top: @popover-arrow-width; }\n  &.left    { margin-left: -@popover-arrow-width; }\n}\n\n.popover-title {\n  margin: 0; // reset heading margin\n  padding: 8px 14px;\n  font-size: @font-size-base;\n  background-color: @popover-title-bg;\n  border-bottom: 1px solid darken(@popover-title-bg, 5%);\n  border-radius: (@border-radius-large - 1) (@border-radius-large - 1) 0 0;\n}\n\n.popover-content {\n  padding: 9px 14px;\n}\n\n// Arrows\n//\n// .arrow is outer, .arrow:after is inner\n\n.popover > .arrow {\n  &,\n  &:after {\n    position: absolute;\n    display: block;\n    width: 0;\n    height: 0;\n    border-color: transparent;\n    border-style: solid;\n  }\n}\n.popover > .arrow {\n  border-width: @popover-arrow-outer-width;\n}\n.popover > .arrow:after {\n  border-width: @popover-arrow-width;\n  content: \"\";\n}\n\n.popover {\n  &.top > .arrow {\n    left: 50%;\n    margin-left: -@popover-arrow-outer-width;\n    border-bottom-width: 0;\n    border-top-color: @popover-arrow-outer-fallback-color; // IE8 fallback\n    border-top-color: @popover-arrow-outer-color;\n    bottom: -@popover-arrow-outer-width;\n    &:after {\n      content: \" \";\n      bottom: 1px;\n      margin-left: -@popover-arrow-width;\n      border-bottom-width: 0;\n      border-top-color: @popover-arrow-color;\n    }\n  }\n  &.right > .arrow {\n    top: 50%;\n    left: -@popover-arrow-outer-width;\n    margin-top: -@popover-arrow-outer-width;\n    border-left-width: 0;\n    border-right-color: @popover-arrow-outer-fallback-color; // IE8 fallback\n    border-right-color: @popover-arrow-outer-color;\n    &:after {\n      content: \" \";\n      left: 1px;\n      bottom: -@popover-arrow-width;\n      border-left-width: 0;\n      border-right-color: @popover-arrow-color;\n    }\n  }\n  &.bottom > .arrow {\n    left: 50%;\n    margin-left: -@popover-arrow-outer-width;\n    border-top-width: 0;\n    border-bottom-color: @popover-arrow-outer-fallback-color; // IE8 fallback\n    border-bottom-color: @popover-arrow-outer-color;\n    top: -@popover-arrow-outer-width;\n    &:after {\n      content: \" \";\n      top: 1px;\n      margin-left: -@popover-arrow-width;\n      border-top-width: 0;\n      border-bottom-color: @popover-arrow-color;\n    }\n  }\n\n  &.left > .arrow {\n    top: 50%;\n    right: -@popover-arrow-outer-width;\n    margin-top: -@popover-arrow-outer-width;\n    border-right-width: 0;\n    border-left-color: @popover-arrow-outer-fallback-color; // IE8 fallback\n    border-left-color: @popover-arrow-outer-color;\n    &:after {\n      content: \" \";\n      right: 1px;\n      border-right-width: 0;\n      border-left-color: @popover-arrow-color;\n      bottom: -@popover-arrow-width;\n    }\n  }\n}\n","//\n// Carousel\n// --------------------------------------------------\n\n\n// Wrapper for the slide container and indicators\n.carousel {\n  position: relative;\n}\n\n.carousel-inner {\n  position: relative;\n  overflow: hidden;\n  width: 100%;\n\n  > .item {\n    display: none;\n    position: relative;\n    .transition(.6s ease-in-out left);\n\n    // Account for jankitude on images\n    > img,\n    > a > img {\n      &:extend(.img-responsive);\n      line-height: 1;\n    }\n\n    // WebKit CSS3 transforms for supported devices\n    @media all and (transform-3d), (-webkit-transform-3d) {\n      .transition-transform(~'0.6s ease-in-out');\n      .backface-visibility(~'hidden');\n      .perspective(1000px);\n\n      &.next,\n      &.active.right {\n        .translate3d(100%, 0, 0);\n        left: 0;\n      }\n      &.prev,\n      &.active.left {\n        .translate3d(-100%, 0, 0);\n        left: 0;\n      }\n      &.next.left,\n      &.prev.right,\n      &.active {\n        .translate3d(0, 0, 0);\n        left: 0;\n      }\n    }\n  }\n\n  > .active,\n  > .next,\n  > .prev {\n    display: block;\n  }\n\n  > .active {\n    left: 0;\n  }\n\n  > .next,\n  > .prev {\n    position: absolute;\n    top: 0;\n    width: 100%;\n  }\n\n  > .next {\n    left: 100%;\n  }\n  > .prev {\n    left: -100%;\n  }\n  > .next.left,\n  > .prev.right {\n    left: 0;\n  }\n\n  > .active.left {\n    left: -100%;\n  }\n  > .active.right {\n    left: 100%;\n  }\n\n}\n\n// Left/right controls for nav\n// ---------------------------\n\n.carousel-control {\n  position: absolute;\n  top: 0;\n  left: 0;\n  bottom: 0;\n  width: @carousel-control-width;\n  .opacity(@carousel-control-opacity);\n  font-size: @carousel-control-font-size;\n  color: @carousel-control-color;\n  text-align: center;\n  text-shadow: @carousel-text-shadow;\n  background-color: rgba(0, 0, 0, 0); // Fix IE9 click-thru bug\n  // We can't have this transition here because WebKit cancels the carousel\n  // animation if you trip this while in the middle of another animation.\n\n  // Set gradients for backgrounds\n  &.left {\n    #gradient > .horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001));\n  }\n  &.right {\n    left: auto;\n    right: 0;\n    #gradient > .horizontal(@start-color: rgba(0,0,0,.0001); @end-color: rgba(0,0,0,.5));\n  }\n\n  // Hover/focus state\n  &:hover,\n  &:focus {\n    outline: 0;\n    color: @carousel-control-color;\n    text-decoration: none;\n    .opacity(.9);\n  }\n\n  // Toggles\n  .icon-prev,\n  .icon-next,\n  .glyphicon-chevron-left,\n  .glyphicon-chevron-right {\n    position: absolute;\n    top: 50%;\n    margin-top: -10px;\n    z-index: 5;\n    display: inline-block;\n  }\n  .icon-prev,\n  .glyphicon-chevron-left {\n    left: 50%;\n    margin-left: -10px;\n  }\n  .icon-next,\n  .glyphicon-chevron-right {\n    right: 50%;\n    margin-right: -10px;\n  }\n  .icon-prev,\n  .icon-next {\n    width:  20px;\n    height: 20px;\n    line-height: 1;\n    font-family: serif;\n  }\n\n\n  .icon-prev {\n    &:before {\n      content: '\\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039)\n    }\n  }\n  .icon-next {\n    &:before {\n      content: '\\203a';// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (U+203A)\n    }\n  }\n}\n\n// Optional indicator pips\n//\n// Add an unordered list with the following class and add a list item for each\n// slide your carousel holds.\n\n.carousel-indicators {\n  position: absolute;\n  bottom: 10px;\n  left: 50%;\n  z-index: 15;\n  width: 60%;\n  margin-left: -30%;\n  padding-left: 0;\n  list-style: none;\n  text-align: center;\n\n  li {\n    display: inline-block;\n    width:  10px;\n    height: 10px;\n    margin: 1px;\n    text-indent: -999px;\n    border: 1px solid @carousel-indicator-border-color;\n    border-radius: 10px;\n    cursor: pointer;\n\n    // IE8-9 hack for event handling\n    //\n    // Internet Explorer 8-9 does not support clicks on elements without a set\n    // `background-color`. We cannot use `filter` since that's not viewed as a\n    // background color by the browser. Thus, a hack is needed.\n    // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Internet_Explorer\n    //\n    // For IE8, we set solid black as it doesn't support `rgba()`. For IE9, we\n    // set alpha transparency for the best results possible.\n    background-color: #000 \\9; // IE8\n    background-color: rgba(0,0,0,0); // IE9\n  }\n  .active {\n    margin: 0;\n    width:  12px;\n    height: 12px;\n    background-color: @carousel-indicator-active-bg;\n  }\n}\n\n// Optional captions\n// -----------------------------\n// Hidden by default for smaller viewports\n.carousel-caption {\n  position: absolute;\n  left: 15%;\n  right: 15%;\n  bottom: 20px;\n  z-index: 10;\n  padding-top: 20px;\n  padding-bottom: 20px;\n  color: @carousel-caption-color;\n  text-align: center;\n  text-shadow: @carousel-text-shadow;\n  & .btn {\n    text-shadow: none; // No shadow for button elements in carousel-caption\n  }\n}\n\n\n// Scale up controls for tablets and up\n@media screen and (min-width: @screen-sm-min) {\n\n  // Scale up the controls a smidge\n  .carousel-control {\n    .glyphicon-chevron-left,\n    .glyphicon-chevron-right,\n    .icon-prev,\n    .icon-next {\n      width: (@carousel-control-font-size * 1.5);\n      height: (@carousel-control-font-size * 1.5);\n      margin-top: (@carousel-control-font-size / -2);\n      font-size: (@carousel-control-font-size * 1.5);\n    }\n    .glyphicon-chevron-left,\n    .icon-prev {\n      margin-left: (@carousel-control-font-size / -2);\n    }\n    .glyphicon-chevron-right,\n    .icon-next {\n      margin-right: (@carousel-control-font-size / -2);\n    }\n  }\n\n  // Show and left align the captions\n  .carousel-caption {\n    left: 20%;\n    right: 20%;\n    padding-bottom: 30px;\n  }\n\n  // Move up the indicators\n  .carousel-indicators {\n    bottom: 20px;\n  }\n}\n","// Clearfix\n//\n// For modern browsers\n// 1. The space content is one way to avoid an Opera bug when the\n//    contenteditable attribute is included anywhere else in the document.\n//    Otherwise it causes space to appear at the top and bottom of elements\n//    that are clearfixed.\n// 2. The use of `table` rather than `block` is only necessary if using\n//    `:before` to contain the top-margins of child elements.\n//\n// Source: http://nicolasgallagher.com/micro-clearfix-hack/\n\n.clearfix() {\n  &:before,\n  &:after {\n    content: \" \"; // 1\n    display: table; // 2\n  }\n  &:after {\n    clear: both;\n  }\n}\n","// Center-align a block level element\n\n.center-block() {\n  display: block;\n  margin-left: auto;\n  margin-right: auto;\n}\n","// CSS image replacement\n//\n// Heads up! v3 launched with only `.hide-text()`, but per our pattern for\n// mixins being reused as classes with the same name, this doesn't hold up. As\n// of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`.\n//\n// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757\n\n// Deprecated as of v3.0.1 (has been removed in v4)\n.hide-text() {\n  font: ~\"0/0\" a;\n  color: transparent;\n  text-shadow: none;\n  background-color: transparent;\n  border: 0;\n}\n\n// New mixin to use as of v3.0.1\n.text-hide() {\n  .hide-text();\n}\n","//\n// Responsive: Utility classes\n// --------------------------------------------------\n\n\n// IE10 in Windows (Phone) 8\n//\n// Support for responsive views via media queries is kind of borked in IE10, for\n// Surface/desktop in split view and for Windows Phone 8. This particular fix\n// must be accompanied by a snippet of JavaScript to sniff the user agent and\n// apply some conditional CSS to *only* the Surface/desktop Windows 8. Look at\n// our Getting Started page for more information on this bug.\n//\n// For more information, see the following:\n//\n// Issue: https://github.com/twbs/bootstrap/issues/10497\n// Docs: http://getbootstrap.com/getting-started/#support-ie10-width\n// Source: http://timkadlec.com/2013/01/windows-phone-8-and-device-width/\n// Source: http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/\n\n@-ms-viewport {\n  width: device-width;\n}\n\n\n// Visibility utilities\n// Note: Deprecated .visible-xs, .visible-sm, .visible-md, and .visible-lg as of v3.2.0\n.visible-xs,\n.visible-sm,\n.visible-md,\n.visible-lg {\n  .responsive-invisibility();\n}\n\n.visible-xs-block,\n.visible-xs-inline,\n.visible-xs-inline-block,\n.visible-sm-block,\n.visible-sm-inline,\n.visible-sm-inline-block,\n.visible-md-block,\n.visible-md-inline,\n.visible-md-inline-block,\n.visible-lg-block,\n.visible-lg-inline,\n.visible-lg-inline-block {\n  display: none !important;\n}\n\n.visible-xs {\n  @media (max-width: @screen-xs-max) {\n    .responsive-visibility();\n  }\n}\n.visible-xs-block {\n  @media (max-width: @screen-xs-max) {\n    display: block !important;\n  }\n}\n.visible-xs-inline {\n  @media (max-width: @screen-xs-max) {\n    display: inline !important;\n  }\n}\n.visible-xs-inline-block {\n  @media (max-width: @screen-xs-max) {\n    display: inline-block !important;\n  }\n}\n\n.visible-sm {\n  @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {\n    .responsive-visibility();\n  }\n}\n.visible-sm-block {\n  @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {\n    display: block !important;\n  }\n}\n.visible-sm-inline {\n  @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {\n    display: inline !important;\n  }\n}\n.visible-sm-inline-block {\n  @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {\n    display: inline-block !important;\n  }\n}\n\n.visible-md {\n  @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {\n    .responsive-visibility();\n  }\n}\n.visible-md-block {\n  @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {\n    display: block !important;\n  }\n}\n.visible-md-inline {\n  @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {\n    display: inline !important;\n  }\n}\n.visible-md-inline-block {\n  @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {\n    display: inline-block !important;\n  }\n}\n\n.visible-lg {\n  @media (min-width: @screen-lg-min) {\n    .responsive-visibility();\n  }\n}\n.visible-lg-block {\n  @media (min-width: @screen-lg-min) {\n    display: block !important;\n  }\n}\n.visible-lg-inline {\n  @media (min-width: @screen-lg-min) {\n    display: inline !important;\n  }\n}\n.visible-lg-inline-block {\n  @media (min-width: @screen-lg-min) {\n    display: inline-block !important;\n  }\n}\n\n.hidden-xs {\n  @media (max-width: @screen-xs-max) {\n    .responsive-invisibility();\n  }\n}\n.hidden-sm {\n  @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {\n    .responsive-invisibility();\n  }\n}\n.hidden-md {\n  @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {\n    .responsive-invisibility();\n  }\n}\n.hidden-lg {\n  @media (min-width: @screen-lg-min) {\n    .responsive-invisibility();\n  }\n}\n\n\n// Print utilities\n//\n// Media queries are placed on the inside to be mixin-friendly.\n\n// Note: Deprecated .visible-print as of v3.2.0\n.visible-print {\n  .responsive-invisibility();\n\n  @media print {\n    .responsive-visibility();\n  }\n}\n.visible-print-block {\n  display: none !important;\n\n  @media print {\n    display: block !important;\n  }\n}\n.visible-print-inline {\n  display: none !important;\n\n  @media print {\n    display: inline !important;\n  }\n}\n.visible-print-inline-block {\n  display: none !important;\n\n  @media print {\n    display: inline-block !important;\n  }\n}\n\n.hidden-print {\n  @media print {\n    .responsive-invisibility();\n  }\n}\n","// Responsive utilities\n\n//\n// More easily include all the states for responsive-utilities.less.\n.responsive-visibility() {\n  display: block !important;\n  table&  { display: table !important; }\n  tr&     { display: table-row !important; }\n  th&,\n  td&     { display: table-cell !important; }\n}\n\n.responsive-invisibility() {\n  display: none !important;\n}\n"]}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.min.css b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.min.css
deleted file mode 100644
index 4cf729e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.min.css
+++ /dev/null
@@ -1,6 +0,0 @@
-/*!
- * Bootstrap v3.3.6 (http://getbootstrap.com)
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}
-/*# sourceMappingURL=bootstrap.min.css.map */
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.min.css.map b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.min.css.map
deleted file mode 100644
index 5f49bb3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/css/bootstrap.min.css.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["less/normalize.less","less/print.less","bootstrap.css","dist/css/bootstrap.css","less/glyphicons.less","less/scaffolding.less","less/mixins/vendor-prefixes.less","less/mixins/tab-focus.less","less/mixins/image.less","less/type.less","less/mixins/text-emphasis.less","less/mixins/background-variant.less","less/mixins/text-overflow.less","less/code.less","less/grid.less","less/mixins/grid.less","less/mixins/grid-framework.less","less/tables.less","less/mixins/table-row.less","less/forms.less","less/mixins/forms.less","less/buttons.less","less/mixins/buttons.less","less/mixins/opacity.less","less/component-animations.less","less/dropdowns.less","less/mixins/nav-divider.less","less/mixins/reset-filter.less","less/button-groups.less","less/mixins/border-radius.less","less/input-groups.less","less/navs.less","less/navbar.less","less/mixins/nav-vertical-align.less","less/utilities.less","less/breadcrumbs.less","less/pagination.less","less/mixins/pagination.less","less/pager.less","less/labels.less","less/mixins/labels.less","less/badges.less","less/jumbotron.less","less/thumbnails.less","less/alerts.less","less/mixins/alerts.less","less/progress-bars.less","less/mixins/gradients.less","less/mixins/progress-bar.less","less/media.less","less/list-group.less","less/mixins/list-group.less","less/panels.less","less/mixins/panels.less","less/responsive-embed.less","less/wells.less","less/close.less","less/modals.less","less/tooltip.less","less/mixins/reset-text.less","less/popovers.less","less/carousel.less","less/mixins/clearfix.less","less/mixins/center-block.less","less/mixins/hide-text.less","less/responsive-utilities.less","less/mixins/responsive-visibility.less"],"names":[],"mappings":"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DG,edkkDH,MAAA,aclkDG,edqkDH,MAAA,acrkDG,edwkDH,MAAA,IcxkDG,ed2kDH,MAAA,ac3kDG,ed8kDH,MAAA,ac9kDG,edilDH,MAAA,IcjlDG,edolDH,MAAA,ac/kDG,edklDH,MAAA,YcjmDG,edomDH,MAAA,KcpmDG,gBdumDH,KAAA,KcvmDG,gBd0mDH,KAAA,ac1mDG,gBd6mDH,KAAA,ac7mDG,edgnDH,KAAA,IchnDG,edmnDH,KAAA,acnnDG,edsnDH,KAAA,actnDG,edynDH,KAAA,IcznDG,ed4nDH,KAAA,ac5nDG,ed+nDH,KAAA,ac/nDG,edkoDH,KAAA,IcloDG,edqoDH,KAAA,achoDG,edmoDH,KAAA,YcpnDG,edunDH,KAAA,KcvnDG,kBd0nDH,YAAA,Kc1nDG,kBd6nDH,YAAA,ac7nDG,kBdgoDH,YAAA,achoDG,iBdmoDH,YAAA,IcnoDG,iBdsoDH,YAAA,actoDG,iBdyoDH,YAAA,aczoDG,iBd4oDH,YAAA,Ic5oDG,iBd+oDH,YAAA,ac/oDG,iBdkpDH,YAAA,aclpDG,iBdqpDH,YAAA,IcrpDG,iBdwpDH,YAAA,acxpDG,iBd2pDH,YAAA,Yc7rDG,iBACE,YAAA,EAOJ,yBACE,UAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,Ud2rDD,MAAA,Kc3rDC,Wd8rDD,MAAA,Kc9rDC,WdisDD,MAAA,acjsDC,WdosDD,MAAA,acpsDC,UdusDD,MAAA,IcvsDC,Ud0sDD,MAAA,ac1sDC,Ud6sDD,MAAA,ac7sDC,UdgtDD,MAAA,IchtDC,UdmtDD,MAAA,acntDC,UdstDD,MAAA,acttDC,UdytDD,MAAA,IcztDC,Ud4tDD,MAAA,ac7sDC,UdgtDD,MAAA,YchtDC,gBdmtDD,MAAA,KcntDC,gBdstDD,MAAA,acttDC,gBdytDD,MAAA,acztDC,ed4tDD,MAAA,Ic5tDC,ed+tDD,MAAA,ac/tDC,edkuDD,MAAA,acluDC,edquDD,MAAA,IcruDC,edwuDD,MAAA,acxuDC,ed2uDD,MAAA,ac3uDC,ed8uDD,MAAA,Ic9uDC,edivDD,MAAA,ac5uDC,ed+uDD,MAAA,Yc9vDC,ediwDD,MAAA,KcjwDC,gBdowDD,KAAA,KcpwDC,gBduwDD,KAAA,acvwDC,gBd0wDD,KAAA,ac1wDC,ed6wDD,KAAA,Ic7wDC,edgxDD,KAAA,achxDC,edmxDD,KAAA,acnxDC,edsxDD,KAAA,IctxDC,edyxDD,KAAA,aczxDC,ed4xDD,KAAA,ac5xDC,ed+xDD,KAAA,Ic/xDC,edkyDD,KAAA,ac7xDC,edgyDD,KAAA,YcjxDC,edoxDD,KAAA,KcpxDC,kBduxDD,YAAA,KcvxDC,kBd0xDD,YAAA,ac1xDC,kBd6xDD,YAAA,ac7xDC,iBdgyDD,YAAA,IchyDC,iBdmyDD,YAAA,acnyDC,iBdsyDD,YAAA,actyDC,iBdyyDD,YAAA,IczyDC,iBd4yDD,YAAA,ac5yDC,iBd+yDD,YAAA,ac/yDC,iBdkzDD,YAAA,IclzDC,iBdqzDD,YAAA,acrzDC,iBdwzDD,YAAA,YY/yDD,iBE3CE,YAAA,GAQF,yBACE,UAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,Udy1DD,MAAA,Kcz1DC,Wd41DD,MAAA,Kc51DC,Wd+1DD,MAAA,ac/1DC,Wdk2DD,MAAA,acl2DC,Udq2DD,MAAA,Icr2DC,Udw2DD,MAAA,acx2DC,Ud22DD,MAAA,ac32DC,Ud82DD,MAAA,Ic92DC,Udi3DD,MAAA,acj3DC,Udo3DD,MAAA,acp3DC,Udu3DD,MAAA,Icv3DC,Ud03DD,MAAA,ac32DC,Ud82DD,MAAA,Yc92DC,gBdi3DD,MAAA,Kcj3DC,gBdo3DD,MAAA,acp3DC,gBdu3DD,MAAA,acv3DC,ed03DD,MAAA,Ic13DC,ed63DD,MAAA,ac73DC,edg4DD,MAAA,ach4DC,edm4DD,MAAA,Icn4DC,eds4DD,MAAA,act4DC,edy4DD,MAAA,acz4DC,ed44DD,MAAA,Ic54DC,ed+4DD,MAAA,ac14DC,ed64DD,MAAA,Yc55DC,ed+5DD,MAAA,Kc/5DC,gBdk6DD,KAAA,Kcl6DC,gBdq6DD,KAAA,acr6DC,gBdw6DD,KAAA,acx6DC,ed26DD,KAAA,Ic36DC,ed86DD,KAAA,ac96DC,edi7DD,KAAA,acj7DC,edo7DD,KAAA,Icp7DC,edu7DD,KAAA,acv7DC,ed07DD,KAAA,ac17DC,ed67DD,KAAA,Ic77DC,edg8DD,KAAA,ac37DC,ed87DD,KAAA,Yc/6DC,edk7DD,KAAA,Kcl7DC,kBdq7DD,YAAA,Kcr7DC,kBdw7DD,YAAA,acx7DC,kBd27DD,YAAA,ac37DC,iBd87DD,YAAA,Ic97DC,iBdi8DD,YAAA,acj8DC,iBdo8DD,YAAA,acp8DC,iBdu8DD,YAAA,Icv8DC,iBd08DD,YAAA,ac18DC,iBd68DD,YAAA,ac78DC,iBdg9DD,YAAA,Ich9DC,iBdm9DD,YAAA,acn9DC,iBds9DD,YAAA,YY18DD,iBE9CE,YAAA,GAQF,0BACE,UAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,Udu/DD,MAAA,Kcv/DC,Wd0/DD,MAAA,Kc1/DC,Wd6/DD,MAAA,ac7/DC,WdggED,MAAA,achgEC,UdmgED,MAAA,IcngEC,UdsgED,MAAA,actgEC,UdygED,MAAA,aczgEC,Ud4gED,MAAA,Ic5gEC,Ud+gED,MAAA,ac/gEC,UdkhED,MAAA,aclhEC,UdqhED,MAAA,IcrhEC,UdwhED,MAAA,aczgEC,Ud4gED,MAAA,Yc5gEC,gBd+gED,MAAA,Kc/gEC,gBdkhED,MAAA,aclhEC,gBdqhED,MAAA,acrhEC,edwhED,MAAA,IcxhEC,ed2hED,MAAA,ac3hEC,ed8hED,MAAA,ac9hEC,ediiED,MAAA,IcjiEC,edoiED,MAAA,acpiEC,eduiED,MAAA,acviEC,ed0iED,MAAA,Ic1iEC,ed6iED,MAAA,acxiEC,ed2iED,MAAA,Yc1jEC,ed6jED,MAAA,Kc7jEC,gBdgkED,KAAA,KchkEC,gBdmkED,KAAA,acnkEC,gBdskED,KAAA,actkEC,edykED,KAAA,IczkEC,ed4kED,KAAA,ac5kEC,ed+kED,KAAA,ac/kEC,edklED,KAAA,IcllEC,edqlED,KAAA,acrlEC,edwlED,KAAA,acxlEC,ed2lED,KAAA,Ic3lEC,ed8lED,KAAA,aczlEC,ed4lED,KAAA,Yc7kEC,e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pC,cAGA,ejB8DA,wBACQ,OAAA,YJ65FT,OAAA,kBmB56FG,mBAAA,KlBw7FM,WAAY,KkBt7FhB,QAAA,IASN,eC3DE,yBACA,eAAA,KpBo+FD,aoBj+FC,MAAA,KnB6+FA,iBAAkB,KmB3+FhB,aAAA,KpBq+FH,mBoBn+FO,mBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpBo+FH,mBoBj+FC,MAAA,KnB6+FA,iBAAkB,QAClB,aAAc,QmBz+FR,oBADJ,oBpBo+FH,mCoBj+FG,MAAA,KnB6+FF,iBAAkB,QAClB,aAAc,QmBz+FN,0BnB++FV,0BAHA,0BmB7+FM,0BnB++FN,0BAHA,0BDFC,yCoB3+FK,yCnB++FN,yCmB1+FE,MAAA,KnBk/FA,iBAAkB,QAClB,aAAc,QmB3+FZ,oBpBm+FH,oBoBn+FG,mCnBg/FF,iBAAkB,KmB5+FV,4BnBi/FV,4BAHA,4BDHC,6BCOD,6BAHA,6BkB99FA,sCClBM,sCnBi/FN,sCmB3+FI,iBAAA,KACA,aAAA,KDcJ,oBC9DE,MAAA,KACA,iBAAA,KpB6hGD,aoB1hGC,MAAA,KnBsiGA,iBAAkB,QmBpiGhB,aAAA,QpB8hGH,mBoB5hGO,mBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpB6hGH,mBoB1hGC,MAAA,KnBsiGA,iBAAkB,QAClB,aAAc,QmBliGR,oBADJ,oBpB6hGH,mCoB1hGG,MAAA,KnBsiGF,iBAAkB,QAClB,aAAc,QmBliGN,0BnBwiGV,0BAHA,0BmBtiGM,0BnBwiGN,0BAHA,0BDFC,yCoBpiGK,yCnBwiGN,yCmBniGE,MAAA,KnB2iGA,iBAAkB,QAClB,aAAc,QmBpiGZ,oBpB4hGH,oBoB5hGG,mCnByiGF,iBAAkB,KmBriGV,4BnB0iGV,4BAHA,4BDHC,6BCOD,6BAHA,6BkBphGA,sCCrBM,sCnB0iGN,sCmBpiGI,iBAAA,QACA,aAAA,QDkBJ,oBClEE,MAAA,QACA,iBAAA,KpBslGD,aoBnlGC,MAAA,KnB+lGA,iBAAkB,QmB7lGhB,aAAA,QpBulGH,mBoBrlGO,mBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpBslGH,mBoBnlGC,MAAA,KnB+lGA,iBAAkB,QAClB,aAAc,QmB3lGR,oBADJ,oBpBslGH,mCoBnlGG,MAAA,KnB+lGF,iBAAkB,QAClB,aAAc,QmB3lGN,0BnBimGV,0BAHA,0BmB/lGM,0BnBimGN,0BAHA,0BDFC,yCoB7lGK,yCnBimGN,yCmB5lGE,MAAA,KnBomGA,iBAAkB,QAClB,aAAc,QmB7lGZ,oBpBqlGH,oBoBrlGG,mCnBkmGF,iBAAkB,KmB9lGV,4BnBmmGV,4BAHA,4BDHC,6BCOD,6BAHA,6BkBzkGA,sCCzBM,sCnBmmGN,sCmB7lGI,iBAAA,QACA,aAAA,QDsBJ,oBCtEE,MAAA,QACA,iBAAA,KpB+oGD,UoB5oGC,MAAA,KnBwpGA,iBAAkB,QmBtpGhB,aAAA,QpBgpGH,gBoB9oGO,gBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpB+oGH,gBoB5oGC,MAAA,KnBwpGA,iBAAkB,QAClB,aAAc,QmBppGR,iBADJ,iBpB+oGH,gCoB5oGG,MAAA,KnBwpGF,iBAAkB,QAClB,aAAc,QmBppGN,uBnB0pGV,uBAHA,uBmBxpGM,uBnB0pGN,uBAHA,uBDFC,sCoBtpGK,sCnB0pGN,sCmBrpGE,MAAA,KnB6pGA,iBAAkB,QAClB,aAAc,QmBtpGZ,iBpB8oGH,iBoB9oGG,gCnB2pGF,iBAAkB,KmBvpGV,yBnB4pGV,yBAHA,yBDHC,0BCOD,0BAHA,0BkB9nGA,mCC7BM,mCnB4pGN,mCmBtpGI,iBAAA,QACA,aAAA,QD0BJ,iBC1EE,MAAA,QACA,iBAAA,KpBwsGD,aoBrsGC,MAAA,KnBitGA,iBAAkB,QmB/sGhB,aAAA,QpBysGH,mBoBvsGO,mBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpBwsGH,mBoBrsGC,MAAA,KnBitGA,iBAAkB,QAClB,aAAc,QmB7sGR,oBADJ,oBpBwsGH,mCoBrsGG,MAAA,KnBitGF,iBAAkB,QAClB,aAAc,QmB7sGN,0BnBmtGV,0BAHA,0BmBjtGM,0BnBmtGN,0BAHA,0BDFC,yCoB/sGK,yCnBmtGN,yCmB9sGE,MAAA,KnBstGA,iBAAkB,QAClB,aAAc,QmB/sGZ,oBpBusGH,oBoBvsGG,mCnBotGF,iBAAkB,KmBhtGV,4BnBqtGV,4BAHA,4BDHC,6BCOD,6BAHA,6BkBnrGA,sCCjCM,sCnBqtGN,sCmB/sGI,iBAAA,QACA,aAAA,QD8BJ,oBC9EE,MAAA,QACA,iBAAA,KpBiwGD,YoB9vGC,MAAA,KnB0wGA,iBAAkB,QmBxwGhB,aAAA,QpBkwGH,kBoBhwGO,kBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpBiwGH,kBoB9vGC,MAAA,KnB0wGA,iBAAkB,QAClB,aAAc,QmBtwGR,mBADJ,mBpBiwGH,kCoB9vGG,MAAA,KnB0wGF,iBAAkB,QAClB,aAAc,QmBtwGN,yBnB4wGV,yBAHA,yBmB1wGM,yBnB4wGN,yBAHA,yBDFC,wCoBxwGK,wCnB4wGN,wCmBvwGE,MAAA,KnB+wGA,iBAAkB,QAClB,aAAc,QmBxwGZ,mBpBgwGH,mBoBhwGG,kCnB6wGF,iBAAkB,KmBzwGV,2BnB8wGV,2BAHA,2BDHC,4BCOD,4BAHA,4BkBxuGA,qCCrCM,qCnB8wGN,qCmBxwGI,iBAAA,QACA,aAAA,QDuCJ,mBACE,MAAA,QACA,iBAAA,KnBkuGD,UmB/tGC,YAAA,IlB2uGA,MAAO,QACP,cAAe,EAEjB,UG5wGE,iBemCE,iBflCM,oBJqwGT,6BmBhuGC,iBAAA,YlB4uGA,mBAAoB,KACZ,WAAY,KkBzuGlB,UAEF,iBAAA,gBnBguGD,gBmB9tGG,aAAA,YnBouGH,gBmBluGG,gBAIA,MAAA,QlB0uGF,gBAAiB,UACjB,iBAAkB,YDNnB,0BmBnuGK,0BAUN,mCATM,mClB8uGJ,MAAO,KmB7yGP,gBAAA,KAGA,mBADA,QpBsyGD,QAAA,KAAA,KmB5tGC,UAAW,KlBwuGX,YAAa,UmBpzGb,cAAA,IAGA,mBADA,QpB6yGD,QAAA,IAAA,KmB/tGC,UAAW,KlB2uGX,YAAa,ImB3zGb,cAAA,IAGA,mBADA,QpBozGD,QAAA,IAAA,ImB9tGC,UAAW,KACX,YAAA,IACA,cAAA,IAIF,WACE,QAAA,MnB8tGD,MAAA,KCYD,sBACE,WAAY,IqB53GZ,6BADF,4BtBq3GC,6BIhsGC,MAAA,KAEQ,MJosGT,QAAA,EsBx3GC,mBAAA,QAAA,KAAA,OACE,cAAA,QAAA,KAAA,OtB03GH,WAAA,QAAA,KAAA,OsBr3GC,StBw3GD,QAAA,EsBt3Ga,UtBy3Gb,QAAA,KsBx3Ga,atB23Gb,QAAA,MsB13Ga,etB63Gb,QAAA,UsBz3GC,kBACA,QAAA,gBlBwKA,YACQ,SAAA,SAAA,OAAA,EAOR,SAAA,OACQ,mCAAA,KAAA,8BAAA,KAGR,2BAAA,KACQ,4BAAA,KAAA,uBAAA,KJ8sGT,oBAAA,KuBx5GC,4BAA6B,OAAQ,WACrC,uBAAA,OAAA,WACA,oBAAA,OAAA,WAEA,OACA,QAAA,aACA,MAAA,EACA,OAAA,EACA,YAAA,IACA,eAAA,OvB05GD,WAAA,IAAA,OuBt5GC,WAAY,IAAI,QtBq6GhB,aAAc,IAAI,MAAM,YsBn6GxB,YAAA,IAAA,MAAA,YAKA,UADF,QvBu5GC,SAAA,SuBj5GC,uBACA,QAAA,EAEA,eACA,SAAA,SACA,IAAA,KACA,KAAA,EACA,QAAA,KACA,QAAA,KACA,MAAA,KACA,UAAA,MACA,QAAA,IAAA,EACA,OAAA,IAAA,EAAA,EACA,UAAA,KACA,WAAA,KACA,WAAA,KnBsBA,iBAAA,KACQ,wBAAA,YmBrBR,gBAAA,YtBk6GA,OsBl6GA,IAAA,MAAA,KvBq5GD,OAAA,IAAA,MAAA,gBuBh5GC,cAAA,IACE,mBAAA,EAAA,IAAA,KAAA,iBACA,WAAA,EAAA,IAAA,KAAA,iBAzBJ,0BCzBE,MAAA,EACA,KAAA,KAEA,wBxBu8GD,OAAA,IuBj7GC,OAAQ,IAAI,EAmCV,SAAA,OACA,iBAAA,QAEA,oBACA,QAAA,MACA,QAAA,IAAA,KACA,MAAA,KvBi5GH,YAAA,IuB34GC,YAAA,WtB25GA,MAAO,KsBz5GL,YAAA,OvB+4GH,0BuB74GG,0BAMF,MAAA,QtBu5GA,gBAAiB,KACjB,iBAAkB,QsBp5GhB,yBAEA,+BADA,+BvB04GH,MAAA,KuBh4GC,gBAAA,KtBg5GA,iBAAkB,QAClB,QAAS,EDZV,2BuB93GC,iCAAA,iCAEE,MAAA,KEzGF,iCF2GE,iCAEA,gBAAA,KvBg4GH,OAAA,YuB33GC,iBAAkB,YAGhB,iBAAA,KvB23GH,OAAA,0DuBt3GG,qBvBy3GH,QAAA,MuBh3GC,QACA,QAAA,EAQF,qBACE,MAAA,EACA,KAAA,KAIF,oBACE,MAAA,KACA,KAAA,EAEA,iBACA,QAAA,MACA,QAAA,IAAA,KvB22GD,UAAA,KuBv2GC,YAAa,WACb,MAAA,KACA,YAAA,OAEA,mBACA,SAAA,MACA,IAAA,EvBy2GD,MAAA,EuBr2GC,OAAQ,EACR,KAAA,EACA,QAAA,IAQF,2BtB+2GE,MAAO,EsB32GL,KAAA,KAEA,eACA,sCvB+1GH,QAAA,GuBt2GC,WAAY,EtBs3GZ,cAAe,IAAI,OsB32GjB,cAAA,IAAA,QAEA,uBvB+1GH,8CuB10GC,IAAK,KAXL,OAAA,KApEA,cAAA,IvB85GC,yBuB11GD,6BA1DA,MAAA,EACA,KAAA,KvBw5GD,kC0BviHG,MAAO,KzBujHP,KAAM,GyBnjHR,W1ByiHD,oB0B7iHC,SAAU,SzB6jHV,QAAS,ayBvjHP,eAAA,OAGA,yB1ByiHH,gBCgBC,SAAU,SACV,MAAO,KyBhjHT,gC1ByiHC,gCCYD,+BAFA,+ByBnjHA,uBANM,uBzB0jHN,sBAFA,sBAQE,QAAS,EyBrjHP,qB1B0iHH,2B0BriHD,2BACE,iC1BuiHD,YAAA,KCgBD,aACE,YAAa,KDZd,kB0B7iHD,wBAAA,0BzB8jHE,MAAO,KDZR,kB0BliHD,wBACE,0B1BoiHD,YAAA,I0B/hHC,yE1BkiHD,cAAA,E2BnlHC,4BACG,YAAA,EDsDL,mEzBgjHE,wBAAyB,E0B/lHzB,2BAAA,E3BolHD,6C0B/hHD,8CACE,uBAAA,E1BiiHD,0BAAA,E0B9hHC,sB1BiiHD,MAAA,KCgBD,8D0BlnHE,cAAA,E3BumHD,mE0B9hHD,oECjEE,wBAAA,EACG,2BAAA,EDqEL,oEzB6iHE,uBAAwB,EyB3iHxB,0BAAA,EAiBF,mCACE,iCACA,QAAA,EAEF,iCACE,cAAA,IACA,aAAA,IAKF,oCtB/CE,cAAA,KACQ,aAAA,KsBkDR,iCtBnDA,mBAAA,MAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,iBsByDV,0CACE,mBAAA,K1B0gHD,WAAA,K0BtgHC,YACA,YAAA,EAGF,eACE,aAAA,IAAA,IAAA,E1BwgHD,oBAAA,ECgBD,uBACE,aAAc,EAAE,IAAI,IyB7gHlB,yBACA,+BACA,oC1BkgHH,QAAA,M0BzgHC,MAAO,KAcH,MAAA,K1B8/GL,UAAA,KCgBD,oCACE,MAAO,KyBvgHL,8BACA,oC1B4/GH,oC0Bv/GC,0CACE,WAAA,K1By/GH,YAAA,E2BlqHC,4DACC,cAAA,EAQA,sD3B+pHF,uBAAA,I0Bz/GC,wBAAA,IC/KA,2BAAA,EACC,0BAAA,EAQA,sD3BqqHF,uBAAA,E0B1/GC,wBAAyB,EACzB,2BAAA,I1B4/GD,0BAAA,ICgBD,uE0BzrHE,cAAA,E3B8qHD,4E0Bz/GD,6EC7LE,2BAAA,EACC,0BAAA,EDoMH,6EACE,uBAAA,EACA,wBAAA,EAEA,qB1Bu/GD,QAAA,M0B3/GC,MAAO,KzB2gHP,aAAc,MyBpgHZ,gBAAA,SAEA,0B1Bw/GH,gC0BjgHC,QAAS,WAYP,MAAA,K1Bw/GH,MAAA,G0Bp/GG,qC1Bu/GH,MAAA,KCgBD,+CACE,KAAM,KyBh/GF,gDAFA,6C1By+GL,2D0Bx+GK,wDEzOJ,SAAU,SACV,KAAA,cACA,eAAA,K5BotHD,a4BhtHC,SAAA,SACE,QAAA,MACA,gBAAA,S5BmtHH,0B4B3tHC,MAAO,KAeL,cAAA,EACA,aAAA,EAOA,2BACA,SAAA,S5B0sHH,QAAA,E4BxsHG,MAAA,KACE,MAAA,K5B0sHL,cAAA,ECgBD,iCACE,QAAS,EiBtrHT,8BACA,mCACA,sCACA,OAAA,KlB2qHD,QAAA,KAAA,KkBzqHC,UAAA,KjByrHA,YAAa,UACb,cAAe,IiBxrHb,oClB6qHH,yCkB1qHC,4CjB0rHA,OAAQ,KACR,YAAa,KDTd,8C4BltHD,mDAAA,sD3B6tHA,sCACA,2CiB5rHI,8CjBisHF,OAAQ,KiB7sHR,8BACA,mCACA,sCACA,OAAA,KlBksHD,QAAA,IAAA,KkBhsHC,UAAA,KjBgtHA,YAAa,IACb,cAAe,IiB/sHb,oClBosHH,yCkBjsHC,4CjBitHA,OAAQ,KACR,YAAa,KDTd,8C4BhuHD,mDAAA,sD3B2uHA,sCACA,2CiBntHI,8CjBwtHF,OAAQ,K2B5uHR,2B5BguHD,mB4BhuHC,iB3BivHA,QAAS,W2B5uHX,8D5BguHC,sD4BhuHD,oDAEE,cAAA,EAEA,mB5BkuHD,iB4B7tHC,MAAO,GACP,YAAA,OACA,eAAA,OAEA,mBACA,QAAA,IAAA,KACA,UAAA,KACA,YAAA,IACA,YAAA,EACA,MAAA,K5B+tHD,WAAA,O4B5tHC,iBAAA,KACE,OAAA,IAAA,MAAA,KACA,cAAA,I5B+tHH,4B4B5tHC,QAAA,IAAA,KACE,UAAA,KACA,cAAA,I5B+tHH,4B4BlvHC,QAAS,KAAK,K3BkwHd,UAAW,K2BxuHT,cAAA,IAKJ,wCAAA,qC3BwuHE,WAAY,EAEd,uCACA,+BACA,kC0Bh1HE,6CACG,8CC4GL,6D5BwtHC,wE4BvtHC,wBAAA,E5B0tHD,2BAAA,ECgBD,+BACE,aAAc,EAEhB,sCACA,8B2BnuHA,+D5BytHC,oDCWD,iC0Br1HE,4CACG,6CCiHH,uBAAA,E5B2tHD,0BAAA,E4BrtHC,8BAGA,YAAA,E5ButHD,iB4B3tHC,SAAU,SAUR,UAAA,E5BotHH,YAAA,O4BltHK,sB5BqtHL,SAAA,SCgBD,2BACE,YAAa,K2B3tHb,6BAAA,4B5B+sHD,4B4B5sHK,QAAA,EAGJ,kCAAA,wCAGI,aAAA,K5B+sHL,iC6B72HD,uCACE,QAAA,EACA,YAAA,K7Bg3HD,K6Bl3HC,aAAc,EAOZ,cAAA,EACA,WAAA,KARJ,QAWM,SAAA,SACA,QAAA,M7B+2HL,U6B72HK,SAAA,S5B63HJ,QAAS,M4B33HH,QAAA,KAAA,KAMJ,gB7B02HH,gB6Bz2HK,gBAAA,K7B42HL,iBAAA,KCgBD,mB4Bx3HQ,MAAA,KAGA,yBADA,yB7B62HP,MAAA,K6Br2HG,gBAAA,K5Bq3HF,OAAQ,YACR,iBAAkB,Y4Bl3Hd,aAzCN,mB7Bg5HC,mBwBn5HC,iBAAA,KACA,aAAA,QAEA,kBxBs5HD,OAAA,I6Bt5HC,OAAQ,IAAI,EA0DV,SAAA,O7B+1HH,iBAAA,Q6Br1HC,c7Bw1HD,UAAA,K6Bt1HG,UAEA,cAAA,IAAA,MAAA,KALJ,aASM,MAAA,KACA,cAAA,KAEA,e7Bu1HL,aAAA,I6Bt1HK,YAAA,WACE,OAAA,IAAA,MAAA,Y7Bw1HP,cAAA,IAAA,IAAA,EAAA,ECgBD,qBACE,aAAc,KAAK,KAAK,K4B/1HlB,sBAEA,4BADA,4BAEA,MAAA,K7Bo1HP,OAAA,Q6B/0HC,iBAAA,KAqDA,OAAA,IAAA,MAAA,KA8BA,oBAAA,YAnFA,wBAwDE,MAAA,K7B8xHH,cAAA,E6B5xHK,2BACA,MAAA,KA3DJ,6BAgEE,cAAA,IACA,WAAA,OAYJ,iDA0DE,IAAK,KAjED,KAAA,K7B6xHH,yB6B5tHD,2BA9DM,QAAA,W7B6xHL,MAAA,G6Bt2HD,6BAuFE,cAAA,GAvFF,6B5B23HA,aAAc,EACd,cAAe,IDZhB,kC6BzuHD,wCA3BA,wCATM,OAAA,IAAA,MAAA,K7BkxHH,yB6B9uHD,6B5B8vHE,cAAe,IAAI,MAAM,KACzB,cAAe,IAAI,IAAI,EAAE,EDZ1B,kC6Bj3HD,wC7Bk3HD,wC6Bh3HG,oBAAA,MAIE,c7Bk3HL,MAAA,K6B/2HK,gB7Bk3HL,cAAA,ICgBD,iBACE,YAAa,I4B13HP,uBAQR,6B7Bu2HC,6B6Br2HG,MAAA,K7Bw2HH,iBAAA,Q6Bt2HK,gBACA,MAAA,KAYN,mBACE,WAAA,I7B+1HD,YAAA,E6B51HG,e7B+1HH,MAAA,K6B71HK,kBACA,MAAA,KAPN,oBAYI,cAAA,IACA,WAAA,OAYJ,wCA0DE,IAAK,KAjED,KAAA,K7B81HH,yB6B7xHD,kBA9DM,QAAA,W7B81HL,MAAA,G6Br1HD,oBACA,cAAA,GAIE,oBACA,cAAA,EANJ,yB5B62HE,aAAc,EACd,cAAe,IDZhB,8B6B7yHD,oCA3BA,oCATM,OAAA,IAAA,MAAA,K7Bs1HH,yB6BlzHD,yB5Bk0HE,cAAe,IAAI,MAAM,KACzB,cAAe,IAAI,IAAI,EAAE,EDZ1B,8B6B30HD,oC7B40HD,oC6B10HG,oBAAA,MAGA,uB7B60HH,QAAA,K6Bl0HC,qBF3OA,QAAA,M3BkjID,yB8B3iIC,WAAY,KACZ,uBAAA,EACA,wBAAA,EAEA,Q9B6iID,SAAA,S8BriIC,WAAY,KA8nBZ,cAAe,KAhoBb,OAAA,IAAA,MAAA,Y9B4iIH,yB8B5hIC,QAgnBE,cAAe,K9Bi7GlB,yB8BphIC,eACA,MAAA,MAGA,iBACA,cAAA,KAAA,aAAA,KAEA,WAAA,Q9BqhID,2BAAA,M8BnhIC,WAAA,IAAA,MAAA,YACE,mBAAA,MAAA,EAAA,IAAA,EAAA,qB9BqhIH,WAAA,MAAA,EAAA,IAAA,EAAA,qB8B57GD,oBArlBI,WAAA,KAEA,yBAAA,iB9BqhID,MAAA,K8BnhIC,WAAA,EACE,mBAAA,KACA,WAAA,KAEA,0B9BqhIH,QAAA,gB8BlhIC,OAAA,eACE,eAAA,E9BohIH,SAAA,kBCkBD,oBACE,WAAY,QDZf,sC8BlhIK,mC9BihIH,oC8B5gIC,cAAe,E7B+hIf,aAAc,G6Bp+GlB,sCAnjBE,mC7B4hIA,WAAY,MDdX,4D8BtgID,sC9BugID,mCCkBG,WAAY,O6B9gId,kCANE,gC9BygIH,4B8B1gIG,0BAuiBF,aAAc,M7Bs/Gd,YAAa,MAEf,yBDZC,kC8B9gIK,gC9B6gIH,4B8B9gIG,0BAcF,aAAc,EAChB,YAAA,GAMF,mBA8gBE,QAAS,KAhhBP,aAAA,EAAA,EAAA,I9BqgIH,yB8BhgIC,mB7BkhIE,cAAe,G6B7gIjB,qBADA,kB9BmgID,SAAA,M8B5/HC,MAAO,EAggBP,KAAM,E7B+gHN,QAAS,KDdR,yB8BhgID,qB9BigID,kB8BhgIC,cAAA,GAGF,kBACE,IAAA,EACA,aAAA,EAAA,EAAA,I9BogID,qB8B7/HC,OAAQ,EACR,cAAA,EACA,aAAA,IAAA,EAAA,EAEA,cACA,MAAA,K9B+/HD,OAAA,K8B7/HC,QAAA,KAAA,K7B+gIA,UAAW,K6B7gIT,YAAA,KAIA,oBAbJ,oB9B2gIC,gBAAA,K8B1/HG,kB7B6gIF,QAAS,MDdR,yBACF,iC8Bn/HC,uCACA,YAAA,OAGA,eC9LA,SAAA,SACA,MAAA,MD+LA,QAAA,IAAA,KACA,WAAA,IACA,aAAA,KACA,cAAA,I9Bs/HD,iBAAA,Y8Bl/HC,iBAAA,KACE,OAAA,IAAA,MAAA,Y9Bo/HH,cAAA,I8B/+HG,qBACA,QAAA,EAEA,yB9Bk/HH,QAAA,M8BxgIC,MAAO,KAyBL,OAAA,I9Bk/HH,cAAA,I8BvjHD,mCAvbI,WAAA,I9Bm/HH,yB8Bz+HC,eACA,QAAA,MAGE,YACA,OAAA,MAAA,M9B4+HH,iB8B/8HC,YAAA,KA2YA,eAAgB,KAjaZ,YAAA,KAEA,yBACA,iCACA,SAAA,OACA,MAAA,KACA,MAAA,KAAA,WAAA,E9By+HH,iBAAA,Y8B9kHC,OAAQ,E7BimHR,mBAAoB,K6Bz/HhB,WAAA,KAGA,kDAqZN,sC9BqlHC,QAAA,IAAA,KAAA,IAAA,KCmBD,sC6B1/HQ,YAAA,KAmBR,4C9By9HD,4C8B1lHG,iBAAkB,M9B+lHnB,yB8B/lHD,YAtYI,MAAA,K9Bw+HH,OAAA,E8Bt+HK,eACA,MAAA,K9B0+HP,iB8B99HG,YAAa,KACf,eAAA,MAGA,aACA,QAAA,KAAA,K1B9NA,WAAA,IACQ,aAAA,M2B/DR,cAAA,IACA,YAAA,M/B+vID,WAAA,IAAA,MAAA,YiBzuHC,cAAe,IAAI,MAAM,YAwEzB,mBAAoB,MAAM,EAAE,IAAI,EAAE,qBAAyB,EAAE,IAAI,EAAE,qBAtI/D,WAAA,MAAA,EAAA,IAAA,EAAA,qBAAA,EAAA,IAAA,EAAA,qBAEA,yBjB2yHH,yBiBvqHC,QAAS,aA/HP,cAAA,EACA,eAAA,OjB0yHH,2BiB5qHC,QAAS,aAxHP,MAAA,KjBuyHH,eAAA,OiBnyHG,kCACA,QAAA,aAmHJ,0BhBssHE,QAAS,aACT,eAAgB,OgB/yHd,wCjBgyHH,6CiBxrHD,2CjB2rHC,MAAA,KiB/xHG,wCACA,MAAA,KAmGJ,4BhBktHE,cAAe,EgB9yHb,eAAA,OAGA,uBADA,oBjBgyHH,QAAA,aiBtsHC,WAAY,EhBytHZ,cAAe,EgB/yHX,eAAA,OAsFN,6BAAA,0BAjFI,aAAA,EAiFJ,4CjB+sHC,sCiB1xHG,SAAA,SjB6xHH,YAAA,E8BtgID,kDAmWE,IAAK,GAvWH,yBACE,yB9BihIL,cAAA,I8B//HD,oCAoVE,cAAe,GA1Vf,yBACA,aACA,MAAA,KACA,YAAA,E1BzPF,eAAA,EACQ,aAAA,EJswIP,YAAA,EACF,OAAA,E8BtgIG,mBAAoB,KACtB,WAAA,M9B0gID,8B8BtgIC,WAAY,EACZ,uBAAA,EHzUA,wBAAA,EAQA,mDACC,cAAA,E3B40IF,uBAAA,I8BlgIC,wBAAyB,IChVzB,2BAAA,EACA,0BAAA,EDkVA,YCnVA,WAAA,IACA,cAAA,IDqVA,mBCtVA,WAAA,KACA,cAAA,KD+VF,mBChWE,WAAA,KACA,cAAA,KDuWF,aAsSE,WAAY,KA1SV,cAAA,KAEA,yB9BkgID,aACF,MAAA,K8Br+HG,aAAc,KAhBhB,YAAA,MACA,yBE5WA,aF8WE,MAAA,eAFF,cAKI,MAAA,gB9B0/HH,aAAA,M8Bh/HD,4BACA,aAAA,GADF,gBAKI,iBAAA,Q9Bm/HH,aAAA,QCmBD,8B6BngIM,MAAA,KARN,oC9B6/HC,oC8B/+HG,MAAA,Q9Bk/HH,iBAAA,Y8B7+HK,6B9Bg/HL,MAAA,KCmBD,iC6B//HQ,MAAA,KAKF,uC9B4+HL,uCCmBC,MAAO,KACP,iBAAkB,Y6B5/HZ,sCAIF,4C9B0+HL,4CCmBC,MAAO,KACP,iBAAkB,Q6B1/HZ,wCAxCR,8C9BohIC,8C8Bt+HG,MAAA,K9By+HH,iBAAA,YCmBD,+B6Bz/HM,aAAA,KAGA,qCApDN,qC9B8hIC,iBAAA,KCmBD,yC6Bv/HI,iBAAA,KAOE,iCAAA,6B7Bq/HJ,aAAc,Q6Bj/HR,oCAiCN,0C9Bk8HD,0C8B9xHC,MAAO,KA7LC,iBAAA,QACA,yB7Bi/HR,sD6B/+HU,MAAA,KAKF,4D9B49HP,4DCmBC,MAAO,KACP,iBAAkB,Y6B5+HV,2DAIF,iE9B09HP,iECmBC,MAAO,KACP,iBAAkB,Q6B1+HV,6D9B69HX,mEADE,mE8B7jIC,MAAO,KA8GP,iBAAA,aAEE,6B9Bo9HL,MAAA,K8B/8HG,mC9Bk9HH,MAAA,KCmBD,0B6Bl+HM,MAAA,KAIA,gCAAA,gC7Bm+HJ,MAAO,K6Bz9HT,0CARQ,0CASN,mD9B08HD,mD8Bz8HC,MAAA,KAFF,gBAKI,iBAAA,K9B68HH,aAAA,QCmBD,8B6B79HM,MAAA,QARN,oC9Bu9HC,oC8Bz8HG,MAAA,K9B48HH,iBAAA,Y8Bv8HK,6B9B08HL,MAAA,QCmBD,iC6Bz9HQ,MAAA,QAKF,uC9Bs8HL,uCCmBC,MAAO,KACP,iBAAkB,Y6Bt9HZ,sCAIF,4C9Bo8HL,4CCmBC,MAAO,KACP,iBAAkB,Q6Bp9HZ,wCAxCR,8C9B8+HC,8C8B/7HG,MAAA,K9Bk8HH,iBAAA,YCmBD,+B6Bl9HM,aAAA,KAGA,qCArDN,qC9Bw/HC,iBAAA,KCmBD,yC6Bh9HI,iBAAA,KAME,iCAAA,6B7B+8HJ,aAAc,Q6B38HR,oCAuCN,0C9Bs5HD,0C8B93HC,MAAO,KAvDC,iBAAA,QAuDV,yBApDU,kE9By7HP,aAAA,Q8Bt7HO,0D9By7HP,iBAAA,QCmBD,sD6Bz8HU,MAAA,QAKF,4D9Bs7HP,4DCmBC,MAAO,KACP,iBAAkB,Y6Bt8HV,2DAIF,iE9Bo7HP,iECmBC,MAAO,KACP,iBAAkB,Q6Bp8HV,6D9Bu7HX,mEADE,mE8B7hIC,MAAO,KA+GP,iBAAA,aAEE,6B9Bm7HL,MAAA,Q8B96HG,mC9Bi7HH,MAAA,KCmBD,0B6Bj8HM,MAAA,QAIA,gCAAA,gC7Bk8HJ,MAAO,KgC1kJT,0CH0oBQ,0CGzoBN,mDjC2jJD,mDiC1jJC,MAAA,KAEA,YACA,QAAA,IAAA,KjC8jJD,cAAA,KiCnkJC,WAAY,KAQV,iBAAA,QjC8jJH,cAAA,IiC3jJK,eACA,QAAA,ajC+jJL,yBiC3kJC,QAAS,EAAE,IAkBT,MAAA,KjC4jJH,QAAA,SkC/kJC,oBACA,MAAA,KAEA,YlCklJD,QAAA,akCtlJC,aAAc,EAOZ,OAAA,KAAA,ElCklJH,cAAA,ICmBD,eiClmJM,QAAA,OAEA,iBACA,oBACA,SAAA,SACA,MAAA,KACA,QAAA,IAAA,KACA,YAAA,KACA,YAAA,WlCmlJL,MAAA,QkCjlJG,gBAAA,KjComJF,iBAAkB,KiCjmJZ,OAAA,IAAA,MAAA,KPVH,6B3B8lJJ,gCkChlJG,YAAA,EjCmmJF,uBAAwB,I0B1nJxB,0BAAA,I3B4mJD,4BkC3kJG,+BjC8lJF,wBAAyB,IACzB,2BAA4B,IiC3lJxB,uBAFA,uBAGA,0BAFA,0BlCilJL,QAAA,EkCzkJG,MAAA,QjC4lJF,iBAAkB,KAClB,aAAc,KAEhB,sBiC1lJM,4BAFA,4BjC6lJN,yBiC1lJM,+BAFA,+BAGA,QAAA,ElC8kJL,MAAA,KkCroJC,OAAQ,QjCwpJR,iBAAkB,QAClB,aAAc,QiCtlJV,wBAEA,8BADA,8BjCulJN,2BiCzlJM,iCjC0lJN,iCDZC,MAAA,KkClkJC,OAAQ,YjCqlJR,iBAAkB,KkChqJd,aAAA,KAEA,oBnCipJL,uBmC/oJG,QAAA,KAAA,KlCkqJF,UAAW,K0B7pJX,YAAA,U3B+oJD,gCmC9oJG,mClCiqJF,uBAAwB,I0B1qJxB,0BAAA,I3B4pJD,+BkC7kJD,kCjCgmJE,wBAAyB,IkChrJrB,2BAAA,IAEA,oBnCiqJL,uBmC/pJG,QAAA,IAAA,KlCkrJF,UAAW,K0B7qJX,YAAA,I3B+pJD,gCmC9pJG,mClCirJF,uBAAwB,I0B1rJxB,0BAAA,I3B4qJD,+BoC9qJD,kCACE,wBAAA,IACA,2BAAA,IAEA,OpCgrJD,aAAA,EoCprJC,OAAQ,KAAK,EAOX,WAAA,OpCgrJH,WAAA,KCmBD,UmChsJM,QAAA,OAEA,YACA,eACA,QAAA,apCirJL,QAAA,IAAA,KoC/rJC,iBAAkB,KnCktJlB,OAAQ,IAAI,MAAM,KmC/rJd,cAAA,KAnBN,kBpCosJC,kBCmBC,gBAAiB,KmC5rJb,iBAAA,KA3BN,eAAA,kBAkCM,MAAA,MAlCN,mBAAA,sBnCguJE,MAAO,KmCrrJH,mBAEA,yBADA,yBpCwqJL,sBqCrtJC,MAAO,KACP,OAAA,YACA,iBAAA,KAEA,OACA,QAAA,OACA,QAAA,KAAA,KAAA,KACA,UAAA,IACA,YAAA,IACA,YAAA,EACA,MAAA,KrCutJD,WAAA,OqCntJG,YAAA,OpCsuJF,eAAgB,SoCpuJZ,cAAA,MrCutJL,cqCrtJK,cAKJ,MAAA,KACE,gBAAA,KrCktJH,OAAA,QqC7sJG,aACA,QAAA,KAOJ,YCtCE,SAAA,StCkvJD,IAAA,KCmBD,eqChwJM,iBAAA,KALJ,2BD0CF,2BrC+sJC,iBAAA,QCmBD,eqCvwJM,iBAAA,QALJ,2BD8CF,2BrCktJC,iBAAA,QCmBD,eqC9wJM,iBAAA,QALJ,2BDkDF,2BrCqtJC,iBAAA,QCmBD,YqCrxJM,iBAAA,QALJ,wBDsDF,wBrCwtJC,iBAAA,QCmBD,eqC5xJM,iBAAA,QALJ,2BD0DF,2BrC2tJC,iBAAA,QCmBD,cqCnyJM,iBAAA,QCDJ,0BADF,0BAEE,iBAAA,QAEA,OACA,QAAA,aACA,UAAA,KACA,QAAA,IAAA,IACA,UAAA,KACA,YAAA,IACA,YAAA,EACA,MAAA,KACA,WAAA,OvCwxJD,YAAA,OuCrxJC,eAAA,OACE,iBAAA,KvCuxJH,cAAA,KuClxJG,aACA,QAAA,KAGF,YtCqyJA,SAAU,SsCnyJR,IAAA,KAMA,0BvC+wJH,eCmBC,IAAK,EsChyJD,QAAA,IAAA,IvCmxJL,cuCjxJK,cAKJ,MAAA,KtC+xJA,gBAAiB,KsC7xJf,OAAA,QvC+wJH,+BuC3wJC,4BACE,MAAA,QvC6wJH,iBAAA,KuCzwJG,wBvC4wJH,MAAA,MuCxwJG,+BvC2wJH,aAAA,IwCp0JC,uBACA,YAAA,IAEA,WACA,YAAA,KxCu0JD,eAAA,KwC50JC,cAAe,KvC+1Jf,MAAO,QuCt1JL,iBAAA,KAIA,eAbJ,cAcI,MAAA,QxCu0JH,awCr1JC,cAAe,KAmBb,UAAA,KxCq0JH,YAAA,ICmBD,cuCn1JI,iBAAA,QAEA,sBxCo0JH,4BwC91JC,cAAe,KA8Bb,aAAA,KxCm0JH,cAAA,IwChzJD,sBAfI,UAAA,KxCo0JD,oCwCj0JC,WvCo1JA,YAAa,KuCl1JX,eAAA,KxCo0JH,sBwC1zJD,4BvC60JE,cAAe,KuCj1Jb,aAAA,KC5CJ,ezC+2JD,cyC92JC,UAAA,MAGA,WACA,QAAA,MACA,QAAA,IACA,cAAA,KrCiLA,YAAA,WACK,iBAAA,KACG,OAAA,IAAA,MAAA,KJisJT,cAAA,IyC33JC,mBAAoB,OAAO,IAAI,YxC84J1B,cAAe,OAAO,IAAI,YwCj4J7B,WAAA,OAAA,IAAA,YAKF,iBzC82JD,eCmBC,aAAc,KACd,YAAa,KwC13JX,mBA1BJ,kBzCq4JC,kByC12JG,aAAA,QCzBJ,oBACE,QAAA,IACA,MAAA,KAEA,O1Cy4JD,QAAA,K0C74JC,cAAe,KAQb,OAAA,IAAA,MAAA,YAEA,cAAA,IAVJ,UAeI,WAAA,E1Cq4JH,MAAA,QCmBD,mByCl5JI,YAAA,IArBJ,SAyBI,U1Ck4JH,cAAA,ECmBD,WyC34JE,WAAA,IAFF,mBAAA,mBAMI,cAAA,KAEA,0BACA,0B1C43JH,SAAA,S0Cp3JC,IAAK,KCvDL,MAAA,MACA,MAAA,Q3C+6JD,e0Cz3JC,MAAO,QClDL,iBAAA,Q3C86JH,aAAA,Q2C36JG,kB3C86JH,iBAAA,Q2Ct7JC,2BACA,MAAA,Q3C07JD,Y0Ch4JC,MAAO,QCtDL,iBAAA,Q3Cy7JH,aAAA,Q2Ct7JG,e3Cy7JH,iBAAA,Q2Cj8JC,wBACA,MAAA,Q3Cq8JD,e0Cv4JC,MAAO,QC1DL,iBAAA,Q3Co8JH,aAAA,Q2Cj8JG,kB3Co8JH,iBAAA,Q2C58JC,2BACA,MAAA,Q3Cg9JD,c0C94JC,MAAO,QC9DL,iBAAA,Q3C+8JH,aAAA,Q2C58JG,iB3C+8JH,iBAAA,Q4Ch9JC,0BAAQ,MAAA,QACR,wCAAQ,K5Cs9JP,oBAAA,KAAA,E4Cl9JD,GACA,oBAAA,EAAA,GACA,mCAAQ,K5Cw9JP,oBAAA,KAAA,E4C19JD,GACA,oBAAA,EAAA,GACA,gCAAQ,K5Cw9JP,oBAAA,KAAA,E4Ch9JD,GACA,oBAAA,EAAA,GAGA,UACA,OAAA,KxCsCA,cAAA,KACQ,SAAA,OJ86JT,iBAAA,Q4Ch9JC,cAAe,IACf,mBAAA,MAAA,EAAA,IAAA,IAAA,eACA,WAAA,MAAA,EAAA,IAAA,IAAA,eAEA,cACA,MAAA,KACA,MAAA,EACA,OAAA,KACA,UAAA,KxCyBA,YAAA,KACQ,MAAA,KAyHR,WAAA,OACK,iBAAA,QACG,mBAAA,MAAA,EAAA,KAAA,EAAA,gBJk0JT,WAAA,MAAA,EAAA,KAAA,EAAA,gB4C78JC,mBAAoB,MAAM,IAAI,K3Cw+JzB,cAAe,MAAM,IAAI,K4Cv+J5B,WAAA,MAAA,IAAA,KDEF,sBCAE,gCDAF,iBAAA,yK5Ci9JD,iBAAA,oK4C18JC,iBAAiB,iK3Cs+JjB,wBAAyB,KAAK,KGlhK9B,gBAAA,KAAA,KJ4/JD,qBI1/JS,+BwCmDR,kBAAmB,qBAAqB,GAAG,OAAO,SErElD,aAAA,qBAAA,GAAA,OAAA,S9C+gKD,UAAA,qBAAA,GAAA,OAAA,S6C59JG,sBACA,iBAAA,Q7Cg+JH,wC4C38JC,iBAAkB,yKEzElB,iBAAA,oK9CuhKD,iBAAA,iK6Cp+JG,mBACA,iBAAA,Q7Cw+JH,qC4C/8JC,iBAAkB,yKE7ElB,iBAAA,oK9C+hKD,iBAAA,iK6C5+JG,sBACA,iBAAA,Q7Cg/JH,wC4Cn9JC,iBAAkB,yKEjFlB,iBAAA,oK9CuiKD,iBAAA,iK6Cp/JG,qBACA,iBAAA,Q7Cw/JH,uC+C/iKC,iBAAkB,yKAElB,iBAAA,oK/CgjKD,iBAAA,iK+C7iKG,O/CgjKH,WAAA,KC4BD,mB8CtkKE,WAAA,E/C+iKD,O+C3iKD,YACE,SAAA,O/C6iKD,KAAA,E+CziKC,Y/C4iKD,MAAA,Q+CxiKG,c/C2iKH,QAAA,MC4BD,4B8CjkKE,UAAA,KAGF,aAAA,mBAEE,aAAA,KAGF,YAAA,kB9CkkKE,cAAe,K8C3jKjB,YAHE,Y/CuiKD,a+CniKC,QAAA,W/CsiKD,eAAA,I+CliKC,c/CqiKD,eAAA,O+ChiKC,cACA,eAAA,OAMF,eACE,WAAA,EACA,cAAA,ICvDF,YAEE,aAAA,EACA,WAAA,KAQF,YACE,aAAA,EACA,cAAA,KAGA,iBACA,SAAA,SACA,QAAA,MhDglKD,QAAA,KAAA,KgD7kKC,cAAA,KrB3BA,iBAAA,KACC,OAAA,IAAA,MAAA,KqB6BD,6BACE,uBAAA,IrBvBF,wBAAA,I3BymKD,4BgDvkKC,cAAe,E/CmmKf,2BAA4B,I+CjmK5B,0BAAA,IAFF,kBAAA,uBAKI,MAAA,KAIF,2CAAA,gD/CmmKA,MAAO,K+C/lKL,wBAFA,wBhD4kKH,6BgD3kKG,6BAKF,MAAO,KACP,gBAAA,KACA,iBAAA,QAKA,uB/C+lKA,MAAO,KACP,WAAY,K+C5lKV,0BhDskKH,gCgDrkKG,gCALF,MAAA,K/CsmKA,OAAQ,YACR,iBAAkB,KDxBnB,mDgD/kKC,yDAAA,yD/C4mKA,MAAO,QDxBR,gDgDnkKC,sDAAA,sD/CgmKA,MAAO,K+C5lKL,wBAEA,8BADA,8BhDskKH,QAAA,EgD3kKC,MAAA,K/CumKA,iBAAkB,QAClB,aAAc,QAEhB,iDDpBC,wDCuBD,uDADA,uD+C5mKE,8DAYI,6D/C+lKN,uD+C3mKE,8D/C8mKF,6DAKE,MAAO,QDxBR,8CiD7qKG,oDADF,oDAEE,MAAA,QAEA,yBhD0sKF,MAAO,QgDxsKH,iBAAA,QAFF,0BAAA,+BAKI,MAAA,QAGF,mDAAA,wDhD2sKJ,MAAO,QDtBR,gCiDnrKO,gCAGF,qCAFE,qChD8sKN,MAAO,QACP,iBAAkB,QAEpB,iCgD1sKQ,uCAFA,uChD6sKR,sCDtBC,4CiDtrKO,4CArBN,MAAA,KACE,iBAAA,QACA,aAAA,QAEA,sBhDuuKF,MAAO,QgDruKH,iBAAA,QAFF,uBAAA,4BAKI,MAAA,QAGF,gDAAA,qDhDwuKJ,MAAO,QDtBR,6BiDhtKO,6BAGF,kCAFE,kChD2uKN,MAAO,QACP,iBAAkB,QAEpB,8BgDvuKQ,oCAFA,oChD0uKR,mCDtBC,yCiDntKO,yCArBN,MAAA,KACE,iBAAA,QACA,aAAA,QAEA,yBhDowKF,MAAO,QgDlwKH,iBAAA,QAFF,0BAAA,+BAKI,MAAA,QAGF,mDAAA,wDhDqwKJ,MAAO,QDtBR,gCiD7uKO,gCAGF,qCAFE,qChDwwKN,MAAO,QACP,iBAAkB,QAEpB,iCgDpwKQ,uCAFA,uChDuwKR,sCDtBC,4CiDhvKO,4CArBN,MAAA,KACE,iBAAA,QACA,aAAA,QAEA,wBhDiyKF,MAAO,QgD/xKH,iBAAA,QAFF,yBAAA,8BAKI,MAAA,QAGF,kDAAA,uDhDkyKJ,MAAO,QDtBR,+BiD1wKO,+BAGF,oCAFE,oChDqyKN,MAAO,QACP,iBAAkB,QAEpB,gCgDjyKQ,sCAFA,sChDoyKR,qCDtBC,2CiD7wKO,2CDkGN,MAAO,KACP,iBAAA,QACA,aAAA,QAEF,yBACE,WAAA,EACA,cAAA,IE1HF,sBACE,cAAA,EACA,YAAA,IAEA,O9C0DA,cAAA,KACQ,iBAAA,KJgvKT,OAAA,IAAA,MAAA,YkDtyKC,cAAe,IACf,mBAAA,EAAA,IAAA,IAAA,gBlDwyKD,WAAA,EAAA,IAAA,IAAA,gBkDlyKC,YACA,QAAA,KvBnBC,e3B0zKF,QAAA,KAAA,KkDzyKC,cAAe,IAAI,MAAM,YAMvB,uBAAA,IlDsyKH,wBAAA,IkDhyKC,0CACA,MAAA,QAEA,alDmyKD,WAAA,EkDvyKC,cAAe,EjDm0Kf,UAAW,KACX,MAAO,QDtBR,oBkD7xKC,sBjDqzKF,eiD3zKI,mBAKJ,qBAEE,MAAA,QvBvCA,cACC,QAAA,KAAA,K3By0KF,iBAAA,QkDxxKC,WAAY,IAAI,MAAM,KjDozKtB,2BAA4B,IiDjzK1B,0BAAA,IAHJ,mBAAA,mCAMM,cAAA,ElD2xKL,oCkDtxKG,oDjDkzKF,aAAc,IAAI,EiDhzKZ,cAAA,EvBtEL,4D3Bg2KF,4EkDpxKG,WAAA,EjDgzKF,uBAAwB,IiD9yKlB,wBAAA,IvBtEL,0D3B81KF,0EkD7yKC,cAAe,EvB1Df,2BAAA,IACC,0BAAA,IuB0FH,+EAEI,uBAAA,ElDixKH,wBAAA,EkD7wKC,wDlDgxKD,iBAAA,EC4BD,0BACE,iBAAkB,EiDryKpB,8BlD6wKC,ckD7wKD,gCjD0yKE,cAAe,EiD1yKjB,sCAQM,sBlD2wKL,wCC4BC,cAAe,K0Bx5Kf,aAAA,KuByGF,wDlDwxKC,0BC4BC,uBAAwB,IACxB,wBAAyB,IiDrzK3B,yFAoBQ,yFlD2wKP,2DkD5wKO,2DjDwyKN,uBAAwB,IACxB,wBAAyB,IAK3B,wGiDj0KA,wGjD+zKA,wGDtBC,wGCuBD,0EiDh0KA,0EjD8zKA,0EiDtyKU,0EjD8yKR,uBAAwB,IAK1B,uGiD30KA,uGjDy0KA,uGDtBC,uGCuBD,yEiD10KA,yEjDw0KA,yEiD5yKU,yEvB7HR,wBAAA,IuBiGF,sDlDwzKC,yBC4BC,2BAA4B,IAC5B,0BAA2B,IiD3yKrB,qFA1CR,qFAyCQ,wDlDsxKP,wDC4BC,2BAA4B,IAC5B,0BAA2B,IAG7B,oGDtBC,oGCwBD,oGiDj2KA,oGjD81KA,uEiDhzKU,uEjDkzKV,uEiDh2KA,uEjDs2KE,0BAA2B,IAG7B,mGDtBC,mGCwBD,mGiD32KA,mGjDw2KA,sEiDtzKU,sEjDwzKV,sEiD12KA,sEjDg3KE,2BAA4B,IiDrzK1B,0BlD8xKH,qCkDz1KD,0BAAA,qCA+DI,WAAA,IAAA,MAAA,KA/DJ,kDAAA,kDAmEI,WAAA,EAnEJ,uBAAA,yCjD83KE,OAAQ,EiDpzKA,+CjDwzKV,+CiDl4KA,+CjDo4KA,+CAEA,+CANA,+CDjBC,iECoBD,iEiDn4KA,iEjDq4KA,iEAEA,iEANA,iEAWE,YAAa,EiD9zKL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1MG,QAAS,oB/Dm2MV,c+Dr2MC,c/Ds2MH,QAAA,sB+Dj2MG,yB/Dq2MD,kBACF,QAAA,iB+Dj2MG,yB/Dq2MD,mBACF,QAAA,kBgEn6MC,yBhEu6MC,yBgEt6MD,QAAA,wBACA,+CAAU,YhE26MT,QAAA,gBC4BD,iB+Dr8MU,QAAA,gBhE86MX,c+Dx2MG,QAAS,oB/D42MV,c+D92MC,c/D+2MH,QAAA,sB+D12MG,+C/D82MD,kBACF,QAAA,iB+D12MG,+C/D82MD,mBACF,QAAA,kBgEj8MC,+ChEq8MC,yBgEp8MD,QAAA,wBACA,gDAAU,YhEy8MT,QAAA,gBC4BD,iB+Dn+MU,QAAA,gBhE48MX,c+Dj3MG,QAAS,oB/Dq3MV,c+Dv3MC,c/Dw3MH,QAAA,sB+Dn3MG,gD/Du3MD,kBACF,QAAA,iB+Dn3MG,gD/Du3MD,mBACF,QAAA,kBgE/9MC,gDhEm+MC,yBgEl+MD,QAAA,wBACA,0BAAU,YhEu+MT,QAAA,gBC4BD,iB+DjgNU,QAAA,gBhE0+MX,c+D13MG,QAAS,oB/D83MV,c+Dh4MC,c/Di4MH,QAAA,sB+D53MG,0B/Dg4MD,kBACF,QAAA,iB+D53MG,0B/Dg4MD,mBACF,QAAA,kBgEr/MC,0BhEy/MC,yBACF,QAAA,wBgE1/MC,yBhE8/MC,WACF,QAAA,gBgE//MC,+ChEmgNC,WACF,QAAA,gBgEpgNC,gDhEwgNC,WACF,QAAA,gBAGA,0B+Dn3MC,WA4BE,QAAS,gBC5LX,eAAU,QAAA,eACV,aAAU,ehE4hNT,QAAA,gBC4BD,oB+DtjNU,QAAA,gBhE+hNX,iB+Dj4MG,QAAS,oBAMX,iB/D83MD,iB+Dz2MG,QAAS,sB/D82MZ,qB+Dl4MC,QAAS,e/Dq4MV,a+D/3MC,qBAcE,QAAS,iB/Ds3MZ,sB+Dn4MC,QAAS,e/Ds4MV,a+Dh4MC,sBAOE,QAAS,kB/D83MZ,4B+D/3MC,QAAS,eCpLT,ahEujNC,4BACF,QAAA,wBC6BD,aACE,cACE,QAAS"}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.eot b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.eot
deleted file mode 100644
index b93a495..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.eot
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.svg b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.svg
deleted file mode 100644
index 94fb549..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.svg
+++ /dev/null
@@ -1,288 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
-<svg xmlns="http://www.w3.org/2000/svg">
-<metadata></metadata>
-<defs>
-<font id="glyphicons_halflingsregular" horiz-adv-x="1200" >
-<font-face units-per-em="1200" ascent="960" descent="-240" />
-<missing-glyph horiz-adv-x="500" />
-<glyph horiz-adv-x="0" />
-<glyph horiz-adv-x="400" />
-<glyph unicode=" " />
-<glyph unicode="*" d="M600 1100q15 0 34 -1.5t30 -3.5l11 -1q10 -2 17.5 -10.5t7.5 -18.5v-224l158 158q7 7 18 8t19 -6l106 -106q7 -8 6 -19t-8 -18l-158 -158h224q10 0 18.5 -7.5t10.5 -17.5q6 -41 6 -75q0 -15 -1.5 -34t-3.5 -30l-1 -11q-2 -10 -10.5 -17.5t-18.5 -7.5h-224l158 -158 q7 -7 8 -18t-6 -19l-106 -106q-8 -7 -19 -6t-18 8l-158 158v-224q0 -10 -7.5 -18.5t-17.5 -10.5q-41 -6 -75 -6q-15 0 -34 1.5t-30 3.5l-11 1q-10 2 -17.5 10.5t-7.5 18.5v224l-158 -158q-7 -7 -18 -8t-19 6l-106 106q-7 8 -6 19t8 18l158 158h-224q-10 0 -18.5 7.5 t-10.5 17.5q-6 41 -6 75q0 15 1.5 34t3.5 30l1 11q2 10 10.5 17.5t18.5 7.5h224l-158 158q-7 7 -8 18t6 19l106 106q8 7 19 6t18 -8l158 -158v224q0 10 7.5 18.5t17.5 10.5q41 6 75 6z" />
-<glyph unicode="+" d="M450 1100h200q21 0 35.5 -14.5t14.5 -35.5v-350h350q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-350v-350q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v350h-350q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5 h350v350q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xa0;" />
-<glyph unicode="&#xa5;" d="M825 1100h250q10 0 12.5 -5t-5.5 -13l-364 -364q-6 -6 -11 -18h268q10 0 13 -6t-3 -14l-120 -160q-6 -8 -18 -14t-22 -6h-125v-100h275q10 0 13 -6t-3 -14l-120 -160q-6 -8 -18 -14t-22 -6h-125v-174q0 -11 -7.5 -18.5t-18.5 -7.5h-148q-11 0 -18.5 7.5t-7.5 18.5v174 h-275q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h125v100h-275q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h118q-5 12 -11 18l-364 364q-8 8 -5.5 13t12.5 5h250q25 0 43 -18l164 -164q8 -8 18 -8t18 8l164 164q18 18 43 18z" />
-<glyph unicode="&#x2000;" horiz-adv-x="650" />
-<glyph unicode="&#x2001;" horiz-adv-x="1300" />
-<glyph unicode="&#x2002;" horiz-adv-x="650" />
-<glyph unicode="&#x2003;" horiz-adv-x="1300" />
-<glyph unicode="&#x2004;" horiz-adv-x="433" />
-<glyph unicode="&#x2005;" horiz-adv-x="325" />
-<glyph unicode="&#x2006;" horiz-adv-x="216" />
-<glyph unicode="&#x2007;" horiz-adv-x="216" />
-<glyph unicode="&#x2008;" horiz-adv-x="162" />
-<glyph unicode="&#x2009;" horiz-adv-x="260" />
-<glyph unicode="&#x200a;" horiz-adv-x="72" />
-<glyph unicode="&#x202f;" horiz-adv-x="260" />
-<glyph unicode="&#x205f;" horiz-adv-x="325" />
-<glyph unicode="&#x20ac;" d="M744 1198q242 0 354 -189q60 -104 66 -209h-181q0 45 -17.5 82.5t-43.5 61.5t-58 40.5t-60.5 24t-51.5 7.5q-19 0 -40.5 -5.5t-49.5 -20.5t-53 -38t-49 -62.5t-39 -89.5h379l-100 -100h-300q-6 -50 -6 -100h406l-100 -100h-300q9 -74 33 -132t52.5 -91t61.5 -54.5t59 -29 t47 -7.5q22 0 50.5 7.5t60.5 24.5t58 41t43.5 61t17.5 80h174q-30 -171 -128 -278q-107 -117 -274 -117q-206 0 -324 158q-36 48 -69 133t-45 204h-217l100 100h112q1 47 6 100h-218l100 100h134q20 87 51 153.5t62 103.5q117 141 297 141z" />
-<glyph unicode="&#x20bd;" d="M428 1200h350q67 0 120 -13t86 -31t57 -49.5t35 -56.5t17 -64.5t6.5 -60.5t0.5 -57v-16.5v-16.5q0 -36 -0.5 -57t-6.5 -61t-17 -65t-35 -57t-57 -50.5t-86 -31.5t-120 -13h-178l-2 -100h288q10 0 13 -6t-3 -14l-120 -160q-6 -8 -18 -14t-22 -6h-138v-175q0 -11 -5.5 -18 t-15.5 -7h-149q-10 0 -17.5 7.5t-7.5 17.5v175h-267q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h117v100h-267q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h117v475q0 10 7.5 17.5t17.5 7.5zM600 1000v-300h203q64 0 86.5 33t22.5 119q0 84 -22.5 116t-86.5 32h-203z" />
-<glyph unicode="&#x2212;" d="M250 700h800q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#x231b;" d="M1000 1200v-150q0 -21 -14.5 -35.5t-35.5 -14.5h-50v-100q0 -91 -49.5 -165.5t-130.5 -109.5q81 -35 130.5 -109.5t49.5 -165.5v-150h50q21 0 35.5 -14.5t14.5 -35.5v-150h-800v150q0 21 14.5 35.5t35.5 14.5h50v150q0 91 49.5 165.5t130.5 109.5q-81 35 -130.5 109.5 t-49.5 165.5v100h-50q-21 0 -35.5 14.5t-14.5 35.5v150h800zM400 1000v-100q0 -60 32.5 -109.5t87.5 -73.5q28 -12 44 -37t16 -55t-16 -55t-44 -37q-55 -24 -87.5 -73.5t-32.5 -109.5v-150h400v150q0 60 -32.5 109.5t-87.5 73.5q-28 12 -44 37t-16 55t16 55t44 37 q55 24 87.5 73.5t32.5 109.5v100h-400z" />
-<glyph unicode="&#x25fc;" horiz-adv-x="500" d="M0 0z" />
-<glyph unicode="&#x2601;" d="M503 1089q110 0 200.5 -59.5t134.5 -156.5q44 14 90 14q120 0 205 -86.5t85 -206.5q0 -121 -85 -207.5t-205 -86.5h-750q-79 0 -135.5 57t-56.5 137q0 69 42.5 122.5t108.5 67.5q-2 12 -2 37q0 153 108 260.5t260 107.5z" />
-<glyph unicode="&#x26fa;" d="M774 1193.5q16 -9.5 20.5 -27t-5.5 -33.5l-136 -187l467 -746h30q20 0 35 -18.5t15 -39.5v-42h-1200v42q0 21 15 39.5t35 18.5h30l468 746l-135 183q-10 16 -5.5 34t20.5 28t34 5.5t28 -20.5l111 -148l112 150q9 16 27 20.5t34 -5zM600 200h377l-182 112l-195 534v-646z " />
-<glyph unicode="&#x2709;" d="M25 1100h1150q10 0 12.5 -5t-5.5 -13l-564 -567q-8 -8 -18 -8t-18 8l-564 567q-8 8 -5.5 13t12.5 5zM18 882l264 -264q8 -8 8 -18t-8 -18l-264 -264q-8 -8 -13 -5.5t-5 12.5v550q0 10 5 12.5t13 -5.5zM918 618l264 264q8 8 13 5.5t5 -12.5v-550q0 -10 -5 -12.5t-13 5.5 l-264 264q-8 8 -8 18t8 18zM818 482l364 -364q8 -8 5.5 -13t-12.5 -5h-1150q-10 0 -12.5 5t5.5 13l364 364q8 8 18 8t18 -8l164 -164q8 -8 18 -8t18 8l164 164q8 8 18 8t18 -8z" />
-<glyph unicode="&#x270f;" d="M1011 1210q19 0 33 -13l153 -153q13 -14 13 -33t-13 -33l-99 -92l-214 214l95 96q13 14 32 14zM1013 800l-615 -614l-214 214l614 614zM317 96l-333 -112l110 335z" />
-<glyph unicode="&#xe001;" d="M700 650v-550h250q21 0 35.5 -14.5t14.5 -35.5v-50h-800v50q0 21 14.5 35.5t35.5 14.5h250v550l-500 550h1200z" />
-<glyph unicode="&#xe002;" d="M368 1017l645 163q39 15 63 0t24 -49v-831q0 -55 -41.5 -95.5t-111.5 -63.5q-79 -25 -147 -4.5t-86 75t25.5 111.5t122.5 82q72 24 138 8v521l-600 -155v-606q0 -42 -44 -90t-109 -69q-79 -26 -147 -5.5t-86 75.5t25.5 111.5t122.5 82.5q72 24 138 7v639q0 38 14.5 59 t53.5 34z" />
-<glyph unicode="&#xe003;" d="M500 1191q100 0 191 -39t156.5 -104.5t104.5 -156.5t39 -191l-1 -2l1 -5q0 -141 -78 -262l275 -274q23 -26 22.5 -44.5t-22.5 -42.5l-59 -58q-26 -20 -46.5 -20t-39.5 20l-275 274q-119 -77 -261 -77l-5 1l-2 -1q-100 0 -191 39t-156.5 104.5t-104.5 156.5t-39 191 t39 191t104.5 156.5t156.5 104.5t191 39zM500 1022q-88 0 -162 -43t-117 -117t-43 -162t43 -162t117 -117t162 -43t162 43t117 117t43 162t-43 162t-117 117t-162 43z" />
-<glyph unicode="&#xe005;" d="M649 949q48 68 109.5 104t121.5 38.5t118.5 -20t102.5 -64t71 -100.5t27 -123q0 -57 -33.5 -117.5t-94 -124.5t-126.5 -127.5t-150 -152.5t-146 -174q-62 85 -145.5 174t-150 152.5t-126.5 127.5t-93.5 124.5t-33.5 117.5q0 64 28 123t73 100.5t104 64t119 20 t120.5 -38.5t104.5 -104z" />
-<glyph unicode="&#xe006;" d="M407 800l131 353q7 19 17.5 19t17.5 -19l129 -353h421q21 0 24 -8.5t-14 -20.5l-342 -249l130 -401q7 -20 -0.5 -25.5t-24.5 6.5l-343 246l-342 -247q-17 -12 -24.5 -6.5t-0.5 25.5l130 400l-347 251q-17 12 -14 20.5t23 8.5h429z" />
-<glyph unicode="&#xe007;" d="M407 800l131 353q7 19 17.5 19t17.5 -19l129 -353h421q21 0 24 -8.5t-14 -20.5l-342 -249l130 -401q7 -20 -0.5 -25.5t-24.5 6.5l-343 246l-342 -247q-17 -12 -24.5 -6.5t-0.5 25.5l130 400l-347 251q-17 12 -14 20.5t23 8.5h429zM477 700h-240l197 -142l-74 -226 l193 139l195 -140l-74 229l192 140h-234l-78 211z" />
-<glyph unicode="&#xe008;" d="M600 1200q124 0 212 -88t88 -212v-250q0 -46 -31 -98t-69 -52v-75q0 -10 6 -21.5t15 -17.5l358 -230q9 -5 15 -16.5t6 -21.5v-93q0 -10 -7.5 -17.5t-17.5 -7.5h-1150q-10 0 -17.5 7.5t-7.5 17.5v93q0 10 6 21.5t15 16.5l358 230q9 6 15 17.5t6 21.5v75q-38 0 -69 52 t-31 98v250q0 124 88 212t212 88z" />
-<glyph unicode="&#xe009;" d="M25 1100h1150q10 0 17.5 -7.5t7.5 -17.5v-1050q0 -10 -7.5 -17.5t-17.5 -7.5h-1150q-10 0 -17.5 7.5t-7.5 17.5v1050q0 10 7.5 17.5t17.5 7.5zM100 1000v-100h100v100h-100zM875 1000h-550q-10 0 -17.5 -7.5t-7.5 -17.5v-350q0 -10 7.5 -17.5t17.5 -7.5h550 q10 0 17.5 7.5t7.5 17.5v350q0 10 -7.5 17.5t-17.5 7.5zM1000 1000v-100h100v100h-100zM100 800v-100h100v100h-100zM1000 800v-100h100v100h-100zM100 600v-100h100v100h-100zM1000 600v-100h100v100h-100zM875 500h-550q-10 0 -17.5 -7.5t-7.5 -17.5v-350q0 -10 7.5 -17.5 t17.5 -7.5h550q10 0 17.5 7.5t7.5 17.5v350q0 10 -7.5 17.5t-17.5 7.5zM100 400v-100h100v100h-100zM1000 400v-100h100v100h-100zM100 200v-100h100v100h-100zM1000 200v-100h100v100h-100z" />
-<glyph unicode="&#xe010;" d="M50 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM650 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400 q0 21 14.5 35.5t35.5 14.5zM50 500h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM650 500h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe011;" d="M50 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200 q0 21 14.5 35.5t35.5 14.5zM850 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200 q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM850 700h200q21 0 35.5 -14.5t14.5 -35.5v-200 q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 300h200 q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM850 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5 t35.5 14.5z" />
-<glyph unicode="&#xe012;" d="M50 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 1100h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v200 q0 21 14.5 35.5t35.5 14.5zM50 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 700h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700 q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 300h700q21 0 35.5 -14.5t14.5 -35.5v-200 q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe013;" d="M465 477l571 571q8 8 18 8t17 -8l177 -177q8 -7 8 -17t-8 -18l-783 -784q-7 -8 -17.5 -8t-17.5 8l-384 384q-8 8 -8 18t8 17l177 177q7 8 17 8t18 -8l171 -171q7 -7 18 -7t18 7z" />
-<glyph unicode="&#xe014;" d="M904 1083l178 -179q8 -8 8 -18.5t-8 -17.5l-267 -268l267 -268q8 -7 8 -17.5t-8 -18.5l-178 -178q-8 -8 -18.5 -8t-17.5 8l-268 267l-268 -267q-7 -8 -17.5 -8t-18.5 8l-178 178q-8 8 -8 18.5t8 17.5l267 268l-267 268q-8 7 -8 17.5t8 18.5l178 178q8 8 18.5 8t17.5 -8 l268 -267l268 268q7 7 17.5 7t18.5 -7z" />
-<glyph unicode="&#xe015;" d="M507 1177q98 0 187.5 -38.5t154.5 -103.5t103.5 -154.5t38.5 -187.5q0 -141 -78 -262l300 -299q8 -8 8 -18.5t-8 -18.5l-109 -108q-7 -8 -17.5 -8t-18.5 8l-300 299q-119 -77 -261 -77q-98 0 -188 38.5t-154.5 103t-103 154.5t-38.5 188t38.5 187.5t103 154.5 t154.5 103.5t188 38.5zM506.5 1023q-89.5 0 -165.5 -44t-120 -120.5t-44 -166t44 -165.5t120 -120t165.5 -44t166 44t120.5 120t44 165.5t-44 166t-120.5 120.5t-166 44zM425 900h150q10 0 17.5 -7.5t7.5 -17.5v-75h75q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5 t-17.5 -7.5h-75v-75q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v75h-75q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h75v75q0 10 7.5 17.5t17.5 7.5z" />
-<glyph unicode="&#xe016;" d="M507 1177q98 0 187.5 -38.5t154.5 -103.5t103.5 -154.5t38.5 -187.5q0 -141 -78 -262l300 -299q8 -8 8 -18.5t-8 -18.5l-109 -108q-7 -8 -17.5 -8t-18.5 8l-300 299q-119 -77 -261 -77q-98 0 -188 38.5t-154.5 103t-103 154.5t-38.5 188t38.5 187.5t103 154.5 t154.5 103.5t188 38.5zM506.5 1023q-89.5 0 -165.5 -44t-120 -120.5t-44 -166t44 -165.5t120 -120t165.5 -44t166 44t120.5 120t44 165.5t-44 166t-120.5 120.5t-166 44zM325 800h350q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-350q-10 0 -17.5 7.5 t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5z" />
-<glyph unicode="&#xe017;" d="M550 1200h100q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM800 975v166q167 -62 272 -209.5t105 -331.5q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5 t-184.5 123t-123 184.5t-45.5 224q0 184 105 331.5t272 209.5v-166q-103 -55 -165 -155t-62 -220q0 -116 57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5q0 120 -62 220t-165 155z" />
-<glyph unicode="&#xe018;" d="M1025 1200h150q10 0 17.5 -7.5t7.5 -17.5v-1150q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v1150q0 10 7.5 17.5t17.5 7.5zM725 800h150q10 0 17.5 -7.5t7.5 -17.5v-750q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v750 q0 10 7.5 17.5t17.5 7.5zM425 500h150q10 0 17.5 -7.5t7.5 -17.5v-450q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v450q0 10 7.5 17.5t17.5 7.5zM125 300h150q10 0 17.5 -7.5t7.5 -17.5v-250q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5 v250q0 10 7.5 17.5t17.5 7.5z" />
-<glyph unicode="&#xe019;" d="M600 1174q33 0 74 -5l38 -152l5 -1q49 -14 94 -39l5 -2l134 80q61 -48 104 -105l-80 -134l3 -5q25 -44 39 -93l1 -6l152 -38q5 -43 5 -73q0 -34 -5 -74l-152 -38l-1 -6q-15 -49 -39 -93l-3 -5l80 -134q-48 -61 -104 -105l-134 81l-5 -3q-44 -25 -94 -39l-5 -2l-38 -151 q-43 -5 -74 -5q-33 0 -74 5l-38 151l-5 2q-49 14 -94 39l-5 3l-134 -81q-60 48 -104 105l80 134l-3 5q-25 45 -38 93l-2 6l-151 38q-6 42 -6 74q0 33 6 73l151 38l2 6q13 48 38 93l3 5l-80 134q47 61 105 105l133 -80l5 2q45 25 94 39l5 1l38 152q43 5 74 5zM600 815 q-89 0 -152 -63t-63 -151.5t63 -151.5t152 -63t152 63t63 151.5t-63 151.5t-152 63z" />
-<glyph unicode="&#xe020;" d="M500 1300h300q41 0 70.5 -29.5t29.5 -70.5v-100h275q10 0 17.5 -7.5t7.5 -17.5v-75h-1100v75q0 10 7.5 17.5t17.5 7.5h275v100q0 41 29.5 70.5t70.5 29.5zM500 1200v-100h300v100h-300zM1100 900v-800q0 -41 -29.5 -70.5t-70.5 -29.5h-700q-41 0 -70.5 29.5t-29.5 70.5 v800h900zM300 800v-700h100v700h-100zM500 800v-700h100v700h-100zM700 800v-700h100v700h-100zM900 800v-700h100v700h-100z" />
-<glyph unicode="&#xe021;" d="M18 618l620 608q8 7 18.5 7t17.5 -7l608 -608q8 -8 5.5 -13t-12.5 -5h-175v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v375h-300v-375q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v575h-175q-10 0 -12.5 5t5.5 13z" />
-<glyph unicode="&#xe022;" d="M600 1200v-400q0 -41 29.5 -70.5t70.5 -29.5h300v-650q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v1100q0 21 14.5 35.5t35.5 14.5h450zM1000 800h-250q-21 0 -35.5 14.5t-14.5 35.5v250z" />
-<glyph unicode="&#xe023;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM525 900h50q10 0 17.5 -7.5t7.5 -17.5v-275h175q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5z" />
-<glyph unicode="&#xe024;" d="M1300 0h-538l-41 400h-242l-41 -400h-538l431 1200h209l-21 -300h162l-20 300h208zM515 800l-27 -300h224l-27 300h-170z" />
-<glyph unicode="&#xe025;" d="M550 1200h200q21 0 35.5 -14.5t14.5 -35.5v-450h191q20 0 25.5 -11.5t-7.5 -27.5l-327 -400q-13 -16 -32 -16t-32 16l-327 400q-13 16 -7.5 27.5t25.5 11.5h191v450q0 21 14.5 35.5t35.5 14.5zM1125 400h50q10 0 17.5 -7.5t7.5 -17.5v-350q0 -10 -7.5 -17.5t-17.5 -7.5 h-1050q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h50q10 0 17.5 -7.5t7.5 -17.5v-175h900v175q0 10 7.5 17.5t17.5 7.5z" />
-<glyph unicode="&#xe026;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM525 900h150q10 0 17.5 -7.5t7.5 -17.5v-275h137q21 0 26 -11.5t-8 -27.5l-223 -275q-13 -16 -32 -16t-32 16l-223 275q-13 16 -8 27.5t26 11.5h137v275q0 10 7.5 17.5t17.5 7.5z " />
-<glyph unicode="&#xe027;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM632 914l223 -275q13 -16 8 -27.5t-26 -11.5h-137v-275q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v275h-137q-21 0 -26 11.5t8 27.5l223 275q13 16 32 16 t32 -16z" />
-<glyph unicode="&#xe028;" d="M225 1200h750q10 0 19.5 -7t12.5 -17l186 -652q7 -24 7 -49v-425q0 -12 -4 -27t-9 -17q-12 -6 -37 -6h-1100q-12 0 -27 4t-17 8q-6 13 -6 38l1 425q0 25 7 49l185 652q3 10 12.5 17t19.5 7zM878 1000h-556q-10 0 -19 -7t-11 -18l-87 -450q-2 -11 4 -18t16 -7h150 q10 0 19.5 -7t11.5 -17l38 -152q2 -10 11.5 -17t19.5 -7h250q10 0 19.5 7t11.5 17l38 152q2 10 11.5 17t19.5 7h150q10 0 16 7t4 18l-87 450q-2 11 -11 18t-19 7z" />
-<glyph unicode="&#xe029;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM540 820l253 -190q17 -12 17 -30t-17 -30l-253 -190q-16 -12 -28 -6.5t-12 26.5v400q0 21 12 26.5t28 -6.5z" />
-<glyph unicode="&#xe030;" d="M947 1060l135 135q7 7 12.5 5t5.5 -13v-362q0 -10 -7.5 -17.5t-17.5 -7.5h-362q-11 0 -13 5.5t5 12.5l133 133q-109 76 -238 76q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5h150q0 -117 -45.5 -224 t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117z" />
-<glyph unicode="&#xe031;" d="M947 1060l135 135q7 7 12.5 5t5.5 -13v-361q0 -11 -7.5 -18.5t-18.5 -7.5h-361q-11 0 -13 5.5t5 12.5l134 134q-110 75 -239 75q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5h-150q0 117 45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117zM1027 600h150 q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5q-192 0 -348 118l-134 -134q-7 -8 -12.5 -5.5t-5.5 12.5v360q0 11 7.5 18.5t18.5 7.5h360q10 0 12.5 -5.5t-5.5 -12.5l-133 -133q110 -76 240 -76q116 0 214.5 57t155.5 155.5t57 214.5z" />
-<glyph unicode="&#xe032;" d="M125 1200h1050q10 0 17.5 -7.5t7.5 -17.5v-1150q0 -10 -7.5 -17.5t-17.5 -7.5h-1050q-10 0 -17.5 7.5t-7.5 17.5v1150q0 10 7.5 17.5t17.5 7.5zM1075 1000h-850q-10 0 -17.5 -7.5t-7.5 -17.5v-850q0 -10 7.5 -17.5t17.5 -7.5h850q10 0 17.5 7.5t7.5 17.5v850 q0 10 -7.5 17.5t-17.5 7.5zM325 900h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 900h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 700h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 700h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 500h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 500h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 300h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 300h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5z" />
-<glyph unicode="&#xe033;" d="M900 800v200q0 83 -58.5 141.5t-141.5 58.5h-300q-82 0 -141 -59t-59 -141v-200h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-600q0 -41 29.5 -70.5t70.5 -29.5h900q41 0 70.5 29.5t29.5 70.5v600q0 41 -29.5 70.5t-70.5 29.5h-100zM400 800v150q0 21 15 35.5t35 14.5h200 q20 0 35 -14.5t15 -35.5v-150h-300z" />
-<glyph unicode="&#xe034;" d="M125 1100h50q10 0 17.5 -7.5t7.5 -17.5v-1075h-100v1075q0 10 7.5 17.5t17.5 7.5zM1075 1052q4 0 9 -2q16 -6 16 -23v-421q0 -6 -3 -12q-33 -59 -66.5 -99t-65.5 -58t-56.5 -24.5t-52.5 -6.5q-26 0 -57.5 6.5t-52.5 13.5t-60 21q-41 15 -63 22.5t-57.5 15t-65.5 7.5 q-85 0 -160 -57q-7 -5 -15 -5q-6 0 -11 3q-14 7 -14 22v438q22 55 82 98.5t119 46.5q23 2 43 0.5t43 -7t32.5 -8.5t38 -13t32.5 -11q41 -14 63.5 -21t57 -14t63.5 -7q103 0 183 87q7 8 18 8z" />
-<glyph unicode="&#xe035;" d="M600 1175q116 0 227 -49.5t192.5 -131t131 -192.5t49.5 -227v-300q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v300q0 127 -70.5 231.5t-184.5 161.5t-245 57t-245 -57t-184.5 -161.5t-70.5 -231.5v-300q0 -10 -7.5 -17.5t-17.5 -7.5h-50 q-10 0 -17.5 7.5t-7.5 17.5v300q0 116 49.5 227t131 192.5t192.5 131t227 49.5zM220 500h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14v460q0 8 6 14t14 6zM820 500h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14v460 q0 8 6 14t14 6z" />
-<glyph unicode="&#xe036;" d="M321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM900 668l120 120q7 7 17 7t17 -7l34 -34q7 -7 7 -17t-7 -17l-120 -120l120 -120q7 -7 7 -17 t-7 -17l-34 -34q-7 -7 -17 -7t-17 7l-120 119l-120 -119q-7 -7 -17 -7t-17 7l-34 34q-7 7 -7 17t7 17l119 120l-119 120q-7 7 -7 17t7 17l34 34q7 8 17 8t17 -8z" />
-<glyph unicode="&#xe037;" d="M321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM766 900h4q10 -1 16 -10q96 -129 96 -290q0 -154 -90 -281q-6 -9 -17 -10l-3 -1q-9 0 -16 6 l-29 23q-7 7 -8.5 16.5t4.5 17.5q72 103 72 229q0 132 -78 238q-6 8 -4.5 18t9.5 17l29 22q7 5 15 5z" />
-<glyph unicode="&#xe038;" d="M967 1004h3q11 -1 17 -10q135 -179 135 -396q0 -105 -34 -206.5t-98 -185.5q-7 -9 -17 -10h-3q-9 0 -16 6l-42 34q-8 6 -9 16t5 18q111 150 111 328q0 90 -29.5 176t-84.5 157q-6 9 -5 19t10 16l42 33q7 5 15 5zM321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5 t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM766 900h4q10 -1 16 -10q96 -129 96 -290q0 -154 -90 -281q-6 -9 -17 -10l-3 -1q-9 0 -16 6l-29 23q-7 7 -8.5 16.5t4.5 17.5q72 103 72 229q0 132 -78 238 q-6 8 -4.5 18.5t9.5 16.5l29 22q7 5 15 5z" />
-<glyph unicode="&#xe039;" d="M500 900h100v-100h-100v-100h-400v-100h-100v600h500v-300zM1200 700h-200v-100h200v-200h-300v300h-200v300h-100v200h600v-500zM100 1100v-300h300v300h-300zM800 1100v-300h300v300h-300zM300 900h-100v100h100v-100zM1000 900h-100v100h100v-100zM300 500h200v-500 h-500v500h200v100h100v-100zM800 300h200v-100h-100v-100h-200v100h-100v100h100v200h-200v100h300v-300zM100 400v-300h300v300h-300zM300 200h-100v100h100v-100zM1200 200h-100v100h100v-100zM700 0h-100v100h100v-100zM1200 0h-300v100h300v-100z" />
-<glyph unicode="&#xe040;" d="M100 200h-100v1000h100v-1000zM300 200h-100v1000h100v-1000zM700 200h-200v1000h200v-1000zM900 200h-100v1000h100v-1000zM1200 200h-200v1000h200v-1000zM400 0h-300v100h300v-100zM600 0h-100v91h100v-91zM800 0h-100v91h100v-91zM1100 0h-200v91h200v-91z" />
-<glyph unicode="&#xe041;" d="M500 1200l682 -682q8 -8 8 -18t-8 -18l-464 -464q-8 -8 -18 -8t-18 8l-682 682l1 475q0 10 7.5 17.5t17.5 7.5h474zM319.5 1024.5q-29.5 29.5 -71 29.5t-71 -29.5t-29.5 -71.5t29.5 -71.5t71 -29.5t71 29.5t29.5 71.5t-29.5 71.5z" />
-<glyph unicode="&#xe042;" d="M500 1200l682 -682q8 -8 8 -18t-8 -18l-464 -464q-8 -8 -18 -8t-18 8l-682 682l1 475q0 10 7.5 17.5t17.5 7.5h474zM800 1200l682 -682q8 -8 8 -18t-8 -18l-464 -464q-8 -8 -18 -8t-18 8l-56 56l424 426l-700 700h150zM319.5 1024.5q-29.5 29.5 -71 29.5t-71 -29.5 t-29.5 -71.5t29.5 -71.5t71 -29.5t71 29.5t29.5 71.5t-29.5 71.5z" />
-<glyph unicode="&#xe043;" d="M300 1200h825q75 0 75 -75v-900q0 -25 -18 -43l-64 -64q-8 -8 -13 -5.5t-5 12.5v950q0 10 -7.5 17.5t-17.5 7.5h-700q-25 0 -43 -18l-64 -64q-8 -8 -5.5 -13t12.5 -5h700q10 0 17.5 -7.5t7.5 -17.5v-950q0 -10 -7.5 -17.5t-17.5 -7.5h-850q-10 0 -17.5 7.5t-7.5 17.5v975 q0 25 18 43l139 139q18 18 43 18z" />
-<glyph unicode="&#xe044;" d="M250 1200h800q21 0 35.5 -14.5t14.5 -35.5v-1150l-450 444l-450 -445v1151q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe045;" d="M822 1200h-444q-11 0 -19 -7.5t-9 -17.5l-78 -301q-7 -24 7 -45l57 -108q6 -9 17.5 -15t21.5 -6h450q10 0 21.5 6t17.5 15l62 108q14 21 7 45l-83 301q-1 10 -9 17.5t-19 7.5zM1175 800h-150q-10 0 -21 -6.5t-15 -15.5l-78 -156q-4 -9 -15 -15.5t-21 -6.5h-550 q-10 0 -21 6.5t-15 15.5l-78 156q-4 9 -15 15.5t-21 6.5h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-650q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h750q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5 t7.5 17.5v650q0 10 -7.5 17.5t-17.5 7.5zM850 200h-500q-10 0 -19.5 -7t-11.5 -17l-38 -152q-2 -10 3.5 -17t15.5 -7h600q10 0 15.5 7t3.5 17l-38 152q-2 10 -11.5 17t-19.5 7z" />
-<glyph unicode="&#xe046;" d="M500 1100h200q56 0 102.5 -20.5t72.5 -50t44 -59t25 -50.5l6 -20h150q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v600q0 41 29.5 70.5t70.5 29.5h150q2 8 6.5 21.5t24 48t45 61t72 48t102.5 21.5zM900 800v-100 h100v100h-100zM600 730q-95 0 -162.5 -67.5t-67.5 -162.5t67.5 -162.5t162.5 -67.5t162.5 67.5t67.5 162.5t-67.5 162.5t-162.5 67.5zM600 603q43 0 73 -30t30 -73t-30 -73t-73 -30t-73 30t-30 73t30 73t73 30z" />
-<glyph unicode="&#xe047;" d="M681 1199l385 -998q20 -50 60 -92q18 -19 36.5 -29.5t27.5 -11.5l10 -2v-66h-417v66q53 0 75 43.5t5 88.5l-82 222h-391q-58 -145 -92 -234q-11 -34 -6.5 -57t25.5 -37t46 -20t55 -6v-66h-365v66q56 24 84 52q12 12 25 30.5t20 31.5l7 13l399 1006h93zM416 521h340 l-162 457z" />
-<glyph unicode="&#xe048;" d="M753 641q5 -1 14.5 -4.5t36 -15.5t50.5 -26.5t53.5 -40t50.5 -54.5t35.5 -70t14.5 -87q0 -67 -27.5 -125.5t-71.5 -97.5t-98.5 -66.5t-108.5 -40.5t-102 -13h-500v89q41 7 70.5 32.5t29.5 65.5v827q0 24 -0.5 34t-3.5 24t-8.5 19.5t-17 13.5t-28 12.5t-42.5 11.5v71 l471 -1q57 0 115.5 -20.5t108 -57t80.5 -94t31 -124.5q0 -51 -15.5 -96.5t-38 -74.5t-45 -50.5t-38.5 -30.5zM400 700h139q78 0 130.5 48.5t52.5 122.5q0 41 -8.5 70.5t-29.5 55.5t-62.5 39.5t-103.5 13.5h-118v-350zM400 200h216q80 0 121 50.5t41 130.5q0 90 -62.5 154.5 t-156.5 64.5h-159v-400z" />
-<glyph unicode="&#xe049;" d="M877 1200l2 -57q-83 -19 -116 -45.5t-40 -66.5l-132 -839q-9 -49 13 -69t96 -26v-97h-500v97q186 16 200 98l173 832q3 17 3 30t-1.5 22.5t-9 17.5t-13.5 12.5t-21.5 10t-26 8.5t-33.5 10q-13 3 -19 5v57h425z" />
-<glyph unicode="&#xe050;" d="M1300 900h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-200v-850q0 -22 25 -34.5t50 -13.5l25 -2v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v850h-200q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h1000v-300zM175 1000h-75v-800h75l-125 -167l-125 167h75v800h-75l125 167z" />
-<glyph unicode="&#xe051;" d="M1100 900h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-200v-650q0 -22 25 -34.5t50 -13.5l25 -2v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v650h-200q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h1000v-300zM1167 50l-167 -125v75h-800v-75l-167 125l167 125v-75h800v75z" />
-<glyph unicode="&#xe052;" d="M50 1100h600q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 800h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM50 500h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe053;" d="M250 1100h700q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 800h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM250 500h700q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe054;" d="M500 950v100q0 21 14.5 35.5t35.5 14.5h600q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5zM100 650v100q0 21 14.5 35.5t35.5 14.5h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000 q-21 0 -35.5 14.5t-14.5 35.5zM300 350v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5zM0 50v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100 q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5z" />
-<glyph unicode="&#xe055;" d="M50 1100h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 800h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM50 500h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe056;" d="M50 1100h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 1100h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 800h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 500h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 500h800q21 0 35.5 -14.5t14.5 -35.5v-100 q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 200h800 q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe057;" d="M400 0h-100v1100h100v-1100zM550 1100h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM550 800h500q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-500 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM267 550l-167 -125v75h-200v100h200v75zM550 500h300q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM550 200h600 q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe058;" d="M50 1100h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM900 0h-100v1100h100v-1100zM50 800h500q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-500 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM1100 600h200v-100h-200v-75l-167 125l167 125v-75zM50 500h300q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h600 q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe059;" d="M75 1000h750q31 0 53 -22t22 -53v-650q0 -31 -22 -53t-53 -22h-750q-31 0 -53 22t-22 53v650q0 31 22 53t53 22zM1200 300l-300 300l300 300v-600z" />
-<glyph unicode="&#xe060;" d="M44 1100h1112q18 0 31 -13t13 -31v-1012q0 -18 -13 -31t-31 -13h-1112q-18 0 -31 13t-13 31v1012q0 18 13 31t31 13zM100 1000v-737l247 182l298 -131l-74 156l293 318l236 -288v500h-1000zM342 884q56 0 95 -39t39 -94.5t-39 -95t-95 -39.5t-95 39.5t-39 95t39 94.5 t95 39z" />
-<glyph unicode="&#xe062;" d="M648 1169q117 0 216 -60t156.5 -161t57.5 -218q0 -115 -70 -258q-69 -109 -158 -225.5t-143 -179.5l-54 -62q-9 8 -25.5 24.5t-63.5 67.5t-91 103t-98.5 128t-95.5 148q-60 132 -60 249q0 88 34 169.5t91.5 142t137 96.5t166.5 36zM652.5 974q-91.5 0 -156.5 -65 t-65 -157t65 -156.5t156.5 -64.5t156.5 64.5t65 156.5t-65 157t-156.5 65z" />
-<glyph unicode="&#xe063;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 173v854q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57z" />
-<glyph unicode="&#xe064;" d="M554 1295q21 -72 57.5 -143.5t76 -130t83 -118t82.5 -117t70 -116t49.5 -126t18.5 -136.5q0 -71 -25.5 -135t-68.5 -111t-99 -82t-118.5 -54t-125.5 -23q-84 5 -161.5 34t-139.5 78.5t-99 125t-37 164.5q0 69 18 136.5t49.5 126.5t69.5 116.5t81.5 117.5t83.5 119 t76.5 131t58.5 143zM344 710q-23 -33 -43.5 -70.5t-40.5 -102.5t-17 -123q1 -37 14.5 -69.5t30 -52t41 -37t38.5 -24.5t33 -15q21 -7 32 -1t13 22l6 34q2 10 -2.5 22t-13.5 19q-5 4 -14 12t-29.5 40.5t-32.5 73.5q-26 89 6 271q2 11 -6 11q-8 1 -15 -10z" />
-<glyph unicode="&#xe065;" d="M1000 1013l108 115q2 1 5 2t13 2t20.5 -1t25 -9.5t28.5 -21.5q22 -22 27 -43t0 -32l-6 -10l-108 -115zM350 1100h400q50 0 105 -13l-187 -187h-368q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v182l200 200v-332 q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5zM1009 803l-362 -362l-161 -50l55 170l355 355z" />
-<glyph unicode="&#xe066;" d="M350 1100h361q-164 -146 -216 -200h-195q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5l200 153v-103q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5z M824 1073l339 -301q8 -7 8 -17.5t-8 -17.5l-340 -306q-7 -6 -12.5 -4t-6.5 11v203q-26 1 -54.5 0t-78.5 -7.5t-92 -17.5t-86 -35t-70 -57q10 59 33 108t51.5 81.5t65 58.5t68.5 40.5t67 24.5t56 13.5t40 4.5v210q1 10 6.5 12.5t13.5 -4.5z" />
-<glyph unicode="&#xe067;" d="M350 1100h350q60 0 127 -23l-178 -177h-349q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v69l200 200v-219q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5z M643 639l395 395q7 7 17.5 7t17.5 -7l101 -101q7 -7 7 -17.5t-7 -17.5l-531 -532q-7 -7 -17.5 -7t-17.5 7l-248 248q-7 7 -7 17.5t7 17.5l101 101q7 7 17.5 7t17.5 -7l111 -111q8 -7 18 -7t18 7z" />
-<glyph unicode="&#xe068;" d="M318 918l264 264q8 8 18 8t18 -8l260 -264q7 -8 4.5 -13t-12.5 -5h-170v-200h200v173q0 10 5 12t13 -5l264 -260q8 -7 8 -17.5t-8 -17.5l-264 -265q-8 -7 -13 -5t-5 12v173h-200v-200h170q10 0 12.5 -5t-4.5 -13l-260 -264q-8 -8 -18 -8t-18 8l-264 264q-8 8 -5.5 13 t12.5 5h175v200h-200v-173q0 -10 -5 -12t-13 5l-264 265q-8 7 -8 17.5t8 17.5l264 260q8 7 13 5t5 -12v-173h200v200h-175q-10 0 -12.5 5t5.5 13z" />
-<glyph unicode="&#xe069;" d="M250 1100h100q21 0 35.5 -14.5t14.5 -35.5v-438l464 453q15 14 25.5 10t10.5 -25v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v1000q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe070;" d="M50 1100h100q21 0 35.5 -14.5t14.5 -35.5v-438l464 453q15 14 25.5 10t10.5 -25v-438l464 453q15 14 25.5 10t10.5 -25v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5 t-14.5 35.5v1000q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe071;" d="M1200 1050v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -10.5 -25t-25.5 10l-492 480q-15 14 -15 35t15 35l492 480q15 14 25.5 10t10.5 -25v-438l464 453q15 14 25.5 10t10.5 -25z" />
-<glyph unicode="&#xe072;" d="M243 1074l814 -498q18 -11 18 -26t-18 -26l-814 -498q-18 -11 -30.5 -4t-12.5 28v1000q0 21 12.5 28t30.5 -4z" />
-<glyph unicode="&#xe073;" d="M250 1000h200q21 0 35.5 -14.5t14.5 -35.5v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v800q0 21 14.5 35.5t35.5 14.5zM650 1000h200q21 0 35.5 -14.5t14.5 -35.5v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v800 q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe074;" d="M1100 950v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v800q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5z" />
-<glyph unicode="&#xe075;" d="M500 612v438q0 21 10.5 25t25.5 -10l492 -480q15 -14 15 -35t-15 -35l-492 -480q-15 -14 -25.5 -10t-10.5 25v438l-464 -453q-15 -14 -25.5 -10t-10.5 25v1000q0 21 10.5 25t25.5 -10z" />
-<glyph unicode="&#xe076;" d="M1048 1102l100 1q20 0 35 -14.5t15 -35.5l5 -1000q0 -21 -14.5 -35.5t-35.5 -14.5l-100 -1q-21 0 -35.5 14.5t-14.5 35.5l-2 437l-463 -454q-14 -15 -24.5 -10.5t-10.5 25.5l-2 437l-462 -455q-15 -14 -25.5 -9.5t-10.5 24.5l-5 1000q0 21 10.5 25.5t25.5 -10.5l466 -450 l-2 438q0 20 10.5 24.5t25.5 -9.5l466 -451l-2 438q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe077;" d="M850 1100h100q21 0 35.5 -14.5t14.5 -35.5v-1000q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v438l-464 -453q-15 -14 -25.5 -10t-10.5 25v1000q0 21 10.5 25t25.5 -10l464 -453v438q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe078;" d="M686 1081l501 -540q15 -15 10.5 -26t-26.5 -11h-1042q-22 0 -26.5 11t10.5 26l501 540q15 15 36 15t36 -15zM150 400h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe079;" d="M885 900l-352 -353l352 -353l-197 -198l-552 552l552 550z" />
-<glyph unicode="&#xe080;" d="M1064 547l-551 -551l-198 198l353 353l-353 353l198 198z" />
-<glyph unicode="&#xe081;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM650 900h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-150h-150 q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5t35.5 -14.5h150v-150q0 -21 14.5 -35.5t35.5 -14.5h100q21 0 35.5 14.5t14.5 35.5v150h150q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5h-150v150q0 21 -14.5 35.5t-35.5 14.5z" />
-<glyph unicode="&#xe082;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM850 700h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5 t35.5 -14.5h500q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5z" />
-<glyph unicode="&#xe083;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM741.5 913q-12.5 0 -21.5 -9l-120 -120l-120 120q-9 9 -21.5 9 t-21.5 -9l-141 -141q-9 -9 -9 -21.5t9 -21.5l120 -120l-120 -120q-9 -9 -9 -21.5t9 -21.5l141 -141q9 -9 21.5 -9t21.5 9l120 120l120 -120q9 -9 21.5 -9t21.5 9l141 141q9 9 9 21.5t-9 21.5l-120 120l120 120q9 9 9 21.5t-9 21.5l-141 141q-9 9 -21.5 9z" />
-<glyph unicode="&#xe084;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM546 623l-84 85q-7 7 -17.5 7t-18.5 -7l-139 -139q-7 -8 -7 -18t7 -18 l242 -241q7 -8 17.5 -8t17.5 8l375 375q7 7 7 17.5t-7 18.5l-139 139q-7 7 -17.5 7t-17.5 -7z" />
-<glyph unicode="&#xe085;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM588 941q-29 0 -59 -5.5t-63 -20.5t-58 -38.5t-41.5 -63t-16.5 -89.5 q0 -25 20 -25h131q30 -5 35 11q6 20 20.5 28t45.5 8q20 0 31.5 -10.5t11.5 -28.5q0 -23 -7 -34t-26 -18q-1 0 -13.5 -4t-19.5 -7.5t-20 -10.5t-22 -17t-18.5 -24t-15.5 -35t-8 -46q-1 -8 5.5 -16.5t20.5 -8.5h173q7 0 22 8t35 28t37.5 48t29.5 74t12 100q0 47 -17 83 t-42.5 57t-59.5 34.5t-64 18t-59 4.5zM675 400h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5z" />
-<glyph unicode="&#xe086;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM675 1000h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5 t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5zM675 700h-250q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h75v-200h-75q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h350q10 0 17.5 7.5t7.5 17.5v50q0 10 -7.5 17.5 t-17.5 7.5h-75v275q0 10 -7.5 17.5t-17.5 7.5z" />
-<glyph unicode="&#xe087;" d="M525 1200h150q10 0 17.5 -7.5t7.5 -17.5v-194q103 -27 178.5 -102.5t102.5 -178.5h194q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-194q-27 -103 -102.5 -178.5t-178.5 -102.5v-194q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v194 q-103 27 -178.5 102.5t-102.5 178.5h-194q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h194q27 103 102.5 178.5t178.5 102.5v194q0 10 7.5 17.5t17.5 7.5zM700 893v-168q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v168q-68 -23 -119 -74 t-74 -119h168q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-168q23 -68 74 -119t119 -74v168q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-168q68 23 119 74t74 119h-168q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h168 q-23 68 -74 119t-119 74z" />
-<glyph unicode="&#xe088;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM759 823l64 -64q7 -7 7 -17.5t-7 -17.5l-124 -124l124 -124q7 -7 7 -17.5t-7 -17.5l-64 -64q-7 -7 -17.5 -7t-17.5 7l-124 124l-124 -124q-7 -7 -17.5 -7t-17.5 7l-64 64 q-7 7 -7 17.5t7 17.5l124 124l-124 124q-7 7 -7 17.5t7 17.5l64 64q7 7 17.5 7t17.5 -7l124 -124l124 124q7 7 17.5 7t17.5 -7z" />
-<glyph unicode="&#xe089;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM782 788l106 -106q7 -7 7 -17.5t-7 -17.5l-320 -321q-8 -7 -18 -7t-18 7l-202 203q-8 7 -8 17.5t8 17.5l106 106q7 8 17.5 8t17.5 -8l79 -79l197 197q7 7 17.5 7t17.5 -7z" />
-<glyph unicode="&#xe090;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5q0 -120 65 -225 l587 587q-105 65 -225 65zM965 819l-584 -584q104 -62 219 -62q116 0 214.5 57t155.5 155.5t57 214.5q0 115 -62 219z" />
-<glyph unicode="&#xe091;" d="M39 582l522 427q16 13 27.5 8t11.5 -26v-291h550q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-550v-291q0 -21 -11.5 -26t-27.5 8l-522 427q-16 13 -16 32t16 32z" />
-<glyph unicode="&#xe092;" d="M639 1009l522 -427q16 -13 16 -32t-16 -32l-522 -427q-16 -13 -27.5 -8t-11.5 26v291h-550q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h550v291q0 21 11.5 26t27.5 -8z" />
-<glyph unicode="&#xe093;" d="M682 1161l427 -522q13 -16 8 -27.5t-26 -11.5h-291v-550q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v550h-291q-21 0 -26 11.5t8 27.5l427 522q13 16 32 16t32 -16z" />
-<glyph unicode="&#xe094;" d="M550 1200h200q21 0 35.5 -14.5t14.5 -35.5v-550h291q21 0 26 -11.5t-8 -27.5l-427 -522q-13 -16 -32 -16t-32 16l-427 522q-13 16 -8 27.5t26 11.5h291v550q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe095;" d="M639 1109l522 -427q16 -13 16 -32t-16 -32l-522 -427q-16 -13 -27.5 -8t-11.5 26v291q-94 -2 -182 -20t-170.5 -52t-147 -92.5t-100.5 -135.5q5 105 27 193.5t67.5 167t113 135t167 91.5t225.5 42v262q0 21 11.5 26t27.5 -8z" />
-<glyph unicode="&#xe096;" d="M850 1200h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94l-249 -249q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l249 249l-94 94q-14 14 -10 24.5t25 10.5zM350 0h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l249 249 q8 7 18 7t18 -7l106 -106q7 -8 7 -18t-7 -18l-249 -249l94 -94q14 -14 10 -24.5t-25 -10.5z" />
-<glyph unicode="&#xe097;" d="M1014 1120l106 -106q7 -8 7 -18t-7 -18l-249 -249l94 -94q14 -14 10 -24.5t-25 -10.5h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l249 249q8 7 18 7t18 -7zM250 600h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94 l-249 -249q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l249 249l-94 94q-14 14 -10 24.5t25 10.5z" />
-<glyph unicode="&#xe101;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM704 900h-208q-20 0 -32 -14.5t-8 -34.5l58 -302q4 -20 21.5 -34.5 t37.5 -14.5h54q20 0 37.5 14.5t21.5 34.5l58 302q4 20 -8 34.5t-32 14.5zM675 400h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5z" />
-<glyph unicode="&#xe102;" d="M260 1200q9 0 19 -2t15 -4l5 -2q22 -10 44 -23l196 -118q21 -13 36 -24q29 -21 37 -12q11 13 49 35l196 118q22 13 45 23q17 7 38 7q23 0 47 -16.5t37 -33.5l13 -16q14 -21 18 -45l25 -123l8 -44q1 -9 8.5 -14.5t17.5 -5.5h61q10 0 17.5 -7.5t7.5 -17.5v-50 q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 -7.5t-7.5 -17.5v-175h-400v300h-200v-300h-400v175q0 10 -7.5 17.5t-17.5 7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5h61q11 0 18 3t7 8q0 4 9 52l25 128q5 25 19 45q2 3 5 7t13.5 15t21.5 19.5t26.5 15.5 t29.5 7zM915 1079l-166 -162q-7 -7 -5 -12t12 -5h219q10 0 15 7t2 17l-51 149q-3 10 -11 12t-15 -6zM463 917l-177 157q-8 7 -16 5t-11 -12l-51 -143q-3 -10 2 -17t15 -7h231q11 0 12.5 5t-5.5 12zM500 0h-375q-10 0 -17.5 7.5t-7.5 17.5v375h400v-400zM1100 400v-375 q0 -10 -7.5 -17.5t-17.5 -7.5h-375v400h400z" />
-<glyph unicode="&#xe103;" d="M1165 1190q8 3 21 -6.5t13 -17.5q-2 -178 -24.5 -323.5t-55.5 -245.5t-87 -174.5t-102.5 -118.5t-118 -68.5t-118.5 -33t-120 -4.5t-105 9.5t-90 16.5q-61 12 -78 11q-4 1 -12.5 0t-34 -14.5t-52.5 -40.5l-153 -153q-26 -24 -37 -14.5t-11 43.5q0 64 42 102q8 8 50.5 45 t66.5 58q19 17 35 47t13 61q-9 55 -10 102.5t7 111t37 130t78 129.5q39 51 80 88t89.5 63.5t94.5 45t113.5 36t129 31t157.5 37t182 47.5zM1116 1098q-8 9 -22.5 -3t-45.5 -50q-38 -47 -119 -103.5t-142 -89.5l-62 -33q-56 -30 -102 -57t-104 -68t-102.5 -80.5t-85.5 -91 t-64 -104.5q-24 -56 -31 -86t2 -32t31.5 17.5t55.5 59.5q25 30 94 75.5t125.5 77.5t147.5 81q70 37 118.5 69t102 79.5t99 111t86.5 148.5q22 50 24 60t-6 19z" />
-<glyph unicode="&#xe104;" d="M653 1231q-39 -67 -54.5 -131t-10.5 -114.5t24.5 -96.5t47.5 -80t63.5 -62.5t68.5 -46.5t65 -30q-4 7 -17.5 35t-18.5 39.5t-17 39.5t-17 43t-13 42t-9.5 44.5t-2 42t4 43t13.5 39t23 38.5q96 -42 165 -107.5t105 -138t52 -156t13 -159t-19 -149.5q-13 -55 -44 -106.5 t-68 -87t-78.5 -64.5t-72.5 -45t-53 -22q-72 -22 -127 -11q-31 6 -13 19q6 3 17 7q13 5 32.5 21t41 44t38.5 63.5t21.5 81.5t-6.5 94.5t-50 107t-104 115.5q10 -104 -0.5 -189t-37 -140.5t-65 -93t-84 -52t-93.5 -11t-95 24.5q-80 36 -131.5 114t-53.5 171q-2 23 0 49.5 t4.5 52.5t13.5 56t27.5 60t46 64.5t69.5 68.5q-8 -53 -5 -102.5t17.5 -90t34 -68.5t44.5 -39t49 -2q31 13 38.5 36t-4.5 55t-29 64.5t-36 75t-26 75.5q-15 85 2 161.5t53.5 128.5t85.5 92.5t93.5 61t81.5 25.5z" />
-<glyph unicode="&#xe105;" d="M600 1094q82 0 160.5 -22.5t140 -59t116.5 -82.5t94.5 -95t68 -95t42.5 -82.5t14 -57.5t-14 -57.5t-43 -82.5t-68.5 -95t-94.5 -95t-116.5 -82.5t-140 -59t-159.5 -22.5t-159.5 22.5t-140 59t-116.5 82.5t-94.5 95t-68.5 95t-43 82.5t-14 57.5t14 57.5t42.5 82.5t68 95 t94.5 95t116.5 82.5t140 59t160.5 22.5zM888 829q-15 15 -18 12t5 -22q25 -57 25 -119q0 -124 -88 -212t-212 -88t-212 88t-88 212q0 59 23 114q8 19 4.5 22t-17.5 -12q-70 -69 -160 -184q-13 -16 -15 -40.5t9 -42.5q22 -36 47 -71t70 -82t92.5 -81t113 -58.5t133.5 -24.5 t133.5 24t113 58.5t92.5 81.5t70 81.5t47 70.5q11 18 9 42.5t-14 41.5q-90 117 -163 189zM448 727l-35 -36q-15 -15 -19.5 -38.5t4.5 -41.5q37 -68 93 -116q16 -13 38.5 -11t36.5 17l35 34q14 15 12.5 33.5t-16.5 33.5q-44 44 -89 117q-11 18 -28 20t-32 -12z" />
-<glyph unicode="&#xe106;" d="M592 0h-148l31 120q-91 20 -175.5 68.5t-143.5 106.5t-103.5 119t-66.5 110t-22 76q0 21 14 57.5t42.5 82.5t68 95t94.5 95t116.5 82.5t140 59t160.5 22.5q61 0 126 -15l32 121h148zM944 770l47 181q108 -85 176.5 -192t68.5 -159q0 -26 -19.5 -71t-59.5 -102t-93 -112 t-129 -104.5t-158 -75.5l46 173q77 49 136 117t97 131q11 18 9 42.5t-14 41.5q-54 70 -107 130zM310 824q-70 -69 -160 -184q-13 -16 -15 -40.5t9 -42.5q18 -30 39 -60t57 -70.5t74 -73t90 -61t105 -41.5l41 154q-107 18 -178.5 101.5t-71.5 193.5q0 59 23 114q8 19 4.5 22 t-17.5 -12zM448 727l-35 -36q-15 -15 -19.5 -38.5t4.5 -41.5q37 -68 93 -116q16 -13 38.5 -11t36.5 17l12 11l22 86l-3 4q-44 44 -89 117q-11 18 -28 20t-32 -12z" />
-<glyph unicode="&#xe107;" d="M-90 100l642 1066q20 31 48 28.5t48 -35.5l642 -1056q21 -32 7.5 -67.5t-50.5 -35.5h-1294q-37 0 -50.5 34t7.5 66zM155 200h345v75q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-75h345l-445 723zM496 700h208q20 0 32 -14.5t8 -34.5l-58 -252 q-4 -20 -21.5 -34.5t-37.5 -14.5h-54q-20 0 -37.5 14.5t-21.5 34.5l-58 252q-4 20 8 34.5t32 14.5z" />
-<glyph unicode="&#xe108;" d="M650 1200q62 0 106 -44t44 -106v-339l363 -325q15 -14 26 -38.5t11 -44.5v-41q0 -20 -12 -26.5t-29 5.5l-359 249v-263q100 -93 100 -113v-64q0 -21 -13 -29t-32 1l-205 128l-205 -128q-19 -9 -32 -1t-13 29v64q0 20 100 113v263l-359 -249q-17 -12 -29 -5.5t-12 26.5v41 q0 20 11 44.5t26 38.5l363 325v339q0 62 44 106t106 44z" />
-<glyph unicode="&#xe109;" d="M850 1200h100q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-150h-1100v150q0 21 14.5 35.5t35.5 14.5h50v50q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-50h500v50q0 21 14.5 35.5t35.5 14.5zM1100 800v-750q0 -21 -14.5 -35.5 t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v750h1100zM100 600v-100h100v100h-100zM300 600v-100h100v100h-100zM500 600v-100h100v100h-100zM700 600v-100h100v100h-100zM900 600v-100h100v100h-100zM100 400v-100h100v100h-100zM300 400v-100h100v100h-100zM500 400 v-100h100v100h-100zM700 400v-100h100v100h-100zM900 400v-100h100v100h-100zM100 200v-100h100v100h-100zM300 200v-100h100v100h-100zM500 200v-100h100v100h-100zM700 200v-100h100v100h-100zM900 200v-100h100v100h-100z" />
-<glyph unicode="&#xe110;" d="M1135 1165l249 -230q15 -14 15 -35t-15 -35l-249 -230q-14 -14 -24.5 -10t-10.5 25v150h-159l-600 -600h-291q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h209l600 600h241v150q0 21 10.5 25t24.5 -10zM522 819l-141 -141l-122 122h-209q-21 0 -35.5 14.5 t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h291zM1135 565l249 -230q15 -14 15 -35t-15 -35l-249 -230q-14 -14 -24.5 -10t-10.5 25v150h-241l-181 181l141 141l122 -122h159v150q0 21 10.5 25t24.5 -10z" />
-<glyph unicode="&#xe111;" d="M100 1100h1000q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-596l-304 -300v300h-100q-41 0 -70.5 29.5t-29.5 70.5v600q0 41 29.5 70.5t70.5 29.5z" />
-<glyph unicode="&#xe112;" d="M150 1200h200q21 0 35.5 -14.5t14.5 -35.5v-250h-300v250q0 21 14.5 35.5t35.5 14.5zM850 1200h200q21 0 35.5 -14.5t14.5 -35.5v-250h-300v250q0 21 14.5 35.5t35.5 14.5zM1100 800v-300q0 -41 -3 -77.5t-15 -89.5t-32 -96t-58 -89t-89 -77t-129 -51t-174 -20t-174 20 t-129 51t-89 77t-58 89t-32 96t-15 89.5t-3 77.5v300h300v-250v-27v-42.5t1.5 -41t5 -38t10 -35t16.5 -30t25.5 -24.5t35 -19t46.5 -12t60 -4t60 4.5t46.5 12.5t35 19.5t25 25.5t17 30.5t10 35t5 38t2 40.5t-0.5 42v25v250h300z" />
-<glyph unicode="&#xe113;" d="M1100 411l-198 -199l-353 353l-353 -353l-197 199l551 551z" />
-<glyph unicode="&#xe114;" d="M1101 789l-550 -551l-551 551l198 199l353 -353l353 353z" />
-<glyph unicode="&#xe115;" d="M404 1000h746q21 0 35.5 -14.5t14.5 -35.5v-551h150q21 0 25 -10.5t-10 -24.5l-230 -249q-14 -15 -35 -15t-35 15l-230 249q-14 14 -10 24.5t25 10.5h150v401h-381zM135 984l230 -249q14 -14 10 -24.5t-25 -10.5h-150v-400h385l215 -200h-750q-21 0 -35.5 14.5 t-14.5 35.5v550h-150q-21 0 -25 10.5t10 24.5l230 249q14 15 35 15t35 -15z" />
-<glyph unicode="&#xe116;" d="M56 1200h94q17 0 31 -11t18 -27l38 -162h896q24 0 39 -18.5t10 -42.5l-100 -475q-5 -21 -27 -42.5t-55 -21.5h-633l48 -200h535q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-50q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v50h-300v-50 q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v50h-31q-18 0 -32.5 10t-20.5 19l-5 10l-201 961h-54q-20 0 -35 14.5t-15 35.5t15 35.5t35 14.5z" />
-<glyph unicode="&#xe117;" d="M1200 1000v-100h-1200v100h200q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5h500zM0 800h1200v-800h-1200v800z" />
-<glyph unicode="&#xe118;" d="M200 800l-200 -400v600h200q0 41 29.5 70.5t70.5 29.5h300q42 0 71 -29.5t29 -70.5h500v-200h-1000zM1500 700l-300 -700h-1200l300 700h1200z" />
-<glyph unicode="&#xe119;" d="M635 1184l230 -249q14 -14 10 -24.5t-25 -10.5h-150v-601h150q21 0 25 -10.5t-10 -24.5l-230 -249q-14 -15 -35 -15t-35 15l-230 249q-14 14 -10 24.5t25 10.5h150v601h-150q-21 0 -25 10.5t10 24.5l230 249q14 15 35 15t35 -15z" />
-<glyph unicode="&#xe120;" d="M936 864l249 -229q14 -15 14 -35.5t-14 -35.5l-249 -229q-15 -15 -25.5 -10.5t-10.5 24.5v151h-600v-151q0 -20 -10.5 -24.5t-25.5 10.5l-249 229q-14 15 -14 35.5t14 35.5l249 229q15 15 25.5 10.5t10.5 -25.5v-149h600v149q0 21 10.5 25.5t25.5 -10.5z" />
-<glyph unicode="&#xe121;" d="M1169 400l-172 732q-5 23 -23 45.5t-38 22.5h-672q-20 0 -38 -20t-23 -41l-172 -739h1138zM1100 300h-1000q-41 0 -70.5 -29.5t-29.5 -70.5v-100q0 -41 29.5 -70.5t70.5 -29.5h1000q41 0 70.5 29.5t29.5 70.5v100q0 41 -29.5 70.5t-70.5 29.5zM800 100v100h100v-100h-100 zM1000 100v100h100v-100h-100z" />
-<glyph unicode="&#xe122;" d="M1150 1100q21 0 35.5 -14.5t14.5 -35.5v-850q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v850q0 21 14.5 35.5t35.5 14.5zM1000 200l-675 200h-38l47 -276q3 -16 -5.5 -20t-29.5 -4h-7h-84q-20 0 -34.5 14t-18.5 35q-55 337 -55 351v250v6q0 16 1 23.5t6.5 14 t17.5 6.5h200l675 250v-850zM0 750v-250q-4 0 -11 0.5t-24 6t-30 15t-24 30t-11 48.5v50q0 26 10.5 46t25 30t29 16t25.5 7z" />
-<glyph unicode="&#xe123;" d="M553 1200h94q20 0 29 -10.5t3 -29.5l-18 -37q83 -19 144 -82.5t76 -140.5l63 -327l118 -173h17q19 0 33 -14.5t14 -35t-13 -40.5t-31 -27q-8 -4 -23 -9.5t-65 -19.5t-103 -25t-132.5 -20t-158.5 -9q-57 0 -115 5t-104 12t-88.5 15.5t-73.5 17.5t-54.5 16t-35.5 12l-11 4 q-18 8 -31 28t-13 40.5t14 35t33 14.5h17l118 173l63 327q15 77 76 140t144 83l-18 32q-6 19 3.5 32t28.5 13zM498 110q50 -6 102 -6q53 0 102 6q-12 -49 -39.5 -79.5t-62.5 -30.5t-63 30.5t-39 79.5z" />
-<glyph unicode="&#xe124;" d="M800 946l224 78l-78 -224l234 -45l-180 -155l180 -155l-234 -45l78 -224l-224 78l-45 -234l-155 180l-155 -180l-45 234l-224 -78l78 224l-234 45l180 155l-180 155l234 45l-78 224l224 -78l45 234l155 -180l155 180z" />
-<glyph unicode="&#xe125;" d="M650 1200h50q40 0 70 -40.5t30 -84.5v-150l-28 -125h328q40 0 70 -40.5t30 -84.5v-100q0 -45 -29 -74l-238 -344q-16 -24 -38 -40.5t-45 -16.5h-250q-7 0 -42 25t-66 50l-31 25h-61q-45 0 -72.5 18t-27.5 57v400q0 36 20 63l145 196l96 198q13 28 37.5 48t51.5 20z M650 1100l-100 -212l-150 -213v-375h100l136 -100h214l250 375v125h-450l50 225v175h-50zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe126;" d="M600 1100h250q23 0 45 -16.5t38 -40.5l238 -344q29 -29 29 -74v-100q0 -44 -30 -84.5t-70 -40.5h-328q28 -118 28 -125v-150q0 -44 -30 -84.5t-70 -40.5h-50q-27 0 -51.5 20t-37.5 48l-96 198l-145 196q-20 27 -20 63v400q0 39 27.5 57t72.5 18h61q124 100 139 100z M50 1000h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5zM636 1000l-136 -100h-100v-375l150 -213l100 -212h50v175l-50 225h450v125l-250 375h-214z" />
-<glyph unicode="&#xe127;" d="M356 873l363 230q31 16 53 -6l110 -112q13 -13 13.5 -32t-11.5 -34l-84 -121h302q84 0 138 -38t54 -110t-55 -111t-139 -39h-106l-131 -339q-6 -21 -19.5 -41t-28.5 -20h-342q-7 0 -90 81t-83 94v525q0 17 14 35.5t28 28.5zM400 792v-503l100 -89h293l131 339 q6 21 19.5 41t28.5 20h203q21 0 30.5 25t0.5 50t-31 25h-456h-7h-6h-5.5t-6 0.5t-5 1.5t-5 2t-4 2.5t-4 4t-2.5 4.5q-12 25 5 47l146 183l-86 83zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500 q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe128;" d="M475 1103l366 -230q2 -1 6 -3.5t14 -10.5t18 -16.5t14.5 -20t6.5 -22.5v-525q0 -13 -86 -94t-93 -81h-342q-15 0 -28.5 20t-19.5 41l-131 339h-106q-85 0 -139.5 39t-54.5 111t54 110t138 38h302l-85 121q-11 15 -10.5 34t13.5 32l110 112q22 22 53 6zM370 945l146 -183 q17 -22 5 -47q-2 -2 -3.5 -4.5t-4 -4t-4 -2.5t-5 -2t-5 -1.5t-6 -0.5h-6h-6.5h-6h-475v-100h221q15 0 29 -20t20 -41l130 -339h294l106 89v503l-342 236zM1050 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5 v500q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe129;" d="M550 1294q72 0 111 -55t39 -139v-106l339 -131q21 -6 41 -19.5t20 -28.5v-342q0 -7 -81 -90t-94 -83h-525q-17 0 -35.5 14t-28.5 28l-9 14l-230 363q-16 31 6 53l112 110q13 13 32 13.5t34 -11.5l121 -84v302q0 84 38 138t110 54zM600 972v203q0 21 -25 30.5t-50 0.5 t-25 -31v-456v-7v-6v-5.5t-0.5 -6t-1.5 -5t-2 -5t-2.5 -4t-4 -4t-4.5 -2.5q-25 -12 -47 5l-183 146l-83 -86l236 -339h503l89 100v293l-339 131q-21 6 -41 19.5t-20 28.5zM450 200h500q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-500 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe130;" d="M350 1100h500q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5t35.5 -14.5zM600 306v-106q0 -84 -39 -139t-111 -55t-110 54t-38 138v302l-121 -84q-15 -12 -34 -11.5t-32 13.5l-112 110 q-22 22 -6 53l230 363q1 2 3.5 6t10.5 13.5t16.5 17t20 13.5t22.5 6h525q13 0 94 -83t81 -90v-342q0 -15 -20 -28.5t-41 -19.5zM308 900l-236 -339l83 -86l183 146q22 17 47 5q2 -1 4.5 -2.5t4 -4t2.5 -4t2 -5t1.5 -5t0.5 -6v-5.5v-6v-7v-456q0 -22 25 -31t50 0.5t25 30.5 v203q0 15 20 28.5t41 19.5l339 131v293l-89 100h-503z" />
-<glyph unicode="&#xe131;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM914 632l-275 223q-16 13 -27.5 8t-11.5 -26v-137h-275 q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h275v-137q0 -21 11.5 -26t27.5 8l275 223q16 13 16 32t-16 32z" />
-<glyph unicode="&#xe132;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM561 855l-275 -223q-16 -13 -16 -32t16 -32l275 -223q16 -13 27.5 -8 t11.5 26v137h275q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5h-275v137q0 21 -11.5 26t-27.5 -8z" />
-<glyph unicode="&#xe133;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM855 639l-223 275q-13 16 -32 16t-32 -16l-223 -275q-13 -16 -8 -27.5 t26 -11.5h137v-275q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v275h137q21 0 26 11.5t-8 27.5z" />
-<glyph unicode="&#xe134;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM675 900h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-275h-137q-21 0 -26 -11.5 t8 -27.5l223 -275q13 -16 32 -16t32 16l223 275q13 16 8 27.5t-26 11.5h-137v275q0 10 -7.5 17.5t-17.5 7.5z" />
-<glyph unicode="&#xe135;" d="M600 1176q116 0 222.5 -46t184 -123.5t123.5 -184t46 -222.5t-46 -222.5t-123.5 -184t-184 -123.5t-222.5 -46t-222.5 46t-184 123.5t-123.5 184t-46 222.5t46 222.5t123.5 184t184 123.5t222.5 46zM627 1101q-15 -12 -36.5 -20.5t-35.5 -12t-43 -8t-39 -6.5 q-15 -3 -45.5 0t-45.5 -2q-20 -7 -51.5 -26.5t-34.5 -34.5q-3 -11 6.5 -22.5t8.5 -18.5q-3 -34 -27.5 -91t-29.5 -79q-9 -34 5 -93t8 -87q0 -9 17 -44.5t16 -59.5q12 0 23 -5t23.5 -15t19.5 -14q16 -8 33 -15t40.5 -15t34.5 -12q21 -9 52.5 -32t60 -38t57.5 -11 q7 -15 -3 -34t-22.5 -40t-9.5 -38q13 -21 23 -34.5t27.5 -27.5t36.5 -18q0 -7 -3.5 -16t-3.5 -14t5 -17q104 -2 221 112q30 29 46.5 47t34.5 49t21 63q-13 8 -37 8.5t-36 7.5q-15 7 -49.5 15t-51.5 19q-18 0 -41 -0.5t-43 -1.5t-42 -6.5t-38 -16.5q-51 -35 -66 -12 q-4 1 -3.5 25.5t0.5 25.5q-6 13 -26.5 17.5t-24.5 6.5q1 15 -0.5 30.5t-7 28t-18.5 11.5t-31 -21q-23 -25 -42 4q-19 28 -8 58q6 16 22 22q6 -1 26 -1.5t33.5 -4t19.5 -13.5q7 -12 18 -24t21.5 -20.5t20 -15t15.5 -10.5l5 -3q2 12 7.5 30.5t8 34.5t-0.5 32q-3 18 3.5 29 t18 22.5t15.5 24.5q6 14 10.5 35t8 31t15.5 22.5t34 22.5q-6 18 10 36q8 0 24 -1.5t24.5 -1.5t20 4.5t20.5 15.5q-10 23 -31 42.5t-37.5 29.5t-49 27t-43.5 23q0 1 2 8t3 11.5t1.5 10.5t-1 9.5t-4.5 4.5q31 -13 58.5 -14.5t38.5 2.5l12 5q5 28 -9.5 46t-36.5 24t-50 15 t-41 20q-18 -4 -37 0zM613 994q0 -17 8 -42t17 -45t9 -23q-8 1 -39.5 5.5t-52.5 10t-37 16.5q3 11 16 29.5t16 25.5q10 -10 19 -10t14 6t13.5 14.5t16.5 12.5z" />
-<glyph unicode="&#xe136;" d="M756 1157q164 92 306 -9l-259 -138l145 -232l251 126q6 -89 -34 -156.5t-117 -110.5q-60 -34 -127 -39.5t-126 16.5l-596 -596q-15 -16 -36.5 -16t-36.5 16l-111 110q-15 15 -15 36.5t15 37.5l600 599q-34 101 5.5 201.5t135.5 154.5z" />
-<glyph unicode="&#xe137;" horiz-adv-x="1220" d="M100 1196h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 1096h-200v-100h200v100zM100 796h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000 q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 696h-500v-100h500v100zM100 396h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 296h-300v-100h300v100z " />
-<glyph unicode="&#xe138;" d="M150 1200h900q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM700 500v-300l-200 -200v500l-350 500h900z" />
-<glyph unicode="&#xe139;" d="M500 1200h200q41 0 70.5 -29.5t29.5 -70.5v-100h300q41 0 70.5 -29.5t29.5 -70.5v-400h-500v100h-200v-100h-500v400q0 41 29.5 70.5t70.5 29.5h300v100q0 41 29.5 70.5t70.5 29.5zM500 1100v-100h200v100h-200zM1200 400v-200q0 -41 -29.5 -70.5t-70.5 -29.5h-1000 q-41 0 -70.5 29.5t-29.5 70.5v200h1200z" />
-<glyph unicode="&#xe140;" d="M50 1200h300q21 0 25 -10.5t-10 -24.5l-94 -94l199 -199q7 -8 7 -18t-7 -18l-106 -106q-8 -7 -18 -7t-18 7l-199 199l-94 -94q-14 -14 -24.5 -10t-10.5 25v300q0 21 14.5 35.5t35.5 14.5zM850 1200h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94 l-199 -199q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l199 199l-94 94q-14 14 -10 24.5t25 10.5zM364 470l106 -106q7 -8 7 -18t-7 -18l-199 -199l94 -94q14 -14 10 -24.5t-25 -10.5h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l199 199 q8 7 18 7t18 -7zM1071 271l94 94q14 14 24.5 10t10.5 -25v-300q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -25 10.5t10 24.5l94 94l-199 199q-7 8 -7 18t7 18l106 106q8 7 18 7t18 -7z" />
-<glyph unicode="&#xe141;" d="M596 1192q121 0 231.5 -47.5t190 -127t127 -190t47.5 -231.5t-47.5 -231.5t-127 -190.5t-190 -127t-231.5 -47t-231.5 47t-190.5 127t-127 190.5t-47 231.5t47 231.5t127 190t190.5 127t231.5 47.5zM596 1010q-112 0 -207.5 -55.5t-151 -151t-55.5 -207.5t55.5 -207.5 t151 -151t207.5 -55.5t207.5 55.5t151 151t55.5 207.5t-55.5 207.5t-151 151t-207.5 55.5zM454.5 905q22.5 0 38.5 -16t16 -38.5t-16 -39t-38.5 -16.5t-38.5 16.5t-16 39t16 38.5t38.5 16zM754.5 905q22.5 0 38.5 -16t16 -38.5t-16 -39t-38 -16.5q-14 0 -29 10l-55 -145 q17 -23 17 -51q0 -36 -25.5 -61.5t-61.5 -25.5t-61.5 25.5t-25.5 61.5q0 32 20.5 56.5t51.5 29.5l122 126l1 1q-9 14 -9 28q0 23 16 39t38.5 16zM345.5 709q22.5 0 38.5 -16t16 -38.5t-16 -38.5t-38.5 -16t-38.5 16t-16 38.5t16 38.5t38.5 16zM854.5 709q22.5 0 38.5 -16 t16 -38.5t-16 -38.5t-38.5 -16t-38.5 16t-16 38.5t16 38.5t38.5 16z" />
-<glyph unicode="&#xe142;" d="M546 173l469 470q91 91 99 192q7 98 -52 175.5t-154 94.5q-22 4 -47 4q-34 0 -66.5 -10t-56.5 -23t-55.5 -38t-48 -41.5t-48.5 -47.5q-376 -375 -391 -390q-30 -27 -45 -41.5t-37.5 -41t-32 -46.5t-16 -47.5t-1.5 -56.5q9 -62 53.5 -95t99.5 -33q74 0 125 51l548 548 q36 36 20 75q-7 16 -21.5 26t-32.5 10q-26 0 -50 -23q-13 -12 -39 -38l-341 -338q-15 -15 -35.5 -15.5t-34.5 13.5t-14 34.5t14 34.5q327 333 361 367q35 35 67.5 51.5t78.5 16.5q14 0 29 -1q44 -8 74.5 -35.5t43.5 -68.5q14 -47 2 -96.5t-47 -84.5q-12 -11 -32 -32 t-79.5 -81t-114.5 -115t-124.5 -123.5t-123 -119.5t-96.5 -89t-57 -45q-56 -27 -120 -27q-70 0 -129 32t-93 89q-48 78 -35 173t81 163l511 511q71 72 111 96q91 55 198 55q80 0 152 -33q78 -36 129.5 -103t66.5 -154q17 -93 -11 -183.5t-94 -156.5l-482 -476 q-15 -15 -36 -16t-37 14t-17.5 34t14.5 35z" />
-<glyph unicode="&#xe143;" d="M649 949q48 68 109.5 104t121.5 38.5t118.5 -20t102.5 -64t71 -100.5t27 -123q0 -57 -33.5 -117.5t-94 -124.5t-126.5 -127.5t-150 -152.5t-146 -174q-62 85 -145.5 174t-150 152.5t-126.5 127.5t-93.5 124.5t-33.5 117.5q0 64 28 123t73 100.5t104 64t119 20 t120.5 -38.5t104.5 -104zM896 972q-33 0 -64.5 -19t-56.5 -46t-47.5 -53.5t-43.5 -45.5t-37.5 -19t-36 19t-40 45.5t-43 53.5t-54 46t-65.5 19q-67 0 -122.5 -55.5t-55.5 -132.5q0 -23 13.5 -51t46 -65t57.5 -63t76 -75l22 -22q15 -14 44 -44t50.5 -51t46 -44t41 -35t23 -12 t23.5 12t42.5 36t46 44t52.5 52t44 43q4 4 12 13q43 41 63.5 62t52 55t46 55t26 46t11.5 44q0 79 -53 133.5t-120 54.5z" />
-<glyph unicode="&#xe144;" d="M776.5 1214q93.5 0 159.5 -66l141 -141q66 -66 66 -160q0 -42 -28 -95.5t-62 -87.5l-29 -29q-31 53 -77 99l-18 18l95 95l-247 248l-389 -389l212 -212l-105 -106l-19 18l-141 141q-66 66 -66 159t66 159l283 283q65 66 158.5 66zM600 706l105 105q10 -8 19 -17l141 -141 q66 -66 66 -159t-66 -159l-283 -283q-66 -66 -159 -66t-159 66l-141 141q-66 66 -66 159.5t66 159.5l55 55q29 -55 75 -102l18 -17l-95 -95l247 -248l389 389z" />
-<glyph unicode="&#xe145;" d="M603 1200q85 0 162 -15t127 -38t79 -48t29 -46v-953q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-41 0 -70.5 29.5t-29.5 70.5v953q0 21 30 46.5t81 48t129 37.5t163 15zM300 1000v-700h600v700h-600zM600 254q-43 0 -73.5 -30.5t-30.5 -73.5t30.5 -73.5t73.5 -30.5t73.5 30.5 t30.5 73.5t-30.5 73.5t-73.5 30.5z" />
-<glyph unicode="&#xe146;" d="M902 1185l283 -282q15 -15 15 -36t-14.5 -35.5t-35.5 -14.5t-35 15l-36 35l-279 -267v-300l-212 210l-308 -307l-280 -203l203 280l307 308l-210 212h300l267 279l-35 36q-15 14 -15 35t14.5 35.5t35.5 14.5t35 -15z" />
-<glyph unicode="&#xe148;" d="M700 1248v-78q38 -5 72.5 -14.5t75.5 -31.5t71 -53.5t52 -84t24 -118.5h-159q-4 36 -10.5 59t-21 45t-40 35.5t-64.5 20.5v-307l64 -13q34 -7 64 -16.5t70 -32t67.5 -52.5t47.5 -80t20 -112q0 -139 -89 -224t-244 -97v-77h-100v79q-150 16 -237 103q-40 40 -52.5 93.5 t-15.5 139.5h139q5 -77 48.5 -126t117.5 -65v335l-27 8q-46 14 -79 26.5t-72 36t-63 52t-40 72.5t-16 98q0 70 25 126t67.5 92t94.5 57t110 27v77h100zM600 754v274q-29 -4 -50 -11t-42 -21.5t-31.5 -41.5t-10.5 -65q0 -29 7 -50.5t16.5 -34t28.5 -22.5t31.5 -14t37.5 -10 q9 -3 13 -4zM700 547v-310q22 2 42.5 6.5t45 15.5t41.5 27t29 42t12 59.5t-12.5 59.5t-38 44.5t-53 31t-66.5 24.5z" />
-<glyph unicode="&#xe149;" d="M561 1197q84 0 160.5 -40t123.5 -109.5t47 -147.5h-153q0 40 -19.5 71.5t-49.5 48.5t-59.5 26t-55.5 9q-37 0 -79 -14.5t-62 -35.5q-41 -44 -41 -101q0 -26 13.5 -63t26.5 -61t37 -66q6 -9 9 -14h241v-100h-197q8 -50 -2.5 -115t-31.5 -95q-45 -62 -99 -112 q34 10 83 17.5t71 7.5q32 1 102 -16t104 -17q83 0 136 30l50 -147q-31 -19 -58 -30.5t-55 -15.5t-42 -4.5t-46 -0.5q-23 0 -76 17t-111 32.5t-96 11.5q-39 -3 -82 -16t-67 -25l-23 -11l-55 145q4 3 16 11t15.5 10.5t13 9t15.5 12t14.5 14t17.5 18.5q48 55 54 126.5 t-30 142.5h-221v100h166q-23 47 -44 104q-7 20 -12 41.5t-6 55.5t6 66.5t29.5 70.5t58.5 71q97 88 263 88z" />
-<glyph unicode="&#xe150;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM935 1184l230 -249q14 -14 10 -24.5t-25 -10.5h-150v-900h-200v900h-150q-21 0 -25 10.5t10 24.5l230 249q14 15 35 15t35 -15z" />
-<glyph unicode="&#xe151;" d="M1000 700h-100v100h-100v-100h-100v500h300v-500zM400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM801 1100v-200h100v200h-100zM1000 350l-200 -250h200v-100h-300v150l200 250h-200v100h300v-150z " />
-<glyph unicode="&#xe152;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1000 1050l-200 -250h200v-100h-300v150l200 250h-200v100h300v-150zM1000 0h-100v100h-100v-100h-100v500h300v-500zM801 400v-200h100v200h-100z " />
-<glyph unicode="&#xe153;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1000 700h-100v400h-100v100h200v-500zM1100 0h-100v100h-200v400h300v-500zM901 400v-200h100v200h-100z" />
-<glyph unicode="&#xe154;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1100 700h-100v100h-200v400h300v-500zM901 1100v-200h100v200h-100zM1000 0h-100v400h-100v100h200v-500z" />
-<glyph unicode="&#xe155;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM900 1000h-200v200h200v-200zM1000 700h-300v200h300v-200zM1100 400h-400v200h400v-200zM1200 100h-500v200h500v-200z" />
-<glyph unicode="&#xe156;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1200 1000h-500v200h500v-200zM1100 700h-400v200h400v-200zM1000 400h-300v200h300v-200zM900 100h-200v200h200v-200z" />
-<glyph unicode="&#xe157;" d="M350 1100h400q162 0 256 -93.5t94 -256.5v-400q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5z" />
-<glyph unicode="&#xe158;" d="M350 1100h400q165 0 257.5 -92.5t92.5 -257.5v-400q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-163 0 -256.5 92.5t-93.5 257.5v400q0 163 94 256.5t256 93.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5zM440 770l253 -190q17 -12 17 -30t-17 -30l-253 -190q-16 -12 -28 -6.5t-12 26.5v400q0 21 12 26.5t28 -6.5z" />
-<glyph unicode="&#xe159;" d="M350 1100h400q163 0 256.5 -94t93.5 -256v-400q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 163 92.5 256.5t257.5 93.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5zM350 700h400q21 0 26.5 -12t-6.5 -28l-190 -253q-12 -17 -30 -17t-30 17l-190 253q-12 16 -6.5 28t26.5 12z" />
-<glyph unicode="&#xe160;" d="M350 1100h400q165 0 257.5 -92.5t92.5 -257.5v-400q0 -163 -92.5 -256.5t-257.5 -93.5h-400q-163 0 -256.5 94t-93.5 256v400q0 165 92.5 257.5t257.5 92.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5zM580 693l190 -253q12 -16 6.5 -28t-26.5 -12h-400q-21 0 -26.5 12t6.5 28l190 253q12 17 30 17t30 -17z" />
-<glyph unicode="&#xe161;" d="M550 1100h400q165 0 257.5 -92.5t92.5 -257.5v-400q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h450q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5h-450q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM338 867l324 -284q16 -14 16 -33t-16 -33l-324 -284q-16 -14 -27 -9t-11 26v150h-250q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h250v150q0 21 11 26t27 -9z" />
-<glyph unicode="&#xe162;" d="M793 1182l9 -9q8 -10 5 -27q-3 -11 -79 -225.5t-78 -221.5l300 1q24 0 32.5 -17.5t-5.5 -35.5q-1 0 -133.5 -155t-267 -312.5t-138.5 -162.5q-12 -15 -26 -15h-9l-9 8q-9 11 -4 32q2 9 42 123.5t79 224.5l39 110h-302q-23 0 -31 19q-10 21 6 41q75 86 209.5 237.5 t228 257t98.5 111.5q9 16 25 16h9z" />
-<glyph unicode="&#xe163;" d="M350 1100h400q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-450q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h450q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400 q0 165 92.5 257.5t257.5 92.5zM938 867l324 -284q16 -14 16 -33t-16 -33l-324 -284q-16 -14 -27 -9t-11 26v150h-250q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h250v150q0 21 11 26t27 -9z" />
-<glyph unicode="&#xe164;" d="M750 1200h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -10.5 -25t-24.5 10l-109 109l-312 -312q-15 -15 -35.5 -15t-35.5 15l-141 141q-15 15 -15 35.5t15 35.5l312 312l-109 109q-14 14 -10 24.5t25 10.5zM456 900h-156q-41 0 -70.5 -29.5t-29.5 -70.5v-500 q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v148l200 200v-298q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5h300z" />
-<glyph unicode="&#xe165;" d="M600 1186q119 0 227.5 -46.5t187 -125t125 -187t46.5 -227.5t-46.5 -227.5t-125 -187t-187 -125t-227.5 -46.5t-227.5 46.5t-187 125t-125 187t-46.5 227.5t46.5 227.5t125 187t187 125t227.5 46.5zM600 1022q-115 0 -212 -56.5t-153.5 -153.5t-56.5 -212t56.5 -212 t153.5 -153.5t212 -56.5t212 56.5t153.5 153.5t56.5 212t-56.5 212t-153.5 153.5t-212 56.5zM600 794q80 0 137 -57t57 -137t-57 -137t-137 -57t-137 57t-57 137t57 137t137 57z" />
-<glyph unicode="&#xe166;" d="M450 1200h200q21 0 35.5 -14.5t14.5 -35.5v-350h245q20 0 25 -11t-9 -26l-383 -426q-14 -15 -33.5 -15t-32.5 15l-379 426q-13 15 -8.5 26t25.5 11h250v350q0 21 14.5 35.5t35.5 14.5zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5z M900 200v-50h100v50h-100z" />
-<glyph unicode="&#xe167;" d="M583 1182l378 -435q14 -15 9 -31t-26 -16h-244v-250q0 -20 -17 -35t-39 -15h-200q-20 0 -32 14.5t-12 35.5v250h-250q-20 0 -25.5 16.5t8.5 31.5l383 431q14 16 33.5 17t33.5 -14zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5z M900 200v-50h100v50h-100z" />
-<glyph unicode="&#xe168;" d="M396 723l369 369q7 7 17.5 7t17.5 -7l139 -139q7 -8 7 -18.5t-7 -17.5l-525 -525q-7 -8 -17.5 -8t-17.5 8l-292 291q-7 8 -7 18t7 18l139 139q8 7 18.5 7t17.5 -7zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5zM900 200v-50h100v50 h-100z" />
-<glyph unicode="&#xe169;" d="M135 1023l142 142q14 14 35 14t35 -14l77 -77l-212 -212l-77 76q-14 15 -14 36t14 35zM655 855l210 210q14 14 24.5 10t10.5 -25l-2 -599q-1 -20 -15.5 -35t-35.5 -15l-597 -1q-21 0 -25 10.5t10 24.5l208 208l-154 155l212 212zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5 v-250h-1100v250q0 21 14.5 35.5t35.5 14.5zM900 200v-50h100v50h-100z" />
-<glyph unicode="&#xe170;" d="M350 1200l599 -2q20 -1 35 -15.5t15 -35.5l1 -597q0 -21 -10.5 -25t-24.5 10l-208 208l-155 -154l-212 212l155 154l-210 210q-14 14 -10 24.5t25 10.5zM524 512l-76 -77q-15 -14 -36 -14t-35 14l-142 142q-14 14 -14 35t14 35l77 77zM50 300h1000q21 0 35.5 -14.5 t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5zM900 200v-50h100v50h-100z" />
-<glyph unicode="&#xe171;" d="M1200 103l-483 276l-314 -399v423h-399l1196 796v-1096zM483 424v-230l683 953z" />
-<glyph unicode="&#xe172;" d="M1100 1000v-850q0 -21 -14.5 -35.5t-35.5 -14.5h-150v400h-700v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200z" />
-<glyph unicode="&#xe173;" d="M1100 1000l-2 -149l-299 -299l-95 95q-9 9 -21.5 9t-21.5 -9l-149 -147h-312v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM1132 638l106 -106q7 -7 7 -17.5t-7 -17.5l-420 -421q-8 -7 -18 -7 t-18 7l-202 203q-8 7 -8 17.5t8 17.5l106 106q7 8 17.5 8t17.5 -8l79 -79l297 297q7 7 17.5 7t17.5 -7z" />
-<glyph unicode="&#xe174;" d="M1100 1000v-269l-103 -103l-134 134q-15 15 -33.5 16.5t-34.5 -12.5l-266 -266h-329v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM1202 572l70 -70q15 -15 15 -35.5t-15 -35.5l-131 -131 l131 -131q15 -15 15 -35.5t-15 -35.5l-70 -70q-15 -15 -35.5 -15t-35.5 15l-131 131l-131 -131q-15 -15 -35.5 -15t-35.5 15l-70 70q-15 15 -15 35.5t15 35.5l131 131l-131 131q-15 15 -15 35.5t15 35.5l70 70q15 15 35.5 15t35.5 -15l131 -131l131 131q15 15 35.5 15 t35.5 -15z" />
-<glyph unicode="&#xe175;" d="M1100 1000v-300h-350q-21 0 -35.5 -14.5t-14.5 -35.5v-150h-500v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM850 600h100q21 0 35.5 -14.5t14.5 -35.5v-250h150q21 0 25 -10.5t-10 -24.5 l-230 -230q-14 -14 -35 -14t-35 14l-230 230q-14 14 -10 24.5t25 10.5h150v250q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe176;" d="M1100 1000v-400l-165 165q-14 15 -35 15t-35 -15l-263 -265h-402v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM935 565l230 -229q14 -15 10 -25.5t-25 -10.5h-150v-250q0 -20 -14.5 -35 t-35.5 -15h-100q-21 0 -35.5 15t-14.5 35v250h-150q-21 0 -25 10.5t10 25.5l230 229q14 15 35 15t35 -15z" />
-<glyph unicode="&#xe177;" d="M50 1100h1100q21 0 35.5 -14.5t14.5 -35.5v-150h-1200v150q0 21 14.5 35.5t35.5 14.5zM1200 800v-550q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v550h1200zM100 500v-200h400v200h-400z" />
-<glyph unicode="&#xe178;" d="M935 1165l248 -230q14 -14 14 -35t-14 -35l-248 -230q-14 -14 -24.5 -10t-10.5 25v150h-400v200h400v150q0 21 10.5 25t24.5 -10zM200 800h-50q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v-200zM400 800h-100v200h100v-200zM18 435l247 230 q14 14 24.5 10t10.5 -25v-150h400v-200h-400v-150q0 -21 -10.5 -25t-24.5 10l-247 230q-15 14 -15 35t15 35zM900 300h-100v200h100v-200zM1000 500h51q20 0 34.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-34.5 -14.5h-51v200z" />
-<glyph unicode="&#xe179;" d="M862 1073l276 116q25 18 43.5 8t18.5 -41v-1106q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v397q-4 1 -11 5t-24 17.5t-30 29t-24 42t-11 56.5v359q0 31 18.5 65t43.5 52zM550 1200q22 0 34.5 -12.5t14.5 -24.5l1 -13v-450q0 -28 -10.5 -59.5 t-25 -56t-29 -45t-25.5 -31.5l-10 -11v-447q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v447q-4 4 -11 11.5t-24 30.5t-30 46t-24 55t-11 60v450q0 2 0.5 5.5t4 12t8.5 15t14.5 12t22.5 5.5q20 0 32.5 -12.5t14.5 -24.5l3 -13v-350h100v350v5.5t2.5 12 t7 15t15 12t25.5 5.5q23 0 35.5 -12.5t13.5 -24.5l1 -13v-350h100v350q0 2 0.5 5.5t3 12t7 15t15 12t24.5 5.5z" />
-<glyph unicode="&#xe180;" d="M1200 1100v-56q-4 0 -11 -0.5t-24 -3t-30 -7.5t-24 -15t-11 -24v-888q0 -22 25 -34.5t50 -13.5l25 -2v-56h-400v56q75 0 87.5 6.5t12.5 43.5v394h-500v-394q0 -37 12.5 -43.5t87.5 -6.5v-56h-400v56q4 0 11 0.5t24 3t30 7.5t24 15t11 24v888q0 22 -25 34.5t-50 13.5 l-25 2v56h400v-56q-75 0 -87.5 -6.5t-12.5 -43.5v-394h500v394q0 37 -12.5 43.5t-87.5 6.5v56h400z" />
-<glyph unicode="&#xe181;" d="M675 1000h375q21 0 35.5 -14.5t14.5 -35.5v-150h-105l-295 -98v98l-200 200h-400l100 100h375zM100 900h300q41 0 70.5 -29.5t29.5 -70.5v-500q0 -41 -29.5 -70.5t-70.5 -29.5h-300q-41 0 -70.5 29.5t-29.5 70.5v500q0 41 29.5 70.5t70.5 29.5zM100 800v-200h300v200 h-300zM1100 535l-400 -133v163l400 133v-163zM100 500v-200h300v200h-300zM1100 398v-248q0 -21 -14.5 -35.5t-35.5 -14.5h-375l-100 -100h-375l-100 100h400l200 200h105z" />
-<glyph unicode="&#xe182;" d="M17 1007l162 162q17 17 40 14t37 -22l139 -194q14 -20 11 -44.5t-20 -41.5l-119 -118q102 -142 228 -268t267 -227l119 118q17 17 42.5 19t44.5 -12l192 -136q19 -14 22.5 -37.5t-13.5 -40.5l-163 -162q-3 -1 -9.5 -1t-29.5 2t-47.5 6t-62.5 14.5t-77.5 26.5t-90 42.5 t-101.5 60t-111 83t-119 108.5q-74 74 -133.5 150.5t-94.5 138.5t-60 119.5t-34.5 100t-15 74.5t-4.5 48z" />
-<glyph unicode="&#xe183;" d="M600 1100q92 0 175 -10.5t141.5 -27t108.5 -36.5t81.5 -40t53.5 -37t31 -27l9 -10v-200q0 -21 -14.5 -33t-34.5 -9l-202 34q-20 3 -34.5 20t-14.5 38v146q-141 24 -300 24t-300 -24v-146q0 -21 -14.5 -38t-34.5 -20l-202 -34q-20 -3 -34.5 9t-14.5 33v200q3 4 9.5 10.5 t31 26t54 37.5t80.5 39.5t109 37.5t141 26.5t175 10.5zM600 795q56 0 97 -9.5t60 -23.5t30 -28t12 -24l1 -10v-50l365 -303q14 -15 24.5 -40t10.5 -45v-212q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v212q0 20 10.5 45t24.5 40l365 303v50 q0 4 1 10.5t12 23t30 29t60 22.5t97 10z" />
-<glyph unicode="&#xe184;" d="M1100 700l-200 -200h-600l-200 200v500h200v-200h200v200h200v-200h200v200h200v-500zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-12l137 -100h-950l137 100h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5 t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe185;" d="M700 1100h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-1000h300v1000q0 41 -29.5 70.5t-70.5 29.5zM1100 800h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-700h300v700q0 41 -29.5 70.5t-70.5 29.5zM400 0h-300v400q0 41 29.5 70.5t70.5 29.5h100q41 0 70.5 -29.5t29.5 -70.5v-400z " />
-<glyph unicode="&#xe186;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 700h-200v-100h200v-300h-300v100h200v100h-200v300h300v-100zM900 700v-300l-100 -100h-200v500h200z M700 700v-300h100v300h-100z" />
-<glyph unicode="&#xe187;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 300h-100v200h-100v-200h-100v500h100v-200h100v200h100v-500zM900 700v-300l-100 -100h-200v500h200z M700 700v-300h100v300h-100z" />
-<glyph unicode="&#xe188;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 700h-200v-300h200v-100h-300v500h300v-100zM900 700h-200v-300h200v-100h-300v500h300v-100z" />
-<glyph unicode="&#xe189;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 400l-300 150l300 150v-300zM900 550l-300 -150v300z" />
-<glyph unicode="&#xe190;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM900 300h-700v500h700v-500zM800 700h-130q-38 0 -66.5 -43t-28.5 -108t27 -107t68 -42h130v300zM300 700v-300 h130q41 0 68 42t27 107t-28.5 108t-66.5 43h-130z" />
-<glyph unicode="&#xe191;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 700h-200v-100h200v-300h-300v100h200v100h-200v300h300v-100zM900 300h-100v400h-100v100h200v-500z M700 300h-100v100h100v-100z" />
-<glyph unicode="&#xe192;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM300 700h200v-400h-300v500h100v-100zM900 300h-100v400h-100v100h200v-500zM300 600v-200h100v200h-100z M700 300h-100v100h100v-100z" />
-<glyph unicode="&#xe193;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 500l-199 -200h-100v50l199 200v150h-200v100h300v-300zM900 300h-100v400h-100v100h200v-500zM701 300h-100 v100h100v-100z" />
-<glyph unicode="&#xe194;" d="M600 1191q120 0 229.5 -47t188.5 -126t126 -188.5t47 -229.5t-47 -229.5t-126 -188.5t-188.5 -126t-229.5 -47t-229.5 47t-188.5 126t-126 188.5t-47 229.5t47 229.5t126 188.5t188.5 126t229.5 47zM600 1021q-114 0 -211 -56.5t-153.5 -153.5t-56.5 -211t56.5 -211 t153.5 -153.5t211 -56.5t211 56.5t153.5 153.5t56.5 211t-56.5 211t-153.5 153.5t-211 56.5zM800 700h-300v-200h300v-100h-300l-100 100v200l100 100h300v-100z" />
-<glyph unicode="&#xe195;" d="M600 1191q120 0 229.5 -47t188.5 -126t126 -188.5t47 -229.5t-47 -229.5t-126 -188.5t-188.5 -126t-229.5 -47t-229.5 47t-188.5 126t-126 188.5t-47 229.5t47 229.5t126 188.5t188.5 126t229.5 47zM600 1021q-114 0 -211 -56.5t-153.5 -153.5t-56.5 -211t56.5 -211 t153.5 -153.5t211 -56.5t211 56.5t153.5 153.5t56.5 211t-56.5 211t-153.5 153.5t-211 56.5zM800 700v-100l-50 -50l100 -100v-50h-100l-100 100h-150v-100h-100v400h300zM500 700v-100h200v100h-200z" />
-<glyph unicode="&#xe197;" d="M503 1089q110 0 200.5 -59.5t134.5 -156.5q44 14 90 14q120 0 205 -86.5t85 -207t-85 -207t-205 -86.5h-128v250q0 21 -14.5 35.5t-35.5 14.5h-300q-21 0 -35.5 -14.5t-14.5 -35.5v-250h-222q-80 0 -136 57.5t-56 136.5q0 69 43 122.5t108 67.5q-2 19 -2 37q0 100 49 185 t134 134t185 49zM525 500h150q10 0 17.5 -7.5t7.5 -17.5v-275h137q21 0 26 -11.5t-8 -27.5l-223 -244q-13 -16 -32 -16t-32 16l-223 244q-13 16 -8 27.5t26 11.5h137v275q0 10 7.5 17.5t17.5 7.5z" />
-<glyph unicode="&#xe198;" d="M502 1089q110 0 201 -59.5t135 -156.5q43 15 89 15q121 0 206 -86.5t86 -206.5q0 -99 -60 -181t-150 -110l-378 360q-13 16 -31.5 16t-31.5 -16l-381 -365h-9q-79 0 -135.5 57.5t-56.5 136.5q0 69 43 122.5t108 67.5q-2 19 -2 38q0 100 49 184.5t133.5 134t184.5 49.5z M632 467l223 -228q13 -16 8 -27.5t-26 -11.5h-137v-275q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v275h-137q-21 0 -26 11.5t8 27.5q199 204 223 228q19 19 31.5 19t32.5 -19z" />
-<glyph unicode="&#xe199;" d="M700 100v100h400l-270 300h170l-270 300h170l-300 333l-300 -333h170l-270 -300h170l-270 -300h400v-100h-50q-21 0 -35.5 -14.5t-14.5 -35.5v-50h400v50q0 21 -14.5 35.5t-35.5 14.5h-50z" />
-<glyph unicode="&#xe200;" d="M600 1179q94 0 167.5 -56.5t99.5 -145.5q89 -6 150.5 -71.5t61.5 -155.5q0 -61 -29.5 -112.5t-79.5 -82.5q9 -29 9 -55q0 -74 -52.5 -126.5t-126.5 -52.5q-55 0 -100 30v-251q21 0 35.5 -14.5t14.5 -35.5v-50h-300v50q0 21 14.5 35.5t35.5 14.5v251q-45 -30 -100 -30 q-74 0 -126.5 52.5t-52.5 126.5q0 18 4 38q-47 21 -75.5 65t-28.5 97q0 74 52.5 126.5t126.5 52.5q5 0 23 -2q0 2 -1 10t-1 13q0 116 81.5 197.5t197.5 81.5z" />
-<glyph unicode="&#xe201;" d="M1010 1010q111 -111 150.5 -260.5t0 -299t-150.5 -260.5q-83 -83 -191.5 -126.5t-218.5 -43.5t-218.5 43.5t-191.5 126.5q-111 111 -150.5 260.5t0 299t150.5 260.5q83 83 191.5 126.5t218.5 43.5t218.5 -43.5t191.5 -126.5zM476 1065q-4 0 -8 -1q-121 -34 -209.5 -122.5 t-122.5 -209.5q-4 -12 2.5 -23t18.5 -14l36 -9q3 -1 7 -1q23 0 29 22q27 96 98 166q70 71 166 98q11 3 17.5 13.5t3.5 22.5l-9 35q-3 13 -14 19q-7 4 -15 4zM512 920q-4 0 -9 -2q-80 -24 -138.5 -82.5t-82.5 -138.5q-4 -13 2 -24t19 -14l34 -9q4 -1 8 -1q22 0 28 21 q18 58 58.5 98.5t97.5 58.5q12 3 18 13.5t3 21.5l-9 35q-3 12 -14 19q-7 4 -15 4zM719.5 719.5q-49.5 49.5 -119.5 49.5t-119.5 -49.5t-49.5 -119.5t49.5 -119.5t119.5 -49.5t119.5 49.5t49.5 119.5t-49.5 119.5zM855 551q-22 0 -28 -21q-18 -58 -58.5 -98.5t-98.5 -57.5 q-11 -4 -17 -14.5t-3 -21.5l9 -35q3 -12 14 -19q7 -4 15 -4q4 0 9 2q80 24 138.5 82.5t82.5 138.5q4 13 -2.5 24t-18.5 14l-34 9q-4 1 -8 1zM1000 515q-23 0 -29 -22q-27 -96 -98 -166q-70 -71 -166 -98q-11 -3 -17.5 -13.5t-3.5 -22.5l9 -35q3 -13 14 -19q7 -4 15 -4 q4 0 8 1q121 34 209.5 122.5t122.5 209.5q4 12 -2.5 23t-18.5 14l-36 9q-3 1 -7 1z" />
-<glyph unicode="&#xe202;" d="M700 800h300v-380h-180v200h-340v-200h-380v755q0 10 7.5 17.5t17.5 7.5h575v-400zM1000 900h-200v200zM700 300h162l-212 -212l-212 212h162v200h100v-200zM520 0h-395q-10 0 -17.5 7.5t-7.5 17.5v395zM1000 220v-195q0 -10 -7.5 -17.5t-17.5 -7.5h-195z" />
-<glyph unicode="&#xe203;" d="M700 800h300v-520l-350 350l-550 -550v1095q0 10 7.5 17.5t17.5 7.5h575v-400zM1000 900h-200v200zM862 200h-162v-200h-100v200h-162l212 212zM480 0h-355q-10 0 -17.5 7.5t-7.5 17.5v55h380v-80zM1000 80v-55q0 -10 -7.5 -17.5t-17.5 -7.5h-155v80h180z" />
-<glyph unicode="&#xe204;" d="M1162 800h-162v-200h100l100 -100h-300v300h-162l212 212zM200 800h200q27 0 40 -2t29.5 -10.5t23.5 -30t7 -57.5h300v-100h-600l-200 -350v450h100q0 36 7 57.5t23.5 30t29.5 10.5t40 2zM800 400h240l-240 -400h-800l300 500h500v-100z" />
-<glyph unicode="&#xe205;" d="M650 1100h100q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v50q0 21 14.5 35.5t35.5 14.5zM1000 850v150q41 0 70.5 -29.5t29.5 -70.5v-800 q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-1 0 -20 4l246 246l-326 326v324q0 41 29.5 70.5t70.5 29.5v-150q0 -62 44 -106t106 -44h300q62 0 106 44t44 106zM412 250l-212 -212v162h-200v100h200v162z" />
-<glyph unicode="&#xe206;" d="M450 1100h100q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v50q0 21 14.5 35.5t35.5 14.5zM800 850v150q41 0 70.5 -29.5t29.5 -70.5v-500 h-200v-300h200q0 -36 -7 -57.5t-23.5 -30t-29.5 -10.5t-40 -2h-600q-41 0 -70.5 29.5t-29.5 70.5v800q0 41 29.5 70.5t70.5 29.5v-150q0 -62 44 -106t106 -44h300q62 0 106 44t44 106zM1212 250l-212 -212v162h-200v100h200v162z" />
-<glyph unicode="&#xe209;" d="M658 1197l637 -1104q23 -38 7 -65.5t-60 -27.5h-1276q-44 0 -60 27.5t7 65.5l637 1104q22 39 54 39t54 -39zM704 800h-208q-20 0 -32 -14.5t-8 -34.5l58 -302q4 -20 21.5 -34.5t37.5 -14.5h54q20 0 37.5 14.5t21.5 34.5l58 302q4 20 -8 34.5t-32 14.5zM500 300v-100h200 v100h-200z" />
-<glyph unicode="&#xe210;" d="M425 1100h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM425 800h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5 t17.5 7.5zM825 800h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM25 500h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150 q0 10 7.5 17.5t17.5 7.5zM425 500h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM825 500h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5 v150q0 10 7.5 17.5t17.5 7.5zM25 200h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM425 200h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5 t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM825 200h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5z" />
-<glyph unicode="&#xe211;" d="M700 1200h100v-200h-100v-100h350q62 0 86.5 -39.5t-3.5 -94.5l-66 -132q-41 -83 -81 -134h-772q-40 51 -81 134l-66 132q-28 55 -3.5 94.5t86.5 39.5h350v100h-100v200h100v100h200v-100zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-12l137 -100 h-950l138 100h-13q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe212;" d="M600 1300q40 0 68.5 -29.5t28.5 -70.5h-194q0 41 28.5 70.5t68.5 29.5zM443 1100h314q18 -37 18 -75q0 -8 -3 -25h328q41 0 44.5 -16.5t-30.5 -38.5l-175 -145h-678l-178 145q-34 22 -29 38.5t46 16.5h328q-3 17 -3 25q0 38 18 75zM250 700h700q21 0 35.5 -14.5 t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-150v-200l275 -200h-950l275 200v200h-150q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe213;" d="M600 1181q75 0 128 -53t53 -128t-53 -128t-128 -53t-128 53t-53 128t53 128t128 53zM602 798h46q34 0 55.5 -28.5t21.5 -86.5q0 -76 39 -183h-324q39 107 39 183q0 58 21.5 86.5t56.5 28.5h45zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-13 l138 -100h-950l137 100h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe214;" d="M600 1300q47 0 92.5 -53.5t71 -123t25.5 -123.5q0 -78 -55.5 -133.5t-133.5 -55.5t-133.5 55.5t-55.5 133.5q0 62 34 143l144 -143l111 111l-163 163q34 26 63 26zM602 798h46q34 0 55.5 -28.5t21.5 -86.5q0 -76 39 -183h-324q39 107 39 183q0 58 21.5 86.5t56.5 28.5h45 zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-13l138 -100h-950l137 100h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe215;" d="M600 1200l300 -161v-139h-300q0 -57 18.5 -108t50 -91.5t63 -72t70 -67.5t57.5 -61h-530q-60 83 -90.5 177.5t-30.5 178.5t33 164.5t87.5 139.5t126 96.5t145.5 41.5v-98zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-13l138 -100h-950l137 100 h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe216;" d="M600 1300q41 0 70.5 -29.5t29.5 -70.5v-78q46 -26 73 -72t27 -100v-50h-400v50q0 54 27 100t73 72v78q0 41 29.5 70.5t70.5 29.5zM400 800h400q54 0 100 -27t72 -73h-172v-100h200v-100h-200v-100h200v-100h-200v-100h200q0 -83 -58.5 -141.5t-141.5 -58.5h-400 q-83 0 -141.5 58.5t-58.5 141.5v400q0 83 58.5 141.5t141.5 58.5z" />
-<glyph unicode="&#xe218;" d="M150 1100h900q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5zM125 400h950q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-283l224 -224q13 -13 13 -31.5t-13 -32 t-31.5 -13.5t-31.5 13l-88 88h-524l-87 -88q-13 -13 -32 -13t-32 13.5t-13 32t13 31.5l224 224h-289q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM541 300l-100 -100h324l-100 100h-124z" />
-<glyph unicode="&#xe219;" d="M200 1100h800q83 0 141.5 -58.5t58.5 -141.5v-200h-100q0 41 -29.5 70.5t-70.5 29.5h-250q-41 0 -70.5 -29.5t-29.5 -70.5h-100q0 41 -29.5 70.5t-70.5 29.5h-250q-41 0 -70.5 -29.5t-29.5 -70.5h-100v200q0 83 58.5 141.5t141.5 58.5zM100 600h1000q41 0 70.5 -29.5 t29.5 -70.5v-300h-1200v300q0 41 29.5 70.5t70.5 29.5zM300 100v-50q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v50h200zM1100 100v-50q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v50h200z" />
-<glyph unicode="&#xe221;" d="M480 1165l682 -683q31 -31 31 -75.5t-31 -75.5l-131 -131h-481l-517 518q-32 31 -32 75.5t32 75.5l295 296q31 31 75.5 31t76.5 -31zM108 794l342 -342l303 304l-341 341zM250 100h800q21 0 35.5 -14.5t14.5 -35.5v-50h-900v50q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe223;" d="M1057 647l-189 506q-8 19 -27.5 33t-40.5 14h-400q-21 0 -40.5 -14t-27.5 -33l-189 -506q-8 -19 1.5 -33t30.5 -14h625v-150q0 -21 14.5 -35.5t35.5 -14.5t35.5 14.5t14.5 35.5v150h125q21 0 30.5 14t1.5 33zM897 0h-595v50q0 21 14.5 35.5t35.5 14.5h50v50 q0 21 14.5 35.5t35.5 14.5h48v300h200v-300h47q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-50z" />
-<glyph unicode="&#xe224;" d="M900 800h300v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-375v591l-300 300v84q0 10 7.5 17.5t17.5 7.5h375v-400zM1200 900h-200v200zM400 600h300v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-650q-10 0 -17.5 7.5t-7.5 17.5v950q0 10 7.5 17.5t17.5 7.5h375v-400zM700 700h-200v200z " />
-<glyph unicode="&#xe225;" d="M484 1095h195q75 0 146 -32.5t124 -86t89.5 -122.5t48.5 -142q18 -14 35 -20q31 -10 64.5 6.5t43.5 48.5q10 34 -15 71q-19 27 -9 43q5 8 12.5 11t19 -1t23.5 -16q41 -44 39 -105q-3 -63 -46 -106.5t-104 -43.5h-62q-7 -55 -35 -117t-56 -100l-39 -234q-3 -20 -20 -34.5 t-38 -14.5h-100q-21 0 -33 14.5t-9 34.5l12 70q-49 -14 -91 -14h-195q-24 0 -65 8l-11 -64q-3 -20 -20 -34.5t-38 -14.5h-100q-21 0 -33 14.5t-9 34.5l26 157q-84 74 -128 175l-159 53q-19 7 -33 26t-14 40v50q0 21 14.5 35.5t35.5 14.5h124q11 87 56 166l-111 95 q-16 14 -12.5 23.5t24.5 9.5h203q116 101 250 101zM675 1000h-250q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h250q10 0 17.5 7.5t7.5 17.5v50q0 10 -7.5 17.5t-17.5 7.5z" />
-<glyph unicode="&#xe226;" d="M641 900l423 247q19 8 42 2.5t37 -21.5l32 -38q14 -15 12.5 -36t-17.5 -34l-139 -120h-390zM50 1100h106q67 0 103 -17t66 -71l102 -212h823q21 0 35.5 -14.5t14.5 -35.5v-50q0 -21 -14 -40t-33 -26l-737 -132q-23 -4 -40 6t-26 25q-42 67 -100 67h-300q-62 0 -106 44 t-44 106v200q0 62 44 106t106 44zM173 928h-80q-19 0 -28 -14t-9 -35v-56q0 -51 42 -51h134q16 0 21.5 8t5.5 24q0 11 -16 45t-27 51q-18 28 -43 28zM550 727q-32 0 -54.5 -22.5t-22.5 -54.5t22.5 -54.5t54.5 -22.5t54.5 22.5t22.5 54.5t-22.5 54.5t-54.5 22.5zM130 389 l152 130q18 19 34 24t31 -3.5t24.5 -17.5t25.5 -28q28 -35 50.5 -51t48.5 -13l63 5l48 -179q13 -61 -3.5 -97.5t-67.5 -79.5l-80 -69q-47 -40 -109 -35.5t-103 51.5l-130 151q-40 47 -35.5 109.5t51.5 102.5zM380 377l-102 -88q-31 -27 2 -65l37 -43q13 -15 27.5 -19.5 t31.5 6.5l61 53q19 16 14 49q-2 20 -12 56t-17 45q-11 12 -19 14t-23 -8z" />
-<glyph unicode="&#xe227;" d="M625 1200h150q10 0 17.5 -7.5t7.5 -17.5v-109q79 -33 131 -87.5t53 -128.5q1 -46 -15 -84.5t-39 -61t-46 -38t-39 -21.5l-17 -6q6 0 15 -1.5t35 -9t50 -17.5t53 -30t50 -45t35.5 -64t14.5 -84q0 -59 -11.5 -105.5t-28.5 -76.5t-44 -51t-49.5 -31.5t-54.5 -16t-49.5 -6.5 t-43.5 -1v-75q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v75h-100v-75q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v75h-175q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h75v600h-75q-10 0 -17.5 7.5t-7.5 17.5v150 q0 10 7.5 17.5t17.5 7.5h175v75q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-75h100v75q0 10 7.5 17.5t17.5 7.5zM400 900v-200h263q28 0 48.5 10.5t30 25t15 29t5.5 25.5l1 10q0 4 -0.5 11t-6 24t-15 30t-30 24t-48.5 11h-263zM400 500v-200h363q28 0 48.5 10.5 t30 25t15 29t5.5 25.5l1 10q0 4 -0.5 11t-6 24t-15 30t-30 24t-48.5 11h-363z" />
-<glyph unicode="&#xe230;" d="M212 1198h780q86 0 147 -61t61 -147v-416q0 -51 -18 -142.5t-36 -157.5l-18 -66q-29 -87 -93.5 -146.5t-146.5 -59.5h-572q-82 0 -147 59t-93 147q-8 28 -20 73t-32 143.5t-20 149.5v416q0 86 61 147t147 61zM600 1045q-70 0 -132.5 -11.5t-105.5 -30.5t-78.5 -41.5 t-57 -45t-36 -41t-20.5 -30.5l-6 -12l156 -243h560l156 243q-2 5 -6 12.5t-20 29.5t-36.5 42t-57 44.5t-79 42t-105 29.5t-132.5 12zM762 703h-157l195 261z" />
-<glyph unicode="&#xe231;" d="M475 1300h150q103 0 189 -86t86 -189v-500q0 -41 -42 -83t-83 -42h-450q-41 0 -83 42t-42 83v500q0 103 86 189t189 86zM700 300v-225q0 -21 -27 -48t-48 -27h-150q-21 0 -48 27t-27 48v225h300z" />
-<glyph unicode="&#xe232;" d="M475 1300h96q0 -150 89.5 -239.5t239.5 -89.5v-446q0 -41 -42 -83t-83 -42h-450q-41 0 -83 42t-42 83v500q0 103 86 189t189 86zM700 300v-225q0 -21 -27 -48t-48 -27h-150q-21 0 -48 27t-27 48v225h300z" />
-<glyph unicode="&#xe233;" d="M1294 767l-638 -283l-378 170l-78 -60v-224l100 -150v-199l-150 148l-150 -149v200l100 150v250q0 4 -0.5 10.5t0 9.5t1 8t3 8t6.5 6l47 40l-147 65l642 283zM1000 380l-350 -166l-350 166v147l350 -165l350 165v-147z" />
-<glyph unicode="&#xe234;" d="M250 800q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM650 800q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM1050 800q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44z" />
-<glyph unicode="&#xe235;" d="M550 1100q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM550 700q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM550 300q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44z" />
-<glyph unicode="&#xe236;" d="M125 1100h950q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-950q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM125 700h950q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-950q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5 t17.5 7.5zM125 300h950q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-950q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5z" />
-<glyph unicode="&#xe237;" d="M350 1200h500q162 0 256 -93.5t94 -256.5v-500q0 -165 -93.5 -257.5t-256.5 -92.5h-500q-165 0 -257.5 92.5t-92.5 257.5v500q0 165 92.5 257.5t257.5 92.5zM900 1000h-600q-41 0 -70.5 -29.5t-29.5 -70.5v-600q0 -41 29.5 -70.5t70.5 -29.5h600q41 0 70.5 29.5 t29.5 70.5v600q0 41 -29.5 70.5t-70.5 29.5zM350 900h500q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -14.5 -35.5t-35.5 -14.5h-500q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 14.5 35.5t35.5 14.5zM400 800v-200h400v200h-400z" />
-<glyph unicode="&#xe238;" d="M150 1100h1000q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-200h50q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-200h50q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-200h50q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5 t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5h50v200h-50q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5h50v200h-50q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5h50v200h-50q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe239;" d="M650 1187q87 -67 118.5 -156t0 -178t-118.5 -155q-87 66 -118.5 155t0 178t118.5 156zM300 800q124 0 212 -88t88 -212q-124 0 -212 88t-88 212zM1000 800q0 -124 -88 -212t-212 -88q0 124 88 212t212 88zM300 500q124 0 212 -88t88 -212q-124 0 -212 88t-88 212z M1000 500q0 -124 -88 -212t-212 -88q0 124 88 212t212 88zM700 199v-144q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v142q40 -4 43 -4q17 0 57 6z" />
-<glyph unicode="&#xe240;" d="M745 878l69 19q25 6 45 -12l298 -295q11 -11 15 -26.5t-2 -30.5q-5 -14 -18 -23.5t-28 -9.5h-8q1 0 1 -13q0 -29 -2 -56t-8.5 -62t-20 -63t-33 -53t-51 -39t-72.5 -14h-146q-184 0 -184 288q0 24 10 47q-20 4 -62 4t-63 -4q11 -24 11 -47q0 -288 -184 -288h-142 q-48 0 -84.5 21t-56 51t-32 71.5t-16 75t-3.5 68.5q0 13 2 13h-7q-15 0 -27.5 9.5t-18.5 23.5q-6 15 -2 30.5t15 25.5l298 296q20 18 46 11l76 -19q20 -5 30.5 -22.5t5.5 -37.5t-22.5 -31t-37.5 -5l-51 12l-182 -193h891l-182 193l-44 -12q-20 -5 -37.5 6t-22.5 31t6 37.5 t31 22.5z" />
-<glyph unicode="&#xe241;" d="M1200 900h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-200v-850q0 -22 25 -34.5t50 -13.5l25 -2v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v850h-200q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h1000v-300zM500 450h-25q0 15 -4 24.5t-9 14.5t-17 7.5t-20 3t-25 0.5h-100v-425q0 -11 12.5 -17.5t25.5 -7.5h12v-50h-200v50q50 0 50 25v425h-100q-17 0 -25 -0.5t-20 -3t-17 -7.5t-9 -14.5t-4 -24.5h-25v150h500v-150z" />
-<glyph unicode="&#xe242;" d="M1000 300v50q-25 0 -55 32q-14 14 -25 31t-16 27l-4 11l-289 747h-69l-300 -754q-18 -35 -39 -56q-9 -9 -24.5 -18.5t-26.5 -14.5l-11 -5v-50h273v50q-49 0 -78.5 21.5t-11.5 67.5l69 176h293l61 -166q13 -34 -3.5 -66.5t-55.5 -32.5v-50h312zM412 691l134 342l121 -342 h-255zM1100 150v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h1000q21 0 35.5 -14.5t14.5 -35.5z" />
-<glyph unicode="&#xe243;" d="M50 1200h1100q21 0 35.5 -14.5t14.5 -35.5v-1100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v1100q0 21 14.5 35.5t35.5 14.5zM611 1118h-70q-13 0 -18 -12l-299 -753q-17 -32 -35 -51q-18 -18 -56 -34q-12 -5 -12 -18v-50q0 -8 5.5 -14t14.5 -6 h273q8 0 14 6t6 14v50q0 8 -6 14t-14 6q-55 0 -71 23q-10 14 0 39l63 163h266l57 -153q11 -31 -6 -55q-12 -17 -36 -17q-8 0 -14 -6t-6 -14v-50q0 -8 6 -14t14 -6h313q8 0 14 6t6 14v50q0 7 -5.5 13t-13.5 7q-17 0 -42 25q-25 27 -40 63h-1l-288 748q-5 12 -19 12zM639 611 h-197l103 264z" />
-<glyph unicode="&#xe244;" d="M1200 1100h-1200v100h1200v-100zM50 1000h400q21 0 35.5 -14.5t14.5 -35.5v-900q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v900q0 21 14.5 35.5t35.5 14.5zM650 1000h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM700 900v-300h300v300h-300z" />
-<glyph unicode="&#xe245;" d="M50 1200h400q21 0 35.5 -14.5t14.5 -35.5v-900q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v900q0 21 14.5 35.5t35.5 14.5zM650 700h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400 q0 21 14.5 35.5t35.5 14.5zM700 600v-300h300v300h-300zM1200 0h-1200v100h1200v-100z" />
-<glyph unicode="&#xe246;" d="M50 1000h400q21 0 35.5 -14.5t14.5 -35.5v-350h100v150q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-150h100v-100h-100v-150q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v150h-100v-350q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5v800q0 21 14.5 35.5t35.5 14.5zM700 700v-300h300v300h-300z" />
-<glyph unicode="&#xe247;" d="M100 0h-100v1200h100v-1200zM250 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM300 1000v-300h300v300h-300zM250 500h900q21 0 35.5 -14.5t14.5 -35.5v-400 q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe248;" d="M600 1100h150q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-150v-100h450q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5h350v100h-150q-21 0 -35.5 14.5 t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5h150v100h100v-100zM400 1000v-300h300v300h-300z" />
-<glyph unicode="&#xe249;" d="M1200 0h-100v1200h100v-1200zM550 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM600 1000v-300h300v300h-300zM50 500h900q21 0 35.5 -14.5t14.5 -35.5v-400 q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5z" />
-<glyph unicode="&#xe250;" d="M865 565l-494 -494q-23 -23 -41 -23q-14 0 -22 13.5t-8 38.5v1000q0 25 8 38.5t22 13.5q18 0 41 -23l494 -494q14 -14 14 -35t-14 -35z" />
-<glyph unicode="&#xe251;" d="M335 635l494 494q29 29 50 20.5t21 -49.5v-1000q0 -41 -21 -49.5t-50 20.5l-494 494q-14 14 -14 35t14 35z" />
-<glyph unicode="&#xe252;" d="M100 900h1000q41 0 49.5 -21t-20.5 -50l-494 -494q-14 -14 -35 -14t-35 14l-494 494q-29 29 -20.5 50t49.5 21z" />
-<glyph unicode="&#xe253;" d="M635 865l494 -494q29 -29 20.5 -50t-49.5 -21h-1000q-41 0 -49.5 21t20.5 50l494 494q14 14 35 14t35 -14z" />
-<glyph unicode="&#xe254;" d="M700 741v-182l-692 -323v221l413 193l-413 193v221zM1200 0h-800v200h800v-200z" />
-<glyph unicode="&#xe255;" d="M1200 900h-200v-100h200v-100h-300v300h200v100h-200v100h300v-300zM0 700h50q0 21 4 37t9.5 26.5t18 17.5t22 11t28.5 5.5t31 2t37 0.5h100v-550q0 -22 -25 -34.5t-50 -13.5l-25 -2v-100h400v100q-4 0 -11 0.5t-24 3t-30 7t-24 15t-11 24.5v550h100q25 0 37 -0.5t31 -2 t28.5 -5.5t22 -11t18 -17.5t9.5 -26.5t4 -37h50v300h-800v-300z" />
-<glyph unicode="&#xe256;" d="M800 700h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-100v-550q0 -22 25 -34.5t50 -14.5l25 -1v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v550h-100q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h800v-300zM1100 200h-200v-100h200v-100h-300v300h200v100h-200v100h300v-300z" />
-<glyph unicode="&#xe257;" d="M701 1098h160q16 0 21 -11t-7 -23l-464 -464l464 -464q12 -12 7 -23t-21 -11h-160q-13 0 -23 9l-471 471q-7 8 -7 18t7 18l471 471q10 9 23 9z" />
-<glyph unicode="&#xe258;" d="M339 1098h160q13 0 23 -9l471 -471q7 -8 7 -18t-7 -18l-471 -471q-10 -9 -23 -9h-160q-16 0 -21 11t7 23l464 464l-464 464q-12 12 -7 23t21 11z" />
-<glyph unicode="&#xe259;" d="M1087 882q11 -5 11 -21v-160q0 -13 -9 -23l-471 -471q-8 -7 -18 -7t-18 7l-471 471q-9 10 -9 23v160q0 16 11 21t23 -7l464 -464l464 464q12 12 23 7z" />
-<glyph unicode="&#xe260;" d="M618 993l471 -471q9 -10 9 -23v-160q0 -16 -11 -21t-23 7l-464 464l-464 -464q-12 -12 -23 -7t-11 21v160q0 13 9 23l471 471q8 7 18 7t18 -7z" />
-<glyph unicode="&#xf8ff;" d="M1000 1200q0 -124 -88 -212t-212 -88q0 124 88 212t212 88zM450 1000h100q21 0 40 -14t26 -33l79 -194q5 1 16 3q34 6 54 9.5t60 7t65.5 1t61 -10t56.5 -23t42.5 -42t29 -64t5 -92t-19.5 -121.5q-1 -7 -3 -19.5t-11 -50t-20.5 -73t-32.5 -81.5t-46.5 -83t-64 -70 t-82.5 -50q-13 -5 -42 -5t-65.5 2.5t-47.5 2.5q-14 0 -49.5 -3.5t-63 -3.5t-43.5 7q-57 25 -104.5 78.5t-75 111.5t-46.5 112t-26 90l-7 35q-15 63 -18 115t4.5 88.5t26 64t39.5 43.5t52 25.5t58.5 13t62.5 2t59.5 -4.5t55.5 -8l-147 192q-12 18 -5.5 30t27.5 12z" />
-<glyph unicode="&#x1f511;" d="M250 1200h600q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-150v-500l-255 -178q-19 -9 -32 -1t-13 29v650h-150q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM400 1100v-100h300v100h-300z" />
-<glyph unicode="&#x1f6aa;" d="M250 1200h750q39 0 69.5 -40.5t30.5 -84.5v-933l-700 -117v950l600 125h-700v-1000h-100v1025q0 23 15.5 49t34.5 26zM500 525v-100l100 20v100z" />
-</font>
-</defs></svg> 
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.ttf b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.ttf
deleted file mode 100644
index 1413fc6..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.ttf
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.woff b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.woff
deleted file mode 100644
index 9e61285..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.woff
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.woff2 b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.woff2
deleted file mode 100644
index 64539b5..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/fonts/glyphicons-halflings-regular.woff2
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/js/bootstrap.js b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/js/bootstrap.js
deleted file mode 100644
index 01fbbcb..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/js/bootstrap.js
+++ /dev/null
@@ -1,2363 +0,0 @@
-/*!
- * Bootstrap v3.3.6 (http://getbootstrap.com)
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under the MIT license
- */
-
-if (typeof jQuery === 'undefined') {
-  throw new Error('Bootstrap\'s JavaScript requires jQuery')
-}
-
-+function ($) {
-  'use strict';
-  var version = $.fn.jquery.split(' ')[0].split('.')
-  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {
-    throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')
-  }
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: transition.js v3.3.6
- * http://getbootstrap.com/javascript/#transitions
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
-  // ============================================================
-
-  function transitionEnd() {
-    var el = document.createElement('bootstrap')
-
-    var transEndEventNames = {
-      WebkitTransition : 'webkitTransitionEnd',
-      MozTransition    : 'transitionend',
-      OTransition      : 'oTransitionEnd otransitionend',
-      transition       : 'transitionend'
-    }
-
-    for (var name in transEndEventNames) {
-      if (el.style[name] !== undefined) {
-        return { end: transEndEventNames[name] }
-      }
-    }
-
-    return false // explicit for ie8 (  ._.)
-  }
-
-  // http://blog.alexmaccaw.com/css-transitions
-  $.fn.emulateTransitionEnd = function (duration) {
-    var called = false
-    var $el = this
-    $(this).one('bsTransitionEnd', function () { called = true })
-    var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
-    setTimeout(callback, duration)
-    return this
-  }
-
-  $(function () {
-    $.support.transition = transitionEnd()
-
-    if (!$.support.transition) return
-
-    $.event.special.bsTransitionEnd = {
-      bindType: $.support.transition.end,
-      delegateType: $.support.transition.end,
-      handle: function (e) {
-        if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
-      }
-    }
-  })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: alert.js v3.3.6
- * http://getbootstrap.com/javascript/#alerts
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // ALERT CLASS DEFINITION
-  // ======================
-
-  var dismiss = '[data-dismiss="alert"]'
-  var Alert   = function (el) {
-    $(el).on('click', dismiss, this.close)
-  }
-
-  Alert.VERSION = '3.3.6'
-
-  Alert.TRANSITION_DURATION = 150
-
-  Alert.prototype.close = function (e) {
-    var $this    = $(this)
-    var selector = $this.attr('data-target')
-
-    if (!selector) {
-      selector = $this.attr('href')
-      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
-    }
-
-    var $parent = $(selector)
-
-    if (e) e.preventDefault()
-
-    if (!$parent.length) {
-      $parent = $this.closest('.alert')
-    }
-
-    $parent.trigger(e = $.Event('close.bs.alert'))
-
-    if (e.isDefaultPrevented()) return
-
-    $parent.removeClass('in')
-
-    function removeElement() {
-      // detach from parent, fire event then clean up data
-      $parent.detach().trigger('closed.bs.alert').remove()
-    }
-
-    $.support.transition && $parent.hasClass('fade') ?
-      $parent
-        .one('bsTransitionEnd', removeElement)
-        .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
-      removeElement()
-  }
-
-
-  // ALERT PLUGIN DEFINITION
-  // =======================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this = $(this)
-      var data  = $this.data('bs.alert')
-
-      if (!data) $this.data('bs.alert', (data = new Alert(this)))
-      if (typeof option == 'string') data[option].call($this)
-    })
-  }
-
-  var old = $.fn.alert
-
-  $.fn.alert             = Plugin
-  $.fn.alert.Constructor = Alert
-
-
-  // ALERT NO CONFLICT
-  // =================
-
-  $.fn.alert.noConflict = function () {
-    $.fn.alert = old
-    return this
-  }
-
-
-  // ALERT DATA-API
-  // ==============
-
-  $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: button.js v3.3.6
- * http://getbootstrap.com/javascript/#buttons
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // BUTTON PUBLIC CLASS DEFINITION
-  // ==============================
-
-  var Button = function (element, options) {
-    this.$element  = $(element)
-    this.options   = $.extend({}, Button.DEFAULTS, options)
-    this.isLoading = false
-  }
-
-  Button.VERSION  = '3.3.6'
-
-  Button.DEFAULTS = {
-    loadingText: 'loading...'
-  }
-
-  Button.prototype.setState = function (state) {
-    var d    = 'disabled'
-    var $el  = this.$element
-    var val  = $el.is('input') ? 'val' : 'html'
-    var data = $el.data()
-
-    state += 'Text'
-
-    if (data.resetText == null) $el.data('resetText', $el[val]())
-
-    // push to event loop to allow forms to submit
-    setTimeout($.proxy(function () {
-      $el[val](data[state] == null ? this.options[state] : data[state])
-
-      if (state == 'loadingText') {
-        this.isLoading = true
-        $el.addClass(d).attr(d, d)
-      } else if (this.isLoading) {
-        this.isLoading = false
-        $el.removeClass(d).removeAttr(d)
-      }
-    }, this), 0)
-  }
-
-  Button.prototype.toggle = function () {
-    var changed = true
-    var $parent = this.$element.closest('[data-toggle="buttons"]')
-
-    if ($parent.length) {
-      var $input = this.$element.find('input')
-      if ($input.prop('type') == 'radio') {
-        if ($input.prop('checked')) changed = false
-        $parent.find('.active').removeClass('active')
-        this.$element.addClass('active')
-      } else if ($input.prop('type') == 'checkbox') {
-        if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
-        this.$element.toggleClass('active')
-      }
-      $input.prop('checked', this.$element.hasClass('active'))
-      if (changed) $input.trigger('change')
-    } else {
-      this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
-      this.$element.toggleClass('active')
-    }
-  }
-
-
-  // BUTTON PLUGIN DEFINITION
-  // ========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.button')
-      var options = typeof option == 'object' && option
-
-      if (!data) $this.data('bs.button', (data = new Button(this, options)))
-
-      if (option == 'toggle') data.toggle()
-      else if (option) data.setState(option)
-    })
-  }
-
-  var old = $.fn.button
-
-  $.fn.button             = Plugin
-  $.fn.button.Constructor = Button
-
-
-  // BUTTON NO CONFLICT
-  // ==================
-
-  $.fn.button.noConflict = function () {
-    $.fn.button = old
-    return this
-  }
-
-
-  // BUTTON DATA-API
-  // ===============
-
-  $(document)
-    .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
-      var $btn = $(e.target)
-      if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
-      Plugin.call($btn, 'toggle')
-      if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
-    })
-    .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
-      $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
-    })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: carousel.js v3.3.6
- * http://getbootstrap.com/javascript/#carousel
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // CAROUSEL CLASS DEFINITION
-  // =========================
-
-  var Carousel = function (element, options) {
-    this.$element    = $(element)
-    this.$indicators = this.$element.find('.carousel-indicators')
-    this.options     = options
-    this.paused      = null
-    this.sliding     = null
-    this.interval    = null
-    this.$active     = null
-    this.$items      = null
-
-    this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
-
-    this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
-      .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
-      .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
-  }
-
-  Carousel.VERSION  = '3.3.6'
-
-  Carousel.TRANSITION_DURATION = 600
-
-  Carousel.DEFAULTS = {
-    interval: 5000,
-    pause: 'hover',
-    wrap: true,
-    keyboard: true
-  }
-
-  Carousel.prototype.keydown = function (e) {
-    if (/input|textarea/i.test(e.target.tagName)) return
-    switch (e.which) {
-      case 37: this.prev(); break
-      case 39: this.next(); break
-      default: return
-    }
-
-    e.preventDefault()
-  }
-
-  Carousel.prototype.cycle = function (e) {
-    e || (this.paused = false)
-
-    this.interval && clearInterval(this.interval)
-
-    this.options.interval
-      && !this.paused
-      && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
-
-    return this
-  }
-
-  Carousel.prototype.getItemIndex = function (item) {
-    this.$items = item.parent().children('.item')
-    return this.$items.index(item || this.$active)
-  }
-
-  Carousel.prototype.getItemForDirection = function (direction, active) {
-    var activeIndex = this.getItemIndex(active)
-    var willWrap = (direction == 'prev' && activeIndex === 0)
-                || (direction == 'next' && activeIndex == (this.$items.length - 1))
-    if (willWrap && !this.options.wrap) return active
-    var delta = direction == 'prev' ? -1 : 1
-    var itemIndex = (activeIndex + delta) % this.$items.length
-    return this.$items.eq(itemIndex)
-  }
-
-  Carousel.prototype.to = function (pos) {
-    var that        = this
-    var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
-
-    if (pos > (this.$items.length - 1) || pos < 0) return
-
-    if (this.sliding)       return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
-    if (activeIndex == pos) return this.pause().cycle()
-
-    return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
-  }
-
-  Carousel.prototype.pause = function (e) {
-    e || (this.paused = true)
-
-    if (this.$element.find('.next, .prev').length && $.support.transition) {
-      this.$element.trigger($.support.transition.end)
-      this.cycle(true)
-    }
-
-    this.interval = clearInterval(this.interval)
-
-    return this
-  }
-
-  Carousel.prototype.next = function () {
-    if (this.sliding) return
-    return this.slide('next')
-  }
-
-  Carousel.prototype.prev = function () {
-    if (this.sliding) return
-    return this.slide('prev')
-  }
-
-  Carousel.prototype.slide = function (type, next) {
-    var $active   = this.$element.find('.item.active')
-    var $next     = next || this.getItemForDirection(type, $active)
-    var isCycling = this.interval
-    var direction = type == 'next' ? 'left' : 'right'
-    var that      = this
-
-    if ($next.hasClass('active')) return (this.sliding = false)
-
-    var relatedTarget = $next[0]
-    var slideEvent = $.Event('slide.bs.carousel', {
-      relatedTarget: relatedTarget,
-      direction: direction
-    })
-    this.$element.trigger(slideEvent)
-    if (slideEvent.isDefaultPrevented()) return
-
-    this.sliding = true
-
-    isCycling && this.pause()
-
-    if (this.$indicators.length) {
-      this.$indicators.find('.active').removeClass('active')
-      var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
-      $nextIndicator && $nextIndicator.addClass('active')
-    }
-
-    var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
-    if ($.support.transition && this.$element.hasClass('slide')) {
-      $next.addClass(type)
-      $next[0].offsetWidth // force reflow
-      $active.addClass(direction)
-      $next.addClass(direction)
-      $active
-        .one('bsTransitionEnd', function () {
-          $next.removeClass([type, direction].join(' ')).addClass('active')
-          $active.removeClass(['active', direction].join(' '))
-          that.sliding = false
-          setTimeout(function () {
-            that.$element.trigger(slidEvent)
-          }, 0)
-        })
-        .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
-    } else {
-      $active.removeClass('active')
-      $next.addClass('active')
-      this.sliding = false
-      this.$element.trigger(slidEvent)
-    }
-
-    isCycling && this.cycle()
-
-    return this
-  }
-
-
-  // CAROUSEL PLUGIN DEFINITION
-  // ==========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.carousel')
-      var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
-      var action  = typeof option == 'string' ? option : options.slide
-
-      if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
-      if (typeof option == 'number') data.to(option)
-      else if (action) data[action]()
-      else if (options.interval) data.pause().cycle()
-    })
-  }
-
-  var old = $.fn.carousel
-
-  $.fn.carousel             = Plugin
-  $.fn.carousel.Constructor = Carousel
-
-
-  // CAROUSEL NO CONFLICT
-  // ====================
-
-  $.fn.carousel.noConflict = function () {
-    $.fn.carousel = old
-    return this
-  }
-
-
-  // CAROUSEL DATA-API
-  // =================
-
-  var clickHandler = function (e) {
-    var href
-    var $this   = $(this)
-    var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
-    if (!$target.hasClass('carousel')) return
-    var options = $.extend({}, $target.data(), $this.data())
-    var slideIndex = $this.attr('data-slide-to')
-    if (slideIndex) options.interval = false
-
-    Plugin.call($target, options)
-
-    if (slideIndex) {
-      $target.data('bs.carousel').to(slideIndex)
-    }
-
-    e.preventDefault()
-  }
-
-  $(document)
-    .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
-    .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
-
-  $(window).on('load', function () {
-    $('[data-ride="carousel"]').each(function () {
-      var $carousel = $(this)
-      Plugin.call($carousel, $carousel.data())
-    })
-  })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: collapse.js v3.3.6
- * http://getbootstrap.com/javascript/#collapse
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // COLLAPSE PUBLIC CLASS DEFINITION
-  // ================================
-
-  var Collapse = function (element, options) {
-    this.$element      = $(element)
-    this.options       = $.extend({}, Collapse.DEFAULTS, options)
-    this.$trigger      = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
-                           '[data-toggle="collapse"][data-target="#' + element.id + '"]')
-    this.transitioning = null
-
-    if (this.options.parent) {
-      this.$parent = this.getParent()
-    } else {
-      this.addAriaAndCollapsedClass(this.$element, this.$trigger)
-    }
-
-    if (this.options.toggle) this.toggle()
-  }
-
-  Collapse.VERSION  = '3.3.6'
-
-  Collapse.TRANSITION_DURATION = 350
-
-  Collapse.DEFAULTS = {
-    toggle: true
-  }
-
-  Collapse.prototype.dimension = function () {
-    var hasWidth = this.$element.hasClass('width')
-    return hasWidth ? 'width' : 'height'
-  }
-
-  Collapse.prototype.show = function () {
-    if (this.transitioning || this.$element.hasClass('in')) return
-
-    var activesData
-    var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
-
-    if (actives && actives.length) {
-      activesData = actives.data('bs.collapse')
-      if (activesData && activesData.transitioning) return
-    }
-
-    var startEvent = $.Event('show.bs.collapse')
-    this.$element.trigger(startEvent)
-    if (startEvent.isDefaultPrevented()) return
-
-    if (actives && actives.length) {
-      Plugin.call(actives, 'hide')
-      activesData || actives.data('bs.collapse', null)
-    }
-
-    var dimension = this.dimension()
-
-    this.$element
-      .removeClass('collapse')
-      .addClass('collapsing')[dimension](0)
-      .attr('aria-expanded', true)
-
-    this.$trigger
-      .removeClass('collapsed')
-      .attr('aria-expanded', true)
-
-    this.transitioning = 1
-
-    var complete = function () {
-      this.$element
-        .removeClass('collapsing')
-        .addClass('collapse in')[dimension]('')
-      this.transitioning = 0
-      this.$element
-        .trigger('shown.bs.collapse')
-    }
-
-    if (!$.support.transition) return complete.call(this)
-
-    var scrollSize = $.camelCase(['scroll', dimension].join('-'))
-
-    this.$element
-      .one('bsTransitionEnd', $.proxy(complete, this))
-      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
-  }
-
-  Collapse.prototype.hide = function () {
-    if (this.transitioning || !this.$element.hasClass('in')) return
-
-    var startEvent = $.Event('hide.bs.collapse')
-    this.$element.trigger(startEvent)
-    if (startEvent.isDefaultPrevented()) return
-
-    var dimension = this.dimension()
-
-    this.$element[dimension](this.$element[dimension]())[0].offsetHeight
-
-    this.$element
-      .addClass('collapsing')
-      .removeClass('collapse in')
-      .attr('aria-expanded', false)
-
-    this.$trigger
-      .addClass('collapsed')
-      .attr('aria-expanded', false)
-
-    this.transitioning = 1
-
-    var complete = function () {
-      this.transitioning = 0
-      this.$element
-        .removeClass('collapsing')
-        .addClass('collapse')
-        .trigger('hidden.bs.collapse')
-    }
-
-    if (!$.support.transition) return complete.call(this)
-
-    this.$element
-      [dimension](0)
-      .one('bsTransitionEnd', $.proxy(complete, this))
-      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
-  }
-
-  Collapse.prototype.toggle = function () {
-    this[this.$element.hasClass('in') ? 'hide' : 'show']()
-  }
-
-  Collapse.prototype.getParent = function () {
-    return $(this.options.parent)
-      .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
-      .each($.proxy(function (i, element) {
-        var $element = $(element)
-        this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
-      }, this))
-      .end()
-  }
-
-  Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
-    var isOpen = $element.hasClass('in')
-
-    $element.attr('aria-expanded', isOpen)
-    $trigger
-      .toggleClass('collapsed', !isOpen)
-      .attr('aria-expanded', isOpen)
-  }
-
-  function getTargetFromTrigger($trigger) {
-    var href
-    var target = $trigger.attr('data-target')
-      || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
-
-    return $(target)
-  }
-
-
-  // COLLAPSE PLUGIN DEFINITION
-  // ==========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.collapse')
-      var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
-
-      if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
-      if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.collapse
-
-  $.fn.collapse             = Plugin
-  $.fn.collapse.Constructor = Collapse
-
-
-  // COLLAPSE NO CONFLICT
-  // ====================
-
-  $.fn.collapse.noConflict = function () {
-    $.fn.collapse = old
-    return this
-  }
-
-
-  // COLLAPSE DATA-API
-  // =================
-
-  $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
-    var $this   = $(this)
-
-    if (!$this.attr('data-target')) e.preventDefault()
-
-    var $target = getTargetFromTrigger($this)
-    var data    = $target.data('bs.collapse')
-    var option  = data ? 'toggle' : $this.data()
-
-    Plugin.call($target, option)
-  })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: dropdown.js v3.3.6
- * http://getbootstrap.com/javascript/#dropdowns
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // DROPDOWN CLASS DEFINITION
-  // =========================
-
-  var backdrop = '.dropdown-backdrop'
-  var toggle   = '[data-toggle="dropdown"]'
-  var Dropdown = function (element) {
-    $(element).on('click.bs.dropdown', this.toggle)
-  }
-
-  Dropdown.VERSION = '3.3.6'
-
-  function getParent($this) {
-    var selector = $this.attr('data-target')
-
-    if (!selector) {
-      selector = $this.attr('href')
-      selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
-    }
-
-    var $parent = selector && $(selector)
-
-    return $parent && $parent.length ? $parent : $this.parent()
-  }
-
-  function clearMenus(e) {
-    if (e && e.which === 3) return
-    $(backdrop).remove()
-    $(toggle).each(function () {
-      var $this         = $(this)
-      var $parent       = getParent($this)
-      var relatedTarget = { relatedTarget: this }
-
-      if (!$parent.hasClass('open')) return
-
-      if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
-
-      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
-
-      if (e.isDefaultPrevented()) return
-
-      $this.attr('aria-expanded', 'false')
-      $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
-    })
-  }
-
-  Dropdown.prototype.toggle = function (e) {
-    var $this = $(this)
-
-    if ($this.is('.disabled, :disabled')) return
-
-    var $parent  = getParent($this)
-    var isActive = $parent.hasClass('open')
-
-    clearMenus()
-
-    if (!isActive) {
-      if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
-        // if mobile we use a backdrop because click events don't delegate
-        $(document.createElement('div'))
-          .addClass('dropdown-backdrop')
-          .insertAfter($(this))
-          .on('click', clearMenus)
-      }
-
-      var relatedTarget = { relatedTarget: this }
-      $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
-
-      if (e.isDefaultPrevented()) return
-
-      $this
-        .trigger('focus')
-        .attr('aria-expanded', 'true')
-
-      $parent
-        .toggleClass('open')
-        .trigger($.Event('shown.bs.dropdown', relatedTarget))
-    }
-
-    return false
-  }
-
-  Dropdown.prototype.keydown = function (e) {
-    if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
-
-    var $this = $(this)
-
-    e.preventDefault()
-    e.stopPropagation()
-
-    if ($this.is('.disabled, :disabled')) return
-
-    var $parent  = getParent($this)
-    var isActive = $parent.hasClass('open')
-
-    if (!isActive && e.which != 27 || isActive && e.which == 27) {
-      if (e.which == 27) $parent.find(toggle).trigger('focus')
-      return $this.trigger('click')
-    }
-
-    var desc = ' li:not(.disabled):visible a'
-    var $items = $parent.find('.dropdown-menu' + desc)
-
-    if (!$items.length) return
-
-    var index = $items.index(e.target)
-
-    if (e.which == 38 && index > 0)                 index--         // up
-    if (e.which == 40 && index < $items.length - 1) index++         // down
-    if (!~index)                                    index = 0
-
-    $items.eq(index).trigger('focus')
-  }
-
-
-  // DROPDOWN PLUGIN DEFINITION
-  // ==========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this = $(this)
-      var data  = $this.data('bs.dropdown')
-
-      if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
-      if (typeof option == 'string') data[option].call($this)
-    })
-  }
-
-  var old = $.fn.dropdown
-
-  $.fn.dropdown             = Plugin
-  $.fn.dropdown.Constructor = Dropdown
-
-
-  // DROPDOWN NO CONFLICT
-  // ====================
-
-  $.fn.dropdown.noConflict = function () {
-    $.fn.dropdown = old
-    return this
-  }
-
-
-  // APPLY TO STANDARD DROPDOWN ELEMENTS
-  // ===================================
-
-  $(document)
-    .on('click.bs.dropdown.data-api', clearMenus)
-    .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
-    .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
-    .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
-    .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: modal.js v3.3.6
- * http://getbootstrap.com/javascript/#modals
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // MODAL CLASS DEFINITION
-  // ======================
-
-  var Modal = function (element, options) {
-    this.options             = options
-    this.$body               = $(document.body)
-    this.$element            = $(element)
-    this.$dialog             = this.$element.find('.modal-dialog')
-    this.$backdrop           = null
-    this.isShown             = null
-    this.originalBodyPad     = null
-    this.scrollbarWidth      = 0
-    this.ignoreBackdropClick = false
-
-    if (this.options.remote) {
-      this.$element
-        .find('.modal-content')
-        .load(this.options.remote, $.proxy(function () {
-          this.$element.trigger('loaded.bs.modal')
-        }, this))
-    }
-  }
-
-  Modal.VERSION  = '3.3.6'
-
-  Modal.TRANSITION_DURATION = 300
-  Modal.BACKDROP_TRANSITION_DURATION = 150
-
-  Modal.DEFAULTS = {
-    backdrop: true,
-    keyboard: true,
-    show: true
-  }
-
-  Modal.prototype.toggle = function (_relatedTarget) {
-    return this.isShown ? this.hide() : this.show(_relatedTarget)
-  }
-
-  Modal.prototype.show = function (_relatedTarget) {
-    var that = this
-    var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
-
-    this.$element.trigger(e)
-
-    if (this.isShown || e.isDefaultPrevented()) return
-
-    this.isShown = true
-
-    this.checkScrollbar()
-    this.setScrollbar()
-    this.$body.addClass('modal-open')
-
-    this.escape()
-    this.resize()
-
-    this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
-
-    this.$dialog.on('mousedown.dismiss.bs.modal', function () {
-      that.$element.one('mouseup.dismiss.bs.modal', function (e) {
-        if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
-      })
-    })
-
-    this.backdrop(function () {
-      var transition = $.support.transition && that.$element.hasClass('fade')
-
-      if (!that.$element.parent().length) {
-        that.$element.appendTo(that.$body) // don't move modals dom position
-      }
-
-      that.$element
-        .show()
-        .scrollTop(0)
-
-      that.adjustDialog()
-
-      if (transition) {
-        that.$element[0].offsetWidth // force reflow
-      }
-
-      that.$element.addClass('in')
-
-      that.enforceFocus()
-
-      var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
-
-      transition ?
-        that.$dialog // wait for modal to slide in
-          .one('bsTransitionEnd', function () {
-            that.$element.trigger('focus').trigger(e)
-          })
-          .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
-        that.$element.trigger('focus').trigger(e)
-    })
-  }
-
-  Modal.prototype.hide = function (e) {
-    if (e) e.preventDefault()
-
-    e = $.Event('hide.bs.modal')
-
-    this.$element.trigger(e)
-
-    if (!this.isShown || e.isDefaultPrevented()) return
-
-    this.isShown = false
-
-    this.escape()
-    this.resize()
-
-    $(document).off('focusin.bs.modal')
-
-    this.$element
-      .removeClass('in')
-      .off('click.dismiss.bs.modal')
-      .off('mouseup.dismiss.bs.modal')
-
-    this.$dialog.off('mousedown.dismiss.bs.modal')
-
-    $.support.transition && this.$element.hasClass('fade') ?
-      this.$element
-        .one('bsTransitionEnd', $.proxy(this.hideModal, this))
-        .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
-      this.hideModal()
-  }
-
-  Modal.prototype.enforceFocus = function () {
-    $(document)
-      .off('focusin.bs.modal') // guard against infinite focus loop
-      .on('focusin.bs.modal', $.proxy(function (e) {
-        if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
-          this.$element.trigger('focus')
-        }
-      }, this))
-  }
-
-  Modal.prototype.escape = function () {
-    if (this.isShown && this.options.keyboard) {
-      this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
-        e.which == 27 && this.hide()
-      }, this))
-    } else if (!this.isShown) {
-      this.$element.off('keydown.dismiss.bs.modal')
-    }
-  }
-
-  Modal.prototype.resize = function () {
-    if (this.isShown) {
-      $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
-    } else {
-      $(window).off('resize.bs.modal')
-    }
-  }
-
-  Modal.prototype.hideModal = function () {
-    var that = this
-    this.$element.hide()
-    this.backdrop(function () {
-      that.$body.removeClass('modal-open')
-      that.resetAdjustments()
-      that.resetScrollbar()
-      that.$element.trigger('hidden.bs.modal')
-    })
-  }
-
-  Modal.prototype.removeBackdrop = function () {
-    this.$backdrop && this.$backdrop.remove()
-    this.$backdrop = null
-  }
-
-  Modal.prototype.backdrop = function (callback) {
-    var that = this
-    var animate = this.$element.hasClass('fade') ? 'fade' : ''
-
-    if (this.isShown && this.options.backdrop) {
-      var doAnimate = $.support.transition && animate
-
-      this.$backdrop = $(document.createElement('div'))
-        .addClass('modal-backdrop ' + animate)
-        .appendTo(this.$body)
-
-      this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
-        if (this.ignoreBackdropClick) {
-          this.ignoreBackdropClick = false
-          return
-        }
-        if (e.target !== e.currentTarget) return
-        this.options.backdrop == 'static'
-          ? this.$element[0].focus()
-          : this.hide()
-      }, this))
-
-      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
-
-      this.$backdrop.addClass('in')
-
-      if (!callback) return
-
-      doAnimate ?
-        this.$backdrop
-          .one('bsTransitionEnd', callback)
-          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
-        callback()
-
-    } else if (!this.isShown && this.$backdrop) {
-      this.$backdrop.removeClass('in')
-
-      var callbackRemove = function () {
-        that.removeBackdrop()
-        callback && callback()
-      }
-      $.support.transition && this.$element.hasClass('fade') ?
-        this.$backdrop
-          .one('bsTransitionEnd', callbackRemove)
-          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
-        callbackRemove()
-
-    } else if (callback) {
-      callback()
-    }
-  }
-
-  // these following methods are used to handle overflowing modals
-
-  Modal.prototype.handleUpdate = function () {
-    this.adjustDialog()
-  }
-
-  Modal.prototype.adjustDialog = function () {
-    var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
-
-    this.$element.css({
-      paddingLeft:  !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
-      paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
-    })
-  }
-
-  Modal.prototype.resetAdjustments = function () {
-    this.$element.css({
-      paddingLeft: '',
-      paddingRight: ''
-    })
-  }
-
-  Modal.prototype.checkScrollbar = function () {
-    var fullWindowWidth = window.innerWidth
-    if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
-      var documentElementRect = document.documentElement.getBoundingClientRect()
-      fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
-    }
-    this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
-    this.scrollbarWidth = this.measureScrollbar()
-  }
-
-  Modal.prototype.setScrollbar = function () {
-    var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
-    this.originalBodyPad = document.body.style.paddingRight || ''
-    if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
-  }
-
-  Modal.prototype.resetScrollbar = function () {
-    this.$body.css('padding-right', this.originalBodyPad)
-  }
-
-  Modal.prototype.measureScrollbar = function () { // thx walsh
-    var scrollDiv = document.createElement('div')
-    scrollDiv.className = 'modal-scrollbar-measure'
-    this.$body.append(scrollDiv)
-    var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
-    this.$body[0].removeChild(scrollDiv)
-    return scrollbarWidth
-  }
-
-
-  // MODAL PLUGIN DEFINITION
-  // =======================
-
-  function Plugin(option, _relatedTarget) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.modal')
-      var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
-
-      if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
-      if (typeof option == 'string') data[option](_relatedTarget)
-      else if (options.show) data.show(_relatedTarget)
-    })
-  }
-
-  var old = $.fn.modal
-
-  $.fn.modal             = Plugin
-  $.fn.modal.Constructor = Modal
-
-
-  // MODAL NO CONFLICT
-  // =================
-
-  $.fn.modal.noConflict = function () {
-    $.fn.modal = old
-    return this
-  }
-
-
-  // MODAL DATA-API
-  // ==============
-
-  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
-    var $this   = $(this)
-    var href    = $this.attr('href')
-    var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
-    var option  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
-
-    if ($this.is('a')) e.preventDefault()
-
-    $target.one('show.bs.modal', function (showEvent) {
-      if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
-      $target.one('hidden.bs.modal', function () {
-        $this.is(':visible') && $this.trigger('focus')
-      })
-    })
-    Plugin.call($target, option, this)
-  })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: tooltip.js v3.3.6
- * http://getbootstrap.com/javascript/#tooltip
- * Inspired by the original jQuery.tipsy by Jason Frame
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // TOOLTIP PUBLIC CLASS DEFINITION
-  // ===============================
-
-  var Tooltip = function (element, options) {
-    this.type       = null
-    this.options    = null
-    this.enabled    = null
-    this.timeout    = null
-    this.hoverState = null
-    this.$element   = null
-    this.inState    = null
-
-    this.init('tooltip', element, options)
-  }
-
-  Tooltip.VERSION  = '3.3.6'
-
-  Tooltip.TRANSITION_DURATION = 150
-
-  Tooltip.DEFAULTS = {
-    animation: true,
-    placement: 'top',
-    selector: false,
-    template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
-    trigger: 'hover focus',
-    title: '',
-    delay: 0,
-    html: false,
-    container: false,
-    viewport: {
-      selector: 'body',
-      padding: 0
-    }
-  }
-
-  Tooltip.prototype.init = function (type, element, options) {
-    this.enabled   = true
-    this.type      = type
-    this.$element  = $(element)
-    this.options   = this.getOptions(options)
-    this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
-    this.inState   = { click: false, hover: false, focus: false }
-
-    if (this.$element[0] instanceof document.constructor && !this.options.selector) {
-      throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
-    }
-
-    var triggers = this.options.trigger.split(' ')
-
-    for (var i = triggers.length; i--;) {
-      var trigger = triggers[i]
-
-      if (trigger == 'click') {
-        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
-      } else if (trigger != 'manual') {
-        var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'
-        var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
-
-        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
-        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
-      }
-    }
-
-    this.options.selector ?
-      (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
-      this.fixTitle()
-  }
-
-  Tooltip.prototype.getDefaults = function () {
-    return Tooltip.DEFAULTS
-  }
-
-  Tooltip.prototype.getOptions = function (options) {
-    options = $.extend({}, this.getDefaults(), this.$element.data(), options)
-
-    if (options.delay && typeof options.delay == 'number') {
-      options.delay = {
-        show: options.delay,
-        hide: options.delay
-      }
-    }
-
-    return options
-  }
-
-  Tooltip.prototype.getDelegateOptions = function () {
-    var options  = {}
-    var defaults = this.getDefaults()
-
-    this._options && $.each(this._options, function (key, value) {
-      if (defaults[key] != value) options[key] = value
-    })
-
-    return options
-  }
-
-  Tooltip.prototype.enter = function (obj) {
-    var self = obj instanceof this.constructor ?
-      obj : $(obj.currentTarget).data('bs.' + this.type)
-
-    if (!self) {
-      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
-      $(obj.currentTarget).data('bs.' + this.type, self)
-    }
-
-    if (obj instanceof $.Event) {
-      self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
-    }
-
-    if (self.tip().hasClass('in') || self.hoverState == 'in') {
-      self.hoverState = 'in'
-      return
-    }
-
-    clearTimeout(self.timeout)
-
-    self.hoverState = 'in'
-
-    if (!self.options.delay || !self.options.delay.show) return self.show()
-
-    self.timeout = setTimeout(function () {
-      if (self.hoverState == 'in') self.show()
-    }, self.options.delay.show)
-  }
-
-  Tooltip.prototype.isInStateTrue = function () {
-    for (var key in this.inState) {
-      if (this.inState[key]) return true
-    }
-
-    return false
-  }
-
-  Tooltip.prototype.leave = function (obj) {
-    var self = obj instanceof this.constructor ?
-      obj : $(obj.currentTarget).data('bs.' + this.type)
-
-    if (!self) {
-      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
-      $(obj.currentTarget).data('bs.' + this.type, self)
-    }
-
-    if (obj instanceof $.Event) {
-      self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
-    }
-
-    if (self.isInStateTrue()) return
-
-    clearTimeout(self.timeout)
-
-    self.hoverState = 'out'
-
-    if (!self.options.delay || !self.options.delay.hide) return self.hide()
-
-    self.timeout = setTimeout(function () {
-      if (self.hoverState == 'out') self.hide()
-    }, self.options.delay.hide)
-  }
-
-  Tooltip.prototype.show = function () {
-    var e = $.Event('show.bs.' + this.type)
-
-    if (this.hasContent() && this.enabled) {
-      this.$element.trigger(e)
-
-      var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
-      if (e.isDefaultPrevented() || !inDom) return
-      var that = this
-
-      var $tip = this.tip()
-
-      var tipId = this.getUID(this.type)
-
-      this.setContent()
-      $tip.attr('id', tipId)
-      this.$element.attr('aria-describedby', tipId)
-
-      if (this.options.animation) $tip.addClass('fade')
-
-      var placement = typeof this.options.placement == 'function' ?
-        this.options.placement.call(this, $tip[0], this.$element[0]) :
-        this.options.placement
-
-      var autoToken = /\s?auto?\s?/i
-      var autoPlace = autoToken.test(placement)
-      if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
-
-      $tip
-        .detach()
-        .css({ top: 0, left: 0, display: 'block' })
-        .addClass(placement)
-        .data('bs.' + this.type, this)
-
-      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
-      this.$element.trigger('inserted.bs.' + this.type)
-
-      var pos          = this.getPosition()
-      var actualWidth  = $tip[0].offsetWidth
-      var actualHeight = $tip[0].offsetHeight
-
-      if (autoPlace) {
-        var orgPlacement = placement
-        var viewportDim = this.getPosition(this.$viewport)
-
-        placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top'    :
-                    placement == 'top'    && pos.top    - actualHeight < viewportDim.top    ? 'bottom' :
-                    placement == 'right'  && pos.right  + actualWidth  > viewportDim.width  ? 'left'   :
-                    placement == 'left'   && pos.left   - actualWidth  < viewportDim.left   ? 'right'  :
-                    placement
-
-        $tip
-          .removeClass(orgPlacement)
-          .addClass(placement)
-      }
-
-      var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
-
-      this.applyPlacement(calculatedOffset, placement)
-
-      var complete = function () {
-        var prevHoverState = that.hoverState
-        that.$element.trigger('shown.bs.' + that.type)
-        that.hoverState = null
-
-        if (prevHoverState == 'out') that.leave(that)
-      }
-
-      $.support.transition && this.$tip.hasClass('fade') ?
-        $tip
-          .one('bsTransitionEnd', complete)
-          .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
-        complete()
-    }
-  }
-
-  Tooltip.prototype.applyPlacement = function (offset, placement) {
-    var $tip   = this.tip()
-    var width  = $tip[0].offsetWidth
-    var height = $tip[0].offsetHeight
-
-    // manually read margins because getBoundingClientRect includes difference
-    var marginTop = parseInt($tip.css('margin-top'), 10)
-    var marginLeft = parseInt($tip.css('margin-left'), 10)
-
-    // we must check for NaN for ie 8/9
-    if (isNaN(marginTop))  marginTop  = 0
-    if (isNaN(marginLeft)) marginLeft = 0
-
-    offset.top  += marginTop
-    offset.left += marginLeft
-
-    // $.fn.offset doesn't round pixel values
-    // so we use setOffset directly with our own function B-0
-    $.offset.setOffset($tip[0], $.extend({
-      using: function (props) {
-        $tip.css({
-          top: Math.round(props.top),
-          left: Math.round(props.left)
-        })
-      }
-    }, offset), 0)
-
-    $tip.addClass('in')
-
-    // check to see if placing tip in new offset caused the tip to resize itself
-    var actualWidth  = $tip[0].offsetWidth
-    var actualHeight = $tip[0].offsetHeight
-
-    if (placement == 'top' && actualHeight != height) {
-      offset.top = offset.top + height - actualHeight
-    }
-
-    var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
-
-    if (delta.left) offset.left += delta.left
-    else offset.top += delta.top
-
-    var isVertical          = /top|bottom/.test(placement)
-    var arrowDelta          = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
-    var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
-
-    $tip.offset(offset)
-    this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
-  }
-
-  Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
-    this.arrow()
-      .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
-      .css(isVertical ? 'top' : 'left', '')
-  }
-
-  Tooltip.prototype.setContent = function () {
-    var $tip  = this.tip()
-    var title = this.getTitle()
-
-    $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
-    $tip.removeClass('fade in top bottom left right')
-  }
-
-  Tooltip.prototype.hide = function (callback) {
-    var that = this
-    var $tip = $(this.$tip)
-    var e    = $.Event('hide.bs.' + this.type)
-
-    function complete() {
-      if (that.hoverState != 'in') $tip.detach()
-      that.$element
-        .removeAttr('aria-describedby')
-        .trigger('hidden.bs.' + that.type)
-      callback && callback()
-    }
-
-    this.$element.trigger(e)
-
-    if (e.isDefaultPrevented()) return
-
-    $tip.removeClass('in')
-
-    $.support.transition && $tip.hasClass('fade') ?
-      $tip
-        .one('bsTransitionEnd', complete)
-        .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
-      complete()
-
-    this.hoverState = null
-
-    return this
-  }
-
-  Tooltip.prototype.fixTitle = function () {
-    var $e = this.$element
-    if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
-      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
-    }
-  }
-
-  Tooltip.prototype.hasContent = function () {
-    return this.getTitle()
-  }
-
-  Tooltip.prototype.getPosition = function ($element) {
-    $element   = $element || this.$element
-
-    var el     = $element[0]
-    var isBody = el.tagName == 'BODY'
-
-    var elRect    = el.getBoundingClientRect()
-    if (elRect.width == null) {
-      // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
-      elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
-    }
-    var elOffset  = isBody ? { top: 0, left: 0 } : $element.offset()
-    var scroll    = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
-    var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
-
-    return $.extend({}, elRect, scroll, outerDims, elOffset)
-  }
-
-  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
-    return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2 } :
-           placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
-           placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
-        /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
-
-  }
-
-  Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
-    var delta = { top: 0, left: 0 }
-    if (!this.$viewport) return delta
-
-    var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
-    var viewportDimensions = this.getPosition(this.$viewport)
-
-    if (/right|left/.test(placement)) {
-      var topEdgeOffset    = pos.top - viewportPadding - viewportDimensions.scroll
-      var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
-      if (topEdgeOffset < viewportDimensions.top) { // top overflow
-        delta.top = viewportDimensions.top - topEdgeOffset
-      } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
-        delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
-      }
-    } else {
-      var leftEdgeOffset  = pos.left - viewportPadding
-      var rightEdgeOffset = pos.left + viewportPadding + actualWidth
-      if (leftEdgeOffset < viewportDimensions.left) { // left overflow
-        delta.left = viewportDimensions.left - leftEdgeOffset
-      } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
-        delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
-      }
-    }
-
-    return delta
-  }
-
-  Tooltip.prototype.getTitle = function () {
-    var title
-    var $e = this.$element
-    var o  = this.options
-
-    title = $e.attr('data-original-title')
-      || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
-
-    return title
-  }
-
-  Tooltip.prototype.getUID = function (prefix) {
-    do prefix += ~~(Math.random() * 1000000)
-    while (document.getElementById(prefix))
-    return prefix
-  }
-
-  Tooltip.prototype.tip = function () {
-    if (!this.$tip) {
-      this.$tip = $(this.options.template)
-      if (this.$tip.length != 1) {
-        throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
-      }
-    }
-    return this.$tip
-  }
-
-  Tooltip.prototype.arrow = function () {
-    return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
-  }
-
-  Tooltip.prototype.enable = function () {
-    this.enabled = true
-  }
-
-  Tooltip.prototype.disable = function () {
-    this.enabled = false
-  }
-
-  Tooltip.prototype.toggleEnabled = function () {
-    this.enabled = !this.enabled
-  }
-
-  Tooltip.prototype.toggle = function (e) {
-    var self = this
-    if (e) {
-      self = $(e.currentTarget).data('bs.' + this.type)
-      if (!self) {
-        self = new this.constructor(e.currentTarget, this.getDelegateOptions())
-        $(e.currentTarget).data('bs.' + this.type, self)
-      }
-    }
-
-    if (e) {
-      self.inState.click = !self.inState.click
-      if (self.isInStateTrue()) self.enter(self)
-      else self.leave(self)
-    } else {
-      self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
-    }
-  }
-
-  Tooltip.prototype.destroy = function () {
-    var that = this
-    clearTimeout(this.timeout)
-    this.hide(function () {
-      that.$element.off('.' + that.type).removeData('bs.' + that.type)
-      if (that.$tip) {
-        that.$tip.detach()
-      }
-      that.$tip = null
-      that.$arrow = null
-      that.$viewport = null
-    })
-  }
-
-
-  // TOOLTIP PLUGIN DEFINITION
-  // =========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.tooltip')
-      var options = typeof option == 'object' && option
-
-      if (!data && /destroy|hide/.test(option)) return
-      if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.tooltip
-
-  $.fn.tooltip             = Plugin
-  $.fn.tooltip.Constructor = Tooltip
-
-
-  // TOOLTIP NO CONFLICT
-  // ===================
-
-  $.fn.tooltip.noConflict = function () {
-    $.fn.tooltip = old
-    return this
-  }
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: popover.js v3.3.6
- * http://getbootstrap.com/javascript/#popovers
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // POPOVER PUBLIC CLASS DEFINITION
-  // ===============================
-
-  var Popover = function (element, options) {
-    this.init('popover', element, options)
-  }
-
-  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
-
-  Popover.VERSION  = '3.3.6'
-
-  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
-    placement: 'right',
-    trigger: 'click',
-    content: '',
-    template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
-  })
-
-
-  // NOTE: POPOVER EXTENDS tooltip.js
-  // ================================
-
-  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
-
-  Popover.prototype.constructor = Popover
-
-  Popover.prototype.getDefaults = function () {
-    return Popover.DEFAULTS
-  }
-
-  Popover.prototype.setContent = function () {
-    var $tip    = this.tip()
-    var title   = this.getTitle()
-    var content = this.getContent()
-
-    $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
-    $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
-      this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
-    ](content)
-
-    $tip.removeClass('fade top bottom left right in')
-
-    // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
-    // this manually by checking the contents.
-    if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
-  }
-
-  Popover.prototype.hasContent = function () {
-    return this.getTitle() || this.getContent()
-  }
-
-  Popover.prototype.getContent = function () {
-    var $e = this.$element
-    var o  = this.options
-
-    return $e.attr('data-content')
-      || (typeof o.content == 'function' ?
-            o.content.call($e[0]) :
-            o.content)
-  }
-
-  Popover.prototype.arrow = function () {
-    return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
-  }
-
-
-  // POPOVER PLUGIN DEFINITION
-  // =========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.popover')
-      var options = typeof option == 'object' && option
-
-      if (!data && /destroy|hide/.test(option)) return
-      if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.popover
-
-  $.fn.popover             = Plugin
-  $.fn.popover.Constructor = Popover
-
-
-  // POPOVER NO CONFLICT
-  // ===================
-
-  $.fn.popover.noConflict = function () {
-    $.fn.popover = old
-    return this
-  }
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: scrollspy.js v3.3.6
- * http://getbootstrap.com/javascript/#scrollspy
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // SCROLLSPY CLASS DEFINITION
-  // ==========================
-
-  function ScrollSpy(element, options) {
-    this.$body          = $(document.body)
-    this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
-    this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)
-    this.selector       = (this.options.target || '') + ' .nav li > a'
-    this.offsets        = []
-    this.targets        = []
-    this.activeTarget   = null
-    this.scrollHeight   = 0
-
-    this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
-    this.refresh()
-    this.process()
-  }
-
-  ScrollSpy.VERSION  = '3.3.6'
-
-  ScrollSpy.DEFAULTS = {
-    offset: 10
-  }
-
-  ScrollSpy.prototype.getScrollHeight = function () {
-    return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
-  }
-
-  ScrollSpy.prototype.refresh = function () {
-    var that          = this
-    var offsetMethod  = 'offset'
-    var offsetBase    = 0
-
-    this.offsets      = []
-    this.targets      = []
-    this.scrollHeight = this.getScrollHeight()
-
-    if (!$.isWindow(this.$scrollElement[0])) {
-      offsetMethod = 'position'
-      offsetBase   = this.$scrollElement.scrollTop()
-    }
-
-    this.$body
-      .find(this.selector)
-      .map(function () {
-        var $el   = $(this)
-        var href  = $el.data('target') || $el.attr('href')
-        var $href = /^#./.test(href) && $(href)
-
-        return ($href
-          && $href.length
-          && $href.is(':visible')
-          && [[$href[offsetMethod]().top + offsetBase, href]]) || null
-      })
-      .sort(function (a, b) { return a[0] - b[0] })
-      .each(function () {
-        that.offsets.push(this[0])
-        that.targets.push(this[1])
-      })
-  }
-
-  ScrollSpy.prototype.process = function () {
-    var scrollTop    = this.$scrollElement.scrollTop() + this.options.offset
-    var scrollHeight = this.getScrollHeight()
-    var maxScroll    = this.options.offset + scrollHeight - this.$scrollElement.height()
-    var offsets      = this.offsets
-    var targets      = this.targets
-    var activeTarget = this.activeTarget
-    var i
-
-    if (this.scrollHeight != scrollHeight) {
-      this.refresh()
-    }
-
-    if (scrollTop >= maxScroll) {
-      return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
-    }
-
-    if (activeTarget && scrollTop < offsets[0]) {
-      this.activeTarget = null
-      return this.clear()
-    }
-
-    for (i = offsets.length; i--;) {
-      activeTarget != targets[i]
-        && scrollTop >= offsets[i]
-        && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
-        && this.activate(targets[i])
-    }
-  }
-
-  ScrollSpy.prototype.activate = function (target) {
-    this.activeTarget = target
-
-    this.clear()
-
-    var selector = this.selector +
-      '[data-target="' + target + '"],' +
-      this.selector + '[href="' + target + '"]'
-
-    var active = $(selector)
-      .parents('li')
-      .addClass('active')
-
-    if (active.parent('.dropdown-menu').length) {
-      active = active
-        .closest('li.dropdown')
-        .addClass('active')
-    }
-
-    active.trigger('activate.bs.scrollspy')
-  }
-
-  ScrollSpy.prototype.clear = function () {
-    $(this.selector)
-      .parentsUntil(this.options.target, '.active')
-      .removeClass('active')
-  }
-
-
-  // SCROLLSPY PLUGIN DEFINITION
-  // ===========================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.scrollspy')
-      var options = typeof option == 'object' && option
-
-      if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.scrollspy
-
-  $.fn.scrollspy             = Plugin
-  $.fn.scrollspy.Constructor = ScrollSpy
-
-
-  // SCROLLSPY NO CONFLICT
-  // =====================
-
-  $.fn.scrollspy.noConflict = function () {
-    $.fn.scrollspy = old
-    return this
-  }
-
-
-  // SCROLLSPY DATA-API
-  // ==================
-
-  $(window).on('load.bs.scrollspy.data-api', function () {
-    $('[data-spy="scroll"]').each(function () {
-      var $spy = $(this)
-      Plugin.call($spy, $spy.data())
-    })
-  })
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: tab.js v3.3.6
- * http://getbootstrap.com/javascript/#tabs
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // TAB CLASS DEFINITION
-  // ====================
-
-  var Tab = function (element) {
-    // jscs:disable requireDollarBeforejQueryAssignment
-    this.element = $(element)
-    // jscs:enable requireDollarBeforejQueryAssignment
-  }
-
-  Tab.VERSION = '3.3.6'
-
-  Tab.TRANSITION_DURATION = 150
-
-  Tab.prototype.show = function () {
-    var $this    = this.element
-    var $ul      = $this.closest('ul:not(.dropdown-menu)')
-    var selector = $this.data('target')
-
-    if (!selector) {
-      selector = $this.attr('href')
-      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
-    }
-
-    if ($this.parent('li').hasClass('active')) return
-
-    var $previous = $ul.find('.active:last a')
-    var hideEvent = $.Event('hide.bs.tab', {
-      relatedTarget: $this[0]
-    })
-    var showEvent = $.Event('show.bs.tab', {
-      relatedTarget: $previous[0]
-    })
-
-    $previous.trigger(hideEvent)
-    $this.trigger(showEvent)
-
-    if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
-
-    var $target = $(selector)
-
-    this.activate($this.closest('li'), $ul)
-    this.activate($target, $target.parent(), function () {
-      $previous.trigger({
-        type: 'hidden.bs.tab',
-        relatedTarget: $this[0]
-      })
-      $this.trigger({
-        type: 'shown.bs.tab',
-        relatedTarget: $previous[0]
-      })
-    })
-  }
-
-  Tab.prototype.activate = function (element, container, callback) {
-    var $active    = container.find('> .active')
-    var transition = callback
-      && $.support.transition
-      && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
-
-    function next() {
-      $active
-        .removeClass('active')
-        .find('> .dropdown-menu > .active')
-          .removeClass('active')
-        .end()
-        .find('[data-toggle="tab"]')
-          .attr('aria-expanded', false)
-
-      element
-        .addClass('active')
-        .find('[data-toggle="tab"]')
-          .attr('aria-expanded', true)
-
-      if (transition) {
-        element[0].offsetWidth // reflow for transition
-        element.addClass('in')
-      } else {
-        element.removeClass('fade')
-      }
-
-      if (element.parent('.dropdown-menu').length) {
-        element
-          .closest('li.dropdown')
-            .addClass('active')
-          .end()
-          .find('[data-toggle="tab"]')
-            .attr('aria-expanded', true)
-      }
-
-      callback && callback()
-    }
-
-    $active.length && transition ?
-      $active
-        .one('bsTransitionEnd', next)
-        .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
-      next()
-
-    $active.removeClass('in')
-  }
-
-
-  // TAB PLUGIN DEFINITION
-  // =====================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this = $(this)
-      var data  = $this.data('bs.tab')
-
-      if (!data) $this.data('bs.tab', (data = new Tab(this)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.tab
-
-  $.fn.tab             = Plugin
-  $.fn.tab.Constructor = Tab
-
-
-  // TAB NO CONFLICT
-  // ===============
-
-  $.fn.tab.noConflict = function () {
-    $.fn.tab = old
-    return this
-  }
-
-
-  // TAB DATA-API
-  // ============
-
-  var clickHandler = function (e) {
-    e.preventDefault()
-    Plugin.call($(this), 'show')
-  }
-
-  $(document)
-    .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
-    .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
-
-}(jQuery);
-
-/* ========================================================================
- * Bootstrap: affix.js v3.3.6
- * http://getbootstrap.com/javascript/#affix
- * ========================================================================
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * ======================================================================== */
-
-
-+function ($) {
-  'use strict';
-
-  // AFFIX CLASS DEFINITION
-  // ======================
-
-  var Affix = function (element, options) {
-    this.options = $.extend({}, Affix.DEFAULTS, options)
-
-    this.$target = $(this.options.target)
-      .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
-      .on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))
-
-    this.$element     = $(element)
-    this.affixed      = null
-    this.unpin        = null
-    this.pinnedOffset = null
-
-    this.checkPosition()
-  }
-
-  Affix.VERSION  = '3.3.6'
-
-  Affix.RESET    = 'affix affix-top affix-bottom'
-
-  Affix.DEFAULTS = {
-    offset: 0,
-    target: window
-  }
-
-  Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
-    var scrollTop    = this.$target.scrollTop()
-    var position     = this.$element.offset()
-    var targetHeight = this.$target.height()
-
-    if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
-
-    if (this.affixed == 'bottom') {
-      if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
-      return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
-    }
-
-    var initializing   = this.affixed == null
-    var colliderTop    = initializing ? scrollTop : position.top
-    var colliderHeight = initializing ? targetHeight : height
-
-    if (offsetTop != null && scrollTop <= offsetTop) return 'top'
-    if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
-
-    return false
-  }
-
-  Affix.prototype.getPinnedOffset = function () {
-    if (this.pinnedOffset) return this.pinnedOffset
-    this.$element.removeClass(Affix.RESET).addClass('affix')
-    var scrollTop = this.$target.scrollTop()
-    var position  = this.$element.offset()
-    return (this.pinnedOffset = position.top - scrollTop)
-  }
-
-  Affix.prototype.checkPositionWithEventLoop = function () {
-    setTimeout($.proxy(this.checkPosition, this), 1)
-  }
-
-  Affix.prototype.checkPosition = function () {
-    if (!this.$element.is(':visible')) return
-
-    var height       = this.$element.height()
-    var offset       = this.options.offset
-    var offsetTop    = offset.top
-    var offsetBottom = offset.bottom
-    var scrollHeight = Math.max($(document).height(), $(document.body).height())
-
-    if (typeof offset != 'object')         offsetBottom = offsetTop = offset
-    if (typeof offsetTop == 'function')    offsetTop    = offset.top(this.$element)
-    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
-
-    var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
-
-    if (this.affixed != affix) {
-      if (this.unpin != null) this.$element.css('top', '')
-
-      var affixType = 'affix' + (affix ? '-' + affix : '')
-      var e         = $.Event(affixType + '.bs.affix')
-
-      this.$element.trigger(e)
-
-      if (e.isDefaultPrevented()) return
-
-      this.affixed = affix
-      this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
-
-      this.$element
-        .removeClass(Affix.RESET)
-        .addClass(affixType)
-        .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
-    }
-
-    if (affix == 'bottom') {
-      this.$element.offset({
-        top: scrollHeight - height - offsetBottom
-      })
-    }
-  }
-
-
-  // AFFIX PLUGIN DEFINITION
-  // =======================
-
-  function Plugin(option) {
-    return this.each(function () {
-      var $this   = $(this)
-      var data    = $this.data('bs.affix')
-      var options = typeof option == 'object' && option
-
-      if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
-      if (typeof option == 'string') data[option]()
-    })
-  }
-
-  var old = $.fn.affix
-
-  $.fn.affix             = Plugin
-  $.fn.affix.Constructor = Affix
-
-
-  // AFFIX NO CONFLICT
-  // =================
-
-  $.fn.affix.noConflict = function () {
-    $.fn.affix = old
-    return this
-  }
-
-
-  // AFFIX DATA-API
-  // ==============
-
-  $(window).on('load', function () {
-    $('[data-spy="affix"]').each(function () {
-      var $spy = $(this)
-      var data = $spy.data()
-
-      data.offset = data.offset || {}
-
-      if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
-      if (data.offsetTop    != null) data.offset.top    = data.offsetTop
-
-      Plugin.call($spy, data)
-    })
-  })
-
-}(jQuery);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/js/bootstrap.min.js b/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/js/bootstrap.min.js
deleted file mode 100644
index e79c065..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/bootstrap-css/js/bootstrap.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*!
- * Bootstrap v3.3.6 (http://getbootstrap.com)
- * Copyright 2011-2015 Twitter, Inc.
- * Licensed under the MIT license
- */
-if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");
-d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/d3/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/d3/.bower.json
deleted file mode 100644
index 8a4a5dd..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/d3/.bower.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "name": "d3",
-  "description": "A JavaScript visualization library for HTML and SVG.",
-  "main": "d3.js",
-  "license": "BSD-3-Clause",
-  "ignore": [],
-  "homepage": "https://github.com/mbostock-bower/d3-bower",
-  "version": "3.5.17",
-  "_release": "3.5.17",
-  "_resolution": {
-    "type": "version",
-    "tag": "v3.5.17",
-    "commit": "abe0262a205c9f3755c3a757de4dfd1d49f34b24"
-  },
-  "_source": "https://github.com/mbostock-bower/d3-bower.git",
-  "_target": "~3.5.13",
-  "_originalSource": "d3"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/d3/LICENSE b/views/ngXosViews/serviceGrid/src/vendor/d3/LICENSE
deleted file mode 100644
index ff3f2e5..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/d3/LICENSE
+++ /dev/null
@@ -1,26 +0,0 @@
-Copyright (c) 2010-2016, Michael Bostock
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this
-  list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice,
-  this list of conditions and the following disclaimer in the documentation
-  and/or other materials provided with the distribution.
-
-* The name Michael Bostock may not be used to endorse or promote products
-  derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/d3/README.md b/views/ngXosViews/serviceGrid/src/vendor/d3/README.md
deleted file mode 100644
index 33e97bf..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/d3/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Data-Driven Documents
-
-<a href="https://d3js.org"><img src="https://d3js.org/logo.svg" align="left" hspace="10" vspace="6"></a>
-
-**D3.js** is a JavaScript library for manipulating documents based on data. **D3** helps you bring data to life using HTML, SVG, and CSS. **D3** emphasizes web standards and combines powerful visualization components with a data-driven approach to DOM manipulation, giving you the full capabilities of modern browsers without tying yourself to a proprietary framework.
-
-Want to learn more? [See the wiki.](https://github.com/mbostock/d3/wiki)
-
-For examples, [see the gallery](https://github.com/mbostock/d3/wiki/Gallery) and [mbostock’s bl.ocks](http://bl.ocks.org/mbostock).
-
-## Good News, Everyone!
-
-The next major release of D3, 4.0, is coming! See the [4.0 development branch](https://github.com/mbostock/d3/tree/4) and read the [new API reference](https://github.com/mbostock/d3/blob/4/README.md) to get ready.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/d3/bower.json b/views/ngXosViews/serviceGrid/src/vendor/d3/bower.json
deleted file mode 100644
index 5bc3d41..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/d3/bower.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "name": "d3",
-  "description": "A JavaScript visualization library for HTML and SVG.",
-  "main": "d3.js",
-  "license": "BSD-3-Clause",
-  "ignore": []
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/d3/d3.js b/views/ngXosViews/serviceGrid/src/vendor/d3/d3.js
deleted file mode 100644
index aded45c..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/d3/d3.js
+++ /dev/null
@@ -1,9554 +0,0 @@
-!function() {
-  var d3 = {
-    version: "3.5.17"
-  };
-  var d3_arraySlice = [].slice, d3_array = function(list) {
-    return d3_arraySlice.call(list);
-  };
-  var d3_document = this.document;
-  function d3_documentElement(node) {
-    return node && (node.ownerDocument || node.document || node).documentElement;
-  }
-  function d3_window(node) {
-    return node && (node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView);
-  }
-  if (d3_document) {
-    try {
-      d3_array(d3_document.documentElement.childNodes)[0].nodeType;
-    } catch (e) {
-      d3_array = function(list) {
-        var i = list.length, array = new Array(i);
-        while (i--) array[i] = list[i];
-        return array;
-      };
-    }
-  }
-  if (!Date.now) Date.now = function() {
-    return +new Date();
-  };
-  if (d3_document) {
-    try {
-      d3_document.createElement("DIV").style.setProperty("opacity", 0, "");
-    } catch (error) {
-      var d3_element_prototype = this.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = this.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty;
-      d3_element_prototype.setAttribute = function(name, value) {
-        d3_element_setAttribute.call(this, name, value + "");
-      };
-      d3_element_prototype.setAttributeNS = function(space, local, value) {
-        d3_element_setAttributeNS.call(this, space, local, value + "");
-      };
-      d3_style_prototype.setProperty = function(name, value, priority) {
-        d3_style_setProperty.call(this, name, value + "", priority);
-      };
-    }
-  }
-  d3.ascending = d3_ascending;
-  function d3_ascending(a, b) {
-    return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
-  }
-  d3.descending = function(a, b) {
-    return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
-  };
-  d3.min = function(array, f) {
-    var i = -1, n = array.length, a, b;
-    if (arguments.length === 1) {
-      while (++i < n) if ((b = array[i]) != null && b >= b) {
-        a = b;
-        break;
-      }
-      while (++i < n) if ((b = array[i]) != null && a > b) a = b;
-    } else {
-      while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
-        a = b;
-        break;
-      }
-      while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
-    }
-    return a;
-  };
-  d3.max = function(array, f) {
-    var i = -1, n = array.length, a, b;
-    if (arguments.length === 1) {
-      while (++i < n) if ((b = array[i]) != null && b >= b) {
-        a = b;
-        break;
-      }
-      while (++i < n) if ((b = array[i]) != null && b > a) a = b;
-    } else {
-      while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
-        a = b;
-        break;
-      }
-      while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
-    }
-    return a;
-  };
-  d3.extent = function(array, f) {
-    var i = -1, n = array.length, a, b, c;
-    if (arguments.length === 1) {
-      while (++i < n) if ((b = array[i]) != null && b >= b) {
-        a = c = b;
-        break;
-      }
-      while (++i < n) if ((b = array[i]) != null) {
-        if (a > b) a = b;
-        if (c < b) c = b;
-      }
-    } else {
-      while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
-        a = c = b;
-        break;
-      }
-      while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
-        if (a > b) a = b;
-        if (c < b) c = b;
-      }
-    }
-    return [ a, c ];
-  };
-  function d3_number(x) {
-    return x === null ? NaN : +x;
-  }
-  function d3_numeric(x) {
-    return !isNaN(x);
-  }
-  d3.sum = function(array, f) {
-    var s = 0, n = array.length, a, i = -1;
-    if (arguments.length === 1) {
-      while (++i < n) if (d3_numeric(a = +array[i])) s += a;
-    } else {
-      while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a;
-    }
-    return s;
-  };
-  d3.mean = function(array, f) {
-    var s = 0, n = array.length, a, i = -1, j = n;
-    if (arguments.length === 1) {
-      while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j;
-    } else {
-      while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j;
-    }
-    if (j) return s / j;
-  };
-  d3.quantile = function(values, p) {
-    var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h;
-    return e ? v + e * (values[h] - v) : v;
-  };
-  d3.median = function(array, f) {
-    var numbers = [], n = array.length, a, i = -1;
-    if (arguments.length === 1) {
-      while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a);
-    } else {
-      while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a);
-    }
-    if (numbers.length) return d3.quantile(numbers.sort(d3_ascending), .5);
-  };
-  d3.variance = function(array, f) {
-    var n = array.length, m = 0, a, d, s = 0, i = -1, j = 0;
-    if (arguments.length === 1) {
-      while (++i < n) {
-        if (d3_numeric(a = d3_number(array[i]))) {
-          d = a - m;
-          m += d / ++j;
-          s += d * (a - m);
-        }
-      }
-    } else {
-      while (++i < n) {
-        if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) {
-          d = a - m;
-          m += d / ++j;
-          s += d * (a - m);
-        }
-      }
-    }
-    if (j > 1) return s / (j - 1);
-  };
-  d3.deviation = function() {
-    var v = d3.variance.apply(this, arguments);
-    return v ? Math.sqrt(v) : v;
-  };
-  function d3_bisector(compare) {
-    return {
-      left: function(a, x, lo, hi) {
-        if (arguments.length < 3) lo = 0;
-        if (arguments.length < 4) hi = a.length;
-        while (lo < hi) {
-          var mid = lo + hi >>> 1;
-          if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid;
-        }
-        return lo;
-      },
-      right: function(a, x, lo, hi) {
-        if (arguments.length < 3) lo = 0;
-        if (arguments.length < 4) hi = a.length;
-        while (lo < hi) {
-          var mid = lo + hi >>> 1;
-          if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1;
-        }
-        return lo;
-      }
-    };
-  }
-  var d3_bisect = d3_bisector(d3_ascending);
-  d3.bisectLeft = d3_bisect.left;
-  d3.bisect = d3.bisectRight = d3_bisect.right;
-  d3.bisector = function(f) {
-    return d3_bisector(f.length === 1 ? function(d, x) {
-      return d3_ascending(f(d), x);
-    } : f);
-  };
-  d3.shuffle = function(array, i0, i1) {
-    if ((m = arguments.length) < 3) {
-      i1 = array.length;
-      if (m < 2) i0 = 0;
-    }
-    var m = i1 - i0, t, i;
-    while (m) {
-      i = Math.random() * m-- | 0;
-      t = array[m + i0], array[m + i0] = array[i + i0], array[i + i0] = t;
-    }
-    return array;
-  };
-  d3.permute = function(array, indexes) {
-    var i = indexes.length, permutes = new Array(i);
-    while (i--) permutes[i] = array[indexes[i]];
-    return permutes;
-  };
-  d3.pairs = function(array) {
-    var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n);
-    while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ];
-    return pairs;
-  };
-  d3.transpose = function(matrix) {
-    if (!(n = matrix.length)) return [];
-    for (var i = -1, m = d3.min(matrix, d3_transposeLength), transpose = new Array(m); ++i < m; ) {
-      for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n; ) {
-        row[j] = matrix[j][i];
-      }
-    }
-    return transpose;
-  };
-  function d3_transposeLength(d) {
-    return d.length;
-  }
-  d3.zip = function() {
-    return d3.transpose(arguments);
-  };
-  d3.keys = function(map) {
-    var keys = [];
-    for (var key in map) keys.push(key);
-    return keys;
-  };
-  d3.values = function(map) {
-    var values = [];
-    for (var key in map) values.push(map[key]);
-    return values;
-  };
-  d3.entries = function(map) {
-    var entries = [];
-    for (var key in map) entries.push({
-      key: key,
-      value: map[key]
-    });
-    return entries;
-  };
-  d3.merge = function(arrays) {
-    var n = arrays.length, m, i = -1, j = 0, merged, array;
-    while (++i < n) j += arrays[i].length;
-    merged = new Array(j);
-    while (--n >= 0) {
-      array = arrays[n];
-      m = array.length;
-      while (--m >= 0) {
-        merged[--j] = array[m];
-      }
-    }
-    return merged;
-  };
-  var abs = Math.abs;
-  d3.range = function(start, stop, step) {
-    if (arguments.length < 3) {
-      step = 1;
-      if (arguments.length < 2) {
-        stop = start;
-        start = 0;
-      }
-    }
-    if ((stop - start) / step === Infinity) throw new Error("infinite range");
-    var range = [], k = d3_range_integerScale(abs(step)), i = -1, j;
-    start *= k, stop *= k, step *= k;
-    if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k);
-    return range;
-  };
-  function d3_range_integerScale(x) {
-    var k = 1;
-    while (x * k % 1) k *= 10;
-    return k;
-  }
-  function d3_class(ctor, properties) {
-    for (var key in properties) {
-      Object.defineProperty(ctor.prototype, key, {
-        value: properties[key],
-        enumerable: false
-      });
-    }
-  }
-  d3.map = function(object, f) {
-    var map = new d3_Map();
-    if (object instanceof d3_Map) {
-      object.forEach(function(key, value) {
-        map.set(key, value);
-      });
-    } else if (Array.isArray(object)) {
-      var i = -1, n = object.length, o;
-      if (arguments.length === 1) while (++i < n) map.set(i, object[i]); else while (++i < n) map.set(f.call(object, o = object[i], i), o);
-    } else {
-      for (var key in object) map.set(key, object[key]);
-    }
-    return map;
-  };
-  function d3_Map() {
-    this._ = Object.create(null);
-  }
-  var d3_map_proto = "__proto__", d3_map_zero = "\x00";
-  d3_class(d3_Map, {
-    has: d3_map_has,
-    get: function(key) {
-      return this._[d3_map_escape(key)];
-    },
-    set: function(key, value) {
-      return this._[d3_map_escape(key)] = value;
-    },
-    remove: d3_map_remove,
-    keys: d3_map_keys,
-    values: function() {
-      var values = [];
-      for (var key in this._) values.push(this._[key]);
-      return values;
-    },
-    entries: function() {
-      var entries = [];
-      for (var key in this._) entries.push({
-        key: d3_map_unescape(key),
-        value: this._[key]
-      });
-      return entries;
-    },
-    size: d3_map_size,
-    empty: d3_map_empty,
-    forEach: function(f) {
-      for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]);
-    }
-  });
-  function d3_map_escape(key) {
-    return (key += "") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key;
-  }
-  function d3_map_unescape(key) {
-    return (key += "")[0] === d3_map_zero ? key.slice(1) : key;
-  }
-  function d3_map_has(key) {
-    return d3_map_escape(key) in this._;
-  }
-  function d3_map_remove(key) {
-    return (key = d3_map_escape(key)) in this._ && delete this._[key];
-  }
-  function d3_map_keys() {
-    var keys = [];
-    for (var key in this._) keys.push(d3_map_unescape(key));
-    return keys;
-  }
-  function d3_map_size() {
-    var size = 0;
-    for (var key in this._) ++size;
-    return size;
-  }
-  function d3_map_empty() {
-    for (var key in this._) return false;
-    return true;
-  }
-  d3.nest = function() {
-    var nest = {}, keys = [], sortKeys = [], sortValues, rollup;
-    function map(mapType, array, depth) {
-      if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
-      var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;
-      while (++i < n) {
-        if (values = valuesByKey.get(keyValue = key(object = array[i]))) {
-          values.push(object);
-        } else {
-          valuesByKey.set(keyValue, [ object ]);
-        }
-      }
-      if (mapType) {
-        object = mapType();
-        setter = function(keyValue, values) {
-          object.set(keyValue, map(mapType, values, depth));
-        };
-      } else {
-        object = {};
-        setter = function(keyValue, values) {
-          object[keyValue] = map(mapType, values, depth);
-        };
-      }
-      valuesByKey.forEach(setter);
-      return object;
-    }
-    function entries(map, depth) {
-      if (depth >= keys.length) return map;
-      var array = [], sortKey = sortKeys[depth++];
-      map.forEach(function(key, keyMap) {
-        array.push({
-          key: key,
-          values: entries(keyMap, depth)
-        });
-      });
-      return sortKey ? array.sort(function(a, b) {
-        return sortKey(a.key, b.key);
-      }) : array;
-    }
-    nest.map = function(array, mapType) {
-      return map(mapType, array, 0);
-    };
-    nest.entries = function(array) {
-      return entries(map(d3.map, array, 0), 0);
-    };
-    nest.key = function(d) {
-      keys.push(d);
-      return nest;
-    };
-    nest.sortKeys = function(order) {
-      sortKeys[keys.length - 1] = order;
-      return nest;
-    };
-    nest.sortValues = function(order) {
-      sortValues = order;
-      return nest;
-    };
-    nest.rollup = function(f) {
-      rollup = f;
-      return nest;
-    };
-    return nest;
-  };
-  d3.set = function(array) {
-    var set = new d3_Set();
-    if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]);
-    return set;
-  };
-  function d3_Set() {
-    this._ = Object.create(null);
-  }
-  d3_class(d3_Set, {
-    has: d3_map_has,
-    add: function(key) {
-      this._[d3_map_escape(key += "")] = true;
-      return key;
-    },
-    remove: d3_map_remove,
-    values: d3_map_keys,
-    size: d3_map_size,
-    empty: d3_map_empty,
-    forEach: function(f) {
-      for (var key in this._) f.call(this, d3_map_unescape(key));
-    }
-  });
-  d3.behavior = {};
-  function d3_identity(d) {
-    return d;
-  }
-  d3.rebind = function(target, source) {
-    var i = 1, n = arguments.length, method;
-    while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);
-    return target;
-  };
-  function d3_rebind(target, source, method) {
-    return function() {
-      var value = method.apply(source, arguments);
-      return value === source ? target : value;
-    };
-  }
-  function d3_vendorSymbol(object, name) {
-    if (name in object) return name;
-    name = name.charAt(0).toUpperCase() + name.slice(1);
-    for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) {
-      var prefixName = d3_vendorPrefixes[i] + name;
-      if (prefixName in object) return prefixName;
-    }
-  }
-  var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ];
-  function d3_noop() {}
-  d3.dispatch = function() {
-    var dispatch = new d3_dispatch(), i = -1, n = arguments.length;
-    while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
-    return dispatch;
-  };
-  function d3_dispatch() {}
-  d3_dispatch.prototype.on = function(type, listener) {
-    var i = type.indexOf("."), name = "";
-    if (i >= 0) {
-      name = type.slice(i + 1);
-      type = type.slice(0, i);
-    }
-    if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener);
-    if (arguments.length === 2) {
-      if (listener == null) for (type in this) {
-        if (this.hasOwnProperty(type)) this[type].on(name, null);
-      }
-      return this;
-    }
-  };
-  function d3_dispatch_event(dispatch) {
-    var listeners = [], listenerByName = new d3_Map();
-    function event() {
-      var z = listeners, i = -1, n = z.length, l;
-      while (++i < n) if (l = z[i].on) l.apply(this, arguments);
-      return dispatch;
-    }
-    event.on = function(name, listener) {
-      var l = listenerByName.get(name), i;
-      if (arguments.length < 2) return l && l.on;
-      if (l) {
-        l.on = null;
-        listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1));
-        listenerByName.remove(name);
-      }
-      if (listener) listeners.push(listenerByName.set(name, {
-        on: listener
-      }));
-      return dispatch;
-    };
-    return event;
-  }
-  d3.event = null;
-  function d3_eventPreventDefault() {
-    d3.event.preventDefault();
-  }
-  function d3_eventSource() {
-    var e = d3.event, s;
-    while (s = e.sourceEvent) e = s;
-    return e;
-  }
-  function d3_eventDispatch(target) {
-    var dispatch = new d3_dispatch(), i = 0, n = arguments.length;
-    while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
-    dispatch.of = function(thiz, argumentz) {
-      return function(e1) {
-        try {
-          var e0 = e1.sourceEvent = d3.event;
-          e1.target = target;
-          d3.event = e1;
-          dispatch[e1.type].apply(thiz, argumentz);
-        } finally {
-          d3.event = e0;
-        }
-      };
-    };
-    return dispatch;
-  }
-  d3.requote = function(s) {
-    return s.replace(d3_requote_re, "\\$&");
-  };
-  var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
-  var d3_subclass = {}.__proto__ ? function(object, prototype) {
-    object.__proto__ = prototype;
-  } : function(object, prototype) {
-    for (var property in prototype) object[property] = prototype[property];
-  };
-  function d3_selection(groups) {
-    d3_subclass(groups, d3_selectionPrototype);
-    return groups;
-  }
-  var d3_select = function(s, n) {
-    return n.querySelector(s);
-  }, d3_selectAll = function(s, n) {
-    return n.querySelectorAll(s);
-  }, d3_selectMatches = function(n, s) {
-    var d3_selectMatcher = n.matches || n[d3_vendorSymbol(n, "matchesSelector")];
-    d3_selectMatches = function(n, s) {
-      return d3_selectMatcher.call(n, s);
-    };
-    return d3_selectMatches(n, s);
-  };
-  if (typeof Sizzle === "function") {
-    d3_select = function(s, n) {
-      return Sizzle(s, n)[0] || null;
-    };
-    d3_selectAll = Sizzle;
-    d3_selectMatches = Sizzle.matchesSelector;
-  }
-  d3.selection = function() {
-    return d3.select(d3_document.documentElement);
-  };
-  var d3_selectionPrototype = d3.selection.prototype = [];
-  d3_selectionPrototype.select = function(selector) {
-    var subgroups = [], subgroup, subnode, group, node;
-    selector = d3_selection_selector(selector);
-    for (var j = -1, m = this.length; ++j < m; ) {
-      subgroups.push(subgroup = []);
-      subgroup.parentNode = (group = this[j]).parentNode;
-      for (var i = -1, n = group.length; ++i < n; ) {
-        if (node = group[i]) {
-          subgroup.push(subnode = selector.call(node, node.__data__, i, j));
-          if (subnode && "__data__" in node) subnode.__data__ = node.__data__;
-        } else {
-          subgroup.push(null);
-        }
-      }
-    }
-    return d3_selection(subgroups);
-  };
-  function d3_selection_selector(selector) {
-    return typeof selector === "function" ? selector : function() {
-      return d3_select(selector, this);
-    };
-  }
-  d3_selectionPrototype.selectAll = function(selector) {
-    var subgroups = [], subgroup, node;
-    selector = d3_selection_selectorAll(selector);
-    for (var j = -1, m = this.length; ++j < m; ) {
-      for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
-        if (node = group[i]) {
-          subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j)));
-          subgroup.parentNode = node;
-        }
-      }
-    }
-    return d3_selection(subgroups);
-  };
-  function d3_selection_selectorAll(selector) {
-    return typeof selector === "function" ? selector : function() {
-      return d3_selectAll(selector, this);
-    };
-  }
-  var d3_nsXhtml = "http://www.w3.org/1999/xhtml";
-  var d3_nsPrefix = {
-    svg: "http://www.w3.org/2000/svg",
-    xhtml: d3_nsXhtml,
-    xlink: "http://www.w3.org/1999/xlink",
-    xml: "http://www.w3.org/XML/1998/namespace",
-    xmlns: "http://www.w3.org/2000/xmlns/"
-  };
-  d3.ns = {
-    prefix: d3_nsPrefix,
-    qualify: function(name) {
-      var i = name.indexOf(":"), prefix = name;
-      if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
-      return d3_nsPrefix.hasOwnProperty(prefix) ? {
-        space: d3_nsPrefix[prefix],
-        local: name
-      } : name;
-    }
-  };
-  d3_selectionPrototype.attr = function(name, value) {
-    if (arguments.length < 2) {
-      if (typeof name === "string") {
-        var node = this.node();
-        name = d3.ns.qualify(name);
-        return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name);
-      }
-      for (value in name) this.each(d3_selection_attr(value, name[value]));
-      return this;
-    }
-    return this.each(d3_selection_attr(name, value));
-  };
-  function d3_selection_attr(name, value) {
-    name = d3.ns.qualify(name);
-    function attrNull() {
-      this.removeAttribute(name);
-    }
-    function attrNullNS() {
-      this.removeAttributeNS(name.space, name.local);
-    }
-    function attrConstant() {
-      this.setAttribute(name, value);
-    }
-    function attrConstantNS() {
-      this.setAttributeNS(name.space, name.local, value);
-    }
-    function attrFunction() {
-      var x = value.apply(this, arguments);
-      if (x == null) this.removeAttribute(name); else this.setAttribute(name, x);
-    }
-    function attrFunctionNS() {
-      var x = value.apply(this, arguments);
-      if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x);
-    }
-    return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant;
-  }
-  function d3_collapse(s) {
-    return s.trim().replace(/\s+/g, " ");
-  }
-  d3_selectionPrototype.classed = function(name, value) {
-    if (arguments.length < 2) {
-      if (typeof name === "string") {
-        var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1;
-        if (value = node.classList) {
-          while (++i < n) if (!value.contains(name[i])) return false;
-        } else {
-          value = node.getAttribute("class");
-          while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false;
-        }
-        return true;
-      }
-      for (value in name) this.each(d3_selection_classed(value, name[value]));
-      return this;
-    }
-    return this.each(d3_selection_classed(name, value));
-  };
-  function d3_selection_classedRe(name) {
-    return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g");
-  }
-  function d3_selection_classes(name) {
-    return (name + "").trim().split(/^|\s+/);
-  }
-  function d3_selection_classed(name, value) {
-    name = d3_selection_classes(name).map(d3_selection_classedName);
-    var n = name.length;
-    function classedConstant() {
-      var i = -1;
-      while (++i < n) name[i](this, value);
-    }
-    function classedFunction() {
-      var i = -1, x = value.apply(this, arguments);
-      while (++i < n) name[i](this, x);
-    }
-    return typeof value === "function" ? classedFunction : classedConstant;
-  }
-  function d3_selection_classedName(name) {
-    var re = d3_selection_classedRe(name);
-    return function(node, value) {
-      if (c = node.classList) return value ? c.add(name) : c.remove(name);
-      var c = node.getAttribute("class") || "";
-      if (value) {
-        re.lastIndex = 0;
-        if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name));
-      } else {
-        node.setAttribute("class", d3_collapse(c.replace(re, " ")));
-      }
-    };
-  }
-  d3_selectionPrototype.style = function(name, value, priority) {
-    var n = arguments.length;
-    if (n < 3) {
-      if (typeof name !== "string") {
-        if (n < 2) value = "";
-        for (priority in name) this.each(d3_selection_style(priority, name[priority], value));
-        return this;
-      }
-      if (n < 2) {
-        var node = this.node();
-        return d3_window(node).getComputedStyle(node, null).getPropertyValue(name);
-      }
-      priority = "";
-    }
-    return this.each(d3_selection_style(name, value, priority));
-  };
-  function d3_selection_style(name, value, priority) {
-    function styleNull() {
-      this.style.removeProperty(name);
-    }
-    function styleConstant() {
-      this.style.setProperty(name, value, priority);
-    }
-    function styleFunction() {
-      var x = value.apply(this, arguments);
-      if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority);
-    }
-    return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant;
-  }
-  d3_selectionPrototype.property = function(name, value) {
-    if (arguments.length < 2) {
-      if (typeof name === "string") return this.node()[name];
-      for (value in name) this.each(d3_selection_property(value, name[value]));
-      return this;
-    }
-    return this.each(d3_selection_property(name, value));
-  };
-  function d3_selection_property(name, value) {
-    function propertyNull() {
-      delete this[name];
-    }
-    function propertyConstant() {
-      this[name] = value;
-    }
-    function propertyFunction() {
-      var x = value.apply(this, arguments);
-      if (x == null) delete this[name]; else this[name] = x;
-    }
-    return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant;
-  }
-  d3_selectionPrototype.text = function(value) {
-    return arguments.length ? this.each(typeof value === "function" ? function() {
-      var v = value.apply(this, arguments);
-      this.textContent = v == null ? "" : v;
-    } : value == null ? function() {
-      this.textContent = "";
-    } : function() {
-      this.textContent = value;
-    }) : this.node().textContent;
-  };
-  d3_selectionPrototype.html = function(value) {
-    return arguments.length ? this.each(typeof value === "function" ? function() {
-      var v = value.apply(this, arguments);
-      this.innerHTML = v == null ? "" : v;
-    } : value == null ? function() {
-      this.innerHTML = "";
-    } : function() {
-      this.innerHTML = value;
-    }) : this.node().innerHTML;
-  };
-  d3_selectionPrototype.append = function(name) {
-    name = d3_selection_creator(name);
-    return this.select(function() {
-      return this.appendChild(name.apply(this, arguments));
-    });
-  };
-  function d3_selection_creator(name) {
-    function create() {
-      var document = this.ownerDocument, namespace = this.namespaceURI;
-      return namespace === d3_nsXhtml && document.documentElement.namespaceURI === d3_nsXhtml ? document.createElement(name) : document.createElementNS(namespace, name);
-    }
-    function createNS() {
-      return this.ownerDocument.createElementNS(name.space, name.local);
-    }
-    return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? createNS : create;
-  }
-  d3_selectionPrototype.insert = function(name, before) {
-    name = d3_selection_creator(name);
-    before = d3_selection_selector(before);
-    return this.select(function() {
-      return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null);
-    });
-  };
-  d3_selectionPrototype.remove = function() {
-    return this.each(d3_selectionRemove);
-  };
-  function d3_selectionRemove() {
-    var parent = this.parentNode;
-    if (parent) parent.removeChild(this);
-  }
-  d3_selectionPrototype.data = function(value, key) {
-    var i = -1, n = this.length, group, node;
-    if (!arguments.length) {
-      value = new Array(n = (group = this[0]).length);
-      while (++i < n) {
-        if (node = group[i]) {
-          value[i] = node.__data__;
-        }
-      }
-      return value;
-    }
-    function bind(group, groupData) {
-      var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData;
-      if (key) {
-        var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue;
-        for (i = -1; ++i < n; ) {
-          if (node = group[i]) {
-            if (nodeByKeyValue.has(keyValue = key.call(node, node.__data__, i))) {
-              exitNodes[i] = node;
-            } else {
-              nodeByKeyValue.set(keyValue, node);
-            }
-            keyValues[i] = keyValue;
-          }
-        }
-        for (i = -1; ++i < m; ) {
-          if (!(node = nodeByKeyValue.get(keyValue = key.call(groupData, nodeData = groupData[i], i)))) {
-            enterNodes[i] = d3_selection_dataNode(nodeData);
-          } else if (node !== true) {
-            updateNodes[i] = node;
-            node.__data__ = nodeData;
-          }
-          nodeByKeyValue.set(keyValue, true);
-        }
-        for (i = -1; ++i < n; ) {
-          if (i in keyValues && nodeByKeyValue.get(keyValues[i]) !== true) {
-            exitNodes[i] = group[i];
-          }
-        }
-      } else {
-        for (i = -1; ++i < n0; ) {
-          node = group[i];
-          nodeData = groupData[i];
-          if (node) {
-            node.__data__ = nodeData;
-            updateNodes[i] = node;
-          } else {
-            enterNodes[i] = d3_selection_dataNode(nodeData);
-          }
-        }
-        for (;i < m; ++i) {
-          enterNodes[i] = d3_selection_dataNode(groupData[i]);
-        }
-        for (;i < n; ++i) {
-          exitNodes[i] = group[i];
-        }
-      }
-      enterNodes.update = updateNodes;
-      enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode;
-      enter.push(enterNodes);
-      update.push(updateNodes);
-      exit.push(exitNodes);
-    }
-    var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]);
-    if (typeof value === "function") {
-      while (++i < n) {
-        bind(group = this[i], value.call(group, group.parentNode.__data__, i));
-      }
-    } else {
-      while (++i < n) {
-        bind(group = this[i], value);
-      }
-    }
-    update.enter = function() {
-      return enter;
-    };
-    update.exit = function() {
-      return exit;
-    };
-    return update;
-  };
-  function d3_selection_dataNode(data) {
-    return {
-      __data__: data
-    };
-  }
-  d3_selectionPrototype.datum = function(value) {
-    return arguments.length ? this.property("__data__", value) : this.property("__data__");
-  };
-  d3_selectionPrototype.filter = function(filter) {
-    var subgroups = [], subgroup, group, node;
-    if (typeof filter !== "function") filter = d3_selection_filter(filter);
-    for (var j = 0, m = this.length; j < m; j++) {
-      subgroups.push(subgroup = []);
-      subgroup.parentNode = (group = this[j]).parentNode;
-      for (var i = 0, n = group.length; i < n; i++) {
-        if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
-          subgroup.push(node);
-        }
-      }
-    }
-    return d3_selection(subgroups);
-  };
-  function d3_selection_filter(selector) {
-    return function() {
-      return d3_selectMatches(this, selector);
-    };
-  }
-  d3_selectionPrototype.order = function() {
-    for (var j = -1, m = this.length; ++j < m; ) {
-      for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {
-        if (node = group[i]) {
-          if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);
-          next = node;
-        }
-      }
-    }
-    return this;
-  };
-  d3_selectionPrototype.sort = function(comparator) {
-    comparator = d3_selection_sortComparator.apply(this, arguments);
-    for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator);
-    return this.order();
-  };
-  function d3_selection_sortComparator(comparator) {
-    if (!arguments.length) comparator = d3_ascending;
-    return function(a, b) {
-      return a && b ? comparator(a.__data__, b.__data__) : !a - !b;
-    };
-  }
-  d3_selectionPrototype.each = function(callback) {
-    return d3_selection_each(this, function(node, i, j) {
-      callback.call(node, node.__data__, i, j);
-    });
-  };
-  function d3_selection_each(groups, callback) {
-    for (var j = 0, m = groups.length; j < m; j++) {
-      for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) {
-        if (node = group[i]) callback(node, i, j);
-      }
-    }
-    return groups;
-  }
-  d3_selectionPrototype.call = function(callback) {
-    var args = d3_array(arguments);
-    callback.apply(args[0] = this, args);
-    return this;
-  };
-  d3_selectionPrototype.empty = function() {
-    return !this.node();
-  };
-  d3_selectionPrototype.node = function() {
-    for (var j = 0, m = this.length; j < m; j++) {
-      for (var group = this[j], i = 0, n = group.length; i < n; i++) {
-        var node = group[i];
-        if (node) return node;
-      }
-    }
-    return null;
-  };
-  d3_selectionPrototype.size = function() {
-    var n = 0;
-    d3_selection_each(this, function() {
-      ++n;
-    });
-    return n;
-  };
-  function d3_selection_enter(selection) {
-    d3_subclass(selection, d3_selection_enterPrototype);
-    return selection;
-  }
-  var d3_selection_enterPrototype = [];
-  d3.selection.enter = d3_selection_enter;
-  d3.selection.enter.prototype = d3_selection_enterPrototype;
-  d3_selection_enterPrototype.append = d3_selectionPrototype.append;
-  d3_selection_enterPrototype.empty = d3_selectionPrototype.empty;
-  d3_selection_enterPrototype.node = d3_selectionPrototype.node;
-  d3_selection_enterPrototype.call = d3_selectionPrototype.call;
-  d3_selection_enterPrototype.size = d3_selectionPrototype.size;
-  d3_selection_enterPrototype.select = function(selector) {
-    var subgroups = [], subgroup, subnode, upgroup, group, node;
-    for (var j = -1, m = this.length; ++j < m; ) {
-      upgroup = (group = this[j]).update;
-      subgroups.push(subgroup = []);
-      subgroup.parentNode = group.parentNode;
-      for (var i = -1, n = group.length; ++i < n; ) {
-        if (node = group[i]) {
-          subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j));
-          subnode.__data__ = node.__data__;
-        } else {
-          subgroup.push(null);
-        }
-      }
-    }
-    return d3_selection(subgroups);
-  };
-  d3_selection_enterPrototype.insert = function(name, before) {
-    if (arguments.length < 2) before = d3_selection_enterInsertBefore(this);
-    return d3_selectionPrototype.insert.call(this, name, before);
-  };
-  function d3_selection_enterInsertBefore(enter) {
-    var i0, j0;
-    return function(d, i, j) {
-      var group = enter[j].update, n = group.length, node;
-      if (j != j0) j0 = j, i0 = 0;
-      if (i >= i0) i0 = i + 1;
-      while (!(node = group[i0]) && ++i0 < n) ;
-      return node;
-    };
-  }
-  d3.select = function(node) {
-    var group;
-    if (typeof node === "string") {
-      group = [ d3_select(node, d3_document) ];
-      group.parentNode = d3_document.documentElement;
-    } else {
-      group = [ node ];
-      group.parentNode = d3_documentElement(node);
-    }
-    return d3_selection([ group ]);
-  };
-  d3.selectAll = function(nodes) {
-    var group;
-    if (typeof nodes === "string") {
-      group = d3_array(d3_selectAll(nodes, d3_document));
-      group.parentNode = d3_document.documentElement;
-    } else {
-      group = d3_array(nodes);
-      group.parentNode = null;
-    }
-    return d3_selection([ group ]);
-  };
-  d3_selectionPrototype.on = function(type, listener, capture) {
-    var n = arguments.length;
-    if (n < 3) {
-      if (typeof type !== "string") {
-        if (n < 2) listener = false;
-        for (capture in type) this.each(d3_selection_on(capture, type[capture], listener));
-        return this;
-      }
-      if (n < 2) return (n = this.node()["__on" + type]) && n._;
-      capture = false;
-    }
-    return this.each(d3_selection_on(type, listener, capture));
-  };
-  function d3_selection_on(type, listener, capture) {
-    var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener;
-    if (i > 0) type = type.slice(0, i);
-    var filter = d3_selection_onFilters.get(type);
-    if (filter) type = filter, wrap = d3_selection_onFilter;
-    function onRemove() {
-      var l = this[name];
-      if (l) {
-        this.removeEventListener(type, l, l.$);
-        delete this[name];
-      }
-    }
-    function onAdd() {
-      var l = wrap(listener, d3_array(arguments));
-      onRemove.call(this);
-      this.addEventListener(type, this[name] = l, l.$ = capture);
-      l._ = listener;
-    }
-    function removeAll() {
-      var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match;
-      for (var name in this) {
-        if (match = name.match(re)) {
-          var l = this[name];
-          this.removeEventListener(match[1], l, l.$);
-          delete this[name];
-        }
-      }
-    }
-    return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll;
-  }
-  var d3_selection_onFilters = d3.map({
-    mouseenter: "mouseover",
-    mouseleave: "mouseout"
-  });
-  if (d3_document) {
-    d3_selection_onFilters.forEach(function(k) {
-      if ("on" + k in d3_document) d3_selection_onFilters.remove(k);
-    });
-  }
-  function d3_selection_onListener(listener, argumentz) {
-    return function(e) {
-      var o = d3.event;
-      d3.event = e;
-      argumentz[0] = this.__data__;
-      try {
-        listener.apply(this, argumentz);
-      } finally {
-        d3.event = o;
-      }
-    };
-  }
-  function d3_selection_onFilter(listener, argumentz) {
-    var l = d3_selection_onListener(listener, argumentz);
-    return function(e) {
-      var target = this, related = e.relatedTarget;
-      if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) {
-        l.call(target, e);
-      }
-    };
-  }
-  var d3_event_dragSelect, d3_event_dragId = 0;
-  function d3_event_dragSuppress(node) {
-    var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window(node)).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault);
-    if (d3_event_dragSelect == null) {
-      d3_event_dragSelect = "onselectstart" in node ? false : d3_vendorSymbol(node.style, "userSelect");
-    }
-    if (d3_event_dragSelect) {
-      var style = d3_documentElement(node).style, select = style[d3_event_dragSelect];
-      style[d3_event_dragSelect] = "none";
-    }
-    return function(suppressClick) {
-      w.on(name, null);
-      if (d3_event_dragSelect) style[d3_event_dragSelect] = select;
-      if (suppressClick) {
-        var off = function() {
-          w.on(click, null);
-        };
-        w.on(click, function() {
-          d3_eventPreventDefault();
-          off();
-        }, true);
-        setTimeout(off, 0);
-      }
-    };
-  }
-  d3.mouse = function(container) {
-    return d3_mousePoint(container, d3_eventSource());
-  };
-  var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0;
-  function d3_mousePoint(container, e) {
-    if (e.changedTouches) e = e.changedTouches[0];
-    var svg = container.ownerSVGElement || container;
-    if (svg.createSVGPoint) {
-      var point = svg.createSVGPoint();
-      if (d3_mouse_bug44083 < 0) {
-        var window = d3_window(container);
-        if (window.scrollX || window.scrollY) {
-          svg = d3.select("body").append("svg").style({
-            position: "absolute",
-            top: 0,
-            left: 0,
-            margin: 0,
-            padding: 0,
-            border: "none"
-          }, "important");
-          var ctm = svg[0][0].getScreenCTM();
-          d3_mouse_bug44083 = !(ctm.f || ctm.e);
-          svg.remove();
-        }
-      }
-      if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX, 
-      point.y = e.clientY;
-      point = point.matrixTransform(container.getScreenCTM().inverse());
-      return [ point.x, point.y ];
-    }
-    var rect = container.getBoundingClientRect();
-    return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ];
-  }
-  d3.touch = function(container, touches, identifier) {
-    if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches;
-    if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) {
-      if ((touch = touches[i]).identifier === identifier) {
-        return d3_mousePoint(container, touch);
-      }
-    }
-  };
-  d3.behavior.drag = function() {
-    var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_window, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_identity, "touchmove", "touchend");
-    function drag() {
-      this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart);
-    }
-    function dragstart(id, position, subject, move, end) {
-      return function() {
-        var that = this, target = d3.event.target.correspondingElement || d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId);
-        if (origin) {
-          dragOffset = origin.apply(that, arguments);
-          dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ];
-        } else {
-          dragOffset = [ 0, 0 ];
-        }
-        dispatch({
-          type: "dragstart"
-        });
-        function moved() {
-          var position1 = position(parent, dragId), dx, dy;
-          if (!position1) return;
-          dx = position1[0] - position0[0];
-          dy = position1[1] - position0[1];
-          dragged |= dx | dy;
-          position0 = position1;
-          dispatch({
-            type: "drag",
-            x: position1[0] + dragOffset[0],
-            y: position1[1] + dragOffset[1],
-            dx: dx,
-            dy: dy
-          });
-        }
-        function ended() {
-          if (!position(parent, dragId)) return;
-          dragSubject.on(move + dragName, null).on(end + dragName, null);
-          dragRestore(dragged);
-          dispatch({
-            type: "dragend"
-          });
-        }
-      };
-    }
-    drag.origin = function(x) {
-      if (!arguments.length) return origin;
-      origin = x;
-      return drag;
-    };
-    return d3.rebind(drag, event, "on");
-  };
-  function d3_behavior_dragTouchId() {
-    return d3.event.changedTouches[0].identifier;
-  }
-  d3.touches = function(container, touches) {
-    if (arguments.length < 2) touches = d3_eventSource().touches;
-    return touches ? d3_array(touches).map(function(touch) {
-      var point = d3_mousePoint(container, touch);
-      point.identifier = touch.identifier;
-      return point;
-    }) : [];
-  };
-  var ε = 1e-6, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;
-  function d3_sgn(x) {
-    return x > 0 ? 1 : x < 0 ? -1 : 0;
-  }
-  function d3_cross2d(a, b, c) {
-    return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
-  }
-  function d3_acos(x) {
-    return x > 1 ? 0 : x < -1 ? π : Math.acos(x);
-  }
-  function d3_asin(x) {
-    return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x);
-  }
-  function d3_sinh(x) {
-    return ((x = Math.exp(x)) - 1 / x) / 2;
-  }
-  function d3_cosh(x) {
-    return ((x = Math.exp(x)) + 1 / x) / 2;
-  }
-  function d3_tanh(x) {
-    return ((x = Math.exp(2 * x)) - 1) / (x + 1);
-  }
-  function d3_haversin(x) {
-    return (x = Math.sin(x / 2)) * x;
-  }
-  var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4;
-  d3.interpolateZoom = function(p0, p1) {
-    var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i, S;
-    if (d2 < ε2) {
-      S = Math.log(w1 / w0) / ρ;
-      i = function(t) {
-        return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * t * S) ];
-      };
-    } else {
-      var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
-      S = (r1 - r0) / ρ;
-      i = function(t) {
-        var s = t * S, coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0));
-        return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ];
-      };
-    }
-    i.duration = S * 1e3;
-    return i;
-  };
-  d3.behavior.zoom = function() {
-    var view = {
-      x: 0,
-      y: 0,
-      k: 1
-    }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, duration = 250, zooming = 0, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1;
-    if (!d3_behavior_zoomWheel) {
-      d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() {
-        return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1);
-      }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() {
-        return d3.event.wheelDelta;
-      }, "mousewheel") : (d3_behavior_zoomDelta = function() {
-        return -d3.event.detail;
-      }, "MozMousePixelScroll");
-    }
-    function zoom(g) {
-      g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted);
-    }
-    zoom.event = function(g) {
-      g.each(function() {
-        var dispatch = event.of(this, arguments), view1 = view;
-        if (d3_transitionInheritId) {
-          d3.select(this).transition().each("start.zoom", function() {
-            view = this.__chart__ || {
-              x: 0,
-              y: 0,
-              k: 1
-            };
-            zoomstarted(dispatch);
-          }).tween("zoom:zoom", function() {
-            var dx = size[0], dy = size[1], cx = center0 ? center0[0] : dx / 2, cy = center0 ? center0[1] : dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]);
-            return function(t) {
-              var l = i(t), k = dx / l[2];
-              this.__chart__ = view = {
-                x: cx - l[0] * k,
-                y: cy - l[1] * k,
-                k: k
-              };
-              zoomed(dispatch);
-            };
-          }).each("interrupt.zoom", function() {
-            zoomended(dispatch);
-          }).each("end.zoom", function() {
-            zoomended(dispatch);
-          });
-        } else {
-          this.__chart__ = view;
-          zoomstarted(dispatch);
-          zoomed(dispatch);
-          zoomended(dispatch);
-        }
-      });
-    };
-    zoom.translate = function(_) {
-      if (!arguments.length) return [ view.x, view.y ];
-      view = {
-        x: +_[0],
-        y: +_[1],
-        k: view.k
-      };
-      rescale();
-      return zoom;
-    };
-    zoom.scale = function(_) {
-      if (!arguments.length) return view.k;
-      view = {
-        x: view.x,
-        y: view.y,
-        k: null
-      };
-      scaleTo(+_);
-      rescale();
-      return zoom;
-    };
-    zoom.scaleExtent = function(_) {
-      if (!arguments.length) return scaleExtent;
-      scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ];
-      return zoom;
-    };
-    zoom.center = function(_) {
-      if (!arguments.length) return center;
-      center = _ && [ +_[0], +_[1] ];
-      return zoom;
-    };
-    zoom.size = function(_) {
-      if (!arguments.length) return size;
-      size = _ && [ +_[0], +_[1] ];
-      return zoom;
-    };
-    zoom.duration = function(_) {
-      if (!arguments.length) return duration;
-      duration = +_;
-      return zoom;
-    };
-    zoom.x = function(z) {
-      if (!arguments.length) return x1;
-      x1 = z;
-      x0 = z.copy();
-      view = {
-        x: 0,
-        y: 0,
-        k: 1
-      };
-      return zoom;
-    };
-    zoom.y = function(z) {
-      if (!arguments.length) return y1;
-      y1 = z;
-      y0 = z.copy();
-      view = {
-        x: 0,
-        y: 0,
-        k: 1
-      };
-      return zoom;
-    };
-    function location(p) {
-      return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ];
-    }
-    function point(l) {
-      return [ l[0] * view.k + view.x, l[1] * view.k + view.y ];
-    }
-    function scaleTo(s) {
-      view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s));
-    }
-    function translateTo(p, l) {
-      l = point(l);
-      view.x += p[0] - l[0];
-      view.y += p[1] - l[1];
-    }
-    function zoomTo(that, p, l, k) {
-      that.__chart__ = {
-        x: view.x,
-        y: view.y,
-        k: view.k
-      };
-      scaleTo(Math.pow(2, k));
-      translateTo(center0 = p, l);
-      that = d3.select(that);
-      if (duration > 0) that = that.transition().duration(duration);
-      that.call(zoom.event);
-    }
-    function rescale() {
-      if (x1) x1.domain(x0.range().map(function(x) {
-        return (x - view.x) / view.k;
-      }).map(x0.invert));
-      if (y1) y1.domain(y0.range().map(function(y) {
-        return (y - view.y) / view.k;
-      }).map(y0.invert));
-    }
-    function zoomstarted(dispatch) {
-      if (!zooming++) dispatch({
-        type: "zoomstart"
-      });
-    }
-    function zoomed(dispatch) {
-      rescale();
-      dispatch({
-        type: "zoom",
-        scale: view.k,
-        translate: [ view.x, view.y ]
-      });
-    }
-    function zoomended(dispatch) {
-      if (!--zooming) dispatch({
-        type: "zoomend"
-      }), center0 = null;
-    }
-    function mousedowned() {
-      var that = this, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that);
-      d3_selection_interrupt.call(that);
-      zoomstarted(dispatch);
-      function moved() {
-        dragged = 1;
-        translateTo(d3.mouse(that), location0);
-        zoomed(dispatch);
-      }
-      function ended() {
-        subject.on(mousemove, null).on(mouseup, null);
-        dragRestore(dragged);
-        zoomended(dispatch);
-      }
-    }
-    function touchstarted() {
-      var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress(that);
-      started();
-      zoomstarted(dispatch);
-      subject.on(mousedown, null).on(touchstart, started);
-      function relocate() {
-        var touches = d3.touches(that);
-        scale0 = view.k;
-        touches.forEach(function(t) {
-          if (t.identifier in locations0) locations0[t.identifier] = location(t);
-        });
-        return touches;
-      }
-      function started() {
-        var target = d3.event.target;
-        d3.select(target).on(touchmove, moved).on(touchend, ended);
-        targets.push(target);
-        var changed = d3.event.changedTouches;
-        for (var i = 0, n = changed.length; i < n; ++i) {
-          locations0[changed[i].identifier] = null;
-        }
-        var touches = relocate(), now = Date.now();
-        if (touches.length === 1) {
-          if (now - touchtime < 500) {
-            var p = touches[0];
-            zoomTo(that, p, locations0[p.identifier], Math.floor(Math.log(view.k) / Math.LN2) + 1);
-            d3_eventPreventDefault();
-          }
-          touchtime = now;
-        } else if (touches.length > 1) {
-          var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1];
-          distance0 = dx * dx + dy * dy;
-        }
-      }
-      function moved() {
-        var touches = d3.touches(that), p0, l0, p1, l1;
-        d3_selection_interrupt.call(that);
-        for (var i = 0, n = touches.length; i < n; ++i, l1 = null) {
-          p1 = touches[i];
-          if (l1 = locations0[p1.identifier]) {
-            if (l0) break;
-            p0 = p1, l0 = l1;
-          }
-        }
-        if (l1) {
-          var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0);
-          p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ];
-          l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ];
-          scaleTo(scale1 * scale0);
-        }
-        touchtime = null;
-        translateTo(p0, l0);
-        zoomed(dispatch);
-      }
-      function ended() {
-        if (d3.event.touches.length) {
-          var changed = d3.event.changedTouches;
-          for (var i = 0, n = changed.length; i < n; ++i) {
-            delete locations0[changed[i].identifier];
-          }
-          for (var identifier in locations0) {
-            return void relocate();
-          }
-        }
-        d3.selectAll(targets).on(zoomName, null);
-        subject.on(mousedown, mousedowned).on(touchstart, touchstarted);
-        dragRestore();
-        zoomended(dispatch);
-      }
-    }
-    function mousewheeled() {
-      var dispatch = event.of(this, arguments);
-      if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this), 
-      translate0 = location(center0 = center || d3.mouse(this)), zoomstarted(dispatch);
-      mousewheelTimer = setTimeout(function() {
-        mousewheelTimer = null;
-        zoomended(dispatch);
-      }, 50);
-      d3_eventPreventDefault();
-      scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);
-      translateTo(center0, translate0);
-      zoomed(dispatch);
-    }
-    function dblclicked() {
-      var p = d3.mouse(this), k = Math.log(view.k) / Math.LN2;
-      zoomTo(this, p, location(p), d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1);
-    }
-    return d3.rebind(zoom, event, "on");
-  };
-  var d3_behavior_zoomInfinity = [ 0, Infinity ], d3_behavior_zoomDelta, d3_behavior_zoomWheel;
-  d3.color = d3_color;
-  function d3_color() {}
-  d3_color.prototype.toString = function() {
-    return this.rgb() + "";
-  };
-  d3.hsl = d3_hsl;
-  function d3_hsl(h, s, l) {
-    return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l);
-  }
-  var d3_hslPrototype = d3_hsl.prototype = new d3_color();
-  d3_hslPrototype.brighter = function(k) {
-    k = Math.pow(.7, arguments.length ? k : 1);
-    return new d3_hsl(this.h, this.s, this.l / k);
-  };
-  d3_hslPrototype.darker = function(k) {
-    k = Math.pow(.7, arguments.length ? k : 1);
-    return new d3_hsl(this.h, this.s, k * this.l);
-  };
-  d3_hslPrototype.rgb = function() {
-    return d3_hsl_rgb(this.h, this.s, this.l);
-  };
-  function d3_hsl_rgb(h, s, l) {
-    var m1, m2;
-    h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h;
-    s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s;
-    l = l < 0 ? 0 : l > 1 ? 1 : l;
-    m2 = l <= .5 ? l * (1 + s) : l + s - l * s;
-    m1 = 2 * l - m2;
-    function v(h) {
-      if (h > 360) h -= 360; else if (h < 0) h += 360;
-      if (h < 60) return m1 + (m2 - m1) * h / 60;
-      if (h < 180) return m2;
-      if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60;
-      return m1;
-    }
-    function vv(h) {
-      return Math.round(v(h) * 255);
-    }
-    return new d3_rgb(vv(h + 120), vv(h), vv(h - 120));
-  }
-  d3.hcl = d3_hcl;
-  function d3_hcl(h, c, l) {
-    return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l);
-  }
-  var d3_hclPrototype = d3_hcl.prototype = new d3_color();
-  d3_hclPrototype.brighter = function(k) {
-    return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)));
-  };
-  d3_hclPrototype.darker = function(k) {
-    return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)));
-  };
-  d3_hclPrototype.rgb = function() {
-    return d3_hcl_lab(this.h, this.c, this.l).rgb();
-  };
-  function d3_hcl_lab(h, c, l) {
-    if (isNaN(h)) h = 0;
-    if (isNaN(c)) c = 0;
-    return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c);
-  }
-  d3.lab = d3_lab;
-  function d3_lab(l, a, b) {
-    return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.h, l.c, l.l) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b);
-  }
-  var d3_lab_K = 18;
-  var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883;
-  var d3_labPrototype = d3_lab.prototype = new d3_color();
-  d3_labPrototype.brighter = function(k) {
-    return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
-  };
-  d3_labPrototype.darker = function(k) {
-    return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
-  };
-  d3_labPrototype.rgb = function() {
-    return d3_lab_rgb(this.l, this.a, this.b);
-  };
-  function d3_lab_rgb(l, a, b) {
-    var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200;
-    x = d3_lab_xyz(x) * d3_lab_X;
-    y = d3_lab_xyz(y) * d3_lab_Y;
-    z = d3_lab_xyz(z) * d3_lab_Z;
-    return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z));
-  }
-  function d3_lab_hcl(l, a, b) {
-    return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l);
-  }
-  function d3_lab_xyz(x) {
-    return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037;
-  }
-  function d3_xyz_lab(x) {
-    return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29;
-  }
-  function d3_xyz_rgb(r) {
-    return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055));
-  }
-  d3.rgb = d3_rgb;
-  function d3_rgb(r, g, b) {
-    return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b);
-  }
-  function d3_rgbNumber(value) {
-    return new d3_rgb(value >> 16, value >> 8 & 255, value & 255);
-  }
-  function d3_rgbString(value) {
-    return d3_rgbNumber(value) + "";
-  }
-  var d3_rgbPrototype = d3_rgb.prototype = new d3_color();
-  d3_rgbPrototype.brighter = function(k) {
-    k = Math.pow(.7, arguments.length ? k : 1);
-    var r = this.r, g = this.g, b = this.b, i = 30;
-    if (!r && !g && !b) return new d3_rgb(i, i, i);
-    if (r && r < i) r = i;
-    if (g && g < i) g = i;
-    if (b && b < i) b = i;
-    return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k));
-  };
-  d3_rgbPrototype.darker = function(k) {
-    k = Math.pow(.7, arguments.length ? k : 1);
-    return new d3_rgb(k * this.r, k * this.g, k * this.b);
-  };
-  d3_rgbPrototype.hsl = function() {
-    return d3_rgb_hsl(this.r, this.g, this.b);
-  };
-  d3_rgbPrototype.toString = function() {
-    return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b);
-  };
-  function d3_rgb_hex(v) {
-    return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16);
-  }
-  function d3_rgb_parse(format, rgb, hsl) {
-    var r = 0, g = 0, b = 0, m1, m2, color;
-    m1 = /([a-z]+)\((.*)\)/.exec(format = format.toLowerCase());
-    if (m1) {
-      m2 = m1[2].split(",");
-      switch (m1[1]) {
-       case "hsl":
-        {
-          return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100);
-        }
-
-       case "rgb":
-        {
-          return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2]));
-        }
-      }
-    }
-    if (color = d3_rgb_names.get(format)) {
-      return rgb(color.r, color.g, color.b);
-    }
-    if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) {
-      if (format.length === 4) {
-        r = (color & 3840) >> 4;
-        r = r >> 4 | r;
-        g = color & 240;
-        g = g >> 4 | g;
-        b = color & 15;
-        b = b << 4 | b;
-      } else if (format.length === 7) {
-        r = (color & 16711680) >> 16;
-        g = (color & 65280) >> 8;
-        b = color & 255;
-      }
-    }
-    return rgb(r, g, b);
-  }
-  function d3_rgb_hsl(r, g, b) {
-    var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2;
-    if (d) {
-      s = l < .5 ? d / (max + min) : d / (2 - max - min);
-      if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4;
-      h *= 60;
-    } else {
-      h = NaN;
-      s = l > 0 && l < 1 ? 0 : h;
-    }
-    return new d3_hsl(h, s, l);
-  }
-  function d3_rgb_lab(r, g, b) {
-    r = d3_rgb_xyz(r);
-    g = d3_rgb_xyz(g);
-    b = d3_rgb_xyz(b);
-    var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z);
-    return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z));
-  }
-  function d3_rgb_xyz(r) {
-    return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4);
-  }
-  function d3_rgb_parseNumber(c) {
-    var f = parseFloat(c);
-    return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f;
-  }
-  var d3_rgb_names = d3.map({
-    aliceblue: 15792383,
-    antiquewhite: 16444375,
-    aqua: 65535,
-    aquamarine: 8388564,
-    azure: 15794175,
-    beige: 16119260,
-    bisque: 16770244,
-    black: 0,
-    blanchedalmond: 16772045,
-    blue: 255,
-    blueviolet: 9055202,
-    brown: 10824234,
-    burlywood: 14596231,
-    cadetblue: 6266528,
-    chartreuse: 8388352,
-    chocolate: 13789470,
-    coral: 16744272,
-    cornflowerblue: 6591981,
-    cornsilk: 16775388,
-    crimson: 14423100,
-    cyan: 65535,
-    darkblue: 139,
-    darkcyan: 35723,
-    darkgoldenrod: 12092939,
-    darkgray: 11119017,
-    darkgreen: 25600,
-    darkgrey: 11119017,
-    darkkhaki: 12433259,
-    darkmagenta: 9109643,
-    darkolivegreen: 5597999,
-    darkorange: 16747520,
-    darkorchid: 10040012,
-    darkred: 9109504,
-    darksalmon: 15308410,
-    darkseagreen: 9419919,
-    darkslateblue: 4734347,
-    darkslategray: 3100495,
-    darkslategrey: 3100495,
-    darkturquoise: 52945,
-    darkviolet: 9699539,
-    deeppink: 16716947,
-    deepskyblue: 49151,
-    dimgray: 6908265,
-    dimgrey: 6908265,
-    dodgerblue: 2003199,
-    firebrick: 11674146,
-    floralwhite: 16775920,
-    forestgreen: 2263842,
-    fuchsia: 16711935,
-    gainsboro: 14474460,
-    ghostwhite: 16316671,
-    gold: 16766720,
-    goldenrod: 14329120,
-    gray: 8421504,
-    green: 32768,
-    greenyellow: 11403055,
-    grey: 8421504,
-    honeydew: 15794160,
-    hotpink: 16738740,
-    indianred: 13458524,
-    indigo: 4915330,
-    ivory: 16777200,
-    khaki: 15787660,
-    lavender: 15132410,
-    lavenderblush: 16773365,
-    lawngreen: 8190976,
-    lemonchiffon: 16775885,
-    lightblue: 11393254,
-    lightcoral: 15761536,
-    lightcyan: 14745599,
-    lightgoldenrodyellow: 16448210,
-    lightgray: 13882323,
-    lightgreen: 9498256,
-    lightgrey: 13882323,
-    lightpink: 16758465,
-    lightsalmon: 16752762,
-    lightseagreen: 2142890,
-    lightskyblue: 8900346,
-    lightslategray: 7833753,
-    lightslategrey: 7833753,
-    lightsteelblue: 11584734,
-    lightyellow: 16777184,
-    lime: 65280,
-    limegreen: 3329330,
-    linen: 16445670,
-    magenta: 16711935,
-    maroon: 8388608,
-    mediumaquamarine: 6737322,
-    mediumblue: 205,
-    mediumorchid: 12211667,
-    mediumpurple: 9662683,
-    mediumseagreen: 3978097,
-    mediumslateblue: 8087790,
-    mediumspringgreen: 64154,
-    mediumturquoise: 4772300,
-    mediumvioletred: 13047173,
-    midnightblue: 1644912,
-    mintcream: 16121850,
-    mistyrose: 16770273,
-    moccasin: 16770229,
-    navajowhite: 16768685,
-    navy: 128,
-    oldlace: 16643558,
-    olive: 8421376,
-    olivedrab: 7048739,
-    orange: 16753920,
-    orangered: 16729344,
-    orchid: 14315734,
-    palegoldenrod: 15657130,
-    palegreen: 10025880,
-    paleturquoise: 11529966,
-    palevioletred: 14381203,
-    papayawhip: 16773077,
-    peachpuff: 16767673,
-    peru: 13468991,
-    pink: 16761035,
-    plum: 14524637,
-    powderblue: 11591910,
-    purple: 8388736,
-    rebeccapurple: 6697881,
-    red: 16711680,
-    rosybrown: 12357519,
-    royalblue: 4286945,
-    saddlebrown: 9127187,
-    salmon: 16416882,
-    sandybrown: 16032864,
-    seagreen: 3050327,
-    seashell: 16774638,
-    sienna: 10506797,
-    silver: 12632256,
-    skyblue: 8900331,
-    slateblue: 6970061,
-    slategray: 7372944,
-    slategrey: 7372944,
-    snow: 16775930,
-    springgreen: 65407,
-    steelblue: 4620980,
-    tan: 13808780,
-    teal: 32896,
-    thistle: 14204888,
-    tomato: 16737095,
-    turquoise: 4251856,
-    violet: 15631086,
-    wheat: 16113331,
-    white: 16777215,
-    whitesmoke: 16119285,
-    yellow: 16776960,
-    yellowgreen: 10145074
-  });
-  d3_rgb_names.forEach(function(key, value) {
-    d3_rgb_names.set(key, d3_rgbNumber(value));
-  });
-  function d3_functor(v) {
-    return typeof v === "function" ? v : function() {
-      return v;
-    };
-  }
-  d3.functor = d3_functor;
-  d3.xhr = d3_xhrType(d3_identity);
-  function d3_xhrType(response) {
-    return function(url, mimeType, callback) {
-      if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType, 
-      mimeType = null;
-      return d3_xhr(url, mimeType, response, callback);
-    };
-  }
-  function d3_xhr(url, mimeType, response, callback) {
-    var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null;
-    if (this.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest();
-    "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {
-      request.readyState > 3 && respond();
-    };
-    function respond() {
-      var status = request.status, result;
-      if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) {
-        try {
-          result = response.call(xhr, request);
-        } catch (e) {
-          dispatch.error.call(xhr, e);
-          return;
-        }
-        dispatch.load.call(xhr, result);
-      } else {
-        dispatch.error.call(xhr, request);
-      }
-    }
-    request.onprogress = function(event) {
-      var o = d3.event;
-      d3.event = event;
-      try {
-        dispatch.progress.call(xhr, request);
-      } finally {
-        d3.event = o;
-      }
-    };
-    xhr.header = function(name, value) {
-      name = (name + "").toLowerCase();
-      if (arguments.length < 2) return headers[name];
-      if (value == null) delete headers[name]; else headers[name] = value + "";
-      return xhr;
-    };
-    xhr.mimeType = function(value) {
-      if (!arguments.length) return mimeType;
-      mimeType = value == null ? null : value + "";
-      return xhr;
-    };
-    xhr.responseType = function(value) {
-      if (!arguments.length) return responseType;
-      responseType = value;
-      return xhr;
-    };
-    xhr.response = function(value) {
-      response = value;
-      return xhr;
-    };
-    [ "get", "post" ].forEach(function(method) {
-      xhr[method] = function() {
-        return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments)));
-      };
-    });
-    xhr.send = function(method, data, callback) {
-      if (arguments.length === 2 && typeof data === "function") callback = data, data = null;
-      request.open(method, url, true);
-      if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*";
-      if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]);
-      if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType);
-      if (responseType != null) request.responseType = responseType;
-      if (callback != null) xhr.on("error", callback).on("load", function(request) {
-        callback(null, request);
-      });
-      dispatch.beforesend.call(xhr, request);
-      request.send(data == null ? null : data);
-      return xhr;
-    };
-    xhr.abort = function() {
-      request.abort();
-      return xhr;
-    };
-    d3.rebind(xhr, dispatch, "on");
-    return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback));
-  }
-  function d3_xhr_fixCallback(callback) {
-    return callback.length === 1 ? function(error, request) {
-      callback(error == null ? request : null);
-    } : callback;
-  }
-  function d3_xhrHasResponse(request) {
-    var type = request.responseType;
-    return type && type !== "text" ? request.response : request.responseText;
-  }
-  d3.dsv = function(delimiter, mimeType) {
-    var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0);
-    function dsv(url, row, callback) {
-      if (arguments.length < 3) callback = row, row = null;
-      var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback);
-      xhr.row = function(_) {
-        return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row;
-      };
-      return xhr;
-    }
-    function response(request) {
-      return dsv.parse(request.responseText);
-    }
-    function typedResponse(f) {
-      return function(request) {
-        return dsv.parse(request.responseText, f);
-      };
-    }
-    dsv.parse = function(text, f) {
-      var o;
-      return dsv.parseRows(text, function(row, i) {
-        if (o) return o(row, i - 1);
-        var a = new Function("d", "return {" + row.map(function(name, i) {
-          return JSON.stringify(name) + ": d[" + i + "]";
-        }).join(",") + "}");
-        o = f ? function(row, i) {
-          return f(a(row), i);
-        } : a;
-      });
-    };
-    dsv.parseRows = function(text, f) {
-      var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol;
-      function token() {
-        if (I >= N) return EOF;
-        if (eol) return eol = false, EOL;
-        var j = I;
-        if (text.charCodeAt(j) === 34) {
-          var i = j;
-          while (i++ < N) {
-            if (text.charCodeAt(i) === 34) {
-              if (text.charCodeAt(i + 1) !== 34) break;
-              ++i;
-            }
-          }
-          I = i + 2;
-          var c = text.charCodeAt(i + 1);
-          if (c === 13) {
-            eol = true;
-            if (text.charCodeAt(i + 2) === 10) ++I;
-          } else if (c === 10) {
-            eol = true;
-          }
-          return text.slice(j + 1, i).replace(/""/g, '"');
-        }
-        while (I < N) {
-          var c = text.charCodeAt(I++), k = 1;
-          if (c === 10) eol = true; else if (c === 13) {
-            eol = true;
-            if (text.charCodeAt(I) === 10) ++I, ++k;
-          } else if (c !== delimiterCode) continue;
-          return text.slice(j, I - k);
-        }
-        return text.slice(j);
-      }
-      while ((t = token()) !== EOF) {
-        var a = [];
-        while (t !== EOL && t !== EOF) {
-          a.push(t);
-          t = token();
-        }
-        if (f && (a = f(a, n++)) == null) continue;
-        rows.push(a);
-      }
-      return rows;
-    };
-    dsv.format = function(rows) {
-      if (Array.isArray(rows[0])) return dsv.formatRows(rows);
-      var fieldSet = new d3_Set(), fields = [];
-      rows.forEach(function(row) {
-        for (var field in row) {
-          if (!fieldSet.has(field)) {
-            fields.push(fieldSet.add(field));
-          }
-        }
-      });
-      return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) {
-        return fields.map(function(field) {
-          return formatValue(row[field]);
-        }).join(delimiter);
-      })).join("\n");
-    };
-    dsv.formatRows = function(rows) {
-      return rows.map(formatRow).join("\n");
-    };
-    function formatRow(row) {
-      return row.map(formatValue).join(delimiter);
-    }
-    function formatValue(text) {
-      return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text;
-    }
-    return dsv;
-  };
-  d3.csv = d3.dsv(",", "text/csv");
-  d3.tsv = d3.dsv("	", "text/tab-separated-values");
-  var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_frame = this[d3_vendorSymbol(this, "requestAnimationFrame")] || function(callback) {
-    setTimeout(callback, 17);
-  };
-  d3.timer = function() {
-    d3_timer.apply(this, arguments);
-  };
-  function d3_timer(callback, delay, then) {
-    var n = arguments.length;
-    if (n < 2) delay = 0;
-    if (n < 3) then = Date.now();
-    var time = then + delay, timer = {
-      c: callback,
-      t: time,
-      n: null
-    };
-    if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer;
-    d3_timer_queueTail = timer;
-    if (!d3_timer_interval) {
-      d3_timer_timeout = clearTimeout(d3_timer_timeout);
-      d3_timer_interval = 1;
-      d3_timer_frame(d3_timer_step);
-    }
-    return timer;
-  }
-  function d3_timer_step() {
-    var now = d3_timer_mark(), delay = d3_timer_sweep() - now;
-    if (delay > 24) {
-      if (isFinite(delay)) {
-        clearTimeout(d3_timer_timeout);
-        d3_timer_timeout = setTimeout(d3_timer_step, delay);
-      }
-      d3_timer_interval = 0;
-    } else {
-      d3_timer_interval = 1;
-      d3_timer_frame(d3_timer_step);
-    }
-  }
-  d3.timer.flush = function() {
-    d3_timer_mark();
-    d3_timer_sweep();
-  };
-  function d3_timer_mark() {
-    var now = Date.now(), timer = d3_timer_queueHead;
-    while (timer) {
-      if (now >= timer.t && timer.c(now - timer.t)) timer.c = null;
-      timer = timer.n;
-    }
-    return now;
-  }
-  function d3_timer_sweep() {
-    var t0, t1 = d3_timer_queueHead, time = Infinity;
-    while (t1) {
-      if (t1.c) {
-        if (t1.t < time) time = t1.t;
-        t1 = (t0 = t1).n;
-      } else {
-        t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n;
-      }
-    }
-    d3_timer_queueTail = t0;
-    return time;
-  }
-  function d3_format_precision(x, p) {
-    return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1);
-  }
-  d3.round = function(x, n) {
-    return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x);
-  };
-  var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix);
-  d3.formatPrefix = function(value, precision) {
-    var i = 0;
-    if (value = +value) {
-      if (value < 0) value *= -1;
-      if (precision) value = d3.round(value, d3_format_precision(value, precision));
-      i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);
-      i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3));
-    }
-    return d3_formatPrefixes[8 + i / 3];
-  };
-  function d3_formatPrefix(d, i) {
-    var k = Math.pow(10, abs(8 - i) * 3);
-    return {
-      scale: i > 8 ? function(d) {
-        return d / k;
-      } : function(d) {
-        return d * k;
-      },
-      symbol: d
-    };
-  }
-  function d3_locale_numberFormat(locale) {
-    var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping && locale_thousands ? function(value, width) {
-      var i = value.length, t = [], j = 0, g = locale_grouping[0], length = 0;
-      while (i > 0 && g > 0) {
-        if (length + g + 1 > width) g = Math.max(1, width - length);
-        t.push(value.substring(i -= g, i + g));
-        if ((length += g + 1) > width) break;
-        g = locale_grouping[j = (j + 1) % locale_grouping.length];
-      }
-      return t.reverse().join(locale_thousands);
-    } : d3_identity;
-    return function(specifier) {
-      var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "-", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = "", suffix = "", integer = false, exponent = true;
-      if (precision) precision = +precision.substring(1);
-      if (zfill || fill === "0" && align === "=") {
-        zfill = fill = "0";
-        align = "=";
-      }
-      switch (type) {
-       case "n":
-        comma = true;
-        type = "g";
-        break;
-
-       case "%":
-        scale = 100;
-        suffix = "%";
-        type = "f";
-        break;
-
-       case "p":
-        scale = 100;
-        suffix = "%";
-        type = "r";
-        break;
-
-       case "b":
-       case "o":
-       case "x":
-       case "X":
-        if (symbol === "#") prefix = "0" + type.toLowerCase();
-
-       case "c":
-        exponent = false;
-
-       case "d":
-        integer = true;
-        precision = 0;
-        break;
-
-       case "s":
-        scale = -1;
-        type = "r";
-        break;
-      }
-      if (symbol === "$") prefix = locale_currency[0], suffix = locale_currency[1];
-      if (type == "r" && !precision) type = "g";
-      if (precision != null) {
-        if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision));
-      }
-      type = d3_format_types.get(type) || d3_format_typeDefault;
-      var zcomma = zfill && comma;
-      return function(value) {
-        var fullSuffix = suffix;
-        if (integer && value % 1) return "";
-        var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign === "-" ? "" : sign;
-        if (scale < 0) {
-          var unit = d3.formatPrefix(value, precision);
-          value = unit.scale(value);
-          fullSuffix = unit.symbol + suffix;
-        } else {
-          value *= scale;
-        }
-        value = type(value, precision);
-        var i = value.lastIndexOf("."), before, after;
-        if (i < 0) {
-          var j = exponent ? value.lastIndexOf("e") : -1;
-          if (j < 0) before = value, after = ""; else before = value.substring(0, j), after = value.substring(j);
-        } else {
-          before = value.substring(0, i);
-          after = locale_decimal + value.substring(i + 1);
-        }
-        if (!zfill && comma) before = formatGroup(before, Infinity);
-        var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : "";
-        if (zcomma) before = formatGroup(padding + before, padding.length ? width - after.length : Infinity);
-        negative += prefix;
-        value = before + after;
-        return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix;
-      };
-    };
-  }
-  var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i;
-  var d3_format_types = d3.map({
-    b: function(x) {
-      return x.toString(2);
-    },
-    c: function(x) {
-      return String.fromCharCode(x);
-    },
-    o: function(x) {
-      return x.toString(8);
-    },
-    x: function(x) {
-      return x.toString(16);
-    },
-    X: function(x) {
-      return x.toString(16).toUpperCase();
-    },
-    g: function(x, p) {
-      return x.toPrecision(p);
-    },
-    e: function(x, p) {
-      return x.toExponential(p);
-    },
-    f: function(x, p) {
-      return x.toFixed(p);
-    },
-    r: function(x, p) {
-      return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p))));
-    }
-  });
-  function d3_format_typeDefault(x) {
-    return x + "";
-  }
-  var d3_time = d3.time = {}, d3_date = Date;
-  function d3_date_utc() {
-    this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]);
-  }
-  d3_date_utc.prototype = {
-    getDate: function() {
-      return this._.getUTCDate();
-    },
-    getDay: function() {
-      return this._.getUTCDay();
-    },
-    getFullYear: function() {
-      return this._.getUTCFullYear();
-    },
-    getHours: function() {
-      return this._.getUTCHours();
-    },
-    getMilliseconds: function() {
-      return this._.getUTCMilliseconds();
-    },
-    getMinutes: function() {
-      return this._.getUTCMinutes();
-    },
-    getMonth: function() {
-      return this._.getUTCMonth();
-    },
-    getSeconds: function() {
-      return this._.getUTCSeconds();
-    },
-    getTime: function() {
-      return this._.getTime();
-    },
-    getTimezoneOffset: function() {
-      return 0;
-    },
-    valueOf: function() {
-      return this._.valueOf();
-    },
-    setDate: function() {
-      d3_time_prototype.setUTCDate.apply(this._, arguments);
-    },
-    setDay: function() {
-      d3_time_prototype.setUTCDay.apply(this._, arguments);
-    },
-    setFullYear: function() {
-      d3_time_prototype.setUTCFullYear.apply(this._, arguments);
-    },
-    setHours: function() {
-      d3_time_prototype.setUTCHours.apply(this._, arguments);
-    },
-    setMilliseconds: function() {
-      d3_time_prototype.setUTCMilliseconds.apply(this._, arguments);
-    },
-    setMinutes: function() {
-      d3_time_prototype.setUTCMinutes.apply(this._, arguments);
-    },
-    setMonth: function() {
-      d3_time_prototype.setUTCMonth.apply(this._, arguments);
-    },
-    setSeconds: function() {
-      d3_time_prototype.setUTCSeconds.apply(this._, arguments);
-    },
-    setTime: function() {
-      d3_time_prototype.setTime.apply(this._, arguments);
-    }
-  };
-  var d3_time_prototype = Date.prototype;
-  function d3_time_interval(local, step, number) {
-    function round(date) {
-      var d0 = local(date), d1 = offset(d0, 1);
-      return date - d0 < d1 - date ? d0 : d1;
-    }
-    function ceil(date) {
-      step(date = local(new d3_date(date - 1)), 1);
-      return date;
-    }
-    function offset(date, k) {
-      step(date = new d3_date(+date), k);
-      return date;
-    }
-    function range(t0, t1, dt) {
-      var time = ceil(t0), times = [];
-      if (dt > 1) {
-        while (time < t1) {
-          if (!(number(time) % dt)) times.push(new Date(+time));
-          step(time, 1);
-        }
-      } else {
-        while (time < t1) times.push(new Date(+time)), step(time, 1);
-      }
-      return times;
-    }
-    function range_utc(t0, t1, dt) {
-      try {
-        d3_date = d3_date_utc;
-        var utc = new d3_date_utc();
-        utc._ = t0;
-        return range(utc, t1, dt);
-      } finally {
-        d3_date = Date;
-      }
-    }
-    local.floor = local;
-    local.round = round;
-    local.ceil = ceil;
-    local.offset = offset;
-    local.range = range;
-    var utc = local.utc = d3_time_interval_utc(local);
-    utc.floor = utc;
-    utc.round = d3_time_interval_utc(round);
-    utc.ceil = d3_time_interval_utc(ceil);
-    utc.offset = d3_time_interval_utc(offset);
-    utc.range = range_utc;
-    return local;
-  }
-  function d3_time_interval_utc(method) {
-    return function(date, k) {
-      try {
-        d3_date = d3_date_utc;
-        var utc = new d3_date_utc();
-        utc._ = date;
-        return method(utc, k)._;
-      } finally {
-        d3_date = Date;
-      }
-    };
-  }
-  d3_time.year = d3_time_interval(function(date) {
-    date = d3_time.day(date);
-    date.setMonth(0, 1);
-    return date;
-  }, function(date, offset) {
-    date.setFullYear(date.getFullYear() + offset);
-  }, function(date) {
-    return date.getFullYear();
-  });
-  d3_time.years = d3_time.year.range;
-  d3_time.years.utc = d3_time.year.utc.range;
-  d3_time.day = d3_time_interval(function(date) {
-    var day = new d3_date(2e3, 0);
-    day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
-    return day;
-  }, function(date, offset) {
-    date.setDate(date.getDate() + offset);
-  }, function(date) {
-    return date.getDate() - 1;
-  });
-  d3_time.days = d3_time.day.range;
-  d3_time.days.utc = d3_time.day.utc.range;
-  d3_time.dayOfYear = function(date) {
-    var year = d3_time.year(date);
-    return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5);
-  };
-  [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) {
-    i = 7 - i;
-    var interval = d3_time[day] = d3_time_interval(function(date) {
-      (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7);
-      return date;
-    }, function(date, offset) {
-      date.setDate(date.getDate() + Math.floor(offset) * 7);
-    }, function(date) {
-      var day = d3_time.year(date).getDay();
-      return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i);
-    });
-    d3_time[day + "s"] = interval.range;
-    d3_time[day + "s"].utc = interval.utc.range;
-    d3_time[day + "OfYear"] = function(date) {
-      var day = d3_time.year(date).getDay();
-      return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7);
-    };
-  });
-  d3_time.week = d3_time.sunday;
-  d3_time.weeks = d3_time.sunday.range;
-  d3_time.weeks.utc = d3_time.sunday.utc.range;
-  d3_time.weekOfYear = d3_time.sundayOfYear;
-  function d3_locale_timeFormat(locale) {
-    var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths;
-    function d3_time_format(template) {
-      var n = template.length;
-      function format(date) {
-        var string = [], i = -1, j = 0, c, p, f;
-        while (++i < n) {
-          if (template.charCodeAt(i) === 37) {
-            string.push(template.slice(j, i));
-            if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i);
-            if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p);
-            string.push(c);
-            j = i + 1;
-          }
-        }
-        string.push(template.slice(j, i));
-        return string.join("");
-      }
-      format.parse = function(string) {
-        var d = {
-          y: 1900,
-          m: 0,
-          d: 1,
-          H: 0,
-          M: 0,
-          S: 0,
-          L: 0,
-          Z: null
-        }, i = d3_time_parse(d, template, string, 0);
-        if (i != string.length) return null;
-        if ("p" in d) d.H = d.H % 12 + d.p * 12;
-        var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)();
-        if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("W" in d || "U" in d) {
-          if (!("w" in d)) d.w = "W" in d ? 1 : 0;
-          date.setFullYear(d.y, 0, 1);
-          date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7);
-        } else date.setFullYear(d.y, d.m, d.d);
-        date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L);
-        return localZ ? date._ : date;
-      };
-      format.toString = function() {
-        return template;
-      };
-      return format;
-    }
-    function d3_time_parse(date, template, string, j) {
-      var c, p, t, i = 0, n = template.length, m = string.length;
-      while (i < n) {
-        if (j >= m) return -1;
-        c = template.charCodeAt(i++);
-        if (c === 37) {
-          t = template.charAt(i++);
-          p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t];
-          if (!p || (j = p(date, string, j)) < 0) return -1;
-        } else if (c != string.charCodeAt(j++)) {
-          return -1;
-        }
-      }
-      return j;
-    }
-    d3_time_format.utc = function(template) {
-      var local = d3_time_format(template);
-      function format(date) {
-        try {
-          d3_date = d3_date_utc;
-          var utc = new d3_date();
-          utc._ = date;
-          return local(utc);
-        } finally {
-          d3_date = Date;
-        }
-      }
-      format.parse = function(string) {
-        try {
-          d3_date = d3_date_utc;
-          var date = local.parse(string);
-          return date && date._;
-        } finally {
-          d3_date = Date;
-        }
-      };
-      format.toString = local.toString;
-      return format;
-    };
-    d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti;
-    var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths);
-    locale_periods.forEach(function(p, i) {
-      d3_time_periodLookup.set(p.toLowerCase(), i);
-    });
-    var d3_time_formats = {
-      a: function(d) {
-        return locale_shortDays[d.getDay()];
-      },
-      A: function(d) {
-        return locale_days[d.getDay()];
-      },
-      b: function(d) {
-        return locale_shortMonths[d.getMonth()];
-      },
-      B: function(d) {
-        return locale_months[d.getMonth()];
-      },
-      c: d3_time_format(locale_dateTime),
-      d: function(d, p) {
-        return d3_time_formatPad(d.getDate(), p, 2);
-      },
-      e: function(d, p) {
-        return d3_time_formatPad(d.getDate(), p, 2);
-      },
-      H: function(d, p) {
-        return d3_time_formatPad(d.getHours(), p, 2);
-      },
-      I: function(d, p) {
-        return d3_time_formatPad(d.getHours() % 12 || 12, p, 2);
-      },
-      j: function(d, p) {
-        return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3);
-      },
-      L: function(d, p) {
-        return d3_time_formatPad(d.getMilliseconds(), p, 3);
-      },
-      m: function(d, p) {
-        return d3_time_formatPad(d.getMonth() + 1, p, 2);
-      },
-      M: function(d, p) {
-        return d3_time_formatPad(d.getMinutes(), p, 2);
-      },
-      p: function(d) {
-        return locale_periods[+(d.getHours() >= 12)];
-      },
-      S: function(d, p) {
-        return d3_time_formatPad(d.getSeconds(), p, 2);
-      },
-      U: function(d, p) {
-        return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2);
-      },
-      w: function(d) {
-        return d.getDay();
-      },
-      W: function(d, p) {
-        return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2);
-      },
-      x: d3_time_format(locale_date),
-      X: d3_time_format(locale_time),
-      y: function(d, p) {
-        return d3_time_formatPad(d.getFullYear() % 100, p, 2);
-      },
-      Y: function(d, p) {
-        return d3_time_formatPad(d.getFullYear() % 1e4, p, 4);
-      },
-      Z: d3_time_zone,
-      "%": function() {
-        return "%";
-      }
-    };
-    var d3_time_parsers = {
-      a: d3_time_parseWeekdayAbbrev,
-      A: d3_time_parseWeekday,
-      b: d3_time_parseMonthAbbrev,
-      B: d3_time_parseMonth,
-      c: d3_time_parseLocaleFull,
-      d: d3_time_parseDay,
-      e: d3_time_parseDay,
-      H: d3_time_parseHour24,
-      I: d3_time_parseHour24,
-      j: d3_time_parseDayOfYear,
-      L: d3_time_parseMilliseconds,
-      m: d3_time_parseMonthNumber,
-      M: d3_time_parseMinutes,
-      p: d3_time_parseAmPm,
-      S: d3_time_parseSeconds,
-      U: d3_time_parseWeekNumberSunday,
-      w: d3_time_parseWeekdayNumber,
-      W: d3_time_parseWeekNumberMonday,
-      x: d3_time_parseLocaleDate,
-      X: d3_time_parseLocaleTime,
-      y: d3_time_parseYear,
-      Y: d3_time_parseFullYear,
-      Z: d3_time_parseZone,
-      "%": d3_time_parseLiteralPercent
-    };
-    function d3_time_parseWeekdayAbbrev(date, string, i) {
-      d3_time_dayAbbrevRe.lastIndex = 0;
-      var n = d3_time_dayAbbrevRe.exec(string.slice(i));
-      return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
-    }
-    function d3_time_parseWeekday(date, string, i) {
-      d3_time_dayRe.lastIndex = 0;
-      var n = d3_time_dayRe.exec(string.slice(i));
-      return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
-    }
-    function d3_time_parseMonthAbbrev(date, string, i) {
-      d3_time_monthAbbrevRe.lastIndex = 0;
-      var n = d3_time_monthAbbrevRe.exec(string.slice(i));
-      return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
-    }
-    function d3_time_parseMonth(date, string, i) {
-      d3_time_monthRe.lastIndex = 0;
-      var n = d3_time_monthRe.exec(string.slice(i));
-      return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
-    }
-    function d3_time_parseLocaleFull(date, string, i) {
-      return d3_time_parse(date, d3_time_formats.c.toString(), string, i);
-    }
-    function d3_time_parseLocaleDate(date, string, i) {
-      return d3_time_parse(date, d3_time_formats.x.toString(), string, i);
-    }
-    function d3_time_parseLocaleTime(date, string, i) {
-      return d3_time_parse(date, d3_time_formats.X.toString(), string, i);
-    }
-    function d3_time_parseAmPm(date, string, i) {
-      var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase());
-      return n == null ? -1 : (date.p = n, i);
-    }
-    return d3_time_format;
-  }
-  var d3_time_formatPads = {
-    "-": "",
-    _: " ",
-    "0": "0"
-  }, d3_time_numberRe = /^\s*\d+/, d3_time_percentRe = /^%/;
-  function d3_time_formatPad(value, fill, width) {
-    var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length;
-    return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
-  }
-  function d3_time_formatRe(names) {
-    return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i");
-  }
-  function d3_time_formatLookup(names) {
-    var map = new d3_Map(), i = -1, n = names.length;
-    while (++i < n) map.set(names[i].toLowerCase(), i);
-    return map;
-  }
-  function d3_time_parseWeekdayNumber(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i, i + 1));
-    return n ? (date.w = +n[0], i + n[0].length) : -1;
-  }
-  function d3_time_parseWeekNumberSunday(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i));
-    return n ? (date.U = +n[0], i + n[0].length) : -1;
-  }
-  function d3_time_parseWeekNumberMonday(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i));
-    return n ? (date.W = +n[0], i + n[0].length) : -1;
-  }
-  function d3_time_parseFullYear(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i, i + 4));
-    return n ? (date.y = +n[0], i + n[0].length) : -1;
-  }
-  function d3_time_parseYear(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i, i + 2));
-    return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1;
-  }
-  function d3_time_parseZone(date, string, i) {
-    return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string, 
-    i + 5) : -1;
-  }
-  function d3_time_expandYear(d) {
-    return d + (d > 68 ? 1900 : 2e3);
-  }
-  function d3_time_parseMonthNumber(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i, i + 2));
-    return n ? (date.m = n[0] - 1, i + n[0].length) : -1;
-  }
-  function d3_time_parseDay(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i, i + 2));
-    return n ? (date.d = +n[0], i + n[0].length) : -1;
-  }
-  function d3_time_parseDayOfYear(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i, i + 3));
-    return n ? (date.j = +n[0], i + n[0].length) : -1;
-  }
-  function d3_time_parseHour24(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i, i + 2));
-    return n ? (date.H = +n[0], i + n[0].length) : -1;
-  }
-  function d3_time_parseMinutes(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i, i + 2));
-    return n ? (date.M = +n[0], i + n[0].length) : -1;
-  }
-  function d3_time_parseSeconds(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i, i + 2));
-    return n ? (date.S = +n[0], i + n[0].length) : -1;
-  }
-  function d3_time_parseMilliseconds(date, string, i) {
-    d3_time_numberRe.lastIndex = 0;
-    var n = d3_time_numberRe.exec(string.slice(i, i + 3));
-    return n ? (date.L = +n[0], i + n[0].length) : -1;
-  }
-  function d3_time_zone(d) {
-    var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = abs(z) / 60 | 0, zm = abs(z) % 60;
-    return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2);
-  }
-  function d3_time_parseLiteralPercent(date, string, i) {
-    d3_time_percentRe.lastIndex = 0;
-    var n = d3_time_percentRe.exec(string.slice(i, i + 1));
-    return n ? i + n[0].length : -1;
-  }
-  function d3_time_formatMulti(formats) {
-    var n = formats.length, i = -1;
-    while (++i < n) formats[i][0] = this(formats[i][0]);
-    return function(date) {
-      var i = 0, f = formats[i];
-      while (!f[1](date)) f = formats[++i];
-      return f[0](date);
-    };
-  }
-  d3.locale = function(locale) {
-    return {
-      numberFormat: d3_locale_numberFormat(locale),
-      timeFormat: d3_locale_timeFormat(locale)
-    };
-  };
-  var d3_locale_enUS = d3.locale({
-    decimal: ".",
-    thousands: ",",
-    grouping: [ 3 ],
-    currency: [ "$", "" ],
-    dateTime: "%a %b %e %X %Y",
-    date: "%m/%d/%Y",
-    time: "%H:%M:%S",
-    periods: [ "AM", "PM" ],
-    days: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
-    shortDays: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
-    months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ],
-    shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
-  });
-  d3.format = d3_locale_enUS.numberFormat;
-  d3.geo = {};
-  function d3_adder() {}
-  d3_adder.prototype = {
-    s: 0,
-    t: 0,
-    add: function(y) {
-      d3_adderSum(y, this.t, d3_adderTemp);
-      d3_adderSum(d3_adderTemp.s, this.s, this);
-      if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t;
-    },
-    reset: function() {
-      this.s = this.t = 0;
-    },
-    valueOf: function() {
-      return this.s;
-    }
-  };
-  var d3_adderTemp = new d3_adder();
-  function d3_adderSum(a, b, o) {
-    var x = o.s = a + b, bv = x - a, av = x - bv;
-    o.t = a - av + (b - bv);
-  }
-  d3.geo.stream = function(object, listener) {
-    if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) {
-      d3_geo_streamObjectType[object.type](object, listener);
-    } else {
-      d3_geo_streamGeometry(object, listener);
-    }
-  };
-  function d3_geo_streamGeometry(geometry, listener) {
-    if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) {
-      d3_geo_streamGeometryType[geometry.type](geometry, listener);
-    }
-  }
-  var d3_geo_streamObjectType = {
-    Feature: function(feature, listener) {
-      d3_geo_streamGeometry(feature.geometry, listener);
-    },
-    FeatureCollection: function(object, listener) {
-      var features = object.features, i = -1, n = features.length;
-      while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener);
-    }
-  };
-  var d3_geo_streamGeometryType = {
-    Sphere: function(object, listener) {
-      listener.sphere();
-    },
-    Point: function(object, listener) {
-      object = object.coordinates;
-      listener.point(object[0], object[1], object[2]);
-    },
-    MultiPoint: function(object, listener) {
-      var coordinates = object.coordinates, i = -1, n = coordinates.length;
-      while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]);
-    },
-    LineString: function(object, listener) {
-      d3_geo_streamLine(object.coordinates, listener, 0);
-    },
-    MultiLineString: function(object, listener) {
-      var coordinates = object.coordinates, i = -1, n = coordinates.length;
-      while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0);
-    },
-    Polygon: function(object, listener) {
-      d3_geo_streamPolygon(object.coordinates, listener);
-    },
-    MultiPolygon: function(object, listener) {
-      var coordinates = object.coordinates, i = -1, n = coordinates.length;
-      while (++i < n) d3_geo_streamPolygon(coordinates[i], listener);
-    },
-    GeometryCollection: function(object, listener) {
-      var geometries = object.geometries, i = -1, n = geometries.length;
-      while (++i < n) d3_geo_streamGeometry(geometries[i], listener);
-    }
-  };
-  function d3_geo_streamLine(coordinates, listener, closed) {
-    var i = -1, n = coordinates.length - closed, coordinate;
-    listener.lineStart();
-    while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]);
-    listener.lineEnd();
-  }
-  function d3_geo_streamPolygon(coordinates, listener) {
-    var i = -1, n = coordinates.length;
-    listener.polygonStart();
-    while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1);
-    listener.polygonEnd();
-  }
-  d3.geo.area = function(object) {
-    d3_geo_areaSum = 0;
-    d3.geo.stream(object, d3_geo_area);
-    return d3_geo_areaSum;
-  };
-  var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder();
-  var d3_geo_area = {
-    sphere: function() {
-      d3_geo_areaSum += 4 * π;
-    },
-    point: d3_noop,
-    lineStart: d3_noop,
-    lineEnd: d3_noop,
-    polygonStart: function() {
-      d3_geo_areaRingSum.reset();
-      d3_geo_area.lineStart = d3_geo_areaRingStart;
-    },
-    polygonEnd: function() {
-      var area = 2 * d3_geo_areaRingSum;
-      d3_geo_areaSum += area < 0 ? 4 * π + area : area;
-      d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop;
-    }
-  };
-  function d3_geo_areaRingStart() {
-    var λ00, φ00, λ0, cosφ0, sinφ0;
-    d3_geo_area.point = function(λ, φ) {
-      d3_geo_area.point = nextPoint;
-      λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4), 
-      sinφ0 = Math.sin(φ);
-    };
-    function nextPoint(λ, φ) {
-      λ *= d3_radians;
-      φ = φ * d3_radians / 2 + π / 4;
-      var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ);
-      d3_geo_areaRingSum.add(Math.atan2(v, u));
-      λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ;
-    }
-    d3_geo_area.lineEnd = function() {
-      nextPoint(λ00, φ00);
-    };
-  }
-  function d3_geo_cartesian(spherical) {
-    var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ);
-    return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ];
-  }
-  function d3_geo_cartesianDot(a, b) {
-    return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
-  }
-  function d3_geo_cartesianCross(a, b) {
-    return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ];
-  }
-  function d3_geo_cartesianAdd(a, b) {
-    a[0] += b[0];
-    a[1] += b[1];
-    a[2] += b[2];
-  }
-  function d3_geo_cartesianScale(vector, k) {
-    return [ vector[0] * k, vector[1] * k, vector[2] * k ];
-  }
-  function d3_geo_cartesianNormalize(d) {
-    var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
-    d[0] /= l;
-    d[1] /= l;
-    d[2] /= l;
-  }
-  function d3_geo_spherical(cartesian) {
-    return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ];
-  }
-  function d3_geo_sphericalEqual(a, b) {
-    return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε;
-  }
-  d3.geo.bounds = function() {
-    var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range;
-    var bound = {
-      point: point,
-      lineStart: lineStart,
-      lineEnd: lineEnd,
-      polygonStart: function() {
-        bound.point = ringPoint;
-        bound.lineStart = ringStart;
-        bound.lineEnd = ringEnd;
-        dλSum = 0;
-        d3_geo_area.polygonStart();
-      },
-      polygonEnd: function() {
-        d3_geo_area.polygonEnd();
-        bound.point = point;
-        bound.lineStart = lineStart;
-        bound.lineEnd = lineEnd;
-        if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90;
-        range[0] = λ0, range[1] = λ1;
-      }
-    };
-    function point(λ, φ) {
-      ranges.push(range = [ λ0 = λ, λ1 = λ ]);
-      if (φ < φ0) φ0 = φ;
-      if (φ > φ1) φ1 = φ;
-    }
-    function linePoint(λ, φ) {
-      var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]);
-      if (p0) {
-        var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal);
-        d3_geo_cartesianNormalize(inflection);
-        inflection = d3_geo_spherical(inflection);
-        var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180;
-        if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
-          var φi = inflection[1] * d3_degrees;
-          if (φi > φ1) φ1 = φi;
-        } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
-          var φi = -inflection[1] * d3_degrees;
-          if (φi < φ0) φ0 = φi;
-        } else {
-          if (φ < φ0) φ0 = φ;
-          if (φ > φ1) φ1 = φ;
-        }
-        if (antimeridian) {
-          if (λ < λ_) {
-            if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
-          } else {
-            if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
-          }
-        } else {
-          if (λ1 >= λ0) {
-            if (λ < λ0) λ0 = λ;
-            if (λ > λ1) λ1 = λ;
-          } else {
-            if (λ > λ_) {
-              if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
-            } else {
-              if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
-            }
-          }
-        }
-      } else {
-        point(λ, φ);
-      }
-      p0 = p, λ_ = λ;
-    }
-    function lineStart() {
-      bound.point = linePoint;
-    }
-    function lineEnd() {
-      range[0] = λ0, range[1] = λ1;
-      bound.point = point;
-      p0 = null;
-    }
-    function ringPoint(λ, φ) {
-      if (p0) {
-        var dλ = λ - λ_;
-        dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ;
-      } else λ__ = λ, φ__ = φ;
-      d3_geo_area.point(λ, φ);
-      linePoint(λ, φ);
-    }
-    function ringStart() {
-      d3_geo_area.lineStart();
-    }
-    function ringEnd() {
-      ringPoint(λ__, φ__);
-      d3_geo_area.lineEnd();
-      if (abs(dλSum) > ε) λ0 = -(λ1 = 180);
-      range[0] = λ0, range[1] = λ1;
-      p0 = null;
-    }
-    function angle(λ0, λ1) {
-      return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1;
-    }
-    function compareRanges(a, b) {
-      return a[0] - b[0];
-    }
-    function withinRange(x, range) {
-      return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;
-    }
-    return function(feature) {
-      φ1 = λ1 = -(λ0 = φ0 = Infinity);
-      ranges = [];
-      d3.geo.stream(feature, bound);
-      var n = ranges.length;
-      if (n) {
-        ranges.sort(compareRanges);
-        for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) {
-          b = ranges[i];
-          if (withinRange(b[0], a) || withinRange(b[1], a)) {
-            if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];
-            if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];
-          } else {
-            merged.push(a = b);
-          }
-        }
-        var best = -Infinity, dλ;
-        for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) {
-          b = merged[i];
-          if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1];
-        }
-      }
-      ranges = range = null;
-      return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ];
-    };
-  }();
-  d3.geo.centroid = function(object) {
-    d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
-    d3.geo.stream(object, d3_geo_centroid);
-    var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z;
-    if (m < ε2) {
-      x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1;
-      if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0;
-      m = x * x + y * y + z * z;
-      if (m < ε2) return [ NaN, NaN ];
-    }
-    return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ];
-  };
-  var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2;
-  var d3_geo_centroid = {
-    sphere: d3_noop,
-    point: d3_geo_centroidPoint,
-    lineStart: d3_geo_centroidLineStart,
-    lineEnd: d3_geo_centroidLineEnd,
-    polygonStart: function() {
-      d3_geo_centroid.lineStart = d3_geo_centroidRingStart;
-    },
-    polygonEnd: function() {
-      d3_geo_centroid.lineStart = d3_geo_centroidLineStart;
-    }
-  };
-  function d3_geo_centroidPoint(λ, φ) {
-    λ *= d3_radians;
-    var cosφ = Math.cos(φ *= d3_radians);
-    d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ));
-  }
-  function d3_geo_centroidPointXYZ(x, y, z) {
-    ++d3_geo_centroidW0;
-    d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0;
-    d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0;
-    d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0;
-  }
-  function d3_geo_centroidLineStart() {
-    var x0, y0, z0;
-    d3_geo_centroid.point = function(λ, φ) {
-      λ *= d3_radians;
-      var cosφ = Math.cos(φ *= d3_radians);
-      x0 = cosφ * Math.cos(λ);
-      y0 = cosφ * Math.sin(λ);
-      z0 = Math.sin(φ);
-      d3_geo_centroid.point = nextPoint;
-      d3_geo_centroidPointXYZ(x0, y0, z0);
-    };
-    function nextPoint(λ, φ) {
-      λ *= d3_radians;
-      var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);
-      d3_geo_centroidW1 += w;
-      d3_geo_centroidX1 += w * (x0 + (x0 = x));
-      d3_geo_centroidY1 += w * (y0 + (y0 = y));
-      d3_geo_centroidZ1 += w * (z0 + (z0 = z));
-      d3_geo_centroidPointXYZ(x0, y0, z0);
-    }
-  }
-  function d3_geo_centroidLineEnd() {
-    d3_geo_centroid.point = d3_geo_centroidPoint;
-  }
-  function d3_geo_centroidRingStart() {
-    var λ00, φ00, x0, y0, z0;
-    d3_geo_centroid.point = function(λ, φ) {
-      λ00 = λ, φ00 = φ;
-      d3_geo_centroid.point = nextPoint;
-      λ *= d3_radians;
-      var cosφ = Math.cos(φ *= d3_radians);
-      x0 = cosφ * Math.cos(λ);
-      y0 = cosφ * Math.sin(λ);
-      z0 = Math.sin(φ);
-      d3_geo_centroidPointXYZ(x0, y0, z0);
-    };
-    d3_geo_centroid.lineEnd = function() {
-      nextPoint(λ00, φ00);
-      d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd;
-      d3_geo_centroid.point = d3_geo_centroidPoint;
-    };
-    function nextPoint(λ, φ) {
-      λ *= d3_radians;
-      var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u);
-      d3_geo_centroidX2 += v * cx;
-      d3_geo_centroidY2 += v * cy;
-      d3_geo_centroidZ2 += v * cz;
-      d3_geo_centroidW1 += w;
-      d3_geo_centroidX1 += w * (x0 + (x0 = x));
-      d3_geo_centroidY1 += w * (y0 + (y0 = y));
-      d3_geo_centroidZ1 += w * (z0 + (z0 = z));
-      d3_geo_centroidPointXYZ(x0, y0, z0);
-    }
-  }
-  function d3_geo_compose(a, b) {
-    function compose(x, y) {
-      return x = a(x, y), b(x[0], x[1]);
-    }
-    if (a.invert && b.invert) compose.invert = function(x, y) {
-      return x = b.invert(x, y), x && a.invert(x[0], x[1]);
-    };
-    return compose;
-  }
-  function d3_true() {
-    return true;
-  }
-  function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {
-    var subject = [], clip = [];
-    segments.forEach(function(segment) {
-      if ((n = segment.length - 1) <= 0) return;
-      var n, p0 = segment[0], p1 = segment[n];
-      if (d3_geo_sphericalEqual(p0, p1)) {
-        listener.lineStart();
-        for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]);
-        listener.lineEnd();
-        return;
-      }
-      var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false);
-      a.o = b;
-      subject.push(a);
-      clip.push(b);
-      a = new d3_geo_clipPolygonIntersection(p1, segment, null, false);
-      b = new d3_geo_clipPolygonIntersection(p1, null, a, true);
-      a.o = b;
-      subject.push(a);
-      clip.push(b);
-    });
-    clip.sort(compare);
-    d3_geo_clipPolygonLinkCircular(subject);
-    d3_geo_clipPolygonLinkCircular(clip);
-    if (!subject.length) return;
-    for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) {
-      clip[i].e = entry = !entry;
-    }
-    var start = subject[0], points, point;
-    while (1) {
-      var current = start, isSubject = true;
-      while (current.v) if ((current = current.n) === start) return;
-      points = current.z;
-      listener.lineStart();
-      do {
-        current.v = current.o.v = true;
-        if (current.e) {
-          if (isSubject) {
-            for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]);
-          } else {
-            interpolate(current.x, current.n.x, 1, listener);
-          }
-          current = current.n;
-        } else {
-          if (isSubject) {
-            points = current.p.z;
-            for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]);
-          } else {
-            interpolate(current.x, current.p.x, -1, listener);
-          }
-          current = current.p;
-        }
-        current = current.o;
-        points = current.z;
-        isSubject = !isSubject;
-      } while (!current.v);
-      listener.lineEnd();
-    }
-  }
-  function d3_geo_clipPolygonLinkCircular(array) {
-    if (!(n = array.length)) return;
-    var n, i = 0, a = array[0], b;
-    while (++i < n) {
-      a.n = b = array[i];
-      b.p = a;
-      a = b;
-    }
-    a.n = b = array[0];
-    b.p = a;
-  }
-  function d3_geo_clipPolygonIntersection(point, points, other, entry) {
-    this.x = point;
-    this.z = points;
-    this.o = other;
-    this.e = entry;
-    this.v = false;
-    this.n = this.p = null;
-  }
-  function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) {
-    return function(rotate, listener) {
-      var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]);
-      var clip = {
-        point: point,
-        lineStart: lineStart,
-        lineEnd: lineEnd,
-        polygonStart: function() {
-          clip.point = pointRing;
-          clip.lineStart = ringStart;
-          clip.lineEnd = ringEnd;
-          segments = [];
-          polygon = [];
-        },
-        polygonEnd: function() {
-          clip.point = point;
-          clip.lineStart = lineStart;
-          clip.lineEnd = lineEnd;
-          segments = d3.merge(segments);
-          var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon);
-          if (segments.length) {
-            if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
-            d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener);
-          } else if (clipStartInside) {
-            if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
-            listener.lineStart();
-            interpolate(null, null, 1, listener);
-            listener.lineEnd();
-          }
-          if (polygonStarted) listener.polygonEnd(), polygonStarted = false;
-          segments = polygon = null;
-        },
-        sphere: function() {
-          listener.polygonStart();
-          listener.lineStart();
-          interpolate(null, null, 1, listener);
-          listener.lineEnd();
-          listener.polygonEnd();
-        }
-      };
-      function point(λ, φ) {
-        var point = rotate(λ, φ);
-        if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ);
-      }
-      function pointLine(λ, φ) {
-        var point = rotate(λ, φ);
-        line.point(point[0], point[1]);
-      }
-      function lineStart() {
-        clip.point = pointLine;
-        line.lineStart();
-      }
-      function lineEnd() {
-        clip.point = point;
-        line.lineEnd();
-      }
-      var segments;
-      var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring;
-      function pointRing(λ, φ) {
-        ring.push([ λ, φ ]);
-        var point = rotate(λ, φ);
-        ringListener.point(point[0], point[1]);
-      }
-      function ringStart() {
-        ringListener.lineStart();
-        ring = [];
-      }
-      function ringEnd() {
-        pointRing(ring[0][0], ring[0][1]);
-        ringListener.lineEnd();
-        var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length;
-        ring.pop();
-        polygon.push(ring);
-        ring = null;
-        if (!n) return;
-        if (clean & 1) {
-          segment = ringSegments[0];
-          var n = segment.length - 1, i = -1, point;
-          if (n > 0) {
-            if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
-            listener.lineStart();
-            while (++i < n) listener.point((point = segment[i])[0], point[1]);
-            listener.lineEnd();
-          }
-          return;
-        }
-        if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
-        segments.push(ringSegments.filter(d3_geo_clipSegmentLength1));
-      }
-      return clip;
-    };
-  }
-  function d3_geo_clipSegmentLength1(segment) {
-    return segment.length > 1;
-  }
-  function d3_geo_clipBufferListener() {
-    var lines = [], line;
-    return {
-      lineStart: function() {
-        lines.push(line = []);
-      },
-      point: function(λ, φ) {
-        line.push([ λ, φ ]);
-      },
-      lineEnd: d3_noop,
-      buffer: function() {
-        var buffer = lines;
-        lines = [];
-        line = null;
-        return buffer;
-      },
-      rejoin: function() {
-        if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
-      }
-    };
-  }
-  function d3_geo_clipSort(a, b) {
-    return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]);
-  }
-  var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]);
-  function d3_geo_clipAntimeridianLine(listener) {
-    var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean;
-    return {
-      lineStart: function() {
-        listener.lineStart();
-        clean = 1;
-      },
-      point: function(λ1, φ1) {
-        var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0);
-        if (abs(dλ - π) < ε) {
-          listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ);
-          listener.point(sλ0, φ0);
-          listener.lineEnd();
-          listener.lineStart();
-          listener.point(sλ1, φ0);
-          listener.point(λ1, φ0);
-          clean = 0;
-        } else if (sλ0 !== sλ1 && dλ >= π) {
-          if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε;
-          if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε;
-          φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1);
-          listener.point(sλ0, φ0);
-          listener.lineEnd();
-          listener.lineStart();
-          listener.point(sλ1, φ0);
-          clean = 0;
-        }
-        listener.point(λ0 = λ1, φ0 = φ1);
-        sλ0 = sλ1;
-      },
-      lineEnd: function() {
-        listener.lineEnd();
-        λ0 = φ0 = NaN;
-      },
-      clean: function() {
-        return 2 - clean;
-      }
-    };
-  }
-  function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) {
-    var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1);
-    return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2;
-  }
-  function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) {
-    var φ;
-    if (from == null) {
-      φ = direction * halfπ;
-      listener.point(-π, φ);
-      listener.point(0, φ);
-      listener.point(π, φ);
-      listener.point(π, 0);
-      listener.point(π, -φ);
-      listener.point(0, -φ);
-      listener.point(-π, -φ);
-      listener.point(-π, 0);
-      listener.point(-π, φ);
-    } else if (abs(from[0] - to[0]) > ε) {
-      var s = from[0] < to[0] ? π : -π;
-      φ = direction * s / 2;
-      listener.point(-s, φ);
-      listener.point(0, φ);
-      listener.point(s, φ);
-    } else {
-      listener.point(to[0], to[1]);
-    }
-  }
-  function d3_geo_pointInPolygon(point, polygon) {
-    var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;
-    d3_geo_areaRingSum.reset();
-    for (var i = 0, n = polygon.length; i < n; ++i) {
-      var ring = polygon[i], m = ring.length;
-      if (!m) continue;
-      var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1;
-      while (true) {
-        if (j === m) j = 0;
-        point = ring[j];
-        var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ;
-        d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));
-        polarAngle += antimeridian ? dλ + sdλ * τ : dλ;
-        if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {
-          var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));
-          d3_geo_cartesianNormalize(arc);
-          var intersection = d3_geo_cartesianCross(meridianNormal, arc);
-          d3_geo_cartesianNormalize(intersection);
-          var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]);
-          if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) {
-            winding += antimeridian ^ dλ >= 0 ? 1 : -1;
-          }
-        }
-        if (!j++) break;
-        λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point;
-      }
-    }
-    return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < -ε) ^ winding & 1;
-  }
-  function d3_geo_clipCircle(radius) {
-    var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians);
-    return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]);
-    function visible(λ, φ) {
-      return Math.cos(λ) * Math.cos(φ) > cr;
-    }
-    function clipLine(listener) {
-      var point0, c0, v0, v00, clean;
-      return {
-        lineStart: function() {
-          v00 = v0 = false;
-          clean = 1;
-        },
-        point: function(λ, φ) {
-          var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0;
-          if (!point0 && (v00 = v0 = v)) listener.lineStart();
-          if (v !== v0) {
-            point2 = intersect(point0, point1);
-            if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) {
-              point1[0] += ε;
-              point1[1] += ε;
-              v = visible(point1[0], point1[1]);
-            }
-          }
-          if (v !== v0) {
-            clean = 0;
-            if (v) {
-              listener.lineStart();
-              point2 = intersect(point1, point0);
-              listener.point(point2[0], point2[1]);
-            } else {
-              point2 = intersect(point0, point1);
-              listener.point(point2[0], point2[1]);
-              listener.lineEnd();
-            }
-            point0 = point2;
-          } else if (notHemisphere && point0 && smallRadius ^ v) {
-            var t;
-            if (!(c & c0) && (t = intersect(point1, point0, true))) {
-              clean = 0;
-              if (smallRadius) {
-                listener.lineStart();
-                listener.point(t[0][0], t[0][1]);
-                listener.point(t[1][0], t[1][1]);
-                listener.lineEnd();
-              } else {
-                listener.point(t[1][0], t[1][1]);
-                listener.lineEnd();
-                listener.lineStart();
-                listener.point(t[0][0], t[0][1]);
-              }
-            }
-          }
-          if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) {
-            listener.point(point1[0], point1[1]);
-          }
-          point0 = point1, v0 = v, c0 = c;
-        },
-        lineEnd: function() {
-          if (v0) listener.lineEnd();
-          point0 = null;
-        },
-        clean: function() {
-          return clean | (v00 && v0) << 1;
-        }
-      };
-    }
-    function intersect(a, b, two) {
-      var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b);
-      var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;
-      if (!determinant) return !two && a;
-      var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2);
-      d3_geo_cartesianAdd(A, B);
-      var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1);
-      if (t2 < 0) return;
-      var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu);
-      d3_geo_cartesianAdd(q, A);
-      q = d3_geo_spherical(q);
-      if (!two) return q;
-      var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z;
-      if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z;
-      var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε;
-      if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z;
-      if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) {
-        var q1 = d3_geo_cartesianScale(u, (-w + t) / uu);
-        d3_geo_cartesianAdd(q1, A);
-        return [ q, d3_geo_spherical(q1) ];
-      }
-    }
-    function code(λ, φ) {
-      var r = smallRadius ? radius : π - radius, code = 0;
-      if (λ < -r) code |= 1; else if (λ > r) code |= 2;
-      if (φ < -r) code |= 4; else if (φ > r) code |= 8;
-      return code;
-    }
-  }
-  function d3_geom_clipLine(x0, y0, x1, y1) {
-    return function(line) {
-      var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r;
-      r = x0 - ax;
-      if (!dx && r > 0) return;
-      r /= dx;
-      if (dx < 0) {
-        if (r < t0) return;
-        if (r < t1) t1 = r;
-      } else if (dx > 0) {
-        if (r > t1) return;
-        if (r > t0) t0 = r;
-      }
-      r = x1 - ax;
-      if (!dx && r < 0) return;
-      r /= dx;
-      if (dx < 0) {
-        if (r > t1) return;
-        if (r > t0) t0 = r;
-      } else if (dx > 0) {
-        if (r < t0) return;
-        if (r < t1) t1 = r;
-      }
-      r = y0 - ay;
-      if (!dy && r > 0) return;
-      r /= dy;
-      if (dy < 0) {
-        if (r < t0) return;
-        if (r < t1) t1 = r;
-      } else if (dy > 0) {
-        if (r > t1) return;
-        if (r > t0) t0 = r;
-      }
-      r = y1 - ay;
-      if (!dy && r < 0) return;
-      r /= dy;
-      if (dy < 0) {
-        if (r > t1) return;
-        if (r > t0) t0 = r;
-      } else if (dy > 0) {
-        if (r < t0) return;
-        if (r < t1) t1 = r;
-      }
-      if (t0 > 0) line.a = {
-        x: ax + t0 * dx,
-        y: ay + t0 * dy
-      };
-      if (t1 < 1) line.b = {
-        x: ax + t1 * dx,
-        y: ay + t1 * dy
-      };
-      return line;
-    };
-  }
-  var d3_geo_clipExtentMAX = 1e9;
-  d3.geo.clipExtent = function() {
-    var x0, y0, x1, y1, stream, clip, clipExtent = {
-      stream: function(output) {
-        if (stream) stream.valid = false;
-        stream = clip(output);
-        stream.valid = true;
-        return stream;
-      },
-      extent: function(_) {
-        if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
-        clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]);
-        if (stream) stream.valid = false, stream = null;
-        return clipExtent;
-      }
-    };
-    return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]);
-  };
-  function d3_geo_clipExtent(x0, y0, x1, y1) {
-    return function(listener) {
-      var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring;
-      var clip = {
-        point: point,
-        lineStart: lineStart,
-        lineEnd: lineEnd,
-        polygonStart: function() {
-          listener = bufferListener;
-          segments = [];
-          polygon = [];
-          clean = true;
-        },
-        polygonEnd: function() {
-          listener = listener_;
-          segments = d3.merge(segments);
-          var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length;
-          if (inside || visible) {
-            listener.polygonStart();
-            if (inside) {
-              listener.lineStart();
-              interpolate(null, null, 1, listener);
-              listener.lineEnd();
-            }
-            if (visible) {
-              d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener);
-            }
-            listener.polygonEnd();
-          }
-          segments = polygon = ring = null;
-        }
-      };
-      function insidePolygon(p) {
-        var wn = 0, n = polygon.length, y = p[1];
-        for (var i = 0; i < n; ++i) {
-          for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) {
-            b = v[j];
-            if (a[1] <= y) {
-              if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn;
-            } else {
-              if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn;
-            }
-            a = b;
-          }
-        }
-        return wn !== 0;
-      }
-      function interpolate(from, to, direction, listener) {
-        var a = 0, a1 = 0;
-        if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) {
-          do {
-            listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);
-          } while ((a = (a + direction + 4) % 4) !== a1);
-        } else {
-          listener.point(to[0], to[1]);
-        }
-      }
-      function pointVisible(x, y) {
-        return x0 <= x && x <= x1 && y0 <= y && y <= y1;
-      }
-      function point(x, y) {
-        if (pointVisible(x, y)) listener.point(x, y);
-      }
-      var x__, y__, v__, x_, y_, v_, first, clean;
-      function lineStart() {
-        clip.point = linePoint;
-        if (polygon) polygon.push(ring = []);
-        first = true;
-        v_ = false;
-        x_ = y_ = NaN;
-      }
-      function lineEnd() {
-        if (segments) {
-          linePoint(x__, y__);
-          if (v__ && v_) bufferListener.rejoin();
-          segments.push(bufferListener.buffer());
-        }
-        clip.point = point;
-        if (v_) listener.lineEnd();
-      }
-      function linePoint(x, y) {
-        x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x));
-        y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y));
-        var v = pointVisible(x, y);
-        if (polygon) ring.push([ x, y ]);
-        if (first) {
-          x__ = x, y__ = y, v__ = v;
-          first = false;
-          if (v) {
-            listener.lineStart();
-            listener.point(x, y);
-          }
-        } else {
-          if (v && v_) listener.point(x, y); else {
-            var l = {
-              a: {
-                x: x_,
-                y: y_
-              },
-              b: {
-                x: x,
-                y: y
-              }
-            };
-            if (clipLine(l)) {
-              if (!v_) {
-                listener.lineStart();
-                listener.point(l.a.x, l.a.y);
-              }
-              listener.point(l.b.x, l.b.y);
-              if (!v) listener.lineEnd();
-              clean = false;
-            } else if (v) {
-              listener.lineStart();
-              listener.point(x, y);
-              clean = false;
-            }
-          }
-        }
-        x_ = x, y_ = y, v_ = v;
-      }
-      return clip;
-    };
-    function corner(p, direction) {
-      return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
-    }
-    function compare(a, b) {
-      return comparePoints(a.x, b.x);
-    }
-    function comparePoints(a, b) {
-      var ca = corner(a, 1), cb = corner(b, 1);
-      return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0];
-    }
-  }
-  function d3_geo_conic(projectAt) {
-    var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1);
-    p.parallels = function(_) {
-      if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ];
-      return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180);
-    };
-    return p;
-  }
-  function d3_geo_conicEqualArea(φ0, φ1) {
-    var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n;
-    function forward(λ, φ) {
-      var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n;
-      return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ];
-    }
-    forward.invert = function(x, y) {
-      var ρ0_y = ρ0 - y;
-      return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ];
-    };
-    return forward;
-  }
-  (d3.geo.conicEqualArea = function() {
-    return d3_geo_conic(d3_geo_conicEqualArea);
-  }).raw = d3_geo_conicEqualArea;
-  d3.geo.albers = function() {
-    return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070);
-  };
-  d3.geo.albersUsa = function() {
-    var lower48 = d3.geo.albers();
-    var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]);
-    var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]);
-    var point, pointStream = {
-      point: function(x, y) {
-        point = [ x, y ];
-      }
-    }, lower48Point, alaskaPoint, hawaiiPoint;
-    function albersUsa(coordinates) {
-      var x = coordinates[0], y = coordinates[1];
-      point = null;
-      (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y);
-      return point;
-    }
-    albersUsa.invert = function(coordinates) {
-      var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
-      return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates);
-    };
-    albersUsa.stream = function(stream) {
-      var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream);
-      return {
-        point: function(x, y) {
-          lower48Stream.point(x, y);
-          alaskaStream.point(x, y);
-          hawaiiStream.point(x, y);
-        },
-        sphere: function() {
-          lower48Stream.sphere();
-          alaskaStream.sphere();
-          hawaiiStream.sphere();
-        },
-        lineStart: function() {
-          lower48Stream.lineStart();
-          alaskaStream.lineStart();
-          hawaiiStream.lineStart();
-        },
-        lineEnd: function() {
-          lower48Stream.lineEnd();
-          alaskaStream.lineEnd();
-          hawaiiStream.lineEnd();
-        },
-        polygonStart: function() {
-          lower48Stream.polygonStart();
-          alaskaStream.polygonStart();
-          hawaiiStream.polygonStart();
-        },
-        polygonEnd: function() {
-          lower48Stream.polygonEnd();
-          alaskaStream.polygonEnd();
-          hawaiiStream.polygonEnd();
-        }
-      };
-    };
-    albersUsa.precision = function(_) {
-      if (!arguments.length) return lower48.precision();
-      lower48.precision(_);
-      alaska.precision(_);
-      hawaii.precision(_);
-      return albersUsa;
-    };
-    albersUsa.scale = function(_) {
-      if (!arguments.length) return lower48.scale();
-      lower48.scale(_);
-      alaska.scale(_ * .35);
-      hawaii.scale(_);
-      return albersUsa.translate(lower48.translate());
-    };
-    albersUsa.translate = function(_) {
-      if (!arguments.length) return lower48.translate();
-      var k = lower48.scale(), x = +_[0], y = +_[1];
-      lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point;
-      alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
-      hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
-      return albersUsa;
-    };
-    return albersUsa.scale(1070);
-  };
-  var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = {
-    point: d3_noop,
-    lineStart: d3_noop,
-    lineEnd: d3_noop,
-    polygonStart: function() {
-      d3_geo_pathAreaPolygon = 0;
-      d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart;
-    },
-    polygonEnd: function() {
-      d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop;
-      d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2);
-    }
-  };
-  function d3_geo_pathAreaRingStart() {
-    var x00, y00, x0, y0;
-    d3_geo_pathArea.point = function(x, y) {
-      d3_geo_pathArea.point = nextPoint;
-      x00 = x0 = x, y00 = y0 = y;
-    };
-    function nextPoint(x, y) {
-      d3_geo_pathAreaPolygon += y0 * x - x0 * y;
-      x0 = x, y0 = y;
-    }
-    d3_geo_pathArea.lineEnd = function() {
-      nextPoint(x00, y00);
-    };
-  }
-  var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1;
-  var d3_geo_pathBounds = {
-    point: d3_geo_pathBoundsPoint,
-    lineStart: d3_noop,
-    lineEnd: d3_noop,
-    polygonStart: d3_noop,
-    polygonEnd: d3_noop
-  };
-  function d3_geo_pathBoundsPoint(x, y) {
-    if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x;
-    if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x;
-    if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y;
-    if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y;
-  }
-  function d3_geo_pathBuffer() {
-    var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = [];
-    var stream = {
-      point: point,
-      lineStart: function() {
-        stream.point = pointLineStart;
-      },
-      lineEnd: lineEnd,
-      polygonStart: function() {
-        stream.lineEnd = lineEndPolygon;
-      },
-      polygonEnd: function() {
-        stream.lineEnd = lineEnd;
-        stream.point = point;
-      },
-      pointRadius: function(_) {
-        pointCircle = d3_geo_pathBufferCircle(_);
-        return stream;
-      },
-      result: function() {
-        if (buffer.length) {
-          var result = buffer.join("");
-          buffer = [];
-          return result;
-        }
-      }
-    };
-    function point(x, y) {
-      buffer.push("M", x, ",", y, pointCircle);
-    }
-    function pointLineStart(x, y) {
-      buffer.push("M", x, ",", y);
-      stream.point = pointLine;
-    }
-    function pointLine(x, y) {
-      buffer.push("L", x, ",", y);
-    }
-    function lineEnd() {
-      stream.point = point;
-    }
-    function lineEndPolygon() {
-      buffer.push("Z");
-    }
-    return stream;
-  }
-  function d3_geo_pathBufferCircle(radius) {
-    return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z";
-  }
-  var d3_geo_pathCentroid = {
-    point: d3_geo_pathCentroidPoint,
-    lineStart: d3_geo_pathCentroidLineStart,
-    lineEnd: d3_geo_pathCentroidLineEnd,
-    polygonStart: function() {
-      d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart;
-    },
-    polygonEnd: function() {
-      d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
-      d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart;
-      d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd;
-    }
-  };
-  function d3_geo_pathCentroidPoint(x, y) {
-    d3_geo_centroidX0 += x;
-    d3_geo_centroidY0 += y;
-    ++d3_geo_centroidZ0;
-  }
-  function d3_geo_pathCentroidLineStart() {
-    var x0, y0;
-    d3_geo_pathCentroid.point = function(x, y) {
-      d3_geo_pathCentroid.point = nextPoint;
-      d3_geo_pathCentroidPoint(x0 = x, y0 = y);
-    };
-    function nextPoint(x, y) {
-      var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
-      d3_geo_centroidX1 += z * (x0 + x) / 2;
-      d3_geo_centroidY1 += z * (y0 + y) / 2;
-      d3_geo_centroidZ1 += z;
-      d3_geo_pathCentroidPoint(x0 = x, y0 = y);
-    }
-  }
-  function d3_geo_pathCentroidLineEnd() {
-    d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
-  }
-  function d3_geo_pathCentroidRingStart() {
-    var x00, y00, x0, y0;
-    d3_geo_pathCentroid.point = function(x, y) {
-      d3_geo_pathCentroid.point = nextPoint;
-      d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y);
-    };
-    function nextPoint(x, y) {
-      var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
-      d3_geo_centroidX1 += z * (x0 + x) / 2;
-      d3_geo_centroidY1 += z * (y0 + y) / 2;
-      d3_geo_centroidZ1 += z;
-      z = y0 * x - x0 * y;
-      d3_geo_centroidX2 += z * (x0 + x);
-      d3_geo_centroidY2 += z * (y0 + y);
-      d3_geo_centroidZ2 += z * 3;
-      d3_geo_pathCentroidPoint(x0 = x, y0 = y);
-    }
-    d3_geo_pathCentroid.lineEnd = function() {
-      nextPoint(x00, y00);
-    };
-  }
-  function d3_geo_pathContext(context) {
-    var pointRadius = 4.5;
-    var stream = {
-      point: point,
-      lineStart: function() {
-        stream.point = pointLineStart;
-      },
-      lineEnd: lineEnd,
-      polygonStart: function() {
-        stream.lineEnd = lineEndPolygon;
-      },
-      polygonEnd: function() {
-        stream.lineEnd = lineEnd;
-        stream.point = point;
-      },
-      pointRadius: function(_) {
-        pointRadius = _;
-        return stream;
-      },
-      result: d3_noop
-    };
-    function point(x, y) {
-      context.moveTo(x + pointRadius, y);
-      context.arc(x, y, pointRadius, 0, τ);
-    }
-    function pointLineStart(x, y) {
-      context.moveTo(x, y);
-      stream.point = pointLine;
-    }
-    function pointLine(x, y) {
-      context.lineTo(x, y);
-    }
-    function lineEnd() {
-      stream.point = point;
-    }
-    function lineEndPolygon() {
-      context.closePath();
-    }
-    return stream;
-  }
-  function d3_geo_resample(project) {
-    var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16;
-    function resample(stream) {
-      return (maxDepth ? resampleRecursive : resampleNone)(stream);
-    }
-    function resampleNone(stream) {
-      return d3_geo_transformPoint(stream, function(x, y) {
-        x = project(x, y);
-        stream.point(x[0], x[1]);
-      });
-    }
-    function resampleRecursive(stream) {
-      var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0;
-      var resample = {
-        point: point,
-        lineStart: lineStart,
-        lineEnd: lineEnd,
-        polygonStart: function() {
-          stream.polygonStart();
-          resample.lineStart = ringStart;
-        },
-        polygonEnd: function() {
-          stream.polygonEnd();
-          resample.lineStart = lineStart;
-        }
-      };
-      function point(x, y) {
-        x = project(x, y);
-        stream.point(x[0], x[1]);
-      }
-      function lineStart() {
-        x0 = NaN;
-        resample.point = linePoint;
-        stream.lineStart();
-      }
-      function linePoint(λ, φ) {
-        var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ);
-        resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);
-        stream.point(x0, y0);
-      }
-      function lineEnd() {
-        resample.point = point;
-        stream.lineEnd();
-      }
-      function ringStart() {
-        lineStart();
-        resample.point = ringPoint;
-        resample.lineEnd = ringEnd;
-      }
-      function ringPoint(λ, φ) {
-        linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;
-        resample.point = linePoint;
-      }
-      function ringEnd() {
-        resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream);
-        resample.lineEnd = lineEnd;
-        lineEnd();
-      }
-      return resample;
-    }
-    function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) {
-      var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy;
-      if (d2 > 4 * δ2 && depth--) {
-        var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2;
-        if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
-          resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream);
-          stream.point(x2, y2);
-          resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream);
-        }
-      }
-    }
-    resample.precision = function(_) {
-      if (!arguments.length) return Math.sqrt(δ2);
-      maxDepth = (δ2 = _ * _) > 0 && 16;
-      return resample;
-    };
-    return resample;
-  }
-  d3.geo.path = function() {
-    var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream;
-    function path(object) {
-      if (object) {
-        if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
-        if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream);
-        d3.geo.stream(object, cacheStream);
-      }
-      return contextStream.result();
-    }
-    path.area = function(object) {
-      d3_geo_pathAreaSum = 0;
-      d3.geo.stream(object, projectStream(d3_geo_pathArea));
-      return d3_geo_pathAreaSum;
-    };
-    path.centroid = function(object) {
-      d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
-      d3.geo.stream(object, projectStream(d3_geo_pathCentroid));
-      return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ];
-    };
-    path.bounds = function(object) {
-      d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity);
-      d3.geo.stream(object, projectStream(d3_geo_pathBounds));
-      return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ];
-    };
-    path.projection = function(_) {
-      if (!arguments.length) return projection;
-      projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity;
-      return reset();
-    };
-    path.context = function(_) {
-      if (!arguments.length) return context;
-      contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_);
-      if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
-      return reset();
-    };
-    path.pointRadius = function(_) {
-      if (!arguments.length) return pointRadius;
-      pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_);
-      return path;
-    };
-    function reset() {
-      cacheStream = null;
-      return path;
-    }
-    return path.projection(d3.geo.albersUsa()).context(null);
-  };
-  function d3_geo_pathProjectStream(project) {
-    var resample = d3_geo_resample(function(x, y) {
-      return project([ x * d3_degrees, y * d3_degrees ]);
-    });
-    return function(stream) {
-      return d3_geo_projectionRadians(resample(stream));
-    };
-  }
-  d3.geo.transform = function(methods) {
-    return {
-      stream: function(stream) {
-        var transform = new d3_geo_transform(stream);
-        for (var k in methods) transform[k] = methods[k];
-        return transform;
-      }
-    };
-  };
-  function d3_geo_transform(stream) {
-    this.stream = stream;
-  }
-  d3_geo_transform.prototype = {
-    point: function(x, y) {
-      this.stream.point(x, y);
-    },
-    sphere: function() {
-      this.stream.sphere();
-    },
-    lineStart: function() {
-      this.stream.lineStart();
-    },
-    lineEnd: function() {
-      this.stream.lineEnd();
-    },
-    polygonStart: function() {
-      this.stream.polygonStart();
-    },
-    polygonEnd: function() {
-      this.stream.polygonEnd();
-    }
-  };
-  function d3_geo_transformPoint(stream, point) {
-    return {
-      point: point,
-      sphere: function() {
-        stream.sphere();
-      },
-      lineStart: function() {
-        stream.lineStart();
-      },
-      lineEnd: function() {
-        stream.lineEnd();
-      },
-      polygonStart: function() {
-        stream.polygonStart();
-      },
-      polygonEnd: function() {
-        stream.polygonEnd();
-      }
-    };
-  }
-  d3.geo.projection = d3_geo_projection;
-  d3.geo.projectionMutator = d3_geo_projectionMutator;
-  function d3_geo_projection(project) {
-    return d3_geo_projectionMutator(function() {
-      return project;
-    })();
-  }
-  function d3_geo_projectionMutator(projectAt) {
-    var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) {
-      x = project(x, y);
-      return [ x[0] * k + δx, δy - x[1] * k ];
-    }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream;
-    function projection(point) {
-      point = projectRotate(point[0] * d3_radians, point[1] * d3_radians);
-      return [ point[0] * k + δx, δy - point[1] * k ];
-    }
-    function invert(point) {
-      point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k);
-      return point && [ point[0] * d3_degrees, point[1] * d3_degrees ];
-    }
-    projection.stream = function(output) {
-      if (stream) stream.valid = false;
-      stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output))));
-      stream.valid = true;
-      return stream;
-    };
-    projection.clipAngle = function(_) {
-      if (!arguments.length) return clipAngle;
-      preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians);
-      return invalidate();
-    };
-    projection.clipExtent = function(_) {
-      if (!arguments.length) return clipExtent;
-      clipExtent = _;
-      postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity;
-      return invalidate();
-    };
-    projection.scale = function(_) {
-      if (!arguments.length) return k;
-      k = +_;
-      return reset();
-    };
-    projection.translate = function(_) {
-      if (!arguments.length) return [ x, y ];
-      x = +_[0];
-      y = +_[1];
-      return reset();
-    };
-    projection.center = function(_) {
-      if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ];
-      λ = _[0] % 360 * d3_radians;
-      φ = _[1] % 360 * d3_radians;
-      return reset();
-    };
-    projection.rotate = function(_) {
-      if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ];
-      δλ = _[0] % 360 * d3_radians;
-      δφ = _[1] % 360 * d3_radians;
-      δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0;
-      return reset();
-    };
-    d3.rebind(projection, projectResample, "precision");
-    function reset() {
-      projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project);
-      var center = project(λ, φ);
-      δx = x - center[0] * k;
-      δy = y + center[1] * k;
-      return invalidate();
-    }
-    function invalidate() {
-      if (stream) stream.valid = false, stream = null;
-      return projection;
-    }
-    return function() {
-      project = projectAt.apply(this, arguments);
-      projection.invert = project.invert && invert;
-      return reset();
-    };
-  }
-  function d3_geo_projectionRadians(stream) {
-    return d3_geo_transformPoint(stream, function(x, y) {
-      stream.point(x * d3_radians, y * d3_radians);
-    });
-  }
-  function d3_geo_equirectangular(λ, φ) {
-    return [ λ, φ ];
-  }
-  (d3.geo.equirectangular = function() {
-    return d3_geo_projection(d3_geo_equirectangular);
-  }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular;
-  d3.geo.rotation = function(rotate) {
-    rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0);
-    function forward(coordinates) {
-      coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
-      return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
-    }
-    forward.invert = function(coordinates) {
-      coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
-      return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
-    };
-    return forward;
-  };
-  function d3_geo_identityRotation(λ, φ) {
-    return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
-  }
-  d3_geo_identityRotation.invert = d3_geo_equirectangular;
-  function d3_geo_rotation(δλ, δφ, δγ) {
-    return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation;
-  }
-  function d3_geo_forwardRotationλ(δλ) {
-    return function(λ, φ) {
-      return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
-    };
-  }
-  function d3_geo_rotationλ(δλ) {
-    var rotation = d3_geo_forwardRotationλ(δλ);
-    rotation.invert = d3_geo_forwardRotationλ(-δλ);
-    return rotation;
-  }
-  function d3_geo_rotationφγ(δφ, δγ) {
-    var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ);
-    function rotation(λ, φ) {
-      var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ;
-      return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ];
-    }
-    rotation.invert = function(λ, φ) {
-      var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ;
-      return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ];
-    };
-    return rotation;
-  }
-  d3.geo.circle = function() {
-    var origin = [ 0, 0 ], angle, precision = 6, interpolate;
-    function circle() {
-      var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = [];
-      interpolate(null, null, 1, {
-        point: function(x, y) {
-          ring.push(x = rotate(x, y));
-          x[0] *= d3_degrees, x[1] *= d3_degrees;
-        }
-      });
-      return {
-        type: "Polygon",
-        coordinates: [ ring ]
-      };
-    }
-    circle.origin = function(x) {
-      if (!arguments.length) return origin;
-      origin = x;
-      return circle;
-    };
-    circle.angle = function(x) {
-      if (!arguments.length) return angle;
-      interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians);
-      return circle;
-    };
-    circle.precision = function(_) {
-      if (!arguments.length) return precision;
-      interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians);
-      return circle;
-    };
-    return circle.angle(90);
-  };
-  function d3_geo_circleInterpolate(radius, precision) {
-    var cr = Math.cos(radius), sr = Math.sin(radius);
-    return function(from, to, direction, listener) {
-      var step = direction * precision;
-      if (from != null) {
-        from = d3_geo_circleAngle(cr, from);
-        to = d3_geo_circleAngle(cr, to);
-        if (direction > 0 ? from < to : from > to) from += direction * τ;
-      } else {
-        from = radius + direction * τ;
-        to = radius - .5 * step;
-      }
-      for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) {
-        listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]);
-      }
-    };
-  }
-  function d3_geo_circleAngle(cr, point) {
-    var a = d3_geo_cartesian(point);
-    a[0] -= cr;
-    d3_geo_cartesianNormalize(a);
-    var angle = d3_acos(-a[1]);
-    return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI);
-  }
-  d3.geo.distance = function(a, b) {
-    var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t;
-    return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ);
-  };
-  d3.geo.graticule = function() {
-    var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5;
-    function graticule() {
-      return {
-        type: "MultiLineString",
-        coordinates: lines()
-      };
-    }
-    function lines() {
-      return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) {
-        return abs(x % DX) > ε;
-      }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) {
-        return abs(y % DY) > ε;
-      }).map(y));
-    }
-    graticule.lines = function() {
-      return lines().map(function(coordinates) {
-        return {
-          type: "LineString",
-          coordinates: coordinates
-        };
-      });
-    };
-    graticule.outline = function() {
-      return {
-        type: "Polygon",
-        coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ]
-      };
-    };
-    graticule.extent = function(_) {
-      if (!arguments.length) return graticule.minorExtent();
-      return graticule.majorExtent(_).minorExtent(_);
-    };
-    graticule.majorExtent = function(_) {
-      if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ];
-      X0 = +_[0][0], X1 = +_[1][0];
-      Y0 = +_[0][1], Y1 = +_[1][1];
-      if (X0 > X1) _ = X0, X0 = X1, X1 = _;
-      if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;
-      return graticule.precision(precision);
-    };
-    graticule.minorExtent = function(_) {
-      if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
-      x0 = +_[0][0], x1 = +_[1][0];
-      y0 = +_[0][1], y1 = +_[1][1];
-      if (x0 > x1) _ = x0, x0 = x1, x1 = _;
-      if (y0 > y1) _ = y0, y0 = y1, y1 = _;
-      return graticule.precision(precision);
-    };
-    graticule.step = function(_) {
-      if (!arguments.length) return graticule.minorStep();
-      return graticule.majorStep(_).minorStep(_);
-    };
-    graticule.majorStep = function(_) {
-      if (!arguments.length) return [ DX, DY ];
-      DX = +_[0], DY = +_[1];
-      return graticule;
-    };
-    graticule.minorStep = function(_) {
-      if (!arguments.length) return [ dx, dy ];
-      dx = +_[0], dy = +_[1];
-      return graticule;
-    };
-    graticule.precision = function(_) {
-      if (!arguments.length) return precision;
-      precision = +_;
-      x = d3_geo_graticuleX(y0, y1, 90);
-      y = d3_geo_graticuleY(x0, x1, precision);
-      X = d3_geo_graticuleX(Y0, Y1, 90);
-      Y = d3_geo_graticuleY(X0, X1, precision);
-      return graticule;
-    };
-    return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]);
-  };
-  function d3_geo_graticuleX(y0, y1, dy) {
-    var y = d3.range(y0, y1 - ε, dy).concat(y1);
-    return function(x) {
-      return y.map(function(y) {
-        return [ x, y ];
-      });
-    };
-  }
-  function d3_geo_graticuleY(x0, x1, dx) {
-    var x = d3.range(x0, x1 - ε, dx).concat(x1);
-    return function(y) {
-      return x.map(function(x) {
-        return [ x, y ];
-      });
-    };
-  }
-  function d3_source(d) {
-    return d.source;
-  }
-  function d3_target(d) {
-    return d.target;
-  }
-  d3.geo.greatArc = function() {
-    var source = d3_source, source_, target = d3_target, target_;
-    function greatArc() {
-      return {
-        type: "LineString",
-        coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ]
-      };
-    }
-    greatArc.distance = function() {
-      return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments));
-    };
-    greatArc.source = function(_) {
-      if (!arguments.length) return source;
-      source = _, source_ = typeof _ === "function" ? null : _;
-      return greatArc;
-    };
-    greatArc.target = function(_) {
-      if (!arguments.length) return target;
-      target = _, target_ = typeof _ === "function" ? null : _;
-      return greatArc;
-    };
-    greatArc.precision = function() {
-      return arguments.length ? greatArc : 0;
-    };
-    return greatArc;
-  };
-  d3.geo.interpolate = function(source, target) {
-    return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians);
-  };
-  function d3_geo_interpolate(x0, y0, x1, y1) {
-    var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d);
-    var interpolate = d ? function(t) {
-      var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1;
-      return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ];
-    } : function() {
-      return [ x0 * d3_degrees, y0 * d3_degrees ];
-    };
-    interpolate.distance = d;
-    return interpolate;
-  }
-  d3.geo.length = function(object) {
-    d3_geo_lengthSum = 0;
-    d3.geo.stream(object, d3_geo_length);
-    return d3_geo_lengthSum;
-  };
-  var d3_geo_lengthSum;
-  var d3_geo_length = {
-    sphere: d3_noop,
-    point: d3_noop,
-    lineStart: d3_geo_lengthLineStart,
-    lineEnd: d3_noop,
-    polygonStart: d3_noop,
-    polygonEnd: d3_noop
-  };
-  function d3_geo_lengthLineStart() {
-    var λ0, sinφ0, cosφ0;
-    d3_geo_length.point = function(λ, φ) {
-      λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ);
-      d3_geo_length.point = nextPoint;
-    };
-    d3_geo_length.lineEnd = function() {
-      d3_geo_length.point = d3_geo_length.lineEnd = d3_noop;
-    };
-    function nextPoint(λ, φ) {
-      var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t);
-      d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ);
-      λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ;
-    }
-  }
-  function d3_geo_azimuthal(scale, angle) {
-    function azimuthal(λ, φ) {
-      var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ);
-      return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ];
-    }
-    azimuthal.invert = function(x, y) {
-      var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c);
-      return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ];
-    };
-    return azimuthal;
-  }
-  var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) {
-    return Math.sqrt(2 / (1 + cosλcosφ));
-  }, function(ρ) {
-    return 2 * Math.asin(ρ / 2);
-  });
-  (d3.geo.azimuthalEqualArea = function() {
-    return d3_geo_projection(d3_geo_azimuthalEqualArea);
-  }).raw = d3_geo_azimuthalEqualArea;
-  var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) {
-    var c = Math.acos(cosλcosφ);
-    return c && c / Math.sin(c);
-  }, d3_identity);
-  (d3.geo.azimuthalEquidistant = function() {
-    return d3_geo_projection(d3_geo_azimuthalEquidistant);
-  }).raw = d3_geo_azimuthalEquidistant;
-  function d3_geo_conicConformal(φ0, φ1) {
-    var cosφ0 = Math.cos(φ0), t = function(φ) {
-      return Math.tan(π / 4 + φ / 2);
-    }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n;
-    if (!n) return d3_geo_mercator;
-    function forward(λ, φ) {
-      if (F > 0) {
-        if (φ < -halfπ + ε) φ = -halfπ + ε;
-      } else {
-        if (φ > halfπ - ε) φ = halfπ - ε;
-      }
-      var ρ = F / Math.pow(t(φ), n);
-      return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ];
-    }
-    forward.invert = function(x, y) {
-      var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y);
-      return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ];
-    };
-    return forward;
-  }
-  (d3.geo.conicConformal = function() {
-    return d3_geo_conic(d3_geo_conicConformal);
-  }).raw = d3_geo_conicConformal;
-  function d3_geo_conicEquidistant(φ0, φ1) {
-    var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0;
-    if (abs(n) < ε) return d3_geo_equirectangular;
-    function forward(λ, φ) {
-      var ρ = G - φ;
-      return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ];
-    }
-    forward.invert = function(x, y) {
-      var ρ0_y = G - y;
-      return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ];
-    };
-    return forward;
-  }
-  (d3.geo.conicEquidistant = function() {
-    return d3_geo_conic(d3_geo_conicEquidistant);
-  }).raw = d3_geo_conicEquidistant;
-  var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) {
-    return 1 / cosλcosφ;
-  }, Math.atan);
-  (d3.geo.gnomonic = function() {
-    return d3_geo_projection(d3_geo_gnomonic);
-  }).raw = d3_geo_gnomonic;
-  function d3_geo_mercator(λ, φ) {
-    return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ];
-  }
-  d3_geo_mercator.invert = function(x, y) {
-    return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ];
-  };
-  function d3_geo_mercatorProjection(project) {
-    var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto;
-    m.scale = function() {
-      var v = scale.apply(m, arguments);
-      return v === m ? clipAuto ? m.clipExtent(null) : m : v;
-    };
-    m.translate = function() {
-      var v = translate.apply(m, arguments);
-      return v === m ? clipAuto ? m.clipExtent(null) : m : v;
-    };
-    m.clipExtent = function(_) {
-      var v = clipExtent.apply(m, arguments);
-      if (v === m) {
-        if (clipAuto = _ == null) {
-          var k = π * scale(), t = translate();
-          clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]);
-        }
-      } else if (clipAuto) {
-        v = null;
-      }
-      return v;
-    };
-    return m.clipExtent(null);
-  }
-  (d3.geo.mercator = function() {
-    return d3_geo_mercatorProjection(d3_geo_mercator);
-  }).raw = d3_geo_mercator;
-  var d3_geo_orthographic = d3_geo_azimuthal(function() {
-    return 1;
-  }, Math.asin);
-  (d3.geo.orthographic = function() {
-    return d3_geo_projection(d3_geo_orthographic);
-  }).raw = d3_geo_orthographic;
-  var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) {
-    return 1 / (1 + cosλcosφ);
-  }, function(ρ) {
-    return 2 * Math.atan(ρ);
-  });
-  (d3.geo.stereographic = function() {
-    return d3_geo_projection(d3_geo_stereographic);
-  }).raw = d3_geo_stereographic;
-  function d3_geo_transverseMercator(λ, φ) {
-    return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ];
-  }
-  d3_geo_transverseMercator.invert = function(x, y) {
-    return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ];
-  };
-  (d3.geo.transverseMercator = function() {
-    var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate;
-    projection.center = function(_) {
-      return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]);
-    };
-    projection.rotate = function(_) {
-      return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(), 
-      [ _[0], _[1], _[2] - 90 ]);
-    };
-    return rotate([ 0, 0, 90 ]);
-  }).raw = d3_geo_transverseMercator;
-  d3.geom = {};
-  function d3_geom_pointX(d) {
-    return d[0];
-  }
-  function d3_geom_pointY(d) {
-    return d[1];
-  }
-  d3.geom.hull = function(vertices) {
-    var x = d3_geom_pointX, y = d3_geom_pointY;
-    if (arguments.length) return hull(vertices);
-    function hull(data) {
-      if (data.length < 3) return [];
-      var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = [];
-      for (i = 0; i < n; i++) {
-        points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]);
-      }
-      points.sort(d3_geom_hullOrder);
-      for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]);
-      var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints);
-      var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = [];
-      for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]);
-      for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]);
-      return polygon;
-    }
-    hull.x = function(_) {
-      return arguments.length ? (x = _, hull) : x;
-    };
-    hull.y = function(_) {
-      return arguments.length ? (y = _, hull) : y;
-    };
-    return hull;
-  };
-  function d3_geom_hullUpper(points) {
-    var n = points.length, hull = [ 0, 1 ], hs = 2;
-    for (var i = 2; i < n; i++) {
-      while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs;
-      hull[hs++] = i;
-    }
-    return hull.slice(0, hs);
-  }
-  function d3_geom_hullOrder(a, b) {
-    return a[0] - b[0] || a[1] - b[1];
-  }
-  d3.geom.polygon = function(coordinates) {
-    d3_subclass(coordinates, d3_geom_polygonPrototype);
-    return coordinates;
-  };
-  var d3_geom_polygonPrototype = d3.geom.polygon.prototype = [];
-  d3_geom_polygonPrototype.area = function() {
-    var i = -1, n = this.length, a, b = this[n - 1], area = 0;
-    while (++i < n) {
-      a = b;
-      b = this[i];
-      area += a[1] * b[0] - a[0] * b[1];
-    }
-    return area * .5;
-  };
-  d3_geom_polygonPrototype.centroid = function(k) {
-    var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c;
-    if (!arguments.length) k = -1 / (6 * this.area());
-    while (++i < n) {
-      a = b;
-      b = this[i];
-      c = a[0] * b[1] - b[0] * a[1];
-      x += (a[0] + b[0]) * c;
-      y += (a[1] + b[1]) * c;
-    }
-    return [ x * k, y * k ];
-  };
-  d3_geom_polygonPrototype.clip = function(subject) {
-    var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d;
-    while (++i < n) {
-      input = subject.slice();
-      subject.length = 0;
-      b = this[i];
-      c = input[(m = input.length - closed) - 1];
-      j = -1;
-      while (++j < m) {
-        d = input[j];
-        if (d3_geom_polygonInside(d, a, b)) {
-          if (!d3_geom_polygonInside(c, a, b)) {
-            subject.push(d3_geom_polygonIntersect(c, d, a, b));
-          }
-          subject.push(d);
-        } else if (d3_geom_polygonInside(c, a, b)) {
-          subject.push(d3_geom_polygonIntersect(c, d, a, b));
-        }
-        c = d;
-      }
-      if (closed) subject.push(subject[0]);
-      a = b;
-    }
-    return subject;
-  };
-  function d3_geom_polygonInside(p, a, b) {
-    return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]);
-  }
-  function d3_geom_polygonIntersect(c, d, a, b) {
-    var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21);
-    return [ x1 + ua * x21, y1 + ua * y21 ];
-  }
-  function d3_geom_polygonClosed(coordinates) {
-    var a = coordinates[0], b = coordinates[coordinates.length - 1];
-    return !(a[0] - b[0] || a[1] - b[1]);
-  }
-  var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = [];
-  function d3_geom_voronoiBeach() {
-    d3_geom_voronoiRedBlackNode(this);
-    this.edge = this.site = this.circle = null;
-  }
-  function d3_geom_voronoiCreateBeach(site) {
-    var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach();
-    beach.site = site;
-    return beach;
-  }
-  function d3_geom_voronoiDetachBeach(beach) {
-    d3_geom_voronoiDetachCircle(beach);
-    d3_geom_voronoiBeaches.remove(beach);
-    d3_geom_voronoiBeachPool.push(beach);
-    d3_geom_voronoiRedBlackNode(beach);
-  }
-  function d3_geom_voronoiRemoveBeach(beach) {
-    var circle = beach.circle, x = circle.x, y = circle.cy, vertex = {
-      x: x,
-      y: y
-    }, previous = beach.P, next = beach.N, disappearing = [ beach ];
-    d3_geom_voronoiDetachBeach(beach);
-    var lArc = previous;
-    while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) {
-      previous = lArc.P;
-      disappearing.unshift(lArc);
-      d3_geom_voronoiDetachBeach(lArc);
-      lArc = previous;
-    }
-    disappearing.unshift(lArc);
-    d3_geom_voronoiDetachCircle(lArc);
-    var rArc = next;
-    while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) {
-      next = rArc.N;
-      disappearing.push(rArc);
-      d3_geom_voronoiDetachBeach(rArc);
-      rArc = next;
-    }
-    disappearing.push(rArc);
-    d3_geom_voronoiDetachCircle(rArc);
-    var nArcs = disappearing.length, iArc;
-    for (iArc = 1; iArc < nArcs; ++iArc) {
-      rArc = disappearing[iArc];
-      lArc = disappearing[iArc - 1];
-      d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);
-    }
-    lArc = disappearing[0];
-    rArc = disappearing[nArcs - 1];
-    rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex);
-    d3_geom_voronoiAttachCircle(lArc);
-    d3_geom_voronoiAttachCircle(rArc);
-  }
-  function d3_geom_voronoiAddBeach(site) {
-    var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._;
-    while (node) {
-      dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x;
-      if (dxl > ε) node = node.L; else {
-        dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix);
-        if (dxr > ε) {
-          if (!node.R) {
-            lArc = node;
-            break;
-          }
-          node = node.R;
-        } else {
-          if (dxl > -ε) {
-            lArc = node.P;
-            rArc = node;
-          } else if (dxr > -ε) {
-            lArc = node;
-            rArc = node.N;
-          } else {
-            lArc = rArc = node;
-          }
-          break;
-        }
-      }
-    }
-    var newArc = d3_geom_voronoiCreateBeach(site);
-    d3_geom_voronoiBeaches.insert(lArc, newArc);
-    if (!lArc && !rArc) return;
-    if (lArc === rArc) {
-      d3_geom_voronoiDetachCircle(lArc);
-      rArc = d3_geom_voronoiCreateBeach(lArc.site);
-      d3_geom_voronoiBeaches.insert(newArc, rArc);
-      newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
-      d3_geom_voronoiAttachCircle(lArc);
-      d3_geom_voronoiAttachCircle(rArc);
-      return;
-    }
-    if (!rArc) {
-      newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
-      return;
-    }
-    d3_geom_voronoiDetachCircle(lArc);
-    d3_geom_voronoiDetachCircle(rArc);
-    var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = {
-      x: (cy * hb - by * hc) / d + ax,
-      y: (bx * hc - cx * hb) / d + ay
-    };
-    d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex);
-    newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex);
-    rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex);
-    d3_geom_voronoiAttachCircle(lArc);
-    d3_geom_voronoiAttachCircle(rArc);
-  }
-  function d3_geom_voronoiLeftBreakPoint(arc, directrix) {
-    var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix;
-    if (!pby2) return rfocx;
-    var lArc = arc.P;
-    if (!lArc) return -Infinity;
-    site = lArc.site;
-    var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix;
-    if (!plby2) return lfocx;
-    var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2;
-    if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;
-    return (rfocx + lfocx) / 2;
-  }
-  function d3_geom_voronoiRightBreakPoint(arc, directrix) {
-    var rArc = arc.N;
-    if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix);
-    var site = arc.site;
-    return site.y === directrix ? site.x : Infinity;
-  }
-  function d3_geom_voronoiCell(site) {
-    this.site = site;
-    this.edges = [];
-  }
-  d3_geom_voronoiCell.prototype.prepare = function() {
-    var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge;
-    while (iHalfEdge--) {
-      edge = halfEdges[iHalfEdge].edge;
-      if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1);
-    }
-    halfEdges.sort(d3_geom_voronoiHalfEdgeOrder);
-    return halfEdges.length;
-  };
-  function d3_geom_voronoiCloseCells(extent) {
-    var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end;
-    while (iCell--) {
-      cell = cells[iCell];
-      if (!cell || !cell.prepare()) continue;
-      halfEdges = cell.edges;
-      nHalfEdges = halfEdges.length;
-      iHalfEdge = 0;
-      while (iHalfEdge < nHalfEdges) {
-        end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y;
-        start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y;
-        if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {
-          halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {
-            x: x0,
-            y: abs(x2 - x0) < ε ? y2 : y1
-          } : abs(y3 - y1) < ε && x1 - x3 > ε ? {
-            x: abs(y2 - y1) < ε ? x2 : x1,
-            y: y1
-          } : abs(x3 - x1) < ε && y3 - y0 > ε ? {
-            x: x1,
-            y: abs(x2 - x1) < ε ? y2 : y0
-          } : abs(y3 - y0) < ε && x3 - x0 > ε ? {
-            x: abs(y2 - y0) < ε ? x2 : x0,
-            y: y0
-          } : null), cell.site, null));
-          ++nHalfEdges;
-        }
-      }
-    }
-  }
-  function d3_geom_voronoiHalfEdgeOrder(a, b) {
-    return b.angle - a.angle;
-  }
-  function d3_geom_voronoiCircle() {
-    d3_geom_voronoiRedBlackNode(this);
-    this.x = this.y = this.arc = this.site = this.cy = null;
-  }
-  function d3_geom_voronoiAttachCircle(arc) {
-    var lArc = arc.P, rArc = arc.N;
-    if (!lArc || !rArc) return;
-    var lSite = lArc.site, cSite = arc.site, rSite = rArc.site;
-    if (lSite === rSite) return;
-    var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by;
-    var d = 2 * (ax * cy - ay * cx);
-    if (d >= -ε2) return;
-    var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by;
-    var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle();
-    circle.arc = arc;
-    circle.site = cSite;
-    circle.x = x + bx;
-    circle.y = cy + Math.sqrt(x * x + y * y);
-    circle.cy = cy;
-    arc.circle = circle;
-    var before = null, node = d3_geom_voronoiCircles._;
-    while (node) {
-      if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) {
-        if (node.L) node = node.L; else {
-          before = node.P;
-          break;
-        }
-      } else {
-        if (node.R) node = node.R; else {
-          before = node;
-          break;
-        }
-      }
-    }
-    d3_geom_voronoiCircles.insert(before, circle);
-    if (!before) d3_geom_voronoiFirstCircle = circle;
-  }
-  function d3_geom_voronoiDetachCircle(arc) {
-    var circle = arc.circle;
-    if (circle) {
-      if (!circle.P) d3_geom_voronoiFirstCircle = circle.N;
-      d3_geom_voronoiCircles.remove(circle);
-      d3_geom_voronoiCirclePool.push(circle);
-      d3_geom_voronoiRedBlackNode(circle);
-      arc.circle = null;
-    }
-  }
-  function d3_geom_voronoiClipEdges(extent) {
-    var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e;
-    while (i--) {
-      e = edges[i];
-      if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) {
-        e.a = e.b = null;
-        edges.splice(i, 1);
-      }
-    }
-  }
-  function d3_geom_voronoiConnectEdge(edge, extent) {
-    var vb = edge.b;
-    if (vb) return true;
-    var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb;
-    if (ry === ly) {
-      if (fx < x0 || fx >= x1) return;
-      if (lx > rx) {
-        if (!va) va = {
-          x: fx,
-          y: y0
-        }; else if (va.y >= y1) return;
-        vb = {
-          x: fx,
-          y: y1
-        };
-      } else {
-        if (!va) va = {
-          x: fx,
-          y: y1
-        }; else if (va.y < y0) return;
-        vb = {
-          x: fx,
-          y: y0
-        };
-      }
-    } else {
-      fm = (lx - rx) / (ry - ly);
-      fb = fy - fm * fx;
-      if (fm < -1 || fm > 1) {
-        if (lx > rx) {
-          if (!va) va = {
-            x: (y0 - fb) / fm,
-            y: y0
-          }; else if (va.y >= y1) return;
-          vb = {
-            x: (y1 - fb) / fm,
-            y: y1
-          };
-        } else {
-          if (!va) va = {
-            x: (y1 - fb) / fm,
-            y: y1
-          }; else if (va.y < y0) return;
-          vb = {
-            x: (y0 - fb) / fm,
-            y: y0
-          };
-        }
-      } else {
-        if (ly < ry) {
-          if (!va) va = {
-            x: x0,
-            y: fm * x0 + fb
-          }; else if (va.x >= x1) return;
-          vb = {
-            x: x1,
-            y: fm * x1 + fb
-          };
-        } else {
-          if (!va) va = {
-            x: x1,
-            y: fm * x1 + fb
-          }; else if (va.x < x0) return;
-          vb = {
-            x: x0,
-            y: fm * x0 + fb
-          };
-        }
-      }
-    }
-    edge.a = va;
-    edge.b = vb;
-    return true;
-  }
-  function d3_geom_voronoiEdge(lSite, rSite) {
-    this.l = lSite;
-    this.r = rSite;
-    this.a = this.b = null;
-  }
-  function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) {
-    var edge = new d3_geom_voronoiEdge(lSite, rSite);
-    d3_geom_voronoiEdges.push(edge);
-    if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va);
-    if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb);
-    d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite));
-    d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite));
-    return edge;
-  }
-  function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) {
-    var edge = new d3_geom_voronoiEdge(lSite, null);
-    edge.a = va;
-    edge.b = vb;
-    d3_geom_voronoiEdges.push(edge);
-    return edge;
-  }
-  function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) {
-    if (!edge.a && !edge.b) {
-      edge.a = vertex;
-      edge.l = lSite;
-      edge.r = rSite;
-    } else if (edge.l === rSite) {
-      edge.b = vertex;
-    } else {
-      edge.a = vertex;
-    }
-  }
-  function d3_geom_voronoiHalfEdge(edge, lSite, rSite) {
-    var va = edge.a, vb = edge.b;
-    this.edge = edge;
-    this.site = lSite;
-    this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y);
-  }
-  d3_geom_voronoiHalfEdge.prototype = {
-    start: function() {
-      return this.edge.l === this.site ? this.edge.a : this.edge.b;
-    },
-    end: function() {
-      return this.edge.l === this.site ? this.edge.b : this.edge.a;
-    }
-  };
-  function d3_geom_voronoiRedBlackTree() {
-    this._ = null;
-  }
-  function d3_geom_voronoiRedBlackNode(node) {
-    node.U = node.C = node.L = node.R = node.P = node.N = null;
-  }
-  d3_geom_voronoiRedBlackTree.prototype = {
-    insert: function(after, node) {
-      var parent, grandpa, uncle;
-      if (after) {
-        node.P = after;
-        node.N = after.N;
-        if (after.N) after.N.P = node;
-        after.N = node;
-        if (after.R) {
-          after = after.R;
-          while (after.L) after = after.L;
-          after.L = node;
-        } else {
-          after.R = node;
-        }
-        parent = after;
-      } else if (this._) {
-        after = d3_geom_voronoiRedBlackFirst(this._);
-        node.P = null;
-        node.N = after;
-        after.P = after.L = node;
-        parent = after;
-      } else {
-        node.P = node.N = null;
-        this._ = node;
-        parent = null;
-      }
-      node.L = node.R = null;
-      node.U = parent;
-      node.C = true;
-      after = node;
-      while (parent && parent.C) {
-        grandpa = parent.U;
-        if (parent === grandpa.L) {
-          uncle = grandpa.R;
-          if (uncle && uncle.C) {
-            parent.C = uncle.C = false;
-            grandpa.C = true;
-            after = grandpa;
-          } else {
-            if (after === parent.R) {
-              d3_geom_voronoiRedBlackRotateLeft(this, parent);
-              after = parent;
-              parent = after.U;
-            }
-            parent.C = false;
-            grandpa.C = true;
-            d3_geom_voronoiRedBlackRotateRight(this, grandpa);
-          }
-        } else {
-          uncle = grandpa.L;
-          if (uncle && uncle.C) {
-            parent.C = uncle.C = false;
-            grandpa.C = true;
-            after = grandpa;
-          } else {
-            if (after === parent.L) {
-              d3_geom_voronoiRedBlackRotateRight(this, parent);
-              after = parent;
-              parent = after.U;
-            }
-            parent.C = false;
-            grandpa.C = true;
-            d3_geom_voronoiRedBlackRotateLeft(this, grandpa);
-          }
-        }
-        parent = after.U;
-      }
-      this._.C = false;
-    },
-    remove: function(node) {
-      if (node.N) node.N.P = node.P;
-      if (node.P) node.P.N = node.N;
-      node.N = node.P = null;
-      var parent = node.U, sibling, left = node.L, right = node.R, next, red;
-      if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right);
-      if (parent) {
-        if (parent.L === node) parent.L = next; else parent.R = next;
-      } else {
-        this._ = next;
-      }
-      if (left && right) {
-        red = next.C;
-        next.C = node.C;
-        next.L = left;
-        left.U = next;
-        if (next !== right) {
-          parent = next.U;
-          next.U = node.U;
-          node = next.R;
-          parent.L = node;
-          next.R = right;
-          right.U = next;
-        } else {
-          next.U = parent;
-          parent = next;
-          node = next.R;
-        }
-      } else {
-        red = node.C;
-        node = next;
-      }
-      if (node) node.U = parent;
-      if (red) return;
-      if (node && node.C) {
-        node.C = false;
-        return;
-      }
-      do {
-        if (node === this._) break;
-        if (node === parent.L) {
-          sibling = parent.R;
-          if (sibling.C) {
-            sibling.C = false;
-            parent.C = true;
-            d3_geom_voronoiRedBlackRotateLeft(this, parent);
-            sibling = parent.R;
-          }
-          if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
-            if (!sibling.R || !sibling.R.C) {
-              sibling.L.C = false;
-              sibling.C = true;
-              d3_geom_voronoiRedBlackRotateRight(this, sibling);
-              sibling = parent.R;
-            }
-            sibling.C = parent.C;
-            parent.C = sibling.R.C = false;
-            d3_geom_voronoiRedBlackRotateLeft(this, parent);
-            node = this._;
-            break;
-          }
-        } else {
-          sibling = parent.L;
-          if (sibling.C) {
-            sibling.C = false;
-            parent.C = true;
-            d3_geom_voronoiRedBlackRotateRight(this, parent);
-            sibling = parent.L;
-          }
-          if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
-            if (!sibling.L || !sibling.L.C) {
-              sibling.R.C = false;
-              sibling.C = true;
-              d3_geom_voronoiRedBlackRotateLeft(this, sibling);
-              sibling = parent.L;
-            }
-            sibling.C = parent.C;
-            parent.C = sibling.L.C = false;
-            d3_geom_voronoiRedBlackRotateRight(this, parent);
-            node = this._;
-            break;
-          }
-        }
-        sibling.C = true;
-        node = parent;
-        parent = parent.U;
-      } while (!node.C);
-      if (node) node.C = false;
-    }
-  };
-  function d3_geom_voronoiRedBlackRotateLeft(tree, node) {
-    var p = node, q = node.R, parent = p.U;
-    if (parent) {
-      if (parent.L === p) parent.L = q; else parent.R = q;
-    } else {
-      tree._ = q;
-    }
-    q.U = parent;
-    p.U = q;
-    p.R = q.L;
-    if (p.R) p.R.U = p;
-    q.L = p;
-  }
-  function d3_geom_voronoiRedBlackRotateRight(tree, node) {
-    var p = node, q = node.L, parent = p.U;
-    if (parent) {
-      if (parent.L === p) parent.L = q; else parent.R = q;
-    } else {
-      tree._ = q;
-    }
-    q.U = parent;
-    p.U = q;
-    p.L = q.R;
-    if (p.L) p.L.U = p;
-    q.R = p;
-  }
-  function d3_geom_voronoiRedBlackFirst(node) {
-    while (node.L) node = node.L;
-    return node;
-  }
-  function d3_geom_voronoi(sites, bbox) {
-    var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle;
-    d3_geom_voronoiEdges = [];
-    d3_geom_voronoiCells = new Array(sites.length);
-    d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree();
-    d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree();
-    while (true) {
-      circle = d3_geom_voronoiFirstCircle;
-      if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) {
-        if (site.x !== x0 || site.y !== y0) {
-          d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site);
-          d3_geom_voronoiAddBeach(site);
-          x0 = site.x, y0 = site.y;
-        }
-        site = sites.pop();
-      } else if (circle) {
-        d3_geom_voronoiRemoveBeach(circle.arc);
-      } else {
-        break;
-      }
-    }
-    if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox);
-    var diagram = {
-      cells: d3_geom_voronoiCells,
-      edges: d3_geom_voronoiEdges
-    };
-    d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null;
-    return diagram;
-  }
-  function d3_geom_voronoiVertexOrder(a, b) {
-    return b.y - a.y || b.x - a.x;
-  }
-  d3.geom.voronoi = function(points) {
-    var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent;
-    if (points) return voronoi(points);
-    function voronoi(data) {
-      var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1];
-      d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) {
-        var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) {
-          var s = e.start();
-          return [ s.x, s.y ];
-        }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : [];
-        polygon.point = data[i];
-      });
-      return polygons;
-    }
-    function sites(data) {
-      return data.map(function(d, i) {
-        return {
-          x: Math.round(fx(d, i) / ε) * ε,
-          y: Math.round(fy(d, i) / ε) * ε,
-          i: i
-        };
-      });
-    }
-    voronoi.links = function(data) {
-      return d3_geom_voronoi(sites(data)).edges.filter(function(edge) {
-        return edge.l && edge.r;
-      }).map(function(edge) {
-        return {
-          source: data[edge.l.i],
-          target: data[edge.r.i]
-        };
-      });
-    };
-    voronoi.triangles = function(data) {
-      var triangles = [];
-      d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) {
-        var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l;
-        while (++j < m) {
-          e0 = e1;
-          s0 = s1;
-          e1 = edges[j].edge;
-          s1 = e1.l === site ? e1.r : e1.l;
-          if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) {
-            triangles.push([ data[i], data[s0.i], data[s1.i] ]);
-          }
-        }
-      });
-      return triangles;
-    };
-    voronoi.x = function(_) {
-      return arguments.length ? (fx = d3_functor(x = _), voronoi) : x;
-    };
-    voronoi.y = function(_) {
-      return arguments.length ? (fy = d3_functor(y = _), voronoi) : y;
-    };
-    voronoi.clipExtent = function(_) {
-      if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent;
-      clipExtent = _ == null ? d3_geom_voronoiClipExtent : _;
-      return voronoi;
-    };
-    voronoi.size = function(_) {
-      if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1];
-      return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]);
-    };
-    return voronoi;
-  };
-  var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ];
-  function d3_geom_voronoiTriangleArea(a, b, c) {
-    return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y);
-  }
-  d3.geom.delaunay = function(vertices) {
-    return d3.geom.voronoi().triangles(vertices);
-  };
-  d3.geom.quadtree = function(points, x1, y1, x2, y2) {
-    var x = d3_geom_pointX, y = d3_geom_pointY, compat;
-    if (compat = arguments.length) {
-      x = d3_geom_quadtreeCompatX;
-      y = d3_geom_quadtreeCompatY;
-      if (compat === 3) {
-        y2 = y1;
-        x2 = x1;
-        y1 = x1 = 0;
-      }
-      return quadtree(points);
-    }
-    function quadtree(data) {
-      var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_;
-      if (x1 != null) {
-        x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2;
-      } else {
-        x2_ = y2_ = -(x1_ = y1_ = Infinity);
-        xs = [], ys = [];
-        n = data.length;
-        if (compat) for (i = 0; i < n; ++i) {
-          d = data[i];
-          if (d.x < x1_) x1_ = d.x;
-          if (d.y < y1_) y1_ = d.y;
-          if (d.x > x2_) x2_ = d.x;
-          if (d.y > y2_) y2_ = d.y;
-          xs.push(d.x);
-          ys.push(d.y);
-        } else for (i = 0; i < n; ++i) {
-          var x_ = +fx(d = data[i], i), y_ = +fy(d, i);
-          if (x_ < x1_) x1_ = x_;
-          if (y_ < y1_) y1_ = y_;
-          if (x_ > x2_) x2_ = x_;
-          if (y_ > y2_) y2_ = y_;
-          xs.push(x_);
-          ys.push(y_);
-        }
-      }
-      var dx = x2_ - x1_, dy = y2_ - y1_;
-      if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy;
-      function insert(n, d, x, y, x1, y1, x2, y2) {
-        if (isNaN(x) || isNaN(y)) return;
-        if (n.leaf) {
-          var nx = n.x, ny = n.y;
-          if (nx != null) {
-            if (abs(nx - x) + abs(ny - y) < .01) {
-              insertChild(n, d, x, y, x1, y1, x2, y2);
-            } else {
-              var nPoint = n.point;
-              n.x = n.y = n.point = null;
-              insertChild(n, nPoint, nx, ny, x1, y1, x2, y2);
-              insertChild(n, d, x, y, x1, y1, x2, y2);
-            }
-          } else {
-            n.x = x, n.y = y, n.point = d;
-          }
-        } else {
-          insertChild(n, d, x, y, x1, y1, x2, y2);
-        }
-      }
-      function insertChild(n, d, x, y, x1, y1, x2, y2) {
-        var xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym, i = below << 1 | right;
-        n.leaf = false;
-        n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode());
-        if (right) x1 = xm; else x2 = xm;
-        if (below) y1 = ym; else y2 = ym;
-        insert(n, d, x, y, x1, y1, x2, y2);
-      }
-      var root = d3_geom_quadtreeNode();
-      root.add = function(d) {
-        insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_);
-      };
-      root.visit = function(f) {
-        d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_);
-      };
-      root.find = function(point) {
-        return d3_geom_quadtreeFind(root, point[0], point[1], x1_, y1_, x2_, y2_);
-      };
-      i = -1;
-      if (x1 == null) {
-        while (++i < n) {
-          insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_);
-        }
-        --i;
-      } else data.forEach(root.add);
-      xs = ys = data = d = null;
-      return root;
-    }
-    quadtree.x = function(_) {
-      return arguments.length ? (x = _, quadtree) : x;
-    };
-    quadtree.y = function(_) {
-      return arguments.length ? (y = _, quadtree) : y;
-    };
-    quadtree.extent = function(_) {
-      if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ];
-      if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], 
-      y2 = +_[1][1];
-      return quadtree;
-    };
-    quadtree.size = function(_) {
-      if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ];
-      if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1];
-      return quadtree;
-    };
-    return quadtree;
-  };
-  function d3_geom_quadtreeCompatX(d) {
-    return d.x;
-  }
-  function d3_geom_quadtreeCompatY(d) {
-    return d.y;
-  }
-  function d3_geom_quadtreeNode() {
-    return {
-      leaf: true,
-      nodes: [],
-      point: null,
-      x: null,
-      y: null
-    };
-  }
-  function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) {
-    if (!f(node, x1, y1, x2, y2)) {
-      var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes;
-      if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy);
-      if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy);
-      if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2);
-      if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2);
-    }
-  }
-  function d3_geom_quadtreeFind(root, x, y, x0, y0, x3, y3) {
-    var minDistance2 = Infinity, closestPoint;
-    (function find(node, x1, y1, x2, y2) {
-      if (x1 > x3 || y1 > y3 || x2 < x0 || y2 < y0) return;
-      if (point = node.point) {
-        var point, dx = x - node.x, dy = y - node.y, distance2 = dx * dx + dy * dy;
-        if (distance2 < minDistance2) {
-          var distance = Math.sqrt(minDistance2 = distance2);
-          x0 = x - distance, y0 = y - distance;
-          x3 = x + distance, y3 = y + distance;
-          closestPoint = point;
-        }
-      }
-      var children = node.nodes, xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym;
-      for (var i = below << 1 | right, j = i + 4; i < j; ++i) {
-        if (node = children[i & 3]) switch (i & 3) {
-         case 0:
-          find(node, x1, y1, xm, ym);
-          break;
-
-         case 1:
-          find(node, xm, y1, x2, ym);
-          break;
-
-         case 2:
-          find(node, x1, ym, xm, y2);
-          break;
-
-         case 3:
-          find(node, xm, ym, x2, y2);
-          break;
-        }
-      }
-    })(root, x0, y0, x3, y3);
-    return closestPoint;
-  }
-  d3.interpolateRgb = d3_interpolateRgb;
-  function d3_interpolateRgb(a, b) {
-    a = d3.rgb(a);
-    b = d3.rgb(b);
-    var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab;
-    return function(t) {
-      return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t));
-    };
-  }
-  d3.interpolateObject = d3_interpolateObject;
-  function d3_interpolateObject(a, b) {
-    var i = {}, c = {}, k;
-    for (k in a) {
-      if (k in b) {
-        i[k] = d3_interpolate(a[k], b[k]);
-      } else {
-        c[k] = a[k];
-      }
-    }
-    for (k in b) {
-      if (!(k in a)) {
-        c[k] = b[k];
-      }
-    }
-    return function(t) {
-      for (k in i) c[k] = i[k](t);
-      return c;
-    };
-  }
-  d3.interpolateNumber = d3_interpolateNumber;
-  function d3_interpolateNumber(a, b) {
-    a = +a, b = +b;
-    return function(t) {
-      return a * (1 - t) + b * t;
-    };
-  }
-  d3.interpolateString = d3_interpolateString;
-  function d3_interpolateString(a, b) {
-    var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
-    a = a + "", b = b + "";
-    while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) {
-      if ((bs = bm.index) > bi) {
-        bs = b.slice(bi, bs);
-        if (s[i]) s[i] += bs; else s[++i] = bs;
-      }
-      if ((am = am[0]) === (bm = bm[0])) {
-        if (s[i]) s[i] += bm; else s[++i] = bm;
-      } else {
-        s[++i] = null;
-        q.push({
-          i: i,
-          x: d3_interpolateNumber(am, bm)
-        });
-      }
-      bi = d3_interpolate_numberB.lastIndex;
-    }
-    if (bi < b.length) {
-      bs = b.slice(bi);
-      if (s[i]) s[i] += bs; else s[++i] = bs;
-    }
-    return s.length < 2 ? q[0] ? (b = q[0].x, function(t) {
-      return b(t) + "";
-    }) : function() {
-      return b;
-    } : (b = q.length, function(t) {
-      for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
-      return s.join("");
-    });
-  }
-  var d3_interpolate_numberA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, "g");
-  d3.interpolate = d3_interpolate;
-  function d3_interpolate(a, b) {
-    var i = d3.interpolators.length, f;
-    while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ;
-    return f;
-  }
-  d3.interpolators = [ function(a, b) {
-    var t = typeof b;
-    return (t === "string" ? d3_rgb_names.has(b.toLowerCase()) || /^(#|rgb\(|hsl\()/i.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b);
-  } ];
-  d3.interpolateArray = d3_interpolateArray;
-  function d3_interpolateArray(a, b) {
-    var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i;
-    for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i]));
-    for (;i < na; ++i) c[i] = a[i];
-    for (;i < nb; ++i) c[i] = b[i];
-    return function(t) {
-      for (i = 0; i < n0; ++i) c[i] = x[i](t);
-      return c;
-    };
-  }
-  var d3_ease_default = function() {
-    return d3_identity;
-  };
-  var d3_ease = d3.map({
-    linear: d3_ease_default,
-    poly: d3_ease_poly,
-    quad: function() {
-      return d3_ease_quad;
-    },
-    cubic: function() {
-      return d3_ease_cubic;
-    },
-    sin: function() {
-      return d3_ease_sin;
-    },
-    exp: function() {
-      return d3_ease_exp;
-    },
-    circle: function() {
-      return d3_ease_circle;
-    },
-    elastic: d3_ease_elastic,
-    back: d3_ease_back,
-    bounce: function() {
-      return d3_ease_bounce;
-    }
-  });
-  var d3_ease_mode = d3.map({
-    "in": d3_identity,
-    out: d3_ease_reverse,
-    "in-out": d3_ease_reflect,
-    "out-in": function(f) {
-      return d3_ease_reflect(d3_ease_reverse(f));
-    }
-  });
-  d3.ease = function(name) {
-    var i = name.indexOf("-"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : "in";
-    t = d3_ease.get(t) || d3_ease_default;
-    m = d3_ease_mode.get(m) || d3_identity;
-    return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1))));
-  };
-  function d3_ease_clamp(f) {
-    return function(t) {
-      return t <= 0 ? 0 : t >= 1 ? 1 : f(t);
-    };
-  }
-  function d3_ease_reverse(f) {
-    return function(t) {
-      return 1 - f(1 - t);
-    };
-  }
-  function d3_ease_reflect(f) {
-    return function(t) {
-      return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t));
-    };
-  }
-  function d3_ease_quad(t) {
-    return t * t;
-  }
-  function d3_ease_cubic(t) {
-    return t * t * t;
-  }
-  function d3_ease_cubicInOut(t) {
-    if (t <= 0) return 0;
-    if (t >= 1) return 1;
-    var t2 = t * t, t3 = t2 * t;
-    return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75);
-  }
-  function d3_ease_poly(e) {
-    return function(t) {
-      return Math.pow(t, e);
-    };
-  }
-  function d3_ease_sin(t) {
-    return 1 - Math.cos(t * halfπ);
-  }
-  function d3_ease_exp(t) {
-    return Math.pow(2, 10 * (t - 1));
-  }
-  function d3_ease_circle(t) {
-    return 1 - Math.sqrt(1 - t * t);
-  }
-  function d3_ease_elastic(a, p) {
-    var s;
-    if (arguments.length < 2) p = .45;
-    if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4;
-    return function(t) {
-      return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p);
-    };
-  }
-  function d3_ease_back(s) {
-    if (!s) s = 1.70158;
-    return function(t) {
-      return t * t * ((s + 1) * t - s);
-    };
-  }
-  function d3_ease_bounce(t) {
-    return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;
-  }
-  d3.interpolateHcl = d3_interpolateHcl;
-  function d3_interpolateHcl(a, b) {
-    a = d3.hcl(a);
-    b = d3.hcl(b);
-    var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al;
-    if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac;
-    if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
-    return function(t) {
-      return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + "";
-    };
-  }
-  d3.interpolateHsl = d3_interpolateHsl;
-  function d3_interpolateHsl(a, b) {
-    a = d3.hsl(a);
-    b = d3.hsl(b);
-    var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al;
-    if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as;
-    if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
-    return function(t) {
-      return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + "";
-    };
-  }
-  d3.interpolateLab = d3_interpolateLab;
-  function d3_interpolateLab(a, b) {
-    a = d3.lab(a);
-    b = d3.lab(b);
-    var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab;
-    return function(t) {
-      return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + "";
-    };
-  }
-  d3.interpolateRound = d3_interpolateRound;
-  function d3_interpolateRound(a, b) {
-    b -= a;
-    return function(t) {
-      return Math.round(a + b * t);
-    };
-  }
-  d3.transform = function(string) {
-    var g = d3_document.createElementNS(d3.ns.prefix.svg, "g");
-    return (d3.transform = function(string) {
-      if (string != null) {
-        g.setAttribute("transform", string);
-        var t = g.transform.baseVal.consolidate();
-      }
-      return new d3_transform(t ? t.matrix : d3_transformIdentity);
-    })(string);
-  };
-  function d3_transform(m) {
-    var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0;
-    if (r0[0] * r1[1] < r1[0] * r0[1]) {
-      r0[0] *= -1;
-      r0[1] *= -1;
-      kx *= -1;
-      kz *= -1;
-    }
-    this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees;
-    this.translate = [ m.e, m.f ];
-    this.scale = [ kx, ky ];
-    this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0;
-  }
-  d3_transform.prototype.toString = function() {
-    return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")";
-  };
-  function d3_transformDot(a, b) {
-    return a[0] * b[0] + a[1] * b[1];
-  }
-  function d3_transformNormalize(a) {
-    var k = Math.sqrt(d3_transformDot(a, a));
-    if (k) {
-      a[0] /= k;
-      a[1] /= k;
-    }
-    return k;
-  }
-  function d3_transformCombine(a, b, k) {
-    a[0] += k * b[0];
-    a[1] += k * b[1];
-    return a;
-  }
-  var d3_transformIdentity = {
-    a: 1,
-    b: 0,
-    c: 0,
-    d: 1,
-    e: 0,
-    f: 0
-  };
-  d3.interpolateTransform = d3_interpolateTransform;
-  function d3_interpolateTransformPop(s) {
-    return s.length ? s.pop() + "," : "";
-  }
-  function d3_interpolateTranslate(ta, tb, s, q) {
-    if (ta[0] !== tb[0] || ta[1] !== tb[1]) {
-      var i = s.push("translate(", null, ",", null, ")");
-      q.push({
-        i: i - 4,
-        x: d3_interpolateNumber(ta[0], tb[0])
-      }, {
-        i: i - 2,
-        x: d3_interpolateNumber(ta[1], tb[1])
-      });
-    } else if (tb[0] || tb[1]) {
-      s.push("translate(" + tb + ")");
-    }
-  }
-  function d3_interpolateRotate(ra, rb, s, q) {
-    if (ra !== rb) {
-      if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360;
-      q.push({
-        i: s.push(d3_interpolateTransformPop(s) + "rotate(", null, ")") - 2,
-        x: d3_interpolateNumber(ra, rb)
-      });
-    } else if (rb) {
-      s.push(d3_interpolateTransformPop(s) + "rotate(" + rb + ")");
-    }
-  }
-  function d3_interpolateSkew(wa, wb, s, q) {
-    if (wa !== wb) {
-      q.push({
-        i: s.push(d3_interpolateTransformPop(s) + "skewX(", null, ")") - 2,
-        x: d3_interpolateNumber(wa, wb)
-      });
-    } else if (wb) {
-      s.push(d3_interpolateTransformPop(s) + "skewX(" + wb + ")");
-    }
-  }
-  function d3_interpolateScale(ka, kb, s, q) {
-    if (ka[0] !== kb[0] || ka[1] !== kb[1]) {
-      var i = s.push(d3_interpolateTransformPop(s) + "scale(", null, ",", null, ")");
-      q.push({
-        i: i - 4,
-        x: d3_interpolateNumber(ka[0], kb[0])
-      }, {
-        i: i - 2,
-        x: d3_interpolateNumber(ka[1], kb[1])
-      });
-    } else if (kb[0] !== 1 || kb[1] !== 1) {
-      s.push(d3_interpolateTransformPop(s) + "scale(" + kb + ")");
-    }
-  }
-  function d3_interpolateTransform(a, b) {
-    var s = [], q = [];
-    a = d3.transform(a), b = d3.transform(b);
-    d3_interpolateTranslate(a.translate, b.translate, s, q);
-    d3_interpolateRotate(a.rotate, b.rotate, s, q);
-    d3_interpolateSkew(a.skew, b.skew, s, q);
-    d3_interpolateScale(a.scale, b.scale, s, q);
-    a = b = null;
-    return function(t) {
-      var i = -1, n = q.length, o;
-      while (++i < n) s[(o = q[i]).i] = o.x(t);
-      return s.join("");
-    };
-  }
-  function d3_uninterpolateNumber(a, b) {
-    b = (b -= a = +a) || 1 / b;
-    return function(x) {
-      return (x - a) / b;
-    };
-  }
-  function d3_uninterpolateClamp(a, b) {
-    b = (b -= a = +a) || 1 / b;
-    return function(x) {
-      return Math.max(0, Math.min(1, (x - a) / b));
-    };
-  }
-  d3.layout = {};
-  d3.layout.bundle = function() {
-    return function(links) {
-      var paths = [], i = -1, n = links.length;
-      while (++i < n) paths.push(d3_layout_bundlePath(links[i]));
-      return paths;
-    };
-  };
-  function d3_layout_bundlePath(link) {
-    var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ];
-    while (start !== lca) {
-      start = start.parent;
-      points.push(start);
-    }
-    var k = points.length;
-    while (end !== lca) {
-      points.splice(k, 0, end);
-      end = end.parent;
-    }
-    return points;
-  }
-  function d3_layout_bundleAncestors(node) {
-    var ancestors = [], parent = node.parent;
-    while (parent != null) {
-      ancestors.push(node);
-      node = parent;
-      parent = parent.parent;
-    }
-    ancestors.push(node);
-    return ancestors;
-  }
-  function d3_layout_bundleLeastCommonAncestor(a, b) {
-    if (a === b) return a;
-    var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null;
-    while (aNode === bNode) {
-      sharedNode = aNode;
-      aNode = aNodes.pop();
-      bNode = bNodes.pop();
-    }
-    return sharedNode;
-  }
-  d3.layout.chord = function() {
-    var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;
-    function relayout() {
-      var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;
-      chords = [];
-      groups = [];
-      k = 0, i = -1;
-      while (++i < n) {
-        x = 0, j = -1;
-        while (++j < n) {
-          x += matrix[i][j];
-        }
-        groupSums.push(x);
-        subgroupIndex.push(d3.range(n));
-        k += x;
-      }
-      if (sortGroups) {
-        groupIndex.sort(function(a, b) {
-          return sortGroups(groupSums[a], groupSums[b]);
-        });
-      }
-      if (sortSubgroups) {
-        subgroupIndex.forEach(function(d, i) {
-          d.sort(function(a, b) {
-            return sortSubgroups(matrix[i][a], matrix[i][b]);
-          });
-        });
-      }
-      k = (τ - padding * n) / k;
-      x = 0, i = -1;
-      while (++i < n) {
-        x0 = x, j = -1;
-        while (++j < n) {
-          var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k;
-          subgroups[di + "-" + dj] = {
-            index: di,
-            subindex: dj,
-            startAngle: a0,
-            endAngle: a1,
-            value: v
-          };
-        }
-        groups[di] = {
-          index: di,
-          startAngle: x0,
-          endAngle: x,
-          value: groupSums[di]
-        };
-        x += padding;
-      }
-      i = -1;
-      while (++i < n) {
-        j = i - 1;
-        while (++j < n) {
-          var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i];
-          if (source.value || target.value) {
-            chords.push(source.value < target.value ? {
-              source: target,
-              target: source
-            } : {
-              source: source,
-              target: target
-            });
-          }
-        }
-      }
-      if (sortChords) resort();
-    }
-    function resort() {
-      chords.sort(function(a, b) {
-        return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2);
-      });
-    }
-    chord.matrix = function(x) {
-      if (!arguments.length) return matrix;
-      n = (matrix = x) && matrix.length;
-      chords = groups = null;
-      return chord;
-    };
-    chord.padding = function(x) {
-      if (!arguments.length) return padding;
-      padding = x;
-      chords = groups = null;
-      return chord;
-    };
-    chord.sortGroups = function(x) {
-      if (!arguments.length) return sortGroups;
-      sortGroups = x;
-      chords = groups = null;
-      return chord;
-    };
-    chord.sortSubgroups = function(x) {
-      if (!arguments.length) return sortSubgroups;
-      sortSubgroups = x;
-      chords = null;
-      return chord;
-    };
-    chord.sortChords = function(x) {
-      if (!arguments.length) return sortChords;
-      sortChords = x;
-      if (chords) resort();
-      return chord;
-    };
-    chord.chords = function() {
-      if (!chords) relayout();
-      return chords;
-    };
-    chord.groups = function() {
-      if (!groups) relayout();
-      return groups;
-    };
-    return chord;
-  };
-  d3.layout.force = function() {
-    var force = {}, event = d3.dispatch("start", "tick", "end"), timer, size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges;
-    function repulse(node) {
-      return function(quad, x1, _, x2) {
-        if (quad.point !== node) {
-          var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy;
-          if (dw * dw / theta2 < dn) {
-            if (dn < chargeDistance2) {
-              var k = quad.charge / dn;
-              node.px -= dx * k;
-              node.py -= dy * k;
-            }
-            return true;
-          }
-          if (quad.point && dn && dn < chargeDistance2) {
-            var k = quad.pointCharge / dn;
-            node.px -= dx * k;
-            node.py -= dy * k;
-          }
-        }
-        return !quad.charge;
-      };
-    }
-    force.tick = function() {
-      if ((alpha *= .99) < .005) {
-        timer = null;
-        event.end({
-          type: "end",
-          alpha: alpha = 0
-        });
-        return true;
-      }
-      var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y;
-      for (i = 0; i < m; ++i) {
-        o = links[i];
-        s = o.source;
-        t = o.target;
-        x = t.x - s.x;
-        y = t.y - s.y;
-        if (l = x * x + y * y) {
-          l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;
-          x *= l;
-          y *= l;
-          t.x -= x * (k = s.weight + t.weight ? s.weight / (s.weight + t.weight) : .5);
-          t.y -= y * k;
-          s.x += x * (k = 1 - k);
-          s.y += y * k;
-        }
-      }
-      if (k = alpha * gravity) {
-        x = size[0] / 2;
-        y = size[1] / 2;
-        i = -1;
-        if (k) while (++i < n) {
-          o = nodes[i];
-          o.x += (x - o.x) * k;
-          o.y += (y - o.y) * k;
-        }
-      }
-      if (charge) {
-        d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges);
-        i = -1;
-        while (++i < n) {
-          if (!(o = nodes[i]).fixed) {
-            q.visit(repulse(o));
-          }
-        }
-      }
-      i = -1;
-      while (++i < n) {
-        o = nodes[i];
-        if (o.fixed) {
-          o.x = o.px;
-          o.y = o.py;
-        } else {
-          o.x -= (o.px - (o.px = o.x)) * friction;
-          o.y -= (o.py - (o.py = o.y)) * friction;
-        }
-      }
-      event.tick({
-        type: "tick",
-        alpha: alpha
-      });
-    };
-    force.nodes = function(x) {
-      if (!arguments.length) return nodes;
-      nodes = x;
-      return force;
-    };
-    force.links = function(x) {
-      if (!arguments.length) return links;
-      links = x;
-      return force;
-    };
-    force.size = function(x) {
-      if (!arguments.length) return size;
-      size = x;
-      return force;
-    };
-    force.linkDistance = function(x) {
-      if (!arguments.length) return linkDistance;
-      linkDistance = typeof x === "function" ? x : +x;
-      return force;
-    };
-    force.distance = force.linkDistance;
-    force.linkStrength = function(x) {
-      if (!arguments.length) return linkStrength;
-      linkStrength = typeof x === "function" ? x : +x;
-      return force;
-    };
-    force.friction = function(x) {
-      if (!arguments.length) return friction;
-      friction = +x;
-      return force;
-    };
-    force.charge = function(x) {
-      if (!arguments.length) return charge;
-      charge = typeof x === "function" ? x : +x;
-      return force;
-    };
-    force.chargeDistance = function(x) {
-      if (!arguments.length) return Math.sqrt(chargeDistance2);
-      chargeDistance2 = x * x;
-      return force;
-    };
-    force.gravity = function(x) {
-      if (!arguments.length) return gravity;
-      gravity = +x;
-      return force;
-    };
-    force.theta = function(x) {
-      if (!arguments.length) return Math.sqrt(theta2);
-      theta2 = x * x;
-      return force;
-    };
-    force.alpha = function(x) {
-      if (!arguments.length) return alpha;
-      x = +x;
-      if (alpha) {
-        if (x > 0) {
-          alpha = x;
-        } else {
-          timer.c = null, timer.t = NaN, timer = null;
-          event.end({
-            type: "end",
-            alpha: alpha = 0
-          });
-        }
-      } else if (x > 0) {
-        event.start({
-          type: "start",
-          alpha: alpha = x
-        });
-        timer = d3_timer(force.tick);
-      }
-      return force;
-    };
-    force.start = function() {
-      var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o;
-      for (i = 0; i < n; ++i) {
-        (o = nodes[i]).index = i;
-        o.weight = 0;
-      }
-      for (i = 0; i < m; ++i) {
-        o = links[i];
-        if (typeof o.source == "number") o.source = nodes[o.source];
-        if (typeof o.target == "number") o.target = nodes[o.target];
-        ++o.source.weight;
-        ++o.target.weight;
-      }
-      for (i = 0; i < n; ++i) {
-        o = nodes[i];
-        if (isNaN(o.x)) o.x = position("x", w);
-        if (isNaN(o.y)) o.y = position("y", h);
-        if (isNaN(o.px)) o.px = o.x;
-        if (isNaN(o.py)) o.py = o.y;
-      }
-      distances = [];
-      if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance;
-      strengths = [];
-      if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength;
-      charges = [];
-      if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge;
-      function position(dimension, size) {
-        if (!neighbors) {
-          neighbors = new Array(n);
-          for (j = 0; j < n; ++j) {
-            neighbors[j] = [];
-          }
-          for (j = 0; j < m; ++j) {
-            var o = links[j];
-            neighbors[o.source.index].push(o.target);
-            neighbors[o.target.index].push(o.source);
-          }
-        }
-        var candidates = neighbors[i], j = -1, l = candidates.length, x;
-        while (++j < l) if (!isNaN(x = candidates[j][dimension])) return x;
-        return Math.random() * size;
-      }
-      return force.resume();
-    };
-    force.resume = function() {
-      return force.alpha(.1);
-    };
-    force.stop = function() {
-      return force.alpha(0);
-    };
-    force.drag = function() {
-      if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend);
-      if (!arguments.length) return drag;
-      this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag);
-    };
-    function dragmove(d) {
-      d.px = d3.event.x, d.py = d3.event.y;
-      force.resume();
-    }
-    return d3.rebind(force, event, "on");
-  };
-  function d3_layout_forceDragstart(d) {
-    d.fixed |= 2;
-  }
-  function d3_layout_forceDragend(d) {
-    d.fixed &= ~6;
-  }
-  function d3_layout_forceMouseover(d) {
-    d.fixed |= 4;
-    d.px = d.x, d.py = d.y;
-  }
-  function d3_layout_forceMouseout(d) {
-    d.fixed &= ~4;
-  }
-  function d3_layout_forceAccumulate(quad, alpha, charges) {
-    var cx = 0, cy = 0;
-    quad.charge = 0;
-    if (!quad.leaf) {
-      var nodes = quad.nodes, n = nodes.length, i = -1, c;
-      while (++i < n) {
-        c = nodes[i];
-        if (c == null) continue;
-        d3_layout_forceAccumulate(c, alpha, charges);
-        quad.charge += c.charge;
-        cx += c.charge * c.cx;
-        cy += c.charge * c.cy;
-      }
-    }
-    if (quad.point) {
-      if (!quad.leaf) {
-        quad.point.x += Math.random() - .5;
-        quad.point.y += Math.random() - .5;
-      }
-      var k = alpha * charges[quad.point.index];
-      quad.charge += quad.pointCharge = k;
-      cx += k * quad.point.x;
-      cy += k * quad.point.y;
-    }
-    quad.cx = cx / quad.charge;
-    quad.cy = cy / quad.charge;
-  }
-  var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity;
-  d3.layout.hierarchy = function() {
-    var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;
-    function hierarchy(root) {
-      var stack = [ root ], nodes = [], node;
-      root.depth = 0;
-      while ((node = stack.pop()) != null) {
-        nodes.push(node);
-        if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) {
-          var n, childs, child;
-          while (--n >= 0) {
-            stack.push(child = childs[n]);
-            child.parent = node;
-            child.depth = node.depth + 1;
-          }
-          if (value) node.value = 0;
-          node.children = childs;
-        } else {
-          if (value) node.value = +value.call(hierarchy, node, node.depth) || 0;
-          delete node.children;
-        }
-      }
-      d3_layout_hierarchyVisitAfter(root, function(node) {
-        var childs, parent;
-        if (sort && (childs = node.children)) childs.sort(sort);
-        if (value && (parent = node.parent)) parent.value += node.value;
-      });
-      return nodes;
-    }
-    hierarchy.sort = function(x) {
-      if (!arguments.length) return sort;
-      sort = x;
-      return hierarchy;
-    };
-    hierarchy.children = function(x) {
-      if (!arguments.length) return children;
-      children = x;
-      return hierarchy;
-    };
-    hierarchy.value = function(x) {
-      if (!arguments.length) return value;
-      value = x;
-      return hierarchy;
-    };
-    hierarchy.revalue = function(root) {
-      if (value) {
-        d3_layout_hierarchyVisitBefore(root, function(node) {
-          if (node.children) node.value = 0;
-        });
-        d3_layout_hierarchyVisitAfter(root, function(node) {
-          var parent;
-          if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0;
-          if (parent = node.parent) parent.value += node.value;
-        });
-      }
-      return root;
-    };
-    return hierarchy;
-  };
-  function d3_layout_hierarchyRebind(object, hierarchy) {
-    d3.rebind(object, hierarchy, "sort", "children", "value");
-    object.nodes = object;
-    object.links = d3_layout_hierarchyLinks;
-    return object;
-  }
-  function d3_layout_hierarchyVisitBefore(node, callback) {
-    var nodes = [ node ];
-    while ((node = nodes.pop()) != null) {
-      callback(node);
-      if ((children = node.children) && (n = children.length)) {
-        var n, children;
-        while (--n >= 0) nodes.push(children[n]);
-      }
-    }
-  }
-  function d3_layout_hierarchyVisitAfter(node, callback) {
-    var nodes = [ node ], nodes2 = [];
-    while ((node = nodes.pop()) != null) {
-      nodes2.push(node);
-      if ((children = node.children) && (n = children.length)) {
-        var i = -1, n, children;
-        while (++i < n) nodes.push(children[i]);
-      }
-    }
-    while ((node = nodes2.pop()) != null) {
-      callback(node);
-    }
-  }
-  function d3_layout_hierarchyChildren(d) {
-    return d.children;
-  }
-  function d3_layout_hierarchyValue(d) {
-    return d.value;
-  }
-  function d3_layout_hierarchySort(a, b) {
-    return b.value - a.value;
-  }
-  function d3_layout_hierarchyLinks(nodes) {
-    return d3.merge(nodes.map(function(parent) {
-      return (parent.children || []).map(function(child) {
-        return {
-          source: parent,
-          target: child
-        };
-      });
-    }));
-  }
-  d3.layout.partition = function() {
-    var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ];
-    function position(node, x, dx, dy) {
-      var children = node.children;
-      node.x = x;
-      node.y = node.depth * dy;
-      node.dx = dx;
-      node.dy = dy;
-      if (children && (n = children.length)) {
-        var i = -1, n, c, d;
-        dx = node.value ? dx / node.value : 0;
-        while (++i < n) {
-          position(c = children[i], x, d = c.value * dx, dy);
-          x += d;
-        }
-      }
-    }
-    function depth(node) {
-      var children = node.children, d = 0;
-      if (children && (n = children.length)) {
-        var i = -1, n;
-        while (++i < n) d = Math.max(d, depth(children[i]));
-      }
-      return 1 + d;
-    }
-    function partition(d, i) {
-      var nodes = hierarchy.call(this, d, i);
-      position(nodes[0], 0, size[0], size[1] / depth(nodes[0]));
-      return nodes;
-    }
-    partition.size = function(x) {
-      if (!arguments.length) return size;
-      size = x;
-      return partition;
-    };
-    return d3_layout_hierarchyRebind(partition, hierarchy);
-  };
-  d3.layout.pie = function() {
-    var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ, padAngle = 0;
-    function pie(data) {
-      var n = data.length, values = data.map(function(d, i) {
-        return +value.call(pie, d, i);
-      }), a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle), da = (typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a, p = Math.min(Math.abs(da) / n, +(typeof padAngle === "function" ? padAngle.apply(this, arguments) : padAngle)), pa = p * (da < 0 ? -1 : 1), sum = d3.sum(values), k = sum ? (da - n * pa) / sum : 0, index = d3.range(n), arcs = [], v;
-      if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) {
-        return values[j] - values[i];
-      } : function(i, j) {
-        return sort(data[i], data[j]);
-      });
-      index.forEach(function(i) {
-        arcs[i] = {
-          data: data[i],
-          value: v = values[i],
-          startAngle: a,
-          endAngle: a += v * k + pa,
-          padAngle: p
-        };
-      });
-      return arcs;
-    }
-    pie.value = function(_) {
-      if (!arguments.length) return value;
-      value = _;
-      return pie;
-    };
-    pie.sort = function(_) {
-      if (!arguments.length) return sort;
-      sort = _;
-      return pie;
-    };
-    pie.startAngle = function(_) {
-      if (!arguments.length) return startAngle;
-      startAngle = _;
-      return pie;
-    };
-    pie.endAngle = function(_) {
-      if (!arguments.length) return endAngle;
-      endAngle = _;
-      return pie;
-    };
-    pie.padAngle = function(_) {
-      if (!arguments.length) return padAngle;
-      padAngle = _;
-      return pie;
-    };
-    return pie;
-  };
-  var d3_layout_pieSortByValue = {};
-  d3.layout.stack = function() {
-    var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY;
-    function stack(data, index) {
-      if (!(n = data.length)) return data;
-      var series = data.map(function(d, i) {
-        return values.call(stack, d, i);
-      });
-      var points = series.map(function(d) {
-        return d.map(function(v, i) {
-          return [ x.call(stack, v, i), y.call(stack, v, i) ];
-        });
-      });
-      var orders = order.call(stack, points, index);
-      series = d3.permute(series, orders);
-      points = d3.permute(points, orders);
-      var offsets = offset.call(stack, points, index);
-      var m = series[0].length, n, i, j, o;
-      for (j = 0; j < m; ++j) {
-        out.call(stack, series[0][j], o = offsets[j], points[0][j][1]);
-        for (i = 1; i < n; ++i) {
-          out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]);
-        }
-      }
-      return data;
-    }
-    stack.values = function(x) {
-      if (!arguments.length) return values;
-      values = x;
-      return stack;
-    };
-    stack.order = function(x) {
-      if (!arguments.length) return order;
-      order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault;
-      return stack;
-    };
-    stack.offset = function(x) {
-      if (!arguments.length) return offset;
-      offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero;
-      return stack;
-    };
-    stack.x = function(z) {
-      if (!arguments.length) return x;
-      x = z;
-      return stack;
-    };
-    stack.y = function(z) {
-      if (!arguments.length) return y;
-      y = z;
-      return stack;
-    };
-    stack.out = function(z) {
-      if (!arguments.length) return out;
-      out = z;
-      return stack;
-    };
-    return stack;
-  };
-  function d3_layout_stackX(d) {
-    return d.x;
-  }
-  function d3_layout_stackY(d) {
-    return d.y;
-  }
-  function d3_layout_stackOut(d, y0, y) {
-    d.y0 = y0;
-    d.y = y;
-  }
-  var d3_layout_stackOrders = d3.map({
-    "inside-out": function(data) {
-      var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) {
-        return max[a] - max[b];
-      }), top = 0, bottom = 0, tops = [], bottoms = [];
-      for (i = 0; i < n; ++i) {
-        j = index[i];
-        if (top < bottom) {
-          top += sums[j];
-          tops.push(j);
-        } else {
-          bottom += sums[j];
-          bottoms.push(j);
-        }
-      }
-      return bottoms.reverse().concat(tops);
-    },
-    reverse: function(data) {
-      return d3.range(data.length).reverse();
-    },
-    "default": d3_layout_stackOrderDefault
-  });
-  var d3_layout_stackOffsets = d3.map({
-    silhouette: function(data) {
-      var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = [];
-      for (j = 0; j < m; ++j) {
-        for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
-        if (o > max) max = o;
-        sums.push(o);
-      }
-      for (j = 0; j < m; ++j) {
-        y0[j] = (max - sums[j]) / 2;
-      }
-      return y0;
-    },
-    wiggle: function(data) {
-      var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];
-      y0[0] = o = o0 = 0;
-      for (j = 1; j < m; ++j) {
-        for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1];
-        for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) {
-          for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) {
-            s3 += (data[k][j][1] - data[k][j - 1][1]) / dx;
-          }
-          s2 += s3 * data[i][j][1];
-        }
-        y0[j] = o -= s1 ? s2 / s1 * dx : 0;
-        if (o < o0) o0 = o;
-      }
-      for (j = 0; j < m; ++j) y0[j] -= o0;
-      return y0;
-    },
-    expand: function(data) {
-      var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = [];
-      for (j = 0; j < m; ++j) {
-        for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
-        if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k;
-      }
-      for (j = 0; j < m; ++j) y0[j] = 0;
-      return y0;
-    },
-    zero: d3_layout_stackOffsetZero
-  });
-  function d3_layout_stackOrderDefault(data) {
-    return d3.range(data.length);
-  }
-  function d3_layout_stackOffsetZero(data) {
-    var j = -1, m = data[0].length, y0 = [];
-    while (++j < m) y0[j] = 0;
-    return y0;
-  }
-  function d3_layout_stackMaxIndex(array) {
-    var i = 1, j = 0, v = array[0][1], k, n = array.length;
-    for (;i < n; ++i) {
-      if ((k = array[i][1]) > v) {
-        j = i;
-        v = k;
-      }
-    }
-    return j;
-  }
-  function d3_layout_stackReduceSum(d) {
-    return d.reduce(d3_layout_stackSum, 0);
-  }
-  function d3_layout_stackSum(p, d) {
-    return p + d[1];
-  }
-  d3.layout.histogram = function() {
-    var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges;
-    function histogram(data, i) {
-      var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x;
-      while (++i < m) {
-        bin = bins[i] = [];
-        bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]);
-        bin.y = 0;
-      }
-      if (m > 0) {
-        i = -1;
-        while (++i < n) {
-          x = values[i];
-          if (x >= range[0] && x <= range[1]) {
-            bin = bins[d3.bisect(thresholds, x, 1, m) - 1];
-            bin.y += k;
-            bin.push(data[i]);
-          }
-        }
-      }
-      return bins;
-    }
-    histogram.value = function(x) {
-      if (!arguments.length) return valuer;
-      valuer = x;
-      return histogram;
-    };
-    histogram.range = function(x) {
-      if (!arguments.length) return ranger;
-      ranger = d3_functor(x);
-      return histogram;
-    };
-    histogram.bins = function(x) {
-      if (!arguments.length) return binner;
-      binner = typeof x === "number" ? function(range) {
-        return d3_layout_histogramBinFixed(range, x);
-      } : d3_functor(x);
-      return histogram;
-    };
-    histogram.frequency = function(x) {
-      if (!arguments.length) return frequency;
-      frequency = !!x;
-      return histogram;
-    };
-    return histogram;
-  };
-  function d3_layout_histogramBinSturges(range, values) {
-    return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1));
-  }
-  function d3_layout_histogramBinFixed(range, n) {
-    var x = -1, b = +range[0], m = (range[1] - b) / n, f = [];
-    while (++x <= n) f[x] = m * x + b;
-    return f;
-  }
-  function d3_layout_histogramRange(values) {
-    return [ d3.min(values), d3.max(values) ];
-  }
-  d3.layout.pack = function() {
-    var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius;
-    function pack(d, i) {
-      var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() {
-        return radius;
-      };
-      root.x = root.y = 0;
-      d3_layout_hierarchyVisitAfter(root, function(d) {
-        d.r = +r(d.value);
-      });
-      d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
-      if (padding) {
-        var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2;
-        d3_layout_hierarchyVisitAfter(root, function(d) {
-          d.r += dr;
-        });
-        d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
-        d3_layout_hierarchyVisitAfter(root, function(d) {
-          d.r -= dr;
-        });
-      }
-      d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h));
-      return nodes;
-    }
-    pack.size = function(_) {
-      if (!arguments.length) return size;
-      size = _;
-      return pack;
-    };
-    pack.radius = function(_) {
-      if (!arguments.length) return radius;
-      radius = _ == null || typeof _ === "function" ? _ : +_;
-      return pack;
-    };
-    pack.padding = function(_) {
-      if (!arguments.length) return padding;
-      padding = +_;
-      return pack;
-    };
-    return d3_layout_hierarchyRebind(pack, hierarchy);
-  };
-  function d3_layout_packSort(a, b) {
-    return a.value - b.value;
-  }
-  function d3_layout_packInsert(a, b) {
-    var c = a._pack_next;
-    a._pack_next = b;
-    b._pack_prev = a;
-    b._pack_next = c;
-    c._pack_prev = b;
-  }
-  function d3_layout_packSplice(a, b) {
-    a._pack_next = b;
-    b._pack_prev = a;
-  }
-  function d3_layout_packIntersects(a, b) {
-    var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r;
-    return .999 * dr * dr > dx * dx + dy * dy;
-  }
-  function d3_layout_packSiblings(node) {
-    if (!(nodes = node.children) || !(n = nodes.length)) return;
-    var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n;
-    function bound(node) {
-      xMin = Math.min(node.x - node.r, xMin);
-      xMax = Math.max(node.x + node.r, xMax);
-      yMin = Math.min(node.y - node.r, yMin);
-      yMax = Math.max(node.y + node.r, yMax);
-    }
-    nodes.forEach(d3_layout_packLink);
-    a = nodes[0];
-    a.x = -a.r;
-    a.y = 0;
-    bound(a);
-    if (n > 1) {
-      b = nodes[1];
-      b.x = b.r;
-      b.y = 0;
-      bound(b);
-      if (n > 2) {
-        c = nodes[2];
-        d3_layout_packPlace(a, b, c);
-        bound(c);
-        d3_layout_packInsert(a, c);
-        a._pack_prev = c;
-        d3_layout_packInsert(c, b);
-        b = a._pack_next;
-        for (i = 3; i < n; i++) {
-          d3_layout_packPlace(a, b, c = nodes[i]);
-          var isect = 0, s1 = 1, s2 = 1;
-          for (j = b._pack_next; j !== b; j = j._pack_next, s1++) {
-            if (d3_layout_packIntersects(j, c)) {
-              isect = 1;
-              break;
-            }
-          }
-          if (isect == 1) {
-            for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {
-              if (d3_layout_packIntersects(k, c)) {
-                break;
-              }
-            }
-          }
-          if (isect) {
-            if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b);
-            i--;
-          } else {
-            d3_layout_packInsert(a, c);
-            b = c;
-            bound(c);
-          }
-        }
-      }
-    }
-    var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0;
-    for (i = 0; i < n; i++) {
-      c = nodes[i];
-      c.x -= cx;
-      c.y -= cy;
-      cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y));
-    }
-    node.r = cr;
-    nodes.forEach(d3_layout_packUnlink);
-  }
-  function d3_layout_packLink(node) {
-    node._pack_next = node._pack_prev = node;
-  }
-  function d3_layout_packUnlink(node) {
-    delete node._pack_next;
-    delete node._pack_prev;
-  }
-  function d3_layout_packTransform(node, x, y, k) {
-    var children = node.children;
-    node.x = x += k * node.x;
-    node.y = y += k * node.y;
-    node.r *= k;
-    if (children) {
-      var i = -1, n = children.length;
-      while (++i < n) d3_layout_packTransform(children[i], x, y, k);
-    }
-  }
-  function d3_layout_packPlace(a, b, c) {
-    var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y;
-    if (db && (dx || dy)) {
-      var da = b.r + c.r, dc = dx * dx + dy * dy;
-      da *= da;
-      db *= db;
-      var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc);
-      c.x = a.x + x * dx + y * dy;
-      c.y = a.y + x * dy - y * dx;
-    } else {
-      c.x = a.x + db;
-      c.y = a.y;
-    }
-  }
-  d3.layout.tree = function() {
-    var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null;
-    function tree(d, i) {
-      var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0);
-      d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z;
-      d3_layout_hierarchyVisitBefore(root1, secondWalk);
-      if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else {
-        var left = root0, right = root0, bottom = root0;
-        d3_layout_hierarchyVisitBefore(root0, function(node) {
-          if (node.x < left.x) left = node;
-          if (node.x > right.x) right = node;
-          if (node.depth > bottom.depth) bottom = node;
-        });
-        var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1);
-        d3_layout_hierarchyVisitBefore(root0, function(node) {
-          node.x = (node.x + tx) * kx;
-          node.y = node.depth * ky;
-        });
-      }
-      return nodes;
-    }
-    function wrapTree(root0) {
-      var root1 = {
-        A: null,
-        children: [ root0 ]
-      }, queue = [ root1 ], node1;
-      while ((node1 = queue.pop()) != null) {
-        for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) {
-          queue.push((children[i] = child = {
-            _: children[i],
-            parent: node1,
-            children: (child = children[i].children) && child.slice() || [],
-            A: null,
-            a: null,
-            z: 0,
-            m: 0,
-            c: 0,
-            s: 0,
-            t: null,
-            i: i
-          }).a = child);
-        }
-      }
-      return root1.children[0];
-    }
-    function firstWalk(v) {
-      var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;
-      if (children.length) {
-        d3_layout_treeShift(v);
-        var midpoint = (children[0].z + children[children.length - 1].z) / 2;
-        if (w) {
-          v.z = w.z + separation(v._, w._);
-          v.m = v.z - midpoint;
-        } else {
-          v.z = midpoint;
-        }
-      } else if (w) {
-        v.z = w.z + separation(v._, w._);
-      }
-      v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
-    }
-    function secondWalk(v) {
-      v._.x = v.z + v.parent.m;
-      v.m += v.parent.m;
-    }
-    function apportion(v, w, ancestor) {
-      if (w) {
-        var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;
-        while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {
-          vom = d3_layout_treeLeft(vom);
-          vop = d3_layout_treeRight(vop);
-          vop.a = v;
-          shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
-          if (shift > 0) {
-            d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift);
-            sip += shift;
-            sop += shift;
-          }
-          sim += vim.m;
-          sip += vip.m;
-          som += vom.m;
-          sop += vop.m;
-        }
-        if (vim && !d3_layout_treeRight(vop)) {
-          vop.t = vim;
-          vop.m += sim - sop;
-        }
-        if (vip && !d3_layout_treeLeft(vom)) {
-          vom.t = vip;
-          vom.m += sip - som;
-          ancestor = v;
-        }
-      }
-      return ancestor;
-    }
-    function sizeNode(node) {
-      node.x *= size[0];
-      node.y = node.depth * size[1];
-    }
-    tree.separation = function(x) {
-      if (!arguments.length) return separation;
-      separation = x;
-      return tree;
-    };
-    tree.size = function(x) {
-      if (!arguments.length) return nodeSize ? null : size;
-      nodeSize = (size = x) == null ? sizeNode : null;
-      return tree;
-    };
-    tree.nodeSize = function(x) {
-      if (!arguments.length) return nodeSize ? size : null;
-      nodeSize = (size = x) == null ? null : sizeNode;
-      return tree;
-    };
-    return d3_layout_hierarchyRebind(tree, hierarchy);
-  };
-  function d3_layout_treeSeparation(a, b) {
-    return a.parent == b.parent ? 1 : 2;
-  }
-  function d3_layout_treeLeft(v) {
-    var children = v.children;
-    return children.length ? children[0] : v.t;
-  }
-  function d3_layout_treeRight(v) {
-    var children = v.children, n;
-    return (n = children.length) ? children[n - 1] : v.t;
-  }
-  function d3_layout_treeMove(wm, wp, shift) {
-    var change = shift / (wp.i - wm.i);
-    wp.c -= change;
-    wp.s += shift;
-    wm.c += change;
-    wp.z += shift;
-    wp.m += shift;
-  }
-  function d3_layout_treeShift(v) {
-    var shift = 0, change = 0, children = v.children, i = children.length, w;
-    while (--i >= 0) {
-      w = children[i];
-      w.z += shift;
-      w.m += shift;
-      shift += w.s + (change += w.c);
-    }
-  }
-  function d3_layout_treeAncestor(vim, v, ancestor) {
-    return vim.a.parent === v.parent ? vim.a : ancestor;
-  }
-  d3.layout.cluster = function() {
-    var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false;
-    function cluster(d, i) {
-      var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0;
-      d3_layout_hierarchyVisitAfter(root, function(node) {
-        var children = node.children;
-        if (children && children.length) {
-          node.x = d3_layout_clusterX(children);
-          node.y = d3_layout_clusterY(children);
-        } else {
-          node.x = previousNode ? x += separation(node, previousNode) : 0;
-          node.y = 0;
-          previousNode = node;
-        }
-      });
-      var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2;
-      d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) {
-        node.x = (node.x - root.x) * size[0];
-        node.y = (root.y - node.y) * size[1];
-      } : function(node) {
-        node.x = (node.x - x0) / (x1 - x0) * size[0];
-        node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1];
-      });
-      return nodes;
-    }
-    cluster.separation = function(x) {
-      if (!arguments.length) return separation;
-      separation = x;
-      return cluster;
-    };
-    cluster.size = function(x) {
-      if (!arguments.length) return nodeSize ? null : size;
-      nodeSize = (size = x) == null;
-      return cluster;
-    };
-    cluster.nodeSize = function(x) {
-      if (!arguments.length) return nodeSize ? size : null;
-      nodeSize = (size = x) != null;
-      return cluster;
-    };
-    return d3_layout_hierarchyRebind(cluster, hierarchy);
-  };
-  function d3_layout_clusterY(children) {
-    return 1 + d3.max(children, function(child) {
-      return child.y;
-    });
-  }
-  function d3_layout_clusterX(children) {
-    return children.reduce(function(x, child) {
-      return x + child.x;
-    }, 0) / children.length;
-  }
-  function d3_layout_clusterLeft(node) {
-    var children = node.children;
-    return children && children.length ? d3_layout_clusterLeft(children[0]) : node;
-  }
-  function d3_layout_clusterRight(node) {
-    var children = node.children, n;
-    return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node;
-  }
-  d3.layout.treemap = function() {
-    var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5));
-    function scale(children, k) {
-      var i = -1, n = children.length, child, area;
-      while (++i < n) {
-        area = (child = children[i]).value * (k < 0 ? 0 : k);
-        child.area = isNaN(area) || area <= 0 ? 0 : area;
-      }
-    }
-    function squarify(node) {
-      var children = node.children;
-      if (children && children.length) {
-        var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n;
-        scale(remaining, rect.dx * rect.dy / node.value);
-        row.area = 0;
-        while ((n = remaining.length) > 0) {
-          row.push(child = remaining[n - 1]);
-          row.area += child.area;
-          if (mode !== "squarify" || (score = worst(row, u)) <= best) {
-            remaining.pop();
-            best = score;
-          } else {
-            row.area -= row.pop().area;
-            position(row, u, rect, false);
-            u = Math.min(rect.dx, rect.dy);
-            row.length = row.area = 0;
-            best = Infinity;
-          }
-        }
-        if (row.length) {
-          position(row, u, rect, true);
-          row.length = row.area = 0;
-        }
-        children.forEach(squarify);
-      }
-    }
-    function stickify(node) {
-      var children = node.children;
-      if (children && children.length) {
-        var rect = pad(node), remaining = children.slice(), child, row = [];
-        scale(remaining, rect.dx * rect.dy / node.value);
-        row.area = 0;
-        while (child = remaining.pop()) {
-          row.push(child);
-          row.area += child.area;
-          if (child.z != null) {
-            position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length);
-            row.length = row.area = 0;
-          }
-        }
-        children.forEach(stickify);
-      }
-    }
-    function worst(row, u) {
-      var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length;
-      while (++i < n) {
-        if (!(r = row[i].area)) continue;
-        if (r < rmin) rmin = r;
-        if (r > rmax) rmax = r;
-      }
-      s *= s;
-      u *= u;
-      return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity;
-    }
-    function position(row, u, rect, flush) {
-      var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o;
-      if (u == rect.dx) {
-        if (flush || v > rect.dy) v = rect.dy;
-        while (++i < n) {
-          o = row[i];
-          o.x = x;
-          o.y = y;
-          o.dy = v;
-          x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0);
-        }
-        o.z = true;
-        o.dx += rect.x + rect.dx - x;
-        rect.y += v;
-        rect.dy -= v;
-      } else {
-        if (flush || v > rect.dx) v = rect.dx;
-        while (++i < n) {
-          o = row[i];
-          o.x = x;
-          o.y = y;
-          o.dx = v;
-          y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0);
-        }
-        o.z = false;
-        o.dy += rect.y + rect.dy - y;
-        rect.x += v;
-        rect.dx -= v;
-      }
-    }
-    function treemap(d) {
-      var nodes = stickies || hierarchy(d), root = nodes[0];
-      root.x = root.y = 0;
-      if (root.value) root.dx = size[0], root.dy = size[1]; else root.dx = root.dy = 0;
-      if (stickies) hierarchy.revalue(root);
-      scale([ root ], root.dx * root.dy / root.value);
-      (stickies ? stickify : squarify)(root);
-      if (sticky) stickies = nodes;
-      return nodes;
-    }
-    treemap.size = function(x) {
-      if (!arguments.length) return size;
-      size = x;
-      return treemap;
-    };
-    treemap.padding = function(x) {
-      if (!arguments.length) return padding;
-      function padFunction(node) {
-        var p = x.call(treemap, node, node.depth);
-        return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p);
-      }
-      function padConstant(node) {
-        return d3_layout_treemapPad(node, x);
-      }
-      var type;
-      pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ], 
-      padConstant) : padConstant;
-      return treemap;
-    };
-    treemap.round = function(x) {
-      if (!arguments.length) return round != Number;
-      round = x ? Math.round : Number;
-      return treemap;
-    };
-    treemap.sticky = function(x) {
-      if (!arguments.length) return sticky;
-      sticky = x;
-      stickies = null;
-      return treemap;
-    };
-    treemap.ratio = function(x) {
-      if (!arguments.length) return ratio;
-      ratio = x;
-      return treemap;
-    };
-    treemap.mode = function(x) {
-      if (!arguments.length) return mode;
-      mode = x + "";
-      return treemap;
-    };
-    return d3_layout_hierarchyRebind(treemap, hierarchy);
-  };
-  function d3_layout_treemapPadNull(node) {
-    return {
-      x: node.x,
-      y: node.y,
-      dx: node.dx,
-      dy: node.dy
-    };
-  }
-  function d3_layout_treemapPad(node, padding) {
-    var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2];
-    if (dx < 0) {
-      x += dx / 2;
-      dx = 0;
-    }
-    if (dy < 0) {
-      y += dy / 2;
-      dy = 0;
-    }
-    return {
-      x: x,
-      y: y,
-      dx: dx,
-      dy: dy
-    };
-  }
-  d3.random = {
-    normal: function(µ, σ) {
-      var n = arguments.length;
-      if (n < 2) σ = 1;
-      if (n < 1) µ = 0;
-      return function() {
-        var x, y, r;
-        do {
-          x = Math.random() * 2 - 1;
-          y = Math.random() * 2 - 1;
-          r = x * x + y * y;
-        } while (!r || r > 1);
-        return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
-      };
-    },
-    logNormal: function() {
-      var random = d3.random.normal.apply(d3, arguments);
-      return function() {
-        return Math.exp(random());
-      };
-    },
-    bates: function(m) {
-      var random = d3.random.irwinHall(m);
-      return function() {
-        return random() / m;
-      };
-    },
-    irwinHall: function(m) {
-      return function() {
-        for (var s = 0, j = 0; j < m; j++) s += Math.random();
-        return s;
-      };
-    }
-  };
-  d3.scale = {};
-  function d3_scaleExtent(domain) {
-    var start = domain[0], stop = domain[domain.length - 1];
-    return start < stop ? [ start, stop ] : [ stop, start ];
-  }
-  function d3_scaleRange(scale) {
-    return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());
-  }
-  function d3_scale_bilinear(domain, range, uninterpolate, interpolate) {
-    var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]);
-    return function(x) {
-      return i(u(x));
-    };
-  }
-  function d3_scale_nice(domain, nice) {
-    var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx;
-    if (x1 < x0) {
-      dx = i0, i0 = i1, i1 = dx;
-      dx = x0, x0 = x1, x1 = dx;
-    }
-    domain[i0] = nice.floor(x0);
-    domain[i1] = nice.ceil(x1);
-    return domain;
-  }
-  function d3_scale_niceStep(step) {
-    return step ? {
-      floor: function(x) {
-        return Math.floor(x / step) * step;
-      },
-      ceil: function(x) {
-        return Math.ceil(x / step) * step;
-      }
-    } : d3_scale_niceIdentity;
-  }
-  var d3_scale_niceIdentity = {
-    floor: d3_identity,
-    ceil: d3_identity
-  };
-  function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {
-    var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1;
-    if (domain[k] < domain[0]) {
-      domain = domain.slice().reverse();
-      range = range.slice().reverse();
-    }
-    while (++j <= k) {
-      u.push(uninterpolate(domain[j - 1], domain[j]));
-      i.push(interpolate(range[j - 1], range[j]));
-    }
-    return function(x) {
-      var j = d3.bisect(domain, x, 1, k) - 1;
-      return i[j](u[j](x));
-    };
-  }
-  d3.scale.linear = function() {
-    return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false);
-  };
-  function d3_scale_linear(domain, range, interpolate, clamp) {
-    var output, input;
-    function rescale() {
-      var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber;
-      output = linear(domain, range, uninterpolate, interpolate);
-      input = linear(range, domain, uninterpolate, d3_interpolate);
-      return scale;
-    }
-    function scale(x) {
-      return output(x);
-    }
-    scale.invert = function(y) {
-      return input(y);
-    };
-    scale.domain = function(x) {
-      if (!arguments.length) return domain;
-      domain = x.map(Number);
-      return rescale();
-    };
-    scale.range = function(x) {
-      if (!arguments.length) return range;
-      range = x;
-      return rescale();
-    };
-    scale.rangeRound = function(x) {
-      return scale.range(x).interpolate(d3_interpolateRound);
-    };
-    scale.clamp = function(x) {
-      if (!arguments.length) return clamp;
-      clamp = x;
-      return rescale();
-    };
-    scale.interpolate = function(x) {
-      if (!arguments.length) return interpolate;
-      interpolate = x;
-      return rescale();
-    };
-    scale.ticks = function(m) {
-      return d3_scale_linearTicks(domain, m);
-    };
-    scale.tickFormat = function(m, format) {
-      return d3_scale_linearTickFormat(domain, m, format);
-    };
-    scale.nice = function(m) {
-      d3_scale_linearNice(domain, m);
-      return rescale();
-    };
-    scale.copy = function() {
-      return d3_scale_linear(domain, range, interpolate, clamp);
-    };
-    return rescale();
-  }
-  function d3_scale_linearRebind(scale, linear) {
-    return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp");
-  }
-  function d3_scale_linearNice(domain, m) {
-    d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
-    d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
-    return domain;
-  }
-  function d3_scale_linearTickRange(domain, m) {
-    if (m == null) m = 10;
-    var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step;
-    if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2;
-    extent[0] = Math.ceil(extent[0] / step) * step;
-    extent[1] = Math.floor(extent[1] / step) * step + step * .5;
-    extent[2] = step;
-    return extent;
-  }
-  function d3_scale_linearTicks(domain, m) {
-    return d3.range.apply(d3, d3_scale_linearTickRange(domain, m));
-  }
-  function d3_scale_linearTickFormat(domain, m, format) {
-    var range = d3_scale_linearTickRange(domain, m);
-    if (format) {
-      var match = d3_format_re.exec(format);
-      match.shift();
-      if (match[8] === "s") {
-        var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1])));
-        if (!match[7]) match[7] = "." + d3_scale_linearPrecision(prefix.scale(range[2]));
-        match[8] = "f";
-        format = d3.format(match.join(""));
-        return function(d) {
-          return format(prefix.scale(d)) + prefix.symbol;
-        };
-      }
-      if (!match[7]) match[7] = "." + d3_scale_linearFormatPrecision(match[8], range);
-      format = match.join("");
-    } else {
-      format = ",." + d3_scale_linearPrecision(range[2]) + "f";
-    }
-    return d3.format(format);
-  }
-  var d3_scale_linearFormatSignificant = {
-    s: 1,
-    g: 1,
-    p: 1,
-    r: 1,
-    e: 1
-  };
-  function d3_scale_linearPrecision(value) {
-    return -Math.floor(Math.log(value) / Math.LN10 + .01);
-  }
-  function d3_scale_linearFormatPrecision(type, range) {
-    var p = d3_scale_linearPrecision(range[2]);
-    return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2;
-  }
-  d3.scale.log = function() {
-    return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]);
-  };
-  function d3_scale_log(linear, base, positive, domain) {
-    function log(x) {
-      return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base);
-    }
-    function pow(x) {
-      return positive ? Math.pow(base, x) : -Math.pow(base, -x);
-    }
-    function scale(x) {
-      return linear(log(x));
-    }
-    scale.invert = function(x) {
-      return pow(linear.invert(x));
-    };
-    scale.domain = function(x) {
-      if (!arguments.length) return domain;
-      positive = x[0] >= 0;
-      linear.domain((domain = x.map(Number)).map(log));
-      return scale;
-    };
-    scale.base = function(_) {
-      if (!arguments.length) return base;
-      base = +_;
-      linear.domain(domain.map(log));
-      return scale;
-    };
-    scale.nice = function() {
-      var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative);
-      linear.domain(niced);
-      domain = niced.map(pow);
-      return scale;
-    };
-    scale.ticks = function() {
-      var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base;
-      if (isFinite(j - i)) {
-        if (positive) {
-          for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k);
-          ticks.push(pow(i));
-        } else {
-          ticks.push(pow(i));
-          for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k);
-        }
-        for (i = 0; ticks[i] < u; i++) {}
-        for (j = ticks.length; ticks[j - 1] > v; j--) {}
-        ticks = ticks.slice(i, j);
-      }
-      return ticks;
-    };
-    scale.tickFormat = function(n, format) {
-      if (!arguments.length) return d3_scale_logFormat;
-      if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format);
-      var k = Math.max(1, base * n / scale.ticks().length);
-      return function(d) {
-        var i = d / pow(Math.round(log(d)));
-        if (i * base < base - .5) i *= base;
-        return i <= k ? format(d) : "";
-      };
-    };
-    scale.copy = function() {
-      return d3_scale_log(linear.copy(), base, positive, domain);
-    };
-    return d3_scale_linearRebind(scale, linear);
-  }
-  var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = {
-    floor: function(x) {
-      return -Math.ceil(-x);
-    },
-    ceil: function(x) {
-      return -Math.floor(-x);
-    }
-  };
-  d3.scale.pow = function() {
-    return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]);
-  };
-  function d3_scale_pow(linear, exponent, domain) {
-    var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent);
-    function scale(x) {
-      return linear(powp(x));
-    }
-    scale.invert = function(x) {
-      return powb(linear.invert(x));
-    };
-    scale.domain = function(x) {
-      if (!arguments.length) return domain;
-      linear.domain((domain = x.map(Number)).map(powp));
-      return scale;
-    };
-    scale.ticks = function(m) {
-      return d3_scale_linearTicks(domain, m);
-    };
-    scale.tickFormat = function(m, format) {
-      return d3_scale_linearTickFormat(domain, m, format);
-    };
-    scale.nice = function(m) {
-      return scale.domain(d3_scale_linearNice(domain, m));
-    };
-    scale.exponent = function(x) {
-      if (!arguments.length) return exponent;
-      powp = d3_scale_powPow(exponent = x);
-      powb = d3_scale_powPow(1 / exponent);
-      linear.domain(domain.map(powp));
-      return scale;
-    };
-    scale.copy = function() {
-      return d3_scale_pow(linear.copy(), exponent, domain);
-    };
-    return d3_scale_linearRebind(scale, linear);
-  }
-  function d3_scale_powPow(e) {
-    return function(x) {
-      return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e);
-    };
-  }
-  d3.scale.sqrt = function() {
-    return d3.scale.pow().exponent(.5);
-  };
-  d3.scale.ordinal = function() {
-    return d3_scale_ordinal([], {
-      t: "range",
-      a: [ [] ]
-    });
-  };
-  function d3_scale_ordinal(domain, ranger) {
-    var index, range, rangeBand;
-    function scale(x) {
-      return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length];
-    }
-    function steps(start, step) {
-      return d3.range(domain.length).map(function(i) {
-        return start + step * i;
-      });
-    }
-    scale.domain = function(x) {
-      if (!arguments.length) return domain;
-      domain = [];
-      index = new d3_Map();
-      var i = -1, n = x.length, xi;
-      while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi));
-      return scale[ranger.t].apply(scale, ranger.a);
-    };
-    scale.range = function(x) {
-      if (!arguments.length) return range;
-      range = x;
-      rangeBand = 0;
-      ranger = {
-        t: "range",
-        a: arguments
-      };
-      return scale;
-    };
-    scale.rangePoints = function(x, padding) {
-      if (arguments.length < 2) padding = 0;
-      var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2, 
-      0) : (stop - start) / (domain.length - 1 + padding);
-      range = steps(start + step * padding / 2, step);
-      rangeBand = 0;
-      ranger = {
-        t: "rangePoints",
-        a: arguments
-      };
-      return scale;
-    };
-    scale.rangeRoundPoints = function(x, padding) {
-      if (arguments.length < 2) padding = 0;
-      var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2), 
-      0) : (stop - start) / (domain.length - 1 + padding) | 0;
-      range = steps(start + Math.round(step * padding / 2 + (stop - start - (domain.length - 1 + padding) * step) / 2), step);
-      rangeBand = 0;
-      ranger = {
-        t: "rangeRoundPoints",
-        a: arguments
-      };
-      return scale;
-    };
-    scale.rangeBands = function(x, padding, outerPadding) {
-      if (arguments.length < 2) padding = 0;
-      if (arguments.length < 3) outerPadding = padding;
-      var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding);
-      range = steps(start + step * outerPadding, step);
-      if (reverse) range.reverse();
-      rangeBand = step * (1 - padding);
-      ranger = {
-        t: "rangeBands",
-        a: arguments
-      };
-      return scale;
-    };
-    scale.rangeRoundBands = function(x, padding, outerPadding) {
-      if (arguments.length < 2) padding = 0;
-      if (arguments.length < 3) outerPadding = padding;
-      var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding));
-      range = steps(start + Math.round((stop - start - (domain.length - padding) * step) / 2), step);
-      if (reverse) range.reverse();
-      rangeBand = Math.round(step * (1 - padding));
-      ranger = {
-        t: "rangeRoundBands",
-        a: arguments
-      };
-      return scale;
-    };
-    scale.rangeBand = function() {
-      return rangeBand;
-    };
-    scale.rangeExtent = function() {
-      return d3_scaleExtent(ranger.a[0]);
-    };
-    scale.copy = function() {
-      return d3_scale_ordinal(domain, ranger);
-    };
-    return scale.domain(domain);
-  }
-  d3.scale.category10 = function() {
-    return d3.scale.ordinal().range(d3_category10);
-  };
-  d3.scale.category20 = function() {
-    return d3.scale.ordinal().range(d3_category20);
-  };
-  d3.scale.category20b = function() {
-    return d3.scale.ordinal().range(d3_category20b);
-  };
-  d3.scale.category20c = function() {
-    return d3.scale.ordinal().range(d3_category20c);
-  };
-  var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString);
-  var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString);
-  var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString);
-  var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString);
-  d3.scale.quantile = function() {
-    return d3_scale_quantile([], []);
-  };
-  function d3_scale_quantile(domain, range) {
-    var thresholds;
-    function rescale() {
-      var k = 0, q = range.length;
-      thresholds = [];
-      while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);
-      return scale;
-    }
-    function scale(x) {
-      if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)];
-    }
-    scale.domain = function(x) {
-      if (!arguments.length) return domain;
-      domain = x.map(d3_number).filter(d3_numeric).sort(d3_ascending);
-      return rescale();
-    };
-    scale.range = function(x) {
-      if (!arguments.length) return range;
-      range = x;
-      return rescale();
-    };
-    scale.quantiles = function() {
-      return thresholds;
-    };
-    scale.invertExtent = function(y) {
-      y = range.indexOf(y);
-      return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ];
-    };
-    scale.copy = function() {
-      return d3_scale_quantile(domain, range);
-    };
-    return rescale();
-  }
-  d3.scale.quantize = function() {
-    return d3_scale_quantize(0, 1, [ 0, 1 ]);
-  };
-  function d3_scale_quantize(x0, x1, range) {
-    var kx, i;
-    function scale(x) {
-      return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))];
-    }
-    function rescale() {
-      kx = range.length / (x1 - x0);
-      i = range.length - 1;
-      return scale;
-    }
-    scale.domain = function(x) {
-      if (!arguments.length) return [ x0, x1 ];
-      x0 = +x[0];
-      x1 = +x[x.length - 1];
-      return rescale();
-    };
-    scale.range = function(x) {
-      if (!arguments.length) return range;
-      range = x;
-      return rescale();
-    };
-    scale.invertExtent = function(y) {
-      y = range.indexOf(y);
-      y = y < 0 ? NaN : y / kx + x0;
-      return [ y, y + 1 / kx ];
-    };
-    scale.copy = function() {
-      return d3_scale_quantize(x0, x1, range);
-    };
-    return rescale();
-  }
-  d3.scale.threshold = function() {
-    return d3_scale_threshold([ .5 ], [ 0, 1 ]);
-  };
-  function d3_scale_threshold(domain, range) {
-    function scale(x) {
-      if (x <= x) return range[d3.bisect(domain, x)];
-    }
-    scale.domain = function(_) {
-      if (!arguments.length) return domain;
-      domain = _;
-      return scale;
-    };
-    scale.range = function(_) {
-      if (!arguments.length) return range;
-      range = _;
-      return scale;
-    };
-    scale.invertExtent = function(y) {
-      y = range.indexOf(y);
-      return [ domain[y - 1], domain[y] ];
-    };
-    scale.copy = function() {
-      return d3_scale_threshold(domain, range);
-    };
-    return scale;
-  }
-  d3.scale.identity = function() {
-    return d3_scale_identity([ 0, 1 ]);
-  };
-  function d3_scale_identity(domain) {
-    function identity(x) {
-      return +x;
-    }
-    identity.invert = identity;
-    identity.domain = identity.range = function(x) {
-      if (!arguments.length) return domain;
-      domain = x.map(identity);
-      return identity;
-    };
-    identity.ticks = function(m) {
-      return d3_scale_linearTicks(domain, m);
-    };
-    identity.tickFormat = function(m, format) {
-      return d3_scale_linearTickFormat(domain, m, format);
-    };
-    identity.copy = function() {
-      return d3_scale_identity(domain);
-    };
-    return identity;
-  }
-  d3.svg = {};
-  function d3_zero() {
-    return 0;
-  }
-  d3.svg.arc = function() {
-    var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, cornerRadius = d3_zero, padRadius = d3_svg_arcAuto, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle, padAngle = d3_svg_arcPadAngle;
-    function arc() {
-      var r0 = Math.max(0, +innerRadius.apply(this, arguments)), r1 = Math.max(0, +outerRadius.apply(this, arguments)), a0 = startAngle.apply(this, arguments) - halfπ, a1 = endAngle.apply(this, arguments) - halfπ, da = Math.abs(a1 - a0), cw = a0 > a1 ? 0 : 1;
-      if (r1 < r0) rc = r1, r1 = r0, r0 = rc;
-      if (da >= τε) return circleSegment(r1, cw) + (r0 ? circleSegment(r0, 1 - cw) : "") + "Z";
-      var rc, cr, rp, ap, p0 = 0, p1 = 0, x0, y0, x1, y1, x2, y2, x3, y3, path = [];
-      if (ap = (+padAngle.apply(this, arguments) || 0) / 2) {
-        rp = padRadius === d3_svg_arcAuto ? Math.sqrt(r0 * r0 + r1 * r1) : +padRadius.apply(this, arguments);
-        if (!cw) p1 *= -1;
-        if (r1) p1 = d3_asin(rp / r1 * Math.sin(ap));
-        if (r0) p0 = d3_asin(rp / r0 * Math.sin(ap));
-      }
-      if (r1) {
-        x0 = r1 * Math.cos(a0 + p1);
-        y0 = r1 * Math.sin(a0 + p1);
-        x1 = r1 * Math.cos(a1 - p1);
-        y1 = r1 * Math.sin(a1 - p1);
-        var l1 = Math.abs(a1 - a0 - 2 * p1) <= π ? 0 : 1;
-        if (p1 && d3_svg_arcSweep(x0, y0, x1, y1) === cw ^ l1) {
-          var h1 = (a0 + a1) / 2;
-          x0 = r1 * Math.cos(h1);
-          y0 = r1 * Math.sin(h1);
-          x1 = y1 = null;
-        }
-      } else {
-        x0 = y0 = 0;
-      }
-      if (r0) {
-        x2 = r0 * Math.cos(a1 - p0);
-        y2 = r0 * Math.sin(a1 - p0);
-        x3 = r0 * Math.cos(a0 + p0);
-        y3 = r0 * Math.sin(a0 + p0);
-        var l0 = Math.abs(a0 - a1 + 2 * p0) <= π ? 0 : 1;
-        if (p0 && d3_svg_arcSweep(x2, y2, x3, y3) === 1 - cw ^ l0) {
-          var h0 = (a0 + a1) / 2;
-          x2 = r0 * Math.cos(h0);
-          y2 = r0 * Math.sin(h0);
-          x3 = y3 = null;
-        }
-      } else {
-        x2 = y2 = 0;
-      }
-      if (da > ε && (rc = Math.min(Math.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments))) > .001) {
-        cr = r0 < r1 ^ cw ? 0 : 1;
-        var rc1 = rc, rc0 = rc;
-        if (da < π) {
-          var oc = x3 == null ? [ x2, y2 ] : x1 == null ? [ x0, y0 ] : d3_geom_polygonIntersect([ x0, y0 ], [ x3, y3 ], [ x1, y1 ], [ x2, y2 ]), ax = x0 - oc[0], ay = y0 - oc[1], bx = x1 - oc[0], by = y1 - oc[1], kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2), lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
-          rc0 = Math.min(rc, (r0 - lc) / (kc - 1));
-          rc1 = Math.min(rc, (r1 - lc) / (kc + 1));
-        }
-        if (x1 != null) {
-          var t30 = d3_svg_arcCornerTangents(x3 == null ? [ x2, y2 ] : [ x3, y3 ], [ x0, y0 ], r1, rc1, cw), t12 = d3_svg_arcCornerTangents([ x1, y1 ], [ x2, y2 ], r1, rc1, cw);
-          if (rc === rc1) {
-            path.push("M", t30[0], "A", rc1, ",", rc1, " 0 0,", cr, " ", t30[1], "A", r1, ",", r1, " 0 ", 1 - cw ^ d3_svg_arcSweep(t30[1][0], t30[1][1], t12[1][0], t12[1][1]), ",", cw, " ", t12[1], "A", rc1, ",", rc1, " 0 0,", cr, " ", t12[0]);
-          } else {
-            path.push("M", t30[0], "A", rc1, ",", rc1, " 0 1,", cr, " ", t12[0]);
-          }
-        } else {
-          path.push("M", x0, ",", y0);
-        }
-        if (x3 != null) {
-          var t03 = d3_svg_arcCornerTangents([ x0, y0 ], [ x3, y3 ], r0, -rc0, cw), t21 = d3_svg_arcCornerTangents([ x2, y2 ], x1 == null ? [ x0, y0 ] : [ x1, y1 ], r0, -rc0, cw);
-          if (rc === rc0) {
-            path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t21[1], "A", r0, ",", r0, " 0 ", cw ^ d3_svg_arcSweep(t21[1][0], t21[1][1], t03[1][0], t03[1][1]), ",", 1 - cw, " ", t03[1], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]);
-          } else {
-            path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]);
-          }
-        } else {
-          path.push("L", x2, ",", y2);
-        }
-      } else {
-        path.push("M", x0, ",", y0);
-        if (x1 != null) path.push("A", r1, ",", r1, " 0 ", l1, ",", cw, " ", x1, ",", y1);
-        path.push("L", x2, ",", y2);
-        if (x3 != null) path.push("A", r0, ",", r0, " 0 ", l0, ",", 1 - cw, " ", x3, ",", y3);
-      }
-      path.push("Z");
-      return path.join("");
-    }
-    function circleSegment(r1, cw) {
-      return "M0," + r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + -r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + r1;
-    }
-    arc.innerRadius = function(v) {
-      if (!arguments.length) return innerRadius;
-      innerRadius = d3_functor(v);
-      return arc;
-    };
-    arc.outerRadius = function(v) {
-      if (!arguments.length) return outerRadius;
-      outerRadius = d3_functor(v);
-      return arc;
-    };
-    arc.cornerRadius = function(v) {
-      if (!arguments.length) return cornerRadius;
-      cornerRadius = d3_functor(v);
-      return arc;
-    };
-    arc.padRadius = function(v) {
-      if (!arguments.length) return padRadius;
-      padRadius = v == d3_svg_arcAuto ? d3_svg_arcAuto : d3_functor(v);
-      return arc;
-    };
-    arc.startAngle = function(v) {
-      if (!arguments.length) return startAngle;
-      startAngle = d3_functor(v);
-      return arc;
-    };
-    arc.endAngle = function(v) {
-      if (!arguments.length) return endAngle;
-      endAngle = d3_functor(v);
-      return arc;
-    };
-    arc.padAngle = function(v) {
-      if (!arguments.length) return padAngle;
-      padAngle = d3_functor(v);
-      return arc;
-    };
-    arc.centroid = function() {
-      var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - halfπ;
-      return [ Math.cos(a) * r, Math.sin(a) * r ];
-    };
-    return arc;
-  };
-  var d3_svg_arcAuto = "auto";
-  function d3_svg_arcInnerRadius(d) {
-    return d.innerRadius;
-  }
-  function d3_svg_arcOuterRadius(d) {
-    return d.outerRadius;
-  }
-  function d3_svg_arcStartAngle(d) {
-    return d.startAngle;
-  }
-  function d3_svg_arcEndAngle(d) {
-    return d.endAngle;
-  }
-  function d3_svg_arcPadAngle(d) {
-    return d && d.padAngle;
-  }
-  function d3_svg_arcSweep(x0, y0, x1, y1) {
-    return (x0 - x1) * y0 - (y0 - y1) * x0 > 0 ? 0 : 1;
-  }
-  function d3_svg_arcCornerTangents(p0, p1, r1, rc, cw) {
-    var x01 = p0[0] - p1[0], y01 = p0[1] - p1[1], lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x1 = p0[0] + ox, y1 = p0[1] + oy, x2 = p1[0] + ox, y2 = p1[1] + oy, x3 = (x1 + x2) / 2, y3 = (y1 + y2) / 2, dx = x2 - x1, dy = y2 - y1, d2 = dx * dx + dy * dy, r = r1 - rc, D = x1 * y2 - x2 * y1, d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x3, dy0 = cy0 - y3, dx1 = cx1 - x3, dy1 = cy1 - y3;
-    if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
-    return [ [ cx0 - ox, cy0 - oy ], [ cx0 * r1 / r, cy0 * r1 / r ] ];
-  }
-  function d3_svg_line(projection) {
-    var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7;
-    function line(data) {
-      var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y);
-      function segment() {
-        segments.push("M", interpolate(projection(points), tension));
-      }
-      while (++i < n) {
-        if (defined.call(this, d = data[i], i)) {
-          points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]);
-        } else if (points.length) {
-          segment();
-          points = [];
-        }
-      }
-      if (points.length) segment();
-      return segments.length ? segments.join("") : null;
-    }
-    line.x = function(_) {
-      if (!arguments.length) return x;
-      x = _;
-      return line;
-    };
-    line.y = function(_) {
-      if (!arguments.length) return y;
-      y = _;
-      return line;
-    };
-    line.defined = function(_) {
-      if (!arguments.length) return defined;
-      defined = _;
-      return line;
-    };
-    line.interpolate = function(_) {
-      if (!arguments.length) return interpolateKey;
-      if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
-      return line;
-    };
-    line.tension = function(_) {
-      if (!arguments.length) return tension;
-      tension = _;
-      return line;
-    };
-    return line;
-  }
-  d3.svg.line = function() {
-    return d3_svg_line(d3_identity);
-  };
-  var d3_svg_lineInterpolators = d3.map({
-    linear: d3_svg_lineLinear,
-    "linear-closed": d3_svg_lineLinearClosed,
-    step: d3_svg_lineStep,
-    "step-before": d3_svg_lineStepBefore,
-    "step-after": d3_svg_lineStepAfter,
-    basis: d3_svg_lineBasis,
-    "basis-open": d3_svg_lineBasisOpen,
-    "basis-closed": d3_svg_lineBasisClosed,
-    bundle: d3_svg_lineBundle,
-    cardinal: d3_svg_lineCardinal,
-    "cardinal-open": d3_svg_lineCardinalOpen,
-    "cardinal-closed": d3_svg_lineCardinalClosed,
-    monotone: d3_svg_lineMonotone
-  });
-  d3_svg_lineInterpolators.forEach(function(key, value) {
-    value.key = key;
-    value.closed = /-closed$/.test(key);
-  });
-  function d3_svg_lineLinear(points) {
-    return points.length > 1 ? points.join("L") : points + "Z";
-  }
-  function d3_svg_lineLinearClosed(points) {
-    return points.join("L") + "Z";
-  }
-  function d3_svg_lineStep(points) {
-    var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
-    while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]);
-    if (n > 1) path.push("H", p[0]);
-    return path.join("");
-  }
-  function d3_svg_lineStepBefore(points) {
-    var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
-    while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]);
-    return path.join("");
-  }
-  function d3_svg_lineStepAfter(points) {
-    var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
-    while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]);
-    return path.join("");
-  }
-  function d3_svg_lineCardinalOpen(points, tension) {
-    return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, -1), d3_svg_lineCardinalTangents(points, tension));
-  }
-  function d3_svg_lineCardinalClosed(points, tension) {
-    return points.length < 3 ? d3_svg_lineLinearClosed(points) : points[0] + d3_svg_lineHermite((points.push(points[0]), 
-    points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));
-  }
-  function d3_svg_lineCardinal(points, tension) {
-    return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension));
-  }
-  function d3_svg_lineHermite(points, tangents) {
-    if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) {
-      return d3_svg_lineLinear(points);
-    }
-    var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1;
-    if (quad) {
-      path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1];
-      p0 = points[1];
-      pi = 2;
-    }
-    if (tangents.length > 1) {
-      t = tangents[1];
-      p = points[pi];
-      pi++;
-      path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
-      for (var i = 2; i < tangents.length; i++, pi++) {
-        p = points[pi];
-        t = tangents[i];
-        path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
-      }
-    }
-    if (quad) {
-      var lp = points[pi];
-      path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1];
-    }
-    return path;
-  }
-  function d3_svg_lineCardinalTangents(points, tension) {
-    var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length;
-    while (++i < n) {
-      p0 = p1;
-      p1 = p2;
-      p2 = points[i];
-      tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]);
-    }
-    return tangents;
-  }
-  function d3_svg_lineBasis(points) {
-    if (points.length < 3) return d3_svg_lineLinear(points);
-    var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
-    points.push(points[n - 1]);
-    while (++i <= n) {
-      pi = points[i];
-      px.shift();
-      px.push(pi[0]);
-      py.shift();
-      py.push(pi[1]);
-      d3_svg_lineBasisBezier(path, px, py);
-    }
-    points.pop();
-    path.push("L", pi);
-    return path.join("");
-  }
-  function d3_svg_lineBasisOpen(points) {
-    if (points.length < 4) return d3_svg_lineLinear(points);
-    var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ];
-    while (++i < 3) {
-      pi = points[i];
-      px.push(pi[0]);
-      py.push(pi[1]);
-    }
-    path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py));
-    --i;
-    while (++i < n) {
-      pi = points[i];
-      px.shift();
-      px.push(pi[0]);
-      py.shift();
-      py.push(pi[1]);
-      d3_svg_lineBasisBezier(path, px, py);
-    }
-    return path.join("");
-  }
-  function d3_svg_lineBasisClosed(points) {
-    var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = [];
-    while (++i < 4) {
-      pi = points[i % n];
-      px.push(pi[0]);
-      py.push(pi[1]);
-    }
-    path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
-    --i;
-    while (++i < m) {
-      pi = points[i % n];
-      px.shift();
-      px.push(pi[0]);
-      py.shift();
-      py.push(pi[1]);
-      d3_svg_lineBasisBezier(path, px, py);
-    }
-    return path.join("");
-  }
-  function d3_svg_lineBundle(points, tension) {
-    var n = points.length - 1;
-    if (n) {
-      var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t;
-      while (++i <= n) {
-        p = points[i];
-        t = i / n;
-        p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx);
-        p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy);
-      }
-    }
-    return d3_svg_lineBasis(points);
-  }
-  function d3_svg_lineDot4(a, b) {
-    return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
-  }
-  var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ];
-  function d3_svg_lineBasisBezier(path, x, y) {
-    path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y));
-  }
-  function d3_svg_lineSlope(p0, p1) {
-    return (p1[1] - p0[1]) / (p1[0] - p0[0]);
-  }
-  function d3_svg_lineFiniteDifferences(points) {
-    var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1);
-    while (++i < j) {
-      m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2;
-    }
-    m[i] = d;
-    return m;
-  }
-  function d3_svg_lineMonotoneTangents(points) {
-    var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1;
-    while (++i < j) {
-      d = d3_svg_lineSlope(points[i], points[i + 1]);
-      if (abs(d) < ε) {
-        m[i] = m[i + 1] = 0;
-      } else {
-        a = m[i] / d;
-        b = m[i + 1] / d;
-        s = a * a + b * b;
-        if (s > 9) {
-          s = d * 3 / Math.sqrt(s);
-          m[i] = s * a;
-          m[i + 1] = s * b;
-        }
-      }
-    }
-    i = -1;
-    while (++i <= j) {
-      s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i]));
-      tangents.push([ s || 0, m[i] * s || 0 ]);
-    }
-    return tangents;
-  }
-  function d3_svg_lineMonotone(points) {
-    return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points));
-  }
-  d3.svg.line.radial = function() {
-    var line = d3_svg_line(d3_svg_lineRadial);
-    line.radius = line.x, delete line.x;
-    line.angle = line.y, delete line.y;
-    return line;
-  };
-  function d3_svg_lineRadial(points) {
-    var point, i = -1, n = points.length, r, a;
-    while (++i < n) {
-      point = points[i];
-      r = point[0];
-      a = point[1] - halfπ;
-      point[0] = r * Math.cos(a);
-      point[1] = r * Math.sin(a);
-    }
-    return points;
-  }
-  function d3_svg_area(projection) {
-    var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7;
-    function area(data) {
-      var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() {
-        return x;
-      } : d3_functor(x1), fy1 = y0 === y1 ? function() {
-        return y;
-      } : d3_functor(y1), x, y;
-      function segment() {
-        segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z");
-      }
-      while (++i < n) {
-        if (defined.call(this, d = data[i], i)) {
-          points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]);
-          points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]);
-        } else if (points0.length) {
-          segment();
-          points0 = [];
-          points1 = [];
-        }
-      }
-      if (points0.length) segment();
-      return segments.length ? segments.join("") : null;
-    }
-    area.x = function(_) {
-      if (!arguments.length) return x1;
-      x0 = x1 = _;
-      return area;
-    };
-    area.x0 = function(_) {
-      if (!arguments.length) return x0;
-      x0 = _;
-      return area;
-    };
-    area.x1 = function(_) {
-      if (!arguments.length) return x1;
-      x1 = _;
-      return area;
-    };
-    area.y = function(_) {
-      if (!arguments.length) return y1;
-      y0 = y1 = _;
-      return area;
-    };
-    area.y0 = function(_) {
-      if (!arguments.length) return y0;
-      y0 = _;
-      return area;
-    };
-    area.y1 = function(_) {
-      if (!arguments.length) return y1;
-      y1 = _;
-      return area;
-    };
-    area.defined = function(_) {
-      if (!arguments.length) return defined;
-      defined = _;
-      return area;
-    };
-    area.interpolate = function(_) {
-      if (!arguments.length) return interpolateKey;
-      if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
-      interpolateReverse = interpolate.reverse || interpolate;
-      L = interpolate.closed ? "M" : "L";
-      return area;
-    };
-    area.tension = function(_) {
-      if (!arguments.length) return tension;
-      tension = _;
-      return area;
-    };
-    return area;
-  }
-  d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter;
-  d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore;
-  d3.svg.area = function() {
-    return d3_svg_area(d3_identity);
-  };
-  d3.svg.area.radial = function() {
-    var area = d3_svg_area(d3_svg_lineRadial);
-    area.radius = area.x, delete area.x;
-    area.innerRadius = area.x0, delete area.x0;
-    area.outerRadius = area.x1, delete area.x1;
-    area.angle = area.y, delete area.y;
-    area.startAngle = area.y0, delete area.y0;
-    area.endAngle = area.y1, delete area.y1;
-    return area;
-  };
-  d3.svg.chord = function() {
-    var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
-    function chord(d, i) {
-      var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i);
-      return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z";
-    }
-    function subgroup(self, f, d, i) {
-      var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) - halfπ, a1 = endAngle.call(self, subgroup, i) - halfπ;
-      return {
-        r: r,
-        a0: a0,
-        a1: a1,
-        p0: [ r * Math.cos(a0), r * Math.sin(a0) ],
-        p1: [ r * Math.cos(a1), r * Math.sin(a1) ]
-      };
-    }
-    function equals(a, b) {
-      return a.a0 == b.a0 && a.a1 == b.a1;
-    }
-    function arc(r, p, a) {
-      return "A" + r + "," + r + " 0 " + +(a > π) + ",1 " + p;
-    }
-    function curve(r0, p0, r1, p1) {
-      return "Q 0,0 " + p1;
-    }
-    chord.radius = function(v) {
-      if (!arguments.length) return radius;
-      radius = d3_functor(v);
-      return chord;
-    };
-    chord.source = function(v) {
-      if (!arguments.length) return source;
-      source = d3_functor(v);
-      return chord;
-    };
-    chord.target = function(v) {
-      if (!arguments.length) return target;
-      target = d3_functor(v);
-      return chord;
-    };
-    chord.startAngle = function(v) {
-      if (!arguments.length) return startAngle;
-      startAngle = d3_functor(v);
-      return chord;
-    };
-    chord.endAngle = function(v) {
-      if (!arguments.length) return endAngle;
-      endAngle = d3_functor(v);
-      return chord;
-    };
-    return chord;
-  };
-  function d3_svg_chordRadius(d) {
-    return d.radius;
-  }
-  d3.svg.diagonal = function() {
-    var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection;
-    function diagonal(d, i) {
-      var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, {
-        x: p0.x,
-        y: m
-      }, {
-        x: p3.x,
-        y: m
-      }, p3 ];
-      p = p.map(projection);
-      return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3];
-    }
-    diagonal.source = function(x) {
-      if (!arguments.length) return source;
-      source = d3_functor(x);
-      return diagonal;
-    };
-    diagonal.target = function(x) {
-      if (!arguments.length) return target;
-      target = d3_functor(x);
-      return diagonal;
-    };
-    diagonal.projection = function(x) {
-      if (!arguments.length) return projection;
-      projection = x;
-      return diagonal;
-    };
-    return diagonal;
-  };
-  function d3_svg_diagonalProjection(d) {
-    return [ d.x, d.y ];
-  }
-  d3.svg.diagonal.radial = function() {
-    var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection;
-    diagonal.projection = function(x) {
-      return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection;
-    };
-    return diagonal;
-  };
-  function d3_svg_diagonalRadialProjection(projection) {
-    return function() {
-      var d = projection.apply(this, arguments), r = d[0], a = d[1] - halfπ;
-      return [ r * Math.cos(a), r * Math.sin(a) ];
-    };
-  }
-  d3.svg.symbol = function() {
-    var type = d3_svg_symbolType, size = d3_svg_symbolSize;
-    function symbol(d, i) {
-      return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i));
-    }
-    symbol.type = function(x) {
-      if (!arguments.length) return type;
-      type = d3_functor(x);
-      return symbol;
-    };
-    symbol.size = function(x) {
-      if (!arguments.length) return size;
-      size = d3_functor(x);
-      return symbol;
-    };
-    return symbol;
-  };
-  function d3_svg_symbolSize() {
-    return 64;
-  }
-  function d3_svg_symbolType() {
-    return "circle";
-  }
-  function d3_svg_symbolCircle(size) {
-    var r = Math.sqrt(size / π);
-    return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z";
-  }
-  var d3_svg_symbols = d3.map({
-    circle: d3_svg_symbolCircle,
-    cross: function(size) {
-      var r = Math.sqrt(size / 5) / 2;
-      return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z";
-    },
-    diamond: function(size) {
-      var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30;
-      return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z";
-    },
-    square: function(size) {
-      var r = Math.sqrt(size) / 2;
-      return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z";
-    },
-    "triangle-down": function(size) {
-      var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
-      return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z";
-    },
-    "triangle-up": function(size) {
-      var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
-      return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z";
-    }
-  });
-  d3.svg.symbolTypes = d3_svg_symbols.keys();
-  var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians);
-  d3_selectionPrototype.transition = function(name) {
-    var id = d3_transitionInheritId || ++d3_transitionId, ns = d3_transitionNamespace(name), subgroups = [], subgroup, node, transition = d3_transitionInherit || {
-      time: Date.now(),
-      ease: d3_ease_cubicInOut,
-      delay: 0,
-      duration: 250
-    };
-    for (var j = -1, m = this.length; ++j < m; ) {
-      subgroups.push(subgroup = []);
-      for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
-        if (node = group[i]) d3_transitionNode(node, i, ns, id, transition);
-        subgroup.push(node);
-      }
-    }
-    return d3_transition(subgroups, ns, id);
-  };
-  d3_selectionPrototype.interrupt = function(name) {
-    return this.each(name == null ? d3_selection_interrupt : d3_selection_interruptNS(d3_transitionNamespace(name)));
-  };
-  var d3_selection_interrupt = d3_selection_interruptNS(d3_transitionNamespace());
-  function d3_selection_interruptNS(ns) {
-    return function() {
-      var lock, activeId, active;
-      if ((lock = this[ns]) && (active = lock[activeId = lock.active])) {
-        active.timer.c = null;
-        active.timer.t = NaN;
-        if (--lock.count) delete lock[activeId]; else delete this[ns];
-        lock.active += .5;
-        active.event && active.event.interrupt.call(this, this.__data__, active.index);
-      }
-    };
-  }
-  function d3_transition(groups, ns, id) {
-    d3_subclass(groups, d3_transitionPrototype);
-    groups.namespace = ns;
-    groups.id = id;
-    return groups;
-  }
-  var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit;
-  d3_transitionPrototype.call = d3_selectionPrototype.call;
-  d3_transitionPrototype.empty = d3_selectionPrototype.empty;
-  d3_transitionPrototype.node = d3_selectionPrototype.node;
-  d3_transitionPrototype.size = d3_selectionPrototype.size;
-  d3.transition = function(selection, name) {
-    return selection && selection.transition ? d3_transitionInheritId ? selection.transition(name) : selection : d3.selection().transition(selection);
-  };
-  d3.transition.prototype = d3_transitionPrototype;
-  d3_transitionPrototype.select = function(selector) {
-    var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnode, node;
-    selector = d3_selection_selector(selector);
-    for (var j = -1, m = this.length; ++j < m; ) {
-      subgroups.push(subgroup = []);
-      for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
-        if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) {
-          if ("__data__" in node) subnode.__data__ = node.__data__;
-          d3_transitionNode(subnode, i, ns, id, node[ns][id]);
-          subgroup.push(subnode);
-        } else {
-          subgroup.push(null);
-        }
-      }
-    }
-    return d3_transition(subgroups, ns, id);
-  };
-  d3_transitionPrototype.selectAll = function(selector) {
-    var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnodes, node, subnode, transition;
-    selector = d3_selection_selectorAll(selector);
-    for (var j = -1, m = this.length; ++j < m; ) {
-      for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
-        if (node = group[i]) {
-          transition = node[ns][id];
-          subnodes = selector.call(node, node.__data__, i, j);
-          subgroups.push(subgroup = []);
-          for (var k = -1, o = subnodes.length; ++k < o; ) {
-            if (subnode = subnodes[k]) d3_transitionNode(subnode, k, ns, id, transition);
-            subgroup.push(subnode);
-          }
-        }
-      }
-    }
-    return d3_transition(subgroups, ns, id);
-  };
-  d3_transitionPrototype.filter = function(filter) {
-    var subgroups = [], subgroup, group, node;
-    if (typeof filter !== "function") filter = d3_selection_filter(filter);
-    for (var j = 0, m = this.length; j < m; j++) {
-      subgroups.push(subgroup = []);
-      for (var group = this[j], i = 0, n = group.length; i < n; i++) {
-        if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
-          subgroup.push(node);
-        }
-      }
-    }
-    return d3_transition(subgroups, this.namespace, this.id);
-  };
-  d3_transitionPrototype.tween = function(name, tween) {
-    var id = this.id, ns = this.namespace;
-    if (arguments.length < 2) return this.node()[ns][id].tween.get(name);
-    return d3_selection_each(this, tween == null ? function(node) {
-      node[ns][id].tween.remove(name);
-    } : function(node) {
-      node[ns][id].tween.set(name, tween);
-    });
-  };
-  function d3_transition_tween(groups, name, value, tween) {
-    var id = groups.id, ns = groups.namespace;
-    return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) {
-      node[ns][id].tween.set(name, tween(value.call(node, node.__data__, i, j)));
-    } : (value = tween(value), function(node) {
-      node[ns][id].tween.set(name, value);
-    }));
-  }
-  d3_transitionPrototype.attr = function(nameNS, value) {
-    if (arguments.length < 2) {
-      for (value in nameNS) this.attr(value, nameNS[value]);
-      return this;
-    }
-    var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS);
-    function attrNull() {
-      this.removeAttribute(name);
-    }
-    function attrNullNS() {
-      this.removeAttributeNS(name.space, name.local);
-    }
-    function attrTween(b) {
-      return b == null ? attrNull : (b += "", function() {
-        var a = this.getAttribute(name), i;
-        return a !== b && (i = interpolate(a, b), function(t) {
-          this.setAttribute(name, i(t));
-        });
-      });
-    }
-    function attrTweenNS(b) {
-      return b == null ? attrNullNS : (b += "", function() {
-        var a = this.getAttributeNS(name.space, name.local), i;
-        return a !== b && (i = interpolate(a, b), function(t) {
-          this.setAttributeNS(name.space, name.local, i(t));
-        });
-      });
-    }
-    return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween);
-  };
-  d3_transitionPrototype.attrTween = function(nameNS, tween) {
-    var name = d3.ns.qualify(nameNS);
-    function attrTween(d, i) {
-      var f = tween.call(this, d, i, this.getAttribute(name));
-      return f && function(t) {
-        this.setAttribute(name, f(t));
-      };
-    }
-    function attrTweenNS(d, i) {
-      var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local));
-      return f && function(t) {
-        this.setAttributeNS(name.space, name.local, f(t));
-      };
-    }
-    return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween);
-  };
-  d3_transitionPrototype.style = function(name, value, priority) {
-    var n = arguments.length;
-    if (n < 3) {
-      if (typeof name !== "string") {
-        if (n < 2) value = "";
-        for (priority in name) this.style(priority, name[priority], value);
-        return this;
-      }
-      priority = "";
-    }
-    function styleNull() {
-      this.style.removeProperty(name);
-    }
-    function styleString(b) {
-      return b == null ? styleNull : (b += "", function() {
-        var a = d3_window(this).getComputedStyle(this, null).getPropertyValue(name), i;
-        return a !== b && (i = d3_interpolate(a, b), function(t) {
-          this.style.setProperty(name, i(t), priority);
-        });
-      });
-    }
-    return d3_transition_tween(this, "style." + name, value, styleString);
-  };
-  d3_transitionPrototype.styleTween = function(name, tween, priority) {
-    if (arguments.length < 3) priority = "";
-    function styleTween(d, i) {
-      var f = tween.call(this, d, i, d3_window(this).getComputedStyle(this, null).getPropertyValue(name));
-      return f && function(t) {
-        this.style.setProperty(name, f(t), priority);
-      };
-    }
-    return this.tween("style." + name, styleTween);
-  };
-  d3_transitionPrototype.text = function(value) {
-    return d3_transition_tween(this, "text", value, d3_transition_text);
-  };
-  function d3_transition_text(b) {
-    if (b == null) b = "";
-    return function() {
-      this.textContent = b;
-    };
-  }
-  d3_transitionPrototype.remove = function() {
-    var ns = this.namespace;
-    return this.each("end.transition", function() {
-      var p;
-      if (this[ns].count < 2 && (p = this.parentNode)) p.removeChild(this);
-    });
-  };
-  d3_transitionPrototype.ease = function(value) {
-    var id = this.id, ns = this.namespace;
-    if (arguments.length < 1) return this.node()[ns][id].ease;
-    if (typeof value !== "function") value = d3.ease.apply(d3, arguments);
-    return d3_selection_each(this, function(node) {
-      node[ns][id].ease = value;
-    });
-  };
-  d3_transitionPrototype.delay = function(value) {
-    var id = this.id, ns = this.namespace;
-    if (arguments.length < 1) return this.node()[ns][id].delay;
-    return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
-      node[ns][id].delay = +value.call(node, node.__data__, i, j);
-    } : (value = +value, function(node) {
-      node[ns][id].delay = value;
-    }));
-  };
-  d3_transitionPrototype.duration = function(value) {
-    var id = this.id, ns = this.namespace;
-    if (arguments.length < 1) return this.node()[ns][id].duration;
-    return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
-      node[ns][id].duration = Math.max(1, value.call(node, node.__data__, i, j));
-    } : (value = Math.max(1, value), function(node) {
-      node[ns][id].duration = value;
-    }));
-  };
-  d3_transitionPrototype.each = function(type, listener) {
-    var id = this.id, ns = this.namespace;
-    if (arguments.length < 2) {
-      var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId;
-      try {
-        d3_transitionInheritId = id;
-        d3_selection_each(this, function(node, i, j) {
-          d3_transitionInherit = node[ns][id];
-          type.call(node, node.__data__, i, j);
-        });
-      } finally {
-        d3_transitionInherit = inherit;
-        d3_transitionInheritId = inheritId;
-      }
-    } else {
-      d3_selection_each(this, function(node) {
-        var transition = node[ns][id];
-        (transition.event || (transition.event = d3.dispatch("start", "end", "interrupt"))).on(type, listener);
-      });
-    }
-    return this;
-  };
-  d3_transitionPrototype.transition = function() {
-    var id0 = this.id, id1 = ++d3_transitionId, ns = this.namespace, subgroups = [], subgroup, group, node, transition;
-    for (var j = 0, m = this.length; j < m; j++) {
-      subgroups.push(subgroup = []);
-      for (var group = this[j], i = 0, n = group.length; i < n; i++) {
-        if (node = group[i]) {
-          transition = node[ns][id0];
-          d3_transitionNode(node, i, ns, id1, {
-            time: transition.time,
-            ease: transition.ease,
-            delay: transition.delay + transition.duration,
-            duration: transition.duration
-          });
-        }
-        subgroup.push(node);
-      }
-    }
-    return d3_transition(subgroups, ns, id1);
-  };
-  function d3_transitionNamespace(name) {
-    return name == null ? "__transition__" : "__transition_" + name + "__";
-  }
-  function d3_transitionNode(node, i, ns, id, inherit) {
-    var lock = node[ns] || (node[ns] = {
-      active: 0,
-      count: 0
-    }), transition = lock[id], time, timer, duration, ease, tweens;
-    function schedule(elapsed) {
-      var delay = transition.delay;
-      timer.t = delay + time;
-      if (delay <= elapsed) return start(elapsed - delay);
-      timer.c = start;
-    }
-    function start(elapsed) {
-      var activeId = lock.active, active = lock[activeId];
-      if (active) {
-        active.timer.c = null;
-        active.timer.t = NaN;
-        --lock.count;
-        delete lock[activeId];
-        active.event && active.event.interrupt.call(node, node.__data__, active.index);
-      }
-      for (var cancelId in lock) {
-        if (+cancelId < id) {
-          var cancel = lock[cancelId];
-          cancel.timer.c = null;
-          cancel.timer.t = NaN;
-          --lock.count;
-          delete lock[cancelId];
-        }
-      }
-      timer.c = tick;
-      d3_timer(function() {
-        if (timer.c && tick(elapsed || 1)) {
-          timer.c = null;
-          timer.t = NaN;
-        }
-        return 1;
-      }, 0, time);
-      lock.active = id;
-      transition.event && transition.event.start.call(node, node.__data__, i);
-      tweens = [];
-      transition.tween.forEach(function(key, value) {
-        if (value = value.call(node, node.__data__, i)) {
-          tweens.push(value);
-        }
-      });
-      ease = transition.ease;
-      duration = transition.duration;
-    }
-    function tick(elapsed) {
-      var t = elapsed / duration, e = ease(t), n = tweens.length;
-      while (n > 0) {
-        tweens[--n].call(node, e);
-      }
-      if (t >= 1) {
-        transition.event && transition.event.end.call(node, node.__data__, i);
-        if (--lock.count) delete lock[id]; else delete node[ns];
-        return 1;
-      }
-    }
-    if (!transition) {
-      time = inherit.time;
-      timer = d3_timer(schedule, 0, time);
-      transition = lock[id] = {
-        tween: new d3_Map(),
-        time: time,
-        timer: timer,
-        delay: inherit.delay,
-        duration: inherit.duration,
-        ease: inherit.ease,
-        index: i
-      };
-      inherit = null;
-      ++lock.count;
-    }
-  }
-  d3.svg.axis = function() {
-    var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_;
-    function axis(g) {
-      g.each(function() {
-        var g = d3.select(this);
-        var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();
-        var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform;
-        var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"), 
-        d3.transition(path));
-        tickEnter.append("line");
-        tickEnter.append("text");
-        var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text"), sign = orient === "top" || orient === "left" ? -1 : 1, x1, x2, y1, y2;
-        if (orient === "bottom" || orient === "top") {
-          tickTransform = d3_svg_axisX, x1 = "x", y1 = "y", x2 = "x2", y2 = "y2";
-          text.attr("dy", sign < 0 ? "0em" : ".71em").style("text-anchor", "middle");
-          pathUpdate.attr("d", "M" + range[0] + "," + sign * outerTickSize + "V0H" + range[1] + "V" + sign * outerTickSize);
-        } else {
-          tickTransform = d3_svg_axisY, x1 = "y", y1 = "x", x2 = "y2", y2 = "x2";
-          text.attr("dy", ".32em").style("text-anchor", sign < 0 ? "end" : "start");
-          pathUpdate.attr("d", "M" + sign * outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + sign * outerTickSize);
-        }
-        lineEnter.attr(y2, sign * innerTickSize);
-        textEnter.attr(y1, sign * tickSpacing);
-        lineUpdate.attr(x2, 0).attr(y2, sign * innerTickSize);
-        textUpdate.attr(x1, 0).attr(y1, sign * tickSpacing);
-        if (scale1.rangeBand) {
-          var x = scale1, dx = x.rangeBand() / 2;
-          scale0 = scale1 = function(d) {
-            return x(d) + dx;
-          };
-        } else if (scale0.rangeBand) {
-          scale0 = scale1;
-        } else {
-          tickExit.call(tickTransform, scale1, scale0);
-        }
-        tickEnter.call(tickTransform, scale0, scale1);
-        tickUpdate.call(tickTransform, scale1, scale1);
-      });
-    }
-    axis.scale = function(x) {
-      if (!arguments.length) return scale;
-      scale = x;
-      return axis;
-    };
-    axis.orient = function(x) {
-      if (!arguments.length) return orient;
-      orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient;
-      return axis;
-    };
-    axis.ticks = function() {
-      if (!arguments.length) return tickArguments_;
-      tickArguments_ = d3_array(arguments);
-      return axis;
-    };
-    axis.tickValues = function(x) {
-      if (!arguments.length) return tickValues;
-      tickValues = x;
-      return axis;
-    };
-    axis.tickFormat = function(x) {
-      if (!arguments.length) return tickFormat_;
-      tickFormat_ = x;
-      return axis;
-    };
-    axis.tickSize = function(x) {
-      var n = arguments.length;
-      if (!n) return innerTickSize;
-      innerTickSize = +x;
-      outerTickSize = +arguments[n - 1];
-      return axis;
-    };
-    axis.innerTickSize = function(x) {
-      if (!arguments.length) return innerTickSize;
-      innerTickSize = +x;
-      return axis;
-    };
-    axis.outerTickSize = function(x) {
-      if (!arguments.length) return outerTickSize;
-      outerTickSize = +x;
-      return axis;
-    };
-    axis.tickPadding = function(x) {
-      if (!arguments.length) return tickPadding;
-      tickPadding = +x;
-      return axis;
-    };
-    axis.tickSubdivide = function() {
-      return arguments.length && axis;
-    };
-    return axis;
-  };
-  var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = {
-    top: 1,
-    right: 1,
-    bottom: 1,
-    left: 1
-  };
-  function d3_svg_axisX(selection, x0, x1) {
-    selection.attr("transform", function(d) {
-      var v0 = x0(d);
-      return "translate(" + (isFinite(v0) ? v0 : x1(d)) + ",0)";
-    });
-  }
-  function d3_svg_axisY(selection, y0, y1) {
-    selection.attr("transform", function(d) {
-      var v0 = y0(d);
-      return "translate(0," + (isFinite(v0) ? v0 : y1(d)) + ")";
-    });
-  }
-  d3.svg.brush = function() {
-    var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0];
-    function brush(g) {
-      g.each(function() {
-        var g = d3.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart);
-        var background = g.selectAll(".background").data([ 0 ]);
-        background.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair");
-        g.selectAll(".extent").data([ 0 ]).enter().append("rect").attr("class", "extent").style("cursor", "move");
-        var resize = g.selectAll(".resize").data(resizes, d3_identity);
-        resize.exit().remove();
-        resize.enter().append("g").attr("class", function(d) {
-          return "resize " + d;
-        }).style("cursor", function(d) {
-          return d3_svg_brushCursor[d];
-        }).append("rect").attr("x", function(d) {
-          return /[ew]$/.test(d) ? -3 : null;
-        }).attr("y", function(d) {
-          return /^[ns]/.test(d) ? -3 : null;
-        }).attr("width", 6).attr("height", 6).style("visibility", "hidden");
-        resize.style("display", brush.empty() ? "none" : null);
-        var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range;
-        if (x) {
-          range = d3_scaleRange(x);
-          backgroundUpdate.attr("x", range[0]).attr("width", range[1] - range[0]);
-          redrawX(gUpdate);
-        }
-        if (y) {
-          range = d3_scaleRange(y);
-          backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]);
-          redrawY(gUpdate);
-        }
-        redraw(gUpdate);
-      });
-    }
-    brush.event = function(g) {
-      g.each(function() {
-        var event_ = event.of(this, arguments), extent1 = {
-          x: xExtent,
-          y: yExtent,
-          i: xExtentDomain,
-          j: yExtentDomain
-        }, extent0 = this.__chart__ || extent1;
-        this.__chart__ = extent1;
-        if (d3_transitionInheritId) {
-          d3.select(this).transition().each("start.brush", function() {
-            xExtentDomain = extent0.i;
-            yExtentDomain = extent0.j;
-            xExtent = extent0.x;
-            yExtent = extent0.y;
-            event_({
-              type: "brushstart"
-            });
-          }).tween("brush:brush", function() {
-            var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y);
-            xExtentDomain = yExtentDomain = null;
-            return function(t) {
-              xExtent = extent1.x = xi(t);
-              yExtent = extent1.y = yi(t);
-              event_({
-                type: "brush",
-                mode: "resize"
-              });
-            };
-          }).each("end.brush", function() {
-            xExtentDomain = extent1.i;
-            yExtentDomain = extent1.j;
-            event_({
-              type: "brush",
-              mode: "resize"
-            });
-            event_({
-              type: "brushend"
-            });
-          });
-        } else {
-          event_({
-            type: "brushstart"
-          });
-          event_({
-            type: "brush",
-            mode: "resize"
-          });
-          event_({
-            type: "brushend"
-          });
-        }
-      });
-    };
-    function redraw(g) {
-      g.selectAll(".resize").attr("transform", function(d) {
-        return "translate(" + xExtent[+/e$/.test(d)] + "," + yExtent[+/^s/.test(d)] + ")";
-      });
-    }
-    function redrawX(g) {
-      g.select(".extent").attr("x", xExtent[0]);
-      g.selectAll(".extent,.n>rect,.s>rect").attr("width", xExtent[1] - xExtent[0]);
-    }
-    function redrawY(g) {
-      g.select(".extent").attr("y", yExtent[0]);
-      g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]);
-    }
-    function brushstart() {
-      var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(target), center, origin = d3.mouse(target), offset;
-      var w = d3.select(d3_window(target)).on("keydown.brush", keydown).on("keyup.brush", keyup);
-      if (d3.event.changedTouches) {
-        w.on("touchmove.brush", brushmove).on("touchend.brush", brushend);
-      } else {
-        w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend);
-      }
-      g.interrupt().selectAll("*").interrupt();
-      if (dragging) {
-        origin[0] = xExtent[0] - origin[0];
-        origin[1] = yExtent[0] - origin[1];
-      } else if (resizing) {
-        var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing);
-        offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ];
-        origin[0] = xExtent[ex];
-        origin[1] = yExtent[ey];
-      } else if (d3.event.altKey) center = origin.slice();
-      g.style("pointer-events", "none").selectAll(".resize").style("display", null);
-      d3.select("body").style("cursor", eventTarget.style("cursor"));
-      event_({
-        type: "brushstart"
-      });
-      brushmove();
-      function keydown() {
-        if (d3.event.keyCode == 32) {
-          if (!dragging) {
-            center = null;
-            origin[0] -= xExtent[1];
-            origin[1] -= yExtent[1];
-            dragging = 2;
-          }
-          d3_eventPreventDefault();
-        }
-      }
-      function keyup() {
-        if (d3.event.keyCode == 32 && dragging == 2) {
-          origin[0] += xExtent[1];
-          origin[1] += yExtent[1];
-          dragging = 0;
-          d3_eventPreventDefault();
-        }
-      }
-      function brushmove() {
-        var point = d3.mouse(target), moved = false;
-        if (offset) {
-          point[0] += offset[0];
-          point[1] += offset[1];
-        }
-        if (!dragging) {
-          if (d3.event.altKey) {
-            if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ];
-            origin[0] = xExtent[+(point[0] < center[0])];
-            origin[1] = yExtent[+(point[1] < center[1])];
-          } else center = null;
-        }
-        if (resizingX && move1(point, x, 0)) {
-          redrawX(g);
-          moved = true;
-        }
-        if (resizingY && move1(point, y, 1)) {
-          redrawY(g);
-          moved = true;
-        }
-        if (moved) {
-          redraw(g);
-          event_({
-            type: "brush",
-            mode: dragging ? "move" : "resize"
-          });
-        }
-      }
-      function move1(point, scale, i) {
-        var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max;
-        if (dragging) {
-          r0 -= position;
-          r1 -= size + position;
-        }
-        min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i];
-        if (dragging) {
-          max = (min += position) + size;
-        } else {
-          if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min));
-          if (position < min) {
-            max = min;
-            min = position;
-          } else {
-            max = position;
-          }
-        }
-        if (extent[0] != min || extent[1] != max) {
-          if (i) yExtentDomain = null; else xExtentDomain = null;
-          extent[0] = min;
-          extent[1] = max;
-          return true;
-        }
-      }
-      function brushend() {
-        brushmove();
-        g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null);
-        d3.select("body").style("cursor", null);
-        w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null);
-        dragRestore();
-        event_({
-          type: "brushend"
-        });
-      }
-    }
-    brush.x = function(z) {
-      if (!arguments.length) return x;
-      x = z;
-      resizes = d3_svg_brushResizes[!x << 1 | !y];
-      return brush;
-    };
-    brush.y = function(z) {
-      if (!arguments.length) return y;
-      y = z;
-      resizes = d3_svg_brushResizes[!x << 1 | !y];
-      return brush;
-    };
-    brush.clamp = function(z) {
-      if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null;
-      if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z;
-      return brush;
-    };
-    brush.extent = function(z) {
-      var x0, x1, y0, y1, t;
-      if (!arguments.length) {
-        if (x) {
-          if (xExtentDomain) {
-            x0 = xExtentDomain[0], x1 = xExtentDomain[1];
-          } else {
-            x0 = xExtent[0], x1 = xExtent[1];
-            if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1);
-            if (x1 < x0) t = x0, x0 = x1, x1 = t;
-          }
-        }
-        if (y) {
-          if (yExtentDomain) {
-            y0 = yExtentDomain[0], y1 = yExtentDomain[1];
-          } else {
-            y0 = yExtent[0], y1 = yExtent[1];
-            if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1);
-            if (y1 < y0) t = y0, y0 = y1, y1 = t;
-          }
-        }
-        return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ];
-      }
-      if (x) {
-        x0 = z[0], x1 = z[1];
-        if (y) x0 = x0[0], x1 = x1[0];
-        xExtentDomain = [ x0, x1 ];
-        if (x.invert) x0 = x(x0), x1 = x(x1);
-        if (x1 < x0) t = x0, x0 = x1, x1 = t;
-        if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ];
-      }
-      if (y) {
-        y0 = z[0], y1 = z[1];
-        if (x) y0 = y0[1], y1 = y1[1];
-        yExtentDomain = [ y0, y1 ];
-        if (y.invert) y0 = y(y0), y1 = y(y1);
-        if (y1 < y0) t = y0, y0 = y1, y1 = t;
-        if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ];
-      }
-      return brush;
-    };
-    brush.clear = function() {
-      if (!brush.empty()) {
-        xExtent = [ 0, 0 ], yExtent = [ 0, 0 ];
-        xExtentDomain = yExtentDomain = null;
-      }
-      return brush;
-    };
-    brush.empty = function() {
-      return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1];
-    };
-    return d3.rebind(brush, event, "on");
-  };
-  var d3_svg_brushCursor = {
-    n: "ns-resize",
-    e: "ew-resize",
-    s: "ns-resize",
-    w: "ew-resize",
-    nw: "nwse-resize",
-    ne: "nesw-resize",
-    se: "nwse-resize",
-    sw: "nesw-resize"
-  };
-  var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ];
-  var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat;
-  var d3_time_formatUtc = d3_time_format.utc;
-  var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ");
-  d3_time_format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso;
-  function d3_time_formatIsoNative(date) {
-    return date.toISOString();
-  }
-  d3_time_formatIsoNative.parse = function(string) {
-    var date = new Date(string);
-    return isNaN(date) ? null : date;
-  };
-  d3_time_formatIsoNative.toString = d3_time_formatIso.toString;
-  d3_time.second = d3_time_interval(function(date) {
-    return new d3_date(Math.floor(date / 1e3) * 1e3);
-  }, function(date, offset) {
-    date.setTime(date.getTime() + Math.floor(offset) * 1e3);
-  }, function(date) {
-    return date.getSeconds();
-  });
-  d3_time.seconds = d3_time.second.range;
-  d3_time.seconds.utc = d3_time.second.utc.range;
-  d3_time.minute = d3_time_interval(function(date) {
-    return new d3_date(Math.floor(date / 6e4) * 6e4);
-  }, function(date, offset) {
-    date.setTime(date.getTime() + Math.floor(offset) * 6e4);
-  }, function(date) {
-    return date.getMinutes();
-  });
-  d3_time.minutes = d3_time.minute.range;
-  d3_time.minutes.utc = d3_time.minute.utc.range;
-  d3_time.hour = d3_time_interval(function(date) {
-    var timezone = date.getTimezoneOffset() / 60;
-    return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5);
-  }, function(date, offset) {
-    date.setTime(date.getTime() + Math.floor(offset) * 36e5);
-  }, function(date) {
-    return date.getHours();
-  });
-  d3_time.hours = d3_time.hour.range;
-  d3_time.hours.utc = d3_time.hour.utc.range;
-  d3_time.month = d3_time_interval(function(date) {
-    date = d3_time.day(date);
-    date.setDate(1);
-    return date;
-  }, function(date, offset) {
-    date.setMonth(date.getMonth() + offset);
-  }, function(date) {
-    return date.getMonth();
-  });
-  d3_time.months = d3_time.month.range;
-  d3_time.months.utc = d3_time.month.utc.range;
-  function d3_time_scale(linear, methods, format) {
-    function scale(x) {
-      return linear(x);
-    }
-    scale.invert = function(x) {
-      return d3_time_scaleDate(linear.invert(x));
-    };
-    scale.domain = function(x) {
-      if (!arguments.length) return linear.domain().map(d3_time_scaleDate);
-      linear.domain(x);
-      return scale;
-    };
-    function tickMethod(extent, count) {
-      var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target);
-      return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) {
-        return d / 31536e6;
-      }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i];
-    }
-    scale.nice = function(interval, skip) {
-      var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" && tickMethod(extent, interval);
-      if (method) interval = method[0], skip = method[1];
-      function skipped(date) {
-        return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length;
-      }
-      return scale.domain(d3_scale_nice(domain, skip > 1 ? {
-        floor: function(date) {
-          while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1);
-          return date;
-        },
-        ceil: function(date) {
-          while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1);
-          return date;
-        }
-      } : interval));
-    };
-    scale.ticks = function(interval, skip) {
-      var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" ? tickMethod(extent, interval) : !interval.range && [ {
-        range: interval
-      }, skip ];
-      if (method) interval = method[0], skip = method[1];
-      return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip);
-    };
-    scale.tickFormat = function() {
-      return format;
-    };
-    scale.copy = function() {
-      return d3_time_scale(linear.copy(), methods, format);
-    };
-    return d3_scale_linearRebind(scale, linear);
-  }
-  function d3_time_scaleDate(t) {
-    return new Date(t);
-  }
-  var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ];
-  var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ];
-  var d3_time_scaleLocalFormat = d3_time_format.multi([ [ ".%L", function(d) {
-    return d.getMilliseconds();
-  } ], [ ":%S", function(d) {
-    return d.getSeconds();
-  } ], [ "%I:%M", function(d) {
-    return d.getMinutes();
-  } ], [ "%I %p", function(d) {
-    return d.getHours();
-  } ], [ "%a %d", function(d) {
-    return d.getDay() && d.getDate() != 1;
-  } ], [ "%b %d", function(d) {
-    return d.getDate() != 1;
-  } ], [ "%B", function(d) {
-    return d.getMonth();
-  } ], [ "%Y", d3_true ] ]);
-  var d3_time_scaleMilliseconds = {
-    range: function(start, stop, step) {
-      return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate);
-    },
-    floor: d3_identity,
-    ceil: d3_identity
-  };
-  d3_time_scaleLocalMethods.year = d3_time.year;
-  d3_time.scale = function() {
-    return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat);
-  };
-  var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) {
-    return [ m[0].utc, m[1] ];
-  });
-  var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ ".%L", function(d) {
-    return d.getUTCMilliseconds();
-  } ], [ ":%S", function(d) {
-    return d.getUTCSeconds();
-  } ], [ "%I:%M", function(d) {
-    return d.getUTCMinutes();
-  } ], [ "%I %p", function(d) {
-    return d.getUTCHours();
-  } ], [ "%a %d", function(d) {
-    return d.getUTCDay() && d.getUTCDate() != 1;
-  } ], [ "%b %d", function(d) {
-    return d.getUTCDate() != 1;
-  } ], [ "%B", function(d) {
-    return d.getUTCMonth();
-  } ], [ "%Y", d3_true ] ]);
-  d3_time_scaleUtcMethods.year = d3_time.year.utc;
-  d3_time.scale.utc = function() {
-    return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat);
-  };
-  d3.text = d3_xhrType(function(request) {
-    return request.responseText;
-  });
-  d3.json = function(url, callback) {
-    return d3_xhr(url, "application/json", d3_json, callback);
-  };
-  function d3_json(request) {
-    return JSON.parse(request.responseText);
-  }
-  d3.html = function(url, callback) {
-    return d3_xhr(url, "text/html", d3_html, callback);
-  };
-  function d3_html(request) {
-    var range = d3_document.createRange();
-    range.selectNode(d3_document.body);
-    return range.createContextualFragment(request.responseText);
-  }
-  d3.xml = d3_xhrType(function(request) {
-    return request.responseXML;
-  });
-  if (typeof define === "function" && define.amd) this.d3 = d3, define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3;
-}();
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/jquery/.bower.json
deleted file mode 100644
index b4040a3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/.bower.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
-  "name": "jquery",
-  "version": "2.1.4",
-  "main": "dist/jquery.js",
-  "license": "MIT",
-  "ignore": [
-    "**/.*",
-    "build",
-    "dist/cdn",
-    "speed",
-    "test",
-    "*.md",
-    "AUTHORS.txt",
-    "Gruntfile.js",
-    "package.json"
-  ],
-  "devDependencies": {
-    "sizzle": "2.1.1-jquery.2.1.2",
-    "requirejs": "2.1.10",
-    "qunit": "1.14.0",
-    "sinon": "1.8.1"
-  },
-  "keywords": [
-    "jquery",
-    "javascript",
-    "library"
-  ],
-  "homepage": "https://github.com/jquery/jquery-dist",
-  "_release": "2.1.4",
-  "_resolution": {
-    "type": "version",
-    "tag": "2.1.4",
-    "commit": "7751e69b615c6eca6f783a81e292a55725af6b85"
-  },
-  "_source": "https://github.com/jquery/jquery-dist.git",
-  "_target": "2.1.4",
-  "_originalSource": "jquery"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/MIT-LICENSE.txt b/views/ngXosViews/serviceGrid/src/vendor/jquery/MIT-LICENSE.txt
deleted file mode 100644
index cdd31b5..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/MIT-LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-Copyright 2014 jQuery Foundation and other contributors
-http://jquery.com/
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/bower.json b/views/ngXosViews/serviceGrid/src/vendor/jquery/bower.json
deleted file mode 100644
index 0c80cd5..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/bower.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-  "name": "jquery",
-  "version": "2.1.4",
-  "main": "dist/jquery.js",
-  "license": "MIT",
-  "ignore": [
-    "**/.*",
-    "build",
-    "dist/cdn",
-    "speed",
-    "test",
-    "*.md",
-    "AUTHORS.txt",
-    "Gruntfile.js",
-    "package.json"
-  ],
-  "devDependencies": {
-    "sizzle": "2.1.1-jquery.2.1.2",
-    "requirejs": "2.1.10",
-    "qunit": "1.14.0",
-    "sinon": "1.8.1"
-  },
-  "keywords": [
-    "jquery",
-    "javascript",
-    "library"
-  ]
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/dist/jquery.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/dist/jquery.js
deleted file mode 100644
index eed1777..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/dist/jquery.js
+++ /dev/null
@@ -1,9210 +0,0 @@
-/*!
- * jQuery JavaScript Library v2.1.4
- * http://jquery.com/
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2015-04-28T16:01Z
- */
-
-(function( global, factory ) {
-
-	if ( typeof module === "object" && typeof module.exports === "object" ) {
-		// For CommonJS and CommonJS-like environments where a proper `window`
-		// is present, execute the factory and get jQuery.
-		// For environments that do not have a `window` with a `document`
-		// (such as Node.js), expose a factory as module.exports.
-		// This accentuates the need for the creation of a real `window`.
-		// e.g. var jQuery = require("jquery")(window);
-		// See ticket #14549 for more info.
-		module.exports = global.document ?
-			factory( global, true ) :
-			function( w ) {
-				if ( !w.document ) {
-					throw new Error( "jQuery requires a window with a document" );
-				}
-				return factory( w );
-			};
-	} else {
-		factory( global );
-	}
-
-// Pass this if window is not defined yet
-}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
-
-// Support: Firefox 18+
-// Can't be in strict mode, several libs including ASP.NET trace
-// the stack via arguments.caller.callee and Firefox dies if
-// you try to trace through "use strict" call chains. (#13335)
-//
-
-var arr = [];
-
-var slice = arr.slice;
-
-var concat = arr.concat;
-
-var push = arr.push;
-
-var indexOf = arr.indexOf;
-
-var class2type = {};
-
-var toString = class2type.toString;
-
-var hasOwn = class2type.hasOwnProperty;
-
-var support = {};
-
-
-
-var
-	// Use the correct document accordingly with window argument (sandbox)
-	document = window.document,
-
-	version = "2.1.4",
-
-	// Define a local copy of jQuery
-	jQuery = function( selector, context ) {
-		// The jQuery object is actually just the init constructor 'enhanced'
-		// Need init if jQuery is called (just allow error to be thrown if not included)
-		return new jQuery.fn.init( selector, context );
-	},
-
-	// Support: Android<4.1
-	// Make sure we trim BOM and NBSP
-	rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
-	// Matches dashed string for camelizing
-	rmsPrefix = /^-ms-/,
-	rdashAlpha = /-([\da-z])/gi,
-
-	// Used by jQuery.camelCase as callback to replace()
-	fcamelCase = function( all, letter ) {
-		return letter.toUpperCase();
-	};
-
-jQuery.fn = jQuery.prototype = {
-	// The current version of jQuery being used
-	jquery: version,
-
-	constructor: jQuery,
-
-	// Start with an empty selector
-	selector: "",
-
-	// The default length of a jQuery object is 0
-	length: 0,
-
-	toArray: function() {
-		return slice.call( this );
-	},
-
-	// Get the Nth element in the matched element set OR
-	// Get the whole matched element set as a clean array
-	get: function( num ) {
-		return num != null ?
-
-			// Return just the one element from the set
-			( num < 0 ? this[ num + this.length ] : this[ num ] ) :
-
-			// Return all the elements in a clean array
-			slice.call( this );
-	},
-
-	// Take an array of elements and push it onto the stack
-	// (returning the new matched element set)
-	pushStack: function( elems ) {
-
-		// Build a new jQuery matched element set
-		var ret = jQuery.merge( this.constructor(), elems );
-
-		// Add the old object onto the stack (as a reference)
-		ret.prevObject = this;
-		ret.context = this.context;
-
-		// Return the newly-formed element set
-		return ret;
-	},
-
-	// Execute a callback for every element in the matched set.
-	// (You can seed the arguments with an array of args, but this is
-	// only used internally.)
-	each: function( callback, args ) {
-		return jQuery.each( this, callback, args );
-	},
-
-	map: function( callback ) {
-		return this.pushStack( jQuery.map(this, function( elem, i ) {
-			return callback.call( elem, i, elem );
-		}));
-	},
-
-	slice: function() {
-		return this.pushStack( slice.apply( this, arguments ) );
-	},
-
-	first: function() {
-		return this.eq( 0 );
-	},
-
-	last: function() {
-		return this.eq( -1 );
-	},
-
-	eq: function( i ) {
-		var len = this.length,
-			j = +i + ( i < 0 ? len : 0 );
-		return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
-	},
-
-	end: function() {
-		return this.prevObject || this.constructor(null);
-	},
-
-	// For internal use only.
-	// Behaves like an Array's method, not like a jQuery method.
-	push: push,
-	sort: arr.sort,
-	splice: arr.splice
-};
-
-jQuery.extend = jQuery.fn.extend = function() {
-	var options, name, src, copy, copyIsArray, clone,
-		target = arguments[0] || {},
-		i = 1,
-		length = arguments.length,
-		deep = false;
-
-	// Handle a deep copy situation
-	if ( typeof target === "boolean" ) {
-		deep = target;
-
-		// Skip the boolean and the target
-		target = arguments[ i ] || {};
-		i++;
-	}
-
-	// Handle case when target is a string or something (possible in deep copy)
-	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
-		target = {};
-	}
-
-	// Extend jQuery itself if only one argument is passed
-	if ( i === length ) {
-		target = this;
-		i--;
-	}
-
-	for ( ; i < length; i++ ) {
-		// Only deal with non-null/undefined values
-		if ( (options = arguments[ i ]) != null ) {
-			// Extend the base object
-			for ( name in options ) {
-				src = target[ name ];
-				copy = options[ name ];
-
-				// Prevent never-ending loop
-				if ( target === copy ) {
-					continue;
-				}
-
-				// Recurse if we're merging plain objects or arrays
-				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
-					if ( copyIsArray ) {
-						copyIsArray = false;
-						clone = src && jQuery.isArray(src) ? src : [];
-
-					} else {
-						clone = src && jQuery.isPlainObject(src) ? src : {};
-					}
-
-					// Never move original objects, clone them
-					target[ name ] = jQuery.extend( deep, clone, copy );
-
-				// Don't bring in undefined values
-				} else if ( copy !== undefined ) {
-					target[ name ] = copy;
-				}
-			}
-		}
-	}
-
-	// Return the modified object
-	return target;
-};
-
-jQuery.extend({
-	// Unique for each copy of jQuery on the page
-	expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
-
-	// Assume jQuery is ready without the ready module
-	isReady: true,
-
-	error: function( msg ) {
-		throw new Error( msg );
-	},
-
-	noop: function() {},
-
-	isFunction: function( obj ) {
-		return jQuery.type(obj) === "function";
-	},
-
-	isArray: Array.isArray,
-
-	isWindow: function( obj ) {
-		return obj != null && obj === obj.window;
-	},
-
-	isNumeric: function( obj ) {
-		// parseFloat NaNs numeric-cast false positives (null|true|false|"")
-		// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
-		// subtraction forces infinities to NaN
-		// adding 1 corrects loss of precision from parseFloat (#15100)
-		return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
-	},
-
-	isPlainObject: function( obj ) {
-		// Not plain objects:
-		// - Any object or value whose internal [[Class]] property is not "[object Object]"
-		// - DOM nodes
-		// - window
-		if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
-			return false;
-		}
-
-		if ( obj.constructor &&
-				!hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
-			return false;
-		}
-
-		// If the function hasn't returned already, we're confident that
-		// |obj| is a plain object, created by {} or constructed with new Object
-		return true;
-	},
-
-	isEmptyObject: function( obj ) {
-		var name;
-		for ( name in obj ) {
-			return false;
-		}
-		return true;
-	},
-
-	type: function( obj ) {
-		if ( obj == null ) {
-			return obj + "";
-		}
-		// Support: Android<4.0, iOS<6 (functionish RegExp)
-		return typeof obj === "object" || typeof obj === "function" ?
-			class2type[ toString.call(obj) ] || "object" :
-			typeof obj;
-	},
-
-	// Evaluates a script in a global context
-	globalEval: function( code ) {
-		var script,
-			indirect = eval;
-
-		code = jQuery.trim( code );
-
-		if ( code ) {
-			// If the code includes a valid, prologue position
-			// strict mode pragma, execute code by injecting a
-			// script tag into the document.
-			if ( code.indexOf("use strict") === 1 ) {
-				script = document.createElement("script");
-				script.text = code;
-				document.head.appendChild( script ).parentNode.removeChild( script );
-			} else {
-			// Otherwise, avoid the DOM node creation, insertion
-			// and removal by using an indirect global eval
-				indirect( code );
-			}
-		}
-	},
-
-	// Convert dashed to camelCase; used by the css and data modules
-	// Support: IE9-11+
-	// Microsoft forgot to hump their vendor prefix (#9572)
-	camelCase: function( string ) {
-		return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
-	},
-
-	nodeName: function( elem, name ) {
-		return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
-	},
-
-	// args is for internal usage only
-	each: function( obj, callback, args ) {
-		var value,
-			i = 0,
-			length = obj.length,
-			isArray = isArraylike( obj );
-
-		if ( args ) {
-			if ( isArray ) {
-				for ( ; i < length; i++ ) {
-					value = callback.apply( obj[ i ], args );
-
-					if ( value === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( i in obj ) {
-					value = callback.apply( obj[ i ], args );
-
-					if ( value === false ) {
-						break;
-					}
-				}
-			}
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( isArray ) {
-				for ( ; i < length; i++ ) {
-					value = callback.call( obj[ i ], i, obj[ i ] );
-
-					if ( value === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( i in obj ) {
-					value = callback.call( obj[ i ], i, obj[ i ] );
-
-					if ( value === false ) {
-						break;
-					}
-				}
-			}
-		}
-
-		return obj;
-	},
-
-	// Support: Android<4.1
-	trim: function( text ) {
-		return text == null ?
-			"" :
-			( text + "" ).replace( rtrim, "" );
-	},
-
-	// results is for internal usage only
-	makeArray: function( arr, results ) {
-		var ret = results || [];
-
-		if ( arr != null ) {
-			if ( isArraylike( Object(arr) ) ) {
-				jQuery.merge( ret,
-					typeof arr === "string" ?
-					[ arr ] : arr
-				);
-			} else {
-				push.call( ret, arr );
-			}
-		}
-
-		return ret;
-	},
-
-	inArray: function( elem, arr, i ) {
-		return arr == null ? -1 : indexOf.call( arr, elem, i );
-	},
-
-	merge: function( first, second ) {
-		var len = +second.length,
-			j = 0,
-			i = first.length;
-
-		for ( ; j < len; j++ ) {
-			first[ i++ ] = second[ j ];
-		}
-
-		first.length = i;
-
-		return first;
-	},
-
-	grep: function( elems, callback, invert ) {
-		var callbackInverse,
-			matches = [],
-			i = 0,
-			length = elems.length,
-			callbackExpect = !invert;
-
-		// Go through the array, only saving the items
-		// that pass the validator function
-		for ( ; i < length; i++ ) {
-			callbackInverse = !callback( elems[ i ], i );
-			if ( callbackInverse !== callbackExpect ) {
-				matches.push( elems[ i ] );
-			}
-		}
-
-		return matches;
-	},
-
-	// arg is for internal usage only
-	map: function( elems, callback, arg ) {
-		var value,
-			i = 0,
-			length = elems.length,
-			isArray = isArraylike( elems ),
-			ret = [];
-
-		// Go through the array, translating each of the items to their new values
-		if ( isArray ) {
-			for ( ; i < length; i++ ) {
-				value = callback( elems[ i ], i, arg );
-
-				if ( value != null ) {
-					ret.push( value );
-				}
-			}
-
-		// Go through every key on the object,
-		} else {
-			for ( i in elems ) {
-				value = callback( elems[ i ], i, arg );
-
-				if ( value != null ) {
-					ret.push( value );
-				}
-			}
-		}
-
-		// Flatten any nested arrays
-		return concat.apply( [], ret );
-	},
-
-	// A global GUID counter for objects
-	guid: 1,
-
-	// Bind a function to a context, optionally partially applying any
-	// arguments.
-	proxy: function( fn, context ) {
-		var tmp, args, proxy;
-
-		if ( typeof context === "string" ) {
-			tmp = fn[ context ];
-			context = fn;
-			fn = tmp;
-		}
-
-		// Quick check to determine if target is callable, in the spec
-		// this throws a TypeError, but we will just return undefined.
-		if ( !jQuery.isFunction( fn ) ) {
-			return undefined;
-		}
-
-		// Simulated bind
-		args = slice.call( arguments, 2 );
-		proxy = function() {
-			return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
-		};
-
-		// Set the guid of unique handler to the same of original handler, so it can be removed
-		proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
-		return proxy;
-	},
-
-	now: Date.now,
-
-	// jQuery.support is not used in Core but other projects attach their
-	// properties to it so it needs to exist.
-	support: support
-});
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
-	class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-function isArraylike( obj ) {
-
-	// Support: iOS 8.2 (not reproducible in simulator)
-	// `in` check used to prevent JIT error (gh-2145)
-	// hasOwn isn't used here due to false negatives
-	// regarding Nodelist length in IE
-	var length = "length" in obj && obj.length,
-		type = jQuery.type( obj );
-
-	if ( type === "function" || jQuery.isWindow( obj ) ) {
-		return false;
-	}
-
-	if ( obj.nodeType === 1 && length ) {
-		return true;
-	}
-
-	return type === "array" || length === 0 ||
-		typeof length === "number" && length > 0 && ( length - 1 ) in obj;
-}
-var Sizzle =
-/*!
- * Sizzle CSS Selector Engine v2.2.0-pre
- * http://sizzlejs.com/
- *
- * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2014-12-16
- */
-(function( window ) {
-
-var i,
-	support,
-	Expr,
-	getText,
-	isXML,
-	tokenize,
-	compile,
-	select,
-	outermostContext,
-	sortInput,
-	hasDuplicate,
-
-	// Local document vars
-	setDocument,
-	document,
-	docElem,
-	documentIsHTML,
-	rbuggyQSA,
-	rbuggyMatches,
-	matches,
-	contains,
-
-	// Instance-specific data
-	expando = "sizzle" + 1 * new Date(),
-	preferredDoc = window.document,
-	dirruns = 0,
-	done = 0,
-	classCache = createCache(),
-	tokenCache = createCache(),
-	compilerCache = createCache(),
-	sortOrder = function( a, b ) {
-		if ( a === b ) {
-			hasDuplicate = true;
-		}
-		return 0;
-	},
-
-	// General-purpose constants
-	MAX_NEGATIVE = 1 << 31,
-
-	// Instance methods
-	hasOwn = ({}).hasOwnProperty,
-	arr = [],
-	pop = arr.pop,
-	push_native = arr.push,
-	push = arr.push,
-	slice = arr.slice,
-	// Use a stripped-down indexOf as it's faster than native
-	// http://jsperf.com/thor-indexof-vs-for/5
-	indexOf = function( list, elem ) {
-		var i = 0,
-			len = list.length;
-		for ( ; i < len; i++ ) {
-			if ( list[i] === elem ) {
-				return i;
-			}
-		}
-		return -1;
-	},
-
-	booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
-
-	// Regular expressions
-
-	// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
-	whitespace = "[\\x20\\t\\r\\n\\f]",
-	// http://www.w3.org/TR/css3-syntax/#characters
-	characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
-
-	// Loosely modeled on CSS identifier characters
-	// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
-	// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
-	identifier = characterEncoding.replace( "w", "w#" ),
-
-	// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
-	attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
-		// Operator (capture 2)
-		"*([*^$|!~]?=)" + whitespace +
-		// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
-		"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
-		"*\\]",
-
-	pseudos = ":(" + characterEncoding + ")(?:\\((" +
-		// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
-		// 1. quoted (capture 3; capture 4 or capture 5)
-		"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
-		// 2. simple (capture 6)
-		"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
-		// 3. anything else (capture 2)
-		".*" +
-		")\\)|)",
-
-	// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
-	rwhitespace = new RegExp( whitespace + "+", "g" ),
-	rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
-	rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
-	rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
-
-	rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
-
-	rpseudo = new RegExp( pseudos ),
-	ridentifier = new RegExp( "^" + identifier + "$" ),
-
-	matchExpr = {
-		"ID": new RegExp( "^#(" + characterEncoding + ")" ),
-		"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
-		"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
-		"ATTR": new RegExp( "^" + attributes ),
-		"PSEUDO": new RegExp( "^" + pseudos ),
-		"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
-			"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
-			"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
-		"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
-		// For use in libraries implementing .is()
-		// We use this for POS matching in `select`
-		"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
-			whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
-	},
-
-	rinputs = /^(?:input|select|textarea|button)$/i,
-	rheader = /^h\d$/i,
-
-	rnative = /^[^{]+\{\s*\[native \w/,
-
-	// Easily-parseable/retrievable ID or TAG or CLASS selectors
-	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
-	rsibling = /[+~]/,
-	rescape = /'|\\/g,
-
-	// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
-	runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
-	funescape = function( _, escaped, escapedWhitespace ) {
-		var high = "0x" + escaped - 0x10000;
-		// NaN means non-codepoint
-		// Support: Firefox<24
-		// Workaround erroneous numeric interpretation of +"0x"
-		return high !== high || escapedWhitespace ?
-			escaped :
-			high < 0 ?
-				// BMP codepoint
-				String.fromCharCode( high + 0x10000 ) :
-				// Supplemental Plane codepoint (surrogate pair)
-				String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
-	},
-
-	// Used for iframes
-	// See setDocument()
-	// Removing the function wrapper causes a "Permission Denied"
-	// error in IE
-	unloadHandler = function() {
-		setDocument();
-	};
-
-// Optimize for push.apply( _, NodeList )
-try {
-	push.apply(
-		(arr = slice.call( preferredDoc.childNodes )),
-		preferredDoc.childNodes
-	);
-	// Support: Android<4.0
-	// Detect silently failing push.apply
-	arr[ preferredDoc.childNodes.length ].nodeType;
-} catch ( e ) {
-	push = { apply: arr.length ?
-
-		// Leverage slice if possible
-		function( target, els ) {
-			push_native.apply( target, slice.call(els) );
-		} :
-
-		// Support: IE<9
-		// Otherwise append directly
-		function( target, els ) {
-			var j = target.length,
-				i = 0;
-			// Can't trust NodeList.length
-			while ( (target[j++] = els[i++]) ) {}
-			target.length = j - 1;
-		}
-	};
-}
-
-function Sizzle( selector, context, results, seed ) {
-	var match, elem, m, nodeType,
-		// QSA vars
-		i, groups, old, nid, newContext, newSelector;
-
-	if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
-		setDocument( context );
-	}
-
-	context = context || document;
-	results = results || [];
-	nodeType = context.nodeType;
-
-	if ( typeof selector !== "string" || !selector ||
-		nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
-
-		return results;
-	}
-
-	if ( !seed && documentIsHTML ) {
-
-		// Try to shortcut find operations when possible (e.g., not under DocumentFragment)
-		if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
-			// Speed-up: Sizzle("#ID")
-			if ( (m = match[1]) ) {
-				if ( nodeType === 9 ) {
-					elem = context.getElementById( m );
-					// Check parentNode to catch when Blackberry 4.6 returns
-					// nodes that are no longer in the document (jQuery #6963)
-					if ( elem && elem.parentNode ) {
-						// Handle the case where IE, Opera, and Webkit return items
-						// by name instead of ID
-						if ( elem.id === m ) {
-							results.push( elem );
-							return results;
-						}
-					} else {
-						return results;
-					}
-				} else {
-					// Context is not a document
-					if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
-						contains( context, elem ) && elem.id === m ) {
-						results.push( elem );
-						return results;
-					}
-				}
-
-			// Speed-up: Sizzle("TAG")
-			} else if ( match[2] ) {
-				push.apply( results, context.getElementsByTagName( selector ) );
-				return results;
-
-			// Speed-up: Sizzle(".CLASS")
-			} else if ( (m = match[3]) && support.getElementsByClassName ) {
-				push.apply( results, context.getElementsByClassName( m ) );
-				return results;
-			}
-		}
-
-		// QSA path
-		if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
-			nid = old = expando;
-			newContext = context;
-			newSelector = nodeType !== 1 && selector;
-
-			// qSA works strangely on Element-rooted queries
-			// We can work around this by specifying an extra ID on the root
-			// and working up from there (Thanks to Andrew Dupont for the technique)
-			// IE 8 doesn't work on object elements
-			if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
-				groups = tokenize( selector );
-
-				if ( (old = context.getAttribute("id")) ) {
-					nid = old.replace( rescape, "\\$&" );
-				} else {
-					context.setAttribute( "id", nid );
-				}
-				nid = "[id='" + nid + "'] ";
-
-				i = groups.length;
-				while ( i-- ) {
-					groups[i] = nid + toSelector( groups[i] );
-				}
-				newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
-				newSelector = groups.join(",");
-			}
-
-			if ( newSelector ) {
-				try {
-					push.apply( results,
-						newContext.querySelectorAll( newSelector )
-					);
-					return results;
-				} catch(qsaError) {
-				} finally {
-					if ( !old ) {
-						context.removeAttribute("id");
-					}
-				}
-			}
-		}
-	}
-
-	// All others
-	return select( selector.replace( rtrim, "$1" ), context, results, seed );
-}
-
-/**
- * Create key-value caches of limited size
- * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
- *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- *	deleting the oldest entry
- */
-function createCache() {
-	var keys = [];
-
-	function cache( key, value ) {
-		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
-		if ( keys.push( key + " " ) > Expr.cacheLength ) {
-			// Only keep the most recent entries
-			delete cache[ keys.shift() ];
-		}
-		return (cache[ key + " " ] = value);
-	}
-	return cache;
-}
-
-/**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
-function markFunction( fn ) {
-	fn[ expando ] = true;
-	return fn;
-}
-
-/**
- * Support testing using an element
- * @param {Function} fn Passed the created div and expects a boolean result
- */
-function assert( fn ) {
-	var div = document.createElement("div");
-
-	try {
-		return !!fn( div );
-	} catch (e) {
-		return false;
-	} finally {
-		// Remove from its parent by default
-		if ( div.parentNode ) {
-			div.parentNode.removeChild( div );
-		}
-		// release memory in IE
-		div = null;
-	}
-}
-
-/**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
-function addHandle( attrs, handler ) {
-	var arr = attrs.split("|"),
-		i = attrs.length;
-
-	while ( i-- ) {
-		Expr.attrHandle[ arr[i] ] = handler;
-	}
-}
-
-/**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
-function siblingCheck( a, b ) {
-	var cur = b && a,
-		diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
-			( ~b.sourceIndex || MAX_NEGATIVE ) -
-			( ~a.sourceIndex || MAX_NEGATIVE );
-
-	// Use IE sourceIndex if available on both nodes
-	if ( diff ) {
-		return diff;
-	}
-
-	// Check if b follows a
-	if ( cur ) {
-		while ( (cur = cur.nextSibling) ) {
-			if ( cur === b ) {
-				return -1;
-			}
-		}
-	}
-
-	return a ? 1 : -1;
-}
-
-/**
- * Returns a function to use in pseudos for input types
- * @param {String} type
- */
-function createInputPseudo( type ) {
-	return function( elem ) {
-		var name = elem.nodeName.toLowerCase();
-		return name === "input" && elem.type === type;
-	};
-}
-
-/**
- * Returns a function to use in pseudos for buttons
- * @param {String} type
- */
-function createButtonPseudo( type ) {
-	return function( elem ) {
-		var name = elem.nodeName.toLowerCase();
-		return (name === "input" || name === "button") && elem.type === type;
-	};
-}
-
-/**
- * Returns a function to use in pseudos for positionals
- * @param {Function} fn
- */
-function createPositionalPseudo( fn ) {
-	return markFunction(function( argument ) {
-		argument = +argument;
-		return markFunction(function( seed, matches ) {
-			var j,
-				matchIndexes = fn( [], seed.length, argument ),
-				i = matchIndexes.length;
-
-			// Match elements found at the specified indexes
-			while ( i-- ) {
-				if ( seed[ (j = matchIndexes[i]) ] ) {
-					seed[j] = !(matches[j] = seed[j]);
-				}
-			}
-		});
-	});
-}
-
-/**
- * Checks a node for validity as a Sizzle context
- * @param {Element|Object=} context
- * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
- */
-function testContext( context ) {
-	return context && typeof context.getElementsByTagName !== "undefined" && context;
-}
-
-// Expose support vars for convenience
-support = Sizzle.support = {};
-
-/**
- * Detects XML nodes
- * @param {Element|Object} elem An element or a document
- * @returns {Boolean} True iff elem is a non-HTML XML node
- */
-isXML = Sizzle.isXML = function( elem ) {
-	// documentElement is verified for cases where it doesn't yet exist
-	// (such as loading iframes in IE - #4833)
-	var documentElement = elem && (elem.ownerDocument || elem).documentElement;
-	return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-/**
- * Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
- * @returns {Object} Returns the current document
- */
-setDocument = Sizzle.setDocument = function( node ) {
-	var hasCompare, parent,
-		doc = node ? node.ownerDocument || node : preferredDoc;
-
-	// If no document and documentElement is available, return
-	if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
-		return document;
-	}
-
-	// Set our document
-	document = doc;
-	docElem = doc.documentElement;
-	parent = doc.defaultView;
-
-	// Support: IE>8
-	// If iframe document is assigned to "document" variable and if iframe has been reloaded,
-	// IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
-	// IE6-8 do not support the defaultView property so parent will be undefined
-	if ( parent && parent !== parent.top ) {
-		// IE11 does not have attachEvent, so all must suffer
-		if ( parent.addEventListener ) {
-			parent.addEventListener( "unload", unloadHandler, false );
-		} else if ( parent.attachEvent ) {
-			parent.attachEvent( "onunload", unloadHandler );
-		}
-	}
-
-	/* Support tests
-	---------------------------------------------------------------------- */
-	documentIsHTML = !isXML( doc );
-
-	/* Attributes
-	---------------------------------------------------------------------- */
-
-	// Support: IE<8
-	// Verify that getAttribute really returns attributes and not properties
-	// (excepting IE8 booleans)
-	support.attributes = assert(function( div ) {
-		div.className = "i";
-		return !div.getAttribute("className");
-	});
-
-	/* getElement(s)By*
-	---------------------------------------------------------------------- */
-
-	// Check if getElementsByTagName("*") returns only elements
-	support.getElementsByTagName = assert(function( div ) {
-		div.appendChild( doc.createComment("") );
-		return !div.getElementsByTagName("*").length;
-	});
-
-	// Support: IE<9
-	support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
-
-	// Support: IE<10
-	// Check if getElementById returns elements by name
-	// The broken getElementById methods don't pick up programatically-set names,
-	// so use a roundabout getElementsByName test
-	support.getById = assert(function( div ) {
-		docElem.appendChild( div ).id = expando;
-		return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
-	});
-
-	// ID find and filter
-	if ( support.getById ) {
-		Expr.find["ID"] = function( id, context ) {
-			if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
-				var m = context.getElementById( id );
-				// Check parentNode to catch when Blackberry 4.6 returns
-				// nodes that are no longer in the document #6963
-				return m && m.parentNode ? [ m ] : [];
-			}
-		};
-		Expr.filter["ID"] = function( id ) {
-			var attrId = id.replace( runescape, funescape );
-			return function( elem ) {
-				return elem.getAttribute("id") === attrId;
-			};
-		};
-	} else {
-		// Support: IE6/7
-		// getElementById is not reliable as a find shortcut
-		delete Expr.find["ID"];
-
-		Expr.filter["ID"] =  function( id ) {
-			var attrId = id.replace( runescape, funescape );
-			return function( elem ) {
-				var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-				return node && node.value === attrId;
-			};
-		};
-	}
-
-	// Tag
-	Expr.find["TAG"] = support.getElementsByTagName ?
-		function( tag, context ) {
-			if ( typeof context.getElementsByTagName !== "undefined" ) {
-				return context.getElementsByTagName( tag );
-
-			// DocumentFragment nodes don't have gEBTN
-			} else if ( support.qsa ) {
-				return context.querySelectorAll( tag );
-			}
-		} :
-
-		function( tag, context ) {
-			var elem,
-				tmp = [],
-				i = 0,
-				// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
-				results = context.getElementsByTagName( tag );
-
-			// Filter out possible comments
-			if ( tag === "*" ) {
-				while ( (elem = results[i++]) ) {
-					if ( elem.nodeType === 1 ) {
-						tmp.push( elem );
-					}
-				}
-
-				return tmp;
-			}
-			return results;
-		};
-
-	// Class
-	Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
-		if ( documentIsHTML ) {
-			return context.getElementsByClassName( className );
-		}
-	};
-
-	/* QSA/matchesSelector
-	---------------------------------------------------------------------- */
-
-	// QSA and matchesSelector support
-
-	// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
-	rbuggyMatches = [];
-
-	// qSa(:focus) reports false when true (Chrome 21)
-	// We allow this because of a bug in IE8/9 that throws an error
-	// whenever `document.activeElement` is accessed on an iframe
-	// So, we allow :focus to pass through QSA all the time to avoid the IE error
-	// See http://bugs.jquery.com/ticket/13378
-	rbuggyQSA = [];
-
-	if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
-		// Build QSA regex
-		// Regex strategy adopted from Diego Perini
-		assert(function( div ) {
-			// Select is set to empty string on purpose
-			// This is to test IE's treatment of not explicitly
-			// setting a boolean content attribute,
-			// since its presence should be enough
-			// http://bugs.jquery.com/ticket/12359
-			docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
-				"<select id='" + expando + "-\f]' msallowcapture=''>" +
-				"<option selected=''></option></select>";
-
-			// Support: IE8, Opera 11-12.16
-			// Nothing should be selected when empty strings follow ^= or $= or *=
-			// The test attribute must be unknown in Opera but "safe" for WinRT
-			// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
-			if ( div.querySelectorAll("[msallowcapture^='']").length ) {
-				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
-			}
-
-			// Support: IE8
-			// Boolean attributes and "value" are not treated correctly
-			if ( !div.querySelectorAll("[selected]").length ) {
-				rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
-			}
-
-			// Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
-			if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
-				rbuggyQSA.push("~=");
-			}
-
-			// Webkit/Opera - :checked should return selected option elements
-			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
-			// IE8 throws error here and will not see later tests
-			if ( !div.querySelectorAll(":checked").length ) {
-				rbuggyQSA.push(":checked");
-			}
-
-			// Support: Safari 8+, iOS 8+
-			// https://bugs.webkit.org/show_bug.cgi?id=136851
-			// In-page `selector#id sibing-combinator selector` fails
-			if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
-				rbuggyQSA.push(".#.+[+~]");
-			}
-		});
-
-		assert(function( div ) {
-			// Support: Windows 8 Native Apps
-			// The type and name attributes are restricted during .innerHTML assignment
-			var input = doc.createElement("input");
-			input.setAttribute( "type", "hidden" );
-			div.appendChild( input ).setAttribute( "name", "D" );
-
-			// Support: IE8
-			// Enforce case-sensitivity of name attribute
-			if ( div.querySelectorAll("[name=d]").length ) {
-				rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
-			}
-
-			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
-			// IE8 throws error here and will not see later tests
-			if ( !div.querySelectorAll(":enabled").length ) {
-				rbuggyQSA.push( ":enabled", ":disabled" );
-			}
-
-			// Opera 10-11 does not throw on post-comma invalid pseudos
-			div.querySelectorAll("*,:x");
-			rbuggyQSA.push(",.*:");
-		});
-	}
-
-	if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
-		docElem.webkitMatchesSelector ||
-		docElem.mozMatchesSelector ||
-		docElem.oMatchesSelector ||
-		docElem.msMatchesSelector) )) ) {
-
-		assert(function( div ) {
-			// Check to see if it's possible to do matchesSelector
-			// on a disconnected node (IE 9)
-			support.disconnectedMatch = matches.call( div, "div" );
-
-			// This should fail with an exception
-			// Gecko does not error, returns false instead
-			matches.call( div, "[s!='']:x" );
-			rbuggyMatches.push( "!=", pseudos );
-		});
-	}
-
-	rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
-	rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
-
-	/* Contains
-	---------------------------------------------------------------------- */
-	hasCompare = rnative.test( docElem.compareDocumentPosition );
-
-	// Element contains another
-	// Purposefully does not implement inclusive descendent
-	// As in, an element does not contain itself
-	contains = hasCompare || rnative.test( docElem.contains ) ?
-		function( a, b ) {
-			var adown = a.nodeType === 9 ? a.documentElement : a,
-				bup = b && b.parentNode;
-			return a === bup || !!( bup && bup.nodeType === 1 && (
-				adown.contains ?
-					adown.contains( bup ) :
-					a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
-			));
-		} :
-		function( a, b ) {
-			if ( b ) {
-				while ( (b = b.parentNode) ) {
-					if ( b === a ) {
-						return true;
-					}
-				}
-			}
-			return false;
-		};
-
-	/* Sorting
-	---------------------------------------------------------------------- */
-
-	// Document order sorting
-	sortOrder = hasCompare ?
-	function( a, b ) {
-
-		// Flag for duplicate removal
-		if ( a === b ) {
-			hasDuplicate = true;
-			return 0;
-		}
-
-		// Sort on method existence if only one input has compareDocumentPosition
-		var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
-		if ( compare ) {
-			return compare;
-		}
-
-		// Calculate position if both inputs belong to the same document
-		compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
-			a.compareDocumentPosition( b ) :
-
-			// Otherwise we know they are disconnected
-			1;
-
-		// Disconnected nodes
-		if ( compare & 1 ||
-			(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
-
-			// Choose the first element that is related to our preferred document
-			if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
-				return -1;
-			}
-			if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
-				return 1;
-			}
-
-			// Maintain original order
-			return sortInput ?
-				( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
-				0;
-		}
-
-		return compare & 4 ? -1 : 1;
-	} :
-	function( a, b ) {
-		// Exit early if the nodes are identical
-		if ( a === b ) {
-			hasDuplicate = true;
-			return 0;
-		}
-
-		var cur,
-			i = 0,
-			aup = a.parentNode,
-			bup = b.parentNode,
-			ap = [ a ],
-			bp = [ b ];
-
-		// Parentless nodes are either documents or disconnected
-		if ( !aup || !bup ) {
-			return a === doc ? -1 :
-				b === doc ? 1 :
-				aup ? -1 :
-				bup ? 1 :
-				sortInput ?
-				( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
-				0;
-
-		// If the nodes are siblings, we can do a quick check
-		} else if ( aup === bup ) {
-			return siblingCheck( a, b );
-		}
-
-		// Otherwise we need full lists of their ancestors for comparison
-		cur = a;
-		while ( (cur = cur.parentNode) ) {
-			ap.unshift( cur );
-		}
-		cur = b;
-		while ( (cur = cur.parentNode) ) {
-			bp.unshift( cur );
-		}
-
-		// Walk down the tree looking for a discrepancy
-		while ( ap[i] === bp[i] ) {
-			i++;
-		}
-
-		return i ?
-			// Do a sibling check if the nodes have a common ancestor
-			siblingCheck( ap[i], bp[i] ) :
-
-			// Otherwise nodes in our document sort first
-			ap[i] === preferredDoc ? -1 :
-			bp[i] === preferredDoc ? 1 :
-			0;
-	};
-
-	return doc;
-};
-
-Sizzle.matches = function( expr, elements ) {
-	return Sizzle( expr, null, null, elements );
-};
-
-Sizzle.matchesSelector = function( elem, expr ) {
-	// Set document vars if needed
-	if ( ( elem.ownerDocument || elem ) !== document ) {
-		setDocument( elem );
-	}
-
-	// Make sure that attribute selectors are quoted
-	expr = expr.replace( rattributeQuotes, "='$1']" );
-
-	if ( support.matchesSelector && documentIsHTML &&
-		( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
-		( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
-
-		try {
-			var ret = matches.call( elem, expr );
-
-			// IE 9's matchesSelector returns false on disconnected nodes
-			if ( ret || support.disconnectedMatch ||
-					// As well, disconnected nodes are said to be in a document
-					// fragment in IE 9
-					elem.document && elem.document.nodeType !== 11 ) {
-				return ret;
-			}
-		} catch (e) {}
-	}
-
-	return Sizzle( expr, document, null, [ elem ] ).length > 0;
-};
-
-Sizzle.contains = function( context, elem ) {
-	// Set document vars if needed
-	if ( ( context.ownerDocument || context ) !== document ) {
-		setDocument( context );
-	}
-	return contains( context, elem );
-};
-
-Sizzle.attr = function( elem, name ) {
-	// Set document vars if needed
-	if ( ( elem.ownerDocument || elem ) !== document ) {
-		setDocument( elem );
-	}
-
-	var fn = Expr.attrHandle[ name.toLowerCase() ],
-		// Don't get fooled by Object.prototype properties (jQuery #13807)
-		val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
-			fn( elem, name, !documentIsHTML ) :
-			undefined;
-
-	return val !== undefined ?
-		val :
-		support.attributes || !documentIsHTML ?
-			elem.getAttribute( name ) :
-			(val = elem.getAttributeNode(name)) && val.specified ?
-				val.value :
-				null;
-};
-
-Sizzle.error = function( msg ) {
-	throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-/**
- * Document sorting and removing duplicates
- * @param {ArrayLike} results
- */
-Sizzle.uniqueSort = function( results ) {
-	var elem,
-		duplicates = [],
-		j = 0,
-		i = 0;
-
-	// Unless we *know* we can detect duplicates, assume their presence
-	hasDuplicate = !support.detectDuplicates;
-	sortInput = !support.sortStable && results.slice( 0 );
-	results.sort( sortOrder );
-
-	if ( hasDuplicate ) {
-		while ( (elem = results[i++]) ) {
-			if ( elem === results[ i ] ) {
-				j = duplicates.push( i );
-			}
-		}
-		while ( j-- ) {
-			results.splice( duplicates[ j ], 1 );
-		}
-	}
-
-	// Clear input after sorting to release objects
-	// See https://github.com/jquery/sizzle/pull/225
-	sortInput = null;
-
-	return results;
-};
-
-/**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-getText = Sizzle.getText = function( elem ) {
-	var node,
-		ret = "",
-		i = 0,
-		nodeType = elem.nodeType;
-
-	if ( !nodeType ) {
-		// If no nodeType, this is expected to be an array
-		while ( (node = elem[i++]) ) {
-			// Do not traverse comment nodes
-			ret += getText( node );
-		}
-	} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
-		// Use textContent for elements
-		// innerText usage removed for consistency of new lines (jQuery #11153)
-		if ( typeof elem.textContent === "string" ) {
-			return elem.textContent;
-		} else {
-			// Traverse its children
-			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
-				ret += getText( elem );
-			}
-		}
-	} else if ( nodeType === 3 || nodeType === 4 ) {
-		return elem.nodeValue;
-	}
-	// Do not include comment or processing instruction nodes
-
-	return ret;
-};
-
-Expr = Sizzle.selectors = {
-
-	// Can be adjusted by the user
-	cacheLength: 50,
-
-	createPseudo: markFunction,
-
-	match: matchExpr,
-
-	attrHandle: {},
-
-	find: {},
-
-	relative: {
-		">": { dir: "parentNode", first: true },
-		" ": { dir: "parentNode" },
-		"+": { dir: "previousSibling", first: true },
-		"~": { dir: "previousSibling" }
-	},
-
-	preFilter: {
-		"ATTR": function( match ) {
-			match[1] = match[1].replace( runescape, funescape );
-
-			// Move the given value to match[3] whether quoted or unquoted
-			match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
-
-			if ( match[2] === "~=" ) {
-				match[3] = " " + match[3] + " ";
-			}
-
-			return match.slice( 0, 4 );
-		},
-
-		"CHILD": function( match ) {
-			/* matches from matchExpr["CHILD"]
-				1 type (only|nth|...)
-				2 what (child|of-type)
-				3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
-				4 xn-component of xn+y argument ([+-]?\d*n|)
-				5 sign of xn-component
-				6 x of xn-component
-				7 sign of y-component
-				8 y of y-component
-			*/
-			match[1] = match[1].toLowerCase();
-
-			if ( match[1].slice( 0, 3 ) === "nth" ) {
-				// nth-* requires argument
-				if ( !match[3] ) {
-					Sizzle.error( match[0] );
-				}
-
-				// numeric x and y parameters for Expr.filter.CHILD
-				// remember that false/true cast respectively to 0/1
-				match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
-				match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
-
-			// other types prohibit arguments
-			} else if ( match[3] ) {
-				Sizzle.error( match[0] );
-			}
-
-			return match;
-		},
-
-		"PSEUDO": function( match ) {
-			var excess,
-				unquoted = !match[6] && match[2];
-
-			if ( matchExpr["CHILD"].test( match[0] ) ) {
-				return null;
-			}
-
-			// Accept quoted arguments as-is
-			if ( match[3] ) {
-				match[2] = match[4] || match[5] || "";
-
-			// Strip excess characters from unquoted arguments
-			} else if ( unquoted && rpseudo.test( unquoted ) &&
-				// Get excess from tokenize (recursively)
-				(excess = tokenize( unquoted, true )) &&
-				// advance to the next closing parenthesis
-				(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
-
-				// excess is a negative index
-				match[0] = match[0].slice( 0, excess );
-				match[2] = unquoted.slice( 0, excess );
-			}
-
-			// Return only captures needed by the pseudo filter method (type and argument)
-			return match.slice( 0, 3 );
-		}
-	},
-
-	filter: {
-
-		"TAG": function( nodeNameSelector ) {
-			var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
-			return nodeNameSelector === "*" ?
-				function() { return true; } :
-				function( elem ) {
-					return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
-				};
-		},
-
-		"CLASS": function( className ) {
-			var pattern = classCache[ className + " " ];
-
-			return pattern ||
-				(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
-				classCache( className, function( elem ) {
-					return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
-				});
-		},
-
-		"ATTR": function( name, operator, check ) {
-			return function( elem ) {
-				var result = Sizzle.attr( elem, name );
-
-				if ( result == null ) {
-					return operator === "!=";
-				}
-				if ( !operator ) {
-					return true;
-				}
-
-				result += "";
-
-				return operator === "=" ? result === check :
-					operator === "!=" ? result !== check :
-					operator === "^=" ? check && result.indexOf( check ) === 0 :
-					operator === "*=" ? check && result.indexOf( check ) > -1 :
-					operator === "$=" ? check && result.slice( -check.length ) === check :
-					operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
-					operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
-					false;
-			};
-		},
-
-		"CHILD": function( type, what, argument, first, last ) {
-			var simple = type.slice( 0, 3 ) !== "nth",
-				forward = type.slice( -4 ) !== "last",
-				ofType = what === "of-type";
-
-			return first === 1 && last === 0 ?
-
-				// Shortcut for :nth-*(n)
-				function( elem ) {
-					return !!elem.parentNode;
-				} :
-
-				function( elem, context, xml ) {
-					var cache, outerCache, node, diff, nodeIndex, start,
-						dir = simple !== forward ? "nextSibling" : "previousSibling",
-						parent = elem.parentNode,
-						name = ofType && elem.nodeName.toLowerCase(),
-						useCache = !xml && !ofType;
-
-					if ( parent ) {
-
-						// :(first|last|only)-(child|of-type)
-						if ( simple ) {
-							while ( dir ) {
-								node = elem;
-								while ( (node = node[ dir ]) ) {
-									if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
-										return false;
-									}
-								}
-								// Reverse direction for :only-* (if we haven't yet done so)
-								start = dir = type === "only" && !start && "nextSibling";
-							}
-							return true;
-						}
-
-						start = [ forward ? parent.firstChild : parent.lastChild ];
-
-						// non-xml :nth-child(...) stores cache data on `parent`
-						if ( forward && useCache ) {
-							// Seek `elem` from a previously-cached index
-							outerCache = parent[ expando ] || (parent[ expando ] = {});
-							cache = outerCache[ type ] || [];
-							nodeIndex = cache[0] === dirruns && cache[1];
-							diff = cache[0] === dirruns && cache[2];
-							node = nodeIndex && parent.childNodes[ nodeIndex ];
-
-							while ( (node = ++nodeIndex && node && node[ dir ] ||
-
-								// Fallback to seeking `elem` from the start
-								(diff = nodeIndex = 0) || start.pop()) ) {
-
-								// When found, cache indexes on `parent` and break
-								if ( node.nodeType === 1 && ++diff && node === elem ) {
-									outerCache[ type ] = [ dirruns, nodeIndex, diff ];
-									break;
-								}
-							}
-
-						// Use previously-cached element index if available
-						} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
-							diff = cache[1];
-
-						// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
-						} else {
-							// Use the same loop as above to seek `elem` from the start
-							while ( (node = ++nodeIndex && node && node[ dir ] ||
-								(diff = nodeIndex = 0) || start.pop()) ) {
-
-								if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
-									// Cache the index of each encountered element
-									if ( useCache ) {
-										(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
-									}
-
-									if ( node === elem ) {
-										break;
-									}
-								}
-							}
-						}
-
-						// Incorporate the offset, then check against cycle size
-						diff -= last;
-						return diff === first || ( diff % first === 0 && diff / first >= 0 );
-					}
-				};
-		},
-
-		"PSEUDO": function( pseudo, argument ) {
-			// pseudo-class names are case-insensitive
-			// http://www.w3.org/TR/selectors/#pseudo-classes
-			// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
-			// Remember that setFilters inherits from pseudos
-			var args,
-				fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
-					Sizzle.error( "unsupported pseudo: " + pseudo );
-
-			// The user may use createPseudo to indicate that
-			// arguments are needed to create the filter function
-			// just as Sizzle does
-			if ( fn[ expando ] ) {
-				return fn( argument );
-			}
-
-			// But maintain support for old signatures
-			if ( fn.length > 1 ) {
-				args = [ pseudo, pseudo, "", argument ];
-				return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
-					markFunction(function( seed, matches ) {
-						var idx,
-							matched = fn( seed, argument ),
-							i = matched.length;
-						while ( i-- ) {
-							idx = indexOf( seed, matched[i] );
-							seed[ idx ] = !( matches[ idx ] = matched[i] );
-						}
-					}) :
-					function( elem ) {
-						return fn( elem, 0, args );
-					};
-			}
-
-			return fn;
-		}
-	},
-
-	pseudos: {
-		// Potentially complex pseudos
-		"not": markFunction(function( selector ) {
-			// Trim the selector passed to compile
-			// to avoid treating leading and trailing
-			// spaces as combinators
-			var input = [],
-				results = [],
-				matcher = compile( selector.replace( rtrim, "$1" ) );
-
-			return matcher[ expando ] ?
-				markFunction(function( seed, matches, context, xml ) {
-					var elem,
-						unmatched = matcher( seed, null, xml, [] ),
-						i = seed.length;
-
-					// Match elements unmatched by `matcher`
-					while ( i-- ) {
-						if ( (elem = unmatched[i]) ) {
-							seed[i] = !(matches[i] = elem);
-						}
-					}
-				}) :
-				function( elem, context, xml ) {
-					input[0] = elem;
-					matcher( input, null, xml, results );
-					// Don't keep the element (issue #299)
-					input[0] = null;
-					return !results.pop();
-				};
-		}),
-
-		"has": markFunction(function( selector ) {
-			return function( elem ) {
-				return Sizzle( selector, elem ).length > 0;
-			};
-		}),
-
-		"contains": markFunction(function( text ) {
-			text = text.replace( runescape, funescape );
-			return function( elem ) {
-				return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
-			};
-		}),
-
-		// "Whether an element is represented by a :lang() selector
-		// is based solely on the element's language value
-		// being equal to the identifier C,
-		// or beginning with the identifier C immediately followed by "-".
-		// The matching of C against the element's language value is performed case-insensitively.
-		// The identifier C does not have to be a valid language name."
-		// http://www.w3.org/TR/selectors/#lang-pseudo
-		"lang": markFunction( function( lang ) {
-			// lang value must be a valid identifier
-			if ( !ridentifier.test(lang || "") ) {
-				Sizzle.error( "unsupported lang: " + lang );
-			}
-			lang = lang.replace( runescape, funescape ).toLowerCase();
-			return function( elem ) {
-				var elemLang;
-				do {
-					if ( (elemLang = documentIsHTML ?
-						elem.lang :
-						elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
-
-						elemLang = elemLang.toLowerCase();
-						return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
-					}
-				} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
-				return false;
-			};
-		}),
-
-		// Miscellaneous
-		"target": function( elem ) {
-			var hash = window.location && window.location.hash;
-			return hash && hash.slice( 1 ) === elem.id;
-		},
-
-		"root": function( elem ) {
-			return elem === docElem;
-		},
-
-		"focus": function( elem ) {
-			return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
-		},
-
-		// Boolean properties
-		"enabled": function( elem ) {
-			return elem.disabled === false;
-		},
-
-		"disabled": function( elem ) {
-			return elem.disabled === true;
-		},
-
-		"checked": function( elem ) {
-			// In CSS3, :checked should return both checked and selected elements
-			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
-			var nodeName = elem.nodeName.toLowerCase();
-			return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
-		},
-
-		"selected": function( elem ) {
-			// Accessing this property makes selected-by-default
-			// options in Safari work properly
-			if ( elem.parentNode ) {
-				elem.parentNode.selectedIndex;
-			}
-
-			return elem.selected === true;
-		},
-
-		// Contents
-		"empty": function( elem ) {
-			// http://www.w3.org/TR/selectors/#empty-pseudo
-			// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
-			//   but not by others (comment: 8; processing instruction: 7; etc.)
-			// nodeType < 6 works because attributes (2) do not appear as children
-			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
-				if ( elem.nodeType < 6 ) {
-					return false;
-				}
-			}
-			return true;
-		},
-
-		"parent": function( elem ) {
-			return !Expr.pseudos["empty"]( elem );
-		},
-
-		// Element/input types
-		"header": function( elem ) {
-			return rheader.test( elem.nodeName );
-		},
-
-		"input": function( elem ) {
-			return rinputs.test( elem.nodeName );
-		},
-
-		"button": function( elem ) {
-			var name = elem.nodeName.toLowerCase();
-			return name === "input" && elem.type === "button" || name === "button";
-		},
-
-		"text": function( elem ) {
-			var attr;
-			return elem.nodeName.toLowerCase() === "input" &&
-				elem.type === "text" &&
-
-				// Support: IE<8
-				// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
-				( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
-		},
-
-		// Position-in-collection
-		"first": createPositionalPseudo(function() {
-			return [ 0 ];
-		}),
-
-		"last": createPositionalPseudo(function( matchIndexes, length ) {
-			return [ length - 1 ];
-		}),
-
-		"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			return [ argument < 0 ? argument + length : argument ];
-		}),
-
-		"even": createPositionalPseudo(function( matchIndexes, length ) {
-			var i = 0;
-			for ( ; i < length; i += 2 ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"odd": createPositionalPseudo(function( matchIndexes, length ) {
-			var i = 1;
-			for ( ; i < length; i += 2 ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			var i = argument < 0 ? argument + length : argument;
-			for ( ; --i >= 0; ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			var i = argument < 0 ? argument + length : argument;
-			for ( ; ++i < length; ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		})
-	}
-};
-
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
-// Add button/input type pseudos
-for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
-	Expr.pseudos[ i ] = createInputPseudo( i );
-}
-for ( i in { submit: true, reset: true } ) {
-	Expr.pseudos[ i ] = createButtonPseudo( i );
-}
-
-// Easy API for creating new setFilters
-function setFilters() {}
-setFilters.prototype = Expr.filters = Expr.pseudos;
-Expr.setFilters = new setFilters();
-
-tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
-	var matched, match, tokens, type,
-		soFar, groups, preFilters,
-		cached = tokenCache[ selector + " " ];
-
-	if ( cached ) {
-		return parseOnly ? 0 : cached.slice( 0 );
-	}
-
-	soFar = selector;
-	groups = [];
-	preFilters = Expr.preFilter;
-
-	while ( soFar ) {
-
-		// Comma and first run
-		if ( !matched || (match = rcomma.exec( soFar )) ) {
-			if ( match ) {
-				// Don't consume trailing commas as valid
-				soFar = soFar.slice( match[0].length ) || soFar;
-			}
-			groups.push( (tokens = []) );
-		}
-
-		matched = false;
-
-		// Combinators
-		if ( (match = rcombinators.exec( soFar )) ) {
-			matched = match.shift();
-			tokens.push({
-				value: matched,
-				// Cast descendant combinators to space
-				type: match[0].replace( rtrim, " " )
-			});
-			soFar = soFar.slice( matched.length );
-		}
-
-		// Filters
-		for ( type in Expr.filter ) {
-			if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
-				(match = preFilters[ type ]( match ))) ) {
-				matched = match.shift();
-				tokens.push({
-					value: matched,
-					type: type,
-					matches: match
-				});
-				soFar = soFar.slice( matched.length );
-			}
-		}
-
-		if ( !matched ) {
-			break;
-		}
-	}
-
-	// Return the length of the invalid excess
-	// if we're just parsing
-	// Otherwise, throw an error or return tokens
-	return parseOnly ?
-		soFar.length :
-		soFar ?
-			Sizzle.error( selector ) :
-			// Cache the tokens
-			tokenCache( selector, groups ).slice( 0 );
-};
-
-function toSelector( tokens ) {
-	var i = 0,
-		len = tokens.length,
-		selector = "";
-	for ( ; i < len; i++ ) {
-		selector += tokens[i].value;
-	}
-	return selector;
-}
-
-function addCombinator( matcher, combinator, base ) {
-	var dir = combinator.dir,
-		checkNonElements = base && dir === "parentNode",
-		doneName = done++;
-
-	return combinator.first ?
-		// Check against closest ancestor/preceding element
-		function( elem, context, xml ) {
-			while ( (elem = elem[ dir ]) ) {
-				if ( elem.nodeType === 1 || checkNonElements ) {
-					return matcher( elem, context, xml );
-				}
-			}
-		} :
-
-		// Check against all ancestor/preceding elements
-		function( elem, context, xml ) {
-			var oldCache, outerCache,
-				newCache = [ dirruns, doneName ];
-
-			// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
-			if ( xml ) {
-				while ( (elem = elem[ dir ]) ) {
-					if ( elem.nodeType === 1 || checkNonElements ) {
-						if ( matcher( elem, context, xml ) ) {
-							return true;
-						}
-					}
-				}
-			} else {
-				while ( (elem = elem[ dir ]) ) {
-					if ( elem.nodeType === 1 || checkNonElements ) {
-						outerCache = elem[ expando ] || (elem[ expando ] = {});
-						if ( (oldCache = outerCache[ dir ]) &&
-							oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
-
-							// Assign to newCache so results back-propagate to previous elements
-							return (newCache[ 2 ] = oldCache[ 2 ]);
-						} else {
-							// Reuse newcache so results back-propagate to previous elements
-							outerCache[ dir ] = newCache;
-
-							// A match means we're done; a fail means we have to keep checking
-							if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
-								return true;
-							}
-						}
-					}
-				}
-			}
-		};
-}
-
-function elementMatcher( matchers ) {
-	return matchers.length > 1 ?
-		function( elem, context, xml ) {
-			var i = matchers.length;
-			while ( i-- ) {
-				if ( !matchers[i]( elem, context, xml ) ) {
-					return false;
-				}
-			}
-			return true;
-		} :
-		matchers[0];
-}
-
-function multipleContexts( selector, contexts, results ) {
-	var i = 0,
-		len = contexts.length;
-	for ( ; i < len; i++ ) {
-		Sizzle( selector, contexts[i], results );
-	}
-	return results;
-}
-
-function condense( unmatched, map, filter, context, xml ) {
-	var elem,
-		newUnmatched = [],
-		i = 0,
-		len = unmatched.length,
-		mapped = map != null;
-
-	for ( ; i < len; i++ ) {
-		if ( (elem = unmatched[i]) ) {
-			if ( !filter || filter( elem, context, xml ) ) {
-				newUnmatched.push( elem );
-				if ( mapped ) {
-					map.push( i );
-				}
-			}
-		}
-	}
-
-	return newUnmatched;
-}
-
-function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
-	if ( postFilter && !postFilter[ expando ] ) {
-		postFilter = setMatcher( postFilter );
-	}
-	if ( postFinder && !postFinder[ expando ] ) {
-		postFinder = setMatcher( postFinder, postSelector );
-	}
-	return markFunction(function( seed, results, context, xml ) {
-		var temp, i, elem,
-			preMap = [],
-			postMap = [],
-			preexisting = results.length,
-
-			// Get initial elements from seed or context
-			elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
-
-			// Prefilter to get matcher input, preserving a map for seed-results synchronization
-			matcherIn = preFilter && ( seed || !selector ) ?
-				condense( elems, preMap, preFilter, context, xml ) :
-				elems,
-
-			matcherOut = matcher ?
-				// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
-				postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
-					// ...intermediate processing is necessary
-					[] :
-
-					// ...otherwise use results directly
-					results :
-				matcherIn;
-
-		// Find primary matches
-		if ( matcher ) {
-			matcher( matcherIn, matcherOut, context, xml );
-		}
-
-		// Apply postFilter
-		if ( postFilter ) {
-			temp = condense( matcherOut, postMap );
-			postFilter( temp, [], context, xml );
-
-			// Un-match failing elements by moving them back to matcherIn
-			i = temp.length;
-			while ( i-- ) {
-				if ( (elem = temp[i]) ) {
-					matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
-				}
-			}
-		}
-
-		if ( seed ) {
-			if ( postFinder || preFilter ) {
-				if ( postFinder ) {
-					// Get the final matcherOut by condensing this intermediate into postFinder contexts
-					temp = [];
-					i = matcherOut.length;
-					while ( i-- ) {
-						if ( (elem = matcherOut[i]) ) {
-							// Restore matcherIn since elem is not yet a final match
-							temp.push( (matcherIn[i] = elem) );
-						}
-					}
-					postFinder( null, (matcherOut = []), temp, xml );
-				}
-
-				// Move matched elements from seed to results to keep them synchronized
-				i = matcherOut.length;
-				while ( i-- ) {
-					if ( (elem = matcherOut[i]) &&
-						(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
-
-						seed[temp] = !(results[temp] = elem);
-					}
-				}
-			}
-
-		// Add elements to results, through postFinder if defined
-		} else {
-			matcherOut = condense(
-				matcherOut === results ?
-					matcherOut.splice( preexisting, matcherOut.length ) :
-					matcherOut
-			);
-			if ( postFinder ) {
-				postFinder( null, results, matcherOut, xml );
-			} else {
-				push.apply( results, matcherOut );
-			}
-		}
-	});
-}
-
-function matcherFromTokens( tokens ) {
-	var checkContext, matcher, j,
-		len = tokens.length,
-		leadingRelative = Expr.relative[ tokens[0].type ],
-		implicitRelative = leadingRelative || Expr.relative[" "],
-		i = leadingRelative ? 1 : 0,
-
-		// The foundational matcher ensures that elements are reachable from top-level context(s)
-		matchContext = addCombinator( function( elem ) {
-			return elem === checkContext;
-		}, implicitRelative, true ),
-		matchAnyContext = addCombinator( function( elem ) {
-			return indexOf( checkContext, elem ) > -1;
-		}, implicitRelative, true ),
-		matchers = [ function( elem, context, xml ) {
-			var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
-				(checkContext = context).nodeType ?
-					matchContext( elem, context, xml ) :
-					matchAnyContext( elem, context, xml ) );
-			// Avoid hanging onto element (issue #299)
-			checkContext = null;
-			return ret;
-		} ];
-
-	for ( ; i < len; i++ ) {
-		if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
-			matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
-		} else {
-			matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
-
-			// Return special upon seeing a positional matcher
-			if ( matcher[ expando ] ) {
-				// Find the next relative operator (if any) for proper handling
-				j = ++i;
-				for ( ; j < len; j++ ) {
-					if ( Expr.relative[ tokens[j].type ] ) {
-						break;
-					}
-				}
-				return setMatcher(
-					i > 1 && elementMatcher( matchers ),
-					i > 1 && toSelector(
-						// If the preceding token was a descendant combinator, insert an implicit any-element `*`
-						tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
-					).replace( rtrim, "$1" ),
-					matcher,
-					i < j && matcherFromTokens( tokens.slice( i, j ) ),
-					j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
-					j < len && toSelector( tokens )
-				);
-			}
-			matchers.push( matcher );
-		}
-	}
-
-	return elementMatcher( matchers );
-}
-
-function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
-	var bySet = setMatchers.length > 0,
-		byElement = elementMatchers.length > 0,
-		superMatcher = function( seed, context, xml, results, outermost ) {
-			var elem, j, matcher,
-				matchedCount = 0,
-				i = "0",
-				unmatched = seed && [],
-				setMatched = [],
-				contextBackup = outermostContext,
-				// We must always have either seed elements or outermost context
-				elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
-				// Use integer dirruns iff this is the outermost matcher
-				dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
-				len = elems.length;
-
-			if ( outermost ) {
-				outermostContext = context !== document && context;
-			}
-
-			// Add elements passing elementMatchers directly to results
-			// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
-			// Support: IE<9, Safari
-			// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
-			for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
-				if ( byElement && elem ) {
-					j = 0;
-					while ( (matcher = elementMatchers[j++]) ) {
-						if ( matcher( elem, context, xml ) ) {
-							results.push( elem );
-							break;
-						}
-					}
-					if ( outermost ) {
-						dirruns = dirrunsUnique;
-					}
-				}
-
-				// Track unmatched elements for set filters
-				if ( bySet ) {
-					// They will have gone through all possible matchers
-					if ( (elem = !matcher && elem) ) {
-						matchedCount--;
-					}
-
-					// Lengthen the array for every element, matched or not
-					if ( seed ) {
-						unmatched.push( elem );
-					}
-				}
-			}
-
-			// Apply set filters to unmatched elements
-			matchedCount += i;
-			if ( bySet && i !== matchedCount ) {
-				j = 0;
-				while ( (matcher = setMatchers[j++]) ) {
-					matcher( unmatched, setMatched, context, xml );
-				}
-
-				if ( seed ) {
-					// Reintegrate element matches to eliminate the need for sorting
-					if ( matchedCount > 0 ) {
-						while ( i-- ) {
-							if ( !(unmatched[i] || setMatched[i]) ) {
-								setMatched[i] = pop.call( results );
-							}
-						}
-					}
-
-					// Discard index placeholder values to get only actual matches
-					setMatched = condense( setMatched );
-				}
-
-				// Add matches to results
-				push.apply( results, setMatched );
-
-				// Seedless set matches succeeding multiple successful matchers stipulate sorting
-				if ( outermost && !seed && setMatched.length > 0 &&
-					( matchedCount + setMatchers.length ) > 1 ) {
-
-					Sizzle.uniqueSort( results );
-				}
-			}
-
-			// Override manipulation of globals by nested matchers
-			if ( outermost ) {
-				dirruns = dirrunsUnique;
-				outermostContext = contextBackup;
-			}
-
-			return unmatched;
-		};
-
-	return bySet ?
-		markFunction( superMatcher ) :
-		superMatcher;
-}
-
-compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
-	var i,
-		setMatchers = [],
-		elementMatchers = [],
-		cached = compilerCache[ selector + " " ];
-
-	if ( !cached ) {
-		// Generate a function of recursive functions that can be used to check each element
-		if ( !match ) {
-			match = tokenize( selector );
-		}
-		i = match.length;
-		while ( i-- ) {
-			cached = matcherFromTokens( match[i] );
-			if ( cached[ expando ] ) {
-				setMatchers.push( cached );
-			} else {
-				elementMatchers.push( cached );
-			}
-		}
-
-		// Cache the compiled function
-		cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
-
-		// Save selector and tokenization
-		cached.selector = selector;
-	}
-	return cached;
-};
-
-/**
- * A low-level selection function that works with Sizzle's compiled
- *  selector functions
- * @param {String|Function} selector A selector or a pre-compiled
- *  selector function built with Sizzle.compile
- * @param {Element} context
- * @param {Array} [results]
- * @param {Array} [seed] A set of elements to match against
- */
-select = Sizzle.select = function( selector, context, results, seed ) {
-	var i, tokens, token, type, find,
-		compiled = typeof selector === "function" && selector,
-		match = !seed && tokenize( (selector = compiled.selector || selector) );
-
-	results = results || [];
-
-	// Try to minimize operations if there is no seed and only one group
-	if ( match.length === 1 ) {
-
-		// Take a shortcut and set the context if the root selector is an ID
-		tokens = match[0] = match[0].slice( 0 );
-		if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
-				support.getById && context.nodeType === 9 && documentIsHTML &&
-				Expr.relative[ tokens[1].type ] ) {
-
-			context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
-			if ( !context ) {
-				return results;
-
-			// Precompiled matchers will still verify ancestry, so step up a level
-			} else if ( compiled ) {
-				context = context.parentNode;
-			}
-
-			selector = selector.slice( tokens.shift().value.length );
-		}
-
-		// Fetch a seed set for right-to-left matching
-		i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
-		while ( i-- ) {
-			token = tokens[i];
-
-			// Abort if we hit a combinator
-			if ( Expr.relative[ (type = token.type) ] ) {
-				break;
-			}
-			if ( (find = Expr.find[ type ]) ) {
-				// Search, expanding context for leading sibling combinators
-				if ( (seed = find(
-					token.matches[0].replace( runescape, funescape ),
-					rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
-				)) ) {
-
-					// If seed is empty or no tokens remain, we can return early
-					tokens.splice( i, 1 );
-					selector = seed.length && toSelector( tokens );
-					if ( !selector ) {
-						push.apply( results, seed );
-						return results;
-					}
-
-					break;
-				}
-			}
-		}
-	}
-
-	// Compile and execute a filtering function if one is not provided
-	// Provide `match` to avoid retokenization if we modified the selector above
-	( compiled || compile( selector, match ) )(
-		seed,
-		context,
-		!documentIsHTML,
-		results,
-		rsibling.test( selector ) && testContext( context.parentNode ) || context
-	);
-	return results;
-};
-
-// One-time assignments
-
-// Sort stability
-support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
-
-// Support: Chrome 14-35+
-// Always assume duplicates if they aren't passed to the comparison function
-support.detectDuplicates = !!hasDuplicate;
-
-// Initialize against the default document
-setDocument();
-
-// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
-// Detached nodes confoundingly follow *each other*
-support.sortDetached = assert(function( div1 ) {
-	// Should return 1, but returns 4 (following)
-	return div1.compareDocumentPosition( document.createElement("div") ) & 1;
-});
-
-// Support: IE<8
-// Prevent attribute/property "interpolation"
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !assert(function( div ) {
-	div.innerHTML = "<a href='#'></a>";
-	return div.firstChild.getAttribute("href") === "#" ;
-}) ) {
-	addHandle( "type|href|height|width", function( elem, name, isXML ) {
-		if ( !isXML ) {
-			return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
-		}
-	});
-}
-
-// Support: IE<9
-// Use defaultValue in place of getAttribute("value")
-if ( !support.attributes || !assert(function( div ) {
-	div.innerHTML = "<input/>";
-	div.firstChild.setAttribute( "value", "" );
-	return div.firstChild.getAttribute( "value" ) === "";
-}) ) {
-	addHandle( "value", function( elem, name, isXML ) {
-		if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
-			return elem.defaultValue;
-		}
-	});
-}
-
-// Support: IE<9
-// Use getAttributeNode to fetch booleans when getAttribute lies
-if ( !assert(function( div ) {
-	return div.getAttribute("disabled") == null;
-}) ) {
-	addHandle( booleans, function( elem, name, isXML ) {
-		var val;
-		if ( !isXML ) {
-			return elem[ name ] === true ? name.toLowerCase() :
-					(val = elem.getAttributeNode( name )) && val.specified ?
-					val.value :
-				null;
-		}
-	});
-}
-
-return Sizzle;
-
-})( window );
-
-
-
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.pseudos;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-
-var rneedsContext = jQuery.expr.match.needsContext;
-
-var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
-
-
-
-var risSimple = /^.[^:#\[\.,]*$/;
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, not ) {
-	if ( jQuery.isFunction( qualifier ) ) {
-		return jQuery.grep( elements, function( elem, i ) {
-			/* jshint -W018 */
-			return !!qualifier.call( elem, i, elem ) !== not;
-		});
-
-	}
-
-	if ( qualifier.nodeType ) {
-		return jQuery.grep( elements, function( elem ) {
-			return ( elem === qualifier ) !== not;
-		});
-
-	}
-
-	if ( typeof qualifier === "string" ) {
-		if ( risSimple.test( qualifier ) ) {
-			return jQuery.filter( qualifier, elements, not );
-		}
-
-		qualifier = jQuery.filter( qualifier, elements );
-	}
-
-	return jQuery.grep( elements, function( elem ) {
-		return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
-	});
-}
-
-jQuery.filter = function( expr, elems, not ) {
-	var elem = elems[ 0 ];
-
-	if ( not ) {
-		expr = ":not(" + expr + ")";
-	}
-
-	return elems.length === 1 && elem.nodeType === 1 ?
-		jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
-		jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
-			return elem.nodeType === 1;
-		}));
-};
-
-jQuery.fn.extend({
-	find: function( selector ) {
-		var i,
-			len = this.length,
-			ret = [],
-			self = this;
-
-		if ( typeof selector !== "string" ) {
-			return this.pushStack( jQuery( selector ).filter(function() {
-				for ( i = 0; i < len; i++ ) {
-					if ( jQuery.contains( self[ i ], this ) ) {
-						return true;
-					}
-				}
-			}) );
-		}
-
-		for ( i = 0; i < len; i++ ) {
-			jQuery.find( selector, self[ i ], ret );
-		}
-
-		// Needed because $( selector, context ) becomes $( context ).find( selector )
-		ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
-		ret.selector = this.selector ? this.selector + " " + selector : selector;
-		return ret;
-	},
-	filter: function( selector ) {
-		return this.pushStack( winnow(this, selector || [], false) );
-	},
-	not: function( selector ) {
-		return this.pushStack( winnow(this, selector || [], true) );
-	},
-	is: function( selector ) {
-		return !!winnow(
-			this,
-
-			// If this is a positional/relative selector, check membership in the returned set
-			// so $("p:first").is("p:last") won't return true for a doc with two "p".
-			typeof selector === "string" && rneedsContext.test( selector ) ?
-				jQuery( selector ) :
-				selector || [],
-			false
-		).length;
-	}
-});
-
-
-// Initialize a jQuery object
-
-
-// A central reference to the root jQuery(document)
-var rootjQuery,
-
-	// A simple way to check for HTML strings
-	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-	// Strict HTML recognition (#11290: must start with <)
-	rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
-
-	init = jQuery.fn.init = function( selector, context ) {
-		var match, elem;
-
-		// HANDLE: $(""), $(null), $(undefined), $(false)
-		if ( !selector ) {
-			return this;
-		}
-
-		// Handle HTML strings
-		if ( typeof selector === "string" ) {
-			if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
-				// Assume that strings that start and end with <> are HTML and skip the regex check
-				match = [ null, selector, null ];
-
-			} else {
-				match = rquickExpr.exec( selector );
-			}
-
-			// Match html or make sure no context is specified for #id
-			if ( match && (match[1] || !context) ) {
-
-				// HANDLE: $(html) -> $(array)
-				if ( match[1] ) {
-					context = context instanceof jQuery ? context[0] : context;
-
-					// Option to run scripts is true for back-compat
-					// Intentionally let the error be thrown if parseHTML is not present
-					jQuery.merge( this, jQuery.parseHTML(
-						match[1],
-						context && context.nodeType ? context.ownerDocument || context : document,
-						true
-					) );
-
-					// HANDLE: $(html, props)
-					if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
-						for ( match in context ) {
-							// Properties of context are called as methods if possible
-							if ( jQuery.isFunction( this[ match ] ) ) {
-								this[ match ]( context[ match ] );
-
-							// ...and otherwise set as attributes
-							} else {
-								this.attr( match, context[ match ] );
-							}
-						}
-					}
-
-					return this;
-
-				// HANDLE: $(#id)
-				} else {
-					elem = document.getElementById( match[2] );
-
-					// Support: Blackberry 4.6
-					// gEBID returns nodes no longer in the document (#6963)
-					if ( elem && elem.parentNode ) {
-						// Inject the element directly into the jQuery object
-						this.length = 1;
-						this[0] = elem;
-					}
-
-					this.context = document;
-					this.selector = selector;
-					return this;
-				}
-
-			// HANDLE: $(expr, $(...))
-			} else if ( !context || context.jquery ) {
-				return ( context || rootjQuery ).find( selector );
-
-			// HANDLE: $(expr, context)
-			// (which is just equivalent to: $(context).find(expr)
-			} else {
-				return this.constructor( context ).find( selector );
-			}
-
-		// HANDLE: $(DOMElement)
-		} else if ( selector.nodeType ) {
-			this.context = this[0] = selector;
-			this.length = 1;
-			return this;
-
-		// HANDLE: $(function)
-		// Shortcut for document ready
-		} else if ( jQuery.isFunction( selector ) ) {
-			return typeof rootjQuery.ready !== "undefined" ?
-				rootjQuery.ready( selector ) :
-				// Execute immediately if ready is not present
-				selector( jQuery );
-		}
-
-		if ( selector.selector !== undefined ) {
-			this.selector = selector.selector;
-			this.context = selector.context;
-		}
-
-		return jQuery.makeArray( selector, this );
-	};
-
-// Give the init function the jQuery prototype for later instantiation
-init.prototype = jQuery.fn;
-
-// Initialize central reference
-rootjQuery = jQuery( document );
-
-
-var rparentsprev = /^(?:parents|prev(?:Until|All))/,
-	// Methods guaranteed to produce a unique set when starting from a unique set
-	guaranteedUnique = {
-		children: true,
-		contents: true,
-		next: true,
-		prev: true
-	};
-
-jQuery.extend({
-	dir: function( elem, dir, until ) {
-		var matched = [],
-			truncate = until !== undefined;
-
-		while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
-			if ( elem.nodeType === 1 ) {
-				if ( truncate && jQuery( elem ).is( until ) ) {
-					break;
-				}
-				matched.push( elem );
-			}
-		}
-		return matched;
-	},
-
-	sibling: function( n, elem ) {
-		var matched = [];
-
-		for ( ; n; n = n.nextSibling ) {
-			if ( n.nodeType === 1 && n !== elem ) {
-				matched.push( n );
-			}
-		}
-
-		return matched;
-	}
-});
-
-jQuery.fn.extend({
-	has: function( target ) {
-		var targets = jQuery( target, this ),
-			l = targets.length;
-
-		return this.filter(function() {
-			var i = 0;
-			for ( ; i < l; i++ ) {
-				if ( jQuery.contains( this, targets[i] ) ) {
-					return true;
-				}
-			}
-		});
-	},
-
-	closest: function( selectors, context ) {
-		var cur,
-			i = 0,
-			l = this.length,
-			matched = [],
-			pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
-				jQuery( selectors, context || this.context ) :
-				0;
-
-		for ( ; i < l; i++ ) {
-			for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
-				// Always skip document fragments
-				if ( cur.nodeType < 11 && (pos ?
-					pos.index(cur) > -1 :
-
-					// Don't pass non-elements to Sizzle
-					cur.nodeType === 1 &&
-						jQuery.find.matchesSelector(cur, selectors)) ) {
-
-					matched.push( cur );
-					break;
-				}
-			}
-		}
-
-		return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
-	},
-
-	// Determine the position of an element within the set
-	index: function( elem ) {
-
-		// No argument, return index in parent
-		if ( !elem ) {
-			return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
-		}
-
-		// Index in selector
-		if ( typeof elem === "string" ) {
-			return indexOf.call( jQuery( elem ), this[ 0 ] );
-		}
-
-		// Locate the position of the desired element
-		return indexOf.call( this,
-
-			// If it receives a jQuery object, the first element is used
-			elem.jquery ? elem[ 0 ] : elem
-		);
-	},
-
-	add: function( selector, context ) {
-		return this.pushStack(
-			jQuery.unique(
-				jQuery.merge( this.get(), jQuery( selector, context ) )
-			)
-		);
-	},
-
-	addBack: function( selector ) {
-		return this.add( selector == null ?
-			this.prevObject : this.prevObject.filter(selector)
-		);
-	}
-});
-
-function sibling( cur, dir ) {
-	while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
-	return cur;
-}
-
-jQuery.each({
-	parent: function( elem ) {
-		var parent = elem.parentNode;
-		return parent && parent.nodeType !== 11 ? parent : null;
-	},
-	parents: function( elem ) {
-		return jQuery.dir( elem, "parentNode" );
-	},
-	parentsUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "parentNode", until );
-	},
-	next: function( elem ) {
-		return sibling( elem, "nextSibling" );
-	},
-	prev: function( elem ) {
-		return sibling( elem, "previousSibling" );
-	},
-	nextAll: function( elem ) {
-		return jQuery.dir( elem, "nextSibling" );
-	},
-	prevAll: function( elem ) {
-		return jQuery.dir( elem, "previousSibling" );
-	},
-	nextUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "nextSibling", until );
-	},
-	prevUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "previousSibling", until );
-	},
-	siblings: function( elem ) {
-		return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
-	},
-	children: function( elem ) {
-		return jQuery.sibling( elem.firstChild );
-	},
-	contents: function( elem ) {
-		return elem.contentDocument || jQuery.merge( [], elem.childNodes );
-	}
-}, function( name, fn ) {
-	jQuery.fn[ name ] = function( until, selector ) {
-		var matched = jQuery.map( this, fn, until );
-
-		if ( name.slice( -5 ) !== "Until" ) {
-			selector = until;
-		}
-
-		if ( selector && typeof selector === "string" ) {
-			matched = jQuery.filter( selector, matched );
-		}
-
-		if ( this.length > 1 ) {
-			// Remove duplicates
-			if ( !guaranteedUnique[ name ] ) {
-				jQuery.unique( matched );
-			}
-
-			// Reverse order for parents* and prev-derivatives
-			if ( rparentsprev.test( name ) ) {
-				matched.reverse();
-			}
-		}
-
-		return this.pushStack( matched );
-	};
-});
-var rnotwhite = (/\S+/g);
-
-
-
-// String to Object options format cache
-var optionsCache = {};
-
-// Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
-	var object = optionsCache[ options ] = {};
-	jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
-		object[ flag ] = true;
-	});
-	return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- *	options: an optional list of space-separated options that will change how
- *			the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- *	once:			will ensure the callback list can only be fired once (like a Deferred)
- *
- *	memory:			will keep track of previous values and will call any callback added
- *					after the list has been fired right away with the latest "memorized"
- *					values (like a Deferred)
- *
- *	unique:			will ensure a callback can only be added once (no duplicate in the list)
- *
- *	stopOnFalse:	interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( options ) {
-
-	// Convert options from String-formatted to Object-formatted if needed
-	// (we check in cache first)
-	options = typeof options === "string" ?
-		( optionsCache[ options ] || createOptions( options ) ) :
-		jQuery.extend( {}, options );
-
-	var // Last fire value (for non-forgettable lists)
-		memory,
-		// Flag to know if list was already fired
-		fired,
-		// Flag to know if list is currently firing
-		firing,
-		// First callback to fire (used internally by add and fireWith)
-		firingStart,
-		// End of the loop when firing
-		firingLength,
-		// Index of currently firing callback (modified by remove if needed)
-		firingIndex,
-		// Actual callback list
-		list = [],
-		// Stack of fire calls for repeatable lists
-		stack = !options.once && [],
-		// Fire callbacks
-		fire = function( data ) {
-			memory = options.memory && data;
-			fired = true;
-			firingIndex = firingStart || 0;
-			firingStart = 0;
-			firingLength = list.length;
-			firing = true;
-			for ( ; list && firingIndex < firingLength; firingIndex++ ) {
-				if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
-					memory = false; // To prevent further calls using add
-					break;
-				}
-			}
-			firing = false;
-			if ( list ) {
-				if ( stack ) {
-					if ( stack.length ) {
-						fire( stack.shift() );
-					}
-				} else if ( memory ) {
-					list = [];
-				} else {
-					self.disable();
-				}
-			}
-		},
-		// Actual Callbacks object
-		self = {
-			// Add a callback or a collection of callbacks to the list
-			add: function() {
-				if ( list ) {
-					// First, we save the current length
-					var start = list.length;
-					(function add( args ) {
-						jQuery.each( args, function( _, arg ) {
-							var type = jQuery.type( arg );
-							if ( type === "function" ) {
-								if ( !options.unique || !self.has( arg ) ) {
-									list.push( arg );
-								}
-							} else if ( arg && arg.length && type !== "string" ) {
-								// Inspect recursively
-								add( arg );
-							}
-						});
-					})( arguments );
-					// Do we need to add the callbacks to the
-					// current firing batch?
-					if ( firing ) {
-						firingLength = list.length;
-					// With memory, if we're not firing then
-					// we should call right away
-					} else if ( memory ) {
-						firingStart = start;
-						fire( memory );
-					}
-				}
-				return this;
-			},
-			// Remove a callback from the list
-			remove: function() {
-				if ( list ) {
-					jQuery.each( arguments, function( _, arg ) {
-						var index;
-						while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
-							list.splice( index, 1 );
-							// Handle firing indexes
-							if ( firing ) {
-								if ( index <= firingLength ) {
-									firingLength--;
-								}
-								if ( index <= firingIndex ) {
-									firingIndex--;
-								}
-							}
-						}
-					});
-				}
-				return this;
-			},
-			// Check if a given callback is in the list.
-			// If no argument is given, return whether or not list has callbacks attached.
-			has: function( fn ) {
-				return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
-			},
-			// Remove all callbacks from the list
-			empty: function() {
-				list = [];
-				firingLength = 0;
-				return this;
-			},
-			// Have the list do nothing anymore
-			disable: function() {
-				list = stack = memory = undefined;
-				return this;
-			},
-			// Is it disabled?
-			disabled: function() {
-				return !list;
-			},
-			// Lock the list in its current state
-			lock: function() {
-				stack = undefined;
-				if ( !memory ) {
-					self.disable();
-				}
-				return this;
-			},
-			// Is it locked?
-			locked: function() {
-				return !stack;
-			},
-			// Call all callbacks with the given context and arguments
-			fireWith: function( context, args ) {
-				if ( list && ( !fired || stack ) ) {
-					args = args || [];
-					args = [ context, args.slice ? args.slice() : args ];
-					if ( firing ) {
-						stack.push( args );
-					} else {
-						fire( args );
-					}
-				}
-				return this;
-			},
-			// Call all the callbacks with the given arguments
-			fire: function() {
-				self.fireWith( this, arguments );
-				return this;
-			},
-			// To know if the callbacks have already been called at least once
-			fired: function() {
-				return !!fired;
-			}
-		};
-
-	return self;
-};
-
-
-jQuery.extend({
-
-	Deferred: function( func ) {
-		var tuples = [
-				// action, add listener, listener list, final state
-				[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
-				[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
-				[ "notify", "progress", jQuery.Callbacks("memory") ]
-			],
-			state = "pending",
-			promise = {
-				state: function() {
-					return state;
-				},
-				always: function() {
-					deferred.done( arguments ).fail( arguments );
-					return this;
-				},
-				then: function( /* fnDone, fnFail, fnProgress */ ) {
-					var fns = arguments;
-					return jQuery.Deferred(function( newDefer ) {
-						jQuery.each( tuples, function( i, tuple ) {
-							var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
-							// deferred[ done | fail | progress ] for forwarding actions to newDefer
-							deferred[ tuple[1] ](function() {
-								var returned = fn && fn.apply( this, arguments );
-								if ( returned && jQuery.isFunction( returned.promise ) ) {
-									returned.promise()
-										.done( newDefer.resolve )
-										.fail( newDefer.reject )
-										.progress( newDefer.notify );
-								} else {
-									newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
-								}
-							});
-						});
-						fns = null;
-					}).promise();
-				},
-				// Get a promise for this deferred
-				// If obj is provided, the promise aspect is added to the object
-				promise: function( obj ) {
-					return obj != null ? jQuery.extend( obj, promise ) : promise;
-				}
-			},
-			deferred = {};
-
-		// Keep pipe for back-compat
-		promise.pipe = promise.then;
-
-		// Add list-specific methods
-		jQuery.each( tuples, function( i, tuple ) {
-			var list = tuple[ 2 ],
-				stateString = tuple[ 3 ];
-
-			// promise[ done | fail | progress ] = list.add
-			promise[ tuple[1] ] = list.add;
-
-			// Handle state
-			if ( stateString ) {
-				list.add(function() {
-					// state = [ resolved | rejected ]
-					state = stateString;
-
-				// [ reject_list | resolve_list ].disable; progress_list.lock
-				}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
-			}
-
-			// deferred[ resolve | reject | notify ]
-			deferred[ tuple[0] ] = function() {
-				deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
-				return this;
-			};
-			deferred[ tuple[0] + "With" ] = list.fireWith;
-		});
-
-		// Make the deferred a promise
-		promise.promise( deferred );
-
-		// Call given func if any
-		if ( func ) {
-			func.call( deferred, deferred );
-		}
-
-		// All done!
-		return deferred;
-	},
-
-	// Deferred helper
-	when: function( subordinate /* , ..., subordinateN */ ) {
-		var i = 0,
-			resolveValues = slice.call( arguments ),
-			length = resolveValues.length,
-
-			// the count of uncompleted subordinates
-			remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
-
-			// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
-			deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
-
-			// Update function for both resolve and progress values
-			updateFunc = function( i, contexts, values ) {
-				return function( value ) {
-					contexts[ i ] = this;
-					values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
-					if ( values === progressValues ) {
-						deferred.notifyWith( contexts, values );
-					} else if ( !( --remaining ) ) {
-						deferred.resolveWith( contexts, values );
-					}
-				};
-			},
-
-			progressValues, progressContexts, resolveContexts;
-
-		// Add listeners to Deferred subordinates; treat others as resolved
-		if ( length > 1 ) {
-			progressValues = new Array( length );
-			progressContexts = new Array( length );
-			resolveContexts = new Array( length );
-			for ( ; i < length; i++ ) {
-				if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
-					resolveValues[ i ].promise()
-						.done( updateFunc( i, resolveContexts, resolveValues ) )
-						.fail( deferred.reject )
-						.progress( updateFunc( i, progressContexts, progressValues ) );
-				} else {
-					--remaining;
-				}
-			}
-		}
-
-		// If we're not waiting on anything, resolve the master
-		if ( !remaining ) {
-			deferred.resolveWith( resolveContexts, resolveValues );
-		}
-
-		return deferred.promise();
-	}
-});
-
-
-// The deferred used on DOM ready
-var readyList;
-
-jQuery.fn.ready = function( fn ) {
-	// Add the callback
-	jQuery.ready.promise().done( fn );
-
-	return this;
-};
-
-jQuery.extend({
-	// Is the DOM ready to be used? Set to true once it occurs.
-	isReady: false,
-
-	// A counter to track how many items to wait for before
-	// the ready event fires. See #6781
-	readyWait: 1,
-
-	// Hold (or release) the ready event
-	holdReady: function( hold ) {
-		if ( hold ) {
-			jQuery.readyWait++;
-		} else {
-			jQuery.ready( true );
-		}
-	},
-
-	// Handle when the DOM is ready
-	ready: function( wait ) {
-
-		// Abort if there are pending holds or we're already ready
-		if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
-			return;
-		}
-
-		// Remember that the DOM is ready
-		jQuery.isReady = true;
-
-		// If a normal DOM Ready event fired, decrement, and wait if need be
-		if ( wait !== true && --jQuery.readyWait > 0 ) {
-			return;
-		}
-
-		// If there are functions bound, to execute
-		readyList.resolveWith( document, [ jQuery ] );
-
-		// Trigger any bound ready events
-		if ( jQuery.fn.triggerHandler ) {
-			jQuery( document ).triggerHandler( "ready" );
-			jQuery( document ).off( "ready" );
-		}
-	}
-});
-
-/**
- * The ready event handler and self cleanup method
- */
-function completed() {
-	document.removeEventListener( "DOMContentLoaded", completed, false );
-	window.removeEventListener( "load", completed, false );
-	jQuery.ready();
-}
-
-jQuery.ready.promise = function( obj ) {
-	if ( !readyList ) {
-
-		readyList = jQuery.Deferred();
-
-		// Catch cases where $(document).ready() is called after the browser event has already occurred.
-		// We once tried to use readyState "interactive" here, but it caused issues like the one
-		// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
-		if ( document.readyState === "complete" ) {
-			// Handle it asynchronously to allow scripts the opportunity to delay ready
-			setTimeout( jQuery.ready );
-
-		} else {
-
-			// Use the handy event callback
-			document.addEventListener( "DOMContentLoaded", completed, false );
-
-			// A fallback to window.onload, that will always work
-			window.addEventListener( "load", completed, false );
-		}
-	}
-	return readyList.promise( obj );
-};
-
-// Kick off the DOM ready check even if the user does not
-jQuery.ready.promise();
-
-
-
-
-// Multifunctional method to get and set values of a collection
-// The value/s can optionally be executed if it's a function
-var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
-	var i = 0,
-		len = elems.length,
-		bulk = key == null;
-
-	// Sets many values
-	if ( jQuery.type( key ) === "object" ) {
-		chainable = true;
-		for ( i in key ) {
-			jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
-		}
-
-	// Sets one value
-	} else if ( value !== undefined ) {
-		chainable = true;
-
-		if ( !jQuery.isFunction( value ) ) {
-			raw = true;
-		}
-
-		if ( bulk ) {
-			// Bulk operations run against the entire set
-			if ( raw ) {
-				fn.call( elems, value );
-				fn = null;
-
-			// ...except when executing function values
-			} else {
-				bulk = fn;
-				fn = function( elem, key, value ) {
-					return bulk.call( jQuery( elem ), value );
-				};
-			}
-		}
-
-		if ( fn ) {
-			for ( ; i < len; i++ ) {
-				fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
-			}
-		}
-	}
-
-	return chainable ?
-		elems :
-
-		// Gets
-		bulk ?
-			fn.call( elems ) :
-			len ? fn( elems[0], key ) : emptyGet;
-};
-
-
-/**
- * Determines whether an object can have data
- */
-jQuery.acceptData = function( owner ) {
-	// Accepts only:
-	//  - Node
-	//    - Node.ELEMENT_NODE
-	//    - Node.DOCUMENT_NODE
-	//  - Object
-	//    - Any
-	/* jshint -W018 */
-	return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
-};
-
-
-function Data() {
-	// Support: Android<4,
-	// Old WebKit does not have Object.preventExtensions/freeze method,
-	// return new empty object instead with no [[set]] accessor
-	Object.defineProperty( this.cache = {}, 0, {
-		get: function() {
-			return {};
-		}
-	});
-
-	this.expando = jQuery.expando + Data.uid++;
-}
-
-Data.uid = 1;
-Data.accepts = jQuery.acceptData;
-
-Data.prototype = {
-	key: function( owner ) {
-		// We can accept data for non-element nodes in modern browsers,
-		// but we should not, see #8335.
-		// Always return the key for a frozen object.
-		if ( !Data.accepts( owner ) ) {
-			return 0;
-		}
-
-		var descriptor = {},
-			// Check if the owner object already has a cache key
-			unlock = owner[ this.expando ];
-
-		// If not, create one
-		if ( !unlock ) {
-			unlock = Data.uid++;
-
-			// Secure it in a non-enumerable, non-writable property
-			try {
-				descriptor[ this.expando ] = { value: unlock };
-				Object.defineProperties( owner, descriptor );
-
-			// Support: Android<4
-			// Fallback to a less secure definition
-			} catch ( e ) {
-				descriptor[ this.expando ] = unlock;
-				jQuery.extend( owner, descriptor );
-			}
-		}
-
-		// Ensure the cache object
-		if ( !this.cache[ unlock ] ) {
-			this.cache[ unlock ] = {};
-		}
-
-		return unlock;
-	},
-	set: function( owner, data, value ) {
-		var prop,
-			// There may be an unlock assigned to this node,
-			// if there is no entry for this "owner", create one inline
-			// and set the unlock as though an owner entry had always existed
-			unlock = this.key( owner ),
-			cache = this.cache[ unlock ];
-
-		// Handle: [ owner, key, value ] args
-		if ( typeof data === "string" ) {
-			cache[ data ] = value;
-
-		// Handle: [ owner, { properties } ] args
-		} else {
-			// Fresh assignments by object are shallow copied
-			if ( jQuery.isEmptyObject( cache ) ) {
-				jQuery.extend( this.cache[ unlock ], data );
-			// Otherwise, copy the properties one-by-one to the cache object
-			} else {
-				for ( prop in data ) {
-					cache[ prop ] = data[ prop ];
-				}
-			}
-		}
-		return cache;
-	},
-	get: function( owner, key ) {
-		// Either a valid cache is found, or will be created.
-		// New caches will be created and the unlock returned,
-		// allowing direct access to the newly created
-		// empty data object. A valid owner object must be provided.
-		var cache = this.cache[ this.key( owner ) ];
-
-		return key === undefined ?
-			cache : cache[ key ];
-	},
-	access: function( owner, key, value ) {
-		var stored;
-		// In cases where either:
-		//
-		//   1. No key was specified
-		//   2. A string key was specified, but no value provided
-		//
-		// Take the "read" path and allow the get method to determine
-		// which value to return, respectively either:
-		//
-		//   1. The entire cache object
-		//   2. The data stored at the key
-		//
-		if ( key === undefined ||
-				((key && typeof key === "string") && value === undefined) ) {
-
-			stored = this.get( owner, key );
-
-			return stored !== undefined ?
-				stored : this.get( owner, jQuery.camelCase(key) );
-		}
-
-		// [*]When the key is not a string, or both a key and value
-		// are specified, set or extend (existing objects) with either:
-		//
-		//   1. An object of properties
-		//   2. A key and value
-		//
-		this.set( owner, key, value );
-
-		// Since the "set" path can have two possible entry points
-		// return the expected data based on which path was taken[*]
-		return value !== undefined ? value : key;
-	},
-	remove: function( owner, key ) {
-		var i, name, camel,
-			unlock = this.key( owner ),
-			cache = this.cache[ unlock ];
-
-		if ( key === undefined ) {
-			this.cache[ unlock ] = {};
-
-		} else {
-			// Support array or space separated string of keys
-			if ( jQuery.isArray( key ) ) {
-				// If "name" is an array of keys...
-				// When data is initially created, via ("key", "val") signature,
-				// keys will be converted to camelCase.
-				// Since there is no way to tell _how_ a key was added, remove
-				// both plain key and camelCase key. #12786
-				// This will only penalize the array argument path.
-				name = key.concat( key.map( jQuery.camelCase ) );
-			} else {
-				camel = jQuery.camelCase( key );
-				// Try the string as a key before any manipulation
-				if ( key in cache ) {
-					name = [ key, camel ];
-				} else {
-					// If a key with the spaces exists, use it.
-					// Otherwise, create an array by matching non-whitespace
-					name = camel;
-					name = name in cache ?
-						[ name ] : ( name.match( rnotwhite ) || [] );
-				}
-			}
-
-			i = name.length;
-			while ( i-- ) {
-				delete cache[ name[ i ] ];
-			}
-		}
-	},
-	hasData: function( owner ) {
-		return !jQuery.isEmptyObject(
-			this.cache[ owner[ this.expando ] ] || {}
-		);
-	},
-	discard: function( owner ) {
-		if ( owner[ this.expando ] ) {
-			delete this.cache[ owner[ this.expando ] ];
-		}
-	}
-};
-var data_priv = new Data();
-
-var data_user = new Data();
-
-
-
-//	Implementation Summary
-//
-//	1. Enforce API surface and semantic compatibility with 1.9.x branch
-//	2. Improve the module's maintainability by reducing the storage
-//		paths to a single mechanism.
-//	3. Use the same single mechanism to support "private" and "user" data.
-//	4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
-//	5. Avoid exposing implementation details on user objects (eg. expando properties)
-//	6. Provide a clear path for implementation upgrade to WeakMap in 2014
-
-var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
-	rmultiDash = /([A-Z])/g;
-
-function dataAttr( elem, key, data ) {
-	var name;
-
-	// If nothing was found internally, try to fetch any
-	// data from the HTML5 data-* attribute
-	if ( data === undefined && elem.nodeType === 1 ) {
-		name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-		data = elem.getAttribute( name );
-
-		if ( typeof data === "string" ) {
-			try {
-				data = data === "true" ? true :
-					data === "false" ? false :
-					data === "null" ? null :
-					// Only convert to a number if it doesn't change the string
-					+data + "" === data ? +data :
-					rbrace.test( data ) ? jQuery.parseJSON( data ) :
-					data;
-			} catch( e ) {}
-
-			// Make sure we set the data so it isn't changed later
-			data_user.set( elem, key, data );
-		} else {
-			data = undefined;
-		}
-	}
-	return data;
-}
-
-jQuery.extend({
-	hasData: function( elem ) {
-		return data_user.hasData( elem ) || data_priv.hasData( elem );
-	},
-
-	data: function( elem, name, data ) {
-		return data_user.access( elem, name, data );
-	},
-
-	removeData: function( elem, name ) {
-		data_user.remove( elem, name );
-	},
-
-	// TODO: Now that all calls to _data and _removeData have been replaced
-	// with direct calls to data_priv methods, these can be deprecated.
-	_data: function( elem, name, data ) {
-		return data_priv.access( elem, name, data );
-	},
-
-	_removeData: function( elem, name ) {
-		data_priv.remove( elem, name );
-	}
-});
-
-jQuery.fn.extend({
-	data: function( key, value ) {
-		var i, name, data,
-			elem = this[ 0 ],
-			attrs = elem && elem.attributes;
-
-		// Gets all values
-		if ( key === undefined ) {
-			if ( this.length ) {
-				data = data_user.get( elem );
-
-				if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
-					i = attrs.length;
-					while ( i-- ) {
-
-						// Support: IE11+
-						// The attrs elements can be null (#14894)
-						if ( attrs[ i ] ) {
-							name = attrs[ i ].name;
-							if ( name.indexOf( "data-" ) === 0 ) {
-								name = jQuery.camelCase( name.slice(5) );
-								dataAttr( elem, name, data[ name ] );
-							}
-						}
-					}
-					data_priv.set( elem, "hasDataAttrs", true );
-				}
-			}
-
-			return data;
-		}
-
-		// Sets multiple values
-		if ( typeof key === "object" ) {
-			return this.each(function() {
-				data_user.set( this, key );
-			});
-		}
-
-		return access( this, function( value ) {
-			var data,
-				camelKey = jQuery.camelCase( key );
-
-			// The calling jQuery object (element matches) is not empty
-			// (and therefore has an element appears at this[ 0 ]) and the
-			// `value` parameter was not undefined. An empty jQuery object
-			// will result in `undefined` for elem = this[ 0 ] which will
-			// throw an exception if an attempt to read a data cache is made.
-			if ( elem && value === undefined ) {
-				// Attempt to get data from the cache
-				// with the key as-is
-				data = data_user.get( elem, key );
-				if ( data !== undefined ) {
-					return data;
-				}
-
-				// Attempt to get data from the cache
-				// with the key camelized
-				data = data_user.get( elem, camelKey );
-				if ( data !== undefined ) {
-					return data;
-				}
-
-				// Attempt to "discover" the data in
-				// HTML5 custom data-* attrs
-				data = dataAttr( elem, camelKey, undefined );
-				if ( data !== undefined ) {
-					return data;
-				}
-
-				// We tried really hard, but the data doesn't exist.
-				return;
-			}
-
-			// Set the data...
-			this.each(function() {
-				// First, attempt to store a copy or reference of any
-				// data that might've been store with a camelCased key.
-				var data = data_user.get( this, camelKey );
-
-				// For HTML5 data-* attribute interop, we have to
-				// store property names with dashes in a camelCase form.
-				// This might not apply to all properties...*
-				data_user.set( this, camelKey, value );
-
-				// *... In the case of properties that might _actually_
-				// have dashes, we need to also store a copy of that
-				// unchanged property.
-				if ( key.indexOf("-") !== -1 && data !== undefined ) {
-					data_user.set( this, key, value );
-				}
-			});
-		}, null, value, arguments.length > 1, null, true );
-	},
-
-	removeData: function( key ) {
-		return this.each(function() {
-			data_user.remove( this, key );
-		});
-	}
-});
-
-
-jQuery.extend({
-	queue: function( elem, type, data ) {
-		var queue;
-
-		if ( elem ) {
-			type = ( type || "fx" ) + "queue";
-			queue = data_priv.get( elem, type );
-
-			// Speed up dequeue by getting out quickly if this is just a lookup
-			if ( data ) {
-				if ( !queue || jQuery.isArray( data ) ) {
-					queue = data_priv.access( elem, type, jQuery.makeArray(data) );
-				} else {
-					queue.push( data );
-				}
-			}
-			return queue || [];
-		}
-	},
-
-	dequeue: function( elem, type ) {
-		type = type || "fx";
-
-		var queue = jQuery.queue( elem, type ),
-			startLength = queue.length,
-			fn = queue.shift(),
-			hooks = jQuery._queueHooks( elem, type ),
-			next = function() {
-				jQuery.dequeue( elem, type );
-			};
-
-		// If the fx queue is dequeued, always remove the progress sentinel
-		if ( fn === "inprogress" ) {
-			fn = queue.shift();
-			startLength--;
-		}
-
-		if ( fn ) {
-
-			// Add a progress sentinel to prevent the fx queue from being
-			// automatically dequeued
-			if ( type === "fx" ) {
-				queue.unshift( "inprogress" );
-			}
-
-			// Clear up the last queue stop function
-			delete hooks.stop;
-			fn.call( elem, next, hooks );
-		}
-
-		if ( !startLength && hooks ) {
-			hooks.empty.fire();
-		}
-	},
-
-	// Not public - generate a queueHooks object, or return the current one
-	_queueHooks: function( elem, type ) {
-		var key = type + "queueHooks";
-		return data_priv.get( elem, key ) || data_priv.access( elem, key, {
-			empty: jQuery.Callbacks("once memory").add(function() {
-				data_priv.remove( elem, [ type + "queue", key ] );
-			})
-		});
-	}
-});
-
-jQuery.fn.extend({
-	queue: function( type, data ) {
-		var setter = 2;
-
-		if ( typeof type !== "string" ) {
-			data = type;
-			type = "fx";
-			setter--;
-		}
-
-		if ( arguments.length < setter ) {
-			return jQuery.queue( this[0], type );
-		}
-
-		return data === undefined ?
-			this :
-			this.each(function() {
-				var queue = jQuery.queue( this, type, data );
-
-				// Ensure a hooks for this queue
-				jQuery._queueHooks( this, type );
-
-				if ( type === "fx" && queue[0] !== "inprogress" ) {
-					jQuery.dequeue( this, type );
-				}
-			});
-	},
-	dequeue: function( type ) {
-		return this.each(function() {
-			jQuery.dequeue( this, type );
-		});
-	},
-	clearQueue: function( type ) {
-		return this.queue( type || "fx", [] );
-	},
-	// Get a promise resolved when queues of a certain type
-	// are emptied (fx is the type by default)
-	promise: function( type, obj ) {
-		var tmp,
-			count = 1,
-			defer = jQuery.Deferred(),
-			elements = this,
-			i = this.length,
-			resolve = function() {
-				if ( !( --count ) ) {
-					defer.resolveWith( elements, [ elements ] );
-				}
-			};
-
-		if ( typeof type !== "string" ) {
-			obj = type;
-			type = undefined;
-		}
-		type = type || "fx";
-
-		while ( i-- ) {
-			tmp = data_priv.get( elements[ i ], type + "queueHooks" );
-			if ( tmp && tmp.empty ) {
-				count++;
-				tmp.empty.add( resolve );
-			}
-		}
-		resolve();
-		return defer.promise( obj );
-	}
-});
-var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
-
-var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
-
-var isHidden = function( elem, el ) {
-		// isHidden might be called from jQuery#filter function;
-		// in that case, element will be second argument
-		elem = el || elem;
-		return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
-	};
-
-var rcheckableType = (/^(?:checkbox|radio)$/i);
-
-
-
-(function() {
-	var fragment = document.createDocumentFragment(),
-		div = fragment.appendChild( document.createElement( "div" ) ),
-		input = document.createElement( "input" );
-
-	// Support: Safari<=5.1
-	// Check state lost if the name is set (#11217)
-	// Support: Windows Web Apps (WWA)
-	// `name` and `type` must use .setAttribute for WWA (#14901)
-	input.setAttribute( "type", "radio" );
-	input.setAttribute( "checked", "checked" );
-	input.setAttribute( "name", "t" );
-
-	div.appendChild( input );
-
-	// Support: Safari<=5.1, Android<4.2
-	// Older WebKit doesn't clone checked state correctly in fragments
-	support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
-	// Support: IE<=11+
-	// Make sure textarea (and checkbox) defaultValue is properly cloned
-	div.innerHTML = "<textarea>x</textarea>";
-	support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
-})();
-var strundefined = typeof undefined;
-
-
-
-support.focusinBubbles = "onfocusin" in window;
-
-
-var
-	rkeyEvent = /^key/,
-	rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
-	rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
-	rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
-
-function returnTrue() {
-	return true;
-}
-
-function returnFalse() {
-	return false;
-}
-
-function safeActiveElement() {
-	try {
-		return document.activeElement;
-	} catch ( err ) { }
-}
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
-	global: {},
-
-	add: function( elem, types, handler, data, selector ) {
-
-		var handleObjIn, eventHandle, tmp,
-			events, t, handleObj,
-			special, handlers, type, namespaces, origType,
-			elemData = data_priv.get( elem );
-
-		// Don't attach events to noData or text/comment nodes (but allow plain objects)
-		if ( !elemData ) {
-			return;
-		}
-
-		// Caller can pass in an object of custom data in lieu of the handler
-		if ( handler.handler ) {
-			handleObjIn = handler;
-			handler = handleObjIn.handler;
-			selector = handleObjIn.selector;
-		}
-
-		// Make sure that the handler has a unique ID, used to find/remove it later
-		if ( !handler.guid ) {
-			handler.guid = jQuery.guid++;
-		}
-
-		// Init the element's event structure and main handler, if this is the first
-		if ( !(events = elemData.events) ) {
-			events = elemData.events = {};
-		}
-		if ( !(eventHandle = elemData.handle) ) {
-			eventHandle = elemData.handle = function( e ) {
-				// Discard the second event of a jQuery.event.trigger() and
-				// when an event is called after a page has unloaded
-				return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
-					jQuery.event.dispatch.apply( elem, arguments ) : undefined;
-			};
-		}
-
-		// Handle multiple events separated by a space
-		types = ( types || "" ).match( rnotwhite ) || [ "" ];
-		t = types.length;
-		while ( t-- ) {
-			tmp = rtypenamespace.exec( types[t] ) || [];
-			type = origType = tmp[1];
-			namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
-			// There *must* be a type, no attaching namespace-only handlers
-			if ( !type ) {
-				continue;
-			}
-
-			// If event changes its type, use the special event handlers for the changed type
-			special = jQuery.event.special[ type ] || {};
-
-			// If selector defined, determine special event api type, otherwise given type
-			type = ( selector ? special.delegateType : special.bindType ) || type;
-
-			// Update special based on newly reset type
-			special = jQuery.event.special[ type ] || {};
-
-			// handleObj is passed to all event handlers
-			handleObj = jQuery.extend({
-				type: type,
-				origType: origType,
-				data: data,
-				handler: handler,
-				guid: handler.guid,
-				selector: selector,
-				needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
-				namespace: namespaces.join(".")
-			}, handleObjIn );
-
-			// Init the event handler queue if we're the first
-			if ( !(handlers = events[ type ]) ) {
-				handlers = events[ type ] = [];
-				handlers.delegateCount = 0;
-
-				// Only use addEventListener if the special events handler returns false
-				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-					if ( elem.addEventListener ) {
-						elem.addEventListener( type, eventHandle, false );
-					}
-				}
-			}
-
-			if ( special.add ) {
-				special.add.call( elem, handleObj );
-
-				if ( !handleObj.handler.guid ) {
-					handleObj.handler.guid = handler.guid;
-				}
-			}
-
-			// Add to the element's handler list, delegates in front
-			if ( selector ) {
-				handlers.splice( handlers.delegateCount++, 0, handleObj );
-			} else {
-				handlers.push( handleObj );
-			}
-
-			// Keep track of which events have ever been used, for event optimization
-			jQuery.event.global[ type ] = true;
-		}
-
-	},
-
-	// Detach an event or set of events from an element
-	remove: function( elem, types, handler, selector, mappedTypes ) {
-
-		var j, origCount, tmp,
-			events, t, handleObj,
-			special, handlers, type, namespaces, origType,
-			elemData = data_priv.hasData( elem ) && data_priv.get( elem );
-
-		if ( !elemData || !(events = elemData.events) ) {
-			return;
-		}
-
-		// Once for each type.namespace in types; type may be omitted
-		types = ( types || "" ).match( rnotwhite ) || [ "" ];
-		t = types.length;
-		while ( t-- ) {
-			tmp = rtypenamespace.exec( types[t] ) || [];
-			type = origType = tmp[1];
-			namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
-			// Unbind all events (on this namespace, if provided) for the element
-			if ( !type ) {
-				for ( type in events ) {
-					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
-				}
-				continue;
-			}
-
-			special = jQuery.event.special[ type ] || {};
-			type = ( selector ? special.delegateType : special.bindType ) || type;
-			handlers = events[ type ] || [];
-			tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
-
-			// Remove matching events
-			origCount = j = handlers.length;
-			while ( j-- ) {
-				handleObj = handlers[ j ];
-
-				if ( ( mappedTypes || origType === handleObj.origType ) &&
-					( !handler || handler.guid === handleObj.guid ) &&
-					( !tmp || tmp.test( handleObj.namespace ) ) &&
-					( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
-					handlers.splice( j, 1 );
-
-					if ( handleObj.selector ) {
-						handlers.delegateCount--;
-					}
-					if ( special.remove ) {
-						special.remove.call( elem, handleObj );
-					}
-				}
-			}
-
-			// Remove generic event handler if we removed something and no more handlers exist
-			// (avoids potential for endless recursion during removal of special event handlers)
-			if ( origCount && !handlers.length ) {
-				if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
-					jQuery.removeEvent( elem, type, elemData.handle );
-				}
-
-				delete events[ type ];
-			}
-		}
-
-		// Remove the expando if it's no longer used
-		if ( jQuery.isEmptyObject( events ) ) {
-			delete elemData.handle;
-			data_priv.remove( elem, "events" );
-		}
-	},
-
-	trigger: function( event, data, elem, onlyHandlers ) {
-
-		var i, cur, tmp, bubbleType, ontype, handle, special,
-			eventPath = [ elem || document ],
-			type = hasOwn.call( event, "type" ) ? event.type : event,
-			namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
-
-		cur = tmp = elem = elem || document;
-
-		// Don't do events on text and comment nodes
-		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return;
-		}
-
-		// focus/blur morphs to focusin/out; ensure we're not firing them right now
-		if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
-			return;
-		}
-
-		if ( type.indexOf(".") >= 0 ) {
-			// Namespaced trigger; create a regexp to match event type in handle()
-			namespaces = type.split(".");
-			type = namespaces.shift();
-			namespaces.sort();
-		}
-		ontype = type.indexOf(":") < 0 && "on" + type;
-
-		// Caller can pass in a jQuery.Event object, Object, or just an event type string
-		event = event[ jQuery.expando ] ?
-			event :
-			new jQuery.Event( type, typeof event === "object" && event );
-
-		// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
-		event.isTrigger = onlyHandlers ? 2 : 3;
-		event.namespace = namespaces.join(".");
-		event.namespace_re = event.namespace ?
-			new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
-			null;
-
-		// Clean up the event in case it is being reused
-		event.result = undefined;
-		if ( !event.target ) {
-			event.target = elem;
-		}
-
-		// Clone any incoming data and prepend the event, creating the handler arg list
-		data = data == null ?
-			[ event ] :
-			jQuery.makeArray( data, [ event ] );
-
-		// Allow special events to draw outside the lines
-		special = jQuery.event.special[ type ] || {};
-		if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
-			return;
-		}
-
-		// Determine event propagation path in advance, per W3C events spec (#9951)
-		// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
-		if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
-			bubbleType = special.delegateType || type;
-			if ( !rfocusMorph.test( bubbleType + type ) ) {
-				cur = cur.parentNode;
-			}
-			for ( ; cur; cur = cur.parentNode ) {
-				eventPath.push( cur );
-				tmp = cur;
-			}
-
-			// Only add window if we got to document (e.g., not plain obj or detached DOM)
-			if ( tmp === (elem.ownerDocument || document) ) {
-				eventPath.push( tmp.defaultView || tmp.parentWindow || window );
-			}
-		}
-
-		// Fire handlers on the event path
-		i = 0;
-		while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
-
-			event.type = i > 1 ?
-				bubbleType :
-				special.bindType || type;
-
-			// jQuery handler
-			handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
-			if ( handle ) {
-				handle.apply( cur, data );
-			}
-
-			// Native handler
-			handle = ontype && cur[ ontype ];
-			if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
-				event.result = handle.apply( cur, data );
-				if ( event.result === false ) {
-					event.preventDefault();
-				}
-			}
-		}
-		event.type = type;
-
-		// If nobody prevented the default action, do it now
-		if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
-			if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
-				jQuery.acceptData( elem ) ) {
-
-				// Call a native DOM method on the target with the same name name as the event.
-				// Don't do default actions on window, that's where global variables be (#6170)
-				if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
-
-					// Don't re-trigger an onFOO event when we call its FOO() method
-					tmp = elem[ ontype ];
-
-					if ( tmp ) {
-						elem[ ontype ] = null;
-					}
-
-					// Prevent re-triggering of the same event, since we already bubbled it above
-					jQuery.event.triggered = type;
-					elem[ type ]();
-					jQuery.event.triggered = undefined;
-
-					if ( tmp ) {
-						elem[ ontype ] = tmp;
-					}
-				}
-			}
-		}
-
-		return event.result;
-	},
-
-	dispatch: function( event ) {
-
-		// Make a writable jQuery.Event from the native event object
-		event = jQuery.event.fix( event );
-
-		var i, j, ret, matched, handleObj,
-			handlerQueue = [],
-			args = slice.call( arguments ),
-			handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
-			special = jQuery.event.special[ event.type ] || {};
-
-		// Use the fix-ed jQuery.Event rather than the (read-only) native event
-		args[0] = event;
-		event.delegateTarget = this;
-
-		// Call the preDispatch hook for the mapped type, and let it bail if desired
-		if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
-			return;
-		}
-
-		// Determine handlers
-		handlerQueue = jQuery.event.handlers.call( this, event, handlers );
-
-		// Run delegates first; they may want to stop propagation beneath us
-		i = 0;
-		while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
-			event.currentTarget = matched.elem;
-
-			j = 0;
-			while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
-
-				// Triggered event must either 1) have no namespace, or 2) have namespace(s)
-				// a subset or equal to those in the bound event (both can have no namespace).
-				if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
-
-					event.handleObj = handleObj;
-					event.data = handleObj.data;
-
-					ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
-							.apply( matched.elem, args );
-
-					if ( ret !== undefined ) {
-						if ( (event.result = ret) === false ) {
-							event.preventDefault();
-							event.stopPropagation();
-						}
-					}
-				}
-			}
-		}
-
-		// Call the postDispatch hook for the mapped type
-		if ( special.postDispatch ) {
-			special.postDispatch.call( this, event );
-		}
-
-		return event.result;
-	},
-
-	handlers: function( event, handlers ) {
-		var i, matches, sel, handleObj,
-			handlerQueue = [],
-			delegateCount = handlers.delegateCount,
-			cur = event.target;
-
-		// Find delegate handlers
-		// Black-hole SVG <use> instance trees (#13180)
-		// Avoid non-left-click bubbling in Firefox (#3861)
-		if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
-
-			for ( ; cur !== this; cur = cur.parentNode || this ) {
-
-				// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
-				if ( cur.disabled !== true || event.type !== "click" ) {
-					matches = [];
-					for ( i = 0; i < delegateCount; i++ ) {
-						handleObj = handlers[ i ];
-
-						// Don't conflict with Object.prototype properties (#13203)
-						sel = handleObj.selector + " ";
-
-						if ( matches[ sel ] === undefined ) {
-							matches[ sel ] = handleObj.needsContext ?
-								jQuery( sel, this ).index( cur ) >= 0 :
-								jQuery.find( sel, this, null, [ cur ] ).length;
-						}
-						if ( matches[ sel ] ) {
-							matches.push( handleObj );
-						}
-					}
-					if ( matches.length ) {
-						handlerQueue.push({ elem: cur, handlers: matches });
-					}
-				}
-			}
-		}
-
-		// Add the remaining (directly-bound) handlers
-		if ( delegateCount < handlers.length ) {
-			handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
-		}
-
-		return handlerQueue;
-	},
-
-	// Includes some event props shared by KeyEvent and MouseEvent
-	props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
-
-	fixHooks: {},
-
-	keyHooks: {
-		props: "char charCode key keyCode".split(" "),
-		filter: function( event, original ) {
-
-			// Add which for key events
-			if ( event.which == null ) {
-				event.which = original.charCode != null ? original.charCode : original.keyCode;
-			}
-
-			return event;
-		}
-	},
-
-	mouseHooks: {
-		props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
-		filter: function( event, original ) {
-			var eventDoc, doc, body,
-				button = original.button;
-
-			// Calculate pageX/Y if missing and clientX/Y available
-			if ( event.pageX == null && original.clientX != null ) {
-				eventDoc = event.target.ownerDocument || document;
-				doc = eventDoc.documentElement;
-				body = eventDoc.body;
-
-				event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
-				event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
-			}
-
-			// Add which for click: 1 === left; 2 === middle; 3 === right
-			// Note: button is not normalized, so don't use it
-			if ( !event.which && button !== undefined ) {
-				event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
-			}
-
-			return event;
-		}
-	},
-
-	fix: function( event ) {
-		if ( event[ jQuery.expando ] ) {
-			return event;
-		}
-
-		// Create a writable copy of the event object and normalize some properties
-		var i, prop, copy,
-			type = event.type,
-			originalEvent = event,
-			fixHook = this.fixHooks[ type ];
-
-		if ( !fixHook ) {
-			this.fixHooks[ type ] = fixHook =
-				rmouseEvent.test( type ) ? this.mouseHooks :
-				rkeyEvent.test( type ) ? this.keyHooks :
-				{};
-		}
-		copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
-		event = new jQuery.Event( originalEvent );
-
-		i = copy.length;
-		while ( i-- ) {
-			prop = copy[ i ];
-			event[ prop ] = originalEvent[ prop ];
-		}
-
-		// Support: Cordova 2.5 (WebKit) (#13255)
-		// All events should have a target; Cordova deviceready doesn't
-		if ( !event.target ) {
-			event.target = document;
-		}
-
-		// Support: Safari 6.0+, Chrome<28
-		// Target should not be a text node (#504, #13143)
-		if ( event.target.nodeType === 3 ) {
-			event.target = event.target.parentNode;
-		}
-
-		return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
-	},
-
-	special: {
-		load: {
-			// Prevent triggered image.load events from bubbling to window.load
-			noBubble: true
-		},
-		focus: {
-			// Fire native event if possible so blur/focus sequence is correct
-			trigger: function() {
-				if ( this !== safeActiveElement() && this.focus ) {
-					this.focus();
-					return false;
-				}
-			},
-			delegateType: "focusin"
-		},
-		blur: {
-			trigger: function() {
-				if ( this === safeActiveElement() && this.blur ) {
-					this.blur();
-					return false;
-				}
-			},
-			delegateType: "focusout"
-		},
-		click: {
-			// For checkbox, fire native event so checked state will be right
-			trigger: function() {
-				if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
-					this.click();
-					return false;
-				}
-			},
-
-			// For cross-browser consistency, don't fire native .click() on links
-			_default: function( event ) {
-				return jQuery.nodeName( event.target, "a" );
-			}
-		},
-
-		beforeunload: {
-			postDispatch: function( event ) {
-
-				// Support: Firefox 20+
-				// Firefox doesn't alert if the returnValue field is not set.
-				if ( event.result !== undefined && event.originalEvent ) {
-					event.originalEvent.returnValue = event.result;
-				}
-			}
-		}
-	},
-
-	simulate: function( type, elem, event, bubble ) {
-		// Piggyback on a donor event to simulate a different one.
-		// Fake originalEvent to avoid donor's stopPropagation, but if the
-		// simulated event prevents default then we do the same on the donor.
-		var e = jQuery.extend(
-			new jQuery.Event(),
-			event,
-			{
-				type: type,
-				isSimulated: true,
-				originalEvent: {}
-			}
-		);
-		if ( bubble ) {
-			jQuery.event.trigger( e, null, elem );
-		} else {
-			jQuery.event.dispatch.call( elem, e );
-		}
-		if ( e.isDefaultPrevented() ) {
-			event.preventDefault();
-		}
-	}
-};
-
-jQuery.removeEvent = function( elem, type, handle ) {
-	if ( elem.removeEventListener ) {
-		elem.removeEventListener( type, handle, false );
-	}
-};
-
-jQuery.Event = function( src, props ) {
-	// Allow instantiation without the 'new' keyword
-	if ( !(this instanceof jQuery.Event) ) {
-		return new jQuery.Event( src, props );
-	}
-
-	// Event object
-	if ( src && src.type ) {
-		this.originalEvent = src;
-		this.type = src.type;
-
-		// Events bubbling up the document may have been marked as prevented
-		// by a handler lower down the tree; reflect the correct value.
-		this.isDefaultPrevented = src.defaultPrevented ||
-				src.defaultPrevented === undefined &&
-				// Support: Android<4.0
-				src.returnValue === false ?
-			returnTrue :
-			returnFalse;
-
-	// Event type
-	} else {
-		this.type = src;
-	}
-
-	// Put explicitly provided properties onto the event object
-	if ( props ) {
-		jQuery.extend( this, props );
-	}
-
-	// Create a timestamp if incoming event doesn't have one
-	this.timeStamp = src && src.timeStamp || jQuery.now();
-
-	// Mark it as fixed
-	this[ jQuery.expando ] = true;
-};
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
-	isDefaultPrevented: returnFalse,
-	isPropagationStopped: returnFalse,
-	isImmediatePropagationStopped: returnFalse,
-
-	preventDefault: function() {
-		var e = this.originalEvent;
-
-		this.isDefaultPrevented = returnTrue;
-
-		if ( e && e.preventDefault ) {
-			e.preventDefault();
-		}
-	},
-	stopPropagation: function() {
-		var e = this.originalEvent;
-
-		this.isPropagationStopped = returnTrue;
-
-		if ( e && e.stopPropagation ) {
-			e.stopPropagation();
-		}
-	},
-	stopImmediatePropagation: function() {
-		var e = this.originalEvent;
-
-		this.isImmediatePropagationStopped = returnTrue;
-
-		if ( e && e.stopImmediatePropagation ) {
-			e.stopImmediatePropagation();
-		}
-
-		this.stopPropagation();
-	}
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-// Support: Chrome 15+
-jQuery.each({
-	mouseenter: "mouseover",
-	mouseleave: "mouseout",
-	pointerenter: "pointerover",
-	pointerleave: "pointerout"
-}, function( orig, fix ) {
-	jQuery.event.special[ orig ] = {
-		delegateType: fix,
-		bindType: fix,
-
-		handle: function( event ) {
-			var ret,
-				target = this,
-				related = event.relatedTarget,
-				handleObj = event.handleObj;
-
-			// For mousenter/leave call the handler if related is outside the target.
-			// NB: No relatedTarget if the mouse left/entered the browser window
-			if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
-				event.type = handleObj.origType;
-				ret = handleObj.handler.apply( this, arguments );
-				event.type = fix;
-			}
-			return ret;
-		}
-	};
-});
-
-// Support: Firefox, Chrome, Safari
-// Create "bubbling" focus and blur events
-if ( !support.focusinBubbles ) {
-	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
-		// Attach a single capturing handler on the document while someone wants focusin/focusout
-		var handler = function( event ) {
-				jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
-			};
-
-		jQuery.event.special[ fix ] = {
-			setup: function() {
-				var doc = this.ownerDocument || this,
-					attaches = data_priv.access( doc, fix );
-
-				if ( !attaches ) {
-					doc.addEventListener( orig, handler, true );
-				}
-				data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
-			},
-			teardown: function() {
-				var doc = this.ownerDocument || this,
-					attaches = data_priv.access( doc, fix ) - 1;
-
-				if ( !attaches ) {
-					doc.removeEventListener( orig, handler, true );
-					data_priv.remove( doc, fix );
-
-				} else {
-					data_priv.access( doc, fix, attaches );
-				}
-			}
-		};
-	});
-}
-
-jQuery.fn.extend({
-
-	on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
-		var origFn, type;
-
-		// Types can be a map of types/handlers
-		if ( typeof types === "object" ) {
-			// ( types-Object, selector, data )
-			if ( typeof selector !== "string" ) {
-				// ( types-Object, data )
-				data = data || selector;
-				selector = undefined;
-			}
-			for ( type in types ) {
-				this.on( type, selector, data, types[ type ], one );
-			}
-			return this;
-		}
-
-		if ( data == null && fn == null ) {
-			// ( types, fn )
-			fn = selector;
-			data = selector = undefined;
-		} else if ( fn == null ) {
-			if ( typeof selector === "string" ) {
-				// ( types, selector, fn )
-				fn = data;
-				data = undefined;
-			} else {
-				// ( types, data, fn )
-				fn = data;
-				data = selector;
-				selector = undefined;
-			}
-		}
-		if ( fn === false ) {
-			fn = returnFalse;
-		} else if ( !fn ) {
-			return this;
-		}
-
-		if ( one === 1 ) {
-			origFn = fn;
-			fn = function( event ) {
-				// Can use an empty set, since event contains the info
-				jQuery().off( event );
-				return origFn.apply( this, arguments );
-			};
-			// Use same guid so caller can remove using origFn
-			fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
-		}
-		return this.each( function() {
-			jQuery.event.add( this, types, fn, data, selector );
-		});
-	},
-	one: function( types, selector, data, fn ) {
-		return this.on( types, selector, data, fn, 1 );
-	},
-	off: function( types, selector, fn ) {
-		var handleObj, type;
-		if ( types && types.preventDefault && types.handleObj ) {
-			// ( event )  dispatched jQuery.Event
-			handleObj = types.handleObj;
-			jQuery( types.delegateTarget ).off(
-				handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
-				handleObj.selector,
-				handleObj.handler
-			);
-			return this;
-		}
-		if ( typeof types === "object" ) {
-			// ( types-object [, selector] )
-			for ( type in types ) {
-				this.off( type, selector, types[ type ] );
-			}
-			return this;
-		}
-		if ( selector === false || typeof selector === "function" ) {
-			// ( types [, fn] )
-			fn = selector;
-			selector = undefined;
-		}
-		if ( fn === false ) {
-			fn = returnFalse;
-		}
-		return this.each(function() {
-			jQuery.event.remove( this, types, fn, selector );
-		});
-	},
-
-	trigger: function( type, data ) {
-		return this.each(function() {
-			jQuery.event.trigger( type, data, this );
-		});
-	},
-	triggerHandler: function( type, data ) {
-		var elem = this[0];
-		if ( elem ) {
-			return jQuery.event.trigger( type, data, elem, true );
-		}
-	}
-});
-
-
-var
-	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
-	rtagName = /<([\w:]+)/,
-	rhtml = /<|&#?\w+;/,
-	rnoInnerhtml = /<(?:script|style|link)/i,
-	// checked="checked" or checked
-	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
-	rscriptType = /^$|\/(?:java|ecma)script/i,
-	rscriptTypeMasked = /^true\/(.*)/,
-	rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
-
-	// We have to close these tags to support XHTML (#13200)
-	wrapMap = {
-
-		// Support: IE9
-		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, "", "" ]
-	};
-
-// Support: IE9
-wrapMap.optgroup = wrapMap.option;
-
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// Support: 1.x compatibility
-// Manipulating tables requires a tbody
-function manipulationTarget( elem, content ) {
-	return jQuery.nodeName( elem, "table" ) &&
-		jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
-
-		elem.getElementsByTagName("tbody")[0] ||
-			elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
-		elem;
-}
-
-// Replace/restore the type attribute of script elements for safe DOM manipulation
-function disableScript( elem ) {
-	elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
-	return elem;
-}
-function restoreScript( elem ) {
-	var match = rscriptTypeMasked.exec( elem.type );
-
-	if ( match ) {
-		elem.type = match[ 1 ];
-	} else {
-		elem.removeAttribute("type");
-	}
-
-	return elem;
-}
-
-// Mark scripts as having already been evaluated
-function setGlobalEval( elems, refElements ) {
-	var i = 0,
-		l = elems.length;
-
-	for ( ; i < l; i++ ) {
-		data_priv.set(
-			elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
-		);
-	}
-}
-
-function cloneCopyEvent( src, dest ) {
-	var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
-
-	if ( dest.nodeType !== 1 ) {
-		return;
-	}
-
-	// 1. Copy private data: events, handlers, etc.
-	if ( data_priv.hasData( src ) ) {
-		pdataOld = data_priv.access( src );
-		pdataCur = data_priv.set( dest, pdataOld );
-		events = pdataOld.events;
-
-		if ( events ) {
-			delete pdataCur.handle;
-			pdataCur.events = {};
-
-			for ( type in events ) {
-				for ( i = 0, l = events[ type ].length; i < l; i++ ) {
-					jQuery.event.add( dest, type, events[ type ][ i ] );
-				}
-			}
-		}
-	}
-
-	// 2. Copy user data
-	if ( data_user.hasData( src ) ) {
-		udataOld = data_user.access( src );
-		udataCur = jQuery.extend( {}, udataOld );
-
-		data_user.set( dest, udataCur );
-	}
-}
-
-function getAll( context, tag ) {
-	var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
-			context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
-			[];
-
-	return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
-		jQuery.merge( [ context ], ret ) :
-		ret;
-}
-
-// Fix IE bugs, see support tests
-function fixInput( src, dest ) {
-	var nodeName = dest.nodeName.toLowerCase();
-
-	// Fails to persist the checked state of a cloned checkbox or radio button.
-	if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
-		dest.checked = src.checked;
-
-	// Fails to return the selected option to the default selected state when cloning options
-	} else if ( nodeName === "input" || nodeName === "textarea" ) {
-		dest.defaultValue = src.defaultValue;
-	}
-}
-
-jQuery.extend({
-	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
-		var i, l, srcElements, destElements,
-			clone = elem.cloneNode( true ),
-			inPage = jQuery.contains( elem.ownerDocument, elem );
-
-		// Fix IE cloning issues
-		if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
-				!jQuery.isXMLDoc( elem ) ) {
-
-			// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
-			destElements = getAll( clone );
-			srcElements = getAll( elem );
-
-			for ( i = 0, l = srcElements.length; i < l; i++ ) {
-				fixInput( srcElements[ i ], destElements[ i ] );
-			}
-		}
-
-		// Copy the events from the original to the clone
-		if ( dataAndEvents ) {
-			if ( deepDataAndEvents ) {
-				srcElements = srcElements || getAll( elem );
-				destElements = destElements || getAll( clone );
-
-				for ( i = 0, l = srcElements.length; i < l; i++ ) {
-					cloneCopyEvent( srcElements[ i ], destElements[ i ] );
-				}
-			} else {
-				cloneCopyEvent( elem, clone );
-			}
-		}
-
-		// Preserve script evaluation history
-		destElements = getAll( clone, "script" );
-		if ( destElements.length > 0 ) {
-			setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
-		}
-
-		// Return the cloned set
-		return clone;
-	},
-
-	buildFragment: function( elems, context, scripts, selection ) {
-		var elem, tmp, tag, wrap, contains, j,
-			fragment = context.createDocumentFragment(),
-			nodes = [],
-			i = 0,
-			l = elems.length;
-
-		for ( ; i < l; i++ ) {
-			elem = elems[ i ];
-
-			if ( elem || elem === 0 ) {
-
-				// Add nodes directly
-				if ( jQuery.type( elem ) === "object" ) {
-					// Support: QtWebKit, PhantomJS
-					// push.apply(_, arraylike) throws on ancient WebKit
-					jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
-
-				// Convert non-html into a text node
-				} else if ( !rhtml.test( elem ) ) {
-					nodes.push( context.createTextNode( elem ) );
-
-				// Convert html into DOM nodes
-				} else {
-					tmp = tmp || fragment.appendChild( context.createElement("div") );
-
-					// Deserialize a standard representation
-					tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
-					wrap = wrapMap[ tag ] || wrapMap._default;
-					tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
-
-					// Descend through wrappers to the right content
-					j = wrap[ 0 ];
-					while ( j-- ) {
-						tmp = tmp.lastChild;
-					}
-
-					// Support: QtWebKit, PhantomJS
-					// push.apply(_, arraylike) throws on ancient WebKit
-					jQuery.merge( nodes, tmp.childNodes );
-
-					// Remember the top-level container
-					tmp = fragment.firstChild;
-
-					// Ensure the created nodes are orphaned (#12392)
-					tmp.textContent = "";
-				}
-			}
-		}
-
-		// Remove wrapper from fragment
-		fragment.textContent = "";
-
-		i = 0;
-		while ( (elem = nodes[ i++ ]) ) {
-
-			// #4087 - If origin and destination elements are the same, and this is
-			// that element, do not do anything
-			if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
-				continue;
-			}
-
-			contains = jQuery.contains( elem.ownerDocument, elem );
-
-			// Append to fragment
-			tmp = getAll( fragment.appendChild( elem ), "script" );
-
-			// Preserve script evaluation history
-			if ( contains ) {
-				setGlobalEval( tmp );
-			}
-
-			// Capture executables
-			if ( scripts ) {
-				j = 0;
-				while ( (elem = tmp[ j++ ]) ) {
-					if ( rscriptType.test( elem.type || "" ) ) {
-						scripts.push( elem );
-					}
-				}
-			}
-		}
-
-		return fragment;
-	},
-
-	cleanData: function( elems ) {
-		var data, elem, type, key,
-			special = jQuery.event.special,
-			i = 0;
-
-		for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
-			if ( jQuery.acceptData( elem ) ) {
-				key = elem[ data_priv.expando ];
-
-				if ( key && (data = data_priv.cache[ key ]) ) {
-					if ( data.events ) {
-						for ( type in data.events ) {
-							if ( special[ type ] ) {
-								jQuery.event.remove( elem, type );
-
-							// This is a shortcut to avoid jQuery.event.remove's overhead
-							} else {
-								jQuery.removeEvent( elem, type, data.handle );
-							}
-						}
-					}
-					if ( data_priv.cache[ key ] ) {
-						// Discard any remaining `private` data
-						delete data_priv.cache[ key ];
-					}
-				}
-			}
-			// Discard any remaining `user` data
-			delete data_user.cache[ elem[ data_user.expando ] ];
-		}
-	}
-});
-
-jQuery.fn.extend({
-	text: function( value ) {
-		return access( this, function( value ) {
-			return value === undefined ?
-				jQuery.text( this ) :
-				this.empty().each(function() {
-					if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
-						this.textContent = value;
-					}
-				});
-		}, null, value, arguments.length );
-	},
-
-	append: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
-				var target = manipulationTarget( this, elem );
-				target.appendChild( elem );
-			}
-		});
-	},
-
-	prepend: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
-				var target = manipulationTarget( this, elem );
-				target.insertBefore( elem, target.firstChild );
-			}
-		});
-	},
-
-	before: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.parentNode ) {
-				this.parentNode.insertBefore( elem, this );
-			}
-		});
-	},
-
-	after: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.parentNode ) {
-				this.parentNode.insertBefore( elem, this.nextSibling );
-			}
-		});
-	},
-
-	remove: function( selector, keepData /* Internal Use Only */ ) {
-		var elem,
-			elems = selector ? jQuery.filter( selector, this ) : this,
-			i = 0;
-
-		for ( ; (elem = elems[i]) != null; i++ ) {
-			if ( !keepData && elem.nodeType === 1 ) {
-				jQuery.cleanData( getAll( elem ) );
-			}
-
-			if ( elem.parentNode ) {
-				if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
-					setGlobalEval( getAll( elem, "script" ) );
-				}
-				elem.parentNode.removeChild( elem );
-			}
-		}
-
-		return this;
-	},
-
-	empty: function() {
-		var elem,
-			i = 0;
-
-		for ( ; (elem = this[i]) != null; i++ ) {
-			if ( elem.nodeType === 1 ) {
-
-				// Prevent memory leaks
-				jQuery.cleanData( getAll( elem, false ) );
-
-				// Remove any remaining nodes
-				elem.textContent = "";
-			}
-		}
-
-		return this;
-	},
-
-	clone: function( dataAndEvents, deepDataAndEvents ) {
-		dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
-		deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
-		return this.map(function() {
-			return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
-		});
-	},
-
-	html: function( value ) {
-		return access( this, function( value ) {
-			var elem = this[ 0 ] || {},
-				i = 0,
-				l = this.length;
-
-			if ( value === undefined && elem.nodeType === 1 ) {
-				return elem.innerHTML;
-			}
-
-			// See if we can take a shortcut and just use innerHTML
-			if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
-				!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
-
-				value = value.replace( rxhtmlTag, "<$1></$2>" );
-
-				try {
-					for ( ; i < l; i++ ) {
-						elem = this[ i ] || {};
-
-						// Remove element nodes and prevent memory leaks
-						if ( elem.nodeType === 1 ) {
-							jQuery.cleanData( getAll( elem, false ) );
-							elem.innerHTML = value;
-						}
-					}
-
-					elem = 0;
-
-				// If using innerHTML throws an exception, use the fallback method
-				} catch( e ) {}
-			}
-
-			if ( elem ) {
-				this.empty().append( value );
-			}
-		}, null, value, arguments.length );
-	},
-
-	replaceWith: function() {
-		var arg = arguments[ 0 ];
-
-		// Make the changes, replacing each context element with the new content
-		this.domManip( arguments, function( elem ) {
-			arg = this.parentNode;
-
-			jQuery.cleanData( getAll( this ) );
-
-			if ( arg ) {
-				arg.replaceChild( elem, this );
-			}
-		});
-
-		// Force removal if there was no new content (e.g., from empty arguments)
-		return arg && (arg.length || arg.nodeType) ? this : this.remove();
-	},
-
-	detach: function( selector ) {
-		return this.remove( selector, true );
-	},
-
-	domManip: function( args, callback ) {
-
-		// Flatten any nested arrays
-		args = concat.apply( [], args );
-
-		var fragment, first, scripts, hasScripts, node, doc,
-			i = 0,
-			l = this.length,
-			set = this,
-			iNoClone = l - 1,
-			value = args[ 0 ],
-			isFunction = jQuery.isFunction( value );
-
-		// We can't cloneNode fragments that contain checked, in WebKit
-		if ( isFunction ||
-				( l > 1 && typeof value === "string" &&
-					!support.checkClone && rchecked.test( value ) ) ) {
-			return this.each(function( index ) {
-				var self = set.eq( index );
-				if ( isFunction ) {
-					args[ 0 ] = value.call( this, index, self.html() );
-				}
-				self.domManip( args, callback );
-			});
-		}
-
-		if ( l ) {
-			fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
-			first = fragment.firstChild;
-
-			if ( fragment.childNodes.length === 1 ) {
-				fragment = first;
-			}
-
-			if ( first ) {
-				scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
-				hasScripts = scripts.length;
-
-				// Use the original fragment for the last item instead of the first because it can end up
-				// being emptied incorrectly in certain situations (#8070).
-				for ( ; i < l; i++ ) {
-					node = fragment;
-
-					if ( i !== iNoClone ) {
-						node = jQuery.clone( node, true, true );
-
-						// Keep references to cloned scripts for later restoration
-						if ( hasScripts ) {
-							// Support: QtWebKit
-							// jQuery.merge because push.apply(_, arraylike) throws
-							jQuery.merge( scripts, getAll( node, "script" ) );
-						}
-					}
-
-					callback.call( this[ i ], node, i );
-				}
-
-				if ( hasScripts ) {
-					doc = scripts[ scripts.length - 1 ].ownerDocument;
-
-					// Reenable scripts
-					jQuery.map( scripts, restoreScript );
-
-					// Evaluate executable scripts on first document insertion
-					for ( i = 0; i < hasScripts; i++ ) {
-						node = scripts[ i ];
-						if ( rscriptType.test( node.type || "" ) &&
-							!data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
-
-							if ( node.src ) {
-								// Optional AJAX dependency, but won't run scripts if not present
-								if ( jQuery._evalUrl ) {
-									jQuery._evalUrl( node.src );
-								}
-							} else {
-								jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
-							}
-						}
-					}
-				}
-			}
-		}
-
-		return this;
-	}
-});
-
-jQuery.each({
-	appendTo: "append",
-	prependTo: "prepend",
-	insertBefore: "before",
-	insertAfter: "after",
-	replaceAll: "replaceWith"
-}, function( name, original ) {
-	jQuery.fn[ name ] = function( selector ) {
-		var elems,
-			ret = [],
-			insert = jQuery( selector ),
-			last = insert.length - 1,
-			i = 0;
-
-		for ( ; i <= last; i++ ) {
-			elems = i === last ? this : this.clone( true );
-			jQuery( insert[ i ] )[ original ]( elems );
-
-			// Support: QtWebKit
-			// .get() because push.apply(_, arraylike) throws
-			push.apply( ret, elems.get() );
-		}
-
-		return this.pushStack( ret );
-	};
-});
-
-
-var iframe,
-	elemdisplay = {};
-
-/**
- * Retrieve the actual display of a element
- * @param {String} name nodeName of the element
- * @param {Object} doc Document object
- */
-// Called only from within defaultDisplay
-function actualDisplay( name, doc ) {
-	var style,
-		elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
-
-		// getDefaultComputedStyle might be reliably used only on attached element
-		display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
-
-			// Use of this method is a temporary fix (more like optimization) until something better comes along,
-			// since it was removed from specification and supported only in FF
-			style.display : jQuery.css( elem[ 0 ], "display" );
-
-	// We don't have any data stored on the element,
-	// so use "detach" method as fast way to get rid of the element
-	elem.detach();
-
-	return display;
-}
-
-/**
- * Try to determine the default display value of an element
- * @param {String} nodeName
- */
-function defaultDisplay( nodeName ) {
-	var doc = document,
-		display = elemdisplay[ nodeName ];
-
-	if ( !display ) {
-		display = actualDisplay( nodeName, doc );
-
-		// If the simple way fails, read from inside an iframe
-		if ( display === "none" || !display ) {
-
-			// Use the already-created iframe if possible
-			iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
-
-			// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
-			doc = iframe[ 0 ].contentDocument;
-
-			// Support: IE
-			doc.write();
-			doc.close();
-
-			display = actualDisplay( nodeName, doc );
-			iframe.detach();
-		}
-
-		// Store the correct default display
-		elemdisplay[ nodeName ] = display;
-	}
-
-	return display;
-}
-var rmargin = (/^margin/);
-
-var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
-
-var getStyles = function( elem ) {
-		// Support: IE<=11+, Firefox<=30+ (#15098, #14150)
-		// IE throws on elements created in popups
-		// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
-		if ( elem.ownerDocument.defaultView.opener ) {
-			return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
-		}
-
-		return window.getComputedStyle( elem, null );
-	};
-
-
-
-function curCSS( elem, name, computed ) {
-	var width, minWidth, maxWidth, ret,
-		style = elem.style;
-
-	computed = computed || getStyles( elem );
-
-	// Support: IE9
-	// getPropertyValue is only needed for .css('filter') (#12537)
-	if ( computed ) {
-		ret = computed.getPropertyValue( name ) || computed[ name ];
-	}
-
-	if ( computed ) {
-
-		if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
-			ret = jQuery.style( elem, name );
-		}
-
-		// Support: iOS < 6
-		// A tribute to the "awesome hack by Dean Edwards"
-		// iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
-		// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
-		if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
-
-			// Remember the original values
-			width = style.width;
-			minWidth = style.minWidth;
-			maxWidth = style.maxWidth;
-
-			// Put in the new values to get a computed value out
-			style.minWidth = style.maxWidth = style.width = ret;
-			ret = computed.width;
-
-			// Revert the changed values
-			style.width = width;
-			style.minWidth = minWidth;
-			style.maxWidth = maxWidth;
-		}
-	}
-
-	return ret !== undefined ?
-		// Support: IE
-		// IE returns zIndex value as an integer.
-		ret + "" :
-		ret;
-}
-
-
-function addGetHookIf( conditionFn, hookFn ) {
-	// Define the hook, we'll check on the first run if it's really needed.
-	return {
-		get: function() {
-			if ( conditionFn() ) {
-				// Hook not needed (or it's not possible to use it due
-				// to missing dependency), remove it.
-				delete this.get;
-				return;
-			}
-
-			// Hook needed; redefine it so that the support test is not executed again.
-			return (this.get = hookFn).apply( this, arguments );
-		}
-	};
-}
-
-
-(function() {
-	var pixelPositionVal, boxSizingReliableVal,
-		docElem = document.documentElement,
-		container = document.createElement( "div" ),
-		div = document.createElement( "div" );
-
-	if ( !div.style ) {
-		return;
-	}
-
-	// Support: IE9-11+
-	// Style of cloned element affects source element cloned (#8908)
-	div.style.backgroundClip = "content-box";
-	div.cloneNode( true ).style.backgroundClip = "";
-	support.clearCloneStyle = div.style.backgroundClip === "content-box";
-
-	container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
-		"position:absolute";
-	container.appendChild( div );
-
-	// Executing both pixelPosition & boxSizingReliable tests require only one layout
-	// so they're executed at the same time to save the second computation.
-	function computePixelPositionAndBoxSizingReliable() {
-		div.style.cssText =
-			// Support: Firefox<29, Android 2.3
-			// Vendor-prefix box-sizing
-			"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
-			"box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
-			"border:1px;padding:1px;width:4px;position:absolute";
-		div.innerHTML = "";
-		docElem.appendChild( container );
-
-		var divStyle = window.getComputedStyle( div, null );
-		pixelPositionVal = divStyle.top !== "1%";
-		boxSizingReliableVal = divStyle.width === "4px";
-
-		docElem.removeChild( container );
-	}
-
-	// Support: node.js jsdom
-	// Don't assume that getComputedStyle is a property of the global object
-	if ( window.getComputedStyle ) {
-		jQuery.extend( support, {
-			pixelPosition: function() {
-
-				// This test is executed only once but we still do memoizing
-				// since we can use the boxSizingReliable pre-computing.
-				// No need to check if the test was already performed, though.
-				computePixelPositionAndBoxSizingReliable();
-				return pixelPositionVal;
-			},
-			boxSizingReliable: function() {
-				if ( boxSizingReliableVal == null ) {
-					computePixelPositionAndBoxSizingReliable();
-				}
-				return boxSizingReliableVal;
-			},
-			reliableMarginRight: function() {
-
-				// Support: Android 2.3
-				// Check if div with explicit width and no margin-right incorrectly
-				// gets computed margin-right based on width of container. (#3333)
-				// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-				// This support function is only executed once so no memoizing is needed.
-				var ret,
-					marginDiv = div.appendChild( document.createElement( "div" ) );
-
-				// Reset CSS: box-sizing; display; margin; border; padding
-				marginDiv.style.cssText = div.style.cssText =
-					// Support: Firefox<29, Android 2.3
-					// Vendor-prefix box-sizing
-					"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
-					"box-sizing:content-box;display:block;margin:0;border:0;padding:0";
-				marginDiv.style.marginRight = marginDiv.style.width = "0";
-				div.style.width = "1px";
-				docElem.appendChild( container );
-
-				ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
-
-				docElem.removeChild( container );
-				div.removeChild( marginDiv );
-
-				return ret;
-			}
-		});
-	}
-})();
-
-
-// A method for quickly swapping in/out CSS properties to get correct calculations.
-jQuery.swap = function( elem, options, callback, args ) {
-	var ret, name,
-		old = {};
-
-	// Remember the old values, and insert the new ones
-	for ( name in options ) {
-		old[ name ] = elem.style[ name ];
-		elem.style[ name ] = options[ name ];
-	}
-
-	ret = callback.apply( elem, args || [] );
-
-	// Revert the old values
-	for ( name in options ) {
-		elem.style[ name ] = old[ name ];
-	}
-
-	return ret;
-};
-
-
-var
-	// Swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
-	// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
-	rdisplayswap = /^(none|table(?!-c[ea]).+)/,
-	rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
-	rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
-
-	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
-	cssNormalTransform = {
-		letterSpacing: "0",
-		fontWeight: "400"
-	},
-
-	cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
-
-// Return a css property mapped to a potentially vendor prefixed property
-function vendorPropName( style, name ) {
-
-	// Shortcut for names that are not vendor prefixed
-	if ( name in style ) {
-		return name;
-	}
-
-	// Check for vendor prefixed names
-	var capName = name[0].toUpperCase() + name.slice(1),
-		origName = name,
-		i = cssPrefixes.length;
-
-	while ( i-- ) {
-		name = cssPrefixes[ i ] + capName;
-		if ( name in style ) {
-			return name;
-		}
-	}
-
-	return origName;
-}
-
-function setPositiveNumber( elem, value, subtract ) {
-	var matches = rnumsplit.exec( value );
-	return matches ?
-		// Guard against undefined "subtract", e.g., when used as in cssHooks
-		Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
-		value;
-}
-
-function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
-	var i = extra === ( isBorderBox ? "border" : "content" ) ?
-		// If we already have the right measurement, avoid augmentation
-		4 :
-		// Otherwise initialize for horizontal or vertical properties
-		name === "width" ? 1 : 0,
-
-		val = 0;
-
-	for ( ; i < 4; i += 2 ) {
-		// Both box models exclude margin, so add it if we want it
-		if ( extra === "margin" ) {
-			val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
-		}
-
-		if ( isBorderBox ) {
-			// border-box includes padding, so remove it if we want content
-			if ( extra === "content" ) {
-				val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-			}
-
-			// At this point, extra isn't border nor margin, so remove border
-			if ( extra !== "margin" ) {
-				val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-			}
-		} else {
-			// At this point, extra isn't content, so add padding
-			val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-
-			// At this point, extra isn't content nor padding, so add border
-			if ( extra !== "padding" ) {
-				val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-			}
-		}
-	}
-
-	return val;
-}
-
-function getWidthOrHeight( elem, name, extra ) {
-
-	// Start with offset property, which is equivalent to the border-box value
-	var valueIsBorderBox = true,
-		val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
-		styles = getStyles( elem ),
-		isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
-
-	// Some non-html elements return undefined for offsetWidth, so check for null/undefined
-	// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
-	// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
-	if ( val <= 0 || val == null ) {
-		// Fall back to computed then uncomputed css if necessary
-		val = curCSS( elem, name, styles );
-		if ( val < 0 || val == null ) {
-			val = elem.style[ name ];
-		}
-
-		// Computed unit is not pixels. Stop here and return.
-		if ( rnumnonpx.test(val) ) {
-			return val;
-		}
-
-		// Check for style in case a browser which returns unreliable values
-		// for getComputedStyle silently falls back to the reliable elem.style
-		valueIsBorderBox = isBorderBox &&
-			( support.boxSizingReliable() || val === elem.style[ name ] );
-
-		// Normalize "", auto, and prepare for extra
-		val = parseFloat( val ) || 0;
-	}
-
-	// Use the active box-sizing model to add/subtract irrelevant styles
-	return ( val +
-		augmentWidthOrHeight(
-			elem,
-			name,
-			extra || ( isBorderBox ? "border" : "content" ),
-			valueIsBorderBox,
-			styles
-		)
-	) + "px";
-}
-
-function showHide( elements, show ) {
-	var display, elem, hidden,
-		values = [],
-		index = 0,
-		length = elements.length;
-
-	for ( ; index < length; index++ ) {
-		elem = elements[ index ];
-		if ( !elem.style ) {
-			continue;
-		}
-
-		values[ index ] = data_priv.get( elem, "olddisplay" );
-		display = elem.style.display;
-		if ( show ) {
-			// Reset the inline display of this element to learn if it is
-			// being hidden by cascaded rules or not
-			if ( !values[ index ] && display === "none" ) {
-				elem.style.display = "";
-			}
-
-			// Set elements which have been overridden with display: none
-			// in a stylesheet to whatever the default browser style is
-			// for such an element
-			if ( elem.style.display === "" && isHidden( elem ) ) {
-				values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
-			}
-		} else {
-			hidden = isHidden( elem );
-
-			if ( display !== "none" || !hidden ) {
-				data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
-			}
-		}
-	}
-
-	// Set the display of most of the elements in a second loop
-	// to avoid the constant reflow
-	for ( index = 0; index < length; index++ ) {
-		elem = elements[ index ];
-		if ( !elem.style ) {
-			continue;
-		}
-		if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
-			elem.style.display = show ? values[ index ] || "" : "none";
-		}
-	}
-
-	return elements;
-}
-
-jQuery.extend({
-
-	// Add in style property hooks for overriding the default
-	// behavior of getting and setting a style property
-	cssHooks: {
-		opacity: {
-			get: function( elem, computed ) {
-				if ( computed ) {
-
-					// We should always get a number back from opacity
-					var ret = curCSS( elem, "opacity" );
-					return ret === "" ? "1" : ret;
-				}
-			}
-		}
-	},
-
-	// Don't automatically add "px" to these possibly-unitless properties
-	cssNumber: {
-		"columnCount": true,
-		"fillOpacity": true,
-		"flexGrow": true,
-		"flexShrink": true,
-		"fontWeight": true,
-		"lineHeight": true,
-		"opacity": true,
-		"order": true,
-		"orphans": true,
-		"widows": true,
-		"zIndex": true,
-		"zoom": true
-	},
-
-	// Add in properties whose names you wish to fix before
-	// setting or getting the value
-	cssProps: {
-		"float": "cssFloat"
-	},
-
-	// Get and set the style property on a DOM Node
-	style: function( elem, name, value, extra ) {
-
-		// Don't set styles on text and comment nodes
-		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
-			return;
-		}
-
-		// Make sure that we're working with the right name
-		var ret, type, hooks,
-			origName = jQuery.camelCase( name ),
-			style = elem.style;
-
-		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
-
-		// Gets hook for the prefixed version, then unprefixed version
-		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
-		// Check if we're setting a value
-		if ( value !== undefined ) {
-			type = typeof value;
-
-			// Convert "+=" or "-=" to relative numbers (#7345)
-			if ( type === "string" && (ret = rrelNum.exec( value )) ) {
-				value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
-				// Fixes bug #9237
-				type = "number";
-			}
-
-			// Make sure that null and NaN values aren't set (#7116)
-			if ( value == null || value !== value ) {
-				return;
-			}
-
-			// If a number, add 'px' to the (except for certain CSS properties)
-			if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
-				value += "px";
-			}
-
-			// Support: IE9-11+
-			// background-* props affect original clone's values
-			if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
-				style[ name ] = "inherit";
-			}
-
-			// If a hook was provided, use that value, otherwise just set the specified value
-			if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
-				style[ name ] = value;
-			}
-
-		} else {
-			// If a hook was provided get the non-computed value from there
-			if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
-				return ret;
-			}
-
-			// Otherwise just get the value from the style object
-			return style[ name ];
-		}
-	},
-
-	css: function( elem, name, extra, styles ) {
-		var val, num, hooks,
-			origName = jQuery.camelCase( name );
-
-		// Make sure that we're working with the right name
-		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
-
-		// Try prefixed name followed by the unprefixed name
-		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
-		// If a hook was provided get the computed value from there
-		if ( hooks && "get" in hooks ) {
-			val = hooks.get( elem, true, extra );
-		}
-
-		// Otherwise, if a way to get the computed value exists, use that
-		if ( val === undefined ) {
-			val = curCSS( elem, name, styles );
-		}
-
-		// Convert "normal" to computed value
-		if ( val === "normal" && name in cssNormalTransform ) {
-			val = cssNormalTransform[ name ];
-		}
-
-		// Make numeric if forced or a qualifier was provided and val looks numeric
-		if ( extra === "" || extra ) {
-			num = parseFloat( val );
-			return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
-		}
-		return val;
-	}
-});
-
-jQuery.each([ "height", "width" ], function( i, name ) {
-	jQuery.cssHooks[ name ] = {
-		get: function( elem, computed, extra ) {
-			if ( computed ) {
-
-				// Certain elements can have dimension info if we invisibly show them
-				// but it must have a current display style that would benefit
-				return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
-					jQuery.swap( elem, cssShow, function() {
-						return getWidthOrHeight( elem, name, extra );
-					}) :
-					getWidthOrHeight( elem, name, extra );
-			}
-		},
-
-		set: function( elem, value, extra ) {
-			var styles = extra && getStyles( elem );
-			return setPositiveNumber( elem, value, extra ?
-				augmentWidthOrHeight(
-					elem,
-					name,
-					extra,
-					jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
-					styles
-				) : 0
-			);
-		}
-	};
-});
-
-// Support: Android 2.3
-jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
-	function( elem, computed ) {
-		if ( computed ) {
-			return jQuery.swap( elem, { "display": "inline-block" },
-				curCSS, [ elem, "marginRight" ] );
-		}
-	}
-);
-
-// These hooks are used by animate to expand properties
-jQuery.each({
-	margin: "",
-	padding: "",
-	border: "Width"
-}, function( prefix, suffix ) {
-	jQuery.cssHooks[ prefix + suffix ] = {
-		expand: function( value ) {
-			var i = 0,
-				expanded = {},
-
-				// Assumes a single number if not a string
-				parts = typeof value === "string" ? value.split(" ") : [ value ];
-
-			for ( ; i < 4; i++ ) {
-				expanded[ prefix + cssExpand[ i ] + suffix ] =
-					parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
-			}
-
-			return expanded;
-		}
-	};
-
-	if ( !rmargin.test( prefix ) ) {
-		jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
-	}
-});
-
-jQuery.fn.extend({
-	css: function( name, value ) {
-		return access( this, function( elem, name, value ) {
-			var styles, len,
-				map = {},
-				i = 0;
-
-			if ( jQuery.isArray( name ) ) {
-				styles = getStyles( elem );
-				len = name.length;
-
-				for ( ; i < len; i++ ) {
-					map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
-				}
-
-				return map;
-			}
-
-			return value !== undefined ?
-				jQuery.style( elem, name, value ) :
-				jQuery.css( elem, name );
-		}, name, value, arguments.length > 1 );
-	},
-	show: function() {
-		return showHide( this, true );
-	},
-	hide: function() {
-		return showHide( this );
-	},
-	toggle: function( state ) {
-		if ( typeof state === "boolean" ) {
-			return state ? this.show() : this.hide();
-		}
-
-		return this.each(function() {
-			if ( isHidden( this ) ) {
-				jQuery( this ).show();
-			} else {
-				jQuery( this ).hide();
-			}
-		});
-	}
-});
-
-
-function Tween( elem, options, prop, end, easing ) {
-	return new Tween.prototype.init( elem, options, prop, end, easing );
-}
-jQuery.Tween = Tween;
-
-Tween.prototype = {
-	constructor: Tween,
-	init: function( elem, options, prop, end, easing, unit ) {
-		this.elem = elem;
-		this.prop = prop;
-		this.easing = easing || "swing";
-		this.options = options;
-		this.start = this.now = this.cur();
-		this.end = end;
-		this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
-	},
-	cur: function() {
-		var hooks = Tween.propHooks[ this.prop ];
-
-		return hooks && hooks.get ?
-			hooks.get( this ) :
-			Tween.propHooks._default.get( this );
-	},
-	run: function( percent ) {
-		var eased,
-			hooks = Tween.propHooks[ this.prop ];
-
-		if ( this.options.duration ) {
-			this.pos = eased = jQuery.easing[ this.easing ](
-				percent, this.options.duration * percent, 0, 1, this.options.duration
-			);
-		} else {
-			this.pos = eased = percent;
-		}
-		this.now = ( this.end - this.start ) * eased + this.start;
-
-		if ( this.options.step ) {
-			this.options.step.call( this.elem, this.now, this );
-		}
-
-		if ( hooks && hooks.set ) {
-			hooks.set( this );
-		} else {
-			Tween.propHooks._default.set( this );
-		}
-		return this;
-	}
-};
-
-Tween.prototype.init.prototype = Tween.prototype;
-
-Tween.propHooks = {
-	_default: {
-		get: function( tween ) {
-			var result;
-
-			if ( tween.elem[ tween.prop ] != null &&
-				(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
-				return tween.elem[ tween.prop ];
-			}
-
-			// Passing an empty string as a 3rd parameter to .css will automatically
-			// attempt a parseFloat and fallback to a string if the parse fails.
-			// Simple values such as "10px" are parsed to Float;
-			// complex values such as "rotate(1rad)" are returned as-is.
-			result = jQuery.css( tween.elem, tween.prop, "" );
-			// Empty strings, null, undefined and "auto" are converted to 0.
-			return !result || result === "auto" ? 0 : result;
-		},
-		set: function( tween ) {
-			// Use step hook for back compat.
-			// Use cssHook if its there.
-			// Use .style if available and use plain properties where available.
-			if ( jQuery.fx.step[ tween.prop ] ) {
-				jQuery.fx.step[ tween.prop ]( tween );
-			} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
-				jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
-			} else {
-				tween.elem[ tween.prop ] = tween.now;
-			}
-		}
-	}
-};
-
-// Support: IE9
-// Panic based approach to setting things on disconnected nodes
-Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
-	set: function( tween ) {
-		if ( tween.elem.nodeType && tween.elem.parentNode ) {
-			tween.elem[ tween.prop ] = tween.now;
-		}
-	}
-};
-
-jQuery.easing = {
-	linear: function( p ) {
-		return p;
-	},
-	swing: function( p ) {
-		return 0.5 - Math.cos( p * Math.PI ) / 2;
-	}
-};
-
-jQuery.fx = Tween.prototype.init;
-
-// Back Compat <1.8 extension point
-jQuery.fx.step = {};
-
-
-
-
-var
-	fxNow, timerId,
-	rfxtypes = /^(?:toggle|show|hide)$/,
-	rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
-	rrun = /queueHooks$/,
-	animationPrefilters = [ defaultPrefilter ],
-	tweeners = {
-		"*": [ function( prop, value ) {
-			var tween = this.createTween( prop, value ),
-				target = tween.cur(),
-				parts = rfxnum.exec( value ),
-				unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
-
-				// Starting value computation is required for potential unit mismatches
-				start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
-					rfxnum.exec( jQuery.css( tween.elem, prop ) ),
-				scale = 1,
-				maxIterations = 20;
-
-			if ( start && start[ 3 ] !== unit ) {
-				// Trust units reported by jQuery.css
-				unit = unit || start[ 3 ];
-
-				// Make sure we update the tween properties later on
-				parts = parts || [];
-
-				// Iteratively approximate from a nonzero starting point
-				start = +target || 1;
-
-				do {
-					// If previous iteration zeroed out, double until we get *something*.
-					// Use string for doubling so we don't accidentally see scale as unchanged below
-					scale = scale || ".5";
-
-					// Adjust and apply
-					start = start / scale;
-					jQuery.style( tween.elem, prop, start + unit );
-
-				// Update scale, tolerating zero or NaN from tween.cur(),
-				// break the loop if scale is unchanged or perfect, or if we've just had enough
-				} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
-			}
-
-			// Update tween properties
-			if ( parts ) {
-				start = tween.start = +start || +target || 0;
-				tween.unit = unit;
-				// If a +=/-= token was provided, we're doing a relative animation
-				tween.end = parts[ 1 ] ?
-					start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
-					+parts[ 2 ];
-			}
-
-			return tween;
-		} ]
-	};
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
-	setTimeout(function() {
-		fxNow = undefined;
-	});
-	return ( fxNow = jQuery.now() );
-}
-
-// Generate parameters to create a standard animation
-function genFx( type, includeWidth ) {
-	var which,
-		i = 0,
-		attrs = { height: type };
-
-	// If we include width, step value is 1 to do all cssExpand values,
-	// otherwise step value is 2 to skip over Left and Right
-	includeWidth = includeWidth ? 1 : 0;
-	for ( ; i < 4 ; i += 2 - includeWidth ) {
-		which = cssExpand[ i ];
-		attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
-	}
-
-	if ( includeWidth ) {
-		attrs.opacity = attrs.width = type;
-	}
-
-	return attrs;
-}
-
-function createTween( value, prop, animation ) {
-	var tween,
-		collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
-		index = 0,
-		length = collection.length;
-	for ( ; index < length; index++ ) {
-		if ( (tween = collection[ index ].call( animation, prop, value )) ) {
-
-			// We're done with this property
-			return tween;
-		}
-	}
-}
-
-function defaultPrefilter( elem, props, opts ) {
-	/* jshint validthis: true */
-	var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
-		anim = this,
-		orig = {},
-		style = elem.style,
-		hidden = elem.nodeType && isHidden( elem ),
-		dataShow = data_priv.get( elem, "fxshow" );
-
-	// Handle queue: false promises
-	if ( !opts.queue ) {
-		hooks = jQuery._queueHooks( elem, "fx" );
-		if ( hooks.unqueued == null ) {
-			hooks.unqueued = 0;
-			oldfire = hooks.empty.fire;
-			hooks.empty.fire = function() {
-				if ( !hooks.unqueued ) {
-					oldfire();
-				}
-			};
-		}
-		hooks.unqueued++;
-
-		anim.always(function() {
-			// Ensure the complete handler is called before this completes
-			anim.always(function() {
-				hooks.unqueued--;
-				if ( !jQuery.queue( elem, "fx" ).length ) {
-					hooks.empty.fire();
-				}
-			});
-		});
-	}
-
-	// Height/width overflow pass
-	if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
-		// Make sure that nothing sneaks out
-		// Record all 3 overflow attributes because IE9-10 do not
-		// change the overflow attribute when overflowX and
-		// overflowY are set to the same value
-		opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
-
-		// Set display property to inline-block for height/width
-		// animations on inline elements that are having width/height animated
-		display = jQuery.css( elem, "display" );
-
-		// Test default display if display is currently "none"
-		checkDisplay = display === "none" ?
-			data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
-
-		if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
-			style.display = "inline-block";
-		}
-	}
-
-	if ( opts.overflow ) {
-		style.overflow = "hidden";
-		anim.always(function() {
-			style.overflow = opts.overflow[ 0 ];
-			style.overflowX = opts.overflow[ 1 ];
-			style.overflowY = opts.overflow[ 2 ];
-		});
-	}
-
-	// show/hide pass
-	for ( prop in props ) {
-		value = props[ prop ];
-		if ( rfxtypes.exec( value ) ) {
-			delete props[ prop ];
-			toggle = toggle || value === "toggle";
-			if ( value === ( hidden ? "hide" : "show" ) ) {
-
-				// If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
-				if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
-					hidden = true;
-				} else {
-					continue;
-				}
-			}
-			orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
-
-		// Any non-fx value stops us from restoring the original display value
-		} else {
-			display = undefined;
-		}
-	}
-
-	if ( !jQuery.isEmptyObject( orig ) ) {
-		if ( dataShow ) {
-			if ( "hidden" in dataShow ) {
-				hidden = dataShow.hidden;
-			}
-		} else {
-			dataShow = data_priv.access( elem, "fxshow", {} );
-		}
-
-		// Store state if its toggle - enables .stop().toggle() to "reverse"
-		if ( toggle ) {
-			dataShow.hidden = !hidden;
-		}
-		if ( hidden ) {
-			jQuery( elem ).show();
-		} else {
-			anim.done(function() {
-				jQuery( elem ).hide();
-			});
-		}
-		anim.done(function() {
-			var prop;
-
-			data_priv.remove( elem, "fxshow" );
-			for ( prop in orig ) {
-				jQuery.style( elem, prop, orig[ prop ] );
-			}
-		});
-		for ( prop in orig ) {
-			tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
-
-			if ( !( prop in dataShow ) ) {
-				dataShow[ prop ] = tween.start;
-				if ( hidden ) {
-					tween.end = tween.start;
-					tween.start = prop === "width" || prop === "height" ? 1 : 0;
-				}
-			}
-		}
-
-	// If this is a noop like .hide().hide(), restore an overwritten display value
-	} else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
-		style.display = display;
-	}
-}
-
-function propFilter( props, specialEasing ) {
-	var index, name, easing, value, hooks;
-
-	// camelCase, specialEasing and expand cssHook pass
-	for ( index in props ) {
-		name = jQuery.camelCase( index );
-		easing = specialEasing[ name ];
-		value = props[ index ];
-		if ( jQuery.isArray( value ) ) {
-			easing = value[ 1 ];
-			value = props[ index ] = value[ 0 ];
-		}
-
-		if ( index !== name ) {
-			props[ name ] = value;
-			delete props[ index ];
-		}
-
-		hooks = jQuery.cssHooks[ name ];
-		if ( hooks && "expand" in hooks ) {
-			value = hooks.expand( value );
-			delete props[ name ];
-
-			// Not quite $.extend, this won't overwrite existing keys.
-			// Reusing 'index' because we have the correct "name"
-			for ( index in value ) {
-				if ( !( index in props ) ) {
-					props[ index ] = value[ index ];
-					specialEasing[ index ] = easing;
-				}
-			}
-		} else {
-			specialEasing[ name ] = easing;
-		}
-	}
-}
-
-function Animation( elem, properties, options ) {
-	var result,
-		stopped,
-		index = 0,
-		length = animationPrefilters.length,
-		deferred = jQuery.Deferred().always( function() {
-			// Don't match elem in the :animated selector
-			delete tick.elem;
-		}),
-		tick = function() {
-			if ( stopped ) {
-				return false;
-			}
-			var currentTime = fxNow || createFxNow(),
-				remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
-				// Support: Android 2.3
-				// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
-				temp = remaining / animation.duration || 0,
-				percent = 1 - temp,
-				index = 0,
-				length = animation.tweens.length;
-
-			for ( ; index < length ; index++ ) {
-				animation.tweens[ index ].run( percent );
-			}
-
-			deferred.notifyWith( elem, [ animation, percent, remaining ]);
-
-			if ( percent < 1 && length ) {
-				return remaining;
-			} else {
-				deferred.resolveWith( elem, [ animation ] );
-				return false;
-			}
-		},
-		animation = deferred.promise({
-			elem: elem,
-			props: jQuery.extend( {}, properties ),
-			opts: jQuery.extend( true, { specialEasing: {} }, options ),
-			originalProperties: properties,
-			originalOptions: options,
-			startTime: fxNow || createFxNow(),
-			duration: options.duration,
-			tweens: [],
-			createTween: function( prop, end ) {
-				var tween = jQuery.Tween( elem, animation.opts, prop, end,
-						animation.opts.specialEasing[ prop ] || animation.opts.easing );
-				animation.tweens.push( tween );
-				return tween;
-			},
-			stop: function( gotoEnd ) {
-				var index = 0,
-					// If we are going to the end, we want to run all the tweens
-					// otherwise we skip this part
-					length = gotoEnd ? animation.tweens.length : 0;
-				if ( stopped ) {
-					return this;
-				}
-				stopped = true;
-				for ( ; index < length ; index++ ) {
-					animation.tweens[ index ].run( 1 );
-				}
-
-				// Resolve when we played the last frame; otherwise, reject
-				if ( gotoEnd ) {
-					deferred.resolveWith( elem, [ animation, gotoEnd ] );
-				} else {
-					deferred.rejectWith( elem, [ animation, gotoEnd ] );
-				}
-				return this;
-			}
-		}),
-		props = animation.props;
-
-	propFilter( props, animation.opts.specialEasing );
-
-	for ( ; index < length ; index++ ) {
-		result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
-		if ( result ) {
-			return result;
-		}
-	}
-
-	jQuery.map( props, createTween, animation );
-
-	if ( jQuery.isFunction( animation.opts.start ) ) {
-		animation.opts.start.call( elem, animation );
-	}
-
-	jQuery.fx.timer(
-		jQuery.extend( tick, {
-			elem: elem,
-			anim: animation,
-			queue: animation.opts.queue
-		})
-	);
-
-	// attach callbacks from options
-	return animation.progress( animation.opts.progress )
-		.done( animation.opts.done, animation.opts.complete )
-		.fail( animation.opts.fail )
-		.always( animation.opts.always );
-}
-
-jQuery.Animation = jQuery.extend( Animation, {
-
-	tweener: function( props, callback ) {
-		if ( jQuery.isFunction( props ) ) {
-			callback = props;
-			props = [ "*" ];
-		} else {
-			props = props.split(" ");
-		}
-
-		var prop,
-			index = 0,
-			length = props.length;
-
-		for ( ; index < length ; index++ ) {
-			prop = props[ index ];
-			tweeners[ prop ] = tweeners[ prop ] || [];
-			tweeners[ prop ].unshift( callback );
-		}
-	},
-
-	prefilter: function( callback, prepend ) {
-		if ( prepend ) {
-			animationPrefilters.unshift( callback );
-		} else {
-			animationPrefilters.push( callback );
-		}
-	}
-});
-
-jQuery.speed = function( speed, easing, fn ) {
-	var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
-		complete: fn || !fn && easing ||
-			jQuery.isFunction( speed ) && speed,
-		duration: speed,
-		easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
-	};
-
-	opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
-		opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
-	// Normalize opt.queue - true/undefined/null -> "fx"
-	if ( opt.queue == null || opt.queue === true ) {
-		opt.queue = "fx";
-	}
-
-	// Queueing
-	opt.old = opt.complete;
-
-	opt.complete = function() {
-		if ( jQuery.isFunction( opt.old ) ) {
-			opt.old.call( this );
-		}
-
-		if ( opt.queue ) {
-			jQuery.dequeue( this, opt.queue );
-		}
-	};
-
-	return opt;
-};
-
-jQuery.fn.extend({
-	fadeTo: function( speed, to, easing, callback ) {
-
-		// Show any hidden elements after setting opacity to 0
-		return this.filter( isHidden ).css( "opacity", 0 ).show()
-
-			// Animate to the value specified
-			.end().animate({ opacity: to }, speed, easing, callback );
-	},
-	animate: function( prop, speed, easing, callback ) {
-		var empty = jQuery.isEmptyObject( prop ),
-			optall = jQuery.speed( speed, easing, callback ),
-			doAnimation = function() {
-				// Operate on a copy of prop so per-property easing won't be lost
-				var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-
-				// Empty animations, or finishing resolves immediately
-				if ( empty || data_priv.get( this, "finish" ) ) {
-					anim.stop( true );
-				}
-			};
-			doAnimation.finish = doAnimation;
-
-		return empty || optall.queue === false ?
-			this.each( doAnimation ) :
-			this.queue( optall.queue, doAnimation );
-	},
-	stop: function( type, clearQueue, gotoEnd ) {
-		var stopQueue = function( hooks ) {
-			var stop = hooks.stop;
-			delete hooks.stop;
-			stop( gotoEnd );
-		};
-
-		if ( typeof type !== "string" ) {
-			gotoEnd = clearQueue;
-			clearQueue = type;
-			type = undefined;
-		}
-		if ( clearQueue && type !== false ) {
-			this.queue( type || "fx", [] );
-		}
-
-		return this.each(function() {
-			var dequeue = true,
-				index = type != null && type + "queueHooks",
-				timers = jQuery.timers,
-				data = data_priv.get( this );
-
-			if ( index ) {
-				if ( data[ index ] && data[ index ].stop ) {
-					stopQueue( data[ index ] );
-				}
-			} else {
-				for ( index in data ) {
-					if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
-						stopQueue( data[ index ] );
-					}
-				}
-			}
-
-			for ( index = timers.length; index--; ) {
-				if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
-					timers[ index ].anim.stop( gotoEnd );
-					dequeue = false;
-					timers.splice( index, 1 );
-				}
-			}
-
-			// Start the next in the queue if the last step wasn't forced.
-			// Timers currently will call their complete callbacks, which
-			// will dequeue but only if they were gotoEnd.
-			if ( dequeue || !gotoEnd ) {
-				jQuery.dequeue( this, type );
-			}
-		});
-	},
-	finish: function( type ) {
-		if ( type !== false ) {
-			type = type || "fx";
-		}
-		return this.each(function() {
-			var index,
-				data = data_priv.get( this ),
-				queue = data[ type + "queue" ],
-				hooks = data[ type + "queueHooks" ],
-				timers = jQuery.timers,
-				length = queue ? queue.length : 0;
-
-			// Enable finishing flag on private data
-			data.finish = true;
-
-			// Empty the queue first
-			jQuery.queue( this, type, [] );
-
-			if ( hooks && hooks.stop ) {
-				hooks.stop.call( this, true );
-			}
-
-			// Look for any active animations, and finish them
-			for ( index = timers.length; index--; ) {
-				if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
-					timers[ index ].anim.stop( true );
-					timers.splice( index, 1 );
-				}
-			}
-
-			// Look for any animations in the old queue and finish them
-			for ( index = 0; index < length; index++ ) {
-				if ( queue[ index ] && queue[ index ].finish ) {
-					queue[ index ].finish.call( this );
-				}
-			}
-
-			// Turn off finishing flag
-			delete data.finish;
-		});
-	}
-});
-
-jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
-	var cssFn = jQuery.fn[ name ];
-	jQuery.fn[ name ] = function( speed, easing, callback ) {
-		return speed == null || typeof speed === "boolean" ?
-			cssFn.apply( this, arguments ) :
-			this.animate( genFx( name, true ), speed, easing, callback );
-	};
-});
-
-// Generate shortcuts for custom animations
-jQuery.each({
-	slideDown: genFx("show"),
-	slideUp: genFx("hide"),
-	slideToggle: genFx("toggle"),
-	fadeIn: { opacity: "show" },
-	fadeOut: { opacity: "hide" },
-	fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
-	jQuery.fn[ name ] = function( speed, easing, callback ) {
-		return this.animate( props, speed, easing, callback );
-	};
-});
-
-jQuery.timers = [];
-jQuery.fx.tick = function() {
-	var timer,
-		i = 0,
-		timers = jQuery.timers;
-
-	fxNow = jQuery.now();
-
-	for ( ; i < timers.length; i++ ) {
-		timer = timers[ i ];
-		// Checks the timer has not already been removed
-		if ( !timer() && timers[ i ] === timer ) {
-			timers.splice( i--, 1 );
-		}
-	}
-
-	if ( !timers.length ) {
-		jQuery.fx.stop();
-	}
-	fxNow = undefined;
-};
-
-jQuery.fx.timer = function( timer ) {
-	jQuery.timers.push( timer );
-	if ( timer() ) {
-		jQuery.fx.start();
-	} else {
-		jQuery.timers.pop();
-	}
-};
-
-jQuery.fx.interval = 13;
-
-jQuery.fx.start = function() {
-	if ( !timerId ) {
-		timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
-	}
-};
-
-jQuery.fx.stop = function() {
-	clearInterval( timerId );
-	timerId = null;
-};
-
-jQuery.fx.speeds = {
-	slow: 600,
-	fast: 200,
-	// Default speed
-	_default: 400
-};
-
-
-// Based off of the plugin by Clint Helfers, with permission.
-// http://blindsignals.com/index.php/2009/07/jquery-delay/
-jQuery.fn.delay = function( time, type ) {
-	time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
-	type = type || "fx";
-
-	return this.queue( type, function( next, hooks ) {
-		var timeout = setTimeout( next, time );
-		hooks.stop = function() {
-			clearTimeout( timeout );
-		};
-	});
-};
-
-
-(function() {
-	var input = document.createElement( "input" ),
-		select = document.createElement( "select" ),
-		opt = select.appendChild( document.createElement( "option" ) );
-
-	input.type = "checkbox";
-
-	// Support: iOS<=5.1, Android<=4.2+
-	// Default value for a checkbox should be "on"
-	support.checkOn = input.value !== "";
-
-	// Support: IE<=11+
-	// Must access selectedIndex to make default options select
-	support.optSelected = opt.selected;
-
-	// Support: Android<=2.3
-	// Options inside disabled selects are incorrectly marked as disabled
-	select.disabled = true;
-	support.optDisabled = !opt.disabled;
-
-	// Support: IE<=11+
-	// An input loses its value after becoming a radio
-	input = document.createElement( "input" );
-	input.value = "t";
-	input.type = "radio";
-	support.radioValue = input.value === "t";
-})();
-
-
-var nodeHook, boolHook,
-	attrHandle = jQuery.expr.attrHandle;
-
-jQuery.fn.extend({
-	attr: function( name, value ) {
-		return access( this, jQuery.attr, name, value, arguments.length > 1 );
-	},
-
-	removeAttr: function( name ) {
-		return this.each(function() {
-			jQuery.removeAttr( this, name );
-		});
-	}
-});
-
-jQuery.extend({
-	attr: function( elem, name, value ) {
-		var hooks, ret,
-			nType = elem.nodeType;
-
-		// don't get/set attributes on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
-
-		// Fallback to prop when attributes are not supported
-		if ( typeof elem.getAttribute === strundefined ) {
-			return jQuery.prop( elem, name, value );
-		}
-
-		// All attributes are lowercase
-		// Grab necessary hook if one is defined
-		if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
-			name = name.toLowerCase();
-			hooks = jQuery.attrHooks[ name ] ||
-				( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
-		}
-
-		if ( value !== undefined ) {
-
-			if ( value === null ) {
-				jQuery.removeAttr( elem, name );
-
-			} else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
-
-			} else {
-				elem.setAttribute( name, value + "" );
-				return value;
-			}
-
-		} else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-			return ret;
-
-		} else {
-			ret = jQuery.find.attr( elem, name );
-
-			// Non-existent attributes return null, we normalize to undefined
-			return ret == null ?
-				undefined :
-				ret;
-		}
-	},
-
-	removeAttr: function( elem, value ) {
-		var name, propName,
-			i = 0,
-			attrNames = value && value.match( rnotwhite );
-
-		if ( attrNames && elem.nodeType === 1 ) {
-			while ( (name = attrNames[i++]) ) {
-				propName = jQuery.propFix[ name ] || name;
-
-				// Boolean attributes get special treatment (#10870)
-				if ( jQuery.expr.match.bool.test( name ) ) {
-					// Set corresponding property to false
-					elem[ propName ] = false;
-				}
-
-				elem.removeAttribute( name );
-			}
-		}
-	},
-
-	attrHooks: {
-		type: {
-			set: function( elem, value ) {
-				if ( !support.radioValue && value === "radio" &&
-					jQuery.nodeName( elem, "input" ) ) {
-					var val = elem.value;
-					elem.setAttribute( "type", value );
-					if ( val ) {
-						elem.value = val;
-					}
-					return value;
-				}
-			}
-		}
-	}
-});
-
-// Hooks for boolean attributes
-boolHook = {
-	set: function( elem, value, name ) {
-		if ( value === false ) {
-			// Remove boolean attributes when set to false
-			jQuery.removeAttr( elem, name );
-		} else {
-			elem.setAttribute( name, name );
-		}
-		return name;
-	}
-};
-jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
-	var getter = attrHandle[ name ] || jQuery.find.attr;
-
-	attrHandle[ name ] = function( elem, name, isXML ) {
-		var ret, handle;
-		if ( !isXML ) {
-			// Avoid an infinite loop by temporarily removing this function from the getter
-			handle = attrHandle[ name ];
-			attrHandle[ name ] = ret;
-			ret = getter( elem, name, isXML ) != null ?
-				name.toLowerCase() :
-				null;
-			attrHandle[ name ] = handle;
-		}
-		return ret;
-	};
-});
-
-
-
-
-var rfocusable = /^(?:input|select|textarea|button)$/i;
-
-jQuery.fn.extend({
-	prop: function( name, value ) {
-		return access( this, jQuery.prop, name, value, arguments.length > 1 );
-	},
-
-	removeProp: function( name ) {
-		return this.each(function() {
-			delete this[ jQuery.propFix[ name ] || name ];
-		});
-	}
-});
-
-jQuery.extend({
-	propFix: {
-		"for": "htmlFor",
-		"class": "className"
-	},
-
-	prop: function( elem, name, value ) {
-		var ret, hooks, notxml,
-			nType = elem.nodeType;
-
-		// Don't get/set properties on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
-
-		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-		if ( notxml ) {
-			// Fix name and attach hooks
-			name = jQuery.propFix[ name ] || name;
-			hooks = jQuery.propHooks[ name ];
-		}
-
-		if ( value !== undefined ) {
-			return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
-				ret :
-				( elem[ name ] = value );
-
-		} else {
-			return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
-				ret :
-				elem[ name ];
-		}
-	},
-
-	propHooks: {
-		tabIndex: {
-			get: function( elem ) {
-				return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
-					elem.tabIndex :
-					-1;
-			}
-		}
-	}
-});
-
-if ( !support.optSelected ) {
-	jQuery.propHooks.selected = {
-		get: function( elem ) {
-			var parent = elem.parentNode;
-			if ( parent && parent.parentNode ) {
-				parent.parentNode.selectedIndex;
-			}
-			return null;
-		}
-	};
-}
-
-jQuery.each([
-	"tabIndex",
-	"readOnly",
-	"maxLength",
-	"cellSpacing",
-	"cellPadding",
-	"rowSpan",
-	"colSpan",
-	"useMap",
-	"frameBorder",
-	"contentEditable"
-], function() {
-	jQuery.propFix[ this.toLowerCase() ] = this;
-});
-
-
-
-
-var rclass = /[\t\r\n\f]/g;
-
-jQuery.fn.extend({
-	addClass: function( value ) {
-		var classes, elem, cur, clazz, j, finalValue,
-			proceed = typeof value === "string" && value,
-			i = 0,
-			len = this.length;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).addClass( value.call( this, j, this.className ) );
-			});
-		}
-
-		if ( proceed ) {
-			// The disjunction here is for better compressibility (see removeClass)
-			classes = ( value || "" ).match( rnotwhite ) || [];
-
-			for ( ; i < len; i++ ) {
-				elem = this[ i ];
-				cur = elem.nodeType === 1 && ( elem.className ?
-					( " " + elem.className + " " ).replace( rclass, " " ) :
-					" "
-				);
-
-				if ( cur ) {
-					j = 0;
-					while ( (clazz = classes[j++]) ) {
-						if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
-							cur += clazz + " ";
-						}
-					}
-
-					// only assign if different to avoid unneeded rendering.
-					finalValue = jQuery.trim( cur );
-					if ( elem.className !== finalValue ) {
-						elem.className = finalValue;
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	removeClass: function( value ) {
-		var classes, elem, cur, clazz, j, finalValue,
-			proceed = arguments.length === 0 || typeof value === "string" && value,
-			i = 0,
-			len = this.length;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).removeClass( value.call( this, j, this.className ) );
-			});
-		}
-		if ( proceed ) {
-			classes = ( value || "" ).match( rnotwhite ) || [];
-
-			for ( ; i < len; i++ ) {
-				elem = this[ i ];
-				// This expression is here for better compressibility (see addClass)
-				cur = elem.nodeType === 1 && ( elem.className ?
-					( " " + elem.className + " " ).replace( rclass, " " ) :
-					""
-				);
-
-				if ( cur ) {
-					j = 0;
-					while ( (clazz = classes[j++]) ) {
-						// Remove *all* instances
-						while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
-							cur = cur.replace( " " + clazz + " ", " " );
-						}
-					}
-
-					// Only assign if different to avoid unneeded rendering.
-					finalValue = value ? jQuery.trim( cur ) : "";
-					if ( elem.className !== finalValue ) {
-						elem.className = finalValue;
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	toggleClass: function( value, stateVal ) {
-		var type = typeof value;
-
-		if ( typeof stateVal === "boolean" && type === "string" ) {
-			return stateVal ? this.addClass( value ) : this.removeClass( value );
-		}
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
-			});
-		}
-
-		return this.each(function() {
-			if ( type === "string" ) {
-				// Toggle individual class names
-				var className,
-					i = 0,
-					self = jQuery( this ),
-					classNames = value.match( rnotwhite ) || [];
-
-				while ( (className = classNames[ i++ ]) ) {
-					// Check each className given, space separated list
-					if ( self.hasClass( className ) ) {
-						self.removeClass( className );
-					} else {
-						self.addClass( className );
-					}
-				}
-
-			// Toggle whole class name
-			} else if ( type === strundefined || type === "boolean" ) {
-				if ( this.className ) {
-					// store className if set
-					data_priv.set( this, "__className__", this.className );
-				}
-
-				// If the element has a class name or if we're passed `false`,
-				// then remove the whole classname (if there was one, the above saved it).
-				// Otherwise bring back whatever was previously saved (if anything),
-				// falling back to the empty string if nothing was stored.
-				this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
-			}
-		});
-	},
-
-	hasClass: function( selector ) {
-		var className = " " + selector + " ",
-			i = 0,
-			l = this.length;
-		for ( ; i < l; i++ ) {
-			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
-				return true;
-			}
-		}
-
-		return false;
-	}
-});
-
-
-
-
-var rreturn = /\r/g;
-
-jQuery.fn.extend({
-	val: function( value ) {
-		var hooks, ret, isFunction,
-			elem = this[0];
-
-		if ( !arguments.length ) {
-			if ( elem ) {
-				hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
-				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
-					return ret;
-				}
-
-				ret = elem.value;
-
-				return typeof ret === "string" ?
-					// Handle most common string cases
-					ret.replace(rreturn, "") :
-					// Handle cases where value is null/undef or number
-					ret == null ? "" : ret;
-			}
-
-			return;
-		}
-
-		isFunction = jQuery.isFunction( value );
-
-		return this.each(function( i ) {
-			var val;
-
-			if ( this.nodeType !== 1 ) {
-				return;
-			}
-
-			if ( isFunction ) {
-				val = value.call( this, i, jQuery( this ).val() );
-			} else {
-				val = value;
-			}
-
-			// Treat null/undefined as ""; convert numbers to string
-			if ( val == null ) {
-				val = "";
-
-			} else if ( typeof val === "number" ) {
-				val += "";
-
-			} else if ( jQuery.isArray( val ) ) {
-				val = jQuery.map( val, function( value ) {
-					return value == null ? "" : value + "";
-				});
-			}
-
-			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
-			// If set returns undefined, fall back to normal setting
-			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
-				this.value = val;
-			}
-		});
-	}
-});
-
-jQuery.extend({
-	valHooks: {
-		option: {
-			get: function( elem ) {
-				var val = jQuery.find.attr( elem, "value" );
-				return val != null ?
-					val :
-					// Support: IE10-11+
-					// option.text throws exceptions (#14686, #14858)
-					jQuery.trim( jQuery.text( elem ) );
-			}
-		},
-		select: {
-			get: function( elem ) {
-				var value, option,
-					options = elem.options,
-					index = elem.selectedIndex,
-					one = elem.type === "select-one" || index < 0,
-					values = one ? null : [],
-					max = one ? index + 1 : options.length,
-					i = index < 0 ?
-						max :
-						one ? index : 0;
-
-				// Loop through all the selected options
-				for ( ; i < max; i++ ) {
-					option = options[ i ];
-
-					// IE6-9 doesn't update selected after form reset (#2551)
-					if ( ( option.selected || i === index ) &&
-							// Don't return options that are disabled or in a disabled optgroup
-							( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
-							( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
-
-						// Get the specific value for the option
-						value = jQuery( option ).val();
-
-						// We don't need an array for one selects
-						if ( one ) {
-							return value;
-						}
-
-						// Multi-Selects return an array
-						values.push( value );
-					}
-				}
-
-				return values;
-			},
-
-			set: function( elem, value ) {
-				var optionSet, option,
-					options = elem.options,
-					values = jQuery.makeArray( value ),
-					i = options.length;
-
-				while ( i-- ) {
-					option = options[ i ];
-					if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
-						optionSet = true;
-					}
-				}
-
-				// Force browsers to behave consistently when non-matching value is set
-				if ( !optionSet ) {
-					elem.selectedIndex = -1;
-				}
-				return values;
-			}
-		}
-	}
-});
-
-// Radios and checkboxes getter/setter
-jQuery.each([ "radio", "checkbox" ], function() {
-	jQuery.valHooks[ this ] = {
-		set: function( elem, value ) {
-			if ( jQuery.isArray( value ) ) {
-				return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
-			}
-		}
-	};
-	if ( !support.checkOn ) {
-		jQuery.valHooks[ this ].get = function( elem ) {
-			return elem.getAttribute("value") === null ? "on" : elem.value;
-		};
-	}
-});
-
-
-
-
-// Return jQuery for attributes-only inclusion
-
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
-	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
-	"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
-	// Handle event binding
-	jQuery.fn[ name ] = function( data, fn ) {
-		return arguments.length > 0 ?
-			this.on( name, null, data, fn ) :
-			this.trigger( name );
-	};
-});
-
-jQuery.fn.extend({
-	hover: function( fnOver, fnOut ) {
-		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
-	},
-
-	bind: function( types, data, fn ) {
-		return this.on( types, null, data, fn );
-	},
-	unbind: function( types, fn ) {
-		return this.off( types, null, fn );
-	},
-
-	delegate: function( selector, types, data, fn ) {
-		return this.on( types, selector, data, fn );
-	},
-	undelegate: function( selector, types, fn ) {
-		// ( namespace ) or ( selector, types [, fn] )
-		return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
-	}
-});
-
-
-var nonce = jQuery.now();
-
-var rquery = (/\?/);
-
-
-
-// Support: Android 2.3
-// Workaround failure to string-cast null input
-jQuery.parseJSON = function( data ) {
-	return JSON.parse( data + "" );
-};
-
-
-// Cross-browser xml parsing
-jQuery.parseXML = function( data ) {
-	var xml, tmp;
-	if ( !data || typeof data !== "string" ) {
-		return null;
-	}
-
-	// Support: IE9
-	try {
-		tmp = new DOMParser();
-		xml = tmp.parseFromString( data, "text/xml" );
-	} catch ( e ) {
-		xml = undefined;
-	}
-
-	if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
-		jQuery.error( "Invalid XML: " + data );
-	}
-	return xml;
-};
-
-
-var
-	rhash = /#.*$/,
-	rts = /([?&])_=[^&]*/,
-	rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
-	// #7653, #8125, #8152: local protocol detection
-	rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
-	rnoContent = /^(?:GET|HEAD)$/,
-	rprotocol = /^\/\//,
-	rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
-
-	/* Prefilters
-	 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
-	 * 2) These are called:
-	 *    - BEFORE asking for a transport
-	 *    - AFTER param serialization (s.data is a string if s.processData is true)
-	 * 3) key is the dataType
-	 * 4) the catchall symbol "*" can be used
-	 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
-	 */
-	prefilters = {},
-
-	/* Transports bindings
-	 * 1) key is the dataType
-	 * 2) the catchall symbol "*" can be used
-	 * 3) selection will start with transport dataType and THEN go to "*" if needed
-	 */
-	transports = {},
-
-	// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
-	allTypes = "*/".concat( "*" ),
-
-	// Document location
-	ajaxLocation = window.location.href,
-
-	// Segment location into parts
-	ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
-
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
-
-	// dataTypeExpression is optional and defaults to "*"
-	return function( dataTypeExpression, func ) {
-
-		if ( typeof dataTypeExpression !== "string" ) {
-			func = dataTypeExpression;
-			dataTypeExpression = "*";
-		}
-
-		var dataType,
-			i = 0,
-			dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
-
-		if ( jQuery.isFunction( func ) ) {
-			// For each dataType in the dataTypeExpression
-			while ( (dataType = dataTypes[i++]) ) {
-				// Prepend if requested
-				if ( dataType[0] === "+" ) {
-					dataType = dataType.slice( 1 ) || "*";
-					(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
-
-				// Otherwise append
-				} else {
-					(structure[ dataType ] = structure[ dataType ] || []).push( func );
-				}
-			}
-		}
-	};
-}
-
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
-
-	var inspected = {},
-		seekingTransport = ( structure === transports );
-
-	function inspect( dataType ) {
-		var selected;
-		inspected[ dataType ] = true;
-		jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
-			var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
-			if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
-				options.dataTypes.unshift( dataTypeOrTransport );
-				inspect( dataTypeOrTransport );
-				return false;
-			} else if ( seekingTransport ) {
-				return !( selected = dataTypeOrTransport );
-			}
-		});
-		return selected;
-	}
-
-	return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
-}
-
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
-	var key, deep,
-		flatOptions = jQuery.ajaxSettings.flatOptions || {};
-
-	for ( key in src ) {
-		if ( src[ key ] !== undefined ) {
-			( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
-		}
-	}
-	if ( deep ) {
-		jQuery.extend( true, target, deep );
-	}
-
-	return target;
-}
-
-/* Handles responses to an ajax request:
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
-
-	var ct, type, finalDataType, firstDataType,
-		contents = s.contents,
-		dataTypes = s.dataTypes;
-
-	// Remove auto dataType and get content-type in the process
-	while ( dataTypes[ 0 ] === "*" ) {
-		dataTypes.shift();
-		if ( ct === undefined ) {
-			ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
-		}
-	}
-
-	// Check if we're dealing with a known content-type
-	if ( ct ) {
-		for ( type in contents ) {
-			if ( contents[ type ] && contents[ type ].test( ct ) ) {
-				dataTypes.unshift( type );
-				break;
-			}
-		}
-	}
-
-	// Check to see if we have a response for the expected dataType
-	if ( dataTypes[ 0 ] in responses ) {
-		finalDataType = dataTypes[ 0 ];
-	} else {
-		// Try convertible dataTypes
-		for ( type in responses ) {
-			if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
-				finalDataType = type;
-				break;
-			}
-			if ( !firstDataType ) {
-				firstDataType = type;
-			}
-		}
-		// Or just use first one
-		finalDataType = finalDataType || firstDataType;
-	}
-
-	// If we found a dataType
-	// We add the dataType to the list if needed
-	// and return the corresponding response
-	if ( finalDataType ) {
-		if ( finalDataType !== dataTypes[ 0 ] ) {
-			dataTypes.unshift( finalDataType );
-		}
-		return responses[ finalDataType ];
-	}
-}
-
-/* Chain conversions given the request and the original response
- * Also sets the responseXXX fields on the jqXHR instance
- */
-function ajaxConvert( s, response, jqXHR, isSuccess ) {
-	var conv2, current, conv, tmp, prev,
-		converters = {},
-		// Work with a copy of dataTypes in case we need to modify it for conversion
-		dataTypes = s.dataTypes.slice();
-
-	// Create converters map with lowercased keys
-	if ( dataTypes[ 1 ] ) {
-		for ( conv in s.converters ) {
-			converters[ conv.toLowerCase() ] = s.converters[ conv ];
-		}
-	}
-
-	current = dataTypes.shift();
-
-	// Convert to each sequential dataType
-	while ( current ) {
-
-		if ( s.responseFields[ current ] ) {
-			jqXHR[ s.responseFields[ current ] ] = response;
-		}
-
-		// Apply the dataFilter if provided
-		if ( !prev && isSuccess && s.dataFilter ) {
-			response = s.dataFilter( response, s.dataType );
-		}
-
-		prev = current;
-		current = dataTypes.shift();
-
-		if ( current ) {
-
-		// There's only work to do if current dataType is non-auto
-			if ( current === "*" ) {
-
-				current = prev;
-
-			// Convert response if prev dataType is non-auto and differs from current
-			} else if ( prev !== "*" && prev !== current ) {
-
-				// Seek a direct converter
-				conv = converters[ prev + " " + current ] || converters[ "* " + current ];
-
-				// If none found, seek a pair
-				if ( !conv ) {
-					for ( conv2 in converters ) {
-
-						// If conv2 outputs current
-						tmp = conv2.split( " " );
-						if ( tmp[ 1 ] === current ) {
-
-							// If prev can be converted to accepted input
-							conv = converters[ prev + " " + tmp[ 0 ] ] ||
-								converters[ "* " + tmp[ 0 ] ];
-							if ( conv ) {
-								// Condense equivalence converters
-								if ( conv === true ) {
-									conv = converters[ conv2 ];
-
-								// Otherwise, insert the intermediate dataType
-								} else if ( converters[ conv2 ] !== true ) {
-									current = tmp[ 0 ];
-									dataTypes.unshift( tmp[ 1 ] );
-								}
-								break;
-							}
-						}
-					}
-				}
-
-				// Apply converter (if not an equivalence)
-				if ( conv !== true ) {
-
-					// Unless errors are allowed to bubble, catch and return them
-					if ( conv && s[ "throws" ] ) {
-						response = conv( response );
-					} else {
-						try {
-							response = conv( response );
-						} catch ( e ) {
-							return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
-						}
-					}
-				}
-			}
-		}
-	}
-
-	return { state: "success", data: response };
-}
-
-jQuery.extend({
-
-	// Counter for holding the number of active queries
-	active: 0,
-
-	// Last-Modified header cache for next request
-	lastModified: {},
-	etag: {},
-
-	ajaxSettings: {
-		url: ajaxLocation,
-		type: "GET",
-		isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
-		global: true,
-		processData: true,
-		async: true,
-		contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-		/*
-		timeout: 0,
-		data: null,
-		dataType: null,
-		username: null,
-		password: null,
-		cache: null,
-		throws: false,
-		traditional: false,
-		headers: {},
-		*/
-
-		accepts: {
-			"*": allTypes,
-			text: "text/plain",
-			html: "text/html",
-			xml: "application/xml, text/xml",
-			json: "application/json, text/javascript"
-		},
-
-		contents: {
-			xml: /xml/,
-			html: /html/,
-			json: /json/
-		},
-
-		responseFields: {
-			xml: "responseXML",
-			text: "responseText",
-			json: "responseJSON"
-		},
-
-		// Data converters
-		// Keys separate source (or catchall "*") and destination types with a single space
-		converters: {
-
-			// Convert anything to text
-			"* text": String,
-
-			// Text to html (true = no transformation)
-			"text html": true,
-
-			// Evaluate text as a json expression
-			"text json": jQuery.parseJSON,
-
-			// Parse text as xml
-			"text xml": jQuery.parseXML
-		},
-
-		// For options that shouldn't be deep extended:
-		// you can add your own custom options here if
-		// and when you create one that shouldn't be
-		// deep extended (see ajaxExtend)
-		flatOptions: {
-			url: true,
-			context: true
-		}
-	},
-
-	// Creates a full fledged settings object into target
-	// with both ajaxSettings and settings fields.
-	// If target is omitted, writes into ajaxSettings.
-	ajaxSetup: function( target, settings ) {
-		return settings ?
-
-			// Building a settings object
-			ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
-
-			// Extending ajaxSettings
-			ajaxExtend( jQuery.ajaxSettings, target );
-	},
-
-	ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
-	ajaxTransport: addToPrefiltersOrTransports( transports ),
-
-	// Main method
-	ajax: function( url, options ) {
-
-		// If url is an object, simulate pre-1.5 signature
-		if ( typeof url === "object" ) {
-			options = url;
-			url = undefined;
-		}
-
-		// Force options to be an object
-		options = options || {};
-
-		var transport,
-			// URL without anti-cache param
-			cacheURL,
-			// Response headers
-			responseHeadersString,
-			responseHeaders,
-			// timeout handle
-			timeoutTimer,
-			// Cross-domain detection vars
-			parts,
-			// To know if global events are to be dispatched
-			fireGlobals,
-			// Loop variable
-			i,
-			// Create the final options object
-			s = jQuery.ajaxSetup( {}, options ),
-			// Callbacks context
-			callbackContext = s.context || s,
-			// Context for global events is callbackContext if it is a DOM node or jQuery collection
-			globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
-				jQuery( callbackContext ) :
-				jQuery.event,
-			// Deferreds
-			deferred = jQuery.Deferred(),
-			completeDeferred = jQuery.Callbacks("once memory"),
-			// Status-dependent callbacks
-			statusCode = s.statusCode || {},
-			// Headers (they are sent all at once)
-			requestHeaders = {},
-			requestHeadersNames = {},
-			// The jqXHR state
-			state = 0,
-			// Default abort message
-			strAbort = "canceled",
-			// Fake xhr
-			jqXHR = {
-				readyState: 0,
-
-				// Builds headers hashtable if needed
-				getResponseHeader: function( key ) {
-					var match;
-					if ( state === 2 ) {
-						if ( !responseHeaders ) {
-							responseHeaders = {};
-							while ( (match = rheaders.exec( responseHeadersString )) ) {
-								responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
-							}
-						}
-						match = responseHeaders[ key.toLowerCase() ];
-					}
-					return match == null ? null : match;
-				},
-
-				// Raw string
-				getAllResponseHeaders: function() {
-					return state === 2 ? responseHeadersString : null;
-				},
-
-				// Caches the header
-				setRequestHeader: function( name, value ) {
-					var lname = name.toLowerCase();
-					if ( !state ) {
-						name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
-						requestHeaders[ name ] = value;
-					}
-					return this;
-				},
-
-				// Overrides response content-type header
-				overrideMimeType: function( type ) {
-					if ( !state ) {
-						s.mimeType = type;
-					}
-					return this;
-				},
-
-				// Status-dependent callbacks
-				statusCode: function( map ) {
-					var code;
-					if ( map ) {
-						if ( state < 2 ) {
-							for ( code in map ) {
-								// Lazy-add the new callback in a way that preserves old ones
-								statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
-							}
-						} else {
-							// Execute the appropriate callbacks
-							jqXHR.always( map[ jqXHR.status ] );
-						}
-					}
-					return this;
-				},
-
-				// Cancel the request
-				abort: function( statusText ) {
-					var finalText = statusText || strAbort;
-					if ( transport ) {
-						transport.abort( finalText );
-					}
-					done( 0, finalText );
-					return this;
-				}
-			};
-
-		// Attach deferreds
-		deferred.promise( jqXHR ).complete = completeDeferred.add;
-		jqXHR.success = jqXHR.done;
-		jqXHR.error = jqXHR.fail;
-
-		// Remove hash character (#7531: and string promotion)
-		// Add protocol if not provided (prefilters might expect it)
-		// Handle falsy url in the settings object (#10093: consistency with old signature)
-		// We also use the url parameter if available
-		s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
-			.replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
-		// Alias method option to type as per ticket #12004
-		s.type = options.method || options.type || s.method || s.type;
-
-		// Extract dataTypes list
-		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
-
-		// A cross-domain request is in order when we have a protocol:host:port mismatch
-		if ( s.crossDomain == null ) {
-			parts = rurl.exec( s.url.toLowerCase() );
-			s.crossDomain = !!( parts &&
-				( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
-					( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
-						( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
-			);
-		}
-
-		// Convert data if not already a string
-		if ( s.data && s.processData && typeof s.data !== "string" ) {
-			s.data = jQuery.param( s.data, s.traditional );
-		}
-
-		// Apply prefilters
-		inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
-		// If request was aborted inside a prefilter, stop there
-		if ( state === 2 ) {
-			return jqXHR;
-		}
-
-		// We can fire global events as of now if asked to
-		// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
-		fireGlobals = jQuery.event && s.global;
-
-		// Watch for a new set of requests
-		if ( fireGlobals && jQuery.active++ === 0 ) {
-			jQuery.event.trigger("ajaxStart");
-		}
-
-		// Uppercase the type
-		s.type = s.type.toUpperCase();
-
-		// Determine if request has content
-		s.hasContent = !rnoContent.test( s.type );
-
-		// Save the URL in case we're toying with the If-Modified-Since
-		// and/or If-None-Match header later on
-		cacheURL = s.url;
-
-		// More options handling for requests with no content
-		if ( !s.hasContent ) {
-
-			// If data is available, append data to url
-			if ( s.data ) {
-				cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
-				// #9682: remove data so that it's not used in an eventual retry
-				delete s.data;
-			}
-
-			// Add anti-cache in url if needed
-			if ( s.cache === false ) {
-				s.url = rts.test( cacheURL ) ?
-
-					// If there is already a '_' parameter, set its value
-					cacheURL.replace( rts, "$1_=" + nonce++ ) :
-
-					// Otherwise add one to the end
-					cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
-			}
-		}
-
-		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-		if ( s.ifModified ) {
-			if ( jQuery.lastModified[ cacheURL ] ) {
-				jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
-			}
-			if ( jQuery.etag[ cacheURL ] ) {
-				jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
-			}
-		}
-
-		// Set the correct header, if data is being sent
-		if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
-			jqXHR.setRequestHeader( "Content-Type", s.contentType );
-		}
-
-		// Set the Accepts header for the server, depending on the dataType
-		jqXHR.setRequestHeader(
-			"Accept",
-			s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
-				s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
-				s.accepts[ "*" ]
-		);
-
-		// Check for headers option
-		for ( i in s.headers ) {
-			jqXHR.setRequestHeader( i, s.headers[ i ] );
-		}
-
-		// Allow custom headers/mimetypes and early abort
-		if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
-			// Abort if not done already and return
-			return jqXHR.abort();
-		}
-
-		// Aborting is no longer a cancellation
-		strAbort = "abort";
-
-		// Install callbacks on deferreds
-		for ( i in { success: 1, error: 1, complete: 1 } ) {
-			jqXHR[ i ]( s[ i ] );
-		}
-
-		// Get transport
-		transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
-		// If no transport, we auto-abort
-		if ( !transport ) {
-			done( -1, "No Transport" );
-		} else {
-			jqXHR.readyState = 1;
-
-			// Send global event
-			if ( fireGlobals ) {
-				globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
-			}
-			// Timeout
-			if ( s.async && s.timeout > 0 ) {
-				timeoutTimer = setTimeout(function() {
-					jqXHR.abort("timeout");
-				}, s.timeout );
-			}
-
-			try {
-				state = 1;
-				transport.send( requestHeaders, done );
-			} catch ( e ) {
-				// Propagate exception as error if not done
-				if ( state < 2 ) {
-					done( -1, e );
-				// Simply rethrow otherwise
-				} else {
-					throw e;
-				}
-			}
-		}
-
-		// Callback for when everything is done
-		function done( status, nativeStatusText, responses, headers ) {
-			var isSuccess, success, error, response, modified,
-				statusText = nativeStatusText;
-
-			// Called once
-			if ( state === 2 ) {
-				return;
-			}
-
-			// State is "done" now
-			state = 2;
-
-			// Clear timeout if it exists
-			if ( timeoutTimer ) {
-				clearTimeout( timeoutTimer );
-			}
-
-			// Dereference transport for early garbage collection
-			// (no matter how long the jqXHR object will be used)
-			transport = undefined;
-
-			// Cache response headers
-			responseHeadersString = headers || "";
-
-			// Set readyState
-			jqXHR.readyState = status > 0 ? 4 : 0;
-
-			// Determine if successful
-			isSuccess = status >= 200 && status < 300 || status === 304;
-
-			// Get response data
-			if ( responses ) {
-				response = ajaxHandleResponses( s, jqXHR, responses );
-			}
-
-			// Convert no matter what (that way responseXXX fields are always set)
-			response = ajaxConvert( s, response, jqXHR, isSuccess );
-
-			// If successful, handle type chaining
-			if ( isSuccess ) {
-
-				// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-				if ( s.ifModified ) {
-					modified = jqXHR.getResponseHeader("Last-Modified");
-					if ( modified ) {
-						jQuery.lastModified[ cacheURL ] = modified;
-					}
-					modified = jqXHR.getResponseHeader("etag");
-					if ( modified ) {
-						jQuery.etag[ cacheURL ] = modified;
-					}
-				}
-
-				// if no content
-				if ( status === 204 || s.type === "HEAD" ) {
-					statusText = "nocontent";
-
-				// if not modified
-				} else if ( status === 304 ) {
-					statusText = "notmodified";
-
-				// If we have data, let's convert it
-				} else {
-					statusText = response.state;
-					success = response.data;
-					error = response.error;
-					isSuccess = !error;
-				}
-			} else {
-				// Extract error from statusText and normalize for non-aborts
-				error = statusText;
-				if ( status || !statusText ) {
-					statusText = "error";
-					if ( status < 0 ) {
-						status = 0;
-					}
-				}
-			}
-
-			// Set data for the fake xhr object
-			jqXHR.status = status;
-			jqXHR.statusText = ( nativeStatusText || statusText ) + "";
-
-			// Success/Error
-			if ( isSuccess ) {
-				deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
-			} else {
-				deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
-			}
-
-			// Status-dependent callbacks
-			jqXHR.statusCode( statusCode );
-			statusCode = undefined;
-
-			if ( fireGlobals ) {
-				globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
-					[ jqXHR, s, isSuccess ? success : error ] );
-			}
-
-			// Complete
-			completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
-			if ( fireGlobals ) {
-				globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
-				// Handle the global AJAX counter
-				if ( !( --jQuery.active ) ) {
-					jQuery.event.trigger("ajaxStop");
-				}
-			}
-		}
-
-		return jqXHR;
-	},
-
-	getJSON: function( url, data, callback ) {
-		return jQuery.get( url, data, callback, "json" );
-	},
-
-	getScript: function( url, callback ) {
-		return jQuery.get( url, undefined, callback, "script" );
-	}
-});
-
-jQuery.each( [ "get", "post" ], function( i, method ) {
-	jQuery[ method ] = function( url, data, callback, type ) {
-		// Shift arguments if data argument was omitted
-		if ( jQuery.isFunction( data ) ) {
-			type = type || callback;
-			callback = data;
-			data = undefined;
-		}
-
-		return jQuery.ajax({
-			url: url,
-			type: method,
-			dataType: type,
-			data: data,
-			success: callback
-		});
-	};
-});
-
-
-jQuery._evalUrl = function( url ) {
-	return jQuery.ajax({
-		url: url,
-		type: "GET",
-		dataType: "script",
-		async: false,
-		global: false,
-		"throws": true
-	});
-};
-
-
-jQuery.fn.extend({
-	wrapAll: function( html ) {
-		var wrap;
-
-		if ( jQuery.isFunction( html ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).wrapAll( html.call(this, i) );
-			});
-		}
-
-		if ( this[ 0 ] ) {
-
-			// The elements to wrap the target around
-			wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
-
-			if ( this[ 0 ].parentNode ) {
-				wrap.insertBefore( this[ 0 ] );
-			}
-
-			wrap.map(function() {
-				var elem = this;
-
-				while ( elem.firstElementChild ) {
-					elem = elem.firstElementChild;
-				}
-
-				return elem;
-			}).append( this );
-		}
-
-		return this;
-	},
-
-	wrapInner: function( html ) {
-		if ( jQuery.isFunction( html ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).wrapInner( html.call(this, i) );
-			});
-		}
-
-		return this.each(function() {
-			var self = jQuery( this ),
-				contents = self.contents();
-
-			if ( contents.length ) {
-				contents.wrapAll( html );
-
-			} else {
-				self.append( html );
-			}
-		});
-	},
-
-	wrap: function( html ) {
-		var isFunction = jQuery.isFunction( html );
-
-		return this.each(function( i ) {
-			jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
-		});
-	},
-
-	unwrap: function() {
-		return this.parent().each(function() {
-			if ( !jQuery.nodeName( this, "body" ) ) {
-				jQuery( this ).replaceWith( this.childNodes );
-			}
-		}).end();
-	}
-});
-
-
-jQuery.expr.filters.hidden = function( elem ) {
-	// Support: Opera <= 12.12
-	// Opera reports offsetWidths and offsetHeights less than zero on some elements
-	return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
-};
-jQuery.expr.filters.visible = function( elem ) {
-	return !jQuery.expr.filters.hidden( elem );
-};
-
-
-
-
-var r20 = /%20/g,
-	rbracket = /\[\]$/,
-	rCRLF = /\r?\n/g,
-	rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
-	rsubmittable = /^(?:input|select|textarea|keygen)/i;
-
-function buildParams( prefix, obj, traditional, add ) {
-	var name;
-
-	if ( jQuery.isArray( obj ) ) {
-		// Serialize array item.
-		jQuery.each( obj, function( i, v ) {
-			if ( traditional || rbracket.test( prefix ) ) {
-				// Treat each array item as a scalar.
-				add( prefix, v );
-
-			} else {
-				// Item is non-scalar (array or object), encode its numeric index.
-				buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
-			}
-		});
-
-	} else if ( !traditional && jQuery.type( obj ) === "object" ) {
-		// Serialize object item.
-		for ( name in obj ) {
-			buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
-		}
-
-	} else {
-		// Serialize scalar item.
-		add( prefix, obj );
-	}
-}
-
-// Serialize an array of form elements or a set of
-// key/values into a query string
-jQuery.param = function( a, traditional ) {
-	var prefix,
-		s = [],
-		add = function( key, value ) {
-			// If value is a function, invoke it and return its value
-			value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
-			s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
-		};
-
-	// Set traditional to true for jQuery <= 1.3.2 behavior.
-	if ( traditional === undefined ) {
-		traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
-	}
-
-	// If an array was passed in, assume that it is an array of form elements.
-	if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
-		// Serialize the form elements
-		jQuery.each( a, function() {
-			add( this.name, this.value );
-		});
-
-	} else {
-		// If traditional, encode the "old" way (the way 1.3.2 or older
-		// did it), otherwise encode params recursively.
-		for ( prefix in a ) {
-			buildParams( prefix, a[ prefix ], traditional, add );
-		}
-	}
-
-	// Return the resulting serialization
-	return s.join( "&" ).replace( r20, "+" );
-};
-
-jQuery.fn.extend({
-	serialize: function() {
-		return jQuery.param( this.serializeArray() );
-	},
-	serializeArray: function() {
-		return this.map(function() {
-			// Can add propHook for "elements" to filter or add form elements
-			var elements = jQuery.prop( this, "elements" );
-			return elements ? jQuery.makeArray( elements ) : this;
-		})
-		.filter(function() {
-			var type = this.type;
-
-			// Use .is( ":disabled" ) so that fieldset[disabled] works
-			return this.name && !jQuery( this ).is( ":disabled" ) &&
-				rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
-				( this.checked || !rcheckableType.test( type ) );
-		})
-		.map(function( i, elem ) {
-			var val = jQuery( this ).val();
-
-			return val == null ?
-				null :
-				jQuery.isArray( val ) ?
-					jQuery.map( val, function( val ) {
-						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-					}) :
-					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-		}).get();
-	}
-});
-
-
-jQuery.ajaxSettings.xhr = function() {
-	try {
-		return new XMLHttpRequest();
-	} catch( e ) {}
-};
-
-var xhrId = 0,
-	xhrCallbacks = {},
-	xhrSuccessStatus = {
-		// file protocol always yields status code 0, assume 200
-		0: 200,
-		// Support: IE9
-		// #1450: sometimes IE returns 1223 when it should be 204
-		1223: 204
-	},
-	xhrSupported = jQuery.ajaxSettings.xhr();
-
-// Support: IE9
-// Open requests must be manually aborted on unload (#5280)
-// See https://support.microsoft.com/kb/2856746 for more info
-if ( window.attachEvent ) {
-	window.attachEvent( "onunload", function() {
-		for ( var key in xhrCallbacks ) {
-			xhrCallbacks[ key ]();
-		}
-	});
-}
-
-support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
-support.ajax = xhrSupported = !!xhrSupported;
-
-jQuery.ajaxTransport(function( options ) {
-	var callback;
-
-	// Cross domain only allowed if supported through XMLHttpRequest
-	if ( support.cors || xhrSupported && !options.crossDomain ) {
-		return {
-			send: function( headers, complete ) {
-				var i,
-					xhr = options.xhr(),
-					id = ++xhrId;
-
-				xhr.open( options.type, options.url, options.async, options.username, options.password );
-
-				// Apply custom fields if provided
-				if ( options.xhrFields ) {
-					for ( i in options.xhrFields ) {
-						xhr[ i ] = options.xhrFields[ i ];
-					}
-				}
-
-				// Override mime type if needed
-				if ( options.mimeType && xhr.overrideMimeType ) {
-					xhr.overrideMimeType( options.mimeType );
-				}
-
-				// X-Requested-With header
-				// For cross-domain requests, seeing as conditions for a preflight are
-				// akin to a jigsaw puzzle, we simply never set it to be sure.
-				// (it can always be set on a per-request basis or even using ajaxSetup)
-				// For same-domain requests, won't change header if already provided.
-				if ( !options.crossDomain && !headers["X-Requested-With"] ) {
-					headers["X-Requested-With"] = "XMLHttpRequest";
-				}
-
-				// Set headers
-				for ( i in headers ) {
-					xhr.setRequestHeader( i, headers[ i ] );
-				}
-
-				// Callback
-				callback = function( type ) {
-					return function() {
-						if ( callback ) {
-							delete xhrCallbacks[ id ];
-							callback = xhr.onload = xhr.onerror = null;
-
-							if ( type === "abort" ) {
-								xhr.abort();
-							} else if ( type === "error" ) {
-								complete(
-									// file: protocol always yields status 0; see #8605, #14207
-									xhr.status,
-									xhr.statusText
-								);
-							} else {
-								complete(
-									xhrSuccessStatus[ xhr.status ] || xhr.status,
-									xhr.statusText,
-									// Support: IE9
-									// Accessing binary-data responseText throws an exception
-									// (#11426)
-									typeof xhr.responseText === "string" ? {
-										text: xhr.responseText
-									} : undefined,
-									xhr.getAllResponseHeaders()
-								);
-							}
-						}
-					};
-				};
-
-				// Listen to events
-				xhr.onload = callback();
-				xhr.onerror = callback("error");
-
-				// Create the abort callback
-				callback = xhrCallbacks[ id ] = callback("abort");
-
-				try {
-					// Do send the request (this may raise an exception)
-					xhr.send( options.hasContent && options.data || null );
-				} catch ( e ) {
-					// #14683: Only rethrow if this hasn't been notified as an error yet
-					if ( callback ) {
-						throw e;
-					}
-				}
-			},
-
-			abort: function() {
-				if ( callback ) {
-					callback();
-				}
-			}
-		};
-	}
-});
-
-
-
-
-// Install script dataType
-jQuery.ajaxSetup({
-	accepts: {
-		script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
-	},
-	contents: {
-		script: /(?:java|ecma)script/
-	},
-	converters: {
-		"text script": function( text ) {
-			jQuery.globalEval( text );
-			return text;
-		}
-	}
-});
-
-// Handle cache's special case and crossDomain
-jQuery.ajaxPrefilter( "script", function( s ) {
-	if ( s.cache === undefined ) {
-		s.cache = false;
-	}
-	if ( s.crossDomain ) {
-		s.type = "GET";
-	}
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function( s ) {
-	// This transport only deals with cross domain requests
-	if ( s.crossDomain ) {
-		var script, callback;
-		return {
-			send: function( _, complete ) {
-				script = jQuery("<script>").prop({
-					async: true,
-					charset: s.scriptCharset,
-					src: s.url
-				}).on(
-					"load error",
-					callback = function( evt ) {
-						script.remove();
-						callback = null;
-						if ( evt ) {
-							complete( evt.type === "error" ? 404 : 200, evt.type );
-						}
-					}
-				);
-				document.head.appendChild( script[ 0 ] );
-			},
-			abort: function() {
-				if ( callback ) {
-					callback();
-				}
-			}
-		};
-	}
-});
-
-
-
-
-var oldCallbacks = [],
-	rjsonp = /(=)\?(?=&|$)|\?\?/;
-
-// Default jsonp settings
-jQuery.ajaxSetup({
-	jsonp: "callback",
-	jsonpCallback: function() {
-		var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
-		this[ callback ] = true;
-		return callback;
-	}
-});
-
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
-	var callbackName, overwritten, responseContainer,
-		jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
-			"url" :
-			typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
-		);
-
-	// Handle iff the expected data type is "jsonp" or we have a parameter to set
-	if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
-
-		// Get callback name, remembering preexisting value associated with it
-		callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
-			s.jsonpCallback() :
-			s.jsonpCallback;
-
-		// Insert callback into url or form data
-		if ( jsonProp ) {
-			s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
-		} else if ( s.jsonp !== false ) {
-			s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
-		}
-
-		// Use data converter to retrieve json after script execution
-		s.converters["script json"] = function() {
-			if ( !responseContainer ) {
-				jQuery.error( callbackName + " was not called" );
-			}
-			return responseContainer[ 0 ];
-		};
-
-		// force json dataType
-		s.dataTypes[ 0 ] = "json";
-
-		// Install callback
-		overwritten = window[ callbackName ];
-		window[ callbackName ] = function() {
-			responseContainer = arguments;
-		};
-
-		// Clean-up function (fires after converters)
-		jqXHR.always(function() {
-			// Restore preexisting value
-			window[ callbackName ] = overwritten;
-
-			// Save back as free
-			if ( s[ callbackName ] ) {
-				// make sure that re-using the options doesn't screw things around
-				s.jsonpCallback = originalSettings.jsonpCallback;
-
-				// save the callback name for future use
-				oldCallbacks.push( callbackName );
-			}
-
-			// Call if it was a function and we have a response
-			if ( responseContainer && jQuery.isFunction( overwritten ) ) {
-				overwritten( responseContainer[ 0 ] );
-			}
-
-			responseContainer = overwritten = undefined;
-		});
-
-		// Delegate to script
-		return "script";
-	}
-});
-
-
-
-
-// data: string of html
-// context (optional): If specified, the fragment will be created in this context, defaults to document
-// keepScripts (optional): If true, will include scripts passed in the html string
-jQuery.parseHTML = function( data, context, keepScripts ) {
-	if ( !data || typeof data !== "string" ) {
-		return null;
-	}
-	if ( typeof context === "boolean" ) {
-		keepScripts = context;
-		context = false;
-	}
-	context = context || document;
-
-	var parsed = rsingleTag.exec( data ),
-		scripts = !keepScripts && [];
-
-	// Single tag
-	if ( parsed ) {
-		return [ context.createElement( parsed[1] ) ];
-	}
-
-	parsed = jQuery.buildFragment( [ data ], context, scripts );
-
-	if ( scripts && scripts.length ) {
-		jQuery( scripts ).remove();
-	}
-
-	return jQuery.merge( [], parsed.childNodes );
-};
-
-
-// Keep a copy of the old load method
-var _load = jQuery.fn.load;
-
-/**
- * Load a url into a page
- */
-jQuery.fn.load = function( url, params, callback ) {
-	if ( typeof url !== "string" && _load ) {
-		return _load.apply( this, arguments );
-	}
-
-	var selector, type, response,
-		self = this,
-		off = url.indexOf(" ");
-
-	if ( off >= 0 ) {
-		selector = jQuery.trim( url.slice( off ) );
-		url = url.slice( 0, off );
-	}
-
-	// If it's a function
-	if ( jQuery.isFunction( params ) ) {
-
-		// We assume that it's the callback
-		callback = params;
-		params = undefined;
-
-	// Otherwise, build a param string
-	} else if ( params && typeof params === "object" ) {
-		type = "POST";
-	}
-
-	// If we have elements to modify, make the request
-	if ( self.length > 0 ) {
-		jQuery.ajax({
-			url: url,
-
-			// if "type" variable is undefined, then "GET" method will be used
-			type: type,
-			dataType: "html",
-			data: params
-		}).done(function( responseText ) {
-
-			// Save response for use in complete callback
-			response = arguments;
-
-			self.html( selector ?
-
-				// If a selector was specified, locate the right elements in a dummy div
-				// Exclude scripts to avoid IE 'Permission Denied' errors
-				jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
-
-				// Otherwise use the full result
-				responseText );
-
-		}).complete( callback && function( jqXHR, status ) {
-			self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
-		});
-	}
-
-	return this;
-};
-
-
-
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
-	jQuery.fn[ type ] = function( fn ) {
-		return this.on( type, fn );
-	};
-});
-
-
-
-
-jQuery.expr.filters.animated = function( elem ) {
-	return jQuery.grep(jQuery.timers, function( fn ) {
-		return elem === fn.elem;
-	}).length;
-};
-
-
-
-
-var docElem = window.document.documentElement;
-
-/**
- * Gets a window from an element
- */
-function getWindow( elem ) {
-	return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
-}
-
-jQuery.offset = {
-	setOffset: function( elem, options, i ) {
-		var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
-			position = jQuery.css( elem, "position" ),
-			curElem = jQuery( elem ),
-			props = {};
-
-		// Set position first, in-case top/left are set even on static elem
-		if ( position === "static" ) {
-			elem.style.position = "relative";
-		}
-
-		curOffset = curElem.offset();
-		curCSSTop = jQuery.css( elem, "top" );
-		curCSSLeft = jQuery.css( elem, "left" );
-		calculatePosition = ( position === "absolute" || position === "fixed" ) &&
-			( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
-
-		// Need to be able to calculate position if either
-		// top or left is auto and position is either absolute or fixed
-		if ( calculatePosition ) {
-			curPosition = curElem.position();
-			curTop = curPosition.top;
-			curLeft = curPosition.left;
-
-		} else {
-			curTop = parseFloat( curCSSTop ) || 0;
-			curLeft = parseFloat( curCSSLeft ) || 0;
-		}
-
-		if ( jQuery.isFunction( options ) ) {
-			options = options.call( elem, i, curOffset );
-		}
-
-		if ( options.top != null ) {
-			props.top = ( options.top - curOffset.top ) + curTop;
-		}
-		if ( options.left != null ) {
-			props.left = ( options.left - curOffset.left ) + curLeft;
-		}
-
-		if ( "using" in options ) {
-			options.using.call( elem, props );
-
-		} else {
-			curElem.css( props );
-		}
-	}
-};
-
-jQuery.fn.extend({
-	offset: function( options ) {
-		if ( arguments.length ) {
-			return options === undefined ?
-				this :
-				this.each(function( i ) {
-					jQuery.offset.setOffset( this, options, i );
-				});
-		}
-
-		var docElem, win,
-			elem = this[ 0 ],
-			box = { top: 0, left: 0 },
-			doc = elem && elem.ownerDocument;
-
-		if ( !doc ) {
-			return;
-		}
-
-		docElem = doc.documentElement;
-
-		// Make sure it's not a disconnected DOM node
-		if ( !jQuery.contains( docElem, elem ) ) {
-			return box;
-		}
-
-		// Support: BlackBerry 5, iOS 3 (original iPhone)
-		// If we don't have gBCR, just use 0,0 rather than error
-		if ( typeof elem.getBoundingClientRect !== strundefined ) {
-			box = elem.getBoundingClientRect();
-		}
-		win = getWindow( doc );
-		return {
-			top: box.top + win.pageYOffset - docElem.clientTop,
-			left: box.left + win.pageXOffset - docElem.clientLeft
-		};
-	},
-
-	position: function() {
-		if ( !this[ 0 ] ) {
-			return;
-		}
-
-		var offsetParent, offset,
-			elem = this[ 0 ],
-			parentOffset = { top: 0, left: 0 };
-
-		// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
-		if ( jQuery.css( elem, "position" ) === "fixed" ) {
-			// Assume getBoundingClientRect is there when computed position is fixed
-			offset = elem.getBoundingClientRect();
-
-		} else {
-			// Get *real* offsetParent
-			offsetParent = this.offsetParent();
-
-			// Get correct offsets
-			offset = this.offset();
-			if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
-				parentOffset = offsetParent.offset();
-			}
-
-			// Add offsetParent borders
-			parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
-			parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
-		}
-
-		// Subtract parent offsets and element margins
-		return {
-			top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
-			left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
-		};
-	},
-
-	offsetParent: function() {
-		return this.map(function() {
-			var offsetParent = this.offsetParent || docElem;
-
-			while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
-				offsetParent = offsetParent.offsetParent;
-			}
-
-			return offsetParent || docElem;
-		});
-	}
-});
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
-	var top = "pageYOffset" === prop;
-
-	jQuery.fn[ method ] = function( val ) {
-		return access( this, function( elem, method, val ) {
-			var win = getWindow( elem );
-
-			if ( val === undefined ) {
-				return win ? win[ prop ] : elem[ method ];
-			}
-
-			if ( win ) {
-				win.scrollTo(
-					!top ? val : window.pageXOffset,
-					top ? val : window.pageYOffset
-				);
-
-			} else {
-				elem[ method ] = val;
-			}
-		}, method, val, arguments.length, null );
-	};
-});
-
-// Support: Safari<7+, Chrome<37+
-// Add the top/left cssHooks using jQuery.fn.position
-// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
-// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
-// getComputedStyle returns percent when specified for top/left/bottom/right;
-// rather than make the css module depend on the offset module, just check for it here
-jQuery.each( [ "top", "left" ], function( i, prop ) {
-	jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
-		function( elem, computed ) {
-			if ( computed ) {
-				computed = curCSS( elem, prop );
-				// If curCSS returns percentage, fallback to offset
-				return rnumnonpx.test( computed ) ?
-					jQuery( elem ).position()[ prop ] + "px" :
-					computed;
-			}
-		}
-	);
-});
-
-
-// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
-	jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
-		// Margin is only for outerHeight, outerWidth
-		jQuery.fn[ funcName ] = function( margin, value ) {
-			var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
-				extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
-
-			return access( this, function( elem, type, value ) {
-				var doc;
-
-				if ( jQuery.isWindow( elem ) ) {
-					// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
-					// isn't a whole lot we can do. See pull request at this URL for discussion:
-					// https://github.com/jquery/jquery/pull/764
-					return elem.document.documentElement[ "client" + name ];
-				}
-
-				// Get document width or height
-				if ( elem.nodeType === 9 ) {
-					doc = elem.documentElement;
-
-					// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
-					// whichever is greatest
-					return Math.max(
-						elem.body[ "scroll" + name ], doc[ "scroll" + name ],
-						elem.body[ "offset" + name ], doc[ "offset" + name ],
-						doc[ "client" + name ]
-					);
-				}
-
-				return value === undefined ?
-					// Get width or height on the element, requesting but not forcing parseFloat
-					jQuery.css( elem, type, extra ) :
-
-					// Set width or height on the element
-					jQuery.style( elem, type, value, extra );
-			}, type, chainable ? margin : undefined, chainable, null );
-		};
-	});
-});
-
-
-// The number of elements contained in the matched element set
-jQuery.fn.size = function() {
-	return this.length;
-};
-
-jQuery.fn.andSelf = jQuery.fn.addBack;
-
-
-
-
-// Register as a named AMD module, since jQuery can be concatenated with other
-// files that may use define, but not via a proper concatenation script that
-// understands anonymous AMD modules. A named AMD is safest and most robust
-// way to register. Lowercase jquery is used because AMD module names are
-// derived from file names, and jQuery is normally delivered in a lowercase
-// file name. Do this after creating the global so that if an AMD module wants
-// to call noConflict to hide this version of jQuery, it will work.
-
-// Note that for maximum portability, libraries that are not jQuery should
-// declare themselves as anonymous modules, and avoid setting a global if an
-// AMD loader is present. jQuery is a special case. For more information, see
-// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
-
-if ( typeof define === "function" && define.amd ) {
-	define( "jquery", [], function() {
-		return jQuery;
-	});
-}
-
-
-
-
-var
-	// Map over jQuery in case of overwrite
-	_jQuery = window.jQuery,
-
-	// Map over the $ in case of overwrite
-	_$ = window.$;
-
-jQuery.noConflict = function( deep ) {
-	if ( window.$ === jQuery ) {
-		window.$ = _$;
-	}
-
-	if ( deep && window.jQuery === jQuery ) {
-		window.jQuery = _jQuery;
-	}
-
-	return jQuery;
-};
-
-// Expose jQuery and $ identifiers, even in AMD
-// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
-// and CommonJS for browser emulators (#13566)
-if ( typeof noGlobal === strundefined ) {
-	window.jQuery = window.$ = jQuery;
-}
-
-
-
-
-return jQuery;
-
-}));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/dist/jquery.min.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/dist/jquery.min.js
deleted file mode 100644
index fad9ab1..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/dist/jquery.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){
-return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fa(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||ta(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Na.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wa(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xa(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(La=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),La=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)),
-void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rb(a,b,c,d){var e={},f=a===mb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function ub(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||n.expando+"_"+cb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gb,"$1"+e):b.jsonp!==!1&&(b.url+=(db.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ib=a.document.documentElement;function Jb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ib;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jb(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=ya(k.pixelPosition,function(a,c){return c?(c=xa(a,b),va.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lb),b&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n});
-//# sourceMappingURL=jquery.min.map
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/dist/jquery.min.map b/views/ngXosViews/serviceGrid/src/vendor/jquery/dist/jquery.min.map
deleted file mode 100644
index 95fc122..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/dist/jquery.min.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"jquery.min.js","sources":["jquery.js"],"names":["global","factory","module","exports","document","w","Error","window","this","noGlobal","arr","slice","concat","push","indexOf","class2type","toString","hasOwn","hasOwnProperty","support","version","jQuery","selector","context","fn","init","rtrim","rmsPrefix","rdashAlpha","fcamelCase","all","letter","toUpperCase","prototype","jquery","constructor","length","toArray","call","get","num","pushStack","elems","ret","merge","prevObject","each","callback","args","map","elem","i","apply","arguments","first","eq","last","len","j","end","sort","splice","extend","options","name","src","copy","copyIsArray","clone","target","deep","isFunction","isPlainObject","isArray","undefined","expando","Math","random","replace","isReady","error","msg","noop","obj","type","Array","isWindow","isNumeric","parseFloat","nodeType","isEmptyObject","globalEval","code","script","indirect","eval","trim","createElement","text","head","appendChild","parentNode","removeChild","camelCase","string","nodeName","toLowerCase","value","isArraylike","makeArray","results","Object","inArray","second","grep","invert","callbackInverse","matches","callbackExpect","arg","guid","proxy","tmp","now","Date","split","Sizzle","Expr","getText","isXML","tokenize","compile","select","outermostContext","sortInput","hasDuplicate","setDocument","docElem","documentIsHTML","rbuggyQSA","rbuggyMatches","contains","preferredDoc","dirruns","done","classCache","createCache","tokenCache","compilerCache","sortOrder","a","b","MAX_NEGATIVE","pop","push_native","list","booleans","whitespace","characterEncoding","identifier","attributes","pseudos","rwhitespace","RegExp","rcomma","rcombinators","rattributeQuotes","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rinputs","rheader","rnative","rquickExpr","rsibling","rescape","runescape","funescape","_","escaped","escapedWhitespace","high","String","fromCharCode","unloadHandler","childNodes","e","els","seed","match","m","groups","old","nid","newContext","newSelector","ownerDocument","exec","getElementById","id","getElementsByTagName","getElementsByClassName","qsa","test","getAttribute","setAttribute","toSelector","testContext","join","querySelectorAll","qsaError","removeAttribute","keys","cache","key","cacheLength","shift","markFunction","assert","div","addHandle","attrs","handler","attrHandle","siblingCheck","cur","diff","sourceIndex","nextSibling","createInputPseudo","createButtonPseudo","createPositionalPseudo","argument","matchIndexes","documentElement","node","hasCompare","parent","doc","defaultView","top","addEventListener","attachEvent","className","createComment","getById","getElementsByName","find","filter","attrId","getAttributeNode","tag","innerHTML","input","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","compareDocumentPosition","adown","bup","compare","sortDetached","aup","ap","bp","unshift","expr","elements","attr","val","specified","uniqueSort","duplicates","detectDuplicates","sortStable","textContent","firstChild","nodeValue","selectors","createPseudo","relative",">","dir"," ","+","~","preFilter","excess","unquoted","nodeNameSelector","pattern","operator","check","result","what","simple","forward","ofType","xml","outerCache","nodeIndex","start","useCache","lastChild","pseudo","setFilters","idx","matched","not","matcher","unmatched","has","innerText","lang","elemLang","hash","location","root","focus","activeElement","hasFocus","href","tabIndex","enabled","disabled","checked","selected","selectedIndex","empty","header","button","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","filters","parseOnly","tokens","soFar","preFilters","cached","addCombinator","combinator","base","checkNonElements","doneName","oldCache","newCache","elementMatcher","matchers","multipleContexts","contexts","condense","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","implicitRelative","matchContext","matchAnyContext","matcherFromGroupMatchers","elementMatchers","setMatchers","bySet","byElement","superMatcher","outermost","matchedCount","setMatched","contextBackup","dirrunsUnique","token","compiled","div1","defaultValue","unique","isXMLDoc","rneedsContext","rsingleTag","risSimple","winnow","qualifier","self","is","rootjQuery","parseHTML","ready","rparentsprev","guaranteedUnique","children","contents","next","prev","until","truncate","sibling","n","targets","l","closest","pos","index","prevAll","add","addBack","parents","parentsUntil","nextAll","nextUntil","prevUntil","siblings","contentDocument","reverse","rnotwhite","optionsCache","createOptions","object","flag","Callbacks","memory","fired","firing","firingStart","firingLength","firingIndex","stack","once","fire","data","stopOnFalse","disable","remove","lock","locked","fireWith","Deferred","func","tuples","state","promise","always","deferred","fail","then","fns","newDefer","tuple","returned","resolve","reject","progress","notify","pipe","stateString","when","subordinate","resolveValues","remaining","updateFunc","values","progressValues","notifyWith","resolveWith","progressContexts","resolveContexts","readyList","readyWait","holdReady","hold","wait","triggerHandler","off","completed","removeEventListener","readyState","setTimeout","access","chainable","emptyGet","raw","bulk","acceptData","owner","Data","defineProperty","uid","accepts","descriptor","unlock","defineProperties","set","prop","stored","camel","hasData","discard","data_priv","data_user","rbrace","rmultiDash","dataAttr","parseJSON","removeData","_data","_removeData","camelKey","queue","dequeue","startLength","hooks","_queueHooks","stop","setter","clearQueue","count","defer","pnum","source","cssExpand","isHidden","el","css","rcheckableType","fragment","createDocumentFragment","checkClone","cloneNode","noCloneChecked","strundefined","focusinBubbles","rkeyEvent","rmouseEvent","rfocusMorph","rtypenamespace","returnTrue","returnFalse","safeActiveElement","err","event","types","handleObjIn","eventHandle","events","t","handleObj","special","handlers","namespaces","origType","elemData","handle","triggered","dispatch","delegateType","bindType","namespace","delegateCount","setup","mappedTypes","origCount","teardown","removeEvent","trigger","onlyHandlers","bubbleType","ontype","eventPath","Event","isTrigger","namespace_re","noBubble","parentWindow","isPropagationStopped","preventDefault","isDefaultPrevented","_default","fix","handlerQueue","delegateTarget","preDispatch","currentTarget","isImmediatePropagationStopped","stopPropagation","postDispatch","sel","props","fixHooks","keyHooks","original","which","charCode","keyCode","mouseHooks","eventDoc","body","pageX","clientX","scrollLeft","clientLeft","pageY","clientY","scrollTop","clientTop","originalEvent","fixHook","load","blur","click","beforeunload","returnValue","simulate","bubble","isSimulated","defaultPrevented","timeStamp","stopImmediatePropagation","mouseenter","mouseleave","pointerenter","pointerleave","orig","related","relatedTarget","attaches","on","one","origFn","rxhtmlTag","rtagName","rhtml","rnoInnerhtml","rchecked","rscriptType","rscriptTypeMasked","rcleanScript","wrapMap","option","thead","col","tr","td","optgroup","tbody","tfoot","colgroup","caption","th","manipulationTarget","content","disableScript","restoreScript","setGlobalEval","refElements","cloneCopyEvent","dest","pdataOld","pdataCur","udataOld","udataCur","getAll","fixInput","dataAndEvents","deepDataAndEvents","srcElements","destElements","inPage","buildFragment","scripts","selection","wrap","nodes","createTextNode","cleanData","append","domManip","prepend","insertBefore","before","after","keepData","html","replaceWith","replaceChild","detach","hasScripts","iNoClone","_evalUrl","appendTo","prependTo","insertAfter","replaceAll","insert","iframe","elemdisplay","actualDisplay","style","display","getDefaultComputedStyle","defaultDisplay","write","close","rmargin","rnumnonpx","getStyles","opener","getComputedStyle","curCSS","computed","width","minWidth","maxWidth","getPropertyValue","addGetHookIf","conditionFn","hookFn","pixelPositionVal","boxSizingReliableVal","container","backgroundClip","clearCloneStyle","cssText","computePixelPositionAndBoxSizingReliable","divStyle","pixelPosition","boxSizingReliable","reliableMarginRight","marginDiv","marginRight","swap","rdisplayswap","rnumsplit","rrelNum","cssShow","position","visibility","cssNormalTransform","letterSpacing","fontWeight","cssPrefixes","vendorPropName","capName","origName","setPositiveNumber","subtract","max","augmentWidthOrHeight","extra","isBorderBox","styles","getWidthOrHeight","valueIsBorderBox","offsetWidth","offsetHeight","showHide","show","hidden","cssHooks","opacity","cssNumber","columnCount","fillOpacity","flexGrow","flexShrink","lineHeight","order","orphans","widows","zIndex","zoom","cssProps","float","margin","padding","border","prefix","suffix","expand","expanded","parts","hide","toggle","Tween","easing","unit","propHooks","run","percent","eased","duration","step","tween","fx","linear","p","swing","cos","PI","fxNow","timerId","rfxtypes","rfxnum","rrun","animationPrefilters","defaultPrefilter","tweeners","*","createTween","scale","maxIterations","createFxNow","genFx","includeWidth","height","animation","collection","opts","oldfire","checkDisplay","anim","dataShow","unqueued","overflow","overflowX","overflowY","propFilter","specialEasing","Animation","properties","stopped","tick","currentTime","startTime","tweens","originalProperties","originalOptions","gotoEnd","rejectWith","timer","complete","tweener","prefilter","speed","opt","speeds","fadeTo","to","animate","optall","doAnimation","finish","stopQueue","timers","cssFn","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","interval","setInterval","clearInterval","slow","fast","delay","time","timeout","clearTimeout","checkOn","optSelected","optDisabled","radioValue","nodeHook","boolHook","removeAttr","nType","attrHooks","propName","attrNames","propFix","getter","rfocusable","removeProp","for","class","notxml","hasAttribute","rclass","addClass","classes","clazz","finalValue","proceed","removeClass","toggleClass","stateVal","classNames","hasClass","rreturn","valHooks","optionSet","hover","fnOver","fnOut","bind","unbind","delegate","undelegate","nonce","rquery","JSON","parse","parseXML","DOMParser","parseFromString","rhash","rts","rheaders","rlocalProtocol","rnoContent","rprotocol","rurl","prefilters","transports","allTypes","ajaxLocation","ajaxLocParts","addToPrefiltersOrTransports","structure","dataTypeExpression","dataType","dataTypes","inspectPrefiltersOrTransports","jqXHR","inspected","seekingTransport","inspect","prefilterOrFactory","dataTypeOrTransport","ajaxExtend","flatOptions","ajaxSettings","ajaxHandleResponses","s","responses","ct","finalDataType","firstDataType","mimeType","getResponseHeader","converters","ajaxConvert","response","isSuccess","conv2","current","conv","responseFields","dataFilter","active","lastModified","etag","url","isLocal","processData","async","contentType","json","* text","text html","text json","text xml","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","ajax","transport","cacheURL","responseHeadersString","responseHeaders","timeoutTimer","fireGlobals","callbackContext","globalEventContext","completeDeferred","statusCode","requestHeaders","requestHeadersNames","strAbort","getAllResponseHeaders","setRequestHeader","lname","overrideMimeType","status","abort","statusText","finalText","success","method","crossDomain","param","traditional","hasContent","ifModified","headers","beforeSend","send","nativeStatusText","modified","getJSON","getScript","throws","wrapAll","firstElementChild","wrapInner","unwrap","visible","r20","rbracket","rCRLF","rsubmitterTypes","rsubmittable","buildParams","v","encodeURIComponent","serialize","serializeArray","xhr","XMLHttpRequest","xhrId","xhrCallbacks","xhrSuccessStatus",1223,"xhrSupported","cors","open","username","xhrFields","onload","onerror","responseText","text script","charset","scriptCharset","evt","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","keepScripts","parsed","_load","params","animated","getWindow","offset","setOffset","curPosition","curLeft","curCSSTop","curTop","curOffset","curCSSLeft","calculatePosition","curElem","left","using","win","box","getBoundingClientRect","pageYOffset","pageXOffset","offsetParent","parentOffset","scrollTo","Height","Width","defaultExtra","funcName","size","andSelf","define","amd","_jQuery","_$","$","noConflict"],"mappings":"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"}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax.js
deleted file mode 100644
index 5c7b4ad..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax.js
+++ /dev/null
@@ -1,786 +0,0 @@
-define([
-	"./core",
-	"./var/rnotwhite",
-	"./ajax/var/nonce",
-	"./ajax/var/rquery",
-	"./core/init",
-	"./ajax/parseJSON",
-	"./ajax/parseXML",
-	"./deferred"
-], function( jQuery, rnotwhite, nonce, rquery ) {
-
-var
-	rhash = /#.*$/,
-	rts = /([?&])_=[^&]*/,
-	rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
-	// #7653, #8125, #8152: local protocol detection
-	rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
-	rnoContent = /^(?:GET|HEAD)$/,
-	rprotocol = /^\/\//,
-	rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
-
-	/* Prefilters
-	 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
-	 * 2) These are called:
-	 *    - BEFORE asking for a transport
-	 *    - AFTER param serialization (s.data is a string if s.processData is true)
-	 * 3) key is the dataType
-	 * 4) the catchall symbol "*" can be used
-	 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
-	 */
-	prefilters = {},
-
-	/* Transports bindings
-	 * 1) key is the dataType
-	 * 2) the catchall symbol "*" can be used
-	 * 3) selection will start with transport dataType and THEN go to "*" if needed
-	 */
-	transports = {},
-
-	// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
-	allTypes = "*/".concat( "*" ),
-
-	// Document location
-	ajaxLocation = window.location.href,
-
-	// Segment location into parts
-	ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
-
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
-
-	// dataTypeExpression is optional and defaults to "*"
-	return function( dataTypeExpression, func ) {
-
-		if ( typeof dataTypeExpression !== "string" ) {
-			func = dataTypeExpression;
-			dataTypeExpression = "*";
-		}
-
-		var dataType,
-			i = 0,
-			dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
-
-		if ( jQuery.isFunction( func ) ) {
-			// For each dataType in the dataTypeExpression
-			while ( (dataType = dataTypes[i++]) ) {
-				// Prepend if requested
-				if ( dataType[0] === "+" ) {
-					dataType = dataType.slice( 1 ) || "*";
-					(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
-
-				// Otherwise append
-				} else {
-					(structure[ dataType ] = structure[ dataType ] || []).push( func );
-				}
-			}
-		}
-	};
-}
-
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
-
-	var inspected = {},
-		seekingTransport = ( structure === transports );
-
-	function inspect( dataType ) {
-		var selected;
-		inspected[ dataType ] = true;
-		jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
-			var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
-			if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
-				options.dataTypes.unshift( dataTypeOrTransport );
-				inspect( dataTypeOrTransport );
-				return false;
-			} else if ( seekingTransport ) {
-				return !( selected = dataTypeOrTransport );
-			}
-		});
-		return selected;
-	}
-
-	return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
-}
-
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
-	var key, deep,
-		flatOptions = jQuery.ajaxSettings.flatOptions || {};
-
-	for ( key in src ) {
-		if ( src[ key ] !== undefined ) {
-			( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
-		}
-	}
-	if ( deep ) {
-		jQuery.extend( true, target, deep );
-	}
-
-	return target;
-}
-
-/* Handles responses to an ajax request:
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
-
-	var ct, type, finalDataType, firstDataType,
-		contents = s.contents,
-		dataTypes = s.dataTypes;
-
-	// Remove auto dataType and get content-type in the process
-	while ( dataTypes[ 0 ] === "*" ) {
-		dataTypes.shift();
-		if ( ct === undefined ) {
-			ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
-		}
-	}
-
-	// Check if we're dealing with a known content-type
-	if ( ct ) {
-		for ( type in contents ) {
-			if ( contents[ type ] && contents[ type ].test( ct ) ) {
-				dataTypes.unshift( type );
-				break;
-			}
-		}
-	}
-
-	// Check to see if we have a response for the expected dataType
-	if ( dataTypes[ 0 ] in responses ) {
-		finalDataType = dataTypes[ 0 ];
-	} else {
-		// Try convertible dataTypes
-		for ( type in responses ) {
-			if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
-				finalDataType = type;
-				break;
-			}
-			if ( !firstDataType ) {
-				firstDataType = type;
-			}
-		}
-		// Or just use first one
-		finalDataType = finalDataType || firstDataType;
-	}
-
-	// If we found a dataType
-	// We add the dataType to the list if needed
-	// and return the corresponding response
-	if ( finalDataType ) {
-		if ( finalDataType !== dataTypes[ 0 ] ) {
-			dataTypes.unshift( finalDataType );
-		}
-		return responses[ finalDataType ];
-	}
-}
-
-/* Chain conversions given the request and the original response
- * Also sets the responseXXX fields on the jqXHR instance
- */
-function ajaxConvert( s, response, jqXHR, isSuccess ) {
-	var conv2, current, conv, tmp, prev,
-		converters = {},
-		// Work with a copy of dataTypes in case we need to modify it for conversion
-		dataTypes = s.dataTypes.slice();
-
-	// Create converters map with lowercased keys
-	if ( dataTypes[ 1 ] ) {
-		for ( conv in s.converters ) {
-			converters[ conv.toLowerCase() ] = s.converters[ conv ];
-		}
-	}
-
-	current = dataTypes.shift();
-
-	// Convert to each sequential dataType
-	while ( current ) {
-
-		if ( s.responseFields[ current ] ) {
-			jqXHR[ s.responseFields[ current ] ] = response;
-		}
-
-		// Apply the dataFilter if provided
-		if ( !prev && isSuccess && s.dataFilter ) {
-			response = s.dataFilter( response, s.dataType );
-		}
-
-		prev = current;
-		current = dataTypes.shift();
-
-		if ( current ) {
-
-		// There's only work to do if current dataType is non-auto
-			if ( current === "*" ) {
-
-				current = prev;
-
-			// Convert response if prev dataType is non-auto and differs from current
-			} else if ( prev !== "*" && prev !== current ) {
-
-				// Seek a direct converter
-				conv = converters[ prev + " " + current ] || converters[ "* " + current ];
-
-				// If none found, seek a pair
-				if ( !conv ) {
-					for ( conv2 in converters ) {
-
-						// If conv2 outputs current
-						tmp = conv2.split( " " );
-						if ( tmp[ 1 ] === current ) {
-
-							// If prev can be converted to accepted input
-							conv = converters[ prev + " " + tmp[ 0 ] ] ||
-								converters[ "* " + tmp[ 0 ] ];
-							if ( conv ) {
-								// Condense equivalence converters
-								if ( conv === true ) {
-									conv = converters[ conv2 ];
-
-								// Otherwise, insert the intermediate dataType
-								} else if ( converters[ conv2 ] !== true ) {
-									current = tmp[ 0 ];
-									dataTypes.unshift( tmp[ 1 ] );
-								}
-								break;
-							}
-						}
-					}
-				}
-
-				// Apply converter (if not an equivalence)
-				if ( conv !== true ) {
-
-					// Unless errors are allowed to bubble, catch and return them
-					if ( conv && s[ "throws" ] ) {
-						response = conv( response );
-					} else {
-						try {
-							response = conv( response );
-						} catch ( e ) {
-							return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
-						}
-					}
-				}
-			}
-		}
-	}
-
-	return { state: "success", data: response };
-}
-
-jQuery.extend({
-
-	// Counter for holding the number of active queries
-	active: 0,
-
-	// Last-Modified header cache for next request
-	lastModified: {},
-	etag: {},
-
-	ajaxSettings: {
-		url: ajaxLocation,
-		type: "GET",
-		isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
-		global: true,
-		processData: true,
-		async: true,
-		contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-		/*
-		timeout: 0,
-		data: null,
-		dataType: null,
-		username: null,
-		password: null,
-		cache: null,
-		throws: false,
-		traditional: false,
-		headers: {},
-		*/
-
-		accepts: {
-			"*": allTypes,
-			text: "text/plain",
-			html: "text/html",
-			xml: "application/xml, text/xml",
-			json: "application/json, text/javascript"
-		},
-
-		contents: {
-			xml: /xml/,
-			html: /html/,
-			json: /json/
-		},
-
-		responseFields: {
-			xml: "responseXML",
-			text: "responseText",
-			json: "responseJSON"
-		},
-
-		// Data converters
-		// Keys separate source (or catchall "*") and destination types with a single space
-		converters: {
-
-			// Convert anything to text
-			"* text": String,
-
-			// Text to html (true = no transformation)
-			"text html": true,
-
-			// Evaluate text as a json expression
-			"text json": jQuery.parseJSON,
-
-			// Parse text as xml
-			"text xml": jQuery.parseXML
-		},
-
-		// For options that shouldn't be deep extended:
-		// you can add your own custom options here if
-		// and when you create one that shouldn't be
-		// deep extended (see ajaxExtend)
-		flatOptions: {
-			url: true,
-			context: true
-		}
-	},
-
-	// Creates a full fledged settings object into target
-	// with both ajaxSettings and settings fields.
-	// If target is omitted, writes into ajaxSettings.
-	ajaxSetup: function( target, settings ) {
-		return settings ?
-
-			// Building a settings object
-			ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
-
-			// Extending ajaxSettings
-			ajaxExtend( jQuery.ajaxSettings, target );
-	},
-
-	ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
-	ajaxTransport: addToPrefiltersOrTransports( transports ),
-
-	// Main method
-	ajax: function( url, options ) {
-
-		// If url is an object, simulate pre-1.5 signature
-		if ( typeof url === "object" ) {
-			options = url;
-			url = undefined;
-		}
-
-		// Force options to be an object
-		options = options || {};
-
-		var transport,
-			// URL without anti-cache param
-			cacheURL,
-			// Response headers
-			responseHeadersString,
-			responseHeaders,
-			// timeout handle
-			timeoutTimer,
-			// Cross-domain detection vars
-			parts,
-			// To know if global events are to be dispatched
-			fireGlobals,
-			// Loop variable
-			i,
-			// Create the final options object
-			s = jQuery.ajaxSetup( {}, options ),
-			// Callbacks context
-			callbackContext = s.context || s,
-			// Context for global events is callbackContext if it is a DOM node or jQuery collection
-			globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
-				jQuery( callbackContext ) :
-				jQuery.event,
-			// Deferreds
-			deferred = jQuery.Deferred(),
-			completeDeferred = jQuery.Callbacks("once memory"),
-			// Status-dependent callbacks
-			statusCode = s.statusCode || {},
-			// Headers (they are sent all at once)
-			requestHeaders = {},
-			requestHeadersNames = {},
-			// The jqXHR state
-			state = 0,
-			// Default abort message
-			strAbort = "canceled",
-			// Fake xhr
-			jqXHR = {
-				readyState: 0,
-
-				// Builds headers hashtable if needed
-				getResponseHeader: function( key ) {
-					var match;
-					if ( state === 2 ) {
-						if ( !responseHeaders ) {
-							responseHeaders = {};
-							while ( (match = rheaders.exec( responseHeadersString )) ) {
-								responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
-							}
-						}
-						match = responseHeaders[ key.toLowerCase() ];
-					}
-					return match == null ? null : match;
-				},
-
-				// Raw string
-				getAllResponseHeaders: function() {
-					return state === 2 ? responseHeadersString : null;
-				},
-
-				// Caches the header
-				setRequestHeader: function( name, value ) {
-					var lname = name.toLowerCase();
-					if ( !state ) {
-						name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
-						requestHeaders[ name ] = value;
-					}
-					return this;
-				},
-
-				// Overrides response content-type header
-				overrideMimeType: function( type ) {
-					if ( !state ) {
-						s.mimeType = type;
-					}
-					return this;
-				},
-
-				// Status-dependent callbacks
-				statusCode: function( map ) {
-					var code;
-					if ( map ) {
-						if ( state < 2 ) {
-							for ( code in map ) {
-								// Lazy-add the new callback in a way that preserves old ones
-								statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
-							}
-						} else {
-							// Execute the appropriate callbacks
-							jqXHR.always( map[ jqXHR.status ] );
-						}
-					}
-					return this;
-				},
-
-				// Cancel the request
-				abort: function( statusText ) {
-					var finalText = statusText || strAbort;
-					if ( transport ) {
-						transport.abort( finalText );
-					}
-					done( 0, finalText );
-					return this;
-				}
-			};
-
-		// Attach deferreds
-		deferred.promise( jqXHR ).complete = completeDeferred.add;
-		jqXHR.success = jqXHR.done;
-		jqXHR.error = jqXHR.fail;
-
-		// Remove hash character (#7531: and string promotion)
-		// Add protocol if not provided (prefilters might expect it)
-		// Handle falsy url in the settings object (#10093: consistency with old signature)
-		// We also use the url parameter if available
-		s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
-			.replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
-		// Alias method option to type as per ticket #12004
-		s.type = options.method || options.type || s.method || s.type;
-
-		// Extract dataTypes list
-		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
-
-		// A cross-domain request is in order when we have a protocol:host:port mismatch
-		if ( s.crossDomain == null ) {
-			parts = rurl.exec( s.url.toLowerCase() );
-			s.crossDomain = !!( parts &&
-				( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
-					( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
-						( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
-			);
-		}
-
-		// Convert data if not already a string
-		if ( s.data && s.processData && typeof s.data !== "string" ) {
-			s.data = jQuery.param( s.data, s.traditional );
-		}
-
-		// Apply prefilters
-		inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
-		// If request was aborted inside a prefilter, stop there
-		if ( state === 2 ) {
-			return jqXHR;
-		}
-
-		// We can fire global events as of now if asked to
-		// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
-		fireGlobals = jQuery.event && s.global;
-
-		// Watch for a new set of requests
-		if ( fireGlobals && jQuery.active++ === 0 ) {
-			jQuery.event.trigger("ajaxStart");
-		}
-
-		// Uppercase the type
-		s.type = s.type.toUpperCase();
-
-		// Determine if request has content
-		s.hasContent = !rnoContent.test( s.type );
-
-		// Save the URL in case we're toying with the If-Modified-Since
-		// and/or If-None-Match header later on
-		cacheURL = s.url;
-
-		// More options handling for requests with no content
-		if ( !s.hasContent ) {
-
-			// If data is available, append data to url
-			if ( s.data ) {
-				cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
-				// #9682: remove data so that it's not used in an eventual retry
-				delete s.data;
-			}
-
-			// Add anti-cache in url if needed
-			if ( s.cache === false ) {
-				s.url = rts.test( cacheURL ) ?
-
-					// If there is already a '_' parameter, set its value
-					cacheURL.replace( rts, "$1_=" + nonce++ ) :
-
-					// Otherwise add one to the end
-					cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
-			}
-		}
-
-		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-		if ( s.ifModified ) {
-			if ( jQuery.lastModified[ cacheURL ] ) {
-				jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
-			}
-			if ( jQuery.etag[ cacheURL ] ) {
-				jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
-			}
-		}
-
-		// Set the correct header, if data is being sent
-		if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
-			jqXHR.setRequestHeader( "Content-Type", s.contentType );
-		}
-
-		// Set the Accepts header for the server, depending on the dataType
-		jqXHR.setRequestHeader(
-			"Accept",
-			s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
-				s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
-				s.accepts[ "*" ]
-		);
-
-		// Check for headers option
-		for ( i in s.headers ) {
-			jqXHR.setRequestHeader( i, s.headers[ i ] );
-		}
-
-		// Allow custom headers/mimetypes and early abort
-		if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
-			// Abort if not done already and return
-			return jqXHR.abort();
-		}
-
-		// Aborting is no longer a cancellation
-		strAbort = "abort";
-
-		// Install callbacks on deferreds
-		for ( i in { success: 1, error: 1, complete: 1 } ) {
-			jqXHR[ i ]( s[ i ] );
-		}
-
-		// Get transport
-		transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
-		// If no transport, we auto-abort
-		if ( !transport ) {
-			done( -1, "No Transport" );
-		} else {
-			jqXHR.readyState = 1;
-
-			// Send global event
-			if ( fireGlobals ) {
-				globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
-			}
-			// Timeout
-			if ( s.async && s.timeout > 0 ) {
-				timeoutTimer = setTimeout(function() {
-					jqXHR.abort("timeout");
-				}, s.timeout );
-			}
-
-			try {
-				state = 1;
-				transport.send( requestHeaders, done );
-			} catch ( e ) {
-				// Propagate exception as error if not done
-				if ( state < 2 ) {
-					done( -1, e );
-				// Simply rethrow otherwise
-				} else {
-					throw e;
-				}
-			}
-		}
-
-		// Callback for when everything is done
-		function done( status, nativeStatusText, responses, headers ) {
-			var isSuccess, success, error, response, modified,
-				statusText = nativeStatusText;
-
-			// Called once
-			if ( state === 2 ) {
-				return;
-			}
-
-			// State is "done" now
-			state = 2;
-
-			// Clear timeout if it exists
-			if ( timeoutTimer ) {
-				clearTimeout( timeoutTimer );
-			}
-
-			// Dereference transport for early garbage collection
-			// (no matter how long the jqXHR object will be used)
-			transport = undefined;
-
-			// Cache response headers
-			responseHeadersString = headers || "";
-
-			// Set readyState
-			jqXHR.readyState = status > 0 ? 4 : 0;
-
-			// Determine if successful
-			isSuccess = status >= 200 && status < 300 || status === 304;
-
-			// Get response data
-			if ( responses ) {
-				response = ajaxHandleResponses( s, jqXHR, responses );
-			}
-
-			// Convert no matter what (that way responseXXX fields are always set)
-			response = ajaxConvert( s, response, jqXHR, isSuccess );
-
-			// If successful, handle type chaining
-			if ( isSuccess ) {
-
-				// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-				if ( s.ifModified ) {
-					modified = jqXHR.getResponseHeader("Last-Modified");
-					if ( modified ) {
-						jQuery.lastModified[ cacheURL ] = modified;
-					}
-					modified = jqXHR.getResponseHeader("etag");
-					if ( modified ) {
-						jQuery.etag[ cacheURL ] = modified;
-					}
-				}
-
-				// if no content
-				if ( status === 204 || s.type === "HEAD" ) {
-					statusText = "nocontent";
-
-				// if not modified
-				} else if ( status === 304 ) {
-					statusText = "notmodified";
-
-				// If we have data, let's convert it
-				} else {
-					statusText = response.state;
-					success = response.data;
-					error = response.error;
-					isSuccess = !error;
-				}
-			} else {
-				// Extract error from statusText and normalize for non-aborts
-				error = statusText;
-				if ( status || !statusText ) {
-					statusText = "error";
-					if ( status < 0 ) {
-						status = 0;
-					}
-				}
-			}
-
-			// Set data for the fake xhr object
-			jqXHR.status = status;
-			jqXHR.statusText = ( nativeStatusText || statusText ) + "";
-
-			// Success/Error
-			if ( isSuccess ) {
-				deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
-			} else {
-				deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
-			}
-
-			// Status-dependent callbacks
-			jqXHR.statusCode( statusCode );
-			statusCode = undefined;
-
-			if ( fireGlobals ) {
-				globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
-					[ jqXHR, s, isSuccess ? success : error ] );
-			}
-
-			// Complete
-			completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
-			if ( fireGlobals ) {
-				globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
-				// Handle the global AJAX counter
-				if ( !( --jQuery.active ) ) {
-					jQuery.event.trigger("ajaxStop");
-				}
-			}
-		}
-
-		return jqXHR;
-	},
-
-	getJSON: function( url, data, callback ) {
-		return jQuery.get( url, data, callback, "json" );
-	},
-
-	getScript: function( url, callback ) {
-		return jQuery.get( url, undefined, callback, "script" );
-	}
-});
-
-jQuery.each( [ "get", "post" ], function( i, method ) {
-	jQuery[ method ] = function( url, data, callback, type ) {
-		// Shift arguments if data argument was omitted
-		if ( jQuery.isFunction( data ) ) {
-			type = type || callback;
-			callback = data;
-			data = undefined;
-		}
-
-		return jQuery.ajax({
-			url: url,
-			type: method,
-			dataType: type,
-			data: data,
-			success: callback
-		});
-	};
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/jsonp.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/jsonp.js
deleted file mode 100644
index ff0d538..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/jsonp.js
+++ /dev/null
@@ -1,89 +0,0 @@
-define([
-	"../core",
-	"./var/nonce",
-	"./var/rquery",
-	"../ajax"
-], function( jQuery, nonce, rquery ) {
-
-var oldCallbacks = [],
-	rjsonp = /(=)\?(?=&|$)|\?\?/;
-
-// Default jsonp settings
-jQuery.ajaxSetup({
-	jsonp: "callback",
-	jsonpCallback: function() {
-		var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
-		this[ callback ] = true;
-		return callback;
-	}
-});
-
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
-	var callbackName, overwritten, responseContainer,
-		jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
-			"url" :
-			typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
-		);
-
-	// Handle iff the expected data type is "jsonp" or we have a parameter to set
-	if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
-
-		// Get callback name, remembering preexisting value associated with it
-		callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
-			s.jsonpCallback() :
-			s.jsonpCallback;
-
-		// Insert callback into url or form data
-		if ( jsonProp ) {
-			s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
-		} else if ( s.jsonp !== false ) {
-			s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
-		}
-
-		// Use data converter to retrieve json after script execution
-		s.converters["script json"] = function() {
-			if ( !responseContainer ) {
-				jQuery.error( callbackName + " was not called" );
-			}
-			return responseContainer[ 0 ];
-		};
-
-		// force json dataType
-		s.dataTypes[ 0 ] = "json";
-
-		// Install callback
-		overwritten = window[ callbackName ];
-		window[ callbackName ] = function() {
-			responseContainer = arguments;
-		};
-
-		// Clean-up function (fires after converters)
-		jqXHR.always(function() {
-			// Restore preexisting value
-			window[ callbackName ] = overwritten;
-
-			// Save back as free
-			if ( s[ callbackName ] ) {
-				// make sure that re-using the options doesn't screw things around
-				s.jsonpCallback = originalSettings.jsonpCallback;
-
-				// save the callback name for future use
-				oldCallbacks.push( callbackName );
-			}
-
-			// Call if it was a function and we have a response
-			if ( responseContainer && jQuery.isFunction( overwritten ) ) {
-				overwritten( responseContainer[ 0 ] );
-			}
-
-			responseContainer = overwritten = undefined;
-		});
-
-		// Delegate to script
-		return "script";
-	}
-});
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/load.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/load.js
deleted file mode 100644
index bff25b1..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/load.js
+++ /dev/null
@@ -1,75 +0,0 @@
-define([
-	"../core",
-	"../core/parseHTML",
-	"../ajax",
-	"../traversing",
-	"../manipulation",
-	"../selector",
-	// Optional event/alias dependency
-	"../event/alias"
-], function( jQuery ) {
-
-// Keep a copy of the old load method
-var _load = jQuery.fn.load;
-
-/**
- * Load a url into a page
- */
-jQuery.fn.load = function( url, params, callback ) {
-	if ( typeof url !== "string" && _load ) {
-		return _load.apply( this, arguments );
-	}
-
-	var selector, type, response,
-		self = this,
-		off = url.indexOf(" ");
-
-	if ( off >= 0 ) {
-		selector = jQuery.trim( url.slice( off ) );
-		url = url.slice( 0, off );
-	}
-
-	// If it's a function
-	if ( jQuery.isFunction( params ) ) {
-
-		// We assume that it's the callback
-		callback = params;
-		params = undefined;
-
-	// Otherwise, build a param string
-	} else if ( params && typeof params === "object" ) {
-		type = "POST";
-	}
-
-	// If we have elements to modify, make the request
-	if ( self.length > 0 ) {
-		jQuery.ajax({
-			url: url,
-
-			// if "type" variable is undefined, then "GET" method will be used
-			type: type,
-			dataType: "html",
-			data: params
-		}).done(function( responseText ) {
-
-			// Save response for use in complete callback
-			response = arguments;
-
-			self.html( selector ?
-
-				// If a selector was specified, locate the right elements in a dummy div
-				// Exclude scripts to avoid IE 'Permission Denied' errors
-				jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
-
-				// Otherwise use the full result
-				responseText );
-
-		}).complete( callback && function( jqXHR, status ) {
-			self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
-		});
-	}
-
-	return this;
-};
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/parseJSON.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/parseJSON.js
deleted file mode 100644
index 3a96d15..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/parseJSON.js
+++ /dev/null
@@ -1,13 +0,0 @@
-define([
-	"../core"
-], function( jQuery ) {
-
-// Support: Android 2.3
-// Workaround failure to string-cast null input
-jQuery.parseJSON = function( data ) {
-	return JSON.parse( data + "" );
-};
-
-return jQuery.parseJSON;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/parseXML.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/parseXML.js
deleted file mode 100644
index 9eeb625..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/parseXML.js
+++ /dev/null
@@ -1,28 +0,0 @@
-define([
-	"../core"
-], function( jQuery ) {
-
-// Cross-browser xml parsing
-jQuery.parseXML = function( data ) {
-	var xml, tmp;
-	if ( !data || typeof data !== "string" ) {
-		return null;
-	}
-
-	// Support: IE9
-	try {
-		tmp = new DOMParser();
-		xml = tmp.parseFromString( data, "text/xml" );
-	} catch ( e ) {
-		xml = undefined;
-	}
-
-	if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
-		jQuery.error( "Invalid XML: " + data );
-	}
-	return xml;
-};
-
-return jQuery.parseXML;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/script.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/script.js
deleted file mode 100644
index f44329d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/script.js
+++ /dev/null
@@ -1,64 +0,0 @@
-define([
-	"../core",
-	"../ajax"
-], function( jQuery ) {
-
-// Install script dataType
-jQuery.ajaxSetup({
-	accepts: {
-		script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
-	},
-	contents: {
-		script: /(?:java|ecma)script/
-	},
-	converters: {
-		"text script": function( text ) {
-			jQuery.globalEval( text );
-			return text;
-		}
-	}
-});
-
-// Handle cache's special case and crossDomain
-jQuery.ajaxPrefilter( "script", function( s ) {
-	if ( s.cache === undefined ) {
-		s.cache = false;
-	}
-	if ( s.crossDomain ) {
-		s.type = "GET";
-	}
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function( s ) {
-	// This transport only deals with cross domain requests
-	if ( s.crossDomain ) {
-		var script, callback;
-		return {
-			send: function( _, complete ) {
-				script = jQuery("<script>").prop({
-					async: true,
-					charset: s.scriptCharset,
-					src: s.url
-				}).on(
-					"load error",
-					callback = function( evt ) {
-						script.remove();
-						callback = null;
-						if ( evt ) {
-							complete( evt.type === "error" ? 404 : 200, evt.type );
-						}
-					}
-				);
-				document.head.appendChild( script[ 0 ] );
-			},
-			abort: function() {
-				if ( callback ) {
-					callback();
-				}
-			}
-		};
-	}
-});
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/var/nonce.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/var/nonce.js
deleted file mode 100644
index 0871aae..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/var/nonce.js
+++ /dev/null
@@ -1,5 +0,0 @@
-define([
-	"../../core"
-], function( jQuery ) {
-	return jQuery.now();
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/var/rquery.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/var/rquery.js
deleted file mode 100644
index 500a77a..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/var/rquery.js
+++ /dev/null
@@ -1,3 +0,0 @@
-define(function() {
-	return (/\?/);
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/xhr.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/xhr.js
deleted file mode 100644
index c2b43c9..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/ajax/xhr.js
+++ /dev/null
@@ -1,136 +0,0 @@
-define([
-	"../core",
-	"../var/support",
-	"../ajax"
-], function( jQuery, support ) {
-
-jQuery.ajaxSettings.xhr = function() {
-	try {
-		return new XMLHttpRequest();
-	} catch( e ) {}
-};
-
-var xhrId = 0,
-	xhrCallbacks = {},
-	xhrSuccessStatus = {
-		// file protocol always yields status code 0, assume 200
-		0: 200,
-		// Support: IE9
-		// #1450: sometimes IE returns 1223 when it should be 204
-		1223: 204
-	},
-	xhrSupported = jQuery.ajaxSettings.xhr();
-
-// Support: IE9
-// Open requests must be manually aborted on unload (#5280)
-// See https://support.microsoft.com/kb/2856746 for more info
-if ( window.attachEvent ) {
-	window.attachEvent( "onunload", function() {
-		for ( var key in xhrCallbacks ) {
-			xhrCallbacks[ key ]();
-		}
-	});
-}
-
-support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
-support.ajax = xhrSupported = !!xhrSupported;
-
-jQuery.ajaxTransport(function( options ) {
-	var callback;
-
-	// Cross domain only allowed if supported through XMLHttpRequest
-	if ( support.cors || xhrSupported && !options.crossDomain ) {
-		return {
-			send: function( headers, complete ) {
-				var i,
-					xhr = options.xhr(),
-					id = ++xhrId;
-
-				xhr.open( options.type, options.url, options.async, options.username, options.password );
-
-				// Apply custom fields if provided
-				if ( options.xhrFields ) {
-					for ( i in options.xhrFields ) {
-						xhr[ i ] = options.xhrFields[ i ];
-					}
-				}
-
-				// Override mime type if needed
-				if ( options.mimeType && xhr.overrideMimeType ) {
-					xhr.overrideMimeType( options.mimeType );
-				}
-
-				// X-Requested-With header
-				// For cross-domain requests, seeing as conditions for a preflight are
-				// akin to a jigsaw puzzle, we simply never set it to be sure.
-				// (it can always be set on a per-request basis or even using ajaxSetup)
-				// For same-domain requests, won't change header if already provided.
-				if ( !options.crossDomain && !headers["X-Requested-With"] ) {
-					headers["X-Requested-With"] = "XMLHttpRequest";
-				}
-
-				// Set headers
-				for ( i in headers ) {
-					xhr.setRequestHeader( i, headers[ i ] );
-				}
-
-				// Callback
-				callback = function( type ) {
-					return function() {
-						if ( callback ) {
-							delete xhrCallbacks[ id ];
-							callback = xhr.onload = xhr.onerror = null;
-
-							if ( type === "abort" ) {
-								xhr.abort();
-							} else if ( type === "error" ) {
-								complete(
-									// file: protocol always yields status 0; see #8605, #14207
-									xhr.status,
-									xhr.statusText
-								);
-							} else {
-								complete(
-									xhrSuccessStatus[ xhr.status ] || xhr.status,
-									xhr.statusText,
-									// Support: IE9
-									// Accessing binary-data responseText throws an exception
-									// (#11426)
-									typeof xhr.responseText === "string" ? {
-										text: xhr.responseText
-									} : undefined,
-									xhr.getAllResponseHeaders()
-								);
-							}
-						}
-					};
-				};
-
-				// Listen to events
-				xhr.onload = callback();
-				xhr.onerror = callback("error");
-
-				// Create the abort callback
-				callback = xhrCallbacks[ id ] = callback("abort");
-
-				try {
-					// Do send the request (this may raise an exception)
-					xhr.send( options.hasContent && options.data || null );
-				} catch ( e ) {
-					// #14683: Only rethrow if this hasn't been notified as an error yet
-					if ( callback ) {
-						throw e;
-					}
-				}
-			},
-
-			abort: function() {
-				if ( callback ) {
-					callback();
-				}
-			}
-		};
-	}
-});
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes.js
deleted file mode 100644
index fa2ef1e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes.js
+++ /dev/null
@@ -1,11 +0,0 @@
-define([
-	"./core",
-	"./attributes/attr",
-	"./attributes/prop",
-	"./attributes/classes",
-	"./attributes/val"
-], function( jQuery ) {
-
-// Return jQuery for attributes-only inclusion
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/attr.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/attr.js
deleted file mode 100644
index a4414d1..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/attr.js
+++ /dev/null
@@ -1,141 +0,0 @@
-define([
-	"../core",
-	"../var/rnotwhite",
-	"../var/strundefined",
-	"../core/access",
-	"./support",
-	"../selector"
-], function( jQuery, rnotwhite, strundefined, access, support ) {
-
-var nodeHook, boolHook,
-	attrHandle = jQuery.expr.attrHandle;
-
-jQuery.fn.extend({
-	attr: function( name, value ) {
-		return access( this, jQuery.attr, name, value, arguments.length > 1 );
-	},
-
-	removeAttr: function( name ) {
-		return this.each(function() {
-			jQuery.removeAttr( this, name );
-		});
-	}
-});
-
-jQuery.extend({
-	attr: function( elem, name, value ) {
-		var hooks, ret,
-			nType = elem.nodeType;
-
-		// don't get/set attributes on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
-
-		// Fallback to prop when attributes are not supported
-		if ( typeof elem.getAttribute === strundefined ) {
-			return jQuery.prop( elem, name, value );
-		}
-
-		// All attributes are lowercase
-		// Grab necessary hook if one is defined
-		if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
-			name = name.toLowerCase();
-			hooks = jQuery.attrHooks[ name ] ||
-				( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
-		}
-
-		if ( value !== undefined ) {
-
-			if ( value === null ) {
-				jQuery.removeAttr( elem, name );
-
-			} else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
-
-			} else {
-				elem.setAttribute( name, value + "" );
-				return value;
-			}
-
-		} else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-			return ret;
-
-		} else {
-			ret = jQuery.find.attr( elem, name );
-
-			// Non-existent attributes return null, we normalize to undefined
-			return ret == null ?
-				undefined :
-				ret;
-		}
-	},
-
-	removeAttr: function( elem, value ) {
-		var name, propName,
-			i = 0,
-			attrNames = value && value.match( rnotwhite );
-
-		if ( attrNames && elem.nodeType === 1 ) {
-			while ( (name = attrNames[i++]) ) {
-				propName = jQuery.propFix[ name ] || name;
-
-				// Boolean attributes get special treatment (#10870)
-				if ( jQuery.expr.match.bool.test( name ) ) {
-					// Set corresponding property to false
-					elem[ propName ] = false;
-				}
-
-				elem.removeAttribute( name );
-			}
-		}
-	},
-
-	attrHooks: {
-		type: {
-			set: function( elem, value ) {
-				if ( !support.radioValue && value === "radio" &&
-					jQuery.nodeName( elem, "input" ) ) {
-					var val = elem.value;
-					elem.setAttribute( "type", value );
-					if ( val ) {
-						elem.value = val;
-					}
-					return value;
-				}
-			}
-		}
-	}
-});
-
-// Hooks for boolean attributes
-boolHook = {
-	set: function( elem, value, name ) {
-		if ( value === false ) {
-			// Remove boolean attributes when set to false
-			jQuery.removeAttr( elem, name );
-		} else {
-			elem.setAttribute( name, name );
-		}
-		return name;
-	}
-};
-jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
-	var getter = attrHandle[ name ] || jQuery.find.attr;
-
-	attrHandle[ name ] = function( elem, name, isXML ) {
-		var ret, handle;
-		if ( !isXML ) {
-			// Avoid an infinite loop by temporarily removing this function from the getter
-			handle = attrHandle[ name ];
-			attrHandle[ name ] = ret;
-			ret = getter( elem, name, isXML ) != null ?
-				name.toLowerCase() :
-				null;
-			attrHandle[ name ] = handle;
-		}
-		return ret;
-	};
-});
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/classes.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/classes.js
deleted file mode 100644
index 1011384..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/classes.js
+++ /dev/null
@@ -1,158 +0,0 @@
-define([
-	"../core",
-	"../var/rnotwhite",
-	"../var/strundefined",
-	"../data/var/data_priv",
-	"../core/init"
-], function( jQuery, rnotwhite, strundefined, data_priv ) {
-
-var rclass = /[\t\r\n\f]/g;
-
-jQuery.fn.extend({
-	addClass: function( value ) {
-		var classes, elem, cur, clazz, j, finalValue,
-			proceed = typeof value === "string" && value,
-			i = 0,
-			len = this.length;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).addClass( value.call( this, j, this.className ) );
-			});
-		}
-
-		if ( proceed ) {
-			// The disjunction here is for better compressibility (see removeClass)
-			classes = ( value || "" ).match( rnotwhite ) || [];
-
-			for ( ; i < len; i++ ) {
-				elem = this[ i ];
-				cur = elem.nodeType === 1 && ( elem.className ?
-					( " " + elem.className + " " ).replace( rclass, " " ) :
-					" "
-				);
-
-				if ( cur ) {
-					j = 0;
-					while ( (clazz = classes[j++]) ) {
-						if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
-							cur += clazz + " ";
-						}
-					}
-
-					// only assign if different to avoid unneeded rendering.
-					finalValue = jQuery.trim( cur );
-					if ( elem.className !== finalValue ) {
-						elem.className = finalValue;
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	removeClass: function( value ) {
-		var classes, elem, cur, clazz, j, finalValue,
-			proceed = arguments.length === 0 || typeof value === "string" && value,
-			i = 0,
-			len = this.length;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).removeClass( value.call( this, j, this.className ) );
-			});
-		}
-		if ( proceed ) {
-			classes = ( value || "" ).match( rnotwhite ) || [];
-
-			for ( ; i < len; i++ ) {
-				elem = this[ i ];
-				// This expression is here for better compressibility (see addClass)
-				cur = elem.nodeType === 1 && ( elem.className ?
-					( " " + elem.className + " " ).replace( rclass, " " ) :
-					""
-				);
-
-				if ( cur ) {
-					j = 0;
-					while ( (clazz = classes[j++]) ) {
-						// Remove *all* instances
-						while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
-							cur = cur.replace( " " + clazz + " ", " " );
-						}
-					}
-
-					// Only assign if different to avoid unneeded rendering.
-					finalValue = value ? jQuery.trim( cur ) : "";
-					if ( elem.className !== finalValue ) {
-						elem.className = finalValue;
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	toggleClass: function( value, stateVal ) {
-		var type = typeof value;
-
-		if ( typeof stateVal === "boolean" && type === "string" ) {
-			return stateVal ? this.addClass( value ) : this.removeClass( value );
-		}
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
-			});
-		}
-
-		return this.each(function() {
-			if ( type === "string" ) {
-				// Toggle individual class names
-				var className,
-					i = 0,
-					self = jQuery( this ),
-					classNames = value.match( rnotwhite ) || [];
-
-				while ( (className = classNames[ i++ ]) ) {
-					// Check each className given, space separated list
-					if ( self.hasClass( className ) ) {
-						self.removeClass( className );
-					} else {
-						self.addClass( className );
-					}
-				}
-
-			// Toggle whole class name
-			} else if ( type === strundefined || type === "boolean" ) {
-				if ( this.className ) {
-					// store className if set
-					data_priv.set( this, "__className__", this.className );
-				}
-
-				// If the element has a class name or if we're passed `false`,
-				// then remove the whole classname (if there was one, the above saved it).
-				// Otherwise bring back whatever was previously saved (if anything),
-				// falling back to the empty string if nothing was stored.
-				this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
-			}
-		});
-	},
-
-	hasClass: function( selector ) {
-		var className = " " + selector + " ",
-			i = 0,
-			l = this.length;
-		for ( ; i < l; i++ ) {
-			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
-				return true;
-			}
-		}
-
-		return false;
-	}
-});
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/prop.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/prop.js
deleted file mode 100644
index d4ee8b6..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/prop.js
+++ /dev/null
@@ -1,94 +0,0 @@
-define([
-	"../core",
-	"../core/access",
-	"./support"
-], function( jQuery, access, support ) {
-
-var rfocusable = /^(?:input|select|textarea|button)$/i;
-
-jQuery.fn.extend({
-	prop: function( name, value ) {
-		return access( this, jQuery.prop, name, value, arguments.length > 1 );
-	},
-
-	removeProp: function( name ) {
-		return this.each(function() {
-			delete this[ jQuery.propFix[ name ] || name ];
-		});
-	}
-});
-
-jQuery.extend({
-	propFix: {
-		"for": "htmlFor",
-		"class": "className"
-	},
-
-	prop: function( elem, name, value ) {
-		var ret, hooks, notxml,
-			nType = elem.nodeType;
-
-		// Don't get/set properties on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
-
-		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-		if ( notxml ) {
-			// Fix name and attach hooks
-			name = jQuery.propFix[ name ] || name;
-			hooks = jQuery.propHooks[ name ];
-		}
-
-		if ( value !== undefined ) {
-			return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
-				ret :
-				( elem[ name ] = value );
-
-		} else {
-			return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
-				ret :
-				elem[ name ];
-		}
-	},
-
-	propHooks: {
-		tabIndex: {
-			get: function( elem ) {
-				return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
-					elem.tabIndex :
-					-1;
-			}
-		}
-	}
-});
-
-if ( !support.optSelected ) {
-	jQuery.propHooks.selected = {
-		get: function( elem ) {
-			var parent = elem.parentNode;
-			if ( parent && parent.parentNode ) {
-				parent.parentNode.selectedIndex;
-			}
-			return null;
-		}
-	};
-}
-
-jQuery.each([
-	"tabIndex",
-	"readOnly",
-	"maxLength",
-	"cellSpacing",
-	"cellPadding",
-	"rowSpan",
-	"colSpan",
-	"useMap",
-	"frameBorder",
-	"contentEditable"
-], function() {
-	jQuery.propFix[ this.toLowerCase() ] = this;
-});
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/support.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/support.js
deleted file mode 100644
index 5db5c52..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/support.js
+++ /dev/null
@@ -1,35 +0,0 @@
-define([
-	"../var/support"
-], function( support ) {
-
-(function() {
-	var input = document.createElement( "input" ),
-		select = document.createElement( "select" ),
-		opt = select.appendChild( document.createElement( "option" ) );
-
-	input.type = "checkbox";
-
-	// Support: iOS<=5.1, Android<=4.2+
-	// Default value for a checkbox should be "on"
-	support.checkOn = input.value !== "";
-
-	// Support: IE<=11+
-	// Must access selectedIndex to make default options select
-	support.optSelected = opt.selected;
-
-	// Support: Android<=2.3
-	// Options inside disabled selects are incorrectly marked as disabled
-	select.disabled = true;
-	support.optDisabled = !opt.disabled;
-
-	// Support: IE<=11+
-	// An input loses its value after becoming a radio
-	input = document.createElement( "input" );
-	input.value = "t";
-	input.type = "radio";
-	support.radioValue = input.value === "t";
-})();
-
-return support;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/val.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/val.js
deleted file mode 100644
index 4a1358a..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/attributes/val.js
+++ /dev/null
@@ -1,161 +0,0 @@
-define([
-	"../core",
-	"./support",
-	"../core/init"
-], function( jQuery, support ) {
-
-var rreturn = /\r/g;
-
-jQuery.fn.extend({
-	val: function( value ) {
-		var hooks, ret, isFunction,
-			elem = this[0];
-
-		if ( !arguments.length ) {
-			if ( elem ) {
-				hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
-				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
-					return ret;
-				}
-
-				ret = elem.value;
-
-				return typeof ret === "string" ?
-					// Handle most common string cases
-					ret.replace(rreturn, "") :
-					// Handle cases where value is null/undef or number
-					ret == null ? "" : ret;
-			}
-
-			return;
-		}
-
-		isFunction = jQuery.isFunction( value );
-
-		return this.each(function( i ) {
-			var val;
-
-			if ( this.nodeType !== 1 ) {
-				return;
-			}
-
-			if ( isFunction ) {
-				val = value.call( this, i, jQuery( this ).val() );
-			} else {
-				val = value;
-			}
-
-			// Treat null/undefined as ""; convert numbers to string
-			if ( val == null ) {
-				val = "";
-
-			} else if ( typeof val === "number" ) {
-				val += "";
-
-			} else if ( jQuery.isArray( val ) ) {
-				val = jQuery.map( val, function( value ) {
-					return value == null ? "" : value + "";
-				});
-			}
-
-			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
-			// If set returns undefined, fall back to normal setting
-			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
-				this.value = val;
-			}
-		});
-	}
-});
-
-jQuery.extend({
-	valHooks: {
-		option: {
-			get: function( elem ) {
-				var val = jQuery.find.attr( elem, "value" );
-				return val != null ?
-					val :
-					// Support: IE10-11+
-					// option.text throws exceptions (#14686, #14858)
-					jQuery.trim( jQuery.text( elem ) );
-			}
-		},
-		select: {
-			get: function( elem ) {
-				var value, option,
-					options = elem.options,
-					index = elem.selectedIndex,
-					one = elem.type === "select-one" || index < 0,
-					values = one ? null : [],
-					max = one ? index + 1 : options.length,
-					i = index < 0 ?
-						max :
-						one ? index : 0;
-
-				// Loop through all the selected options
-				for ( ; i < max; i++ ) {
-					option = options[ i ];
-
-					// IE6-9 doesn't update selected after form reset (#2551)
-					if ( ( option.selected || i === index ) &&
-							// Don't return options that are disabled or in a disabled optgroup
-							( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
-							( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
-
-						// Get the specific value for the option
-						value = jQuery( option ).val();
-
-						// We don't need an array for one selects
-						if ( one ) {
-							return value;
-						}
-
-						// Multi-Selects return an array
-						values.push( value );
-					}
-				}
-
-				return values;
-			},
-
-			set: function( elem, value ) {
-				var optionSet, option,
-					options = elem.options,
-					values = jQuery.makeArray( value ),
-					i = options.length;
-
-				while ( i-- ) {
-					option = options[ i ];
-					if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
-						optionSet = true;
-					}
-				}
-
-				// Force browsers to behave consistently when non-matching value is set
-				if ( !optionSet ) {
-					elem.selectedIndex = -1;
-				}
-				return values;
-			}
-		}
-	}
-});
-
-// Radios and checkboxes getter/setter
-jQuery.each([ "radio", "checkbox" ], function() {
-	jQuery.valHooks[ this ] = {
-		set: function( elem, value ) {
-			if ( jQuery.isArray( value ) ) {
-				return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
-			}
-		}
-	};
-	if ( !support.checkOn ) {
-		jQuery.valHooks[ this ].get = function( elem ) {
-			return elem.getAttribute("value") === null ? "on" : elem.value;
-		};
-	}
-});
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/callbacks.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/callbacks.js
deleted file mode 100644
index 17572bb..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/callbacks.js
+++ /dev/null
@@ -1,205 +0,0 @@
-define([
-	"./core",
-	"./var/rnotwhite"
-], function( jQuery, rnotwhite ) {
-
-// String to Object options format cache
-var optionsCache = {};
-
-// Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
-	var object = optionsCache[ options ] = {};
-	jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
-		object[ flag ] = true;
-	});
-	return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- *	options: an optional list of space-separated options that will change how
- *			the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- *	once:			will ensure the callback list can only be fired once (like a Deferred)
- *
- *	memory:			will keep track of previous values and will call any callback added
- *					after the list has been fired right away with the latest "memorized"
- *					values (like a Deferred)
- *
- *	unique:			will ensure a callback can only be added once (no duplicate in the list)
- *
- *	stopOnFalse:	interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( options ) {
-
-	// Convert options from String-formatted to Object-formatted if needed
-	// (we check in cache first)
-	options = typeof options === "string" ?
-		( optionsCache[ options ] || createOptions( options ) ) :
-		jQuery.extend( {}, options );
-
-	var // Last fire value (for non-forgettable lists)
-		memory,
-		// Flag to know if list was already fired
-		fired,
-		// Flag to know if list is currently firing
-		firing,
-		// First callback to fire (used internally by add and fireWith)
-		firingStart,
-		// End of the loop when firing
-		firingLength,
-		// Index of currently firing callback (modified by remove if needed)
-		firingIndex,
-		// Actual callback list
-		list = [],
-		// Stack of fire calls for repeatable lists
-		stack = !options.once && [],
-		// Fire callbacks
-		fire = function( data ) {
-			memory = options.memory && data;
-			fired = true;
-			firingIndex = firingStart || 0;
-			firingStart = 0;
-			firingLength = list.length;
-			firing = true;
-			for ( ; list && firingIndex < firingLength; firingIndex++ ) {
-				if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
-					memory = false; // To prevent further calls using add
-					break;
-				}
-			}
-			firing = false;
-			if ( list ) {
-				if ( stack ) {
-					if ( stack.length ) {
-						fire( stack.shift() );
-					}
-				} else if ( memory ) {
-					list = [];
-				} else {
-					self.disable();
-				}
-			}
-		},
-		// Actual Callbacks object
-		self = {
-			// Add a callback or a collection of callbacks to the list
-			add: function() {
-				if ( list ) {
-					// First, we save the current length
-					var start = list.length;
-					(function add( args ) {
-						jQuery.each( args, function( _, arg ) {
-							var type = jQuery.type( arg );
-							if ( type === "function" ) {
-								if ( !options.unique || !self.has( arg ) ) {
-									list.push( arg );
-								}
-							} else if ( arg && arg.length && type !== "string" ) {
-								// Inspect recursively
-								add( arg );
-							}
-						});
-					})( arguments );
-					// Do we need to add the callbacks to the
-					// current firing batch?
-					if ( firing ) {
-						firingLength = list.length;
-					// With memory, if we're not firing then
-					// we should call right away
-					} else if ( memory ) {
-						firingStart = start;
-						fire( memory );
-					}
-				}
-				return this;
-			},
-			// Remove a callback from the list
-			remove: function() {
-				if ( list ) {
-					jQuery.each( arguments, function( _, arg ) {
-						var index;
-						while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
-							list.splice( index, 1 );
-							// Handle firing indexes
-							if ( firing ) {
-								if ( index <= firingLength ) {
-									firingLength--;
-								}
-								if ( index <= firingIndex ) {
-									firingIndex--;
-								}
-							}
-						}
-					});
-				}
-				return this;
-			},
-			// Check if a given callback is in the list.
-			// If no argument is given, return whether or not list has callbacks attached.
-			has: function( fn ) {
-				return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
-			},
-			// Remove all callbacks from the list
-			empty: function() {
-				list = [];
-				firingLength = 0;
-				return this;
-			},
-			// Have the list do nothing anymore
-			disable: function() {
-				list = stack = memory = undefined;
-				return this;
-			},
-			// Is it disabled?
-			disabled: function() {
-				return !list;
-			},
-			// Lock the list in its current state
-			lock: function() {
-				stack = undefined;
-				if ( !memory ) {
-					self.disable();
-				}
-				return this;
-			},
-			// Is it locked?
-			locked: function() {
-				return !stack;
-			},
-			// Call all callbacks with the given context and arguments
-			fireWith: function( context, args ) {
-				if ( list && ( !fired || stack ) ) {
-					args = args || [];
-					args = [ context, args.slice ? args.slice() : args ];
-					if ( firing ) {
-						stack.push( args );
-					} else {
-						fire( args );
-					}
-				}
-				return this;
-			},
-			// Call all the callbacks with the given arguments
-			fire: function() {
-				self.fireWith( this, arguments );
-				return this;
-			},
-			// To know if the callbacks have already been called at least once
-			fired: function() {
-				return !!fired;
-			}
-		};
-
-	return self;
-};
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core.js
deleted file mode 100644
index 6f471ee..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core.js
+++ /dev/null
@@ -1,502 +0,0 @@
-define([
-	"./var/arr",
-	"./var/slice",
-	"./var/concat",
-	"./var/push",
-	"./var/indexOf",
-	"./var/class2type",
-	"./var/toString",
-	"./var/hasOwn",
-	"./var/support"
-], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) {
-
-var
-	// Use the correct document accordingly with window argument (sandbox)
-	document = window.document,
-
-	version = "@VERSION",
-
-	// Define a local copy of jQuery
-	jQuery = function( selector, context ) {
-		// The jQuery object is actually just the init constructor 'enhanced'
-		// Need init if jQuery is called (just allow error to be thrown if not included)
-		return new jQuery.fn.init( selector, context );
-	},
-
-	// Support: Android<4.1
-	// Make sure we trim BOM and NBSP
-	rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
-	// Matches dashed string for camelizing
-	rmsPrefix = /^-ms-/,
-	rdashAlpha = /-([\da-z])/gi,
-
-	// Used by jQuery.camelCase as callback to replace()
-	fcamelCase = function( all, letter ) {
-		return letter.toUpperCase();
-	};
-
-jQuery.fn = jQuery.prototype = {
-	// The current version of jQuery being used
-	jquery: version,
-
-	constructor: jQuery,
-
-	// Start with an empty selector
-	selector: "",
-
-	// The default length of a jQuery object is 0
-	length: 0,
-
-	toArray: function() {
-		return slice.call( this );
-	},
-
-	// Get the Nth element in the matched element set OR
-	// Get the whole matched element set as a clean array
-	get: function( num ) {
-		return num != null ?
-
-			// Return just the one element from the set
-			( num < 0 ? this[ num + this.length ] : this[ num ] ) :
-
-			// Return all the elements in a clean array
-			slice.call( this );
-	},
-
-	// Take an array of elements and push it onto the stack
-	// (returning the new matched element set)
-	pushStack: function( elems ) {
-
-		// Build a new jQuery matched element set
-		var ret = jQuery.merge( this.constructor(), elems );
-
-		// Add the old object onto the stack (as a reference)
-		ret.prevObject = this;
-		ret.context = this.context;
-
-		// Return the newly-formed element set
-		return ret;
-	},
-
-	// Execute a callback for every element in the matched set.
-	// (You can seed the arguments with an array of args, but this is
-	// only used internally.)
-	each: function( callback, args ) {
-		return jQuery.each( this, callback, args );
-	},
-
-	map: function( callback ) {
-		return this.pushStack( jQuery.map(this, function( elem, i ) {
-			return callback.call( elem, i, elem );
-		}));
-	},
-
-	slice: function() {
-		return this.pushStack( slice.apply( this, arguments ) );
-	},
-
-	first: function() {
-		return this.eq( 0 );
-	},
-
-	last: function() {
-		return this.eq( -1 );
-	},
-
-	eq: function( i ) {
-		var len = this.length,
-			j = +i + ( i < 0 ? len : 0 );
-		return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
-	},
-
-	end: function() {
-		return this.prevObject || this.constructor(null);
-	},
-
-	// For internal use only.
-	// Behaves like an Array's method, not like a jQuery method.
-	push: push,
-	sort: arr.sort,
-	splice: arr.splice
-};
-
-jQuery.extend = jQuery.fn.extend = function() {
-	var options, name, src, copy, copyIsArray, clone,
-		target = arguments[0] || {},
-		i = 1,
-		length = arguments.length,
-		deep = false;
-
-	// Handle a deep copy situation
-	if ( typeof target === "boolean" ) {
-		deep = target;
-
-		// Skip the boolean and the target
-		target = arguments[ i ] || {};
-		i++;
-	}
-
-	// Handle case when target is a string or something (possible in deep copy)
-	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
-		target = {};
-	}
-
-	// Extend jQuery itself if only one argument is passed
-	if ( i === length ) {
-		target = this;
-		i--;
-	}
-
-	for ( ; i < length; i++ ) {
-		// Only deal with non-null/undefined values
-		if ( (options = arguments[ i ]) != null ) {
-			// Extend the base object
-			for ( name in options ) {
-				src = target[ name ];
-				copy = options[ name ];
-
-				// Prevent never-ending loop
-				if ( target === copy ) {
-					continue;
-				}
-
-				// Recurse if we're merging plain objects or arrays
-				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
-					if ( copyIsArray ) {
-						copyIsArray = false;
-						clone = src && jQuery.isArray(src) ? src : [];
-
-					} else {
-						clone = src && jQuery.isPlainObject(src) ? src : {};
-					}
-
-					// Never move original objects, clone them
-					target[ name ] = jQuery.extend( deep, clone, copy );
-
-				// Don't bring in undefined values
-				} else if ( copy !== undefined ) {
-					target[ name ] = copy;
-				}
-			}
-		}
-	}
-
-	// Return the modified object
-	return target;
-};
-
-jQuery.extend({
-	// Unique for each copy of jQuery on the page
-	expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
-
-	// Assume jQuery is ready without the ready module
-	isReady: true,
-
-	error: function( msg ) {
-		throw new Error( msg );
-	},
-
-	noop: function() {},
-
-	isFunction: function( obj ) {
-		return jQuery.type(obj) === "function";
-	},
-
-	isArray: Array.isArray,
-
-	isWindow: function( obj ) {
-		return obj != null && obj === obj.window;
-	},
-
-	isNumeric: function( obj ) {
-		// parseFloat NaNs numeric-cast false positives (null|true|false|"")
-		// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
-		// subtraction forces infinities to NaN
-		// adding 1 corrects loss of precision from parseFloat (#15100)
-		return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
-	},
-
-	isPlainObject: function( obj ) {
-		// Not plain objects:
-		// - Any object or value whose internal [[Class]] property is not "[object Object]"
-		// - DOM nodes
-		// - window
-		if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
-			return false;
-		}
-
-		if ( obj.constructor &&
-				!hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
-			return false;
-		}
-
-		// If the function hasn't returned already, we're confident that
-		// |obj| is a plain object, created by {} or constructed with new Object
-		return true;
-	},
-
-	isEmptyObject: function( obj ) {
-		var name;
-		for ( name in obj ) {
-			return false;
-		}
-		return true;
-	},
-
-	type: function( obj ) {
-		if ( obj == null ) {
-			return obj + "";
-		}
-		// Support: Android<4.0, iOS<6 (functionish RegExp)
-		return typeof obj === "object" || typeof obj === "function" ?
-			class2type[ toString.call(obj) ] || "object" :
-			typeof obj;
-	},
-
-	// Evaluates a script in a global context
-	globalEval: function( code ) {
-		var script,
-			indirect = eval;
-
-		code = jQuery.trim( code );
-
-		if ( code ) {
-			// If the code includes a valid, prologue position
-			// strict mode pragma, execute code by injecting a
-			// script tag into the document.
-			if ( code.indexOf("use strict") === 1 ) {
-				script = document.createElement("script");
-				script.text = code;
-				document.head.appendChild( script ).parentNode.removeChild( script );
-			} else {
-			// Otherwise, avoid the DOM node creation, insertion
-			// and removal by using an indirect global eval
-				indirect( code );
-			}
-		}
-	},
-
-	// Convert dashed to camelCase; used by the css and data modules
-	// Support: IE9-11+
-	// Microsoft forgot to hump their vendor prefix (#9572)
-	camelCase: function( string ) {
-		return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
-	},
-
-	nodeName: function( elem, name ) {
-		return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
-	},
-
-	// args is for internal usage only
-	each: function( obj, callback, args ) {
-		var value,
-			i = 0,
-			length = obj.length,
-			isArray = isArraylike( obj );
-
-		if ( args ) {
-			if ( isArray ) {
-				for ( ; i < length; i++ ) {
-					value = callback.apply( obj[ i ], args );
-
-					if ( value === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( i in obj ) {
-					value = callback.apply( obj[ i ], args );
-
-					if ( value === false ) {
-						break;
-					}
-				}
-			}
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( isArray ) {
-				for ( ; i < length; i++ ) {
-					value = callback.call( obj[ i ], i, obj[ i ] );
-
-					if ( value === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( i in obj ) {
-					value = callback.call( obj[ i ], i, obj[ i ] );
-
-					if ( value === false ) {
-						break;
-					}
-				}
-			}
-		}
-
-		return obj;
-	},
-
-	// Support: Android<4.1
-	trim: function( text ) {
-		return text == null ?
-			"" :
-			( text + "" ).replace( rtrim, "" );
-	},
-
-	// results is for internal usage only
-	makeArray: function( arr, results ) {
-		var ret = results || [];
-
-		if ( arr != null ) {
-			if ( isArraylike( Object(arr) ) ) {
-				jQuery.merge( ret,
-					typeof arr === "string" ?
-					[ arr ] : arr
-				);
-			} else {
-				push.call( ret, arr );
-			}
-		}
-
-		return ret;
-	},
-
-	inArray: function( elem, arr, i ) {
-		return arr == null ? -1 : indexOf.call( arr, elem, i );
-	},
-
-	merge: function( first, second ) {
-		var len = +second.length,
-			j = 0,
-			i = first.length;
-
-		for ( ; j < len; j++ ) {
-			first[ i++ ] = second[ j ];
-		}
-
-		first.length = i;
-
-		return first;
-	},
-
-	grep: function( elems, callback, invert ) {
-		var callbackInverse,
-			matches = [],
-			i = 0,
-			length = elems.length,
-			callbackExpect = !invert;
-
-		// Go through the array, only saving the items
-		// that pass the validator function
-		for ( ; i < length; i++ ) {
-			callbackInverse = !callback( elems[ i ], i );
-			if ( callbackInverse !== callbackExpect ) {
-				matches.push( elems[ i ] );
-			}
-		}
-
-		return matches;
-	},
-
-	// arg is for internal usage only
-	map: function( elems, callback, arg ) {
-		var value,
-			i = 0,
-			length = elems.length,
-			isArray = isArraylike( elems ),
-			ret = [];
-
-		// Go through the array, translating each of the items to their new values
-		if ( isArray ) {
-			for ( ; i < length; i++ ) {
-				value = callback( elems[ i ], i, arg );
-
-				if ( value != null ) {
-					ret.push( value );
-				}
-			}
-
-		// Go through every key on the object,
-		} else {
-			for ( i in elems ) {
-				value = callback( elems[ i ], i, arg );
-
-				if ( value != null ) {
-					ret.push( value );
-				}
-			}
-		}
-
-		// Flatten any nested arrays
-		return concat.apply( [], ret );
-	},
-
-	// A global GUID counter for objects
-	guid: 1,
-
-	// Bind a function to a context, optionally partially applying any
-	// arguments.
-	proxy: function( fn, context ) {
-		var tmp, args, proxy;
-
-		if ( typeof context === "string" ) {
-			tmp = fn[ context ];
-			context = fn;
-			fn = tmp;
-		}
-
-		// Quick check to determine if target is callable, in the spec
-		// this throws a TypeError, but we will just return undefined.
-		if ( !jQuery.isFunction( fn ) ) {
-			return undefined;
-		}
-
-		// Simulated bind
-		args = slice.call( arguments, 2 );
-		proxy = function() {
-			return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
-		};
-
-		// Set the guid of unique handler to the same of original handler, so it can be removed
-		proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
-		return proxy;
-	},
-
-	now: Date.now,
-
-	// jQuery.support is not used in Core but other projects attach their
-	// properties to it so it needs to exist.
-	support: support
-});
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
-	class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-function isArraylike( obj ) {
-
-	// Support: iOS 8.2 (not reproducible in simulator)
-	// `in` check used to prevent JIT error (gh-2145)
-	// hasOwn isn't used here due to false negatives
-	// regarding Nodelist length in IE
-	var length = "length" in obj && obj.length,
-		type = jQuery.type( obj );
-
-	if ( type === "function" || jQuery.isWindow( obj ) ) {
-		return false;
-	}
-
-	if ( obj.nodeType === 1 && length ) {
-		return true;
-	}
-
-	return type === "array" || length === 0 ||
-		typeof length === "number" && length > 0 && ( length - 1 ) in obj;
-}
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/access.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/access.js
deleted file mode 100644
index b6110c8..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/access.js
+++ /dev/null
@@ -1,60 +0,0 @@
-define([
-	"../core"
-], function( jQuery ) {
-
-// Multifunctional method to get and set values of a collection
-// The value/s can optionally be executed if it's a function
-var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
-	var i = 0,
-		len = elems.length,
-		bulk = key == null;
-
-	// Sets many values
-	if ( jQuery.type( key ) === "object" ) {
-		chainable = true;
-		for ( i in key ) {
-			jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
-		}
-
-	// Sets one value
-	} else if ( value !== undefined ) {
-		chainable = true;
-
-		if ( !jQuery.isFunction( value ) ) {
-			raw = true;
-		}
-
-		if ( bulk ) {
-			// Bulk operations run against the entire set
-			if ( raw ) {
-				fn.call( elems, value );
-				fn = null;
-
-			// ...except when executing function values
-			} else {
-				bulk = fn;
-				fn = function( elem, key, value ) {
-					return bulk.call( jQuery( elem ), value );
-				};
-			}
-		}
-
-		if ( fn ) {
-			for ( ; i < len; i++ ) {
-				fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
-			}
-		}
-	}
-
-	return chainable ?
-		elems :
-
-		// Gets
-		bulk ?
-			fn.call( elems ) :
-			len ? fn( elems[0], key ) : emptyGet;
-};
-
-return access;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/init.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/init.js
deleted file mode 100644
index 7e83a04..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/init.js
+++ /dev/null
@@ -1,123 +0,0 @@
-// Initialize a jQuery object
-define([
-	"../core",
-	"./var/rsingleTag",
-	"../traversing/findFilter"
-], function( jQuery, rsingleTag ) {
-
-// A central reference to the root jQuery(document)
-var rootjQuery,
-
-	// A simple way to check for HTML strings
-	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-	// Strict HTML recognition (#11290: must start with <)
-	rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
-
-	init = jQuery.fn.init = function( selector, context ) {
-		var match, elem;
-
-		// HANDLE: $(""), $(null), $(undefined), $(false)
-		if ( !selector ) {
-			return this;
-		}
-
-		// Handle HTML strings
-		if ( typeof selector === "string" ) {
-			if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
-				// Assume that strings that start and end with <> are HTML and skip the regex check
-				match = [ null, selector, null ];
-
-			} else {
-				match = rquickExpr.exec( selector );
-			}
-
-			// Match html or make sure no context is specified for #id
-			if ( match && (match[1] || !context) ) {
-
-				// HANDLE: $(html) -> $(array)
-				if ( match[1] ) {
-					context = context instanceof jQuery ? context[0] : context;
-
-					// Option to run scripts is true for back-compat
-					// Intentionally let the error be thrown if parseHTML is not present
-					jQuery.merge( this, jQuery.parseHTML(
-						match[1],
-						context && context.nodeType ? context.ownerDocument || context : document,
-						true
-					) );
-
-					// HANDLE: $(html, props)
-					if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
-						for ( match in context ) {
-							// Properties of context are called as methods if possible
-							if ( jQuery.isFunction( this[ match ] ) ) {
-								this[ match ]( context[ match ] );
-
-							// ...and otherwise set as attributes
-							} else {
-								this.attr( match, context[ match ] );
-							}
-						}
-					}
-
-					return this;
-
-				// HANDLE: $(#id)
-				} else {
-					elem = document.getElementById( match[2] );
-
-					// Support: Blackberry 4.6
-					// gEBID returns nodes no longer in the document (#6963)
-					if ( elem && elem.parentNode ) {
-						// Inject the element directly into the jQuery object
-						this.length = 1;
-						this[0] = elem;
-					}
-
-					this.context = document;
-					this.selector = selector;
-					return this;
-				}
-
-			// HANDLE: $(expr, $(...))
-			} else if ( !context || context.jquery ) {
-				return ( context || rootjQuery ).find( selector );
-
-			// HANDLE: $(expr, context)
-			// (which is just equivalent to: $(context).find(expr)
-			} else {
-				return this.constructor( context ).find( selector );
-			}
-
-		// HANDLE: $(DOMElement)
-		} else if ( selector.nodeType ) {
-			this.context = this[0] = selector;
-			this.length = 1;
-			return this;
-
-		// HANDLE: $(function)
-		// Shortcut for document ready
-		} else if ( jQuery.isFunction( selector ) ) {
-			return typeof rootjQuery.ready !== "undefined" ?
-				rootjQuery.ready( selector ) :
-				// Execute immediately if ready is not present
-				selector( jQuery );
-		}
-
-		if ( selector.selector !== undefined ) {
-			this.selector = selector.selector;
-			this.context = selector.context;
-		}
-
-		return jQuery.makeArray( selector, this );
-	};
-
-// Give the init function the jQuery prototype for later instantiation
-init.prototype = jQuery.fn;
-
-// Initialize central reference
-rootjQuery = jQuery( document );
-
-return init;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/parseHTML.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/parseHTML.js
deleted file mode 100644
index 64cf2a1..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/parseHTML.js
+++ /dev/null
@@ -1,39 +0,0 @@
-define([
-	"../core",
-	"./var/rsingleTag",
-	"../manipulation" // buildFragment
-], function( jQuery, rsingleTag ) {
-
-// data: string of html
-// context (optional): If specified, the fragment will be created in this context, defaults to document
-// keepScripts (optional): If true, will include scripts passed in the html string
-jQuery.parseHTML = function( data, context, keepScripts ) {
-	if ( !data || typeof data !== "string" ) {
-		return null;
-	}
-	if ( typeof context === "boolean" ) {
-		keepScripts = context;
-		context = false;
-	}
-	context = context || document;
-
-	var parsed = rsingleTag.exec( data ),
-		scripts = !keepScripts && [];
-
-	// Single tag
-	if ( parsed ) {
-		return [ context.createElement( parsed[1] ) ];
-	}
-
-	parsed = jQuery.buildFragment( [ data ], context, scripts );
-
-	if ( scripts && scripts.length ) {
-		jQuery( scripts ).remove();
-	}
-
-	return jQuery.merge( [], parsed.childNodes );
-};
-
-return jQuery.parseHTML;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/ready.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/ready.js
deleted file mode 100644
index db1a6e6..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/ready.js
+++ /dev/null
@@ -1,97 +0,0 @@
-define([
-	"../core",
-	"../core/init",
-	"../deferred"
-], function( jQuery ) {
-
-// The deferred used on DOM ready
-var readyList;
-
-jQuery.fn.ready = function( fn ) {
-	// Add the callback
-	jQuery.ready.promise().done( fn );
-
-	return this;
-};
-
-jQuery.extend({
-	// Is the DOM ready to be used? Set to true once it occurs.
-	isReady: false,
-
-	// A counter to track how many items to wait for before
-	// the ready event fires. See #6781
-	readyWait: 1,
-
-	// Hold (or release) the ready event
-	holdReady: function( hold ) {
-		if ( hold ) {
-			jQuery.readyWait++;
-		} else {
-			jQuery.ready( true );
-		}
-	},
-
-	// Handle when the DOM is ready
-	ready: function( wait ) {
-
-		// Abort if there are pending holds or we're already ready
-		if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
-			return;
-		}
-
-		// Remember that the DOM is ready
-		jQuery.isReady = true;
-
-		// If a normal DOM Ready event fired, decrement, and wait if need be
-		if ( wait !== true && --jQuery.readyWait > 0 ) {
-			return;
-		}
-
-		// If there are functions bound, to execute
-		readyList.resolveWith( document, [ jQuery ] );
-
-		// Trigger any bound ready events
-		if ( jQuery.fn.triggerHandler ) {
-			jQuery( document ).triggerHandler( "ready" );
-			jQuery( document ).off( "ready" );
-		}
-	}
-});
-
-/**
- * The ready event handler and self cleanup method
- */
-function completed() {
-	document.removeEventListener( "DOMContentLoaded", completed, false );
-	window.removeEventListener( "load", completed, false );
-	jQuery.ready();
-}
-
-jQuery.ready.promise = function( obj ) {
-	if ( !readyList ) {
-
-		readyList = jQuery.Deferred();
-
-		// Catch cases where $(document).ready() is called after the browser event has already occurred.
-		// We once tried to use readyState "interactive" here, but it caused issues like the one
-		// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
-		if ( document.readyState === "complete" ) {
-			// Handle it asynchronously to allow scripts the opportunity to delay ready
-			setTimeout( jQuery.ready );
-
-		} else {
-
-			// Use the handy event callback
-			document.addEventListener( "DOMContentLoaded", completed, false );
-
-			// A fallback to window.onload, that will always work
-			window.addEventListener( "load", completed, false );
-		}
-	}
-	return readyList.promise( obj );
-};
-
-// Kick off the DOM ready check even if the user does not
-jQuery.ready.promise();
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/var/rsingleTag.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/var/rsingleTag.js
deleted file mode 100644
index 7e7090b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/core/var/rsingleTag.js
+++ /dev/null
@@ -1,4 +0,0 @@
-define(function() {
-	// Match a standalone tag
-	return (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css.js
deleted file mode 100644
index d481617..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css.js
+++ /dev/null
@@ -1,450 +0,0 @@
-define([
-	"./core",
-	"./var/pnum",
-	"./core/access",
-	"./css/var/rmargin",
-	"./css/var/rnumnonpx",
-	"./css/var/cssExpand",
-	"./css/var/isHidden",
-	"./css/var/getStyles",
-	"./css/curCSS",
-	"./css/defaultDisplay",
-	"./css/addGetHookIf",
-	"./css/support",
-	"./data/var/data_priv",
-
-	"./core/init",
-	"./css/swap",
-	"./core/ready",
-	"./selector" // contains
-], function( jQuery, pnum, access, rmargin, rnumnonpx, cssExpand, isHidden,
-	getStyles, curCSS, defaultDisplay, addGetHookIf, support, data_priv ) {
-
-var
-	// Swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
-	// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
-	rdisplayswap = /^(none|table(?!-c[ea]).+)/,
-	rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
-	rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
-
-	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
-	cssNormalTransform = {
-		letterSpacing: "0",
-		fontWeight: "400"
-	},
-
-	cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
-
-// Return a css property mapped to a potentially vendor prefixed property
-function vendorPropName( style, name ) {
-
-	// Shortcut for names that are not vendor prefixed
-	if ( name in style ) {
-		return name;
-	}
-
-	// Check for vendor prefixed names
-	var capName = name[0].toUpperCase() + name.slice(1),
-		origName = name,
-		i = cssPrefixes.length;
-
-	while ( i-- ) {
-		name = cssPrefixes[ i ] + capName;
-		if ( name in style ) {
-			return name;
-		}
-	}
-
-	return origName;
-}
-
-function setPositiveNumber( elem, value, subtract ) {
-	var matches = rnumsplit.exec( value );
-	return matches ?
-		// Guard against undefined "subtract", e.g., when used as in cssHooks
-		Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
-		value;
-}
-
-function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
-	var i = extra === ( isBorderBox ? "border" : "content" ) ?
-		// If we already have the right measurement, avoid augmentation
-		4 :
-		// Otherwise initialize for horizontal or vertical properties
-		name === "width" ? 1 : 0,
-
-		val = 0;
-
-	for ( ; i < 4; i += 2 ) {
-		// Both box models exclude margin, so add it if we want it
-		if ( extra === "margin" ) {
-			val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
-		}
-
-		if ( isBorderBox ) {
-			// border-box includes padding, so remove it if we want content
-			if ( extra === "content" ) {
-				val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-			}
-
-			// At this point, extra isn't border nor margin, so remove border
-			if ( extra !== "margin" ) {
-				val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-			}
-		} else {
-			// At this point, extra isn't content, so add padding
-			val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-
-			// At this point, extra isn't content nor padding, so add border
-			if ( extra !== "padding" ) {
-				val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-			}
-		}
-	}
-
-	return val;
-}
-
-function getWidthOrHeight( elem, name, extra ) {
-
-	// Start with offset property, which is equivalent to the border-box value
-	var valueIsBorderBox = true,
-		val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
-		styles = getStyles( elem ),
-		isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
-
-	// Some non-html elements return undefined for offsetWidth, so check for null/undefined
-	// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
-	// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
-	if ( val <= 0 || val == null ) {
-		// Fall back to computed then uncomputed css if necessary
-		val = curCSS( elem, name, styles );
-		if ( val < 0 || val == null ) {
-			val = elem.style[ name ];
-		}
-
-		// Computed unit is not pixels. Stop here and return.
-		if ( rnumnonpx.test(val) ) {
-			return val;
-		}
-
-		// Check for style in case a browser which returns unreliable values
-		// for getComputedStyle silently falls back to the reliable elem.style
-		valueIsBorderBox = isBorderBox &&
-			( support.boxSizingReliable() || val === elem.style[ name ] );
-
-		// Normalize "", auto, and prepare for extra
-		val = parseFloat( val ) || 0;
-	}
-
-	// Use the active box-sizing model to add/subtract irrelevant styles
-	return ( val +
-		augmentWidthOrHeight(
-			elem,
-			name,
-			extra || ( isBorderBox ? "border" : "content" ),
-			valueIsBorderBox,
-			styles
-		)
-	) + "px";
-}
-
-function showHide( elements, show ) {
-	var display, elem, hidden,
-		values = [],
-		index = 0,
-		length = elements.length;
-
-	for ( ; index < length; index++ ) {
-		elem = elements[ index ];
-		if ( !elem.style ) {
-			continue;
-		}
-
-		values[ index ] = data_priv.get( elem, "olddisplay" );
-		display = elem.style.display;
-		if ( show ) {
-			// Reset the inline display of this element to learn if it is
-			// being hidden by cascaded rules or not
-			if ( !values[ index ] && display === "none" ) {
-				elem.style.display = "";
-			}
-
-			// Set elements which have been overridden with display: none
-			// in a stylesheet to whatever the default browser style is
-			// for such an element
-			if ( elem.style.display === "" && isHidden( elem ) ) {
-				values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
-			}
-		} else {
-			hidden = isHidden( elem );
-
-			if ( display !== "none" || !hidden ) {
-				data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
-			}
-		}
-	}
-
-	// Set the display of most of the elements in a second loop
-	// to avoid the constant reflow
-	for ( index = 0; index < length; index++ ) {
-		elem = elements[ index ];
-		if ( !elem.style ) {
-			continue;
-		}
-		if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
-			elem.style.display = show ? values[ index ] || "" : "none";
-		}
-	}
-
-	return elements;
-}
-
-jQuery.extend({
-
-	// Add in style property hooks for overriding the default
-	// behavior of getting and setting a style property
-	cssHooks: {
-		opacity: {
-			get: function( elem, computed ) {
-				if ( computed ) {
-
-					// We should always get a number back from opacity
-					var ret = curCSS( elem, "opacity" );
-					return ret === "" ? "1" : ret;
-				}
-			}
-		}
-	},
-
-	// Don't automatically add "px" to these possibly-unitless properties
-	cssNumber: {
-		"columnCount": true,
-		"fillOpacity": true,
-		"flexGrow": true,
-		"flexShrink": true,
-		"fontWeight": true,
-		"lineHeight": true,
-		"opacity": true,
-		"order": true,
-		"orphans": true,
-		"widows": true,
-		"zIndex": true,
-		"zoom": true
-	},
-
-	// Add in properties whose names you wish to fix before
-	// setting or getting the value
-	cssProps: {
-		"float": "cssFloat"
-	},
-
-	// Get and set the style property on a DOM Node
-	style: function( elem, name, value, extra ) {
-
-		// Don't set styles on text and comment nodes
-		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
-			return;
-		}
-
-		// Make sure that we're working with the right name
-		var ret, type, hooks,
-			origName = jQuery.camelCase( name ),
-			style = elem.style;
-
-		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
-
-		// Gets hook for the prefixed version, then unprefixed version
-		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
-		// Check if we're setting a value
-		if ( value !== undefined ) {
-			type = typeof value;
-
-			// Convert "+=" or "-=" to relative numbers (#7345)
-			if ( type === "string" && (ret = rrelNum.exec( value )) ) {
-				value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
-				// Fixes bug #9237
-				type = "number";
-			}
-
-			// Make sure that null and NaN values aren't set (#7116)
-			if ( value == null || value !== value ) {
-				return;
-			}
-
-			// If a number, add 'px' to the (except for certain CSS properties)
-			if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
-				value += "px";
-			}
-
-			// Support: IE9-11+
-			// background-* props affect original clone's values
-			if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
-				style[ name ] = "inherit";
-			}
-
-			// If a hook was provided, use that value, otherwise just set the specified value
-			if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
-				style[ name ] = value;
-			}
-
-		} else {
-			// If a hook was provided get the non-computed value from there
-			if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
-				return ret;
-			}
-
-			// Otherwise just get the value from the style object
-			return style[ name ];
-		}
-	},
-
-	css: function( elem, name, extra, styles ) {
-		var val, num, hooks,
-			origName = jQuery.camelCase( name );
-
-		// Make sure that we're working with the right name
-		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
-
-		// Try prefixed name followed by the unprefixed name
-		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
-		// If a hook was provided get the computed value from there
-		if ( hooks && "get" in hooks ) {
-			val = hooks.get( elem, true, extra );
-		}
-
-		// Otherwise, if a way to get the computed value exists, use that
-		if ( val === undefined ) {
-			val = curCSS( elem, name, styles );
-		}
-
-		// Convert "normal" to computed value
-		if ( val === "normal" && name in cssNormalTransform ) {
-			val = cssNormalTransform[ name ];
-		}
-
-		// Make numeric if forced or a qualifier was provided and val looks numeric
-		if ( extra === "" || extra ) {
-			num = parseFloat( val );
-			return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
-		}
-		return val;
-	}
-});
-
-jQuery.each([ "height", "width" ], function( i, name ) {
-	jQuery.cssHooks[ name ] = {
-		get: function( elem, computed, extra ) {
-			if ( computed ) {
-
-				// Certain elements can have dimension info if we invisibly show them
-				// but it must have a current display style that would benefit
-				return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
-					jQuery.swap( elem, cssShow, function() {
-						return getWidthOrHeight( elem, name, extra );
-					}) :
-					getWidthOrHeight( elem, name, extra );
-			}
-		},
-
-		set: function( elem, value, extra ) {
-			var styles = extra && getStyles( elem );
-			return setPositiveNumber( elem, value, extra ?
-				augmentWidthOrHeight(
-					elem,
-					name,
-					extra,
-					jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
-					styles
-				) : 0
-			);
-		}
-	};
-});
-
-// Support: Android 2.3
-jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
-	function( elem, computed ) {
-		if ( computed ) {
-			return jQuery.swap( elem, { "display": "inline-block" },
-				curCSS, [ elem, "marginRight" ] );
-		}
-	}
-);
-
-// These hooks are used by animate to expand properties
-jQuery.each({
-	margin: "",
-	padding: "",
-	border: "Width"
-}, function( prefix, suffix ) {
-	jQuery.cssHooks[ prefix + suffix ] = {
-		expand: function( value ) {
-			var i = 0,
-				expanded = {},
-
-				// Assumes a single number if not a string
-				parts = typeof value === "string" ? value.split(" ") : [ value ];
-
-			for ( ; i < 4; i++ ) {
-				expanded[ prefix + cssExpand[ i ] + suffix ] =
-					parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
-			}
-
-			return expanded;
-		}
-	};
-
-	if ( !rmargin.test( prefix ) ) {
-		jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
-	}
-});
-
-jQuery.fn.extend({
-	css: function( name, value ) {
-		return access( this, function( elem, name, value ) {
-			var styles, len,
-				map = {},
-				i = 0;
-
-			if ( jQuery.isArray( name ) ) {
-				styles = getStyles( elem );
-				len = name.length;
-
-				for ( ; i < len; i++ ) {
-					map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
-				}
-
-				return map;
-			}
-
-			return value !== undefined ?
-				jQuery.style( elem, name, value ) :
-				jQuery.css( elem, name );
-		}, name, value, arguments.length > 1 );
-	},
-	show: function() {
-		return showHide( this, true );
-	},
-	hide: function() {
-		return showHide( this );
-	},
-	toggle: function( state ) {
-		if ( typeof state === "boolean" ) {
-			return state ? this.show() : this.hide();
-		}
-
-		return this.each(function() {
-			if ( isHidden( this ) ) {
-				jQuery( this ).show();
-			} else {
-				jQuery( this ).hide();
-			}
-		});
-	}
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/addGetHookIf.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/addGetHookIf.js
deleted file mode 100644
index e12f359..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/addGetHookIf.js
+++ /dev/null
@@ -1,22 +0,0 @@
-define(function() {
-
-function addGetHookIf( conditionFn, hookFn ) {
-	// Define the hook, we'll check on the first run if it's really needed.
-	return {
-		get: function() {
-			if ( conditionFn() ) {
-				// Hook not needed (or it's not possible to use it due
-				// to missing dependency), remove it.
-				delete this.get;
-				return;
-			}
-
-			// Hook needed; redefine it so that the support test is not executed again.
-			return (this.get = hookFn).apply( this, arguments );
-		}
-	};
-}
-
-return addGetHookIf;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/curCSS.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/curCSS.js
deleted file mode 100644
index 90e508c..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/curCSS.js
+++ /dev/null
@@ -1,57 +0,0 @@
-define([
-	"../core",
-	"./var/rnumnonpx",
-	"./var/rmargin",
-	"./var/getStyles",
-	"../selector" // contains
-], function( jQuery, rnumnonpx, rmargin, getStyles ) {
-
-function curCSS( elem, name, computed ) {
-	var width, minWidth, maxWidth, ret,
-		style = elem.style;
-
-	computed = computed || getStyles( elem );
-
-	// Support: IE9
-	// getPropertyValue is only needed for .css('filter') (#12537)
-	if ( computed ) {
-		ret = computed.getPropertyValue( name ) || computed[ name ];
-	}
-
-	if ( computed ) {
-
-		if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
-			ret = jQuery.style( elem, name );
-		}
-
-		// Support: iOS < 6
-		// A tribute to the "awesome hack by Dean Edwards"
-		// iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
-		// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
-		if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
-
-			// Remember the original values
-			width = style.width;
-			minWidth = style.minWidth;
-			maxWidth = style.maxWidth;
-
-			// Put in the new values to get a computed value out
-			style.minWidth = style.maxWidth = style.width = ret;
-			ret = computed.width;
-
-			// Revert the changed values
-			style.width = width;
-			style.minWidth = minWidth;
-			style.maxWidth = maxWidth;
-		}
-	}
-
-	return ret !== undefined ?
-		// Support: IE
-		// IE returns zIndex value as an integer.
-		ret + "" :
-		ret;
-}
-
-return curCSS;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/defaultDisplay.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/defaultDisplay.js
deleted file mode 100644
index 046ae91..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/defaultDisplay.js
+++ /dev/null
@@ -1,70 +0,0 @@
-define([
-	"../core",
-	"../manipulation" // appendTo
-], function( jQuery ) {
-
-var iframe,
-	elemdisplay = {};
-
-/**
- * Retrieve the actual display of a element
- * @param {String} name nodeName of the element
- * @param {Object} doc Document object
- */
-// Called only from within defaultDisplay
-function actualDisplay( name, doc ) {
-	var style,
-		elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
-
-		// getDefaultComputedStyle might be reliably used only on attached element
-		display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
-
-			// Use of this method is a temporary fix (more like optimization) until something better comes along,
-			// since it was removed from specification and supported only in FF
-			style.display : jQuery.css( elem[ 0 ], "display" );
-
-	// We don't have any data stored on the element,
-	// so use "detach" method as fast way to get rid of the element
-	elem.detach();
-
-	return display;
-}
-
-/**
- * Try to determine the default display value of an element
- * @param {String} nodeName
- */
-function defaultDisplay( nodeName ) {
-	var doc = document,
-		display = elemdisplay[ nodeName ];
-
-	if ( !display ) {
-		display = actualDisplay( nodeName, doc );
-
-		// If the simple way fails, read from inside an iframe
-		if ( display === "none" || !display ) {
-
-			// Use the already-created iframe if possible
-			iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
-
-			// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
-			doc = iframe[ 0 ].contentDocument;
-
-			// Support: IE
-			doc.write();
-			doc.close();
-
-			display = actualDisplay( nodeName, doc );
-			iframe.detach();
-		}
-
-		// Store the correct default display
-		elemdisplay[ nodeName ] = display;
-	}
-
-	return display;
-}
-
-return defaultDisplay;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/hiddenVisibleSelectors.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/hiddenVisibleSelectors.js
deleted file mode 100644
index c7f1c7e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/hiddenVisibleSelectors.js
+++ /dev/null
@@ -1,15 +0,0 @@
-define([
-	"../core",
-	"../selector"
-], function( jQuery ) {
-
-jQuery.expr.filters.hidden = function( elem ) {
-	// Support: Opera <= 12.12
-	// Opera reports offsetWidths and offsetHeights less than zero on some elements
-	return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
-};
-jQuery.expr.filters.visible = function( elem ) {
-	return !jQuery.expr.filters.hidden( elem );
-};
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/support.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/support.js
deleted file mode 100644
index b9eaf14..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/support.js
+++ /dev/null
@@ -1,96 +0,0 @@
-define([
-	"../core",
-	"../var/support"
-], function( jQuery, support ) {
-
-(function() {
-	var pixelPositionVal, boxSizingReliableVal,
-		docElem = document.documentElement,
-		container = document.createElement( "div" ),
-		div = document.createElement( "div" );
-
-	if ( !div.style ) {
-		return;
-	}
-
-	// Support: IE9-11+
-	// Style of cloned element affects source element cloned (#8908)
-	div.style.backgroundClip = "content-box";
-	div.cloneNode( true ).style.backgroundClip = "";
-	support.clearCloneStyle = div.style.backgroundClip === "content-box";
-
-	container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
-		"position:absolute";
-	container.appendChild( div );
-
-	// Executing both pixelPosition & boxSizingReliable tests require only one layout
-	// so they're executed at the same time to save the second computation.
-	function computePixelPositionAndBoxSizingReliable() {
-		div.style.cssText =
-			// Support: Firefox<29, Android 2.3
-			// Vendor-prefix box-sizing
-			"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
-			"box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
-			"border:1px;padding:1px;width:4px;position:absolute";
-		div.innerHTML = "";
-		docElem.appendChild( container );
-
-		var divStyle = window.getComputedStyle( div, null );
-		pixelPositionVal = divStyle.top !== "1%";
-		boxSizingReliableVal = divStyle.width === "4px";
-
-		docElem.removeChild( container );
-	}
-
-	// Support: node.js jsdom
-	// Don't assume that getComputedStyle is a property of the global object
-	if ( window.getComputedStyle ) {
-		jQuery.extend( support, {
-			pixelPosition: function() {
-
-				// This test is executed only once but we still do memoizing
-				// since we can use the boxSizingReliable pre-computing.
-				// No need to check if the test was already performed, though.
-				computePixelPositionAndBoxSizingReliable();
-				return pixelPositionVal;
-			},
-			boxSizingReliable: function() {
-				if ( boxSizingReliableVal == null ) {
-					computePixelPositionAndBoxSizingReliable();
-				}
-				return boxSizingReliableVal;
-			},
-			reliableMarginRight: function() {
-
-				// Support: Android 2.3
-				// Check if div with explicit width and no margin-right incorrectly
-				// gets computed margin-right based on width of container. (#3333)
-				// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-				// This support function is only executed once so no memoizing is needed.
-				var ret,
-					marginDiv = div.appendChild( document.createElement( "div" ) );
-
-				// Reset CSS: box-sizing; display; margin; border; padding
-				marginDiv.style.cssText = div.style.cssText =
-					// Support: Firefox<29, Android 2.3
-					// Vendor-prefix box-sizing
-					"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
-					"box-sizing:content-box;display:block;margin:0;border:0;padding:0";
-				marginDiv.style.marginRight = marginDiv.style.width = "0";
-				div.style.width = "1px";
-				docElem.appendChild( container );
-
-				ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
-
-				docElem.removeChild( container );
-				div.removeChild( marginDiv );
-
-				return ret;
-			}
-		});
-	}
-})();
-
-return support;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/swap.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/swap.js
deleted file mode 100644
index ce16435..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/swap.js
+++ /dev/null
@@ -1,28 +0,0 @@
-define([
-	"../core"
-], function( jQuery ) {
-
-// A method for quickly swapping in/out CSS properties to get correct calculations.
-jQuery.swap = function( elem, options, callback, args ) {
-	var ret, name,
-		old = {};
-
-	// Remember the old values, and insert the new ones
-	for ( name in options ) {
-		old[ name ] = elem.style[ name ];
-		elem.style[ name ] = options[ name ];
-	}
-
-	ret = callback.apply( elem, args || [] );
-
-	// Revert the old values
-	for ( name in options ) {
-		elem.style[ name ] = old[ name ];
-	}
-
-	return ret;
-};
-
-return jQuery.swap;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/cssExpand.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/cssExpand.js
deleted file mode 100644
index 91e90a8..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/cssExpand.js
+++ /dev/null
@@ -1,3 +0,0 @@
-define(function() {
-	return [ "Top", "Right", "Bottom", "Left" ];
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/getStyles.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/getStyles.js
deleted file mode 100644
index 413acd0..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/getStyles.js
+++ /dev/null
@@ -1,12 +0,0 @@
-define(function() {
-	return function( elem ) {
-		// Support: IE<=11+, Firefox<=30+ (#15098, #14150)
-		// IE throws on elements created in popups
-		// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
-		if ( elem.ownerDocument.defaultView.opener ) {
-			return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
-		}
-
-		return window.getComputedStyle( elem, null );
-	};
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/isHidden.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/isHidden.js
deleted file mode 100644
index 15ab81a..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/isHidden.js
+++ /dev/null
@@ -1,13 +0,0 @@
-define([
-	"../../core",
-	"../../selector"
-	// css is assumed
-], function( jQuery ) {
-
-	return function( elem, el ) {
-		// isHidden might be called from jQuery#filter function;
-		// in that case, element will be second argument
-		elem = el || elem;
-		return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
-	};
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/rmargin.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/rmargin.js
deleted file mode 100644
index da0438d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/rmargin.js
+++ /dev/null
@@ -1,3 +0,0 @@
-define(function() {
-	return (/^margin/);
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/rnumnonpx.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/rnumnonpx.js
deleted file mode 100644
index c93be28..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/css/var/rnumnonpx.js
+++ /dev/null
@@ -1,5 +0,0 @@
-define([
-	"../../var/pnum"
-], function( pnum ) {
-	return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data.js
deleted file mode 100644
index f9af9ae..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data.js
+++ /dev/null
@@ -1,178 +0,0 @@
-define([
-	"./core",
-	"./var/rnotwhite",
-	"./core/access",
-	"./data/var/data_priv",
-	"./data/var/data_user"
-], function( jQuery, rnotwhite, access, data_priv, data_user ) {
-
-//	Implementation Summary
-//
-//	1. Enforce API surface and semantic compatibility with 1.9.x branch
-//	2. Improve the module's maintainability by reducing the storage
-//		paths to a single mechanism.
-//	3. Use the same single mechanism to support "private" and "user" data.
-//	4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
-//	5. Avoid exposing implementation details on user objects (eg. expando properties)
-//	6. Provide a clear path for implementation upgrade to WeakMap in 2014
-
-var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
-	rmultiDash = /([A-Z])/g;
-
-function dataAttr( elem, key, data ) {
-	var name;
-
-	// If nothing was found internally, try to fetch any
-	// data from the HTML5 data-* attribute
-	if ( data === undefined && elem.nodeType === 1 ) {
-		name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-		data = elem.getAttribute( name );
-
-		if ( typeof data === "string" ) {
-			try {
-				data = data === "true" ? true :
-					data === "false" ? false :
-					data === "null" ? null :
-					// Only convert to a number if it doesn't change the string
-					+data + "" === data ? +data :
-					rbrace.test( data ) ? jQuery.parseJSON( data ) :
-					data;
-			} catch( e ) {}
-
-			// Make sure we set the data so it isn't changed later
-			data_user.set( elem, key, data );
-		} else {
-			data = undefined;
-		}
-	}
-	return data;
-}
-
-jQuery.extend({
-	hasData: function( elem ) {
-		return data_user.hasData( elem ) || data_priv.hasData( elem );
-	},
-
-	data: function( elem, name, data ) {
-		return data_user.access( elem, name, data );
-	},
-
-	removeData: function( elem, name ) {
-		data_user.remove( elem, name );
-	},
-
-	// TODO: Now that all calls to _data and _removeData have been replaced
-	// with direct calls to data_priv methods, these can be deprecated.
-	_data: function( elem, name, data ) {
-		return data_priv.access( elem, name, data );
-	},
-
-	_removeData: function( elem, name ) {
-		data_priv.remove( elem, name );
-	}
-});
-
-jQuery.fn.extend({
-	data: function( key, value ) {
-		var i, name, data,
-			elem = this[ 0 ],
-			attrs = elem && elem.attributes;
-
-		// Gets all values
-		if ( key === undefined ) {
-			if ( this.length ) {
-				data = data_user.get( elem );
-
-				if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
-					i = attrs.length;
-					while ( i-- ) {
-
-						// Support: IE11+
-						// The attrs elements can be null (#14894)
-						if ( attrs[ i ] ) {
-							name = attrs[ i ].name;
-							if ( name.indexOf( "data-" ) === 0 ) {
-								name = jQuery.camelCase( name.slice(5) );
-								dataAttr( elem, name, data[ name ] );
-							}
-						}
-					}
-					data_priv.set( elem, "hasDataAttrs", true );
-				}
-			}
-
-			return data;
-		}
-
-		// Sets multiple values
-		if ( typeof key === "object" ) {
-			return this.each(function() {
-				data_user.set( this, key );
-			});
-		}
-
-		return access( this, function( value ) {
-			var data,
-				camelKey = jQuery.camelCase( key );
-
-			// The calling jQuery object (element matches) is not empty
-			// (and therefore has an element appears at this[ 0 ]) and the
-			// `value` parameter was not undefined. An empty jQuery object
-			// will result in `undefined` for elem = this[ 0 ] which will
-			// throw an exception if an attempt to read a data cache is made.
-			if ( elem && value === undefined ) {
-				// Attempt to get data from the cache
-				// with the key as-is
-				data = data_user.get( elem, key );
-				if ( data !== undefined ) {
-					return data;
-				}
-
-				// Attempt to get data from the cache
-				// with the key camelized
-				data = data_user.get( elem, camelKey );
-				if ( data !== undefined ) {
-					return data;
-				}
-
-				// Attempt to "discover" the data in
-				// HTML5 custom data-* attrs
-				data = dataAttr( elem, camelKey, undefined );
-				if ( data !== undefined ) {
-					return data;
-				}
-
-				// We tried really hard, but the data doesn't exist.
-				return;
-			}
-
-			// Set the data...
-			this.each(function() {
-				// First, attempt to store a copy or reference of any
-				// data that might've been store with a camelCased key.
-				var data = data_user.get( this, camelKey );
-
-				// For HTML5 data-* attribute interop, we have to
-				// store property names with dashes in a camelCase form.
-				// This might not apply to all properties...*
-				data_user.set( this, camelKey, value );
-
-				// *... In the case of properties that might _actually_
-				// have dashes, we need to also store a copy of that
-				// unchanged property.
-				if ( key.indexOf("-") !== -1 && data !== undefined ) {
-					data_user.set( this, key, value );
-				}
-			});
-		}, null, value, arguments.length > 1, null, true );
-	},
-
-	removeData: function( key ) {
-		return this.each(function() {
-			data_user.remove( this, key );
-		});
-	}
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/Data.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/Data.js
deleted file mode 100644
index 85afd64..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/Data.js
+++ /dev/null
@@ -1,181 +0,0 @@
-define([
-	"../core",
-	"../var/rnotwhite",
-	"./accepts"
-], function( jQuery, rnotwhite ) {
-
-function Data() {
-	// Support: Android<4,
-	// Old WebKit does not have Object.preventExtensions/freeze method,
-	// return new empty object instead with no [[set]] accessor
-	Object.defineProperty( this.cache = {}, 0, {
-		get: function() {
-			return {};
-		}
-	});
-
-	this.expando = jQuery.expando + Data.uid++;
-}
-
-Data.uid = 1;
-Data.accepts = jQuery.acceptData;
-
-Data.prototype = {
-	key: function( owner ) {
-		// We can accept data for non-element nodes in modern browsers,
-		// but we should not, see #8335.
-		// Always return the key for a frozen object.
-		if ( !Data.accepts( owner ) ) {
-			return 0;
-		}
-
-		var descriptor = {},
-			// Check if the owner object already has a cache key
-			unlock = owner[ this.expando ];
-
-		// If not, create one
-		if ( !unlock ) {
-			unlock = Data.uid++;
-
-			// Secure it in a non-enumerable, non-writable property
-			try {
-				descriptor[ this.expando ] = { value: unlock };
-				Object.defineProperties( owner, descriptor );
-
-			// Support: Android<4
-			// Fallback to a less secure definition
-			} catch ( e ) {
-				descriptor[ this.expando ] = unlock;
-				jQuery.extend( owner, descriptor );
-			}
-		}
-
-		// Ensure the cache object
-		if ( !this.cache[ unlock ] ) {
-			this.cache[ unlock ] = {};
-		}
-
-		return unlock;
-	},
-	set: function( owner, data, value ) {
-		var prop,
-			// There may be an unlock assigned to this node,
-			// if there is no entry for this "owner", create one inline
-			// and set the unlock as though an owner entry had always existed
-			unlock = this.key( owner ),
-			cache = this.cache[ unlock ];
-
-		// Handle: [ owner, key, value ] args
-		if ( typeof data === "string" ) {
-			cache[ data ] = value;
-
-		// Handle: [ owner, { properties } ] args
-		} else {
-			// Fresh assignments by object are shallow copied
-			if ( jQuery.isEmptyObject( cache ) ) {
-				jQuery.extend( this.cache[ unlock ], data );
-			// Otherwise, copy the properties one-by-one to the cache object
-			} else {
-				for ( prop in data ) {
-					cache[ prop ] = data[ prop ];
-				}
-			}
-		}
-		return cache;
-	},
-	get: function( owner, key ) {
-		// Either a valid cache is found, or will be created.
-		// New caches will be created and the unlock returned,
-		// allowing direct access to the newly created
-		// empty data object. A valid owner object must be provided.
-		var cache = this.cache[ this.key( owner ) ];
-
-		return key === undefined ?
-			cache : cache[ key ];
-	},
-	access: function( owner, key, value ) {
-		var stored;
-		// In cases where either:
-		//
-		//   1. No key was specified
-		//   2. A string key was specified, but no value provided
-		//
-		// Take the "read" path and allow the get method to determine
-		// which value to return, respectively either:
-		//
-		//   1. The entire cache object
-		//   2. The data stored at the key
-		//
-		if ( key === undefined ||
-				((key && typeof key === "string") && value === undefined) ) {
-
-			stored = this.get( owner, key );
-
-			return stored !== undefined ?
-				stored : this.get( owner, jQuery.camelCase(key) );
-		}
-
-		// [*]When the key is not a string, or both a key and value
-		// are specified, set or extend (existing objects) with either:
-		//
-		//   1. An object of properties
-		//   2. A key and value
-		//
-		this.set( owner, key, value );
-
-		// Since the "set" path can have two possible entry points
-		// return the expected data based on which path was taken[*]
-		return value !== undefined ? value : key;
-	},
-	remove: function( owner, key ) {
-		var i, name, camel,
-			unlock = this.key( owner ),
-			cache = this.cache[ unlock ];
-
-		if ( key === undefined ) {
-			this.cache[ unlock ] = {};
-
-		} else {
-			// Support array or space separated string of keys
-			if ( jQuery.isArray( key ) ) {
-				// If "name" is an array of keys...
-				// When data is initially created, via ("key", "val") signature,
-				// keys will be converted to camelCase.
-				// Since there is no way to tell _how_ a key was added, remove
-				// both plain key and camelCase key. #12786
-				// This will only penalize the array argument path.
-				name = key.concat( key.map( jQuery.camelCase ) );
-			} else {
-				camel = jQuery.camelCase( key );
-				// Try the string as a key before any manipulation
-				if ( key in cache ) {
-					name = [ key, camel ];
-				} else {
-					// If a key with the spaces exists, use it.
-					// Otherwise, create an array by matching non-whitespace
-					name = camel;
-					name = name in cache ?
-						[ name ] : ( name.match( rnotwhite ) || [] );
-				}
-			}
-
-			i = name.length;
-			while ( i-- ) {
-				delete cache[ name[ i ] ];
-			}
-		}
-	},
-	hasData: function( owner ) {
-		return !jQuery.isEmptyObject(
-			this.cache[ owner[ this.expando ] ] || {}
-		);
-	},
-	discard: function( owner ) {
-		if ( owner[ this.expando ] ) {
-			delete this.cache[ owner[ this.expando ] ];
-		}
-	}
-};
-
-return Data;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/accepts.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/accepts.js
deleted file mode 100644
index 291c7b4..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/accepts.js
+++ /dev/null
@@ -1,20 +0,0 @@
-define([
-	"../core"
-], function( jQuery ) {
-
-/**
- * Determines whether an object can have data
- */
-jQuery.acceptData = function( owner ) {
-	// Accepts only:
-	//  - Node
-	//    - Node.ELEMENT_NODE
-	//    - Node.DOCUMENT_NODE
-	//  - Object
-	//    - Any
-	/* jshint -W018 */
-	return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
-};
-
-return jQuery.acceptData;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/var/data_priv.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/var/data_priv.js
deleted file mode 100644
index 24399e4..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/var/data_priv.js
+++ /dev/null
@@ -1,5 +0,0 @@
-define([
-	"../Data"
-], function( Data ) {
-	return new Data();
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/var/data_user.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/var/data_user.js
deleted file mode 100644
index 24399e4..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/data/var/data_user.js
+++ /dev/null
@@ -1,5 +0,0 @@
-define([
-	"../Data"
-], function( Data ) {
-	return new Data();
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/deferred.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/deferred.js
deleted file mode 100644
index 98f9c31..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/deferred.js
+++ /dev/null
@@ -1,149 +0,0 @@
-define([
-	"./core",
-	"./var/slice",
-	"./callbacks"
-], function( jQuery, slice ) {
-
-jQuery.extend({
-
-	Deferred: function( func ) {
-		var tuples = [
-				// action, add listener, listener list, final state
-				[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
-				[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
-				[ "notify", "progress", jQuery.Callbacks("memory") ]
-			],
-			state = "pending",
-			promise = {
-				state: function() {
-					return state;
-				},
-				always: function() {
-					deferred.done( arguments ).fail( arguments );
-					return this;
-				},
-				then: function( /* fnDone, fnFail, fnProgress */ ) {
-					var fns = arguments;
-					return jQuery.Deferred(function( newDefer ) {
-						jQuery.each( tuples, function( i, tuple ) {
-							var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
-							// deferred[ done | fail | progress ] for forwarding actions to newDefer
-							deferred[ tuple[1] ](function() {
-								var returned = fn && fn.apply( this, arguments );
-								if ( returned && jQuery.isFunction( returned.promise ) ) {
-									returned.promise()
-										.done( newDefer.resolve )
-										.fail( newDefer.reject )
-										.progress( newDefer.notify );
-								} else {
-									newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
-								}
-							});
-						});
-						fns = null;
-					}).promise();
-				},
-				// Get a promise for this deferred
-				// If obj is provided, the promise aspect is added to the object
-				promise: function( obj ) {
-					return obj != null ? jQuery.extend( obj, promise ) : promise;
-				}
-			},
-			deferred = {};
-
-		// Keep pipe for back-compat
-		promise.pipe = promise.then;
-
-		// Add list-specific methods
-		jQuery.each( tuples, function( i, tuple ) {
-			var list = tuple[ 2 ],
-				stateString = tuple[ 3 ];
-
-			// promise[ done | fail | progress ] = list.add
-			promise[ tuple[1] ] = list.add;
-
-			// Handle state
-			if ( stateString ) {
-				list.add(function() {
-					// state = [ resolved | rejected ]
-					state = stateString;
-
-				// [ reject_list | resolve_list ].disable; progress_list.lock
-				}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
-			}
-
-			// deferred[ resolve | reject | notify ]
-			deferred[ tuple[0] ] = function() {
-				deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
-				return this;
-			};
-			deferred[ tuple[0] + "With" ] = list.fireWith;
-		});
-
-		// Make the deferred a promise
-		promise.promise( deferred );
-
-		// Call given func if any
-		if ( func ) {
-			func.call( deferred, deferred );
-		}
-
-		// All done!
-		return deferred;
-	},
-
-	// Deferred helper
-	when: function( subordinate /* , ..., subordinateN */ ) {
-		var i = 0,
-			resolveValues = slice.call( arguments ),
-			length = resolveValues.length,
-
-			// the count of uncompleted subordinates
-			remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
-
-			// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
-			deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
-
-			// Update function for both resolve and progress values
-			updateFunc = function( i, contexts, values ) {
-				return function( value ) {
-					contexts[ i ] = this;
-					values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
-					if ( values === progressValues ) {
-						deferred.notifyWith( contexts, values );
-					} else if ( !( --remaining ) ) {
-						deferred.resolveWith( contexts, values );
-					}
-				};
-			},
-
-			progressValues, progressContexts, resolveContexts;
-
-		// Add listeners to Deferred subordinates; treat others as resolved
-		if ( length > 1 ) {
-			progressValues = new Array( length );
-			progressContexts = new Array( length );
-			resolveContexts = new Array( length );
-			for ( ; i < length; i++ ) {
-				if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
-					resolveValues[ i ].promise()
-						.done( updateFunc( i, resolveContexts, resolveValues ) )
-						.fail( deferred.reject )
-						.progress( updateFunc( i, progressContexts, progressValues ) );
-				} else {
-					--remaining;
-				}
-			}
-		}
-
-		// If we're not waiting on anything, resolve the master
-		if ( !remaining ) {
-			deferred.resolveWith( resolveContexts, resolveValues );
-		}
-
-		return deferred.promise();
-	}
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/deprecated.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/deprecated.js
deleted file mode 100644
index 1b068bc..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/deprecated.js
+++ /dev/null
@@ -1,13 +0,0 @@
-define([
-	"./core",
-	"./traversing"
-], function( jQuery ) {
-
-// The number of elements contained in the matched element set
-jQuery.fn.size = function() {
-	return this.length;
-};
-
-jQuery.fn.andSelf = jQuery.fn.addBack;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/dimensions.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/dimensions.js
deleted file mode 100644
index e6cb04c..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/dimensions.js
+++ /dev/null
@@ -1,50 +0,0 @@
-define([
-	"./core",
-	"./core/access",
-	"./css"
-], function( jQuery, access ) {
-
-// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
-	jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
-		// Margin is only for outerHeight, outerWidth
-		jQuery.fn[ funcName ] = function( margin, value ) {
-			var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
-				extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
-
-			return access( this, function( elem, type, value ) {
-				var doc;
-
-				if ( jQuery.isWindow( elem ) ) {
-					// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
-					// isn't a whole lot we can do. See pull request at this URL for discussion:
-					// https://github.com/jquery/jquery/pull/764
-					return elem.document.documentElement[ "client" + name ];
-				}
-
-				// Get document width or height
-				if ( elem.nodeType === 9 ) {
-					doc = elem.documentElement;
-
-					// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
-					// whichever is greatest
-					return Math.max(
-						elem.body[ "scroll" + name ], doc[ "scroll" + name ],
-						elem.body[ "offset" + name ], doc[ "offset" + name ],
-						doc[ "client" + name ]
-					);
-				}
-
-				return value === undefined ?
-					// Get width or height on the element, requesting but not forcing parseFloat
-					jQuery.css( elem, type, extra ) :
-
-					// Set width or height on the element
-					jQuery.style( elem, type, value, extra );
-			}, type, chainable ? margin : undefined, chainable, null );
-		};
-	});
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/effects.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/effects.js
deleted file mode 100644
index 90226bd..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/effects.js
+++ /dev/null
@@ -1,648 +0,0 @@
-define([
-	"./core",
-	"./var/pnum",
-	"./css/var/cssExpand",
-	"./css/var/isHidden",
-	"./css/defaultDisplay",
-	"./data/var/data_priv",
-
-	"./core/init",
-	"./effects/Tween",
-	"./queue",
-	"./css",
-	"./deferred",
-	"./traversing"
-], function( jQuery, pnum, cssExpand, isHidden, defaultDisplay, data_priv ) {
-
-var
-	fxNow, timerId,
-	rfxtypes = /^(?:toggle|show|hide)$/,
-	rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
-	rrun = /queueHooks$/,
-	animationPrefilters = [ defaultPrefilter ],
-	tweeners = {
-		"*": [ function( prop, value ) {
-			var tween = this.createTween( prop, value ),
-				target = tween.cur(),
-				parts = rfxnum.exec( value ),
-				unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
-
-				// Starting value computation is required for potential unit mismatches
-				start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
-					rfxnum.exec( jQuery.css( tween.elem, prop ) ),
-				scale = 1,
-				maxIterations = 20;
-
-			if ( start && start[ 3 ] !== unit ) {
-				// Trust units reported by jQuery.css
-				unit = unit || start[ 3 ];
-
-				// Make sure we update the tween properties later on
-				parts = parts || [];
-
-				// Iteratively approximate from a nonzero starting point
-				start = +target || 1;
-
-				do {
-					// If previous iteration zeroed out, double until we get *something*.
-					// Use string for doubling so we don't accidentally see scale as unchanged below
-					scale = scale || ".5";
-
-					// Adjust and apply
-					start = start / scale;
-					jQuery.style( tween.elem, prop, start + unit );
-
-				// Update scale, tolerating zero or NaN from tween.cur(),
-				// break the loop if scale is unchanged or perfect, or if we've just had enough
-				} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
-			}
-
-			// Update tween properties
-			if ( parts ) {
-				start = tween.start = +start || +target || 0;
-				tween.unit = unit;
-				// If a +=/-= token was provided, we're doing a relative animation
-				tween.end = parts[ 1 ] ?
-					start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
-					+parts[ 2 ];
-			}
-
-			return tween;
-		} ]
-	};
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
-	setTimeout(function() {
-		fxNow = undefined;
-	});
-	return ( fxNow = jQuery.now() );
-}
-
-// Generate parameters to create a standard animation
-function genFx( type, includeWidth ) {
-	var which,
-		i = 0,
-		attrs = { height: type };
-
-	// If we include width, step value is 1 to do all cssExpand values,
-	// otherwise step value is 2 to skip over Left and Right
-	includeWidth = includeWidth ? 1 : 0;
-	for ( ; i < 4 ; i += 2 - includeWidth ) {
-		which = cssExpand[ i ];
-		attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
-	}
-
-	if ( includeWidth ) {
-		attrs.opacity = attrs.width = type;
-	}
-
-	return attrs;
-}
-
-function createTween( value, prop, animation ) {
-	var tween,
-		collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
-		index = 0,
-		length = collection.length;
-	for ( ; index < length; index++ ) {
-		if ( (tween = collection[ index ].call( animation, prop, value )) ) {
-
-			// We're done with this property
-			return tween;
-		}
-	}
-}
-
-function defaultPrefilter( elem, props, opts ) {
-	/* jshint validthis: true */
-	var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
-		anim = this,
-		orig = {},
-		style = elem.style,
-		hidden = elem.nodeType && isHidden( elem ),
-		dataShow = data_priv.get( elem, "fxshow" );
-
-	// Handle queue: false promises
-	if ( !opts.queue ) {
-		hooks = jQuery._queueHooks( elem, "fx" );
-		if ( hooks.unqueued == null ) {
-			hooks.unqueued = 0;
-			oldfire = hooks.empty.fire;
-			hooks.empty.fire = function() {
-				if ( !hooks.unqueued ) {
-					oldfire();
-				}
-			};
-		}
-		hooks.unqueued++;
-
-		anim.always(function() {
-			// Ensure the complete handler is called before this completes
-			anim.always(function() {
-				hooks.unqueued--;
-				if ( !jQuery.queue( elem, "fx" ).length ) {
-					hooks.empty.fire();
-				}
-			});
-		});
-	}
-
-	// Height/width overflow pass
-	if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
-		// Make sure that nothing sneaks out
-		// Record all 3 overflow attributes because IE9-10 do not
-		// change the overflow attribute when overflowX and
-		// overflowY are set to the same value
-		opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
-
-		// Set display property to inline-block for height/width
-		// animations on inline elements that are having width/height animated
-		display = jQuery.css( elem, "display" );
-
-		// Test default display if display is currently "none"
-		checkDisplay = display === "none" ?
-			data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
-
-		if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
-			style.display = "inline-block";
-		}
-	}
-
-	if ( opts.overflow ) {
-		style.overflow = "hidden";
-		anim.always(function() {
-			style.overflow = opts.overflow[ 0 ];
-			style.overflowX = opts.overflow[ 1 ];
-			style.overflowY = opts.overflow[ 2 ];
-		});
-	}
-
-	// show/hide pass
-	for ( prop in props ) {
-		value = props[ prop ];
-		if ( rfxtypes.exec( value ) ) {
-			delete props[ prop ];
-			toggle = toggle || value === "toggle";
-			if ( value === ( hidden ? "hide" : "show" ) ) {
-
-				// If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
-				if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
-					hidden = true;
-				} else {
-					continue;
-				}
-			}
-			orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
-
-		// Any non-fx value stops us from restoring the original display value
-		} else {
-			display = undefined;
-		}
-	}
-
-	if ( !jQuery.isEmptyObject( orig ) ) {
-		if ( dataShow ) {
-			if ( "hidden" in dataShow ) {
-				hidden = dataShow.hidden;
-			}
-		} else {
-			dataShow = data_priv.access( elem, "fxshow", {} );
-		}
-
-		// Store state if its toggle - enables .stop().toggle() to "reverse"
-		if ( toggle ) {
-			dataShow.hidden = !hidden;
-		}
-		if ( hidden ) {
-			jQuery( elem ).show();
-		} else {
-			anim.done(function() {
-				jQuery( elem ).hide();
-			});
-		}
-		anim.done(function() {
-			var prop;
-
-			data_priv.remove( elem, "fxshow" );
-			for ( prop in orig ) {
-				jQuery.style( elem, prop, orig[ prop ] );
-			}
-		});
-		for ( prop in orig ) {
-			tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
-
-			if ( !( prop in dataShow ) ) {
-				dataShow[ prop ] = tween.start;
-				if ( hidden ) {
-					tween.end = tween.start;
-					tween.start = prop === "width" || prop === "height" ? 1 : 0;
-				}
-			}
-		}
-
-	// If this is a noop like .hide().hide(), restore an overwritten display value
-	} else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
-		style.display = display;
-	}
-}
-
-function propFilter( props, specialEasing ) {
-	var index, name, easing, value, hooks;
-
-	// camelCase, specialEasing and expand cssHook pass
-	for ( index in props ) {
-		name = jQuery.camelCase( index );
-		easing = specialEasing[ name ];
-		value = props[ index ];
-		if ( jQuery.isArray( value ) ) {
-			easing = value[ 1 ];
-			value = props[ index ] = value[ 0 ];
-		}
-
-		if ( index !== name ) {
-			props[ name ] = value;
-			delete props[ index ];
-		}
-
-		hooks = jQuery.cssHooks[ name ];
-		if ( hooks && "expand" in hooks ) {
-			value = hooks.expand( value );
-			delete props[ name ];
-
-			// Not quite $.extend, this won't overwrite existing keys.
-			// Reusing 'index' because we have the correct "name"
-			for ( index in value ) {
-				if ( !( index in props ) ) {
-					props[ index ] = value[ index ];
-					specialEasing[ index ] = easing;
-				}
-			}
-		} else {
-			specialEasing[ name ] = easing;
-		}
-	}
-}
-
-function Animation( elem, properties, options ) {
-	var result,
-		stopped,
-		index = 0,
-		length = animationPrefilters.length,
-		deferred = jQuery.Deferred().always( function() {
-			// Don't match elem in the :animated selector
-			delete tick.elem;
-		}),
-		tick = function() {
-			if ( stopped ) {
-				return false;
-			}
-			var currentTime = fxNow || createFxNow(),
-				remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
-				// Support: Android 2.3
-				// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
-				temp = remaining / animation.duration || 0,
-				percent = 1 - temp,
-				index = 0,
-				length = animation.tweens.length;
-
-			for ( ; index < length ; index++ ) {
-				animation.tweens[ index ].run( percent );
-			}
-
-			deferred.notifyWith( elem, [ animation, percent, remaining ]);
-
-			if ( percent < 1 && length ) {
-				return remaining;
-			} else {
-				deferred.resolveWith( elem, [ animation ] );
-				return false;
-			}
-		},
-		animation = deferred.promise({
-			elem: elem,
-			props: jQuery.extend( {}, properties ),
-			opts: jQuery.extend( true, { specialEasing: {} }, options ),
-			originalProperties: properties,
-			originalOptions: options,
-			startTime: fxNow || createFxNow(),
-			duration: options.duration,
-			tweens: [],
-			createTween: function( prop, end ) {
-				var tween = jQuery.Tween( elem, animation.opts, prop, end,
-						animation.opts.specialEasing[ prop ] || animation.opts.easing );
-				animation.tweens.push( tween );
-				return tween;
-			},
-			stop: function( gotoEnd ) {
-				var index = 0,
-					// If we are going to the end, we want to run all the tweens
-					// otherwise we skip this part
-					length = gotoEnd ? animation.tweens.length : 0;
-				if ( stopped ) {
-					return this;
-				}
-				stopped = true;
-				for ( ; index < length ; index++ ) {
-					animation.tweens[ index ].run( 1 );
-				}
-
-				// Resolve when we played the last frame; otherwise, reject
-				if ( gotoEnd ) {
-					deferred.resolveWith( elem, [ animation, gotoEnd ] );
-				} else {
-					deferred.rejectWith( elem, [ animation, gotoEnd ] );
-				}
-				return this;
-			}
-		}),
-		props = animation.props;
-
-	propFilter( props, animation.opts.specialEasing );
-
-	for ( ; index < length ; index++ ) {
-		result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
-		if ( result ) {
-			return result;
-		}
-	}
-
-	jQuery.map( props, createTween, animation );
-
-	if ( jQuery.isFunction( animation.opts.start ) ) {
-		animation.opts.start.call( elem, animation );
-	}
-
-	jQuery.fx.timer(
-		jQuery.extend( tick, {
-			elem: elem,
-			anim: animation,
-			queue: animation.opts.queue
-		})
-	);
-
-	// attach callbacks from options
-	return animation.progress( animation.opts.progress )
-		.done( animation.opts.done, animation.opts.complete )
-		.fail( animation.opts.fail )
-		.always( animation.opts.always );
-}
-
-jQuery.Animation = jQuery.extend( Animation, {
-
-	tweener: function( props, callback ) {
-		if ( jQuery.isFunction( props ) ) {
-			callback = props;
-			props = [ "*" ];
-		} else {
-			props = props.split(" ");
-		}
-
-		var prop,
-			index = 0,
-			length = props.length;
-
-		for ( ; index < length ; index++ ) {
-			prop = props[ index ];
-			tweeners[ prop ] = tweeners[ prop ] || [];
-			tweeners[ prop ].unshift( callback );
-		}
-	},
-
-	prefilter: function( callback, prepend ) {
-		if ( prepend ) {
-			animationPrefilters.unshift( callback );
-		} else {
-			animationPrefilters.push( callback );
-		}
-	}
-});
-
-jQuery.speed = function( speed, easing, fn ) {
-	var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
-		complete: fn || !fn && easing ||
-			jQuery.isFunction( speed ) && speed,
-		duration: speed,
-		easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
-	};
-
-	opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
-		opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
-	// Normalize opt.queue - true/undefined/null -> "fx"
-	if ( opt.queue == null || opt.queue === true ) {
-		opt.queue = "fx";
-	}
-
-	// Queueing
-	opt.old = opt.complete;
-
-	opt.complete = function() {
-		if ( jQuery.isFunction( opt.old ) ) {
-			opt.old.call( this );
-		}
-
-		if ( opt.queue ) {
-			jQuery.dequeue( this, opt.queue );
-		}
-	};
-
-	return opt;
-};
-
-jQuery.fn.extend({
-	fadeTo: function( speed, to, easing, callback ) {
-
-		// Show any hidden elements after setting opacity to 0
-		return this.filter( isHidden ).css( "opacity", 0 ).show()
-
-			// Animate to the value specified
-			.end().animate({ opacity: to }, speed, easing, callback );
-	},
-	animate: function( prop, speed, easing, callback ) {
-		var empty = jQuery.isEmptyObject( prop ),
-			optall = jQuery.speed( speed, easing, callback ),
-			doAnimation = function() {
-				// Operate on a copy of prop so per-property easing won't be lost
-				var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-
-				// Empty animations, or finishing resolves immediately
-				if ( empty || data_priv.get( this, "finish" ) ) {
-					anim.stop( true );
-				}
-			};
-			doAnimation.finish = doAnimation;
-
-		return empty || optall.queue === false ?
-			this.each( doAnimation ) :
-			this.queue( optall.queue, doAnimation );
-	},
-	stop: function( type, clearQueue, gotoEnd ) {
-		var stopQueue = function( hooks ) {
-			var stop = hooks.stop;
-			delete hooks.stop;
-			stop( gotoEnd );
-		};
-
-		if ( typeof type !== "string" ) {
-			gotoEnd = clearQueue;
-			clearQueue = type;
-			type = undefined;
-		}
-		if ( clearQueue && type !== false ) {
-			this.queue( type || "fx", [] );
-		}
-
-		return this.each(function() {
-			var dequeue = true,
-				index = type != null && type + "queueHooks",
-				timers = jQuery.timers,
-				data = data_priv.get( this );
-
-			if ( index ) {
-				if ( data[ index ] && data[ index ].stop ) {
-					stopQueue( data[ index ] );
-				}
-			} else {
-				for ( index in data ) {
-					if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
-						stopQueue( data[ index ] );
-					}
-				}
-			}
-
-			for ( index = timers.length; index--; ) {
-				if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
-					timers[ index ].anim.stop( gotoEnd );
-					dequeue = false;
-					timers.splice( index, 1 );
-				}
-			}
-
-			// Start the next in the queue if the last step wasn't forced.
-			// Timers currently will call their complete callbacks, which
-			// will dequeue but only if they were gotoEnd.
-			if ( dequeue || !gotoEnd ) {
-				jQuery.dequeue( this, type );
-			}
-		});
-	},
-	finish: function( type ) {
-		if ( type !== false ) {
-			type = type || "fx";
-		}
-		return this.each(function() {
-			var index,
-				data = data_priv.get( this ),
-				queue = data[ type + "queue" ],
-				hooks = data[ type + "queueHooks" ],
-				timers = jQuery.timers,
-				length = queue ? queue.length : 0;
-
-			// Enable finishing flag on private data
-			data.finish = true;
-
-			// Empty the queue first
-			jQuery.queue( this, type, [] );
-
-			if ( hooks && hooks.stop ) {
-				hooks.stop.call( this, true );
-			}
-
-			// Look for any active animations, and finish them
-			for ( index = timers.length; index--; ) {
-				if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
-					timers[ index ].anim.stop( true );
-					timers.splice( index, 1 );
-				}
-			}
-
-			// Look for any animations in the old queue and finish them
-			for ( index = 0; index < length; index++ ) {
-				if ( queue[ index ] && queue[ index ].finish ) {
-					queue[ index ].finish.call( this );
-				}
-			}
-
-			// Turn off finishing flag
-			delete data.finish;
-		});
-	}
-});
-
-jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
-	var cssFn = jQuery.fn[ name ];
-	jQuery.fn[ name ] = function( speed, easing, callback ) {
-		return speed == null || typeof speed === "boolean" ?
-			cssFn.apply( this, arguments ) :
-			this.animate( genFx( name, true ), speed, easing, callback );
-	};
-});
-
-// Generate shortcuts for custom animations
-jQuery.each({
-	slideDown: genFx("show"),
-	slideUp: genFx("hide"),
-	slideToggle: genFx("toggle"),
-	fadeIn: { opacity: "show" },
-	fadeOut: { opacity: "hide" },
-	fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
-	jQuery.fn[ name ] = function( speed, easing, callback ) {
-		return this.animate( props, speed, easing, callback );
-	};
-});
-
-jQuery.timers = [];
-jQuery.fx.tick = function() {
-	var timer,
-		i = 0,
-		timers = jQuery.timers;
-
-	fxNow = jQuery.now();
-
-	for ( ; i < timers.length; i++ ) {
-		timer = timers[ i ];
-		// Checks the timer has not already been removed
-		if ( !timer() && timers[ i ] === timer ) {
-			timers.splice( i--, 1 );
-		}
-	}
-
-	if ( !timers.length ) {
-		jQuery.fx.stop();
-	}
-	fxNow = undefined;
-};
-
-jQuery.fx.timer = function( timer ) {
-	jQuery.timers.push( timer );
-	if ( timer() ) {
-		jQuery.fx.start();
-	} else {
-		jQuery.timers.pop();
-	}
-};
-
-jQuery.fx.interval = 13;
-
-jQuery.fx.start = function() {
-	if ( !timerId ) {
-		timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
-	}
-};
-
-jQuery.fx.stop = function() {
-	clearInterval( timerId );
-	timerId = null;
-};
-
-jQuery.fx.speeds = {
-	slow: 600,
-	fast: 200,
-	// Default speed
-	_default: 400
-};
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/effects/Tween.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/effects/Tween.js
deleted file mode 100644
index 9acd8d0..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/effects/Tween.js
+++ /dev/null
@@ -1,114 +0,0 @@
-define([
-	"../core",
-	"../css"
-], function( jQuery ) {
-
-function Tween( elem, options, prop, end, easing ) {
-	return new Tween.prototype.init( elem, options, prop, end, easing );
-}
-jQuery.Tween = Tween;
-
-Tween.prototype = {
-	constructor: Tween,
-	init: function( elem, options, prop, end, easing, unit ) {
-		this.elem = elem;
-		this.prop = prop;
-		this.easing = easing || "swing";
-		this.options = options;
-		this.start = this.now = this.cur();
-		this.end = end;
-		this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
-	},
-	cur: function() {
-		var hooks = Tween.propHooks[ this.prop ];
-
-		return hooks && hooks.get ?
-			hooks.get( this ) :
-			Tween.propHooks._default.get( this );
-	},
-	run: function( percent ) {
-		var eased,
-			hooks = Tween.propHooks[ this.prop ];
-
-		if ( this.options.duration ) {
-			this.pos = eased = jQuery.easing[ this.easing ](
-				percent, this.options.duration * percent, 0, 1, this.options.duration
-			);
-		} else {
-			this.pos = eased = percent;
-		}
-		this.now = ( this.end - this.start ) * eased + this.start;
-
-		if ( this.options.step ) {
-			this.options.step.call( this.elem, this.now, this );
-		}
-
-		if ( hooks && hooks.set ) {
-			hooks.set( this );
-		} else {
-			Tween.propHooks._default.set( this );
-		}
-		return this;
-	}
-};
-
-Tween.prototype.init.prototype = Tween.prototype;
-
-Tween.propHooks = {
-	_default: {
-		get: function( tween ) {
-			var result;
-
-			if ( tween.elem[ tween.prop ] != null &&
-				(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
-				return tween.elem[ tween.prop ];
-			}
-
-			// Passing an empty string as a 3rd parameter to .css will automatically
-			// attempt a parseFloat and fallback to a string if the parse fails.
-			// Simple values such as "10px" are parsed to Float;
-			// complex values such as "rotate(1rad)" are returned as-is.
-			result = jQuery.css( tween.elem, tween.prop, "" );
-			// Empty strings, null, undefined and "auto" are converted to 0.
-			return !result || result === "auto" ? 0 : result;
-		},
-		set: function( tween ) {
-			// Use step hook for back compat.
-			// Use cssHook if its there.
-			// Use .style if available and use plain properties where available.
-			if ( jQuery.fx.step[ tween.prop ] ) {
-				jQuery.fx.step[ tween.prop ]( tween );
-			} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
-				jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
-			} else {
-				tween.elem[ tween.prop ] = tween.now;
-			}
-		}
-	}
-};
-
-// Support: IE9
-// Panic based approach to setting things on disconnected nodes
-Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
-	set: function( tween ) {
-		if ( tween.elem.nodeType && tween.elem.parentNode ) {
-			tween.elem[ tween.prop ] = tween.now;
-		}
-	}
-};
-
-jQuery.easing = {
-	linear: function( p ) {
-		return p;
-	},
-	swing: function( p ) {
-		return 0.5 - Math.cos( p * Math.PI ) / 2;
-	}
-};
-
-jQuery.fx = Tween.prototype.init;
-
-// Back Compat <1.8 extension point
-jQuery.fx.step = {};
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/effects/animatedSelector.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/effects/animatedSelector.js
deleted file mode 100644
index bc5a3d6..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/effects/animatedSelector.js
+++ /dev/null
@@ -1,13 +0,0 @@
-define([
-	"../core",
-	"../selector",
-	"../effects"
-], function( jQuery ) {
-
-jQuery.expr.filters.animated = function( elem ) {
-	return jQuery.grep(jQuery.timers, function( fn ) {
-		return elem === fn.elem;
-	}).length;
-};
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event.js
deleted file mode 100644
index 8f04b89..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event.js
+++ /dev/null
@@ -1,868 +0,0 @@
-define([
-	"./core",
-	"./var/strundefined",
-	"./var/rnotwhite",
-	"./var/hasOwn",
-	"./var/slice",
-	"./event/support",
-	"./data/var/data_priv",
-
-	"./core/init",
-	"./data/accepts",
-	"./selector"
-], function( jQuery, strundefined, rnotwhite, hasOwn, slice, support, data_priv ) {
-
-var
-	rkeyEvent = /^key/,
-	rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
-	rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
-	rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
-
-function returnTrue() {
-	return true;
-}
-
-function returnFalse() {
-	return false;
-}
-
-function safeActiveElement() {
-	try {
-		return document.activeElement;
-	} catch ( err ) { }
-}
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
-	global: {},
-
-	add: function( elem, types, handler, data, selector ) {
-
-		var handleObjIn, eventHandle, tmp,
-			events, t, handleObj,
-			special, handlers, type, namespaces, origType,
-			elemData = data_priv.get( elem );
-
-		// Don't attach events to noData or text/comment nodes (but allow plain objects)
-		if ( !elemData ) {
-			return;
-		}
-
-		// Caller can pass in an object of custom data in lieu of the handler
-		if ( handler.handler ) {
-			handleObjIn = handler;
-			handler = handleObjIn.handler;
-			selector = handleObjIn.selector;
-		}
-
-		// Make sure that the handler has a unique ID, used to find/remove it later
-		if ( !handler.guid ) {
-			handler.guid = jQuery.guid++;
-		}
-
-		// Init the element's event structure and main handler, if this is the first
-		if ( !(events = elemData.events) ) {
-			events = elemData.events = {};
-		}
-		if ( !(eventHandle = elemData.handle) ) {
-			eventHandle = elemData.handle = function( e ) {
-				// Discard the second event of a jQuery.event.trigger() and
-				// when an event is called after a page has unloaded
-				return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
-					jQuery.event.dispatch.apply( elem, arguments ) : undefined;
-			};
-		}
-
-		// Handle multiple events separated by a space
-		types = ( types || "" ).match( rnotwhite ) || [ "" ];
-		t = types.length;
-		while ( t-- ) {
-			tmp = rtypenamespace.exec( types[t] ) || [];
-			type = origType = tmp[1];
-			namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
-			// There *must* be a type, no attaching namespace-only handlers
-			if ( !type ) {
-				continue;
-			}
-
-			// If event changes its type, use the special event handlers for the changed type
-			special = jQuery.event.special[ type ] || {};
-
-			// If selector defined, determine special event api type, otherwise given type
-			type = ( selector ? special.delegateType : special.bindType ) || type;
-
-			// Update special based on newly reset type
-			special = jQuery.event.special[ type ] || {};
-
-			// handleObj is passed to all event handlers
-			handleObj = jQuery.extend({
-				type: type,
-				origType: origType,
-				data: data,
-				handler: handler,
-				guid: handler.guid,
-				selector: selector,
-				needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
-				namespace: namespaces.join(".")
-			}, handleObjIn );
-
-			// Init the event handler queue if we're the first
-			if ( !(handlers = events[ type ]) ) {
-				handlers = events[ type ] = [];
-				handlers.delegateCount = 0;
-
-				// Only use addEventListener if the special events handler returns false
-				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-					if ( elem.addEventListener ) {
-						elem.addEventListener( type, eventHandle, false );
-					}
-				}
-			}
-
-			if ( special.add ) {
-				special.add.call( elem, handleObj );
-
-				if ( !handleObj.handler.guid ) {
-					handleObj.handler.guid = handler.guid;
-				}
-			}
-
-			// Add to the element's handler list, delegates in front
-			if ( selector ) {
-				handlers.splice( handlers.delegateCount++, 0, handleObj );
-			} else {
-				handlers.push( handleObj );
-			}
-
-			// Keep track of which events have ever been used, for event optimization
-			jQuery.event.global[ type ] = true;
-		}
-
-	},
-
-	// Detach an event or set of events from an element
-	remove: function( elem, types, handler, selector, mappedTypes ) {
-
-		var j, origCount, tmp,
-			events, t, handleObj,
-			special, handlers, type, namespaces, origType,
-			elemData = data_priv.hasData( elem ) && data_priv.get( elem );
-
-		if ( !elemData || !(events = elemData.events) ) {
-			return;
-		}
-
-		// Once for each type.namespace in types; type may be omitted
-		types = ( types || "" ).match( rnotwhite ) || [ "" ];
-		t = types.length;
-		while ( t-- ) {
-			tmp = rtypenamespace.exec( types[t] ) || [];
-			type = origType = tmp[1];
-			namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
-			// Unbind all events (on this namespace, if provided) for the element
-			if ( !type ) {
-				for ( type in events ) {
-					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
-				}
-				continue;
-			}
-
-			special = jQuery.event.special[ type ] || {};
-			type = ( selector ? special.delegateType : special.bindType ) || type;
-			handlers = events[ type ] || [];
-			tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
-
-			// Remove matching events
-			origCount = j = handlers.length;
-			while ( j-- ) {
-				handleObj = handlers[ j ];
-
-				if ( ( mappedTypes || origType === handleObj.origType ) &&
-					( !handler || handler.guid === handleObj.guid ) &&
-					( !tmp || tmp.test( handleObj.namespace ) ) &&
-					( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
-					handlers.splice( j, 1 );
-
-					if ( handleObj.selector ) {
-						handlers.delegateCount--;
-					}
-					if ( special.remove ) {
-						special.remove.call( elem, handleObj );
-					}
-				}
-			}
-
-			// Remove generic event handler if we removed something and no more handlers exist
-			// (avoids potential for endless recursion during removal of special event handlers)
-			if ( origCount && !handlers.length ) {
-				if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
-					jQuery.removeEvent( elem, type, elemData.handle );
-				}
-
-				delete events[ type ];
-			}
-		}
-
-		// Remove the expando if it's no longer used
-		if ( jQuery.isEmptyObject( events ) ) {
-			delete elemData.handle;
-			data_priv.remove( elem, "events" );
-		}
-	},
-
-	trigger: function( event, data, elem, onlyHandlers ) {
-
-		var i, cur, tmp, bubbleType, ontype, handle, special,
-			eventPath = [ elem || document ],
-			type = hasOwn.call( event, "type" ) ? event.type : event,
-			namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
-
-		cur = tmp = elem = elem || document;
-
-		// Don't do events on text and comment nodes
-		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return;
-		}
-
-		// focus/blur morphs to focusin/out; ensure we're not firing them right now
-		if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
-			return;
-		}
-
-		if ( type.indexOf(".") >= 0 ) {
-			// Namespaced trigger; create a regexp to match event type in handle()
-			namespaces = type.split(".");
-			type = namespaces.shift();
-			namespaces.sort();
-		}
-		ontype = type.indexOf(":") < 0 && "on" + type;
-
-		// Caller can pass in a jQuery.Event object, Object, or just an event type string
-		event = event[ jQuery.expando ] ?
-			event :
-			new jQuery.Event( type, typeof event === "object" && event );
-
-		// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
-		event.isTrigger = onlyHandlers ? 2 : 3;
-		event.namespace = namespaces.join(".");
-		event.namespace_re = event.namespace ?
-			new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
-			null;
-
-		// Clean up the event in case it is being reused
-		event.result = undefined;
-		if ( !event.target ) {
-			event.target = elem;
-		}
-
-		// Clone any incoming data and prepend the event, creating the handler arg list
-		data = data == null ?
-			[ event ] :
-			jQuery.makeArray( data, [ event ] );
-
-		// Allow special events to draw outside the lines
-		special = jQuery.event.special[ type ] || {};
-		if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
-			return;
-		}
-
-		// Determine event propagation path in advance, per W3C events spec (#9951)
-		// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
-		if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
-			bubbleType = special.delegateType || type;
-			if ( !rfocusMorph.test( bubbleType + type ) ) {
-				cur = cur.parentNode;
-			}
-			for ( ; cur; cur = cur.parentNode ) {
-				eventPath.push( cur );
-				tmp = cur;
-			}
-
-			// Only add window if we got to document (e.g., not plain obj or detached DOM)
-			if ( tmp === (elem.ownerDocument || document) ) {
-				eventPath.push( tmp.defaultView || tmp.parentWindow || window );
-			}
-		}
-
-		// Fire handlers on the event path
-		i = 0;
-		while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
-
-			event.type = i > 1 ?
-				bubbleType :
-				special.bindType || type;
-
-			// jQuery handler
-			handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
-			if ( handle ) {
-				handle.apply( cur, data );
-			}
-
-			// Native handler
-			handle = ontype && cur[ ontype ];
-			if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
-				event.result = handle.apply( cur, data );
-				if ( event.result === false ) {
-					event.preventDefault();
-				}
-			}
-		}
-		event.type = type;
-
-		// If nobody prevented the default action, do it now
-		if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
-			if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
-				jQuery.acceptData( elem ) ) {
-
-				// Call a native DOM method on the target with the same name name as the event.
-				// Don't do default actions on window, that's where global variables be (#6170)
-				if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
-
-					// Don't re-trigger an onFOO event when we call its FOO() method
-					tmp = elem[ ontype ];
-
-					if ( tmp ) {
-						elem[ ontype ] = null;
-					}
-
-					// Prevent re-triggering of the same event, since we already bubbled it above
-					jQuery.event.triggered = type;
-					elem[ type ]();
-					jQuery.event.triggered = undefined;
-
-					if ( tmp ) {
-						elem[ ontype ] = tmp;
-					}
-				}
-			}
-		}
-
-		return event.result;
-	},
-
-	dispatch: function( event ) {
-
-		// Make a writable jQuery.Event from the native event object
-		event = jQuery.event.fix( event );
-
-		var i, j, ret, matched, handleObj,
-			handlerQueue = [],
-			args = slice.call( arguments ),
-			handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
-			special = jQuery.event.special[ event.type ] || {};
-
-		// Use the fix-ed jQuery.Event rather than the (read-only) native event
-		args[0] = event;
-		event.delegateTarget = this;
-
-		// Call the preDispatch hook for the mapped type, and let it bail if desired
-		if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
-			return;
-		}
-
-		// Determine handlers
-		handlerQueue = jQuery.event.handlers.call( this, event, handlers );
-
-		// Run delegates first; they may want to stop propagation beneath us
-		i = 0;
-		while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
-			event.currentTarget = matched.elem;
-
-			j = 0;
-			while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
-
-				// Triggered event must either 1) have no namespace, or 2) have namespace(s)
-				// a subset or equal to those in the bound event (both can have no namespace).
-				if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
-
-					event.handleObj = handleObj;
-					event.data = handleObj.data;
-
-					ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
-							.apply( matched.elem, args );
-
-					if ( ret !== undefined ) {
-						if ( (event.result = ret) === false ) {
-							event.preventDefault();
-							event.stopPropagation();
-						}
-					}
-				}
-			}
-		}
-
-		// Call the postDispatch hook for the mapped type
-		if ( special.postDispatch ) {
-			special.postDispatch.call( this, event );
-		}
-
-		return event.result;
-	},
-
-	handlers: function( event, handlers ) {
-		var i, matches, sel, handleObj,
-			handlerQueue = [],
-			delegateCount = handlers.delegateCount,
-			cur = event.target;
-
-		// Find delegate handlers
-		// Black-hole SVG <use> instance trees (#13180)
-		// Avoid non-left-click bubbling in Firefox (#3861)
-		if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
-
-			for ( ; cur !== this; cur = cur.parentNode || this ) {
-
-				// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
-				if ( cur.disabled !== true || event.type !== "click" ) {
-					matches = [];
-					for ( i = 0; i < delegateCount; i++ ) {
-						handleObj = handlers[ i ];
-
-						// Don't conflict with Object.prototype properties (#13203)
-						sel = handleObj.selector + " ";
-
-						if ( matches[ sel ] === undefined ) {
-							matches[ sel ] = handleObj.needsContext ?
-								jQuery( sel, this ).index( cur ) >= 0 :
-								jQuery.find( sel, this, null, [ cur ] ).length;
-						}
-						if ( matches[ sel ] ) {
-							matches.push( handleObj );
-						}
-					}
-					if ( matches.length ) {
-						handlerQueue.push({ elem: cur, handlers: matches });
-					}
-				}
-			}
-		}
-
-		// Add the remaining (directly-bound) handlers
-		if ( delegateCount < handlers.length ) {
-			handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
-		}
-
-		return handlerQueue;
-	},
-
-	// Includes some event props shared by KeyEvent and MouseEvent
-	props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
-
-	fixHooks: {},
-
-	keyHooks: {
-		props: "char charCode key keyCode".split(" "),
-		filter: function( event, original ) {
-
-			// Add which for key events
-			if ( event.which == null ) {
-				event.which = original.charCode != null ? original.charCode : original.keyCode;
-			}
-
-			return event;
-		}
-	},
-
-	mouseHooks: {
-		props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
-		filter: function( event, original ) {
-			var eventDoc, doc, body,
-				button = original.button;
-
-			// Calculate pageX/Y if missing and clientX/Y available
-			if ( event.pageX == null && original.clientX != null ) {
-				eventDoc = event.target.ownerDocument || document;
-				doc = eventDoc.documentElement;
-				body = eventDoc.body;
-
-				event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
-				event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
-			}
-
-			// Add which for click: 1 === left; 2 === middle; 3 === right
-			// Note: button is not normalized, so don't use it
-			if ( !event.which && button !== undefined ) {
-				event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
-			}
-
-			return event;
-		}
-	},
-
-	fix: function( event ) {
-		if ( event[ jQuery.expando ] ) {
-			return event;
-		}
-
-		// Create a writable copy of the event object and normalize some properties
-		var i, prop, copy,
-			type = event.type,
-			originalEvent = event,
-			fixHook = this.fixHooks[ type ];
-
-		if ( !fixHook ) {
-			this.fixHooks[ type ] = fixHook =
-				rmouseEvent.test( type ) ? this.mouseHooks :
-				rkeyEvent.test( type ) ? this.keyHooks :
-				{};
-		}
-		copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
-		event = new jQuery.Event( originalEvent );
-
-		i = copy.length;
-		while ( i-- ) {
-			prop = copy[ i ];
-			event[ prop ] = originalEvent[ prop ];
-		}
-
-		// Support: Cordova 2.5 (WebKit) (#13255)
-		// All events should have a target; Cordova deviceready doesn't
-		if ( !event.target ) {
-			event.target = document;
-		}
-
-		// Support: Safari 6.0+, Chrome<28
-		// Target should not be a text node (#504, #13143)
-		if ( event.target.nodeType === 3 ) {
-			event.target = event.target.parentNode;
-		}
-
-		return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
-	},
-
-	special: {
-		load: {
-			// Prevent triggered image.load events from bubbling to window.load
-			noBubble: true
-		},
-		focus: {
-			// Fire native event if possible so blur/focus sequence is correct
-			trigger: function() {
-				if ( this !== safeActiveElement() && this.focus ) {
-					this.focus();
-					return false;
-				}
-			},
-			delegateType: "focusin"
-		},
-		blur: {
-			trigger: function() {
-				if ( this === safeActiveElement() && this.blur ) {
-					this.blur();
-					return false;
-				}
-			},
-			delegateType: "focusout"
-		},
-		click: {
-			// For checkbox, fire native event so checked state will be right
-			trigger: function() {
-				if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
-					this.click();
-					return false;
-				}
-			},
-
-			// For cross-browser consistency, don't fire native .click() on links
-			_default: function( event ) {
-				return jQuery.nodeName( event.target, "a" );
-			}
-		},
-
-		beforeunload: {
-			postDispatch: function( event ) {
-
-				// Support: Firefox 20+
-				// Firefox doesn't alert if the returnValue field is not set.
-				if ( event.result !== undefined && event.originalEvent ) {
-					event.originalEvent.returnValue = event.result;
-				}
-			}
-		}
-	},
-
-	simulate: function( type, elem, event, bubble ) {
-		// Piggyback on a donor event to simulate a different one.
-		// Fake originalEvent to avoid donor's stopPropagation, but if the
-		// simulated event prevents default then we do the same on the donor.
-		var e = jQuery.extend(
-			new jQuery.Event(),
-			event,
-			{
-				type: type,
-				isSimulated: true,
-				originalEvent: {}
-			}
-		);
-		if ( bubble ) {
-			jQuery.event.trigger( e, null, elem );
-		} else {
-			jQuery.event.dispatch.call( elem, e );
-		}
-		if ( e.isDefaultPrevented() ) {
-			event.preventDefault();
-		}
-	}
-};
-
-jQuery.removeEvent = function( elem, type, handle ) {
-	if ( elem.removeEventListener ) {
-		elem.removeEventListener( type, handle, false );
-	}
-};
-
-jQuery.Event = function( src, props ) {
-	// Allow instantiation without the 'new' keyword
-	if ( !(this instanceof jQuery.Event) ) {
-		return new jQuery.Event( src, props );
-	}
-
-	// Event object
-	if ( src && src.type ) {
-		this.originalEvent = src;
-		this.type = src.type;
-
-		// Events bubbling up the document may have been marked as prevented
-		// by a handler lower down the tree; reflect the correct value.
-		this.isDefaultPrevented = src.defaultPrevented ||
-				src.defaultPrevented === undefined &&
-				// Support: Android<4.0
-				src.returnValue === false ?
-			returnTrue :
-			returnFalse;
-
-	// Event type
-	} else {
-		this.type = src;
-	}
-
-	// Put explicitly provided properties onto the event object
-	if ( props ) {
-		jQuery.extend( this, props );
-	}
-
-	// Create a timestamp if incoming event doesn't have one
-	this.timeStamp = src && src.timeStamp || jQuery.now();
-
-	// Mark it as fixed
-	this[ jQuery.expando ] = true;
-};
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
-	isDefaultPrevented: returnFalse,
-	isPropagationStopped: returnFalse,
-	isImmediatePropagationStopped: returnFalse,
-
-	preventDefault: function() {
-		var e = this.originalEvent;
-
-		this.isDefaultPrevented = returnTrue;
-
-		if ( e && e.preventDefault ) {
-			e.preventDefault();
-		}
-	},
-	stopPropagation: function() {
-		var e = this.originalEvent;
-
-		this.isPropagationStopped = returnTrue;
-
-		if ( e && e.stopPropagation ) {
-			e.stopPropagation();
-		}
-	},
-	stopImmediatePropagation: function() {
-		var e = this.originalEvent;
-
-		this.isImmediatePropagationStopped = returnTrue;
-
-		if ( e && e.stopImmediatePropagation ) {
-			e.stopImmediatePropagation();
-		}
-
-		this.stopPropagation();
-	}
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-// Support: Chrome 15+
-jQuery.each({
-	mouseenter: "mouseover",
-	mouseleave: "mouseout",
-	pointerenter: "pointerover",
-	pointerleave: "pointerout"
-}, function( orig, fix ) {
-	jQuery.event.special[ orig ] = {
-		delegateType: fix,
-		bindType: fix,
-
-		handle: function( event ) {
-			var ret,
-				target = this,
-				related = event.relatedTarget,
-				handleObj = event.handleObj;
-
-			// For mousenter/leave call the handler if related is outside the target.
-			// NB: No relatedTarget if the mouse left/entered the browser window
-			if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
-				event.type = handleObj.origType;
-				ret = handleObj.handler.apply( this, arguments );
-				event.type = fix;
-			}
-			return ret;
-		}
-	};
-});
-
-// Support: Firefox, Chrome, Safari
-// Create "bubbling" focus and blur events
-if ( !support.focusinBubbles ) {
-	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
-		// Attach a single capturing handler on the document while someone wants focusin/focusout
-		var handler = function( event ) {
-				jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
-			};
-
-		jQuery.event.special[ fix ] = {
-			setup: function() {
-				var doc = this.ownerDocument || this,
-					attaches = data_priv.access( doc, fix );
-
-				if ( !attaches ) {
-					doc.addEventListener( orig, handler, true );
-				}
-				data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
-			},
-			teardown: function() {
-				var doc = this.ownerDocument || this,
-					attaches = data_priv.access( doc, fix ) - 1;
-
-				if ( !attaches ) {
-					doc.removeEventListener( orig, handler, true );
-					data_priv.remove( doc, fix );
-
-				} else {
-					data_priv.access( doc, fix, attaches );
-				}
-			}
-		};
-	});
-}
-
-jQuery.fn.extend({
-
-	on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
-		var origFn, type;
-
-		// Types can be a map of types/handlers
-		if ( typeof types === "object" ) {
-			// ( types-Object, selector, data )
-			if ( typeof selector !== "string" ) {
-				// ( types-Object, data )
-				data = data || selector;
-				selector = undefined;
-			}
-			for ( type in types ) {
-				this.on( type, selector, data, types[ type ], one );
-			}
-			return this;
-		}
-
-		if ( data == null && fn == null ) {
-			// ( types, fn )
-			fn = selector;
-			data = selector = undefined;
-		} else if ( fn == null ) {
-			if ( typeof selector === "string" ) {
-				// ( types, selector, fn )
-				fn = data;
-				data = undefined;
-			} else {
-				// ( types, data, fn )
-				fn = data;
-				data = selector;
-				selector = undefined;
-			}
-		}
-		if ( fn === false ) {
-			fn = returnFalse;
-		} else if ( !fn ) {
-			return this;
-		}
-
-		if ( one === 1 ) {
-			origFn = fn;
-			fn = function( event ) {
-				// Can use an empty set, since event contains the info
-				jQuery().off( event );
-				return origFn.apply( this, arguments );
-			};
-			// Use same guid so caller can remove using origFn
-			fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
-		}
-		return this.each( function() {
-			jQuery.event.add( this, types, fn, data, selector );
-		});
-	},
-	one: function( types, selector, data, fn ) {
-		return this.on( types, selector, data, fn, 1 );
-	},
-	off: function( types, selector, fn ) {
-		var handleObj, type;
-		if ( types && types.preventDefault && types.handleObj ) {
-			// ( event )  dispatched jQuery.Event
-			handleObj = types.handleObj;
-			jQuery( types.delegateTarget ).off(
-				handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
-				handleObj.selector,
-				handleObj.handler
-			);
-			return this;
-		}
-		if ( typeof types === "object" ) {
-			// ( types-object [, selector] )
-			for ( type in types ) {
-				this.off( type, selector, types[ type ] );
-			}
-			return this;
-		}
-		if ( selector === false || typeof selector === "function" ) {
-			// ( types [, fn] )
-			fn = selector;
-			selector = undefined;
-		}
-		if ( fn === false ) {
-			fn = returnFalse;
-		}
-		return this.each(function() {
-			jQuery.event.remove( this, types, fn, selector );
-		});
-	},
-
-	trigger: function( type, data ) {
-		return this.each(function() {
-			jQuery.event.trigger( type, data, this );
-		});
-	},
-	triggerHandler: function( type, data ) {
-		var elem = this[0];
-		if ( elem ) {
-			return jQuery.event.trigger( type, data, elem, true );
-		}
-	}
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event/ajax.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event/ajax.js
deleted file mode 100644
index 278c403..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event/ajax.js
+++ /dev/null
@@ -1,13 +0,0 @@
-define([
-	"../core",
-	"../event"
-], function( jQuery ) {
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
-	jQuery.fn[ type ] = function( fn ) {
-		return this.on( type, fn );
-	};
-});
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event/alias.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event/alias.js
deleted file mode 100644
index 7e79175..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event/alias.js
+++ /dev/null
@@ -1,39 +0,0 @@
-define([
-	"../core",
-	"../event"
-], function( jQuery ) {
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
-	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
-	"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
-	// Handle event binding
-	jQuery.fn[ name ] = function( data, fn ) {
-		return arguments.length > 0 ?
-			this.on( name, null, data, fn ) :
-			this.trigger( name );
-	};
-});
-
-jQuery.fn.extend({
-	hover: function( fnOver, fnOut ) {
-		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
-	},
-
-	bind: function( types, data, fn ) {
-		return this.on( types, null, data, fn );
-	},
-	unbind: function( types, fn ) {
-		return this.off( types, null, fn );
-	},
-
-	delegate: function( selector, types, data, fn ) {
-		return this.on( types, selector, data, fn );
-	},
-	undelegate: function( selector, types, fn ) {
-		// ( namespace ) or ( selector, types [, fn] )
-		return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
-	}
-});
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event/support.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event/support.js
deleted file mode 100644
index 85060db..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/event/support.js
+++ /dev/null
@@ -1,9 +0,0 @@
-define([
-	"../var/support"
-], function( support ) {
-
-support.focusinBubbles = "onfocusin" in window;
-
-return support;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/exports/amd.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/exports/amd.js
deleted file mode 100644
index 9a9846f..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/exports/amd.js
+++ /dev/null
@@ -1,24 +0,0 @@
-define([
-	"../core"
-], function( jQuery ) {
-
-// Register as a named AMD module, since jQuery can be concatenated with other
-// files that may use define, but not via a proper concatenation script that
-// understands anonymous AMD modules. A named AMD is safest and most robust
-// way to register. Lowercase jquery is used because AMD module names are
-// derived from file names, and jQuery is normally delivered in a lowercase
-// file name. Do this after creating the global so that if an AMD module wants
-// to call noConflict to hide this version of jQuery, it will work.
-
-// Note that for maximum portability, libraries that are not jQuery should
-// declare themselves as anonymous modules, and avoid setting a global if an
-// AMD loader is present. jQuery is a special case. For more information, see
-// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
-
-if ( typeof define === "function" && define.amd ) {
-	define( "jquery", [], function() {
-		return jQuery;
-	});
-}
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/exports/global.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/exports/global.js
deleted file mode 100644
index 6513287..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/exports/global.js
+++ /dev/null
@@ -1,32 +0,0 @@
-define([
-	"../core",
-	"../var/strundefined"
-], function( jQuery, strundefined ) {
-
-var
-	// Map over jQuery in case of overwrite
-	_jQuery = window.jQuery,
-
-	// Map over the $ in case of overwrite
-	_$ = window.$;
-
-jQuery.noConflict = function( deep ) {
-	if ( window.$ === jQuery ) {
-		window.$ = _$;
-	}
-
-	if ( deep && window.jQuery === jQuery ) {
-		window.jQuery = _jQuery;
-	}
-
-	return jQuery;
-};
-
-// Expose jQuery and $ identifiers, even in AMD
-// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
-// and CommonJS for browser emulators (#13566)
-if ( typeof noGlobal === strundefined ) {
-	window.jQuery = window.$ = jQuery;
-}
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/intro.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/intro.js
deleted file mode 100644
index d7d4368..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/intro.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*!
- * jQuery JavaScript Library v@VERSION
- * http://jquery.com/
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: @DATE
- */
-
-(function( global, factory ) {
-
-	if ( typeof module === "object" && typeof module.exports === "object" ) {
-		// For CommonJS and CommonJS-like environments where a proper `window`
-		// is present, execute the factory and get jQuery.
-		// For environments that do not have a `window` with a `document`
-		// (such as Node.js), expose a factory as module.exports.
-		// This accentuates the need for the creation of a real `window`.
-		// e.g. var jQuery = require("jquery")(window);
-		// See ticket #14549 for more info.
-		module.exports = global.document ?
-			factory( global, true ) :
-			function( w ) {
-				if ( !w.document ) {
-					throw new Error( "jQuery requires a window with a document" );
-				}
-				return factory( w );
-			};
-	} else {
-		factory( global );
-	}
-
-// Pass this if window is not defined yet
-}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
-
-// Support: Firefox 18+
-// Can't be in strict mode, several libs including ASP.NET trace
-// the stack via arguments.caller.callee and Firefox dies if
-// you try to trace through "use strict" call chains. (#13335)
-//"use strict";
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/jquery.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/jquery.js
deleted file mode 100644
index d3857e9..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/jquery.js
+++ /dev/null
@@ -1,37 +0,0 @@
-define([
-	"./core",
-	"./selector",
-	"./traversing",
-	"./callbacks",
-	"./deferred",
-	"./core/ready",
-	"./data",
-	"./queue",
-	"./queue/delay",
-	"./attributes",
-	"./event",
-	"./event/alias",
-	"./manipulation",
-	"./manipulation/_evalUrl",
-	"./wrap",
-	"./css",
-	"./css/hiddenVisibleSelectors",
-	"./serialize",
-	"./ajax",
-	"./ajax/xhr",
-	"./ajax/script",
-	"./ajax/jsonp",
-	"./ajax/load",
-	"./event/ajax",
-	"./effects",
-	"./effects/animatedSelector",
-	"./offset",
-	"./dimensions",
-	"./deprecated",
-	"./exports/amd",
-	"./exports/global"
-], function( jQuery ) {
-
-return jQuery;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation.js
deleted file mode 100644
index c627962..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation.js
+++ /dev/null
@@ -1,580 +0,0 @@
-define([
-	"./core",
-	"./var/concat",
-	"./var/push",
-	"./core/access",
-	"./manipulation/var/rcheckableType",
-	"./manipulation/support",
-	"./data/var/data_priv",
-	"./data/var/data_user",
-
-	"./core/init",
-	"./data/accepts",
-	"./traversing",
-	"./selector",
-	"./event"
-], function( jQuery, concat, push, access, rcheckableType, support, data_priv, data_user ) {
-
-var
-	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
-	rtagName = /<([\w:]+)/,
-	rhtml = /<|&#?\w+;/,
-	rnoInnerhtml = /<(?:script|style|link)/i,
-	// checked="checked" or checked
-	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
-	rscriptType = /^$|\/(?:java|ecma)script/i,
-	rscriptTypeMasked = /^true\/(.*)/,
-	rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
-
-	// We have to close these tags to support XHTML (#13200)
-	wrapMap = {
-
-		// Support: IE9
-		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, "", "" ]
-	};
-
-// Support: IE9
-wrapMap.optgroup = wrapMap.option;
-
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// Support: 1.x compatibility
-// Manipulating tables requires a tbody
-function manipulationTarget( elem, content ) {
-	return jQuery.nodeName( elem, "table" ) &&
-		jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
-
-		elem.getElementsByTagName("tbody")[0] ||
-			elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
-		elem;
-}
-
-// Replace/restore the type attribute of script elements for safe DOM manipulation
-function disableScript( elem ) {
-	elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
-	return elem;
-}
-function restoreScript( elem ) {
-	var match = rscriptTypeMasked.exec( elem.type );
-
-	if ( match ) {
-		elem.type = match[ 1 ];
-	} else {
-		elem.removeAttribute("type");
-	}
-
-	return elem;
-}
-
-// Mark scripts as having already been evaluated
-function setGlobalEval( elems, refElements ) {
-	var i = 0,
-		l = elems.length;
-
-	for ( ; i < l; i++ ) {
-		data_priv.set(
-			elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
-		);
-	}
-}
-
-function cloneCopyEvent( src, dest ) {
-	var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
-
-	if ( dest.nodeType !== 1 ) {
-		return;
-	}
-
-	// 1. Copy private data: events, handlers, etc.
-	if ( data_priv.hasData( src ) ) {
-		pdataOld = data_priv.access( src );
-		pdataCur = data_priv.set( dest, pdataOld );
-		events = pdataOld.events;
-
-		if ( events ) {
-			delete pdataCur.handle;
-			pdataCur.events = {};
-
-			for ( type in events ) {
-				for ( i = 0, l = events[ type ].length; i < l; i++ ) {
-					jQuery.event.add( dest, type, events[ type ][ i ] );
-				}
-			}
-		}
-	}
-
-	// 2. Copy user data
-	if ( data_user.hasData( src ) ) {
-		udataOld = data_user.access( src );
-		udataCur = jQuery.extend( {}, udataOld );
-
-		data_user.set( dest, udataCur );
-	}
-}
-
-function getAll( context, tag ) {
-	var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
-			context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
-			[];
-
-	return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
-		jQuery.merge( [ context ], ret ) :
-		ret;
-}
-
-// Fix IE bugs, see support tests
-function fixInput( src, dest ) {
-	var nodeName = dest.nodeName.toLowerCase();
-
-	// Fails to persist the checked state of a cloned checkbox or radio button.
-	if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
-		dest.checked = src.checked;
-
-	// Fails to return the selected option to the default selected state when cloning options
-	} else if ( nodeName === "input" || nodeName === "textarea" ) {
-		dest.defaultValue = src.defaultValue;
-	}
-}
-
-jQuery.extend({
-	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
-		var i, l, srcElements, destElements,
-			clone = elem.cloneNode( true ),
-			inPage = jQuery.contains( elem.ownerDocument, elem );
-
-		// Fix IE cloning issues
-		if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
-				!jQuery.isXMLDoc( elem ) ) {
-
-			// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
-			destElements = getAll( clone );
-			srcElements = getAll( elem );
-
-			for ( i = 0, l = srcElements.length; i < l; i++ ) {
-				fixInput( srcElements[ i ], destElements[ i ] );
-			}
-		}
-
-		// Copy the events from the original to the clone
-		if ( dataAndEvents ) {
-			if ( deepDataAndEvents ) {
-				srcElements = srcElements || getAll( elem );
-				destElements = destElements || getAll( clone );
-
-				for ( i = 0, l = srcElements.length; i < l; i++ ) {
-					cloneCopyEvent( srcElements[ i ], destElements[ i ] );
-				}
-			} else {
-				cloneCopyEvent( elem, clone );
-			}
-		}
-
-		// Preserve script evaluation history
-		destElements = getAll( clone, "script" );
-		if ( destElements.length > 0 ) {
-			setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
-		}
-
-		// Return the cloned set
-		return clone;
-	},
-
-	buildFragment: function( elems, context, scripts, selection ) {
-		var elem, tmp, tag, wrap, contains, j,
-			fragment = context.createDocumentFragment(),
-			nodes = [],
-			i = 0,
-			l = elems.length;
-
-		for ( ; i < l; i++ ) {
-			elem = elems[ i ];
-
-			if ( elem || elem === 0 ) {
-
-				// Add nodes directly
-				if ( jQuery.type( elem ) === "object" ) {
-					// Support: QtWebKit, PhantomJS
-					// push.apply(_, arraylike) throws on ancient WebKit
-					jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
-
-				// Convert non-html into a text node
-				} else if ( !rhtml.test( elem ) ) {
-					nodes.push( context.createTextNode( elem ) );
-
-				// Convert html into DOM nodes
-				} else {
-					tmp = tmp || fragment.appendChild( context.createElement("div") );
-
-					// Deserialize a standard representation
-					tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
-					wrap = wrapMap[ tag ] || wrapMap._default;
-					tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
-
-					// Descend through wrappers to the right content
-					j = wrap[ 0 ];
-					while ( j-- ) {
-						tmp = tmp.lastChild;
-					}
-
-					// Support: QtWebKit, PhantomJS
-					// push.apply(_, arraylike) throws on ancient WebKit
-					jQuery.merge( nodes, tmp.childNodes );
-
-					// Remember the top-level container
-					tmp = fragment.firstChild;
-
-					// Ensure the created nodes are orphaned (#12392)
-					tmp.textContent = "";
-				}
-			}
-		}
-
-		// Remove wrapper from fragment
-		fragment.textContent = "";
-
-		i = 0;
-		while ( (elem = nodes[ i++ ]) ) {
-
-			// #4087 - If origin and destination elements are the same, and this is
-			// that element, do not do anything
-			if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
-				continue;
-			}
-
-			contains = jQuery.contains( elem.ownerDocument, elem );
-
-			// Append to fragment
-			tmp = getAll( fragment.appendChild( elem ), "script" );
-
-			// Preserve script evaluation history
-			if ( contains ) {
-				setGlobalEval( tmp );
-			}
-
-			// Capture executables
-			if ( scripts ) {
-				j = 0;
-				while ( (elem = tmp[ j++ ]) ) {
-					if ( rscriptType.test( elem.type || "" ) ) {
-						scripts.push( elem );
-					}
-				}
-			}
-		}
-
-		return fragment;
-	},
-
-	cleanData: function( elems ) {
-		var data, elem, type, key,
-			special = jQuery.event.special,
-			i = 0;
-
-		for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
-			if ( jQuery.acceptData( elem ) ) {
-				key = elem[ data_priv.expando ];
-
-				if ( key && (data = data_priv.cache[ key ]) ) {
-					if ( data.events ) {
-						for ( type in data.events ) {
-							if ( special[ type ] ) {
-								jQuery.event.remove( elem, type );
-
-							// This is a shortcut to avoid jQuery.event.remove's overhead
-							} else {
-								jQuery.removeEvent( elem, type, data.handle );
-							}
-						}
-					}
-					if ( data_priv.cache[ key ] ) {
-						// Discard any remaining `private` data
-						delete data_priv.cache[ key ];
-					}
-				}
-			}
-			// Discard any remaining `user` data
-			delete data_user.cache[ elem[ data_user.expando ] ];
-		}
-	}
-});
-
-jQuery.fn.extend({
-	text: function( value ) {
-		return access( this, function( value ) {
-			return value === undefined ?
-				jQuery.text( this ) :
-				this.empty().each(function() {
-					if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
-						this.textContent = value;
-					}
-				});
-		}, null, value, arguments.length );
-	},
-
-	append: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
-				var target = manipulationTarget( this, elem );
-				target.appendChild( elem );
-			}
-		});
-	},
-
-	prepend: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
-				var target = manipulationTarget( this, elem );
-				target.insertBefore( elem, target.firstChild );
-			}
-		});
-	},
-
-	before: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.parentNode ) {
-				this.parentNode.insertBefore( elem, this );
-			}
-		});
-	},
-
-	after: function() {
-		return this.domManip( arguments, function( elem ) {
-			if ( this.parentNode ) {
-				this.parentNode.insertBefore( elem, this.nextSibling );
-			}
-		});
-	},
-
-	remove: function( selector, keepData /* Internal Use Only */ ) {
-		var elem,
-			elems = selector ? jQuery.filter( selector, this ) : this,
-			i = 0;
-
-		for ( ; (elem = elems[i]) != null; i++ ) {
-			if ( !keepData && elem.nodeType === 1 ) {
-				jQuery.cleanData( getAll( elem ) );
-			}
-
-			if ( elem.parentNode ) {
-				if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
-					setGlobalEval( getAll( elem, "script" ) );
-				}
-				elem.parentNode.removeChild( elem );
-			}
-		}
-
-		return this;
-	},
-
-	empty: function() {
-		var elem,
-			i = 0;
-
-		for ( ; (elem = this[i]) != null; i++ ) {
-			if ( elem.nodeType === 1 ) {
-
-				// Prevent memory leaks
-				jQuery.cleanData( getAll( elem, false ) );
-
-				// Remove any remaining nodes
-				elem.textContent = "";
-			}
-		}
-
-		return this;
-	},
-
-	clone: function( dataAndEvents, deepDataAndEvents ) {
-		dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
-		deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
-		return this.map(function() {
-			return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
-		});
-	},
-
-	html: function( value ) {
-		return access( this, function( value ) {
-			var elem = this[ 0 ] || {},
-				i = 0,
-				l = this.length;
-
-			if ( value === undefined && elem.nodeType === 1 ) {
-				return elem.innerHTML;
-			}
-
-			// See if we can take a shortcut and just use innerHTML
-			if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
-				!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
-
-				value = value.replace( rxhtmlTag, "<$1></$2>" );
-
-				try {
-					for ( ; i < l; i++ ) {
-						elem = this[ i ] || {};
-
-						// Remove element nodes and prevent memory leaks
-						if ( elem.nodeType === 1 ) {
-							jQuery.cleanData( getAll( elem, false ) );
-							elem.innerHTML = value;
-						}
-					}
-
-					elem = 0;
-
-				// If using innerHTML throws an exception, use the fallback method
-				} catch( e ) {}
-			}
-
-			if ( elem ) {
-				this.empty().append( value );
-			}
-		}, null, value, arguments.length );
-	},
-
-	replaceWith: function() {
-		var arg = arguments[ 0 ];
-
-		// Make the changes, replacing each context element with the new content
-		this.domManip( arguments, function( elem ) {
-			arg = this.parentNode;
-
-			jQuery.cleanData( getAll( this ) );
-
-			if ( arg ) {
-				arg.replaceChild( elem, this );
-			}
-		});
-
-		// Force removal if there was no new content (e.g., from empty arguments)
-		return arg && (arg.length || arg.nodeType) ? this : this.remove();
-	},
-
-	detach: function( selector ) {
-		return this.remove( selector, true );
-	},
-
-	domManip: function( args, callback ) {
-
-		// Flatten any nested arrays
-		args = concat.apply( [], args );
-
-		var fragment, first, scripts, hasScripts, node, doc,
-			i = 0,
-			l = this.length,
-			set = this,
-			iNoClone = l - 1,
-			value = args[ 0 ],
-			isFunction = jQuery.isFunction( value );
-
-		// We can't cloneNode fragments that contain checked, in WebKit
-		if ( isFunction ||
-				( l > 1 && typeof value === "string" &&
-					!support.checkClone && rchecked.test( value ) ) ) {
-			return this.each(function( index ) {
-				var self = set.eq( index );
-				if ( isFunction ) {
-					args[ 0 ] = value.call( this, index, self.html() );
-				}
-				self.domManip( args, callback );
-			});
-		}
-
-		if ( l ) {
-			fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
-			first = fragment.firstChild;
-
-			if ( fragment.childNodes.length === 1 ) {
-				fragment = first;
-			}
-
-			if ( first ) {
-				scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
-				hasScripts = scripts.length;
-
-				// Use the original fragment for the last item instead of the first because it can end up
-				// being emptied incorrectly in certain situations (#8070).
-				for ( ; i < l; i++ ) {
-					node = fragment;
-
-					if ( i !== iNoClone ) {
-						node = jQuery.clone( node, true, true );
-
-						// Keep references to cloned scripts for later restoration
-						if ( hasScripts ) {
-							// Support: QtWebKit
-							// jQuery.merge because push.apply(_, arraylike) throws
-							jQuery.merge( scripts, getAll( node, "script" ) );
-						}
-					}
-
-					callback.call( this[ i ], node, i );
-				}
-
-				if ( hasScripts ) {
-					doc = scripts[ scripts.length - 1 ].ownerDocument;
-
-					// Reenable scripts
-					jQuery.map( scripts, restoreScript );
-
-					// Evaluate executable scripts on first document insertion
-					for ( i = 0; i < hasScripts; i++ ) {
-						node = scripts[ i ];
-						if ( rscriptType.test( node.type || "" ) &&
-							!data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
-
-							if ( node.src ) {
-								// Optional AJAX dependency, but won't run scripts if not present
-								if ( jQuery._evalUrl ) {
-									jQuery._evalUrl( node.src );
-								}
-							} else {
-								jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
-							}
-						}
-					}
-				}
-			}
-		}
-
-		return this;
-	}
-});
-
-jQuery.each({
-	appendTo: "append",
-	prependTo: "prepend",
-	insertBefore: "before",
-	insertAfter: "after",
-	replaceAll: "replaceWith"
-}, function( name, original ) {
-	jQuery.fn[ name ] = function( selector ) {
-		var elems,
-			ret = [],
-			insert = jQuery( selector ),
-			last = insert.length - 1,
-			i = 0;
-
-		for ( ; i <= last; i++ ) {
-			elems = i === last ? this : this.clone( true );
-			jQuery( insert[ i ] )[ original ]( elems );
-
-			// Support: QtWebKit
-			// .get() because push.apply(_, arraylike) throws
-			push.apply( ret, elems.get() );
-		}
-
-		return this.pushStack( ret );
-	};
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation/_evalUrl.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation/_evalUrl.js
deleted file mode 100644
index 6704749..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation/_evalUrl.js
+++ /dev/null
@@ -1,18 +0,0 @@
-define([
-	"../ajax"
-], function( jQuery ) {
-
-jQuery._evalUrl = function( url ) {
-	return jQuery.ajax({
-		url: url,
-		type: "GET",
-		dataType: "script",
-		async: false,
-		global: false,
-		"throws": true
-	});
-};
-
-return jQuery._evalUrl;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation/support.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation/support.js
deleted file mode 100644
index 822a014..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation/support.js
+++ /dev/null
@@ -1,32 +0,0 @@
-define([
-	"../var/support"
-], function( support ) {
-
-(function() {
-	var fragment = document.createDocumentFragment(),
-		div = fragment.appendChild( document.createElement( "div" ) ),
-		input = document.createElement( "input" );
-
-	// Support: Safari<=5.1
-	// Check state lost if the name is set (#11217)
-	// Support: Windows Web Apps (WWA)
-	// `name` and `type` must use .setAttribute for WWA (#14901)
-	input.setAttribute( "type", "radio" );
-	input.setAttribute( "checked", "checked" );
-	input.setAttribute( "name", "t" );
-
-	div.appendChild( input );
-
-	// Support: Safari<=5.1, Android<4.2
-	// Older WebKit doesn't clone checked state correctly in fragments
-	support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
-	// Support: IE<=11+
-	// Make sure textarea (and checkbox) defaultValue is properly cloned
-	div.innerHTML = "<textarea>x</textarea>";
-	support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
-})();
-
-return support;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation/var/rcheckableType.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation/var/rcheckableType.js
deleted file mode 100644
index c27a15d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/manipulation/var/rcheckableType.js
+++ /dev/null
@@ -1,3 +0,0 @@
-define(function() {
-	return (/^(?:checkbox|radio)$/i);
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/offset.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/offset.js
deleted file mode 100644
index 4c34fd0..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/offset.js
+++ /dev/null
@@ -1,207 +0,0 @@
-define([
-	"./core",
-	"./var/strundefined",
-	"./core/access",
-	"./css/var/rnumnonpx",
-	"./css/curCSS",
-	"./css/addGetHookIf",
-	"./css/support",
-
-	"./core/init",
-	"./css",
-	"./selector" // contains
-], function( jQuery, strundefined, access, rnumnonpx, curCSS, addGetHookIf, support ) {
-
-var docElem = window.document.documentElement;
-
-/**
- * Gets a window from an element
- */
-function getWindow( elem ) {
-	return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
-}
-
-jQuery.offset = {
-	setOffset: function( elem, options, i ) {
-		var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
-			position = jQuery.css( elem, "position" ),
-			curElem = jQuery( elem ),
-			props = {};
-
-		// Set position first, in-case top/left are set even on static elem
-		if ( position === "static" ) {
-			elem.style.position = "relative";
-		}
-
-		curOffset = curElem.offset();
-		curCSSTop = jQuery.css( elem, "top" );
-		curCSSLeft = jQuery.css( elem, "left" );
-		calculatePosition = ( position === "absolute" || position === "fixed" ) &&
-			( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
-
-		// Need to be able to calculate position if either
-		// top or left is auto and position is either absolute or fixed
-		if ( calculatePosition ) {
-			curPosition = curElem.position();
-			curTop = curPosition.top;
-			curLeft = curPosition.left;
-
-		} else {
-			curTop = parseFloat( curCSSTop ) || 0;
-			curLeft = parseFloat( curCSSLeft ) || 0;
-		}
-
-		if ( jQuery.isFunction( options ) ) {
-			options = options.call( elem, i, curOffset );
-		}
-
-		if ( options.top != null ) {
-			props.top = ( options.top - curOffset.top ) + curTop;
-		}
-		if ( options.left != null ) {
-			props.left = ( options.left - curOffset.left ) + curLeft;
-		}
-
-		if ( "using" in options ) {
-			options.using.call( elem, props );
-
-		} else {
-			curElem.css( props );
-		}
-	}
-};
-
-jQuery.fn.extend({
-	offset: function( options ) {
-		if ( arguments.length ) {
-			return options === undefined ?
-				this :
-				this.each(function( i ) {
-					jQuery.offset.setOffset( this, options, i );
-				});
-		}
-
-		var docElem, win,
-			elem = this[ 0 ],
-			box = { top: 0, left: 0 },
-			doc = elem && elem.ownerDocument;
-
-		if ( !doc ) {
-			return;
-		}
-
-		docElem = doc.documentElement;
-
-		// Make sure it's not a disconnected DOM node
-		if ( !jQuery.contains( docElem, elem ) ) {
-			return box;
-		}
-
-		// Support: BlackBerry 5, iOS 3 (original iPhone)
-		// If we don't have gBCR, just use 0,0 rather than error
-		if ( typeof elem.getBoundingClientRect !== strundefined ) {
-			box = elem.getBoundingClientRect();
-		}
-		win = getWindow( doc );
-		return {
-			top: box.top + win.pageYOffset - docElem.clientTop,
-			left: box.left + win.pageXOffset - docElem.clientLeft
-		};
-	},
-
-	position: function() {
-		if ( !this[ 0 ] ) {
-			return;
-		}
-
-		var offsetParent, offset,
-			elem = this[ 0 ],
-			parentOffset = { top: 0, left: 0 };
-
-		// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
-		if ( jQuery.css( elem, "position" ) === "fixed" ) {
-			// Assume getBoundingClientRect is there when computed position is fixed
-			offset = elem.getBoundingClientRect();
-
-		} else {
-			// Get *real* offsetParent
-			offsetParent = this.offsetParent();
-
-			// Get correct offsets
-			offset = this.offset();
-			if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
-				parentOffset = offsetParent.offset();
-			}
-
-			// Add offsetParent borders
-			parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
-			parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
-		}
-
-		// Subtract parent offsets and element margins
-		return {
-			top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
-			left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
-		};
-	},
-
-	offsetParent: function() {
-		return this.map(function() {
-			var offsetParent = this.offsetParent || docElem;
-
-			while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
-				offsetParent = offsetParent.offsetParent;
-			}
-
-			return offsetParent || docElem;
-		});
-	}
-});
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
-	var top = "pageYOffset" === prop;
-
-	jQuery.fn[ method ] = function( val ) {
-		return access( this, function( elem, method, val ) {
-			var win = getWindow( elem );
-
-			if ( val === undefined ) {
-				return win ? win[ prop ] : elem[ method ];
-			}
-
-			if ( win ) {
-				win.scrollTo(
-					!top ? val : window.pageXOffset,
-					top ? val : window.pageYOffset
-				);
-
-			} else {
-				elem[ method ] = val;
-			}
-		}, method, val, arguments.length, null );
-	};
-});
-
-// Support: Safari<7+, Chrome<37+
-// Add the top/left cssHooks using jQuery.fn.position
-// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
-// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
-// getComputedStyle returns percent when specified for top/left/bottom/right;
-// rather than make the css module depend on the offset module, just check for it here
-jQuery.each( [ "top", "left" ], function( i, prop ) {
-	jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
-		function( elem, computed ) {
-			if ( computed ) {
-				computed = curCSS( elem, prop );
-				// If curCSS returns percentage, fallback to offset
-				return rnumnonpx.test( computed ) ?
-					jQuery( elem ).position()[ prop ] + "px" :
-					computed;
-			}
-		}
-	);
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/outro.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/outro.js
deleted file mode 100644
index be4600a..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/outro.js
+++ /dev/null
@@ -1 +0,0 @@
-}));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/queue.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/queue.js
deleted file mode 100644
index 199c56d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/queue.js
+++ /dev/null
@@ -1,142 +0,0 @@
-define([
-	"./core",
-	"./data/var/data_priv",
-	"./deferred",
-	"./callbacks"
-], function( jQuery, data_priv ) {
-
-jQuery.extend({
-	queue: function( elem, type, data ) {
-		var queue;
-
-		if ( elem ) {
-			type = ( type || "fx" ) + "queue";
-			queue = data_priv.get( elem, type );
-
-			// Speed up dequeue by getting out quickly if this is just a lookup
-			if ( data ) {
-				if ( !queue || jQuery.isArray( data ) ) {
-					queue = data_priv.access( elem, type, jQuery.makeArray(data) );
-				} else {
-					queue.push( data );
-				}
-			}
-			return queue || [];
-		}
-	},
-
-	dequeue: function( elem, type ) {
-		type = type || "fx";
-
-		var queue = jQuery.queue( elem, type ),
-			startLength = queue.length,
-			fn = queue.shift(),
-			hooks = jQuery._queueHooks( elem, type ),
-			next = function() {
-				jQuery.dequeue( elem, type );
-			};
-
-		// If the fx queue is dequeued, always remove the progress sentinel
-		if ( fn === "inprogress" ) {
-			fn = queue.shift();
-			startLength--;
-		}
-
-		if ( fn ) {
-
-			// Add a progress sentinel to prevent the fx queue from being
-			// automatically dequeued
-			if ( type === "fx" ) {
-				queue.unshift( "inprogress" );
-			}
-
-			// Clear up the last queue stop function
-			delete hooks.stop;
-			fn.call( elem, next, hooks );
-		}
-
-		if ( !startLength && hooks ) {
-			hooks.empty.fire();
-		}
-	},
-
-	// Not public - generate a queueHooks object, or return the current one
-	_queueHooks: function( elem, type ) {
-		var key = type + "queueHooks";
-		return data_priv.get( elem, key ) || data_priv.access( elem, key, {
-			empty: jQuery.Callbacks("once memory").add(function() {
-				data_priv.remove( elem, [ type + "queue", key ] );
-			})
-		});
-	}
-});
-
-jQuery.fn.extend({
-	queue: function( type, data ) {
-		var setter = 2;
-
-		if ( typeof type !== "string" ) {
-			data = type;
-			type = "fx";
-			setter--;
-		}
-
-		if ( arguments.length < setter ) {
-			return jQuery.queue( this[0], type );
-		}
-
-		return data === undefined ?
-			this :
-			this.each(function() {
-				var queue = jQuery.queue( this, type, data );
-
-				// Ensure a hooks for this queue
-				jQuery._queueHooks( this, type );
-
-				if ( type === "fx" && queue[0] !== "inprogress" ) {
-					jQuery.dequeue( this, type );
-				}
-			});
-	},
-	dequeue: function( type ) {
-		return this.each(function() {
-			jQuery.dequeue( this, type );
-		});
-	},
-	clearQueue: function( type ) {
-		return this.queue( type || "fx", [] );
-	},
-	// Get a promise resolved when queues of a certain type
-	// are emptied (fx is the type by default)
-	promise: function( type, obj ) {
-		var tmp,
-			count = 1,
-			defer = jQuery.Deferred(),
-			elements = this,
-			i = this.length,
-			resolve = function() {
-				if ( !( --count ) ) {
-					defer.resolveWith( elements, [ elements ] );
-				}
-			};
-
-		if ( typeof type !== "string" ) {
-			obj = type;
-			type = undefined;
-		}
-		type = type || "fx";
-
-		while ( i-- ) {
-			tmp = data_priv.get( elements[ i ], type + "queueHooks" );
-			if ( tmp && tmp.empty ) {
-				count++;
-				tmp.empty.add( resolve );
-			}
-		}
-		resolve();
-		return defer.promise( obj );
-	}
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/queue/delay.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/queue/delay.js
deleted file mode 100644
index 4b4498c..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/queue/delay.js
+++ /dev/null
@@ -1,22 +0,0 @@
-define([
-	"../core",
-	"../queue",
-	"../effects" // Delay is optional because of this dependency
-], function( jQuery ) {
-
-// Based off of the plugin by Clint Helfers, with permission.
-// http://blindsignals.com/index.php/2009/07/jquery-delay/
-jQuery.fn.delay = function( time, type ) {
-	time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
-	type = type || "fx";
-
-	return this.queue( type, function( next, hooks ) {
-		var timeout = setTimeout( next, time );
-		hooks.stop = function() {
-			clearTimeout( timeout );
-		};
-	});
-};
-
-return jQuery.fn.delay;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/selector-native.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/selector-native.js
deleted file mode 100644
index d8163c2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/selector-native.js
+++ /dev/null
@@ -1,172 +0,0 @@
-define([
-	"./core"
-], function( jQuery ) {
-
-/*
- * Optional (non-Sizzle) selector module for custom builds.
- *
- * Note that this DOES NOT SUPPORT many documented jQuery
- * features in exchange for its smaller size:
- *
- * Attribute not equal selector
- * Positional selectors (:first; :eq(n); :odd; etc.)
- * Type selectors (:input; :checkbox; :button; etc.)
- * State-based selectors (:animated; :visible; :hidden; etc.)
- * :has(selector)
- * :not(complex selector)
- * custom selectors via Sizzle extensions
- * Leading combinators (e.g., $collection.find("> *"))
- * Reliable functionality on XML fragments
- * Requiring all parts of a selector to match elements under context
- *   (e.g., $div.find("div > *") now matches children of $div)
- * Matching against non-elements
- * Reliable sorting of disconnected nodes
- * querySelectorAll bug fixes (e.g., unreliable :focus on WebKit)
- *
- * If any of these are unacceptable tradeoffs, either use Sizzle or
- * customize this stub for the project's specific needs.
- */
-
-var docElem = window.document.documentElement,
-	selector_hasDuplicate,
-	matches = docElem.matches ||
-		docElem.webkitMatchesSelector ||
-		docElem.mozMatchesSelector ||
-		docElem.oMatchesSelector ||
-		docElem.msMatchesSelector,
-	selector_sortOrder = function( a, b ) {
-		// Flag for duplicate removal
-		if ( a === b ) {
-			selector_hasDuplicate = true;
-			return 0;
-		}
-
-		var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
-
-		if ( compare ) {
-			// Disconnected nodes
-			if ( compare & 1 ) {
-
-				// Choose the first element that is related to our document
-				if ( a === document || jQuery.contains(document, a) ) {
-					return -1;
-				}
-				if ( b === document || jQuery.contains(document, b) ) {
-					return 1;
-				}
-
-				// Maintain original order
-				return 0;
-			}
-
-			return compare & 4 ? -1 : 1;
-		}
-
-		// Not directly comparable, sort on existence of method
-		return a.compareDocumentPosition ? -1 : 1;
-	};
-
-jQuery.extend({
-	find: function( selector, context, results, seed ) {
-		var elem, nodeType,
-			i = 0;
-
-		results = results || [];
-		context = context || document;
-
-		// Same basic safeguard as Sizzle
-		if ( !selector || typeof selector !== "string" ) {
-			return results;
-		}
-
-		// Early return if context is not an element or document
-		if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
-			return [];
-		}
-
-		if ( seed ) {
-			while ( (elem = seed[i++]) ) {
-				if ( jQuery.find.matchesSelector(elem, selector) ) {
-					results.push( elem );
-				}
-			}
-		} else {
-			jQuery.merge( results, context.querySelectorAll(selector) );
-		}
-
-		return results;
-	},
-	unique: function( results ) {
-		var elem,
-			duplicates = [],
-			i = 0,
-			j = 0;
-
-		selector_hasDuplicate = false;
-		results.sort( selector_sortOrder );
-
-		if ( selector_hasDuplicate ) {
-			while ( (elem = results[i++]) ) {
-				if ( elem === results[ i ] ) {
-					j = duplicates.push( i );
-				}
-			}
-			while ( j-- ) {
-				results.splice( duplicates[ j ], 1 );
-			}
-		}
-
-		return results;
-	},
-	text: function( elem ) {
-		var node,
-			ret = "",
-			i = 0,
-			nodeType = elem.nodeType;
-
-		if ( !nodeType ) {
-			// If no nodeType, this is expected to be an array
-			while ( (node = elem[i++]) ) {
-				// Do not traverse comment nodes
-				ret += jQuery.text( node );
-			}
-		} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
-			// Use textContent for elements
-			return elem.textContent;
-		} else if ( nodeType === 3 || nodeType === 4 ) {
-			return elem.nodeValue;
-		}
-		// Do not include comment or processing instruction nodes
-
-		return ret;
-	},
-	contains: function( a, b ) {
-		var adown = a.nodeType === 9 ? a.documentElement : a,
-			bup = b && b.parentNode;
-		return a === bup || !!( bup && bup.nodeType === 1 && adown.contains(bup) );
-	},
-	isXMLDoc: function( elem ) {
-		return (elem.ownerDocument || elem).documentElement.nodeName !== "HTML";
-	},
-	expr: {
-		attrHandle: {},
-		match: {
-			bool: /^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i,
-			needsContext: /^[\x20\t\r\n\f]*[>+~]/
-		}
-	}
-});
-
-jQuery.extend( jQuery.find, {
-	matches: function( expr, elements ) {
-		return jQuery.find( expr, null, null, elements );
-	},
-	matchesSelector: function( elem, expr ) {
-		return matches.call( elem, expr );
-	},
-	attr: function( elem, name ) {
-		return elem.getAttribute( name );
-	}
-});
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/selector-sizzle.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/selector-sizzle.js
deleted file mode 100644
index 7d3926b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/selector-sizzle.js
+++ /dev/null
@@ -1,14 +0,0 @@
-define([
-	"./core",
-	"sizzle"
-], function( jQuery, Sizzle ) {
-
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.pseudos;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/selector.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/selector.js
deleted file mode 100644
index 01e9733..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/selector.js
+++ /dev/null
@@ -1 +0,0 @@
-define([ "./selector-sizzle" ]);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/serialize.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/serialize.js
deleted file mode 100644
index 0d6dfec..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/serialize.js
+++ /dev/null
@@ -1,111 +0,0 @@
-define([
-	"./core",
-	"./manipulation/var/rcheckableType",
-	"./core/init",
-	"./traversing", // filter
-	"./attributes/prop"
-], function( jQuery, rcheckableType ) {
-
-var r20 = /%20/g,
-	rbracket = /\[\]$/,
-	rCRLF = /\r?\n/g,
-	rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
-	rsubmittable = /^(?:input|select|textarea|keygen)/i;
-
-function buildParams( prefix, obj, traditional, add ) {
-	var name;
-
-	if ( jQuery.isArray( obj ) ) {
-		// Serialize array item.
-		jQuery.each( obj, function( i, v ) {
-			if ( traditional || rbracket.test( prefix ) ) {
-				// Treat each array item as a scalar.
-				add( prefix, v );
-
-			} else {
-				// Item is non-scalar (array or object), encode its numeric index.
-				buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
-			}
-		});
-
-	} else if ( !traditional && jQuery.type( obj ) === "object" ) {
-		// Serialize object item.
-		for ( name in obj ) {
-			buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
-		}
-
-	} else {
-		// Serialize scalar item.
-		add( prefix, obj );
-	}
-}
-
-// Serialize an array of form elements or a set of
-// key/values into a query string
-jQuery.param = function( a, traditional ) {
-	var prefix,
-		s = [],
-		add = function( key, value ) {
-			// If value is a function, invoke it and return its value
-			value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
-			s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
-		};
-
-	// Set traditional to true for jQuery <= 1.3.2 behavior.
-	if ( traditional === undefined ) {
-		traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
-	}
-
-	// If an array was passed in, assume that it is an array of form elements.
-	if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
-		// Serialize the form elements
-		jQuery.each( a, function() {
-			add( this.name, this.value );
-		});
-
-	} else {
-		// If traditional, encode the "old" way (the way 1.3.2 or older
-		// did it), otherwise encode params recursively.
-		for ( prefix in a ) {
-			buildParams( prefix, a[ prefix ], traditional, add );
-		}
-	}
-
-	// Return the resulting serialization
-	return s.join( "&" ).replace( r20, "+" );
-};
-
-jQuery.fn.extend({
-	serialize: function() {
-		return jQuery.param( this.serializeArray() );
-	},
-	serializeArray: function() {
-		return this.map(function() {
-			// Can add propHook for "elements" to filter or add form elements
-			var elements = jQuery.prop( this, "elements" );
-			return elements ? jQuery.makeArray( elements ) : this;
-		})
-		.filter(function() {
-			var type = this.type;
-
-			// Use .is( ":disabled" ) so that fieldset[disabled] works
-			return this.name && !jQuery( this ).is( ":disabled" ) &&
-				rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
-				( this.checked || !rcheckableType.test( type ) );
-		})
-		.map(function( i, elem ) {
-			var val = jQuery( this ).val();
-
-			return val == null ?
-				null :
-				jQuery.isArray( val ) ?
-					jQuery.map( val, function( val ) {
-						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-					}) :
-					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-		}).get();
-	}
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/sizzle/dist/sizzle.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/sizzle/dist/sizzle.js
deleted file mode 100644
index 89aecbc..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/sizzle/dist/sizzle.js
+++ /dev/null
@@ -1,2067 +0,0 @@
-/*!
- * Sizzle CSS Selector Engine v2.2.0-pre
- * http://sizzlejs.com/
- *
- * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2014-12-16
- */
-(function( window ) {
-
-var i,
-	support,
-	Expr,
-	getText,
-	isXML,
-	tokenize,
-	compile,
-	select,
-	outermostContext,
-	sortInput,
-	hasDuplicate,
-
-	// Local document vars
-	setDocument,
-	document,
-	docElem,
-	documentIsHTML,
-	rbuggyQSA,
-	rbuggyMatches,
-	matches,
-	contains,
-
-	// Instance-specific data
-	expando = "sizzle" + 1 * new Date(),
-	preferredDoc = window.document,
-	dirruns = 0,
-	done = 0,
-	classCache = createCache(),
-	tokenCache = createCache(),
-	compilerCache = createCache(),
-	sortOrder = function( a, b ) {
-		if ( a === b ) {
-			hasDuplicate = true;
-		}
-		return 0;
-	},
-
-	// General-purpose constants
-	MAX_NEGATIVE = 1 << 31,
-
-	// Instance methods
-	hasOwn = ({}).hasOwnProperty,
-	arr = [],
-	pop = arr.pop,
-	push_native = arr.push,
-	push = arr.push,
-	slice = arr.slice,
-	// Use a stripped-down indexOf as it's faster than native
-	// http://jsperf.com/thor-indexof-vs-for/5
-	indexOf = function( list, elem ) {
-		var i = 0,
-			len = list.length;
-		for ( ; i < len; i++ ) {
-			if ( list[i] === elem ) {
-				return i;
-			}
-		}
-		return -1;
-	},
-
-	booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
-
-	// Regular expressions
-
-	// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
-	whitespace = "[\\x20\\t\\r\\n\\f]",
-	// http://www.w3.org/TR/css3-syntax/#characters
-	characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
-
-	// Loosely modeled on CSS identifier characters
-	// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
-	// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
-	identifier = characterEncoding.replace( "w", "w#" ),
-
-	// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
-	attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
-		// Operator (capture 2)
-		"*([*^$|!~]?=)" + whitespace +
-		// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
-		"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
-		"*\\]",
-
-	pseudos = ":(" + characterEncoding + ")(?:\\((" +
-		// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
-		// 1. quoted (capture 3; capture 4 or capture 5)
-		"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
-		// 2. simple (capture 6)
-		"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
-		// 3. anything else (capture 2)
-		".*" +
-		")\\)|)",
-
-	// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
-	rwhitespace = new RegExp( whitespace + "+", "g" ),
-	rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
-	rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
-	rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
-
-	rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
-
-	rpseudo = new RegExp( pseudos ),
-	ridentifier = new RegExp( "^" + identifier + "$" ),
-
-	matchExpr = {
-		"ID": new RegExp( "^#(" + characterEncoding + ")" ),
-		"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
-		"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
-		"ATTR": new RegExp( "^" + attributes ),
-		"PSEUDO": new RegExp( "^" + pseudos ),
-		"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
-			"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
-			"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
-		"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
-		// For use in libraries implementing .is()
-		// We use this for POS matching in `select`
-		"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
-			whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
-	},
-
-	rinputs = /^(?:input|select|textarea|button)$/i,
-	rheader = /^h\d$/i,
-
-	rnative = /^[^{]+\{\s*\[native \w/,
-
-	// Easily-parseable/retrievable ID or TAG or CLASS selectors
-	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
-	rsibling = /[+~]/,
-	rescape = /'|\\/g,
-
-	// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
-	runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
-	funescape = function( _, escaped, escapedWhitespace ) {
-		var high = "0x" + escaped - 0x10000;
-		// NaN means non-codepoint
-		// Support: Firefox<24
-		// Workaround erroneous numeric interpretation of +"0x"
-		return high !== high || escapedWhitespace ?
-			escaped :
-			high < 0 ?
-				// BMP codepoint
-				String.fromCharCode( high + 0x10000 ) :
-				// Supplemental Plane codepoint (surrogate pair)
-				String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
-	},
-
-	// Used for iframes
-	// See setDocument()
-	// Removing the function wrapper causes a "Permission Denied"
-	// error in IE
-	unloadHandler = function() {
-		setDocument();
-	};
-
-// Optimize for push.apply( _, NodeList )
-try {
-	push.apply(
-		(arr = slice.call( preferredDoc.childNodes )),
-		preferredDoc.childNodes
-	);
-	// Support: Android<4.0
-	// Detect silently failing push.apply
-	arr[ preferredDoc.childNodes.length ].nodeType;
-} catch ( e ) {
-	push = { apply: arr.length ?
-
-		// Leverage slice if possible
-		function( target, els ) {
-			push_native.apply( target, slice.call(els) );
-		} :
-
-		// Support: IE<9
-		// Otherwise append directly
-		function( target, els ) {
-			var j = target.length,
-				i = 0;
-			// Can't trust NodeList.length
-			while ( (target[j++] = els[i++]) ) {}
-			target.length = j - 1;
-		}
-	};
-}
-
-function Sizzle( selector, context, results, seed ) {
-	var match, elem, m, nodeType,
-		// QSA vars
-		i, groups, old, nid, newContext, newSelector;
-
-	if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
-		setDocument( context );
-	}
-
-	context = context || document;
-	results = results || [];
-	nodeType = context.nodeType;
-
-	if ( typeof selector !== "string" || !selector ||
-		nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
-
-		return results;
-	}
-
-	if ( !seed && documentIsHTML ) {
-
-		// Try to shortcut find operations when possible (e.g., not under DocumentFragment)
-		if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
-			// Speed-up: Sizzle("#ID")
-			if ( (m = match[1]) ) {
-				if ( nodeType === 9 ) {
-					elem = context.getElementById( m );
-					// Check parentNode to catch when Blackberry 4.6 returns
-					// nodes that are no longer in the document (jQuery #6963)
-					if ( elem && elem.parentNode ) {
-						// Handle the case where IE, Opera, and Webkit return items
-						// by name instead of ID
-						if ( elem.id === m ) {
-							results.push( elem );
-							return results;
-						}
-					} else {
-						return results;
-					}
-				} else {
-					// Context is not a document
-					if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
-						contains( context, elem ) && elem.id === m ) {
-						results.push( elem );
-						return results;
-					}
-				}
-
-			// Speed-up: Sizzle("TAG")
-			} else if ( match[2] ) {
-				push.apply( results, context.getElementsByTagName( selector ) );
-				return results;
-
-			// Speed-up: Sizzle(".CLASS")
-			} else if ( (m = match[3]) && support.getElementsByClassName ) {
-				push.apply( results, context.getElementsByClassName( m ) );
-				return results;
-			}
-		}
-
-		// QSA path
-		if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
-			nid = old = expando;
-			newContext = context;
-			newSelector = nodeType !== 1 && selector;
-
-			// qSA works strangely on Element-rooted queries
-			// We can work around this by specifying an extra ID on the root
-			// and working up from there (Thanks to Andrew Dupont for the technique)
-			// IE 8 doesn't work on object elements
-			if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
-				groups = tokenize( selector );
-
-				if ( (old = context.getAttribute("id")) ) {
-					nid = old.replace( rescape, "\\$&" );
-				} else {
-					context.setAttribute( "id", nid );
-				}
-				nid = "[id='" + nid + "'] ";
-
-				i = groups.length;
-				while ( i-- ) {
-					groups[i] = nid + toSelector( groups[i] );
-				}
-				newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
-				newSelector = groups.join(",");
-			}
-
-			if ( newSelector ) {
-				try {
-					push.apply( results,
-						newContext.querySelectorAll( newSelector )
-					);
-					return results;
-				} catch(qsaError) {
-				} finally {
-					if ( !old ) {
-						context.removeAttribute("id");
-					}
-				}
-			}
-		}
-	}
-
-	// All others
-	return select( selector.replace( rtrim, "$1" ), context, results, seed );
-}
-
-/**
- * Create key-value caches of limited size
- * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
- *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- *	deleting the oldest entry
- */
-function createCache() {
-	var keys = [];
-
-	function cache( key, value ) {
-		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
-		if ( keys.push( key + " " ) > Expr.cacheLength ) {
-			// Only keep the most recent entries
-			delete cache[ keys.shift() ];
-		}
-		return (cache[ key + " " ] = value);
-	}
-	return cache;
-}
-
-/**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
-function markFunction( fn ) {
-	fn[ expando ] = true;
-	return fn;
-}
-
-/**
- * Support testing using an element
- * @param {Function} fn Passed the created div and expects a boolean result
- */
-function assert( fn ) {
-	var div = document.createElement("div");
-
-	try {
-		return !!fn( div );
-	} catch (e) {
-		return false;
-	} finally {
-		// Remove from its parent by default
-		if ( div.parentNode ) {
-			div.parentNode.removeChild( div );
-		}
-		// release memory in IE
-		div = null;
-	}
-}
-
-/**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
-function addHandle( attrs, handler ) {
-	var arr = attrs.split("|"),
-		i = attrs.length;
-
-	while ( i-- ) {
-		Expr.attrHandle[ arr[i] ] = handler;
-	}
-}
-
-/**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
-function siblingCheck( a, b ) {
-	var cur = b && a,
-		diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
-			( ~b.sourceIndex || MAX_NEGATIVE ) -
-			( ~a.sourceIndex || MAX_NEGATIVE );
-
-	// Use IE sourceIndex if available on both nodes
-	if ( diff ) {
-		return diff;
-	}
-
-	// Check if b follows a
-	if ( cur ) {
-		while ( (cur = cur.nextSibling) ) {
-			if ( cur === b ) {
-				return -1;
-			}
-		}
-	}
-
-	return a ? 1 : -1;
-}
-
-/**
- * Returns a function to use in pseudos for input types
- * @param {String} type
- */
-function createInputPseudo( type ) {
-	return function( elem ) {
-		var name = elem.nodeName.toLowerCase();
-		return name === "input" && elem.type === type;
-	};
-}
-
-/**
- * Returns a function to use in pseudos for buttons
- * @param {String} type
- */
-function createButtonPseudo( type ) {
-	return function( elem ) {
-		var name = elem.nodeName.toLowerCase();
-		return (name === "input" || name === "button") && elem.type === type;
-	};
-}
-
-/**
- * Returns a function to use in pseudos for positionals
- * @param {Function} fn
- */
-function createPositionalPseudo( fn ) {
-	return markFunction(function( argument ) {
-		argument = +argument;
-		return markFunction(function( seed, matches ) {
-			var j,
-				matchIndexes = fn( [], seed.length, argument ),
-				i = matchIndexes.length;
-
-			// Match elements found at the specified indexes
-			while ( i-- ) {
-				if ( seed[ (j = matchIndexes[i]) ] ) {
-					seed[j] = !(matches[j] = seed[j]);
-				}
-			}
-		});
-	});
-}
-
-/**
- * Checks a node for validity as a Sizzle context
- * @param {Element|Object=} context
- * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
- */
-function testContext( context ) {
-	return context && typeof context.getElementsByTagName !== "undefined" && context;
-}
-
-// Expose support vars for convenience
-support = Sizzle.support = {};
-
-/**
- * Detects XML nodes
- * @param {Element|Object} elem An element or a document
- * @returns {Boolean} True iff elem is a non-HTML XML node
- */
-isXML = Sizzle.isXML = function( elem ) {
-	// documentElement is verified for cases where it doesn't yet exist
-	// (such as loading iframes in IE - #4833)
-	var documentElement = elem && (elem.ownerDocument || elem).documentElement;
-	return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-/**
- * Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
- * @returns {Object} Returns the current document
- */
-setDocument = Sizzle.setDocument = function( node ) {
-	var hasCompare, parent,
-		doc = node ? node.ownerDocument || node : preferredDoc;
-
-	// If no document and documentElement is available, return
-	if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
-		return document;
-	}
-
-	// Set our document
-	document = doc;
-	docElem = doc.documentElement;
-	parent = doc.defaultView;
-
-	// Support: IE>8
-	// If iframe document is assigned to "document" variable and if iframe has been reloaded,
-	// IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
-	// IE6-8 do not support the defaultView property so parent will be undefined
-	if ( parent && parent !== parent.top ) {
-		// IE11 does not have attachEvent, so all must suffer
-		if ( parent.addEventListener ) {
-			parent.addEventListener( "unload", unloadHandler, false );
-		} else if ( parent.attachEvent ) {
-			parent.attachEvent( "onunload", unloadHandler );
-		}
-	}
-
-	/* Support tests
-	---------------------------------------------------------------------- */
-	documentIsHTML = !isXML( doc );
-
-	/* Attributes
-	---------------------------------------------------------------------- */
-
-	// Support: IE<8
-	// Verify that getAttribute really returns attributes and not properties
-	// (excepting IE8 booleans)
-	support.attributes = assert(function( div ) {
-		div.className = "i";
-		return !div.getAttribute("className");
-	});
-
-	/* getElement(s)By*
-	---------------------------------------------------------------------- */
-
-	// Check if getElementsByTagName("*") returns only elements
-	support.getElementsByTagName = assert(function( div ) {
-		div.appendChild( doc.createComment("") );
-		return !div.getElementsByTagName("*").length;
-	});
-
-	// Support: IE<9
-	support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
-
-	// Support: IE<10
-	// Check if getElementById returns elements by name
-	// The broken getElementById methods don't pick up programatically-set names,
-	// so use a roundabout getElementsByName test
-	support.getById = assert(function( div ) {
-		docElem.appendChild( div ).id = expando;
-		return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
-	});
-
-	// ID find and filter
-	if ( support.getById ) {
-		Expr.find["ID"] = function( id, context ) {
-			if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
-				var m = context.getElementById( id );
-				// Check parentNode to catch when Blackberry 4.6 returns
-				// nodes that are no longer in the document #6963
-				return m && m.parentNode ? [ m ] : [];
-			}
-		};
-		Expr.filter["ID"] = function( id ) {
-			var attrId = id.replace( runescape, funescape );
-			return function( elem ) {
-				return elem.getAttribute("id") === attrId;
-			};
-		};
-	} else {
-		// Support: IE6/7
-		// getElementById is not reliable as a find shortcut
-		delete Expr.find["ID"];
-
-		Expr.filter["ID"] =  function( id ) {
-			var attrId = id.replace( runescape, funescape );
-			return function( elem ) {
-				var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-				return node && node.value === attrId;
-			};
-		};
-	}
-
-	// Tag
-	Expr.find["TAG"] = support.getElementsByTagName ?
-		function( tag, context ) {
-			if ( typeof context.getElementsByTagName !== "undefined" ) {
-				return context.getElementsByTagName( tag );
-
-			// DocumentFragment nodes don't have gEBTN
-			} else if ( support.qsa ) {
-				return context.querySelectorAll( tag );
-			}
-		} :
-
-		function( tag, context ) {
-			var elem,
-				tmp = [],
-				i = 0,
-				// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
-				results = context.getElementsByTagName( tag );
-
-			// Filter out possible comments
-			if ( tag === "*" ) {
-				while ( (elem = results[i++]) ) {
-					if ( elem.nodeType === 1 ) {
-						tmp.push( elem );
-					}
-				}
-
-				return tmp;
-			}
-			return results;
-		};
-
-	// Class
-	Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
-		if ( documentIsHTML ) {
-			return context.getElementsByClassName( className );
-		}
-	};
-
-	/* QSA/matchesSelector
-	---------------------------------------------------------------------- */
-
-	// QSA and matchesSelector support
-
-	// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
-	rbuggyMatches = [];
-
-	// qSa(:focus) reports false when true (Chrome 21)
-	// We allow this because of a bug in IE8/9 that throws an error
-	// whenever `document.activeElement` is accessed on an iframe
-	// So, we allow :focus to pass through QSA all the time to avoid the IE error
-	// See http://bugs.jquery.com/ticket/13378
-	rbuggyQSA = [];
-
-	if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
-		// Build QSA regex
-		// Regex strategy adopted from Diego Perini
-		assert(function( div ) {
-			// Select is set to empty string on purpose
-			// This is to test IE's treatment of not explicitly
-			// setting a boolean content attribute,
-			// since its presence should be enough
-			// http://bugs.jquery.com/ticket/12359
-			docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
-				"<select id='" + expando + "-\f]' msallowcapture=''>" +
-				"<option selected=''></option></select>";
-
-			// Support: IE8, Opera 11-12.16
-			// Nothing should be selected when empty strings follow ^= or $= or *=
-			// The test attribute must be unknown in Opera but "safe" for WinRT
-			// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
-			if ( div.querySelectorAll("[msallowcapture^='']").length ) {
-				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
-			}
-
-			// Support: IE8
-			// Boolean attributes and "value" are not treated correctly
-			if ( !div.querySelectorAll("[selected]").length ) {
-				rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
-			}
-
-			// Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
-			if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
-				rbuggyQSA.push("~=");
-			}
-
-			// Webkit/Opera - :checked should return selected option elements
-			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
-			// IE8 throws error here and will not see later tests
-			if ( !div.querySelectorAll(":checked").length ) {
-				rbuggyQSA.push(":checked");
-			}
-
-			// Support: Safari 8+, iOS 8+
-			// https://bugs.webkit.org/show_bug.cgi?id=136851
-			// In-page `selector#id sibing-combinator selector` fails
-			if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
-				rbuggyQSA.push(".#.+[+~]");
-			}
-		});
-
-		assert(function( div ) {
-			// Support: Windows 8 Native Apps
-			// The type and name attributes are restricted during .innerHTML assignment
-			var input = doc.createElement("input");
-			input.setAttribute( "type", "hidden" );
-			div.appendChild( input ).setAttribute( "name", "D" );
-
-			// Support: IE8
-			// Enforce case-sensitivity of name attribute
-			if ( div.querySelectorAll("[name=d]").length ) {
-				rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
-			}
-
-			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
-			// IE8 throws error here and will not see later tests
-			if ( !div.querySelectorAll(":enabled").length ) {
-				rbuggyQSA.push( ":enabled", ":disabled" );
-			}
-
-			// Opera 10-11 does not throw on post-comma invalid pseudos
-			div.querySelectorAll("*,:x");
-			rbuggyQSA.push(",.*:");
-		});
-	}
-
-	if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
-		docElem.webkitMatchesSelector ||
-		docElem.mozMatchesSelector ||
-		docElem.oMatchesSelector ||
-		docElem.msMatchesSelector) )) ) {
-
-		assert(function( div ) {
-			// Check to see if it's possible to do matchesSelector
-			// on a disconnected node (IE 9)
-			support.disconnectedMatch = matches.call( div, "div" );
-
-			// This should fail with an exception
-			// Gecko does not error, returns false instead
-			matches.call( div, "[s!='']:x" );
-			rbuggyMatches.push( "!=", pseudos );
-		});
-	}
-
-	rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
-	rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
-
-	/* Contains
-	---------------------------------------------------------------------- */
-	hasCompare = rnative.test( docElem.compareDocumentPosition );
-
-	// Element contains another
-	// Purposefully does not implement inclusive descendent
-	// As in, an element does not contain itself
-	contains = hasCompare || rnative.test( docElem.contains ) ?
-		function( a, b ) {
-			var adown = a.nodeType === 9 ? a.documentElement : a,
-				bup = b && b.parentNode;
-			return a === bup || !!( bup && bup.nodeType === 1 && (
-				adown.contains ?
-					adown.contains( bup ) :
-					a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
-			));
-		} :
-		function( a, b ) {
-			if ( b ) {
-				while ( (b = b.parentNode) ) {
-					if ( b === a ) {
-						return true;
-					}
-				}
-			}
-			return false;
-		};
-
-	/* Sorting
-	---------------------------------------------------------------------- */
-
-	// Document order sorting
-	sortOrder = hasCompare ?
-	function( a, b ) {
-
-		// Flag for duplicate removal
-		if ( a === b ) {
-			hasDuplicate = true;
-			return 0;
-		}
-
-		// Sort on method existence if only one input has compareDocumentPosition
-		var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
-		if ( compare ) {
-			return compare;
-		}
-
-		// Calculate position if both inputs belong to the same document
-		compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
-			a.compareDocumentPosition( b ) :
-
-			// Otherwise we know they are disconnected
-			1;
-
-		// Disconnected nodes
-		if ( compare & 1 ||
-			(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
-
-			// Choose the first element that is related to our preferred document
-			if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
-				return -1;
-			}
-			if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
-				return 1;
-			}
-
-			// Maintain original order
-			return sortInput ?
-				( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
-				0;
-		}
-
-		return compare & 4 ? -1 : 1;
-	} :
-	function( a, b ) {
-		// Exit early if the nodes are identical
-		if ( a === b ) {
-			hasDuplicate = true;
-			return 0;
-		}
-
-		var cur,
-			i = 0,
-			aup = a.parentNode,
-			bup = b.parentNode,
-			ap = [ a ],
-			bp = [ b ];
-
-		// Parentless nodes are either documents or disconnected
-		if ( !aup || !bup ) {
-			return a === doc ? -1 :
-				b === doc ? 1 :
-				aup ? -1 :
-				bup ? 1 :
-				sortInput ?
-				( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
-				0;
-
-		// If the nodes are siblings, we can do a quick check
-		} else if ( aup === bup ) {
-			return siblingCheck( a, b );
-		}
-
-		// Otherwise we need full lists of their ancestors for comparison
-		cur = a;
-		while ( (cur = cur.parentNode) ) {
-			ap.unshift( cur );
-		}
-		cur = b;
-		while ( (cur = cur.parentNode) ) {
-			bp.unshift( cur );
-		}
-
-		// Walk down the tree looking for a discrepancy
-		while ( ap[i] === bp[i] ) {
-			i++;
-		}
-
-		return i ?
-			// Do a sibling check if the nodes have a common ancestor
-			siblingCheck( ap[i], bp[i] ) :
-
-			// Otherwise nodes in our document sort first
-			ap[i] === preferredDoc ? -1 :
-			bp[i] === preferredDoc ? 1 :
-			0;
-	};
-
-	return doc;
-};
-
-Sizzle.matches = function( expr, elements ) {
-	return Sizzle( expr, null, null, elements );
-};
-
-Sizzle.matchesSelector = function( elem, expr ) {
-	// Set document vars if needed
-	if ( ( elem.ownerDocument || elem ) !== document ) {
-		setDocument( elem );
-	}
-
-	// Make sure that attribute selectors are quoted
-	expr = expr.replace( rattributeQuotes, "='$1']" );
-
-	if ( support.matchesSelector && documentIsHTML &&
-		( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
-		( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
-
-		try {
-			var ret = matches.call( elem, expr );
-
-			// IE 9's matchesSelector returns false on disconnected nodes
-			if ( ret || support.disconnectedMatch ||
-					// As well, disconnected nodes are said to be in a document
-					// fragment in IE 9
-					elem.document && elem.document.nodeType !== 11 ) {
-				return ret;
-			}
-		} catch (e) {}
-	}
-
-	return Sizzle( expr, document, null, [ elem ] ).length > 0;
-};
-
-Sizzle.contains = function( context, elem ) {
-	// Set document vars if needed
-	if ( ( context.ownerDocument || context ) !== document ) {
-		setDocument( context );
-	}
-	return contains( context, elem );
-};
-
-Sizzle.attr = function( elem, name ) {
-	// Set document vars if needed
-	if ( ( elem.ownerDocument || elem ) !== document ) {
-		setDocument( elem );
-	}
-
-	var fn = Expr.attrHandle[ name.toLowerCase() ],
-		// Don't get fooled by Object.prototype properties (jQuery #13807)
-		val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
-			fn( elem, name, !documentIsHTML ) :
-			undefined;
-
-	return val !== undefined ?
-		val :
-		support.attributes || !documentIsHTML ?
-			elem.getAttribute( name ) :
-			(val = elem.getAttributeNode(name)) && val.specified ?
-				val.value :
-				null;
-};
-
-Sizzle.error = function( msg ) {
-	throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-/**
- * Document sorting and removing duplicates
- * @param {ArrayLike} results
- */
-Sizzle.uniqueSort = function( results ) {
-	var elem,
-		duplicates = [],
-		j = 0,
-		i = 0;
-
-	// Unless we *know* we can detect duplicates, assume their presence
-	hasDuplicate = !support.detectDuplicates;
-	sortInput = !support.sortStable && results.slice( 0 );
-	results.sort( sortOrder );
-
-	if ( hasDuplicate ) {
-		while ( (elem = results[i++]) ) {
-			if ( elem === results[ i ] ) {
-				j = duplicates.push( i );
-			}
-		}
-		while ( j-- ) {
-			results.splice( duplicates[ j ], 1 );
-		}
-	}
-
-	// Clear input after sorting to release objects
-	// See https://github.com/jquery/sizzle/pull/225
-	sortInput = null;
-
-	return results;
-};
-
-/**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-getText = Sizzle.getText = function( elem ) {
-	var node,
-		ret = "",
-		i = 0,
-		nodeType = elem.nodeType;
-
-	if ( !nodeType ) {
-		// If no nodeType, this is expected to be an array
-		while ( (node = elem[i++]) ) {
-			// Do not traverse comment nodes
-			ret += getText( node );
-		}
-	} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
-		// Use textContent for elements
-		// innerText usage removed for consistency of new lines (jQuery #11153)
-		if ( typeof elem.textContent === "string" ) {
-			return elem.textContent;
-		} else {
-			// Traverse its children
-			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
-				ret += getText( elem );
-			}
-		}
-	} else if ( nodeType === 3 || nodeType === 4 ) {
-		return elem.nodeValue;
-	}
-	// Do not include comment or processing instruction nodes
-
-	return ret;
-};
-
-Expr = Sizzle.selectors = {
-
-	// Can be adjusted by the user
-	cacheLength: 50,
-
-	createPseudo: markFunction,
-
-	match: matchExpr,
-
-	attrHandle: {},
-
-	find: {},
-
-	relative: {
-		">": { dir: "parentNode", first: true },
-		" ": { dir: "parentNode" },
-		"+": { dir: "previousSibling", first: true },
-		"~": { dir: "previousSibling" }
-	},
-
-	preFilter: {
-		"ATTR": function( match ) {
-			match[1] = match[1].replace( runescape, funescape );
-
-			// Move the given value to match[3] whether quoted or unquoted
-			match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
-
-			if ( match[2] === "~=" ) {
-				match[3] = " " + match[3] + " ";
-			}
-
-			return match.slice( 0, 4 );
-		},
-
-		"CHILD": function( match ) {
-			/* matches from matchExpr["CHILD"]
-				1 type (only|nth|...)
-				2 what (child|of-type)
-				3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
-				4 xn-component of xn+y argument ([+-]?\d*n|)
-				5 sign of xn-component
-				6 x of xn-component
-				7 sign of y-component
-				8 y of y-component
-			*/
-			match[1] = match[1].toLowerCase();
-
-			if ( match[1].slice( 0, 3 ) === "nth" ) {
-				// nth-* requires argument
-				if ( !match[3] ) {
-					Sizzle.error( match[0] );
-				}
-
-				// numeric x and y parameters for Expr.filter.CHILD
-				// remember that false/true cast respectively to 0/1
-				match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
-				match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
-
-			// other types prohibit arguments
-			} else if ( match[3] ) {
-				Sizzle.error( match[0] );
-			}
-
-			return match;
-		},
-
-		"PSEUDO": function( match ) {
-			var excess,
-				unquoted = !match[6] && match[2];
-
-			if ( matchExpr["CHILD"].test( match[0] ) ) {
-				return null;
-			}
-
-			// Accept quoted arguments as-is
-			if ( match[3] ) {
-				match[2] = match[4] || match[5] || "";
-
-			// Strip excess characters from unquoted arguments
-			} else if ( unquoted && rpseudo.test( unquoted ) &&
-				// Get excess from tokenize (recursively)
-				(excess = tokenize( unquoted, true )) &&
-				// advance to the next closing parenthesis
-				(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
-
-				// excess is a negative index
-				match[0] = match[0].slice( 0, excess );
-				match[2] = unquoted.slice( 0, excess );
-			}
-
-			// Return only captures needed by the pseudo filter method (type and argument)
-			return match.slice( 0, 3 );
-		}
-	},
-
-	filter: {
-
-		"TAG": function( nodeNameSelector ) {
-			var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
-			return nodeNameSelector === "*" ?
-				function() { return true; } :
-				function( elem ) {
-					return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
-				};
-		},
-
-		"CLASS": function( className ) {
-			var pattern = classCache[ className + " " ];
-
-			return pattern ||
-				(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
-				classCache( className, function( elem ) {
-					return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
-				});
-		},
-
-		"ATTR": function( name, operator, check ) {
-			return function( elem ) {
-				var result = Sizzle.attr( elem, name );
-
-				if ( result == null ) {
-					return operator === "!=";
-				}
-				if ( !operator ) {
-					return true;
-				}
-
-				result += "";
-
-				return operator === "=" ? result === check :
-					operator === "!=" ? result !== check :
-					operator === "^=" ? check && result.indexOf( check ) === 0 :
-					operator === "*=" ? check && result.indexOf( check ) > -1 :
-					operator === "$=" ? check && result.slice( -check.length ) === check :
-					operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
-					operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
-					false;
-			};
-		},
-
-		"CHILD": function( type, what, argument, first, last ) {
-			var simple = type.slice( 0, 3 ) !== "nth",
-				forward = type.slice( -4 ) !== "last",
-				ofType = what === "of-type";
-
-			return first === 1 && last === 0 ?
-
-				// Shortcut for :nth-*(n)
-				function( elem ) {
-					return !!elem.parentNode;
-				} :
-
-				function( elem, context, xml ) {
-					var cache, outerCache, node, diff, nodeIndex, start,
-						dir = simple !== forward ? "nextSibling" : "previousSibling",
-						parent = elem.parentNode,
-						name = ofType && elem.nodeName.toLowerCase(),
-						useCache = !xml && !ofType;
-
-					if ( parent ) {
-
-						// :(first|last|only)-(child|of-type)
-						if ( simple ) {
-							while ( dir ) {
-								node = elem;
-								while ( (node = node[ dir ]) ) {
-									if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
-										return false;
-									}
-								}
-								// Reverse direction for :only-* (if we haven't yet done so)
-								start = dir = type === "only" && !start && "nextSibling";
-							}
-							return true;
-						}
-
-						start = [ forward ? parent.firstChild : parent.lastChild ];
-
-						// non-xml :nth-child(...) stores cache data on `parent`
-						if ( forward && useCache ) {
-							// Seek `elem` from a previously-cached index
-							outerCache = parent[ expando ] || (parent[ expando ] = {});
-							cache = outerCache[ type ] || [];
-							nodeIndex = cache[0] === dirruns && cache[1];
-							diff = cache[0] === dirruns && cache[2];
-							node = nodeIndex && parent.childNodes[ nodeIndex ];
-
-							while ( (node = ++nodeIndex && node && node[ dir ] ||
-
-								// Fallback to seeking `elem` from the start
-								(diff = nodeIndex = 0) || start.pop()) ) {
-
-								// When found, cache indexes on `parent` and break
-								if ( node.nodeType === 1 && ++diff && node === elem ) {
-									outerCache[ type ] = [ dirruns, nodeIndex, diff ];
-									break;
-								}
-							}
-
-						// Use previously-cached element index if available
-						} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
-							diff = cache[1];
-
-						// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
-						} else {
-							// Use the same loop as above to seek `elem` from the start
-							while ( (node = ++nodeIndex && node && node[ dir ] ||
-								(diff = nodeIndex = 0) || start.pop()) ) {
-
-								if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
-									// Cache the index of each encountered element
-									if ( useCache ) {
-										(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
-									}
-
-									if ( node === elem ) {
-										break;
-									}
-								}
-							}
-						}
-
-						// Incorporate the offset, then check against cycle size
-						diff -= last;
-						return diff === first || ( diff % first === 0 && diff / first >= 0 );
-					}
-				};
-		},
-
-		"PSEUDO": function( pseudo, argument ) {
-			// pseudo-class names are case-insensitive
-			// http://www.w3.org/TR/selectors/#pseudo-classes
-			// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
-			// Remember that setFilters inherits from pseudos
-			var args,
-				fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
-					Sizzle.error( "unsupported pseudo: " + pseudo );
-
-			// The user may use createPseudo to indicate that
-			// arguments are needed to create the filter function
-			// just as Sizzle does
-			if ( fn[ expando ] ) {
-				return fn( argument );
-			}
-
-			// But maintain support for old signatures
-			if ( fn.length > 1 ) {
-				args = [ pseudo, pseudo, "", argument ];
-				return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
-					markFunction(function( seed, matches ) {
-						var idx,
-							matched = fn( seed, argument ),
-							i = matched.length;
-						while ( i-- ) {
-							idx = indexOf( seed, matched[i] );
-							seed[ idx ] = !( matches[ idx ] = matched[i] );
-						}
-					}) :
-					function( elem ) {
-						return fn( elem, 0, args );
-					};
-			}
-
-			return fn;
-		}
-	},
-
-	pseudos: {
-		// Potentially complex pseudos
-		"not": markFunction(function( selector ) {
-			// Trim the selector passed to compile
-			// to avoid treating leading and trailing
-			// spaces as combinators
-			var input = [],
-				results = [],
-				matcher = compile( selector.replace( rtrim, "$1" ) );
-
-			return matcher[ expando ] ?
-				markFunction(function( seed, matches, context, xml ) {
-					var elem,
-						unmatched = matcher( seed, null, xml, [] ),
-						i = seed.length;
-
-					// Match elements unmatched by `matcher`
-					while ( i-- ) {
-						if ( (elem = unmatched[i]) ) {
-							seed[i] = !(matches[i] = elem);
-						}
-					}
-				}) :
-				function( elem, context, xml ) {
-					input[0] = elem;
-					matcher( input, null, xml, results );
-					// Don't keep the element (issue #299)
-					input[0] = null;
-					return !results.pop();
-				};
-		}),
-
-		"has": markFunction(function( selector ) {
-			return function( elem ) {
-				return Sizzle( selector, elem ).length > 0;
-			};
-		}),
-
-		"contains": markFunction(function( text ) {
-			text = text.replace( runescape, funescape );
-			return function( elem ) {
-				return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
-			};
-		}),
-
-		// "Whether an element is represented by a :lang() selector
-		// is based solely on the element's language value
-		// being equal to the identifier C,
-		// or beginning with the identifier C immediately followed by "-".
-		// The matching of C against the element's language value is performed case-insensitively.
-		// The identifier C does not have to be a valid language name."
-		// http://www.w3.org/TR/selectors/#lang-pseudo
-		"lang": markFunction( function( lang ) {
-			// lang value must be a valid identifier
-			if ( !ridentifier.test(lang || "") ) {
-				Sizzle.error( "unsupported lang: " + lang );
-			}
-			lang = lang.replace( runescape, funescape ).toLowerCase();
-			return function( elem ) {
-				var elemLang;
-				do {
-					if ( (elemLang = documentIsHTML ?
-						elem.lang :
-						elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
-
-						elemLang = elemLang.toLowerCase();
-						return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
-					}
-				} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
-				return false;
-			};
-		}),
-
-		// Miscellaneous
-		"target": function( elem ) {
-			var hash = window.location && window.location.hash;
-			return hash && hash.slice( 1 ) === elem.id;
-		},
-
-		"root": function( elem ) {
-			return elem === docElem;
-		},
-
-		"focus": function( elem ) {
-			return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
-		},
-
-		// Boolean properties
-		"enabled": function( elem ) {
-			return elem.disabled === false;
-		},
-
-		"disabled": function( elem ) {
-			return elem.disabled === true;
-		},
-
-		"checked": function( elem ) {
-			// In CSS3, :checked should return both checked and selected elements
-			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
-			var nodeName = elem.nodeName.toLowerCase();
-			return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
-		},
-
-		"selected": function( elem ) {
-			// Accessing this property makes selected-by-default
-			// options in Safari work properly
-			if ( elem.parentNode ) {
-				elem.parentNode.selectedIndex;
-			}
-
-			return elem.selected === true;
-		},
-
-		// Contents
-		"empty": function( elem ) {
-			// http://www.w3.org/TR/selectors/#empty-pseudo
-			// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
-			//   but not by others (comment: 8; processing instruction: 7; etc.)
-			// nodeType < 6 works because attributes (2) do not appear as children
-			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
-				if ( elem.nodeType < 6 ) {
-					return false;
-				}
-			}
-			return true;
-		},
-
-		"parent": function( elem ) {
-			return !Expr.pseudos["empty"]( elem );
-		},
-
-		// Element/input types
-		"header": function( elem ) {
-			return rheader.test( elem.nodeName );
-		},
-
-		"input": function( elem ) {
-			return rinputs.test( elem.nodeName );
-		},
-
-		"button": function( elem ) {
-			var name = elem.nodeName.toLowerCase();
-			return name === "input" && elem.type === "button" || name === "button";
-		},
-
-		"text": function( elem ) {
-			var attr;
-			return elem.nodeName.toLowerCase() === "input" &&
-				elem.type === "text" &&
-
-				// Support: IE<8
-				// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
-				( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
-		},
-
-		// Position-in-collection
-		"first": createPositionalPseudo(function() {
-			return [ 0 ];
-		}),
-
-		"last": createPositionalPseudo(function( matchIndexes, length ) {
-			return [ length - 1 ];
-		}),
-
-		"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			return [ argument < 0 ? argument + length : argument ];
-		}),
-
-		"even": createPositionalPseudo(function( matchIndexes, length ) {
-			var i = 0;
-			for ( ; i < length; i += 2 ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"odd": createPositionalPseudo(function( matchIndexes, length ) {
-			var i = 1;
-			for ( ; i < length; i += 2 ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			var i = argument < 0 ? argument + length : argument;
-			for ( ; --i >= 0; ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			var i = argument < 0 ? argument + length : argument;
-			for ( ; ++i < length; ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		})
-	}
-};
-
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
-// Add button/input type pseudos
-for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
-	Expr.pseudos[ i ] = createInputPseudo( i );
-}
-for ( i in { submit: true, reset: true } ) {
-	Expr.pseudos[ i ] = createButtonPseudo( i );
-}
-
-// Easy API for creating new setFilters
-function setFilters() {}
-setFilters.prototype = Expr.filters = Expr.pseudos;
-Expr.setFilters = new setFilters();
-
-tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
-	var matched, match, tokens, type,
-		soFar, groups, preFilters,
-		cached = tokenCache[ selector + " " ];
-
-	if ( cached ) {
-		return parseOnly ? 0 : cached.slice( 0 );
-	}
-
-	soFar = selector;
-	groups = [];
-	preFilters = Expr.preFilter;
-
-	while ( soFar ) {
-
-		// Comma and first run
-		if ( !matched || (match = rcomma.exec( soFar )) ) {
-			if ( match ) {
-				// Don't consume trailing commas as valid
-				soFar = soFar.slice( match[0].length ) || soFar;
-			}
-			groups.push( (tokens = []) );
-		}
-
-		matched = false;
-
-		// Combinators
-		if ( (match = rcombinators.exec( soFar )) ) {
-			matched = match.shift();
-			tokens.push({
-				value: matched,
-				// Cast descendant combinators to space
-				type: match[0].replace( rtrim, " " )
-			});
-			soFar = soFar.slice( matched.length );
-		}
-
-		// Filters
-		for ( type in Expr.filter ) {
-			if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
-				(match = preFilters[ type ]( match ))) ) {
-				matched = match.shift();
-				tokens.push({
-					value: matched,
-					type: type,
-					matches: match
-				});
-				soFar = soFar.slice( matched.length );
-			}
-		}
-
-		if ( !matched ) {
-			break;
-		}
-	}
-
-	// Return the length of the invalid excess
-	// if we're just parsing
-	// Otherwise, throw an error or return tokens
-	return parseOnly ?
-		soFar.length :
-		soFar ?
-			Sizzle.error( selector ) :
-			// Cache the tokens
-			tokenCache( selector, groups ).slice( 0 );
-};
-
-function toSelector( tokens ) {
-	var i = 0,
-		len = tokens.length,
-		selector = "";
-	for ( ; i < len; i++ ) {
-		selector += tokens[i].value;
-	}
-	return selector;
-}
-
-function addCombinator( matcher, combinator, base ) {
-	var dir = combinator.dir,
-		checkNonElements = base && dir === "parentNode",
-		doneName = done++;
-
-	return combinator.first ?
-		// Check against closest ancestor/preceding element
-		function( elem, context, xml ) {
-			while ( (elem = elem[ dir ]) ) {
-				if ( elem.nodeType === 1 || checkNonElements ) {
-					return matcher( elem, context, xml );
-				}
-			}
-		} :
-
-		// Check against all ancestor/preceding elements
-		function( elem, context, xml ) {
-			var oldCache, outerCache,
-				newCache = [ dirruns, doneName ];
-
-			// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
-			if ( xml ) {
-				while ( (elem = elem[ dir ]) ) {
-					if ( elem.nodeType === 1 || checkNonElements ) {
-						if ( matcher( elem, context, xml ) ) {
-							return true;
-						}
-					}
-				}
-			} else {
-				while ( (elem = elem[ dir ]) ) {
-					if ( elem.nodeType === 1 || checkNonElements ) {
-						outerCache = elem[ expando ] || (elem[ expando ] = {});
-						if ( (oldCache = outerCache[ dir ]) &&
-							oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
-
-							// Assign to newCache so results back-propagate to previous elements
-							return (newCache[ 2 ] = oldCache[ 2 ]);
-						} else {
-							// Reuse newcache so results back-propagate to previous elements
-							outerCache[ dir ] = newCache;
-
-							// A match means we're done; a fail means we have to keep checking
-							if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
-								return true;
-							}
-						}
-					}
-				}
-			}
-		};
-}
-
-function elementMatcher( matchers ) {
-	return matchers.length > 1 ?
-		function( elem, context, xml ) {
-			var i = matchers.length;
-			while ( i-- ) {
-				if ( !matchers[i]( elem, context, xml ) ) {
-					return false;
-				}
-			}
-			return true;
-		} :
-		matchers[0];
-}
-
-function multipleContexts( selector, contexts, results ) {
-	var i = 0,
-		len = contexts.length;
-	for ( ; i < len; i++ ) {
-		Sizzle( selector, contexts[i], results );
-	}
-	return results;
-}
-
-function condense( unmatched, map, filter, context, xml ) {
-	var elem,
-		newUnmatched = [],
-		i = 0,
-		len = unmatched.length,
-		mapped = map != null;
-
-	for ( ; i < len; i++ ) {
-		if ( (elem = unmatched[i]) ) {
-			if ( !filter || filter( elem, context, xml ) ) {
-				newUnmatched.push( elem );
-				if ( mapped ) {
-					map.push( i );
-				}
-			}
-		}
-	}
-
-	return newUnmatched;
-}
-
-function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
-	if ( postFilter && !postFilter[ expando ] ) {
-		postFilter = setMatcher( postFilter );
-	}
-	if ( postFinder && !postFinder[ expando ] ) {
-		postFinder = setMatcher( postFinder, postSelector );
-	}
-	return markFunction(function( seed, results, context, xml ) {
-		var temp, i, elem,
-			preMap = [],
-			postMap = [],
-			preexisting = results.length,
-
-			// Get initial elements from seed or context
-			elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
-
-			// Prefilter to get matcher input, preserving a map for seed-results synchronization
-			matcherIn = preFilter && ( seed || !selector ) ?
-				condense( elems, preMap, preFilter, context, xml ) :
-				elems,
-
-			matcherOut = matcher ?
-				// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
-				postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
-					// ...intermediate processing is necessary
-					[] :
-
-					// ...otherwise use results directly
-					results :
-				matcherIn;
-
-		// Find primary matches
-		if ( matcher ) {
-			matcher( matcherIn, matcherOut, context, xml );
-		}
-
-		// Apply postFilter
-		if ( postFilter ) {
-			temp = condense( matcherOut, postMap );
-			postFilter( temp, [], context, xml );
-
-			// Un-match failing elements by moving them back to matcherIn
-			i = temp.length;
-			while ( i-- ) {
-				if ( (elem = temp[i]) ) {
-					matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
-				}
-			}
-		}
-
-		if ( seed ) {
-			if ( postFinder || preFilter ) {
-				if ( postFinder ) {
-					// Get the final matcherOut by condensing this intermediate into postFinder contexts
-					temp = [];
-					i = matcherOut.length;
-					while ( i-- ) {
-						if ( (elem = matcherOut[i]) ) {
-							// Restore matcherIn since elem is not yet a final match
-							temp.push( (matcherIn[i] = elem) );
-						}
-					}
-					postFinder( null, (matcherOut = []), temp, xml );
-				}
-
-				// Move matched elements from seed to results to keep them synchronized
-				i = matcherOut.length;
-				while ( i-- ) {
-					if ( (elem = matcherOut[i]) &&
-						(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
-
-						seed[temp] = !(results[temp] = elem);
-					}
-				}
-			}
-
-		// Add elements to results, through postFinder if defined
-		} else {
-			matcherOut = condense(
-				matcherOut === results ?
-					matcherOut.splice( preexisting, matcherOut.length ) :
-					matcherOut
-			);
-			if ( postFinder ) {
-				postFinder( null, results, matcherOut, xml );
-			} else {
-				push.apply( results, matcherOut );
-			}
-		}
-	});
-}
-
-function matcherFromTokens( tokens ) {
-	var checkContext, matcher, j,
-		len = tokens.length,
-		leadingRelative = Expr.relative[ tokens[0].type ],
-		implicitRelative = leadingRelative || Expr.relative[" "],
-		i = leadingRelative ? 1 : 0,
-
-		// The foundational matcher ensures that elements are reachable from top-level context(s)
-		matchContext = addCombinator( function( elem ) {
-			return elem === checkContext;
-		}, implicitRelative, true ),
-		matchAnyContext = addCombinator( function( elem ) {
-			return indexOf( checkContext, elem ) > -1;
-		}, implicitRelative, true ),
-		matchers = [ function( elem, context, xml ) {
-			var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
-				(checkContext = context).nodeType ?
-					matchContext( elem, context, xml ) :
-					matchAnyContext( elem, context, xml ) );
-			// Avoid hanging onto element (issue #299)
-			checkContext = null;
-			return ret;
-		} ];
-
-	for ( ; i < len; i++ ) {
-		if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
-			matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
-		} else {
-			matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
-
-			// Return special upon seeing a positional matcher
-			if ( matcher[ expando ] ) {
-				// Find the next relative operator (if any) for proper handling
-				j = ++i;
-				for ( ; j < len; j++ ) {
-					if ( Expr.relative[ tokens[j].type ] ) {
-						break;
-					}
-				}
-				return setMatcher(
-					i > 1 && elementMatcher( matchers ),
-					i > 1 && toSelector(
-						// If the preceding token was a descendant combinator, insert an implicit any-element `*`
-						tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
-					).replace( rtrim, "$1" ),
-					matcher,
-					i < j && matcherFromTokens( tokens.slice( i, j ) ),
-					j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
-					j < len && toSelector( tokens )
-				);
-			}
-			matchers.push( matcher );
-		}
-	}
-
-	return elementMatcher( matchers );
-}
-
-function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
-	var bySet = setMatchers.length > 0,
-		byElement = elementMatchers.length > 0,
-		superMatcher = function( seed, context, xml, results, outermost ) {
-			var elem, j, matcher,
-				matchedCount = 0,
-				i = "0",
-				unmatched = seed && [],
-				setMatched = [],
-				contextBackup = outermostContext,
-				// We must always have either seed elements or outermost context
-				elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
-				// Use integer dirruns iff this is the outermost matcher
-				dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
-				len = elems.length;
-
-			if ( outermost ) {
-				outermostContext = context !== document && context;
-			}
-
-			// Add elements passing elementMatchers directly to results
-			// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
-			// Support: IE<9, Safari
-			// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
-			for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
-				if ( byElement && elem ) {
-					j = 0;
-					while ( (matcher = elementMatchers[j++]) ) {
-						if ( matcher( elem, context, xml ) ) {
-							results.push( elem );
-							break;
-						}
-					}
-					if ( outermost ) {
-						dirruns = dirrunsUnique;
-					}
-				}
-
-				// Track unmatched elements for set filters
-				if ( bySet ) {
-					// They will have gone through all possible matchers
-					if ( (elem = !matcher && elem) ) {
-						matchedCount--;
-					}
-
-					// Lengthen the array for every element, matched or not
-					if ( seed ) {
-						unmatched.push( elem );
-					}
-				}
-			}
-
-			// Apply set filters to unmatched elements
-			matchedCount += i;
-			if ( bySet && i !== matchedCount ) {
-				j = 0;
-				while ( (matcher = setMatchers[j++]) ) {
-					matcher( unmatched, setMatched, context, xml );
-				}
-
-				if ( seed ) {
-					// Reintegrate element matches to eliminate the need for sorting
-					if ( matchedCount > 0 ) {
-						while ( i-- ) {
-							if ( !(unmatched[i] || setMatched[i]) ) {
-								setMatched[i] = pop.call( results );
-							}
-						}
-					}
-
-					// Discard index placeholder values to get only actual matches
-					setMatched = condense( setMatched );
-				}
-
-				// Add matches to results
-				push.apply( results, setMatched );
-
-				// Seedless set matches succeeding multiple successful matchers stipulate sorting
-				if ( outermost && !seed && setMatched.length > 0 &&
-					( matchedCount + setMatchers.length ) > 1 ) {
-
-					Sizzle.uniqueSort( results );
-				}
-			}
-
-			// Override manipulation of globals by nested matchers
-			if ( outermost ) {
-				dirruns = dirrunsUnique;
-				outermostContext = contextBackup;
-			}
-
-			return unmatched;
-		};
-
-	return bySet ?
-		markFunction( superMatcher ) :
-		superMatcher;
-}
-
-compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
-	var i,
-		setMatchers = [],
-		elementMatchers = [],
-		cached = compilerCache[ selector + " " ];
-
-	if ( !cached ) {
-		// Generate a function of recursive functions that can be used to check each element
-		if ( !match ) {
-			match = tokenize( selector );
-		}
-		i = match.length;
-		while ( i-- ) {
-			cached = matcherFromTokens( match[i] );
-			if ( cached[ expando ] ) {
-				setMatchers.push( cached );
-			} else {
-				elementMatchers.push( cached );
-			}
-		}
-
-		// Cache the compiled function
-		cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
-
-		// Save selector and tokenization
-		cached.selector = selector;
-	}
-	return cached;
-};
-
-/**
- * A low-level selection function that works with Sizzle's compiled
- *  selector functions
- * @param {String|Function} selector A selector or a pre-compiled
- *  selector function built with Sizzle.compile
- * @param {Element} context
- * @param {Array} [results]
- * @param {Array} [seed] A set of elements to match against
- */
-select = Sizzle.select = function( selector, context, results, seed ) {
-	var i, tokens, token, type, find,
-		compiled = typeof selector === "function" && selector,
-		match = !seed && tokenize( (selector = compiled.selector || selector) );
-
-	results = results || [];
-
-	// Try to minimize operations if there is no seed and only one group
-	if ( match.length === 1 ) {
-
-		// Take a shortcut and set the context if the root selector is an ID
-		tokens = match[0] = match[0].slice( 0 );
-		if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
-				support.getById && context.nodeType === 9 && documentIsHTML &&
-				Expr.relative[ tokens[1].type ] ) {
-
-			context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
-			if ( !context ) {
-				return results;
-
-			// Precompiled matchers will still verify ancestry, so step up a level
-			} else if ( compiled ) {
-				context = context.parentNode;
-			}
-
-			selector = selector.slice( tokens.shift().value.length );
-		}
-
-		// Fetch a seed set for right-to-left matching
-		i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
-		while ( i-- ) {
-			token = tokens[i];
-
-			// Abort if we hit a combinator
-			if ( Expr.relative[ (type = token.type) ] ) {
-				break;
-			}
-			if ( (find = Expr.find[ type ]) ) {
-				// Search, expanding context for leading sibling combinators
-				if ( (seed = find(
-					token.matches[0].replace( runescape, funescape ),
-					rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
-				)) ) {
-
-					// If seed is empty or no tokens remain, we can return early
-					tokens.splice( i, 1 );
-					selector = seed.length && toSelector( tokens );
-					if ( !selector ) {
-						push.apply( results, seed );
-						return results;
-					}
-
-					break;
-				}
-			}
-		}
-	}
-
-	// Compile and execute a filtering function if one is not provided
-	// Provide `match` to avoid retokenization if we modified the selector above
-	( compiled || compile( selector, match ) )(
-		seed,
-		context,
-		!documentIsHTML,
-		results,
-		rsibling.test( selector ) && testContext( context.parentNode ) || context
-	);
-	return results;
-};
-
-// One-time assignments
-
-// Sort stability
-support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
-
-// Support: Chrome 14-35+
-// Always assume duplicates if they aren't passed to the comparison function
-support.detectDuplicates = !!hasDuplicate;
-
-// Initialize against the default document
-setDocument();
-
-// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
-// Detached nodes confoundingly follow *each other*
-support.sortDetached = assert(function( div1 ) {
-	// Should return 1, but returns 4 (following)
-	return div1.compareDocumentPosition( document.createElement("div") ) & 1;
-});
-
-// Support: IE<8
-// Prevent attribute/property "interpolation"
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !assert(function( div ) {
-	div.innerHTML = "<a href='#'></a>";
-	return div.firstChild.getAttribute("href") === "#" ;
-}) ) {
-	addHandle( "type|href|height|width", function( elem, name, isXML ) {
-		if ( !isXML ) {
-			return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
-		}
-	});
-}
-
-// Support: IE<9
-// Use defaultValue in place of getAttribute("value")
-if ( !support.attributes || !assert(function( div ) {
-	div.innerHTML = "<input/>";
-	div.firstChild.setAttribute( "value", "" );
-	return div.firstChild.getAttribute( "value" ) === "";
-}) ) {
-	addHandle( "value", function( elem, name, isXML ) {
-		if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
-			return elem.defaultValue;
-		}
-	});
-}
-
-// Support: IE<9
-// Use getAttributeNode to fetch booleans when getAttribute lies
-if ( !assert(function( div ) {
-	return div.getAttribute("disabled") == null;
-}) ) {
-	addHandle( booleans, function( elem, name, isXML ) {
-		var val;
-		if ( !isXML ) {
-			return elem[ name ] === true ? name.toLowerCase() :
-					(val = elem.getAttributeNode( name )) && val.specified ?
-					val.value :
-				null;
-		}
-	});
-}
-
-// EXPOSE
-if ( typeof define === "function" && define.amd ) {
-	define(function() { return Sizzle; });
-// Sizzle requires that there be a global window in Common-JS like environments
-} else if ( typeof module !== "undefined" && module.exports ) {
-	module.exports = Sizzle;
-} else {
-	window.Sizzle = Sizzle;
-}
-// EXPOSE
-
-})( window );
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/sizzle/dist/sizzle.min.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/sizzle/dist/sizzle.min.js
deleted file mode 100644
index cf4d1a6..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/sizzle/dist/sizzle.min.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! Sizzle v2.2.0-pre | (c) 2008, 2014 jQuery Foundation, Inc. | jquery.org/license */
-!function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=mb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=nb(b);function qb(){}qb.prototype=d.filters=d.pseudos,d.setFilters=new qb,g=gb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?gb.error(a):z(a,i).slice(0)};function rb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),"function"==typeof define&&define.amd?define(function(){return gb}):"undefined"!=typeof module&&module.exports?module.exports=gb:a.Sizzle=gb}(window);
-//# sourceMappingURL=sizzle.min.map
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/sizzle/dist/sizzle.min.map b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/sizzle/dist/sizzle.min.map
deleted file mode 100644
index e39754e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/sizzle/dist/sizzle.min.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"sizzle.min.js","sources":["sizzle.js"],"names":["window","i","support","Expr","getText","isXML","tokenize","compile","select","outermostContext","sortInput","hasDuplicate","setDocument","document","docElem","documentIsHTML","rbuggyQSA","rbuggyMatches","matches","contains","expando","Date","preferredDoc","dirruns","done","classCache","createCache","tokenCache","compilerCache","sortOrder","a","b","MAX_NEGATIVE","hasOwn","hasOwnProperty","arr","pop","push_native","push","slice","indexOf","list","elem","len","length","booleans","whitespace","characterEncoding","identifier","replace","attributes","pseudos","rwhitespace","RegExp","rtrim","rcomma","rcombinators","rattributeQuotes","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rinputs","rheader","rnative","rquickExpr","rsibling","rescape","runescape","funescape","_","escaped","escapedWhitespace","high","String","fromCharCode","unloadHandler","apply","call","childNodes","nodeType","e","target","els","j","Sizzle","selector","context","results","seed","match","m","groups","old","nid","newContext","newSelector","ownerDocument","exec","getElementById","parentNode","id","getElementsByTagName","getElementsByClassName","qsa","test","nodeName","toLowerCase","getAttribute","setAttribute","toSelector","testContext","join","querySelectorAll","qsaError","removeAttribute","keys","cache","key","value","cacheLength","shift","markFunction","fn","assert","div","createElement","removeChild","addHandle","attrs","handler","split","attrHandle","siblingCheck","cur","diff","sourceIndex","nextSibling","createInputPseudo","type","name","createButtonPseudo","createPositionalPseudo","argument","matchIndexes","documentElement","node","hasCompare","parent","doc","defaultView","top","addEventListener","attachEvent","className","appendChild","createComment","getById","getElementsByName","find","filter","attrId","getAttributeNode","tag","tmp","innerHTML","input","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","compareDocumentPosition","adown","bup","compare","sortDetached","aup","ap","bp","unshift","expr","elements","ret","attr","val","undefined","specified","error","msg","Error","uniqueSort","duplicates","detectDuplicates","sortStable","sort","splice","textContent","firstChild","nodeValue","selectors","createPseudo","relative",">","dir","first"," ","+","~","preFilter","excess","unquoted","nodeNameSelector","pattern","operator","check","result","what","last","simple","forward","ofType","xml","outerCache","nodeIndex","start","useCache","lastChild","pseudo","args","setFilters","idx","matched","not","matcher","unmatched","has","text","innerText","lang","elemLang","hash","location","root","focus","activeElement","hasFocus","href","tabIndex","enabled","disabled","checked","selected","selectedIndex","empty","header","button","eq","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","prototype","filters","parseOnly","tokens","soFar","preFilters","cached","addCombinator","combinator","base","checkNonElements","doneName","oldCache","newCache","elementMatcher","matchers","multipleContexts","contexts","condense","map","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","elems","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","implicitRelative","matchContext","matchAnyContext","concat","matcherFromGroupMatchers","elementMatchers","setMatchers","bySet","byElement","superMatcher","outermost","matchedCount","setMatched","contextBackup","dirrunsUnique","Math","random","token","compiled","div1","defaultValue","define","amd","module","exports"],"mappings":"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"}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/traversing.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/traversing.js
deleted file mode 100644
index d9ff0ae..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/traversing.js
+++ /dev/null
@@ -1,199 +0,0 @@
-define([
-	"./core",
-	"./var/indexOf",
-	"./traversing/var/rneedsContext",
-	"./core/init",
-	"./traversing/findFilter",
-	"./selector"
-], function( jQuery, indexOf, rneedsContext ) {
-
-var rparentsprev = /^(?:parents|prev(?:Until|All))/,
-	// Methods guaranteed to produce a unique set when starting from a unique set
-	guaranteedUnique = {
-		children: true,
-		contents: true,
-		next: true,
-		prev: true
-	};
-
-jQuery.extend({
-	dir: function( elem, dir, until ) {
-		var matched = [],
-			truncate = until !== undefined;
-
-		while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
-			if ( elem.nodeType === 1 ) {
-				if ( truncate && jQuery( elem ).is( until ) ) {
-					break;
-				}
-				matched.push( elem );
-			}
-		}
-		return matched;
-	},
-
-	sibling: function( n, elem ) {
-		var matched = [];
-
-		for ( ; n; n = n.nextSibling ) {
-			if ( n.nodeType === 1 && n !== elem ) {
-				matched.push( n );
-			}
-		}
-
-		return matched;
-	}
-});
-
-jQuery.fn.extend({
-	has: function( target ) {
-		var targets = jQuery( target, this ),
-			l = targets.length;
-
-		return this.filter(function() {
-			var i = 0;
-			for ( ; i < l; i++ ) {
-				if ( jQuery.contains( this, targets[i] ) ) {
-					return true;
-				}
-			}
-		});
-	},
-
-	closest: function( selectors, context ) {
-		var cur,
-			i = 0,
-			l = this.length,
-			matched = [],
-			pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
-				jQuery( selectors, context || this.context ) :
-				0;
-
-		for ( ; i < l; i++ ) {
-			for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
-				// Always skip document fragments
-				if ( cur.nodeType < 11 && (pos ?
-					pos.index(cur) > -1 :
-
-					// Don't pass non-elements to Sizzle
-					cur.nodeType === 1 &&
-						jQuery.find.matchesSelector(cur, selectors)) ) {
-
-					matched.push( cur );
-					break;
-				}
-			}
-		}
-
-		return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
-	},
-
-	// Determine the position of an element within the set
-	index: function( elem ) {
-
-		// No argument, return index in parent
-		if ( !elem ) {
-			return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
-		}
-
-		// Index in selector
-		if ( typeof elem === "string" ) {
-			return indexOf.call( jQuery( elem ), this[ 0 ] );
-		}
-
-		// Locate the position of the desired element
-		return indexOf.call( this,
-
-			// If it receives a jQuery object, the first element is used
-			elem.jquery ? elem[ 0 ] : elem
-		);
-	},
-
-	add: function( selector, context ) {
-		return this.pushStack(
-			jQuery.unique(
-				jQuery.merge( this.get(), jQuery( selector, context ) )
-			)
-		);
-	},
-
-	addBack: function( selector ) {
-		return this.add( selector == null ?
-			this.prevObject : this.prevObject.filter(selector)
-		);
-	}
-});
-
-function sibling( cur, dir ) {
-	while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
-	return cur;
-}
-
-jQuery.each({
-	parent: function( elem ) {
-		var parent = elem.parentNode;
-		return parent && parent.nodeType !== 11 ? parent : null;
-	},
-	parents: function( elem ) {
-		return jQuery.dir( elem, "parentNode" );
-	},
-	parentsUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "parentNode", until );
-	},
-	next: function( elem ) {
-		return sibling( elem, "nextSibling" );
-	},
-	prev: function( elem ) {
-		return sibling( elem, "previousSibling" );
-	},
-	nextAll: function( elem ) {
-		return jQuery.dir( elem, "nextSibling" );
-	},
-	prevAll: function( elem ) {
-		return jQuery.dir( elem, "previousSibling" );
-	},
-	nextUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "nextSibling", until );
-	},
-	prevUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "previousSibling", until );
-	},
-	siblings: function( elem ) {
-		return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
-	},
-	children: function( elem ) {
-		return jQuery.sibling( elem.firstChild );
-	},
-	contents: function( elem ) {
-		return elem.contentDocument || jQuery.merge( [], elem.childNodes );
-	}
-}, function( name, fn ) {
-	jQuery.fn[ name ] = function( until, selector ) {
-		var matched = jQuery.map( this, fn, until );
-
-		if ( name.slice( -5 ) !== "Until" ) {
-			selector = until;
-		}
-
-		if ( selector && typeof selector === "string" ) {
-			matched = jQuery.filter( selector, matched );
-		}
-
-		if ( this.length > 1 ) {
-			// Remove duplicates
-			if ( !guaranteedUnique[ name ] ) {
-				jQuery.unique( matched );
-			}
-
-			// Reverse order for parents* and prev-derivatives
-			if ( rparentsprev.test( name ) ) {
-				matched.reverse();
-			}
-		}
-
-		return this.pushStack( matched );
-	};
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/traversing/findFilter.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/traversing/findFilter.js
deleted file mode 100644
index dd70a73..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/traversing/findFilter.js
+++ /dev/null
@@ -1,100 +0,0 @@
-define([
-	"../core",
-	"../var/indexOf",
-	"./var/rneedsContext",
-	"../selector"
-], function( jQuery, indexOf, rneedsContext ) {
-
-var risSimple = /^.[^:#\[\.,]*$/;
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, not ) {
-	if ( jQuery.isFunction( qualifier ) ) {
-		return jQuery.grep( elements, function( elem, i ) {
-			/* jshint -W018 */
-			return !!qualifier.call( elem, i, elem ) !== not;
-		});
-
-	}
-
-	if ( qualifier.nodeType ) {
-		return jQuery.grep( elements, function( elem ) {
-			return ( elem === qualifier ) !== not;
-		});
-
-	}
-
-	if ( typeof qualifier === "string" ) {
-		if ( risSimple.test( qualifier ) ) {
-			return jQuery.filter( qualifier, elements, not );
-		}
-
-		qualifier = jQuery.filter( qualifier, elements );
-	}
-
-	return jQuery.grep( elements, function( elem ) {
-		return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
-	});
-}
-
-jQuery.filter = function( expr, elems, not ) {
-	var elem = elems[ 0 ];
-
-	if ( not ) {
-		expr = ":not(" + expr + ")";
-	}
-
-	return elems.length === 1 && elem.nodeType === 1 ?
-		jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
-		jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
-			return elem.nodeType === 1;
-		}));
-};
-
-jQuery.fn.extend({
-	find: function( selector ) {
-		var i,
-			len = this.length,
-			ret = [],
-			self = this;
-
-		if ( typeof selector !== "string" ) {
-			return this.pushStack( jQuery( selector ).filter(function() {
-				for ( i = 0; i < len; i++ ) {
-					if ( jQuery.contains( self[ i ], this ) ) {
-						return true;
-					}
-				}
-			}) );
-		}
-
-		for ( i = 0; i < len; i++ ) {
-			jQuery.find( selector, self[ i ], ret );
-		}
-
-		// Needed because $( selector, context ) becomes $( context ).find( selector )
-		ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
-		ret.selector = this.selector ? this.selector + " " + selector : selector;
-		return ret;
-	},
-	filter: function( selector ) {
-		return this.pushStack( winnow(this, selector || [], false) );
-	},
-	not: function( selector ) {
-		return this.pushStack( winnow(this, selector || [], true) );
-	},
-	is: function( selector ) {
-		return !!winnow(
-			this,
-
-			// If this is a positional/relative selector, check membership in the returned set
-			// so $("p:first").is("p:last") won't return true for a doc with two "p".
-			typeof selector === "string" && rneedsContext.test( selector ) ?
-				jQuery( selector ) :
-				selector || [],
-			false
-		).length;
-	}
-});
-
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/traversing/var/rneedsContext.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/traversing/var/rneedsContext.js
deleted file mode 100644
index 3d6ae40..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/traversing/var/rneedsContext.js
+++ /dev/null
@@ -1,6 +0,0 @@
-define([
-	"../../core",
-	"../../selector"
-], function( jQuery ) {
-	return jQuery.expr.match.needsContext;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/arr.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/arr.js
deleted file mode 100644
index b18fc9c..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/arr.js
+++ /dev/null
@@ -1,3 +0,0 @@
-define(function() {
-	return [];
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/class2type.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/class2type.js
deleted file mode 100644
index e674c3b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/class2type.js
+++ /dev/null
@@ -1,4 +0,0 @@
-define(function() {
-	// [[Class]] -> type pairs
-	return {};
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/concat.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/concat.js
deleted file mode 100644
index 7dcf77e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/concat.js
+++ /dev/null
@@ -1,5 +0,0 @@
-define([
-	"./arr"
-], function( arr ) {
-	return arr.concat;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/hasOwn.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/hasOwn.js
deleted file mode 100644
index 32c002a..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/hasOwn.js
+++ /dev/null
@@ -1,5 +0,0 @@
-define([
-	"./class2type"
-], function( class2type ) {
-	return class2type.hasOwnProperty;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/indexOf.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/indexOf.js
deleted file mode 100644
index cdbe3c7..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/indexOf.js
+++ /dev/null
@@ -1,5 +0,0 @@
-define([
-	"./arr"
-], function( arr ) {
-	return arr.indexOf;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/pnum.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/pnum.js
deleted file mode 100644
index 4070447..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/pnum.js
+++ /dev/null
@@ -1,3 +0,0 @@
-define(function() {
-	return (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/push.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/push.js
deleted file mode 100644
index ad6f0a1..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/push.js
+++ /dev/null
@@ -1,5 +0,0 @@
-define([
-	"./arr"
-], function( arr ) {
-	return arr.push;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/rnotwhite.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/rnotwhite.js
deleted file mode 100644
index 7c69bec..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/rnotwhite.js
+++ /dev/null
@@ -1,3 +0,0 @@
-define(function() {
-	return (/\S+/g);
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/slice.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/slice.js
deleted file mode 100644
index 614d46c..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/slice.js
+++ /dev/null
@@ -1,5 +0,0 @@
-define([
-	"./arr"
-], function( arr ) {
-	return arr.slice;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/strundefined.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/strundefined.js
deleted file mode 100644
index 04e16b0..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/strundefined.js
+++ /dev/null
@@ -1,3 +0,0 @@
-define(function() {
-	return typeof undefined;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/support.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/support.js
deleted file mode 100644
index b25dbc7..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/support.js
+++ /dev/null
@@ -1,4 +0,0 @@
-define(function() {
-	// All support tests are defined in their respective modules.
-	return {};
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/toString.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/toString.js
deleted file mode 100644
index ca92d22..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/var/toString.js
+++ /dev/null
@@ -1,5 +0,0 @@
-define([
-	"./class2type"
-], function( class2type ) {
-	return class2type.toString;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/wrap.js b/views/ngXosViews/serviceGrid/src/vendor/jquery/src/wrap.js
deleted file mode 100644
index 4958251..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/jquery/src/wrap.js
+++ /dev/null
@@ -1,79 +0,0 @@
-define([
-	"./core",
-	"./core/init",
-	"./manipulation", // clone
-	"./traversing" // parent, contents
-], function( jQuery ) {
-
-jQuery.fn.extend({
-	wrapAll: function( html ) {
-		var wrap;
-
-		if ( jQuery.isFunction( html ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).wrapAll( html.call(this, i) );
-			});
-		}
-
-		if ( this[ 0 ] ) {
-
-			// The elements to wrap the target around
-			wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
-
-			if ( this[ 0 ].parentNode ) {
-				wrap.insertBefore( this[ 0 ] );
-			}
-
-			wrap.map(function() {
-				var elem = this;
-
-				while ( elem.firstElementChild ) {
-					elem = elem.firstElementChild;
-				}
-
-				return elem;
-			}).append( this );
-		}
-
-		return this;
-	},
-
-	wrapInner: function( html ) {
-		if ( jQuery.isFunction( html ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).wrapInner( html.call(this, i) );
-			});
-		}
-
-		return this.each(function() {
-			var self = jQuery( this ),
-				contents = self.contents();
-
-			if ( contents.length ) {
-				contents.wrapAll( html );
-
-			} else {
-				self.append( html );
-			}
-		});
-	},
-
-	wrap: function( html ) {
-		var isFunction = jQuery.isFunction( html );
-
-		return this.each(function( i ) {
-			jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
-		});
-	},
-
-	unwrap: function() {
-		return this.parent().each(function() {
-			if ( !jQuery.nodeName( this, "body" ) ) {
-				jQuery( this ).replaceWith( this.childNodes );
-			}
-		}).end();
-	}
-});
-
-return jQuery;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/.bower.json b/views/ngXosViews/serviceGrid/src/vendor/lodash/.bower.json
deleted file mode 100644
index 6b70939..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/.bower.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "name": "lodash",
-  "homepage": "https://github.com/lodash/lodash",
-  "version": "4.11.2",
-  "_release": "4.11.2",
-  "_resolution": {
-    "type": "version",
-    "tag": "4.11.2",
-    "commit": "64fbb18fc7a4dd44240e25ed9cac2576b16f45a3"
-  },
-  "_source": "https://github.com/lodash/lodash.git",
-  "_target": "~4.11.1",
-  "_originalSource": "lodash"
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/.editorconfig b/views/ngXosViews/serviceGrid/src/vendor/lodash/.editorconfig
deleted file mode 100644
index b889a36..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/.editorconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-# This file is for unifying the coding style for different editors and IDEs
-# editorconfig.org
-
-root = true
-
-[*]
-charset = utf-8
-end_of_line = lf
-indent_size = 2
-indent_style = space
-insert_final_newline = true
-trim_trailing_whitespace = true
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/.gitattributes b/views/ngXosViews/serviceGrid/src/vendor/lodash/.gitattributes
deleted file mode 100644
index 176a458..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* text=auto
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/.github/CONTRIBUTING.md b/views/ngXosViews/serviceGrid/src/vendor/lodash/.github/CONTRIBUTING.md
deleted file mode 100644
index b3427fd..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/.github/CONTRIBUTING.md
+++ /dev/null
@@ -1,78 +0,0 @@
-# Contributing to Lodash
-
-Contributions are always welcome. Before contributing please read the
-[code of conduct](https://github.com/lodash/lodash/blob/master/CODE_OF_CONDUCT.md)
-& [search the issue tracker](https://github.com/lodash/lodash/issues); your issue
-may have already been discussed or fixed in `master`. To contribute,
-[fork](https://help.github.com/articles/fork-a-repo/) Lodash, commit your changes,
-& [send a pull request](https://help.github.com/articles/using-pull-requests/).
-
-## Feature Requests
-
-Feature requests should be submitted in the
-[issue tracker](https://github.com/lodash/lodash/issues), with a description of
-the expected behavior & use case, where they’ll remain closed until sufficient interest,
-[e.g. :+1: reactions](https://help.github.com/articles/about-discussions-in-issues-and-pull-requests/),
-has been shown by the community. Before submitting a request, please search for
-similar ones in the
-[closed issues](https://github.com/lodash/lodash/issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement).
-
-## Pull Requests
-
-For additions or bug fixes you should only need to modify `lodash.js`. Include
-updated unit tests in the `test` directory as part of your pull request. Don’t
-worry about regenerating the `dist/` or `doc/` files.
-
-Before running the unit tests you’ll need to install, `npm i`,
-[development dependencies](https://docs.npmjs.com/files/package.json#devdependencies).
-Run unit tests from the command-line via `npm test`, or open `test/index.html` &
-`test/fp.html` in a web browser. The [Backbone](http://backbonejs.org/) &
-[Underscore](http://underscorejs.org/) test suites are included as well.
-
-## Contributor License Agreement
-
-Lodash is a member of the [jQuery Foundation](https://jquery.org/).
-As such, we request that all contributors sign the jQuery Foundation
-[contributor license agreement (CLA)](https://contribute.jquery.org/CLA/).
-
-For more information about CLAs, please check out Alex Russell’s excellent post,
-[“Why Do I Need to Sign This?”](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
-
-## Coding Guidelines
-
-In addition to the following guidelines, please follow the conventions already
-established in the code.
-
-- **Spacing**:<br>
-  Use two spaces for indentation. No tabs.
-
-- **Naming**:<br>
-  Keep variable & method names concise & descriptive.<br>
-  Variable names `index`, `collection`, & `callback` are preferable to
-  `i`, `arr`, & `fn`.
-
-- **Quotes**:<br>
-  Single-quoted strings are preferred to double-quoted strings; however,
-  please use a double-quoted string if the value contains a single-quote
-  character to avoid unnecessary escaping.
-
-- **Comments**:<br>
-  Please use single-line comments to annotate significant additions, &
-  [JSDoc-style](http://www.2ality.com/2011/08/jsdoc-intro.html) comments for
-  functions.
-
-Guidelines are enforced using [JSCS](https://www.npmjs.com/package/jscs):
-```bash
-$ npm run style
-```
-
-## Tips
-
-You can opt-in to a pre-push git hook by adding an `.opt-in` file to the root of
-the project containing:
-```txt
-pre-push
-```
-
-With that, when you `git push`, the pre-push git hook will trigger and execute
-`npm run validate`.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/.gitignore b/views/ngXosViews/serviceGrid/src/vendor/lodash/.gitignore
deleted file mode 100644
index 6eb2db8..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-.DS_Store
-*.custom.*
-*.log
-*.map
-lodash.compat.min.js
-coverage
-node_modules
-.opt-in
-.opt-out
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/.jscsrc b/views/ngXosViews/serviceGrid/src/vendor/lodash/.jscsrc
deleted file mode 100644
index 5f44ab8..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/.jscsrc
+++ /dev/null
@@ -1,97 +0,0 @@
-{
-    "maxErrors": "2000",
-    "maximumLineLength": {
-      "value": 180,
-      "allExcept": ["comments", "functionSignature", "regex"]
-    },
-    "requireCurlyBraces": [
-        "if",
-        "else",
-        "for",
-        "while",
-        "do",
-        "try",
-        "catch"
-    ],
-    "requireOperatorBeforeLineBreak": [
-        "=",
-        "+",
-        "-",
-        "/",
-        "*",
-        "==",
-        "===",
-        "!=",
-        "!==",
-        ">",
-        ">=",
-        "<",
-        "<="
-    ],
-    "requireSpaceAfterKeywords": [
-      "if",
-      "else",
-      "for",
-      "while",
-      "do",
-      "switch",
-      "return",
-      "try",
-      "catch"
-    ],
-    "requireSpaceBeforeBinaryOperators": [
-        "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
-        "&=", "|=", "^=", "+=",
-
-        "+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
-        "|", "^", "&&", "||", "===", "==", ">=",
-        "<=", "<", ">", "!=", "!=="
-    ],
-    "requireSpacesInFunctionExpression": {
-        "beforeOpeningCurlyBrace": true
-    },
-    "requireCamelCaseOrUpperCaseIdentifiers": true,
-    "requireDotNotation": { "allExcept": ["keywords"] },
-    "requireEarlyReturn": true,
-    "requireLineFeedAtFileEnd": true,
-    "requireSemicolons": true,
-    "requireSpaceAfterBinaryOperators": true,
-    "requireSpacesInConditionalExpression": true,
-    "requireSpaceBeforeObjectValues": true,
-    "requireSpaceBeforeBlockStatements": true,
-    "requireSpacesInForStatement": true,
-
-    "validateIndentation": 2,
-    "validateParameterSeparator": ", ",
-    "validateQuoteMarks": { "mark": "'", "escape": true },
-
-    "disallowSpacesInAnonymousFunctionExpression": {
-        "beforeOpeningRoundBrace": true
-    },
-    "disallowSpacesInFunctionDeclaration": {
-        "beforeOpeningRoundBrace": true
-    },
-    "disallowSpacesInFunctionExpression": {
-        "beforeOpeningRoundBrace": true
-    },
-    "disallowKeywords": ["with"],
-    "disallowMixedSpacesAndTabs": true,
-    "disallowMultipleLineBreaks": true,
-    "disallowNewlineBeforeBlockStatements": true,
-    "disallowSpaceAfterObjectKeys": true,
-    "disallowSpaceAfterPrefixUnaryOperators": true,
-    "disallowSpacesInCallExpression": true,
-    "disallowSpacesInsideArrayBrackets": true,
-    "disallowSpacesInsideParentheses": true,
-    "disallowTrailingWhitespace": true,
-    "disallowUnusedVariables": true,
-
-    "jsDoc": {
-        "checkRedundantAccess": true,
-        "checkTypes": true,
-        "requireNewlineAfterDescription": true,
-        "requireParamDescription": true,
-        "requireParamTypes": true,
-        "requireReturnTypes": true
-    }
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/.travis.yml b/views/ngXosViews/serviceGrid/src/vendor/lodash/.travis.yml
deleted file mode 100644
index 161f0cd..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/.travis.yml
+++ /dev/null
@@ -1,77 +0,0 @@
-language: node_js
-sudo: false
-node_js:
-  - "5"
-env:
-  global:
-    - BIN="node" ISTANBUL=false OPTION=""
-    - SAUCE_LABS=false SAUCE_USERNAME="lodash"
-    - secure: "tg1JFsIFnxzLaTboFPOnm+aJCuMm5+JdhLlESlqg9x3fwro++7KCnwHKLNovhchaPe4otC43ZMB/nfWhDnDm11dKbm/V6HlTkED+dadTsaLxVDg6J+7yK41QhokBPJOxLV78iDaNaAQVYEirAgZ0yn8kFubxmNKV+bpCGQNc9yU="
-  matrix:
-    -
-    - BIN="phantomjs"
-    - ISTANBUL=true
-    - SAUCE_LABS=true
-matrix:
-  include:
-    - node_js: "0.10"
-      env:
-    - node_js: "0.12"
-      env:
-    - node_js: "4"
-      env:
-git:
-  depth: 10
-branches:
-  only:
-    - master
-notifications:
-  webhooks:
-    urls:
-      - https://webhooks.gitter.im/e/4aab6358b0e9aed0b628
-    on_success: change
-    on_failure: always
-before_install:
-  - "nvm use $TRAVIS_NODE_VERSION"
-  - "npm set loglevel error"
-  - "npm set progress false"
-  - "npm i -g npm@\"^2.0.0\""
-  - |
-      PATTERN[0]="|\s*if\s*\(isHostObject\b[\s\S]+?\}(?=\n)|"
-      PATTERN[1]="|\s*if\s*\(enumerate\b[\s\S]+?\};\s*\}|"
-      PATTERN[2]="|\s*while\s*\([^)]+\)\s*\{\s*iteratee\(index\);\s*\}|"
-      PATTERN[3]="|\s*else\s*\{\s*assocSet\(data\b[\s\S]+?\}|"
-      PATTERN[4]="|\bcase\s+(?:dataView|set|map|weakMap)CtorString:.+|g"
-      PATTERN[5]="|\bindex,\s*iterable\)\s*===\s*false\)[^}]+?(break;)|"
-      PATTERN[6]="|\s*if\s*\(\!lodashFunc\)\s*\{\s*return;\s*\}|"
-      PATTERN[7]="|\s*define\([\s\S]+?\);|"
-      PATTERN[8]="|\s*root\._\s*=\s*_;|"
-
-      if [ $ISTANBUL == true ]; then
-        set -e
-        for PTRN in ${PATTERN[@]}; do
-          node ./test/remove.js "$PTRN" ./lodash.js
-        done
-      fi
-  - "git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli && mkdir $_/node_modules && cd $_ && ln -s ../../../ ./lodash && cd ../ && npm i && cd ../../"
-  - "node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js"
-script:
-  - "[ $ISTANBUL == false ]   || istanbul cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./lodash.js"
-  - "[ $ISTANBUL == false ]   || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/lcov.info | coveralls) || true"
-  - "[ $ISTANBUL == false ]   || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/coverage.json | codecov) || true"
-  - "[ $SAUCE_LABS == true ]  || [ $ISTANBUL == true ] || cd ./test"
-  - "[ $SAUCE_LABS == true ]  || [ $ISTANBUL == true ] || $BIN $OPTION ./test.js ../lodash.js"
-  - "[ $SAUCE_LABS == true ]  || [ $ISTANBUL == true ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || $BIN $OPTION ./test.js ../dist/lodash.min.js"
-  - "[ $SAUCE_LABS == false ] || rm -rf ./node_modules/lodash"
-  - "[ $SAUCE_LABS == false ] || ($BIN ./node_modules/lodash-cli/bin/lodash -d -o ./node_modules/lodash/index.js && cd ./node_modules/lodash/ && ln -s ./index.js ./lodash.js && cd ../../)"
-  - "[ $SAUCE_LABS == false ] || $BIN ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js"
-  - "[ $SAUCE_LABS == false ] || npm run build"
-  - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\"     runner=\"test/index.html?build=../dist/lodash.js&noglobals=true\"     tags=\"development\""
-  - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\"     runner=\"test/index.html?build=../dist/lodash.min.js&noglobals=true\" tags=\"production\""
-  - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash-fp tests\"  runner=\"test/fp.html?noglobals=true\"                                tags=\"development\""
-  - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.js\"               tags=\"development,underscore\""
-  - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.min.js\"           tags=\"production,underscore\""
-  - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\"   runner=\"test/backbone.html?build=../dist/lodash.js\"                 tags=\"development,backbone\""
-  - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\"   runner=\"test/backbone.html?build=../dist/lodash.min.js\"             tags=\"production,backbone\""
-  - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\"   runner=\"test/backbone.html?build=../dist/lodash.core.js\"            tags=\"development,backbone\""
-  - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\"   runner=\"test/backbone.html?build=../dist/lodash.core.min.js\"        tags=\"production,backbone\""
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/LICENSE b/views/ngXosViews/serviceGrid/src/vendor/lodash/LICENSE
deleted file mode 100644
index e0c69d5..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/LICENSE
+++ /dev/null
@@ -1,47 +0,0 @@
-Copyright jQuery Foundation and other contributors <https://jquery.org/>
-
-Based on Underscore.js, copyright Jeremy Ashkenas,
-DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
-
-This software consists of voluntary contributions made by many
-individuals. For exact contribution history, see the revision history
-available at https://github.com/lodash/lodash
-
-The following license applies to all parts of this software except as
-documented below:
-
-====
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-====
-
-Copyright and related rights for sample code are waived via CC0. Sample
-code is defined as all source code displayed within the prose of the
-documentation.
-
-CC0: http://creativecommons.org/publicdomain/zero/1.0/
-
-====
-
-Files located in the node_modules and vendor directories are externally
-maintained libraries used by this software which have their own
-licenses; we recommend you read them, as their terms may differ from the
-terms above.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/README.md b/views/ngXosViews/serviceGrid/src/vendor/lodash/README.md
deleted file mode 100644
index fe14559..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# lodash v4.11.2
-
-[Site](https://lodash.com/) |
-[Docs](https://lodash.com/docs) |
-[FP Guide](https://github.com/lodash/lodash/wiki/FP-Guide) |
-[Contributing](https://github.com/lodash/lodash/blob/4.11.2/.github/CONTRIBUTING.md) |
-[Wiki](https://github.com/lodash/lodash/wiki "Changelog, Roadmap, etc.") |
-[Code of Conduct](https://jquery.org/conduct/) |
-[Twitter](https://twitter.com/bestiejs) |
-[Chat](https://gitter.im/lodash/lodash)
-
-The [Lodash](https://lodash.com/) library exported as a [UMD](https://github.com/umdjs/umd) module.
-
-Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
-```bash
-$ npm run build
-$ lodash -o ./dist/lodash.js
-$ lodash core -o ./dist/lodash.core.js
-```
-
-## Download
-
-Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.11.2/LICENSE) & supports [modern environments](#support).<br>
-Review the [build differences](https://github.com/lodash/lodash/wiki/build-differences) & pick one that’s right for you.
-
- * [Core build](https://raw.githubusercontent.com/lodash/lodash/4.11.2/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.11.2/dist/lodash.core.min.js))
- * [Full build](https://raw.githubusercontent.com/lodash/lodash/4.11.2/dist/lodash.js) ([~22 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.11.2/dist/lodash.min.js))
- * [CDN copies](https://www.jsdelivr.com/projects/lodash)
-
-## Why Lodash?
-
-Lodash makes JavaScript easier by taking the hassle out of working with arrays,<br>
-numbers, objects, strings, etc. Lodash’s modular methods are great for:
-
-* Iterating arrays, objects, & strings
-* Manipulating & testing values
-* Creating composite functions
-
-## Module Formats
-
-Lodash is available in a [variety of builds](https://lodash.com/custom-builds) & module formats.
-
- * [lodash](https://www.npmjs.com/package/lodash) & [per method packages](https://www.npmjs.com/browse/keyword/lodash-modularized)
- * [lodash-amd](https://www.npmjs.com/package/lodash-amd)
- * [lodash-es](https://www.npmjs.com/package/lodash-es) & [babel-plugin-lodash](https://www.npmjs.com/package/babel-plugin-lodash)
- * [lodash/fp](https://github.com/lodash/lodash/tree/4.11.2-npm/fp)
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.core.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.core.js
deleted file mode 100644
index 73b541b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.core.js
+++ /dev/null
@@ -1,3978 +0,0 @@
-/**
- * @license
- * lodash 4.11.2 (Custom Build) <https://lodash.com/>
- * Build: `lodash core -o ./dist/lodash.core.js`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-;(function() {
-
-  /** Used as a safe reference for `undefined` in pre-ES5 environments. */
-  var undefined;
-
-  /** Used as the semantic version number. */
-  var VERSION = '4.11.2';
-
-  /** Used as the `TypeError` message for "Functions" methods. */
-  var FUNC_ERROR_TEXT = 'Expected a function';
-
-  /** Used to compose bitmasks for wrapper metadata. */
-  var BIND_FLAG = 1,
-      PARTIAL_FLAG = 32;
-
-  /** Used to compose bitmasks for comparison styles. */
-  var UNORDERED_COMPARE_FLAG = 1,
-      PARTIAL_COMPARE_FLAG = 2;
-
-  /** Used as references for various `Number` constants. */
-  var INFINITY = 1 / 0,
-      MAX_SAFE_INTEGER = 9007199254740991;
-
-  /** `Object#toString` result references. */
-  var argsTag = '[object Arguments]',
-      arrayTag = '[object Array]',
-      boolTag = '[object Boolean]',
-      dateTag = '[object Date]',
-      errorTag = '[object Error]',
-      funcTag = '[object Function]',
-      genTag = '[object GeneratorFunction]',
-      numberTag = '[object Number]',
-      objectTag = '[object Object]',
-      regexpTag = '[object RegExp]',
-      stringTag = '[object String]';
-
-  /** Used to match HTML entities and HTML characters. */
-  var reUnescapedHtml = /[&<>"'`]/g,
-      reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
-
-  /** Used to detect unsigned integer values. */
-  var reIsUint = /^(?:0|[1-9]\d*)$/;
-
-  /** Used to map characters to HTML entities. */
-  var htmlEscapes = {
-    '&': '&amp;',
-    '<': '&lt;',
-    '>': '&gt;',
-    '"': '&quot;',
-    "'": '&#39;',
-    '`': '&#96;'
-  };
-
-  /** Used to determine if values are of the language type `Object`. */
-  var objectTypes = {
-    'function': true,
-    'object': true
-  };
-
-  /** Detect free variable `exports`. */
-  var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)
-    ? exports
-    : undefined;
-
-  /** Detect free variable `module`. */
-  var freeModule = (objectTypes[typeof module] && module && !module.nodeType)
-    ? module
-    : undefined;
-
-  /** Detect the popular CommonJS extension `module.exports`. */
-  var moduleExports = (freeModule && freeModule.exports === freeExports)
-    ? freeExports
-    : undefined;
-
-  /** Detect free variable `global` from Node.js. */
-  var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
-
-  /** Detect free variable `self`. */
-  var freeSelf = checkGlobal(objectTypes[typeof self] && self);
-
-  /** Detect free variable `window`. */
-  var freeWindow = checkGlobal(objectTypes[typeof window] && window);
-
-  /** Detect `this` as the global object. */
-  var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
-
-  /**
-   * Used as a reference to the global object.
-   *
-   * The `this` value is used if it's the global object to avoid Greasemonkey's
-   * restricted `window` object, otherwise the `window` object is used.
-   */
-  var root = freeGlobal ||
-    ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||
-      freeSelf || thisGlobal || Function('return this')();
-
-  /*--------------------------------------------------------------------------*/
-
-  /**
-   * Creates a new array concatenating `array` with `other`.
-   *
-   * @private
-   * @param {Array} array The first array to concatenate.
-   * @param {Array} other The second array to concatenate.
-   * @returns {Array} Returns the new concatenated array.
-   */
-  function arrayConcat(array, other) {
-    return arrayPush(copyArray(array), values);
-  }
-
-  /**
-   * Appends the elements of `values` to `array`.
-   *
-   * @private
-   * @param {Array} array The array to modify.
-   * @param {Array} values The values to append.
-   * @returns {Array} Returns `array`.
-   */
-  function arrayPush(array, values) {
-    array.push.apply(array, values);
-    return array;
-  }
-
-  /**
-   * The base implementation of methods like `_.find` and `_.findKey`, without
-   * support for iteratee shorthands, which iterates over `collection` using
-   * `eachFunc`.
-   *
-   * @private
-   * @param {Array|Object} collection The collection to search.
-   * @param {Function} predicate The function invoked per iteration.
-   * @param {Function} eachFunc The function to iterate over `collection`.
-   * @param {boolean} [retKey] Specify returning the key of the found element
-   *  instead of the element itself.
-   * @returns {*} Returns the found element or its key, else `undefined`.
-   */
-  function baseFind(collection, predicate, eachFunc, retKey) {
-    var result;
-    eachFunc(collection, function(value, key, collection) {
-      if (predicate(value, key, collection)) {
-        result = retKey ? key : value;
-        return false;
-      }
-    });
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.reduce` and `_.reduceRight`, without support
-   * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
-   *
-   * @private
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @param {*} accumulator The initial value.
-   * @param {boolean} initAccum Specify using the first or last element of
-   *  `collection` as the initial value.
-   * @param {Function} eachFunc The function to iterate over `collection`.
-   * @returns {*} Returns the accumulated value.
-   */
-  function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
-    eachFunc(collection, function(value, index, collection) {
-      accumulator = initAccum
-        ? (initAccum = false, value)
-        : iteratee(accumulator, value, index, collection);
-    });
-    return accumulator;
-  }
-
-  /**
-   * The base implementation of `_.times` without support for iteratee shorthands
-   * or max array length checks.
-   *
-   * @private
-   * @param {number} n The number of times to invoke `iteratee`.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Array} Returns the array of results.
-   */
-  function baseTimes(n, iteratee) {
-    var index = -1,
-        result = Array(n);
-
-    while (++index < n) {
-      result[index] = iteratee(index);
-    }
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.values` and `_.valuesIn` which creates an
-   * array of `object` property values corresponding to the property names
-   * of `props`.
-   *
-   * @private
-   * @param {Object} object The object to query.
-   * @param {Array} props The property names to get values for.
-   * @returns {Object} Returns the array of property values.
-   */
-  function baseValues(object, props) {
-    return baseMap(props, function(key) {
-      return object[key];
-    });
-  }
-
-  /**
-   * Checks if `value` is a global object.
-   *
-   * @private
-   * @param {*} value The value to check.
-   * @returns {null|Object} Returns `value` if it's a global object, else `null`.
-   */
-  function checkGlobal(value) {
-    return (value && value.Object === Object) ? value : null;
-  }
-
-  /**
-   * Used by `_.escape` to convert characters to HTML entities.
-   *
-   * @private
-   * @param {string} chr The matched character to escape.
-   * @returns {string} Returns the escaped character.
-   */
-  function escapeHtmlChar(chr) {
-    return htmlEscapes[chr];
-  }
-
-  /**
-   * Checks if `value` is a host object in IE < 9.
-   *
-   * @private
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
-   */
-  function isHostObject(value) {
-    // Many host objects are `Object` objects that can coerce to strings
-    // despite having improperly defined `toString` methods.
-    var result = false;
-    if (value != null && typeof value.toString != 'function') {
-      try {
-        result = !!(value + '');
-      } catch (e) {}
-    }
-    return result;
-  }
-
-  /**
-   * Converts `iterator` to an array.
-   *
-   * @private
-   * @param {Object} iterator The iterator to convert.
-   * @returns {Array} Returns the converted array.
-   */
-  function iteratorToArray(iterator) {
-    var data,
-        result = [];
-
-    while (!(data = iterator.next()).done) {
-      result.push(data.value);
-    }
-    return result;
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  /** Used for built-in method references. */
-  var arrayProto = Array.prototype,
-      objectProto = Object.prototype;
-
-  /** Used to check objects for own properties. */
-  var hasOwnProperty = objectProto.hasOwnProperty;
-
-  /** Used to generate unique IDs. */
-  var idCounter = 0;
-
-  /**
-   * Used to resolve the
-   * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
-   * of values.
-   */
-  var objectToString = objectProto.toString;
-
-  /** Used to restore the original `_` reference in `_.noConflict`. */
-  var oldDash = root._;
-
-  /** Built-in value references. */
-  var Reflect = root.Reflect,
-      Symbol = root.Symbol,
-      Uint8Array = root.Uint8Array,
-      enumerate = Reflect ? Reflect.enumerate : undefined,
-      objectCreate = Object.create,
-      propertyIsEnumerable = objectProto.propertyIsEnumerable;
-
-  /* Built-in method references for those with the same name as other `lodash` methods. */
-  var nativeIsFinite = root.isFinite,
-      nativeKeys = Object.keys,
-      nativeMax = Math.max;
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * Creates a `lodash` object which wraps `value` to enable implicit method
-   * chain sequences. Methods that operate on and return arrays, collections,
-   * and functions can be chained together. Methods that retrieve a single value
-   * or may return a primitive value will automatically end the chain sequence
-   * and return the unwrapped value. Otherwise, the value must be unwrapped
-   * with `_#value`.
-   *
-   * Explicit chain sequences, which must be unwrapped with `_#value`, may be
-   * enabled using `_.chain`.
-   *
-   * The execution of chained methods is lazy, that is, it's deferred until
-   * `_#value` is implicitly or explicitly called.
-   *
-   * Lazy evaluation allows several methods to support shortcut fusion.
-   * Shortcut fusion is an optimization to merge iteratee calls; this avoids
-   * the creation of intermediate arrays and can greatly reduce the number of
-   * iteratee executions. Sections of a chain sequence qualify for shortcut
-   * fusion if the section is applied to an array of at least `200` elements
-   * and any iteratees accept only one argument. The heuristic for whether a
-   * section qualifies for shortcut fusion is subject to change.
-   *
-   * Chaining is supported in custom builds as long as the `_#value` method is
-   * directly or indirectly included in the build.
-   *
-   * In addition to lodash methods, wrappers have `Array` and `String` methods.
-   *
-   * The wrapper `Array` methods are:
-   * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
-   *
-   * The wrapper `String` methods are:
-   * `replace` and `split`
-   *
-   * The wrapper methods that support shortcut fusion are:
-   * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
-   * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
-   * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
-   *
-   * The chainable wrapper methods are:
-   * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
-   * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
-   * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
-   * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
-   * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
-   * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
-   * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
-   * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
-   * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
-   * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
-   * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
-   * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
-   * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
-   * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
-   * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
-   * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
-   * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
-   * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
-   * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
-   * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
-   * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
-   * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
-   * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
-   * `zipObject`, `zipObjectDeep`, and `zipWith`
-   *
-   * The wrapper methods that are **not** chainable by default are:
-   * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
-   * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`,
-   * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`,
-   * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`,
-   * `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`,
-   * `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`,
-   * `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`,
-   * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`,
-   * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`,
-   * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`,
-   * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
-   * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
-   * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
-   * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
-   * `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`,
-   * `noConflict`, `noop`, `now`, `nth`, `pad`, `padEnd`, `padStart`, `parseInt`,
-   * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`,
-   * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
-   * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`,
-   * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`,
-   * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`,
-   * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`,
-   * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words`
-   *
-   * @name _
-   * @constructor
-   * @category Seq
-   * @param {*} value The value to wrap in a `lodash` instance.
-   * @returns {Object} Returns the new `lodash` wrapper instance.
-   * @example
-   *
-   * function square(n) {
-   *   return n * n;
-   * }
-   *
-   * var wrapped = _([1, 2, 3]);
-   *
-   * // Returns an unwrapped value.
-   * wrapped.reduce(_.add);
-   * // => 6
-   *
-   * // Returns a wrapped value.
-   * var squares = wrapped.map(square);
-   *
-   * _.isArray(squares);
-   * // => false
-   *
-   * _.isArray(squares.value());
-   * // => true
-   */
-  function lodash(value) {
-    return value instanceof LodashWrapper
-      ? value
-      : new LodashWrapper(value);
-  }
-
-  /**
-   * The base constructor for creating `lodash` wrapper objects.
-   *
-   * @private
-   * @param {*} value The value to wrap.
-   * @param {boolean} [chainAll] Enable explicit method chain sequences.
-   */
-  function LodashWrapper(value, chainAll) {
-    this.__wrapped__ = value;
-    this.__actions__ = [];
-    this.__chain__ = !!chainAll;
-  }
-
-  LodashWrapper.prototype = baseCreate(lodash.prototype);
-  LodashWrapper.prototype.constructor = LodashWrapper;
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * Used by `_.defaults` to customize its `_.assignIn` use.
-   *
-   * @private
-   * @param {*} objValue The destination value.
-   * @param {*} srcValue The source value.
-   * @param {string} key The key of the property to assign.
-   * @param {Object} object The parent object of `objValue`.
-   * @returns {*} Returns the value to assign.
-   */
-  function assignInDefaults(objValue, srcValue, key, object) {
-    if (objValue === undefined ||
-        (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
-      return srcValue;
-    }
-    return objValue;
-  }
-
-  /**
-   * Assigns `value` to `key` of `object` if the existing value is not equivalent
-   * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-   * for equality comparisons.
-   *
-   * @private
-   * @param {Object} object The object to modify.
-   * @param {string} key The key of the property to assign.
-   * @param {*} value The value to assign.
-   */
-  function assignValue(object, key, value) {
-    var objValue = object[key];
-    if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
-        (value === undefined && !(key in object))) {
-      object[key] = value;
-    }
-  }
-
-  /**
-   * The base implementation of `_.create` without support for assigning
-   * properties to the created object.
-   *
-   * @private
-   * @param {Object} prototype The object to inherit from.
-   * @returns {Object} Returns the new object.
-   */
-  function baseCreate(proto) {
-    return isObject(proto) ? objectCreate(proto) : {};
-  }
-
-  /**
-   * The base implementation of `_.delay` and `_.defer` which accepts an array
-   * of `func` arguments.
-   *
-   * @private
-   * @param {Function} func The function to delay.
-   * @param {number} wait The number of milliseconds to delay invocation.
-   * @param {Object} args The arguments to provide to `func`.
-   * @returns {number} Returns the timer id.
-   */
-  function baseDelay(func, wait, args) {
-    if (typeof func != 'function') {
-      throw new TypeError(FUNC_ERROR_TEXT);
-    }
-    return setTimeout(function() { func.apply(undefined, args); }, wait);
-  }
-
-  /**
-   * The base implementation of `_.forEach` without support for iteratee shorthands.
-   *
-   * @private
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Array|Object} Returns `collection`.
-   */
-  var baseEach = createBaseEach(baseForOwn);
-
-  /**
-   * The base implementation of `_.every` without support for iteratee shorthands.
-   *
-   * @private
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Function} predicate The function invoked per iteration.
-   * @returns {boolean} Returns `true` if all elements pass the predicate check,
-   *  else `false`
-   */
-  function baseEvery(collection, predicate) {
-    var result = true;
-    baseEach(collection, function(value, index, collection) {
-      result = !!predicate(value, index, collection);
-      return result;
-    });
-    return result;
-  }
-
-  /**
-   * The base implementation of methods like `_.max` and `_.min` which accepts a
-   * `comparator` to determine the extremum value.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The iteratee invoked per iteration.
-   * @param {Function} comparator The comparator used to compare values.
-   * @returns {*} Returns the extremum value.
-   */
-  function baseExtremum(array, iteratee, comparator) {
-    var index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      var value = array[index],
-          current = iteratee(value);
-
-      if (current != null && (computed === undefined
-            ? (current === current && !false)
-            : comparator(current, computed)
-          )) {
-        var computed = current,
-            result = value;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.filter` without support for iteratee shorthands.
-   *
-   * @private
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Function} predicate The function invoked per iteration.
-   * @returns {Array} Returns the new filtered array.
-   */
-  function baseFilter(collection, predicate) {
-    var result = [];
-    baseEach(collection, function(value, index, collection) {
-      if (predicate(value, index, collection)) {
-        result.push(value);
-      }
-    });
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.flatten` with support for restricting flattening.
-   *
-   * @private
-   * @param {Array} array The array to flatten.
-   * @param {number} depth The maximum recursion depth.
-   * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
-   * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
-   * @param {Array} [result=[]] The initial result value.
-   * @returns {Array} Returns the new flattened array.
-   */
-  function baseFlatten(array, depth, predicate, isStrict, result) {
-    var index = -1,
-        length = array.length;
-
-    predicate || (predicate = isFlattenable);
-    result || (result = []);
-
-    while (++index < length) {
-      var value = array[index];
-      if (depth > 0 && predicate(value)) {
-        if (depth > 1) {
-          // Recursively flatten arrays (susceptible to call stack limits).
-          baseFlatten(value, depth - 1, predicate, isStrict, result);
-        } else {
-          arrayPush(result, value);
-        }
-      } else if (!isStrict) {
-        result[result.length] = value;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * The base implementation of `baseForOwn` which iterates over `object`
-   * properties returned by `keysFunc` and invokes `iteratee` for each property.
-   * Iteratee functions may exit iteration early by explicitly returning `false`.
-   *
-   * @private
-   * @param {Object} object The object to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @param {Function} keysFunc The function to get the keys of `object`.
-   * @returns {Object} Returns `object`.
-   */
-  var baseFor = createBaseFor();
-
-  /**
-   * The base implementation of `_.forOwn` without support for iteratee shorthands.
-   *
-   * @private
-   * @param {Object} object The object to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Object} Returns `object`.
-   */
-  function baseForOwn(object, iteratee) {
-    return object && baseFor(object, iteratee, keys);
-  }
-
-  /**
-   * The base implementation of `_.functions` which creates an array of
-   * `object` function property names filtered from `props`.
-   *
-   * @private
-   * @param {Object} object The object to inspect.
-   * @param {Array} props The property names to filter.
-   * @returns {Array} Returns the new array of filtered property names.
-   */
-  function baseFunctions(object, props) {
-    return baseFilter(props, function(key) {
-      return isFunction(object[key]);
-    });
-  }
-
-  /**
-   * The base implementation of `_.gt` which doesn't coerce arguments to numbers.
-   *
-   * @private
-   * @param {*} value The value to compare.
-   * @param {*} other The other value to compare.
-   * @returns {boolean} Returns `true` if `value` is greater than `other`,
-   *  else `false`.
-   */
-  function baseGt(value, other) {
-    return value > other;
-  }
-
-  /**
-   * The base implementation of `_.isEqual` which supports partial comparisons
-   * and tracks traversed objects.
-   *
-   * @private
-   * @param {*} value The value to compare.
-   * @param {*} other The other value to compare.
-   * @param {Function} [customizer] The function to customize comparisons.
-   * @param {boolean} [bitmask] The bitmask of comparison flags.
-   *  The bitmask may be composed of the following flags:
-   *     1 - Unordered comparison
-   *     2 - Partial comparison
-   * @param {Object} [stack] Tracks traversed `value` and `other` objects.
-   * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
-   */
-  function baseIsEqual(value, other, customizer, bitmask, stack) {
-    if (value === other) {
-      return true;
-    }
-    if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
-      return value !== value && other !== other;
-    }
-    return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
-  }
-
-  /**
-   * A specialized version of `baseIsEqual` for arrays and objects which performs
-   * deep comparisons and tracks traversed objects enabling objects with circular
-   * references to be compared.
-   *
-   * @private
-   * @param {Object} object The object to compare.
-   * @param {Object} other The other object to compare.
-   * @param {Function} equalFunc The function to determine equivalents of values.
-   * @param {Function} [customizer] The function to customize comparisons.
-   * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
-   *  for more details.
-   * @param {Object} [stack] Tracks traversed `object` and `other` objects.
-   * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
-   */
-  function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
-    var objIsArr = isArray(object),
-        othIsArr = isArray(other),
-        objTag = arrayTag,
-        othTag = arrayTag;
-
-    if (!objIsArr) {
-      objTag = objectToString.call(object);
-      objTag = objTag == argsTag ? objectTag : objTag;
-    }
-    if (!othIsArr) {
-      othTag = objectToString.call(other);
-      othTag = othTag == argsTag ? objectTag : othTag;
-    }
-    var objIsObj = objTag == objectTag && !isHostObject(object),
-        othIsObj = othTag == objectTag && !isHostObject(other),
-        isSameTag = objTag == othTag;
-
-    stack || (stack = []);
-    var stacked = find(stack, function(entry) {
-      return entry[0] === object;
-    });
-    if (stacked && stacked[1]) {
-      return stacked[1] == other;
-    }
-    stack.push([object, other]);
-    if (isSameTag && !objIsObj) {
-      var result = (objIsArr || isTypedArray(object))
-        ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)
-        : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
-      stack.pop();
-      return result;
-    }
-    if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
-      var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
-          othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
-
-      if (objIsWrapped || othIsWrapped) {
-        var objUnwrapped = objIsWrapped ? object.value() : object,
-            othUnwrapped = othIsWrapped ? other.value() : other;
-
-        var result = equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
-        stack.pop();
-        return result;
-      }
-    }
-    if (!isSameTag) {
-      return false;
-    }
-    var result = equalObjects(object, other, equalFunc, customizer, bitmask, stack);
-    stack.pop();
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.iteratee`.
-   *
-   * @private
-   * @param {*} [value=_.identity] The value to convert to an iteratee.
-   * @returns {Function} Returns the iteratee.
-   */
-  function baseIteratee(func) {
-    if (typeof func == 'function') {
-      return func;
-    }
-    if (func == null) {
-      return identity;
-    }
-    return (typeof func == 'object' ? baseMatches : baseProperty)(func);
-  }
-
-  /**
-   * The base implementation of `_.keys` which doesn't skip the constructor
-   * property of prototypes or treat sparse arrays as dense.
-   *
-   * @private
-   * @param {Object} object The object to query.
-   * @returns {Array} Returns the array of property names.
-   */
-  function baseKeys(object) {
-    return nativeKeys(Object(object));
-  }
-
-  /**
-   * The base implementation of `_.keysIn` which doesn't skip the constructor
-   * property of prototypes or treat sparse arrays as dense.
-   *
-   * @private
-   * @param {Object} object The object to query.
-   * @returns {Array} Returns the array of property names.
-   */
-  function baseKeysIn(object) {
-    object = object == null ? object : Object(object);
-
-    var result = [];
-    for (var key in object) {
-      result.push(key);
-    }
-    return result;
-  }
-
-  // Fallback for IE < 9 with es6-shim.
-  if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
-    baseKeysIn = function(object) {
-      return iteratorToArray(enumerate(object));
-    };
-  }
-
-  /**
-   * The base implementation of `_.lt` which doesn't coerce arguments to numbers.
-   *
-   * @private
-   * @param {*} value The value to compare.
-   * @param {*} other The other value to compare.
-   * @returns {boolean} Returns `true` if `value` is less than `other`,
-   *  else `false`.
-   */
-  function baseLt(value, other) {
-    return value < other;
-  }
-
-  /**
-   * The base implementation of `_.map` without support for iteratee shorthands.
-   *
-   * @private
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Array} Returns the new mapped array.
-   */
-  function baseMap(collection, iteratee) {
-    var index = -1,
-        result = isArrayLike(collection) ? Array(collection.length) : [];
-
-    baseEach(collection, function(value, key, collection) {
-      result[++index] = iteratee(value, key, collection);
-    });
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.matches` which doesn't clone `source`.
-   *
-   * @private
-   * @param {Object} source The object of property values to match.
-   * @returns {Function} Returns the new function.
-   */
-  function baseMatches(source) {
-    var props = keys(source);
-    return function(object) {
-      var length = props.length;
-      if (object == null) {
-        return !length;
-      }
-      object = Object(object);
-      while (length--) {
-        var key = props[length];
-        if (!(key in object &&
-              baseIsEqual(source[key], object[key], undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG)
-            )) {
-          return false;
-        }
-      }
-      return true;
-    };
-  }
-
-  /**
-   * The base implementation of `_.pick` without support for individual
-   * property identifiers.
-   *
-   * @private
-   * @param {Object} object The source object.
-   * @param {string[]} props The property identifiers to pick.
-   * @returns {Object} Returns the new object.
-   */
-  function basePick(object, props) {
-    object = Object(object);
-    return reduce(props, function(result, key) {
-      if (key in object) {
-        result[key] = object[key];
-      }
-      return result;
-    }, {});
-  }
-
-  /**
-   * The base implementation of `_.property` without support for deep paths.
-   *
-   * @private
-   * @param {string} key The key of the property to get.
-   * @returns {Function} Returns the new function.
-   */
-  function baseProperty(key) {
-    return function(object) {
-      return object == null ? undefined : object[key];
-    };
-  }
-
-  /**
-   * The base implementation of `_.slice` without an iteratee call guard.
-   *
-   * @private
-   * @param {Array} array The array to slice.
-   * @param {number} [start=0] The start position.
-   * @param {number} [end=array.length] The end position.
-   * @returns {Array} Returns the slice of `array`.
-   */
-  function baseSlice(array, start, end) {
-    var index = -1,
-        length = array.length;
-
-    if (start < 0) {
-      start = -start > length ? 0 : (length + start);
-    }
-    end = end > length ? length : end;
-    if (end < 0) {
-      end += length;
-    }
-    length = start > end ? 0 : ((end - start) >>> 0);
-    start >>>= 0;
-
-    var result = Array(length);
-    while (++index < length) {
-      result[index] = array[index + start];
-    }
-    return result;
-  }
-
-  /**
-   * Copies the values of `source` to `array`.
-   *
-   * @private
-   * @param {Array} source The array to copy values from.
-   * @param {Array} [array=[]] The array to copy values to.
-   * @returns {Array} Returns `array`.
-   */
-  function copyArray(source) {
-    return baseSlice(source, 0, source.length);
-  }
-
-  /**
-   * The base implementation of `_.some` without support for iteratee shorthands.
-   *
-   * @private
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Function} predicate The function invoked per iteration.
-   * @returns {boolean} Returns `true` if any element passes the predicate check,
-   *  else `false`.
-   */
-  function baseSome(collection, predicate) {
-    var result;
-
-    baseEach(collection, function(value, index, collection) {
-      result = predicate(value, index, collection);
-      return !result;
-    });
-    return !!result;
-  }
-
-  /**
-   * The base implementation of `wrapperValue` which returns the result of
-   * performing a sequence of actions on the unwrapped `value`, where each
-   * successive action is supplied the return value of the previous.
-   *
-   * @private
-   * @param {*} value The unwrapped value.
-   * @param {Array} actions Actions to perform to resolve the unwrapped value.
-   * @returns {*} Returns the resolved value.
-   */
-  function baseWrapperValue(value, actions) {
-    var result = value;
-    return reduce(actions, function(result, action) {
-      return action.func.apply(action.thisArg, arrayPush([result], action.args));
-    }, result);
-  }
-
-  /**
-   * Compares values to sort them in ascending order.
-   *
-   * @private
-   * @param {*} value The value to compare.
-   * @param {*} other The other value to compare.
-   * @returns {number} Returns the sort order indicator for `value`.
-   */
-  function compareAscending(value, other) {
-    if (value !== other) {
-      var valIsDefined = value !== undefined,
-          valIsNull = value === null,
-          valIsReflexive = value === value,
-          valIsSymbol = false;
-
-      var othIsDefined = other !== undefined,
-          othIsNull = other === null,
-          othIsReflexive = other === other,
-          othIsSymbol = false;
-
-      if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
-          (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
-          (valIsNull && othIsDefined && othIsReflexive) ||
-          (!valIsDefined && othIsReflexive) ||
-          !valIsReflexive) {
-        return 1;
-      }
-      if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
-          (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
-          (othIsNull && valIsDefined && valIsReflexive) ||
-          (!othIsDefined && valIsReflexive) ||
-          !othIsReflexive) {
-        return -1;
-      }
-    }
-    return 0;
-  }
-
-  /**
-   * Copies properties of `source` to `object`.
-   *
-   * @private
-   * @param {Object} source The object to copy properties from.
-   * @param {Array} props The property identifiers to copy.
-   * @param {Object} [object={}] The object to copy properties to.
-   * @param {Function} [customizer] The function to customize copied values.
-   * @returns {Object} Returns `object`.
-   */
-  function copyObject(source, props, object, customizer) {
-    object || (object = {});
-
-    var index = -1,
-        length = props.length;
-
-    while (++index < length) {
-      var key = props[index];
-
-      var newValue = customizer
-        ? customizer(object[key], source[key], key, object, source)
-        : source[key];
-
-      assignValue(object, key, newValue);
-    }
-    return object;
-  }
-
-  /**
-   * Creates a function like `_.assign`.
-   *
-   * @private
-   * @param {Function} assigner The function to assign values.
-   * @returns {Function} Returns the new assigner function.
-   */
-  function createAssigner(assigner) {
-    return rest(function(object, sources) {
-      var index = -1,
-          length = sources.length,
-          customizer = length > 1 ? sources[length - 1] : undefined;
-
-      customizer = typeof customizer == 'function'
-        ? (length--, customizer)
-        : undefined;
-
-      object = Object(object);
-      while (++index < length) {
-        var source = sources[index];
-        if (source) {
-          assigner(object, source, index, customizer);
-        }
-      }
-      return object;
-    });
-  }
-
-  /**
-   * Creates a `baseEach` or `baseEachRight` function.
-   *
-   * @private
-   * @param {Function} eachFunc The function to iterate over a collection.
-   * @param {boolean} [fromRight] Specify iterating from right to left.
-   * @returns {Function} Returns the new base function.
-   */
-  function createBaseEach(eachFunc, fromRight) {
-    return function(collection, iteratee) {
-      if (collection == null) {
-        return collection;
-      }
-      if (!isArrayLike(collection)) {
-        return eachFunc(collection, iteratee);
-      }
-      var length = collection.length,
-          index = fromRight ? length : -1,
-          iterable = Object(collection);
-
-      while ((fromRight ? index-- : ++index < length)) {
-        if (iteratee(iterable[index], index, iterable) === false) {
-          break;
-        }
-      }
-      return collection;
-    };
-  }
-
-  /**
-   * Creates a base function for methods like `_.forIn` and `_.forOwn`.
-   *
-   * @private
-   * @param {boolean} [fromRight] Specify iterating from right to left.
-   * @returns {Function} Returns the new base function.
-   */
-  function createBaseFor(fromRight) {
-    return function(object, iteratee, keysFunc) {
-      var index = -1,
-          iterable = Object(object),
-          props = keysFunc(object),
-          length = props.length;
-
-      while (length--) {
-        var key = props[fromRight ? length : ++index];
-        if (iteratee(iterable[key], key, iterable) === false) {
-          break;
-        }
-      }
-      return object;
-    };
-  }
-
-  /**
-   * Creates a function that produces an instance of `Ctor` regardless of
-   * whether it was invoked as part of a `new` expression or by `call` or `apply`.
-   *
-   * @private
-   * @param {Function} Ctor The constructor to wrap.
-   * @returns {Function} Returns the new wrapped function.
-   */
-  function createCtorWrapper(Ctor) {
-    return function() {
-      // Use a `switch` statement to work with class constructors. See
-      // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
-      // for more details.
-      var args = arguments;
-      var thisBinding = baseCreate(Ctor.prototype),
-          result = Ctor.apply(thisBinding, args);
-
-      // Mimic the constructor's `return` behavior.
-      // See https://es5.github.io/#x13.2.2 for more details.
-      return isObject(result) ? result : thisBinding;
-    };
-  }
-
-  /**
-   * Creates a function that wraps `func` to invoke it with the `this` binding
-   * of `thisArg` and `partials` prepended to the arguments it receives.
-   *
-   * @private
-   * @param {Function} func The function to wrap.
-   * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
-   *  for more details.
-   * @param {*} thisArg The `this` binding of `func`.
-   * @param {Array} partials The arguments to prepend to those provided to
-   *  the new function.
-   * @returns {Function} Returns the new wrapped function.
-   */
-  function createPartialWrapper(func, bitmask, thisArg, partials) {
-    if (typeof func != 'function') {
-      throw new TypeError(FUNC_ERROR_TEXT);
-    }
-    var isBind = bitmask & BIND_FLAG,
-        Ctor = createCtorWrapper(func);
-
-    function wrapper() {
-      var argsIndex = -1,
-          argsLength = arguments.length,
-          leftIndex = -1,
-          leftLength = partials.length,
-          args = Array(leftLength + argsLength),
-          fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
-
-      while (++leftIndex < leftLength) {
-        args[leftIndex] = partials[leftIndex];
-      }
-      while (argsLength--) {
-        args[leftIndex++] = arguments[++argsIndex];
-      }
-      return fn.apply(isBind ? thisArg : this, args);
-    }
-    return wrapper;
-  }
-
-  /**
-   * A specialized version of `baseIsEqualDeep` for arrays with support for
-   * partial deep comparisons.
-   *
-   * @private
-   * @param {Array} array The array to compare.
-   * @param {Array} other The other array to compare.
-   * @param {Function} equalFunc The function to determine equivalents of values.
-   * @param {Function} customizer The function to customize comparisons.
-   * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
-   *  for more details.
-   * @param {Object} stack Tracks traversed `array` and `other` objects.
-   * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
-   */
-  function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
-    var index = -1,
-        isPartial = bitmask & PARTIAL_COMPARE_FLAG,
-        isUnordered = bitmask & UNORDERED_COMPARE_FLAG,
-        arrLength = array.length,
-        othLength = other.length;
-
-    if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
-      return false;
-    }
-    var result = true;
-
-    // Ignore non-index properties.
-    while (++index < arrLength) {
-      var arrValue = array[index],
-          othValue = other[index];
-
-      var compared;
-      if (compared !== undefined) {
-        if (compared) {
-          continue;
-        }
-        result = false;
-        break;
-      }
-      // Recursively compare arrays (susceptible to call stack limits).
-      if (isUnordered) {
-        if (!baseSome(other, function(othValue) {
-              return arrValue === othValue ||
-                equalFunc(arrValue, othValue, customizer, bitmask, stack);
-            })) {
-          result = false;
-          break;
-        }
-      } else if (!(
-            arrValue === othValue ||
-              equalFunc(arrValue, othValue, customizer, bitmask, stack)
-          )) {
-        result = false;
-        break;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * A specialized version of `baseIsEqualDeep` for comparing objects of
-   * the same `toStringTag`.
-   *
-   * **Note:** This function only supports comparing values with tags of
-   * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
-   *
-   * @private
-   * @param {Object} object The object to compare.
-   * @param {Object} other The other object to compare.
-   * @param {string} tag The `toStringTag` of the objects to compare.
-   * @param {Function} equalFunc The function to determine equivalents of values.
-   * @param {Function} customizer The function to customize comparisons.
-   * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
-   *  for more details.
-   * @param {Object} stack Tracks traversed `object` and `other` objects.
-   * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
-   */
-  function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
-    switch (tag) {
-
-      case boolTag:
-      case dateTag:
-        // Coerce dates and booleans to numbers, dates to milliseconds and
-        // booleans to `1` or `0` treating invalid dates coerced to `NaN` as
-        // not equal.
-        return +object == +other;
-
-      case errorTag:
-        return object.name == other.name && object.message == other.message;
-
-      case numberTag:
-        // Treat `NaN` vs. `NaN` as equal.
-        return (object != +object) ? other != +other : object == +other;
-
-      case regexpTag:
-      case stringTag:
-        // Coerce regexes to strings and treat strings, primitives and objects,
-        // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring
-        // for more details.
-        return object == (other + '');
-
-    }
-    return false;
-  }
-
-  /**
-   * A specialized version of `baseIsEqualDeep` for objects with support for
-   * partial deep comparisons.
-   *
-   * @private
-   * @param {Object} object The object to compare.
-   * @param {Object} other The other object to compare.
-   * @param {Function} equalFunc The function to determine equivalents of values.
-   * @param {Function} customizer The function to customize comparisons.
-   * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
-   *  for more details.
-   * @param {Object} stack Tracks traversed `object` and `other` objects.
-   * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
-   */
-  function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
-    var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
-        objProps = keys(object),
-        objLength = objProps.length,
-        othProps = keys(other),
-        othLength = othProps.length;
-
-    if (objLength != othLength && !isPartial) {
-      return false;
-    }
-    var index = objLength;
-    while (index--) {
-      var key = objProps[index];
-      if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
-        return false;
-      }
-    }
-    var result = true;
-
-    var skipCtor = isPartial;
-    while (++index < objLength) {
-      key = objProps[index];
-      var objValue = object[key],
-          othValue = other[key];
-
-      var compared;
-      // Recursively compare objects (susceptible to call stack limits).
-      if (!(compared === undefined
-            ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))
-            : compared
-          )) {
-        result = false;
-        break;
-      }
-      skipCtor || (skipCtor = key == 'constructor');
-    }
-    if (result && !skipCtor) {
-      var objCtor = object.constructor,
-          othCtor = other.constructor;
-
-      // Non `Object` object instances with different constructors are not equal.
-      if (objCtor != othCtor &&
-          ('constructor' in object && 'constructor' in other) &&
-          !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
-            typeof othCtor == 'function' && othCtor instanceof othCtor)) {
-        result = false;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Gets the "length" property value of `object`.
-   *
-   * **Note:** This function is used to avoid a
-   * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
-   * Safari on at least iOS 8.1-8.3 ARM64.
-   *
-   * @private
-   * @param {Object} object The object to query.
-   * @returns {*} Returns the "length" value.
-   */
-  var getLength = baseProperty('length');
-
-  /**
-   * Creates an array of index keys for `object` values of arrays,
-   * `arguments` objects, and strings, otherwise `null` is returned.
-   *
-   * @private
-   * @param {Object} object The object to query.
-   * @returns {Array|null} Returns index keys, else `null`.
-   */
-  function indexKeys(object) {
-    var length = object ? object.length : undefined;
-    if (isLength(length) &&
-        (isArray(object) || isString(object) || isArguments(object))) {
-      return baseTimes(length, String);
-    }
-    return null;
-  }
-
-  /**
-   * Checks if `value` is a flattenable `arguments` object or array.
-   *
-   * @private
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
-   */
-  function isFlattenable(value) {
-    return isArrayLikeObject(value) && (isArray(value) || isArguments(value));
-  }
-
-  /**
-   * Checks if `value` is a valid array-like index.
-   *
-   * @private
-   * @param {*} value The value to check.
-   * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
-   * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
-   */
-  function isIndex(value, length) {
-    length = length == null ? MAX_SAFE_INTEGER : length;
-    return !!length &&
-      (typeof value == 'number' || reIsUint.test(value)) &&
-      (value > -1 && value % 1 == 0 && value < length);
-  }
-
-  /**
-   * Checks if `value` is likely a prototype object.
-   *
-   * @private
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
-   */
-  function isPrototype(value) {
-    var Ctor = value && value.constructor,
-        proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
-
-    return value === proto;
-  }
-
-  /**
-   * Converts `value` to a string key if it's not a string or symbol.
-   *
-   * @private
-   * @param {*} value The value to inspect.
-   * @returns {string|symbol} Returns the key.
-   */
-  var toKey = String;
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * Creates an array with all falsey values removed. The values `false`, `null`,
-   * `0`, `""`, `undefined`, and `NaN` are falsey.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Array
-   * @param {Array} array The array to compact.
-   * @returns {Array} Returns the new array of filtered values.
-   * @example
-   *
-   * _.compact([0, 1, false, 2, '', 3]);
-   * // => [1, 2, 3]
-   */
-  function compact(array) {
-    return baseFilter(array, Boolean);
-  }
-
-  /**
-   * Creates a new array concatenating `array` with any additional arrays
-   * and/or values.
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @category Array
-   * @param {Array} array The array to concatenate.
-   * @param {...*} [values] The values to concatenate.
-   * @returns {Array} Returns the new concatenated array.
-   * @example
-   *
-   * var array = [1];
-   * var other = _.concat(array, 2, [3], [[4]]);
-   *
-   * console.log(other);
-   * // => [1, 2, 3, [4]]
-   *
-   * console.log(array);
-   * // => [1]
-   */
-  function concat() {
-    var length = arguments.length,
-        array = castArray(arguments[0]);
-
-    if (length < 2) {
-      return length ? copyArray(array) : [];
-    }
-    var args = Array(length - 1);
-    while (length--) {
-      args[length - 1] = arguments[length];
-    }
-    return arrayConcat(array, baseFlatten(args, 1));
-  }
-
-  /**
-   * Flattens `array` a single level deep.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Array
-   * @param {Array} array The array to flatten.
-   * @returns {Array} Returns the new flattened array.
-   * @example
-   *
-   * _.flatten([1, [2, [3, [4]], 5]]);
-   * // => [1, 2, [3, [4]], 5]
-   */
-  function flatten(array) {
-    var length = array ? array.length : 0;
-    return length ? baseFlatten(array, 1) : [];
-  }
-
-  /**
-   * Recursively flattens `array`.
-   *
-   * @static
-   * @memberOf _
-   * @since 3.0.0
-   * @category Array
-   * @param {Array} array The array to flatten.
-   * @returns {Array} Returns the new flattened array.
-   * @example
-   *
-   * _.flattenDeep([1, [2, [3, [4]], 5]]);
-   * // => [1, 2, 3, 4, 5]
-   */
-  function flattenDeep(array) {
-    var length = array ? array.length : 0;
-    return length ? baseFlatten(array, INFINITY) : [];
-  }
-
-  /**
-   * Gets the first element of `array`.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @alias first
-   * @category Array
-   * @param {Array} array The array to query.
-   * @returns {*} Returns the first element of `array`.
-   * @example
-   *
-   * _.head([1, 2, 3]);
-   * // => 1
-   *
-   * _.head([]);
-   * // => undefined
-   */
-  function head(array) {
-    return (array && array.length) ? array[0] : undefined;
-  }
-
-  /**
-   * Gets the index at which the first occurrence of `value` is found in `array`
-   * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-   * for equality comparisons. If `fromIndex` is negative, it's used as the
-   * offset from the end of `array`.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Array
-   * @param {Array} array The array to search.
-   * @param {*} value The value to search for.
-   * @param {number} [fromIndex=0] The index to search from.
-   * @returns {number} Returns the index of the matched value, else `-1`.
-   * @example
-   *
-   * _.indexOf([1, 2, 1, 2], 2);
-   * // => 1
-   *
-   * // Search from the `fromIndex`.
-   * _.indexOf([1, 2, 1, 2], 2, 2);
-   * // => 3
-   */
-  function indexOf(array, value, fromIndex) {
-    var length = array ? array.length : 0;
-    if (typeof fromIndex == 'number') {
-      fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
-    } else {
-      fromIndex = 0;
-    }
-    var index = (fromIndex || 0) - 1,
-        isReflexive = value === value;
-
-    while (++index < length) {
-      var other = array[index];
-      if ((isReflexive ? other === value : other !== other)) {
-        return index;
-      }
-    }
-    return -1;
-  }
-
-  /**
-   * Gets the last element of `array`.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Array
-   * @param {Array} array The array to query.
-   * @returns {*} Returns the last element of `array`.
-   * @example
-   *
-   * _.last([1, 2, 3]);
-   * // => 3
-   */
-  function last(array) {
-    var length = array ? array.length : 0;
-    return length ? array[length - 1] : undefined;
-  }
-
-  /**
-   * Creates a slice of `array` from `start` up to, but not including, `end`.
-   *
-   * **Note:** This method is used instead of
-   * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
-   * returned.
-   *
-   * @static
-   * @memberOf _
-   * @since 3.0.0
-   * @category Array
-   * @param {Array} array The array to slice.
-   * @param {number} [start=0] The start position.
-   * @param {number} [end=array.length] The end position.
-   * @returns {Array} Returns the slice of `array`.
-   */
-  function slice(array, start, end) {
-    var length = array ? array.length : 0;
-    start = start == null ? 0 : +start;
-    end = end === undefined ? length : +end;
-    return length ? baseSlice(array, start, end) : [];
-  }
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * Creates a `lodash` wrapper instance that wraps `value` with explicit method
-   * chain sequences enabled. The result of such sequences must be unwrapped
-   * with `_#value`.
-   *
-   * @static
-   * @memberOf _
-   * @since 1.3.0
-   * @category Seq
-   * @param {*} value The value to wrap.
-   * @returns {Object} Returns the new `lodash` wrapper instance.
-   * @example
-   *
-   * var users = [
-   *   { 'user': 'barney',  'age': 36 },
-   *   { 'user': 'fred',    'age': 40 },
-   *   { 'user': 'pebbles', 'age': 1 }
-   * ];
-   *
-   * var youngest = _
-   *   .chain(users)
-   *   .sortBy('age')
-   *   .map(function(o) {
-   *     return o.user + ' is ' + o.age;
-   *   })
-   *   .head()
-   *   .value();
-   * // => 'pebbles is 1'
-   */
-  function chain(value) {
-    var result = lodash(value);
-    result.__chain__ = true;
-    return result;
-  }
-
-  /**
-   * This method invokes `interceptor` and returns `value`. The interceptor
-   * is invoked with one argument; (value). The purpose of this method is to
-   * "tap into" a method chain sequence in order to modify intermediate results.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Seq
-   * @param {*} value The value to provide to `interceptor`.
-   * @param {Function} interceptor The function to invoke.
-   * @returns {*} Returns `value`.
-   * @example
-   *
-   * _([1, 2, 3])
-   *  .tap(function(array) {
-   *    // Mutate input array.
-   *    array.pop();
-   *  })
-   *  .reverse()
-   *  .value();
-   * // => [2, 1]
-   */
-  function tap(value, interceptor) {
-    interceptor(value);
-    return value;
-  }
-
-  /**
-   * This method is like `_.tap` except that it returns the result of `interceptor`.
-   * The purpose of this method is to "pass thru" values replacing intermediate
-   * results in a method chain sequence.
-   *
-   * @static
-   * @memberOf _
-   * @since 3.0.0
-   * @category Seq
-   * @param {*} value The value to provide to `interceptor`.
-   * @param {Function} interceptor The function to invoke.
-   * @returns {*} Returns the result of `interceptor`.
-   * @example
-   *
-   * _('  abc  ')
-   *  .chain()
-   *  .trim()
-   *  .thru(function(value) {
-   *    return [value];
-   *  })
-   *  .value();
-   * // => ['abc']
-   */
-  function thru(value, interceptor) {
-    return interceptor(value);
-  }
-
-  /**
-   * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
-   *
-   * @name chain
-   * @memberOf _
-   * @since 0.1.0
-   * @category Seq
-   * @returns {Object} Returns the new `lodash` wrapper instance.
-   * @example
-   *
-   * var users = [
-   *   { 'user': 'barney', 'age': 36 },
-   *   { 'user': 'fred',   'age': 40 }
-   * ];
-   *
-   * // A sequence without explicit chaining.
-   * _(users).head();
-   * // => { 'user': 'barney', 'age': 36 }
-   *
-   * // A sequence with explicit chaining.
-   * _(users)
-   *   .chain()
-   *   .head()
-   *   .pick('user')
-   *   .value();
-   * // => { 'user': 'barney' }
-   */
-  function wrapperChain() {
-    return chain(this);
-  }
-
-  /**
-   * Executes the chain sequence to resolve the unwrapped value.
-   *
-   * @name value
-   * @memberOf _
-   * @since 0.1.0
-   * @alias toJSON, valueOf
-   * @category Seq
-   * @returns {*} Returns the resolved unwrapped value.
-   * @example
-   *
-   * _([1, 2, 3]).value();
-   * // => [1, 2, 3]
-   */
-  function wrapperValue() {
-    return baseWrapperValue(this.__wrapped__, this.__actions__);
-  }
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * Checks if `predicate` returns truthy for **all** elements of `collection`.
-   * Iteration is stopped once `predicate` returns falsey. The predicate is
-   * invoked with three arguments: (value, index|key, collection).
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Collection
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Array|Function|Object|string} [predicate=_.identity]
-   *  The function invoked per iteration.
-   * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-   * @returns {boolean} Returns `true` if all elements pass the predicate check,
-   *  else `false`.
-   * @example
-   *
-   * _.every([true, 1, null, 'yes'], Boolean);
-   * // => false
-   *
-   * var users = [
-   *   { 'user': 'barney', 'age': 36, 'active': false },
-   *   { 'user': 'fred',   'age': 40, 'active': false }
-   * ];
-   *
-   * // The `_.matches` iteratee shorthand.
-   * _.every(users, { 'user': 'barney', 'active': false });
-   * // => false
-   *
-   * // The `_.matchesProperty` iteratee shorthand.
-   * _.every(users, ['active', false]);
-   * // => true
-   *
-   * // The `_.property` iteratee shorthand.
-   * _.every(users, 'active');
-   * // => false
-   */
-  function every(collection, predicate, guard) {
-    predicate = guard ? undefined : predicate;
-    return baseEvery(collection, baseIteratee(predicate));
-  }
-
-  /**
-   * Iterates over elements of `collection`, returning an array of all elements
-   * `predicate` returns truthy for. The predicate is invoked with three
-   * arguments: (value, index|key, collection).
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Collection
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Array|Function|Object|string} [predicate=_.identity]
-   *  The function invoked per iteration.
-   * @returns {Array} Returns the new filtered array.
-   * @see _.reject
-   * @example
-   *
-   * var users = [
-   *   { 'user': 'barney', 'age': 36, 'active': true },
-   *   { 'user': 'fred',   'age': 40, 'active': false }
-   * ];
-   *
-   * _.filter(users, function(o) { return !o.active; });
-   * // => objects for ['fred']
-   *
-   * // The `_.matches` iteratee shorthand.
-   * _.filter(users, { 'age': 36, 'active': true });
-   * // => objects for ['barney']
-   *
-   * // The `_.matchesProperty` iteratee shorthand.
-   * _.filter(users, ['active', false]);
-   * // => objects for ['fred']
-   *
-   * // The `_.property` iteratee shorthand.
-   * _.filter(users, 'active');
-   * // => objects for ['barney']
-   */
-  function filter(collection, predicate) {
-    return baseFilter(collection, baseIteratee(predicate));
-  }
-
-  /**
-   * Iterates over elements of `collection`, returning the first element
-   * `predicate` returns truthy for. The predicate is invoked with three
-   * arguments: (value, index|key, collection).
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Collection
-   * @param {Array|Object} collection The collection to search.
-   * @param {Array|Function|Object|string} [predicate=_.identity]
-   *  The function invoked per iteration.
-   * @returns {*} Returns the matched element, else `undefined`.
-   * @example
-   *
-   * var users = [
-   *   { 'user': 'barney',  'age': 36, 'active': true },
-   *   { 'user': 'fred',    'age': 40, 'active': false },
-   *   { 'user': 'pebbles', 'age': 1,  'active': true }
-   * ];
-   *
-   * _.find(users, function(o) { return o.age < 40; });
-   * // => object for 'barney'
-   *
-   * // The `_.matches` iteratee shorthand.
-   * _.find(users, { 'age': 1, 'active': true });
-   * // => object for 'pebbles'
-   *
-   * // The `_.matchesProperty` iteratee shorthand.
-   * _.find(users, ['active', false]);
-   * // => object for 'fred'
-   *
-   * // The `_.property` iteratee shorthand.
-   * _.find(users, 'active');
-   * // => object for 'barney'
-   */
-  function find(collection, predicate) {
-    return baseFind(collection, baseIteratee(predicate), baseEach);
-  }
-
-  /**
-   * Iterates over elements of `collection` and invokes `iteratee` for each element.
-   * The iteratee is invoked with three arguments: (value, index|key, collection).
-   * Iteratee functions may exit iteration early by explicitly returning `false`.
-   *
-   * **Note:** As with other "Collections" methods, objects with a "length"
-   * property are iterated like arrays. To avoid this behavior use `_.forIn`
-   * or `_.forOwn` for object iteration.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @alias each
-   * @category Collection
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-   * @returns {Array|Object} Returns `collection`.
-   * @see _.forEachRight
-   * @example
-   *
-   * _([1, 2]).forEach(function(value) {
-   *   console.log(value);
-   * });
-   * // => Logs `1` then `2`.
-   *
-   * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
-   *   console.log(key);
-   * });
-   * // => Logs 'a' then 'b' (iteration order is not guaranteed).
-   */
-  function forEach(collection, iteratee) {
-    return baseEach(collection, baseIteratee(iteratee));
-  }
-
-  /**
-   * Creates an array of values by running each element in `collection` thru
-   * `iteratee`. The iteratee is invoked with three arguments:
-   * (value, index|key, collection).
-   *
-   * Many lodash methods are guarded to work as iteratees for methods like
-   * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
-   *
-   * The guarded methods are:
-   * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
-   * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
-   * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
-   * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Collection
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Array|Function|Object|string} [iteratee=_.identity]
-   *  The function invoked per iteration.
-   * @returns {Array} Returns the new mapped array.
-   * @example
-   *
-   * function square(n) {
-   *   return n * n;
-   * }
-   *
-   * _.map([4, 8], square);
-   * // => [16, 64]
-   *
-   * _.map({ 'a': 4, 'b': 8 }, square);
-   * // => [16, 64] (iteration order is not guaranteed)
-   *
-   * var users = [
-   *   { 'user': 'barney' },
-   *   { 'user': 'fred' }
-   * ];
-   *
-   * // The `_.property` iteratee shorthand.
-   * _.map(users, 'user');
-   * // => ['barney', 'fred']
-   */
-  function map(collection, iteratee) {
-    return baseMap(collection, baseIteratee(iteratee));
-  }
-
-  /**
-   * Reduces `collection` to a value which is the accumulated result of running
-   * each element in `collection` thru `iteratee`, where each successive
-   * invocation is supplied the return value of the previous. If `accumulator`
-   * is not given, the first element of `collection` is used as the initial
-   * value. The iteratee is invoked with four arguments:
-   * (accumulator, value, index|key, collection).
-   *
-   * Many lodash methods are guarded to work as iteratees for methods like
-   * `_.reduce`, `_.reduceRight`, and `_.transform`.
-   *
-   * The guarded methods are:
-   * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
-   * and `sortBy`
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Collection
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-   * @param {*} [accumulator] The initial value.
-   * @returns {*} Returns the accumulated value.
-   * @see _.reduceRight
-   * @example
-   *
-   * _.reduce([1, 2], function(sum, n) {
-   *   return sum + n;
-   * }, 0);
-   * // => 3
-   *
-   * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
-   *   (result[value] || (result[value] = [])).push(key);
-   *   return result;
-   * }, {});
-   * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
-   */
-  function reduce(collection, iteratee, accumulator) {
-    return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach);
-  }
-
-  /**
-   * Gets the size of `collection` by returning its length for array-like
-   * values or the number of own enumerable string keyed properties for objects.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Collection
-   * @param {Array|Object} collection The collection to inspect.
-   * @returns {number} Returns the collection size.
-   * @example
-   *
-   * _.size([1, 2, 3]);
-   * // => 3
-   *
-   * _.size({ 'a': 1, 'b': 2 });
-   * // => 2
-   *
-   * _.size('pebbles');
-   * // => 7
-   */
-  function size(collection) {
-    if (collection == null) {
-      return 0;
-    }
-    collection = isArrayLike(collection) ? collection : keys(collection);
-    return collection.length;
-  }
-
-  /**
-   * Checks if `predicate` returns truthy for **any** element of `collection`.
-   * Iteration is stopped once `predicate` returns truthy. The predicate is
-   * invoked with three arguments: (value, index|key, collection).
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Collection
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Array|Function|Object|string} [predicate=_.identity]
-   *  The function invoked per iteration.
-   * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-   * @returns {boolean} Returns `true` if any element passes the predicate check,
-   *  else `false`.
-   * @example
-   *
-   * _.some([null, 0, 'yes', false], Boolean);
-   * // => true
-   *
-   * var users = [
-   *   { 'user': 'barney', 'active': true },
-   *   { 'user': 'fred',   'active': false }
-   * ];
-   *
-   * // The `_.matches` iteratee shorthand.
-   * _.some(users, { 'user': 'barney', 'active': false });
-   * // => false
-   *
-   * // The `_.matchesProperty` iteratee shorthand.
-   * _.some(users, ['active', false]);
-   * // => true
-   *
-   * // The `_.property` iteratee shorthand.
-   * _.some(users, 'active');
-   * // => true
-   */
-  function some(collection, predicate, guard) {
-    predicate = guard ? undefined : predicate;
-    return baseSome(collection, baseIteratee(predicate));
-  }
-
-  /**
-   * Creates an array of elements, sorted in ascending order by the results of
-   * running each element in a collection thru each iteratee. This method
-   * performs a stable sort, that is, it preserves the original sort order of
-   * equal elements. The iteratees are invoked with one argument: (value).
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Collection
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
-   *  [iteratees=[_.identity]] The iteratees to sort by.
-   * @returns {Array} Returns the new sorted array.
-   * @example
-   *
-   * var users = [
-   *   { 'user': 'fred',   'age': 48 },
-   *   { 'user': 'barney', 'age': 36 },
-   *   { 'user': 'fred',   'age': 40 },
-   *   { 'user': 'barney', 'age': 34 }
-   * ];
-   *
-   * _.sortBy(users, function(o) { return o.user; });
-   * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
-   *
-   * _.sortBy(users, ['user', 'age']);
-   * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
-   *
-   * _.sortBy(users, 'user', function(o) {
-   *   return Math.floor(o.age / 10);
-   * });
-   * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
-   */
-  function sortBy(collection, iteratee) {
-    var index = 0;
-    iteratee = baseIteratee(iteratee);
-
-    return baseMap(baseMap(collection, function(value, key, collection) {
-      return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) };
-    }).sort(function(object, other) {
-      return compareAscending(object.criteria, other.criteria) || (object.index - other.index);
-    }), baseProperty('value'));
-  }
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * Creates a function that invokes `func`, with the `this` binding and arguments
-   * of the created function, while it's called less than `n` times. Subsequent
-   * calls to the created function return the result of the last `func` invocation.
-   *
-   * @static
-   * @memberOf _
-   * @since 3.0.0
-   * @category Function
-   * @param {number} n The number of calls at which `func` is no longer invoked.
-   * @param {Function} func The function to restrict.
-   * @returns {Function} Returns the new restricted function.
-   * @example
-   *
-   * jQuery(element).on('click', _.before(5, addContactToList));
-   * // => allows adding up to 4 contacts to the list
-   */
-  function before(n, func) {
-    var result;
-    if (typeof func != 'function') {
-      throw new TypeError(FUNC_ERROR_TEXT);
-    }
-    n = toInteger(n);
-    return function() {
-      if (--n > 0) {
-        result = func.apply(this, arguments);
-      }
-      if (n <= 1) {
-        func = undefined;
-      }
-      return result;
-    };
-  }
-
-  /**
-   * Creates a function that invokes `func` with the `this` binding of `thisArg`
-   * and `partials` prepended to the arguments it receives.
-   *
-   * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
-   * may be used as a placeholder for partially applied arguments.
-   *
-   * **Note:** Unlike native `Function#bind` this method doesn't set the "length"
-   * property of bound functions.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Function
-   * @param {Function} func The function to bind.
-   * @param {*} thisArg The `this` binding of `func`.
-   * @param {...*} [partials] The arguments to be partially applied.
-   * @returns {Function} Returns the new bound function.
-   * @example
-   *
-   * var greet = function(greeting, punctuation) {
-   *   return greeting + ' ' + this.user + punctuation;
-   * };
-   *
-   * var object = { 'user': 'fred' };
-   *
-   * var bound = _.bind(greet, object, 'hi');
-   * bound('!');
-   * // => 'hi fred!'
-   *
-   * // Bound with placeholders.
-   * var bound = _.bind(greet, object, _, '!');
-   * bound('hi');
-   * // => 'hi fred!'
-   */
-  var bind = rest(function(func, thisArg, partials) {
-    return createPartialWrapper(func, BIND_FLAG | PARTIAL_FLAG, thisArg, partials);
-  });
-
-  /**
-   * Defers invoking the `func` until the current call stack has cleared. Any
-   * additional arguments are provided to `func` when it's invoked.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Function
-   * @param {Function} func The function to defer.
-   * @param {...*} [args] The arguments to invoke `func` with.
-   * @returns {number} Returns the timer id.
-   * @example
-   *
-   * _.defer(function(text) {
-   *   console.log(text);
-   * }, 'deferred');
-   * // => Logs 'deferred' after one or more milliseconds.
-   */
-  var defer = rest(function(func, args) {
-    return baseDelay(func, 1, args);
-  });
-
-  /**
-   * Invokes `func` after `wait` milliseconds. Any additional arguments are
-   * provided to `func` when it's invoked.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Function
-   * @param {Function} func The function to delay.
-   * @param {number} wait The number of milliseconds to delay invocation.
-   * @param {...*} [args] The arguments to invoke `func` with.
-   * @returns {number} Returns the timer id.
-   * @example
-   *
-   * _.delay(function(text) {
-   *   console.log(text);
-   * }, 1000, 'later');
-   * // => Logs 'later' after one second.
-   */
-  var delay = rest(function(func, wait, args) {
-    return baseDelay(func, toNumber(wait) || 0, args);
-  });
-
-  /**
-   * Creates a function that negates the result of the predicate `func`. The
-   * `func` predicate is invoked with the `this` binding and arguments of the
-   * created function.
-   *
-   * @static
-   * @memberOf _
-   * @since 3.0.0
-   * @category Function
-   * @param {Function} predicate The predicate to negate.
-   * @returns {Function} Returns the new function.
-   * @example
-   *
-   * function isEven(n) {
-   *   return n % 2 == 0;
-   * }
-   *
-   * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
-   * // => [1, 3, 5]
-   */
-  function negate(predicate) {
-    if (typeof predicate != 'function') {
-      throw new TypeError(FUNC_ERROR_TEXT);
-    }
-    return function() {
-      return !predicate.apply(this, arguments);
-    };
-  }
-
-  /**
-   * Creates a function that is restricted to invoking `func` once. Repeat calls
-   * to the function return the value of the first invocation. The `func` is
-   * invoked with the `this` binding and arguments of the created function.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Function
-   * @param {Function} func The function to restrict.
-   * @returns {Function} Returns the new restricted function.
-   * @example
-   *
-   * var initialize = _.once(createApplication);
-   * initialize();
-   * initialize();
-   * // `initialize` invokes `createApplication` once
-   */
-  function once(func) {
-    return before(2, func);
-  }
-
-  /**
-   * Creates a function that invokes `func` with the `this` binding of the
-   * created function and arguments from `start` and beyond provided as
-   * an array.
-   *
-   * **Note:** This method is based on the
-   * [rest parameter](https://mdn.io/rest_parameters).
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @category Function
-   * @param {Function} func The function to apply a rest parameter to.
-   * @param {number} [start=func.length-1] The start position of the rest parameter.
-   * @returns {Function} Returns the new function.
-   * @example
-   *
-   * var say = _.rest(function(what, names) {
-   *   return what + ' ' + _.initial(names).join(', ') +
-   *     (_.size(names) > 1 ? ', & ' : '') + _.last(names);
-   * });
-   *
-   * say('hello', 'fred', 'barney', 'pebbles');
-   * // => 'hello fred, barney, & pebbles'
-   */
-  function rest(func, start) {
-    if (typeof func != 'function') {
-      throw new TypeError(FUNC_ERROR_TEXT);
-    }
-    start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);
-    return function() {
-      var args = arguments,
-          index = -1,
-          length = nativeMax(args.length - start, 0),
-          array = Array(length);
-
-      while (++index < length) {
-        array[index] = args[start + index];
-      }
-      var otherArgs = Array(start + 1);
-      index = -1;
-      while (++index < start) {
-        otherArgs[index] = args[index];
-      }
-      otherArgs[start] = array;
-      return func.apply(this, otherArgs);
-    };
-  }
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * Casts `value` as an array if it's not one.
-   *
-   * @static
-   * @memberOf _
-   * @since 4.4.0
-   * @category Lang
-   * @param {*} value The value to inspect.
-   * @returns {Array} Returns the cast array.
-   * @example
-   *
-   * _.castArray(1);
-   * // => [1]
-   *
-   * _.castArray({ 'a': 1 });
-   * // => [{ 'a': 1 }]
-   *
-   * _.castArray('abc');
-   * // => ['abc']
-   *
-   * _.castArray(null);
-   * // => [null]
-   *
-   * _.castArray(undefined);
-   * // => [undefined]
-   *
-   * _.castArray();
-   * // => []
-   *
-   * var array = [1, 2, 3];
-   * console.log(_.castArray(array) === array);
-   * // => true
-   */
-  function castArray() {
-    if (!arguments.length) {
-      return [];
-    }
-    var value = arguments[0];
-    return isArray(value) ? value : [value];
-  }
-
-  /**
-   * Creates a shallow clone of `value`.
-   *
-   * **Note:** This method is loosely based on the
-   * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
-   * and supports cloning arrays, array buffers, booleans, date objects, maps,
-   * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
-   * arrays. The own enumerable properties of `arguments` objects are cloned
-   * as plain objects. An empty object is returned for uncloneable values such
-   * as error objects, functions, DOM nodes, and WeakMaps.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to clone.
-   * @returns {*} Returns the cloned value.
-   * @see _.cloneDeep
-   * @example
-   *
-   * var objects = [{ 'a': 1 }, { 'b': 2 }];
-   *
-   * var shallow = _.clone(objects);
-   * console.log(shallow[0] === objects[0]);
-   * // => true
-   */
-  function clone(value) {
-    if (!isObject(value)) {
-      return value;
-    }
-    return isArray(value) ? copyArray(value) : copyObject(value, keys(value));
-  }
-
-  /**
-   * Performs a
-   * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-   * comparison between two values to determine if they are equivalent.
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @category Lang
-   * @param {*} value The value to compare.
-   * @param {*} other The other value to compare.
-   * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
-   * @example
-   *
-   * var object = { 'user': 'fred' };
-   * var other = { 'user': 'fred' };
-   *
-   * _.eq(object, object);
-   * // => true
-   *
-   * _.eq(object, other);
-   * // => false
-   *
-   * _.eq('a', 'a');
-   * // => true
-   *
-   * _.eq('a', Object('a'));
-   * // => false
-   *
-   * _.eq(NaN, NaN);
-   * // => true
-   */
-  function eq(value, other) {
-    return value === other || (value !== value && other !== other);
-  }
-
-  /**
-   * Checks if `value` is likely an `arguments` object.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is correctly classified,
-   *  else `false`.
-   * @example
-   *
-   * _.isArguments(function() { return arguments; }());
-   * // => true
-   *
-   * _.isArguments([1, 2, 3]);
-   * // => false
-   */
-  function isArguments(value) {
-    // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
-    return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
-      (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
-  }
-
-  /**
-   * Checks if `value` is classified as an `Array` object.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @type {Function}
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is correctly classified,
-   *  else `false`.
-   * @example
-   *
-   * _.isArray([1, 2, 3]);
-   * // => true
-   *
-   * _.isArray(document.body.children);
-   * // => false
-   *
-   * _.isArray('abc');
-   * // => false
-   *
-   * _.isArray(_.noop);
-   * // => false
-   */
-  var isArray = Array.isArray;
-
-  /**
-   * Checks if `value` is array-like. A value is considered array-like if it's
-   * not a function and has a `value.length` that's an integer greater than or
-   * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
-   * @example
-   *
-   * _.isArrayLike([1, 2, 3]);
-   * // => true
-   *
-   * _.isArrayLike(document.body.children);
-   * // => true
-   *
-   * _.isArrayLike('abc');
-   * // => true
-   *
-   * _.isArrayLike(_.noop);
-   * // => false
-   */
-  function isArrayLike(value) {
-    return value != null && isLength(getLength(value)) && !isFunction(value);
-  }
-
-  /**
-   * This method is like `_.isArrayLike` except that it also checks if `value`
-   * is an object.
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is an array-like object,
-   *  else `false`.
-   * @example
-   *
-   * _.isArrayLikeObject([1, 2, 3]);
-   * // => true
-   *
-   * _.isArrayLikeObject(document.body.children);
-   * // => true
-   *
-   * _.isArrayLikeObject('abc');
-   * // => false
-   *
-   * _.isArrayLikeObject(_.noop);
-   * // => false
-   */
-  function isArrayLikeObject(value) {
-    return isObjectLike(value) && isArrayLike(value);
-  }
-
-  /**
-   * Checks if `value` is classified as a boolean primitive or object.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is correctly classified,
-   *  else `false`.
-   * @example
-   *
-   * _.isBoolean(false);
-   * // => true
-   *
-   * _.isBoolean(null);
-   * // => false
-   */
-  function isBoolean(value) {
-    return value === true || value === false ||
-      (isObjectLike(value) && objectToString.call(value) == boolTag);
-  }
-
-  /**
-   * Checks if `value` is classified as a `Date` object.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is correctly classified,
-   *  else `false`.
-   * @example
-   *
-   * _.isDate(new Date);
-   * // => true
-   *
-   * _.isDate('Mon April 23 2012');
-   * // => false
-   */
-  function isDate(value) {
-    return isObjectLike(value) && objectToString.call(value) == dateTag;
-  }
-
-  /**
-   * Checks if `value` is an empty object, collection, map, or set.
-   *
-   * Objects are considered empty if they have no own enumerable string keyed
-   * properties.
-   *
-   * Array-like values such as `arguments` objects, arrays, buffers, strings, or
-   * jQuery-like collections are considered empty if they have a `length` of `0`.
-   * Similarly, maps and sets are considered empty if they have a `size` of `0`.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is empty, else `false`.
-   * @example
-   *
-   * _.isEmpty(null);
-   * // => true
-   *
-   * _.isEmpty(true);
-   * // => true
-   *
-   * _.isEmpty(1);
-   * // => true
-   *
-   * _.isEmpty([1, 2, 3]);
-   * // => false
-   *
-   * _.isEmpty({ 'a': 1 });
-   * // => false
-   */
-  function isEmpty(value) {
-    if (isArrayLike(value) &&
-        (isArray(value) || isString(value) ||
-          isFunction(value.splice) || isArguments(value))) {
-      return !value.length;
-    }
-    return !keys(value).length;
-  }
-
-  /**
-   * Performs a deep comparison between two values to determine if they are
-   * equivalent.
-   *
-   * **Note:** This method supports comparing arrays, array buffers, booleans,
-   * date objects, error objects, maps, numbers, `Object` objects, regexes,
-   * sets, strings, symbols, and typed arrays. `Object` objects are compared
-   * by their own, not inherited, enumerable properties. Functions and DOM
-   * nodes are **not** supported.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to compare.
-   * @param {*} other The other value to compare.
-   * @returns {boolean} Returns `true` if the values are equivalent,
-   *  else `false`.
-   * @example
-   *
-   * var object = { 'user': 'fred' };
-   * var other = { 'user': 'fred' };
-   *
-   * _.isEqual(object, other);
-   * // => true
-   *
-   * object === other;
-   * // => false
-   */
-  function isEqual(value, other) {
-    return baseIsEqual(value, other);
-  }
-
-  /**
-   * Checks if `value` is a finite primitive number.
-   *
-   * **Note:** This method is based on
-   * [`Number.isFinite`](https://mdn.io/Number/isFinite).
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is a finite number,
-   *  else `false`.
-   * @example
-   *
-   * _.isFinite(3);
-   * // => true
-   *
-   * _.isFinite(Number.MAX_VALUE);
-   * // => true
-   *
-   * _.isFinite(3.14);
-   * // => true
-   *
-   * _.isFinite(Infinity);
-   * // => false
-   */
-  function isFinite(value) {
-    return typeof value == 'number' && nativeIsFinite(value);
-  }
-
-  /**
-   * Checks if `value` is classified as a `Function` object.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is correctly classified,
-   *  else `false`.
-   * @example
-   *
-   * _.isFunction(_);
-   * // => true
-   *
-   * _.isFunction(/abc/);
-   * // => false
-   */
-  function isFunction(value) {
-    // The use of `Object#toString` avoids issues with the `typeof` operator
-    // in Safari 8 which returns 'object' for typed array and weak map constructors,
-    // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
-    var tag = isObject(value) ? objectToString.call(value) : '';
-    return tag == funcTag || tag == genTag;
-  }
-
-  /**
-   * Checks if `value` is a valid array-like length.
-   *
-   * **Note:** This function is loosely based on
-   * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is a valid length,
-   *  else `false`.
-   * @example
-   *
-   * _.isLength(3);
-   * // => true
-   *
-   * _.isLength(Number.MIN_VALUE);
-   * // => false
-   *
-   * _.isLength(Infinity);
-   * // => false
-   *
-   * _.isLength('3');
-   * // => false
-   */
-  function isLength(value) {
-    return typeof value == 'number' &&
-      value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-  }
-
-  /**
-   * Checks if `value` is the
-   * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
-   * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is an object, else `false`.
-   * @example
-   *
-   * _.isObject({});
-   * // => true
-   *
-   * _.isObject([1, 2, 3]);
-   * // => true
-   *
-   * _.isObject(_.noop);
-   * // => true
-   *
-   * _.isObject(null);
-   * // => false
-   */
-  function isObject(value) {
-    var type = typeof value;
-    return !!value && (type == 'object' || type == 'function');
-  }
-
-  /**
-   * Checks if `value` is object-like. A value is object-like if it's not `null`
-   * and has a `typeof` result of "object".
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
-   * @example
-   *
-   * _.isObjectLike({});
-   * // => true
-   *
-   * _.isObjectLike([1, 2, 3]);
-   * // => true
-   *
-   * _.isObjectLike(_.noop);
-   * // => false
-   *
-   * _.isObjectLike(null);
-   * // => false
-   */
-  function isObjectLike(value) {
-    return !!value && typeof value == 'object';
-  }
-
-  /**
-   * Checks if `value` is `NaN`.
-   *
-   * **Note:** This method is based on
-   * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
-   * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
-   * `undefined` and other non-number values.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
-   * @example
-   *
-   * _.isNaN(NaN);
-   * // => true
-   *
-   * _.isNaN(new Number(NaN));
-   * // => true
-   *
-   * isNaN(undefined);
-   * // => true
-   *
-   * _.isNaN(undefined);
-   * // => false
-   */
-  function isNaN(value) {
-    // An `NaN` primitive is the only value that is not equal to itself.
-    // Perform the `toStringTag` check first to avoid errors with some
-    // ActiveX objects in IE.
-    return isNumber(value) && value != +value;
-  }
-
-  /**
-   * Checks if `value` is `null`.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
-   * @example
-   *
-   * _.isNull(null);
-   * // => true
-   *
-   * _.isNull(void 0);
-   * // => false
-   */
-  function isNull(value) {
-    return value === null;
-  }
-
-  /**
-   * Checks if `value` is classified as a `Number` primitive or object.
-   *
-   * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
-   * classified as numbers, use the `_.isFinite` method.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is correctly classified,
-   *  else `false`.
-   * @example
-   *
-   * _.isNumber(3);
-   * // => true
-   *
-   * _.isNumber(Number.MIN_VALUE);
-   * // => true
-   *
-   * _.isNumber(Infinity);
-   * // => true
-   *
-   * _.isNumber('3');
-   * // => false
-   */
-  function isNumber(value) {
-    return typeof value == 'number' ||
-      (isObjectLike(value) && objectToString.call(value) == numberTag);
-  }
-
-  /**
-   * Checks if `value` is classified as a `RegExp` object.
-   *
-   * @static
-   * @memberOf _
-   * @since 0.1.0
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is correctly classified,
-   *  else `false`.
-   * @example
-   *
-   * _.isRegExp(/abc/);
-   * // => true
-   *
-   * _.isRegExp('/abc/');
-   * // => false
-   */
-  function isRegExp(value) {
-    return isObject(value) && objectToString.call(value) == regexpTag;
-  }
-
-  /**
-   * Checks if `value` is classified as a `String` primitive or object.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is correctly classified,
-   *  else `false`.
-   * @example
-   *
-   * _.isString('abc');
-   * // => true
-   *
-   * _.isString(1);
-   * // => false
-   */
-  function isString(value) {
-    return typeof value == 'string' ||
-      (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
-  }
-
-  /**
-   * Checks if `value` is `undefined`.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Lang
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
-   * @example
-   *
-   * _.isUndefined(void 0);
-   * // => true
-   *
-   * _.isUndefined(null);
-   * // => false
-   */
-  function isUndefined(value) {
-    return value === undefined;
-  }
-
-  /**
-   * Converts `value` to an array.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Lang
-   * @param {*} value The value to convert.
-   * @returns {Array} Returns the converted array.
-   * @example
-   *
-   * _.toArray({ 'a': 1, 'b': 2 });
-   * // => [1, 2]
-   *
-   * _.toArray('abc');
-   * // => ['a', 'b', 'c']
-   *
-   * _.toArray(1);
-   * // => []
-   *
-   * _.toArray(null);
-   * // => []
-   */
-  function toArray(value) {
-    if (!isArrayLike(value)) {
-      return values(value);
-    }
-    return value.length ? copyArray(value) : [];
-  }
-
-  /**
-   * Converts `value` to an integer.
-   *
-   * **Note:** This function is loosely based on
-   * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @category Lang
-   * @param {*} value The value to convert.
-   * @returns {number} Returns the converted integer.
-   * @example
-   *
-   * _.toInteger(3);
-   * // => 3
-   *
-   * _.toInteger(Number.MIN_VALUE);
-   * // => 0
-   *
-   * _.toInteger(Infinity);
-   * // => 1.7976931348623157e+308
-   *
-   * _.toInteger('3');
-   * // => 3
-   */
-  var toInteger = Number;
-
-  /**
-   * Converts `value` to a number.
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @category Lang
-   * @param {*} value The value to process.
-   * @returns {number} Returns the number.
-   * @example
-   *
-   * _.toNumber(3);
-   * // => 3
-   *
-   * _.toNumber(Number.MIN_VALUE);
-   * // => 5e-324
-   *
-   * _.toNumber(Infinity);
-   * // => Infinity
-   *
-   * _.toNumber('3');
-   * // => 3
-   */
-  var toNumber = Number;
-
-  /**
-   * Converts `value` to a string. An empty string is returned for `null`
-   * and `undefined` values. The sign of `-0` is preserved.
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @category Lang
-   * @param {*} value The value to process.
-   * @returns {string} Returns the string.
-   * @example
-   *
-   * _.toString(null);
-   * // => ''
-   *
-   * _.toString(-0);
-   * // => '-0'
-   *
-   * _.toString([1, 2, 3]);
-   * // => '1,2,3'
-   */
-  function toString(value) {
-    if (typeof value == 'string') {
-      return value;
-    }
-    return value == null ? '' : (value + '');
-  }
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * Assigns own enumerable string keyed properties of source objects to the
-   * destination object. Source objects are applied from left to right.
-   * Subsequent sources overwrite property assignments of previous sources.
-   *
-   * **Note:** This method mutates `object` and is loosely based on
-   * [`Object.assign`](https://mdn.io/Object/assign).
-   *
-   * @static
-   * @memberOf _
-   * @since 0.10.0
-   * @category Object
-   * @param {Object} object The destination object.
-   * @param {...Object} [sources] The source objects.
-   * @returns {Object} Returns `object`.
-   * @see _.assignIn
-   * @example
-   *
-   * function Foo() {
-   *   this.c = 3;
-   * }
-   *
-   * function Bar() {
-   *   this.e = 5;
-   * }
-   *
-   * Foo.prototype.d = 4;
-   * Bar.prototype.f = 6;
-   *
-   * _.assign({ 'a': 1 }, new Foo, new Bar);
-   * // => { 'a': 1, 'c': 3, 'e': 5 }
-   */
-  var assign = createAssigner(function(object, source) {
-    copyObject(source, keys(source), object);
-  });
-
-  /**
-   * This method is like `_.assign` except that it iterates over own and
-   * inherited source properties.
-   *
-   * **Note:** This method mutates `object`.
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @alias extend
-   * @category Object
-   * @param {Object} object The destination object.
-   * @param {...Object} [sources] The source objects.
-   * @returns {Object} Returns `object`.
-   * @see _.assign
-   * @example
-   *
-   * function Foo() {
-   *   this.b = 2;
-   * }
-   *
-   * function Bar() {
-   *   this.d = 4;
-   * }
-   *
-   * Foo.prototype.c = 3;
-   * Bar.prototype.e = 5;
-   *
-   * _.assignIn({ 'a': 1 }, new Foo, new Bar);
-   * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
-   */
-  var assignIn = createAssigner(function(object, source) {
-    copyObject(source, keysIn(source), object);
-  });
-
-  /**
-   * This method is like `_.assignIn` except that it accepts `customizer`
-   * which is invoked to produce the assigned values. If `customizer` returns
-   * `undefined`, assignment is handled by the method instead. The `customizer`
-   * is invoked with five arguments: (objValue, srcValue, key, object, source).
-   *
-   * **Note:** This method mutates `object`.
-   *
-   * @static
-   * @memberOf _
-   * @since 4.0.0
-   * @alias extendWith
-   * @category Object
-   * @param {Object} object The destination object.
-   * @param {...Object} sources The source objects.
-   * @param {Function} [customizer] The function to customize assigned values.
-   * @returns {Object} Returns `object`.
-   * @see _.assignWith
-   * @example
-   *
-   * function customizer(objValue, srcValue) {
-   *   return _.isUndefined(objValue) ? srcValue : objValue;
-   * }
-   *
-   * var defaults = _.partialRight(_.assignInWith, customizer);
-   *
-   * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
-   * // => { 'a': 1, 'b': 2 }
-   */
-  var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
-    copyObject(source, keysIn(source), object, customizer);
-  });
-
-  /**
-   * Creates an object that inherits from the `prototype` object. If a
-   * `properties` object is given, its own enumerable string keyed properties
-   * are assigned to the created object.
-   *
-   * @static
-   * @memberOf _
-   * @since 2.3.0
-   * @category Object
-   * @param {Object} prototype The object to inherit from.
-   * @param {Object} [properties] The properties to assign to the object.
-   * @returns {Object} Returns the new object.
-   * @example
-   *
-   * function Shape() {
-   *   this.x = 0;
-   *   this.y = 0;
-   * }
-   *
-   * function Circle() {
-   *   Shape.call(this);
-   * }
-   *
-   * Circle.prototype = _.create(Shape.prototype, {
-   *   'constructor': Circle
-   * });
-   *
-   * var circle = new Circle;
-   * circle instanceof Circle;
-   * // => true
-   *
-   * circle instanceof Shape;
-   * // => true
-   */
-  function create(prototype, properties) {
-    var result = baseCreate(prototype);
-    return properties ? assign(result, properties) : result;
-  }
-
-  /**
-   * Assigns own and inherited enumerable string keyed properties of source
-   * objects to the destination object for all destination properties that
-   * resolve to `undefined`. Source objects are applied from left to right.
-   * Once a property is set, additional values of the same property are ignored.
-   *
-   * **Note:** This method mutates `object`.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Object
-   * @param {Object} object The destination object.
-   * @param {...Object} [sources] The source objects.
-   * @returns {Object} Returns `object`.
-   * @see _.defaultsDeep
-   * @example
-   *
-   * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
-   * // => { 'user': 'barney', 'age': 36 }
-   */
-  var defaults = rest(function(args) {
-    args.push(undefined, assignInDefaults);
-    return assignInWith.apply(undefined, args);
-  });
-
-  /**
-   * Checks if `path` is a direct property of `object`.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Object
-   * @param {Object} object The object to query.
-   * @param {Array|string} path The path to check.
-   * @returns {boolean} Returns `true` if `path` exists, else `false`.
-   * @example
-   *
-   * var object = { 'a': { 'b': 2 } };
-   * var other = _.create({ 'a': _.create({ 'b': 2 }) });
-   *
-   * _.has(object, 'a');
-   * // => true
-   *
-   * _.has(object, 'a.b');
-   * // => true
-   *
-   * _.has(object, ['a', 'b']);
-   * // => true
-   *
-   * _.has(other, 'a');
-   * // => false
-   */
-  function has(object, path) {
-    return object != null && hasOwnProperty.call(object, path);
-  }
-
-  /**
-   * Creates an array of the own enumerable property names of `object`.
-   *
-   * **Note:** Non-object values are coerced to objects. See the
-   * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
-   * for more details.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Object
-   * @param {Object} object The object to query.
-   * @returns {Array} Returns the array of property names.
-   * @example
-   *
-   * function Foo() {
-   *   this.a = 1;
-   *   this.b = 2;
-   * }
-   *
-   * Foo.prototype.c = 3;
-   *
-   * _.keys(new Foo);
-   * // => ['a', 'b'] (iteration order is not guaranteed)
-   *
-   * _.keys('hi');
-   * // => ['0', '1']
-   */
-  function keys(object) {
-    var isProto = isPrototype(object);
-    if (!(isProto || isArrayLike(object))) {
-      return baseKeys(object);
-    }
-    var indexes = indexKeys(object),
-        skipIndexes = !!indexes,
-        result = indexes || [],
-        length = result.length;
-
-    for (var key in object) {
-      if (hasOwnProperty.call(object, key) &&
-          !(skipIndexes && (key == 'length' || isIndex(key, length))) &&
-          !(isProto && key == 'constructor')) {
-        result.push(key);
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Creates an array of the own and inherited enumerable property names of `object`.
-   *
-   * **Note:** Non-object values are coerced to objects.
-   *
-   * @static
-   * @memberOf _
-   * @since 3.0.0
-   * @category Object
-   * @param {Object} object The object to query.
-   * @returns {Array} Returns the array of property names.
-   * @example
-   *
-   * function Foo() {
-   *   this.a = 1;
-   *   this.b = 2;
-   * }
-   *
-   * Foo.prototype.c = 3;
-   *
-   * _.keysIn(new Foo);
-   * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
-   */
-  function keysIn(object) {
-    var index = -1,
-        isProto = isPrototype(object),
-        props = baseKeysIn(object),
-        propsLength = props.length,
-        indexes = indexKeys(object),
-        skipIndexes = !!indexes,
-        result = indexes || [],
-        length = result.length;
-
-    while (++index < propsLength) {
-      var key = props[index];
-      if (!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
-          !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
-        result.push(key);
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Creates an object composed of the picked `object` properties.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Object
-   * @param {Object} object The source object.
-   * @param {...(string|string[])} [props] The property identifiers to pick.
-   * @returns {Object} Returns the new object.
-   * @example
-   *
-   * var object = { 'a': 1, 'b': '2', 'c': 3 };
-   *
-   * _.pick(object, ['a', 'c']);
-   * // => { 'a': 1, 'c': 3 }
-   */
-  var pick = rest(function(object, props) {
-    return object == null ? {} : basePick(object, baseMap(baseFlatten(props, 1), toKey));
-  });
-
-  /**
-   * This method is like `_.get` except that if the resolved value is a
-   * function it's invoked with the `this` binding of its parent object and
-   * its result is returned.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Object
-   * @param {Object} object The object to query.
-   * @param {Array|string} path The path of the property to resolve.
-   * @param {*} [defaultValue] The value returned for `undefined` resolved values.
-   * @returns {*} Returns the resolved value.
-   * @example
-   *
-   * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
-   *
-   * _.result(object, 'a[0].b.c1');
-   * // => 3
-   *
-   * _.result(object, 'a[0].b.c2');
-   * // => 4
-   *
-   * _.result(object, 'a[0].b.c3', 'default');
-   * // => 'default'
-   *
-   * _.result(object, 'a[0].b.c3', _.constant('default'));
-   * // => 'default'
-   */
-  function result(object, path, defaultValue) {
-    var value = object == null ? undefined : object[path];
-    if (value === undefined) {
-      value = defaultValue;
-    }
-    return isFunction(value) ? value.call(object) : value;
-  }
-
-  /**
-   * Creates an array of the own enumerable string keyed property values of `object`.
-   *
-   * **Note:** Non-object values are coerced to objects.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Object
-   * @param {Object} object The object to query.
-   * @returns {Array} Returns the array of property values.
-   * @example
-   *
-   * function Foo() {
-   *   this.a = 1;
-   *   this.b = 2;
-   * }
-   *
-   * Foo.prototype.c = 3;
-   *
-   * _.values(new Foo);
-   * // => [1, 2] (iteration order is not guaranteed)
-   *
-   * _.values('hi');
-   * // => ['h', 'i']
-   */
-  function values(object) {
-    return object ? baseValues(object, keys(object)) : [];
-  }
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
-   * their corresponding HTML entities.
-   *
-   * **Note:** No other characters are escaped. To escape additional
-   * characters use a third-party library like [_he_](https://mths.be/he).
-   *
-   * Though the ">" character is escaped for symmetry, characters like
-   * ">" and "/" don't need escaping in HTML and have no special meaning
-   * unless they're part of a tag or unquoted attribute value. See
-   * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
-   * (under "semi-related fun fact") for more details.
-   *
-   * Backticks are escaped because in IE < 9, they can break out of
-   * attribute values or HTML comments. See [#59](https://html5sec.org/#59),
-   * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
-   * [#133](https://html5sec.org/#133) of the
-   * [HTML5 Security Cheatsheet](https://html5sec.org/) for more details.
-   *
-   * When working with HTML you should always
-   * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
-   * XSS vectors.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category String
-   * @param {string} [string=''] The string to escape.
-   * @returns {string} Returns the escaped string.
-   * @example
-   *
-   * _.escape('fred, barney, & pebbles');
-   * // => 'fred, barney, &amp; pebbles'
-   */
-  function escape(string) {
-    string = toString(string);
-    return (string && reHasUnescapedHtml.test(string))
-      ? string.replace(reUnescapedHtml, escapeHtmlChar)
-      : string;
-  }
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * This method returns the first argument given to it.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Util
-   * @param {*} value Any value.
-   * @returns {*} Returns `value`.
-   * @example
-   *
-   * var object = { 'user': 'fred' };
-   *
-   * _.identity(object) === object;
-   * // => true
-   */
-  function identity(value) {
-    return value;
-  }
-
-  /**
-   * Creates a function that invokes `func` with the arguments of the created
-   * function. If `func` is a property name, the created function returns the
-   * property value for a given element. If `func` is an array or object, the
-   * created function returns `true` for elements that contain the equivalent
-   * source properties, otherwise it returns `false`.
-   *
-   * @static
-   * @since 4.0.0
-   * @memberOf _
-   * @category Util
-   * @param {*} [func=_.identity] The value to convert to a callback.
-   * @returns {Function} Returns the callback.
-   * @example
-   *
-   * var users = [
-   *   { 'user': 'barney', 'age': 36, 'active': true },
-   *   { 'user': 'fred',   'age': 40, 'active': false }
-   * ];
-   *
-   * // The `_.matches` iteratee shorthand.
-   * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
-   * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
-   *
-   * // The `_.matchesProperty` iteratee shorthand.
-   * _.filter(users, _.iteratee(['user', 'fred']));
-   * // => [{ 'user': 'fred', 'age': 40 }]
-   *
-   * // The `_.property` iteratee shorthand.
-   * _.map(users, _.iteratee('user'));
-   * // => ['barney', 'fred']
-   *
-   * // Create custom iteratee shorthands.
-   * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
-   *   return !_.isRegExp(func) ? iteratee(func) : function(string) {
-   *     return func.test(string);
-   *   };
-   * });
-   *
-   * _.filter(['abc', 'def'], /ef/);
-   * // => ['def']
-   */
-  var iteratee = baseIteratee;
-
-  /**
-   * Creates a function that performs a partial deep comparison between a given
-   * object and `source`, returning `true` if the given object has equivalent
-   * property values, else `false`. The created function is equivalent to
-   * `_.isMatch` with a `source` partially applied.
-   *
-   * **Note:** This method supports comparing the same values as `_.isEqual`.
-   *
-   * @static
-   * @memberOf _
-   * @since 3.0.0
-   * @category Util
-   * @param {Object} source The object of property values to match.
-   * @returns {Function} Returns the new function.
-   * @example
-   *
-   * var users = [
-   *   { 'user': 'barney', 'age': 36, 'active': true },
-   *   { 'user': 'fred',   'age': 40, 'active': false }
-   * ];
-   *
-   * _.filter(users, _.matches({ 'age': 40, 'active': false }));
-   * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
-   */
-  function matches(source) {
-    return baseMatches(assign({}, source));
-  }
-
-  /**
-   * Adds all own enumerable string keyed function properties of a source
-   * object to the destination object. If `object` is a function, then methods
-   * are added to its prototype as well.
-   *
-   * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
-   * avoid conflicts caused by modifying the original.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Util
-   * @param {Function|Object} [object=lodash] The destination object.
-   * @param {Object} source The object of functions to add.
-   * @param {Object} [options={}] The options object.
-   * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
-   * @returns {Function|Object} Returns `object`.
-   * @example
-   *
-   * function vowels(string) {
-   *   return _.filter(string, function(v) {
-   *     return /[aeiou]/i.test(v);
-   *   });
-   * }
-   *
-   * _.mixin({ 'vowels': vowels });
-   * _.vowels('fred');
-   * // => ['e']
-   *
-   * _('fred').vowels().value();
-   * // => ['e']
-   *
-   * _.mixin({ 'vowels': vowels }, { 'chain': false });
-   * _('fred').vowels();
-   * // => ['e']
-   */
-  function mixin(object, source, options) {
-    var props = keys(source),
-        methodNames = baseFunctions(source, props);
-
-    if (options == null &&
-        !(isObject(source) && (methodNames.length || !props.length))) {
-      options = source;
-      source = object;
-      object = this;
-      methodNames = baseFunctions(source, keys(source));
-    }
-    var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
-        isFunc = isFunction(object);
-
-    baseEach(methodNames, function(methodName) {
-      var func = source[methodName];
-      object[methodName] = func;
-      if (isFunc) {
-        object.prototype[methodName] = function() {
-          var chainAll = this.__chain__;
-          if (chain || chainAll) {
-            var result = object(this.__wrapped__),
-                actions = result.__actions__ = copyArray(this.__actions__);
-
-            actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
-            result.__chain__ = chainAll;
-            return result;
-          }
-          return func.apply(object, arrayPush([this.value()], arguments));
-        };
-      }
-    });
-
-    return object;
-  }
-
-  /**
-   * Reverts the `_` variable to its previous value and returns a reference to
-   * the `lodash` function.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Util
-   * @returns {Function} Returns the `lodash` function.
-   * @example
-   *
-   * var lodash = _.noConflict();
-   */
-  function noConflict() {
-    if (root._ === this) {
-      root._ = oldDash;
-    }
-    return this;
-  }
-
-  /**
-   * A no-operation function that returns `undefined` regardless of the
-   * arguments it receives.
-   *
-   * @static
-   * @memberOf _
-   * @since 2.3.0
-   * @category Util
-   * @example
-   *
-   * var object = { 'user': 'fred' };
-   *
-   * _.noop(object) === undefined;
-   * // => true
-   */
-  function noop() {
-    // No operation performed.
-  }
-
-  /**
-   * Generates a unique ID. If `prefix` is given, the ID is appended to it.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Util
-   * @param {string} [prefix=''] The value to prefix the ID with.
-   * @returns {string} Returns the unique ID.
-   * @example
-   *
-   * _.uniqueId('contact_');
-   * // => 'contact_104'
-   *
-   * _.uniqueId();
-   * // => '105'
-   */
-  function uniqueId(prefix) {
-    var id = ++idCounter;
-    return toString(prefix) + id;
-  }
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * Computes the maximum value of `array`. If `array` is empty or falsey,
-   * `undefined` is returned.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Math
-   * @param {Array} array The array to iterate over.
-   * @returns {*} Returns the maximum value.
-   * @example
-   *
-   * _.max([4, 2, 8, 6]);
-   * // => 8
-   *
-   * _.max([]);
-   * // => undefined
-   */
-  function max(array) {
-    return (array && array.length)
-      ? baseExtremum(array, identity, baseGt)
-      : undefined;
-  }
-
-  /**
-   * Computes the minimum value of `array`. If `array` is empty or falsey,
-   * `undefined` is returned.
-   *
-   * @static
-   * @since 0.1.0
-   * @memberOf _
-   * @category Math
-   * @param {Array} array The array to iterate over.
-   * @returns {*} Returns the minimum value.
-   * @example
-   *
-   * _.min([4, 2, 8, 6]);
-   * // => 2
-   *
-   * _.min([]);
-   * // => undefined
-   */
-  function min(array) {
-    return (array && array.length)
-      ? baseExtremum(array, identity, baseLt)
-      : undefined;
-  }
-
-  /*------------------------------------------------------------------------*/
-
-  // Add methods that return wrapped values in chain sequences.
-  lodash.assignIn = assignIn;
-  lodash.before = before;
-  lodash.bind = bind;
-  lodash.chain = chain;
-  lodash.compact = compact;
-  lodash.concat = concat;
-  lodash.create = create;
-  lodash.defaults = defaults;
-  lodash.defer = defer;
-  lodash.delay = delay;
-  lodash.filter = filter;
-  lodash.flatten = flatten;
-  lodash.flattenDeep = flattenDeep;
-  lodash.iteratee = iteratee;
-  lodash.keys = keys;
-  lodash.map = map;
-  lodash.matches = matches;
-  lodash.mixin = mixin;
-  lodash.negate = negate;
-  lodash.once = once;
-  lodash.pick = pick;
-  lodash.slice = slice;
-  lodash.sortBy = sortBy;
-  lodash.tap = tap;
-  lodash.thru = thru;
-  lodash.toArray = toArray;
-  lodash.values = values;
-
-  // Add aliases.
-  lodash.extend = assignIn;
-
-  // Add methods to `lodash.prototype`.
-  mixin(lodash, lodash);
-
-  /*------------------------------------------------------------------------*/
-
-  // Add methods that return unwrapped values in chain sequences.
-  lodash.clone = clone;
-  lodash.escape = escape;
-  lodash.every = every;
-  lodash.find = find;
-  lodash.forEach = forEach;
-  lodash.has = has;
-  lodash.head = head;
-  lodash.identity = identity;
-  lodash.indexOf = indexOf;
-  lodash.isArguments = isArguments;
-  lodash.isArray = isArray;
-  lodash.isBoolean = isBoolean;
-  lodash.isDate = isDate;
-  lodash.isEmpty = isEmpty;
-  lodash.isEqual = isEqual;
-  lodash.isFinite = isFinite;
-  lodash.isFunction = isFunction;
-  lodash.isNaN = isNaN;
-  lodash.isNull = isNull;
-  lodash.isNumber = isNumber;
-  lodash.isObject = isObject;
-  lodash.isRegExp = isRegExp;
-  lodash.isString = isString;
-  lodash.isUndefined = isUndefined;
-  lodash.last = last;
-  lodash.max = max;
-  lodash.min = min;
-  lodash.noConflict = noConflict;
-  lodash.noop = noop;
-  lodash.reduce = reduce;
-  lodash.result = result;
-  lodash.size = size;
-  lodash.some = some;
-  lodash.uniqueId = uniqueId;
-
-  // Add aliases.
-  lodash.each = forEach;
-  lodash.first = head;
-
-  mixin(lodash, (function() {
-    var source = {};
-    baseForOwn(lodash, function(func, methodName) {
-      if (!hasOwnProperty.call(lodash.prototype, methodName)) {
-        source[methodName] = func;
-      }
-    });
-    return source;
-  }()), { 'chain': false });
-
-  /*------------------------------------------------------------------------*/
-
-  /**
-   * The semantic version number.
-   *
-   * @static
-   * @memberOf _
-   * @type {string}
-   */
-  lodash.VERSION = VERSION;
-
-  // Add `Array` methods to `lodash.prototype`.
-  baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
-    var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName],
-        chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
-        retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName);
-
-    lodash.prototype[methodName] = function() {
-      var args = arguments;
-      if (retUnwrapped && !this.__chain__) {
-        var value = this.value();
-        return func.apply(isArray(value) ? value : [], args);
-      }
-      return this[chainName](function(value) {
-        return func.apply(isArray(value) ? value : [], args);
-      });
-    };
-  });
-
-  // Add chain sequence methods to the `lodash` wrapper.
-  lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
-
-  /*--------------------------------------------------------------------------*/
-
-  // Expose Lodash on the free variable `window` or `self` when available so it's
-  // globally accessible, even when bundled with Browserify, Webpack, etc. This
-  // also prevents errors in cases where Lodash is loaded by a script tag in the
-  // presence of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch
-  // for more details. Use `_.noConflict` to remove Lodash from the global object.
-  (freeWindow || freeSelf || {})._ = lodash;
-
-  // Some AMD build optimizers like r.js check for condition patterns like the following:
-  if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
-    // Define as an anonymous module so, through path mapping, it can be
-    // referenced as the "underscore" module.
-    define(function() {
-      return lodash;
-    });
-  }
-  // Check for `exports` after `define` in case a build optimizer adds an `exports` object.
-  else if (freeExports && freeModule) {
-    // Export for Node.js.
-    if (moduleExports) {
-      (freeModule.exports = lodash)._ = lodash;
-    }
-    // Export for CommonJS support.
-    freeExports._ = lodash;
-  }
-  else {
-    // Export to the global object.
-    root._ = lodash;
-  }
-}.call(this));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.core.min.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.core.min.js
deleted file mode 100644
index af9a225..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.core.min.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @license
- * lodash 4.11.2 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
- * Build: `lodash core -o ./dist/lodash.core.js`
- */
-;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}function r(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function e(n,t){return O(t,function(t){return n[t]})}function u(n){return n&&n.Object===Object?n:null}function o(n){return gn[n]}function i(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function c(n){return n instanceof f?n:new f(n)}function f(n,t){
-this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function a(n,t,r,e){var u;return(u=n===pn)||(u=En[r],u=(n===u||n!==n&&u!==u)&&!kn.call(e,r)),u?t:n}function l(n){return nn(n)?Bn(n):{}}function p(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(pn,r)},t)}function s(n,t){var r=true;return zn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function h(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===pn?i===i:r(i,c)))var c=i,f=o;
-}return f}function v(n,t){var r=[];return zn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function y(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=G),o||(o=[]);++i<c;){var f=t[i];r>0&&e(f)?r>1?y(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function g(n,t){return n&&Cn(n,t,on)}function b(n,t){return v(t,function(t){return Y(n[t])})}function _(n,t){return n>t}function d(n,t,r,e,u){return n===t?true:null==n||null==t||!nn(n)&&!tn(t)?n!==n&&t!==t:j(n,t,d,r,e,u)}function j(n,t,r,e,u,o){var c=Vn(n),f=Vn(t),a="[object Array]",l="[object Array]";
-c||(a=Sn.call(n),a="[object Arguments]"==a?"[object Object]":a),f||(l=Sn.call(t),l="[object Arguments]"==l?"[object Object]":l);var p="[object Object]"==a&&!i(n),f="[object Object]"==l&&!i(t),l=a==l;o||(o=[]);var s=U(o,function(t){return t[0]===n});return s&&s[1]?s[1]==t:(o.push([n,t]),l&&!p?(r=c||isTypedArray(n)?$(n,t,r,e,u,o):q(n,t,a),o.pop(),r):2&u||(c=p&&kn.call(n,"__wrapped__"),a=f&&kn.call(t,"__wrapped__"),!c&&!a)?l?(r=z(n,t,r,e,u,o),o.pop(),r):false:(c=c?n.value():n,t=a?t.value():t,r=r(c,t,e,u,o),
-o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?an:(typeof n=="object"?A:k)(n)}function w(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function x(n,t){return t>n}function O(n,t){var r=-1,e=X(n)?Array(n.length):[];return zn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function A(n){var t=on(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&d(n[u],r[u],pn,3)))return false}return true}}function E(n,t){return n=Object(n),H(t,function(t,r){
-return r in n&&(t[r]=n[r]),t},{})}function k(n){return function(t){return null==t?pn:t[n]}}function N(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function S(n){return N(n,0,n.length)}function T(n,t){var r;return zn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function F(t,r){return H(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function R(n,t,r,e){r||(r={});for(var u=-1,o=t.length;++u<o;){
-var i=t[u],c=e?e(r[i],n[i],i,r,n):n[i],f=r,a=f[i];kn.call(f,i)&&(a===c||a!==a&&c!==c)&&(c!==pn||i in f)||(f[i]=c)}return r}function B(n){return L(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:pn,o=typeof o=="function"?(u--,o):pn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function D(n){return function(){var t=arguments,r=l(n.prototype),t=n.apply(r,t);return nn(t)?t:r}}function I(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==On&&this instanceof e?u:n;++c<f;)a[c]=r[c];
-for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=D(n);return e}function $(n,t,r,e,u,o){var i=-1,c=1&u,f=n.length,a=t.length;if(f!=a&&!(2&u&&a>f))return false;for(a=true;++i<f;){var l=n[i],p=t[i];if(void 0!==pn){a=false;break}if(c){if(!T(t,function(n){return l===n||r(l,n,e,u,o)})){a=false;break}}else if(l!==p&&!r(l,p,e,u,o)){a=false;break}}return a}function q(n,t,r){switch(r){case"[object Boolean]":case"[object Date]":return+n==+t;case"[object Error]":
-return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":return n==t+""}return false}function z(n,t,r,e,u,o){var i=2&u,c=on(n),f=c.length,a=on(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:kn.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==pn||s!==h&&!r(s,h,e,u,o)){a=false;break}i||(i="constructor"==p)}return a&&!i&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)),
-a}function C(n){var t=n?n.length:pn;if(Z(t)&&(Vn(n)||en(n)||W(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function G(n){return tn(n)&&X(n)&&(Vn(n)||W(n))}function J(n,t){return t=null==t?9007199254740991:t,!!t&&(typeof n=="number"||yn.test(n))&&n>-1&&0==n%1&&t>n}function M(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||En)}function P(n){return n&&n.length?n[0]:pn}function U(n,r){return t(n,m(r),zn)}function V(n,t){return zn(n,m(t))}function H(n,t,e){
-return r(n,m(t),e,3>arguments.length,zn)}function K(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=pn),r}}function L(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=qn(t===pn?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=qn(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function Q(){
-if(!arguments.length)return[];var n=arguments[0];return Vn(n)?n:[n]}function W(n){return tn(n)&&X(n)&&kn.call(n,"callee")&&(!Dn.call(n,"callee")||"[object Arguments]"==Sn.call(n))}function X(n){return null!=n&&Z(Gn(n))&&!Y(n)}function Y(n){return n=nn(n)?Sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function Z(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function nn(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function tn(n){return!!n&&typeof n=="object";
-}function rn(n){return typeof n=="number"||tn(n)&&"[object Number]"==Sn.call(n)}function en(n){return typeof n=="string"||!Vn(n)&&tn(n)&&"[object String]"==Sn.call(n)}function un(n){return typeof n=="string"?n:null==n?"":n+""}function on(n){var t=M(n);if(!t&&!X(n))return $n(Object(n));var r,e=C(n),u=!!e,e=e||[],o=e.length;for(r in n)!kn.call(n,r)||u&&("length"==r||J(r,o))||t&&"constructor"==r||e.push(r);return e}function cn(n){for(var t=-1,r=M(n),e=w(n),u=e.length,o=C(n),i=!!o,o=o||[],c=o.length;++t<u;){
-var f=e[t];i&&("length"==f||J(f,c))||"constructor"==f&&(r||!kn.call(n,f))||o.push(f)}return o}function fn(n){return n?e(n,on(n)):[]}function an(n){return n}function ln(t,r,e){var u=on(r),o=b(r,u);null!=e||nn(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=b(r,on(r)));var i=!(nn(e)&&"chain"in e&&!e.chain),c=Y(t);return zn(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=S(this.__actions__)).push({func:u,args:arguments,
-thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var pn,sn=1/0,hn=/[&<>"'`]/g,vn=RegExp(hn.source),yn=/^(?:0|[1-9]\d*)$/,gn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},bn={"function":true,object:true},_n=bn[typeof exports]&&exports&&!exports.nodeType?exports:pn,dn=bn[typeof module]&&module&&!module.nodeType?module:pn,jn=dn&&dn.exports===_n?_n:pn,mn=u(bn[typeof self]&&self),wn=u(bn[typeof window]&&window),xn=u(bn[typeof this]&&this),On=u(_n&&dn&&typeof global=="object"&&global)||wn!==(xn&&xn.window)&&wn||mn||xn||Function("return this")(),An=Array.prototype,En=Object.prototype,kn=En.hasOwnProperty,Nn=0,Sn=En.toString,Tn=On._,Fn=On.Reflect,Rn=Fn?Fn.a:pn,Bn=Object.create,Dn=En.propertyIsEnumerable,In=On.isFinite,$n=Object.keys,qn=Math.max;
-f.prototype=l(c.prototype),f.prototype.constructor=f;var zn=function(n,t){return function(r,e){if(null==r)return r;if(!X(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(g),Cn=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}();Rn&&!Dn.call({valueOf:1},"valueOf")&&(w=function(n){n=Rn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r});var Gn=k("length"),Jn=String,Mn=L(function(n,t,r){
-return I(n,t,r)}),Pn=L(function(n,t){return p(n,1,t)}),Un=L(function(n,t,r){return p(n,Kn(t)||0,r)}),Vn=Array.isArray,Hn=Number,Kn=Number,Ln=B(function(n,t){R(t,on(t),n)}),Qn=B(function(n,t){R(t,cn(t),n)}),Wn=B(function(n,t,r,e){R(t,cn(t),n,e)}),Xn=L(function(n){return n.push(pn,a),Wn.apply(pn,n)}),Yn=L(function(n,t){return null==n?{}:E(n,O(y(t,1),Jn))}),Zn=m;c.assignIn=Qn,c.before=K,c.bind=Mn,c.chain=function(n){return n=c(n),n.__chain__=true,n},c.compact=function(n){return v(n,Boolean)},c.concat=function(){
-var t=arguments.length,r=Q(arguments[0]);if(2>t)return t?S(r):[];for(var e=Array(t-1);t--;)e[t-1]=arguments[t];return y(e,1),n(S(r),fn)},c.create=function(n,t){var r=l(n);return t?Ln(r,t):r},c.defaults=Xn,c.defer=Pn,c.delay=Un,c.filter=function(n,t){return v(n,m(t))},c.flatten=function(n){return n&&n.length?y(n,1):[]},c.flattenDeep=function(n){return n&&n.length?y(n,sn):[]},c.iteratee=Zn,c.keys=on,c.map=function(n,t){return O(n,m(t))},c.matches=function(n){return A(Ln({},n))},c.mixin=ln,c.negate=function(n){
-if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},c.once=function(n){return K(2,n)},c.pick=Yn,c.slice=function(n,t,r){var e=n?n.length:0;return r=r===pn?e:+r,e?N(n,null==t?0:+t,r):[]},c.sortBy=function(n,t){var r=0;return t=m(t),O(O(n,function(n,e,u){return{value:n,index:r++,criteria:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==pn,o=null===r,i=r===r,c=e!==pn,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){
-r=1;break n}if(!o&&e>r||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),k("value"))},c.tap=function(n,t){return t(n),n},c.thru=function(n,t){return t(n)},c.toArray=function(n){return X(n)?n.length?S(n):[]:fn(n)},c.values=fn,c.extend=Qn,ln(c,c),c.clone=function(n){return nn(n)?Vn(n)?S(n):R(n,on(n)):n},c.escape=function(n){return(n=un(n))&&vn.test(n)?n.replace(hn,o):n},c.every=function(n,t,r){return t=r?pn:t,s(n,m(t))},c.find=U,c.forEach=V,c.has=function(n,t){return null!=n&&kn.call(n,t);
-},c.head=P,c.identity=an,c.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?qn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1},c.isArguments=W,c.isArray=Vn,c.isBoolean=function(n){return true===n||false===n||tn(n)&&"[object Boolean]"==Sn.call(n)},c.isDate=function(n){return tn(n)&&"[object Date]"==Sn.call(n)},c.isEmpty=function(n){return X(n)&&(Vn(n)||en(n)||Y(n.splice)||W(n))?!n.length:!on(n).length},c.isEqual=function(n,t){return d(n,t)},
-c.isFinite=function(n){return typeof n=="number"&&In(n)},c.isFunction=Y,c.isNaN=function(n){return rn(n)&&n!=+n},c.isNull=function(n){return null===n},c.isNumber=rn,c.isObject=nn,c.isRegExp=function(n){return nn(n)&&"[object RegExp]"==Sn.call(n)},c.isString=en,c.isUndefined=function(n){return n===pn},c.last=function(n){var t=n?n.length:0;return t?n[t-1]:pn},c.max=function(n){return n&&n.length?h(n,an,_):pn},c.min=function(n){return n&&n.length?h(n,an,x):pn},c.noConflict=function(){return On._===this&&(On._=Tn),
-this},c.noop=function(){},c.reduce=H,c.result=function(n,t,r){return t=null==n?pn:n[t],t===pn&&(t=r),Y(t)?t.call(n):t},c.size=function(n){return null==n?0:(n=X(n)?n:on(n),n.length)},c.some=function(n,t,r){return t=r?pn:t,T(n,m(t))},c.uniqueId=function(n){var t=++Nn;return un(n)+t},c.each=V,c.first=P,ln(c,function(){var n={};return g(c,function(t,r){kn.call(c.prototype,r)||(n[r]=t)}),n}(),{chain:false}),c.VERSION="4.11.2",zn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){
-var t=(/^(?:replace|split)$/.test(n)?String.prototype:An)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);c.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Vn(u)?u:[],n)}return this[r](function(r){return t.apply(Vn(r)?r:[],n)})}}),c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=function(){return F(this.__wrapped__,this.__actions__)},(wn||mn||{})._=c,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){
-return c}):_n&&dn?(jn&&((dn.exports=c)._=c),_n._=c):On._=c}).call(this);
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.fp.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.fp.js
deleted file mode 100644
index 6181b35..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.fp.js
+++ /dev/null
@@ -1,863 +0,0 @@
-(function webpackUniversalModuleDefinition(root, factory) {
-	if(typeof exports === 'object' && typeof module === 'object')
-		module.exports = factory();
-	else if(typeof define === 'function' && define.amd)
-		define([], factory);
-	else if(typeof exports === 'object')
-		exports["fp"] = factory();
-	else
-		root["fp"] = factory();
-})(this, function() {
-return /******/ (function(modules) { // webpackBootstrap
-/******/ 	// The module cache
-/******/ 	var installedModules = {};
-
-/******/ 	// The require function
-/******/ 	function __webpack_require__(moduleId) {
-
-/******/ 		// Check if module is in cache
-/******/ 		if(installedModules[moduleId])
-/******/ 			return installedModules[moduleId].exports;
-
-/******/ 		// Create a new module (and put it into the cache)
-/******/ 		var module = installedModules[moduleId] = {
-/******/ 			exports: {},
-/******/ 			id: moduleId,
-/******/ 			loaded: false
-/******/ 		};
-
-/******/ 		// Execute the module function
-/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-
-/******/ 		// Flag the module as loaded
-/******/ 		module.loaded = true;
-
-/******/ 		// Return the exports of the module
-/******/ 		return module.exports;
-/******/ 	}
-
-
-/******/ 	// expose the modules object (__webpack_modules__)
-/******/ 	__webpack_require__.m = modules;
-
-/******/ 	// expose the module cache
-/******/ 	__webpack_require__.c = installedModules;
-
-/******/ 	// __webpack_public_path__
-/******/ 	__webpack_require__.p = "";
-
-/******/ 	// Load entry module and return exports
-/******/ 	return __webpack_require__(0);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ function(module, exports, __webpack_require__) {
-
-	var baseConvert = __webpack_require__(1);
-
-	/**
-	 * Converts `lodash` to an immutable auto-curried iteratee-first data-last
-	 * version with conversion `options` applied.
-	 *
-	 * @param {Function} lodash The lodash function to convert.
-	 * @param {Object} [options] The options object. See `baseConvert` for more details.
-	 * @returns {Function} Returns the converted `lodash`.
-	 */
-	function browserConvert(lodash, options) {
-	  return baseConvert(lodash, lodash, options);
-	}
-
-	if (typeof _ == 'function') {
-	  _ = browserConvert(_.runInContext());
-	}
-	module.exports = browserConvert;
-
-
-/***/ },
-/* 1 */
-/***/ function(module, exports, __webpack_require__) {
-
-	var mapping = __webpack_require__(2),
-	    mutateMap = mapping.mutate,
-	    fallbackHolder = __webpack_require__(3);
-
-	/**
-	 * Creates a function, with an arity of `n`, that invokes `func` with the
-	 * arguments it receives.
-	 *
-	 * @private
-	 * @param {Function} func The function to wrap.
-	 * @param {number} n The arity of the new function.
-	 * @returns {Function} Returns the new function.
-	 */
-	function baseArity(func, n) {
-	  return n == 2
-	    ? function(a, b) { return func.apply(undefined, arguments); }
-	    : function(a) { return func.apply(undefined, arguments); };
-	}
-
-	/**
-	 * Creates a function that invokes `func`, with up to `n` arguments, ignoring
-	 * any additional arguments.
-	 *
-	 * @private
-	 * @param {Function} func The function to cap arguments for.
-	 * @param {number} n The arity cap.
-	 * @returns {Function} Returns the new function.
-	 */
-	function baseAry(func, n) {
-	  return n == 2
-	    ? function(a, b) { return func(a, b); }
-	    : function(a) { return func(a); };
-	}
-
-	/**
-	 * Creates a clone of `array`.
-	 *
-	 * @private
-	 * @param {Array} array The array to clone.
-	 * @returns {Array} Returns the cloned array.
-	 */
-	function cloneArray(array) {
-	  var length = array ? array.length : 0,
-	      result = Array(length);
-
-	  while (length--) {
-	    result[length] = array[length];
-	  }
-	  return result;
-	}
-
-	/**
-	 * Creates a function that clones a given object using the assignment `func`.
-	 *
-	 * @private
-	 * @param {Function} func The assignment function.
-	 * @returns {Function} Returns the new cloner function.
-	 */
-	function createCloner(func) {
-	  return function(object) {
-	    return func({}, object);
-	  };
-	}
-
-	/**
-	 * Creates a function that wraps `func` and uses `cloner` to clone the first
-	 * argument it receives.
-	 *
-	 * @private
-	 * @param {Function} func The function to wrap.
-	 * @param {Function} cloner The function to clone arguments.
-	 * @returns {Function} Returns the new immutable function.
-	 */
-	function immutWrap(func, cloner) {
-	  return function() {
-	    var length = arguments.length;
-	    if (!length) {
-	      return result;
-	    }
-	    var args = Array(length);
-	    while (length--) {
-	      args[length] = arguments[length];
-	    }
-	    var result = args[0] = cloner.apply(undefined, args);
-	    func.apply(undefined, args);
-	    return result;
-	  };
-	}
-
-	/**
-	 * The base implementation of `convert` which accepts a `util` object of methods
-	 * required to perform conversions.
-	 *
-	 * @param {Object} util The util object.
-	 * @param {string} name The name of the function to convert.
-	 * @param {Function} func The function to convert.
-	 * @param {Object} [options] The options object.
-	 * @param {boolean} [options.cap=true] Specify capping iteratee arguments.
-	 * @param {boolean} [options.curry=true] Specify currying.
-	 * @param {boolean} [options.fixed=true] Specify fixed arity.
-	 * @param {boolean} [options.immutable=true] Specify immutable operations.
-	 * @param {boolean} [options.rearg=true] Specify rearranging arguments.
-	 * @returns {Function|Object} Returns the converted function or object.
-	 */
-	function baseConvert(util, name, func, options) {
-	  var setPlaceholder,
-	      isLib = typeof name == 'function',
-	      isObj = name === Object(name);
-
-	  if (isObj) {
-	    options = func;
-	    func = name;
-	    name = undefined;
-	  }
-	  if (func == null) {
-	    throw new TypeError;
-	  }
-	  options || (options = {});
-
-	  var config = {
-	    'cap': 'cap' in options ? options.cap : true,
-	    'curry': 'curry' in options ? options.curry : true,
-	    'fixed': 'fixed' in options ? options.fixed : true,
-	    'immutable': 'immutable' in options ? options.immutable : true,
-	    'rearg': 'rearg' in options ? options.rearg : true
-	  };
-
-	  var forceCurry = ('curry' in options) && options.curry,
-	      forceFixed = ('fixed' in options) && options.fixed,
-	      forceRearg = ('rearg' in options) && options.rearg,
-	      placeholder = isLib ? func : fallbackHolder,
-	      pristine = isLib ? func.runInContext() : undefined;
-
-	  var helpers = isLib ? func : {
-	    'ary': util.ary,
-	    'assign': util.assign,
-	    'clone': util.clone,
-	    'curry': util.curry,
-	    'forEach': util.forEach,
-	    'isArray': util.isArray,
-	    'isFunction': util.isFunction,
-	    'iteratee': util.iteratee,
-	    'keys': util.keys,
-	    'rearg': util.rearg,
-	    'spread': util.spread,
-	    'toPath': util.toPath
-	  };
-
-	  var ary = helpers.ary,
-	      assign = helpers.assign,
-	      clone = helpers.clone,
-	      curry = helpers.curry,
-	      each = helpers.forEach,
-	      isArray = helpers.isArray,
-	      isFunction = helpers.isFunction,
-	      keys = helpers.keys,
-	      rearg = helpers.rearg,
-	      spread = helpers.spread,
-	      toPath = helpers.toPath;
-
-	  var aryMethodKeys = keys(mapping.aryMethod);
-
-	  var wrappers = {
-	    'castArray': function(castArray) {
-	      return function() {
-	        var value = arguments[0];
-	        return isArray(value)
-	          ? castArray(cloneArray(value))
-	          : castArray.apply(undefined, arguments);
-	      };
-	    },
-	    'iteratee': function(iteratee) {
-	      return function() {
-	        var func = arguments[0],
-	            arity = arguments[1],
-	            result = iteratee(func, arity),
-	            length = result.length;
-
-	        if (config.cap && typeof arity == 'number') {
-	          arity = arity > 2 ? (arity - 2) : 1;
-	          return (length && length <= arity) ? result : baseAry(result, arity);
-	        }
-	        return result;
-	      };
-	    },
-	    'mixin': function(mixin) {
-	      return function(source) {
-	        var func = this;
-	        if (!isFunction(func)) {
-	          return mixin(func, Object(source));
-	        }
-	        var methods = [],
-	            methodNames = [];
-
-	        each(keys(source), function(key) {
-	          var value = source[key];
-	          if (isFunction(value)) {
-	            methodNames.push(key);
-	            methods.push(func.prototype[key]);
-	          }
-	        });
-
-	        mixin(func, Object(source));
-
-	        each(methodNames, function(methodName, index) {
-	          var method = methods[index];
-	          if (isFunction(method)) {
-	            func.prototype[methodName] = method;
-	          } else {
-	            delete func.prototype[methodName];
-	          }
-	        });
-	        return func;
-	      };
-	    },
-	    'runInContext': function(runInContext) {
-	      return function(context) {
-	        return baseConvert(util, runInContext(context), options);
-	      };
-	    }
-	  };
-
-	  /*--------------------------------------------------------------------------*/
-
-	  /**
-	   * Creates a clone of `object` by `path`.
-	   *
-	   * @private
-	   * @param {Object} object The object to clone.
-	   * @param {Array|string} path The path to clone by.
-	   * @returns {Object} Returns the cloned object.
-	   */
-	  function cloneByPath(object, path) {
-	    path = toPath(path);
-
-	    var index = -1,
-	        length = path.length,
-	        result = clone(Object(object)),
-	        nested = result;
-
-	    while (nested != null && ++index < length) {
-	      var key = path[index],
-	          value = nested[key];
-
-	      if (value != null) {
-	        nested[key] = clone(Object(value));
-	      }
-	      nested = nested[key];
-	    }
-	    return result;
-	  }
-
-	  /**
-	   * Converts `lodash` to an immutable auto-curried iteratee-first data-last
-	   * version with conversion `options` applied.
-	   *
-	   * @param {Object} [options] The options object. See `baseConvert` for more details.
-	   * @returns {Function} Returns the converted `lodash`.
-	   */
-	  function convertLib(options) {
-	    return _.runInContext.convert(options)(undefined);
-	  }
-
-	  /**
-	   * Create a converter function for `func` of `name`.
-	   *
-	   * @param {string} name The name of the function to convert.
-	   * @param {Function} func The function to convert.
-	   * @returns {Function} Returns the new converter function.
-	   */
-	  function createConverter(name, func) {
-	    var oldOptions = options;
-	    return function(options) {
-	      var newUtil = isLib ? pristine : helpers,
-	          newFunc = isLib ? pristine[name] : func,
-	          newOptions = assign(assign({}, oldOptions), options);
-
-	      return baseConvert(newUtil, name, newFunc, newOptions);
-	    };
-	  }
-
-	  /**
-	   * Creates a function that wraps `func` to invoke its iteratee, with up to `n`
-	   * arguments, ignoring any additional arguments.
-	   *
-	   * @private
-	   * @param {Function} func The function to cap iteratee arguments for.
-	   * @param {number} n The arity cap.
-	   * @returns {Function} Returns the new function.
-	   */
-	  function iterateeAry(func, n) {
-	    return overArg(func, function(func) {
-	      return typeof func == 'function' ? baseAry(func, n) : func;
-	    });
-	  }
-
-	  /**
-	   * Creates a function that wraps `func` to invoke its iteratee with arguments
-	   * arranged according to the specified `indexes` where the argument value at
-	   * the first index is provided as the first argument, the argument value at
-	   * the second index is provided as the second argument, and so on.
-	   *
-	   * @private
-	   * @param {Function} func The function to rearrange iteratee arguments for.
-	   * @param {number[]} indexes The arranged argument indexes.
-	   * @returns {Function} Returns the new function.
-	   */
-	  function iterateeRearg(func, indexes) {
-	    return overArg(func, function(func) {
-	      var n = indexes.length;
-	      return baseArity(rearg(baseAry(func, n), indexes), n);
-	    });
-	  }
-
-	  /**
-	   * Creates a function that invokes `func` with its first argument passed
-	   * thru `transform`.
-	   *
-	   * @private
-	   * @param {Function} func The function to wrap.
-	   * @param {...Function} transform The functions to transform the first argument.
-	   * @returns {Function} Returns the new function.
-	   */
-	  function overArg(func, transform) {
-	    return function() {
-	      var length = arguments.length;
-	      if (!length) {
-	        return func();
-	      }
-	      var args = Array(length);
-	      while (length--) {
-	        args[length] = arguments[length];
-	      }
-	      var index = config.rearg ? 0 : (length - 1);
-	      args[index] = transform(args[index]);
-	      return func.apply(undefined, args);
-	    };
-	  }
-
-	  /**
-	   * Creates a function that wraps `func` and applys the conversions
-	   * rules by `name`.
-	   *
-	   * @private
-	   * @param {string} name The name of the function to wrap.
-	   * @param {Function} func The function to wrap.
-	   * @returns {Function} Returns the converted function.
-	   */
-	  function wrap(name, func) {
-	    name = mapping.aliasToReal[name] || name;
-
-	    var result,
-	        wrapped = func,
-	        wrapper = wrappers[name];
-
-	    if (wrapper) {
-	      wrapped = wrapper(func);
-	    }
-	    else if (config.immutable) {
-	      if (mutateMap.array[name]) {
-	        wrapped = immutWrap(func, cloneArray);
-	      }
-	      else if (mutateMap.object[name]) {
-	        wrapped = immutWrap(func, createCloner(func));
-	      }
-	      else if (mutateMap.set[name]) {
-	        wrapped = immutWrap(func, cloneByPath);
-	      }
-	    }
-	    each(aryMethodKeys, function(aryKey) {
-	      each(mapping.aryMethod[aryKey], function(otherName) {
-	        if (name == otherName) {
-	          var aryN = !isLib && mapping.iterateeAry[name],
-	              reargIndexes = mapping.iterateeRearg[name],
-	              spreadStart = mapping.methodSpread[name];
-
-	          result = wrapped;
-	          if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
-	            result = spreadStart === undefined
-	              ? ary(result, aryKey)
-	              : spread(result, spreadStart);
-	          }
-	          if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
-	            result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
-	          }
-	          if (config.cap) {
-	            if (reargIndexes) {
-	              result = iterateeRearg(result, reargIndexes);
-	            } else if (aryN) {
-	              result = iterateeAry(result, aryN);
-	            }
-	          }
-	          if (forceCurry || (config.curry && aryKey > 1)) {
-	            forceCurry  && console.log(forceCurry, name);
-	            result = curry(result, aryKey);
-	          }
-	          return false;
-	        }
-	      });
-	      return !result;
-	    });
-
-	    result || (result = wrapped);
-	    if (result == func) {
-	      result = forceCurry ? curry(result, 1) : function() {
-	        return func.apply(this, arguments);
-	      };
-	    }
-	    result.convert = createConverter(name, func);
-	    if (mapping.placeholder[name]) {
-	      setPlaceholder = true;
-	      result.placeholder = func.placeholder = placeholder;
-	    }
-	    return result;
-	  }
-
-	  /*--------------------------------------------------------------------------*/
-
-	  if (!isObj) {
-	    return wrap(name, func);
-	  }
-	  var _ = func;
-
-	  // Convert methods by ary cap.
-	  var pairs = [];
-	  each(aryMethodKeys, function(aryKey) {
-	    each(mapping.aryMethod[aryKey], function(key) {
-	      var func = _[mapping.remap[key] || key];
-	      if (func) {
-	        pairs.push([key, wrap(key, func)]);
-	      }
-	    });
-	  });
-
-	  // Convert remaining methods.
-	  each(keys(_), function(key) {
-	    var func = _[key];
-	    if (typeof func == 'function') {
-	      var length = pairs.length;
-	      while (length--) {
-	        if (pairs[length][0] == key) {
-	          return;
-	        }
-	      }
-	      func.convert = createConverter(key, func);
-	      pairs.push([key, func]);
-	    }
-	  });
-
-	  // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
-	  each(pairs, function(pair) {
-	    _[pair[0]] = pair[1];
-	  });
-
-	  _.convert = convertLib;
-	  if (setPlaceholder) {
-	    _.placeholder = placeholder;
-	  }
-	  // Assign aliases.
-	  each(keys(_), function(key) {
-	    each(mapping.realToAlias[key] || [], function(alias) {
-	      _[alias] = _[key];
-	    });
-	  });
-
-	  return _;
-	}
-
-	module.exports = baseConvert;
-
-
-/***/ },
-/* 2 */
-/***/ function(module, exports) {
-
-	/** Used to map aliases to their real names. */
-	exports.aliasToReal = {
-
-	  // Lodash aliases.
-	  'each': 'forEach',
-	  'eachRight': 'forEachRight',
-	  'entries': 'toPairs',
-	  'entriesIn': 'toPairsIn',
-	  'extend': 'assignIn',
-	  'extendWith': 'assignInWith',
-	  'first': 'head',
-
-	  // Ramda aliases.
-	  '__': 'placeholder',
-	  'all': 'every',
-	  'allPass': 'overEvery',
-	  'always': 'constant',
-	  'any': 'some',
-	  'anyPass': 'overSome',
-	  'apply': 'spread',
-	  'assoc': 'set',
-	  'assocPath': 'set',
-	  'complement': 'negate',
-	  'compose': 'flowRight',
-	  'contains': 'includes',
-	  'dissoc': 'unset',
-	  'dissocPath': 'unset',
-	  'equals': 'isEqual',
-	  'identical': 'eq',
-	  'init': 'initial',
-	  'invertObj': 'invert',
-	  'juxt': 'over',
-	  'omitAll': 'omit',
-	  'nAry': 'ary',
-	  'path': 'get',
-	  'pathEq': 'matchesProperty',
-	  'pathOr': 'getOr',
-	  'paths': 'at',
-	  'pickAll': 'pick',
-	  'pipe': 'flow',
-	  'pluck': 'map',
-	  'prop': 'get',
-	  'propEq': 'matchesProperty',
-	  'propOr': 'getOr',
-	  'props': 'at',
-	  'unapply': 'rest',
-	  'unnest': 'flatten',
-	  'useWith': 'overArgs',
-	  'whereEq': 'filter',
-	  'zipObj': 'zipObject'
-	};
-
-	/** Used to map ary to method names. */
-	exports.aryMethod = {
-	  '1': [
-	    'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
-	    'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
-	    'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
-	    'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
-	    'uniqueId', 'words'
-	  ],
-	  '2': [
-	    'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
-	    'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
-	    'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
-	    'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
-	    'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast',
-	    'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
-	    'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
-	    'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
-	    'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
-	    'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
-	    'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth',
-	    'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
-	    'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
-	    'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
-	    'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
-	    'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
-	    'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
-	    'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
-	    'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
-	    'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
-	    'zipObjectDeep'
-	  ],
-	  '3': [
-	    'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
-	    'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
-	    'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith',
-	    'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy',
-	    'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice',
-	    'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith',
-	    'update', 'xorBy', 'xorWith', 'zipWith'
-	  ],
-	  '4': [
-	    'fill', 'setWith', 'updateWith'
-	  ]
-	};
-
-	/** Used to map ary to rearg configs. */
-	exports.aryRearg = {
-	  '2': [1, 0],
-	  '3': [2, 0, 1],
-	  '4': [3, 2, 0, 1]
-	};
-
-	/** Used to map method names to their iteratee ary. */
-	exports.iterateeAry = {
-	  'dropRightWhile': 1,
-	  'dropWhile': 1,
-	  'every': 1,
-	  'filter': 1,
-	  'find': 1,
-	  'findIndex': 1,
-	  'findKey': 1,
-	  'findLast': 1,
-	  'findLastIndex': 1,
-	  'findLastKey': 1,
-	  'flatMap': 1,
-	  'flatMapDeep': 1,
-	  'flatMapDepth': 1,
-	  'forEach': 1,
-	  'forEachRight': 1,
-	  'forIn': 1,
-	  'forInRight': 1,
-	  'forOwn': 1,
-	  'forOwnRight': 1,
-	  'map': 1,
-	  'mapKeys': 1,
-	  'mapValues': 1,
-	  'partition': 1,
-	  'reduce': 2,
-	  'reduceRight': 2,
-	  'reject': 1,
-	  'remove': 1,
-	  'some': 1,
-	  'takeRightWhile': 1,
-	  'takeWhile': 1,
-	  'times': 1,
-	  'transform': 2
-	};
-
-	/** Used to map method names to iteratee rearg configs. */
-	exports.iterateeRearg = {
-	  'mapKeys': [1]
-	};
-
-	/** Used to map method names to rearg configs. */
-	exports.methodRearg = {
-	  'assignInWith': [1, 2, 0],
-	  'assignWith': [1, 2, 0],
-	  'getOr': [2, 1, 0],
-	  'isEqualWith': [1, 2, 0],
-	  'isMatchWith': [2, 1, 0],
-	  'mergeWith': [1, 2, 0],
-	  'padChars': [2, 1, 0],
-	  'padCharsEnd': [2, 1, 0],
-	  'padCharsStart': [2, 1, 0],
-	  'pullAllBy': [2, 1, 0],
-	  'pullAllWith': [2, 1, 0],
-	  'setWith': [3, 1, 2, 0],
-	  'sortedIndexBy': [2, 1, 0],
-	  'sortedLastIndexBy': [2, 1, 0],
-	  'updateWith': [3, 1, 2, 0],
-	  'zipWith': [1, 2, 0]
-	};
-
-	/** Used to map method names to spread configs. */
-	exports.methodSpread = {
-	  'invokeArgs': 2,
-	  'invokeArgsMap': 2,
-	  'partial': 1,
-	  'partialRight': 1,
-	  'without': 1
-	};
-
-	/** Used to identify methods which mutate arrays or objects. */
-	exports.mutate = {
-	  'array': {
-	    'fill': true,
-	    'pull': true,
-	    'pullAll': true,
-	    'pullAllBy': true,
-	    'pullAllWith': true,
-	    'pullAt': true,
-	    'remove': true,
-	    'reverse': true
-	  },
-	  'object': {
-	    'assign': true,
-	    'assignIn': true,
-	    'assignInWith': true,
-	    'assignWith': true,
-	    'defaults': true,
-	    'defaultsDeep': true,
-	    'merge': true,
-	    'mergeWith': true
-	  },
-	  'set': {
-	    'set': true,
-	    'setWith': true,
-	    'unset': true,
-	    'update': true,
-	    'updateWith': true
-	  }
-	};
-
-	/** Used to track methods with placeholder support */
-	exports.placeholder = {
-	  'bind': true,
-	  'bindKey': true,
-	  'curry': true,
-	  'curryRight': true,
-	  'partial': true,
-	  'partialRight': true
-	};
-
-	/** Used to map real names to their aliases. */
-	exports.realToAlias = (function() {
-	  var hasOwnProperty = Object.prototype.hasOwnProperty,
-	      object = exports.aliasToReal,
-	      result = {};
-
-	  for (var key in object) {
-	    var value = object[key];
-	    if (hasOwnProperty.call(result, value)) {
-	      result[value].push(key);
-	    } else {
-	      result[value] = [key];
-	    }
-	  }
-	  return result;
-	}());
-
-	/** Used to map method names to other names. */
-	exports.remap = {
-	  'curryN': 'curry',
-	  'curryRightN': 'curryRight',
-	  'getOr': 'get',
-	  'invokeArgs': 'invoke',
-	  'invokeArgsMap': 'invokeMap',
-	  'padChars': 'pad',
-	  'padCharsEnd': 'padEnd',
-	  'padCharsStart': 'padStart',
-	  'restFrom': 'rest',
-	  'spreadFrom': 'spread',
-	  'trimChars': 'trim',
-	  'trimCharsEnd': 'trimEnd',
-	  'trimCharsStart': 'trimStart'
-	};
-
-	/** Used to track methods that skip fixing their arity. */
-	exports.skipFixed = {
-	  'castArray': true,
-	  'flow': true,
-	  'flowRight': true,
-	  'iteratee': true,
-	  'mixin': true,
-	  'runInContext': true
-	};
-
-	/** Used to track methods that skip rearranging arguments. */
-	exports.skipRearg = {
-	  'add': true,
-	  'assign': true,
-	  'assignIn': true,
-	  'bind': true,
-	  'bindKey': true,
-	  'concat': true,
-	  'difference': true,
-	  'divide': true,
-	  'eq': true,
-	  'gt': true,
-	  'gte': true,
-	  'isEqual': true,
-	  'lt': true,
-	  'lte': true,
-	  'matchesProperty': true,
-	  'merge': true,
-	  'multiply': true,
-	  'overArgs': true,
-	  'partial': true,
-	  'partialRight': true,
-	  'random': true,
-	  'range': true,
-	  'rangeRight': true,
-	  'subtract': true,
-	  'without': true,
-	  'zip': true,
-	  'zipObject': true
-	};
-
-
-/***/ },
-/* 3 */
-/***/ function(module, exports) {
-
-	/**
-	 * The default argument placeholder value for methods.
-	 *
-	 * @type {Object}
-	 */
-	module.exports = {};
-
-
-/***/ }
-/******/ ])
-});
-;
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.fp.min.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.fp.min.js
deleted file mode 100644
index bd12b9e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.fp.min.js
+++ /dev/null
@@ -1,16 +0,0 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fp=e():t.fp=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function n(t,e){return i(t,t,e)}var i=r(1);"function"==typeof _&&(_=n(_.runInContext())),
-t.exports=n},function(t,e,r){function n(t,e){return 2==e?function(e,r){return t.apply(void 0,arguments)}:function(e){return t.apply(void 0,arguments)}}function i(t,e){return 2==e?function(e,r){return t(e,r)}:function(e){return t(e)}}function a(t){for(var e=t?t.length:0,r=Array(e);e--;)r[e]=t[e];return r}function o(t){return function(e){return t({},e)}}function s(t,e){return function(){var r=arguments.length;if(!r)return i;for(var n=Array(r);r--;)n[r]=arguments[r];var i=n[0]=e.apply(void 0,n);return t.apply(void 0,n),
-i}}function u(t,e,r,d){function f(t,e){e=F(e);for(var r=-1,n=e.length,i=M(Object(t)),a=i;null!=a&&++r<n;){var o=e[r],s=a[o];null!=s&&(a[o]=M(Object(s))),a=a[o]}return i}function h(t){return N.runInContext.convert(t)(void 0)}function y(t,e){var r=d;return function(n){var i=R?B:j,a=R?B[t]:e,o=w(w({},r),n);return u(i,t,a,o)}}function g(t,e){return v(t,function(t){return"function"==typeof t?i(t,e):t})}function m(t,e){return v(t,function(t){var r=e.length;return n(L(i(t,r),e),r)})}function v(t,e){return function(){
-var r=arguments.length;if(!r)return t();for(var n=Array(r);r--;)n[r]=arguments[r];var i=I.rearg?0:r-1;return n[i]=e(n[i]),t.apply(void 0,n)}}function x(t,e){t=p.aliasToReal[t]||t;var r,n=e,i=_[t];return i?n=i(e):I.immutable&&(l.array[t]?n=s(e,a):l.object[t]?n=s(e,o(e)):l.set[t]&&(n=s(e,f))),P(T,function(e){return P(p.aryMethod[e],function(i){if(t==i){var a=!R&&p.iterateeAry[t],o=p.iterateeRearg[t],s=p.methodSpread[t];return r=n,!I.fixed||!k&&p.skipFixed[t]||(r=void 0===s?C(r,e):D(r,s)),I.rearg&&e>1&&(E||!p.skipRearg[t])&&(r=L(r,p.methodRearg[t]||p.aryRearg[e])),
-I.cap&&(o?r=m(r,o):a&&(r=g(r,a))),(b||I.curry&&e>1)&&(b&&console.log(b,t),r=q(r,e)),!1}}),!r}),r||(r=n),r==e&&(r=b?q(r,1):function(){return e.apply(this,arguments)}),r.convert=y(t,e),p.placeholder[t]&&(W=!0,r.placeholder=e.placeholder=O),r}var W,R="function"==typeof e,A=e===Object(e);if(A&&(d=r,r=e,e=void 0),null==r)throw new TypeError;d||(d={});var I={cap:"cap"in d?d.cap:!0,curry:"curry"in d?d.curry:!0,fixed:"fixed"in d?d.fixed:!0,immutable:"immutable"in d?d.immutable:!0,rearg:"rearg"in d?d.rearg:!0
-},b="curry"in d&&d.curry,k="fixed"in d&&d.fixed,E="rearg"in d&&d.rearg,O=R?r:c,B=R?r.runInContext():void 0,j=R?r:{ary:t.ary,assign:t.assign,clone:t.clone,curry:t.curry,forEach:t.forEach,isArray:t.isArray,isFunction:t.isFunction,iteratee:t.iteratee,keys:t.keys,rearg:t.rearg,spread:t.spread,toPath:t.toPath},C=j.ary,w=j.assign,M=j.clone,q=j.curry,P=j.forEach,S=j.isArray,z=j.isFunction,K=j.keys,L=j.rearg,D=j.spread,F=j.toPath,T=K(p.aryMethod),_={castArray:function(t){return function(){var e=arguments[0];
-return S(e)?t(a(e)):t.apply(void 0,arguments)}},iteratee:function(t){return function(){var e=arguments[0],r=arguments[1],n=t(e,r),a=n.length;return I.cap&&"number"==typeof r?(r=r>2?r-2:1,a&&r>=a?n:i(n,r)):n}},mixin:function(t){return function(e){var r=this;if(!z(r))return t(r,Object(e));var n=[],i=[];return P(K(e),function(t){var a=e[t];z(a)&&(i.push(t),n.push(r.prototype[t]))}),t(r,Object(e)),P(i,function(t,e){var i=n[e];z(i)?r.prototype[t]=i:delete r.prototype[t]}),r}},runInContext:function(e){
-return function(r){return u(t,e(r),d)}}};if(!A)return x(e,r);var N=r,V=[];return P(T,function(t){P(p.aryMethod[t],function(t){var e=N[p.remap[t]||t];e&&V.push([t,x(t,e)])})}),P(K(N),function(t){var e=N[t];if("function"==typeof e){for(var r=V.length;r--;)if(V[r][0]==t)return;e.convert=y(t,e),V.push([t,e])}}),P(V,function(t){N[t[0]]=t[1]}),N.convert=h,W&&(N.placeholder=O),P(K(N),function(t){P(p.realToAlias[t]||[],function(e){N[e]=N[t]})}),N}var p=r(2),l=p.mutate,c=r(3);t.exports=u},function(t,e){e.aliasToReal={
-each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendWith:"assignInWith",first:"head",__:"placeholder",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",equals:"isEqual",identical:"eq",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",
-pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",unapply:"rest",unnest:"flatten",useWith:"overArgs",whereEq:"filter",zipObj:"zipObject"},e.aryMethod={1:["attempt","castArray","ceil","create","curry","curryRight","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words"],
-2:["add","after","ary","assign","assignIn","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],
-3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","getOr","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],
-4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findIndex:1,findKey:1,findLast:1,findLastIndex:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1]},e.methodRearg={assignInWith:[1,2,0],assignWith:[1,2,0],getOr:[2,1,0],isEqualWith:[1,2,0],
-isMatchWith:[2,1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],updateWith:[3,1,2,0],zipWith:[1,2,0]},e.methodSpread={invokeArgs:2,invokeArgsMap:2,partial:1,partialRight:1,without:1},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignIn:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsDeep:!0,
-merge:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.placeholder={bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,r=e.aliasToReal,n={};for(var i in r){var a=r[i];t.call(n,a)?n[a].push(i):n[a]=[i]}return n}(),e.remap={curryN:"curry",curryRightN:"curryRight",getOr:"get",invokeArgs:"invoke",invokeArgsMap:"invokeMap",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",restFrom:"rest",
-spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,without:!0,zip:!0,zipObject:!0}},function(t,e){t.exports={}}])});
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.js
deleted file mode 100644
index 7bc771f..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.js
+++ /dev/null
@@ -1,16149 +0,0 @@
-/**
- * @license
- * lodash 4.11.2 (Custom Build) <https://lodash.com/>
- * Build: `lodash -o ./dist/lodash.js`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-;(function() {
-
-  /** Used as a safe reference for `undefined` in pre-ES5 environments. */
-  var undefined;
-
-  /** Used as the semantic version number. */
-  var VERSION = '4.11.2';
-
-  /** Used as the size to enable large array optimizations. */
-  var LARGE_ARRAY_SIZE = 200;
-
-  /** Used as the `TypeError` message for "Functions" methods. */
-  var FUNC_ERROR_TEXT = 'Expected a function';
-
-  /** Used to stand-in for `undefined` hash values. */
-  var HASH_UNDEFINED = '__lodash_hash_undefined__';
-
-  /** Used as the internal argument placeholder. */
-  var PLACEHOLDER = '__lodash_placeholder__';
-
-  /** Used to compose bitmasks for wrapper metadata. */
-  var BIND_FLAG = 1,
-      BIND_KEY_FLAG = 2,
-      CURRY_BOUND_FLAG = 4,
-      CURRY_FLAG = 8,
-      CURRY_RIGHT_FLAG = 16,
-      PARTIAL_FLAG = 32,
-      PARTIAL_RIGHT_FLAG = 64,
-      ARY_FLAG = 128,
-      REARG_FLAG = 256,
-      FLIP_FLAG = 512;
-
-  /** Used to compose bitmasks for comparison styles. */
-  var UNORDERED_COMPARE_FLAG = 1,
-      PARTIAL_COMPARE_FLAG = 2;
-
-  /** Used as default options for `_.truncate`. */
-  var DEFAULT_TRUNC_LENGTH = 30,
-      DEFAULT_TRUNC_OMISSION = '...';
-
-  /** Used to detect hot functions by number of calls within a span of milliseconds. */
-  var HOT_COUNT = 150,
-      HOT_SPAN = 16;
-
-  /** Used to indicate the type of lazy iteratees. */
-  var LAZY_FILTER_FLAG = 1,
-      LAZY_MAP_FLAG = 2,
-      LAZY_WHILE_FLAG = 3;
-
-  /** Used as references for various `Number` constants. */
-  var INFINITY = 1 / 0,
-      MAX_SAFE_INTEGER = 9007199254740991,
-      MAX_INTEGER = 1.7976931348623157e+308,
-      NAN = 0 / 0;
-
-  /** Used as references for the maximum length and index of an array. */
-  var MAX_ARRAY_LENGTH = 4294967295,
-      MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
-      HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
-
-  /** `Object#toString` result references. */
-  var argsTag = '[object Arguments]',
-      arrayTag = '[object Array]',
-      boolTag = '[object Boolean]',
-      dateTag = '[object Date]',
-      errorTag = '[object Error]',
-      funcTag = '[object Function]',
-      genTag = '[object GeneratorFunction]',
-      mapTag = '[object Map]',
-      numberTag = '[object Number]',
-      objectTag = '[object Object]',
-      promiseTag = '[object Promise]',
-      regexpTag = '[object RegExp]',
-      setTag = '[object Set]',
-      stringTag = '[object String]',
-      symbolTag = '[object Symbol]',
-      weakMapTag = '[object WeakMap]',
-      weakSetTag = '[object WeakSet]';
-
-  var arrayBufferTag = '[object ArrayBuffer]',
-      dataViewTag = '[object DataView]',
-      float32Tag = '[object Float32Array]',
-      float64Tag = '[object Float64Array]',
-      int8Tag = '[object Int8Array]',
-      int16Tag = '[object Int16Array]',
-      int32Tag = '[object Int32Array]',
-      uint8Tag = '[object Uint8Array]',
-      uint8ClampedTag = '[object Uint8ClampedArray]',
-      uint16Tag = '[object Uint16Array]',
-      uint32Tag = '[object Uint32Array]';
-
-  /** Used to match empty string literals in compiled template source. */
-  var reEmptyStringLeading = /\b__p \+= '';/g,
-      reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
-      reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
-
-  /** Used to match HTML entities and HTML characters. */
-  var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
-      reUnescapedHtml = /[&<>"'`]/g,
-      reHasEscapedHtml = RegExp(reEscapedHtml.source),
-      reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
-
-  /** Used to match template delimiters. */
-  var reEscape = /<%-([\s\S]+?)%>/g,
-      reEvaluate = /<%([\s\S]+?)%>/g,
-      reInterpolate = /<%=([\s\S]+?)%>/g;
-
-  /** Used to match property names within property paths. */
-  var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
-      reIsPlainProp = /^\w*$/,
-      rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g;
-
-  /**
-   * Used to match `RegExp`
-   * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
-   */
-  var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
-      reHasRegExpChar = RegExp(reRegExpChar.source);
-
-  /** Used to match leading and trailing whitespace. */
-  var reTrim = /^\s+|\s+$/g,
-      reTrimStart = /^\s+/,
-      reTrimEnd = /\s+$/;
-
-  /** Used to match non-compound words composed of alphanumeric characters. */
-  var reBasicWord = /[a-zA-Z0-9]+/g;
-
-  /** Used to match backslashes in property paths. */
-  var reEscapeChar = /\\(\\)?/g;
-
-  /**
-   * Used to match
-   * [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components).
-   */
-  var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
-
-  /** Used to match `RegExp` flags from their coerced string values. */
-  var reFlags = /\w*$/;
-
-  /** Used to detect hexadecimal string values. */
-  var reHasHexPrefix = /^0x/i;
-
-  /** Used to detect bad signed hexadecimal string values. */
-  var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
-
-  /** Used to detect binary string values. */
-  var reIsBinary = /^0b[01]+$/i;
-
-  /** Used to detect host constructors (Safari). */
-  var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
-  /** Used to detect octal string values. */
-  var reIsOctal = /^0o[0-7]+$/i;
-
-  /** Used to detect unsigned integer values. */
-  var reIsUint = /^(?:0|[1-9]\d*)$/;
-
-  /** Used to match latin-1 supplementary letters (excluding mathematical operators). */
-  var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
-
-  /** Used to ensure capturing order of template delimiters. */
-  var reNoMatch = /($^)/;
-
-  /** Used to match unescaped characters in compiled string literals. */
-  var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
-
-  /** Used to compose unicode character classes. */
-  var rsAstralRange = '\\ud800-\\udfff',
-      rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
-      rsComboSymbolsRange = '\\u20d0-\\u20f0',
-      rsDingbatRange = '\\u2700-\\u27bf',
-      rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
-      rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
-      rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
-      rsPunctuationRange = '\\u2000-\\u206f',
-      rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
-      rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
-      rsVarRange = '\\ufe0e\\ufe0f',
-      rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
-
-  /** Used to compose unicode capture groups. */
-  var rsApos = "['\u2019]",
-      rsAstral = '[' + rsAstralRange + ']',
-      rsBreak = '[' + rsBreakRange + ']',
-      rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
-      rsDigits = '\\d+',
-      rsDingbat = '[' + rsDingbatRange + ']',
-      rsLower = '[' + rsLowerRange + ']',
-      rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
-      rsFitz = '\\ud83c[\\udffb-\\udfff]',
-      rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
-      rsNonAstral = '[^' + rsAstralRange + ']',
-      rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
-      rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
-      rsUpper = '[' + rsUpperRange + ']',
-      rsZWJ = '\\u200d';
-
-  /** Used to compose unicode regexes. */
-  var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')',
-      rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')',
-      rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
-      rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
-      reOptMod = rsModifier + '?',
-      rsOptVar = '[' + rsVarRange + ']?',
-      rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
-      rsSeq = rsOptVar + reOptMod + rsOptJoin,
-      rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
-      rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
-
-  /** Used to match apostrophes. */
-  var reApos = RegExp(rsApos, 'g');
-
-  /**
-   * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
-   * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
-   */
-  var reComboMark = RegExp(rsCombo, 'g');
-
-  /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
-  var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
-
-  /** Used to match complex or compound words. */
-  var reComplexWord = RegExp([
-    rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
-    rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',
-    rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr,
-    rsUpper + '+' + rsOptUpperContr,
-    rsDigits,
-    rsEmoji
-  ].join('|'), 'g');
-
-  /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
-  var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange  + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
-
-  /** Used to detect strings that need a more robust regexp to match words. */
-  var reHasComplexWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
-
-  /** Used to assign default `context` object properties. */
-  var contextProps = [
-    'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
-    'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
-    'Promise', 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError',
-    'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
-    '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
-  ];
-
-  /** Used to make template sourceURLs easier to identify. */
-  var templateCounter = -1;
-
-  /** Used to identify `toStringTag` values of typed arrays. */
-  var typedArrayTags = {};
-  typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
-  typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
-  typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
-  typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
-  typedArrayTags[uint32Tag] = true;
-  typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
-  typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
-  typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
-  typedArrayTags[errorTag] = typedArrayTags[funcTag] =
-  typedArrayTags[mapTag] = typedArrayTags[numberTag] =
-  typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
-  typedArrayTags[setTag] = typedArrayTags[stringTag] =
-  typedArrayTags[weakMapTag] = false;
-
-  /** Used to identify `toStringTag` values supported by `_.clone`. */
-  var cloneableTags = {};
-  cloneableTags[argsTag] = cloneableTags[arrayTag] =
-  cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
-  cloneableTags[boolTag] = cloneableTags[dateTag] =
-  cloneableTags[float32Tag] = cloneableTags[float64Tag] =
-  cloneableTags[int8Tag] = cloneableTags[int16Tag] =
-  cloneableTags[int32Tag] = cloneableTags[mapTag] =
-  cloneableTags[numberTag] = cloneableTags[objectTag] =
-  cloneableTags[regexpTag] = cloneableTags[setTag] =
-  cloneableTags[stringTag] = cloneableTags[symbolTag] =
-  cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
-  cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
-  cloneableTags[errorTag] = cloneableTags[funcTag] =
-  cloneableTags[weakMapTag] = false;
-
-  /** Used to map latin-1 supplementary letters to basic latin letters. */
-  var deburredLetters = {
-    '\xc0': 'A',  '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
-    '\xe0': 'a',  '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
-    '\xc7': 'C',  '\xe7': 'c',
-    '\xd0': 'D',  '\xf0': 'd',
-    '\xc8': 'E',  '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
-    '\xe8': 'e',  '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
-    '\xcC': 'I',  '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
-    '\xeC': 'i',  '\xed': 'i', '\xee': 'i', '\xef': 'i',
-    '\xd1': 'N',  '\xf1': 'n',
-    '\xd2': 'O',  '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
-    '\xf2': 'o',  '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
-    '\xd9': 'U',  '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
-    '\xf9': 'u',  '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
-    '\xdd': 'Y',  '\xfd': 'y', '\xff': 'y',
-    '\xc6': 'Ae', '\xe6': 'ae',
-    '\xde': 'Th', '\xfe': 'th',
-    '\xdf': 'ss'
-  };
-
-  /** Used to map characters to HTML entities. */
-  var htmlEscapes = {
-    '&': '&amp;',
-    '<': '&lt;',
-    '>': '&gt;',
-    '"': '&quot;',
-    "'": '&#39;',
-    '`': '&#96;'
-  };
-
-  /** Used to map HTML entities to characters. */
-  var htmlUnescapes = {
-    '&amp;': '&',
-    '&lt;': '<',
-    '&gt;': '>',
-    '&quot;': '"',
-    '&#39;': "'",
-    '&#96;': '`'
-  };
-
-  /** Used to determine if values are of the language type `Object`. */
-  var objectTypes = {
-    'function': true,
-    'object': true
-  };
-
-  /** Used to escape characters for inclusion in compiled string literals. */
-  var stringEscapes = {
-    '\\': '\\',
-    "'": "'",
-    '\n': 'n',
-    '\r': 'r',
-    '\u2028': 'u2028',
-    '\u2029': 'u2029'
-  };
-
-  /** Built-in method references without a dependency on `root`. */
-  var freeParseFloat = parseFloat,
-      freeParseInt = parseInt;
-
-  /** Detect free variable `exports`. */
-  var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)
-    ? exports
-    : undefined;
-
-  /** Detect free variable `module`. */
-  var freeModule = (objectTypes[typeof module] && module && !module.nodeType)
-    ? module
-    : undefined;
-
-  /** Detect the popular CommonJS extension `module.exports`. */
-  var moduleExports = (freeModule && freeModule.exports === freeExports)
-    ? freeExports
-    : undefined;
-
-  /** Detect free variable `global` from Node.js. */
-  var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
-
-  /** Detect free variable `self`. */
-  var freeSelf = checkGlobal(objectTypes[typeof self] && self);
-
-  /** Detect free variable `window`. */
-  var freeWindow = checkGlobal(objectTypes[typeof window] && window);
-
-  /** Detect `this` as the global object. */
-  var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
-
-  /**
-   * Used as a reference to the global object.
-   *
-   * The `this` value is used if it's the global object to avoid Greasemonkey's
-   * restricted `window` object, otherwise the `window` object is used.
-   */
-  var root = freeGlobal ||
-    ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||
-      freeSelf || thisGlobal || Function('return this')();
-
-  /*--------------------------------------------------------------------------*/
-
-  /**
-   * Adds the key-value `pair` to `map`.
-   *
-   * @private
-   * @param {Object} map The map to modify.
-   * @param {Array} pair The key-value pair to add.
-   * @returns {Object} Returns `map`.
-   */
-  function addMapEntry(map, pair) {
-    // Don't return `Map#set` because it doesn't return the map instance in IE 11.
-    map.set(pair[0], pair[1]);
-    return map;
-  }
-
-  /**
-   * Adds `value` to `set`.
-   *
-   * @private
-   * @param {Object} set The set to modify.
-   * @param {*} value The value to add.
-   * @returns {Object} Returns `set`.
-   */
-  function addSetEntry(set, value) {
-    set.add(value);
-    return set;
-  }
-
-  /**
-   * A faster alternative to `Function#apply`, this function invokes `func`
-   * with the `this` binding of `thisArg` and the arguments of `args`.
-   *
-   * @private
-   * @param {Function} func The function to invoke.
-   * @param {*} thisArg The `this` binding of `func`.
-   * @param {Array} args The arguments to invoke `func` with.
-   * @returns {*} Returns the result of `func`.
-   */
-  function apply(func, thisArg, args) {
-    var length = args.length;
-    switch (length) {
-      case 0: return func.call(thisArg);
-      case 1: return func.call(thisArg, args[0]);
-      case 2: return func.call(thisArg, args[0], args[1]);
-      case 3: return func.call(thisArg, args[0], args[1], args[2]);
-    }
-    return func.apply(thisArg, args);
-  }
-
-  /**
-   * A specialized version of `baseAggregator` for arrays.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} setter The function to set `accumulator` values.
-   * @param {Function} iteratee The iteratee to transform keys.
-   * @param {Object} accumulator The initial aggregated object.
-   * @returns {Function} Returns `accumulator`.
-   */
-  function arrayAggregator(array, setter, iteratee, accumulator) {
-    var index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      var value = array[index];
-      setter(accumulator, value, iteratee(value), array);
-    }
-    return accumulator;
-  }
-
-  /**
-   * Creates a new array concatenating `array` with `other`.
-   *
-   * @private
-   * @param {Array} array The first array to concatenate.
-   * @param {Array} other The second array to concatenate.
-   * @returns {Array} Returns the new concatenated array.
-   */
-  function arrayConcat(array, other) {
-    var index = -1,
-        length = array.length,
-        othIndex = -1,
-        othLength = other.length,
-        result = Array(length + othLength);
-
-    while (++index < length) {
-      result[index] = array[index];
-    }
-    while (++othIndex < othLength) {
-      result[index++] = other[othIndex];
-    }
-    return result;
-  }
-
-  /**
-   * A specialized version of `_.forEach` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Array} Returns `array`.
-   */
-  function arrayEach(array, iteratee) {
-    var index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      if (iteratee(array[index], index, array) === false) {
-        break;
-      }
-    }
-    return array;
-  }
-
-  /**
-   * A specialized version of `_.forEachRight` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Array} Returns `array`.
-   */
-  function arrayEachRight(array, iteratee) {
-    var length = array.length;
-
-    while (length--) {
-      if (iteratee(array[length], length, array) === false) {
-        break;
-      }
-    }
-    return array;
-  }
-
-  /**
-   * A specialized version of `_.every` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} predicate The function invoked per iteration.
-   * @returns {boolean} Returns `true` if all elements pass the predicate check,
-   *  else `false`.
-   */
-  function arrayEvery(array, predicate) {
-    var index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      if (!predicate(array[index], index, array)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  /**
-   * A specialized version of `_.filter` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} predicate The function invoked per iteration.
-   * @returns {Array} Returns the new filtered array.
-   */
-  function arrayFilter(array, predicate) {
-    var index = -1,
-        length = array.length,
-        resIndex = 0,
-        result = [];
-
-    while (++index < length) {
-      var value = array[index];
-      if (predicate(value, index, array)) {
-        result[resIndex++] = value;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * A specialized version of `_.includes` for arrays without support for
-   * specifying an index to search from.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {*} target The value to search for.
-   * @returns {boolean} Returns `true` if `target` is found, else `false`.
-   */
-  function arrayIncludes(array, value) {
-    return !!array.length && baseIndexOf(array, value, 0) > -1;
-  }
-
-  /**
-   * This function is like `arrayIncludes` except that it accepts a comparator.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {*} target The value to search for.
-   * @param {Function} comparator The comparator invoked per element.
-   * @returns {boolean} Returns `true` if `target` is found, else `false`.
-   */
-  function arrayIncludesWith(array, value, comparator) {
-    var index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      if (comparator(value, array[index])) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * A specialized version of `_.map` for arrays without support for iteratee
-   * shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Array} Returns the new mapped array.
-   */
-  function arrayMap(array, iteratee) {
-    var index = -1,
-        length = array.length,
-        result = Array(length);
-
-    while (++index < length) {
-      result[index] = iteratee(array[index], index, array);
-    }
-    return result;
-  }
-
-  /**
-   * Appends the elements of `values` to `array`.
-   *
-   * @private
-   * @param {Array} array The array to modify.
-   * @param {Array} values The values to append.
-   * @returns {Array} Returns `array`.
-   */
-  function arrayPush(array, values) {
-    var index = -1,
-        length = values.length,
-        offset = array.length;
-
-    while (++index < length) {
-      array[offset + index] = values[index];
-    }
-    return array;
-  }
-
-  /**
-   * A specialized version of `_.reduce` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @param {*} [accumulator] The initial value.
-   * @param {boolean} [initAccum] Specify using the first element of `array` as
-   *  the initial value.
-   * @returns {*} Returns the accumulated value.
-   */
-  function arrayReduce(array, iteratee, accumulator, initAccum) {
-    var index = -1,
-        length = array.length;
-
-    if (initAccum && length) {
-      accumulator = array[++index];
-    }
-    while (++index < length) {
-      accumulator = iteratee(accumulator, array[index], index, array);
-    }
-    return accumulator;
-  }
-
-  /**
-   * A specialized version of `_.reduceRight` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @param {*} [accumulator] The initial value.
-   * @param {boolean} [initAccum] Specify using the last element of `array` as
-   *  the initial value.
-   * @returns {*} Returns the accumulated value.
-   */
-  function arrayReduceRight(array, iteratee, accumulator, initAccum) {
-    var length = array.length;
-    if (initAccum && length) {
-      accumulator = array[--length];
-    }
-    while (length--) {
-      accumulator = iteratee(accumulator, array[length], length, array);
-    }
-    return accumulator;
-  }
-
-  /**
-   * A specialized version of `_.some` for arrays without support for iteratee
-   * shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} predicate The function invoked per iteration.
-   * @returns {boolean} Returns `true` if any element passes the predicate check,
-   *  else `false`.
-   */
-  function arraySome(array, predicate) {
-    var index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      if (predicate(array[index], index, array)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * The base implementation of methods like `_.find` and `_.findKey`, without
-   * support for iteratee shorthands, which iterates over `collection` using
-   * `eachFunc`.
-   *
-   * @private
-   * @param {Array|Object} collection The collection to search.
-   * @param {Function} predicate The function invoked per iteration.
-   * @param {Function} eachFunc The function to iterate over `collection`.
-   * @param {boolean} [retKey] Specify returning the key of the found element
-   *  instead of the element itself.
-   * @returns {*} Returns the found element or its key, else `undefined`.
-   */
-  function baseFind(collection, predicate, eachFunc, retKey) {
-    var result;
-    eachFunc(collection, function(value, key, collection) {
-      if (predicate(value, key, collection)) {
-        result = retKey ? key : value;
-        return false;
-      }
-    });
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.findIndex` and `_.findLastIndex` without
-   * support for iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {Function} predicate The function invoked per iteration.
-   * @param {boolean} [fromRight] Specify iterating from right to left.
-   * @returns {number} Returns the index of the matched value, else `-1`.
-   */
-  function baseFindIndex(array, predicate, fromRight) {
-    var length = array.length,
-        index = fromRight ? length : -1;
-
-    while ((fromRight ? index-- : ++index < length)) {
-      if (predicate(array[index], index, array)) {
-        return index;
-      }
-    }
-    return -1;
-  }
-
-  /**
-   * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {*} value The value to search for.
-   * @param {number} fromIndex The index to search from.
-   * @returns {number} Returns the index of the matched value, else `-1`.
-   */
-  function baseIndexOf(array, value, fromIndex) {
-    if (value !== value) {
-      return indexOfNaN(array, fromIndex);
-    }
-    var index = fromIndex - 1,
-        length = array.length;
-
-    while (++index < length) {
-      if (array[index] === value) {
-        return index;
-      }
-    }
-    return -1;
-  }
-
-  /**
-   * This function is like `baseIndexOf` except that it accepts a comparator.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {*} value The value to search for.
-   * @param {number} fromIndex The index to search from.
-   * @param {Function} comparator The comparator invoked per element.
-   * @returns {number} Returns the index of the matched value, else `-1`.
-   */
-  function baseIndexOfWith(array, value, fromIndex, comparator) {
-    var index = fromIndex - 1,
-        length = array.length;
-
-    while (++index < length) {
-      if (comparator(array[index], value)) {
-        return index;
-      }
-    }
-    return -1;
-  }
-
-  /**
-   * The base implementation of `_.mean` and `_.meanBy` without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {number} Returns the mean.
-   */
-  function baseMean(array, iteratee) {
-    var length = array ? array.length : 0;
-    return length ? (baseSum(array, iteratee) / length) : NAN;
-  }
-
-  /**
-   * The base implementation of `_.reduce` and `_.reduceRight`, without support
-   * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
-   *
-   * @private
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @param {*} accumulator The initial value.
-   * @param {boolean} initAccum Specify using the first or last element of
-   *  `collection` as the initial value.
-   * @param {Function} eachFunc The function to iterate over `collection`.
-   * @returns {*} Returns the accumulated value.
-   */
-  function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
-    eachFunc(collection, function(value, index, collection) {
-      accumulator = initAccum
-        ? (initAccum = false, value)
-        : iteratee(accumulator, value, index, collection);
-    });
-    return accumulator;
-  }
-
-  /**
-   * The base implementation of `_.sortBy` which uses `comparer` to define the
-   * sort order of `array` and replaces criteria objects with their corresponding
-   * values.
-   *
-   * @private
-   * @param {Array} array The array to sort.
-   * @param {Function} comparer The function to define sort order.
-   * @returns {Array} Returns `array`.
-   */
-  function baseSortBy(array, comparer) {
-    var length = array.length;
-
-    array.sort(comparer);
-    while (length--) {
-      array[length] = array[length].value;
-    }
-    return array;
-  }
-
-  /**
-   * The base implementation of `_.sum` and `_.sumBy` without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {number} Returns the sum.
-   */
-  function baseSum(array, iteratee) {
-    var result,
-        index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      var current = iteratee(array[index]);
-      if (current !== undefined) {
-        result = result === undefined ? current : (result + current);
-      }
-    }
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.times` without support for iteratee shorthands
-   * or max array length checks.
-   *
-   * @private
-   * @param {number} n The number of times to invoke `iteratee`.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Array} Returns the array of results.
-   */
-  function baseTimes(n, iteratee) {
-    var index = -1,
-        result = Array(n);
-
-    while (++index < n) {
-      result[index] = iteratee(index);
-    }
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
-   * of key-value pairs for `object` corresponding to the property names of `props`.
-   *
-   * @private
-   * @param {Object} object The object to query.
-   * @param {Array} props The property names to get values for.
-   * @returns {Object} Returns the new array of key-value pairs.
-   */
-  function baseToPairs(object, props) {
-    return arrayMap(props, function(key) {
-      return [key, object[key]];
-    });
-  }
-
-  /**
-   * The base implementation of `_.unary` without support for storing wrapper metadata.
-   *
-   * @private
-   * @param {Function} func The function to cap arguments for.
-   * @returns {Function} Returns the new function.
-   */
-  function baseUnary(func) {
-    return function(value) {
-      return func(value);
-    };
-  }
-
-  /**
-   * The base implementation of `_.values` and `_.valuesIn` which creates an
-   * array of `object` property values corresponding to the property names
-   * of `props`.
-   *
-   * @private
-   * @param {Object} object The object to query.
-   * @param {Array} props The property names to get values for.
-   * @returns {Object} Returns the array of property values.
-   */
-  function baseValues(object, props) {
-    return arrayMap(props, function(key) {
-      return object[key];
-    });
-  }
-
-  /**
-   * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
-   * that is not found in the character symbols.
-   *
-   * @private
-   * @param {Array} strSymbols The string symbols to inspect.
-   * @param {Array} chrSymbols The character symbols to find.
-   * @returns {number} Returns the index of the first unmatched string symbol.
-   */
-  function charsStartIndex(strSymbols, chrSymbols) {
-    var index = -1,
-        length = strSymbols.length;
-
-    while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
-    return index;
-  }
-
-  /**
-   * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
-   * that is not found in the character symbols.
-   *
-   * @private
-   * @param {Array} strSymbols The string symbols to inspect.
-   * @param {Array} chrSymbols The character symbols to find.
-   * @returns {number} Returns the index of the last unmatched string symbol.
-   */
-  function charsEndIndex(strSymbols, chrSymbols) {
-    var index = strSymbols.length;
-
-    while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
-    return index;
-  }
-
-  /**
-   * Checks if `value` is a global object.
-   *
-   * @private
-   * @param {*} value The value to check.
-   * @returns {null|Object} Returns `value` if it's a global object, else `null`.
-   */
-  function checkGlobal(value) {
-    return (value && value.Object === Object) ? value : null;
-  }
-
-  /**
-   * Gets the number of `placeholder` occurrences in `array`.
-   *
-   * @private
-   * @param {Array} array The array to inspect.
-   * @param {*} placeholder The placeholder to search for.
-   * @returns {number} Returns the placeholder count.
-   */
-  function countHolders(array, placeholder) {
-    var length = array.length,
-        result = 0;
-
-    while (length--) {
-      if (array[length] === placeholder) {
-        result++;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
-   *
-   * @private
-   * @param {string} letter The matched letter to deburr.
-   * @returns {string} Returns the deburred letter.
-   */
-  function deburrLetter(letter) {
-    return deburredLetters[letter];
-  }
-
-  /**
-   * Used by `_.escape` to convert characters to HTML entities.
-   *
-   * @private
-   * @param {string} chr The matched character to escape.
-   * @returns {string} Returns the escaped character.
-   */
-  function escapeHtmlChar(chr) {
-    return htmlEscapes[chr];
-  }
-
-  /**
-   * Used by `_.template` to escape characters for inclusion in compiled string literals.
-   *
-   * @private
-   * @param {string} chr The matched character to escape.
-   * @returns {string} Returns the escaped character.
-   */
-  function escapeStringChar(chr) {
-    return '\\' + stringEscapes[chr];
-  }
-
-  /**
-   * Gets the index at which the first occurrence of `NaN` is found in `array`.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {number} fromIndex The index to search from.
-   * @param {boolean} [fromRight] Specify iterating from right to left.
-   * @returns {number} Returns the index of the matched `NaN`, else `-1`.
-   */
-  function indexOfNaN(array, fromIndex, fromRight) {
-    var length = array.length,
-        index = fromIndex + (fromRight ? 0 : -1);
-
-    while ((fromRight ? index-- : ++index < length)) {
-      var other = array[index];
-      if (other !== other) {
-        return index;
-      }
-    }
-    return -1;
-  }
-
-  /**
-   * Checks if `value` is a host object in IE < 9.
-   *
-   * @private
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
-   */
-  function isHostObject(value) {
-    // Many host objects are `Object` objects that can coerce to strings
-    // despite having improperly defined `toString` methods.
-    var result = false;
-    if (value != null && typeof value.toString != 'function') {
-      try {
-        result = !!(value + '');
-      } catch (e) {}
-    }
-    return result;
-  }
-
-  /**
-   * Converts `iterator` to an array.
-   *
-   * @private
-   * @param {Object} iterator The iterator to convert.
-   * @returns {Array} Returns the converted array.
-   */
-  function iteratorToArray(iterator) {
-    var data,
-        result = [];
-
-    while (!(data = iterator.next()).done) {
-      result.push(data.value);
-    }
-    return result;
-  }
-
-  /**
-   * Converts `map` to an array.
-   *
-   * @private
-   * @param {Object} map The map to convert.
-   * @returns {Array} Returns the converted array.
-   */
-  function mapToArray(map) {
-    var index = -1,
-        result = Array(map.size);
-
-    map.forEach(function(value, key) {
-      result[++index] = [key, value];
-    });
-    return result;
-  }
-
-  /**
-   * Replaces all `placeholder` elements in `array` with an internal placeholder
-   * and returns an array of their indexes.
-   *
-   * @private
-   * @param {Array} array The array to modify.
-   * @param {*} placeholder The placeholder to replace.
-   * @returns {Array} Returns the new array of placeholder indexes.
-   */
-  function replaceHolders(array, placeholder) {
-    var index = -1,
-        length = array.length,
-        resIndex = 0,
-        result = [];
-
-    while (++index < length) {
-      var value = array[index];
-      if (value === placeholder || value === PLACEHOLDER) {
-        array[index] = PLACEHOLDER;
-        result[resIndex++] = index;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Converts `set` to an array.
-   *
-   * @private
-   * @param {Object} set The set to convert.
-   * @returns {Array} Returns the converted array.
-   */
-  function setToArray(set) {
-    var index = -1,
-        result = Array(set.size);
-
-    set.forEach(function(value) {
-      result[++index] = value;
-    });
-    return result;
-  }
-
-  /**
-   * Gets the number of symbols in `string`.
-   *
-   * @private
-   * @param {string} string The string to inspect.
-   * @returns {number} Returns the string size.
-   */
-  function stringSize(string) {
-    if (!(string && reHasComplexSymbol.test(string))) {
-      return string.length;
-    }
-    var result = reComplexSymbol.lastIndex = 0;
-    while (reComplexSymbol.test(string)) {
-      result++;
-    }
-    return result;
-  }
-
-  /**
-   * Converts `string` to an array.
-   *
-   * @private
-   * @param {string} string The string to convert.
-   * @returns {Array} Returns the converted array.
-   */
-  function stringToArray(string) {
-    return string.match(reComplexSymbol);
-  }
-
-  /**
-   * Used by `_.unescape` to convert HTML entities to characters.
-   *
-   * @private
-   * @param {string} chr The matched character to unescape.
-   * @returns {string} Returns the unescaped character.
-   */
-  function unescapeHtmlChar(chr) {
-    return htmlUnescapes[chr];
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  /**
-   * Create a new pristine `lodash` function using the `context` object.
-   *
-   * @static
-   * @memberOf _
-   * @since 1.1.0
-   * @category Util
-   * @param {Object} [context=root] The context object.
-   * @returns {Function} Returns a new `lodash` function.
-   * @example
-   *
-   * _.mixin({ 'foo': _.constant('foo') });
-   *
-   * var lodash = _.runInContext();
-   * lodash.mixin({ 'bar': lodash.constant('bar') });
-   *
-   * _.isFunction(_.foo);
-   * // => true
-   * _.isFunction(_.bar);
-   * // => false
-   *
-   * lodash.isFunction(lodash.foo);
-   * // => false
-   * lodash.isFunction(lodash.bar);
-   * // => true
-   *
-   * // Use `context` to mock `Date#getTime` use in `_.now`.
-   * var mock = _.runInContext({
-   *   'Date': function() {
-   *     return { 'getTime': getTimeMock };
-   *   }
-   * });
-   *
-   * // Create a suped-up `defer` in Node.js.
-   * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
-   */
-  function runInContext(context) {
-    context = context ? _.defaults({}, context, _.pick(root, contextProps)) : root;
-
-    /** Built-in constructor references. */
-    var Date = context.Date,
-        Error = context.Error,
-        Math = context.Math,
-        RegExp = context.RegExp,
-        TypeError = context.TypeError;
-
-    /** Used for built-in method references. */
-    var arrayProto = context.Array.prototype,
-        objectProto = context.Object.prototype,
-        stringProto = context.String.prototype;
-
-    /** Used to resolve the decompiled source of functions. */
-    var funcToString = context.Function.prototype.toString;
-
-    /** Used to check objects for own properties. */
-    var hasOwnProperty = objectProto.hasOwnProperty;
-
-    /** Used to generate unique IDs. */
-    var idCounter = 0;
-
-    /** Used to infer the `Object` constructor. */
-    var objectCtorString = funcToString.call(Object);
-
-    /**
-     * Used to resolve the
-     * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
-     * of values.
-     */
-    var objectToString = objectProto.toString;
-
-    /** Used to restore the original `_` reference in `_.noConflict`. */
-    var oldDash = root._;
-
-    /** Used to detect if a method is native. */
-    var reIsNative = RegExp('^' +
-      funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
-      .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
-    );
-
-    /** Built-in value references. */
-    var Buffer = moduleExports ? context.Buffer : undefined,
-        Reflect = context.Reflect,
-        Symbol = context.Symbol,
-        Uint8Array = context.Uint8Array,
-        clearTimeout = context.clearTimeout,
-        enumerate = Reflect ? Reflect.enumerate : undefined,
-        getOwnPropertySymbols = Object.getOwnPropertySymbols,
-        iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined,
-        objectCreate = Object.create,
-        propertyIsEnumerable = objectProto.propertyIsEnumerable,
-        setTimeout = context.setTimeout,
-        splice = arrayProto.splice;
-
-    /* Built-in method references for those with the same name as other `lodash` methods. */
-    var nativeCeil = Math.ceil,
-        nativeFloor = Math.floor,
-        nativeGetPrototype = Object.getPrototypeOf,
-        nativeIsFinite = context.isFinite,
-        nativeJoin = arrayProto.join,
-        nativeKeys = Object.keys,
-        nativeMax = Math.max,
-        nativeMin = Math.min,
-        nativeParseInt = context.parseInt,
-        nativeRandom = Math.random,
-        nativeReplace = stringProto.replace,
-        nativeReverse = arrayProto.reverse,
-        nativeSplit = stringProto.split;
-
-    /* Built-in method references that are verified to be native. */
-    var DataView = getNative(context, 'DataView'),
-        Map = getNative(context, 'Map'),
-        Promise = getNative(context, 'Promise'),
-        Set = getNative(context, 'Set'),
-        WeakMap = getNative(context, 'WeakMap'),
-        nativeCreate = getNative(Object, 'create');
-
-    /** Used to store function metadata. */
-    var metaMap = WeakMap && new WeakMap;
-
-    /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
-    var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
-
-    /** Used to lookup unminified function names. */
-    var realNames = {};
-
-    /** Used to detect maps, sets, and weakmaps. */
-    var dataViewCtorString = toSource(DataView),
-        mapCtorString = toSource(Map),
-        promiseCtorString = toSource(Promise),
-        setCtorString = toSource(Set),
-        weakMapCtorString = toSource(WeakMap);
-
-    /** Used to convert symbols to primitives and strings. */
-    var symbolProto = Symbol ? Symbol.prototype : undefined,
-        symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
-        symbolToString = symbolProto ? symbolProto.toString : undefined;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a `lodash` object which wraps `value` to enable implicit method
-     * chain sequences. Methods that operate on and return arrays, collections,
-     * and functions can be chained together. Methods that retrieve a single value
-     * or may return a primitive value will automatically end the chain sequence
-     * and return the unwrapped value. Otherwise, the value must be unwrapped
-     * with `_#value`.
-     *
-     * Explicit chain sequences, which must be unwrapped with `_#value`, may be
-     * enabled using `_.chain`.
-     *
-     * The execution of chained methods is lazy, that is, it's deferred until
-     * `_#value` is implicitly or explicitly called.
-     *
-     * Lazy evaluation allows several methods to support shortcut fusion.
-     * Shortcut fusion is an optimization to merge iteratee calls; this avoids
-     * the creation of intermediate arrays and can greatly reduce the number of
-     * iteratee executions. Sections of a chain sequence qualify for shortcut
-     * fusion if the section is applied to an array of at least `200` elements
-     * and any iteratees accept only one argument. The heuristic for whether a
-     * section qualifies for shortcut fusion is subject to change.
-     *
-     * Chaining is supported in custom builds as long as the `_#value` method is
-     * directly or indirectly included in the build.
-     *
-     * In addition to lodash methods, wrappers have `Array` and `String` methods.
-     *
-     * The wrapper `Array` methods are:
-     * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
-     *
-     * The wrapper `String` methods are:
-     * `replace` and `split`
-     *
-     * The wrapper methods that support shortcut fusion are:
-     * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
-     * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
-     * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
-     *
-     * The chainable wrapper methods are:
-     * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
-     * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
-     * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
-     * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
-     * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
-     * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
-     * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
-     * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
-     * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
-     * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
-     * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
-     * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
-     * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
-     * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
-     * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
-     * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
-     * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
-     * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
-     * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
-     * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
-     * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
-     * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
-     * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
-     * `zipObject`, `zipObjectDeep`, and `zipWith`
-     *
-     * The wrapper methods that are **not** chainable by default are:
-     * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
-     * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`,
-     * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`,
-     * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`,
-     * `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`,
-     * `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`,
-     * `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`,
-     * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`,
-     * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`,
-     * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`,
-     * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
-     * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
-     * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
-     * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
-     * `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`,
-     * `noConflict`, `noop`, `now`, `nth`, `pad`, `padEnd`, `padStart`, `parseInt`,
-     * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`,
-     * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
-     * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`,
-     * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`,
-     * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`,
-     * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`,
-     * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words`
-     *
-     * @name _
-     * @constructor
-     * @category Seq
-     * @param {*} value The value to wrap in a `lodash` instance.
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * var wrapped = _([1, 2, 3]);
-     *
-     * // Returns an unwrapped value.
-     * wrapped.reduce(_.add);
-     * // => 6
-     *
-     * // Returns a wrapped value.
-     * var squares = wrapped.map(square);
-     *
-     * _.isArray(squares);
-     * // => false
-     *
-     * _.isArray(squares.value());
-     * // => true
-     */
-    function lodash(value) {
-      if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
-        if (value instanceof LodashWrapper) {
-          return value;
-        }
-        if (hasOwnProperty.call(value, '__wrapped__')) {
-          return wrapperClone(value);
-        }
-      }
-      return new LodashWrapper(value);
-    }
-
-    /**
-     * The function whose prototype chain sequence wrappers inherit from.
-     *
-     * @private
-     */
-    function baseLodash() {
-      // No operation performed.
-    }
-
-    /**
-     * The base constructor for creating `lodash` wrapper objects.
-     *
-     * @private
-     * @param {*} value The value to wrap.
-     * @param {boolean} [chainAll] Enable explicit method chain sequences.
-     */
-    function LodashWrapper(value, chainAll) {
-      this.__wrapped__ = value;
-      this.__actions__ = [];
-      this.__chain__ = !!chainAll;
-      this.__index__ = 0;
-      this.__values__ = undefined;
-    }
-
-    /**
-     * By default, the template delimiters used by lodash are like those in
-     * embedded Ruby (ERB). Change the following template settings to use
-     * alternative delimiters.
-     *
-     * @static
-     * @memberOf _
-     * @type {Object}
-     */
-    lodash.templateSettings = {
-
-      /**
-       * Used to detect `data` property values to be HTML-escaped.
-       *
-       * @memberOf _.templateSettings
-       * @type {RegExp}
-       */
-      'escape': reEscape,
-
-      /**
-       * Used to detect code to be evaluated.
-       *
-       * @memberOf _.templateSettings
-       * @type {RegExp}
-       */
-      'evaluate': reEvaluate,
-
-      /**
-       * Used to detect `data` property values to inject.
-       *
-       * @memberOf _.templateSettings
-       * @type {RegExp}
-       */
-      'interpolate': reInterpolate,
-
-      /**
-       * Used to reference the data object in the template text.
-       *
-       * @memberOf _.templateSettings
-       * @type {string}
-       */
-      'variable': '',
-
-      /**
-       * Used to import variables into the compiled template.
-       *
-       * @memberOf _.templateSettings
-       * @type {Object}
-       */
-      'imports': {
-
-        /**
-         * A reference to the `lodash` function.
-         *
-         * @memberOf _.templateSettings.imports
-         * @type {Function}
-         */
-        '_': lodash
-      }
-    };
-
-    // Ensure wrappers are instances of `baseLodash`.
-    lodash.prototype = baseLodash.prototype;
-    lodash.prototype.constructor = lodash;
-
-    LodashWrapper.prototype = baseCreate(baseLodash.prototype);
-    LodashWrapper.prototype.constructor = LodashWrapper;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
-     *
-     * @private
-     * @constructor
-     * @param {*} value The value to wrap.
-     */
-    function LazyWrapper(value) {
-      this.__wrapped__ = value;
-      this.__actions__ = [];
-      this.__dir__ = 1;
-      this.__filtered__ = false;
-      this.__iteratees__ = [];
-      this.__takeCount__ = MAX_ARRAY_LENGTH;
-      this.__views__ = [];
-    }
-
-    /**
-     * Creates a clone of the lazy wrapper object.
-     *
-     * @private
-     * @name clone
-     * @memberOf LazyWrapper
-     * @returns {Object} Returns the cloned `LazyWrapper` object.
-     */
-    function lazyClone() {
-      var result = new LazyWrapper(this.__wrapped__);
-      result.__actions__ = copyArray(this.__actions__);
-      result.__dir__ = this.__dir__;
-      result.__filtered__ = this.__filtered__;
-      result.__iteratees__ = copyArray(this.__iteratees__);
-      result.__takeCount__ = this.__takeCount__;
-      result.__views__ = copyArray(this.__views__);
-      return result;
-    }
-
-    /**
-     * Reverses the direction of lazy iteration.
-     *
-     * @private
-     * @name reverse
-     * @memberOf LazyWrapper
-     * @returns {Object} Returns the new reversed `LazyWrapper` object.
-     */
-    function lazyReverse() {
-      if (this.__filtered__) {
-        var result = new LazyWrapper(this);
-        result.__dir__ = -1;
-        result.__filtered__ = true;
-      } else {
-        result = this.clone();
-        result.__dir__ *= -1;
-      }
-      return result;
-    }
-
-    /**
-     * Extracts the unwrapped value from its lazy wrapper.
-     *
-     * @private
-     * @name value
-     * @memberOf LazyWrapper
-     * @returns {*} Returns the unwrapped value.
-     */
-    function lazyValue() {
-      var array = this.__wrapped__.value(),
-          dir = this.__dir__,
-          isArr = isArray(array),
-          isRight = dir < 0,
-          arrLength = isArr ? array.length : 0,
-          view = getView(0, arrLength, this.__views__),
-          start = view.start,
-          end = view.end,
-          length = end - start,
-          index = isRight ? end : (start - 1),
-          iteratees = this.__iteratees__,
-          iterLength = iteratees.length,
-          resIndex = 0,
-          takeCount = nativeMin(length, this.__takeCount__);
-
-      if (!isArr || arrLength < LARGE_ARRAY_SIZE ||
-          (arrLength == length && takeCount == length)) {
-        return baseWrapperValue(array, this.__actions__);
-      }
-      var result = [];
-
-      outer:
-      while (length-- && resIndex < takeCount) {
-        index += dir;
-
-        var iterIndex = -1,
-            value = array[index];
-
-        while (++iterIndex < iterLength) {
-          var data = iteratees[iterIndex],
-              iteratee = data.iteratee,
-              type = data.type,
-              computed = iteratee(value);
-
-          if (type == LAZY_MAP_FLAG) {
-            value = computed;
-          } else if (!computed) {
-            if (type == LAZY_FILTER_FLAG) {
-              continue outer;
-            } else {
-              break outer;
-            }
-          }
-        }
-        result[resIndex++] = value;
-      }
-      return result;
-    }
-
-    // Ensure `LazyWrapper` is an instance of `baseLodash`.
-    LazyWrapper.prototype = baseCreate(baseLodash.prototype);
-    LazyWrapper.prototype.constructor = LazyWrapper;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a hash object.
-     *
-     * @private
-     * @constructor
-     * @returns {Object} Returns the new hash object.
-     */
-    function Hash() {}
-
-    /**
-     * Removes `key` and its value from the hash.
-     *
-     * @private
-     * @param {Object} hash The hash to modify.
-     * @param {string} key The key of the value to remove.
-     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
-     */
-    function hashDelete(hash, key) {
-      return hashHas(hash, key) && delete hash[key];
-    }
-
-    /**
-     * Gets the hash value for `key`.
-     *
-     * @private
-     * @param {Object} hash The hash to query.
-     * @param {string} key The key of the value to get.
-     * @returns {*} Returns the entry value.
-     */
-    function hashGet(hash, key) {
-      if (nativeCreate) {
-        var result = hash[key];
-        return result === HASH_UNDEFINED ? undefined : result;
-      }
-      return hasOwnProperty.call(hash, key) ? hash[key] : undefined;
-    }
-
-    /**
-     * Checks if a hash value for `key` exists.
-     *
-     * @private
-     * @param {Object} hash The hash to query.
-     * @param {string} key The key of the entry to check.
-     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
-     */
-    function hashHas(hash, key) {
-      return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key);
-    }
-
-    /**
-     * Sets the hash `key` to `value`.
-     *
-     * @private
-     * @param {Object} hash The hash to modify.
-     * @param {string} key The key of the value to set.
-     * @param {*} value The value to set.
-     */
-    function hashSet(hash, key, value) {
-      hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
-    }
-
-    // Avoid inheriting from `Object.prototype` when possible.
-    Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a map cache object to store key-value pairs.
-     *
-     * @private
-     * @constructor
-     * @param {Array} [values] The values to cache.
-     */
-    function MapCache(values) {
-      var index = -1,
-          length = values ? values.length : 0;
-
-      this.clear();
-      while (++index < length) {
-        var entry = values[index];
-        this.set(entry[0], entry[1]);
-      }
-    }
-
-    /**
-     * Removes all key-value entries from the map.
-     *
-     * @private
-     * @name clear
-     * @memberOf MapCache
-     */
-    function mapClear() {
-      this.__data__ = {
-        'hash': new Hash,
-        'map': Map ? new Map : [],
-        'string': new Hash
-      };
-    }
-
-    /**
-     * Removes `key` and its value from the map.
-     *
-     * @private
-     * @name delete
-     * @memberOf MapCache
-     * @param {string} key The key of the value to remove.
-     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
-     */
-    function mapDelete(key) {
-      var data = this.__data__;
-      if (isKeyable(key)) {
-        return hashDelete(typeof key == 'string' ? data.string : data.hash, key);
-      }
-      return Map ? data.map['delete'](key) : assocDelete(data.map, key);
-    }
-
-    /**
-     * Gets the map value for `key`.
-     *
-     * @private
-     * @name get
-     * @memberOf MapCache
-     * @param {string} key The key of the value to get.
-     * @returns {*} Returns the entry value.
-     */
-    function mapGet(key) {
-      var data = this.__data__;
-      if (isKeyable(key)) {
-        return hashGet(typeof key == 'string' ? data.string : data.hash, key);
-      }
-      return Map ? data.map.get(key) : assocGet(data.map, key);
-    }
-
-    /**
-     * Checks if a map value for `key` exists.
-     *
-     * @private
-     * @name has
-     * @memberOf MapCache
-     * @param {string} key The key of the entry to check.
-     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
-     */
-    function mapHas(key) {
-      var data = this.__data__;
-      if (isKeyable(key)) {
-        return hashHas(typeof key == 'string' ? data.string : data.hash, key);
-      }
-      return Map ? data.map.has(key) : assocHas(data.map, key);
-    }
-
-    /**
-     * Sets the map `key` to `value`.
-     *
-     * @private
-     * @name set
-     * @memberOf MapCache
-     * @param {string} key The key of the value to set.
-     * @param {*} value The value to set.
-     * @returns {Object} Returns the map cache instance.
-     */
-    function mapSet(key, value) {
-      var data = this.__data__;
-      if (isKeyable(key)) {
-        hashSet(typeof key == 'string' ? data.string : data.hash, key, value);
-      } else if (Map) {
-        data.map.set(key, value);
-      } else {
-        assocSet(data.map, key, value);
-      }
-      return this;
-    }
-
-    // Add methods to `MapCache`.
-    MapCache.prototype.clear = mapClear;
-    MapCache.prototype['delete'] = mapDelete;
-    MapCache.prototype.get = mapGet;
-    MapCache.prototype.has = mapHas;
-    MapCache.prototype.set = mapSet;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     *
-     * Creates a set cache object to store unique values.
-     *
-     * @private
-     * @constructor
-     * @param {Array} [values] The values to cache.
-     */
-    function SetCache(values) {
-      var index = -1,
-          length = values ? values.length : 0;
-
-      this.__data__ = new MapCache;
-      while (++index < length) {
-        this.push(values[index]);
-      }
-    }
-
-    /**
-     * Checks if `value` is in `cache`.
-     *
-     * @private
-     * @param {Object} cache The set cache to search.
-     * @param {*} value The value to search for.
-     * @returns {number} Returns `true` if `value` is found, else `false`.
-     */
-    function cacheHas(cache, value) {
-      var map = cache.__data__;
-      if (isKeyable(value)) {
-        var data = map.__data__,
-            hash = typeof value == 'string' ? data.string : data.hash;
-
-        return hash[value] === HASH_UNDEFINED;
-      }
-      return map.has(value);
-    }
-
-    /**
-     * Adds `value` to the set cache.
-     *
-     * @private
-     * @name push
-     * @memberOf SetCache
-     * @param {*} value The value to cache.
-     */
-    function cachePush(value) {
-      var map = this.__data__;
-      if (isKeyable(value)) {
-        var data = map.__data__,
-            hash = typeof value == 'string' ? data.string : data.hash;
-
-        hash[value] = HASH_UNDEFINED;
-      }
-      else {
-        map.set(value, HASH_UNDEFINED);
-      }
-    }
-
-    // Add methods to `SetCache`.
-    SetCache.prototype.push = cachePush;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a stack cache object to store key-value pairs.
-     *
-     * @private
-     * @constructor
-     * @param {Array} [values] The values to cache.
-     */
-    function Stack(values) {
-      var index = -1,
-          length = values ? values.length : 0;
-
-      this.clear();
-      while (++index < length) {
-        var entry = values[index];
-        this.set(entry[0], entry[1]);
-      }
-    }
-
-    /**
-     * Removes all key-value entries from the stack.
-     *
-     * @private
-     * @name clear
-     * @memberOf Stack
-     */
-    function stackClear() {
-      this.__data__ = { 'array': [], 'map': null };
-    }
-
-    /**
-     * Removes `key` and its value from the stack.
-     *
-     * @private
-     * @name delete
-     * @memberOf Stack
-     * @param {string} key The key of the value to remove.
-     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
-     */
-    function stackDelete(key) {
-      var data = this.__data__,
-          array = data.array;
-
-      return array ? assocDelete(array, key) : data.map['delete'](key);
-    }
-
-    /**
-     * Gets the stack value for `key`.
-     *
-     * @private
-     * @name get
-     * @memberOf Stack
-     * @param {string} key The key of the value to get.
-     * @returns {*} Returns the entry value.
-     */
-    function stackGet(key) {
-      var data = this.__data__,
-          array = data.array;
-
-      return array ? assocGet(array, key) : data.map.get(key);
-    }
-
-    /**
-     * Checks if a stack value for `key` exists.
-     *
-     * @private
-     * @name has
-     * @memberOf Stack
-     * @param {string} key The key of the entry to check.
-     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
-     */
-    function stackHas(key) {
-      var data = this.__data__,
-          array = data.array;
-
-      return array ? assocHas(array, key) : data.map.has(key);
-    }
-
-    /**
-     * Sets the stack `key` to `value`.
-     *
-     * @private
-     * @name set
-     * @memberOf Stack
-     * @param {string} key The key of the value to set.
-     * @param {*} value The value to set.
-     * @returns {Object} Returns the stack cache instance.
-     */
-    function stackSet(key, value) {
-      var data = this.__data__,
-          array = data.array;
-
-      if (array) {
-        if (array.length < (LARGE_ARRAY_SIZE - 1)) {
-          assocSet(array, key, value);
-        } else {
-          data.array = null;
-          data.map = new MapCache(array);
-        }
-      }
-      var map = data.map;
-      if (map) {
-        map.set(key, value);
-      }
-      return this;
-    }
-
-    // Add methods to `Stack`.
-    Stack.prototype.clear = stackClear;
-    Stack.prototype['delete'] = stackDelete;
-    Stack.prototype.get = stackGet;
-    Stack.prototype.has = stackHas;
-    Stack.prototype.set = stackSet;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Removes `key` and its value from the associative array.
-     *
-     * @private
-     * @param {Array} array The array to modify.
-     * @param {string} key The key of the value to remove.
-     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
-     */
-    function assocDelete(array, key) {
-      var index = assocIndexOf(array, key);
-      if (index < 0) {
-        return false;
-      }
-      var lastIndex = array.length - 1;
-      if (index == lastIndex) {
-        array.pop();
-      } else {
-        splice.call(array, index, 1);
-      }
-      return true;
-    }
-
-    /**
-     * Gets the associative array value for `key`.
-     *
-     * @private
-     * @param {Array} array The array to query.
-     * @param {string} key The key of the value to get.
-     * @returns {*} Returns the entry value.
-     */
-    function assocGet(array, key) {
-      var index = assocIndexOf(array, key);
-      return index < 0 ? undefined : array[index][1];
-    }
-
-    /**
-     * Checks if an associative array value for `key` exists.
-     *
-     * @private
-     * @param {Array} array The array to query.
-     * @param {string} key The key of the entry to check.
-     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
-     */
-    function assocHas(array, key) {
-      return assocIndexOf(array, key) > -1;
-    }
-
-    /**
-     * Gets the index at which the `key` is found in `array` of key-value pairs.
-     *
-     * @private
-     * @param {Array} array The array to search.
-     * @param {*} key The key to search for.
-     * @returns {number} Returns the index of the matched value, else `-1`.
-     */
-    function assocIndexOf(array, key) {
-      var length = array.length;
-      while (length--) {
-        if (eq(array[length][0], key)) {
-          return length;
-        }
-      }
-      return -1;
-    }
-
-    /**
-     * Sets the associative array `key` to `value`.
-     *
-     * @private
-     * @param {Array} array The array to modify.
-     * @param {string} key The key of the value to set.
-     * @param {*} value The value to set.
-     */
-    function assocSet(array, key, value) {
-      var index = assocIndexOf(array, key);
-      if (index < 0) {
-        array.push([key, value]);
-      } else {
-        array[index][1] = value;
-      }
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Used by `_.defaults` to customize its `_.assignIn` use.
-     *
-     * @private
-     * @param {*} objValue The destination value.
-     * @param {*} srcValue The source value.
-     * @param {string} key The key of the property to assign.
-     * @param {Object} object The parent object of `objValue`.
-     * @returns {*} Returns the value to assign.
-     */
-    function assignInDefaults(objValue, srcValue, key, object) {
-      if (objValue === undefined ||
-          (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
-        return srcValue;
-      }
-      return objValue;
-    }
-
-    /**
-     * This function is like `assignValue` except that it doesn't assign
-     * `undefined` values.
-     *
-     * @private
-     * @param {Object} object The object to modify.
-     * @param {string} key The key of the property to assign.
-     * @param {*} value The value to assign.
-     */
-    function assignMergeValue(object, key, value) {
-      if ((value !== undefined && !eq(object[key], value)) ||
-          (typeof key == 'number' && value === undefined && !(key in object))) {
-        object[key] = value;
-      }
-    }
-
-    /**
-     * Assigns `value` to `key` of `object` if the existing value is not equivalent
-     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons.
-     *
-     * @private
-     * @param {Object} object The object to modify.
-     * @param {string} key The key of the property to assign.
-     * @param {*} value The value to assign.
-     */
-    function assignValue(object, key, value) {
-      var objValue = object[key];
-      if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
-          (value === undefined && !(key in object))) {
-        object[key] = value;
-      }
-    }
-
-    /**
-     * Aggregates elements of `collection` on `accumulator` with keys transformed
-     * by `iteratee` and values set by `setter`.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} setter The function to set `accumulator` values.
-     * @param {Function} iteratee The iteratee to transform keys.
-     * @param {Object} accumulator The initial aggregated object.
-     * @returns {Function} Returns `accumulator`.
-     */
-    function baseAggregator(collection, setter, iteratee, accumulator) {
-      baseEach(collection, function(value, key, collection) {
-        setter(accumulator, value, iteratee(value), collection);
-      });
-      return accumulator;
-    }
-
-    /**
-     * The base implementation of `_.assign` without support for multiple sources
-     * or `customizer` functions.
-     *
-     * @private
-     * @param {Object} object The destination object.
-     * @param {Object} source The source object.
-     * @returns {Object} Returns `object`.
-     */
-    function baseAssign(object, source) {
-      return object && copyObject(source, keys(source), object);
-    }
-
-    /**
-     * The base implementation of `_.at` without support for individual paths.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {string[]} paths The property paths of elements to pick.
-     * @returns {Array} Returns the new array of picked elements.
-     */
-    function baseAt(object, paths) {
-      var index = -1,
-          isNil = object == null,
-          length = paths.length,
-          result = Array(length);
-
-      while (++index < length) {
-        result[index] = isNil ? undefined : get(object, paths[index]);
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.clamp` which doesn't coerce arguments to numbers.
-     *
-     * @private
-     * @param {number} number The number to clamp.
-     * @param {number} [lower] The lower bound.
-     * @param {number} upper The upper bound.
-     * @returns {number} Returns the clamped number.
-     */
-    function baseClamp(number, lower, upper) {
-      if (number === number) {
-        if (upper !== undefined) {
-          number = number <= upper ? number : upper;
-        }
-        if (lower !== undefined) {
-          number = number >= lower ? number : lower;
-        }
-      }
-      return number;
-    }
-
-    /**
-     * The base implementation of `_.clone` and `_.cloneDeep` which tracks
-     * traversed objects.
-     *
-     * @private
-     * @param {*} value The value to clone.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @param {boolean} [isFull] Specify a clone including symbols.
-     * @param {Function} [customizer] The function to customize cloning.
-     * @param {string} [key] The key of `value`.
-     * @param {Object} [object] The parent object of `value`.
-     * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
-     * @returns {*} Returns the cloned value.
-     */
-    function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
-      var result;
-      if (customizer) {
-        result = object ? customizer(value, key, object, stack) : customizer(value);
-      }
-      if (result !== undefined) {
-        return result;
-      }
-      if (!isObject(value)) {
-        return value;
-      }
-      var isArr = isArray(value);
-      if (isArr) {
-        result = initCloneArray(value);
-        if (!isDeep) {
-          return copyArray(value, result);
-        }
-      } else {
-        var tag = getTag(value),
-            isFunc = tag == funcTag || tag == genTag;
-
-        if (isBuffer(value)) {
-          return cloneBuffer(value, isDeep);
-        }
-        if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
-          if (isHostObject(value)) {
-            return object ? value : {};
-          }
-          result = initCloneObject(isFunc ? {} : value);
-          if (!isDeep) {
-            return copySymbols(value, baseAssign(result, value));
-          }
-        } else {
-          if (!cloneableTags[tag]) {
-            return object ? value : {};
-          }
-          result = initCloneByTag(value, tag, baseClone, isDeep);
-        }
-      }
-      // Check for circular references and return its corresponding clone.
-      stack || (stack = new Stack);
-      var stacked = stack.get(value);
-      if (stacked) {
-        return stacked;
-      }
-      stack.set(value, result);
-
-      if (!isArr) {
-        var props = isFull ? getAllKeys(value) : keys(value);
-      }
-      // Recursively populate clone (susceptible to call stack limits).
-      arrayEach(props || value, function(subValue, key) {
-        if (props) {
-          key = subValue;
-          subValue = value[key];
-        }
-        assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
-      });
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.conforms` which doesn't clone `source`.
-     *
-     * @private
-     * @param {Object} source The object of property predicates to conform to.
-     * @returns {Function} Returns the new function.
-     */
-    function baseConforms(source) {
-      var props = keys(source),
-          length = props.length;
-
-      return function(object) {
-        if (object == null) {
-          return !length;
-        }
-        var index = length;
-        while (index--) {
-          var key = props[index],
-              predicate = source[key],
-              value = object[key];
-
-          if ((value === undefined &&
-              !(key in Object(object))) || !predicate(value)) {
-            return false;
-          }
-        }
-        return true;
-      };
-    }
-
-    /**
-     * The base implementation of `_.create` without support for assigning
-     * properties to the created object.
-     *
-     * @private
-     * @param {Object} prototype The object to inherit from.
-     * @returns {Object} Returns the new object.
-     */
-    function baseCreate(proto) {
-      return isObject(proto) ? objectCreate(proto) : {};
-    }
-
-    /**
-     * The base implementation of `_.delay` and `_.defer` which accepts an array
-     * of `func` arguments.
-     *
-     * @private
-     * @param {Function} func The function to delay.
-     * @param {number} wait The number of milliseconds to delay invocation.
-     * @param {Object} args The arguments to provide to `func`.
-     * @returns {number} Returns the timer id.
-     */
-    function baseDelay(func, wait, args) {
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      return setTimeout(function() { func.apply(undefined, args); }, wait);
-    }
-
-    /**
-     * The base implementation of methods like `_.difference` without support
-     * for excluding multiple arrays or iteratee shorthands.
-     *
-     * @private
-     * @param {Array} array The array to inspect.
-     * @param {Array} values The values to exclude.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of filtered values.
-     */
-    function baseDifference(array, values, iteratee, comparator) {
-      var index = -1,
-          includes = arrayIncludes,
-          isCommon = true,
-          length = array.length,
-          result = [],
-          valuesLength = values.length;
-
-      if (!length) {
-        return result;
-      }
-      if (iteratee) {
-        values = arrayMap(values, baseUnary(iteratee));
-      }
-      if (comparator) {
-        includes = arrayIncludesWith;
-        isCommon = false;
-      }
-      else if (values.length >= LARGE_ARRAY_SIZE) {
-        includes = cacheHas;
-        isCommon = false;
-        values = new SetCache(values);
-      }
-      outer:
-      while (++index < length) {
-        var value = array[index],
-            computed = iteratee ? iteratee(value) : value;
-
-        value = (comparator || value !== 0) ? value : 0;
-        if (isCommon && computed === computed) {
-          var valuesIndex = valuesLength;
-          while (valuesIndex--) {
-            if (values[valuesIndex] === computed) {
-              continue outer;
-            }
-          }
-          result.push(value);
-        }
-        else if (!includes(values, computed, comparator)) {
-          result.push(value);
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.forEach` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @returns {Array|Object} Returns `collection`.
-     */
-    var baseEach = createBaseEach(baseForOwn);
-
-    /**
-     * The base implementation of `_.forEachRight` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @returns {Array|Object} Returns `collection`.
-     */
-    var baseEachRight = createBaseEach(baseForOwnRight, true);
-
-    /**
-     * The base implementation of `_.every` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} predicate The function invoked per iteration.
-     * @returns {boolean} Returns `true` if all elements pass the predicate check,
-     *  else `false`
-     */
-    function baseEvery(collection, predicate) {
-      var result = true;
-      baseEach(collection, function(value, index, collection) {
-        result = !!predicate(value, index, collection);
-        return result;
-      });
-      return result;
-    }
-
-    /**
-     * The base implementation of methods like `_.max` and `_.min` which accepts a
-     * `comparator` to determine the extremum value.
-     *
-     * @private
-     * @param {Array} array The array to iterate over.
-     * @param {Function} iteratee The iteratee invoked per iteration.
-     * @param {Function} comparator The comparator used to compare values.
-     * @returns {*} Returns the extremum value.
-     */
-    function baseExtremum(array, iteratee, comparator) {
-      var index = -1,
-          length = array.length;
-
-      while (++index < length) {
-        var value = array[index],
-            current = iteratee(value);
-
-        if (current != null && (computed === undefined
-              ? (current === current && !isSymbol(current))
-              : comparator(current, computed)
-            )) {
-          var computed = current,
-              result = value;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.fill` without an iteratee call guard.
-     *
-     * @private
-     * @param {Array} array The array to fill.
-     * @param {*} value The value to fill `array` with.
-     * @param {number} [start=0] The start position.
-     * @param {number} [end=array.length] The end position.
-     * @returns {Array} Returns `array`.
-     */
-    function baseFill(array, value, start, end) {
-      var length = array.length;
-
-      start = toInteger(start);
-      if (start < 0) {
-        start = -start > length ? 0 : (length + start);
-      }
-      end = (end === undefined || end > length) ? length : toInteger(end);
-      if (end < 0) {
-        end += length;
-      }
-      end = start > end ? 0 : toLength(end);
-      while (start < end) {
-        array[start++] = value;
-      }
-      return array;
-    }
-
-    /**
-     * The base implementation of `_.filter` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} predicate The function invoked per iteration.
-     * @returns {Array} Returns the new filtered array.
-     */
-    function baseFilter(collection, predicate) {
-      var result = [];
-      baseEach(collection, function(value, index, collection) {
-        if (predicate(value, index, collection)) {
-          result.push(value);
-        }
-      });
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.flatten` with support for restricting flattening.
-     *
-     * @private
-     * @param {Array} array The array to flatten.
-     * @param {number} depth The maximum recursion depth.
-     * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
-     * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
-     * @param {Array} [result=[]] The initial result value.
-     * @returns {Array} Returns the new flattened array.
-     */
-    function baseFlatten(array, depth, predicate, isStrict, result) {
-      var index = -1,
-          length = array.length;
-
-      predicate || (predicate = isFlattenable);
-      result || (result = []);
-
-      while (++index < length) {
-        var value = array[index];
-        if (depth > 0 && predicate(value)) {
-          if (depth > 1) {
-            // Recursively flatten arrays (susceptible to call stack limits).
-            baseFlatten(value, depth - 1, predicate, isStrict, result);
-          } else {
-            arrayPush(result, value);
-          }
-        } else if (!isStrict) {
-          result[result.length] = value;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `baseForOwn` which iterates over `object`
-     * properties returned by `keysFunc` and invokes `iteratee` for each property.
-     * Iteratee functions may exit iteration early by explicitly returning `false`.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @param {Function} keysFunc The function to get the keys of `object`.
-     * @returns {Object} Returns `object`.
-     */
-    var baseFor = createBaseFor();
-
-    /**
-     * This function is like `baseFor` except that it iterates over properties
-     * in the opposite order.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @param {Function} keysFunc The function to get the keys of `object`.
-     * @returns {Object} Returns `object`.
-     */
-    var baseForRight = createBaseFor(true);
-
-    /**
-     * The base implementation of `_.forOwn` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     */
-    function baseForOwn(object, iteratee) {
-      return object && baseFor(object, iteratee, keys);
-    }
-
-    /**
-     * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     */
-    function baseForOwnRight(object, iteratee) {
-      return object && baseForRight(object, iteratee, keys);
-    }
-
-    /**
-     * The base implementation of `_.functions` which creates an array of
-     * `object` function property names filtered from `props`.
-     *
-     * @private
-     * @param {Object} object The object to inspect.
-     * @param {Array} props The property names to filter.
-     * @returns {Array} Returns the new array of filtered property names.
-     */
-    function baseFunctions(object, props) {
-      return arrayFilter(props, function(key) {
-        return isFunction(object[key]);
-      });
-    }
-
-    /**
-     * The base implementation of `_.get` without support for default values.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the property to get.
-     * @returns {*} Returns the resolved value.
-     */
-    function baseGet(object, path) {
-      path = isKey(path, object) ? [path] : castPath(path);
-
-      var index = 0,
-          length = path.length;
-
-      while (object != null && index < length) {
-        object = object[toKey(path[index++])];
-      }
-      return (index && index == length) ? object : undefined;
-    }
-
-    /**
-     * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
-     * `keysFunc` and `symbolsFunc` to get the enumerable property names and
-     * symbols of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Function} keysFunc The function to get the keys of `object`.
-     * @param {Function} symbolsFunc The function to get the symbols of `object`.
-     * @returns {Array} Returns the array of property names and symbols.
-     */
-    function baseGetAllKeys(object, keysFunc, symbolsFunc) {
-      var result = keysFunc(object);
-      return isArray(object)
-        ? result
-        : arrayPush(result, symbolsFunc(object));
-    }
-
-    /**
-     * The base implementation of `_.gt` which doesn't coerce arguments to numbers.
-     *
-     * @private
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is greater than `other`,
-     *  else `false`.
-     */
-    function baseGt(value, other) {
-      return value > other;
-    }
-
-    /**
-     * The base implementation of `_.has` without support for deep paths.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} key The key to check.
-     * @returns {boolean} Returns `true` if `key` exists, else `false`.
-     */
-    function baseHas(object, key) {
-      // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
-      // that are composed entirely of index properties, return `false` for
-      // `hasOwnProperty` checks of them.
-      return hasOwnProperty.call(object, key) ||
-        (typeof object == 'object' && key in object && getPrototype(object) === null);
-    }
-
-    /**
-     * The base implementation of `_.hasIn` without support for deep paths.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} key The key to check.
-     * @returns {boolean} Returns `true` if `key` exists, else `false`.
-     */
-    function baseHasIn(object, key) {
-      return key in Object(object);
-    }
-
-    /**
-     * The base implementation of `_.inRange` which doesn't coerce arguments to numbers.
-     *
-     * @private
-     * @param {number} number The number to check.
-     * @param {number} start The start of the range.
-     * @param {number} end The end of the range.
-     * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
-     */
-    function baseInRange(number, start, end) {
-      return number >= nativeMin(start, end) && number < nativeMax(start, end);
-    }
-
-    /**
-     * The base implementation of methods like `_.intersection`, without support
-     * for iteratee shorthands, that accepts an array of arrays to inspect.
-     *
-     * @private
-     * @param {Array} arrays The arrays to inspect.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of shared values.
-     */
-    function baseIntersection(arrays, iteratee, comparator) {
-      var includes = comparator ? arrayIncludesWith : arrayIncludes,
-          length = arrays[0].length,
-          othLength = arrays.length,
-          othIndex = othLength,
-          caches = Array(othLength),
-          maxLength = Infinity,
-          result = [];
-
-      while (othIndex--) {
-        var array = arrays[othIndex];
-        if (othIndex && iteratee) {
-          array = arrayMap(array, baseUnary(iteratee));
-        }
-        maxLength = nativeMin(array.length, maxLength);
-        caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
-          ? new SetCache(othIndex && array)
-          : undefined;
-      }
-      array = arrays[0];
-
-      var index = -1,
-          seen = caches[0];
-
-      outer:
-      while (++index < length && result.length < maxLength) {
-        var value = array[index],
-            computed = iteratee ? iteratee(value) : value;
-
-        value = (comparator || value !== 0) ? value : 0;
-        if (!(seen
-              ? cacheHas(seen, computed)
-              : includes(result, computed, comparator)
-            )) {
-          othIndex = othLength;
-          while (--othIndex) {
-            var cache = caches[othIndex];
-            if (!(cache
-                  ? cacheHas(cache, computed)
-                  : includes(arrays[othIndex], computed, comparator))
-                ) {
-              continue outer;
-            }
-          }
-          if (seen) {
-            seen.push(computed);
-          }
-          result.push(value);
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.invert` and `_.invertBy` which inverts
-     * `object` with values transformed by `iteratee` and set by `setter`.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {Function} setter The function to set `accumulator` values.
-     * @param {Function} iteratee The iteratee to transform values.
-     * @param {Object} accumulator The initial inverted object.
-     * @returns {Function} Returns `accumulator`.
-     */
-    function baseInverter(object, setter, iteratee, accumulator) {
-      baseForOwn(object, function(value, key, object) {
-        setter(accumulator, iteratee(value), key, object);
-      });
-      return accumulator;
-    }
-
-    /**
-     * The base implementation of `_.invoke` without support for individual
-     * method arguments.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the method to invoke.
-     * @param {Array} args The arguments to invoke the method with.
-     * @returns {*} Returns the result of the invoked method.
-     */
-    function baseInvoke(object, path, args) {
-      if (!isKey(path, object)) {
-        path = castPath(path);
-        object = parent(object, path);
-        path = last(path);
-      }
-      var func = object == null ? object : object[toKey(path)];
-      return func == null ? undefined : apply(func, object, args);
-    }
-
-    /**
-     * The base implementation of `_.isEqual` which supports partial comparisons
-     * and tracks traversed objects.
-     *
-     * @private
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @param {Function} [customizer] The function to customize comparisons.
-     * @param {boolean} [bitmask] The bitmask of comparison flags.
-     *  The bitmask may be composed of the following flags:
-     *     1 - Unordered comparison
-     *     2 - Partial comparison
-     * @param {Object} [stack] Tracks traversed `value` and `other` objects.
-     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
-     */
-    function baseIsEqual(value, other, customizer, bitmask, stack) {
-      if (value === other) {
-        return true;
-      }
-      if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
-        return value !== value && other !== other;
-      }
-      return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
-    }
-
-    /**
-     * A specialized version of `baseIsEqual` for arrays and objects which performs
-     * deep comparisons and tracks traversed objects enabling objects with circular
-     * references to be compared.
-     *
-     * @private
-     * @param {Object} object The object to compare.
-     * @param {Object} other The other object to compare.
-     * @param {Function} equalFunc The function to determine equivalents of values.
-     * @param {Function} [customizer] The function to customize comparisons.
-     * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
-     *  for more details.
-     * @param {Object} [stack] Tracks traversed `object` and `other` objects.
-     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
-     */
-    function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
-      var objIsArr = isArray(object),
-          othIsArr = isArray(other),
-          objTag = arrayTag,
-          othTag = arrayTag;
-
-      if (!objIsArr) {
-        objTag = getTag(object);
-        objTag = objTag == argsTag ? objectTag : objTag;
-      }
-      if (!othIsArr) {
-        othTag = getTag(other);
-        othTag = othTag == argsTag ? objectTag : othTag;
-      }
-      var objIsObj = objTag == objectTag && !isHostObject(object),
-          othIsObj = othTag == objectTag && !isHostObject(other),
-          isSameTag = objTag == othTag;
-
-      if (isSameTag && !objIsObj) {
-        stack || (stack = new Stack);
-        return (objIsArr || isTypedArray(object))
-          ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)
-          : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
-      }
-      if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
-        var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
-            othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
-
-        if (objIsWrapped || othIsWrapped) {
-          var objUnwrapped = objIsWrapped ? object.value() : object,
-              othUnwrapped = othIsWrapped ? other.value() : other;
-
-          stack || (stack = new Stack);
-          return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
-        }
-      }
-      if (!isSameTag) {
-        return false;
-      }
-      stack || (stack = new Stack);
-      return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
-    }
-
-    /**
-     * The base implementation of `_.isMatch` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Object} object The object to inspect.
-     * @param {Object} source The object of property values to match.
-     * @param {Array} matchData The property names, values, and compare flags to match.
-     * @param {Function} [customizer] The function to customize comparisons.
-     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
-     */
-    function baseIsMatch(object, source, matchData, customizer) {
-      var index = matchData.length,
-          length = index,
-          noCustomizer = !customizer;
-
-      if (object == null) {
-        return !length;
-      }
-      object = Object(object);
-      while (index--) {
-        var data = matchData[index];
-        if ((noCustomizer && data[2])
-              ? data[1] !== object[data[0]]
-              : !(data[0] in object)
-            ) {
-          return false;
-        }
-      }
-      while (++index < length) {
-        data = matchData[index];
-        var key = data[0],
-            objValue = object[key],
-            srcValue = data[1];
-
-        if (noCustomizer && data[2]) {
-          if (objValue === undefined && !(key in object)) {
-            return false;
-          }
-        } else {
-          var stack = new Stack;
-          if (customizer) {
-            var result = customizer(objValue, srcValue, key, object, source, stack);
-          }
-          if (!(result === undefined
-                ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)
-                : result
-              )) {
-            return false;
-          }
-        }
-      }
-      return true;
-    }
-
-    /**
-     * The base implementation of `_.iteratee`.
-     *
-     * @private
-     * @param {*} [value=_.identity] The value to convert to an iteratee.
-     * @returns {Function} Returns the iteratee.
-     */
-    function baseIteratee(value) {
-      // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
-      // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
-      if (typeof value == 'function') {
-        return value;
-      }
-      if (value == null) {
-        return identity;
-      }
-      if (typeof value == 'object') {
-        return isArray(value)
-          ? baseMatchesProperty(value[0], value[1])
-          : baseMatches(value);
-      }
-      return property(value);
-    }
-
-    /**
-     * The base implementation of `_.keys` which doesn't skip the constructor
-     * property of prototypes or treat sparse arrays as dense.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names.
-     */
-    function baseKeys(object) {
-      return nativeKeys(Object(object));
-    }
-
-    /**
-     * The base implementation of `_.keysIn` which doesn't skip the constructor
-     * property of prototypes or treat sparse arrays as dense.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names.
-     */
-    function baseKeysIn(object) {
-      object = object == null ? object : Object(object);
-
-      var result = [];
-      for (var key in object) {
-        result.push(key);
-      }
-      return result;
-    }
-
-    // Fallback for IE < 9 with es6-shim.
-    if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
-      baseKeysIn = function(object) {
-        return iteratorToArray(enumerate(object));
-      };
-    }
-
-    /**
-     * The base implementation of `_.lt` which doesn't coerce arguments to numbers.
-     *
-     * @private
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is less than `other`,
-     *  else `false`.
-     */
-    function baseLt(value, other) {
-      return value < other;
-    }
-
-    /**
-     * The base implementation of `_.map` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @returns {Array} Returns the new mapped array.
-     */
-    function baseMap(collection, iteratee) {
-      var index = -1,
-          result = isArrayLike(collection) ? Array(collection.length) : [];
-
-      baseEach(collection, function(value, key, collection) {
-        result[++index] = iteratee(value, key, collection);
-      });
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.matches` which doesn't clone `source`.
-     *
-     * @private
-     * @param {Object} source The object of property values to match.
-     * @returns {Function} Returns the new function.
-     */
-    function baseMatches(source) {
-      var matchData = getMatchData(source);
-      if (matchData.length == 1 && matchData[0][2]) {
-        return matchesStrictComparable(matchData[0][0], matchData[0][1]);
-      }
-      return function(object) {
-        return object === source || baseIsMatch(object, source, matchData);
-      };
-    }
-
-    /**
-     * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
-     *
-     * @private
-     * @param {string} path The path of the property to get.
-     * @param {*} srcValue The value to match.
-     * @returns {Function} Returns the new function.
-     */
-    function baseMatchesProperty(path, srcValue) {
-      if (isKey(path) && isStrictComparable(srcValue)) {
-        return matchesStrictComparable(toKey(path), srcValue);
-      }
-      return function(object) {
-        var objValue = get(object, path);
-        return (objValue === undefined && objValue === srcValue)
-          ? hasIn(object, path)
-          : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
-      };
-    }
-
-    /**
-     * The base implementation of `_.merge` without support for multiple sources.
-     *
-     * @private
-     * @param {Object} object The destination object.
-     * @param {Object} source The source object.
-     * @param {number} srcIndex The index of `source`.
-     * @param {Function} [customizer] The function to customize merged values.
-     * @param {Object} [stack] Tracks traversed source values and their merged
-     *  counterparts.
-     */
-    function baseMerge(object, source, srcIndex, customizer, stack) {
-      if (object === source) {
-        return;
-      }
-      if (!(isArray(source) || isTypedArray(source))) {
-        var props = keysIn(source);
-      }
-      arrayEach(props || source, function(srcValue, key) {
-        if (props) {
-          key = srcValue;
-          srcValue = source[key];
-        }
-        if (isObject(srcValue)) {
-          stack || (stack = new Stack);
-          baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
-        }
-        else {
-          var newValue = customizer
-            ? customizer(object[key], srcValue, (key + ''), object, source, stack)
-            : undefined;
-
-          if (newValue === undefined) {
-            newValue = srcValue;
-          }
-          assignMergeValue(object, key, newValue);
-        }
-      });
-    }
-
-    /**
-     * A specialized version of `baseMerge` for arrays and objects which performs
-     * deep merges and tracks traversed objects enabling objects with circular
-     * references to be merged.
-     *
-     * @private
-     * @param {Object} object The destination object.
-     * @param {Object} source The source object.
-     * @param {string} key The key of the value to merge.
-     * @param {number} srcIndex The index of `source`.
-     * @param {Function} mergeFunc The function to merge values.
-     * @param {Function} [customizer] The function to customize assigned values.
-     * @param {Object} [stack] Tracks traversed source values and their merged
-     *  counterparts.
-     */
-    function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
-      var objValue = object[key],
-          srcValue = source[key],
-          stacked = stack.get(srcValue);
-
-      if (stacked) {
-        assignMergeValue(object, key, stacked);
-        return;
-      }
-      var newValue = customizer
-        ? customizer(objValue, srcValue, (key + ''), object, source, stack)
-        : undefined;
-
-      var isCommon = newValue === undefined;
-
-      if (isCommon) {
-        newValue = srcValue;
-        if (isArray(srcValue) || isTypedArray(srcValue)) {
-          if (isArray(objValue)) {
-            newValue = objValue;
-          }
-          else if (isArrayLikeObject(objValue)) {
-            newValue = copyArray(objValue);
-          }
-          else {
-            isCommon = false;
-            newValue = baseClone(srcValue, true);
-          }
-        }
-        else if (isPlainObject(srcValue) || isArguments(srcValue)) {
-          if (isArguments(objValue)) {
-            newValue = toPlainObject(objValue);
-          }
-          else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
-            isCommon = false;
-            newValue = baseClone(srcValue, true);
-          }
-          else {
-            newValue = objValue;
-          }
-        }
-        else {
-          isCommon = false;
-        }
-      }
-      stack.set(srcValue, newValue);
-
-      if (isCommon) {
-        // Recursively merge objects and arrays (susceptible to call stack limits).
-        mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
-      }
-      stack['delete'](srcValue);
-      assignMergeValue(object, key, newValue);
-    }
-
-    /**
-     * The base implementation of `_.nth` which doesn't coerce `n` to an integer.
-     *
-     * @private
-     * @param {Array} array The array to query.
-     * @param {number} n The index of the element to return.
-     * @returns {*} Returns the nth element of `array`.
-     */
-    function baseNth(array, n) {
-      var length = array.length;
-      if (!length) {
-        return;
-      }
-      n += n < 0 ? length : 0;
-      return isIndex(n, length) ? array[n] : undefined;
-    }
-
-    /**
-     * The base implementation of `_.orderBy` without param guards.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
-     * @param {string[]} orders The sort orders of `iteratees`.
-     * @returns {Array} Returns the new sorted array.
-     */
-    function baseOrderBy(collection, iteratees, orders) {
-      var index = -1;
-      iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
-
-      var result = baseMap(collection, function(value, key, collection) {
-        var criteria = arrayMap(iteratees, function(iteratee) {
-          return iteratee(value);
-        });
-        return { 'criteria': criteria, 'index': ++index, 'value': value };
-      });
-
-      return baseSortBy(result, function(object, other) {
-        return compareMultiple(object, other, orders);
-      });
-    }
-
-    /**
-     * The base implementation of `_.pick` without support for individual
-     * property identifiers.
-     *
-     * @private
-     * @param {Object} object The source object.
-     * @param {string[]} props The property identifiers to pick.
-     * @returns {Object} Returns the new object.
-     */
-    function basePick(object, props) {
-      object = Object(object);
-      return arrayReduce(props, function(result, key) {
-        if (key in object) {
-          result[key] = object[key];
-        }
-        return result;
-      }, {});
-    }
-
-    /**
-     * The base implementation of  `_.pickBy` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Object} object The source object.
-     * @param {Function} predicate The function invoked per property.
-     * @returns {Object} Returns the new object.
-     */
-    function basePickBy(object, predicate) {
-      var index = -1,
-          props = getAllKeysIn(object),
-          length = props.length,
-          result = {};
-
-      while (++index < length) {
-        var key = props[index],
-            value = object[key];
-
-        if (predicate(value, key)) {
-          result[key] = value;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.property` without support for deep paths.
-     *
-     * @private
-     * @param {string} key The key of the property to get.
-     * @returns {Function} Returns the new function.
-     */
-    function baseProperty(key) {
-      return function(object) {
-        return object == null ? undefined : object[key];
-      };
-    }
-
-    /**
-     * A specialized version of `baseProperty` which supports deep paths.
-     *
-     * @private
-     * @param {Array|string} path The path of the property to get.
-     * @returns {Function} Returns the new function.
-     */
-    function basePropertyDeep(path) {
-      return function(object) {
-        return baseGet(object, path);
-      };
-    }
-
-    /**
-     * The base implementation of `_.pullAllBy` without support for iteratee
-     * shorthands.
-     *
-     * @private
-     * @param {Array} array The array to modify.
-     * @param {Array} values The values to remove.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns `array`.
-     */
-    function basePullAll(array, values, iteratee, comparator) {
-      var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
-          index = -1,
-          length = values.length,
-          seen = array;
-
-      if (iteratee) {
-        seen = arrayMap(array, baseUnary(iteratee));
-      }
-      while (++index < length) {
-        var fromIndex = 0,
-            value = values[index],
-            computed = iteratee ? iteratee(value) : value;
-
-        while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
-          if (seen !== array) {
-            splice.call(seen, fromIndex, 1);
-          }
-          splice.call(array, fromIndex, 1);
-        }
-      }
-      return array;
-    }
-
-    /**
-     * The base implementation of `_.pullAt` without support for individual
-     * indexes or capturing the removed elements.
-     *
-     * @private
-     * @param {Array} array The array to modify.
-     * @param {number[]} indexes The indexes of elements to remove.
-     * @returns {Array} Returns `array`.
-     */
-    function basePullAt(array, indexes) {
-      var length = array ? indexes.length : 0,
-          lastIndex = length - 1;
-
-      while (length--) {
-        var index = indexes[length];
-        if (length == lastIndex || index !== previous) {
-          var previous = index;
-          if (isIndex(index)) {
-            splice.call(array, index, 1);
-          }
-          else if (!isKey(index, array)) {
-            var path = castPath(index),
-                object = parent(array, path);
-
-            if (object != null) {
-              delete object[toKey(last(path))];
-            }
-          }
-          else {
-            delete array[toKey(index)];
-          }
-        }
-      }
-      return array;
-    }
-
-    /**
-     * The base implementation of `_.random` without support for returning
-     * floating-point numbers.
-     *
-     * @private
-     * @param {number} lower The lower bound.
-     * @param {number} upper The upper bound.
-     * @returns {number} Returns the random number.
-     */
-    function baseRandom(lower, upper) {
-      return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
-    }
-
-    /**
-     * The base implementation of `_.range` and `_.rangeRight` which doesn't
-     * coerce arguments to numbers.
-     *
-     * @private
-     * @param {number} start The start of the range.
-     * @param {number} end The end of the range.
-     * @param {number} step The value to increment or decrement by.
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Array} Returns the new array of numbers.
-     */
-    function baseRange(start, end, step, fromRight) {
-      var index = -1,
-          length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
-          result = Array(length);
-
-      while (length--) {
-        result[fromRight ? length : ++index] = start;
-        start += step;
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.repeat` which doesn't coerce arguments.
-     *
-     * @private
-     * @param {string} string The string to repeat.
-     * @param {number} n The number of times to repeat the string.
-     * @returns {string} Returns the repeated string.
-     */
-    function baseRepeat(string, n) {
-      var result = '';
-      if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
-        return result;
-      }
-      // Leverage the exponentiation by squaring algorithm for a faster repeat.
-      // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
-      do {
-        if (n % 2) {
-          result += string;
-        }
-        n = nativeFloor(n / 2);
-        if (n) {
-          string += string;
-        }
-      } while (n);
-
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.set`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the property to set.
-     * @param {*} value The value to set.
-     * @param {Function} [customizer] The function to customize path creation.
-     * @returns {Object} Returns `object`.
-     */
-    function baseSet(object, path, value, customizer) {
-      path = isKey(path, object) ? [path] : castPath(path);
-
-      var index = -1,
-          length = path.length,
-          lastIndex = length - 1,
-          nested = object;
-
-      while (nested != null && ++index < length) {
-        var key = toKey(path[index]);
-        if (isObject(nested)) {
-          var newValue = value;
-          if (index != lastIndex) {
-            var objValue = nested[key];
-            newValue = customizer ? customizer(objValue, key, nested) : undefined;
-            if (newValue === undefined) {
-              newValue = objValue == null
-                ? (isIndex(path[index + 1]) ? [] : {})
-                : objValue;
-            }
-          }
-          assignValue(nested, key, newValue);
-        }
-        nested = nested[key];
-      }
-      return object;
-    }
-
-    /**
-     * The base implementation of `setData` without support for hot loop detection.
-     *
-     * @private
-     * @param {Function} func The function to associate metadata with.
-     * @param {*} data The metadata.
-     * @returns {Function} Returns `func`.
-     */
-    var baseSetData = !metaMap ? identity : function(func, data) {
-      metaMap.set(func, data);
-      return func;
-    };
-
-    /**
-     * The base implementation of `_.slice` without an iteratee call guard.
-     *
-     * @private
-     * @param {Array} array The array to slice.
-     * @param {number} [start=0] The start position.
-     * @param {number} [end=array.length] The end position.
-     * @returns {Array} Returns the slice of `array`.
-     */
-    function baseSlice(array, start, end) {
-      var index = -1,
-          length = array.length;
-
-      if (start < 0) {
-        start = -start > length ? 0 : (length + start);
-      }
-      end = end > length ? length : end;
-      if (end < 0) {
-        end += length;
-      }
-      length = start > end ? 0 : ((end - start) >>> 0);
-      start >>>= 0;
-
-      var result = Array(length);
-      while (++index < length) {
-        result[index] = array[index + start];
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.some` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} predicate The function invoked per iteration.
-     * @returns {boolean} Returns `true` if any element passes the predicate check,
-     *  else `false`.
-     */
-    function baseSome(collection, predicate) {
-      var result;
-
-      baseEach(collection, function(value, index, collection) {
-        result = predicate(value, index, collection);
-        return !result;
-      });
-      return !!result;
-    }
-
-    /**
-     * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
-     * performs a binary search of `array` to determine the index at which `value`
-     * should be inserted into `array` in order to maintain its sort order.
-     *
-     * @private
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @param {boolean} [retHighest] Specify returning the highest qualified index.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     */
-    function baseSortedIndex(array, value, retHighest) {
-      var low = 0,
-          high = array ? array.length : low;
-
-      if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
-        while (low < high) {
-          var mid = (low + high) >>> 1,
-              computed = array[mid];
-
-          if (computed !== null && !isSymbol(computed) &&
-              (retHighest ? (computed <= value) : (computed < value))) {
-            low = mid + 1;
-          } else {
-            high = mid;
-          }
-        }
-        return high;
-      }
-      return baseSortedIndexBy(array, value, identity, retHighest);
-    }
-
-    /**
-     * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
-     * which invokes `iteratee` for `value` and each element of `array` to compute
-     * their sort ranking. The iteratee is invoked with one argument; (value).
-     *
-     * @private
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @param {Function} iteratee The iteratee invoked per element.
-     * @param {boolean} [retHighest] Specify returning the highest qualified index.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     */
-    function baseSortedIndexBy(array, value, iteratee, retHighest) {
-      value = iteratee(value);
-
-      var low = 0,
-          high = array ? array.length : 0,
-          valIsNaN = value !== value,
-          valIsNull = value === null,
-          valIsSymbol = isSymbol(value),
-          valIsUndefined = value === undefined;
-
-      while (low < high) {
-        var mid = nativeFloor((low + high) / 2),
-            computed = iteratee(array[mid]),
-            othIsDefined = computed !== undefined,
-            othIsNull = computed === null,
-            othIsReflexive = computed === computed,
-            othIsSymbol = isSymbol(computed);
-
-        if (valIsNaN) {
-          var setLow = retHighest || othIsReflexive;
-        } else if (valIsUndefined) {
-          setLow = othIsReflexive && (retHighest || othIsDefined);
-        } else if (valIsNull) {
-          setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
-        } else if (valIsSymbol) {
-          setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
-        } else if (othIsNull || othIsSymbol) {
-          setLow = false;
-        } else {
-          setLow = retHighest ? (computed <= value) : (computed < value);
-        }
-        if (setLow) {
-          low = mid + 1;
-        } else {
-          high = mid;
-        }
-      }
-      return nativeMin(high, MAX_ARRAY_INDEX);
-    }
-
-    /**
-     * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
-     * support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array} array The array to inspect.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @returns {Array} Returns the new duplicate free array.
-     */
-    function baseSortedUniq(array, iteratee) {
-      var index = -1,
-          length = array.length,
-          resIndex = 0,
-          result = [];
-
-      while (++index < length) {
-        var value = array[index],
-            computed = iteratee ? iteratee(value) : value;
-
-        if (!index || !eq(computed, seen)) {
-          var seen = computed;
-          result[resIndex++] = value === 0 ? 0 : value;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.toNumber` which doesn't ensure correct
-     * conversions of binary, hexadecimal, or octal string values.
-     *
-     * @private
-     * @param {*} value The value to process.
-     * @returns {number} Returns the number.
-     */
-    function baseToNumber(value) {
-      if (typeof value == 'number') {
-        return value;
-      }
-      if (isSymbol(value)) {
-        return NAN;
-      }
-      return +value;
-    }
-
-    /**
-     * The base implementation of `_.toString` which doesn't convert nullish
-     * values to empty strings.
-     *
-     * @private
-     * @param {*} value The value to process.
-     * @returns {string} Returns the string.
-     */
-    function baseToString(value) {
-      // Exit early for strings to avoid a performance hit in some environments.
-      if (typeof value == 'string') {
-        return value;
-      }
-      if (isSymbol(value)) {
-        return symbolToString ? symbolToString.call(value) : '';
-      }
-      var result = (value + '');
-      return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
-    }
-
-    /**
-     * The base implementation of `_.uniqBy` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array} array The array to inspect.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new duplicate free array.
-     */
-    function baseUniq(array, iteratee, comparator) {
-      var index = -1,
-          includes = arrayIncludes,
-          length = array.length,
-          isCommon = true,
-          result = [],
-          seen = result;
-
-      if (comparator) {
-        isCommon = false;
-        includes = arrayIncludesWith;
-      }
-      else if (length >= LARGE_ARRAY_SIZE) {
-        var set = iteratee ? null : createSet(array);
-        if (set) {
-          return setToArray(set);
-        }
-        isCommon = false;
-        includes = cacheHas;
-        seen = new SetCache;
-      }
-      else {
-        seen = iteratee ? [] : result;
-      }
-      outer:
-      while (++index < length) {
-        var value = array[index],
-            computed = iteratee ? iteratee(value) : value;
-
-        value = (comparator || value !== 0) ? value : 0;
-        if (isCommon && computed === computed) {
-          var seenIndex = seen.length;
-          while (seenIndex--) {
-            if (seen[seenIndex] === computed) {
-              continue outer;
-            }
-          }
-          if (iteratee) {
-            seen.push(computed);
-          }
-          result.push(value);
-        }
-        else if (!includes(seen, computed, comparator)) {
-          if (seen !== result) {
-            seen.push(computed);
-          }
-          result.push(value);
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.unset`.
-     *
-     * @private
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to unset.
-     * @returns {boolean} Returns `true` if the property is deleted, else `false`.
-     */
-    function baseUnset(object, path) {
-      path = isKey(path, object) ? [path] : castPath(path);
-      object = parent(object, path);
-
-      var key = toKey(last(path));
-      return !(object != null && baseHas(object, key)) || delete object[key];
-    }
-
-    /**
-     * The base implementation of `_.update`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the property to update.
-     * @param {Function} updater The function to produce the updated value.
-     * @param {Function} [customizer] The function to customize path creation.
-     * @returns {Object} Returns `object`.
-     */
-    function baseUpdate(object, path, updater, customizer) {
-      return baseSet(object, path, updater(baseGet(object, path)), customizer);
-    }
-
-    /**
-     * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
-     * without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array} array The array to query.
-     * @param {Function} predicate The function invoked per iteration.
-     * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Array} Returns the slice of `array`.
-     */
-    function baseWhile(array, predicate, isDrop, fromRight) {
-      var length = array.length,
-          index = fromRight ? length : -1;
-
-      while ((fromRight ? index-- : ++index < length) &&
-        predicate(array[index], index, array)) {}
-
-      return isDrop
-        ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
-        : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
-    }
-
-    /**
-     * The base implementation of `wrapperValue` which returns the result of
-     * performing a sequence of actions on the unwrapped `value`, where each
-     * successive action is supplied the return value of the previous.
-     *
-     * @private
-     * @param {*} value The unwrapped value.
-     * @param {Array} actions Actions to perform to resolve the unwrapped value.
-     * @returns {*} Returns the resolved value.
-     */
-    function baseWrapperValue(value, actions) {
-      var result = value;
-      if (result instanceof LazyWrapper) {
-        result = result.value();
-      }
-      return arrayReduce(actions, function(result, action) {
-        return action.func.apply(action.thisArg, arrayPush([result], action.args));
-      }, result);
-    }
-
-    /**
-     * The base implementation of methods like `_.xor`, without support for
-     * iteratee shorthands, that accepts an array of arrays to inspect.
-     *
-     * @private
-     * @param {Array} arrays The arrays to inspect.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of values.
-     */
-    function baseXor(arrays, iteratee, comparator) {
-      var index = -1,
-          length = arrays.length;
-
-      while (++index < length) {
-        var result = result
-          ? arrayPush(
-              baseDifference(result, arrays[index], iteratee, comparator),
-              baseDifference(arrays[index], result, iteratee, comparator)
-            )
-          : arrays[index];
-      }
-      return (result && result.length) ? baseUniq(result, iteratee, comparator) : [];
-    }
-
-    /**
-     * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
-     *
-     * @private
-     * @param {Array} props The property identifiers.
-     * @param {Array} values The property values.
-     * @param {Function} assignFunc The function to assign values.
-     * @returns {Object} Returns the new object.
-     */
-    function baseZipObject(props, values, assignFunc) {
-      var index = -1,
-          length = props.length,
-          valsLength = values.length,
-          result = {};
-
-      while (++index < length) {
-        var value = index < valsLength ? values[index] : undefined;
-        assignFunc(result, props[index], value);
-      }
-      return result;
-    }
-
-    /**
-     * Casts `value` to an empty array if it's not an array like object.
-     *
-     * @private
-     * @param {*} value The value to inspect.
-     * @returns {Array|Object} Returns the cast array-like object.
-     */
-    function castArrayLikeObject(value) {
-      return isArrayLikeObject(value) ? value : [];
-    }
-
-    /**
-     * Casts `value` to `identity` if it's not a function.
-     *
-     * @private
-     * @param {*} value The value to inspect.
-     * @returns {Function} Returns cast function.
-     */
-    function castFunction(value) {
-      return typeof value == 'function' ? value : identity;
-    }
-
-    /**
-     * Casts `value` to a path array if it's not one.
-     *
-     * @private
-     * @param {*} value The value to inspect.
-     * @returns {Array} Returns the cast property path array.
-     */
-    function castPath(value) {
-      return isArray(value) ? value : stringToPath(value);
-    }
-
-    /**
-     * Casts `array` to a slice if it's needed.
-     *
-     * @private
-     * @param {Array} array The array to inspect.
-     * @param {number} start The start position.
-     * @param {number} [end=array.length] The end position.
-     * @returns {Array} Returns the cast slice.
-     */
-    function castSlice(array, start, end) {
-      var length = array.length;
-      end = end === undefined ? length : end;
-      return (!start && end >= length) ? array : baseSlice(array, start, end);
-    }
-
-    /**
-     * Creates a clone of  `buffer`.
-     *
-     * @private
-     * @param {Buffer} buffer The buffer to clone.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Buffer} Returns the cloned buffer.
-     */
-    function cloneBuffer(buffer, isDeep) {
-      if (isDeep) {
-        return buffer.slice();
-      }
-      var result = new buffer.constructor(buffer.length);
-      buffer.copy(result);
-      return result;
-    }
-
-    /**
-     * Creates a clone of `arrayBuffer`.
-     *
-     * @private
-     * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
-     * @returns {ArrayBuffer} Returns the cloned array buffer.
-     */
-    function cloneArrayBuffer(arrayBuffer) {
-      var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
-      new Uint8Array(result).set(new Uint8Array(arrayBuffer));
-      return result;
-    }
-
-    /**
-     * Creates a clone of `dataView`.
-     *
-     * @private
-     * @param {Object} dataView The data view to clone.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Object} Returns the cloned data view.
-     */
-    function cloneDataView(dataView, isDeep) {
-      var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
-      return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
-    }
-
-    /**
-     * Creates a clone of `map`.
-     *
-     * @private
-     * @param {Object} map The map to clone.
-     * @param {Function} cloneFunc The function to clone values.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Object} Returns the cloned map.
-     */
-    function cloneMap(map, isDeep, cloneFunc) {
-      var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
-      return arrayReduce(array, addMapEntry, new map.constructor);
-    }
-
-    /**
-     * Creates a clone of `regexp`.
-     *
-     * @private
-     * @param {Object} regexp The regexp to clone.
-     * @returns {Object} Returns the cloned regexp.
-     */
-    function cloneRegExp(regexp) {
-      var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
-      result.lastIndex = regexp.lastIndex;
-      return result;
-    }
-
-    /**
-     * Creates a clone of `set`.
-     *
-     * @private
-     * @param {Object} set The set to clone.
-     * @param {Function} cloneFunc The function to clone values.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Object} Returns the cloned set.
-     */
-    function cloneSet(set, isDeep, cloneFunc) {
-      var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
-      return arrayReduce(array, addSetEntry, new set.constructor);
-    }
-
-    /**
-     * Creates a clone of the `symbol` object.
-     *
-     * @private
-     * @param {Object} symbol The symbol object to clone.
-     * @returns {Object} Returns the cloned symbol object.
-     */
-    function cloneSymbol(symbol) {
-      return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
-    }
-
-    /**
-     * Creates a clone of `typedArray`.
-     *
-     * @private
-     * @param {Object} typedArray The typed array to clone.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Object} Returns the cloned typed array.
-     */
-    function cloneTypedArray(typedArray, isDeep) {
-      var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
-      return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
-    }
-
-    /**
-     * Compares values to sort them in ascending order.
-     *
-     * @private
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {number} Returns the sort order indicator for `value`.
-     */
-    function compareAscending(value, other) {
-      if (value !== other) {
-        var valIsDefined = value !== undefined,
-            valIsNull = value === null,
-            valIsReflexive = value === value,
-            valIsSymbol = isSymbol(value);
-
-        var othIsDefined = other !== undefined,
-            othIsNull = other === null,
-            othIsReflexive = other === other,
-            othIsSymbol = isSymbol(other);
-
-        if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
-            (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
-            (valIsNull && othIsDefined && othIsReflexive) ||
-            (!valIsDefined && othIsReflexive) ||
-            !valIsReflexive) {
-          return 1;
-        }
-        if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
-            (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
-            (othIsNull && valIsDefined && valIsReflexive) ||
-            (!othIsDefined && valIsReflexive) ||
-            !othIsReflexive) {
-          return -1;
-        }
-      }
-      return 0;
-    }
-
-    /**
-     * Used by `_.orderBy` to compare multiple properties of a value to another
-     * and stable sort them.
-     *
-     * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
-     * specify an order of "desc" for descending or "asc" for ascending sort order
-     * of corresponding values.
-     *
-     * @private
-     * @param {Object} object The object to compare.
-     * @param {Object} other The other object to compare.
-     * @param {boolean[]|string[]} orders The order to sort by for each property.
-     * @returns {number} Returns the sort order indicator for `object`.
-     */
-    function compareMultiple(object, other, orders) {
-      var index = -1,
-          objCriteria = object.criteria,
-          othCriteria = other.criteria,
-          length = objCriteria.length,
-          ordersLength = orders.length;
-
-      while (++index < length) {
-        var result = compareAscending(objCriteria[index], othCriteria[index]);
-        if (result) {
-          if (index >= ordersLength) {
-            return result;
-          }
-          var order = orders[index];
-          return result * (order == 'desc' ? -1 : 1);
-        }
-      }
-      // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
-      // that causes it, under certain circumstances, to provide the same value for
-      // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
-      // for more details.
-      //
-      // This also ensures a stable sort in V8 and other engines.
-      // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
-      return object.index - other.index;
-    }
-
-    /**
-     * Creates an array that is the composition of partially applied arguments,
-     * placeholders, and provided arguments into a single array of arguments.
-     *
-     * @private
-     * @param {Array|Object} args The provided arguments.
-     * @param {Array} partials The arguments to prepend to those provided.
-     * @param {Array} holders The `partials` placeholder indexes.
-     * @params {boolean} [isCurried] Specify composing for a curried function.
-     * @returns {Array} Returns the new array of composed arguments.
-     */
-    function composeArgs(args, partials, holders, isCurried) {
-      var argsIndex = -1,
-          argsLength = args.length,
-          holdersLength = holders.length,
-          leftIndex = -1,
-          leftLength = partials.length,
-          rangeLength = nativeMax(argsLength - holdersLength, 0),
-          result = Array(leftLength + rangeLength),
-          isUncurried = !isCurried;
-
-      while (++leftIndex < leftLength) {
-        result[leftIndex] = partials[leftIndex];
-      }
-      while (++argsIndex < holdersLength) {
-        if (isUncurried || argsIndex < argsLength) {
-          result[holders[argsIndex]] = args[argsIndex];
-        }
-      }
-      while (rangeLength--) {
-        result[leftIndex++] = args[argsIndex++];
-      }
-      return result;
-    }
-
-    /**
-     * This function is like `composeArgs` except that the arguments composition
-     * is tailored for `_.partialRight`.
-     *
-     * @private
-     * @param {Array|Object} args The provided arguments.
-     * @param {Array} partials The arguments to append to those provided.
-     * @param {Array} holders The `partials` placeholder indexes.
-     * @params {boolean} [isCurried] Specify composing for a curried function.
-     * @returns {Array} Returns the new array of composed arguments.
-     */
-    function composeArgsRight(args, partials, holders, isCurried) {
-      var argsIndex = -1,
-          argsLength = args.length,
-          holdersIndex = -1,
-          holdersLength = holders.length,
-          rightIndex = -1,
-          rightLength = partials.length,
-          rangeLength = nativeMax(argsLength - holdersLength, 0),
-          result = Array(rangeLength + rightLength),
-          isUncurried = !isCurried;
-
-      while (++argsIndex < rangeLength) {
-        result[argsIndex] = args[argsIndex];
-      }
-      var offset = argsIndex;
-      while (++rightIndex < rightLength) {
-        result[offset + rightIndex] = partials[rightIndex];
-      }
-      while (++holdersIndex < holdersLength) {
-        if (isUncurried || argsIndex < argsLength) {
-          result[offset + holders[holdersIndex]] = args[argsIndex++];
-        }
-      }
-      return result;
-    }
-
-    /**
-     * Copies the values of `source` to `array`.
-     *
-     * @private
-     * @param {Array} source The array to copy values from.
-     * @param {Array} [array=[]] The array to copy values to.
-     * @returns {Array} Returns `array`.
-     */
-    function copyArray(source, array) {
-      var index = -1,
-          length = source.length;
-
-      array || (array = Array(length));
-      while (++index < length) {
-        array[index] = source[index];
-      }
-      return array;
-    }
-
-    /**
-     * Copies properties of `source` to `object`.
-     *
-     * @private
-     * @param {Object} source The object to copy properties from.
-     * @param {Array} props The property identifiers to copy.
-     * @param {Object} [object={}] The object to copy properties to.
-     * @param {Function} [customizer] The function to customize copied values.
-     * @returns {Object} Returns `object`.
-     */
-    function copyObject(source, props, object, customizer) {
-      object || (object = {});
-
-      var index = -1,
-          length = props.length;
-
-      while (++index < length) {
-        var key = props[index];
-
-        var newValue = customizer
-          ? customizer(object[key], source[key], key, object, source)
-          : source[key];
-
-        assignValue(object, key, newValue);
-      }
-      return object;
-    }
-
-    /**
-     * Copies own symbol properties of `source` to `object`.
-     *
-     * @private
-     * @param {Object} source The object to copy symbols from.
-     * @param {Object} [object={}] The object to copy symbols to.
-     * @returns {Object} Returns `object`.
-     */
-    function copySymbols(source, object) {
-      return copyObject(source, getSymbols(source), object);
-    }
-
-    /**
-     * Creates a function like `_.groupBy`.
-     *
-     * @private
-     * @param {Function} setter The function to set accumulator values.
-     * @param {Function} [initializer] The accumulator object initializer.
-     * @returns {Function} Returns the new aggregator function.
-     */
-    function createAggregator(setter, initializer) {
-      return function(collection, iteratee) {
-        var func = isArray(collection) ? arrayAggregator : baseAggregator,
-            accumulator = initializer ? initializer() : {};
-
-        return func(collection, setter, getIteratee(iteratee), accumulator);
-      };
-    }
-
-    /**
-     * Creates a function like `_.assign`.
-     *
-     * @private
-     * @param {Function} assigner The function to assign values.
-     * @returns {Function} Returns the new assigner function.
-     */
-    function createAssigner(assigner) {
-      return rest(function(object, sources) {
-        var index = -1,
-            length = sources.length,
-            customizer = length > 1 ? sources[length - 1] : undefined,
-            guard = length > 2 ? sources[2] : undefined;
-
-        customizer = typeof customizer == 'function'
-          ? (length--, customizer)
-          : undefined;
-
-        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
-          customizer = length < 3 ? undefined : customizer;
-          length = 1;
-        }
-        object = Object(object);
-        while (++index < length) {
-          var source = sources[index];
-          if (source) {
-            assigner(object, source, index, customizer);
-          }
-        }
-        return object;
-      });
-    }
-
-    /**
-     * Creates a `baseEach` or `baseEachRight` function.
-     *
-     * @private
-     * @param {Function} eachFunc The function to iterate over a collection.
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Function} Returns the new base function.
-     */
-    function createBaseEach(eachFunc, fromRight) {
-      return function(collection, iteratee) {
-        if (collection == null) {
-          return collection;
-        }
-        if (!isArrayLike(collection)) {
-          return eachFunc(collection, iteratee);
-        }
-        var length = collection.length,
-            index = fromRight ? length : -1,
-            iterable = Object(collection);
-
-        while ((fromRight ? index-- : ++index < length)) {
-          if (iteratee(iterable[index], index, iterable) === false) {
-            break;
-          }
-        }
-        return collection;
-      };
-    }
-
-    /**
-     * Creates a base function for methods like `_.forIn` and `_.forOwn`.
-     *
-     * @private
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Function} Returns the new base function.
-     */
-    function createBaseFor(fromRight) {
-      return function(object, iteratee, keysFunc) {
-        var index = -1,
-            iterable = Object(object),
-            props = keysFunc(object),
-            length = props.length;
-
-        while (length--) {
-          var key = props[fromRight ? length : ++index];
-          if (iteratee(iterable[key], key, iterable) === false) {
-            break;
-          }
-        }
-        return object;
-      };
-    }
-
-    /**
-     * Creates a function that wraps `func` to invoke it with the optional `this`
-     * binding of `thisArg`.
-     *
-     * @private
-     * @param {Function} func The function to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
-     *  for more details.
-     * @param {*} [thisArg] The `this` binding of `func`.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createBaseWrapper(func, bitmask, thisArg) {
-      var isBind = bitmask & BIND_FLAG,
-          Ctor = createCtorWrapper(func);
-
-      function wrapper() {
-        var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
-        return fn.apply(isBind ? thisArg : this, arguments);
-      }
-      return wrapper;
-    }
-
-    /**
-     * Creates a function like `_.lowerFirst`.
-     *
-     * @private
-     * @param {string} methodName The name of the `String` case method to use.
-     * @returns {Function} Returns the new function.
-     */
-    function createCaseFirst(methodName) {
-      return function(string) {
-        string = toString(string);
-
-        var strSymbols = reHasComplexSymbol.test(string)
-          ? stringToArray(string)
-          : undefined;
-
-        var chr = strSymbols
-          ? strSymbols[0]
-          : string.charAt(0);
-
-        var trailing = strSymbols
-          ? castSlice(strSymbols, 1).join('')
-          : string.slice(1);
-
-        return chr[methodName]() + trailing;
-      };
-    }
-
-    /**
-     * Creates a function like `_.camelCase`.
-     *
-     * @private
-     * @param {Function} callback The function to combine each word.
-     * @returns {Function} Returns the new compounder function.
-     */
-    function createCompounder(callback) {
-      return function(string) {
-        return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
-      };
-    }
-
-    /**
-     * Creates a function that produces an instance of `Ctor` regardless of
-     * whether it was invoked as part of a `new` expression or by `call` or `apply`.
-     *
-     * @private
-     * @param {Function} Ctor The constructor to wrap.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createCtorWrapper(Ctor) {
-      return function() {
-        // Use a `switch` statement to work with class constructors. See
-        // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
-        // for more details.
-        var args = arguments;
-        switch (args.length) {
-          case 0: return new Ctor;
-          case 1: return new Ctor(args[0]);
-          case 2: return new Ctor(args[0], args[1]);
-          case 3: return new Ctor(args[0], args[1], args[2]);
-          case 4: return new Ctor(args[0], args[1], args[2], args[3]);
-          case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
-          case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
-          case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
-        }
-        var thisBinding = baseCreate(Ctor.prototype),
-            result = Ctor.apply(thisBinding, args);
-
-        // Mimic the constructor's `return` behavior.
-        // See https://es5.github.io/#x13.2.2 for more details.
-        return isObject(result) ? result : thisBinding;
-      };
-    }
-
-    /**
-     * Creates a function that wraps `func` to enable currying.
-     *
-     * @private
-     * @param {Function} func The function to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
-     *  for more details.
-     * @param {number} arity The arity of `func`.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createCurryWrapper(func, bitmask, arity) {
-      var Ctor = createCtorWrapper(func);
-
-      function wrapper() {
-        var length = arguments.length,
-            args = Array(length),
-            index = length,
-            placeholder = getPlaceholder(wrapper);
-
-        while (index--) {
-          args[index] = arguments[index];
-        }
-        var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
-          ? []
-          : replaceHolders(args, placeholder);
-
-        length -= holders.length;
-        if (length < arity) {
-          return createRecurryWrapper(
-            func, bitmask, createHybridWrapper, wrapper.placeholder, undefined,
-            args, holders, undefined, undefined, arity - length);
-        }
-        var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
-        return apply(fn, this, args);
-      }
-      return wrapper;
-    }
-
-    /**
-     * Creates a `_.flow` or `_.flowRight` function.
-     *
-     * @private
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Function} Returns the new flow function.
-     */
-    function createFlow(fromRight) {
-      return rest(function(funcs) {
-        funcs = baseFlatten(funcs, 1);
-
-        var length = funcs.length,
-            index = length,
-            prereq = LodashWrapper.prototype.thru;
-
-        if (fromRight) {
-          funcs.reverse();
-        }
-        while (index--) {
-          var func = funcs[index];
-          if (typeof func != 'function') {
-            throw new TypeError(FUNC_ERROR_TEXT);
-          }
-          if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
-            var wrapper = new LodashWrapper([], true);
-          }
-        }
-        index = wrapper ? index : length;
-        while (++index < length) {
-          func = funcs[index];
-
-          var funcName = getFuncName(func),
-              data = funcName == 'wrapper' ? getData(func) : undefined;
-
-          if (data && isLaziable(data[0]) &&
-                data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) &&
-                !data[4].length && data[9] == 1
-              ) {
-            wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
-          } else {
-            wrapper = (func.length == 1 && isLaziable(func))
-              ? wrapper[funcName]()
-              : wrapper.thru(func);
-          }
-        }
-        return function() {
-          var args = arguments,
-              value = args[0];
-
-          if (wrapper && args.length == 1 &&
-              isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
-            return wrapper.plant(value).value();
-          }
-          var index = 0,
-              result = length ? funcs[index].apply(this, args) : value;
-
-          while (++index < length) {
-            result = funcs[index].call(this, result);
-          }
-          return result;
-        };
-      });
-    }
-
-    /**
-     * Creates a function that wraps `func` to invoke it with optional `this`
-     * binding of `thisArg`, partial application, and currying.
-     *
-     * @private
-     * @param {Function|string} func The function or method name to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
-     *  for more details.
-     * @param {*} [thisArg] The `this` binding of `func`.
-     * @param {Array} [partials] The arguments to prepend to those provided to
-     *  the new function.
-     * @param {Array} [holders] The `partials` placeholder indexes.
-     * @param {Array} [partialsRight] The arguments to append to those provided
-     *  to the new function.
-     * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
-     * @param {Array} [argPos] The argument positions of the new function.
-     * @param {number} [ary] The arity cap of `func`.
-     * @param {number} [arity] The arity of `func`.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
-      var isAry = bitmask & ARY_FLAG,
-          isBind = bitmask & BIND_FLAG,
-          isBindKey = bitmask & BIND_KEY_FLAG,
-          isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG),
-          isFlip = bitmask & FLIP_FLAG,
-          Ctor = isBindKey ? undefined : createCtorWrapper(func);
-
-      function wrapper() {
-        var length = arguments.length,
-            index = length,
-            args = Array(length);
-
-        while (index--) {
-          args[index] = arguments[index];
-        }
-        if (isCurried) {
-          var placeholder = getPlaceholder(wrapper),
-              holdersCount = countHolders(args, placeholder);
-        }
-        if (partials) {
-          args = composeArgs(args, partials, holders, isCurried);
-        }
-        if (partialsRight) {
-          args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
-        }
-        length -= holdersCount;
-        if (isCurried && length < arity) {
-          var newHolders = replaceHolders(args, placeholder);
-          return createRecurryWrapper(
-            func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg,
-            args, newHolders, argPos, ary, arity - length
-          );
-        }
-        var thisBinding = isBind ? thisArg : this,
-            fn = isBindKey ? thisBinding[func] : func;
-
-        length = args.length;
-        if (argPos) {
-          args = reorder(args, argPos);
-        } else if (isFlip && length > 1) {
-          args.reverse();
-        }
-        if (isAry && ary < length) {
-          args.length = ary;
-        }
-        if (this && this !== root && this instanceof wrapper) {
-          fn = Ctor || createCtorWrapper(fn);
-        }
-        return fn.apply(thisBinding, args);
-      }
-      return wrapper;
-    }
-
-    /**
-     * Creates a function like `_.invertBy`.
-     *
-     * @private
-     * @param {Function} setter The function to set accumulator values.
-     * @param {Function} toIteratee The function to resolve iteratees.
-     * @returns {Function} Returns the new inverter function.
-     */
-    function createInverter(setter, toIteratee) {
-      return function(object, iteratee) {
-        return baseInverter(object, setter, toIteratee(iteratee), {});
-      };
-    }
-
-    /**
-     * Creates a function that performs a mathematical operation on two values.
-     *
-     * @private
-     * @param {Function} operator The function to perform the operation.
-     * @returns {Function} Returns the new mathematical operation function.
-     */
-    function createMathOperation(operator) {
-      return function(value, other) {
-        var result;
-        if (value === undefined && other === undefined) {
-          return 0;
-        }
-        if (value !== undefined) {
-          result = value;
-        }
-        if (other !== undefined) {
-          if (result === undefined) {
-            return other;
-          }
-          if (typeof value == 'string' || typeof other == 'string') {
-            value = baseToString(value);
-            other = baseToString(other);
-          } else {
-            value = baseToNumber(value);
-            other = baseToNumber(other);
-          }
-          result = operator(value, other);
-        }
-        return result;
-      };
-    }
-
-    /**
-     * Creates a function like `_.over`.
-     *
-     * @private
-     * @param {Function} arrayFunc The function to iterate over iteratees.
-     * @returns {Function} Returns the new invoker function.
-     */
-    function createOver(arrayFunc) {
-      return rest(function(iteratees) {
-        iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
-          ? arrayMap(iteratees[0], baseUnary(getIteratee()))
-          : arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseUnary(getIteratee()));
-
-        return rest(function(args) {
-          var thisArg = this;
-          return arrayFunc(iteratees, function(iteratee) {
-            return apply(iteratee, thisArg, args);
-          });
-        });
-      });
-    }
-
-    /**
-     * Creates the padding for `string` based on `length`. The `chars` string
-     * is truncated if the number of characters exceeds `length`.
-     *
-     * @private
-     * @param {number} length The padding length.
-     * @param {string} [chars=' '] The string used as padding.
-     * @returns {string} Returns the padding for `string`.
-     */
-    function createPadding(length, chars) {
-      chars = chars === undefined ? ' ' : baseToString(chars);
-
-      var charsLength = chars.length;
-      if (charsLength < 2) {
-        return charsLength ? baseRepeat(chars, length) : chars;
-      }
-      var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
-      return reHasComplexSymbol.test(chars)
-        ? castSlice(stringToArray(result), 0, length).join('')
-        : result.slice(0, length);
-    }
-
-    /**
-     * Creates a function that wraps `func` to invoke it with the `this` binding
-     * of `thisArg` and `partials` prepended to the arguments it receives.
-     *
-     * @private
-     * @param {Function} func The function to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
-     *  for more details.
-     * @param {*} thisArg The `this` binding of `func`.
-     * @param {Array} partials The arguments to prepend to those provided to
-     *  the new function.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createPartialWrapper(func, bitmask, thisArg, partials) {
-      var isBind = bitmask & BIND_FLAG,
-          Ctor = createCtorWrapper(func);
-
-      function wrapper() {
-        var argsIndex = -1,
-            argsLength = arguments.length,
-            leftIndex = -1,
-            leftLength = partials.length,
-            args = Array(leftLength + argsLength),
-            fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
-
-        while (++leftIndex < leftLength) {
-          args[leftIndex] = partials[leftIndex];
-        }
-        while (argsLength--) {
-          args[leftIndex++] = arguments[++argsIndex];
-        }
-        return apply(fn, isBind ? thisArg : this, args);
-      }
-      return wrapper;
-    }
-
-    /**
-     * Creates a `_.range` or `_.rangeRight` function.
-     *
-     * @private
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Function} Returns the new range function.
-     */
-    function createRange(fromRight) {
-      return function(start, end, step) {
-        if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
-          end = step = undefined;
-        }
-        // Ensure the sign of `-0` is preserved.
-        start = toNumber(start);
-        start = start === start ? start : 0;
-        if (end === undefined) {
-          end = start;
-          start = 0;
-        } else {
-          end = toNumber(end) || 0;
-        }
-        step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);
-        return baseRange(start, end, step, fromRight);
-      };
-    }
-
-    /**
-     * Creates a function that performs a relational operation on two values.
-     *
-     * @private
-     * @param {Function} operator The function to perform the operation.
-     * @returns {Function} Returns the new relational operation function.
-     */
-    function createRelationalOperation(operator) {
-      return function(value, other) {
-        if (!(typeof value == 'string' && typeof other == 'string')) {
-          value = toNumber(value);
-          other = toNumber(other);
-        }
-        return operator(value, other);
-      };
-    }
-
-    /**
-     * Creates a function that wraps `func` to continue currying.
-     *
-     * @private
-     * @param {Function} func The function to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
-     *  for more details.
-     * @param {Function} wrapFunc The function to create the `func` wrapper.
-     * @param {*} placeholder The placeholder value.
-     * @param {*} [thisArg] The `this` binding of `func`.
-     * @param {Array} [partials] The arguments to prepend to those provided to
-     *  the new function.
-     * @param {Array} [holders] The `partials` placeholder indexes.
-     * @param {Array} [argPos] The argument positions of the new function.
-     * @param {number} [ary] The arity cap of `func`.
-     * @param {number} [arity] The arity of `func`.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
-      var isCurry = bitmask & CURRY_FLAG,
-          newHolders = isCurry ? holders : undefined,
-          newHoldersRight = isCurry ? undefined : holders,
-          newPartials = isCurry ? partials : undefined,
-          newPartialsRight = isCurry ? undefined : partials;
-
-      bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
-      bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
-
-      if (!(bitmask & CURRY_BOUND_FLAG)) {
-        bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
-      }
-      var newData = [
-        func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
-        newHoldersRight, argPos, ary, arity
-      ];
-
-      var result = wrapFunc.apply(undefined, newData);
-      if (isLaziable(func)) {
-        setData(result, newData);
-      }
-      result.placeholder = placeholder;
-      return result;
-    }
-
-    /**
-     * Creates a function like `_.round`.
-     *
-     * @private
-     * @param {string} methodName The name of the `Math` method to use when rounding.
-     * @returns {Function} Returns the new round function.
-     */
-    function createRound(methodName) {
-      var func = Math[methodName];
-      return function(number, precision) {
-        number = toNumber(number);
-        precision = toInteger(precision);
-        if (precision) {
-          // Shift with exponential notation to avoid floating-point issues.
-          // See [MDN](https://mdn.io/round#Examples) for more details.
-          var pair = (toString(number) + 'e').split('e'),
-              value = func(pair[0] + 'e' + (+pair[1] + precision));
-
-          pair = (toString(value) + 'e').split('e');
-          return +(pair[0] + 'e' + (+pair[1] - precision));
-        }
-        return func(number);
-      };
-    }
-
-    /**
-     * Creates a set of `values`.
-     *
-     * @private
-     * @param {Array} values The values to add to the set.
-     * @returns {Object} Returns the new set.
-     */
-    var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
-      return new Set(values);
-    };
-
-    /**
-     * Creates a function that either curries or invokes `func` with optional
-     * `this` binding and partially applied arguments.
-     *
-     * @private
-     * @param {Function|string} func The function or method name to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags.
-     *  The bitmask may be composed of the following flags:
-     *     1 - `_.bind`
-     *     2 - `_.bindKey`
-     *     4 - `_.curry` or `_.curryRight` of a bound function
-     *     8 - `_.curry`
-     *    16 - `_.curryRight`
-     *    32 - `_.partial`
-     *    64 - `_.partialRight`
-     *   128 - `_.rearg`
-     *   256 - `_.ary`
-     * @param {*} [thisArg] The `this` binding of `func`.
-     * @param {Array} [partials] The arguments to be partially applied.
-     * @param {Array} [holders] The `partials` placeholder indexes.
-     * @param {Array} [argPos] The argument positions of the new function.
-     * @param {number} [ary] The arity cap of `func`.
-     * @param {number} [arity] The arity of `func`.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
-      var isBindKey = bitmask & BIND_KEY_FLAG;
-      if (!isBindKey && typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      var length = partials ? partials.length : 0;
-      if (!length) {
-        bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
-        partials = holders = undefined;
-      }
-      ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
-      arity = arity === undefined ? arity : toInteger(arity);
-      length -= holders ? holders.length : 0;
-
-      if (bitmask & PARTIAL_RIGHT_FLAG) {
-        var partialsRight = partials,
-            holdersRight = holders;
-
-        partials = holders = undefined;
-      }
-      var data = isBindKey ? undefined : getData(func);
-
-      var newData = [
-        func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
-        argPos, ary, arity
-      ];
-
-      if (data) {
-        mergeData(newData, data);
-      }
-      func = newData[0];
-      bitmask = newData[1];
-      thisArg = newData[2];
-      partials = newData[3];
-      holders = newData[4];
-      arity = newData[9] = newData[9] == null
-        ? (isBindKey ? 0 : func.length)
-        : nativeMax(newData[9] - length, 0);
-
-      if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) {
-        bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG);
-      }
-      if (!bitmask || bitmask == BIND_FLAG) {
-        var result = createBaseWrapper(func, bitmask, thisArg);
-      } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) {
-        result = createCurryWrapper(func, bitmask, arity);
-      } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) {
-        result = createPartialWrapper(func, bitmask, thisArg, partials);
-      } else {
-        result = createHybridWrapper.apply(undefined, newData);
-      }
-      var setter = data ? baseSetData : setData;
-      return setter(result, newData);
-    }
-
-    /**
-     * A specialized version of `baseIsEqualDeep` for arrays with support for
-     * partial deep comparisons.
-     *
-     * @private
-     * @param {Array} array The array to compare.
-     * @param {Array} other The other array to compare.
-     * @param {Function} equalFunc The function to determine equivalents of values.
-     * @param {Function} customizer The function to customize comparisons.
-     * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
-     *  for more details.
-     * @param {Object} stack Tracks traversed `array` and `other` objects.
-     * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
-     */
-    function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
-      var index = -1,
-          isPartial = bitmask & PARTIAL_COMPARE_FLAG,
-          isUnordered = bitmask & UNORDERED_COMPARE_FLAG,
-          arrLength = array.length,
-          othLength = other.length;
-
-      if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
-        return false;
-      }
-      // Assume cyclic values are equal.
-      var stacked = stack.get(array);
-      if (stacked) {
-        return stacked == other;
-      }
-      var result = true;
-      stack.set(array, other);
-
-      // Ignore non-index properties.
-      while (++index < arrLength) {
-        var arrValue = array[index],
-            othValue = other[index];
-
-        if (customizer) {
-          var compared = isPartial
-            ? customizer(othValue, arrValue, index, other, array, stack)
-            : customizer(arrValue, othValue, index, array, other, stack);
-        }
-        if (compared !== undefined) {
-          if (compared) {
-            continue;
-          }
-          result = false;
-          break;
-        }
-        // Recursively compare arrays (susceptible to call stack limits).
-        if (isUnordered) {
-          if (!arraySome(other, function(othValue) {
-                return arrValue === othValue ||
-                  equalFunc(arrValue, othValue, customizer, bitmask, stack);
-              })) {
-            result = false;
-            break;
-          }
-        } else if (!(
-              arrValue === othValue ||
-                equalFunc(arrValue, othValue, customizer, bitmask, stack)
-            )) {
-          result = false;
-          break;
-        }
-      }
-      stack['delete'](array);
-      return result;
-    }
-
-    /**
-     * A specialized version of `baseIsEqualDeep` for comparing objects of
-     * the same `toStringTag`.
-     *
-     * **Note:** This function only supports comparing values with tags of
-     * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
-     *
-     * @private
-     * @param {Object} object The object to compare.
-     * @param {Object} other The other object to compare.
-     * @param {string} tag The `toStringTag` of the objects to compare.
-     * @param {Function} equalFunc The function to determine equivalents of values.
-     * @param {Function} customizer The function to customize comparisons.
-     * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
-     *  for more details.
-     * @param {Object} stack Tracks traversed `object` and `other` objects.
-     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
-     */
-    function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
-      switch (tag) {
-        case dataViewTag:
-          if ((object.byteLength != other.byteLength) ||
-              (object.byteOffset != other.byteOffset)) {
-            return false;
-          }
-          object = object.buffer;
-          other = other.buffer;
-
-        case arrayBufferTag:
-          if ((object.byteLength != other.byteLength) ||
-              !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
-            return false;
-          }
-          return true;
-
-        case boolTag:
-        case dateTag:
-          // Coerce dates and booleans to numbers, dates to milliseconds and
-          // booleans to `1` or `0` treating invalid dates coerced to `NaN` as
-          // not equal.
-          return +object == +other;
-
-        case errorTag:
-          return object.name == other.name && object.message == other.message;
-
-        case numberTag:
-          // Treat `NaN` vs. `NaN` as equal.
-          return (object != +object) ? other != +other : object == +other;
-
-        case regexpTag:
-        case stringTag:
-          // Coerce regexes to strings and treat strings, primitives and objects,
-          // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring
-          // for more details.
-          return object == (other + '');
-
-        case mapTag:
-          var convert = mapToArray;
-
-        case setTag:
-          var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
-          convert || (convert = setToArray);
-
-          if (object.size != other.size && !isPartial) {
-            return false;
-          }
-          // Assume cyclic values are equal.
-          var stacked = stack.get(object);
-          if (stacked) {
-            return stacked == other;
-          }
-          bitmask |= UNORDERED_COMPARE_FLAG;
-          stack.set(object, other);
-
-          // Recursively compare objects (susceptible to call stack limits).
-          return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
-
-        case symbolTag:
-          if (symbolValueOf) {
-            return symbolValueOf.call(object) == symbolValueOf.call(other);
-          }
-      }
-      return false;
-    }
-
-    /**
-     * A specialized version of `baseIsEqualDeep` for objects with support for
-     * partial deep comparisons.
-     *
-     * @private
-     * @param {Object} object The object to compare.
-     * @param {Object} other The other object to compare.
-     * @param {Function} equalFunc The function to determine equivalents of values.
-     * @param {Function} customizer The function to customize comparisons.
-     * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
-     *  for more details.
-     * @param {Object} stack Tracks traversed `object` and `other` objects.
-     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
-     */
-    function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
-      var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
-          objProps = keys(object),
-          objLength = objProps.length,
-          othProps = keys(other),
-          othLength = othProps.length;
-
-      if (objLength != othLength && !isPartial) {
-        return false;
-      }
-      var index = objLength;
-      while (index--) {
-        var key = objProps[index];
-        if (!(isPartial ? key in other : baseHas(other, key))) {
-          return false;
-        }
-      }
-      // Assume cyclic values are equal.
-      var stacked = stack.get(object);
-      if (stacked) {
-        return stacked == other;
-      }
-      var result = true;
-      stack.set(object, other);
-
-      var skipCtor = isPartial;
-      while (++index < objLength) {
-        key = objProps[index];
-        var objValue = object[key],
-            othValue = other[key];
-
-        if (customizer) {
-          var compared = isPartial
-            ? customizer(othValue, objValue, key, other, object, stack)
-            : customizer(objValue, othValue, key, object, other, stack);
-        }
-        // Recursively compare objects (susceptible to call stack limits).
-        if (!(compared === undefined
-              ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))
-              : compared
-            )) {
-          result = false;
-          break;
-        }
-        skipCtor || (skipCtor = key == 'constructor');
-      }
-      if (result && !skipCtor) {
-        var objCtor = object.constructor,
-            othCtor = other.constructor;
-
-        // Non `Object` object instances with different constructors are not equal.
-        if (objCtor != othCtor &&
-            ('constructor' in object && 'constructor' in other) &&
-            !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
-              typeof othCtor == 'function' && othCtor instanceof othCtor)) {
-          result = false;
-        }
-      }
-      stack['delete'](object);
-      return result;
-    }
-
-    /**
-     * Creates an array of own enumerable property names and symbols of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names and symbols.
-     */
-    function getAllKeys(object) {
-      return baseGetAllKeys(object, keys, getSymbols);
-    }
-
-    /**
-     * Creates an array of own and inherited enumerable property names and
-     * symbols of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names and symbols.
-     */
-    function getAllKeysIn(object) {
-      return baseGetAllKeys(object, keysIn, getSymbolsIn);
-    }
-
-    /**
-     * Gets metadata for `func`.
-     *
-     * @private
-     * @param {Function} func The function to query.
-     * @returns {*} Returns the metadata for `func`.
-     */
-    var getData = !metaMap ? noop : function(func) {
-      return metaMap.get(func);
-    };
-
-    /**
-     * Gets the name of `func`.
-     *
-     * @private
-     * @param {Function} func The function to query.
-     * @returns {string} Returns the function name.
-     */
-    function getFuncName(func) {
-      var result = (func.name + ''),
-          array = realNames[result],
-          length = hasOwnProperty.call(realNames, result) ? array.length : 0;
-
-      while (length--) {
-        var data = array[length],
-            otherFunc = data.func;
-        if (otherFunc == null || otherFunc == func) {
-          return data.name;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
-     * this function returns the custom method, otherwise it returns `baseIteratee`.
-     * If arguments are provided, the chosen function is invoked with them and
-     * its result is returned.
-     *
-     * @private
-     * @param {*} [value] The value to convert to an iteratee.
-     * @param {number} [arity] The arity of the created iteratee.
-     * @returns {Function} Returns the chosen function or its result.
-     */
-    function getIteratee() {
-      var result = lodash.iteratee || iteratee;
-      result = result === iteratee ? baseIteratee : result;
-      return arguments.length ? result(arguments[0], arguments[1]) : result;
-    }
-
-    /**
-     * Gets the "length" property value of `object`.
-     *
-     * **Note:** This function is used to avoid a
-     * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
-     * Safari on at least iOS 8.1-8.3 ARM64.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {*} Returns the "length" value.
-     */
-    var getLength = baseProperty('length');
-
-    /**
-     * Gets the property names, values, and compare flags of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the match data of `object`.
-     */
-    function getMatchData(object) {
-      var result = toPairs(object),
-          length = result.length;
-
-      while (length--) {
-        result[length][2] = isStrictComparable(result[length][1]);
-      }
-      return result;
-    }
-
-    /**
-     * Gets the native function at `key` of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {string} key The key of the method to get.
-     * @returns {*} Returns the function if it's native, else `undefined`.
-     */
-    function getNative(object, key) {
-      var value = object[key];
-      return isNative(value) ? value : undefined;
-    }
-
-    /**
-     * Gets the argument placeholder value for `func`.
-     *
-     * @private
-     * @param {Function} func The function to inspect.
-     * @returns {*} Returns the placeholder value.
-     */
-    function getPlaceholder(func) {
-      var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
-      return object.placeholder;
-    }
-
-    /**
-     * Gets the `[[Prototype]]` of `value`.
-     *
-     * @private
-     * @param {*} value The value to query.
-     * @returns {null|Object} Returns the `[[Prototype]]`.
-     */
-    function getPrototype(value) {
-      return nativeGetPrototype(Object(value));
-    }
-
-    /**
-     * Creates an array of the own enumerable symbol properties of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of symbols.
-     */
-    function getSymbols(object) {
-      // Coerce `object` to an object to avoid non-object errors in V8.
-      // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details.
-      return getOwnPropertySymbols(Object(object));
-    }
-
-    // Fallback for IE < 11.
-    if (!getOwnPropertySymbols) {
-      getSymbols = function() {
-        return [];
-      };
-    }
-
-    /**
-     * Creates an array of the own and inherited enumerable symbol properties
-     * of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of symbols.
-     */
-    var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) {
-      var result = [];
-      while (object) {
-        arrayPush(result, getSymbols(object));
-        object = getPrototype(object);
-      }
-      return result;
-    };
-
-    /**
-     * Gets the `toStringTag` of `value`.
-     *
-     * @private
-     * @param {*} value The value to query.
-     * @returns {string} Returns the `toStringTag`.
-     */
-    function getTag(value) {
-      return objectToString.call(value);
-    }
-
-    // Fallback for data views, maps, sets, and weak maps in IE 11,
-    // for data views in Edge, and promises in Node.js.
-    if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
-        (Map && getTag(new Map) != mapTag) ||
-        (Promise && getTag(Promise.resolve()) != promiseTag) ||
-        (Set && getTag(new Set) != setTag) ||
-        (WeakMap && getTag(new WeakMap) != weakMapTag)) {
-      getTag = function(value) {
-        var result = objectToString.call(value),
-            Ctor = result == objectTag ? value.constructor : undefined,
-            ctorString = Ctor ? toSource(Ctor) : undefined;
-
-        if (ctorString) {
-          switch (ctorString) {
-            case dataViewCtorString: return dataViewTag;
-            case mapCtorString: return mapTag;
-            case promiseCtorString: return promiseTag;
-            case setCtorString: return setTag;
-            case weakMapCtorString: return weakMapTag;
-          }
-        }
-        return result;
-      };
-    }
-
-    /**
-     * Gets the view, applying any `transforms` to the `start` and `end` positions.
-     *
-     * @private
-     * @param {number} start The start of the view.
-     * @param {number} end The end of the view.
-     * @param {Array} transforms The transformations to apply to the view.
-     * @returns {Object} Returns an object containing the `start` and `end`
-     *  positions of the view.
-     */
-    function getView(start, end, transforms) {
-      var index = -1,
-          length = transforms.length;
-
-      while (++index < length) {
-        var data = transforms[index],
-            size = data.size;
-
-        switch (data.type) {
-          case 'drop':      start += size; break;
-          case 'dropRight': end -= size; break;
-          case 'take':      end = nativeMin(end, start + size); break;
-          case 'takeRight': start = nativeMax(start, end - size); break;
-        }
-      }
-      return { 'start': start, 'end': end };
-    }
-
-    /**
-     * Checks if `path` exists on `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path to check.
-     * @param {Function} hasFunc The function to check properties.
-     * @returns {boolean} Returns `true` if `path` exists, else `false`.
-     */
-    function hasPath(object, path, hasFunc) {
-      path = isKey(path, object) ? [path] : castPath(path);
-
-      var result,
-          index = -1,
-          length = path.length;
-
-      while (++index < length) {
-        var key = toKey(path[index]);
-        if (!(result = object != null && hasFunc(object, key))) {
-          break;
-        }
-        object = object[key];
-      }
-      if (result) {
-        return result;
-      }
-      var length = object ? object.length : 0;
-      return !!length && isLength(length) && isIndex(key, length) &&
-        (isArray(object) || isString(object) || isArguments(object));
-    }
-
-    /**
-     * Initializes an array clone.
-     *
-     * @private
-     * @param {Array} array The array to clone.
-     * @returns {Array} Returns the initialized clone.
-     */
-    function initCloneArray(array) {
-      var length = array.length,
-          result = array.constructor(length);
-
-      // Add properties assigned by `RegExp#exec`.
-      if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
-        result.index = array.index;
-        result.input = array.input;
-      }
-      return result;
-    }
-
-    /**
-     * Initializes an object clone.
-     *
-     * @private
-     * @param {Object} object The object to clone.
-     * @returns {Object} Returns the initialized clone.
-     */
-    function initCloneObject(object) {
-      return (typeof object.constructor == 'function' && !isPrototype(object))
-        ? baseCreate(getPrototype(object))
-        : {};
-    }
-
-    /**
-     * Initializes an object clone based on its `toStringTag`.
-     *
-     * **Note:** This function only supports cloning values with tags of
-     * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
-     *
-     * @private
-     * @param {Object} object The object to clone.
-     * @param {string} tag The `toStringTag` of the object to clone.
-     * @param {Function} cloneFunc The function to clone values.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Object} Returns the initialized clone.
-     */
-    function initCloneByTag(object, tag, cloneFunc, isDeep) {
-      var Ctor = object.constructor;
-      switch (tag) {
-        case arrayBufferTag:
-          return cloneArrayBuffer(object);
-
-        case boolTag:
-        case dateTag:
-          return new Ctor(+object);
-
-        case dataViewTag:
-          return cloneDataView(object, isDeep);
-
-        case float32Tag: case float64Tag:
-        case int8Tag: case int16Tag: case int32Tag:
-        case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
-          return cloneTypedArray(object, isDeep);
-
-        case mapTag:
-          return cloneMap(object, isDeep, cloneFunc);
-
-        case numberTag:
-        case stringTag:
-          return new Ctor(object);
-
-        case regexpTag:
-          return cloneRegExp(object);
-
-        case setTag:
-          return cloneSet(object, isDeep, cloneFunc);
-
-        case symbolTag:
-          return cloneSymbol(object);
-      }
-    }
-
-    /**
-     * Creates an array of index keys for `object` values of arrays,
-     * `arguments` objects, and strings, otherwise `null` is returned.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array|null} Returns index keys, else `null`.
-     */
-    function indexKeys(object) {
-      var length = object ? object.length : undefined;
-      if (isLength(length) &&
-          (isArray(object) || isString(object) || isArguments(object))) {
-        return baseTimes(length, String);
-      }
-      return null;
-    }
-
-    /**
-     * Checks if `value` is a flattenable `arguments` object or array.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
-     */
-    function isFlattenable(value) {
-      return isArrayLikeObject(value) && (isArray(value) || isArguments(value));
-    }
-
-    /**
-     * Checks if `value` is a flattenable array and not a `_.matchesProperty`
-     * iteratee shorthand.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
-     */
-    function isFlattenableIteratee(value) {
-      return isArray(value) && !(value.length == 2 && !isFunction(value[0]));
-    }
-
-    /**
-     * Checks if `value` is a valid array-like index.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
-     * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
-     */
-    function isIndex(value, length) {
-      length = length == null ? MAX_SAFE_INTEGER : length;
-      return !!length &&
-        (typeof value == 'number' || reIsUint.test(value)) &&
-        (value > -1 && value % 1 == 0 && value < length);
-    }
-
-    /**
-     * Checks if the given arguments are from an iteratee call.
-     *
-     * @private
-     * @param {*} value The potential iteratee value argument.
-     * @param {*} index The potential iteratee index or key argument.
-     * @param {*} object The potential iteratee object argument.
-     * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
-     *  else `false`.
-     */
-    function isIterateeCall(value, index, object) {
-      if (!isObject(object)) {
-        return false;
-      }
-      var type = typeof index;
-      if (type == 'number'
-            ? (isArrayLike(object) && isIndex(index, object.length))
-            : (type == 'string' && index in object)
-          ) {
-        return eq(object[index], value);
-      }
-      return false;
-    }
-
-    /**
-     * Checks if `value` is a property name and not a property path.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @param {Object} [object] The object to query keys on.
-     * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
-     */
-    function isKey(value, object) {
-      if (isArray(value)) {
-        return false;
-      }
-      var type = typeof value;
-      if (type == 'number' || type == 'symbol' || type == 'boolean' ||
-          value == null || isSymbol(value)) {
-        return true;
-      }
-      return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
-        (object != null && value in Object(object));
-    }
-
-    /**
-     * Checks if `value` is suitable for use as unique object key.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
-     */
-    function isKeyable(value) {
-      var type = typeof value;
-      return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
-        ? (value !== '__proto__')
-        : (value === null);
-    }
-
-    /**
-     * Checks if `func` has a lazy counterpart.
-     *
-     * @private
-     * @param {Function} func The function to check.
-     * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
-     *  else `false`.
-     */
-    function isLaziable(func) {
-      var funcName = getFuncName(func),
-          other = lodash[funcName];
-
-      if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
-        return false;
-      }
-      if (func === other) {
-        return true;
-      }
-      var data = getData(other);
-      return !!data && func === data[0];
-    }
-
-    /**
-     * Checks if `value` is likely a prototype object.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
-     */
-    function isPrototype(value) {
-      var Ctor = value && value.constructor,
-          proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
-
-      return value === proto;
-    }
-
-    /**
-     * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` if suitable for strict
-     *  equality comparisons, else `false`.
-     */
-    function isStrictComparable(value) {
-      return value === value && !isObject(value);
-    }
-
-    /**
-     * A specialized version of `matchesProperty` for source values suitable
-     * for strict equality comparisons, i.e. `===`.
-     *
-     * @private
-     * @param {string} key The key of the property to get.
-     * @param {*} srcValue The value to match.
-     * @returns {Function} Returns the new function.
-     */
-    function matchesStrictComparable(key, srcValue) {
-      return function(object) {
-        if (object == null) {
-          return false;
-        }
-        return object[key] === srcValue &&
-          (srcValue !== undefined || (key in Object(object)));
-      };
-    }
-
-    /**
-     * Merges the function metadata of `source` into `data`.
-     *
-     * Merging metadata reduces the number of wrappers used to invoke a function.
-     * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
-     * may be applied regardless of execution order. Methods like `_.ary` and
-     * `_.rearg` modify function arguments, making the order in which they are
-     * executed important, preventing the merging of metadata. However, we make
-     * an exception for a safe combined case where curried functions have `_.ary`
-     * and or `_.rearg` applied.
-     *
-     * @private
-     * @param {Array} data The destination metadata.
-     * @param {Array} source The source metadata.
-     * @returns {Array} Returns `data`.
-     */
-    function mergeData(data, source) {
-      var bitmask = data[1],
-          srcBitmask = source[1],
-          newBitmask = bitmask | srcBitmask,
-          isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG);
-
-      var isCombo =
-        ((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) ||
-        ((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
-        ((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
-
-      // Exit early if metadata can't be merged.
-      if (!(isCommon || isCombo)) {
-        return data;
-      }
-      // Use source `thisArg` if available.
-      if (srcBitmask & BIND_FLAG) {
-        data[2] = source[2];
-        // Set when currying a bound function.
-        newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG;
-      }
-      // Compose partial arguments.
-      var value = source[3];
-      if (value) {
-        var partials = data[3];
-        data[3] = partials ? composeArgs(partials, value, source[4]) : value;
-        data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
-      }
-      // Compose partial right arguments.
-      value = source[5];
-      if (value) {
-        partials = data[5];
-        data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
-        data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
-      }
-      // Use source `argPos` if available.
-      value = source[7];
-      if (value) {
-        data[7] = value;
-      }
-      // Use source `ary` if it's smaller.
-      if (srcBitmask & ARY_FLAG) {
-        data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
-      }
-      // Use source `arity` if one is not provided.
-      if (data[9] == null) {
-        data[9] = source[9];
-      }
-      // Use source `func` and merge bitmasks.
-      data[0] = source[0];
-      data[1] = newBitmask;
-
-      return data;
-    }
-
-    /**
-     * Used by `_.defaultsDeep` to customize its `_.merge` use.
-     *
-     * @private
-     * @param {*} objValue The destination value.
-     * @param {*} srcValue The source value.
-     * @param {string} key The key of the property to merge.
-     * @param {Object} object The parent object of `objValue`.
-     * @param {Object} source The parent object of `srcValue`.
-     * @param {Object} [stack] Tracks traversed source values and their merged
-     *  counterparts.
-     * @returns {*} Returns the value to assign.
-     */
-    function mergeDefaults(objValue, srcValue, key, object, source, stack) {
-      if (isObject(objValue) && isObject(srcValue)) {
-        baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue));
-      }
-      return objValue;
-    }
-
-    /**
-     * Gets the parent value at `path` of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array} path The path to get the parent value of.
-     * @returns {*} Returns the parent value.
-     */
-    function parent(object, path) {
-      return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
-    }
-
-    /**
-     * Reorder `array` according to the specified indexes where the element at
-     * the first index is assigned as the first element, the element at
-     * the second index is assigned as the second element, and so on.
-     *
-     * @private
-     * @param {Array} array The array to reorder.
-     * @param {Array} indexes The arranged array indexes.
-     * @returns {Array} Returns `array`.
-     */
-    function reorder(array, indexes) {
-      var arrLength = array.length,
-          length = nativeMin(indexes.length, arrLength),
-          oldArray = copyArray(array);
-
-      while (length--) {
-        var index = indexes[length];
-        array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
-      }
-      return array;
-    }
-
-    /**
-     * Sets metadata for `func`.
-     *
-     * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
-     * period of time, it will trip its breaker and transition to an identity
-     * function to avoid garbage collection pauses in V8. See
-     * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
-     * for more details.
-     *
-     * @private
-     * @param {Function} func The function to associate metadata with.
-     * @param {*} data The metadata.
-     * @returns {Function} Returns `func`.
-     */
-    var setData = (function() {
-      var count = 0,
-          lastCalled = 0;
-
-      return function(key, value) {
-        var stamp = now(),
-            remaining = HOT_SPAN - (stamp - lastCalled);
-
-        lastCalled = stamp;
-        if (remaining > 0) {
-          if (++count >= HOT_COUNT) {
-            return key;
-          }
-        } else {
-          count = 0;
-        }
-        return baseSetData(key, value);
-      };
-    }());
-
-    /**
-     * Converts `string` to a property path array.
-     *
-     * @private
-     * @param {string} string The string to convert.
-     * @returns {Array} Returns the property path array.
-     */
-    var stringToPath = memoize(function(string) {
-      var result = [];
-      toString(string).replace(rePropName, function(match, number, quote, string) {
-        result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
-      });
-      return result;
-    });
-
-    /**
-     * Converts `value` to a string key if it's not a string or symbol.
-     *
-     * @private
-     * @param {*} value The value to inspect.
-     * @returns {string|symbol} Returns the key.
-     */
-    function toKey(value) {
-      if (typeof value == 'string' || isSymbol(value)) {
-        return value;
-      }
-      var result = (value + '');
-      return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
-    }
-
-    /**
-     * Converts `func` to its source code.
-     *
-     * @private
-     * @param {Function} func The function to process.
-     * @returns {string} Returns the source code.
-     */
-    function toSource(func) {
-      if (func != null) {
-        try {
-          return funcToString.call(func);
-        } catch (e) {}
-        try {
-          return (func + '');
-        } catch (e) {}
-      }
-      return '';
-    }
-
-    /**
-     * Creates a clone of `wrapper`.
-     *
-     * @private
-     * @param {Object} wrapper The wrapper to clone.
-     * @returns {Object} Returns the cloned wrapper.
-     */
-    function wrapperClone(wrapper) {
-      if (wrapper instanceof LazyWrapper) {
-        return wrapper.clone();
-      }
-      var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
-      result.__actions__ = copyArray(wrapper.__actions__);
-      result.__index__  = wrapper.__index__;
-      result.__values__ = wrapper.__values__;
-      return result;
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates an array of elements split into groups the length of `size`.
-     * If `array` can't be split evenly, the final chunk will be the remaining
-     * elements.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to process.
-     * @param {number} [size=1] The length of each chunk
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the new array containing chunks.
-     * @example
-     *
-     * _.chunk(['a', 'b', 'c', 'd'], 2);
-     * // => [['a', 'b'], ['c', 'd']]
-     *
-     * _.chunk(['a', 'b', 'c', 'd'], 3);
-     * // => [['a', 'b', 'c'], ['d']]
-     */
-    function chunk(array, size, guard) {
-      if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
-        size = 1;
-      } else {
-        size = nativeMax(toInteger(size), 0);
-      }
-      var length = array ? array.length : 0;
-      if (!length || size < 1) {
-        return [];
-      }
-      var index = 0,
-          resIndex = 0,
-          result = Array(nativeCeil(length / size));
-
-      while (index < length) {
-        result[resIndex++] = baseSlice(array, index, (index += size));
-      }
-      return result;
-    }
-
-    /**
-     * Creates an array with all falsey values removed. The values `false`, `null`,
-     * `0`, `""`, `undefined`, and `NaN` are falsey.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to compact.
-     * @returns {Array} Returns the new array of filtered values.
-     * @example
-     *
-     * _.compact([0, 1, false, 2, '', 3]);
-     * // => [1, 2, 3]
-     */
-    function compact(array) {
-      var index = -1,
-          length = array ? array.length : 0,
-          resIndex = 0,
-          result = [];
-
-      while (++index < length) {
-        var value = array[index];
-        if (value) {
-          result[resIndex++] = value;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * Creates a new array concatenating `array` with any additional arrays
-     * and/or values.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to concatenate.
-     * @param {...*} [values] The values to concatenate.
-     * @returns {Array} Returns the new concatenated array.
-     * @example
-     *
-     * var array = [1];
-     * var other = _.concat(array, 2, [3], [[4]]);
-     *
-     * console.log(other);
-     * // => [1, 2, 3, [4]]
-     *
-     * console.log(array);
-     * // => [1]
-     */
-    function concat() {
-      var length = arguments.length,
-          array = castArray(arguments[0]);
-
-      if (length < 2) {
-        return length ? copyArray(array) : [];
-      }
-      var args = Array(length - 1);
-      while (length--) {
-        args[length - 1] = arguments[length];
-      }
-      return arrayConcat(array, baseFlatten(args, 1));
-    }
-
-    /**
-     * Creates an array of unique `array` values not included in the other given
-     * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons. The order of result values is determined by the
-     * order they occur in the first array.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {...Array} [values] The values to exclude.
-     * @returns {Array} Returns the new array of filtered values.
-     * @see _.without, _.xor
-     * @example
-     *
-     * _.difference([3, 2, 1], [4, 2]);
-     * // => [3, 1]
-     */
-    var difference = rest(function(array, values) {
-      return isArrayLikeObject(array)
-        ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
-        : [];
-    });
-
-    /**
-     * This method is like `_.difference` except that it accepts `iteratee` which
-     * is invoked for each element of `array` and `values` to generate the criterion
-     * by which they're compared. Result values are chosen from the first array.
-     * The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {...Array} [values] The values to exclude.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns the new array of filtered values.
-     * @example
-     *
-     * _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);
-     * // => [3.1, 1.3]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
-     * // => [{ 'x': 2 }]
-     */
-    var differenceBy = rest(function(array, values) {
-      var iteratee = last(values);
-      if (isArrayLikeObject(iteratee)) {
-        iteratee = undefined;
-      }
-      return isArrayLikeObject(array)
-        ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee))
-        : [];
-    });
-
-    /**
-     * This method is like `_.difference` except that it accepts `comparator`
-     * which is invoked to compare elements of `array` to `values`. Result values
-     * are chosen from the first array. The comparator is invoked with two arguments:
-     * (arrVal, othVal).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {...Array} [values] The values to exclude.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of filtered values.
-     * @example
-     *
-     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-     *
-     * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
-     * // => [{ 'x': 2, 'y': 1 }]
-     */
-    var differenceWith = rest(function(array, values) {
-      var comparator = last(values);
-      if (isArrayLikeObject(comparator)) {
-        comparator = undefined;
-      }
-      return isArrayLikeObject(array)
-        ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
-        : [];
-    });
-
-    /**
-     * Creates a slice of `array` with `n` elements dropped from the beginning.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.5.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {number} [n=1] The number of elements to drop.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.drop([1, 2, 3]);
-     * // => [2, 3]
-     *
-     * _.drop([1, 2, 3], 2);
-     * // => [3]
-     *
-     * _.drop([1, 2, 3], 5);
-     * // => []
-     *
-     * _.drop([1, 2, 3], 0);
-     * // => [1, 2, 3]
-     */
-    function drop(array, n, guard) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      n = (guard || n === undefined) ? 1 : toInteger(n);
-      return baseSlice(array, n < 0 ? 0 : n, length);
-    }
-
-    /**
-     * Creates a slice of `array` with `n` elements dropped from the end.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {number} [n=1] The number of elements to drop.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.dropRight([1, 2, 3]);
-     * // => [1, 2]
-     *
-     * _.dropRight([1, 2, 3], 2);
-     * // => [1]
-     *
-     * _.dropRight([1, 2, 3], 5);
-     * // => []
-     *
-     * _.dropRight([1, 2, 3], 0);
-     * // => [1, 2, 3]
-     */
-    function dropRight(array, n, guard) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      n = (guard || n === undefined) ? 1 : toInteger(n);
-      n = length - n;
-      return baseSlice(array, 0, n < 0 ? 0 : n);
-    }
-
-    /**
-     * Creates a slice of `array` excluding elements dropped from the end.
-     * Elements are dropped until `predicate` returns falsey. The predicate is
-     * invoked with three arguments: (value, index, array).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': true },
-     *   { 'user': 'fred',    'active': false },
-     *   { 'user': 'pebbles', 'active': false }
-     * ];
-     *
-     * _.dropRightWhile(users, function(o) { return !o.active; });
-     * // => objects for ['barney']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
-     * // => objects for ['barney', 'fred']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.dropRightWhile(users, ['active', false]);
-     * // => objects for ['barney']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.dropRightWhile(users, 'active');
-     * // => objects for ['barney', 'fred', 'pebbles']
-     */
-    function dropRightWhile(array, predicate) {
-      return (array && array.length)
-        ? baseWhile(array, getIteratee(predicate, 3), true, true)
-        : [];
-    }
-
-    /**
-     * Creates a slice of `array` excluding elements dropped from the beginning.
-     * Elements are dropped until `predicate` returns falsey. The predicate is
-     * invoked with three arguments: (value, index, array).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': false },
-     *   { 'user': 'fred',    'active': false },
-     *   { 'user': 'pebbles', 'active': true }
-     * ];
-     *
-     * _.dropWhile(users, function(o) { return !o.active; });
-     * // => objects for ['pebbles']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.dropWhile(users, { 'user': 'barney', 'active': false });
-     * // => objects for ['fred', 'pebbles']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.dropWhile(users, ['active', false]);
-     * // => objects for ['pebbles']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.dropWhile(users, 'active');
-     * // => objects for ['barney', 'fred', 'pebbles']
-     */
-    function dropWhile(array, predicate) {
-      return (array && array.length)
-        ? baseWhile(array, getIteratee(predicate, 3), true)
-        : [];
-    }
-
-    /**
-     * Fills elements of `array` with `value` from `start` up to, but not
-     * including, `end`.
-     *
-     * **Note:** This method mutates `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.2.0
-     * @category Array
-     * @param {Array} array The array to fill.
-     * @param {*} value The value to fill `array` with.
-     * @param {number} [start=0] The start position.
-     * @param {number} [end=array.length] The end position.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [1, 2, 3];
-     *
-     * _.fill(array, 'a');
-     * console.log(array);
-     * // => ['a', 'a', 'a']
-     *
-     * _.fill(Array(3), 2);
-     * // => [2, 2, 2]
-     *
-     * _.fill([4, 6, 8, 10], '*', 1, 3);
-     * // => [4, '*', '*', 10]
-     */
-    function fill(array, value, start, end) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
-        start = 0;
-        end = length;
-      }
-      return baseFill(array, value, start, end);
-    }
-
-    /**
-     * This method is like `_.find` except that it returns the index of the first
-     * element `predicate` returns truthy for instead of the element itself.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.1.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {number} Returns the index of the found element, else `-1`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': false },
-     *   { 'user': 'fred',    'active': false },
-     *   { 'user': 'pebbles', 'active': true }
-     * ];
-     *
-     * _.findIndex(users, function(o) { return o.user == 'barney'; });
-     * // => 0
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.findIndex(users, { 'user': 'fred', 'active': false });
-     * // => 1
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.findIndex(users, ['active', false]);
-     * // => 0
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.findIndex(users, 'active');
-     * // => 2
-     */
-    function findIndex(array, predicate) {
-      return (array && array.length)
-        ? baseFindIndex(array, getIteratee(predicate, 3))
-        : -1;
-    }
-
-    /**
-     * This method is like `_.findIndex` except that it iterates over elements
-     * of `collection` from right to left.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {number} Returns the index of the found element, else `-1`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': true },
-     *   { 'user': 'fred',    'active': false },
-     *   { 'user': 'pebbles', 'active': false }
-     * ];
-     *
-     * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
-     * // => 2
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.findLastIndex(users, { 'user': 'barney', 'active': true });
-     * // => 0
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.findLastIndex(users, ['active', false]);
-     * // => 2
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.findLastIndex(users, 'active');
-     * // => 0
-     */
-    function findLastIndex(array, predicate) {
-      return (array && array.length)
-        ? baseFindIndex(array, getIteratee(predicate, 3), true)
-        : -1;
-    }
-
-    /**
-     * Flattens `array` a single level deep.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to flatten.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * _.flatten([1, [2, [3, [4]], 5]]);
-     * // => [1, 2, [3, [4]], 5]
-     */
-    function flatten(array) {
-      var length = array ? array.length : 0;
-      return length ? baseFlatten(array, 1) : [];
-    }
-
-    /**
-     * Recursively flattens `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to flatten.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * _.flattenDeep([1, [2, [3, [4]], 5]]);
-     * // => [1, 2, 3, 4, 5]
-     */
-    function flattenDeep(array) {
-      var length = array ? array.length : 0;
-      return length ? baseFlatten(array, INFINITY) : [];
-    }
-
-    /**
-     * Recursively flatten `array` up to `depth` times.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.4.0
-     * @category Array
-     * @param {Array} array The array to flatten.
-     * @param {number} [depth=1] The maximum recursion depth.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * var array = [1, [2, [3, [4]], 5]];
-     *
-     * _.flattenDepth(array, 1);
-     * // => [1, 2, [3, [4]], 5]
-     *
-     * _.flattenDepth(array, 2);
-     * // => [1, 2, 3, [4], 5]
-     */
-    function flattenDepth(array, depth) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      depth = depth === undefined ? 1 : toInteger(depth);
-      return baseFlatten(array, depth);
-    }
-
-    /**
-     * The inverse of `_.toPairs`; this method returns an object composed
-     * from key-value `pairs`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} pairs The key-value pairs.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * _.fromPairs([['fred', 30], ['barney', 40]]);
-     * // => { 'fred': 30, 'barney': 40 }
-     */
-    function fromPairs(pairs) {
-      var index = -1,
-          length = pairs ? pairs.length : 0,
-          result = {};
-
-      while (++index < length) {
-        var pair = pairs[index];
-        result[pair[0]] = pair[1];
-      }
-      return result;
-    }
-
-    /**
-     * Gets the first element of `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @alias first
-     * @category Array
-     * @param {Array} array The array to query.
-     * @returns {*} Returns the first element of `array`.
-     * @example
-     *
-     * _.head([1, 2, 3]);
-     * // => 1
-     *
-     * _.head([]);
-     * // => undefined
-     */
-    function head(array) {
-      return (array && array.length) ? array[0] : undefined;
-    }
-
-    /**
-     * Gets the index at which the first occurrence of `value` is found in `array`
-     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons. If `fromIndex` is negative, it's used as the
-     * offset from the end of `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {*} value The value to search for.
-     * @param {number} [fromIndex=0] The index to search from.
-     * @returns {number} Returns the index of the matched value, else `-1`.
-     * @example
-     *
-     * _.indexOf([1, 2, 1, 2], 2);
-     * // => 1
-     *
-     * // Search from the `fromIndex`.
-     * _.indexOf([1, 2, 1, 2], 2, 2);
-     * // => 3
-     */
-    function indexOf(array, value, fromIndex) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return -1;
-      }
-      fromIndex = toInteger(fromIndex);
-      if (fromIndex < 0) {
-        fromIndex = nativeMax(length + fromIndex, 0);
-      }
-      return baseIndexOf(array, value, fromIndex);
-    }
-
-    /**
-     * Gets all but the last element of `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.initial([1, 2, 3]);
-     * // => [1, 2]
-     */
-    function initial(array) {
-      return dropRight(array, 1);
-    }
-
-    /**
-     * Creates an array of unique values that are included in all given arrays
-     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons. The order of result values is determined by the
-     * order they occur in the first array.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @returns {Array} Returns the new array of intersecting values.
-     * @example
-     *
-     * _.intersection([2, 1], [4, 2], [1, 2]);
-     * // => [2]
-     */
-    var intersection = rest(function(arrays) {
-      var mapped = arrayMap(arrays, castArrayLikeObject);
-      return (mapped.length && mapped[0] === arrays[0])
-        ? baseIntersection(mapped)
-        : [];
-    });
-
-    /**
-     * This method is like `_.intersection` except that it accepts `iteratee`
-     * which is invoked for each element of each `arrays` to generate the criterion
-     * by which they're compared. Result values are chosen from the first array.
-     * The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns the new array of intersecting values.
-     * @example
-     *
-     * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-     * // => [2.1]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-     * // => [{ 'x': 1 }]
-     */
-    var intersectionBy = rest(function(arrays) {
-      var iteratee = last(arrays),
-          mapped = arrayMap(arrays, castArrayLikeObject);
-
-      if (iteratee === last(mapped)) {
-        iteratee = undefined;
-      } else {
-        mapped.pop();
-      }
-      return (mapped.length && mapped[0] === arrays[0])
-        ? baseIntersection(mapped, getIteratee(iteratee))
-        : [];
-    });
-
-    /**
-     * This method is like `_.intersection` except that it accepts `comparator`
-     * which is invoked to compare elements of `arrays`. Result values are chosen
-     * from the first array. The comparator is invoked with two arguments:
-     * (arrVal, othVal).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of intersecting values.
-     * @example
-     *
-     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-     * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
-     *
-     * _.intersectionWith(objects, others, _.isEqual);
-     * // => [{ 'x': 1, 'y': 2 }]
-     */
-    var intersectionWith = rest(function(arrays) {
-      var comparator = last(arrays),
-          mapped = arrayMap(arrays, castArrayLikeObject);
-
-      if (comparator === last(mapped)) {
-        comparator = undefined;
-      } else {
-        mapped.pop();
-      }
-      return (mapped.length && mapped[0] === arrays[0])
-        ? baseIntersection(mapped, undefined, comparator)
-        : [];
-    });
-
-    /**
-     * Converts all elements in `array` into a string separated by `separator`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to convert.
-     * @param {string} [separator=','] The element separator.
-     * @returns {string} Returns the joined string.
-     * @example
-     *
-     * _.join(['a', 'b', 'c'], '~');
-     * // => 'a~b~c'
-     */
-    function join(array, separator) {
-      return array ? nativeJoin.call(array, separator) : '';
-    }
-
-    /**
-     * Gets the last element of `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @returns {*} Returns the last element of `array`.
-     * @example
-     *
-     * _.last([1, 2, 3]);
-     * // => 3
-     */
-    function last(array) {
-      var length = array ? array.length : 0;
-      return length ? array[length - 1] : undefined;
-    }
-
-    /**
-     * This method is like `_.indexOf` except that it iterates over elements of
-     * `array` from right to left.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {*} value The value to search for.
-     * @param {number} [fromIndex=array.length-1] The index to search from.
-     * @returns {number} Returns the index of the matched value, else `-1`.
-     * @example
-     *
-     * _.lastIndexOf([1, 2, 1, 2], 2);
-     * // => 3
-     *
-     * // Search from the `fromIndex`.
-     * _.lastIndexOf([1, 2, 1, 2], 2, 2);
-     * // => 1
-     */
-    function lastIndexOf(array, value, fromIndex) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return -1;
-      }
-      var index = length;
-      if (fromIndex !== undefined) {
-        index = toInteger(fromIndex);
-        index = (
-          index < 0
-            ? nativeMax(length + index, 0)
-            : nativeMin(index, length - 1)
-        ) + 1;
-      }
-      if (value !== value) {
-        return indexOfNaN(array, index, true);
-      }
-      while (index--) {
-        if (array[index] === value) {
-          return index;
-        }
-      }
-      return -1;
-    }
-
-    /**
-     * Gets the nth element of `array`. If `n` is negative, the nth element
-     * from the end is returned.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.11.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {number} [n=0] The index of the element to return.
-     * @returns {*} Returns the nth element of `array`.
-     * @example
-     *
-     * var array = ['a', 'b', 'c', 'd'];
-     *
-     * _.nth(array, 1);
-     * // => 'b'
-     *
-     * _.nth(array, -2);
-     * // => 'c';
-     */
-    function nth(array, n) {
-      return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
-    }
-
-    /**
-     * Removes all given values from `array` using
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons.
-     *
-     * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
-     * to remove elements from an array by predicate.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {...*} [values] The values to remove.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [1, 2, 3, 1, 2, 3];
-     *
-     * _.pull(array, 2, 3);
-     * console.log(array);
-     * // => [1, 1]
-     */
-    var pull = rest(pullAll);
-
-    /**
-     * This method is like `_.pull` except that it accepts an array of values to remove.
-     *
-     * **Note:** Unlike `_.difference`, this method mutates `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {Array} values The values to remove.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [1, 2, 3, 1, 2, 3];
-     *
-     * _.pullAll(array, [2, 3]);
-     * console.log(array);
-     * // => [1, 1]
-     */
-    function pullAll(array, values) {
-      return (array && array.length && values && values.length)
-        ? basePullAll(array, values)
-        : array;
-    }
-
-    /**
-     * This method is like `_.pullAll` except that it accepts `iteratee` which is
-     * invoked for each element of `array` and `values` to generate the criterion
-     * by which they're compared. The iteratee is invoked with one argument: (value).
-     *
-     * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {Array} values The values to remove.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
-     *
-     * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
-     * console.log(array);
-     * // => [{ 'x': 2 }]
-     */
-    function pullAllBy(array, values, iteratee) {
-      return (array && array.length && values && values.length)
-        ? basePullAll(array, values, getIteratee(iteratee))
-        : array;
-    }
-
-    /**
-     * This method is like `_.pullAll` except that it accepts `comparator` which
-     * is invoked to compare elements of `array` to `values`. The comparator is
-     * invoked with two arguments: (arrVal, othVal).
-     *
-     * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.6.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {Array} values The values to remove.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
-     *
-     * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
-     * console.log(array);
-     * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
-     */
-    function pullAllWith(array, values, comparator) {
-      return (array && array.length && values && values.length)
-        ? basePullAll(array, values, undefined, comparator)
-        : array;
-    }
-
-    /**
-     * Removes elements from `array` corresponding to `indexes` and returns an
-     * array of removed elements.
-     *
-     * **Note:** Unlike `_.at`, this method mutates `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {...(number|number[])} [indexes] The indexes of elements to remove.
-     * @returns {Array} Returns the new array of removed elements.
-     * @example
-     *
-     * var array = [5, 10, 15, 20];
-     * var evens = _.pullAt(array, 1, 3);
-     *
-     * console.log(array);
-     * // => [5, 15]
-     *
-     * console.log(evens);
-     * // => [10, 20]
-     */
-    var pullAt = rest(function(array, indexes) {
-      indexes = baseFlatten(indexes, 1);
-
-      var length = array ? array.length : 0,
-          result = baseAt(array, indexes);
-
-      basePullAt(array, arrayMap(indexes, function(index) {
-        return isIndex(index, length) ? +index : index;
-      }).sort(compareAscending));
-
-      return result;
-    });
-
-    /**
-     * Removes all elements from `array` that `predicate` returns truthy for
-     * and returns an array of the removed elements. The predicate is invoked
-     * with three arguments: (value, index, array).
-     *
-     * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
-     * to pull elements from an array by value.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new array of removed elements.
-     * @example
-     *
-     * var array = [1, 2, 3, 4];
-     * var evens = _.remove(array, function(n) {
-     *   return n % 2 == 0;
-     * });
-     *
-     * console.log(array);
-     * // => [1, 3]
-     *
-     * console.log(evens);
-     * // => [2, 4]
-     */
-    function remove(array, predicate) {
-      var result = [];
-      if (!(array && array.length)) {
-        return result;
-      }
-      var index = -1,
-          indexes = [],
-          length = array.length;
-
-      predicate = getIteratee(predicate, 3);
-      while (++index < length) {
-        var value = array[index];
-        if (predicate(value, index, array)) {
-          result.push(value);
-          indexes.push(index);
-        }
-      }
-      basePullAt(array, indexes);
-      return result;
-    }
-
-    /**
-     * Reverses `array` so that the first element becomes the last, the second
-     * element becomes the second to last, and so on.
-     *
-     * **Note:** This method mutates `array` and is based on
-     * [`Array#reverse`](https://mdn.io/Array/reverse).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [1, 2, 3];
-     *
-     * _.reverse(array);
-     * // => [3, 2, 1]
-     *
-     * console.log(array);
-     * // => [3, 2, 1]
-     */
-    function reverse(array) {
-      return array ? nativeReverse.call(array) : array;
-    }
-
-    /**
-     * Creates a slice of `array` from `start` up to, but not including, `end`.
-     *
-     * **Note:** This method is used instead of
-     * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
-     * returned.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to slice.
-     * @param {number} [start=0] The start position.
-     * @param {number} [end=array.length] The end position.
-     * @returns {Array} Returns the slice of `array`.
-     */
-    function slice(array, start, end) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
-        start = 0;
-        end = length;
-      }
-      else {
-        start = start == null ? 0 : toInteger(start);
-        end = end === undefined ? length : toInteger(end);
-      }
-      return baseSlice(array, start, end);
-    }
-
-    /**
-     * Uses a binary search to determine the lowest index at which `value`
-     * should be inserted into `array` in order to maintain its sort order.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     * @example
-     *
-     * _.sortedIndex([30, 50], 40);
-     * // => 1
-     *
-     * _.sortedIndex([4, 5], 4);
-     * // => 0
-     */
-    function sortedIndex(array, value) {
-      return baseSortedIndex(array, value);
-    }
-
-    /**
-     * This method is like `_.sortedIndex` except that it accepts `iteratee`
-     * which is invoked for `value` and each element of `array` to compute their
-     * sort ranking. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     * @example
-     *
-     * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
-     *
-     * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
-     * // => 1
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
-     * // => 0
-     */
-    function sortedIndexBy(array, value, iteratee) {
-      return baseSortedIndexBy(array, value, getIteratee(iteratee));
-    }
-
-    /**
-     * This method is like `_.indexOf` except that it performs a binary
-     * search on a sorted `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {*} value The value to search for.
-     * @returns {number} Returns the index of the matched value, else `-1`.
-     * @example
-     *
-     * _.sortedIndexOf([1, 1, 2, 2], 2);
-     * // => 2
-     */
-    function sortedIndexOf(array, value) {
-      var length = array ? array.length : 0;
-      if (length) {
-        var index = baseSortedIndex(array, value);
-        if (index < length && eq(array[index], value)) {
-          return index;
-        }
-      }
-      return -1;
-    }
-
-    /**
-     * This method is like `_.sortedIndex` except that it returns the highest
-     * index at which `value` should be inserted into `array` in order to
-     * maintain its sort order.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     * @example
-     *
-     * _.sortedLastIndex([4, 5], 4);
-     * // => 1
-     */
-    function sortedLastIndex(array, value) {
-      return baseSortedIndex(array, value, true);
-    }
-
-    /**
-     * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
-     * which is invoked for `value` and each element of `array` to compute their
-     * sort ranking. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     * @example
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
-     * // => 1
-     */
-    function sortedLastIndexBy(array, value, iteratee) {
-      return baseSortedIndexBy(array, value, getIteratee(iteratee), true);
-    }
-
-    /**
-     * This method is like `_.lastIndexOf` except that it performs a binary
-     * search on a sorted `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {*} value The value to search for.
-     * @returns {number} Returns the index of the matched value, else `-1`.
-     * @example
-     *
-     * _.sortedLastIndexOf([1, 1, 2, 2], 2);
-     * // => 3
-     */
-    function sortedLastIndexOf(array, value) {
-      var length = array ? array.length : 0;
-      if (length) {
-        var index = baseSortedIndex(array, value, true) - 1;
-        if (eq(array[index], value)) {
-          return index;
-        }
-      }
-      return -1;
-    }
-
-    /**
-     * This method is like `_.uniq` except that it's designed and optimized
-     * for sorted arrays.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @returns {Array} Returns the new duplicate free array.
-     * @example
-     *
-     * _.sortedUniq([1, 1, 2]);
-     * // => [1, 2]
-     */
-    function sortedUniq(array) {
-      return (array && array.length)
-        ? baseSortedUniq(array)
-        : [];
-    }
-
-    /**
-     * This method is like `_.uniqBy` except that it's designed and optimized
-     * for sorted arrays.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @returns {Array} Returns the new duplicate free array.
-     * @example
-     *
-     * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
-     * // => [1.1, 2.3]
-     */
-    function sortedUniqBy(array, iteratee) {
-      return (array && array.length)
-        ? baseSortedUniq(array, getIteratee(iteratee))
-        : [];
-    }
-
-    /**
-     * Gets all but the first element of `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.tail([1, 2, 3]);
-     * // => [2, 3]
-     */
-    function tail(array) {
-      return drop(array, 1);
-    }
-
-    /**
-     * Creates a slice of `array` with `n` elements taken from the beginning.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {number} [n=1] The number of elements to take.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.take([1, 2, 3]);
-     * // => [1]
-     *
-     * _.take([1, 2, 3], 2);
-     * // => [1, 2]
-     *
-     * _.take([1, 2, 3], 5);
-     * // => [1, 2, 3]
-     *
-     * _.take([1, 2, 3], 0);
-     * // => []
-     */
-    function take(array, n, guard) {
-      if (!(array && array.length)) {
-        return [];
-      }
-      n = (guard || n === undefined) ? 1 : toInteger(n);
-      return baseSlice(array, 0, n < 0 ? 0 : n);
-    }
-
-    /**
-     * Creates a slice of `array` with `n` elements taken from the end.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {number} [n=1] The number of elements to take.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.takeRight([1, 2, 3]);
-     * // => [3]
-     *
-     * _.takeRight([1, 2, 3], 2);
-     * // => [2, 3]
-     *
-     * _.takeRight([1, 2, 3], 5);
-     * // => [1, 2, 3]
-     *
-     * _.takeRight([1, 2, 3], 0);
-     * // => []
-     */
-    function takeRight(array, n, guard) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      n = (guard || n === undefined) ? 1 : toInteger(n);
-      n = length - n;
-      return baseSlice(array, n < 0 ? 0 : n, length);
-    }
-
-    /**
-     * Creates a slice of `array` with elements taken from the end. Elements are
-     * taken until `predicate` returns falsey. The predicate is invoked with
-     * three arguments: (value, index, array).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': true },
-     *   { 'user': 'fred',    'active': false },
-     *   { 'user': 'pebbles', 'active': false }
-     * ];
-     *
-     * _.takeRightWhile(users, function(o) { return !o.active; });
-     * // => objects for ['fred', 'pebbles']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
-     * // => objects for ['pebbles']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.takeRightWhile(users, ['active', false]);
-     * // => objects for ['fred', 'pebbles']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.takeRightWhile(users, 'active');
-     * // => []
-     */
-    function takeRightWhile(array, predicate) {
-      return (array && array.length)
-        ? baseWhile(array, getIteratee(predicate, 3), false, true)
-        : [];
-    }
-
-    /**
-     * Creates a slice of `array` with elements taken from the beginning. Elements
-     * are taken until `predicate` returns falsey. The predicate is invoked with
-     * three arguments: (value, index, array).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': false },
-     *   { 'user': 'fred',    'active': false},
-     *   { 'user': 'pebbles', 'active': true }
-     * ];
-     *
-     * _.takeWhile(users, function(o) { return !o.active; });
-     * // => objects for ['barney', 'fred']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.takeWhile(users, { 'user': 'barney', 'active': false });
-     * // => objects for ['barney']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.takeWhile(users, ['active', false]);
-     * // => objects for ['barney', 'fred']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.takeWhile(users, 'active');
-     * // => []
-     */
-    function takeWhile(array, predicate) {
-      return (array && array.length)
-        ? baseWhile(array, getIteratee(predicate, 3))
-        : [];
-    }
-
-    /**
-     * Creates an array of unique values, in order, from all given arrays using
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @returns {Array} Returns the new array of combined values.
-     * @example
-     *
-     * _.union([2, 1], [4, 2], [1, 2]);
-     * // => [2, 1, 4]
-     */
-    var union = rest(function(arrays) {
-      return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
-    });
-
-    /**
-     * This method is like `_.union` except that it accepts `iteratee` which is
-     * invoked for each element of each `arrays` to generate the criterion by
-     * which uniqueness is computed. The iteratee is invoked with one argument:
-     * (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns the new array of combined values.
-     * @example
-     *
-     * _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-     * // => [2.1, 1.2, 4.3]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-     * // => [{ 'x': 1 }, { 'x': 2 }]
-     */
-    var unionBy = rest(function(arrays) {
-      var iteratee = last(arrays);
-      if (isArrayLikeObject(iteratee)) {
-        iteratee = undefined;
-      }
-      return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee));
-    });
-
-    /**
-     * This method is like `_.union` except that it accepts `comparator` which
-     * is invoked to compare elements of `arrays`. The comparator is invoked
-     * with two arguments: (arrVal, othVal).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of combined values.
-     * @example
-     *
-     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-     * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
-     *
-     * _.unionWith(objects, others, _.isEqual);
-     * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
-     */
-    var unionWith = rest(function(arrays) {
-      var comparator = last(arrays);
-      if (isArrayLikeObject(comparator)) {
-        comparator = undefined;
-      }
-      return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
-    });
-
-    /**
-     * Creates a duplicate-free version of an array, using
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons, in which only the first occurrence of each
-     * element is kept.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @returns {Array} Returns the new duplicate free array.
-     * @example
-     *
-     * _.uniq([2, 1, 2]);
-     * // => [2, 1]
-     */
-    function uniq(array) {
-      return (array && array.length)
-        ? baseUniq(array)
-        : [];
-    }
-
-    /**
-     * This method is like `_.uniq` except that it accepts `iteratee` which is
-     * invoked for each element in `array` to generate the criterion by which
-     * uniqueness is computed. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns the new duplicate free array.
-     * @example
-     *
-     * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
-     * // => [2.1, 1.2]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
-     * // => [{ 'x': 1 }, { 'x': 2 }]
-     */
-    function uniqBy(array, iteratee) {
-      return (array && array.length)
-        ? baseUniq(array, getIteratee(iteratee))
-        : [];
-    }
-
-    /**
-     * This method is like `_.uniq` except that it accepts `comparator` which
-     * is invoked to compare elements of `array`. The comparator is invoked with
-     * two arguments: (arrVal, othVal).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new duplicate free array.
-     * @example
-     *
-     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 },  { 'x': 1, 'y': 2 }];
-     *
-     * _.uniqWith(objects, _.isEqual);
-     * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
-     */
-    function uniqWith(array, comparator) {
-      return (array && array.length)
-        ? baseUniq(array, undefined, comparator)
-        : [];
-    }
-
-    /**
-     * This method is like `_.zip` except that it accepts an array of grouped
-     * elements and creates an array regrouping the elements to their pre-zip
-     * configuration.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.2.0
-     * @category Array
-     * @param {Array} array The array of grouped elements to process.
-     * @returns {Array} Returns the new array of regrouped elements.
-     * @example
-     *
-     * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
-     * // => [['fred', 30, true], ['barney', 40, false]]
-     *
-     * _.unzip(zipped);
-     * // => [['fred', 'barney'], [30, 40], [true, false]]
-     */
-    function unzip(array) {
-      if (!(array && array.length)) {
-        return [];
-      }
-      var length = 0;
-      array = arrayFilter(array, function(group) {
-        if (isArrayLikeObject(group)) {
-          length = nativeMax(group.length, length);
-          return true;
-        }
-      });
-      return baseTimes(length, function(index) {
-        return arrayMap(array, baseProperty(index));
-      });
-    }
-
-    /**
-     * This method is like `_.unzip` except that it accepts `iteratee` to specify
-     * how regrouped values should be combined. The iteratee is invoked with the
-     * elements of each group: (...group).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.8.0
-     * @category Array
-     * @param {Array} array The array of grouped elements to process.
-     * @param {Function} [iteratee=_.identity] The function to combine
-     *  regrouped values.
-     * @returns {Array} Returns the new array of regrouped elements.
-     * @example
-     *
-     * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
-     * // => [[1, 10, 100], [2, 20, 200]]
-     *
-     * _.unzipWith(zipped, _.add);
-     * // => [3, 30, 300]
-     */
-    function unzipWith(array, iteratee) {
-      if (!(array && array.length)) {
-        return [];
-      }
-      var result = unzip(array);
-      if (iteratee == null) {
-        return result;
-      }
-      return arrayMap(result, function(group) {
-        return apply(iteratee, undefined, group);
-      });
-    }
-
-    /**
-     * Creates an array excluding all given values using
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to filter.
-     * @param {...*} [values] The values to exclude.
-     * @returns {Array} Returns the new array of filtered values.
-     * @see _.difference, _.xor
-     * @example
-     *
-     * _.without([1, 2, 1, 3], 1, 2);
-     * // => [3]
-     */
-    var without = rest(function(array, values) {
-      return isArrayLikeObject(array)
-        ? baseDifference(array, values)
-        : [];
-    });
-
-    /**
-     * Creates an array of unique values that is the
-     * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
-     * of the given arrays. The order of result values is determined by the order
-     * they occur in the arrays.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.4.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @returns {Array} Returns the new array of values.
-     * @see _.difference, _.without
-     * @example
-     *
-     * _.xor([2, 1], [4, 2]);
-     * // => [1, 4]
-     */
-    var xor = rest(function(arrays) {
-      return baseXor(arrayFilter(arrays, isArrayLikeObject));
-    });
-
-    /**
-     * This method is like `_.xor` except that it accepts `iteratee` which is
-     * invoked for each element of each `arrays` to generate the criterion by
-     * which by which they're compared. The iteratee is invoked with one argument:
-     * (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns the new array of values.
-     * @example
-     *
-     * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-     * // => [1.2, 4.3]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-     * // => [{ 'x': 2 }]
-     */
-    var xorBy = rest(function(arrays) {
-      var iteratee = last(arrays);
-      if (isArrayLikeObject(iteratee)) {
-        iteratee = undefined;
-      }
-      return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee));
-    });
-
-    /**
-     * This method is like `_.xor` except that it accepts `comparator` which is
-     * invoked to compare elements of `arrays`. The comparator is invoked with
-     * two arguments: (arrVal, othVal).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of values.
-     * @example
-     *
-     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-     * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
-     *
-     * _.xorWith(objects, others, _.isEqual);
-     * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
-     */
-    var xorWith = rest(function(arrays) {
-      var comparator = last(arrays);
-      if (isArrayLikeObject(comparator)) {
-        comparator = undefined;
-      }
-      return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
-    });
-
-    /**
-     * Creates an array of grouped elements, the first of which contains the
-     * first elements of the given arrays, the second of which contains the
-     * second elements of the given arrays, and so on.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to process.
-     * @returns {Array} Returns the new array of grouped elements.
-     * @example
-     *
-     * _.zip(['fred', 'barney'], [30, 40], [true, false]);
-     * // => [['fred', 30, true], ['barney', 40, false]]
-     */
-    var zip = rest(unzip);
-
-    /**
-     * This method is like `_.fromPairs` except that it accepts two arrays,
-     * one of property identifiers and one of corresponding values.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.4.0
-     * @category Array
-     * @param {Array} [props=[]] The property identifiers.
-     * @param {Array} [values=[]] The property values.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * _.zipObject(['a', 'b'], [1, 2]);
-     * // => { 'a': 1, 'b': 2 }
-     */
-    function zipObject(props, values) {
-      return baseZipObject(props || [], values || [], assignValue);
-    }
-
-    /**
-     * This method is like `_.zipObject` except that it supports property paths.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.1.0
-     * @category Array
-     * @param {Array} [props=[]] The property identifiers.
-     * @param {Array} [values=[]] The property values.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
-     * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
-     */
-    function zipObjectDeep(props, values) {
-      return baseZipObject(props || [], values || [], baseSet);
-    }
-
-    /**
-     * This method is like `_.zip` except that it accepts `iteratee` to specify
-     * how grouped values should be combined. The iteratee is invoked with the
-     * elements of each group: (...group).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.8.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to process.
-     * @param {Function} [iteratee=_.identity] The function to combine grouped values.
-     * @returns {Array} Returns the new array of grouped elements.
-     * @example
-     *
-     * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
-     *   return a + b + c;
-     * });
-     * // => [111, 222]
-     */
-    var zipWith = rest(function(arrays) {
-      var length = arrays.length,
-          iteratee = length > 1 ? arrays[length - 1] : undefined;
-
-      iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
-      return unzipWith(arrays, iteratee);
-    });
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a `lodash` wrapper instance that wraps `value` with explicit method
-     * chain sequences enabled. The result of such sequences must be unwrapped
-     * with `_#value`.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.3.0
-     * @category Seq
-     * @param {*} value The value to wrap.
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'age': 36 },
-     *   { 'user': 'fred',    'age': 40 },
-     *   { 'user': 'pebbles', 'age': 1 }
-     * ];
-     *
-     * var youngest = _
-     *   .chain(users)
-     *   .sortBy('age')
-     *   .map(function(o) {
-     *     return o.user + ' is ' + o.age;
-     *   })
-     *   .head()
-     *   .value();
-     * // => 'pebbles is 1'
-     */
-    function chain(value) {
-      var result = lodash(value);
-      result.__chain__ = true;
-      return result;
-    }
-
-    /**
-     * This method invokes `interceptor` and returns `value`. The interceptor
-     * is invoked with one argument; (value). The purpose of this method is to
-     * "tap into" a method chain sequence in order to modify intermediate results.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Seq
-     * @param {*} value The value to provide to `interceptor`.
-     * @param {Function} interceptor The function to invoke.
-     * @returns {*} Returns `value`.
-     * @example
-     *
-     * _([1, 2, 3])
-     *  .tap(function(array) {
-     *    // Mutate input array.
-     *    array.pop();
-     *  })
-     *  .reverse()
-     *  .value();
-     * // => [2, 1]
-     */
-    function tap(value, interceptor) {
-      interceptor(value);
-      return value;
-    }
-
-    /**
-     * This method is like `_.tap` except that it returns the result of `interceptor`.
-     * The purpose of this method is to "pass thru" values replacing intermediate
-     * results in a method chain sequence.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Seq
-     * @param {*} value The value to provide to `interceptor`.
-     * @param {Function} interceptor The function to invoke.
-     * @returns {*} Returns the result of `interceptor`.
-     * @example
-     *
-     * _('  abc  ')
-     *  .chain()
-     *  .trim()
-     *  .thru(function(value) {
-     *    return [value];
-     *  })
-     *  .value();
-     * // => ['abc']
-     */
-    function thru(value, interceptor) {
-      return interceptor(value);
-    }
-
-    /**
-     * This method is the wrapper version of `_.at`.
-     *
-     * @name at
-     * @memberOf _
-     * @since 1.0.0
-     * @category Seq
-     * @param {...(string|string[])} [paths] The property paths of elements to pick.
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
-     *
-     * _(object).at(['a[0].b.c', 'a[1]']).value();
-     * // => [3, 4]
-     *
-     * _(['a', 'b', 'c']).at(0, 2).value();
-     * // => ['a', 'c']
-     */
-    var wrapperAt = rest(function(paths) {
-      paths = baseFlatten(paths, 1);
-      var length = paths.length,
-          start = length ? paths[0] : 0,
-          value = this.__wrapped__,
-          interceptor = function(object) { return baseAt(object, paths); };
-
-      if (length > 1 || this.__actions__.length ||
-          !(value instanceof LazyWrapper) || !isIndex(start)) {
-        return this.thru(interceptor);
-      }
-      value = value.slice(start, +start + (length ? 1 : 0));
-      value.__actions__.push({
-        'func': thru,
-        'args': [interceptor],
-        'thisArg': undefined
-      });
-      return new LodashWrapper(value, this.__chain__).thru(function(array) {
-        if (length && !array.length) {
-          array.push(undefined);
-        }
-        return array;
-      });
-    });
-
-    /**
-     * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
-     *
-     * @name chain
-     * @memberOf _
-     * @since 0.1.0
-     * @category Seq
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36 },
-     *   { 'user': 'fred',   'age': 40 }
-     * ];
-     *
-     * // A sequence without explicit chaining.
-     * _(users).head();
-     * // => { 'user': 'barney', 'age': 36 }
-     *
-     * // A sequence with explicit chaining.
-     * _(users)
-     *   .chain()
-     *   .head()
-     *   .pick('user')
-     *   .value();
-     * // => { 'user': 'barney' }
-     */
-    function wrapperChain() {
-      return chain(this);
-    }
-
-    /**
-     * Executes the chain sequence and returns the wrapped result.
-     *
-     * @name commit
-     * @memberOf _
-     * @since 3.2.0
-     * @category Seq
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * var array = [1, 2];
-     * var wrapped = _(array).push(3);
-     *
-     * console.log(array);
-     * // => [1, 2]
-     *
-     * wrapped = wrapped.commit();
-     * console.log(array);
-     * // => [1, 2, 3]
-     *
-     * wrapped.last();
-     * // => 3
-     *
-     * console.log(array);
-     * // => [1, 2, 3]
-     */
-    function wrapperCommit() {
-      return new LodashWrapper(this.value(), this.__chain__);
-    }
-
-    /**
-     * Gets the next value on a wrapped object following the
-     * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
-     *
-     * @name next
-     * @memberOf _
-     * @since 4.0.0
-     * @category Seq
-     * @returns {Object} Returns the next iterator value.
-     * @example
-     *
-     * var wrapped = _([1, 2]);
-     *
-     * wrapped.next();
-     * // => { 'done': false, 'value': 1 }
-     *
-     * wrapped.next();
-     * // => { 'done': false, 'value': 2 }
-     *
-     * wrapped.next();
-     * // => { 'done': true, 'value': undefined }
-     */
-    function wrapperNext() {
-      if (this.__values__ === undefined) {
-        this.__values__ = toArray(this.value());
-      }
-      var done = this.__index__ >= this.__values__.length,
-          value = done ? undefined : this.__values__[this.__index__++];
-
-      return { 'done': done, 'value': value };
-    }
-
-    /**
-     * Enables the wrapper to be iterable.
-     *
-     * @name Symbol.iterator
-     * @memberOf _
-     * @since 4.0.0
-     * @category Seq
-     * @returns {Object} Returns the wrapper object.
-     * @example
-     *
-     * var wrapped = _([1, 2]);
-     *
-     * wrapped[Symbol.iterator]() === wrapped;
-     * // => true
-     *
-     * Array.from(wrapped);
-     * // => [1, 2]
-     */
-    function wrapperToIterator() {
-      return this;
-    }
-
-    /**
-     * Creates a clone of the chain sequence planting `value` as the wrapped value.
-     *
-     * @name plant
-     * @memberOf _
-     * @since 3.2.0
-     * @category Seq
-     * @param {*} value The value to plant.
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * var wrapped = _([1, 2]).map(square);
-     * var other = wrapped.plant([3, 4]);
-     *
-     * other.value();
-     * // => [9, 16]
-     *
-     * wrapped.value();
-     * // => [1, 4]
-     */
-    function wrapperPlant(value) {
-      var result,
-          parent = this;
-
-      while (parent instanceof baseLodash) {
-        var clone = wrapperClone(parent);
-        clone.__index__ = 0;
-        clone.__values__ = undefined;
-        if (result) {
-          previous.__wrapped__ = clone;
-        } else {
-          result = clone;
-        }
-        var previous = clone;
-        parent = parent.__wrapped__;
-      }
-      previous.__wrapped__ = value;
-      return result;
-    }
-
-    /**
-     * This method is the wrapper version of `_.reverse`.
-     *
-     * **Note:** This method mutates the wrapped array.
-     *
-     * @name reverse
-     * @memberOf _
-     * @since 0.1.0
-     * @category Seq
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * var array = [1, 2, 3];
-     *
-     * _(array).reverse().value()
-     * // => [3, 2, 1]
-     *
-     * console.log(array);
-     * // => [3, 2, 1]
-     */
-    function wrapperReverse() {
-      var value = this.__wrapped__;
-      if (value instanceof LazyWrapper) {
-        var wrapped = value;
-        if (this.__actions__.length) {
-          wrapped = new LazyWrapper(this);
-        }
-        wrapped = wrapped.reverse();
-        wrapped.__actions__.push({
-          'func': thru,
-          'args': [reverse],
-          'thisArg': undefined
-        });
-        return new LodashWrapper(wrapped, this.__chain__);
-      }
-      return this.thru(reverse);
-    }
-
-    /**
-     * Executes the chain sequence to resolve the unwrapped value.
-     *
-     * @name value
-     * @memberOf _
-     * @since 0.1.0
-     * @alias toJSON, valueOf
-     * @category Seq
-     * @returns {*} Returns the resolved unwrapped value.
-     * @example
-     *
-     * _([1, 2, 3]).value();
-     * // => [1, 2, 3]
-     */
-    function wrapperValue() {
-      return baseWrapperValue(this.__wrapped__, this.__actions__);
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates an object composed of keys generated from the results of running
-     * each element of `collection` thru `iteratee`. The corresponding value of
-     * each key is the number of times the key was returned by `iteratee`. The
-     * iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.5.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee to transform keys.
-     * @returns {Object} Returns the composed aggregate object.
-     * @example
-     *
-     * _.countBy([6.1, 4.2, 6.3], Math.floor);
-     * // => { '4': 1, '6': 2 }
-     *
-     * _.countBy(['one', 'two', 'three'], 'length');
-     * // => { '3': 2, '5': 1 }
-     */
-    var countBy = createAggregator(function(result, value, key) {
-      hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
-    });
-
-    /**
-     * Checks if `predicate` returns truthy for **all** elements of `collection`.
-     * Iteration is stopped once `predicate` returns falsey. The predicate is
-     * invoked with three arguments: (value, index|key, collection).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {boolean} Returns `true` if all elements pass the predicate check,
-     *  else `false`.
-     * @example
-     *
-     * _.every([true, 1, null, 'yes'], Boolean);
-     * // => false
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36, 'active': false },
-     *   { 'user': 'fred',   'age': 40, 'active': false }
-     * ];
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.every(users, { 'user': 'barney', 'active': false });
-     * // => false
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.every(users, ['active', false]);
-     * // => true
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.every(users, 'active');
-     * // => false
-     */
-    function every(collection, predicate, guard) {
-      var func = isArray(collection) ? arrayEvery : baseEvery;
-      if (guard && isIterateeCall(collection, predicate, guard)) {
-        predicate = undefined;
-      }
-      return func(collection, getIteratee(predicate, 3));
-    }
-
-    /**
-     * Iterates over elements of `collection`, returning an array of all elements
-     * `predicate` returns truthy for. The predicate is invoked with three
-     * arguments: (value, index|key, collection).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new filtered array.
-     * @see _.reject
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36, 'active': true },
-     *   { 'user': 'fred',   'age': 40, 'active': false }
-     * ];
-     *
-     * _.filter(users, function(o) { return !o.active; });
-     * // => objects for ['fred']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.filter(users, { 'age': 36, 'active': true });
-     * // => objects for ['barney']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.filter(users, ['active', false]);
-     * // => objects for ['fred']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.filter(users, 'active');
-     * // => objects for ['barney']
-     */
-    function filter(collection, predicate) {
-      var func = isArray(collection) ? arrayFilter : baseFilter;
-      return func(collection, getIteratee(predicate, 3));
-    }
-
-    /**
-     * Iterates over elements of `collection`, returning the first element
-     * `predicate` returns truthy for. The predicate is invoked with three
-     * arguments: (value, index|key, collection).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {*} Returns the matched element, else `undefined`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'age': 36, 'active': true },
-     *   { 'user': 'fred',    'age': 40, 'active': false },
-     *   { 'user': 'pebbles', 'age': 1,  'active': true }
-     * ];
-     *
-     * _.find(users, function(o) { return o.age < 40; });
-     * // => object for 'barney'
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.find(users, { 'age': 1, 'active': true });
-     * // => object for 'pebbles'
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.find(users, ['active', false]);
-     * // => object for 'fred'
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.find(users, 'active');
-     * // => object for 'barney'
-     */
-    function find(collection, predicate) {
-      predicate = getIteratee(predicate, 3);
-      if (isArray(collection)) {
-        var index = baseFindIndex(collection, predicate);
-        return index > -1 ? collection[index] : undefined;
-      }
-      return baseFind(collection, predicate, baseEach);
-    }
-
-    /**
-     * This method is like `_.find` except that it iterates over elements of
-     * `collection` from right to left.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {*} Returns the matched element, else `undefined`.
-     * @example
-     *
-     * _.findLast([1, 2, 3, 4], function(n) {
-     *   return n % 2 == 1;
-     * });
-     * // => 3
-     */
-    function findLast(collection, predicate) {
-      predicate = getIteratee(predicate, 3);
-      if (isArray(collection)) {
-        var index = baseFindIndex(collection, predicate, true);
-        return index > -1 ? collection[index] : undefined;
-      }
-      return baseFind(collection, predicate, baseEachRight);
-    }
-
-    /**
-     * Creates a flattened array of values by running each element in `collection`
-     * thru `iteratee` and flattening the mapped results. The iteratee is invoked
-     * with three arguments: (value, index|key, collection).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * function duplicate(n) {
-     *   return [n, n];
-     * }
-     *
-     * _.flatMap([1, 2], duplicate);
-     * // => [1, 1, 2, 2]
-     */
-    function flatMap(collection, iteratee) {
-      return baseFlatten(map(collection, iteratee), 1);
-    }
-
-    /**
-     * This method is like `_.flatMap` except that it recursively flattens the
-     * mapped results.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.7.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * function duplicate(n) {
-     *   return [[[n, n]]];
-     * }
-     *
-     * _.flatMapDeep([1, 2], duplicate);
-     * // => [1, 1, 2, 2]
-     */
-    function flatMapDeep(collection, iteratee) {
-      return baseFlatten(map(collection, iteratee), INFINITY);
-    }
-
-    /**
-     * This method is like `_.flatMap` except that it recursively flattens the
-     * mapped results up to `depth` times.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.7.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @param {number} [depth=1] The maximum recursion depth.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * function duplicate(n) {
-     *   return [[[n, n]]];
-     * }
-     *
-     * _.flatMapDepth([1, 2], duplicate, 2);
-     * // => [[1, 1], [2, 2]]
-     */
-    function flatMapDepth(collection, iteratee, depth) {
-      depth = depth === undefined ? 1 : toInteger(depth);
-      return baseFlatten(map(collection, iteratee), depth);
-    }
-
-    /**
-     * Iterates over elements of `collection` and invokes `iteratee` for each element.
-     * The iteratee is invoked with three arguments: (value, index|key, collection).
-     * Iteratee functions may exit iteration early by explicitly returning `false`.
-     *
-     * **Note:** As with other "Collections" methods, objects with a "length"
-     * property are iterated like arrays. To avoid this behavior use `_.forIn`
-     * or `_.forOwn` for object iteration.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @alias each
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Array|Object} Returns `collection`.
-     * @see _.forEachRight
-     * @example
-     *
-     * _([1, 2]).forEach(function(value) {
-     *   console.log(value);
-     * });
-     * // => Logs `1` then `2`.
-     *
-     * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
-     *   console.log(key);
-     * });
-     * // => Logs 'a' then 'b' (iteration order is not guaranteed).
-     */
-    function forEach(collection, iteratee) {
-      return (typeof iteratee == 'function' && isArray(collection))
-        ? arrayEach(collection, iteratee)
-        : baseEach(collection, getIteratee(iteratee));
-    }
-
-    /**
-     * This method is like `_.forEach` except that it iterates over elements of
-     * `collection` from right to left.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @alias eachRight
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Array|Object} Returns `collection`.
-     * @see _.forEach
-     * @example
-     *
-     * _.forEachRight([1, 2], function(value) {
-     *   console.log(value);
-     * });
-     * // => Logs `2` then `1`.
-     */
-    function forEachRight(collection, iteratee) {
-      return (typeof iteratee == 'function' && isArray(collection))
-        ? arrayEachRight(collection, iteratee)
-        : baseEachRight(collection, getIteratee(iteratee));
-    }
-
-    /**
-     * Creates an object composed of keys generated from the results of running
-     * each element of `collection` thru `iteratee`. The order of grouped values
-     * is determined by the order they occur in `collection`. The corresponding
-     * value of each key is an array of elements responsible for generating the
-     * key. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee to transform keys.
-     * @returns {Object} Returns the composed aggregate object.
-     * @example
-     *
-     * _.groupBy([6.1, 4.2, 6.3], Math.floor);
-     * // => { '4': [4.2], '6': [6.1, 6.3] }
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.groupBy(['one', 'two', 'three'], 'length');
-     * // => { '3': ['one', 'two'], '5': ['three'] }
-     */
-    var groupBy = createAggregator(function(result, value, key) {
-      if (hasOwnProperty.call(result, key)) {
-        result[key].push(value);
-      } else {
-        result[key] = [value];
-      }
-    });
-
-    /**
-     * Checks if `value` is in `collection`. If `collection` is a string, it's
-     * checked for a substring of `value`, otherwise
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * is used for equality comparisons. If `fromIndex` is negative, it's used as
-     * the offset from the end of `collection`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object|string} collection The collection to search.
-     * @param {*} value The value to search for.
-     * @param {number} [fromIndex=0] The index to search from.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
-     * @returns {boolean} Returns `true` if `value` is found, else `false`.
-     * @example
-     *
-     * _.includes([1, 2, 3], 1);
-     * // => true
-     *
-     * _.includes([1, 2, 3], 1, 2);
-     * // => false
-     *
-     * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
-     * // => true
-     *
-     * _.includes('pebbles', 'eb');
-     * // => true
-     */
-    function includes(collection, value, fromIndex, guard) {
-      collection = isArrayLike(collection) ? collection : values(collection);
-      fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
-
-      var length = collection.length;
-      if (fromIndex < 0) {
-        fromIndex = nativeMax(length + fromIndex, 0);
-      }
-      return isString(collection)
-        ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
-        : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
-    }
-
-    /**
-     * Invokes the method at `path` of each element in `collection`, returning
-     * an array of the results of each invoked method. Any additional arguments
-     * are provided to each invoked method. If `methodName` is a function, it's
-     * invoked for and `this` bound to, each element in `collection`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|string} path The path of the method to invoke or
-     *  the function invoked per iteration.
-     * @param {...*} [args] The arguments to invoke each method with.
-     * @returns {Array} Returns the array of results.
-     * @example
-     *
-     * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
-     * // => [[1, 5, 7], [1, 2, 3]]
-     *
-     * _.invokeMap([123, 456], String.prototype.split, '');
-     * // => [['1', '2', '3'], ['4', '5', '6']]
-     */
-    var invokeMap = rest(function(collection, path, args) {
-      var index = -1,
-          isFunc = typeof path == 'function',
-          isProp = isKey(path),
-          result = isArrayLike(collection) ? Array(collection.length) : [];
-
-      baseEach(collection, function(value) {
-        var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
-        result[++index] = func ? apply(func, value, args) : baseInvoke(value, path, args);
-      });
-      return result;
-    });
-
-    /**
-     * Creates an object composed of keys generated from the results of running
-     * each element of `collection` thru `iteratee`. The corresponding value of
-     * each key is the last element responsible for generating the key. The
-     * iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee to transform keys.
-     * @returns {Object} Returns the composed aggregate object.
-     * @example
-     *
-     * var array = [
-     *   { 'dir': 'left', 'code': 97 },
-     *   { 'dir': 'right', 'code': 100 }
-     * ];
-     *
-     * _.keyBy(array, function(o) {
-     *   return String.fromCharCode(o.code);
-     * });
-     * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
-     *
-     * _.keyBy(array, 'dir');
-     * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
-     */
-    var keyBy = createAggregator(function(result, value, key) {
-      result[key] = value;
-    });
-
-    /**
-     * Creates an array of values by running each element in `collection` thru
-     * `iteratee`. The iteratee is invoked with three arguments:
-     * (value, index|key, collection).
-     *
-     * Many lodash methods are guarded to work as iteratees for methods like
-     * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
-     *
-     * The guarded methods are:
-     * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
-     * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
-     * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
-     * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new mapped array.
-     * @example
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * _.map([4, 8], square);
-     * // => [16, 64]
-     *
-     * _.map({ 'a': 4, 'b': 8 }, square);
-     * // => [16, 64] (iteration order is not guaranteed)
-     *
-     * var users = [
-     *   { 'user': 'barney' },
-     *   { 'user': 'fred' }
-     * ];
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.map(users, 'user');
-     * // => ['barney', 'fred']
-     */
-    function map(collection, iteratee) {
-      var func = isArray(collection) ? arrayMap : baseMap;
-      return func(collection, getIteratee(iteratee, 3));
-    }
-
-    /**
-     * This method is like `_.sortBy` except that it allows specifying the sort
-     * orders of the iteratees to sort by. If `orders` is unspecified, all values
-     * are sorted in ascending order. Otherwise, specify an order of "desc" for
-     * descending or "asc" for ascending sort order of corresponding values.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
-     *  The iteratees to sort by.
-     * @param {string[]} [orders] The sort orders of `iteratees`.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
-     * @returns {Array} Returns the new sorted array.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'fred',   'age': 48 },
-     *   { 'user': 'barney', 'age': 34 },
-     *   { 'user': 'fred',   'age': 40 },
-     *   { 'user': 'barney', 'age': 36 }
-     * ];
-     *
-     * // Sort by `user` in ascending order and by `age` in descending order.
-     * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
-     * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
-     */
-    function orderBy(collection, iteratees, orders, guard) {
-      if (collection == null) {
-        return [];
-      }
-      if (!isArray(iteratees)) {
-        iteratees = iteratees == null ? [] : [iteratees];
-      }
-      orders = guard ? undefined : orders;
-      if (!isArray(orders)) {
-        orders = orders == null ? [] : [orders];
-      }
-      return baseOrderBy(collection, iteratees, orders);
-    }
-
-    /**
-     * Creates an array of elements split into two groups, the first of which
-     * contains elements `predicate` returns truthy for, the second of which
-     * contains elements `predicate` returns falsey for. The predicate is
-     * invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the array of grouped elements.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'age': 36, 'active': false },
-     *   { 'user': 'fred',    'age': 40, 'active': true },
-     *   { 'user': 'pebbles', 'age': 1,  'active': false }
-     * ];
-     *
-     * _.partition(users, function(o) { return o.active; });
-     * // => objects for [['fred'], ['barney', 'pebbles']]
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.partition(users, { 'age': 1, 'active': false });
-     * // => objects for [['pebbles'], ['barney', 'fred']]
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.partition(users, ['active', false]);
-     * // => objects for [['barney', 'pebbles'], ['fred']]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.partition(users, 'active');
-     * // => objects for [['fred'], ['barney', 'pebbles']]
-     */
-    var partition = createAggregator(function(result, value, key) {
-      result[key ? 0 : 1].push(value);
-    }, function() { return [[], []]; });
-
-    /**
-     * Reduces `collection` to a value which is the accumulated result of running
-     * each element in `collection` thru `iteratee`, where each successive
-     * invocation is supplied the return value of the previous. If `accumulator`
-     * is not given, the first element of `collection` is used as the initial
-     * value. The iteratee is invoked with four arguments:
-     * (accumulator, value, index|key, collection).
-     *
-     * Many lodash methods are guarded to work as iteratees for methods like
-     * `_.reduce`, `_.reduceRight`, and `_.transform`.
-     *
-     * The guarded methods are:
-     * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
-     * and `sortBy`
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @param {*} [accumulator] The initial value.
-     * @returns {*} Returns the accumulated value.
-     * @see _.reduceRight
-     * @example
-     *
-     * _.reduce([1, 2], function(sum, n) {
-     *   return sum + n;
-     * }, 0);
-     * // => 3
-     *
-     * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
-     *   (result[value] || (result[value] = [])).push(key);
-     *   return result;
-     * }, {});
-     * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
-     */
-    function reduce(collection, iteratee, accumulator) {
-      var func = isArray(collection) ? arrayReduce : baseReduce,
-          initAccum = arguments.length < 3;
-
-      return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
-    }
-
-    /**
-     * This method is like `_.reduce` except that it iterates over elements of
-     * `collection` from right to left.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @param {*} [accumulator] The initial value.
-     * @returns {*} Returns the accumulated value.
-     * @see _.reduce
-     * @example
-     *
-     * var array = [[0, 1], [2, 3], [4, 5]];
-     *
-     * _.reduceRight(array, function(flattened, other) {
-     *   return flattened.concat(other);
-     * }, []);
-     * // => [4, 5, 2, 3, 0, 1]
-     */
-    function reduceRight(collection, iteratee, accumulator) {
-      var func = isArray(collection) ? arrayReduceRight : baseReduce,
-          initAccum = arguments.length < 3;
-
-      return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
-    }
-
-    /**
-     * The opposite of `_.filter`; this method returns the elements of `collection`
-     * that `predicate` does **not** return truthy for.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new filtered array.
-     * @see _.filter
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36, 'active': false },
-     *   { 'user': 'fred',   'age': 40, 'active': true }
-     * ];
-     *
-     * _.reject(users, function(o) { return !o.active; });
-     * // => objects for ['fred']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.reject(users, { 'age': 40, 'active': true });
-     * // => objects for ['barney']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.reject(users, ['active', false]);
-     * // => objects for ['fred']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.reject(users, 'active');
-     * // => objects for ['barney']
-     */
-    function reject(collection, predicate) {
-      var func = isArray(collection) ? arrayFilter : baseFilter;
-      predicate = getIteratee(predicate, 3);
-      return func(collection, function(value, index, collection) {
-        return !predicate(value, index, collection);
-      });
-    }
-
-    /**
-     * Gets a random element from `collection`.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to sample.
-     * @returns {*} Returns the random element.
-     * @example
-     *
-     * _.sample([1, 2, 3, 4]);
-     * // => 2
-     */
-    function sample(collection) {
-      var array = isArrayLike(collection) ? collection : values(collection),
-          length = array.length;
-
-      return length > 0 ? array[baseRandom(0, length - 1)] : undefined;
-    }
-
-    /**
-     * Gets `n` random elements at unique keys from `collection` up to the
-     * size of `collection`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to sample.
-     * @param {number} [n=1] The number of elements to sample.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the random elements.
-     * @example
-     *
-     * _.sampleSize([1, 2, 3], 2);
-     * // => [3, 1]
-     *
-     * _.sampleSize([1, 2, 3], 4);
-     * // => [2, 3, 1]
-     */
-    function sampleSize(collection, n, guard) {
-      var index = -1,
-          result = toArray(collection),
-          length = result.length,
-          lastIndex = length - 1;
-
-      if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
-        n = 1;
-      } else {
-        n = baseClamp(toInteger(n), 0, length);
-      }
-      while (++index < n) {
-        var rand = baseRandom(index, lastIndex),
-            value = result[rand];
-
-        result[rand] = result[index];
-        result[index] = value;
-      }
-      result.length = n;
-      return result;
-    }
-
-    /**
-     * Creates an array of shuffled values, using a version of the
-     * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to shuffle.
-     * @returns {Array} Returns the new shuffled array.
-     * @example
-     *
-     * _.shuffle([1, 2, 3, 4]);
-     * // => [4, 1, 3, 2]
-     */
-    function shuffle(collection) {
-      return sampleSize(collection, MAX_ARRAY_LENGTH);
-    }
-
-    /**
-     * Gets the size of `collection` by returning its length for array-like
-     * values or the number of own enumerable string keyed properties for objects.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to inspect.
-     * @returns {number} Returns the collection size.
-     * @example
-     *
-     * _.size([1, 2, 3]);
-     * // => 3
-     *
-     * _.size({ 'a': 1, 'b': 2 });
-     * // => 2
-     *
-     * _.size('pebbles');
-     * // => 7
-     */
-    function size(collection) {
-      if (collection == null) {
-        return 0;
-      }
-      if (isArrayLike(collection)) {
-        var result = collection.length;
-        return (result && isString(collection)) ? stringSize(collection) : result;
-      }
-      if (isObjectLike(collection)) {
-        var tag = getTag(collection);
-        if (tag == mapTag || tag == setTag) {
-          return collection.size;
-        }
-      }
-      return keys(collection).length;
-    }
-
-    /**
-     * Checks if `predicate` returns truthy for **any** element of `collection`.
-     * Iteration is stopped once `predicate` returns truthy. The predicate is
-     * invoked with three arguments: (value, index|key, collection).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {boolean} Returns `true` if any element passes the predicate check,
-     *  else `false`.
-     * @example
-     *
-     * _.some([null, 0, 'yes', false], Boolean);
-     * // => true
-     *
-     * var users = [
-     *   { 'user': 'barney', 'active': true },
-     *   { 'user': 'fred',   'active': false }
-     * ];
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.some(users, { 'user': 'barney', 'active': false });
-     * // => false
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.some(users, ['active', false]);
-     * // => true
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.some(users, 'active');
-     * // => true
-     */
-    function some(collection, predicate, guard) {
-      var func = isArray(collection) ? arraySome : baseSome;
-      if (guard && isIterateeCall(collection, predicate, guard)) {
-        predicate = undefined;
-      }
-      return func(collection, getIteratee(predicate, 3));
-    }
-
-    /**
-     * Creates an array of elements, sorted in ascending order by the results of
-     * running each element in a collection thru each iteratee. This method
-     * performs a stable sort, that is, it preserves the original sort order of
-     * equal elements. The iteratees are invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
-     *  [iteratees=[_.identity]] The iteratees to sort by.
-     * @returns {Array} Returns the new sorted array.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'fred',   'age': 48 },
-     *   { 'user': 'barney', 'age': 36 },
-     *   { 'user': 'fred',   'age': 40 },
-     *   { 'user': 'barney', 'age': 34 }
-     * ];
-     *
-     * _.sortBy(users, function(o) { return o.user; });
-     * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
-     *
-     * _.sortBy(users, ['user', 'age']);
-     * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
-     *
-     * _.sortBy(users, 'user', function(o) {
-     *   return Math.floor(o.age / 10);
-     * });
-     * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
-     */
-    var sortBy = rest(function(collection, iteratees) {
-      if (collection == null) {
-        return [];
-      }
-      var length = iteratees.length;
-      if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
-        iteratees = [];
-      } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
-        iteratees = [iteratees[0]];
-      }
-      iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
-        ? iteratees[0]
-        : baseFlatten(iteratees, 1, isFlattenableIteratee);
-
-      return baseOrderBy(collection, iteratees, []);
-    });
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Gets the timestamp of the number of milliseconds that have elapsed since
-     * the Unix epoch (1 January 1970 00:00:00 UTC).
-     *
-     * @static
-     * @memberOf _
-     * @since 2.4.0
-     * @type {Function}
-     * @category Date
-     * @returns {number} Returns the timestamp.
-     * @example
-     *
-     * _.defer(function(stamp) {
-     *   console.log(_.now() - stamp);
-     * }, _.now());
-     * // => Logs the number of milliseconds it took for the deferred function to be invoked.
-     */
-    var now = Date.now;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * The opposite of `_.before`; this method creates a function that invokes
-     * `func` once it's called `n` or more times.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {number} n The number of calls before `func` is invoked.
-     * @param {Function} func The function to restrict.
-     * @returns {Function} Returns the new restricted function.
-     * @example
-     *
-     * var saves = ['profile', 'settings'];
-     *
-     * var done = _.after(saves.length, function() {
-     *   console.log('done saving!');
-     * });
-     *
-     * _.forEach(saves, function(type) {
-     *   asyncSave({ 'type': type, 'complete': done });
-     * });
-     * // => Logs 'done saving!' after the two async saves have completed.
-     */
-    function after(n, func) {
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      n = toInteger(n);
-      return function() {
-        if (--n < 1) {
-          return func.apply(this, arguments);
-        }
-      };
-    }
-
-    /**
-     * Creates a function that invokes `func`, with up to `n` arguments,
-     * ignoring any additional arguments.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Function
-     * @param {Function} func The function to cap arguments for.
-     * @param {number} [n=func.length] The arity cap.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * _.map(['6', '8', '10'], _.ary(parseInt, 1));
-     * // => [6, 8, 10]
-     */
-    function ary(func, n, guard) {
-      n = guard ? undefined : n;
-      n = (func && n == null) ? func.length : n;
-      return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
-    }
-
-    /**
-     * Creates a function that invokes `func`, with the `this` binding and arguments
-     * of the created function, while it's called less than `n` times. Subsequent
-     * calls to the created function return the result of the last `func` invocation.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Function
-     * @param {number} n The number of calls at which `func` is no longer invoked.
-     * @param {Function} func The function to restrict.
-     * @returns {Function} Returns the new restricted function.
-     * @example
-     *
-     * jQuery(element).on('click', _.before(5, addContactToList));
-     * // => allows adding up to 4 contacts to the list
-     */
-    function before(n, func) {
-      var result;
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      n = toInteger(n);
-      return function() {
-        if (--n > 0) {
-          result = func.apply(this, arguments);
-        }
-        if (n <= 1) {
-          func = undefined;
-        }
-        return result;
-      };
-    }
-
-    /**
-     * Creates a function that invokes `func` with the `this` binding of `thisArg`
-     * and `partials` prepended to the arguments it receives.
-     *
-     * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
-     * may be used as a placeholder for partially applied arguments.
-     *
-     * **Note:** Unlike native `Function#bind` this method doesn't set the "length"
-     * property of bound functions.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to bind.
-     * @param {*} thisArg The `this` binding of `func`.
-     * @param {...*} [partials] The arguments to be partially applied.
-     * @returns {Function} Returns the new bound function.
-     * @example
-     *
-     * var greet = function(greeting, punctuation) {
-     *   return greeting + ' ' + this.user + punctuation;
-     * };
-     *
-     * var object = { 'user': 'fred' };
-     *
-     * var bound = _.bind(greet, object, 'hi');
-     * bound('!');
-     * // => 'hi fred!'
-     *
-     * // Bound with placeholders.
-     * var bound = _.bind(greet, object, _, '!');
-     * bound('hi');
-     * // => 'hi fred!'
-     */
-    var bind = rest(function(func, thisArg, partials) {
-      var bitmask = BIND_FLAG;
-      if (partials.length) {
-        var holders = replaceHolders(partials, getPlaceholder(bind));
-        bitmask |= PARTIAL_FLAG;
-      }
-      return createWrapper(func, bitmask, thisArg, partials, holders);
-    });
-
-    /**
-     * Creates a function that invokes the method at `object[key]` with `partials`
-     * prepended to the arguments it receives.
-     *
-     * This method differs from `_.bind` by allowing bound functions to reference
-     * methods that may be redefined or don't yet exist. See
-     * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
-     * for more details.
-     *
-     * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
-     * builds, may be used as a placeholder for partially applied arguments.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.10.0
-     * @category Function
-     * @param {Object} object The object to invoke the method on.
-     * @param {string} key The key of the method.
-     * @param {...*} [partials] The arguments to be partially applied.
-     * @returns {Function} Returns the new bound function.
-     * @example
-     *
-     * var object = {
-     *   'user': 'fred',
-     *   'greet': function(greeting, punctuation) {
-     *     return greeting + ' ' + this.user + punctuation;
-     *   }
-     * };
-     *
-     * var bound = _.bindKey(object, 'greet', 'hi');
-     * bound('!');
-     * // => 'hi fred!'
-     *
-     * object.greet = function(greeting, punctuation) {
-     *   return greeting + 'ya ' + this.user + punctuation;
-     * };
-     *
-     * bound('!');
-     * // => 'hiya fred!'
-     *
-     * // Bound with placeholders.
-     * var bound = _.bindKey(object, 'greet', _, '!');
-     * bound('hi');
-     * // => 'hiya fred!'
-     */
-    var bindKey = rest(function(object, key, partials) {
-      var bitmask = BIND_FLAG | BIND_KEY_FLAG;
-      if (partials.length) {
-        var holders = replaceHolders(partials, getPlaceholder(bindKey));
-        bitmask |= PARTIAL_FLAG;
-      }
-      return createWrapper(key, bitmask, object, partials, holders);
-    });
-
-    /**
-     * Creates a function that accepts arguments of `func` and either invokes
-     * `func` returning its result, if at least `arity` number of arguments have
-     * been provided, or returns a function that accepts the remaining `func`
-     * arguments, and so on. The arity of `func` may be specified if `func.length`
-     * is not sufficient.
-     *
-     * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
-     * may be used as a placeholder for provided arguments.
-     *
-     * **Note:** This method doesn't set the "length" property of curried functions.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Function
-     * @param {Function} func The function to curry.
-     * @param {number} [arity=func.length] The arity of `func`.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Function} Returns the new curried function.
-     * @example
-     *
-     * var abc = function(a, b, c) {
-     *   return [a, b, c];
-     * };
-     *
-     * var curried = _.curry(abc);
-     *
-     * curried(1)(2)(3);
-     * // => [1, 2, 3]
-     *
-     * curried(1, 2)(3);
-     * // => [1, 2, 3]
-     *
-     * curried(1, 2, 3);
-     * // => [1, 2, 3]
-     *
-     * // Curried with placeholders.
-     * curried(1)(_, 3)(2);
-     * // => [1, 2, 3]
-     */
-    function curry(func, arity, guard) {
-      arity = guard ? undefined : arity;
-      var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
-      result.placeholder = curry.placeholder;
-      return result;
-    }
-
-    /**
-     * This method is like `_.curry` except that arguments are applied to `func`
-     * in the manner of `_.partialRight` instead of `_.partial`.
-     *
-     * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
-     * builds, may be used as a placeholder for provided arguments.
-     *
-     * **Note:** This method doesn't set the "length" property of curried functions.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Function
-     * @param {Function} func The function to curry.
-     * @param {number} [arity=func.length] The arity of `func`.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Function} Returns the new curried function.
-     * @example
-     *
-     * var abc = function(a, b, c) {
-     *   return [a, b, c];
-     * };
-     *
-     * var curried = _.curryRight(abc);
-     *
-     * curried(3)(2)(1);
-     * // => [1, 2, 3]
-     *
-     * curried(2, 3)(1);
-     * // => [1, 2, 3]
-     *
-     * curried(1, 2, 3);
-     * // => [1, 2, 3]
-     *
-     * // Curried with placeholders.
-     * curried(3)(1, _)(2);
-     * // => [1, 2, 3]
-     */
-    function curryRight(func, arity, guard) {
-      arity = guard ? undefined : arity;
-      var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
-      result.placeholder = curryRight.placeholder;
-      return result;
-    }
-
-    /**
-     * Creates a debounced function that delays invoking `func` until after `wait`
-     * milliseconds have elapsed since the last time the debounced function was
-     * invoked. The debounced function comes with a `cancel` method to cancel
-     * delayed `func` invocations and a `flush` method to immediately invoke them.
-     * Provide an options object to indicate whether `func` should be invoked on
-     * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
-     * with the last arguments provided to the debounced function. Subsequent calls
-     * to the debounced function return the result of the last `func` invocation.
-     *
-     * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
-     * on the trailing edge of the timeout only if the debounced function is
-     * invoked more than once during the `wait` timeout.
-     *
-     * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
-     * for details over the differences between `_.debounce` and `_.throttle`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to debounce.
-     * @param {number} [wait=0] The number of milliseconds to delay.
-     * @param {Object} [options={}] The options object.
-     * @param {boolean} [options.leading=false]
-     *  Specify invoking on the leading edge of the timeout.
-     * @param {number} [options.maxWait]
-     *  The maximum time `func` is allowed to be delayed before it's invoked.
-     * @param {boolean} [options.trailing=true]
-     *  Specify invoking on the trailing edge of the timeout.
-     * @returns {Function} Returns the new debounced function.
-     * @example
-     *
-     * // Avoid costly calculations while the window size is in flux.
-     * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
-     *
-     * // Invoke `sendMail` when clicked, debouncing subsequent calls.
-     * jQuery(element).on('click', _.debounce(sendMail, 300, {
-     *   'leading': true,
-     *   'trailing': false
-     * }));
-     *
-     * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
-     * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
-     * var source = new EventSource('/stream');
-     * jQuery(source).on('message', debounced);
-     *
-     * // Cancel the trailing debounced invocation.
-     * jQuery(window).on('popstate', debounced.cancel);
-     */
-    function debounce(func, wait, options) {
-      var lastArgs,
-          lastThis,
-          maxWait,
-          result,
-          timerId,
-          lastCallTime = 0,
-          lastInvokeTime = 0,
-          leading = false,
-          maxing = false,
-          trailing = true;
-
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      wait = toNumber(wait) || 0;
-      if (isObject(options)) {
-        leading = !!options.leading;
-        maxing = 'maxWait' in options;
-        maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
-        trailing = 'trailing' in options ? !!options.trailing : trailing;
-      }
-
-      function invokeFunc(time) {
-        var args = lastArgs,
-            thisArg = lastThis;
-
-        lastArgs = lastThis = undefined;
-        lastInvokeTime = time;
-        result = func.apply(thisArg, args);
-        return result;
-      }
-
-      function leadingEdge(time) {
-        // Reset any `maxWait` timer.
-        lastInvokeTime = time;
-        // Start the timer for the trailing edge.
-        timerId = setTimeout(timerExpired, wait);
-        // Invoke the leading edge.
-        return leading ? invokeFunc(time) : result;
-      }
-
-      function remainingWait(time) {
-        var timeSinceLastCall = time - lastCallTime,
-            timeSinceLastInvoke = time - lastInvokeTime,
-            result = wait - timeSinceLastCall;
-
-        return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
-      }
-
-      function shouldInvoke(time) {
-        var timeSinceLastCall = time - lastCallTime,
-            timeSinceLastInvoke = time - lastInvokeTime;
-
-        // Either this is the first call, activity has stopped and we're at the
-        // trailing edge, the system time has gone backwards and we're treating
-        // it as the trailing edge, or we've hit the `maxWait` limit.
-        return (!lastCallTime || (timeSinceLastCall >= wait) ||
-          (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
-      }
-
-      function timerExpired() {
-        var time = now();
-        if (shouldInvoke(time)) {
-          return trailingEdge(time);
-        }
-        // Restart the timer.
-        timerId = setTimeout(timerExpired, remainingWait(time));
-      }
-
-      function trailingEdge(time) {
-        clearTimeout(timerId);
-        timerId = undefined;
-
-        // Only invoke if we have `lastArgs` which means `func` has been
-        // debounced at least once.
-        if (trailing && lastArgs) {
-          return invokeFunc(time);
-        }
-        lastArgs = lastThis = undefined;
-        return result;
-      }
-
-      function cancel() {
-        if (timerId !== undefined) {
-          clearTimeout(timerId);
-        }
-        lastCallTime = lastInvokeTime = 0;
-        lastArgs = lastThis = timerId = undefined;
-      }
-
-      function flush() {
-        return timerId === undefined ? result : trailingEdge(now());
-      }
-
-      function debounced() {
-        var time = now(),
-            isInvoking = shouldInvoke(time);
-
-        lastArgs = arguments;
-        lastThis = this;
-        lastCallTime = time;
-
-        if (isInvoking) {
-          if (timerId === undefined) {
-            return leadingEdge(lastCallTime);
-          }
-          if (maxing) {
-            // Handle invocations in a tight loop.
-            clearTimeout(timerId);
-            timerId = setTimeout(timerExpired, wait);
-            return invokeFunc(lastCallTime);
-          }
-        }
-        if (timerId === undefined) {
-          timerId = setTimeout(timerExpired, wait);
-        }
-        return result;
-      }
-      debounced.cancel = cancel;
-      debounced.flush = flush;
-      return debounced;
-    }
-
-    /**
-     * Defers invoking the `func` until the current call stack has cleared. Any
-     * additional arguments are provided to `func` when it's invoked.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to defer.
-     * @param {...*} [args] The arguments to invoke `func` with.
-     * @returns {number} Returns the timer id.
-     * @example
-     *
-     * _.defer(function(text) {
-     *   console.log(text);
-     * }, 'deferred');
-     * // => Logs 'deferred' after one or more milliseconds.
-     */
-    var defer = rest(function(func, args) {
-      return baseDelay(func, 1, args);
-    });
-
-    /**
-     * Invokes `func` after `wait` milliseconds. Any additional arguments are
-     * provided to `func` when it's invoked.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to delay.
-     * @param {number} wait The number of milliseconds to delay invocation.
-     * @param {...*} [args] The arguments to invoke `func` with.
-     * @returns {number} Returns the timer id.
-     * @example
-     *
-     * _.delay(function(text) {
-     *   console.log(text);
-     * }, 1000, 'later');
-     * // => Logs 'later' after one second.
-     */
-    var delay = rest(function(func, wait, args) {
-      return baseDelay(func, toNumber(wait) || 0, args);
-    });
-
-    /**
-     * Creates a function that invokes `func` with arguments reversed.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Function
-     * @param {Function} func The function to flip arguments for.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var flipped = _.flip(function() {
-     *   return _.toArray(arguments);
-     * });
-     *
-     * flipped('a', 'b', 'c', 'd');
-     * // => ['d', 'c', 'b', 'a']
-     */
-    function flip(func) {
-      return createWrapper(func, FLIP_FLAG);
-    }
-
-    /**
-     * Creates a function that memoizes the result of `func`. If `resolver` is
-     * provided, it determines the cache key for storing the result based on the
-     * arguments provided to the memoized function. By default, the first argument
-     * provided to the memoized function is used as the map cache key. The `func`
-     * is invoked with the `this` binding of the memoized function.
-     *
-     * **Note:** The cache is exposed as the `cache` property on the memoized
-     * function. Its creation may be customized by replacing the `_.memoize.Cache`
-     * constructor with one whose instances implement the
-     * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
-     * method interface of `delete`, `get`, `has`, and `set`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to have its output memoized.
-     * @param {Function} [resolver] The function to resolve the cache key.
-     * @returns {Function} Returns the new memoizing function.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': 2 };
-     * var other = { 'c': 3, 'd': 4 };
-     *
-     * var values = _.memoize(_.values);
-     * values(object);
-     * // => [1, 2]
-     *
-     * values(other);
-     * // => [3, 4]
-     *
-     * object.a = 2;
-     * values(object);
-     * // => [1, 2]
-     *
-     * // Modify the result cache.
-     * values.cache.set(object, ['a', 'b']);
-     * values(object);
-     * // => ['a', 'b']
-     *
-     * // Replace `_.memoize.Cache`.
-     * _.memoize.Cache = WeakMap;
-     */
-    function memoize(func, resolver) {
-      if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      var memoized = function() {
-        var args = arguments,
-            key = resolver ? resolver.apply(this, args) : args[0],
-            cache = memoized.cache;
-
-        if (cache.has(key)) {
-          return cache.get(key);
-        }
-        var result = func.apply(this, args);
-        memoized.cache = cache.set(key, result);
-        return result;
-      };
-      memoized.cache = new (memoize.Cache || MapCache);
-      return memoized;
-    }
-
-    // Assign cache to `_.memoize`.
-    memoize.Cache = MapCache;
-
-    /**
-     * Creates a function that negates the result of the predicate `func`. The
-     * `func` predicate is invoked with the `this` binding and arguments of the
-     * created function.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Function
-     * @param {Function} predicate The predicate to negate.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * function isEven(n) {
-     *   return n % 2 == 0;
-     * }
-     *
-     * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
-     * // => [1, 3, 5]
-     */
-    function negate(predicate) {
-      if (typeof predicate != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      return function() {
-        return !predicate.apply(this, arguments);
-      };
-    }
-
-    /**
-     * Creates a function that is restricted to invoking `func` once. Repeat calls
-     * to the function return the value of the first invocation. The `func` is
-     * invoked with the `this` binding and arguments of the created function.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to restrict.
-     * @returns {Function} Returns the new restricted function.
-     * @example
-     *
-     * var initialize = _.once(createApplication);
-     * initialize();
-     * initialize();
-     * // `initialize` invokes `createApplication` once
-     */
-    function once(func) {
-      return before(2, func);
-    }
-
-    /**
-     * Creates a function that invokes `func` with arguments transformed by
-     * corresponding `transforms`.
-     *
-     * @static
-     * @since 4.0.0
-     * @memberOf _
-     * @category Function
-     * @param {Function} func The function to wrap.
-     * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
-     *  [transforms[_.identity]] The functions to transform.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * function doubled(n) {
-     *   return n * 2;
-     * }
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * var func = _.overArgs(function(x, y) {
-     *   return [x, y];
-     * }, square, doubled);
-     *
-     * func(9, 3);
-     * // => [81, 6]
-     *
-     * func(10, 5);
-     * // => [100, 10]
-     */
-    var overArgs = rest(function(func, transforms) {
-      transforms = (transforms.length == 1 && isArray(transforms[0]))
-        ? arrayMap(transforms[0], baseUnary(getIteratee()))
-        : arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), baseUnary(getIteratee()));
-
-      var funcsLength = transforms.length;
-      return rest(function(args) {
-        var index = -1,
-            length = nativeMin(args.length, funcsLength);
-
-        while (++index < length) {
-          args[index] = transforms[index].call(this, args[index]);
-        }
-        return apply(func, this, args);
-      });
-    });
-
-    /**
-     * Creates a function that invokes `func` with `partials` prepended to the
-     * arguments it receives. This method is like `_.bind` except it does **not**
-     * alter the `this` binding.
-     *
-     * The `_.partial.placeholder` value, which defaults to `_` in monolithic
-     * builds, may be used as a placeholder for partially applied arguments.
-     *
-     * **Note:** This method doesn't set the "length" property of partially
-     * applied functions.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.2.0
-     * @category Function
-     * @param {Function} func The function to partially apply arguments to.
-     * @param {...*} [partials] The arguments to be partially applied.
-     * @returns {Function} Returns the new partially applied function.
-     * @example
-     *
-     * var greet = function(greeting, name) {
-     *   return greeting + ' ' + name;
-     * };
-     *
-     * var sayHelloTo = _.partial(greet, 'hello');
-     * sayHelloTo('fred');
-     * // => 'hello fred'
-     *
-     * // Partially applied with placeholders.
-     * var greetFred = _.partial(greet, _, 'fred');
-     * greetFred('hi');
-     * // => 'hi fred'
-     */
-    var partial = rest(function(func, partials) {
-      var holders = replaceHolders(partials, getPlaceholder(partial));
-      return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);
-    });
-
-    /**
-     * This method is like `_.partial` except that partially applied arguments
-     * are appended to the arguments it receives.
-     *
-     * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
-     * builds, may be used as a placeholder for partially applied arguments.
-     *
-     * **Note:** This method doesn't set the "length" property of partially
-     * applied functions.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.0.0
-     * @category Function
-     * @param {Function} func The function to partially apply arguments to.
-     * @param {...*} [partials] The arguments to be partially applied.
-     * @returns {Function} Returns the new partially applied function.
-     * @example
-     *
-     * var greet = function(greeting, name) {
-     *   return greeting + ' ' + name;
-     * };
-     *
-     * var greetFred = _.partialRight(greet, 'fred');
-     * greetFred('hi');
-     * // => 'hi fred'
-     *
-     * // Partially applied with placeholders.
-     * var sayHelloTo = _.partialRight(greet, 'hello', _);
-     * sayHelloTo('fred');
-     * // => 'hello fred'
-     */
-    var partialRight = rest(function(func, partials) {
-      var holders = replaceHolders(partials, getPlaceholder(partialRight));
-      return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
-    });
-
-    /**
-     * Creates a function that invokes `func` with arguments arranged according
-     * to the specified `indexes` where the argument value at the first index is
-     * provided as the first argument, the argument value at the second index is
-     * provided as the second argument, and so on.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Function
-     * @param {Function} func The function to rearrange arguments for.
-     * @param {...(number|number[])} indexes The arranged argument indexes.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var rearged = _.rearg(function(a, b, c) {
-     *   return [a, b, c];
-     * }, 2, 0, 1);
-     *
-     * rearged('b', 'c', 'a')
-     * // => ['a', 'b', 'c']
-     */
-    var rearg = rest(function(func, indexes) {
-      return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1));
-    });
-
-    /**
-     * Creates a function that invokes `func` with the `this` binding of the
-     * created function and arguments from `start` and beyond provided as
-     * an array.
-     *
-     * **Note:** This method is based on the
-     * [rest parameter](https://mdn.io/rest_parameters).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Function
-     * @param {Function} func The function to apply a rest parameter to.
-     * @param {number} [start=func.length-1] The start position of the rest parameter.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var say = _.rest(function(what, names) {
-     *   return what + ' ' + _.initial(names).join(', ') +
-     *     (_.size(names) > 1 ? ', & ' : '') + _.last(names);
-     * });
-     *
-     * say('hello', 'fred', 'barney', 'pebbles');
-     * // => 'hello fred, barney, & pebbles'
-     */
-    function rest(func, start) {
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);
-      return function() {
-        var args = arguments,
-            index = -1,
-            length = nativeMax(args.length - start, 0),
-            array = Array(length);
-
-        while (++index < length) {
-          array[index] = args[start + index];
-        }
-        switch (start) {
-          case 0: return func.call(this, array);
-          case 1: return func.call(this, args[0], array);
-          case 2: return func.call(this, args[0], args[1], array);
-        }
-        var otherArgs = Array(start + 1);
-        index = -1;
-        while (++index < start) {
-          otherArgs[index] = args[index];
-        }
-        otherArgs[start] = array;
-        return apply(func, this, otherArgs);
-      };
-    }
-
-    /**
-     * Creates a function that invokes `func` with the `this` binding of the
-     * create function and an array of arguments much like
-     * [`Function#apply`](http://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.apply).
-     *
-     * **Note:** This method is based on the
-     * [spread operator](https://mdn.io/spread_operator).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.2.0
-     * @category Function
-     * @param {Function} func The function to spread arguments over.
-     * @param {number} [start=0] The start position of the spread.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var say = _.spread(function(who, what) {
-     *   return who + ' says ' + what;
-     * });
-     *
-     * say(['fred', 'hello']);
-     * // => 'fred says hello'
-     *
-     * var numbers = Promise.all([
-     *   Promise.resolve(40),
-     *   Promise.resolve(36)
-     * ]);
-     *
-     * numbers.then(_.spread(function(x, y) {
-     *   return x + y;
-     * }));
-     * // => a Promise of 76
-     */
-    function spread(func, start) {
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      start = start === undefined ? 0 : nativeMax(toInteger(start), 0);
-      return rest(function(args) {
-        var array = args[start],
-            otherArgs = castSlice(args, 0, start);
-
-        if (array) {
-          arrayPush(otherArgs, array);
-        }
-        return apply(func, this, otherArgs);
-      });
-    }
-
-    /**
-     * Creates a throttled function that only invokes `func` at most once per
-     * every `wait` milliseconds. The throttled function comes with a `cancel`
-     * method to cancel delayed `func` invocations and a `flush` method to
-     * immediately invoke them. Provide an options object to indicate whether
-     * `func` should be invoked on the leading and/or trailing edge of the `wait`
-     * timeout. The `func` is invoked with the last arguments provided to the
-     * throttled function. Subsequent calls to the throttled function return the
-     * result of the last `func` invocation.
-     *
-     * **Note:** If `leading` and `trailing` options are `true`, `func` is
-     * invoked on the trailing edge of the timeout only if the throttled function
-     * is invoked more than once during the `wait` timeout.
-     *
-     * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
-     * for details over the differences between `_.throttle` and `_.debounce`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to throttle.
-     * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
-     * @param {Object} [options={}] The options object.
-     * @param {boolean} [options.leading=true]
-     *  Specify invoking on the leading edge of the timeout.
-     * @param {boolean} [options.trailing=true]
-     *  Specify invoking on the trailing edge of the timeout.
-     * @returns {Function} Returns the new throttled function.
-     * @example
-     *
-     * // Avoid excessively updating the position while scrolling.
-     * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
-     *
-     * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
-     * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
-     * jQuery(element).on('click', throttled);
-     *
-     * // Cancel the trailing throttled invocation.
-     * jQuery(window).on('popstate', throttled.cancel);
-     */
-    function throttle(func, wait, options) {
-      var leading = true,
-          trailing = true;
-
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      if (isObject(options)) {
-        leading = 'leading' in options ? !!options.leading : leading;
-        trailing = 'trailing' in options ? !!options.trailing : trailing;
-      }
-      return debounce(func, wait, {
-        'leading': leading,
-        'maxWait': wait,
-        'trailing': trailing
-      });
-    }
-
-    /**
-     * Creates a function that accepts up to one argument, ignoring any
-     * additional arguments.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Function
-     * @param {Function} func The function to cap arguments for.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * _.map(['6', '8', '10'], _.unary(parseInt));
-     * // => [6, 8, 10]
-     */
-    function unary(func) {
-      return ary(func, 1);
-    }
-
-    /**
-     * Creates a function that provides `value` to the wrapper function as its
-     * first argument. Any additional arguments provided to the function are
-     * appended to those provided to the wrapper function. The wrapper is invoked
-     * with the `this` binding of the created function.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {*} value The value to wrap.
-     * @param {Function} [wrapper=identity] The wrapper function.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var p = _.wrap(_.escape, function(func, text) {
-     *   return '<p>' + func(text) + '</p>';
-     * });
-     *
-     * p('fred, barney, & pebbles');
-     * // => '<p>fred, barney, &amp; pebbles</p>'
-     */
-    function wrap(value, wrapper) {
-      wrapper = wrapper == null ? identity : wrapper;
-      return partial(wrapper, value);
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Casts `value` as an array if it's not one.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.4.0
-     * @category Lang
-     * @param {*} value The value to inspect.
-     * @returns {Array} Returns the cast array.
-     * @example
-     *
-     * _.castArray(1);
-     * // => [1]
-     *
-     * _.castArray({ 'a': 1 });
-     * // => [{ 'a': 1 }]
-     *
-     * _.castArray('abc');
-     * // => ['abc']
-     *
-     * _.castArray(null);
-     * // => [null]
-     *
-     * _.castArray(undefined);
-     * // => [undefined]
-     *
-     * _.castArray();
-     * // => []
-     *
-     * var array = [1, 2, 3];
-     * console.log(_.castArray(array) === array);
-     * // => true
-     */
-    function castArray() {
-      if (!arguments.length) {
-        return [];
-      }
-      var value = arguments[0];
-      return isArray(value) ? value : [value];
-    }
-
-    /**
-     * Creates a shallow clone of `value`.
-     *
-     * **Note:** This method is loosely based on the
-     * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
-     * and supports cloning arrays, array buffers, booleans, date objects, maps,
-     * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
-     * arrays. The own enumerable properties of `arguments` objects are cloned
-     * as plain objects. An empty object is returned for uncloneable values such
-     * as error objects, functions, DOM nodes, and WeakMaps.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to clone.
-     * @returns {*} Returns the cloned value.
-     * @see _.cloneDeep
-     * @example
-     *
-     * var objects = [{ 'a': 1 }, { 'b': 2 }];
-     *
-     * var shallow = _.clone(objects);
-     * console.log(shallow[0] === objects[0]);
-     * // => true
-     */
-    function clone(value) {
-      return baseClone(value, false, true);
-    }
-
-    /**
-     * This method is like `_.clone` except that it accepts `customizer` which
-     * is invoked to produce the cloned value. If `customizer` returns `undefined`,
-     * cloning is handled by the method instead. The `customizer` is invoked with
-     * up to four arguments; (value [, index|key, object, stack]).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to clone.
-     * @param {Function} [customizer] The function to customize cloning.
-     * @returns {*} Returns the cloned value.
-     * @see _.cloneDeepWith
-     * @example
-     *
-     * function customizer(value) {
-     *   if (_.isElement(value)) {
-     *     return value.cloneNode(false);
-     *   }
-     * }
-     *
-     * var el = _.cloneWith(document.body, customizer);
-     *
-     * console.log(el === document.body);
-     * // => false
-     * console.log(el.nodeName);
-     * // => 'BODY'
-     * console.log(el.childNodes.length);
-     * // => 0
-     */
-    function cloneWith(value, customizer) {
-      return baseClone(value, false, true, customizer);
-    }
-
-    /**
-     * This method is like `_.clone` except that it recursively clones `value`.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.0.0
-     * @category Lang
-     * @param {*} value The value to recursively clone.
-     * @returns {*} Returns the deep cloned value.
-     * @see _.clone
-     * @example
-     *
-     * var objects = [{ 'a': 1 }, { 'b': 2 }];
-     *
-     * var deep = _.cloneDeep(objects);
-     * console.log(deep[0] === objects[0]);
-     * // => false
-     */
-    function cloneDeep(value) {
-      return baseClone(value, true, true);
-    }
-
-    /**
-     * This method is like `_.cloneWith` except that it recursively clones `value`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to recursively clone.
-     * @param {Function} [customizer] The function to customize cloning.
-     * @returns {*} Returns the deep cloned value.
-     * @see _.cloneWith
-     * @example
-     *
-     * function customizer(value) {
-     *   if (_.isElement(value)) {
-     *     return value.cloneNode(true);
-     *   }
-     * }
-     *
-     * var el = _.cloneDeepWith(document.body, customizer);
-     *
-     * console.log(el === document.body);
-     * // => false
-     * console.log(el.nodeName);
-     * // => 'BODY'
-     * console.log(el.childNodes.length);
-     * // => 20
-     */
-    function cloneDeepWith(value, customizer) {
-      return baseClone(value, true, true, customizer);
-    }
-
-    /**
-     * Performs a
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * comparison between two values to determine if they are equivalent.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
-     * @example
-     *
-     * var object = { 'user': 'fred' };
-     * var other = { 'user': 'fred' };
-     *
-     * _.eq(object, object);
-     * // => true
-     *
-     * _.eq(object, other);
-     * // => false
-     *
-     * _.eq('a', 'a');
-     * // => true
-     *
-     * _.eq('a', Object('a'));
-     * // => false
-     *
-     * _.eq(NaN, NaN);
-     * // => true
-     */
-    function eq(value, other) {
-      return value === other || (value !== value && other !== other);
-    }
-
-    /**
-     * Checks if `value` is greater than `other`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.9.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is greater than `other`,
-     *  else `false`.
-     * @see _.lt
-     * @example
-     *
-     * _.gt(3, 1);
-     * // => true
-     *
-     * _.gt(3, 3);
-     * // => false
-     *
-     * _.gt(1, 3);
-     * // => false
-     */
-    var gt = createRelationalOperation(baseGt);
-
-    /**
-     * Checks if `value` is greater than or equal to `other`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.9.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is greater than or equal to
-     *  `other`, else `false`.
-     * @see _.lte
-     * @example
-     *
-     * _.gte(3, 1);
-     * // => true
-     *
-     * _.gte(3, 3);
-     * // => true
-     *
-     * _.gte(1, 3);
-     * // => false
-     */
-    var gte = createRelationalOperation(function(value, other) {
-      return value >= other;
-    });
-
-    /**
-     * Checks if `value` is likely an `arguments` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isArguments(function() { return arguments; }());
-     * // => true
-     *
-     * _.isArguments([1, 2, 3]);
-     * // => false
-     */
-    function isArguments(value) {
-      // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
-      return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
-        (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
-    }
-
-    /**
-     * Checks if `value` is classified as an `Array` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @type {Function}
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isArray([1, 2, 3]);
-     * // => true
-     *
-     * _.isArray(document.body.children);
-     * // => false
-     *
-     * _.isArray('abc');
-     * // => false
-     *
-     * _.isArray(_.noop);
-     * // => false
-     */
-    var isArray = Array.isArray;
-
-    /**
-     * Checks if `value` is classified as an `ArrayBuffer` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isArrayBuffer(new ArrayBuffer(2));
-     * // => true
-     *
-     * _.isArrayBuffer(new Array(2));
-     * // => false
-     */
-    function isArrayBuffer(value) {
-      return isObjectLike(value) && objectToString.call(value) == arrayBufferTag;
-    }
-
-    /**
-     * Checks if `value` is array-like. A value is considered array-like if it's
-     * not a function and has a `value.length` that's an integer greater than or
-     * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
-     * @example
-     *
-     * _.isArrayLike([1, 2, 3]);
-     * // => true
-     *
-     * _.isArrayLike(document.body.children);
-     * // => true
-     *
-     * _.isArrayLike('abc');
-     * // => true
-     *
-     * _.isArrayLike(_.noop);
-     * // => false
-     */
-    function isArrayLike(value) {
-      return value != null && isLength(getLength(value)) && !isFunction(value);
-    }
-
-    /**
-     * This method is like `_.isArrayLike` except that it also checks if `value`
-     * is an object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is an array-like object,
-     *  else `false`.
-     * @example
-     *
-     * _.isArrayLikeObject([1, 2, 3]);
-     * // => true
-     *
-     * _.isArrayLikeObject(document.body.children);
-     * // => true
-     *
-     * _.isArrayLikeObject('abc');
-     * // => false
-     *
-     * _.isArrayLikeObject(_.noop);
-     * // => false
-     */
-    function isArrayLikeObject(value) {
-      return isObjectLike(value) && isArrayLike(value);
-    }
-
-    /**
-     * Checks if `value` is classified as a boolean primitive or object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isBoolean(false);
-     * // => true
-     *
-     * _.isBoolean(null);
-     * // => false
-     */
-    function isBoolean(value) {
-      return value === true || value === false ||
-        (isObjectLike(value) && objectToString.call(value) == boolTag);
-    }
-
-    /**
-     * Checks if `value` is a buffer.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
-     * @example
-     *
-     * _.isBuffer(new Buffer(2));
-     * // => true
-     *
-     * _.isBuffer(new Uint8Array(2));
-     * // => false
-     */
-    var isBuffer = !Buffer ? constant(false) : function(value) {
-      return value instanceof Buffer;
-    };
-
-    /**
-     * Checks if `value` is classified as a `Date` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isDate(new Date);
-     * // => true
-     *
-     * _.isDate('Mon April 23 2012');
-     * // => false
-     */
-    function isDate(value) {
-      return isObjectLike(value) && objectToString.call(value) == dateTag;
-    }
-
-    /**
-     * Checks if `value` is likely a DOM element.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a DOM element,
-     *  else `false`.
-     * @example
-     *
-     * _.isElement(document.body);
-     * // => true
-     *
-     * _.isElement('<body>');
-     * // => false
-     */
-    function isElement(value) {
-      return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
-    }
-
-    /**
-     * Checks if `value` is an empty object, collection, map, or set.
-     *
-     * Objects are considered empty if they have no own enumerable string keyed
-     * properties.
-     *
-     * Array-like values such as `arguments` objects, arrays, buffers, strings, or
-     * jQuery-like collections are considered empty if they have a `length` of `0`.
-     * Similarly, maps and sets are considered empty if they have a `size` of `0`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is empty, else `false`.
-     * @example
-     *
-     * _.isEmpty(null);
-     * // => true
-     *
-     * _.isEmpty(true);
-     * // => true
-     *
-     * _.isEmpty(1);
-     * // => true
-     *
-     * _.isEmpty([1, 2, 3]);
-     * // => false
-     *
-     * _.isEmpty({ 'a': 1 });
-     * // => false
-     */
-    function isEmpty(value) {
-      if (isArrayLike(value) &&
-          (isArray(value) || isString(value) || isFunction(value.splice) ||
-            isArguments(value) || isBuffer(value))) {
-        return !value.length;
-      }
-      if (isObjectLike(value)) {
-        var tag = getTag(value);
-        if (tag == mapTag || tag == setTag) {
-          return !value.size;
-        }
-      }
-      for (var key in value) {
-        if (hasOwnProperty.call(value, key)) {
-          return false;
-        }
-      }
-      return !(nonEnumShadows && keys(value).length);
-    }
-
-    /**
-     * Performs a deep comparison between two values to determine if they are
-     * equivalent.
-     *
-     * **Note:** This method supports comparing arrays, array buffers, booleans,
-     * date objects, error objects, maps, numbers, `Object` objects, regexes,
-     * sets, strings, symbols, and typed arrays. `Object` objects are compared
-     * by their own, not inherited, enumerable properties. Functions and DOM
-     * nodes are **not** supported.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if the values are equivalent,
-     *  else `false`.
-     * @example
-     *
-     * var object = { 'user': 'fred' };
-     * var other = { 'user': 'fred' };
-     *
-     * _.isEqual(object, other);
-     * // => true
-     *
-     * object === other;
-     * // => false
-     */
-    function isEqual(value, other) {
-      return baseIsEqual(value, other);
-    }
-
-    /**
-     * This method is like `_.isEqual` except that it accepts `customizer` which
-     * is invoked to compare values. If `customizer` returns `undefined`, comparisons
-     * are handled by the method instead. The `customizer` is invoked with up to
-     * six arguments: (objValue, othValue [, index|key, object, other, stack]).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @param {Function} [customizer] The function to customize comparisons.
-     * @returns {boolean} Returns `true` if the values are equivalent,
-     *  else `false`.
-     * @example
-     *
-     * function isGreeting(value) {
-     *   return /^h(?:i|ello)$/.test(value);
-     * }
-     *
-     * function customizer(objValue, othValue) {
-     *   if (isGreeting(objValue) && isGreeting(othValue)) {
-     *     return true;
-     *   }
-     * }
-     *
-     * var array = ['hello', 'goodbye'];
-     * var other = ['hi', 'goodbye'];
-     *
-     * _.isEqualWith(array, other, customizer);
-     * // => true
-     */
-    function isEqualWith(value, other, customizer) {
-      customizer = typeof customizer == 'function' ? customizer : undefined;
-      var result = customizer ? customizer(value, other) : undefined;
-      return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
-    }
-
-    /**
-     * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
-     * `SyntaxError`, `TypeError`, or `URIError` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is an error object,
-     *  else `false`.
-     * @example
-     *
-     * _.isError(new Error);
-     * // => true
-     *
-     * _.isError(Error);
-     * // => false
-     */
-    function isError(value) {
-      if (!isObjectLike(value)) {
-        return false;
-      }
-      return (objectToString.call(value) == errorTag) ||
-        (typeof value.message == 'string' && typeof value.name == 'string');
-    }
-
-    /**
-     * Checks if `value` is a finite primitive number.
-     *
-     * **Note:** This method is based on
-     * [`Number.isFinite`](https://mdn.io/Number/isFinite).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a finite number,
-     *  else `false`.
-     * @example
-     *
-     * _.isFinite(3);
-     * // => true
-     *
-     * _.isFinite(Number.MAX_VALUE);
-     * // => true
-     *
-     * _.isFinite(3.14);
-     * // => true
-     *
-     * _.isFinite(Infinity);
-     * // => false
-     */
-    function isFinite(value) {
-      return typeof value == 'number' && nativeIsFinite(value);
-    }
-
-    /**
-     * Checks if `value` is classified as a `Function` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isFunction(_);
-     * // => true
-     *
-     * _.isFunction(/abc/);
-     * // => false
-     */
-    function isFunction(value) {
-      // The use of `Object#toString` avoids issues with the `typeof` operator
-      // in Safari 8 which returns 'object' for typed array and weak map constructors,
-      // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
-      var tag = isObject(value) ? objectToString.call(value) : '';
-      return tag == funcTag || tag == genTag;
-    }
-
-    /**
-     * Checks if `value` is an integer.
-     *
-     * **Note:** This method is based on
-     * [`Number.isInteger`](https://mdn.io/Number/isInteger).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
-     * @example
-     *
-     * _.isInteger(3);
-     * // => true
-     *
-     * _.isInteger(Number.MIN_VALUE);
-     * // => false
-     *
-     * _.isInteger(Infinity);
-     * // => false
-     *
-     * _.isInteger('3');
-     * // => false
-     */
-    function isInteger(value) {
-      return typeof value == 'number' && value == toInteger(value);
-    }
-
-    /**
-     * Checks if `value` is a valid array-like length.
-     *
-     * **Note:** This function is loosely based on
-     * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a valid length,
-     *  else `false`.
-     * @example
-     *
-     * _.isLength(3);
-     * // => true
-     *
-     * _.isLength(Number.MIN_VALUE);
-     * // => false
-     *
-     * _.isLength(Infinity);
-     * // => false
-     *
-     * _.isLength('3');
-     * // => false
-     */
-    function isLength(value) {
-      return typeof value == 'number' &&
-        value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-    }
-
-    /**
-     * Checks if `value` is the
-     * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
-     * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is an object, else `false`.
-     * @example
-     *
-     * _.isObject({});
-     * // => true
-     *
-     * _.isObject([1, 2, 3]);
-     * // => true
-     *
-     * _.isObject(_.noop);
-     * // => true
-     *
-     * _.isObject(null);
-     * // => false
-     */
-    function isObject(value) {
-      var type = typeof value;
-      return !!value && (type == 'object' || type == 'function');
-    }
-
-    /**
-     * Checks if `value` is object-like. A value is object-like if it's not `null`
-     * and has a `typeof` result of "object".
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
-     * @example
-     *
-     * _.isObjectLike({});
-     * // => true
-     *
-     * _.isObjectLike([1, 2, 3]);
-     * // => true
-     *
-     * _.isObjectLike(_.noop);
-     * // => false
-     *
-     * _.isObjectLike(null);
-     * // => false
-     */
-    function isObjectLike(value) {
-      return !!value && typeof value == 'object';
-    }
-
-    /**
-     * Checks if `value` is classified as a `Map` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isMap(new Map);
-     * // => true
-     *
-     * _.isMap(new WeakMap);
-     * // => false
-     */
-    function isMap(value) {
-      return isObjectLike(value) && getTag(value) == mapTag;
-    }
-
-    /**
-     * Performs a partial deep comparison between `object` and `source` to
-     * determine if `object` contains equivalent property values. This method is
-     * equivalent to a `_.matches` function when `source` is partially applied.
-     *
-     * **Note:** This method supports comparing the same values as `_.isEqual`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Lang
-     * @param {Object} object The object to inspect.
-     * @param {Object} source The object of property values to match.
-     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
-     * @example
-     *
-     * var object = { 'user': 'fred', 'age': 40 };
-     *
-     * _.isMatch(object, { 'age': 40 });
-     * // => true
-     *
-     * _.isMatch(object, { 'age': 36 });
-     * // => false
-     */
-    function isMatch(object, source) {
-      return object === source || baseIsMatch(object, source, getMatchData(source));
-    }
-
-    /**
-     * This method is like `_.isMatch` except that it accepts `customizer` which
-     * is invoked to compare values. If `customizer` returns `undefined`, comparisons
-     * are handled by the method instead. The `customizer` is invoked with five
-     * arguments: (objValue, srcValue, index|key, object, source).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {Object} object The object to inspect.
-     * @param {Object} source The object of property values to match.
-     * @param {Function} [customizer] The function to customize comparisons.
-     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
-     * @example
-     *
-     * function isGreeting(value) {
-     *   return /^h(?:i|ello)$/.test(value);
-     * }
-     *
-     * function customizer(objValue, srcValue) {
-     *   if (isGreeting(objValue) && isGreeting(srcValue)) {
-     *     return true;
-     *   }
-     * }
-     *
-     * var object = { 'greeting': 'hello' };
-     * var source = { 'greeting': 'hi' };
-     *
-     * _.isMatchWith(object, source, customizer);
-     * // => true
-     */
-    function isMatchWith(object, source, customizer) {
-      customizer = typeof customizer == 'function' ? customizer : undefined;
-      return baseIsMatch(object, source, getMatchData(source), customizer);
-    }
-
-    /**
-     * Checks if `value` is `NaN`.
-     *
-     * **Note:** This method is based on
-     * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
-     * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
-     * `undefined` and other non-number values.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
-     * @example
-     *
-     * _.isNaN(NaN);
-     * // => true
-     *
-     * _.isNaN(new Number(NaN));
-     * // => true
-     *
-     * isNaN(undefined);
-     * // => true
-     *
-     * _.isNaN(undefined);
-     * // => false
-     */
-    function isNaN(value) {
-      // An `NaN` primitive is the only value that is not equal to itself.
-      // Perform the `toStringTag` check first to avoid errors with some
-      // ActiveX objects in IE.
-      return isNumber(value) && value != +value;
-    }
-
-    /**
-     * Checks if `value` is a native function.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a native function,
-     *  else `false`.
-     * @example
-     *
-     * _.isNative(Array.prototype.push);
-     * // => true
-     *
-     * _.isNative(_);
-     * // => false
-     */
-    function isNative(value) {
-      if (!isObject(value)) {
-        return false;
-      }
-      var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
-      return pattern.test(toSource(value));
-    }
-
-    /**
-     * Checks if `value` is `null`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
-     * @example
-     *
-     * _.isNull(null);
-     * // => true
-     *
-     * _.isNull(void 0);
-     * // => false
-     */
-    function isNull(value) {
-      return value === null;
-    }
-
-    /**
-     * Checks if `value` is `null` or `undefined`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
-     * @example
-     *
-     * _.isNil(null);
-     * // => true
-     *
-     * _.isNil(void 0);
-     * // => true
-     *
-     * _.isNil(NaN);
-     * // => false
-     */
-    function isNil(value) {
-      return value == null;
-    }
-
-    /**
-     * Checks if `value` is classified as a `Number` primitive or object.
-     *
-     * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
-     * classified as numbers, use the `_.isFinite` method.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isNumber(3);
-     * // => true
-     *
-     * _.isNumber(Number.MIN_VALUE);
-     * // => true
-     *
-     * _.isNumber(Infinity);
-     * // => true
-     *
-     * _.isNumber('3');
-     * // => false
-     */
-    function isNumber(value) {
-      return typeof value == 'number' ||
-        (isObjectLike(value) && objectToString.call(value) == numberTag);
-    }
-
-    /**
-     * Checks if `value` is a plain object, that is, an object created by the
-     * `Object` constructor or one with a `[[Prototype]]` of `null`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.8.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a plain object,
-     *  else `false`.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     * }
-     *
-     * _.isPlainObject(new Foo);
-     * // => false
-     *
-     * _.isPlainObject([1, 2, 3]);
-     * // => false
-     *
-     * _.isPlainObject({ 'x': 0, 'y': 0 });
-     * // => true
-     *
-     * _.isPlainObject(Object.create(null));
-     * // => true
-     */
-    function isPlainObject(value) {
-      if (!isObjectLike(value) ||
-          objectToString.call(value) != objectTag || isHostObject(value)) {
-        return false;
-      }
-      var proto = getPrototype(value);
-      if (proto === null) {
-        return true;
-      }
-      var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
-      return (typeof Ctor == 'function' &&
-        Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
-    }
-
-    /**
-     * Checks if `value` is classified as a `RegExp` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isRegExp(/abc/);
-     * // => true
-     *
-     * _.isRegExp('/abc/');
-     * // => false
-     */
-    function isRegExp(value) {
-      return isObject(value) && objectToString.call(value) == regexpTag;
-    }
-
-    /**
-     * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
-     * double precision number which isn't the result of a rounded unsafe integer.
-     *
-     * **Note:** This method is based on
-     * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a safe integer,
-     *  else `false`.
-     * @example
-     *
-     * _.isSafeInteger(3);
-     * // => true
-     *
-     * _.isSafeInteger(Number.MIN_VALUE);
-     * // => false
-     *
-     * _.isSafeInteger(Infinity);
-     * // => false
-     *
-     * _.isSafeInteger('3');
-     * // => false
-     */
-    function isSafeInteger(value) {
-      return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
-    }
-
-    /**
-     * Checks if `value` is classified as a `Set` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isSet(new Set);
-     * // => true
-     *
-     * _.isSet(new WeakSet);
-     * // => false
-     */
-    function isSet(value) {
-      return isObjectLike(value) && getTag(value) == setTag;
-    }
-
-    /**
-     * Checks if `value` is classified as a `String` primitive or object.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isString('abc');
-     * // => true
-     *
-     * _.isString(1);
-     * // => false
-     */
-    function isString(value) {
-      return typeof value == 'string' ||
-        (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
-    }
-
-    /**
-     * Checks if `value` is classified as a `Symbol` primitive or object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isSymbol(Symbol.iterator);
-     * // => true
-     *
-     * _.isSymbol('abc');
-     * // => false
-     */
-    function isSymbol(value) {
-      return typeof value == 'symbol' ||
-        (isObjectLike(value) && objectToString.call(value) == symbolTag);
-    }
-
-    /**
-     * Checks if `value` is classified as a typed array.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isTypedArray(new Uint8Array);
-     * // => true
-     *
-     * _.isTypedArray([]);
-     * // => false
-     */
-    function isTypedArray(value) {
-      return isObjectLike(value) &&
-        isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
-    }
-
-    /**
-     * Checks if `value` is `undefined`.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
-     * @example
-     *
-     * _.isUndefined(void 0);
-     * // => true
-     *
-     * _.isUndefined(null);
-     * // => false
-     */
-    function isUndefined(value) {
-      return value === undefined;
-    }
-
-    /**
-     * Checks if `value` is classified as a `WeakMap` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isWeakMap(new WeakMap);
-     * // => true
-     *
-     * _.isWeakMap(new Map);
-     * // => false
-     */
-    function isWeakMap(value) {
-      return isObjectLike(value) && getTag(value) == weakMapTag;
-    }
-
-    /**
-     * Checks if `value` is classified as a `WeakSet` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isWeakSet(new WeakSet);
-     * // => true
-     *
-     * _.isWeakSet(new Set);
-     * // => false
-     */
-    function isWeakSet(value) {
-      return isObjectLike(value) && objectToString.call(value) == weakSetTag;
-    }
-
-    /**
-     * Checks if `value` is less than `other`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.9.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is less than `other`,
-     *  else `false`.
-     * @see _.gt
-     * @example
-     *
-     * _.lt(1, 3);
-     * // => true
-     *
-     * _.lt(3, 3);
-     * // => false
-     *
-     * _.lt(3, 1);
-     * // => false
-     */
-    var lt = createRelationalOperation(baseLt);
-
-    /**
-     * Checks if `value` is less than or equal to `other`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.9.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is less than or equal to
-     *  `other`, else `false`.
-     * @see _.gte
-     * @example
-     *
-     * _.lte(1, 3);
-     * // => true
-     *
-     * _.lte(3, 3);
-     * // => true
-     *
-     * _.lte(3, 1);
-     * // => false
-     */
-    var lte = createRelationalOperation(function(value, other) {
-      return value <= other;
-    });
-
-    /**
-     * Converts `value` to an array.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Lang
-     * @param {*} value The value to convert.
-     * @returns {Array} Returns the converted array.
-     * @example
-     *
-     * _.toArray({ 'a': 1, 'b': 2 });
-     * // => [1, 2]
-     *
-     * _.toArray('abc');
-     * // => ['a', 'b', 'c']
-     *
-     * _.toArray(1);
-     * // => []
-     *
-     * _.toArray(null);
-     * // => []
-     */
-    function toArray(value) {
-      if (!value) {
-        return [];
-      }
-      if (isArrayLike(value)) {
-        return isString(value) ? stringToArray(value) : copyArray(value);
-      }
-      if (iteratorSymbol && value[iteratorSymbol]) {
-        return iteratorToArray(value[iteratorSymbol]());
-      }
-      var tag = getTag(value),
-          func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
-
-      return func(value);
-    }
-
-    /**
-     * Converts `value` to an integer.
-     *
-     * **Note:** This function is loosely based on
-     * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to convert.
-     * @returns {number} Returns the converted integer.
-     * @example
-     *
-     * _.toInteger(3);
-     * // => 3
-     *
-     * _.toInteger(Number.MIN_VALUE);
-     * // => 0
-     *
-     * _.toInteger(Infinity);
-     * // => 1.7976931348623157e+308
-     *
-     * _.toInteger('3');
-     * // => 3
-     */
-    function toInteger(value) {
-      if (!value) {
-        return value === 0 ? value : 0;
-      }
-      value = toNumber(value);
-      if (value === INFINITY || value === -INFINITY) {
-        var sign = (value < 0 ? -1 : 1);
-        return sign * MAX_INTEGER;
-      }
-      var remainder = value % 1;
-      return value === value ? (remainder ? value - remainder : value) : 0;
-    }
-
-    /**
-     * Converts `value` to an integer suitable for use as the length of an
-     * array-like object.
-     *
-     * **Note:** This method is based on
-     * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to convert.
-     * @returns {number} Returns the converted integer.
-     * @example
-     *
-     * _.toLength(3);
-     * // => 3
-     *
-     * _.toLength(Number.MIN_VALUE);
-     * // => 0
-     *
-     * _.toLength(Infinity);
-     * // => 4294967295
-     *
-     * _.toLength('3');
-     * // => 3
-     */
-    function toLength(value) {
-      return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
-    }
-
-    /**
-     * Converts `value` to a number.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to process.
-     * @returns {number} Returns the number.
-     * @example
-     *
-     * _.toNumber(3);
-     * // => 3
-     *
-     * _.toNumber(Number.MIN_VALUE);
-     * // => 5e-324
-     *
-     * _.toNumber(Infinity);
-     * // => Infinity
-     *
-     * _.toNumber('3');
-     * // => 3
-     */
-    function toNumber(value) {
-      if (typeof value == 'number') {
-        return value;
-      }
-      if (isSymbol(value)) {
-        return NAN;
-      }
-      if (isObject(value)) {
-        var other = isFunction(value.valueOf) ? value.valueOf() : value;
-        value = isObject(other) ? (other + '') : other;
-      }
-      if (typeof value != 'string') {
-        return value === 0 ? value : +value;
-      }
-      value = value.replace(reTrim, '');
-      var isBinary = reIsBinary.test(value);
-      return (isBinary || reIsOctal.test(value))
-        ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
-        : (reIsBadHex.test(value) ? NAN : +value);
-    }
-
-    /**
-     * Converts `value` to a plain object flattening inherited enumerable string
-     * keyed properties of `value` to own properties of the plain object.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Lang
-     * @param {*} value The value to convert.
-     * @returns {Object} Returns the converted plain object.
-     * @example
-     *
-     * function Foo() {
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.assign({ 'a': 1 }, new Foo);
-     * // => { 'a': 1, 'b': 2 }
-     *
-     * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
-     * // => { 'a': 1, 'b': 2, 'c': 3 }
-     */
-    function toPlainObject(value) {
-      return copyObject(value, keysIn(value));
-    }
-
-    /**
-     * Converts `value` to a safe integer. A safe integer can be compared and
-     * represented correctly.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to convert.
-     * @returns {number} Returns the converted integer.
-     * @example
-     *
-     * _.toSafeInteger(3);
-     * // => 3
-     *
-     * _.toSafeInteger(Number.MIN_VALUE);
-     * // => 0
-     *
-     * _.toSafeInteger(Infinity);
-     * // => 9007199254740991
-     *
-     * _.toSafeInteger('3');
-     * // => 3
-     */
-    function toSafeInteger(value) {
-      return baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
-    }
-
-    /**
-     * Converts `value` to a string. An empty string is returned for `null`
-     * and `undefined` values. The sign of `-0` is preserved.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to process.
-     * @returns {string} Returns the string.
-     * @example
-     *
-     * _.toString(null);
-     * // => ''
-     *
-     * _.toString(-0);
-     * // => '-0'
-     *
-     * _.toString([1, 2, 3]);
-     * // => '1,2,3'
-     */
-    function toString(value) {
-      return value == null ? '' : baseToString(value);
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Assigns own enumerable string keyed properties of source objects to the
-     * destination object. Source objects are applied from left to right.
-     * Subsequent sources overwrite property assignments of previous sources.
-     *
-     * **Note:** This method mutates `object` and is loosely based on
-     * [`Object.assign`](https://mdn.io/Object/assign).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.10.0
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} [sources] The source objects.
-     * @returns {Object} Returns `object`.
-     * @see _.assignIn
-     * @example
-     *
-     * function Foo() {
-     *   this.c = 3;
-     * }
-     *
-     * function Bar() {
-     *   this.e = 5;
-     * }
-     *
-     * Foo.prototype.d = 4;
-     * Bar.prototype.f = 6;
-     *
-     * _.assign({ 'a': 1 }, new Foo, new Bar);
-     * // => { 'a': 1, 'c': 3, 'e': 5 }
-     */
-    var assign = createAssigner(function(object, source) {
-      if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
-        copyObject(source, keys(source), object);
-        return;
-      }
-      for (var key in source) {
-        if (hasOwnProperty.call(source, key)) {
-          assignValue(object, key, source[key]);
-        }
-      }
-    });
-
-    /**
-     * This method is like `_.assign` except that it iterates over own and
-     * inherited source properties.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @alias extend
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} [sources] The source objects.
-     * @returns {Object} Returns `object`.
-     * @see _.assign
-     * @example
-     *
-     * function Foo() {
-     *   this.b = 2;
-     * }
-     *
-     * function Bar() {
-     *   this.d = 4;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     * Bar.prototype.e = 5;
-     *
-     * _.assignIn({ 'a': 1 }, new Foo, new Bar);
-     * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
-     */
-    var assignIn = createAssigner(function(object, source) {
-      if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
-        copyObject(source, keysIn(source), object);
-        return;
-      }
-      for (var key in source) {
-        assignValue(object, key, source[key]);
-      }
-    });
-
-    /**
-     * This method is like `_.assignIn` except that it accepts `customizer`
-     * which is invoked to produce the assigned values. If `customizer` returns
-     * `undefined`, assignment is handled by the method instead. The `customizer`
-     * is invoked with five arguments: (objValue, srcValue, key, object, source).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @alias extendWith
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} sources The source objects.
-     * @param {Function} [customizer] The function to customize assigned values.
-     * @returns {Object} Returns `object`.
-     * @see _.assignWith
-     * @example
-     *
-     * function customizer(objValue, srcValue) {
-     *   return _.isUndefined(objValue) ? srcValue : objValue;
-     * }
-     *
-     * var defaults = _.partialRight(_.assignInWith, customizer);
-     *
-     * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
-     * // => { 'a': 1, 'b': 2 }
-     */
-    var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
-      copyObject(source, keysIn(source), object, customizer);
-    });
-
-    /**
-     * This method is like `_.assign` except that it accepts `customizer`
-     * which is invoked to produce the assigned values. If `customizer` returns
-     * `undefined`, assignment is handled by the method instead. The `customizer`
-     * is invoked with five arguments: (objValue, srcValue, key, object, source).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} sources The source objects.
-     * @param {Function} [customizer] The function to customize assigned values.
-     * @returns {Object} Returns `object`.
-     * @see _.assignInWith
-     * @example
-     *
-     * function customizer(objValue, srcValue) {
-     *   return _.isUndefined(objValue) ? srcValue : objValue;
-     * }
-     *
-     * var defaults = _.partialRight(_.assignWith, customizer);
-     *
-     * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
-     * // => { 'a': 1, 'b': 2 }
-     */
-    var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
-      copyObject(source, keys(source), object, customizer);
-    });
-
-    /**
-     * Creates an array of values corresponding to `paths` of `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.0.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {...(string|string[])} [paths] The property paths of elements to pick.
-     * @returns {Array} Returns the new array of picked elements.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
-     *
-     * _.at(object, ['a[0].b.c', 'a[1]']);
-     * // => [3, 4]
-     *
-     * _.at(['a', 'b', 'c'], 0, 2);
-     * // => ['a', 'c']
-     */
-    var at = rest(function(object, paths) {
-      return baseAt(object, baseFlatten(paths, 1));
-    });
-
-    /**
-     * Creates an object that inherits from the `prototype` object. If a
-     * `properties` object is given, its own enumerable string keyed properties
-     * are assigned to the created object.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.3.0
-     * @category Object
-     * @param {Object} prototype The object to inherit from.
-     * @param {Object} [properties] The properties to assign to the object.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * function Shape() {
-     *   this.x = 0;
-     *   this.y = 0;
-     * }
-     *
-     * function Circle() {
-     *   Shape.call(this);
-     * }
-     *
-     * Circle.prototype = _.create(Shape.prototype, {
-     *   'constructor': Circle
-     * });
-     *
-     * var circle = new Circle;
-     * circle instanceof Circle;
-     * // => true
-     *
-     * circle instanceof Shape;
-     * // => true
-     */
-    function create(prototype, properties) {
-      var result = baseCreate(prototype);
-      return properties ? baseAssign(result, properties) : result;
-    }
-
-    /**
-     * Assigns own and inherited enumerable string keyed properties of source
-     * objects to the destination object for all destination properties that
-     * resolve to `undefined`. Source objects are applied from left to right.
-     * Once a property is set, additional values of the same property are ignored.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} [sources] The source objects.
-     * @returns {Object} Returns `object`.
-     * @see _.defaultsDeep
-     * @example
-     *
-     * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
-     * // => { 'user': 'barney', 'age': 36 }
-     */
-    var defaults = rest(function(args) {
-      args.push(undefined, assignInDefaults);
-      return apply(assignInWith, undefined, args);
-    });
-
-    /**
-     * This method is like `_.defaults` except that it recursively assigns
-     * default properties.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.10.0
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} [sources] The source objects.
-     * @returns {Object} Returns `object`.
-     * @see _.defaults
-     * @example
-     *
-     * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
-     * // => { 'user': { 'name': 'barney', 'age': 36 } }
-     *
-     */
-    var defaultsDeep = rest(function(args) {
-      args.push(undefined, mergeDefaults);
-      return apply(mergeWith, undefined, args);
-    });
-
-    /**
-     * This method is like `_.find` except that it returns the key of the first
-     * element `predicate` returns truthy for instead of the element itself.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.1.0
-     * @category Object
-     * @param {Object} object The object to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {string|undefined} Returns the key of the matched element,
-     *  else `undefined`.
-     * @example
-     *
-     * var users = {
-     *   'barney':  { 'age': 36, 'active': true },
-     *   'fred':    { 'age': 40, 'active': false },
-     *   'pebbles': { 'age': 1,  'active': true }
-     * };
-     *
-     * _.findKey(users, function(o) { return o.age < 40; });
-     * // => 'barney' (iteration order is not guaranteed)
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.findKey(users, { 'age': 1, 'active': true });
-     * // => 'pebbles'
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.findKey(users, ['active', false]);
-     * // => 'fred'
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.findKey(users, 'active');
-     * // => 'barney'
-     */
-    function findKey(object, predicate) {
-      return baseFind(object, getIteratee(predicate, 3), baseForOwn, true);
-    }
-
-    /**
-     * This method is like `_.findKey` except that it iterates over elements of
-     * a collection in the opposite order.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Object
-     * @param {Object} object The object to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {string|undefined} Returns the key of the matched element,
-     *  else `undefined`.
-     * @example
-     *
-     * var users = {
-     *   'barney':  { 'age': 36, 'active': true },
-     *   'fred':    { 'age': 40, 'active': false },
-     *   'pebbles': { 'age': 1,  'active': true }
-     * };
-     *
-     * _.findLastKey(users, function(o) { return o.age < 40; });
-     * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.findLastKey(users, { 'age': 36, 'active': true });
-     * // => 'barney'
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.findLastKey(users, ['active', false]);
-     * // => 'fred'
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.findLastKey(users, 'active');
-     * // => 'pebbles'
-     */
-    function findLastKey(object, predicate) {
-      return baseFind(object, getIteratee(predicate, 3), baseForOwnRight, true);
-    }
-
-    /**
-     * Iterates over own and inherited enumerable string keyed properties of an
-     * object and invokes `iteratee` for each property. The iteratee is invoked
-     * with three arguments: (value, key, object). Iteratee functions may exit
-     * iteration early by explicitly returning `false`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.3.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     * @see _.forInRight
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.forIn(new Foo, function(value, key) {
-     *   console.log(key);
-     * });
-     * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
-     */
-    function forIn(object, iteratee) {
-      return object == null
-        ? object
-        : baseFor(object, getIteratee(iteratee), keysIn);
-    }
-
-    /**
-     * This method is like `_.forIn` except that it iterates over properties of
-     * `object` in the opposite order.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     * @see _.forIn
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.forInRight(new Foo, function(value, key) {
-     *   console.log(key);
-     * });
-     * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
-     */
-    function forInRight(object, iteratee) {
-      return object == null
-        ? object
-        : baseForRight(object, getIteratee(iteratee), keysIn);
-    }
-
-    /**
-     * Iterates over own enumerable string keyed properties of an object and
-     * invokes `iteratee` for each property. The iteratee is invoked with three
-     * arguments: (value, key, object). Iteratee functions may exit iteration
-     * early by explicitly returning `false`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.3.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     * @see _.forOwnRight
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.forOwn(new Foo, function(value, key) {
-     *   console.log(key);
-     * });
-     * // => Logs 'a' then 'b' (iteration order is not guaranteed).
-     */
-    function forOwn(object, iteratee) {
-      return object && baseForOwn(object, getIteratee(iteratee));
-    }
-
-    /**
-     * This method is like `_.forOwn` except that it iterates over properties of
-     * `object` in the opposite order.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     * @see _.forOwn
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.forOwnRight(new Foo, function(value, key) {
-     *   console.log(key);
-     * });
-     * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
-     */
-    function forOwnRight(object, iteratee) {
-      return object && baseForOwnRight(object, getIteratee(iteratee));
-    }
-
-    /**
-     * Creates an array of function property names from own enumerable properties
-     * of `object`.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The object to inspect.
-     * @returns {Array} Returns the new array of property names.
-     * @see _.functionsIn
-     * @example
-     *
-     * function Foo() {
-     *   this.a = _.constant('a');
-     *   this.b = _.constant('b');
-     * }
-     *
-     * Foo.prototype.c = _.constant('c');
-     *
-     * _.functions(new Foo);
-     * // => ['a', 'b']
-     */
-    function functions(object) {
-      return object == null ? [] : baseFunctions(object, keys(object));
-    }
-
-    /**
-     * Creates an array of function property names from own and inherited
-     * enumerable properties of `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The object to inspect.
-     * @returns {Array} Returns the new array of property names.
-     * @see _.functions
-     * @example
-     *
-     * function Foo() {
-     *   this.a = _.constant('a');
-     *   this.b = _.constant('b');
-     * }
-     *
-     * Foo.prototype.c = _.constant('c');
-     *
-     * _.functionsIn(new Foo);
-     * // => ['a', 'b', 'c']
-     */
-    function functionsIn(object) {
-      return object == null ? [] : baseFunctions(object, keysIn(object));
-    }
-
-    /**
-     * Gets the value at `path` of `object`. If the resolved value is
-     * `undefined`, the `defaultValue` is used in its place.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.7.0
-     * @category Object
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the property to get.
-     * @param {*} [defaultValue] The value returned for `undefined` resolved values.
-     * @returns {*} Returns the resolved value.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
-     *
-     * _.get(object, 'a[0].b.c');
-     * // => 3
-     *
-     * _.get(object, ['a', '0', 'b', 'c']);
-     * // => 3
-     *
-     * _.get(object, 'a.b.c', 'default');
-     * // => 'default'
-     */
-    function get(object, path, defaultValue) {
-      var result = object == null ? undefined : baseGet(object, path);
-      return result === undefined ? defaultValue : result;
-    }
-
-    /**
-     * Checks if `path` is a direct property of `object`.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path to check.
-     * @returns {boolean} Returns `true` if `path` exists, else `false`.
-     * @example
-     *
-     * var object = { 'a': { 'b': 2 } };
-     * var other = _.create({ 'a': _.create({ 'b': 2 }) });
-     *
-     * _.has(object, 'a');
-     * // => true
-     *
-     * _.has(object, 'a.b');
-     * // => true
-     *
-     * _.has(object, ['a', 'b']);
-     * // => true
-     *
-     * _.has(other, 'a');
-     * // => false
-     */
-    function has(object, path) {
-      return object != null && hasPath(object, path, baseHas);
-    }
-
-    /**
-     * Checks if `path` is a direct or inherited property of `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path to check.
-     * @returns {boolean} Returns `true` if `path` exists, else `false`.
-     * @example
-     *
-     * var object = _.create({ 'a': _.create({ 'b': 2 }) });
-     *
-     * _.hasIn(object, 'a');
-     * // => true
-     *
-     * _.hasIn(object, 'a.b');
-     * // => true
-     *
-     * _.hasIn(object, ['a', 'b']);
-     * // => true
-     *
-     * _.hasIn(object, 'b');
-     * // => false
-     */
-    function hasIn(object, path) {
-      return object != null && hasPath(object, path, baseHasIn);
-    }
-
-    /**
-     * Creates an object composed of the inverted keys and values of `object`.
-     * If `object` contains duplicate values, subsequent values overwrite
-     * property assignments of previous values.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.7.0
-     * @category Object
-     * @param {Object} object The object to invert.
-     * @returns {Object} Returns the new inverted object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': 2, 'c': 1 };
-     *
-     * _.invert(object);
-     * // => { '1': 'c', '2': 'b' }
-     */
-    var invert = createInverter(function(result, value, key) {
-      result[value] = key;
-    }, constant(identity));
-
-    /**
-     * This method is like `_.invert` except that the inverted object is generated
-     * from the results of running each element of `object` thru `iteratee`. The
-     * corresponding inverted value of each inverted key is an array of keys
-     * responsible for generating the inverted value. The iteratee is invoked
-     * with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.1.0
-     * @category Object
-     * @param {Object} object The object to invert.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Object} Returns the new inverted object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': 2, 'c': 1 };
-     *
-     * _.invertBy(object);
-     * // => { '1': ['a', 'c'], '2': ['b'] }
-     *
-     * _.invertBy(object, function(value) {
-     *   return 'group' + value;
-     * });
-     * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
-     */
-    var invertBy = createInverter(function(result, value, key) {
-      if (hasOwnProperty.call(result, value)) {
-        result[value].push(key);
-      } else {
-        result[value] = [key];
-      }
-    }, getIteratee);
-
-    /**
-     * Invokes the method at `path` of `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the method to invoke.
-     * @param {...*} [args] The arguments to invoke the method with.
-     * @returns {*} Returns the result of the invoked method.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
-     *
-     * _.invoke(object, 'a[0].b.c.slice', 1, 3);
-     * // => [2, 3]
-     */
-    var invoke = rest(baseInvoke);
-
-    /**
-     * Creates an array of the own enumerable property names of `object`.
-     *
-     * **Note:** Non-object values are coerced to objects. See the
-     * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
-     * for more details.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.keys(new Foo);
-     * // => ['a', 'b'] (iteration order is not guaranteed)
-     *
-     * _.keys('hi');
-     * // => ['0', '1']
-     */
-    function keys(object) {
-      var isProto = isPrototype(object);
-      if (!(isProto || isArrayLike(object))) {
-        return baseKeys(object);
-      }
-      var indexes = indexKeys(object),
-          skipIndexes = !!indexes,
-          result = indexes || [],
-          length = result.length;
-
-      for (var key in object) {
-        if (baseHas(object, key) &&
-            !(skipIndexes && (key == 'length' || isIndex(key, length))) &&
-            !(isProto && key == 'constructor')) {
-          result.push(key);
-        }
-      }
-      return result;
-    }
-
-    /**
-     * Creates an array of the own and inherited enumerable property names of `object`.
-     *
-     * **Note:** Non-object values are coerced to objects.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.keysIn(new Foo);
-     * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
-     */
-    function keysIn(object) {
-      var index = -1,
-          isProto = isPrototype(object),
-          props = baseKeysIn(object),
-          propsLength = props.length,
-          indexes = indexKeys(object),
-          skipIndexes = !!indexes,
-          result = indexes || [],
-          length = result.length;
-
-      while (++index < propsLength) {
-        var key = props[index];
-        if (!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
-            !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
-          result.push(key);
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The opposite of `_.mapValues`; this method creates an object with the
-     * same values as `object` and keys generated by running each own enumerable
-     * string keyed property of `object` thru `iteratee`. The iteratee is invoked
-     * with three arguments: (value, key, object).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.8.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Object} Returns the new mapped object.
-     * @see _.mapValues
-     * @example
-     *
-     * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
-     *   return key + value;
-     * });
-     * // => { 'a1': 1, 'b2': 2 }
-     */
-    function mapKeys(object, iteratee) {
-      var result = {};
-      iteratee = getIteratee(iteratee, 3);
-
-      baseForOwn(object, function(value, key, object) {
-        result[iteratee(value, key, object)] = value;
-      });
-      return result;
-    }
-
-    /**
-     * Creates an object with the same keys as `object` and values generated
-     * by running each own enumerable string keyed property of `object` thru
-     * `iteratee`. The iteratee is invoked with three arguments:
-     * (value, key, object).
-     *
-     * @static
-     * @memberOf _
-     * @since 2.4.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Object} Returns the new mapped object.
-     * @see _.mapKeys
-     * @example
-     *
-     * var users = {
-     *   'fred':    { 'user': 'fred',    'age': 40 },
-     *   'pebbles': { 'user': 'pebbles', 'age': 1 }
-     * };
-     *
-     * _.mapValues(users, function(o) { return o.age; });
-     * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.mapValues(users, 'age');
-     * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
-     */
-    function mapValues(object, iteratee) {
-      var result = {};
-      iteratee = getIteratee(iteratee, 3);
-
-      baseForOwn(object, function(value, key, object) {
-        result[key] = iteratee(value, key, object);
-      });
-      return result;
-    }
-
-    /**
-     * This method is like `_.assign` except that it recursively merges own and
-     * inherited enumerable string keyed properties of source objects into the
-     * destination object. Source properties that resolve to `undefined` are
-     * skipped if a destination value exists. Array and plain object properties
-     * are merged recursively.Other objects and value types are overridden by
-     * assignment. Source objects are applied from left to right. Subsequent
-     * sources overwrite property assignments of previous sources.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.5.0
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} [sources] The source objects.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var users = {
-     *   'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
-     * };
-     *
-     * var ages = {
-     *   'data': [{ 'age': 36 }, { 'age': 40 }]
-     * };
-     *
-     * _.merge(users, ages);
-     * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
-     */
-    var merge = createAssigner(function(object, source, srcIndex) {
-      baseMerge(object, source, srcIndex);
-    });
-
-    /**
-     * This method is like `_.merge` except that it accepts `customizer` which
-     * is invoked to produce the merged values of the destination and source
-     * properties. If `customizer` returns `undefined`, merging is handled by the
-     * method instead. The `customizer` is invoked with seven arguments:
-     * (objValue, srcValue, key, object, source, stack).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} sources The source objects.
-     * @param {Function} customizer The function to customize assigned values.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * function customizer(objValue, srcValue) {
-     *   if (_.isArray(objValue)) {
-     *     return objValue.concat(srcValue);
-     *   }
-     * }
-     *
-     * var object = {
-     *   'fruits': ['apple'],
-     *   'vegetables': ['beet']
-     * };
-     *
-     * var other = {
-     *   'fruits': ['banana'],
-     *   'vegetables': ['carrot']
-     * };
-     *
-     * _.mergeWith(object, other, customizer);
-     * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
-     */
-    var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
-      baseMerge(object, source, srcIndex, customizer);
-    });
-
-    /**
-     * The opposite of `_.pick`; this method creates an object composed of the
-     * own and inherited enumerable string keyed properties of `object` that are
-     * not omitted.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The source object.
-     * @param {...(string|string[])} [props] The property identifiers to omit.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': '2', 'c': 3 };
-     *
-     * _.omit(object, ['a', 'c']);
-     * // => { 'b': '2' }
-     */
-    var omit = rest(function(object, props) {
-      if (object == null) {
-        return {};
-      }
-      props = arrayMap(baseFlatten(props, 1), toKey);
-      return basePick(object, baseDifference(getAllKeysIn(object), props));
-    });
-
-    /**
-     * The opposite of `_.pickBy`; this method creates an object composed of
-     * the own and inherited enumerable string keyed properties of `object` that
-     * `predicate` doesn't return truthy for. The predicate is invoked with two
-     * arguments: (value, key).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The source object.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per property.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': '2', 'c': 3 };
-     *
-     * _.omitBy(object, _.isNumber);
-     * // => { 'b': '2' }
-     */
-    function omitBy(object, predicate) {
-      predicate = getIteratee(predicate);
-      return basePickBy(object, function(value, key) {
-        return !predicate(value, key);
-      });
-    }
-
-    /**
-     * Creates an object composed of the picked `object` properties.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The source object.
-     * @param {...(string|string[])} [props] The property identifiers to pick.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': '2', 'c': 3 };
-     *
-     * _.pick(object, ['a', 'c']);
-     * // => { 'a': 1, 'c': 3 }
-     */
-    var pick = rest(function(object, props) {
-      return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey));
-    });
-
-    /**
-     * Creates an object composed of the `object` properties `predicate` returns
-     * truthy for. The predicate is invoked with two arguments: (value, key).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The source object.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per property.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': '2', 'c': 3 };
-     *
-     * _.pickBy(object, _.isNumber);
-     * // => { 'a': 1, 'c': 3 }
-     */
-    function pickBy(object, predicate) {
-      return object == null ? {} : basePickBy(object, getIteratee(predicate));
-    }
-
-    /**
-     * This method is like `_.get` except that if the resolved value is a
-     * function it's invoked with the `this` binding of its parent object and
-     * its result is returned.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the property to resolve.
-     * @param {*} [defaultValue] The value returned for `undefined` resolved values.
-     * @returns {*} Returns the resolved value.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
-     *
-     * _.result(object, 'a[0].b.c1');
-     * // => 3
-     *
-     * _.result(object, 'a[0].b.c2');
-     * // => 4
-     *
-     * _.result(object, 'a[0].b.c3', 'default');
-     * // => 'default'
-     *
-     * _.result(object, 'a[0].b.c3', _.constant('default'));
-     * // => 'default'
-     */
-    function result(object, path, defaultValue) {
-      path = isKey(path, object) ? [path] : castPath(path);
-
-      var index = -1,
-          length = path.length;
-
-      // Ensure the loop is entered when path is empty.
-      if (!length) {
-        object = undefined;
-        length = 1;
-      }
-      while (++index < length) {
-        var value = object == null ? undefined : object[toKey(path[index])];
-        if (value === undefined) {
-          index = length;
-          value = defaultValue;
-        }
-        object = isFunction(value) ? value.call(object) : value;
-      }
-      return object;
-    }
-
-    /**
-     * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
-     * it's created. Arrays are created for missing index properties while objects
-     * are created for all other missing properties. Use `_.setWith` to customize
-     * `path` creation.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.7.0
-     * @category Object
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to set.
-     * @param {*} value The value to set.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
-     *
-     * _.set(object, 'a[0].b.c', 4);
-     * console.log(object.a[0].b.c);
-     * // => 4
-     *
-     * _.set(object, ['x', '0', 'y', 'z'], 5);
-     * console.log(object.x[0].y.z);
-     * // => 5
-     */
-    function set(object, path, value) {
-      return object == null ? object : baseSet(object, path, value);
-    }
-
-    /**
-     * This method is like `_.set` except that it accepts `customizer` which is
-     * invoked to produce the objects of `path`.  If `customizer` returns `undefined`
-     * path creation is handled by the method instead. The `customizer` is invoked
-     * with three arguments: (nsValue, key, nsObject).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to set.
-     * @param {*} value The value to set.
-     * @param {Function} [customizer] The function to customize assigned values.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var object = {};
-     *
-     * _.setWith(object, '[0][1]', 'a', Object);
-     * // => { '0': { '1': 'a' } }
-     */
-    function setWith(object, path, value, customizer) {
-      customizer = typeof customizer == 'function' ? customizer : undefined;
-      return object == null ? object : baseSet(object, path, value, customizer);
-    }
-
-    /**
-     * Creates an array of own enumerable string keyed-value pairs for `object`
-     * which can be consumed by `_.fromPairs`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @alias entries
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the new array of key-value pairs.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.toPairs(new Foo);
-     * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
-     */
-    function toPairs(object) {
-      return baseToPairs(object, keys(object));
-    }
-
-    /**
-     * Creates an array of own and inherited enumerable string keyed-value pairs
-     * for `object` which can be consumed by `_.fromPairs`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @alias entriesIn
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the new array of key-value pairs.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.toPairsIn(new Foo);
-     * // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)
-     */
-    function toPairsIn(object) {
-      return baseToPairs(object, keysIn(object));
-    }
-
-    /**
-     * An alternative to `_.reduce`; this method transforms `object` to a new
-     * `accumulator` object which is the result of running each of its own
-     * enumerable string keyed properties thru `iteratee`, with each invocation
-     * potentially mutating the `accumulator` object. The iteratee is invoked
-     * with four arguments: (accumulator, value, key, object). Iteratee functions
-     * may exit iteration early by explicitly returning `false`.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.3.0
-     * @category Object
-     * @param {Array|Object} object The object to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @param {*} [accumulator] The custom accumulator value.
-     * @returns {*} Returns the accumulated value.
-     * @example
-     *
-     * _.transform([2, 3, 4], function(result, n) {
-     *   result.push(n *= n);
-     *   return n % 2 == 0;
-     * }, []);
-     * // => [4, 9]
-     *
-     * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
-     *   (result[value] || (result[value] = [])).push(key);
-     * }, {});
-     * // => { '1': ['a', 'c'], '2': ['b'] }
-     */
-    function transform(object, iteratee, accumulator) {
-      var isArr = isArray(object) || isTypedArray(object);
-      iteratee = getIteratee(iteratee, 4);
-
-      if (accumulator == null) {
-        if (isArr || isObject(object)) {
-          var Ctor = object.constructor;
-          if (isArr) {
-            accumulator = isArray(object) ? new Ctor : [];
-          } else {
-            accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
-          }
-        } else {
-          accumulator = {};
-        }
-      }
-      (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
-        return iteratee(accumulator, value, index, object);
-      });
-      return accumulator;
-    }
-
-    /**
-     * Removes the property at `path` of `object`.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to unset.
-     * @returns {boolean} Returns `true` if the property is deleted, else `false`.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 7 } }] };
-     * _.unset(object, 'a[0].b.c');
-     * // => true
-     *
-     * console.log(object);
-     * // => { 'a': [{ 'b': {} }] };
-     *
-     * _.unset(object, ['a', '0', 'b', 'c']);
-     * // => true
-     *
-     * console.log(object);
-     * // => { 'a': [{ 'b': {} }] };
-     */
-    function unset(object, path) {
-      return object == null ? true : baseUnset(object, path);
-    }
-
-    /**
-     * This method is like `_.set` except that accepts `updater` to produce the
-     * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
-     * is invoked with one argument: (value).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.6.0
-     * @category Object
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to set.
-     * @param {Function} updater The function to produce the updated value.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
-     *
-     * _.update(object, 'a[0].b.c', function(n) { return n * n; });
-     * console.log(object.a[0].b.c);
-     * // => 9
-     *
-     * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
-     * console.log(object.x[0].y.z);
-     * // => 0
-     */
-    function update(object, path, updater) {
-      return object == null ? object : baseUpdate(object, path, castFunction(updater));
-    }
-
-    /**
-     * This method is like `_.update` except that it accepts `customizer` which is
-     * invoked to produce the objects of `path`.  If `customizer` returns `undefined`
-     * path creation is handled by the method instead. The `customizer` is invoked
-     * with three arguments: (nsValue, key, nsObject).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.6.0
-     * @category Object
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to set.
-     * @param {Function} updater The function to produce the updated value.
-     * @param {Function} [customizer] The function to customize assigned values.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var object = {};
-     *
-     * _.updateWith(object, '[0][1]', _.constant('a'), Object);
-     * // => { '0': { '1': 'a' } }
-     */
-    function updateWith(object, path, updater, customizer) {
-      customizer = typeof customizer == 'function' ? customizer : undefined;
-      return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
-    }
-
-    /**
-     * Creates an array of the own enumerable string keyed property values of `object`.
-     *
-     * **Note:** Non-object values are coerced to objects.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property values.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.values(new Foo);
-     * // => [1, 2] (iteration order is not guaranteed)
-     *
-     * _.values('hi');
-     * // => ['h', 'i']
-     */
-    function values(object) {
-      return object ? baseValues(object, keys(object)) : [];
-    }
-
-    /**
-     * Creates an array of the own and inherited enumerable string keyed property
-     * values of `object`.
-     *
-     * **Note:** Non-object values are coerced to objects.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property values.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.valuesIn(new Foo);
-     * // => [1, 2, 3] (iteration order is not guaranteed)
-     */
-    function valuesIn(object) {
-      return object == null ? [] : baseValues(object, keysIn(object));
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Clamps `number` within the inclusive `lower` and `upper` bounds.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Number
-     * @param {number} number The number to clamp.
-     * @param {number} [lower] The lower bound.
-     * @param {number} upper The upper bound.
-     * @returns {number} Returns the clamped number.
-     * @example
-     *
-     * _.clamp(-10, -5, 5);
-     * // => -5
-     *
-     * _.clamp(10, -5, 5);
-     * // => 5
-     */
-    function clamp(number, lower, upper) {
-      if (upper === undefined) {
-        upper = lower;
-        lower = undefined;
-      }
-      if (upper !== undefined) {
-        upper = toNumber(upper);
-        upper = upper === upper ? upper : 0;
-      }
-      if (lower !== undefined) {
-        lower = toNumber(lower);
-        lower = lower === lower ? lower : 0;
-      }
-      return baseClamp(toNumber(number), lower, upper);
-    }
-
-    /**
-     * Checks if `n` is between `start` and up to, but not including, `end`. If
-     * `end` is not specified, it's set to `start` with `start` then set to `0`.
-     * If `start` is greater than `end` the params are swapped to support
-     * negative ranges.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.3.0
-     * @category Number
-     * @param {number} number The number to check.
-     * @param {number} [start=0] The start of the range.
-     * @param {number} end The end of the range.
-     * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
-     * @see _.range, _.rangeRight
-     * @example
-     *
-     * _.inRange(3, 2, 4);
-     * // => true
-     *
-     * _.inRange(4, 8);
-     * // => true
-     *
-     * _.inRange(4, 2);
-     * // => false
-     *
-     * _.inRange(2, 2);
-     * // => false
-     *
-     * _.inRange(1.2, 2);
-     * // => true
-     *
-     * _.inRange(5.2, 4);
-     * // => false
-     *
-     * _.inRange(-3, -2, -6);
-     * // => true
-     */
-    function inRange(number, start, end) {
-      start = toNumber(start) || 0;
-      if (end === undefined) {
-        end = start;
-        start = 0;
-      } else {
-        end = toNumber(end) || 0;
-      }
-      number = toNumber(number);
-      return baseInRange(number, start, end);
-    }
-
-    /**
-     * Produces a random number between the inclusive `lower` and `upper` bounds.
-     * If only one argument is provided a number between `0` and the given number
-     * is returned. If `floating` is `true`, or either `lower` or `upper` are
-     * floats, a floating-point number is returned instead of an integer.
-     *
-     * **Note:** JavaScript follows the IEEE-754 standard for resolving
-     * floating-point values which can produce unexpected results.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.7.0
-     * @category Number
-     * @param {number} [lower=0] The lower bound.
-     * @param {number} [upper=1] The upper bound.
-     * @param {boolean} [floating] Specify returning a floating-point number.
-     * @returns {number} Returns the random number.
-     * @example
-     *
-     * _.random(0, 5);
-     * // => an integer between 0 and 5
-     *
-     * _.random(5);
-     * // => also an integer between 0 and 5
-     *
-     * _.random(5, true);
-     * // => a floating-point number between 0 and 5
-     *
-     * _.random(1.2, 5.2);
-     * // => a floating-point number between 1.2 and 5.2
-     */
-    function random(lower, upper, floating) {
-      if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
-        upper = floating = undefined;
-      }
-      if (floating === undefined) {
-        if (typeof upper == 'boolean') {
-          floating = upper;
-          upper = undefined;
-        }
-        else if (typeof lower == 'boolean') {
-          floating = lower;
-          lower = undefined;
-        }
-      }
-      if (lower === undefined && upper === undefined) {
-        lower = 0;
-        upper = 1;
-      }
-      else {
-        lower = toNumber(lower) || 0;
-        if (upper === undefined) {
-          upper = lower;
-          lower = 0;
-        } else {
-          upper = toNumber(upper) || 0;
-        }
-      }
-      if (lower > upper) {
-        var temp = lower;
-        lower = upper;
-        upper = temp;
-      }
-      if (floating || lower % 1 || upper % 1) {
-        var rand = nativeRandom();
-        return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
-      }
-      return baseRandom(lower, upper);
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the camel cased string.
-     * @example
-     *
-     * _.camelCase('Foo Bar');
-     * // => 'fooBar'
-     *
-     * _.camelCase('--foo-bar--');
-     * // => 'fooBar'
-     *
-     * _.camelCase('__FOO_BAR__');
-     * // => 'fooBar'
-     */
-    var camelCase = createCompounder(function(result, word, index) {
-      word = word.toLowerCase();
-      return result + (index ? capitalize(word) : word);
-    });
-
-    /**
-     * Converts the first character of `string` to upper case and the remaining
-     * to lower case.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to capitalize.
-     * @returns {string} Returns the capitalized string.
-     * @example
-     *
-     * _.capitalize('FRED');
-     * // => 'Fred'
-     */
-    function capitalize(string) {
-      return upperFirst(toString(string).toLowerCase());
-    }
-
-    /**
-     * Deburrs `string` by converting
-     * [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
-     * to basic latin letters and removing
-     * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to deburr.
-     * @returns {string} Returns the deburred string.
-     * @example
-     *
-     * _.deburr('déjà vu');
-     * // => 'deja vu'
-     */
-    function deburr(string) {
-      string = toString(string);
-      return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
-    }
-
-    /**
-     * Checks if `string` ends with the given target string.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to search.
-     * @param {string} [target] The string to search for.
-     * @param {number} [position=string.length] The position to search from.
-     * @returns {boolean} Returns `true` if `string` ends with `target`,
-     *  else `false`.
-     * @example
-     *
-     * _.endsWith('abc', 'c');
-     * // => true
-     *
-     * _.endsWith('abc', 'b');
-     * // => false
-     *
-     * _.endsWith('abc', 'b', 2);
-     * // => true
-     */
-    function endsWith(string, target, position) {
-      string = toString(string);
-      target = baseToString(target);
-
-      var length = string.length;
-      position = position === undefined
-        ? length
-        : baseClamp(toInteger(position), 0, length);
-
-      position -= target.length;
-      return position >= 0 && string.indexOf(target, position) == position;
-    }
-
-    /**
-     * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
-     * their corresponding HTML entities.
-     *
-     * **Note:** No other characters are escaped. To escape additional
-     * characters use a third-party library like [_he_](https://mths.be/he).
-     *
-     * Though the ">" character is escaped for symmetry, characters like
-     * ">" and "/" don't need escaping in HTML and have no special meaning
-     * unless they're part of a tag or unquoted attribute value. See
-     * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
-     * (under "semi-related fun fact") for more details.
-     *
-     * Backticks are escaped because in IE < 9, they can break out of
-     * attribute values or HTML comments. See [#59](https://html5sec.org/#59),
-     * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
-     * [#133](https://html5sec.org/#133) of the
-     * [HTML5 Security Cheatsheet](https://html5sec.org/) for more details.
-     *
-     * When working with HTML you should always
-     * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
-     * XSS vectors.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category String
-     * @param {string} [string=''] The string to escape.
-     * @returns {string} Returns the escaped string.
-     * @example
-     *
-     * _.escape('fred, barney, & pebbles');
-     * // => 'fred, barney, &amp; pebbles'
-     */
-    function escape(string) {
-      string = toString(string);
-      return (string && reHasUnescapedHtml.test(string))
-        ? string.replace(reUnescapedHtml, escapeHtmlChar)
-        : string;
-    }
-
-    /**
-     * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
-     * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to escape.
-     * @returns {string} Returns the escaped string.
-     * @example
-     *
-     * _.escapeRegExp('[lodash](https://lodash.com/)');
-     * // => '\[lodash\]\(https://lodash\.com/\)'
-     */
-    function escapeRegExp(string) {
-      string = toString(string);
-      return (string && reHasRegExpChar.test(string))
-        ? string.replace(reRegExpChar, '\\$&')
-        : string;
-    }
-
-    /**
-     * Converts `string` to
-     * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the kebab cased string.
-     * @example
-     *
-     * _.kebabCase('Foo Bar');
-     * // => 'foo-bar'
-     *
-     * _.kebabCase('fooBar');
-     * // => 'foo-bar'
-     *
-     * _.kebabCase('__FOO_BAR__');
-     * // => 'foo-bar'
-     */
-    var kebabCase = createCompounder(function(result, word, index) {
-      return result + (index ? '-' : '') + word.toLowerCase();
-    });
-
-    /**
-     * Converts `string`, as space separated words, to lower case.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the lower cased string.
-     * @example
-     *
-     * _.lowerCase('--Foo-Bar--');
-     * // => 'foo bar'
-     *
-     * _.lowerCase('fooBar');
-     * // => 'foo bar'
-     *
-     * _.lowerCase('__FOO_BAR__');
-     * // => 'foo bar'
-     */
-    var lowerCase = createCompounder(function(result, word, index) {
-      return result + (index ? ' ' : '') + word.toLowerCase();
-    });
-
-    /**
-     * Converts the first character of `string` to lower case.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the converted string.
-     * @example
-     *
-     * _.lowerFirst('Fred');
-     * // => 'fred'
-     *
-     * _.lowerFirst('FRED');
-     * // => 'fRED'
-     */
-    var lowerFirst = createCaseFirst('toLowerCase');
-
-    /**
-     * Pads `string` on the left and right sides if it's shorter than `length`.
-     * Padding characters are truncated if they can't be evenly divided by `length`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to pad.
-     * @param {number} [length=0] The padding length.
-     * @param {string} [chars=' '] The string used as padding.
-     * @returns {string} Returns the padded string.
-     * @example
-     *
-     * _.pad('abc', 8);
-     * // => '  abc   '
-     *
-     * _.pad('abc', 8, '_-');
-     * // => '_-abc_-_'
-     *
-     * _.pad('abc', 3);
-     * // => 'abc'
-     */
-    function pad(string, length, chars) {
-      string = toString(string);
-      length = toInteger(length);
-
-      var strLength = length ? stringSize(string) : 0;
-      if (!length || strLength >= length) {
-        return string;
-      }
-      var mid = (length - strLength) / 2;
-      return (
-        createPadding(nativeFloor(mid), chars) +
-        string +
-        createPadding(nativeCeil(mid), chars)
-      );
-    }
-
-    /**
-     * Pads `string` on the right side if it's shorter than `length`. Padding
-     * characters are truncated if they exceed `length`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to pad.
-     * @param {number} [length=0] The padding length.
-     * @param {string} [chars=' '] The string used as padding.
-     * @returns {string} Returns the padded string.
-     * @example
-     *
-     * _.padEnd('abc', 6);
-     * // => 'abc   '
-     *
-     * _.padEnd('abc', 6, '_-');
-     * // => 'abc_-_'
-     *
-     * _.padEnd('abc', 3);
-     * // => 'abc'
-     */
-    function padEnd(string, length, chars) {
-      string = toString(string);
-      length = toInteger(length);
-
-      var strLength = length ? stringSize(string) : 0;
-      return (length && strLength < length)
-        ? (string + createPadding(length - strLength, chars))
-        : string;
-    }
-
-    /**
-     * Pads `string` on the left side if it's shorter than `length`. Padding
-     * characters are truncated if they exceed `length`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to pad.
-     * @param {number} [length=0] The padding length.
-     * @param {string} [chars=' '] The string used as padding.
-     * @returns {string} Returns the padded string.
-     * @example
-     *
-     * _.padStart('abc', 6);
-     * // => '   abc'
-     *
-     * _.padStart('abc', 6, '_-');
-     * // => '_-_abc'
-     *
-     * _.padStart('abc', 3);
-     * // => 'abc'
-     */
-    function padStart(string, length, chars) {
-      string = toString(string);
-      length = toInteger(length);
-
-      var strLength = length ? stringSize(string) : 0;
-      return (length && strLength < length)
-        ? (createPadding(length - strLength, chars) + string)
-        : string;
-    }
-
-    /**
-     * Converts `string` to an integer of the specified radix. If `radix` is
-     * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
-     * hexadecimal, in which case a `radix` of `16` is used.
-     *
-     * **Note:** This method aligns with the
-     * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.1.0
-     * @category String
-     * @param {string} string The string to convert.
-     * @param {number} [radix=10] The radix to interpret `value` by.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {number} Returns the converted integer.
-     * @example
-     *
-     * _.parseInt('08');
-     * // => 8
-     *
-     * _.map(['6', '08', '10'], _.parseInt);
-     * // => [6, 8, 10]
-     */
-    function parseInt(string, radix, guard) {
-      // Chrome fails to trim leading <BOM> whitespace characters.
-      // See https://bugs.chromium.org/p/v8/issues/detail?id=3109 for more details.
-      if (guard || radix == null) {
-        radix = 0;
-      } else if (radix) {
-        radix = +radix;
-      }
-      string = toString(string).replace(reTrim, '');
-      return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
-    }
-
-    /**
-     * Repeats the given string `n` times.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to repeat.
-     * @param {number} [n=1] The number of times to repeat the string.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {string} Returns the repeated string.
-     * @example
-     *
-     * _.repeat('*', 3);
-     * // => '***'
-     *
-     * _.repeat('abc', 2);
-     * // => 'abcabc'
-     *
-     * _.repeat('abc', 0);
-     * // => ''
-     */
-    function repeat(string, n, guard) {
-      if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
-        n = 1;
-      } else {
-        n = toInteger(n);
-      }
-      return baseRepeat(toString(string), n);
-    }
-
-    /**
-     * Replaces matches for `pattern` in `string` with `replacement`.
-     *
-     * **Note:** This method is based on
-     * [`String#replace`](https://mdn.io/String/replace).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to modify.
-     * @param {RegExp|string} pattern The pattern to replace.
-     * @param {Function|string} replacement The match replacement.
-     * @returns {string} Returns the modified string.
-     * @example
-     *
-     * _.replace('Hi Fred', 'Fred', 'Barney');
-     * // => 'Hi Barney'
-     */
-    function replace() {
-      var args = arguments,
-          string = toString(args[0]);
-
-      return args.length < 3 ? string : nativeReplace.call(string, args[1], args[2]);
-    }
-
-    /**
-     * Converts `string` to
-     * [snake case](https://en.wikipedia.org/wiki/Snake_case).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the snake cased string.
-     * @example
-     *
-     * _.snakeCase('Foo Bar');
-     * // => 'foo_bar'
-     *
-     * _.snakeCase('fooBar');
-     * // => 'foo_bar'
-     *
-     * _.snakeCase('--FOO-BAR--');
-     * // => 'foo_bar'
-     */
-    var snakeCase = createCompounder(function(result, word, index) {
-      return result + (index ? '_' : '') + word.toLowerCase();
-    });
-
-    /**
-     * Splits `string` by `separator`.
-     *
-     * **Note:** This method is based on
-     * [`String#split`](https://mdn.io/String/split).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to split.
-     * @param {RegExp|string} separator The separator pattern to split by.
-     * @param {number} [limit] The length to truncate results to.
-     * @returns {Array} Returns the new array of string segments.
-     * @example
-     *
-     * _.split('a-b-c', '-', 2);
-     * // => ['a', 'b']
-     */
-    function split(string, separator, limit) {
-      if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
-        separator = limit = undefined;
-      }
-      limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
-      if (!limit) {
-        return [];
-      }
-      string = toString(string);
-      if (string && (
-            typeof separator == 'string' ||
-            (separator != null && !isRegExp(separator))
-          )) {
-        separator = baseToString(separator);
-        if (separator == '' && reHasComplexSymbol.test(string)) {
-          return castSlice(stringToArray(string), 0, limit);
-        }
-      }
-      return nativeSplit.call(string, separator, limit);
-    }
-
-    /**
-     * Converts `string` to
-     * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.1.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the start cased string.
-     * @example
-     *
-     * _.startCase('--foo-bar--');
-     * // => 'Foo Bar'
-     *
-     * _.startCase('fooBar');
-     * // => 'Foo Bar'
-     *
-     * _.startCase('__FOO_BAR__');
-     * // => 'FOO BAR'
-     */
-    var startCase = createCompounder(function(result, word, index) {
-      return result + (index ? ' ' : '') + upperFirst(word);
-    });
-
-    /**
-     * Checks if `string` starts with the given target string.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to search.
-     * @param {string} [target] The string to search for.
-     * @param {number} [position=0] The position to search from.
-     * @returns {boolean} Returns `true` if `string` starts with `target`,
-     *  else `false`.
-     * @example
-     *
-     * _.startsWith('abc', 'a');
-     * // => true
-     *
-     * _.startsWith('abc', 'b');
-     * // => false
-     *
-     * _.startsWith('abc', 'b', 1);
-     * // => true
-     */
-    function startsWith(string, target, position) {
-      string = toString(string);
-      position = baseClamp(toInteger(position), 0, string.length);
-      return string.lastIndexOf(baseToString(target), position) == position;
-    }
-
-    /**
-     * Creates a compiled template function that can interpolate data properties
-     * in "interpolate" delimiters, HTML-escape interpolated data properties in
-     * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
-     * properties may be accessed as free variables in the template. If a setting
-     * object is given, it takes precedence over `_.templateSettings` values.
-     *
-     * **Note:** In the development build `_.template` utilizes
-     * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
-     * for easier debugging.
-     *
-     * For more information on precompiling templates see
-     * [lodash's custom builds documentation](https://lodash.com/custom-builds).
-     *
-     * For more information on Chrome extension sandboxes see
-     * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category String
-     * @param {string} [string=''] The template string.
-     * @param {Object} [options={}] The options object.
-     * @param {RegExp} [options.escape=_.templateSettings.escape]
-     *  The HTML "escape" delimiter.
-     * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
-     *  The "evaluate" delimiter.
-     * @param {Object} [options.imports=_.templateSettings.imports]
-     *  An object to import into the template as free variables.
-     * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
-     *  The "interpolate" delimiter.
-     * @param {string} [options.sourceURL='lodash.templateSources[n]']
-     *  The sourceURL of the compiled template.
-     * @param {string} [options.variable='obj']
-     *  The data object variable name.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Function} Returns the compiled template function.
-     * @example
-     *
-     * // Use the "interpolate" delimiter to create a compiled template.
-     * var compiled = _.template('hello <%= user %>!');
-     * compiled({ 'user': 'fred' });
-     * // => 'hello fred!'
-     *
-     * // Use the HTML "escape" delimiter to escape data property values.
-     * var compiled = _.template('<b><%- value %></b>');
-     * compiled({ 'value': '<script>' });
-     * // => '<b>&lt;script&gt;</b>'
-     *
-     * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
-     * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
-     * compiled({ 'users': ['fred', 'barney'] });
-     * // => '<li>fred</li><li>barney</li>'
-     *
-     * // Use the internal `print` function in "evaluate" delimiters.
-     * var compiled = _.template('<% print("hello " + user); %>!');
-     * compiled({ 'user': 'barney' });
-     * // => 'hello barney!'
-     *
-     * // Use the ES delimiter as an alternative to the default "interpolate" delimiter.
-     * var compiled = _.template('hello ${ user }!');
-     * compiled({ 'user': 'pebbles' });
-     * // => 'hello pebbles!'
-     *
-     * // Use custom template delimiters.
-     * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
-     * var compiled = _.template('hello {{ user }}!');
-     * compiled({ 'user': 'mustache' });
-     * // => 'hello mustache!'
-     *
-     * // Use backslashes to treat delimiters as plain text.
-     * var compiled = _.template('<%= "\\<%- value %\\>" %>');
-     * compiled({ 'value': 'ignored' });
-     * // => '<%- value %>'
-     *
-     * // Use the `imports` option to import `jQuery` as `jq`.
-     * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
-     * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
-     * compiled({ 'users': ['fred', 'barney'] });
-     * // => '<li>fred</li><li>barney</li>'
-     *
-     * // Use the `sourceURL` option to specify a custom sourceURL for the template.
-     * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
-     * compiled(data);
-     * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
-     *
-     * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
-     * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
-     * compiled.source;
-     * // => function(data) {
-     * //   var __t, __p = '';
-     * //   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
-     * //   return __p;
-     * // }
-     *
-     * // Use the `source` property to inline compiled templates for meaningful
-     * // line numbers in error messages and stack traces.
-     * fs.writeFileSync(path.join(cwd, 'jst.js'), '\
-     *   var JST = {\
-     *     "main": ' + _.template(mainText).source + '\
-     *   };\
-     * ');
-     */
-    function template(string, options, guard) {
-      // Based on John Resig's `tmpl` implementation
-      // (http://ejohn.org/blog/javascript-micro-templating/)
-      // and Laura Doktorova's doT.js (https://github.com/olado/doT).
-      var settings = lodash.templateSettings;
-
-      if (guard && isIterateeCall(string, options, guard)) {
-        options = undefined;
-      }
-      string = toString(string);
-      options = assignInWith({}, options, settings, assignInDefaults);
-
-      var imports = assignInWith({}, options.imports, settings.imports, assignInDefaults),
-          importsKeys = keys(imports),
-          importsValues = baseValues(imports, importsKeys);
-
-      var isEscaping,
-          isEvaluating,
-          index = 0,
-          interpolate = options.interpolate || reNoMatch,
-          source = "__p += '";
-
-      // Compile the regexp to match each delimiter.
-      var reDelimiters = RegExp(
-        (options.escape || reNoMatch).source + '|' +
-        interpolate.source + '|' +
-        (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
-        (options.evaluate || reNoMatch).source + '|$'
-      , 'g');
-
-      // Use a sourceURL for easier debugging.
-      var sourceURL = '//# sourceURL=' +
-        ('sourceURL' in options
-          ? options.sourceURL
-          : ('lodash.templateSources[' + (++templateCounter) + ']')
-        ) + '\n';
-
-      string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
-        interpolateValue || (interpolateValue = esTemplateValue);
-
-        // Escape characters that can't be included in string literals.
-        source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
-
-        // Replace delimiters with snippets.
-        if (escapeValue) {
-          isEscaping = true;
-          source += "' +\n__e(" + escapeValue + ") +\n'";
-        }
-        if (evaluateValue) {
-          isEvaluating = true;
-          source += "';\n" + evaluateValue + ";\n__p += '";
-        }
-        if (interpolateValue) {
-          source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
-        }
-        index = offset + match.length;
-
-        // The JS engine embedded in Adobe products needs `match` returned in
-        // order to produce the correct `offset` value.
-        return match;
-      });
-
-      source += "';\n";
-
-      // If `variable` is not specified wrap a with-statement around the generated
-      // code to add the data object to the top of the scope chain.
-      var variable = options.variable;
-      if (!variable) {
-        source = 'with (obj) {\n' + source + '\n}\n';
-      }
-      // Cleanup code by stripping empty strings.
-      source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
-        .replace(reEmptyStringMiddle, '$1')
-        .replace(reEmptyStringTrailing, '$1;');
-
-      // Frame code as the function body.
-      source = 'function(' + (variable || 'obj') + ') {\n' +
-        (variable
-          ? ''
-          : 'obj || (obj = {});\n'
-        ) +
-        "var __t, __p = ''" +
-        (isEscaping
-           ? ', __e = _.escape'
-           : ''
-        ) +
-        (isEvaluating
-          ? ', __j = Array.prototype.join;\n' +
-            "function print() { __p += __j.call(arguments, '') }\n"
-          : ';\n'
-        ) +
-        source +
-        'return __p\n}';
-
-      var result = attempt(function() {
-        return Function(importsKeys, sourceURL + 'return ' + source)
-          .apply(undefined, importsValues);
-      });
-
-      // Provide the compiled function's source by its `toString` method or
-      // the `source` property as a convenience for inlining compiled templates.
-      result.source = source;
-      if (isError(result)) {
-        throw result;
-      }
-      return result;
-    }
-
-    /**
-     * Converts `string`, as a whole, to lower case just like
-     * [String#toLowerCase](https://mdn.io/toLowerCase).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the lower cased string.
-     * @example
-     *
-     * _.toLower('--Foo-Bar--');
-     * // => '--foo-bar--'
-     *
-     * _.toLower('fooBar');
-     * // => 'foobar'
-     *
-     * _.toLower('__FOO_BAR__');
-     * // => '__foo_bar__'
-     */
-    function toLower(value) {
-      return toString(value).toLowerCase();
-    }
-
-    /**
-     * Converts `string`, as a whole, to upper case just like
-     * [String#toUpperCase](https://mdn.io/toUpperCase).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the upper cased string.
-     * @example
-     *
-     * _.toUpper('--foo-bar--');
-     * // => '--FOO-BAR--'
-     *
-     * _.toUpper('fooBar');
-     * // => 'FOOBAR'
-     *
-     * _.toUpper('__foo_bar__');
-     * // => '__FOO_BAR__'
-     */
-    function toUpper(value) {
-      return toString(value).toUpperCase();
-    }
-
-    /**
-     * Removes leading and trailing whitespace or specified characters from `string`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to trim.
-     * @param {string} [chars=whitespace] The characters to trim.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {string} Returns the trimmed string.
-     * @example
-     *
-     * _.trim('  abc  ');
-     * // => 'abc'
-     *
-     * _.trim('-_-abc-_-', '_-');
-     * // => 'abc'
-     *
-     * _.map(['  foo  ', '  bar  '], _.trim);
-     * // => ['foo', 'bar']
-     */
-    function trim(string, chars, guard) {
-      string = toString(string);
-      if (string && (guard || chars === undefined)) {
-        return string.replace(reTrim, '');
-      }
-      if (!string || !(chars = baseToString(chars))) {
-        return string;
-      }
-      var strSymbols = stringToArray(string),
-          chrSymbols = stringToArray(chars),
-          start = charsStartIndex(strSymbols, chrSymbols),
-          end = charsEndIndex(strSymbols, chrSymbols) + 1;
-
-      return castSlice(strSymbols, start, end).join('');
-    }
-
-    /**
-     * Removes trailing whitespace or specified characters from `string`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to trim.
-     * @param {string} [chars=whitespace] The characters to trim.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {string} Returns the trimmed string.
-     * @example
-     *
-     * _.trimEnd('  abc  ');
-     * // => '  abc'
-     *
-     * _.trimEnd('-_-abc-_-', '_-');
-     * // => '-_-abc'
-     */
-    function trimEnd(string, chars, guard) {
-      string = toString(string);
-      if (string && (guard || chars === undefined)) {
-        return string.replace(reTrimEnd, '');
-      }
-      if (!string || !(chars = baseToString(chars))) {
-        return string;
-      }
-      var strSymbols = stringToArray(string),
-          end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
-
-      return castSlice(strSymbols, 0, end).join('');
-    }
-
-    /**
-     * Removes leading whitespace or specified characters from `string`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to trim.
-     * @param {string} [chars=whitespace] The characters to trim.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {string} Returns the trimmed string.
-     * @example
-     *
-     * _.trimStart('  abc  ');
-     * // => 'abc  '
-     *
-     * _.trimStart('-_-abc-_-', '_-');
-     * // => 'abc-_-'
-     */
-    function trimStart(string, chars, guard) {
-      string = toString(string);
-      if (string && (guard || chars === undefined)) {
-        return string.replace(reTrimStart, '');
-      }
-      if (!string || !(chars = baseToString(chars))) {
-        return string;
-      }
-      var strSymbols = stringToArray(string),
-          start = charsStartIndex(strSymbols, stringToArray(chars));
-
-      return castSlice(strSymbols, start).join('');
-    }
-
-    /**
-     * Truncates `string` if it's longer than the given maximum string length.
-     * The last characters of the truncated string are replaced with the omission
-     * string which defaults to "...".
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to truncate.
-     * @param {Object} [options={}] The options object.
-     * @param {number} [options.length=30] The maximum string length.
-     * @param {string} [options.omission='...'] The string to indicate text is omitted.
-     * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
-     * @returns {string} Returns the truncated string.
-     * @example
-     *
-     * _.truncate('hi-diddly-ho there, neighborino');
-     * // => 'hi-diddly-ho there, neighbo...'
-     *
-     * _.truncate('hi-diddly-ho there, neighborino', {
-     *   'length': 24,
-     *   'separator': ' '
-     * });
-     * // => 'hi-diddly-ho there,...'
-     *
-     * _.truncate('hi-diddly-ho there, neighborino', {
-     *   'length': 24,
-     *   'separator': /,? +/
-     * });
-     * // => 'hi-diddly-ho there...'
-     *
-     * _.truncate('hi-diddly-ho there, neighborino', {
-     *   'omission': ' [...]'
-     * });
-     * // => 'hi-diddly-ho there, neig [...]'
-     */
-    function truncate(string, options) {
-      var length = DEFAULT_TRUNC_LENGTH,
-          omission = DEFAULT_TRUNC_OMISSION;
-
-      if (isObject(options)) {
-        var separator = 'separator' in options ? options.separator : separator;
-        length = 'length' in options ? toInteger(options.length) : length;
-        omission = 'omission' in options ? baseToString(options.omission) : omission;
-      }
-      string = toString(string);
-
-      var strLength = string.length;
-      if (reHasComplexSymbol.test(string)) {
-        var strSymbols = stringToArray(string);
-        strLength = strSymbols.length;
-      }
-      if (length >= strLength) {
-        return string;
-      }
-      var end = length - stringSize(omission);
-      if (end < 1) {
-        return omission;
-      }
-      var result = strSymbols
-        ? castSlice(strSymbols, 0, end).join('')
-        : string.slice(0, end);
-
-      if (separator === undefined) {
-        return result + omission;
-      }
-      if (strSymbols) {
-        end += (result.length - end);
-      }
-      if (isRegExp(separator)) {
-        if (string.slice(end).search(separator)) {
-          var match,
-              substring = result;
-
-          if (!separator.global) {
-            separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
-          }
-          separator.lastIndex = 0;
-          while ((match = separator.exec(substring))) {
-            var newEnd = match.index;
-          }
-          result = result.slice(0, newEnd === undefined ? end : newEnd);
-        }
-      } else if (string.indexOf(baseToString(separator), end) != end) {
-        var index = result.lastIndexOf(separator);
-        if (index > -1) {
-          result = result.slice(0, index);
-        }
-      }
-      return result + omission;
-    }
-
-    /**
-     * The inverse of `_.escape`; this method converts the HTML entities
-     * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to
-     * their corresponding characters.
-     *
-     * **Note:** No other HTML entities are unescaped. To unescape additional
-     * HTML entities use a third-party library like [_he_](https://mths.be/he).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.6.0
-     * @category String
-     * @param {string} [string=''] The string to unescape.
-     * @returns {string} Returns the unescaped string.
-     * @example
-     *
-     * _.unescape('fred, barney, &amp; pebbles');
-     * // => 'fred, barney, & pebbles'
-     */
-    function unescape(string) {
-      string = toString(string);
-      return (string && reHasEscapedHtml.test(string))
-        ? string.replace(reEscapedHtml, unescapeHtmlChar)
-        : string;
-    }
-
-    /**
-     * Converts `string`, as space separated words, to upper case.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the upper cased string.
-     * @example
-     *
-     * _.upperCase('--foo-bar');
-     * // => 'FOO BAR'
-     *
-     * _.upperCase('fooBar');
-     * // => 'FOO BAR'
-     *
-     * _.upperCase('__foo_bar__');
-     * // => 'FOO BAR'
-     */
-    var upperCase = createCompounder(function(result, word, index) {
-      return result + (index ? ' ' : '') + word.toUpperCase();
-    });
-
-    /**
-     * Converts the first character of `string` to upper case.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the converted string.
-     * @example
-     *
-     * _.upperFirst('fred');
-     * // => 'Fred'
-     *
-     * _.upperFirst('FRED');
-     * // => 'FRED'
-     */
-    var upperFirst = createCaseFirst('toUpperCase');
-
-    /**
-     * Splits `string` into an array of its words.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to inspect.
-     * @param {RegExp|string} [pattern] The pattern to match words.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the words of `string`.
-     * @example
-     *
-     * _.words('fred, barney, & pebbles');
-     * // => ['fred', 'barney', 'pebbles']
-     *
-     * _.words('fred, barney, & pebbles', /[^, ]+/g);
-     * // => ['fred', 'barney', '&', 'pebbles']
-     */
-    function words(string, pattern, guard) {
-      string = toString(string);
-      pattern = guard ? undefined : pattern;
-
-      if (pattern === undefined) {
-        pattern = reHasComplexWord.test(string) ? reComplexWord : reBasicWord;
-      }
-      return string.match(pattern) || [];
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Attempts to invoke `func`, returning either the result or the caught error
-     * object. Any additional arguments are provided to `func` when it's invoked.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Util
-     * @param {Function} func The function to attempt.
-     * @param {...*} [args] The arguments to invoke `func` with.
-     * @returns {*} Returns the `func` result or error object.
-     * @example
-     *
-     * // Avoid throwing errors for invalid selectors.
-     * var elements = _.attempt(function(selector) {
-     *   return document.querySelectorAll(selector);
-     * }, '>_>');
-     *
-     * if (_.isError(elements)) {
-     *   elements = [];
-     * }
-     */
-    var attempt = rest(function(func, args) {
-      try {
-        return apply(func, undefined, args);
-      } catch (e) {
-        return isError(e) ? e : new Error(e);
-      }
-    });
-
-    /**
-     * Binds methods of an object to the object itself, overwriting the existing
-     * method.
-     *
-     * **Note:** This method doesn't set the "length" property of bound functions.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {Object} object The object to bind and assign the bound methods to.
-     * @param {...(string|string[])} methodNames The object method names to bind.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var view = {
-     *   'label': 'docs',
-     *   'onClick': function() {
-     *     console.log('clicked ' + this.label);
-     *   }
-     * };
-     *
-     * _.bindAll(view, 'onClick');
-     * jQuery(element).on('click', view.onClick);
-     * // => Logs 'clicked docs' when clicked.
-     */
-    var bindAll = rest(function(object, methodNames) {
-      arrayEach(baseFlatten(methodNames, 1), function(key) {
-        key = toKey(key);
-        object[key] = bind(object[key], object);
-      });
-      return object;
-    });
-
-    /**
-     * Creates a function that iterates over `pairs` and invokes the corresponding
-     * function of the first predicate to return truthy. The predicate-function
-     * pairs are invoked with the `this` binding and arguments of the created
-     * function.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {Array} pairs The predicate-function pairs.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var func = _.cond([
-     *   [_.matches({ 'a': 1 }),           _.constant('matches A')],
-     *   [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
-     *   [_.constant(true),                _.constant('no match')]
-     * ]);
-     *
-     * func({ 'a': 1, 'b': 2 });
-     * // => 'matches A'
-     *
-     * func({ 'a': 0, 'b': 1 });
-     * // => 'matches B'
-     *
-     * func({ 'a': '1', 'b': '2' });
-     * // => 'no match'
-     */
-    function cond(pairs) {
-      var length = pairs ? pairs.length : 0,
-          toIteratee = getIteratee();
-
-      pairs = !length ? [] : arrayMap(pairs, function(pair) {
-        if (typeof pair[1] != 'function') {
-          throw new TypeError(FUNC_ERROR_TEXT);
-        }
-        return [toIteratee(pair[0]), pair[1]];
-      });
-
-      return rest(function(args) {
-        var index = -1;
-        while (++index < length) {
-          var pair = pairs[index];
-          if (apply(pair[0], this, args)) {
-            return apply(pair[1], this, args);
-          }
-        }
-      });
-    }
-
-    /**
-     * Creates a function that invokes the predicate properties of `source` with
-     * the corresponding property values of a given object, returning `true` if
-     * all predicates return truthy, else `false`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {Object} source The object of property predicates to conform to.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36 },
-     *   { 'user': 'fred',   'age': 40 }
-     * ];
-     *
-     * _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) }));
-     * // => [{ 'user': 'fred', 'age': 40 }]
-     */
-    function conforms(source) {
-      return baseConforms(baseClone(source, true));
-    }
-
-    /**
-     * Creates a function that returns `value`.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.4.0
-     * @category Util
-     * @param {*} value The value to return from the new function.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var object = { 'user': 'fred' };
-     * var getter = _.constant(object);
-     *
-     * getter() === object;
-     * // => true
-     */
-    function constant(value) {
-      return function() {
-        return value;
-      };
-    }
-
-    /**
-     * Creates a function that returns the result of invoking the given functions
-     * with the `this` binding of the created function, where each successive
-     * invocation is supplied the return value of the previous.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Util
-     * @param {...(Function|Function[])} [funcs] Functions to invoke.
-     * @returns {Function} Returns the new function.
-     * @see _.flowRight
-     * @example
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * var addSquare = _.flow(_.add, square);
-     * addSquare(1, 2);
-     * // => 9
-     */
-    var flow = createFlow();
-
-    /**
-     * This method is like `_.flow` except that it creates a function that
-     * invokes the given functions from right to left.
-     *
-     * @static
-     * @since 3.0.0
-     * @memberOf _
-     * @category Util
-     * @param {...(Function|Function[])} [funcs] Functions to invoke.
-     * @returns {Function} Returns the new function.
-     * @see _.flow
-     * @example
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * var addSquare = _.flowRight(square, _.add);
-     * addSquare(1, 2);
-     * // => 9
-     */
-    var flowRight = createFlow(true);
-
-    /**
-     * This method returns the first argument given to it.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {*} value Any value.
-     * @returns {*} Returns `value`.
-     * @example
-     *
-     * var object = { 'user': 'fred' };
-     *
-     * _.identity(object) === object;
-     * // => true
-     */
-    function identity(value) {
-      return value;
-    }
-
-    /**
-     * Creates a function that invokes `func` with the arguments of the created
-     * function. If `func` is a property name, the created function returns the
-     * property value for a given element. If `func` is an array or object, the
-     * created function returns `true` for elements that contain the equivalent
-     * source properties, otherwise it returns `false`.
-     *
-     * @static
-     * @since 4.0.0
-     * @memberOf _
-     * @category Util
-     * @param {*} [func=_.identity] The value to convert to a callback.
-     * @returns {Function} Returns the callback.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36, 'active': true },
-     *   { 'user': 'fred',   'age': 40, 'active': false }
-     * ];
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
-     * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.filter(users, _.iteratee(['user', 'fred']));
-     * // => [{ 'user': 'fred', 'age': 40 }]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.map(users, _.iteratee('user'));
-     * // => ['barney', 'fred']
-     *
-     * // Create custom iteratee shorthands.
-     * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
-     *   return !_.isRegExp(func) ? iteratee(func) : function(string) {
-     *     return func.test(string);
-     *   };
-     * });
-     *
-     * _.filter(['abc', 'def'], /ef/);
-     * // => ['def']
-     */
-    function iteratee(func) {
-      return baseIteratee(typeof func == 'function' ? func : baseClone(func, true));
-    }
-
-    /**
-     * Creates a function that performs a partial deep comparison between a given
-     * object and `source`, returning `true` if the given object has equivalent
-     * property values, else `false`. The created function is equivalent to
-     * `_.isMatch` with a `source` partially applied.
-     *
-     * **Note:** This method supports comparing the same values as `_.isEqual`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Util
-     * @param {Object} source The object of property values to match.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36, 'active': true },
-     *   { 'user': 'fred',   'age': 40, 'active': false }
-     * ];
-     *
-     * _.filter(users, _.matches({ 'age': 40, 'active': false }));
-     * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
-     */
-    function matches(source) {
-      return baseMatches(baseClone(source, true));
-    }
-
-    /**
-     * Creates a function that performs a partial deep comparison between the
-     * value at `path` of a given object to `srcValue`, returning `true` if the
-     * object value is equivalent, else `false`.
-     *
-     * **Note:** This method supports comparing the same values as `_.isEqual`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.2.0
-     * @category Util
-     * @param {Array|string} path The path of the property to get.
-     * @param {*} srcValue The value to match.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney' },
-     *   { 'user': 'fred' }
-     * ];
-     *
-     * _.find(users, _.matchesProperty('user', 'fred'));
-     * // => { 'user': 'fred' }
-     */
-    function matchesProperty(path, srcValue) {
-      return baseMatchesProperty(path, baseClone(srcValue, true));
-    }
-
-    /**
-     * Creates a function that invokes the method at `path` of a given object.
-     * Any additional arguments are provided to the invoked method.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.7.0
-     * @category Util
-     * @param {Array|string} path The path of the method to invoke.
-     * @param {...*} [args] The arguments to invoke the method with.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var objects = [
-     *   { 'a': { 'b': _.constant(2) } },
-     *   { 'a': { 'b': _.constant(1) } }
-     * ];
-     *
-     * _.map(objects, _.method('a.b'));
-     * // => [2, 1]
-     *
-     * _.map(objects, _.method(['a', 'b']));
-     * // => [2, 1]
-     */
-    var method = rest(function(path, args) {
-      return function(object) {
-        return baseInvoke(object, path, args);
-      };
-    });
-
-    /**
-     * The opposite of `_.method`; this method creates a function that invokes
-     * the method at a given path of `object`. Any additional arguments are
-     * provided to the invoked method.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.7.0
-     * @category Util
-     * @param {Object} object The object to query.
-     * @param {...*} [args] The arguments to invoke the method with.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var array = _.times(3, _.constant),
-     *     object = { 'a': array, 'b': array, 'c': array };
-     *
-     * _.map(['a[2]', 'c[0]'], _.methodOf(object));
-     * // => [2, 0]
-     *
-     * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
-     * // => [2, 0]
-     */
-    var methodOf = rest(function(object, args) {
-      return function(path) {
-        return baseInvoke(object, path, args);
-      };
-    });
-
-    /**
-     * Adds all own enumerable string keyed function properties of a source
-     * object to the destination object. If `object` is a function, then methods
-     * are added to its prototype as well.
-     *
-     * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
-     * avoid conflicts caused by modifying the original.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {Function|Object} [object=lodash] The destination object.
-     * @param {Object} source The object of functions to add.
-     * @param {Object} [options={}] The options object.
-     * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
-     * @returns {Function|Object} Returns `object`.
-     * @example
-     *
-     * function vowels(string) {
-     *   return _.filter(string, function(v) {
-     *     return /[aeiou]/i.test(v);
-     *   });
-     * }
-     *
-     * _.mixin({ 'vowels': vowels });
-     * _.vowels('fred');
-     * // => ['e']
-     *
-     * _('fred').vowels().value();
-     * // => ['e']
-     *
-     * _.mixin({ 'vowels': vowels }, { 'chain': false });
-     * _('fred').vowels();
-     * // => ['e']
-     */
-    function mixin(object, source, options) {
-      var props = keys(source),
-          methodNames = baseFunctions(source, props);
-
-      if (options == null &&
-          !(isObject(source) && (methodNames.length || !props.length))) {
-        options = source;
-        source = object;
-        object = this;
-        methodNames = baseFunctions(source, keys(source));
-      }
-      var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
-          isFunc = isFunction(object);
-
-      arrayEach(methodNames, function(methodName) {
-        var func = source[methodName];
-        object[methodName] = func;
-        if (isFunc) {
-          object.prototype[methodName] = function() {
-            var chainAll = this.__chain__;
-            if (chain || chainAll) {
-              var result = object(this.__wrapped__),
-                  actions = result.__actions__ = copyArray(this.__actions__);
-
-              actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
-              result.__chain__ = chainAll;
-              return result;
-            }
-            return func.apply(object, arrayPush([this.value()], arguments));
-          };
-        }
-      });
-
-      return object;
-    }
-
-    /**
-     * Reverts the `_` variable to its previous value and returns a reference to
-     * the `lodash` function.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @returns {Function} Returns the `lodash` function.
-     * @example
-     *
-     * var lodash = _.noConflict();
-     */
-    function noConflict() {
-      if (root._ === this) {
-        root._ = oldDash;
-      }
-      return this;
-    }
-
-    /**
-     * A no-operation function that returns `undefined` regardless of the
-     * arguments it receives.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.3.0
-     * @category Util
-     * @example
-     *
-     * var object = { 'user': 'fred' };
-     *
-     * _.noop(object) === undefined;
-     * // => true
-     */
-    function noop() {
-      // No operation performed.
-    }
-
-    /**
-     * Creates a function that returns its nth argument. If `n` is negative,
-     * the nth argument from the end is returned.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {number} [n=0] The index of the argument to return.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var func = _.nthArg(1);
-     * func('a', 'b', 'c', 'd');
-     * // => 'b'
-     *
-     * var func = _.nthArg(-2);
-     * func('a', 'b', 'c', 'd');
-     * // => 'c'
-     */
-    function nthArg(n) {
-      n = toInteger(n);
-      return rest(function(args) {
-        return baseNth(args, n);
-      });
-    }
-
-    /**
-     * Creates a function that invokes `iteratees` with the arguments it receives
-     * and returns their results.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
-     *  [iteratees=[_.identity]] The iteratees to invoke.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var func = _.over(Math.max, Math.min);
-     *
-     * func(1, 2, 3, 4);
-     * // => [4, 1]
-     */
-    var over = createOver(arrayMap);
-
-    /**
-     * Creates a function that checks if **all** of the `predicates` return
-     * truthy when invoked with the arguments it receives.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
-     *  [predicates=[_.identity]] The predicates to check.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var func = _.overEvery(Boolean, isFinite);
-     *
-     * func('1');
-     * // => true
-     *
-     * func(null);
-     * // => false
-     *
-     * func(NaN);
-     * // => false
-     */
-    var overEvery = createOver(arrayEvery);
-
-    /**
-     * Creates a function that checks if **any** of the `predicates` return
-     * truthy when invoked with the arguments it receives.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
-     *  [predicates=[_.identity]] The predicates to check.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var func = _.overSome(Boolean, isFinite);
-     *
-     * func('1');
-     * // => true
-     *
-     * func(null);
-     * // => true
-     *
-     * func(NaN);
-     * // => false
-     */
-    var overSome = createOver(arraySome);
-
-    /**
-     * Creates a function that returns the value at `path` of a given object.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.4.0
-     * @category Util
-     * @param {Array|string} path The path of the property to get.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var objects = [
-     *   { 'a': { 'b': 2 } },
-     *   { 'a': { 'b': 1 } }
-     * ];
-     *
-     * _.map(objects, _.property('a.b'));
-     * // => [2, 1]
-     *
-     * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
-     * // => [1, 2]
-     */
-    function property(path) {
-      return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
-    }
-
-    /**
-     * The opposite of `_.property`; this method creates a function that returns
-     * the value at a given path of `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Util
-     * @param {Object} object The object to query.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var array = [0, 1, 2],
-     *     object = { 'a': array, 'b': array, 'c': array };
-     *
-     * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
-     * // => [2, 0]
-     *
-     * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
-     * // => [2, 0]
-     */
-    function propertyOf(object) {
-      return function(path) {
-        return object == null ? undefined : baseGet(object, path);
-      };
-    }
-
-    /**
-     * Creates an array of numbers (positive and/or negative) progressing from
-     * `start` up to, but not including, `end`. A step of `-1` is used if a negative
-     * `start` is specified without an `end` or `step`. If `end` is not specified,
-     * it's set to `start` with `start` then set to `0`.
-     *
-     * **Note:** JavaScript follows the IEEE-754 standard for resolving
-     * floating-point values which can produce unexpected results.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {number} [start=0] The start of the range.
-     * @param {number} end The end of the range.
-     * @param {number} [step=1] The value to increment or decrement by.
-     * @returns {Array} Returns the new array of numbers.
-     * @see _.inRange, _.rangeRight
-     * @example
-     *
-     * _.range(4);
-     * // => [0, 1, 2, 3]
-     *
-     * _.range(-4);
-     * // => [0, -1, -2, -3]
-     *
-     * _.range(1, 5);
-     * // => [1, 2, 3, 4]
-     *
-     * _.range(0, 20, 5);
-     * // => [0, 5, 10, 15]
-     *
-     * _.range(0, -4, -1);
-     * // => [0, -1, -2, -3]
-     *
-     * _.range(1, 4, 0);
-     * // => [1, 1, 1]
-     *
-     * _.range(0);
-     * // => []
-     */
-    var range = createRange();
-
-    /**
-     * This method is like `_.range` except that it populates values in
-     * descending order.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {number} [start=0] The start of the range.
-     * @param {number} end The end of the range.
-     * @param {number} [step=1] The value to increment or decrement by.
-     * @returns {Array} Returns the new array of numbers.
-     * @see _.inRange, _.range
-     * @example
-     *
-     * _.rangeRight(4);
-     * // => [3, 2, 1, 0]
-     *
-     * _.rangeRight(-4);
-     * // => [-3, -2, -1, 0]
-     *
-     * _.rangeRight(1, 5);
-     * // => [4, 3, 2, 1]
-     *
-     * _.rangeRight(0, 20, 5);
-     * // => [15, 10, 5, 0]
-     *
-     * _.rangeRight(0, -4, -1);
-     * // => [-3, -2, -1, 0]
-     *
-     * _.rangeRight(1, 4, 0);
-     * // => [1, 1, 1]
-     *
-     * _.rangeRight(0);
-     * // => []
-     */
-    var rangeRight = createRange(true);
-
-    /**
-     * Invokes the iteratee `n` times, returning an array of the results of
-     * each invocation. The iteratee is invoked with one argument; (index).
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {number} n The number of times to invoke `iteratee`.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Array} Returns the array of results.
-     * @example
-     *
-     * _.times(3, String);
-     * // => ['0', '1', '2']
-     *
-     *  _.times(4, _.constant(true));
-     * // => [true, true, true, true]
-     */
-    function times(n, iteratee) {
-      n = toInteger(n);
-      if (n < 1 || n > MAX_SAFE_INTEGER) {
-        return [];
-      }
-      var index = MAX_ARRAY_LENGTH,
-          length = nativeMin(n, MAX_ARRAY_LENGTH);
-
-      iteratee = getIteratee(iteratee);
-      n -= MAX_ARRAY_LENGTH;
-
-      var result = baseTimes(length, iteratee);
-      while (++index < n) {
-        iteratee(index);
-      }
-      return result;
-    }
-
-    /**
-     * Converts `value` to a property path array.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {*} value The value to convert.
-     * @returns {Array} Returns the new property path array.
-     * @example
-     *
-     * _.toPath('a.b.c');
-     * // => ['a', 'b', 'c']
-     *
-     * _.toPath('a[0].b.c');
-     * // => ['a', '0', 'b', 'c']
-     *
-     * var path = ['a', 'b', 'c'],
-     *     newPath = _.toPath(path);
-     *
-     * console.log(newPath);
-     * // => ['a', 'b', 'c']
-     *
-     * console.log(path === newPath);
-     * // => false
-     */
-    function toPath(value) {
-      if (isArray(value)) {
-        return arrayMap(value, toKey);
-      }
-      return isSymbol(value) ? [value] : copyArray(stringToPath(value));
-    }
-
-    /**
-     * Generates a unique ID. If `prefix` is given, the ID is appended to it.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {string} [prefix=''] The value to prefix the ID with.
-     * @returns {string} Returns the unique ID.
-     * @example
-     *
-     * _.uniqueId('contact_');
-     * // => 'contact_104'
-     *
-     * _.uniqueId();
-     * // => '105'
-     */
-    function uniqueId(prefix) {
-      var id = ++idCounter;
-      return toString(prefix) + id;
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Adds two numbers.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.4.0
-     * @category Math
-     * @param {number} augend The first number in an addition.
-     * @param {number} addend The second number in an addition.
-     * @returns {number} Returns the total.
-     * @example
-     *
-     * _.add(6, 4);
-     * // => 10
-     */
-    var add = createMathOperation(function(augend, addend) {
-      return augend + addend;
-    });
-
-    /**
-     * Computes `number` rounded up to `precision`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.10.0
-     * @category Math
-     * @param {number} number The number to round up.
-     * @param {number} [precision=0] The precision to round up to.
-     * @returns {number} Returns the rounded up number.
-     * @example
-     *
-     * _.ceil(4.006);
-     * // => 5
-     *
-     * _.ceil(6.004, 2);
-     * // => 6.01
-     *
-     * _.ceil(6040, -2);
-     * // => 6100
-     */
-    var ceil = createRound('ceil');
-
-    /**
-     * Divide two numbers.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.7.0
-     * @category Math
-     * @param {number} dividend The first number in a division.
-     * @param {number} divisor The second number in a division.
-     * @returns {number} Returns the quotient.
-     * @example
-     *
-     * _.divide(6, 4);
-     * // => 1.5
-     */
-    var divide = createMathOperation(function(dividend, divisor) {
-      return dividend / divisor;
-    });
-
-    /**
-     * Computes `number` rounded down to `precision`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.10.0
-     * @category Math
-     * @param {number} number The number to round down.
-     * @param {number} [precision=0] The precision to round down to.
-     * @returns {number} Returns the rounded down number.
-     * @example
-     *
-     * _.floor(4.006);
-     * // => 4
-     *
-     * _.floor(0.046, 2);
-     * // => 0.04
-     *
-     * _.floor(4060, -2);
-     * // => 4000
-     */
-    var floor = createRound('floor');
-
-    /**
-     * Computes the maximum value of `array`. If `array` is empty or falsey,
-     * `undefined` is returned.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @returns {*} Returns the maximum value.
-     * @example
-     *
-     * _.max([4, 2, 8, 6]);
-     * // => 8
-     *
-     * _.max([]);
-     * // => undefined
-     */
-    function max(array) {
-      return (array && array.length)
-        ? baseExtremum(array, identity, baseGt)
-        : undefined;
-    }
-
-    /**
-     * This method is like `_.max` except that it accepts `iteratee` which is
-     * invoked for each element in `array` to generate the criterion by which
-     * the value is ranked. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {*} Returns the maximum value.
-     * @example
-     *
-     * var objects = [{ 'n': 1 }, { 'n': 2 }];
-     *
-     * _.maxBy(objects, function(o) { return o.n; });
-     * // => { 'n': 2 }
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.maxBy(objects, 'n');
-     * // => { 'n': 2 }
-     */
-    function maxBy(array, iteratee) {
-      return (array && array.length)
-        ? baseExtremum(array, getIteratee(iteratee), baseGt)
-        : undefined;
-    }
-
-    /**
-     * Computes the mean of the values in `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @returns {number} Returns the mean.
-     * @example
-     *
-     * _.mean([4, 2, 8, 6]);
-     * // => 5
-     */
-    function mean(array) {
-      return baseMean(array, identity);
-    }
-
-    /**
-     * This method is like `_.mean` except that it accepts `iteratee` which is
-     * invoked for each element in `array` to generate the value to be averaged.
-     * The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.7.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {number} Returns the mean.
-     * @example
-     *
-     * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
-     *
-     * _.meanBy(objects, function(o) { return o.n; });
-     * // => 5
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.meanBy(objects, 'n');
-     * // => 5
-     */
-    function meanBy(array, iteratee) {
-      return baseMean(array, getIteratee(iteratee));
-    }
-
-    /**
-     * Computes the minimum value of `array`. If `array` is empty or falsey,
-     * `undefined` is returned.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @returns {*} Returns the minimum value.
-     * @example
-     *
-     * _.min([4, 2, 8, 6]);
-     * // => 2
-     *
-     * _.min([]);
-     * // => undefined
-     */
-    function min(array) {
-      return (array && array.length)
-        ? baseExtremum(array, identity, baseLt)
-        : undefined;
-    }
-
-    /**
-     * This method is like `_.min` except that it accepts `iteratee` which is
-     * invoked for each element in `array` to generate the criterion by which
-     * the value is ranked. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {*} Returns the minimum value.
-     * @example
-     *
-     * var objects = [{ 'n': 1 }, { 'n': 2 }];
-     *
-     * _.minBy(objects, function(o) { return o.n; });
-     * // => { 'n': 1 }
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.minBy(objects, 'n');
-     * // => { 'n': 1 }
-     */
-    function minBy(array, iteratee) {
-      return (array && array.length)
-        ? baseExtremum(array, getIteratee(iteratee), baseLt)
-        : undefined;
-    }
-
-    /**
-     * Multiply two numbers.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.7.0
-     * @category Math
-     * @param {number} multiplier The first number in a multiplication.
-     * @param {number} multiplicand The second number in a multiplication.
-     * @returns {number} Returns the product.
-     * @example
-     *
-     * _.multiply(6, 4);
-     * // => 24
-     */
-    var multiply = createMathOperation(function(multiplier, multiplicand) {
-      return multiplier * multiplicand;
-    });
-
-    /**
-     * Computes `number` rounded to `precision`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.10.0
-     * @category Math
-     * @param {number} number The number to round.
-     * @param {number} [precision=0] The precision to round to.
-     * @returns {number} Returns the rounded number.
-     * @example
-     *
-     * _.round(4.006);
-     * // => 4
-     *
-     * _.round(4.006, 2);
-     * // => 4.01
-     *
-     * _.round(4060, -2);
-     * // => 4100
-     */
-    var round = createRound('round');
-
-    /**
-     * Subtract two numbers.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Math
-     * @param {number} minuend The first number in a subtraction.
-     * @param {number} subtrahend The second number in a subtraction.
-     * @returns {number} Returns the difference.
-     * @example
-     *
-     * _.subtract(6, 4);
-     * // => 2
-     */
-    var subtract = createMathOperation(function(minuend, subtrahend) {
-      return minuend - subtrahend;
-    });
-
-    /**
-     * Computes the sum of the values in `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.4.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @returns {number} Returns the sum.
-     * @example
-     *
-     * _.sum([4, 2, 8, 6]);
-     * // => 20
-     */
-    function sum(array) {
-      return (array && array.length)
-        ? baseSum(array, identity)
-        : 0;
-    }
-
-    /**
-     * This method is like `_.sum` except that it accepts `iteratee` which is
-     * invoked for each element in `array` to generate the value to be summed.
-     * The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {number} Returns the sum.
-     * @example
-     *
-     * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
-     *
-     * _.sumBy(objects, function(o) { return o.n; });
-     * // => 20
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.sumBy(objects, 'n');
-     * // => 20
-     */
-    function sumBy(array, iteratee) {
-      return (array && array.length)
-        ? baseSum(array, getIteratee(iteratee))
-        : 0;
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    // Add methods that return wrapped values in chain sequences.
-    lodash.after = after;
-    lodash.ary = ary;
-    lodash.assign = assign;
-    lodash.assignIn = assignIn;
-    lodash.assignInWith = assignInWith;
-    lodash.assignWith = assignWith;
-    lodash.at = at;
-    lodash.before = before;
-    lodash.bind = bind;
-    lodash.bindAll = bindAll;
-    lodash.bindKey = bindKey;
-    lodash.castArray = castArray;
-    lodash.chain = chain;
-    lodash.chunk = chunk;
-    lodash.compact = compact;
-    lodash.concat = concat;
-    lodash.cond = cond;
-    lodash.conforms = conforms;
-    lodash.constant = constant;
-    lodash.countBy = countBy;
-    lodash.create = create;
-    lodash.curry = curry;
-    lodash.curryRight = curryRight;
-    lodash.debounce = debounce;
-    lodash.defaults = defaults;
-    lodash.defaultsDeep = defaultsDeep;
-    lodash.defer = defer;
-    lodash.delay = delay;
-    lodash.difference = difference;
-    lodash.differenceBy = differenceBy;
-    lodash.differenceWith = differenceWith;
-    lodash.drop = drop;
-    lodash.dropRight = dropRight;
-    lodash.dropRightWhile = dropRightWhile;
-    lodash.dropWhile = dropWhile;
-    lodash.fill = fill;
-    lodash.filter = filter;
-    lodash.flatMap = flatMap;
-    lodash.flatMapDeep = flatMapDeep;
-    lodash.flatMapDepth = flatMapDepth;
-    lodash.flatten = flatten;
-    lodash.flattenDeep = flattenDeep;
-    lodash.flattenDepth = flattenDepth;
-    lodash.flip = flip;
-    lodash.flow = flow;
-    lodash.flowRight = flowRight;
-    lodash.fromPairs = fromPairs;
-    lodash.functions = functions;
-    lodash.functionsIn = functionsIn;
-    lodash.groupBy = groupBy;
-    lodash.initial = initial;
-    lodash.intersection = intersection;
-    lodash.intersectionBy = intersectionBy;
-    lodash.intersectionWith = intersectionWith;
-    lodash.invert = invert;
-    lodash.invertBy = invertBy;
-    lodash.invokeMap = invokeMap;
-    lodash.iteratee = iteratee;
-    lodash.keyBy = keyBy;
-    lodash.keys = keys;
-    lodash.keysIn = keysIn;
-    lodash.map = map;
-    lodash.mapKeys = mapKeys;
-    lodash.mapValues = mapValues;
-    lodash.matches = matches;
-    lodash.matchesProperty = matchesProperty;
-    lodash.memoize = memoize;
-    lodash.merge = merge;
-    lodash.mergeWith = mergeWith;
-    lodash.method = method;
-    lodash.methodOf = methodOf;
-    lodash.mixin = mixin;
-    lodash.negate = negate;
-    lodash.nthArg = nthArg;
-    lodash.omit = omit;
-    lodash.omitBy = omitBy;
-    lodash.once = once;
-    lodash.orderBy = orderBy;
-    lodash.over = over;
-    lodash.overArgs = overArgs;
-    lodash.overEvery = overEvery;
-    lodash.overSome = overSome;
-    lodash.partial = partial;
-    lodash.partialRight = partialRight;
-    lodash.partition = partition;
-    lodash.pick = pick;
-    lodash.pickBy = pickBy;
-    lodash.property = property;
-    lodash.propertyOf = propertyOf;
-    lodash.pull = pull;
-    lodash.pullAll = pullAll;
-    lodash.pullAllBy = pullAllBy;
-    lodash.pullAllWith = pullAllWith;
-    lodash.pullAt = pullAt;
-    lodash.range = range;
-    lodash.rangeRight = rangeRight;
-    lodash.rearg = rearg;
-    lodash.reject = reject;
-    lodash.remove = remove;
-    lodash.rest = rest;
-    lodash.reverse = reverse;
-    lodash.sampleSize = sampleSize;
-    lodash.set = set;
-    lodash.setWith = setWith;
-    lodash.shuffle = shuffle;
-    lodash.slice = slice;
-    lodash.sortBy = sortBy;
-    lodash.sortedUniq = sortedUniq;
-    lodash.sortedUniqBy = sortedUniqBy;
-    lodash.split = split;
-    lodash.spread = spread;
-    lodash.tail = tail;
-    lodash.take = take;
-    lodash.takeRight = takeRight;
-    lodash.takeRightWhile = takeRightWhile;
-    lodash.takeWhile = takeWhile;
-    lodash.tap = tap;
-    lodash.throttle = throttle;
-    lodash.thru = thru;
-    lodash.toArray = toArray;
-    lodash.toPairs = toPairs;
-    lodash.toPairsIn = toPairsIn;
-    lodash.toPath = toPath;
-    lodash.toPlainObject = toPlainObject;
-    lodash.transform = transform;
-    lodash.unary = unary;
-    lodash.union = union;
-    lodash.unionBy = unionBy;
-    lodash.unionWith = unionWith;
-    lodash.uniq = uniq;
-    lodash.uniqBy = uniqBy;
-    lodash.uniqWith = uniqWith;
-    lodash.unset = unset;
-    lodash.unzip = unzip;
-    lodash.unzipWith = unzipWith;
-    lodash.update = update;
-    lodash.updateWith = updateWith;
-    lodash.values = values;
-    lodash.valuesIn = valuesIn;
-    lodash.without = without;
-    lodash.words = words;
-    lodash.wrap = wrap;
-    lodash.xor = xor;
-    lodash.xorBy = xorBy;
-    lodash.xorWith = xorWith;
-    lodash.zip = zip;
-    lodash.zipObject = zipObject;
-    lodash.zipObjectDeep = zipObjectDeep;
-    lodash.zipWith = zipWith;
-
-    // Add aliases.
-    lodash.entries = toPairs;
-    lodash.entriesIn = toPairsIn;
-    lodash.extend = assignIn;
-    lodash.extendWith = assignInWith;
-
-    // Add methods to `lodash.prototype`.
-    mixin(lodash, lodash);
-
-    /*------------------------------------------------------------------------*/
-
-    // Add methods that return unwrapped values in chain sequences.
-    lodash.add = add;
-    lodash.attempt = attempt;
-    lodash.camelCase = camelCase;
-    lodash.capitalize = capitalize;
-    lodash.ceil = ceil;
-    lodash.clamp = clamp;
-    lodash.clone = clone;
-    lodash.cloneDeep = cloneDeep;
-    lodash.cloneDeepWith = cloneDeepWith;
-    lodash.cloneWith = cloneWith;
-    lodash.deburr = deburr;
-    lodash.divide = divide;
-    lodash.endsWith = endsWith;
-    lodash.eq = eq;
-    lodash.escape = escape;
-    lodash.escapeRegExp = escapeRegExp;
-    lodash.every = every;
-    lodash.find = find;
-    lodash.findIndex = findIndex;
-    lodash.findKey = findKey;
-    lodash.findLast = findLast;
-    lodash.findLastIndex = findLastIndex;
-    lodash.findLastKey = findLastKey;
-    lodash.floor = floor;
-    lodash.forEach = forEach;
-    lodash.forEachRight = forEachRight;
-    lodash.forIn = forIn;
-    lodash.forInRight = forInRight;
-    lodash.forOwn = forOwn;
-    lodash.forOwnRight = forOwnRight;
-    lodash.get = get;
-    lodash.gt = gt;
-    lodash.gte = gte;
-    lodash.has = has;
-    lodash.hasIn = hasIn;
-    lodash.head = head;
-    lodash.identity = identity;
-    lodash.includes = includes;
-    lodash.indexOf = indexOf;
-    lodash.inRange = inRange;
-    lodash.invoke = invoke;
-    lodash.isArguments = isArguments;
-    lodash.isArray = isArray;
-    lodash.isArrayBuffer = isArrayBuffer;
-    lodash.isArrayLike = isArrayLike;
-    lodash.isArrayLikeObject = isArrayLikeObject;
-    lodash.isBoolean = isBoolean;
-    lodash.isBuffer = isBuffer;
-    lodash.isDate = isDate;
-    lodash.isElement = isElement;
-    lodash.isEmpty = isEmpty;
-    lodash.isEqual = isEqual;
-    lodash.isEqualWith = isEqualWith;
-    lodash.isError = isError;
-    lodash.isFinite = isFinite;
-    lodash.isFunction = isFunction;
-    lodash.isInteger = isInteger;
-    lodash.isLength = isLength;
-    lodash.isMap = isMap;
-    lodash.isMatch = isMatch;
-    lodash.isMatchWith = isMatchWith;
-    lodash.isNaN = isNaN;
-    lodash.isNative = isNative;
-    lodash.isNil = isNil;
-    lodash.isNull = isNull;
-    lodash.isNumber = isNumber;
-    lodash.isObject = isObject;
-    lodash.isObjectLike = isObjectLike;
-    lodash.isPlainObject = isPlainObject;
-    lodash.isRegExp = isRegExp;
-    lodash.isSafeInteger = isSafeInteger;
-    lodash.isSet = isSet;
-    lodash.isString = isString;
-    lodash.isSymbol = isSymbol;
-    lodash.isTypedArray = isTypedArray;
-    lodash.isUndefined = isUndefined;
-    lodash.isWeakMap = isWeakMap;
-    lodash.isWeakSet = isWeakSet;
-    lodash.join = join;
-    lodash.kebabCase = kebabCase;
-    lodash.last = last;
-    lodash.lastIndexOf = lastIndexOf;
-    lodash.lowerCase = lowerCase;
-    lodash.lowerFirst = lowerFirst;
-    lodash.lt = lt;
-    lodash.lte = lte;
-    lodash.max = max;
-    lodash.maxBy = maxBy;
-    lodash.mean = mean;
-    lodash.meanBy = meanBy;
-    lodash.min = min;
-    lodash.minBy = minBy;
-    lodash.multiply = multiply;
-    lodash.nth = nth;
-    lodash.noConflict = noConflict;
-    lodash.noop = noop;
-    lodash.now = now;
-    lodash.pad = pad;
-    lodash.padEnd = padEnd;
-    lodash.padStart = padStart;
-    lodash.parseInt = parseInt;
-    lodash.random = random;
-    lodash.reduce = reduce;
-    lodash.reduceRight = reduceRight;
-    lodash.repeat = repeat;
-    lodash.replace = replace;
-    lodash.result = result;
-    lodash.round = round;
-    lodash.runInContext = runInContext;
-    lodash.sample = sample;
-    lodash.size = size;
-    lodash.snakeCase = snakeCase;
-    lodash.some = some;
-    lodash.sortedIndex = sortedIndex;
-    lodash.sortedIndexBy = sortedIndexBy;
-    lodash.sortedIndexOf = sortedIndexOf;
-    lodash.sortedLastIndex = sortedLastIndex;
-    lodash.sortedLastIndexBy = sortedLastIndexBy;
-    lodash.sortedLastIndexOf = sortedLastIndexOf;
-    lodash.startCase = startCase;
-    lodash.startsWith = startsWith;
-    lodash.subtract = subtract;
-    lodash.sum = sum;
-    lodash.sumBy = sumBy;
-    lodash.template = template;
-    lodash.times = times;
-    lodash.toInteger = toInteger;
-    lodash.toLength = toLength;
-    lodash.toLower = toLower;
-    lodash.toNumber = toNumber;
-    lodash.toSafeInteger = toSafeInteger;
-    lodash.toString = toString;
-    lodash.toUpper = toUpper;
-    lodash.trim = trim;
-    lodash.trimEnd = trimEnd;
-    lodash.trimStart = trimStart;
-    lodash.truncate = truncate;
-    lodash.unescape = unescape;
-    lodash.uniqueId = uniqueId;
-    lodash.upperCase = upperCase;
-    lodash.upperFirst = upperFirst;
-
-    // Add aliases.
-    lodash.each = forEach;
-    lodash.eachRight = forEachRight;
-    lodash.first = head;
-
-    mixin(lodash, (function() {
-      var source = {};
-      baseForOwn(lodash, function(func, methodName) {
-        if (!hasOwnProperty.call(lodash.prototype, methodName)) {
-          source[methodName] = func;
-        }
-      });
-      return source;
-    }()), { 'chain': false });
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * The semantic version number.
-     *
-     * @static
-     * @memberOf _
-     * @type {string}
-     */
-    lodash.VERSION = VERSION;
-
-    // Assign default placeholders.
-    arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
-      lodash[methodName].placeholder = lodash;
-    });
-
-    // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
-    arrayEach(['drop', 'take'], function(methodName, index) {
-      LazyWrapper.prototype[methodName] = function(n) {
-        var filtered = this.__filtered__;
-        if (filtered && !index) {
-          return new LazyWrapper(this);
-        }
-        n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
-
-        var result = this.clone();
-        if (filtered) {
-          result.__takeCount__ = nativeMin(n, result.__takeCount__);
-        } else {
-          result.__views__.push({
-            'size': nativeMin(n, MAX_ARRAY_LENGTH),
-            'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
-          });
-        }
-        return result;
-      };
-
-      LazyWrapper.prototype[methodName + 'Right'] = function(n) {
-        return this.reverse()[methodName](n).reverse();
-      };
-    });
-
-    // Add `LazyWrapper` methods that accept an `iteratee` value.
-    arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
-      var type = index + 1,
-          isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
-
-      LazyWrapper.prototype[methodName] = function(iteratee) {
-        var result = this.clone();
-        result.__iteratees__.push({
-          'iteratee': getIteratee(iteratee, 3),
-          'type': type
-        });
-        result.__filtered__ = result.__filtered__ || isFilter;
-        return result;
-      };
-    });
-
-    // Add `LazyWrapper` methods for `_.head` and `_.last`.
-    arrayEach(['head', 'last'], function(methodName, index) {
-      var takeName = 'take' + (index ? 'Right' : '');
-
-      LazyWrapper.prototype[methodName] = function() {
-        return this[takeName](1).value()[0];
-      };
-    });
-
-    // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
-    arrayEach(['initial', 'tail'], function(methodName, index) {
-      var dropName = 'drop' + (index ? '' : 'Right');
-
-      LazyWrapper.prototype[methodName] = function() {
-        return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
-      };
-    });
-
-    LazyWrapper.prototype.compact = function() {
-      return this.filter(identity);
-    };
-
-    LazyWrapper.prototype.find = function(predicate) {
-      return this.filter(predicate).head();
-    };
-
-    LazyWrapper.prototype.findLast = function(predicate) {
-      return this.reverse().find(predicate);
-    };
-
-    LazyWrapper.prototype.invokeMap = rest(function(path, args) {
-      if (typeof path == 'function') {
-        return new LazyWrapper(this);
-      }
-      return this.map(function(value) {
-        return baseInvoke(value, path, args);
-      });
-    });
-
-    LazyWrapper.prototype.reject = function(predicate) {
-      predicate = getIteratee(predicate, 3);
-      return this.filter(function(value) {
-        return !predicate(value);
-      });
-    };
-
-    LazyWrapper.prototype.slice = function(start, end) {
-      start = toInteger(start);
-
-      var result = this;
-      if (result.__filtered__ && (start > 0 || end < 0)) {
-        return new LazyWrapper(result);
-      }
-      if (start < 0) {
-        result = result.takeRight(-start);
-      } else if (start) {
-        result = result.drop(start);
-      }
-      if (end !== undefined) {
-        end = toInteger(end);
-        result = end < 0 ? result.dropRight(-end) : result.take(end - start);
-      }
-      return result;
-    };
-
-    LazyWrapper.prototype.takeRightWhile = function(predicate) {
-      return this.reverse().takeWhile(predicate).reverse();
-    };
-
-    LazyWrapper.prototype.toArray = function() {
-      return this.take(MAX_ARRAY_LENGTH);
-    };
-
-    // Add `LazyWrapper` methods to `lodash.prototype`.
-    baseForOwn(LazyWrapper.prototype, function(func, methodName) {
-      var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
-          isTaker = /^(?:head|last)$/.test(methodName),
-          lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
-          retUnwrapped = isTaker || /^find/.test(methodName);
-
-      if (!lodashFunc) {
-        return;
-      }
-      lodash.prototype[methodName] = function() {
-        var value = this.__wrapped__,
-            args = isTaker ? [1] : arguments,
-            isLazy = value instanceof LazyWrapper,
-            iteratee = args[0],
-            useLazy = isLazy || isArray(value);
-
-        var interceptor = function(value) {
-          var result = lodashFunc.apply(lodash, arrayPush([value], args));
-          return (isTaker && chainAll) ? result[0] : result;
-        };
-
-        if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
-          // Avoid lazy use if the iteratee has a "length" value other than `1`.
-          isLazy = useLazy = false;
-        }
-        var chainAll = this.__chain__,
-            isHybrid = !!this.__actions__.length,
-            isUnwrapped = retUnwrapped && !chainAll,
-            onlyLazy = isLazy && !isHybrid;
-
-        if (!retUnwrapped && useLazy) {
-          value = onlyLazy ? value : new LazyWrapper(this);
-          var result = func.apply(value, args);
-          result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
-          return new LodashWrapper(result, chainAll);
-        }
-        if (isUnwrapped && onlyLazy) {
-          return func.apply(this, args);
-        }
-        result = this.thru(interceptor);
-        return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
-      };
-    });
-
-    // Add `Array` methods to `lodash.prototype`.
-    arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
-      var func = arrayProto[methodName],
-          chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
-          retUnwrapped = /^(?:pop|shift)$/.test(methodName);
-
-      lodash.prototype[methodName] = function() {
-        var args = arguments;
-        if (retUnwrapped && !this.__chain__) {
-          var value = this.value();
-          return func.apply(isArray(value) ? value : [], args);
-        }
-        return this[chainName](function(value) {
-          return func.apply(isArray(value) ? value : [], args);
-        });
-      };
-    });
-
-    // Map minified method names to their real names.
-    baseForOwn(LazyWrapper.prototype, function(func, methodName) {
-      var lodashFunc = lodash[methodName];
-      if (lodashFunc) {
-        var key = (lodashFunc.name + ''),
-            names = realNames[key] || (realNames[key] = []);
-
-        names.push({ 'name': methodName, 'func': lodashFunc });
-      }
-    });
-
-    realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{
-      'name': 'wrapper',
-      'func': undefined
-    }];
-
-    // Add methods to `LazyWrapper`.
-    LazyWrapper.prototype.clone = lazyClone;
-    LazyWrapper.prototype.reverse = lazyReverse;
-    LazyWrapper.prototype.value = lazyValue;
-
-    // Add chain sequence methods to the `lodash` wrapper.
-    lodash.prototype.at = wrapperAt;
-    lodash.prototype.chain = wrapperChain;
-    lodash.prototype.commit = wrapperCommit;
-    lodash.prototype.next = wrapperNext;
-    lodash.prototype.plant = wrapperPlant;
-    lodash.prototype.reverse = wrapperReverse;
-    lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
-
-    if (iteratorSymbol) {
-      lodash.prototype[iteratorSymbol] = wrapperToIterator;
-    }
-    return lodash;
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  // Export lodash.
-  var _ = runInContext();
-
-  // Expose Lodash on the free variable `window` or `self` when available so it's
-  // globally accessible, even when bundled with Browserify, Webpack, etc. This
-  // also prevents errors in cases where Lodash is loaded by a script tag in the
-  // presence of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch
-  // for more details. Use `_.noConflict` to remove Lodash from the global object.
-  (freeWindow || freeSelf || {})._ = _;
-
-  // Some AMD build optimizers like r.js check for condition patterns like the following:
-  if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
-    // Define as an anonymous module so, through path mapping, it can be
-    // referenced as the "underscore" module.
-    define(function() {
-      return _;
-    });
-  }
-  // Check for `exports` after `define` in case a build optimizer adds an `exports` object.
-  else if (freeExports && freeModule) {
-    // Export for Node.js.
-    if (moduleExports) {
-      (freeModule.exports = _)._ = _;
-    }
-    // Export for CommonJS support.
-    freeExports._ = _;
-  }
-  else {
-    // Export to the global object.
-    root._ = _;
-  }
-}.call(this));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.min.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.min.js
deleted file mode 100644
index 4994229..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/lodash.min.js
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * @license
- * lodash 4.11.2 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
- * Build: `lodash -o ./dist/lodash.js`
- */
-;(function(){function t(t,n){return t.set(n[0],n[1]),t}function n(t,n){return t.add(n),t}function r(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function e(t,n,r,e){for(var u=-1,o=t.length;++u<o;){var i=t[u];n(e,i,r(i),t)}return e}function u(t,n){for(var r=-1,e=t.length;++r<e&&false!==n(t[r],r,t););return t}function o(t,n){for(var r=-1,e=t.length;++r<e;)if(!n(t[r],r,t))return false;
-return true}function i(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r];n(i,r,t)&&(o[u++]=i)}return o}function f(t,n){return!!t.length&&-1<g(t,n,0)}function c(t,n,r){for(var e=-1,u=t.length;++e<u;)if(r(n,t[e]))return true;return false}function a(t,n){for(var r=-1,e=t.length,u=Array(e);++r<e;)u[r]=n(t[r],r,t);return u}function l(t,n){for(var r=-1,e=n.length,u=t.length;++r<e;)t[u+r]=n[r];return t}function s(t,n,r,e){var u=-1,o=t.length;for(e&&o&&(r=t[++u]);++u<o;)r=n(r,t[u],u,t);return r}function h(t,n,r,e){
-var u=t.length;for(e&&u&&(r=t[--u]);u--;)r=n(r,t[u],u,t);return r}function p(t,n){for(var r=-1,e=t.length;++r<e;)if(n(t[r],r,t))return true;return false}function _(t,n,r,e){var u;return r(t,function(t,r,o){return n(t,r,o)?(u=e?r:t,false):void 0}),u}function v(t,n,r){for(var e=t.length,u=r?e:-1;r?u--:++u<e;)if(n(t[u],u,t))return u;return-1}function g(t,n,r){if(n!==n)return B(t,r);--r;for(var e=t.length;++r<e;)if(t[r]===n)return r;return-1}function d(t,n,r,e){--r;for(var u=t.length;++r<u;)if(e(t[r],n))return r;
-return-1}function y(t,n){var r=t?t.length:0;return r?j(t,n)/r:Z}function b(t,n,r,e,u){return u(t,function(t,u,o){r=e?(e=false,t):n(r,t,u,o)}),r}function x(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].c;return t}function j(t,n){for(var r,e=-1,u=t.length;++e<u;){var o=n(t[e]);o!==N&&(r=r===N?o:r+o)}return r}function m(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}function w(t,n){return a(n,function(n){return[n,t[n]]})}function A(t){return function(n){return t(n)}}function O(t,n){return a(n,function(n){
-return t[n]})}function k(t,n){for(var r=-1,e=t.length;++r<e&&-1<g(n,t[r],0););return r}function E(t,n){for(var r=t.length;r--&&-1<g(n,t[r],0););return r}function I(t){return t&&t.Object===Object?t:null}function S(t){return Lt[t]}function R(t){return Ct[t]}function W(t){return"\\"+zt[t]}function B(t,n,r){var e=t.length;for(n+=r?0:-1;r?n--:++n<e;){var u=t[n];if(u!==u)return n}return-1}function L(t){var n=false;if(null!=t&&typeof t.toString!="function")try{n=!!(t+"")}catch(r){}return n}function C(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);
-return r}function M(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function U(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r];i!==n&&"__lodash_placeholder__"!==i||(t[r]="__lodash_placeholder__",o[u++]=r)}return o}function z(t){var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=t}),r}function D(t){if(!t||!It.test(t))return t.length;for(var n=kt.lastIndex=0;kt.test(t);)n++;return n}function $(t){return Mt[t]}function F(I){function jt(t){if(De(t)&&!li(t)&&!(t instanceof Lt)){
-if(t instanceof wt)return t;if(wu.call(t,"__wrapped__"))return oe(t)}return new wt(t)}function mt(){}function wt(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=N}function Lt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ct(){}function Mt(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function Ut(t){var n=-1,r=t?t.length:0;
-for(this.__data__=new Mt;++n<r;)this.push(t[n])}function zt(t,n){var r=t.__data__;return Hr(n)?(r=r.__data__,"__lodash_hash_undefined__"===(typeof n=="string"?r.string:r.hash)[n]):r.has(n)}function Ft(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function Nt(t,n){var r=Tt(t,n);return 0>r?false:(r==t.length-1?t.pop():Fu.call(t,r,1),true)}function Zt(t,n){var r=Tt(t,n);return 0>r?N:t[r][1]}function Tt(t,n){for(var r=t.length;r--;)if(Se(t[r][0],n))return r;return-1}function qt(t,n,r){
-var e=Tt(t,n);0>e?t.push([n,r]):t[e][1]=r}function Gt(t,n,r,e){return t===N||Se(t,xu[r])&&!wu.call(e,r)?n:t}function Jt(t,n,r){(r===N||Se(t[n],r))&&(typeof n!="number"||r!==N||n in t)||(t[n]=r)}function Yt(t,n,r){var e=t[n];wu.call(t,n)&&Se(e,r)&&(r!==N||n in t)||(t[n]=r)}function Ht(t,n,r,e){return yo(t,function(t,u,o){n(e,t,r(t),o)}),e}function Qt(t,n){return t&&ar(n,tu(n),t)}function Xt(t,n){for(var r=-1,e=null==t,u=n.length,o=Array(u);++r<u;)o[r]=e?N:Qe(t,n[r]);return o}function tn(t,n,r){return t===t&&(r!==N&&(t=r>=t?t:r),
-n!==N&&(t=t>=n?t:n)),t}function nn(t,n,r,e,o,i,f){var c;if(e&&(c=i?e(t,o,i,f):e(t)),c!==N)return c;if(!ze(t))return t;if(o=li(t)){if(c=Pr(t),!n)return cr(t,c)}else{var a=Fr(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(si(t))return er(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(L(t))return i?t:{};if(c=Zr(l?{}:t),!n)return lr(t,Qt(c,t))}else{if(!Bt[a])return i?t:{};c=Tr(t,a,nn,n)}}if(f||(f=new Ft),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?vn(t,tu,$r):tu(t);
-return u(s||t,function(u,o){s&&(o=u,u=t[o]),Yt(c,o,nn(u,n,r,e,o,t,f))}),c}function rn(t){var n=tu(t),r=n.length;return function(e){if(null==e)return!r;for(var u=r;u--;){var o=n[u],i=t[o],f=e[o];if(f===N&&!(o in Object(e))||!i(f))return false}return true}}function en(t){return ze(t)?zu(t):{}}function un(t,n,r){if(typeof t!="function")throw new yu("Expected a function");return $u(function(){t.apply(N,r)},n)}function on(t,n,r,e){var u=-1,o=f,i=true,l=t.length,s=[],h=n.length;if(!l)return s;r&&(n=a(n,A(r))),e?(o=c,
-i=false):n.length>=200&&(o=zt,i=false,n=new Ut(n));t:for(;++u<l;){var p=t[u],_=r?r(p):p,p=e||0!==p?p:0;if(i&&_===_){for(var v=h;v--;)if(n[v]===_)continue t;s.push(p)}else o(n,_,e)||s.push(p)}return s}function fn(t,n){var r=true;return yo(t,function(t,e,u){return r=!!n(t,e,u)}),r}function cn(t,n,r){for(var e=-1,u=t.length;++e<u;){var o=t[e],i=n(o);if(null!=i&&(f===N?i===i&&!Te(i):r(i,f)))var f=i,c=o}return c}function an(t,n){var r=[];return yo(t,function(t,e,u){n(t,e,u)&&r.push(t)}),r}function ln(t,n,r,e,u){
-var o=-1,i=t.length;for(r||(r=Vr),u||(u=[]);++o<i;){var f=t[o];n>0&&r(f)?n>1?ln(f,n-1,r,e,u):l(u,f):e||(u[u.length]=f)}return u}function sn(t,n){return t&&xo(t,n,tu)}function hn(t,n){return t&&jo(t,n,tu)}function pn(t,n){return i(n,function(n){return Ce(t[n])})}function _n(t,n){n=Yr(n,t)?[n]:nr(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[ee(n[r++])];return r&&r==e?t:N}function vn(t,n,r){return n=n(t),li(t)?n:l(n,r(t))}function gn(t,n){return t>n}function dn(t,n){return wu.call(t,n)||typeof t=="object"&&n in t&&null===Zu(Object(t));
-}function yn(t,n){return n in Object(t)}function bn(t,n,r){for(var e=r?c:f,u=t[0].length,o=t.length,i=o,l=Array(o),s=1/0,h=[];i--;){var p=t[i];i&&n&&(p=a(p,A(n))),s=Gu(p.length,s),l[i]=!r&&(n||u>=120&&p.length>=120)?new Ut(i&&p):N}var p=t[0],_=-1,v=l[0];t:for(;++_<u&&s>h.length;){var g=p[_],d=n?n(g):g,g=r||0!==g?g:0;if(v?!zt(v,d):!e(h,d,r)){for(i=o;--i;){var y=l[i];if(y?!zt(y,d):!e(t[i],d,r))continue t}v&&v.push(d),h.push(g)}}return h}function xn(t,n,r){var e={};return sn(t,function(t,u,o){n(e,r(t),u,o);
-}),e}function jn(t,n,e){return Yr(n,t)||(n=nr(n),t=re(t,n),n=ae(n)),n=null==t?t:t[ee(n)],null==n?N:r(n,t,e)}function mn(t,n,r,e,u){if(t===n)n=true;else if(null==t||null==n||!ze(t)&&!De(n))n=t!==t&&n!==n;else t:{var o=li(t),i=li(n),f="[object Array]",c="[object Array]";o||(f=Fr(t),f="[object Arguments]"==f?"[object Object]":f),i||(c=Fr(n),c="[object Arguments]"==c?"[object Object]":c);var a="[object Object]"==f&&!L(t),i="[object Object]"==c&&!L(n);if((c=f==c)&&!a)u||(u=new Ft),n=o||qe(t)?Br(t,n,mn,r,e,u):Lr(t,n,f,mn,r,e,u);else{
-if(!(2&e)&&(o=a&&wu.call(t,"__wrapped__"),f=i&&wu.call(n,"__wrapped__"),o||f)){t=o?t.value():t,n=f?n.value():n,u||(u=new Ft),n=mn(t,n,r,e,u);break t}if(c)n:if(u||(u=new Ft),o=2&e,f=tu(t),i=f.length,c=tu(n).length,i==c||o){for(a=i;a--;){var l=f[a];if(!(o?l in n:dn(n,l))){n=false;break n}}if(c=u.get(t))n=c==n;else{c=true,u.set(t,n);for(var s=o;++a<i;){var l=f[a],h=t[l],p=n[l];if(r)var _=o?r(p,h,l,n,t,u):r(h,p,l,t,n,u);if(_===N?h!==p&&!mn(h,p,r,e,u):!_){c=false;break}s||(s="constructor"==l)}c&&!s&&(r=t.constructor,
-e=n.constructor,r!=e&&"constructor"in t&&"constructor"in n&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(c=false)),u["delete"](t),n=c}}else n=false;else n=false}}return n}function wn(t,n,r,e){var u=r.length,o=u,i=!e;if(null==t)return!o;for(t=Object(t);u--;){var f=r[u];if(i&&f[2]?f[1]!==t[f[0]]:!(f[0]in t))return false}for(;++u<o;){var f=r[u],c=f[0],a=t[c],l=f[1];if(i&&f[2]){if(a===N&&!(c in t))return false}else{if(f=new Ft,e)var s=e(a,l,c,t,n,f);if(s===N?!mn(l,a,e,3,f):!s)return false;
-}}return true}function An(t){return typeof t=="function"?t:null==t?au:typeof t=="object"?li(t)?Sn(t[0],t[1]):In(t):pu(t)}function On(t){t=null==t?t:Object(t);var n,r=[];for(n in t)r.push(n);return r}function kn(t,n){return n>t}function En(t,n){var r=-1,e=We(t)?Array(t.length):[];return yo(t,function(t,u,o){e[++r]=n(t,u,o)}),e}function In(t){var n=Ur(t);return 1==n.length&&n[0][2]?te(n[0][0],n[0][1]):function(r){return r===t||wn(r,t,n)}}function Sn(t,n){return Yr(t)&&n===n&&!ze(n)?te(ee(t),n):function(r){
-var e=Qe(r,t);return e===N&&e===n?Xe(r,t):mn(n,e,N,3)}}function Rn(t,n,r,e,o){if(t!==n){if(!li(n)&&!qe(n))var i=nu(n);u(i||n,function(u,f){if(i&&(f=u,u=n[f]),ze(u)){o||(o=new Ft);var c=f,a=o,l=t[c],s=n[c],h=a.get(s);if(h)Jt(t,c,h);else{var h=e?e(l,s,c+"",t,n,a):N,p=h===N;p&&(h=s,li(s)||qe(s)?li(l)?h=l:Be(l)?h=cr(l):(p=false,h=nn(s,true)):Ne(s)||Re(s)?Re(l)?h=Ye(l):!ze(l)||r&&Ce(l)?(p=false,h=nn(s,true)):h=l:p=false),a.set(s,h),p&&Rn(h,s,r,e,a),a["delete"](s),Jt(t,c,h)}}else c=e?e(t[f],u,f+"",t,n,o):N,c===N&&(c=u),
-Jt(t,f,c)})}}function Wn(t,n){var r=t.length;return r?(n+=0>n?r:0,Gr(n,r)?t[n]:N):void 0}function Bn(t,n,r){var e=-1;return n=a(n.length?n:[au],A(Mr())),t=En(t,function(t){return{a:a(n,function(n){return n(t)}),b:++e,c:t}}),x(t,function(t,n){var e;t:{e=-1;for(var u=t.a,o=n.a,i=u.length,f=r.length;++e<i;){var c=or(u[e],o[e]);if(c){e=e>=f?c:c*("desc"==r[e]?-1:1);break t}}e=t.b-n.b}return e})}function Ln(t,n){return t=Object(t),s(n,function(n,r){return r in t&&(n[r]=t[r]),n},{})}function Cn(t,n){for(var r=-1,e=vn(t,nu,ko),u=e.length,o={};++r<u;){
-var i=e[r],f=t[i];n(f,i)&&(o[i]=f)}return o}function Mn(t){return function(n){return null==n?N:n[t]}}function Un(t){return function(n){return _n(n,t)}}function zn(t,n,r,e){var u=e?d:g,o=-1,i=n.length,f=t;for(r&&(f=a(t,A(r)));++o<i;)for(var c=0,l=n[o],l=r?r(l):l;-1<(c=u(f,l,c,e));)f!==t&&Fu.call(f,c,1),Fu.call(t,c,1);return t}function Dn(t,n){for(var r=t?n.length:0,e=r-1;r--;){var u=n[r];if(r==e||u!==o){var o=u;if(Gr(u))Fu.call(t,u,1);else if(Yr(u,t))delete t[ee(u)];else{var u=nr(u),i=re(t,u);null!=i&&delete i[ee(ae(u))];
-}}}}function $n(t,n){return t+Pu(Yu()*(n-t+1))}function Fn(t,n){var r="";if(!t||1>n||n>9007199254740991)return r;do n%2&&(r+=t),(n=Pu(n/2))&&(t+=t);while(n);return r}function Nn(t,n,r,e){n=Yr(n,t)?[n]:nr(n);for(var u=-1,o=n.length,i=o-1,f=t;null!=f&&++u<o;){var c=ee(n[u]);if(ze(f)){var a=r;if(u!=i){var l=f[c],a=e?e(l,c,f):N;a===N&&(a=null==l?Gr(n[u+1])?[]:{}:l)}Yt(f,c,a)}f=f[c]}return t}function Pn(t,n,r){var e=-1,u=t.length;for(0>n&&(n=-n>u?0:u+n),r=r>u?u:r,0>r&&(r+=u),u=n>r?0:r-n>>>0,n>>>=0,r=Array(u);++e<u;)r[e]=t[e+n];
-return r}function Zn(t,n){var r;return yo(t,function(t,e,u){return r=n(t,e,u),!r}),!!r}function Tn(t,n,r){var e=0,u=t?t.length:e;if(typeof n=="number"&&n===n&&2147483647>=u){for(;u>e;){var o=e+u>>>1,i=t[o];null!==i&&!Te(i)&&(r?n>=i:n>i)?e=o+1:u=o}return u}return qn(t,n,au,r)}function qn(t,n,r,e){n=r(n);for(var u=0,o=t?t.length:0,i=n!==n,f=null===n,c=Te(n),a=n===N;o>u;){var l=Pu((u+o)/2),s=r(t[l]),h=s!==N,p=null===s,_=s===s,v=Te(s);(i?e||_:a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):p||v?0:e?n>=s:n>s)?u=l+1:o=l;
-}return Gu(o,4294967294)}function Vn(t,n){for(var r=-1,e=t.length,u=0,o=[];++r<e;){var i=t[r],f=n?n(i):i;if(!r||!Se(f,c)){var c=f;o[u++]=0===i?0:i}}return o}function Kn(t){return typeof t=="number"?t:Te(t)?Z:+t}function Gn(t){if(typeof t=="string")return t;if(Te(t))return go?go.call(t):"";var n=t+"";return"0"==n&&1/t==-P?"-0":n}function Jn(t,n,r){var e=-1,u=f,o=t.length,i=true,a=[],l=a;if(r)i=false,u=c;else if(o>=200){if(u=n?null:wo(t))return z(u);i=false,u=zt,l=new Ut}else l=n?[]:a;t:for(;++e<o;){var s=t[e],h=n?n(s):s,s=r||0!==s?s:0;
-if(i&&h===h){for(var p=l.length;p--;)if(l[p]===h)continue t;n&&l.push(h),a.push(s)}else u(l,h,r)||(l!==a&&l.push(h),a.push(s))}return a}function Yn(t,n,r,e){for(var u=t.length,o=e?u:-1;(e?o--:++o<u)&&n(t[o],o,t););return r?Pn(t,e?0:o,e?o+1:u):Pn(t,e?o+1:0,e?u:o)}function Hn(t,n){var r=t;return r instanceof Lt&&(r=r.value()),s(n,function(t,n){return n.func.apply(n.thisArg,l([t],n.args))},r)}function Qn(t,n,r){for(var e=-1,u=t.length;++e<u;)var o=o?l(on(o,t[e],n,r),on(t[e],o,n,r)):t[e];return o&&o.length?Jn(o,n,r):[];
-}function Xn(t,n,r){for(var e=-1,u=t.length,o=n.length,i={};++e<u;)r(i,t[e],o>e?n[e]:N);return i}function tr(t){return Be(t)?t:[]}function nr(t){return li(t)?t:Io(t)}function rr(t,n,r){var e=t.length;return r=r===N?e:r,!n&&r>=e?t:Pn(t,n,r)}function er(t,n){if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function ur(t){var n=new t.constructor(t.byteLength);return new Bu(n).set(new Bu(t)),n}function or(t,n){if(t!==n){var r=t!==N,e=null===t,u=t===t,o=Te(t),i=n!==N,f=null===n,c=n===n,a=Te(n);
-if(!f&&!a&&!o&&t>n||o&&i&&c&&!f&&!a||e&&i&&c||!r&&c||!u)return 1;if(!e&&!o&&!a&&n>t||a&&r&&u&&!e&&!o||f&&r&&u||!i&&u||!c)return-1}return 0}function ir(t,n,r,e){var u=-1,o=t.length,i=r.length,f=-1,c=n.length,a=Ku(o-i,0),l=Array(c+a);for(e=!e;++f<c;)l[f]=n[f];for(;++u<i;)(e||o>u)&&(l[r[u]]=t[u]);for(;a--;)l[f++]=t[u++];return l}function fr(t,n,r,e){var u=-1,o=t.length,i=-1,f=r.length,c=-1,a=n.length,l=Ku(o-f,0),s=Array(l+a);for(e=!e;++u<l;)s[u]=t[u];for(l=u;++c<a;)s[l+c]=n[c];for(;++i<f;)(e||o>u)&&(s[l+r[i]]=t[u++]);
-return s}function cr(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r<e;)n[r]=t[r];return n}function ar(t,n,r,e){r||(r={});for(var u=-1,o=n.length;++u<o;){var i=n[u],f=e?e(r[i],t[i],i,r,t):t[i];Yt(r,i,f)}return r}function lr(t,n){return ar(t,$r(t),n)}function sr(t,n){return function(r,u){var o=li(r)?e:Ht,i=n?n():{};return o(r,t,Mr(u),i)}}function hr(t){return Ee(function(n,r){var e=-1,u=r.length,o=u>1?r[u-1]:N,i=u>2?r[2]:N,o=typeof o=="function"?(u--,o):N;for(i&&Jr(r[0],r[1],i)&&(o=3>u?N:o,u=1),n=Object(n);++e<u;)(i=r[e])&&t(n,i,e,o);
-return n})}function pr(t,n){return function(r,e){if(null==r)return r;if(!We(r))return t(r,e);for(var u=r.length,o=n?u:-1,i=Object(r);(n?o--:++o<u)&&false!==e(i[o],o,i););return r}}function _r(t){return function(n,r,e){var u=-1,o=Object(n);e=e(n);for(var i=e.length;i--;){var f=e[t?i:++u];if(false===r(o[f],f,o))break}return n}}function vr(t,n,r){function e(){return(this&&this!==Vt&&this instanceof e?o:t).apply(u?r:this,arguments)}var u=1&n,o=yr(t);return e}function gr(t){return function(n){n=He(n);var r=It.test(n)?n.match(kt):N,e=r?r[0]:n.charAt(0);
-return n=r?rr(r,1).join(""):n.slice(1),e[t]()+n}}function dr(t){return function(n){return s(fu(iu(n).replace(At,"")),t,"")}}function yr(t){return function(){var n=arguments;switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3]);case 5:return new t(n[0],n[1],n[2],n[3],n[4]);case 6:return new t(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new t(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var r=en(t.prototype),n=t.apply(r,n);
-return ze(n)?n:r}}function br(t,n,e){function u(){for(var i=arguments.length,f=Array(i),c=i,a=Dr(u);c--;)f[c]=arguments[c];return c=3>i&&f[0]!==a&&f[i-1]!==a?[]:U(f,a),i-=c.length,e>i?Sr(t,n,jr,u.placeholder,N,f,c,N,N,e-i):r(this&&this!==Vt&&this instanceof u?o:t,this,f)}var o=yr(t);return u}function xr(t){return Ee(function(n){n=ln(n,1);var r=n.length,e=r,u=wt.prototype.thru;for(t&&n.reverse();e--;){var o=n[e];if(typeof o!="function")throw new yu("Expected a function");if(u&&!i&&"wrapper"==Cr(o))var i=new wt([],true);
-}for(e=i?e:r;++e<r;)var o=n[e],u=Cr(o),f="wrapper"==u?Ao(o):N,i=f&&Qr(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?i[Cr(f[0])].apply(i,f[3]):1==o.length&&Qr(o)?i[u]():i.thru(o);return function(){var t=arguments,e=t[0];if(i&&1==t.length&&li(e)&&e.length>=200)return i.plant(e).value();for(var u=0,t=r?n[u].apply(this,t):e;++u<r;)t=n[u].call(this,t);return t}})}function jr(t,n,r,e,u,o,i,f,c,a){function l(){for(var d=arguments.length,y=d,b=Array(d);y--;)b[y]=arguments[y];if(_){var x,j=Dr(l),y=b.length;for(x=0;y--;)b[y]===j&&x++;
-}if(e&&(b=ir(b,e,u,_)),o&&(b=fr(b,o,i,_)),d-=x,_&&a>d)return j=U(b,j),Sr(t,n,jr,l.placeholder,r,b,j,f,c,a-d);if(j=h?r:this,y=p?j[t]:t,d=b.length,f){x=b.length;for(var m=Gu(f.length,x),w=cr(b);m--;){var A=f[m];b[m]=Gr(A,x)?w[A]:N}}else v&&d>1&&b.reverse();return s&&d>c&&(b.length=c),this&&this!==Vt&&this instanceof l&&(y=g||yr(y)),y.apply(j,b)}var s=128&n,h=1&n,p=2&n,_=24&n,v=512&n,g=p?N:yr(t);return l}function mr(t,n){return function(r,e){return xn(r,t,n(e))}}function wr(t){return function(n,r){var e;
-if(n===N&&r===N)return 0;if(n!==N&&(e=n),r!==N){if(e===N)return r;typeof n=="string"||typeof r=="string"?(n=Gn(n),r=Gn(r)):(n=Kn(n),r=Kn(r)),e=t(n,r)}return e}}function Ar(t){return Ee(function(n){return n=1==n.length&&li(n[0])?a(n[0],A(Mr())):a(ln(n,1,Kr),A(Mr())),Ee(function(e){var u=this;return t(n,function(t){return r(t,u,e)})})})}function Or(t,n){n=n===N?" ":Gn(n);var r=n.length;return 2>r?r?Fn(n,t):n:(r=Fn(n,Nu(t/D(n))),It.test(n)?rr(r.match(kt),0,t).join(""):r.slice(0,t))}function kr(t,n,e,u){
-function o(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Vt&&this instanceof o?f:t;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++n];return r(h,i?e:this,s)}var i=1&n,f=yr(t);return o}function Er(t){return function(n,r,e){e&&typeof e!="number"&&Jr(n,r,e)&&(r=e=N),n=Je(n),n=n===n?n:0,r===N?(r=n,n=0):r=Je(r)||0,e=e===N?r>n?1:-1:Je(e)||0;var u=-1;r=Ku(Nu((r-n)/(e||1)),0);for(var o=Array(r);r--;)o[t?r:++u]=n,n+=e;return o}}function Ir(t){return function(n,r){return typeof n=="string"&&typeof r=="string"||(n=Je(n),
-r=Je(r)),t(n,r)}}function Sr(t,n,r,e,u,o,i,f,c,a){var l=8&n,s=l?i:N;i=l?N:i;var h=l?o:N;return o=l?N:o,n=(n|(l?32:64))&~(l?64:32),4&n||(n&=-4),n=[t,n,u,h,s,o,i,f,c,a],r=r.apply(N,n),Qr(t)&&Eo(r,n),r.placeholder=e,r}function Rr(t){var n=gu[t];return function(t,r){if(t=Je(t),r=Ke(r)){var e=(He(t)+"e").split("e"),e=n(e[0]+"e"+(+e[1]+r)),e=(He(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return n(t)}}function Wr(t,n,r,e,u,o,i,f){var c=2&n;if(!c&&typeof t!="function")throw new yu("Expected a function");
-var a=e?e.length:0;if(a||(n&=-97,e=u=N),i=i===N?i:Ku(Ke(i),0),f=f===N?f:Ke(f),a-=u?u.length:0,64&n){var l=e,s=u;e=u=N}var h=c?N:Ao(t);return o=[t,n,r,e,u,l,s,o,i,f],h&&(r=o[1],t=h[1],n=r|t,e=128==t&&8==r||128==t&&256==r&&h[8]>=o[7].length||384==t&&h[8]>=h[7].length&&8==r,131>n||e)&&(1&t&&(o[2]=h[2],n|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?ir(e,r,h[4]):r,o[4]=e?U(o[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=o[5],o[5]=e?fr(e,r,h[6]):r,o[6]=e?U(o[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(o[7]=r),
-128&t&&(o[8]=null==o[8]?h[8]:Gu(o[8],h[8])),null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=n),t=o[0],n=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:t.length:Ku(o[9]-a,0),!f&&24&n&&(n&=-25),(h?mo:Eo)(n&&1!=n?8==n||16==n?br(t,n,f):32!=n&&33!=n||u.length?jr.apply(N,o):kr(t,n,r,e):vr(t,n,r),o)}function Br(t,n,r,e,u,o){var i=-1,f=2&u,c=1&u,a=t.length,l=n.length;if(a!=l&&!(f&&l>a))return false;if(l=o.get(t))return l==n;for(l=true,o.set(t,n);++i<a;){var s=t[i],h=n[i];if(e)var _=f?e(h,s,i,n,t,o):e(s,h,i,t,n,o);if(_!==N){
-if(_)continue;l=false;break}if(c){if(!p(n,function(t){return s===t||r(s,t,e,u,o)})){l=false;break}}else if(s!==h&&!r(s,h,e,u,o)){l=false;break}}return o["delete"](t),l}function Lr(t,n,r,e,u,o,i){switch(r){case"[object DataView]":if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)break;t=t.buffer,n=n.buffer;case"[object ArrayBuffer]":if(t.byteLength!=n.byteLength||!e(new Bu(t),new Bu(n)))break;return true;case"[object Boolean]":case"[object Date]":return+t==+n;case"[object Error]":return t.name==n.name&&t.message==n.message;
-case"[object Number]":return t!=+t?n!=+n:t==+n;case"[object RegExp]":case"[object String]":return t==n+"";case"[object Map]":var f=M;case"[object Set]":if(f||(f=z),t.size!=n.size&&!(2&o))break;return(r=i.get(t))?r==n:(o|=1,i.set(t,n),Br(f(t),f(n),e,u,o,i));case"[object Symbol]":if(vo)return vo.call(t)==vo.call(n)}return false}function Cr(t){for(var n=t.name+"",r=co[n],e=wu.call(co,n)?r.length:0;e--;){var u=r[e],o=u.func;if(null==o||o==t)return u.name}return n}function Mr(){var t=jt.iteratee||lu,t=t===lu?An:t;
-return arguments.length?t(arguments[0],arguments[1]):t}function Ur(t){t=ru(t);for(var n=t.length;n--;){var r=t[n][1];t[n][2]=r===r&&!ze(r)}return t}function zr(t,n){var r=t[n];return $e(r)?r:N}function Dr(t){return(wu.call(jt,"placeholder")?jt:t).placeholder}function $r(t){return Mu(Object(t))}function Fr(t){return ku.call(t)}function Nr(t,n,r){n=Yr(n,t)?[n]:nr(n);for(var e,u=-1,o=n.length;++u<o;){var i=ee(n[u]);if(!(e=null!=t&&r(t,i)))break;t=t[i]}return e?e:(o=t?t.length:0,!!o&&Ue(o)&&Gr(i,o)&&(li(t)||Ze(t)||Re(t)));
-}function Pr(t){var n=t.length,r=t.constructor(n);return n&&"string"==typeof t[0]&&wu.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function Zr(t){return typeof t.constructor!="function"||Xr(t)?{}:en(Zu(Object(t)))}function Tr(r,e,u,o){var i=r.constructor;switch(e){case"[object ArrayBuffer]":return ur(r);case"[object Boolean]":case"[object Date]":return new i(+r);case"[object DataView]":return e=o?ur(r.buffer):r.buffer,new r.constructor(e,r.byteOffset,r.byteLength);case"[object Float32Array]":
-case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return e=o?ur(r.buffer):r.buffer,new r.constructor(e,r.byteOffset,r.length);case"[object Map]":return e=o?u(M(r),true):M(r),s(e,t,new r.constructor);case"[object Number]":case"[object String]":return new i(r);case"[object RegExp]":return e=new r.constructor(r.source,st.exec(r)),e.lastIndex=r.lastIndex,
-e;case"[object Set]":return e=o?u(z(r),true):z(r),s(e,n,new r.constructor);case"[object Symbol]":return vo?Object(vo.call(r)):{}}}function qr(t){var n=t?t.length:N;return Ue(n)&&(li(t)||Ze(t)||Re(t))?m(n,String):null}function Vr(t){return Be(t)&&(li(t)||Re(t))}function Kr(t){return li(t)&&!(2==t.length&&!Ce(t[0]))}function Gr(t,n){return n=null==n?9007199254740991:n,!!n&&(typeof t=="number"||dt.test(t))&&t>-1&&0==t%1&&n>t}function Jr(t,n,r){if(!ze(r))return false;var e=typeof n;return("number"==e?We(r)&&Gr(n,r.length):"string"==e&&n in r)?Se(r[n],t):false;
-}function Yr(t,n){if(li(t))return false;var r=typeof t;return"number"==r||"symbol"==r||"boolean"==r||null==t||Te(t)?true:nt.test(t)||!tt.test(t)||null!=n&&t in Object(n)}function Hr(t){var n=typeof t;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t}function Qr(t){var n=Cr(t),r=jt[n];return typeof r=="function"&&n in Lt.prototype?t===r?true:(n=Ao(r),!!n&&t===n[0]):false}function Xr(t){var n=t&&t.constructor;return t===(typeof n=="function"&&n.prototype||xu)}function te(t,n){return function(r){
-return null==r?false:r[t]===n&&(n!==N||t in Object(r))}}function ne(t,n,r,e,u,o){return ze(t)&&ze(n)&&Rn(t,n,N,ne,o.set(n,t)),t}function re(t,n){return 1==n.length?t:_n(t,Pn(n,0,-1))}function ee(t){if(typeof t=="string"||Te(t))return t;var n=t+"";return"0"==n&&1/t==-P?"-0":n}function ue(t){if(null!=t){try{return mu.call(t)}catch(n){}return t+""}return""}function oe(t){if(t instanceof Lt)return t.clone();var n=new wt(t.__wrapped__,t.__chain__);return n.__actions__=cr(t.__actions__),n.__index__=t.__index__,
-n.__values__=t.__values__,n}function ie(t,n,r){var e=t?t.length:0;return e?(n=r||n===N?1:Ke(n),Pn(t,0>n?0:n,e)):[]}function fe(t,n,r){var e=t?t.length:0;return e?(n=r||n===N?1:Ke(n),n=e-n,Pn(t,0,0>n?0:n)):[]}function ce(t){return t&&t.length?t[0]:N}function ae(t){var n=t?t.length:0;return n?t[n-1]:N}function le(t,n){return t&&t.length&&n&&n.length?zn(t,n):t}function se(t){return t?Qu.call(t):t}function he(t){if(!t||!t.length)return[];var n=0;return t=i(t,function(t){return Be(t)?(n=Ku(t.length,n),
-!0):void 0}),m(n,function(n){return a(t,Mn(n))})}function pe(t,n){if(!t||!t.length)return[];var e=he(t);return null==n?e:a(e,function(t){return r(n,N,t)})}function _e(t){return t=jt(t),t.__chain__=true,t}function ve(t,n){return n(t)}function ge(){return this}function de(t,n){return typeof n=="function"&&li(t)?u(t,n):yo(t,Mr(n))}function ye(t,n){var r;if(typeof n=="function"&&li(t)){for(r=t.length;r--&&false!==n(t[r],r,t););r=t}else r=bo(t,Mr(n));return r}function be(t,n){return(li(t)?a:En)(t,Mr(n,3))}function xe(t,n,r){
-var e=-1,u=Ve(t),o=u.length,i=o-1;for(n=(r?Jr(t,n,r):n===N)?1:tn(Ke(n),0,o);++e<n;)t=$n(e,i),r=u[t],u[t]=u[e],u[e]=r;return u.length=n,u}function je(t,n,r){return n=r?N:n,n=t&&null==n?t.length:n,Wr(t,128,N,N,N,N,n)}function me(t,n){var r;if(typeof n!="function")throw new yu("Expected a function");return t=Ke(t),function(){return 0<--t&&(r=n.apply(this,arguments)),1>=t&&(n=N),r}}function we(t,n,r){return n=r?N:n,t=Wr(t,8,N,N,N,N,N,n),t.placeholder=we.placeholder,t}function Ae(t,n,r){return n=r?N:n,
-t=Wr(t,16,N,N,N,N,N,n),t.placeholder=Ae.placeholder,t}function Oe(t,n,r){function e(n){var r=c,e=a;return c=a=N,_=n,s=t.apply(e,r)}function u(t){var r=t-p;return t-=_,!p||r>=n||0>r||g&&t>=l}function o(){var t=Xo();if(u(t))return i(t);var r;r=t-_,t=n-(t-p),r=g?Gu(t,l-r):t,h=$u(o,r)}function i(t){return Lu(h),h=N,d&&c?e(t):(c=a=N,s)}function f(){var t=Xo(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===N)return _=t=p,h=$u(o,n),v?e(t):s;if(g)return Lu(h),h=$u(o,n),e(p)}return h===N&&(h=$u(o,n)),s}var c,a,l,s,h,p=0,_=0,v=false,g=false,d=true;
-if(typeof t!="function")throw new yu("Expected a function");return n=Je(n)||0,ze(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Ku(Je(r.maxWait)||0,n):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==N&&Lu(h),p=_=0,c=a=h=N},f.flush=function(){return h===N?s:i(Xo())},f}function ke(t,n){function r(){var e=arguments,u=n?n.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=t.apply(this,e),r.cache=o.set(u,e),e)}if(typeof t!="function"||n&&typeof n!="function")throw new yu("Expected a function");
-return r.cache=new(ke.Cache||Mt),r}function Ee(t,n){if(typeof t!="function")throw new yu("Expected a function");return n=Ku(n===N?t.length-1:Ke(n),0),function(){for(var e=arguments,u=-1,o=Ku(e.length-n,0),i=Array(o);++u<o;)i[u]=e[n+u];switch(n){case 0:return t.call(this,i);case 1:return t.call(this,e[0],i);case 2:return t.call(this,e[0],e[1],i)}for(o=Array(n+1),u=-1;++u<n;)o[u]=e[u];return o[n]=i,r(t,this,o)}}function Ie(){if(!arguments.length)return[];var t=arguments[0];return li(t)?t:[t]}function Se(t,n){
-return t===n||t!==t&&n!==n}function Re(t){return Be(t)&&wu.call(t,"callee")&&(!Du.call(t,"callee")||"[object Arguments]"==ku.call(t))}function We(t){return null!=t&&Ue(Oo(t))&&!Ce(t)}function Be(t){return De(t)&&We(t)}function Le(t){return De(t)?"[object Error]"==ku.call(t)||typeof t.message=="string"&&typeof t.name=="string":false}function Ce(t){return t=ze(t)?ku.call(t):"","[object Function]"==t||"[object GeneratorFunction]"==t}function Me(t){return typeof t=="number"&&t==Ke(t)}function Ue(t){return typeof t=="number"&&t>-1&&0==t%1&&9007199254740991>=t;
-}function ze(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function De(t){return!!t&&typeof t=="object"}function $e(t){return ze(t)?(Ce(t)||L(t)?Iu:vt).test(ue(t)):false}function Fe(t){return typeof t=="number"||De(t)&&"[object Number]"==ku.call(t)}function Ne(t){return!De(t)||"[object Object]"!=ku.call(t)||L(t)?false:(t=Zu(Object(t)),null===t?true:(t=wu.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&mu.call(t)==Ou))}function Pe(t){return ze(t)&&"[object RegExp]"==ku.call(t);
-}function Ze(t){return typeof t=="string"||!li(t)&&De(t)&&"[object String]"==ku.call(t)}function Te(t){return typeof t=="symbol"||De(t)&&"[object Symbol]"==ku.call(t)}function qe(t){return De(t)&&Ue(t.length)&&!!Wt[ku.call(t)]}function Ve(t){if(!t)return[];if(We(t))return Ze(t)?t.match(kt):cr(t);if(Uu&&t[Uu])return C(t[Uu]());var n=Fr(t);return("[object Map]"==n?M:"[object Set]"==n?z:uu)(t)}function Ke(t){if(!t)return 0===t?t:0;if(t=Je(t),t===P||t===-P)return 1.7976931348623157e308*(0>t?-1:1);var n=t%1;
-return t===t?n?t-n:t:0}function Ge(t){return t?tn(Ke(t),0,4294967295):0}function Je(t){if(typeof t=="number")return t;if(Te(t))return Z;if(ze(t)&&(t=Ce(t.valueOf)?t.valueOf():t,t=ze(t)?t+"":t),typeof t!="string")return 0===t?t:+t;t=t.replace(ot,"");var n=_t.test(t);return n||gt.test(t)?$t(t.slice(2),n?2:8):pt.test(t)?Z:+t}function Ye(t){return ar(t,nu(t))}function He(t){return null==t?"":Gn(t)}function Qe(t,n,r){return t=null==t?N:_n(t,n),t===N?r:t}function Xe(t,n){return null!=t&&Nr(t,n,yn)}function tu(t){
-var n=Xr(t);if(!n&&!We(t))return Vu(Object(t));var r,e=qr(t),u=!!e,e=e||[],o=e.length;for(r in t)!dn(t,r)||u&&("length"==r||Gr(r,o))||n&&"constructor"==r||e.push(r);return e}function nu(t){for(var n=-1,r=Xr(t),e=On(t),u=e.length,o=qr(t),i=!!o,o=o||[],f=o.length;++n<u;){var c=e[n];i&&("length"==c||Gr(c,f))||"constructor"==c&&(r||!wu.call(t,c))||o.push(c)}return o}function ru(t){return w(t,tu(t))}function eu(t){return w(t,nu(t))}function uu(t){return t?O(t,tu(t)):[]}function ou(t){return Mi(He(t).toLowerCase());
-}function iu(t){return(t=He(t))&&t.replace(yt,S).replace(Ot,"")}function fu(t,n,r){return t=He(t),n=r?N:n,n===N&&(n=St.test(t)?Et:ct),t.match(n)||[]}function cu(t){return function(){return t}}function au(t){return t}function lu(t){return An(typeof t=="function"?t:nn(t,true))}function su(t,n,r){var e=tu(n),o=pn(n,e);null!=r||ze(n)&&(o.length||!e.length)||(r=n,n=t,t=this,o=pn(n,tu(n)));var i=!(ze(r)&&"chain"in r&&!r.chain),f=Ce(t);return u(o,function(r){var e=n[r];t[r]=e,f&&(t.prototype[r]=function(){
-var n=this.__chain__;if(i||n){var r=t(this.__wrapped__);return(r.__actions__=cr(this.__actions__)).push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}return e.apply(t,l([this.value()],arguments))})}),t}function hu(){}function pu(t){return Yr(t)?Mn(ee(t)):Un(t)}I=I?Kt.defaults({},I,Kt.pick(Vt,Rt)):Vt;var _u=I.Date,vu=I.Error,gu=I.Math,du=I.RegExp,yu=I.TypeError,bu=I.Array.prototype,xu=I.Object.prototype,ju=I.String.prototype,mu=I.Function.prototype.toString,wu=xu.hasOwnProperty,Au=0,Ou=mu.call(Object),ku=xu.toString,Eu=Vt._,Iu=du("^"+mu.call(wu).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Su=Pt?I.Buffer:N,Ru=I.Reflect,Wu=I.Symbol,Bu=I.Uint8Array,Lu=I.clearTimeout,Cu=Ru?Ru.f:N,Mu=Object.getOwnPropertySymbols,Uu=typeof(Uu=Wu&&Wu.iterator)=="symbol"?Uu:N,zu=Object.create,Du=xu.propertyIsEnumerable,$u=I.setTimeout,Fu=bu.splice,Nu=gu.ceil,Pu=gu.floor,Zu=Object.getPrototypeOf,Tu=I.isFinite,qu=bu.join,Vu=Object.keys,Ku=gu.max,Gu=gu.min,Ju=I.parseInt,Yu=gu.random,Hu=ju.replace,Qu=bu.reverse,Xu=ju.split,to=zr(I,"DataView"),no=zr(I,"Map"),ro=zr(I,"Promise"),eo=zr(I,"Set"),uo=zr(I,"WeakMap"),oo=zr(Object,"create"),io=uo&&new uo,fo=!Du.call({
-valueOf:1},"valueOf"),co={},ao=ue(to),lo=ue(no),so=ue(ro),ho=ue(eo),po=ue(uo),_o=Wu?Wu.prototype:N,vo=_o?_o.valueOf:N,go=_o?_o.toString:N;jt.templateSettings={escape:H,evaluate:Q,interpolate:X,variable:"",imports:{_:jt}},jt.prototype=mt.prototype,jt.prototype.constructor=jt,wt.prototype=en(mt.prototype),wt.prototype.constructor=wt,Lt.prototype=en(mt.prototype),Lt.prototype.constructor=Lt,Ct.prototype=oo?oo(null):xu,Mt.prototype.clear=function(){this.__data__={hash:new Ct,map:no?new no:[],string:new Ct
-}},Mt.prototype["delete"]=function(t){var n=this.__data__;return Hr(t)?(n=typeof t=="string"?n.string:n.hash,t=(oo?n[t]!==N:wu.call(n,t))&&delete n[t]):t=no?n.map["delete"](t):Nt(n.map,t),t},Mt.prototype.get=function(t){var n=this.__data__;return Hr(t)?(n=typeof t=="string"?n.string:n.hash,oo?(t=n[t],t="__lodash_hash_undefined__"===t?N:t):t=wu.call(n,t)?n[t]:N):t=no?n.map.get(t):Zt(n.map,t),t},Mt.prototype.has=function(t){var n=this.__data__;return Hr(t)?(n=typeof t=="string"?n.string:n.hash,t=oo?n[t]!==N:wu.call(n,t)):t=no?n.map.has(t):-1<Tt(n.map,t),
-t},Mt.prototype.set=function(t,n){var r=this.__data__;return Hr(t)?(typeof t=="string"?r.string:r.hash)[t]=oo&&n===N?"__lodash_hash_undefined__":n:no?r.map.set(t,n):qt(r.map,t,n),this},Ut.prototype.push=function(t){var n=this.__data__;Hr(t)?(n=n.__data__,(typeof t=="string"?n.string:n.hash)[t]="__lodash_hash_undefined__"):n.set(t,"__lodash_hash_undefined__")},Ft.prototype.clear=function(){this.__data__={array:[],map:null}},Ft.prototype["delete"]=function(t){var n=this.__data__,r=n.array;return r?Nt(r,t):n.map["delete"](t);
-},Ft.prototype.get=function(t){var n=this.__data__,r=n.array;return r?Zt(r,t):n.map.get(t)},Ft.prototype.has=function(t){var n=this.__data__,r=n.array;return r?-1<Tt(r,t):n.map.has(t)},Ft.prototype.set=function(t,n){var r=this.__data__,e=r.array;return e&&(199>e.length?qt(e,t,n):(r.array=null,r.map=new Mt(e))),(r=r.map)&&r.set(t,n),this};var yo=pr(sn),bo=pr(hn,true),xo=_r(),jo=_r(true);Cu&&!Du.call({valueOf:1},"valueOf")&&(On=function(t){return C(Cu(t))});var mo=io?function(t,n){return io.set(t,n),t}:au,wo=eo&&1/z(new eo([,-0]))[1]==P?function(t){
-return new eo(t)}:hu,Ao=io?function(t){return io.get(t)}:hu,Oo=Mn("length");Mu||($r=function(){return[]});var ko=Mu?function(t){for(var n=[];t;)l(n,$r(t)),t=Zu(Object(t));return n}:$r;(to&&"[object DataView]"!=Fr(new to(new ArrayBuffer(1)))||no&&"[object Map]"!=Fr(new no)||ro&&"[object Promise]"!=Fr(ro.resolve())||eo&&"[object Set]"!=Fr(new eo)||uo&&"[object WeakMap]"!=Fr(new uo))&&(Fr=function(t){var n=ku.call(t);if(t=(t="[object Object]"==n?t.constructor:N)?ue(t):N)switch(t){case ao:return"[object DataView]";
-case lo:return"[object Map]";case so:return"[object Promise]";case ho:return"[object Set]";case po:return"[object WeakMap]"}return n});var Eo=function(){var t=0,n=0;return function(r,e){var u=Xo(),o=16-(u-n);if(n=u,o>0){if(150<=++t)return r}else t=0;return mo(r,e)}}(),Io=ke(function(t){var n=[];return He(t).replace(rt,function(t,r,e,u){n.push(e?u.replace(at,"$1"):r||t)}),n}),So=Ee(function(t,n){return Be(t)?on(t,ln(n,1,Be,true)):[]}),Ro=Ee(function(t,n){var r=ae(n);return Be(r)&&(r=N),Be(t)?on(t,ln(n,1,Be,true),Mr(r)):[];
-}),Wo=Ee(function(t,n){var r=ae(n);return Be(r)&&(r=N),Be(t)?on(t,ln(n,1,Be,true),N,r):[]}),Bo=Ee(function(t){var n=a(t,tr);return n.length&&n[0]===t[0]?bn(n):[]}),Lo=Ee(function(t){var n=ae(t),r=a(t,tr);return n===ae(r)?n=N:r.pop(),r.length&&r[0]===t[0]?bn(r,Mr(n)):[]}),Co=Ee(function(t){var n=ae(t),r=a(t,tr);return n===ae(r)?n=N:r.pop(),r.length&&r[0]===t[0]?bn(r,N,n):[]}),Mo=Ee(le),Uo=Ee(function(t,n){n=ln(n,1);var r=t?t.length:0,e=Xt(t,n);return Dn(t,a(n,function(t){return Gr(t,r)?+t:t}).sort(or)),
-e}),zo=Ee(function(t){return Jn(ln(t,1,Be,true))}),Do=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Jn(ln(t,1,Be,true),Mr(n))}),$o=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Jn(ln(t,1,Be,true),N,n)}),Fo=Ee(function(t,n){return Be(t)?on(t,n):[]}),No=Ee(function(t){return Qn(i(t,Be))}),Po=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Qn(i(t,Be),Mr(n))}),Zo=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Qn(i(t,Be),N,n)}),To=Ee(he),qo=Ee(function(t){var n=t.length,n=n>1?t[n-1]:N,n=typeof n=="function"?(t.pop(),
-n):N;return pe(t,n)}),Vo=Ee(function(t){function n(n){return Xt(n,t)}t=ln(t,1);var r=t.length,e=r?t[0]:0,u=this.__wrapped__;return!(r>1||this.__actions__.length)&&u instanceof Lt&&Gr(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:ve,args:[n],thisArg:N}),new wt(u,this.__chain__).thru(function(t){return r&&!t.length&&t.push(N),t})):this.thru(n)}),Ko=sr(function(t,n,r){wu.call(t,r)?++t[r]:t[r]=1}),Go=sr(function(t,n,r){wu.call(t,r)?t[r].push(n):t[r]=[n]}),Jo=Ee(function(t,n,e){var u=-1,o=typeof n=="function",i=Yr(n),f=We(t)?Array(t.length):[];
-return yo(t,function(t){var c=o?n:i&&null!=t?t[n]:N;f[++u]=c?r(c,t,e):jn(t,n,e)}),f}),Yo=sr(function(t,n,r){t[r]=n}),Ho=sr(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]}),Qo=Ee(function(t,n){if(null==t)return[];var r=n.length;return r>1&&Jr(t,n[0],n[1])?n=[]:r>2&&Jr(n[0],n[1],n[2])&&(n=[n[0]]),n=1==n.length&&li(n[0])?n[0]:ln(n,1,Kr),Bn(t,n,[])}),Xo=_u.now,ti=Ee(function(t,n,r){var e=1;if(r.length)var u=U(r,Dr(ti)),e=32|e;return Wr(t,e,n,r,u)}),ni=Ee(function(t,n,r){var e=3;if(r.length)var u=U(r,Dr(ni)),e=32|e;
-return Wr(n,e,t,r,u)}),ri=Ee(function(t,n){return un(t,1,n)}),ei=Ee(function(t,n,r){return un(t,Je(n)||0,r)});ke.Cache=Mt;var ui=Ee(function(t,n){n=1==n.length&&li(n[0])?a(n[0],A(Mr())):a(ln(n,1,Kr),A(Mr()));var e=n.length;return Ee(function(u){for(var o=-1,i=Gu(u.length,e);++o<i;)u[o]=n[o].call(this,u[o]);return r(t,this,u)})}),oi=Ee(function(t,n){var r=U(n,Dr(oi));return Wr(t,32,N,n,r)}),ii=Ee(function(t,n){var r=U(n,Dr(ii));return Wr(t,64,N,n,r)}),fi=Ee(function(t,n){return Wr(t,256,N,N,N,ln(n,1));
-}),ci=Ir(gn),ai=Ir(function(t,n){return t>=n}),li=Array.isArray,si=Su?function(t){return t instanceof Su}:cu(false),hi=Ir(kn),pi=Ir(function(t,n){return n>=t}),_i=hr(function(t,n){if(fo||Xr(n)||We(n))ar(n,tu(n),t);else for(var r in n)wu.call(n,r)&&Yt(t,r,n[r])}),vi=hr(function(t,n){if(fo||Xr(n)||We(n))ar(n,nu(n),t);else for(var r in n)Yt(t,r,n[r])}),gi=hr(function(t,n,r,e){ar(n,nu(n),t,e)}),di=hr(function(t,n,r,e){ar(n,tu(n),t,e)}),yi=Ee(function(t,n){return Xt(t,ln(n,1))}),bi=Ee(function(t){return t.push(N,Gt),
-r(gi,N,t)}),xi=Ee(function(t){return t.push(N,ne),r(Oi,N,t)}),ji=mr(function(t,n,r){t[n]=r},cu(au)),mi=mr(function(t,n,r){wu.call(t,n)?t[n].push(r):t[n]=[r]},Mr),wi=Ee(jn),Ai=hr(function(t,n,r){Rn(t,n,r)}),Oi=hr(function(t,n,r,e){Rn(t,n,r,e)}),ki=Ee(function(t,n){return null==t?{}:(n=a(ln(n,1),ee),Ln(t,on(vn(t,nu,ko),n)))}),Ei=Ee(function(t,n){return null==t?{}:Ln(t,a(ln(n,1),ee))}),Ii=dr(function(t,n,r){return n=n.toLowerCase(),t+(r?ou(n):n)}),Si=dr(function(t,n,r){return t+(r?"-":"")+n.toLowerCase();
-}),Ri=dr(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),Wi=gr("toLowerCase"),Bi=dr(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),Li=dr(function(t,n,r){return t+(r?" ":"")+Mi(n)}),Ci=dr(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),Mi=gr("toUpperCase"),Ui=Ee(function(t,n){try{return r(t,N,n)}catch(e){return Le(e)?e:new vu(e)}}),zi=Ee(function(t,n){return u(ln(n,1),function(n){n=ee(n),t[n]=ti(t[n],t)}),t}),Di=xr(),$i=xr(true),Fi=Ee(function(t,n){return function(r){return jn(r,t,n);
-}}),Ni=Ee(function(t,n){return function(r){return jn(t,r,n)}}),Pi=Ar(a),Zi=Ar(o),Ti=Ar(p),qi=Er(),Vi=Er(true),Ki=wr(function(t,n){return t+n}),Gi=Rr("ceil"),Ji=wr(function(t,n){return t/n}),Yi=Rr("floor"),Hi=wr(function(t,n){return t*n}),Qi=Rr("round"),Xi=wr(function(t,n){return t-n});return jt.after=function(t,n){if(typeof n!="function")throw new yu("Expected a function");return t=Ke(t),function(){return 1>--t?n.apply(this,arguments):void 0}},jt.ary=je,jt.assign=_i,jt.assignIn=vi,jt.assignInWith=gi,
-jt.assignWith=di,jt.at=yi,jt.before=me,jt.bind=ti,jt.bindAll=zi,jt.bindKey=ni,jt.castArray=Ie,jt.chain=_e,jt.chunk=function(t,n,r){if(n=(r?Jr(t,n,r):n===N)?1:Ku(Ke(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,o=Array(Nu(r/n));r>e;)o[u++]=Pn(t,e,e+=n);return o},jt.compact=function(t){for(var n=-1,r=t?t.length:0,e=0,u=[];++n<r;){var o=t[n];o&&(u[e++]=o)}return u},jt.concat=function(){var t=arguments.length,n=Ie(arguments[0]);if(2>t)return t?cr(n):[];for(var r=Array(t-1);t--;)r[t-1]=arguments[t];
-for(var t=ln(r,1),r=-1,e=n.length,u=-1,o=t.length,i=Array(e+o);++r<e;)i[r]=n[r];for(;++u<o;)i[r++]=t[u];return i},jt.cond=function(t){var n=t?t.length:0,e=Mr();return t=n?a(t,function(t){if("function"!=typeof t[1])throw new yu("Expected a function");return[e(t[0]),t[1]]}):[],Ee(function(e){for(var u=-1;++u<n;){var o=t[u];if(r(o[0],this,e))return r(o[1],this,e)}})},jt.conforms=function(t){return rn(nn(t,true))},jt.constant=cu,jt.countBy=Ko,jt.create=function(t,n){var r=en(t);return n?Qt(r,n):r},jt.curry=we,
-jt.curryRight=Ae,jt.debounce=Oe,jt.defaults=bi,jt.defaultsDeep=xi,jt.defer=ri,jt.delay=ei,jt.difference=So,jt.differenceBy=Ro,jt.differenceWith=Wo,jt.drop=ie,jt.dropRight=fe,jt.dropRightWhile=function(t,n){return t&&t.length?Yn(t,Mr(n,3),true,true):[]},jt.dropWhile=function(t,n){return t&&t.length?Yn(t,Mr(n,3),true):[]},jt.fill=function(t,n,r,e){var u=t?t.length:0;if(!u)return[];for(r&&typeof r!="number"&&Jr(t,n,r)&&(r=0,e=u),u=t.length,r=Ke(r),0>r&&(r=-r>u?0:u+r),e=e===N||e>u?u:Ke(e),0>e&&(e+=u),e=r>e?0:Ge(e);e>r;)t[r++]=n;
-return t},jt.filter=function(t,n){return(li(t)?i:an)(t,Mr(n,3))},jt.flatMap=function(t,n){return ln(be(t,n),1)},jt.flatMapDeep=function(t,n){return ln(be(t,n),P)},jt.flatMapDepth=function(t,n,r){return r=r===N?1:Ke(r),ln(be(t,n),r)},jt.flatten=function(t){return t&&t.length?ln(t,1):[]},jt.flattenDeep=function(t){return t&&t.length?ln(t,P):[]},jt.flattenDepth=function(t,n){return t&&t.length?(n=n===N?1:Ke(n),ln(t,n)):[]},jt.flip=function(t){return Wr(t,512)},jt.flow=Di,jt.flowRight=$i,jt.fromPairs=function(t){
-for(var n=-1,r=t?t.length:0,e={};++n<r;){var u=t[n];e[u[0]]=u[1]}return e},jt.functions=function(t){return null==t?[]:pn(t,tu(t))},jt.functionsIn=function(t){return null==t?[]:pn(t,nu(t))},jt.groupBy=Go,jt.initial=function(t){return fe(t,1)},jt.intersection=Bo,jt.intersectionBy=Lo,jt.intersectionWith=Co,jt.invert=ji,jt.invertBy=mi,jt.invokeMap=Jo,jt.iteratee=lu,jt.keyBy=Yo,jt.keys=tu,jt.keysIn=nu,jt.map=be,jt.mapKeys=function(t,n){var r={};return n=Mr(n,3),sn(t,function(t,e,u){r[n(t,e,u)]=t}),r},
-jt.mapValues=function(t,n){var r={};return n=Mr(n,3),sn(t,function(t,e,u){r[e]=n(t,e,u)}),r},jt.matches=function(t){return In(nn(t,true))},jt.matchesProperty=function(t,n){return Sn(t,nn(n,true))},jt.memoize=ke,jt.merge=Ai,jt.mergeWith=Oi,jt.method=Fi,jt.methodOf=Ni,jt.mixin=su,jt.negate=function(t){if(typeof t!="function")throw new yu("Expected a function");return function(){return!t.apply(this,arguments)}},jt.nthArg=function(t){return t=Ke(t),Ee(function(n){return Wn(n,t)})},jt.omit=ki,jt.omitBy=function(t,n){
-return n=Mr(n),Cn(t,function(t,r){return!n(t,r)})},jt.once=function(t){return me(2,t)},jt.orderBy=function(t,n,r,e){return null==t?[]:(li(n)||(n=null==n?[]:[n]),r=e?N:r,li(r)||(r=null==r?[]:[r]),Bn(t,n,r))},jt.over=Pi,jt.overArgs=ui,jt.overEvery=Zi,jt.overSome=Ti,jt.partial=oi,jt.partialRight=ii,jt.partition=Ho,jt.pick=Ei,jt.pickBy=function(t,n){return null==t?{}:Cn(t,Mr(n))},jt.property=pu,jt.propertyOf=function(t){return function(n){return null==t?N:_n(t,n)}},jt.pull=Mo,jt.pullAll=le,jt.pullAllBy=function(t,n,r){
-return t&&t.length&&n&&n.length?zn(t,n,Mr(r)):t},jt.pullAllWith=function(t,n,r){return t&&t.length&&n&&n.length?zn(t,n,N,r):t},jt.pullAt=Uo,jt.range=qi,jt.rangeRight=Vi,jt.rearg=fi,jt.reject=function(t,n){var r=li(t)?i:an;return n=Mr(n,3),r(t,function(t,r,e){return!n(t,r,e)})},jt.remove=function(t,n){var r=[];if(!t||!t.length)return r;var e=-1,u=[],o=t.length;for(n=Mr(n,3);++e<o;){var i=t[e];n(i,e,t)&&(r.push(i),u.push(e))}return Dn(t,u),r},jt.rest=Ee,jt.reverse=se,jt.sampleSize=xe,jt.set=function(t,n,r){
-return null==t?t:Nn(t,n,r)},jt.setWith=function(t,n,r,e){return e=typeof e=="function"?e:N,null==t?t:Nn(t,n,r,e)},jt.shuffle=function(t){return xe(t,4294967295)},jt.slice=function(t,n,r){var e=t?t.length:0;return e?(r&&typeof r!="number"&&Jr(t,n,r)?(n=0,r=e):(n=null==n?0:Ke(n),r=r===N?e:Ke(r)),Pn(t,n,r)):[]},jt.sortBy=Qo,jt.sortedUniq=function(t){return t&&t.length?Vn(t):[]},jt.sortedUniqBy=function(t,n){return t&&t.length?Vn(t,Mr(n)):[]},jt.split=function(t,n,r){return r&&typeof r!="number"&&Jr(t,n,r)&&(n=r=N),
-r=r===N?4294967295:r>>>0,r?(t=He(t))&&(typeof n=="string"||null!=n&&!Pe(n))&&(n=Gn(n),""==n&&It.test(t))?rr(t.match(kt),0,r):Xu.call(t,n,r):[]},jt.spread=function(t,n){if(typeof t!="function")throw new yu("Expected a function");return n=n===N?0:Ku(Ke(n),0),Ee(function(e){var u=e[n];return e=rr(e,0,n),u&&l(e,u),r(t,this,e)})},jt.tail=function(t){return ie(t,1)},jt.take=function(t,n,r){return t&&t.length?(n=r||n===N?1:Ke(n),Pn(t,0,0>n?0:n)):[]},jt.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===N?1:Ke(n),
-n=e-n,Pn(t,0>n?0:n,e)):[]},jt.takeRightWhile=function(t,n){return t&&t.length?Yn(t,Mr(n,3),false,true):[]},jt.takeWhile=function(t,n){return t&&t.length?Yn(t,Mr(n,3)):[]},jt.tap=function(t,n){return n(t),t},jt.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new yu("Expected a function");return ze(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Oe(t,n,{leading:e,maxWait:n,trailing:u})},jt.thru=ve,jt.toArray=Ve,jt.toPairs=ru,jt.toPairsIn=eu,jt.toPath=function(t){
-return li(t)?a(t,ee):Te(t)?[t]:cr(Io(t))},jt.toPlainObject=Ye,jt.transform=function(t,n,r){var e=li(t)||qe(t);if(n=Mr(n,4),null==r)if(e||ze(t)){var o=t.constructor;r=e?li(t)?new o:[]:Ce(o)?en(Zu(Object(t))):{}}else r={};return(e?u:sn)(t,function(t,e,u){return n(r,t,e,u)}),r},jt.unary=function(t){return je(t,1)},jt.union=zo,jt.unionBy=Do,jt.unionWith=$o,jt.uniq=function(t){return t&&t.length?Jn(t):[]},jt.uniqBy=function(t,n){return t&&t.length?Jn(t,Mr(n)):[]},jt.uniqWith=function(t,n){return t&&t.length?Jn(t,N,n):[];
-},jt.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=Yr(e,r)?[e]:nr(e);r=re(r,e),e=ee(ae(e)),r=!(null!=r&&dn(r,e))||delete r[e]}return r},jt.unzip=he,jt.unzipWith=pe,jt.update=function(t,n,r){return null==t?t:Nn(t,n,(typeof r=="function"?r:au)(_n(t,n)),void 0)},jt.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:N,null!=t&&(t=Nn(t,n,(typeof r=="function"?r:au)(_n(t,n)),e)),t},jt.values=uu,jt.valuesIn=function(t){return null==t?[]:O(t,nu(t))},jt.without=Fo,jt.words=fu,jt.wrap=function(t,n){
-return n=null==n?au:n,oi(n,t)},jt.xor=No,jt.xorBy=Po,jt.xorWith=Zo,jt.zip=To,jt.zipObject=function(t,n){return Xn(t||[],n||[],Yt)},jt.zipObjectDeep=function(t,n){return Xn(t||[],n||[],Nn)},jt.zipWith=qo,jt.entries=ru,jt.entriesIn=eu,jt.extend=vi,jt.extendWith=gi,su(jt,jt),jt.add=Ki,jt.attempt=Ui,jt.camelCase=Ii,jt.capitalize=ou,jt.ceil=Gi,jt.clamp=function(t,n,r){return r===N&&(r=n,n=N),r!==N&&(r=Je(r),r=r===r?r:0),n!==N&&(n=Je(n),n=n===n?n:0),tn(Je(t),n,r)},jt.clone=function(t){return nn(t,false,true);
-},jt.cloneDeep=function(t){return nn(t,true,true)},jt.cloneDeepWith=function(t,n){return nn(t,true,true,n)},jt.cloneWith=function(t,n){return nn(t,false,true,n)},jt.deburr=iu,jt.divide=Ji,jt.endsWith=function(t,n,r){t=He(t),n=Gn(n);var e=t.length;return r=r===N?e:tn(Ke(r),0,e),r-=n.length,r>=0&&t.indexOf(n,r)==r},jt.eq=Se,jt.escape=function(t){return(t=He(t))&&Y.test(t)?t.replace(G,R):t},jt.escapeRegExp=function(t){return(t=He(t))&&ut.test(t)?t.replace(et,"\\$&"):t},jt.every=function(t,n,r){var e=li(t)?o:fn;return r&&Jr(t,n,r)&&(n=N),
-e(t,Mr(n,3))},jt.find=function(t,n){if(n=Mr(n,3),li(t)){var r=v(t,n);return r>-1?t[r]:N}return _(t,n,yo)},jt.findIndex=function(t,n){return t&&t.length?v(t,Mr(n,3)):-1},jt.findKey=function(t,n){return _(t,Mr(n,3),sn,true)},jt.findLast=function(t,n){if(n=Mr(n,3),li(t)){var r=v(t,n,true);return r>-1?t[r]:N}return _(t,n,bo)},jt.findLastIndex=function(t,n){return t&&t.length?v(t,Mr(n,3),true):-1},jt.findLastKey=function(t,n){return _(t,Mr(n,3),hn,true)},jt.floor=Yi,jt.forEach=de,jt.forEachRight=ye,jt.forIn=function(t,n){
-return null==t?t:xo(t,Mr(n),nu)},jt.forInRight=function(t,n){return null==t?t:jo(t,Mr(n),nu)},jt.forOwn=function(t,n){return t&&sn(t,Mr(n))},jt.forOwnRight=function(t,n){return t&&hn(t,Mr(n))},jt.get=Qe,jt.gt=ci,jt.gte=ai,jt.has=function(t,n){return null!=t&&Nr(t,n,dn)},jt.hasIn=Xe,jt.head=ce,jt.identity=au,jt.includes=function(t,n,r,e){return t=We(t)?t:uu(t),r=r&&!e?Ke(r):0,e=t.length,0>r&&(r=Ku(e+r,0)),Ze(t)?e>=r&&-1<t.indexOf(n,r):!!e&&-1<g(t,n,r)},jt.indexOf=function(t,n,r){var e=t?t.length:0;
-return e?(r=Ke(r),0>r&&(r=Ku(e+r,0)),g(t,n,r)):-1},jt.inRange=function(t,n,r){return n=Je(n)||0,r===N?(r=n,n=0):r=Je(r)||0,t=Je(t),t>=Gu(n,r)&&t<Ku(n,r)},jt.invoke=wi,jt.isArguments=Re,jt.isArray=li,jt.isArrayBuffer=function(t){return De(t)&&"[object ArrayBuffer]"==ku.call(t)},jt.isArrayLike=We,jt.isArrayLikeObject=Be,jt.isBoolean=function(t){return true===t||false===t||De(t)&&"[object Boolean]"==ku.call(t)},jt.isBuffer=si,jt.isDate=function(t){return De(t)&&"[object Date]"==ku.call(t)},jt.isElement=function(t){
-return!!t&&1===t.nodeType&&De(t)&&!Ne(t)},jt.isEmpty=function(t){if(We(t)&&(li(t)||Ze(t)||Ce(t.splice)||Re(t)||si(t)))return!t.length;if(De(t)){var n=Fr(t);if("[object Map]"==n||"[object Set]"==n)return!t.size}for(var r in t)if(wu.call(t,r))return false;return!(fo&&tu(t).length)},jt.isEqual=function(t,n){return mn(t,n)},jt.isEqualWith=function(t,n,r){var e=(r=typeof r=="function"?r:N)?r(t,n):N;return e===N?mn(t,n,r):!!e},jt.isError=Le,jt.isFinite=function(t){return typeof t=="number"&&Tu(t)},jt.isFunction=Ce,
-jt.isInteger=Me,jt.isLength=Ue,jt.isMap=function(t){return De(t)&&"[object Map]"==Fr(t)},jt.isMatch=function(t,n){return t===n||wn(t,n,Ur(n))},jt.isMatchWith=function(t,n,r){return r=typeof r=="function"?r:N,wn(t,n,Ur(n),r)},jt.isNaN=function(t){return Fe(t)&&t!=+t},jt.isNative=$e,jt.isNil=function(t){return null==t},jt.isNull=function(t){return null===t},jt.isNumber=Fe,jt.isObject=ze,jt.isObjectLike=De,jt.isPlainObject=Ne,jt.isRegExp=Pe,jt.isSafeInteger=function(t){return Me(t)&&t>=-9007199254740991&&9007199254740991>=t;
-},jt.isSet=function(t){return De(t)&&"[object Set]"==Fr(t)},jt.isString=Ze,jt.isSymbol=Te,jt.isTypedArray=qe,jt.isUndefined=function(t){return t===N},jt.isWeakMap=function(t){return De(t)&&"[object WeakMap]"==Fr(t)},jt.isWeakSet=function(t){return De(t)&&"[object WeakSet]"==ku.call(t)},jt.join=function(t,n){return t?qu.call(t,n):""},jt.kebabCase=Si,jt.last=ae,jt.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==N&&(u=Ke(r),u=(0>u?Ku(e+u,0):Gu(u,e-1))+1),n!==n)return B(t,u,true);
-for(;u--;)if(t[u]===n)return u;return-1},jt.lowerCase=Ri,jt.lowerFirst=Wi,jt.lt=hi,jt.lte=pi,jt.max=function(t){return t&&t.length?cn(t,au,gn):N},jt.maxBy=function(t,n){return t&&t.length?cn(t,Mr(n),gn):N},jt.mean=function(t){return y(t,au)},jt.meanBy=function(t,n){return y(t,Mr(n))},jt.min=function(t){return t&&t.length?cn(t,au,kn):N},jt.minBy=function(t,n){return t&&t.length?cn(t,Mr(n),kn):N},jt.multiply=Hi,jt.nth=function(t,n){return t&&t.length?Wn(t,Ke(n)):N},jt.noConflict=function(){return Vt._===this&&(Vt._=Eu),
-this},jt.noop=hu,jt.now=Xo,jt.pad=function(t,n,r){t=He(t);var e=(n=Ke(n))?D(t):0;return!n||e>=n?t:(n=(n-e)/2,Or(Pu(n),r)+t+Or(Nu(n),r))},jt.padEnd=function(t,n,r){t=He(t);var e=(n=Ke(n))?D(t):0;return n&&n>e?t+Or(n-e,r):t},jt.padStart=function(t,n,r){t=He(t);var e=(n=Ke(n))?D(t):0;return n&&n>e?Or(n-e,r)+t:t},jt.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n),t=He(t).replace(ot,""),Ju(t,n||(ht.test(t)?16:10))},jt.random=function(t,n,r){if(r&&typeof r!="boolean"&&Jr(t,n,r)&&(n=r=N),r===N&&(typeof n=="boolean"?(r=n,
-n=N):typeof t=="boolean"&&(r=t,t=N)),t===N&&n===N?(t=0,n=1):(t=Je(t)||0,n===N?(n=t,t=0):n=Je(n)||0),t>n){var e=t;t=n,n=e}return r||t%1||n%1?(r=Yu(),Gu(t+r*(n-t+Dt("1e-"+((r+"").length-1))),n)):$n(t,n)},jt.reduce=function(t,n,r){var e=li(t)?s:b,u=3>arguments.length;return e(t,Mr(n,4),r,u,yo)},jt.reduceRight=function(t,n,r){var e=li(t)?h:b,u=3>arguments.length;return e(t,Mr(n,4),r,u,bo)},jt.repeat=function(t,n,r){return n=(r?Jr(t,n,r):n===N)?1:Ke(n),Fn(He(t),n)},jt.replace=function(){var t=arguments,n=He(t[0]);
-return 3>t.length?n:Hu.call(n,t[1],t[2])},jt.result=function(t,n,r){n=Yr(n,t)?[n]:nr(n);var e=-1,u=n.length;for(u||(t=N,u=1);++e<u;){var o=null==t?N:t[ee(n[e])];o===N&&(e=u,o=r),t=Ce(o)?o.call(t):o}return t},jt.round=Qi,jt.runInContext=F,jt.sample=function(t){t=We(t)?t:uu(t);var n=t.length;return n>0?t[$n(0,n-1)]:N},jt.size=function(t){if(null==t)return 0;if(We(t)){var n=t.length;return n&&Ze(t)?D(t):n}return De(t)&&(n=Fr(t),"[object Map]"==n||"[object Set]"==n)?t.size:tu(t).length},jt.snakeCase=Bi,
-jt.some=function(t,n,r){var e=li(t)?p:Zn;return r&&Jr(t,n,r)&&(n=N),e(t,Mr(n,3))},jt.sortedIndex=function(t,n){return Tn(t,n)},jt.sortedIndexBy=function(t,n,r){return qn(t,n,Mr(r))},jt.sortedIndexOf=function(t,n){var r=t?t.length:0;if(r){var e=Tn(t,n);if(r>e&&Se(t[e],n))return e}return-1},jt.sortedLastIndex=function(t,n){return Tn(t,n,true)},jt.sortedLastIndexBy=function(t,n,r){return qn(t,n,Mr(r),true)},jt.sortedLastIndexOf=function(t,n){if(t&&t.length){var r=Tn(t,n,true)-1;if(Se(t[r],n))return r}return-1;
-},jt.startCase=Li,jt.startsWith=function(t,n,r){return t=He(t),r=tn(Ke(r),0,t.length),t.lastIndexOf(Gn(n),r)==r},jt.subtract=Xi,jt.sum=function(t){return t&&t.length?j(t,au):0},jt.sumBy=function(t,n){return t&&t.length?j(t,Mr(n)):0},jt.template=function(t,n,r){var e=jt.templateSettings;r&&Jr(t,n,r)&&(n=N),t=He(t),n=gi({},n,e,Gt),r=gi({},n.imports,e.imports,Gt);var u,o,i=tu(r),f=O(r,i),c=0;r=n.interpolate||bt;var a="__p+='";r=du((n.escape||bt).source+"|"+r.source+"|"+(r===X?lt:bt).source+"|"+(n.evaluate||bt).source+"|$","g");
-var l="sourceURL"in n?"//# sourceURL="+n.sourceURL+"\n":"";if(t.replace(r,function(n,r,e,i,f,l){return e||(e=i),a+=t.slice(c,l).replace(xt,W),r&&(u=true,a+="'+__e("+r+")+'"),f&&(o=true,a+="';"+f+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+n.length,n}),a+="';",(n=n.variable)||(a="with(obj){"+a+"}"),a=(o?a.replace(T,""):a).replace(q,"$1").replace(V,"$1;"),a="function("+(n||"obj")+"){"+(n?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",
-n=Ui(function(){return Function(i,l+"return "+a).apply(N,f)}),n.source=a,Le(n))throw n;return n},jt.times=function(t,n){if(t=Ke(t),1>t||t>9007199254740991)return[];var r=4294967295,e=Gu(t,4294967295);for(n=Mr(n),t-=4294967295,e=m(e,n);++r<t;)n(r);return e},jt.toInteger=Ke,jt.toLength=Ge,jt.toLower=function(t){return He(t).toLowerCase()},jt.toNumber=Je,jt.toSafeInteger=function(t){return tn(Ke(t),-9007199254740991,9007199254740991)},jt.toString=He,jt.toUpper=function(t){return He(t).toUpperCase()},
-jt.trim=function(t,n,r){return(t=He(t))&&(r||n===N)?t.replace(ot,""):t&&(n=Gn(n))?(t=t.match(kt),n=n.match(kt),rr(t,k(t,n),E(t,n)+1).join("")):t},jt.trimEnd=function(t,n,r){return(t=He(t))&&(r||n===N)?t.replace(ft,""):t&&(n=Gn(n))?(t=t.match(kt),n=E(t,n.match(kt))+1,rr(t,0,n).join("")):t},jt.trimStart=function(t,n,r){return(t=He(t))&&(r||n===N)?t.replace(it,""):t&&(n=Gn(n))?(t=t.match(kt),n=k(t,n.match(kt)),rr(t,n).join("")):t},jt.truncate=function(t,n){var r=30,e="...";if(ze(n))var u="separator"in n?n.separator:u,r="length"in n?Ke(n.length):r,e="omission"in n?Gn(n.omission):e;
-t=He(t);var o=t.length;if(It.test(t))var i=t.match(kt),o=i.length;if(r>=o)return t;if(o=r-D(e),1>o)return e;if(r=i?rr(i,0,o).join(""):t.slice(0,o),u===N)return r+e;if(i&&(o+=r.length-o),Pe(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=du(u.source,He(st.exec(u))+"g")),u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===N?o:c)}}else t.indexOf(Gn(u),o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},jt.unescape=function(t){return(t=He(t))&&J.test(t)?t.replace(K,$):t},jt.uniqueId=function(t){
-var n=++Au;return He(t)+n},jt.upperCase=Ci,jt.upperFirst=Mi,jt.each=de,jt.eachRight=ye,jt.first=ce,su(jt,function(){var t={};return sn(jt,function(n,r){wu.call(jt.prototype,r)||(t[r]=n)}),t}(),{chain:false}),jt.VERSION="4.11.2",u("bind bindKey curry curryRight partial partialRight".split(" "),function(t){jt[t].placeholder=jt}),u(["drop","take"],function(t,n){Lt.prototype[t]=function(r){var e=this.__filtered__;if(e&&!n)return new Lt(this);r=r===N?1:Ku(Ke(r),0);var u=this.clone();return e?u.__takeCount__=Gu(r,u.__takeCount__):u.__views__.push({
-size:Gu(r,4294967295),type:t+(0>u.__dir__?"Right":"")}),u},Lt.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),u(["filter","map","takeWhile"],function(t,n){var r=n+1,e=1==r||3==r;Lt.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:Mr(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");Lt.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right");
-Lt.prototype[t]=function(){return this.__filtered__?new Lt(this):this[r](1)}}),Lt.prototype.compact=function(){return this.filter(au)},Lt.prototype.find=function(t){return this.filter(t).head()},Lt.prototype.findLast=function(t){return this.reverse().find(t)},Lt.prototype.invokeMap=Ee(function(t,n){return typeof t=="function"?new Lt(this):this.map(function(r){return jn(r,t,n)})}),Lt.prototype.reject=function(t){return t=Mr(t,3),this.filter(function(n){return!t(n)})},Lt.prototype.slice=function(t,n){
-t=Ke(t);var r=this;return r.__filtered__&&(t>0||0>n)?new Lt(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==N&&(n=Ke(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},Lt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Lt.prototype.toArray=function(){return this.take(4294967295)},sn(Lt.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=jt[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(jt.prototype[n]=function(){
-function n(t){return t=u.apply(jt,l([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof Lt,a=f[0],s=c||li(i);s&&r&&typeof a=="function"&&1!=a.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&s?(i=c?i:new Lt(this),i=t.apply(i,f),i.__actions__.push({func:ve,args:[n],thisArg:N}),new wt(i,h)):a&&c?t.apply(this,f):(i=this.thru(n),a?e?i.value()[0]:i.value():i)})}),u("pop push shift sort splice unshift".split(" "),function(t){var n=bu[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);
-jt.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var u=this.value();return n.apply(li(u)?u:[],t)}return this[r](function(r){return n.apply(li(r)?r:[],t)})}}),sn(Lt.prototype,function(t,n){var r=jt[n];if(r){var e=r.name+"";(co[e]||(co[e]=[])).push({name:n,func:r})}}),co[jr(N,2).name]=[{name:"wrapper",func:N}],Lt.prototype.clone=function(){var t=new Lt(this.__wrapped__);return t.__actions__=cr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=cr(this.__iteratees__),
-t.__takeCount__=this.__takeCount__,t.__views__=cr(this.__views__),t},Lt.prototype.reverse=function(){if(this.__filtered__){var t=new Lt(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(),t.__dir__*=-1;return t},Lt.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=li(n),u=0>r,o=e?n.length:0;t=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++c<a;){var l=i[c],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":t-=s;break;case"take":t=Gu(t,f+s);break;case"takeRight":
-f=Ku(f,t-s)}}if(t={start:f,end:t},i=t.start,f=t.end,t=f-i,u=u?f:i-1,i=this.__iteratees__,f=i.length,c=0,a=Gu(t,this.__takeCount__),!e||200>o||o==t&&a==t)return Hn(n,this.__actions__);e=[];t:for(;t--&&a>c;){for(u+=r,o=-1,l=n[u];++o<f;){var h=i[o],s=h.type,h=(0,h.iteratee)(l);if(2==s)l=h;else if(!h){if(1==s)continue t;break t}}e[c++]=l}return e},jt.prototype.at=Vo,jt.prototype.chain=function(){return _e(this)},jt.prototype.commit=function(){return new wt(this.value(),this.__chain__)},jt.prototype.next=function(){
-this.__values__===N&&(this.__values__=Ve(this.value()));var t=this.__index__>=this.__values__.length,n=t?N:this.__values__[this.__index__++];return{done:t,value:n}},jt.prototype.plant=function(t){for(var n,r=this;r instanceof mt;){var e=oe(r);e.__index__=0,e.__values__=N,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},jt.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof Lt?(this.__actions__.length&&(t=new Lt(this)),t=t.reverse(),t.__actions__.push({func:ve,
-args:[se],thisArg:N}),new wt(t,this.__chain__)):this.thru(se)},jt.prototype.toJSON=jt.prototype.valueOf=jt.prototype.value=function(){return Hn(this.__wrapped__,this.__actions__)},Uu&&(jt.prototype[Uu]=ge),jt}var N,P=1/0,Z=NaN,T=/\b__p\+='';/g,q=/\b(__p\+=)''\+/g,V=/(__e\(.*?\)|\b__t\))\+'';/g,K=/&(?:amp|lt|gt|quot|#39|#96);/g,G=/[&<>"'`]/g,J=RegExp(K.source),Y=RegExp(G.source),H=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nt=/^\w*$/,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,et=/[\\^$.*+?()[\]{}|]/g,ut=RegExp(et.source),ot=/^\s+|\s+$/g,it=/^\s+/,ft=/\s+$/,ct=/[a-zA-Z0-9]+/g,at=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,st=/\w*$/,ht=/^0x/i,pt=/^[-+]0x[0-9a-f]+$/i,_t=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,dt=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,bt=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,jt="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",mt="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+jt,wt="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",At=RegExp("['\u2019]","g"),Ot=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),kt=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+wt+jt,"g"),Et=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d+",mt].join("|"),"g"),It=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),St=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rt="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Wt={};
-Wt["[object Float32Array]"]=Wt["[object Float64Array]"]=Wt["[object Int8Array]"]=Wt["[object Int16Array]"]=Wt["[object Int32Array]"]=Wt["[object Uint8Array]"]=Wt["[object Uint8ClampedArray]"]=Wt["[object Uint16Array]"]=Wt["[object Uint32Array]"]=true,Wt["[object Arguments]"]=Wt["[object Array]"]=Wt["[object ArrayBuffer]"]=Wt["[object Boolean]"]=Wt["[object DataView]"]=Wt["[object Date]"]=Wt["[object Error]"]=Wt["[object Function]"]=Wt["[object Map]"]=Wt["[object Number]"]=Wt["[object Object]"]=Wt["[object RegExp]"]=Wt["[object Set]"]=Wt["[object String]"]=Wt["[object WeakMap]"]=false;
-var Bt={};Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object DataView]"]=Bt["[object Boolean]"]=Bt["[object Date]"]=Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object Symbol]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=true,
-Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object WeakMap]"]=false;var Lt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O",
-"\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Ct={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},Mt={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},Ut={"function":true,object:true},zt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"
-},Dt=parseFloat,$t=parseInt,Ft=Ut[typeof exports]&&exports&&!exports.nodeType?exports:N,Nt=Ut[typeof module]&&module&&!module.nodeType?module:N,Pt=Nt&&Nt.exports===Ft?Ft:N,Zt=I(Ut[typeof self]&&self),Tt=I(Ut[typeof window]&&window),qt=I(Ut[typeof this]&&this),Vt=I(Ft&&Nt&&typeof global=="object"&&global)||Tt!==(qt&&qt.window)&&Tt||Zt||qt||Function("return this")(),Kt=F();(Tt||Zt||{})._=Kt,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Kt}):Ft&&Nt?(Pt&&((Nt.exports=Kt)._=Kt),
-Ft._=Kt):Vt._=Kt}).call(this);
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/mapping.fp.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/mapping.fp.js
deleted file mode 100644
index 8adef99..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/dist/mapping.fp.js
+++ /dev/null
@@ -1,352 +0,0 @@
-(function webpackUniversalModuleDefinition(root, factory) {
-	if(typeof exports === 'object' && typeof module === 'object')
-		module.exports = factory();
-	else if(typeof define === 'function' && define.amd)
-		define([], factory);
-	else if(typeof exports === 'object')
-		exports["mapping"] = factory();
-	else
-		root["mapping"] = factory();
-})(this, function() {
-return /******/ (function(modules) { // webpackBootstrap
-/******/ 	// The module cache
-/******/ 	var installedModules = {};
-
-/******/ 	// The require function
-/******/ 	function __webpack_require__(moduleId) {
-
-/******/ 		// Check if module is in cache
-/******/ 		if(installedModules[moduleId])
-/******/ 			return installedModules[moduleId].exports;
-
-/******/ 		// Create a new module (and put it into the cache)
-/******/ 		var module = installedModules[moduleId] = {
-/******/ 			exports: {},
-/******/ 			id: moduleId,
-/******/ 			loaded: false
-/******/ 		};
-
-/******/ 		// Execute the module function
-/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-
-/******/ 		// Flag the module as loaded
-/******/ 		module.loaded = true;
-
-/******/ 		// Return the exports of the module
-/******/ 		return module.exports;
-/******/ 	}
-
-
-/******/ 	// expose the modules object (__webpack_modules__)
-/******/ 	__webpack_require__.m = modules;
-
-/******/ 	// expose the module cache
-/******/ 	__webpack_require__.c = installedModules;
-
-/******/ 	// __webpack_public_path__
-/******/ 	__webpack_require__.p = "";
-
-/******/ 	// Load entry module and return exports
-/******/ 	return __webpack_require__(0);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ function(module, exports) {
-
-	/** Used to map aliases to their real names. */
-	exports.aliasToReal = {
-
-	  // Lodash aliases.
-	  'each': 'forEach',
-	  'eachRight': 'forEachRight',
-	  'entries': 'toPairs',
-	  'entriesIn': 'toPairsIn',
-	  'extend': 'assignIn',
-	  'extendWith': 'assignInWith',
-	  'first': 'head',
-
-	  // Ramda aliases.
-	  '__': 'placeholder',
-	  'all': 'every',
-	  'allPass': 'overEvery',
-	  'always': 'constant',
-	  'any': 'some',
-	  'anyPass': 'overSome',
-	  'apply': 'spread',
-	  'assoc': 'set',
-	  'assocPath': 'set',
-	  'complement': 'negate',
-	  'compose': 'flowRight',
-	  'contains': 'includes',
-	  'dissoc': 'unset',
-	  'dissocPath': 'unset',
-	  'equals': 'isEqual',
-	  'identical': 'eq',
-	  'init': 'initial',
-	  'invertObj': 'invert',
-	  'juxt': 'over',
-	  'omitAll': 'omit',
-	  'nAry': 'ary',
-	  'path': 'get',
-	  'pathEq': 'matchesProperty',
-	  'pathOr': 'getOr',
-	  'paths': 'at',
-	  'pickAll': 'pick',
-	  'pipe': 'flow',
-	  'pluck': 'map',
-	  'prop': 'get',
-	  'propEq': 'matchesProperty',
-	  'propOr': 'getOr',
-	  'props': 'at',
-	  'unapply': 'rest',
-	  'unnest': 'flatten',
-	  'useWith': 'overArgs',
-	  'whereEq': 'filter',
-	  'zipObj': 'zipObject'
-	};
-
-	/** Used to map ary to method names. */
-	exports.aryMethod = {
-	  '1': [
-	    'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
-	    'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
-	    'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
-	    'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
-	    'uniqueId', 'words'
-	  ],
-	  '2': [
-	    'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
-	    'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
-	    'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
-	    'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
-	    'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast',
-	    'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
-	    'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
-	    'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
-	    'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
-	    'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
-	    'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth',
-	    'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
-	    'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
-	    'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
-	    'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
-	    'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
-	    'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
-	    'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
-	    'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
-	    'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
-	    'zipObjectDeep'
-	  ],
-	  '3': [
-	    'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
-	    'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
-	    'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith',
-	    'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy',
-	    'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice',
-	    'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith',
-	    'update', 'xorBy', 'xorWith', 'zipWith'
-	  ],
-	  '4': [
-	    'fill', 'setWith', 'updateWith'
-	  ]
-	};
-
-	/** Used to map ary to rearg configs. */
-	exports.aryRearg = {
-	  '2': [1, 0],
-	  '3': [2, 0, 1],
-	  '4': [3, 2, 0, 1]
-	};
-
-	/** Used to map method names to their iteratee ary. */
-	exports.iterateeAry = {
-	  'dropRightWhile': 1,
-	  'dropWhile': 1,
-	  'every': 1,
-	  'filter': 1,
-	  'find': 1,
-	  'findIndex': 1,
-	  'findKey': 1,
-	  'findLast': 1,
-	  'findLastIndex': 1,
-	  'findLastKey': 1,
-	  'flatMap': 1,
-	  'flatMapDeep': 1,
-	  'flatMapDepth': 1,
-	  'forEach': 1,
-	  'forEachRight': 1,
-	  'forIn': 1,
-	  'forInRight': 1,
-	  'forOwn': 1,
-	  'forOwnRight': 1,
-	  'map': 1,
-	  'mapKeys': 1,
-	  'mapValues': 1,
-	  'partition': 1,
-	  'reduce': 2,
-	  'reduceRight': 2,
-	  'reject': 1,
-	  'remove': 1,
-	  'some': 1,
-	  'takeRightWhile': 1,
-	  'takeWhile': 1,
-	  'times': 1,
-	  'transform': 2
-	};
-
-	/** Used to map method names to iteratee rearg configs. */
-	exports.iterateeRearg = {
-	  'mapKeys': [1]
-	};
-
-	/** Used to map method names to rearg configs. */
-	exports.methodRearg = {
-	  'assignInWith': [1, 2, 0],
-	  'assignWith': [1, 2, 0],
-	  'getOr': [2, 1, 0],
-	  'isEqualWith': [1, 2, 0],
-	  'isMatchWith': [2, 1, 0],
-	  'mergeWith': [1, 2, 0],
-	  'padChars': [2, 1, 0],
-	  'padCharsEnd': [2, 1, 0],
-	  'padCharsStart': [2, 1, 0],
-	  'pullAllBy': [2, 1, 0],
-	  'pullAllWith': [2, 1, 0],
-	  'setWith': [3, 1, 2, 0],
-	  'sortedIndexBy': [2, 1, 0],
-	  'sortedLastIndexBy': [2, 1, 0],
-	  'updateWith': [3, 1, 2, 0],
-	  'zipWith': [1, 2, 0]
-	};
-
-	/** Used to map method names to spread configs. */
-	exports.methodSpread = {
-	  'invokeArgs': 2,
-	  'invokeArgsMap': 2,
-	  'partial': 1,
-	  'partialRight': 1,
-	  'without': 1
-	};
-
-	/** Used to identify methods which mutate arrays or objects. */
-	exports.mutate = {
-	  'array': {
-	    'fill': true,
-	    'pull': true,
-	    'pullAll': true,
-	    'pullAllBy': true,
-	    'pullAllWith': true,
-	    'pullAt': true,
-	    'remove': true,
-	    'reverse': true
-	  },
-	  'object': {
-	    'assign': true,
-	    'assignIn': true,
-	    'assignInWith': true,
-	    'assignWith': true,
-	    'defaults': true,
-	    'defaultsDeep': true,
-	    'merge': true,
-	    'mergeWith': true
-	  },
-	  'set': {
-	    'set': true,
-	    'setWith': true,
-	    'unset': true,
-	    'update': true,
-	    'updateWith': true
-	  }
-	};
-
-	/** Used to track methods with placeholder support */
-	exports.placeholder = {
-	  'bind': true,
-	  'bindKey': true,
-	  'curry': true,
-	  'curryRight': true,
-	  'partial': true,
-	  'partialRight': true
-	};
-
-	/** Used to map real names to their aliases. */
-	exports.realToAlias = (function() {
-	  var hasOwnProperty = Object.prototype.hasOwnProperty,
-	      object = exports.aliasToReal,
-	      result = {};
-
-	  for (var key in object) {
-	    var value = object[key];
-	    if (hasOwnProperty.call(result, value)) {
-	      result[value].push(key);
-	    } else {
-	      result[value] = [key];
-	    }
-	  }
-	  return result;
-	}());
-
-	/** Used to map method names to other names. */
-	exports.remap = {
-	  'curryN': 'curry',
-	  'curryRightN': 'curryRight',
-	  'getOr': 'get',
-	  'invokeArgs': 'invoke',
-	  'invokeArgsMap': 'invokeMap',
-	  'padChars': 'pad',
-	  'padCharsEnd': 'padEnd',
-	  'padCharsStart': 'padStart',
-	  'restFrom': 'rest',
-	  'spreadFrom': 'spread',
-	  'trimChars': 'trim',
-	  'trimCharsEnd': 'trimEnd',
-	  'trimCharsStart': 'trimStart'
-	};
-
-	/** Used to track methods that skip fixing their arity. */
-	exports.skipFixed = {
-	  'castArray': true,
-	  'flow': true,
-	  'flowRight': true,
-	  'iteratee': true,
-	  'mixin': true,
-	  'runInContext': true
-	};
-
-	/** Used to track methods that skip rearranging arguments. */
-	exports.skipRearg = {
-	  'add': true,
-	  'assign': true,
-	  'assignIn': true,
-	  'bind': true,
-	  'bindKey': true,
-	  'concat': true,
-	  'difference': true,
-	  'divide': true,
-	  'eq': true,
-	  'gt': true,
-	  'gte': true,
-	  'isEqual': true,
-	  'lt': true,
-	  'lte': true,
-	  'matchesProperty': true,
-	  'merge': true,
-	  'multiply': true,
-	  'overArgs': true,
-	  'partial': true,
-	  'partialRight': true,
-	  'random': true,
-	  'range': true,
-	  'rangeRight': true,
-	  'subtract': true,
-	  'without': true,
-	  'zip': true,
-	  'zipObject': true
-	};
-
-
-/***/ }
-/******/ ])
-});
-;
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/doc/README.md b/views/ngXosViews/serviceGrid/src/vendor/lodash/doc/README.md
deleted file mode 100644
index f9da2b3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/doc/README.md
+++ /dev/null
@@ -1,10738 +0,0 @@
-# <a href="https://lodash.com/">lodash</a> <span>v4.11.2</span>
-
-<!-- div class="toc-container" -->
-
-<!-- div -->
-
-## `Array`
-* <a href="#_chunkarray-size1">`_.chunk`</a>
-* <a href="#_compactarray">`_.compact`</a>
-* <a href="#_concatarray-values">`_.concat`</a>
-* <a href="#_differencearray-values">`_.difference`</a>
-* <a href="#_differencebyarray-values-iteratee_identity">`_.differenceBy`</a>
-* <a href="#_differencewitharray-values-comparator">`_.differenceWith`</a>
-* <a href="#_droparray-n1">`_.drop`</a>
-* <a href="#_droprightarray-n1">`_.dropRight`</a>
-* <a href="#_droprightwhilearray-predicate_identity">`_.dropRightWhile`</a>
-* <a href="#_dropwhilearray-predicate_identity">`_.dropWhile`</a>
-* <a href="#_fillarray-value-start0-endarraylength">`_.fill`</a>
-* <a href="#_findindexarray-predicate_identity">`_.findIndex`</a>
-* <a href="#_findlastindexarray-predicate_identity">`_.findLastIndex`</a>
-* <a href="#_headarray" class="alias">`_.first` -> `head`</a>
-* <a href="#_flattenarray">`_.flatten`</a>
-* <a href="#_flattendeeparray">`_.flattenDeep`</a>
-* <a href="#_flattendeptharray-depth1">`_.flattenDepth`</a>
-* <a href="#_frompairspairs">`_.fromPairs`</a>
-* <a href="#_headarray">`_.head`</a>
-* <a href="#_indexofarray-value-fromindex0">`_.indexOf`</a>
-* <a href="#_initialarray">`_.initial`</a>
-* <a href="#_intersectionarrays">`_.intersection`</a>
-* <a href="#_intersectionbyarrays-iteratee_identity">`_.intersectionBy`</a>
-* <a href="#_intersectionwitharrays-comparator">`_.intersectionWith`</a>
-* <a href="#_joinarray-separator-">`_.join`</a>
-* <a href="#_lastarray">`_.last`</a>
-* <a href="#_lastindexofarray-value-fromindexarraylength-1">`_.lastIndexOf`</a>
-* <a href="#_ntharray-n0">`_.nth`</a>
-* <a href="#_pullarray-values">`_.pull`</a>
-* <a href="#_pullallarray-values">`_.pullAll`</a>
-* <a href="#_pullallbyarray-values-iteratee_identity">`_.pullAllBy`</a>
-* <a href="#_pullallwitharray-values-comparator">`_.pullAllWith`</a>
-* <a href="#_pullatarray-indexes">`_.pullAt`</a>
-* <a href="#_removearray-predicate_identity">`_.remove`</a>
-* <a href="#_reversearray">`_.reverse`</a>
-* <a href="#_slicearray-start0-endarraylength">`_.slice`</a>
-* <a href="#_sortedindexarray-value">`_.sortedIndex`</a>
-* <a href="#_sortedindexbyarray-value-iteratee_identity">`_.sortedIndexBy`</a>
-* <a href="#_sortedindexofarray-value">`_.sortedIndexOf`</a>
-* <a href="#_sortedlastindexarray-value">`_.sortedLastIndex`</a>
-* <a href="#_sortedlastindexbyarray-value-iteratee_identity">`_.sortedLastIndexBy`</a>
-* <a href="#_sortedlastindexofarray-value">`_.sortedLastIndexOf`</a>
-* <a href="#_sorteduniqarray">`_.sortedUniq`</a>
-* <a href="#_sorteduniqbyarray-iteratee">`_.sortedUniqBy`</a>
-* <a href="#_tailarray">`_.tail`</a>
-* <a href="#_takearray-n1">`_.take`</a>
-* <a href="#_takerightarray-n1">`_.takeRight`</a>
-* <a href="#_takerightwhilearray-predicate_identity">`_.takeRightWhile`</a>
-* <a href="#_takewhilearray-predicate_identity">`_.takeWhile`</a>
-* <a href="#_unionarrays">`_.union`</a>
-* <a href="#_unionbyarrays-iteratee_identity">`_.unionBy`</a>
-* <a href="#_unionwitharrays-comparator">`_.unionWith`</a>
-* <a href="#_uniqarray">`_.uniq`</a>
-* <a href="#_uniqbyarray-iteratee_identity">`_.uniqBy`</a>
-* <a href="#_uniqwitharray-comparator">`_.uniqWith`</a>
-* <a href="#_unziparray">`_.unzip`</a>
-* <a href="#_unzipwitharray-iteratee_identity">`_.unzipWith`</a>
-* <a href="#_withoutarray-values">`_.without`</a>
-* <a href="#_xorarrays">`_.xor`</a>
-* <a href="#_xorbyarrays-iteratee_identity">`_.xorBy`</a>
-* <a href="#_xorwitharrays-comparator">`_.xorWith`</a>
-* <a href="#_ziparrays">`_.zip`</a>
-* <a href="#_zipobjectprops-values">`_.zipObject`</a>
-* <a href="#_zipobjectdeepprops-values">`_.zipObjectDeep`</a>
-* <a href="#_zipwitharrays-iteratee_identity">`_.zipWith`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Collection`
-* <a href="#_countbycollection-iteratee_identity">`_.countBy`</a>
-* <a href="#_foreachcollection-iteratee_identity" class="alias">`_.each` -> `forEach`</a>
-* <a href="#_foreachrightcollection-iteratee_identity" class="alias">`_.eachRight` -> `forEachRight`</a>
-* <a href="#_everycollection-predicate_identity">`_.every`</a>
-* <a href="#_filtercollection-predicate_identity">`_.filter`</a>
-* <a href="#_findcollection-predicate_identity">`_.find`</a>
-* <a href="#_findlastcollection-predicate_identity">`_.findLast`</a>
-* <a href="#_flatmapcollection-iteratee_identity">`_.flatMap`</a>
-* <a href="#_flatmapdeepcollection-iteratee_identity">`_.flatMapDeep`</a>
-* <a href="#_flatmapdepthcollection-iteratee_identity-depth1">`_.flatMapDepth`</a>
-* <a href="#_foreachcollection-iteratee_identity">`_.forEach`</a>
-* <a href="#_foreachrightcollection-iteratee_identity">`_.forEachRight`</a>
-* <a href="#_groupbycollection-iteratee_identity">`_.groupBy`</a>
-* <a href="#_includescollection-value-fromindex0">`_.includes`</a>
-* <a href="#_invokemapcollection-path-args">`_.invokeMap`</a>
-* <a href="#_keybycollection-iteratee_identity">`_.keyBy`</a>
-* <a href="#_mapcollection-iteratee_identity">`_.map`</a>
-* <a href="#_orderbycollection-iteratees_identity-orders">`_.orderBy`</a>
-* <a href="#_partitioncollection-predicate_identity">`_.partition`</a>
-* <a href="#_reducecollection-iteratee_identity-accumulator">`_.reduce`</a>
-* <a href="#_reducerightcollection-iteratee_identity-accumulator">`_.reduceRight`</a>
-* <a href="#_rejectcollection-predicate_identity">`_.reject`</a>
-* <a href="#_samplecollection">`_.sample`</a>
-* <a href="#_samplesizecollection-n1">`_.sampleSize`</a>
-* <a href="#_shufflecollection">`_.shuffle`</a>
-* <a href="#_sizecollection">`_.size`</a>
-* <a href="#_somecollection-predicate_identity">`_.some`</a>
-* <a href="#_sortbycollection-iteratees_identity">`_.sortBy`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Date`
-* <a href="#_now">`_.now`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Function`
-* <a href="#_aftern-func">`_.after`</a>
-* <a href="#_aryfunc-nfunclength">`_.ary`</a>
-* <a href="#_beforen-func">`_.before`</a>
-* <a href="#_bindfunc-thisarg-partials">`_.bind`</a>
-* <a href="#_bindkeyobject-key-partials">`_.bindKey`</a>
-* <a href="#_curryfunc-arityfunclength">`_.curry`</a>
-* <a href="#_curryrightfunc-arityfunclength">`_.curryRight`</a>
-* <a href="#_debouncefunc-wait0-options-optionsleadingfalse-optionsmaxwait-optionstrailingtrue">`_.debounce`</a>
-* <a href="#_deferfunc-args">`_.defer`</a>
-* <a href="#_delayfunc-wait-args">`_.delay`</a>
-* <a href="#_flipfunc">`_.flip`</a>
-* <a href="#_memoizefunc-resolver">`_.memoize`</a>
-* <a href="#_negatepredicate">`_.negate`</a>
-* <a href="#_oncefunc">`_.once`</a>
-* <a href="#_overargsfunc">`_.overArgs`</a>
-* <a href="#_partialfunc-partials">`_.partial`</a>
-* <a href="#_partialrightfunc-partials">`_.partialRight`</a>
-* <a href="#_reargfunc-indexes">`_.rearg`</a>
-* <a href="#_restfunc-startfunclength-1">`_.rest`</a>
-* <a href="#_spreadfunc-start0">`_.spread`</a>
-* <a href="#_throttlefunc-wait0-options-optionsleadingtrue-optionstrailingtrue">`_.throttle`</a>
-* <a href="#_unaryfunc">`_.unary`</a>
-* <a href="#_wrapvalue-wrapperidentity">`_.wrap`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Lang`
-* <a href="#_castarrayvalue">`_.castArray`</a>
-* <a href="#_clonevalue">`_.clone`</a>
-* <a href="#_clonedeepvalue">`_.cloneDeep`</a>
-* <a href="#_clonedeepwithvalue-customizer">`_.cloneDeepWith`</a>
-* <a href="#_clonewithvalue-customizer">`_.cloneWith`</a>
-* <a href="#_eqvalue-other">`_.eq`</a>
-* <a href="#_gtvalue-other">`_.gt`</a>
-* <a href="#_gtevalue-other">`_.gte`</a>
-* <a href="#_isargumentsvalue">`_.isArguments`</a>
-* <a href="#_isarrayvalue">`_.isArray`</a>
-* <a href="#_isarraybuffervalue">`_.isArrayBuffer`</a>
-* <a href="#_isarraylikevalue">`_.isArrayLike`</a>
-* <a href="#_isarraylikeobjectvalue">`_.isArrayLikeObject`</a>
-* <a href="#_isbooleanvalue">`_.isBoolean`</a>
-* <a href="#_isbuffervalue">`_.isBuffer`</a>
-* <a href="#_isdatevalue">`_.isDate`</a>
-* <a href="#_iselementvalue">`_.isElement`</a>
-* <a href="#_isemptyvalue">`_.isEmpty`</a>
-* <a href="#_isequalvalue-other">`_.isEqual`</a>
-* <a href="#_isequalwithvalue-other-customizer">`_.isEqualWith`</a>
-* <a href="#_iserrorvalue">`_.isError`</a>
-* <a href="#_isfinitevalue">`_.isFinite`</a>
-* <a href="#_isfunctionvalue">`_.isFunction`</a>
-* <a href="#_isintegervalue">`_.isInteger`</a>
-* <a href="#_islengthvalue">`_.isLength`</a>
-* <a href="#_ismapvalue">`_.isMap`</a>
-* <a href="#_ismatchobject-source">`_.isMatch`</a>
-* <a href="#_ismatchwithobject-source-customizer">`_.isMatchWith`</a>
-* <a href="#_isnanvalue">`_.isNaN`</a>
-* <a href="#_isnativevalue">`_.isNative`</a>
-* <a href="#_isnilvalue">`_.isNil`</a>
-* <a href="#_isnullvalue">`_.isNull`</a>
-* <a href="#_isnumbervalue">`_.isNumber`</a>
-* <a href="#_isobjectvalue">`_.isObject`</a>
-* <a href="#_isobjectlikevalue">`_.isObjectLike`</a>
-* <a href="#_isplainobjectvalue">`_.isPlainObject`</a>
-* <a href="#_isregexpvalue">`_.isRegExp`</a>
-* <a href="#_issafeintegervalue">`_.isSafeInteger`</a>
-* <a href="#_issetvalue">`_.isSet`</a>
-* <a href="#_isstringvalue">`_.isString`</a>
-* <a href="#_issymbolvalue">`_.isSymbol`</a>
-* <a href="#_istypedarrayvalue">`_.isTypedArray`</a>
-* <a href="#_isundefinedvalue">`_.isUndefined`</a>
-* <a href="#_isweakmapvalue">`_.isWeakMap`</a>
-* <a href="#_isweaksetvalue">`_.isWeakSet`</a>
-* <a href="#_ltvalue-other">`_.lt`</a>
-* <a href="#_ltevalue-other">`_.lte`</a>
-* <a href="#_toarrayvalue">`_.toArray`</a>
-* <a href="#_tointegervalue">`_.toInteger`</a>
-* <a href="#_tolengthvalue">`_.toLength`</a>
-* <a href="#_tonumbervalue">`_.toNumber`</a>
-* <a href="#_toplainobjectvalue">`_.toPlainObject`</a>
-* <a href="#_tosafeintegervalue">`_.toSafeInteger`</a>
-* <a href="#_tostringvalue">`_.toString`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Math`
-* <a href="#_addaugend-addend">`_.add`</a>
-* <a href="#_ceilnumber-precision0">`_.ceil`</a>
-* <a href="#_dividedividend-divisor">`_.divide`</a>
-* <a href="#_floornumber-precision0">`_.floor`</a>
-* <a href="#_maxarray">`_.max`</a>
-* <a href="#_maxbyarray-iteratee_identity">`_.maxBy`</a>
-* <a href="#_meanarray">`_.mean`</a>
-* <a href="#_meanbyarray-iteratee_identity">`_.meanBy`</a>
-* <a href="#_minarray">`_.min`</a>
-* <a href="#_minbyarray-iteratee_identity">`_.minBy`</a>
-* <a href="#_multiplymultiplier-multiplicand">`_.multiply`</a>
-* <a href="#_roundnumber-precision0">`_.round`</a>
-* <a href="#_subtractminuend-subtrahend">`_.subtract`</a>
-* <a href="#_sumarray">`_.sum`</a>
-* <a href="#_sumbyarray-iteratee_identity">`_.sumBy`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Number`
-* <a href="#_clampnumber-lower-upper">`_.clamp`</a>
-* <a href="#_inrangenumber-start0-end">`_.inRange`</a>
-* <a href="#_randomlower0-upper1-floating">`_.random`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Object`
-* <a href="#_assignobject-sources">`_.assign`</a>
-* <a href="#_assigninobject-sources">`_.assignIn`</a>
-* <a href="#_assigninwithobject-sources-customizer">`_.assignInWith`</a>
-* <a href="#_assignwithobject-sources-customizer">`_.assignWith`</a>
-* <a href="#_atobject-paths">`_.at`</a>
-* <a href="#_createprototype-properties">`_.create`</a>
-* <a href="#_defaultsobject-sources">`_.defaults`</a>
-* <a href="#_defaultsdeepobject-sources">`_.defaultsDeep`</a>
-* <a href="#_topairsobject" class="alias">`_.entries` -> `toPairs`</a>
-* <a href="#_topairsinobject" class="alias">`_.entriesIn` -> `toPairsIn`</a>
-* <a href="#_assigninobject-sources" class="alias">`_.extend` -> `assignIn`</a>
-* <a href="#_assigninwithobject-sources-customizer" class="alias">`_.extendWith` -> `assignInWith`</a>
-* <a href="#_findkeyobject-predicate_identity">`_.findKey`</a>
-* <a href="#_findlastkeyobject-predicate_identity">`_.findLastKey`</a>
-* <a href="#_forinobject-iteratee_identity">`_.forIn`</a>
-* <a href="#_forinrightobject-iteratee_identity">`_.forInRight`</a>
-* <a href="#_forownobject-iteratee_identity">`_.forOwn`</a>
-* <a href="#_forownrightobject-iteratee_identity">`_.forOwnRight`</a>
-* <a href="#_functionsobject">`_.functions`</a>
-* <a href="#_functionsinobject">`_.functionsIn`</a>
-* <a href="#_getobject-path-defaultvalue">`_.get`</a>
-* <a href="#_hasobject-path">`_.has`</a>
-* <a href="#_hasinobject-path">`_.hasIn`</a>
-* <a href="#_invertobject">`_.invert`</a>
-* <a href="#_invertbyobject-iteratee_identity">`_.invertBy`</a>
-* <a href="#_invokeobject-path-args">`_.invoke`</a>
-* <a href="#_keysobject">`_.keys`</a>
-* <a href="#_keysinobject">`_.keysIn`</a>
-* <a href="#_mapkeysobject-iteratee_identity">`_.mapKeys`</a>
-* <a href="#_mapvaluesobject-iteratee_identity">`_.mapValues`</a>
-* <a href="#_mergeobject-sources">`_.merge`</a>
-* <a href="#_mergewithobject-sources-customizer">`_.mergeWith`</a>
-* <a href="#_omitobject-props">`_.omit`</a>
-* <a href="#_omitbyobject-predicate_identity">`_.omitBy`</a>
-* <a href="#_pickobject-props">`_.pick`</a>
-* <a href="#_pickbyobject-predicate_identity">`_.pickBy`</a>
-* <a href="#_resultobject-path-defaultvalue">`_.result`</a>
-* <a href="#_setobject-path-value">`_.set`</a>
-* <a href="#_setwithobject-path-value-customizer">`_.setWith`</a>
-* <a href="#_topairsobject">`_.toPairs`</a>
-* <a href="#_topairsinobject">`_.toPairsIn`</a>
-* <a href="#_transformobject-iteratee_identity-accumulator">`_.transform`</a>
-* <a href="#_unsetobject-path">`_.unset`</a>
-* <a href="#_updateobject-path-updater">`_.update`</a>
-* <a href="#_updatewithobject-path-updater-customizer">`_.updateWith`</a>
-* <a href="#_valuesobject">`_.values`</a>
-* <a href="#_valuesinobject">`_.valuesIn`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Seq`
-* <a href="#_value">`_`</a>
-* <a href="#_chainvalue">`_.chain`</a>
-* <a href="#_tapvalue-interceptor">`_.tap`</a>
-* <a href="#_thruvalue-interceptor">`_.thru`</a>
-* <a href="#_prototypesymboliterator">`_.prototype[Symbol.iterator]`</a>
-* <a href="#_prototypeatpaths">`_.prototype.at`</a>
-* <a href="#_prototypechain">`_.prototype.chain`</a>
-* <a href="#_prototypecommit">`_.prototype.commit`</a>
-* <a href="#_prototypenext">`_.prototype.next`</a>
-* <a href="#_prototypeplantvalue">`_.prototype.plant`</a>
-* <a href="#_prototypereverse">`_.prototype.reverse`</a>
-* <a href="#_prototypevalue" class="alias">`_.prototype.toJSON` -> `value`</a>
-* <a href="#_prototypevalue">`_.prototype.value`</a>
-* <a href="#_prototypevalue" class="alias">`_.prototype.valueOf` -> `value`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `String`
-* <a href="#_camelcasestring">`_.camelCase`</a>
-* <a href="#_capitalizestring">`_.capitalize`</a>
-* <a href="#_deburrstring">`_.deburr`</a>
-* <a href="#_endswithstring-target-positionstringlength">`_.endsWith`</a>
-* <a href="#_escapestring">`_.escape`</a>
-* <a href="#_escaperegexpstring">`_.escapeRegExp`</a>
-* <a href="#_kebabcasestring">`_.kebabCase`</a>
-* <a href="#_lowercasestring">`_.lowerCase`</a>
-* <a href="#_lowerfirststring">`_.lowerFirst`</a>
-* <a href="#_padstring-length0-chars">`_.pad`</a>
-* <a href="#_padendstring-length0-chars">`_.padEnd`</a>
-* <a href="#_padstartstring-length0-chars">`_.padStart`</a>
-* <a href="#_parseintstring-radix10">`_.parseInt`</a>
-* <a href="#_repeatstring-n1">`_.repeat`</a>
-* <a href="#_replacestring-pattern-replacement">`_.replace`</a>
-* <a href="#_snakecasestring">`_.snakeCase`</a>
-* <a href="#_splitstring-separator-limit">`_.split`</a>
-* <a href="#_startcasestring">`_.startCase`</a>
-* <a href="#_startswithstring-target-position0">`_.startsWith`</a>
-* <a href="#_templatestring-options-optionsescape_templatesettingsescape-optionsevaluate_templatesettingsevaluate-optionsimports_templatesettingsimports-optionsinterpolate_templatesettingsinterpolate-optionssourceurllodashtemplatesourcesn-optionsvariableobj">`_.template`</a>
-* <a href="#_tolowerstring">`_.toLower`</a>
-* <a href="#_toupperstring">`_.toUpper`</a>
-* <a href="#_trimstring-charswhitespace">`_.trim`</a>
-* <a href="#_trimendstring-charswhitespace">`_.trimEnd`</a>
-* <a href="#_trimstartstring-charswhitespace">`_.trimStart`</a>
-* <a href="#_truncatestring-options-optionslength30-optionsomission-optionsseparator">`_.truncate`</a>
-* <a href="#_unescapestring">`_.unescape`</a>
-* <a href="#_uppercasestring">`_.upperCase`</a>
-* <a href="#_upperfirststring">`_.upperFirst`</a>
-* <a href="#_wordsstring-pattern">`_.words`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Util`
-* <a href="#_attemptfunc-args">`_.attempt`</a>
-* <a href="#_bindallobject-methodnames">`_.bindAll`</a>
-* <a href="#_condpairs">`_.cond`</a>
-* <a href="#_conformssource">`_.conforms`</a>
-* <a href="#_constantvalue">`_.constant`</a>
-* <a href="#_flowfuncs">`_.flow`</a>
-* <a href="#_flowrightfuncs">`_.flowRight`</a>
-* <a href="#_identityvalue">`_.identity`</a>
-* <a href="#_iterateefunc_identity">`_.iteratee`</a>
-* <a href="#_matchessource">`_.matches`</a>
-* <a href="#_matchespropertypath-srcvalue">`_.matchesProperty`</a>
-* <a href="#_methodpath-args">`_.method`</a>
-* <a href="#_methodofobject-args">`_.methodOf`</a>
-* <a href="#_mixinobjectlodash-source-options-optionschaintrue">`_.mixin`</a>
-* <a href="#_noconflict">`_.noConflict`</a>
-* <a href="#_noop">`_.noop`</a>
-* <a href="#_nthargn0">`_.nthArg`</a>
-* <a href="#_overiteratees_identity">`_.over`</a>
-* <a href="#_overeverypredicates_identity">`_.overEvery`</a>
-* <a href="#_oversomepredicates_identity">`_.overSome`</a>
-* <a href="#_propertypath">`_.property`</a>
-* <a href="#_propertyofobject">`_.propertyOf`</a>
-* <a href="#_rangestart0-end-step1">`_.range`</a>
-* <a href="#_rangerightstart0-end-step1">`_.rangeRight`</a>
-* <a href="#_runincontextcontextroot">`_.runInContext`</a>
-* <a href="#_timesn-iteratee_identity">`_.times`</a>
-* <a href="#_topathvalue">`_.toPath`</a>
-* <a href="#_uniqueidprefix">`_.uniqueId`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Properties`
-* <a href="#_version">`_.VERSION`</a>
-* <a href="#_templatesettings">`_.templateSettings`</a>
-* <a href="#_templatesettingsescape">`_.templateSettings.escape`</a>
-* <a href="#_templatesettingsevaluate">`_.templateSettings.evaluate`</a>
-* <a href="#_templatesettingsimports">`_.templateSettings.imports`</a>
-* <a href="#_templatesettingsinterpolate">`_.templateSettings.interpolate`</a>
-* <a href="#_templatesettingsvariable">`_.templateSettings.variable`</a>
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Methods`
-* <a href="#_templatesettingsimports_">`_.templateSettings.imports._`</a>
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div class="doc-container" -->
-
-<!-- div -->
-
-## `“Array” Methods`
-
-<!-- div -->
-
-### <a id="_chunkarray-size1"></a>`_.chunk(array, [size=1])`
-<a href="#_chunkarray-size1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L5982 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.chunk "See the npm package")
-
-Creates an array of elements split into groups the length of `size`.
-If `array` can't be split evenly, the final chunk will be the remaining
-elements.
-
-#### Since
-3.0.0
-#### Arguments
-1. `array` *(Array)*: The array to process.
-2. `[size=1]` *(number)*: The length of each chunk
-
-#### Returns
-*(Array)*: Returns the new array containing chunks.
-
-#### Example
-```js
-_.chunk(['a', 'b', 'c', 'd'], 2);
-// => [['a', 'b'], ['c', 'd']]
-
-_.chunk(['a', 'b', 'c', 'd'], 3);
-// => [['a', 'b', 'c'], ['d']]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_compactarray"></a>`_.compact(array)`
-<a href="#_compactarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6017 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.compact "See the npm package")
-
-Creates an array with all falsey values removed. The values `false`, `null`,
-`0`, `""`, `undefined`, and `NaN` are falsey.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to compact.
-
-#### Returns
-*(Array)*: Returns the new array of filtered values.
-
-#### Example
-```js
-_.compact([0, 1, false, 2, '', 3]);
-// => [1, 2, 3]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_concatarray-values"></a>`_.concat(array, [values])`
-<a href="#_concatarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6054 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.concat "See the npm package")
-
-Creates a new array concatenating `array` with any additional arrays
-and/or values.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to concatenate.
-2. `[values]` *(...&#42;)*: The values to concatenate.
-
-#### Returns
-*(Array)*: Returns the new concatenated array.
-
-#### Example
-```js
-var array = [1];
-var other = _.concat(array, 2, [3], [[4]]);
-
-console.log(other);
-// => [1, 2, 3, [4]]
-
-console.log(array);
-// => [1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_differencearray-values"></a>`_.difference(array, [values])`
-<a href="#_differencearray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6087 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.difference "See the npm package")
-
-Creates an array of unique `array` values not included in the other given
-arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-for equality comparisons. The order of result values is determined by the
-order they occur in the first array.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to inspect.
-2. `[values]` *(...Array)*: The values to exclude.
-
-#### Returns
-*(Array)*: Returns the new array of filtered values.
-
-#### Example
-```js
-_.difference([3, 2, 1], [4, 2]);
-// => [3, 1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_differencebyarray-values-iteratee_identity"></a>`_.differenceBy(array, [values], [iteratee=_.identity])`
-<a href="#_differencebyarray-values-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6117 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.differenceby "See the npm package")
-
-This method is like `_.difference` except that it accepts `iteratee` which
-is invoked for each element of `array` and `values` to generate the criterion
-by which they're compared. Result values are chosen from the first array.
-The iteratee is invoked with one argument: *(value)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to inspect.
-2. `[values]` *(...Array)*: The values to exclude.
-3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(Array)*: Returns the new array of filtered values.
-
-#### Example
-```js
-_.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);
-// => [3.1, 1.3]
-
-// The `_.property` iteratee shorthand.
-_.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
-// => [{ 'x': 2 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_differencewitharray-values-comparator"></a>`_.differenceWith(array, [values], [comparator])`
-<a href="#_differencewitharray-values-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6148 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.differencewith "See the npm package")
-
-This method is like `_.difference` except that it accepts `comparator`
-which is invoked to compare elements of `array` to `values`. Result values
-are chosen from the first array. The comparator is invoked with two arguments:<br>
-*(arrVal, othVal)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to inspect.
-2. `[values]` *(...Array)*: The values to exclude.
-3. `[comparator]` *(Function)*: The comparator invoked per element.
-
-#### Returns
-*(Array)*: Returns the new array of filtered values.
-
-#### Example
-```js
-var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-
-_.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
-// => [{ 'x': 2, 'y': 1 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_droparray-n1"></a>`_.drop(array, [n=1])`
-<a href="#_droparray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6183 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.drop "See the npm package")
-
-Creates a slice of `array` with `n` elements dropped from the beginning.
-
-#### Since
-0.5.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-2. `[n=1]` *(number)*: The number of elements to drop.
-
-#### Returns
-*(Array)*: Returns the slice of `array`.
-
-#### Example
-```js
-_.drop([1, 2, 3]);
-// => [2, 3]
-
-_.drop([1, 2, 3], 2);
-// => [3]
-
-_.drop([1, 2, 3], 5);
-// => []
-
-_.drop([1, 2, 3], 0);
-// => [1, 2, 3]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_droprightarray-n1"></a>`_.dropRight(array, [n=1])`
-<a href="#_droprightarray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6217 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.dropright "See the npm package")
-
-Creates a slice of `array` with `n` elements dropped from the end.
-
-#### Since
-3.0.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-2. `[n=1]` *(number)*: The number of elements to drop.
-
-#### Returns
-*(Array)*: Returns the slice of `array`.
-
-#### Example
-```js
-_.dropRight([1, 2, 3]);
-// => [1, 2]
-
-_.dropRight([1, 2, 3], 2);
-// => [1]
-
-_.dropRight([1, 2, 3], 5);
-// => []
-
-_.dropRight([1, 2, 3], 0);
-// => [1, 2, 3]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_droprightwhilearray-predicate_identity"></a>`_.dropRightWhile(array, [predicate=_.identity])`
-<a href="#_droprightwhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6263 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package")
-
-Creates a slice of `array` excluding elements dropped from the end.
-Elements are dropped until `predicate` returns falsey. The predicate is
-invoked with three arguments: *(value, index, array)*.
-
-#### Since
-3.0.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the slice of `array`.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney',  'active': true },
-  { 'user': 'fred',    'active': false },
-  { 'user': 'pebbles', 'active': false }
-];
-
-_.dropRightWhile(users, function(o) { return !o.active; });
-// => objects for ['barney']
-
-// The `_.matches` iteratee shorthand.
-_.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
-// => objects for ['barney', 'fred']
-
-// The `_.matchesProperty` iteratee shorthand.
-_.dropRightWhile(users, ['active', false]);
-// => objects for ['barney']
-
-// The `_.property` iteratee shorthand.
-_.dropRightWhile(users, 'active');
-// => objects for ['barney', 'fred', 'pebbles']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_dropwhilearray-predicate_identity"></a>`_.dropWhile(array, [predicate=_.identity])`
-<a href="#_dropwhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6305 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.dropwhile "See the npm package")
-
-Creates a slice of `array` excluding elements dropped from the beginning.
-Elements are dropped until `predicate` returns falsey. The predicate is
-invoked with three arguments: *(value, index, array)*.
-
-#### Since
-3.0.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the slice of `array`.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney',  'active': false },
-  { 'user': 'fred',    'active': false },
-  { 'user': 'pebbles', 'active': true }
-];
-
-_.dropWhile(users, function(o) { return !o.active; });
-// => objects for ['pebbles']
-
-// The `_.matches` iteratee shorthand.
-_.dropWhile(users, { 'user': 'barney', 'active': false });
-// => objects for ['fred', 'pebbles']
-
-// The `_.matchesProperty` iteratee shorthand.
-_.dropWhile(users, ['active', false]);
-// => objects for ['pebbles']
-
-// The `_.property` iteratee shorthand.
-_.dropWhile(users, 'active');
-// => objects for ['barney', 'fred', 'pebbles']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_fillarray-value-start0-endarraylength"></a>`_.fill(array, value, [start=0], [end=array.length])`
-<a href="#_fillarray-value-start0-endarraylength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6340 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.fill "See the npm package")
-
-Fills elements of `array` with `value` from `start` up to, but not
-including, `end`.
-<br>
-<br>
-**Note:** This method mutates `array`.
-
-#### Since
-3.2.0
-#### Arguments
-1. `array` *(Array)*: The array to fill.
-2. `value` *(&#42;)*: The value to fill `array` with.
-3. `[start=0]` *(number)*: The start position.
-4. `[end=array.length]` *(number)*: The end position.
-
-#### Returns
-*(Array)*: Returns `array`.
-
-#### Example
-```js
-var array = [1, 2, 3];
-
-_.fill(array, 'a');
-console.log(array);
-// => ['a', 'a', 'a']
-
-_.fill(Array(3), 2);
-// => [2, 2, 2]
-
-_.fill([4, 6, 8, 10], '*', 1, 3);
-// => [4, '*', '*', 10]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_findindexarray-predicate_identity"></a>`_.findIndex(array, [predicate=_.identity])`
-<a href="#_findindexarray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6387 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findindex "See the npm package")
-
-This method is like `_.find` except that it returns the index of the first
-element `predicate` returns truthy for instead of the element itself.
-
-#### Since
-1.1.0
-#### Arguments
-1. `array` *(Array)*: The array to search.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(number)*: Returns the index of the found element, else `-1`.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney',  'active': false },
-  { 'user': 'fred',    'active': false },
-  { 'user': 'pebbles', 'active': true }
-];
-
-_.findIndex(users, function(o) { return o.user == 'barney'; });
-// => 0
-
-// The `_.matches` iteratee shorthand.
-_.findIndex(users, { 'user': 'fred', 'active': false });
-// => 1
-
-// The `_.matchesProperty` iteratee shorthand.
-_.findIndex(users, ['active', false]);
-// => 0
-
-// The `_.property` iteratee shorthand.
-_.findIndex(users, 'active');
-// => 2
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_findlastindexarray-predicate_identity"></a>`_.findLastIndex(array, [predicate=_.identity])`
-<a href="#_findlastindexarray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6428 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findlastindex "See the npm package")
-
-This method is like `_.findIndex` except that it iterates over elements
-of `collection` from right to left.
-
-#### Since
-2.0.0
-#### Arguments
-1. `array` *(Array)*: The array to search.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(number)*: Returns the index of the found element, else `-1`.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney',  'active': true },
-  { 'user': 'fred',    'active': false },
-  { 'user': 'pebbles', 'active': false }
-];
-
-_.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
-// => 2
-
-// The `_.matches` iteratee shorthand.
-_.findLastIndex(users, { 'user': 'barney', 'active': true });
-// => 0
-
-// The `_.matchesProperty` iteratee shorthand.
-_.findLastIndex(users, ['active', false]);
-// => 2
-
-// The `_.property` iteratee shorthand.
-_.findLastIndex(users, 'active');
-// => 0
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_flattenarray"></a>`_.flatten(array)`
-<a href="#_flattenarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6448 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flatten "See the npm package")
-
-Flattens `array` a single level deep.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to flatten.
-
-#### Returns
-*(Array)*: Returns the new flattened array.
-
-#### Example
-```js
-_.flatten([1, [2, [3, [4]], 5]]);
-// => [1, 2, [3, [4]], 5]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_flattendeeparray"></a>`_.flattenDeep(array)`
-<a href="#_flattendeeparray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6467 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flattendeep "See the npm package")
-
-Recursively flattens `array`.
-
-#### Since
-3.0.0
-#### Arguments
-1. `array` *(Array)*: The array to flatten.
-
-#### Returns
-*(Array)*: Returns the new flattened array.
-
-#### Example
-```js
-_.flattenDeep([1, [2, [3, [4]], 5]]);
-// => [1, 2, 3, 4, 5]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_flattendeptharray-depth1"></a>`_.flattenDepth(array, [depth=1])`
-<a href="#_flattendeptharray-depth1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6492 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flattendepth "See the npm package")
-
-Recursively flatten `array` up to `depth` times.
-
-#### Since
-4.4.0
-#### Arguments
-1. `array` *(Array)*: The array to flatten.
-2. `[depth=1]` *(number)*: The maximum recursion depth.
-
-#### Returns
-*(Array)*: Returns the new flattened array.
-
-#### Example
-```js
-var array = [1, [2, [3, [4]], 5]];
-
-_.flattenDepth(array, 1);
-// => [1, 2, [3, [4]], 5]
-
-_.flattenDepth(array, 2);
-// => [1, 2, 3, [4], 5]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_frompairspairs"></a>`_.fromPairs(pairs)`
-<a href="#_frompairspairs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6516 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.frompairs "See the npm package")
-
-The inverse of `_.toPairs`; this method returns an object composed
-from key-value `pairs`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `pairs` *(Array)*: The key-value pairs.
-
-#### Returns
-*(Object)*: Returns the new object.
-
-#### Example
-```js
-_.fromPairs([['fred', 30], ['barney', 40]]);
-// => { 'fred': 30, 'barney': 40 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_headarray"></a>`_.head(array)`
-<a href="#_headarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6546 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.head "See the npm package")
-
-Gets the first element of `array`.
-
-#### Since
-0.1.0
-#### Aliases
-*_.first*
-
-#### Arguments
-1. `array` *(Array)*: The array to query.
-
-#### Returns
-*(&#42;)*: Returns the first element of `array`.
-
-#### Example
-```js
-_.head([1, 2, 3]);
-// => 1
-
-_.head([]);
-// => undefined
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_indexofarray-value-fromindex0"></a>`_.indexOf(array, value, [fromIndex=0])`
-<a href="#_indexofarray-value-fromindex0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6573 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.indexof "See the npm package")
-
-Gets the index at which the first occurrence of `value` is found in `array`
-using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-for equality comparisons. If `fromIndex` is negative, it's used as the
-offset from the end of `array`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to search.
-2. `value` *(&#42;)*: The value to search for.
-3. `[fromIndex=0]` *(number)*: The index to search from.
-
-#### Returns
-*(number)*: Returns the index of the matched value, else `-1`.
-
-#### Example
-```js
-_.indexOf([1, 2, 1, 2], 2);
-// => 1
-
-// Search from the `fromIndex`.
-_.indexOf([1, 2, 1, 2], 2, 2);
-// => 3
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_initialarray"></a>`_.initial(array)`
-<a href="#_initialarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6599 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.initial "See the npm package")
-
-Gets all but the last element of `array`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-
-#### Returns
-*(Array)*: Returns the slice of `array`.
-
-#### Example
-```js
-_.initial([1, 2, 3]);
-// => [1, 2]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_intersectionarrays"></a>`_.intersection([arrays])`
-<a href="#_intersectionarrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6620 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.intersection "See the npm package")
-
-Creates an array of unique values that are included in all given arrays
-using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-for equality comparisons. The order of result values is determined by the
-order they occur in the first array.
-
-#### Since
-0.1.0
-#### Arguments
-1. `[arrays]` *(...Array)*: The arrays to inspect.
-
-#### Returns
-*(Array)*: Returns the new array of intersecting values.
-
-#### Example
-```js
-_.intersection([2, 1], [4, 2], [1, 2]);
-// => [2]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_intersectionbyarrays-iteratee_identity"></a>`_.intersectionBy([arrays], [iteratee=_.identity])`
-<a href="#_intersectionbyarrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6650 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.intersectionby "See the npm package")
-
-This method is like `_.intersection` except that it accepts `iteratee`
-which is invoked for each element of each `arrays` to generate the criterion
-by which they're compared. Result values are chosen from the first array.
-The iteratee is invoked with one argument: *(value)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[arrays]` *(...Array)*: The arrays to inspect.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(Array)*: Returns the new array of intersecting values.
-
-#### Example
-```js
-_.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-// => [2.1]
-
-// The `_.property` iteratee shorthand.
-_.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-// => [{ 'x': 1 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_intersectionwitharrays-comparator"></a>`_.intersectionWith([arrays], [comparator])`
-<a href="#_intersectionwitharrays-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6685 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package")
-
-This method is like `_.intersection` except that it accepts `comparator`
-which is invoked to compare elements of `arrays`. Result values are chosen
-from the first array. The comparator is invoked with two arguments:<br>
-*(arrVal, othVal)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[arrays]` *(...Array)*: The arrays to inspect.
-2. `[comparator]` *(Function)*: The comparator invoked per element.
-
-#### Returns
-*(Array)*: Returns the new array of intersecting values.
-
-#### Example
-```js
-var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
-
-_.intersectionWith(objects, others, _.isEqual);
-// => [{ 'x': 1, 'y': 2 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_joinarray-separator-"></a>`_.join(array, [separator=','])`
-<a href="#_joinarray-separator-">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6714 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.join "See the npm package")
-
-Converts all elements in `array` into a string separated by `separator`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to convert.
-2. `[separator=',']` *(string)*: The element separator.
-
-#### Returns
-*(string)*: Returns the joined string.
-
-#### Example
-```js
-_.join(['a', 'b', 'c'], '~');
-// => 'a~b~c'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_lastarray"></a>`_.last(array)`
-<a href="#_lastarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6732 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.last "See the npm package")
-
-Gets the last element of `array`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-
-#### Returns
-*(&#42;)*: Returns the last element of `array`.
-
-#### Example
-```js
-_.last([1, 2, 3]);
-// => 3
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_lastindexofarray-value-fromindexarraylength-1"></a>`_.lastIndexOf(array, value, [fromIndex=array.length-1])`
-<a href="#_lastindexofarray-value-fromindexarraylength-1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6758 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lastindexof "See the npm package")
-
-This method is like `_.indexOf` except that it iterates over elements of
-`array` from right to left.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to search.
-2. `value` *(&#42;)*: The value to search for.
-3. `[fromIndex=array.length-1]` *(number)*: The index to search from.
-
-#### Returns
-*(number)*: Returns the index of the matched value, else `-1`.
-
-#### Example
-```js
-_.lastIndexOf([1, 2, 1, 2], 2);
-// => 3
-
-// Search from the `fromIndex`.
-_.lastIndexOf([1, 2, 1, 2], 2, 2);
-// => 1
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_ntharray-n0"></a>`_.nth(array, [n=0])`
-<a href="#_ntharray-n0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6804 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.nth "See the npm package")
-
-Gets the nth element of `array`. If `n` is negative, the nth element
-from the end is returned.
-
-#### Since
-4.11.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-2. `[n=0]` *(number)*: The index of the element to return.
-
-#### Returns
-*(&#42;)*: Returns the nth element of `array`.
-
-#### Example
-```js
-var array = ['a', 'b', 'c', 'd'];
-
-_.nth(array, 1);
-// => 'b'
-
-_.nth(array, -2);
-// => 'c';
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_pullarray-values"></a>`_.pull(array, [values])`
-<a href="#_pullarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6831 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pull "See the npm package")
-
-Removes all given values from `array` using
-[`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-for equality comparisons.
-<br>
-<br>
-**Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
-to remove elements from an array by predicate.
-
-#### Since
-2.0.0
-#### Arguments
-1. `array` *(Array)*: The array to modify.
-2. `[values]` *(...&#42;)*: The values to remove.
-
-#### Returns
-*(Array)*: Returns `array`.
-
-#### Example
-```js
-var array = [1, 2, 3, 1, 2, 3];
-
-_.pull(array, 2, 3);
-console.log(array);
-// => [1, 1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_pullallarray-values"></a>`_.pullAll(array, values)`
-<a href="#_pullallarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6853 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pullall "See the npm package")
-
-This method is like `_.pull` except that it accepts an array of values to remove.
-<br>
-<br>
-**Note:** Unlike `_.difference`, this method mutates `array`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to modify.
-2. `values` *(Array)*: The values to remove.
-
-#### Returns
-*(Array)*: Returns `array`.
-
-#### Example
-```js
-var array = [1, 2, 3, 1, 2, 3];
-
-_.pullAll(array, [2, 3]);
-console.log(array);
-// => [1, 1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_pullallbyarray-values-iteratee_identity"></a>`_.pullAllBy(array, values, [iteratee=_.identity])`
-<a href="#_pullallbyarray-values-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6883 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pullallby "See the npm package")
-
-This method is like `_.pullAll` except that it accepts `iteratee` which is
-invoked for each element of `array` and `values` to generate the criterion
-by which they're compared. The iteratee is invoked with one argument: *(value)*.
-<br>
-<br>
-**Note:** Unlike `_.differenceBy`, this method mutates `array`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to modify.
-2. `values` *(Array)*: The values to remove.
-3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(Array)*: Returns `array`.
-
-#### Example
-```js
-var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
-
-_.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
-console.log(array);
-// => [{ 'x': 2 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_pullallwitharray-values-comparator"></a>`_.pullAllWith(array, values, [comparator])`
-<a href="#_pullallwitharray-values-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6912 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pullallwith "See the npm package")
-
-This method is like `_.pullAll` except that it accepts `comparator` which
-is invoked to compare elements of `array` to `values`. The comparator is
-invoked with two arguments: *(arrVal, othVal)*.
-<br>
-<br>
-**Note:** Unlike `_.differenceWith`, this method mutates `array`.
-
-#### Since
-4.6.0
-#### Arguments
-1. `array` *(Array)*: The array to modify.
-2. `values` *(Array)*: The values to remove.
-3. `[comparator]` *(Function)*: The comparator invoked per element.
-
-#### Returns
-*(Array)*: Returns `array`.
-
-#### Example
-```js
-var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
-
-_.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
-console.log(array);
-// => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_pullatarray-indexes"></a>`_.pullAt(array, [indexes])`
-<a href="#_pullatarray-indexes">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6942 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pullat "See the npm package")
-
-Removes elements from `array` corresponding to `indexes` and returns an
-array of removed elements.
-<br>
-<br>
-**Note:** Unlike `_.at`, this method mutates `array`.
-
-#### Since
-3.0.0
-#### Arguments
-1. `array` *(Array)*: The array to modify.
-2. `[indexes]` *(...(number|number&#91;&#93;))*: The indexes of elements to remove.
-
-#### Returns
-*(Array)*: Returns the new array of removed elements.
-
-#### Example
-```js
-var array = [5, 10, 15, 20];
-var evens = _.pullAt(array, 1, 3);
-
-console.log(array);
-// => [5, 15]
-
-console.log(evens);
-// => [10, 20]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_removearray-predicate_identity"></a>`_.remove(array, [predicate=_.identity])`
-<a href="#_removearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6984 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.remove "See the npm package")
-
-Removes all elements from `array` that `predicate` returns truthy for
-and returns an array of the removed elements. The predicate is invoked
-with three arguments: *(value, index, array)*.
-<br>
-<br>
-**Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
-to pull elements from an array by value.
-
-#### Since
-2.0.0
-#### Arguments
-1. `array` *(Array)*: The array to modify.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the new array of removed elements.
-
-#### Example
-```js
-var array = [1, 2, 3, 4];
-var evens = _.remove(array, function(n) {
-  return n % 2 == 0;
-});
-
-console.log(array);
-// => [1, 3]
-
-console.log(evens);
-// => [2, 4]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_reversearray"></a>`_.reverse(array)`
-<a href="#_reversearray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7028 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reverse "See the npm package")
-
-Reverses `array` so that the first element becomes the last, the second
-element becomes the second to last, and so on.
-<br>
-<br>
-**Note:** This method mutates `array` and is based on
-[`Array#reverse`](https://mdn.io/Array/reverse).
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to modify.
-
-#### Returns
-*(Array)*: Returns `array`.
-
-#### Example
-```js
-var array = [1, 2, 3];
-
-_.reverse(array);
-// => [3, 2, 1]
-
-console.log(array);
-// => [3, 2, 1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_slicearray-start0-endarraylength"></a>`_.slice(array, [start=0], [end=array.length])`
-<a href="#_slicearray-start0-endarraylength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7048 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.slice "See the npm package")
-
-Creates a slice of `array` from `start` up to, but not including, `end`.
-<br>
-<br>
-**Note:** This method is used instead of
-[`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
-returned.
-
-#### Since
-3.0.0
-#### Arguments
-1. `array` *(Array)*: The array to slice.
-2. `[start=0]` *(number)*: The start position.
-3. `[end=array.length]` *(number)*: The end position.
-
-#### Returns
-*(Array)*: Returns the slice of `array`.
-
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sortedindexarray-value"></a>`_.sortedIndex(array, value)`
-<a href="#_sortedindexarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7084 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedindex "See the npm package")
-
-Uses a binary search to determine the lowest index at which `value`
-should be inserted into `array` in order to maintain its sort order.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The sorted array to inspect.
-2. `value` *(&#42;)*: The value to evaluate.
-
-#### Returns
-*(number)*: Returns the index at which `value` should be inserted into `array`.
-
-#### Example
-```js
-_.sortedIndex([30, 50], 40);
-// => 1
-
-_.sortedIndex([4, 5], 4);
-// => 0
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sortedindexbyarray-value-iteratee_identity"></a>`_.sortedIndexBy(array, value, [iteratee=_.identity])`
-<a href="#_sortedindexbyarray-value-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7114 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package")
-
-This method is like `_.sortedIndex` except that it accepts `iteratee`
-which is invoked for `value` and each element of `array` to compute their
-sort ranking. The iteratee is invoked with one argument: *(value)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The sorted array to inspect.
-2. `value` *(&#42;)*: The value to evaluate.
-3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(number)*: Returns the index at which `value` should be inserted into `array`.
-
-#### Example
-```js
-var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
-
-_.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
-// => 1
-
-// The `_.property` iteratee shorthand.
-_.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
-// => 0
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sortedindexofarray-value"></a>`_.sortedIndexOf(array, value)`
-<a href="#_sortedindexofarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7134 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package")
-
-This method is like `_.indexOf` except that it performs a binary
-search on a sorted `array`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to search.
-2. `value` *(&#42;)*: The value to search for.
-
-#### Returns
-*(number)*: Returns the index of the matched value, else `-1`.
-
-#### Example
-```js
-_.sortedIndexOf([1, 1, 2, 2], 2);
-// => 2
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sortedlastindexarray-value"></a>`_.sortedLastIndex(array, value)`
-<a href="#_sortedlastindexarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7163 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package")
-
-This method is like `_.sortedIndex` except that it returns the highest
-index at which `value` should be inserted into `array` in order to
-maintain its sort order.
-
-#### Since
-3.0.0
-#### Arguments
-1. `array` *(Array)*: The sorted array to inspect.
-2. `value` *(&#42;)*: The value to evaluate.
-
-#### Returns
-*(number)*: Returns the index at which `value` should be inserted into `array`.
-
-#### Example
-```js
-_.sortedLastIndex([4, 5], 4);
-// => 1
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sortedlastindexbyarray-value-iteratee_identity"></a>`_.sortedLastIndexBy(array, value, [iteratee=_.identity])`
-<a href="#_sortedlastindexbyarray-value-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7188 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package")
-
-This method is like `_.sortedLastIndex` except that it accepts `iteratee`
-which is invoked for `value` and each element of `array` to compute their
-sort ranking. The iteratee is invoked with one argument: *(value)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The sorted array to inspect.
-2. `value` *(&#42;)*: The value to evaluate.
-3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(number)*: Returns the index at which `value` should be inserted into `array`.
-
-#### Example
-```js
-// The `_.property` iteratee shorthand.
-_.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
-// => 1
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sortedlastindexofarray-value"></a>`_.sortedLastIndexOf(array, value)`
-<a href="#_sortedlastindexofarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7208 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package")
-
-This method is like `_.lastIndexOf` except that it performs a binary
-search on a sorted `array`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to search.
-2. `value` *(&#42;)*: The value to search for.
-
-#### Returns
-*(number)*: Returns the index of the matched value, else `-1`.
-
-#### Example
-```js
-_.sortedLastIndexOf([1, 1, 2, 2], 2);
-// => 3
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sorteduniqarray"></a>`_.sortedUniq(array)`
-<a href="#_sorteduniqarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7234 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package")
-
-This method is like `_.uniq` except that it's designed and optimized
-for sorted arrays.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to inspect.
-
-#### Returns
-*(Array)*: Returns the new duplicate free array.
-
-#### Example
-```js
-_.sortedUniq([1, 1, 2]);
-// => [1, 2]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sorteduniqbyarray-iteratee"></a>`_.sortedUniqBy(array, [iteratee])`
-<a href="#_sorteduniqbyarray-iteratee">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7256 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package")
-
-This method is like `_.uniqBy` except that it's designed and optimized
-for sorted arrays.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to inspect.
-2. `[iteratee]` *(Function)*: The iteratee invoked per element.
-
-#### Returns
-*(Array)*: Returns the new duplicate free array.
-
-#### Example
-```js
-_.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
-// => [1.1, 2.3]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_tailarray"></a>`_.tail(array)`
-<a href="#_tailarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7276 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tail "See the npm package")
-
-Gets all but the first element of `array`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-
-#### Returns
-*(Array)*: Returns the slice of `array`.
-
-#### Example
-```js
-_.tail([1, 2, 3]);
-// => [2, 3]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_takearray-n1"></a>`_.take(array, [n=1])`
-<a href="#_takearray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7305 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.take "See the npm package")
-
-Creates a slice of `array` with `n` elements taken from the beginning.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-2. `[n=1]` *(number)*: The number of elements to take.
-
-#### Returns
-*(Array)*: Returns the slice of `array`.
-
-#### Example
-```js
-_.take([1, 2, 3]);
-// => [1]
-
-_.take([1, 2, 3], 2);
-// => [1, 2]
-
-_.take([1, 2, 3], 5);
-// => [1, 2, 3]
-
-_.take([1, 2, 3], 0);
-// => []
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_takerightarray-n1"></a>`_.takeRight(array, [n=1])`
-<a href="#_takerightarray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7338 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.takeright "See the npm package")
-
-Creates a slice of `array` with `n` elements taken from the end.
-
-#### Since
-3.0.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-2. `[n=1]` *(number)*: The number of elements to take.
-
-#### Returns
-*(Array)*: Returns the slice of `array`.
-
-#### Example
-```js
-_.takeRight([1, 2, 3]);
-// => [3]
-
-_.takeRight([1, 2, 3], 2);
-// => [2, 3]
-
-_.takeRight([1, 2, 3], 5);
-// => [1, 2, 3]
-
-_.takeRight([1, 2, 3], 0);
-// => []
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_takerightwhilearray-predicate_identity"></a>`_.takeRightWhile(array, [predicate=_.identity])`
-<a href="#_takerightwhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7384 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package")
-
-Creates a slice of `array` with elements taken from the end. Elements are
-taken until `predicate` returns falsey. The predicate is invoked with
-three arguments: *(value, index, array)*.
-
-#### Since
-3.0.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the slice of `array`.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney',  'active': true },
-  { 'user': 'fred',    'active': false },
-  { 'user': 'pebbles', 'active': false }
-];
-
-_.takeRightWhile(users, function(o) { return !o.active; });
-// => objects for ['fred', 'pebbles']
-
-// The `_.matches` iteratee shorthand.
-_.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
-// => objects for ['pebbles']
-
-// The `_.matchesProperty` iteratee shorthand.
-_.takeRightWhile(users, ['active', false]);
-// => objects for ['fred', 'pebbles']
-
-// The `_.property` iteratee shorthand.
-_.takeRightWhile(users, 'active');
-// => []
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_takewhilearray-predicate_identity"></a>`_.takeWhile(array, [predicate=_.identity])`
-<a href="#_takewhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7426 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.takewhile "See the npm package")
-
-Creates a slice of `array` with elements taken from the beginning. Elements
-are taken until `predicate` returns falsey. The predicate is invoked with
-three arguments: *(value, index, array)*.
-
-#### Since
-3.0.0
-#### Arguments
-1. `array` *(Array)*: The array to query.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the slice of `array`.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney',  'active': false },
-  { 'user': 'fred',    'active': false},
-  { 'user': 'pebbles', 'active': true }
-];
-
-_.takeWhile(users, function(o) { return !o.active; });
-// => objects for ['barney', 'fred']
-
-// The `_.matches` iteratee shorthand.
-_.takeWhile(users, { 'user': 'barney', 'active': false });
-// => objects for ['barney']
-
-// The `_.matchesProperty` iteratee shorthand.
-_.takeWhile(users, ['active', false]);
-// => objects for ['barney', 'fred']
-
-// The `_.property` iteratee shorthand.
-_.takeWhile(users, 'active');
-// => []
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_unionarrays"></a>`_.union([arrays])`
-<a href="#_unionarrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7448 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.union "See the npm package")
-
-Creates an array of unique values, in order, from all given arrays using
-[`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-for equality comparisons.
-
-#### Since
-0.1.0
-#### Arguments
-1. `[arrays]` *(...Array)*: The arrays to inspect.
-
-#### Returns
-*(Array)*: Returns the new array of combined values.
-
-#### Example
-```js
-_.union([2, 1], [4, 2], [1, 2]);
-// => [2, 1, 4]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_unionbyarrays-iteratee_identity"></a>`_.unionBy([arrays], [iteratee=_.identity])`
-<a href="#_unionbyarrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7475 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unionby "See the npm package")
-
-This method is like `_.union` except that it accepts `iteratee` which is
-invoked for each element of each `arrays` to generate the criterion by
-which uniqueness is computed. The iteratee is invoked with one argument:<br>
-*(value)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[arrays]` *(...Array)*: The arrays to inspect.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(Array)*: Returns the new array of combined values.
-
-#### Example
-```js
-_.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-// => [2.1, 1.2, 4.3]
-
-// The `_.property` iteratee shorthand.
-_.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-// => [{ 'x': 1 }, { 'x': 2 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_unionwitharrays-comparator"></a>`_.unionWith([arrays], [comparator])`
-<a href="#_unionwitharrays-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7503 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unionwith "See the npm package")
-
-This method is like `_.union` except that it accepts `comparator` which
-is invoked to compare elements of `arrays`. The comparator is invoked
-with two arguments: *(arrVal, othVal)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[arrays]` *(...Array)*: The arrays to inspect.
-2. `[comparator]` *(Function)*: The comparator invoked per element.
-
-#### Returns
-*(Array)*: Returns the new array of combined values.
-
-#### Example
-```js
-var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
-
-_.unionWith(objects, others, _.isEqual);
-// => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_uniqarray"></a>`_.uniq(array)`
-<a href="#_uniqarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7528 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniq "See the npm package")
-
-Creates a duplicate-free version of an array, using
-[`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-for equality comparisons, in which only the first occurrence of each
-element is kept.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to inspect.
-
-#### Returns
-*(Array)*: Returns the new duplicate free array.
-
-#### Example
-```js
-_.uniq([2, 1, 2]);
-// => [2, 1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_uniqbyarray-iteratee_identity"></a>`_.uniqBy(array, [iteratee=_.identity])`
-<a href="#_uniqbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7556 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniqby "See the npm package")
-
-This method is like `_.uniq` except that it accepts `iteratee` which is
-invoked for each element in `array` to generate the criterion by which
-uniqueness is computed. The iteratee is invoked with one argument: *(value)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to inspect.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(Array)*: Returns the new duplicate free array.
-
-#### Example
-```js
-_.uniqBy([2.1, 1.2, 2.3], Math.floor);
-// => [2.1, 1.2]
-
-// The `_.property` iteratee shorthand.
-_.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
-// => [{ 'x': 1 }, { 'x': 2 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_uniqwitharray-comparator"></a>`_.uniqWith(array, [comparator])`
-<a href="#_uniqwitharray-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7581 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniqwith "See the npm package")
-
-This method is like `_.uniq` except that it accepts `comparator` which
-is invoked to compare elements of `array`. The comparator is invoked with
-two arguments: *(arrVal, othVal)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to inspect.
-2. `[comparator]` *(Function)*: The comparator invoked per element.
-
-#### Returns
-*(Array)*: Returns the new duplicate free array.
-
-#### Example
-```js
-var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 },  { 'x': 1, 'y': 2 }];
-
-_.uniqWith(objects, _.isEqual);
-// => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_unziparray"></a>`_.unzip(array)`
-<a href="#_unziparray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7606 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unzip "See the npm package")
-
-This method is like `_.zip` except that it accepts an array of grouped
-elements and creates an array regrouping the elements to their pre-zip
-configuration.
-
-#### Since
-1.2.0
-#### Arguments
-1. `array` *(Array)*: The array of grouped elements to process.
-
-#### Returns
-*(Array)*: Returns the new array of regrouped elements.
-
-#### Example
-```js
-var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
-// => [['fred', 30, true], ['barney', 40, false]]
-
-_.unzip(zipped);
-// => [['fred', 'barney'], [30, 40], [true, false]]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_unzipwitharray-iteratee_identity"></a>`_.unzipWith(array, [iteratee=_.identity])`
-<a href="#_unzipwitharray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7643 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unzipwith "See the npm package")
-
-This method is like `_.unzip` except that it accepts `iteratee` to specify
-how regrouped values should be combined. The iteratee is invoked with the
-elements of each group: *(...group)*.
-
-#### Since
-3.8.0
-#### Arguments
-1. `array` *(Array)*: The array of grouped elements to process.
-2. `[iteratee=_.identity]` *(Function)*: The function to combine regrouped values.
-
-#### Returns
-*(Array)*: Returns the new array of regrouped elements.
-
-#### Example
-```js
-var zipped = _.zip([1, 2], [10, 20], [100, 200]);
-// => [[1, 10, 100], [2, 20, 200]]
-
-_.unzipWith(zipped, _.add);
-// => [3, 30, 300]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_withoutarray-values"></a>`_.without(array, [values])`
-<a href="#_withoutarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7674 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.without "See the npm package")
-
-Creates an array excluding all given values using
-[`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-for equality comparisons.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to filter.
-2. `[values]` *(...&#42;)*: The values to exclude.
-
-#### Returns
-*(Array)*: Returns the new array of filtered values.
-
-#### Example
-```js
-_.without([1, 2, 1, 3], 1, 2);
-// => [3]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_xorarrays"></a>`_.xor([arrays])`
-<a href="#_xorarrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7698 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.xor "See the npm package")
-
-Creates an array of unique values that is the
-[symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
-of the given arrays. The order of result values is determined by the order
-they occur in the arrays.
-
-#### Since
-2.4.0
-#### Arguments
-1. `[arrays]` *(...Array)*: The arrays to inspect.
-
-#### Returns
-*(Array)*: Returns the new array of values.
-
-#### Example
-```js
-_.xor([2, 1], [4, 2]);
-// => [1, 4]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_xorbyarrays-iteratee_identity"></a>`_.xorBy([arrays], [iteratee=_.identity])`
-<a href="#_xorbyarrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7725 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.xorby "See the npm package")
-
-This method is like `_.xor` except that it accepts `iteratee` which is
-invoked for each element of each `arrays` to generate the criterion by
-which by which they're compared. The iteratee is invoked with one argument:<br>
-*(value)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[arrays]` *(...Array)*: The arrays to inspect.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(Array)*: Returns the new array of values.
-
-#### Example
-```js
-_.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-// => [1.2, 4.3]
-
-// The `_.property` iteratee shorthand.
-_.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-// => [{ 'x': 2 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_xorwitharrays-comparator"></a>`_.xorWith([arrays], [comparator])`
-<a href="#_xorwitharrays-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7753 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.xorwith "See the npm package")
-
-This method is like `_.xor` except that it accepts `comparator` which is
-invoked to compare elements of `arrays`. The comparator is invoked with
-two arguments: *(arrVal, othVal)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[arrays]` *(...Array)*: The arrays to inspect.
-2. `[comparator]` *(Function)*: The comparator invoked per element.
-
-#### Returns
-*(Array)*: Returns the new array of values.
-
-#### Example
-```js
-var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
-
-_.xorWith(objects, others, _.isEqual);
-// => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_ziparrays"></a>`_.zip([arrays])`
-<a href="#_ziparrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7777 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zip "See the npm package")
-
-Creates an array of grouped elements, the first of which contains the
-first elements of the given arrays, the second of which contains the
-second elements of the given arrays, and so on.
-
-#### Since
-0.1.0
-#### Arguments
-1. `[arrays]` *(...Array)*: The arrays to process.
-
-#### Returns
-*(Array)*: Returns the new array of grouped elements.
-
-#### Example
-```js
-_.zip(['fred', 'barney'], [30, 40], [true, false]);
-// => [['fred', 30, true], ['barney', 40, false]]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_zipobjectprops-values"></a>`_.zipObject([props=[]], [values=[]])`
-<a href="#_zipobjectprops-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7795 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zipobject "See the npm package")
-
-This method is like `_.fromPairs` except that it accepts two arrays,
-one of property identifiers and one of corresponding values.
-
-#### Since
-0.4.0
-#### Arguments
-1. `[props=[]]` *(Array)*: The property identifiers.
-2. `[values=[]]` *(Array)*: The property values.
-
-#### Returns
-*(Object)*: Returns the new object.
-
-#### Example
-```js
-_.zipObject(['a', 'b'], [1, 2]);
-// => { 'a': 1, 'b': 2 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_zipobjectdeepprops-values"></a>`_.zipObjectDeep([props=[]], [values=[]])`
-<a href="#_zipobjectdeepprops-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7814 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package")
-
-This method is like `_.zipObject` except that it supports property paths.
-
-#### Since
-4.1.0
-#### Arguments
-1. `[props=[]]` *(Array)*: The property identifiers.
-2. `[values=[]]` *(Array)*: The property values.
-
-#### Returns
-*(Object)*: Returns the new object.
-
-#### Example
-```js
-_.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
-// => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_zipwitharrays-iteratee_identity"></a>`_.zipWith([arrays], [iteratee=_.identity])`
-<a href="#_zipwitharrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7837 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zipwith "See the npm package")
-
-This method is like `_.zip` except that it accepts `iteratee` to specify
-how grouped values should be combined. The iteratee is invoked with the
-elements of each group: *(...group)*.
-
-#### Since
-3.8.0
-#### Arguments
-1. `[arrays]` *(...Array)*: The arrays to process.
-2. `[iteratee=_.identity]` *(Function)*: The function to combine grouped values.
-
-#### Returns
-*(Array)*: Returns the new array of grouped elements.
-
-#### Example
-```js
-_.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
-  return a + b + c;
-});
-// => [111, 222]
-```
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `“Collection” Methods`
-
-<!-- div -->
-
-### <a id="_countbycollection-iteratee_identity"></a>`_.countBy(collection, [iteratee=_.identity])`
-<a href="#_countbycollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8220 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.countby "See the npm package")
-
-Creates an object composed of keys generated from the results of running
-each element of `collection` thru `iteratee`. The corresponding value of
-each key is the number of times the key was returned by `iteratee`. The
-iteratee is invoked with one argument: *(value)*.
-
-#### Since
-0.5.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys.
-
-#### Returns
-*(Object)*: Returns the composed aggregate object.
-
-#### Example
-```js
-_.countBy([6.1, 4.2, 6.3], Math.floor);
-// => { '4': 1, '6': 2 }
-
-_.countBy(['one', 'two', 'three'], 'length');
-// => { '3': 2, '5': 1 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_everycollection-predicate_identity"></a>`_.every(collection, [predicate=_.identity])`
-<a href="#_everycollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8261 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.every "See the npm package")
-
-Checks if `predicate` returns truthy for **all** elements of `collection`.
-Iteration is stopped once `predicate` returns falsey. The predicate is
-invoked with three arguments: *(value, index|key, collection)*.
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(boolean)*: Returns `true` if all elements pass the predicate check, else `false`.
-
-#### Example
-```js
-_.every([true, 1, null, 'yes'], Boolean);
-// => false
-
-var users = [
-  { 'user': 'barney', 'age': 36, 'active': false },
-  { 'user': 'fred',   'age': 40, 'active': false }
-];
-
-// The `_.matches` iteratee shorthand.
-_.every(users, { 'user': 'barney', 'active': false });
-// => false
-
-// The `_.matchesProperty` iteratee shorthand.
-_.every(users, ['active', false]);
-// => true
-
-// The `_.property` iteratee shorthand.
-_.every(users, 'active');
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_filtercollection-predicate_identity"></a>`_.filter(collection, [predicate=_.identity])`
-<a href="#_filtercollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8305 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.filter "See the npm package")
-
-Iterates over elements of `collection`, returning an array of all elements
-`predicate` returns truthy for. The predicate is invoked with three
-arguments: *(value, index|key, collection)*.
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the new filtered array.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney', 'age': 36, 'active': true },
-  { 'user': 'fred',   'age': 40, 'active': false }
-];
-
-_.filter(users, function(o) { return !o.active; });
-// => objects for ['fred']
-
-// The `_.matches` iteratee shorthand.
-_.filter(users, { 'age': 36, 'active': true });
-// => objects for ['barney']
-
-// The `_.matchesProperty` iteratee shorthand.
-_.filter(users, ['active', false]);
-// => objects for ['fred']
-
-// The `_.property` iteratee shorthand.
-_.filter(users, 'active');
-// => objects for ['barney']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_findcollection-predicate_identity"></a>`_.find(collection, [predicate=_.identity])`
-<a href="#_findcollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8346 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.find "See the npm package")
-
-Iterates over elements of `collection`, returning the first element
-`predicate` returns truthy for. The predicate is invoked with three
-arguments: *(value, index|key, collection)*.
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to search.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(&#42;)*: Returns the matched element, else `undefined`.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney',  'age': 36, 'active': true },
-  { 'user': 'fred',    'age': 40, 'active': false },
-  { 'user': 'pebbles', 'age': 1,  'active': true }
-];
-
-_.find(users, function(o) { return o.age < 40; });
-// => object for 'barney'
-
-// The `_.matches` iteratee shorthand.
-_.find(users, { 'age': 1, 'active': true });
-// => object for 'pebbles'
-
-// The `_.matchesProperty` iteratee shorthand.
-_.find(users, ['active', false]);
-// => object for 'fred'
-
-// The `_.property` iteratee shorthand.
-_.find(users, 'active');
-// => object for 'barney'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_findlastcollection-predicate_identity"></a>`_.findLast(collection, [predicate=_.identity])`
-<a href="#_findlastcollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8374 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findlast "See the npm package")
-
-This method is like `_.find` except that it iterates over elements of
-`collection` from right to left.
-
-#### Since
-2.0.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to search.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(&#42;)*: Returns the matched element, else `undefined`.
-
-#### Example
-```js
-_.findLast([1, 2, 3, 4], function(n) {
-  return n % 2 == 1;
-});
-// => 3
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_flatmapcollection-iteratee_identity"></a>`_.flatMap(collection, [iteratee=_.identity])`
-<a href="#_flatmapcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8405 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flatmap "See the npm package")
-
-Creates a flattened array of values by running each element in `collection`
-thru `iteratee` and flattening the mapped results. The iteratee is invoked
-with three arguments: *(value, index|key, collection)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the new flattened array.
-
-#### Example
-```js
-function duplicate(n) {
-  return [n, n];
-}
-
-_.flatMap([1, 2], duplicate);
-// => [1, 1, 2, 2]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_flatmapdeepcollection-iteratee_identity"></a>`_.flatMapDeep(collection, [iteratee=_.identity])`
-<a href="#_flatmapdeepcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8430 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flatmapdeep "See the npm package")
-
-This method is like `_.flatMap` except that it recursively flattens the
-mapped results.
-
-#### Since
-4.7.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the new flattened array.
-
-#### Example
-```js
-function duplicate(n) {
-  return [[[n, n]]];
-}
-
-_.flatMapDeep([1, 2], duplicate);
-// => [1, 1, 2, 2]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_flatmapdepthcollection-iteratee_identity-depth1"></a>`_.flatMapDepth(collection, [iteratee=_.identity], [depth=1])`
-<a href="#_flatmapdepthcollection-iteratee_identity-depth1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8456 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flatmapdepth "See the npm package")
-
-This method is like `_.flatMap` except that it recursively flattens the
-mapped results up to `depth` times.
-
-#### Since
-4.7.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-3. `[depth=1]` *(number)*: The maximum recursion depth.
-
-#### Returns
-*(Array)*: Returns the new flattened array.
-
-#### Example
-```js
-function duplicate(n) {
-  return [[[n, n]]];
-}
-
-_.flatMapDepth([1, 2], duplicate, 2);
-// => [[1, 1], [2, 2]]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_foreachcollection-iteratee_identity"></a>`_.forEach(collection, [iteratee=_.identity])`
-<a href="#_foreachcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8491 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.foreach "See the npm package")
-
-Iterates over elements of `collection` and invokes `iteratee` for each element.
-The iteratee is invoked with three arguments: *(value, index|key, collection)*.
-Iteratee functions may exit iteration early by explicitly returning `false`.
-<br>
-<br>
-**Note:** As with other "Collections" methods, objects with a "length"
-property are iterated like arrays. To avoid this behavior use `_.forIn`
-or `_.forOwn` for object iteration.
-
-#### Since
-0.1.0
-#### Aliases
-*_.each*
-
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
-
-#### Returns
-*(&#42;)*: Returns `collection`.
-
-#### Example
-```js
-_([1, 2]).forEach(function(value) {
-  console.log(value);
-});
-// => Logs `1` then `2`.
-
-_.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
-  console.log(key);
-});
-// => Logs 'a' then 'b' (iteration order is not guaranteed).
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_foreachrightcollection-iteratee_identity"></a>`_.forEachRight(collection, [iteratee=_.identity])`
-<a href="#_foreachrightcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8517 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.foreachright "See the npm package")
-
-This method is like `_.forEach` except that it iterates over elements of
-`collection` from right to left.
-
-#### Since
-2.0.0
-#### Aliases
-*_.eachRight*
-
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
-
-#### Returns
-*(&#42;)*: Returns `collection`.
-
-#### Example
-```js
-_.forEachRight([1, 2], function(value) {
-  console.log(value);
-});
-// => Logs `2` then `1`.
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_groupbycollection-iteratee_identity"></a>`_.groupBy(collection, [iteratee=_.identity])`
-<a href="#_groupbycollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8547 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.groupby "See the npm package")
-
-Creates an object composed of keys generated from the results of running
-each element of `collection` thru `iteratee`. The order of grouped values
-is determined by the order they occur in `collection`. The corresponding
-value of each key is an array of elements responsible for generating the
-key. The iteratee is invoked with one argument: *(value)*.
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys.
-
-#### Returns
-*(Object)*: Returns the composed aggregate object.
-
-#### Example
-```js
-_.groupBy([6.1, 4.2, 6.3], Math.floor);
-// => { '4': [4.2], '6': [6.1, 6.3] }
-
-// The `_.property` iteratee shorthand.
-_.groupBy(['one', 'two', 'three'], 'length');
-// => { '3': ['one', 'two'], '5': ['three'] }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_includescollection-value-fromindex0"></a>`_.includes(collection, value, [fromIndex=0])`
-<a href="#_includescollection-value-fromindex0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8585 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.includes "See the npm package")
-
-Checks if `value` is in `collection`. If `collection` is a string, it's
-checked for a substring of `value`, otherwise
-[`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-is used for equality comparisons. If `fromIndex` is negative, it's used as
-the offset from the end of `collection`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object|string)*: The collection to search.
-2. `value` *(&#42;)*: The value to search for.
-3. `[fromIndex=0]` *(number)*: The index to search from.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is found, else `false`.
-
-#### Example
-```js
-_.includes([1, 2, 3], 1);
-// => true
-
-_.includes([1, 2, 3], 1, 2);
-// => false
-
-_.includes({ 'user': 'fred', 'age': 40 }, 'fred');
-// => true
-
-_.includes('pebbles', 'eb');
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_invokemapcollection-path-args"></a>`_.invokeMap(collection, path, [args])`
-<a href="#_invokemapcollection-path-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8621 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invokemap "See the npm package")
-
-Invokes the method at `path` of each element in `collection`, returning
-an array of the results of each invoked method. Any additional arguments
-are provided to each invoked method. If `methodName` is a function, it's
-invoked for and `this` bound to, each element in `collection`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `path` *(Array|Function|string)*: The path of the method to invoke or the function invoked per iteration.
-3. `[args]` *(...&#42;)*: The arguments to invoke each method with.
-
-#### Returns
-*(Array)*: Returns the array of results.
-
-#### Example
-```js
-_.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
-// => [[1, 5, 7], [1, 2, 3]]
-
-_.invokeMap([123, 456], String.prototype.split, '');
-// => [['1', '2', '3'], ['4', '5', '6']]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_keybycollection-iteratee_identity"></a>`_.keyBy(collection, [iteratee=_.identity])`
-<a href="#_keybycollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8663 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.keyby "See the npm package")
-
-Creates an object composed of keys generated from the results of running
-each element of `collection` thru `iteratee`. The corresponding value of
-each key is the last element responsible for generating the key. The
-iteratee is invoked with one argument: *(value)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys.
-
-#### Returns
-*(Object)*: Returns the composed aggregate object.
-
-#### Example
-```js
-var array = [
-  { 'dir': 'left', 'code': 97 },
-  { 'dir': 'right', 'code': 100 }
-];
-
-_.keyBy(array, function(o) {
-  return String.fromCharCode(o.code);
-});
-// => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
-
-_.keyBy(array, 'dir');
-// => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_mapcollection-iteratee_identity"></a>`_.map(collection, [iteratee=_.identity])`
-<a href="#_mapcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8710 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.map "See the npm package")
-
-Creates an array of values by running each element in `collection` thru
-`iteratee`. The iteratee is invoked with three arguments:<br>
-*(value, index|key, collection)*.
-<br>
-<br>
-Many lodash methods are guarded to work as iteratees for methods like
-`_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
-<br>
-<br>
-The guarded methods are:<br>
-`ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
-`fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
-`sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
-`template`, `trim`, `trimEnd`, `trimStart`, and `words`
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the new mapped array.
-
-#### Example
-```js
-function square(n) {
-  return n * n;
-}
-
-_.map([4, 8], square);
-// => [16, 64]
-
-_.map({ 'a': 4, 'b': 8 }, square);
-// => [16, 64] (iteration order is not guaranteed)
-
-var users = [
-  { 'user': 'barney' },
-  { 'user': 'fred' }
-];
-
-// The `_.property` iteratee shorthand.
-_.map(users, 'user');
-// => ['barney', 'fred']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_orderbycollection-iteratees_identity-orders"></a>`_.orderBy(collection, [iteratees=[_.identity]], [orders])`
-<a href="#_orderbycollection-iteratees_identity-orders">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8744 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.orderby "See the npm package")
-
-This method is like `_.sortBy` except that it allows specifying the sort
-orders of the iteratees to sort by. If `orders` is unspecified, all values
-are sorted in ascending order. Otherwise, specify an order of "desc" for
-descending or "asc" for ascending sort order of corresponding values.
-
-#### Since
-4.0.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratees=[_.identity]]` *(Array&#91;&#93;|Function&#91;&#93;|Object&#91;&#93;|string&#91;&#93;)*: The iteratees to sort by.
-3. `[orders]` *(string&#91;&#93;)*: The sort orders of `iteratees`.
-
-#### Returns
-*(Array)*: Returns the new sorted array.
-
-#### Example
-```js
-var users = [
-  { 'user': 'fred',   'age': 48 },
-  { 'user': 'barney', 'age': 34 },
-  { 'user': 'fred',   'age': 40 },
-  { 'user': 'barney', 'age': 36 }
-];
-
-// Sort by `user` in ascending order and by `age` in descending order.
-_.orderBy(users, ['user', 'age'], ['asc', 'desc']);
-// => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_partitioncollection-predicate_identity"></a>`_.partition(collection, [predicate=_.identity])`
-<a href="#_partitioncollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8795 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.partition "See the npm package")
-
-Creates an array of elements split into two groups, the first of which
-contains elements `predicate` returns truthy for, the second of which
-contains elements `predicate` returns falsey for. The predicate is
-invoked with one argument: *(value)*.
-
-#### Since
-3.0.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the array of grouped elements.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney',  'age': 36, 'active': false },
-  { 'user': 'fred',    'age': 40, 'active': true },
-  { 'user': 'pebbles', 'age': 1,  'active': false }
-];
-
-_.partition(users, function(o) { return o.active; });
-// => objects for [['fred'], ['barney', 'pebbles']]
-
-// The `_.matches` iteratee shorthand.
-_.partition(users, { 'age': 1, 'active': false });
-// => objects for [['pebbles'], ['barney', 'fred']]
-
-// The `_.matchesProperty` iteratee shorthand.
-_.partition(users, ['active', false]);
-// => objects for [['barney', 'pebbles'], ['fred']]
-
-// The `_.property` iteratee shorthand.
-_.partition(users, 'active');
-// => objects for [['fred'], ['barney', 'pebbles']]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_reducecollection-iteratee_identity-accumulator"></a>`_.reduce(collection, [iteratee=_.identity], [accumulator])`
-<a href="#_reducecollection-iteratee_identity-accumulator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8836 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reduce "See the npm package")
-
-Reduces `collection` to a value which is the accumulated result of running
-each element in `collection` thru `iteratee`, where each successive
-invocation is supplied the return value of the previous. If `accumulator`
-is not given, the first element of `collection` is used as the initial
-value. The iteratee is invoked with four arguments:<br>
-*(accumulator, value, index|key, collection)*.
-<br>
-<br>
-Many lodash methods are guarded to work as iteratees for methods like
-`_.reduce`, `_.reduceRight`, and `_.transform`.
-<br>
-<br>
-The guarded methods are:<br>
-`assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
-and `sortBy`
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
-3. `[accumulator]` *(&#42;)*: The initial value.
-
-#### Returns
-*(&#42;)*: Returns the accumulated value.
-
-#### Example
-```js
-_.reduce([1, 2], function(sum, n) {
-  return sum + n;
-}, 0);
-// => 3
-
-_.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
-  (result[value] || (result[value] = [])).push(key);
-  return result;
-}, {});
-// => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_reducerightcollection-iteratee_identity-accumulator"></a>`_.reduceRight(collection, [iteratee=_.identity], [accumulator])`
-<a href="#_reducerightcollection-iteratee_identity-accumulator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8865 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reduceright "See the npm package")
-
-This method is like `_.reduce` except that it iterates over elements of
-`collection` from right to left.
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
-3. `[accumulator]` *(&#42;)*: The initial value.
-
-#### Returns
-*(&#42;)*: Returns the accumulated value.
-
-#### Example
-```js
-var array = [[0, 1], [2, 3], [4, 5]];
-
-_.reduceRight(array, function(flattened, other) {
-  return flattened.concat(other);
-}, []);
-// => [4, 5, 2, 3, 0, 1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_rejectcollection-predicate_identity"></a>`_.reject(collection, [predicate=_.identity])`
-<a href="#_rejectcollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8907 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reject "See the npm package")
-
-The opposite of `_.filter`; this method returns the elements of `collection`
-that `predicate` does **not** return truthy for.
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the new filtered array.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney', 'age': 36, 'active': false },
-  { 'user': 'fred',   'age': 40, 'active': true }
-];
-
-_.reject(users, function(o) { return !o.active; });
-// => objects for ['fred']
-
-// The `_.matches` iteratee shorthand.
-_.reject(users, { 'age': 40, 'active': true });
-// => objects for ['barney']
-
-// The `_.matchesProperty` iteratee shorthand.
-_.reject(users, ['active', false]);
-// => objects for ['fred']
-
-// The `_.property` iteratee shorthand.
-_.reject(users, 'active');
-// => objects for ['barney']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_samplecollection"></a>`_.sample(collection)`
-<a href="#_samplecollection">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8929 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sample "See the npm package")
-
-Gets a random element from `collection`.
-
-#### Since
-2.0.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to sample.
-
-#### Returns
-*(&#42;)*: Returns the random element.
-
-#### Example
-```js
-_.sample([1, 2, 3, 4]);
-// => 2
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_samplesizecollection-n1"></a>`_.sampleSize(collection, [n=1])`
-<a href="#_samplesizecollection-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8956 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.samplesize "See the npm package")
-
-Gets `n` random elements at unique keys from `collection` up to the
-size of `collection`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to sample.
-2. `[n=1]` *(number)*: The number of elements to sample.
-
-#### Returns
-*(Array)*: Returns the random elements.
-
-#### Example
-```js
-_.sampleSize([1, 2, 3], 2);
-// => [3, 1]
-
-_.sampleSize([1, 2, 3], 4);
-// => [2, 3, 1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_shufflecollection"></a>`_.shuffle(collection)`
-<a href="#_shufflecollection">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8993 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.shuffle "See the npm package")
-
-Creates an array of shuffled values, using a version of the
-[Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to shuffle.
-
-#### Returns
-*(Array)*: Returns the new shuffled array.
-
-#### Example
-```js
-_.shuffle([1, 2, 3, 4]);
-// => [4, 1, 3, 2]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sizecollection"></a>`_.size(collection)`
-<a href="#_sizecollection">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9018 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.size "See the npm package")
-
-Gets the size of `collection` by returning its length for array-like
-values or the number of own enumerable string keyed properties for objects.
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to inspect.
-
-#### Returns
-*(number)*: Returns the collection size.
-
-#### Example
-```js
-_.size([1, 2, 3]);
-// => 3
-
-_.size({ 'a': 1, 'b': 2 });
-// => 2
-
-_.size('pebbles');
-// => 7
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_somecollection-predicate_identity"></a>`_.some(collection, [predicate=_.identity])`
-<a href="#_somecollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9072 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.some "See the npm package")
-
-Checks if `predicate` returns truthy for **any** element of `collection`.
-Iteration is stopped once `predicate` returns truthy. The predicate is
-invoked with three arguments: *(value, index|key, collection)*.
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(boolean)*: Returns `true` if any element passes the predicate check, else `false`.
-
-#### Example
-```js
-_.some([null, 0, 'yes', false], Boolean);
-// => true
-
-var users = [
-  { 'user': 'barney', 'active': true },
-  { 'user': 'fred',   'active': false }
-];
-
-// The `_.matches` iteratee shorthand.
-_.some(users, { 'user': 'barney', 'active': false });
-// => false
-
-// The `_.matchesProperty` iteratee shorthand.
-_.some(users, ['active', false]);
-// => true
-
-// The `_.property` iteratee shorthand.
-_.some(users, 'active');
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sortbycollection-iteratees_identity"></a>`_.sortBy(collection, [iteratees=[_.identity]])`
-<a href="#_sortbycollection-iteratees_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9114 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortby "See the npm package")
-
-Creates an array of elements, sorted in ascending order by the results of
-running each element in a collection thru each iteratee. This method
-performs a stable sort, that is, it preserves the original sort order of
-equal elements. The iteratees are invoked with one argument: *(value)*.
-
-#### Since
-0.1.0
-#### Arguments
-1. `collection` *(Array|Object)*: The collection to iterate over.
-2. `[iteratees=[_.identity]]` *(...(Array|Array&#91;&#93;|Function|Function&#91;&#93;|Object|Object&#91;&#93;|string|string&#91;&#93;))*: The iteratees to sort by.
-
-#### Returns
-*(Array)*: Returns the new sorted array.
-
-#### Example
-```js
-var users = [
-  { 'user': 'fred',   'age': 48 },
-  { 'user': 'barney', 'age': 36 },
-  { 'user': 'fred',   'age': 40 },
-  { 'user': 'barney', 'age': 34 }
-];
-
-_.sortBy(users, function(o) { return o.user; });
-// => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
-
-_.sortBy(users, ['user', 'age']);
-// => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
-
-_.sortBy(users, 'user', function(o) {
-  return Math.floor(o.age / 10);
-});
-// => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
-```
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `“Date” Methods`
-
-<!-- div -->
-
-### <a id="_now"></a>`_.now()`
-<a href="#_now">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9150 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.now "See the npm package")
-
-Gets the timestamp of the number of milliseconds that have elapsed since
-the Unix epoch *(1 January `1970 00`:00:00 UTC)*.
-
-#### Since
-2.4.0
-#### Returns
-*(number)*: Returns the timestamp.
-
-#### Example
-```js
-_.defer(function(stamp) {
-  console.log(_.now() - stamp);
-}, _.now());
-// => Logs the number of milliseconds it took for the deferred function to be invoked.
-```
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `“Function” Methods`
-
-<!-- div -->
-
-### <a id="_aftern-func"></a>`_.after(n, func)`
-<a href="#_aftern-func">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9178 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.after "See the npm package")
-
-The opposite of `_.before`; this method creates a function that invokes
-`func` once it's called `n` or more times.
-
-#### Since
-0.1.0
-#### Arguments
-1. `n` *(number)*: The number of calls before `func` is invoked.
-2. `func` *(Function)*: The function to restrict.
-
-#### Returns
-*(Function)*: Returns the new restricted function.
-
-#### Example
-```js
-var saves = ['profile', 'settings'];
-
-var done = _.after(saves.length, function() {
-  console.log('done saving!');
-});
-
-_.forEach(saves, function(type) {
-  asyncSave({ 'type': type, 'complete': done });
-});
-// => Logs 'done saving!' after the two async saves have completed.
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_aryfunc-nfunclength"></a>`_.ary(func, [n=func.length])`
-<a href="#_aryfunc-nfunclength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9207 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ary "See the npm package")
-
-Creates a function that invokes `func`, with up to `n` arguments,
-ignoring any additional arguments.
-
-#### Since
-3.0.0
-#### Arguments
-1. `func` *(Function)*: The function to cap arguments for.
-2. `[n=func.length]` *(number)*: The arity cap.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-_.map(['6', '8', '10'], _.ary(parseInt, 1));
-// => [6, 8, 10]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_beforen-func"></a>`_.before(n, func)`
-<a href="#_beforen-func">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9230 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.before "See the npm package")
-
-Creates a function that invokes `func`, with the `this` binding and arguments
-of the created function, while it's called less than `n` times. Subsequent
-calls to the created function return the result of the last `func` invocation.
-
-#### Since
-3.0.0
-#### Arguments
-1. `n` *(number)*: The number of calls at which `func` is no longer invoked.
-2. `func` *(Function)*: The function to restrict.
-
-#### Returns
-*(Function)*: Returns the new restricted function.
-
-#### Example
-```js
-jQuery(element).on('click', _.before(5, addContactToList));
-// => allows adding up to 4 contacts to the list
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_bindfunc-thisarg-partials"></a>`_.bind(func, thisArg, [partials])`
-<a href="#_bindfunc-thisarg-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9282 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.bind "See the npm package")
-
-Creates a function that invokes `func` with the `this` binding of `thisArg`
-and `partials` prepended to the arguments it receives.
-<br>
-<br>
-The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
-may be used as a placeholder for partially applied arguments.
-<br>
-<br>
-**Note:** Unlike native `Function#bind` this method doesn't set the "length"
-property of bound functions.
-
-#### Since
-0.1.0
-#### Arguments
-1. `func` *(Function)*: The function to bind.
-2. `thisArg` *(&#42;)*: The `this` binding of `func`.
-3. `[partials]` *(...&#42;)*: The arguments to be partially applied.
-
-#### Returns
-*(Function)*: Returns the new bound function.
-
-#### Example
-```js
-var greet = function(greeting, punctuation) {
-  return greeting + ' ' + this.user + punctuation;
-};
-
-var object = { 'user': 'fred' };
-
-var bound = _.bind(greet, object, 'hi');
-bound('!');
-// => 'hi fred!'
-
-// Bound with placeholders.
-var bound = _.bind(greet, object, _, '!');
-bound('hi');
-// => 'hi fred!'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_bindkeyobject-key-partials"></a>`_.bindKey(object, key, [partials])`
-<a href="#_bindkeyobject-key-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9336 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.bindkey "See the npm package")
-
-Creates a function that invokes the method at `object[key]` with `partials`
-prepended to the arguments it receives.
-<br>
-<br>
-This method differs from `_.bind` by allowing bound functions to reference
-methods that may be redefined or don't yet exist. See
-[Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
-for more details.
-<br>
-<br>
-The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
-builds, may be used as a placeholder for partially applied arguments.
-
-#### Since
-0.10.0
-#### Arguments
-1. `object` *(Object)*: The object to invoke the method on.
-2. `key` *(string)*: The key of the method.
-3. `[partials]` *(...&#42;)*: The arguments to be partially applied.
-
-#### Returns
-*(Function)*: Returns the new bound function.
-
-#### Example
-```js
-var object = {
-  'user': 'fred',
-  'greet': function(greeting, punctuation) {
-    return greeting + ' ' + this.user + punctuation;
-  }
-};
-
-var bound = _.bindKey(object, 'greet', 'hi');
-bound('!');
-// => 'hi fred!'
-
-object.greet = function(greeting, punctuation) {
-  return greeting + 'ya ' + this.user + punctuation;
-};
-
-bound('!');
-// => 'hiya fred!'
-
-// Bound with placeholders.
-var bound = _.bindKey(object, 'greet', _, '!');
-bound('hi');
-// => 'hiya fred!'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_curryfunc-arityfunclength"></a>`_.curry(func, [arity=func.length])`
-<a href="#_curryfunc-arityfunclength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9386 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.curry "See the npm package")
-
-Creates a function that accepts arguments of `func` and either invokes
-`func` returning its result, if at least `arity` number of arguments have
-been provided, or returns a function that accepts the remaining `func`
-arguments, and so on. The arity of `func` may be specified if `func.length`
-is not sufficient.
-<br>
-<br>
-The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
-may be used as a placeholder for provided arguments.
-<br>
-<br>
-**Note:** This method doesn't set the "length" property of curried functions.
-
-#### Since
-2.0.0
-#### Arguments
-1. `func` *(Function)*: The function to curry.
-2. `[arity=func.length]` *(number)*: The arity of `func`.
-
-#### Returns
-*(Function)*: Returns the new curried function.
-
-#### Example
-```js
-var abc = function(a, b, c) {
-  return [a, b, c];
-};
-
-var curried = _.curry(abc);
-
-curried(1)(2)(3);
-// => [1, 2, 3]
-
-curried(1, 2)(3);
-// => [1, 2, 3]
-
-curried(1, 2, 3);
-// => [1, 2, 3]
-
-// Curried with placeholders.
-curried(1)(_, 3)(2);
-// => [1, 2, 3]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_curryrightfunc-arityfunclength"></a>`_.curryRight(func, [arity=func.length])`
-<a href="#_curryrightfunc-arityfunclength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9431 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.curryright "See the npm package")
-
-This method is like `_.curry` except that arguments are applied to `func`
-in the manner of `_.partialRight` instead of `_.partial`.
-<br>
-<br>
-The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
-builds, may be used as a placeholder for provided arguments.
-<br>
-<br>
-**Note:** This method doesn't set the "length" property of curried functions.
-
-#### Since
-3.0.0
-#### Arguments
-1. `func` *(Function)*: The function to curry.
-2. `[arity=func.length]` *(number)*: The arity of `func`.
-
-#### Returns
-*(Function)*: Returns the new curried function.
-
-#### Example
-```js
-var abc = function(a, b, c) {
-  return [a, b, c];
-};
-
-var curried = _.curryRight(abc);
-
-curried(3)(2)(1);
-// => [1, 2, 3]
-
-curried(2, 3)(1);
-// => [1, 2, 3]
-
-curried(1, 2, 3);
-// => [1, 2, 3]
-
-// Curried with placeholders.
-curried(3)(1, _)(2);
-// => [1, 2, 3]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_debouncefunc-wait0-options-optionsleadingfalse-optionsmaxwait-optionstrailingtrue"></a>`_.debounce(func, [wait=0], [options={}], [options.leading=false], [options.maxWait], [options.trailing=true])`
-<a href="#_debouncefunc-wait0-options-optionsleadingfalse-optionsmaxwait-optionstrailingtrue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9488 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.debounce "See the npm package")
-
-Creates a debounced function that delays invoking `func` until after `wait`
-milliseconds have elapsed since the last time the debounced function was
-invoked. The debounced function comes with a `cancel` method to cancel
-delayed `func` invocations and a `flush` method to immediately invoke them.
-Provide an options object to indicate whether `func` should be invoked on
-the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
-with the last arguments provided to the debounced function. Subsequent calls
-to the debounced function return the result of the last `func` invocation.
-<br>
-<br>
-**Note:** If `leading` and `trailing` options are `true`, `func` is invoked
-on the trailing edge of the timeout only if the debounced function is
-invoked more than once during the `wait` timeout.
-<br>
-<br>
-See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
-for details over the differences between `_.debounce` and `_.throttle`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `func` *(Function)*: The function to debounce.
-2. `[wait=0]` *(number)*: The number of milliseconds to delay.
-3. `[options={}]` *(Object)*: The options object.
-4. `[options.leading=false]` *(boolean)*: Specify invoking on the leading edge of the timeout.
-5. `[options.maxWait]` *(number)*: The maximum time `func` is allowed to be delayed before it's invoked.
-6. `[options.trailing=true]` *(boolean)*: Specify invoking on the trailing edge of the timeout.
-
-#### Returns
-*(Function)*: Returns the new debounced function.
-
-#### Example
-```js
-// Avoid costly calculations while the window size is in flux.
-jQuery(window).on('resize', _.debounce(calculateLayout, 150));
-
-// Invoke `sendMail` when clicked, debouncing subsequent calls.
-jQuery(element).on('click', _.debounce(sendMail, 300, {
-  'leading': true,
-  'trailing': false
-}));
-
-// Ensure `batchLog` is invoked once after 1 second of debounced calls.
-var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
-var source = new EventSource('/stream');
-jQuery(source).on('message', debounced);
-
-// Cancel the trailing debounced invocation.
-jQuery(window).on('popstate', debounced.cancel);
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_deferfunc-args"></a>`_.defer(func, [args])`
-<a href="#_deferfunc-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9630 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.defer "See the npm package")
-
-Defers invoking the `func` until the current call stack has cleared. Any
-additional arguments are provided to `func` when it's invoked.
-
-#### Since
-0.1.0
-#### Arguments
-1. `func` *(Function)*: The function to defer.
-2. `[args]` *(...&#42;)*: The arguments to invoke `func` with.
-
-#### Returns
-*(number)*: Returns the timer id.
-
-#### Example
-```js
-_.defer(function(text) {
-  console.log(text);
-}, 'deferred');
-// => Logs 'deferred' after one or more milliseconds.
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_delayfunc-wait-args"></a>`_.delay(func, wait, [args])`
-<a href="#_delayfunc-wait-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9653 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.delay "See the npm package")
-
-Invokes `func` after `wait` milliseconds. Any additional arguments are
-provided to `func` when it's invoked.
-
-#### Since
-0.1.0
-#### Arguments
-1. `func` *(Function)*: The function to delay.
-2. `wait` *(number)*: The number of milliseconds to delay invocation.
-3. `[args]` *(...&#42;)*: The arguments to invoke `func` with.
-
-#### Returns
-*(number)*: Returns the timer id.
-
-#### Example
-```js
-_.delay(function(text) {
-  console.log(text);
-}, 1000, 'later');
-// => Logs 'later' after one second.
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_flipfunc"></a>`_.flip(func)`
-<a href="#_flipfunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9675 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flip "See the npm package")
-
-Creates a function that invokes `func` with arguments reversed.
-
-#### Since
-4.0.0
-#### Arguments
-1. `func` *(Function)*: The function to flip arguments for.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var flipped = _.flip(function() {
-  return _.toArray(arguments);
-});
-
-flipped('a', 'b', 'c', 'd');
-// => ['d', 'c', 'b', 'a']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_memoizefunc-resolver"></a>`_.memoize(func, [resolver])`
-<a href="#_memoizefunc-resolver">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9723 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.memoize "See the npm package")
-
-Creates a function that memoizes the result of `func`. If `resolver` is
-provided, it determines the cache key for storing the result based on the
-arguments provided to the memoized function. By default, the first argument
-provided to the memoized function is used as the map cache key. The `func`
-is invoked with the `this` binding of the memoized function.
-<br>
-<br>
-**Note:** The cache is exposed as the `cache` property on the memoized
-function. Its creation may be customized by replacing the `_.memoize.Cache`
-constructor with one whose instances implement the
-[`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
-method interface of `delete`, `get`, `has`, and `set`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `func` *(Function)*: The function to have its output memoized.
-2. `[resolver]` *(Function)*: The function to resolve the cache key.
-
-#### Returns
-*(Function)*: Returns the new memoizing function.
-
-#### Example
-```js
-var object = { 'a': 1, 'b': 2 };
-var other = { 'c': 3, 'd': 4 };
-
-var values = _.memoize(_.values);
-values(object);
-// => [1, 2]
-
-values(other);
-// => [3, 4]
-
-object.a = 2;
-values(object);
-// => [1, 2]
-
-// Modify the result cache.
-values.cache.set(object, ['a', 'b']);
-values(object);
-// => ['a', 'b']
-
-// Replace `_.memoize.Cache`.
-_.memoize.Cache = WeakMap;
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_negatepredicate"></a>`_.negate(predicate)`
-<a href="#_negatepredicate">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9766 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.negate "See the npm package")
-
-Creates a function that negates the result of the predicate `func`. The
-`func` predicate is invoked with the `this` binding and arguments of the
-created function.
-
-#### Since
-3.0.0
-#### Arguments
-1. `predicate` *(Function)*: The predicate to negate.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-function isEven(n) {
-  return n % 2 == 0;
-}
-
-_.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
-// => [1, 3, 5]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_oncefunc"></a>`_.once(func)`
-<a href="#_oncefunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9793 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.once "See the npm package")
-
-Creates a function that is restricted to invoking `func` once. Repeat calls
-to the function return the value of the first invocation. The `func` is
-invoked with the `this` binding and arguments of the created function.
-
-#### Since
-0.1.0
-#### Arguments
-1. `func` *(Function)*: The function to restrict.
-
-#### Returns
-*(Function)*: Returns the new restricted function.
-
-#### Example
-```js
-var initialize = _.once(createApplication);
-initialize();
-initialize();
-// `initialize` invokes `createApplication` once
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_overargsfunc"></a>`_.overArgs(func)`
-<a href="#_overargsfunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9829 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.overargs "See the npm package")
-
-Creates a function that invokes `func` with arguments transformed by
-corresponding `transforms`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `func` *(Function)*: The function to wrap.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-function doubled(n) {
-  return n * 2;
-}
-
-function square(n) {
-  return n * n;
-}
-
-var func = _.overArgs(function(x, y) {
-  return [x, y];
-}, square, doubled);
-
-func(9, 3);
-// => [81, 6]
-
-func(10, 5);
-// => [100, 10]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_partialfunc-partials"></a>`_.partial(func, [partials])`
-<a href="#_partialfunc-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9879 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.partial "See the npm package")
-
-Creates a function that invokes `func` with `partials` prepended to the
-arguments it receives. This method is like `_.bind` except it does **not**
-alter the `this` binding.
-<br>
-<br>
-The `_.partial.placeholder` value, which defaults to `_` in monolithic
-builds, may be used as a placeholder for partially applied arguments.
-<br>
-<br>
-**Note:** This method doesn't set the "length" property of partially
-applied functions.
-
-#### Since
-0.2.0
-#### Arguments
-1. `func` *(Function)*: The function to partially apply arguments to.
-2. `[partials]` *(...&#42;)*: The arguments to be partially applied.
-
-#### Returns
-*(Function)*: Returns the new partially applied function.
-
-#### Example
-```js
-var greet = function(greeting, name) {
-  return greeting + ' ' + name;
-};
-
-var sayHelloTo = _.partial(greet, 'hello');
-sayHelloTo('fred');
-// => 'hello fred'
-
-// Partially applied with placeholders.
-var greetFred = _.partial(greet, _, 'fred');
-greetFred('hi');
-// => 'hi fred'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_partialrightfunc-partials"></a>`_.partialRight(func, [partials])`
-<a href="#_partialrightfunc-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9916 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.partialright "See the npm package")
-
-This method is like `_.partial` except that partially applied arguments
-are appended to the arguments it receives.
-<br>
-<br>
-The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
-builds, may be used as a placeholder for partially applied arguments.
-<br>
-<br>
-**Note:** This method doesn't set the "length" property of partially
-applied functions.
-
-#### Since
-1.0.0
-#### Arguments
-1. `func` *(Function)*: The function to partially apply arguments to.
-2. `[partials]` *(...&#42;)*: The arguments to be partially applied.
-
-#### Returns
-*(Function)*: Returns the new partially applied function.
-
-#### Example
-```js
-var greet = function(greeting, name) {
-  return greeting + ' ' + name;
-};
-
-var greetFred = _.partialRight(greet, 'fred');
-greetFred('hi');
-// => 'hi fred'
-
-// Partially applied with placeholders.
-var sayHelloTo = _.partialRight(greet, 'hello', _);
-sayHelloTo('fred');
-// => 'hello fred'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_reargfunc-indexes"></a>`_.rearg(func, indexes)`
-<a href="#_reargfunc-indexes">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9943 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.rearg "See the npm package")
-
-Creates a function that invokes `func` with arguments arranged according
-to the specified `indexes` where the argument value at the first index is
-provided as the first argument, the argument value at the second index is
-provided as the second argument, and so on.
-
-#### Since
-3.0.0
-#### Arguments
-1. `func` *(Function)*: The function to rearrange arguments for.
-2. `indexes` *(...(number|number&#91;&#93;))*: The arranged argument indexes.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var rearged = _.rearg(function(a, b, c) {
-  return [a, b, c];
-}, 2, 0, 1);
-
-rearged('b', 'c', 'a')
-// => ['a', 'b', 'c']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_restfunc-startfunclength-1"></a>`_.rest(func, [start=func.length-1])`
-<a href="#_restfunc-startfunclength-1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9972 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.rest "See the npm package")
-
-Creates a function that invokes `func` with the `this` binding of the
-created function and arguments from `start` and beyond provided as
-an array.
-<br>
-<br>
-**Note:** This method is based on the
-[rest parameter](https://mdn.io/rest_parameters).
-
-#### Since
-4.0.0
-#### Arguments
-1. `func` *(Function)*: The function to apply a rest parameter to.
-2. `[start=func.length-1]` *(number)*: The start position of the rest parameter.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var say = _.rest(function(what, names) {
-  return what + ' ' + _.initial(names).join(', ') +
-    (_.size(names) > 1 ? ', & ' : '') + _.last(names);
-});
-
-say('hello', 'fred', 'barney', 'pebbles');
-// => 'hello fred, barney, & pebbles'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_spreadfunc-start0"></a>`_.spread(func, [start=0])`
-<a href="#_spreadfunc-start0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10035 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.spread "See the npm package")
-
-Creates a function that invokes `func` with the `this` binding of the
-create function and an array of arguments much like
-[`Function#apply`](http://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.apply).
-<br>
-<br>
-**Note:** This method is based on the
-[spread operator](https://mdn.io/spread_operator).
-
-#### Since
-3.2.0
-#### Arguments
-1. `func` *(Function)*: The function to spread arguments over.
-2. `[start=0]` *(number)*: The start position of the spread.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var say = _.spread(function(who, what) {
-  return who + ' says ' + what;
-});
-
-say(['fred', 'hello']);
-// => 'fred says hello'
-
-var numbers = Promise.all([
-  Promise.resolve(40),
-  Promise.resolve(36)
-]);
-
-numbers.then(_.spread(function(x, y) {
-  return x + y;
-}));
-// => a Promise of 76
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_throttlefunc-wait0-options-optionsleadingtrue-optionstrailingtrue"></a>`_.throttle(func, [wait=0], [options={}], [options.leading=true], [options.trailing=true])`
-<a href="#_throttlefunc-wait0-options-optionsleadingtrue-optionstrailingtrue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10092 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.throttle "See the npm package")
-
-Creates a throttled function that only invokes `func` at most once per
-every `wait` milliseconds. The throttled function comes with a `cancel`
-method to cancel delayed `func` invocations and a `flush` method to
-immediately invoke them. Provide an options object to indicate whether
-`func` should be invoked on the leading and/or trailing edge of the `wait`
-timeout. The `func` is invoked with the last arguments provided to the
-throttled function. Subsequent calls to the throttled function return the
-result of the last `func` invocation.
-<br>
-<br>
-**Note:** If `leading` and `trailing` options are `true`, `func` is
-invoked on the trailing edge of the timeout only if the throttled function
-is invoked more than once during the `wait` timeout.
-<br>
-<br>
-See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
-for details over the differences between `_.throttle` and `_.debounce`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `func` *(Function)*: The function to throttle.
-2. `[wait=0]` *(number)*: The number of milliseconds to throttle invocations to.
-3. `[options={}]` *(Object)*: The options object.
-4. `[options.leading=true]` *(boolean)*: Specify invoking on the leading edge of the timeout.
-5. `[options.trailing=true]` *(boolean)*: Specify invoking on the trailing edge of the timeout.
-
-#### Returns
-*(Function)*: Returns the new throttled function.
-
-#### Example
-```js
-// Avoid excessively updating the position while scrolling.
-jQuery(window).on('scroll', _.throttle(updatePosition, 100));
-
-// Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
-var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
-jQuery(element).on('click', throttled);
-
-// Cancel the trailing throttled invocation.
-jQuery(window).on('popstate', throttled.cancel);
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_unaryfunc"></a>`_.unary(func)`
-<a href="#_unaryfunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10125 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unary "See the npm package")
-
-Creates a function that accepts up to one argument, ignoring any
-additional arguments.
-
-#### Since
-4.0.0
-#### Arguments
-1. `func` *(Function)*: The function to cap arguments for.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-_.map(['6', '8', '10'], _.unary(parseInt));
-// => [6, 8, 10]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_wrapvalue-wrapperidentity"></a>`_.wrap(value, [wrapper=identity])`
-<a href="#_wrapvalue-wrapperidentity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10151 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.wrap "See the npm package")
-
-Creates a function that provides `value` to the wrapper function as its
-first argument. Any additional arguments provided to the function are
-appended to those provided to the wrapper function. The wrapper is invoked
-with the `this` binding of the created function.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to wrap.
-2. `[wrapper=identity]` *(Function)*: The wrapper function.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var p = _.wrap(_.escape, function(func, text) {
-  return '<p>' + func(text) + '</p>';
-});
-
-p('fred, barney, & pebbles');
-// => '<p>fred, barney, &amp; pebbles</p>'
-```
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `“Lang” Methods`
-
-<!-- div -->
-
-### <a id="_castarrayvalue"></a>`_.castArray(value)`
-<a href="#_castarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10191 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.castarray "See the npm package")
-
-Casts `value` as an array if it's not one.
-
-#### Since
-4.4.0
-#### Arguments
-1. `value` *(&#42;)*: The value to inspect.
-
-#### Returns
-*(Array)*: Returns the cast array.
-
-#### Example
-```js
-_.castArray(1);
-// => [1]
-
-_.castArray({ 'a': 1 });
-// => [{ 'a': 1 }]
-
-_.castArray('abc');
-// => ['abc']
-
-_.castArray(null);
-// => [null]
-
-_.castArray(undefined);
-// => [undefined]
-
-_.castArray();
-// => []
-
-var array = [1, 2, 3];
-console.log(_.castArray(array) === array);
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_clonevalue"></a>`_.clone(value)`
-<a href="#_clonevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10225 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clone "See the npm package")
-
-Creates a shallow clone of `value`.
-<br>
-<br>
-**Note:** This method is loosely based on the
-[structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
-and supports cloning arrays, array buffers, booleans, date objects, maps,
-numbers, `Object` objects, regexes, sets, strings, symbols, and typed
-arrays. The own enumerable properties of `arguments` objects are cloned
-as plain objects. An empty object is returned for uncloneable values such
-as error objects, functions, DOM nodes, and WeakMaps.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to clone.
-
-#### Returns
-*(&#42;)*: Returns the cloned value.
-
-#### Example
-```js
-var objects = [{ 'a': 1 }, { 'b': 2 }];
-
-var shallow = _.clone(objects);
-console.log(shallow[0] === objects[0]);
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_clonedeepvalue"></a>`_.cloneDeep(value)`
-<a href="#_clonedeepvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10282 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clonedeep "See the npm package")
-
-This method is like `_.clone` except that it recursively clones `value`.
-
-#### Since
-1.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to recursively clone.
-
-#### Returns
-*(&#42;)*: Returns the deep cloned value.
-
-#### Example
-```js
-var objects = [{ 'a': 1 }, { 'b': 2 }];
-
-var deep = _.cloneDeep(objects);
-console.log(deep[0] === objects[0]);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_clonedeepwithvalue-customizer"></a>`_.cloneDeepWith(value, [customizer])`
-<a href="#_clonedeepwithvalue-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10314 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package")
-
-This method is like `_.cloneWith` except that it recursively clones `value`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to recursively clone.
-2. `[customizer]` *(Function)*: The function to customize cloning.
-
-#### Returns
-*(&#42;)*: Returns the deep cloned value.
-
-#### Example
-```js
-function customizer(value) {
-  if (_.isElement(value)) {
-    return value.cloneNode(true);
-  }
-}
-
-var el = _.cloneDeepWith(document.body, customizer);
-
-console.log(el === document.body);
-// => false
-console.log(el.nodeName);
-// => 'BODY'
-console.log(el.childNodes.length);
-// => 20
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_clonewithvalue-customizer"></a>`_.cloneWith(value, [customizer])`
-<a href="#_clonewithvalue-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10260 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clonewith "See the npm package")
-
-This method is like `_.clone` except that it accepts `customizer` which
-is invoked to produce the cloned value. If `customizer` returns `undefined`,
-cloning is handled by the method instead. The `customizer` is invoked with
-up to four arguments; *(value [, index|key, object, stack])*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to clone.
-2. `[customizer]` *(Function)*: The function to customize cloning.
-
-#### Returns
-*(&#42;)*: Returns the cloned value.
-
-#### Example
-```js
-function customizer(value) {
-  if (_.isElement(value)) {
-    return value.cloneNode(false);
-  }
-}
-
-var el = _.cloneWith(document.body, customizer);
-
-console.log(el === document.body);
-// => false
-console.log(el.nodeName);
-// => 'BODY'
-console.log(el.childNodes.length);
-// => 0
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_eqvalue-other"></a>`_.eq(value, other)`
-<a href="#_eqvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10350 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.eq "See the npm package")
-
-Performs a
-[`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-comparison between two values to determine if they are equivalent.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to compare.
-2. `other` *(&#42;)*: The other value to compare.
-
-#### Returns
-*(boolean)*: Returns `true` if the values are equivalent, else `false`.
-
-#### Example
-```js
-var object = { 'user': 'fred' };
-var other = { 'user': 'fred' };
-
-_.eq(object, object);
-// => true
-
-_.eq(object, other);
-// => false
-
-_.eq('a', 'a');
-// => true
-
-_.eq('a', Object('a'));
-// => false
-
-_.eq(NaN, NaN);
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_gtvalue-other"></a>`_.gt(value, other)`
-<a href="#_gtvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10377 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.gt "See the npm package")
-
-Checks if `value` is greater than `other`.
-
-#### Since
-3.9.0
-#### Arguments
-1. `value` *(&#42;)*: The value to compare.
-2. `other` *(&#42;)*: The other value to compare.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is greater than `other`, else `false`.
-
-#### Example
-```js
-_.gt(3, 1);
-// => true
-
-_.gt(3, 3);
-// => false
-
-_.gt(1, 3);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_gtevalue-other"></a>`_.gte(value, other)`
-<a href="#_gtevalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10402 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.gte "See the npm package")
-
-Checks if `value` is greater than or equal to `other`.
-
-#### Since
-3.9.0
-#### Arguments
-1. `value` *(&#42;)*: The value to compare.
-2. `other` *(&#42;)*: The other value to compare.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is greater than or equal to `other`, else `false`.
-
-#### Example
-```js
-_.gte(3, 1);
-// => true
-
-_.gte(3, 3);
-// => true
-
-_.gte(1, 3);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isargumentsvalue"></a>`_.isArguments(value)`
-<a href="#_isargumentsvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10424 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarguments "See the npm package")
-
-Checks if `value` is likely an `arguments` object.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isArguments(function() { return arguments; }());
-// => true
-
-_.isArguments([1, 2, 3]);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isarrayvalue"></a>`_.isArray(value)`
-<a href="#_isarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10455 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarray "See the npm package")
-
-Checks if `value` is classified as an `Array` object.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isArray([1, 2, 3]);
-// => true
-
-_.isArray(document.body.children);
-// => false
-
-_.isArray('abc');
-// => false
-
-_.isArray(_.noop);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isarraybuffervalue"></a>`_.isArrayBuffer(value)`
-<a href="#_isarraybuffervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10475 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarraybuffer "See the npm package")
-
-Checks if `value` is classified as an `ArrayBuffer` object.
-
-#### Since
-4.3.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isArrayBuffer(new ArrayBuffer(2));
-// => true
-
-_.isArrayBuffer(new Array(2));
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isarraylikevalue"></a>`_.isArrayLike(value)`
-<a href="#_isarraylikevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10504 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarraylike "See the npm package")
-
-Checks if `value` is array-like. A value is considered array-like if it's
-not a function and has a `value.length` that's an integer greater than or
-equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is array-like, else `false`.
-
-#### Example
-```js
-_.isArrayLike([1, 2, 3]);
-// => true
-
-_.isArrayLike(document.body.children);
-// => true
-
-_.isArrayLike('abc');
-// => true
-
-_.isArrayLike(_.noop);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isarraylikeobjectvalue"></a>`_.isArrayLikeObject(value)`
-<a href="#_isarraylikeobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10533 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package")
-
-This method is like `_.isArrayLike` except that it also checks if `value`
-is an object.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is an array-like object, else `false`.
-
-#### Example
-```js
-_.isArrayLikeObject([1, 2, 3]);
-// => true
-
-_.isArrayLikeObject(document.body.children);
-// => true
-
-_.isArrayLikeObject('abc');
-// => false
-
-_.isArrayLikeObject(_.noop);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isbooleanvalue"></a>`_.isBoolean(value)`
-<a href="#_isbooleanvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10555 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isboolean "See the npm package")
-
-Checks if `value` is classified as a boolean primitive or object.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isBoolean(false);
-// => true
-
-_.isBoolean(null);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isbuffervalue"></a>`_.isBuffer(value)`
-<a href="#_isbuffervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10577 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isbuffer "See the npm package")
-
-Checks if `value` is a buffer.
-
-#### Since
-4.3.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is a buffer, else `false`.
-
-#### Example
-```js
-_.isBuffer(new Buffer(2));
-// => true
-
-_.isBuffer(new Uint8Array(2));
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isdatevalue"></a>`_.isDate(value)`
-<a href="#_isdatevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10599 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isdate "See the npm package")
-
-Checks if `value` is classified as a `Date` object.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isDate(new Date);
-// => true
-
-_.isDate('Mon April 23 2012');
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_iselementvalue"></a>`_.isElement(value)`
-<a href="#_iselementvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10621 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.iselement "See the npm package")
-
-Checks if `value` is likely a DOM element.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is a DOM element, else `false`.
-
-#### Example
-```js
-_.isElement(document.body);
-// => true
-
-_.isElement('<body>');
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
-<a href="#_isemptyvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10658 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isempty "See the npm package")
-
-Checks if `value` is an empty object, collection, map, or set.
-<br>
-<br>
-Objects are considered empty if they have no own enumerable string keyed
-properties.
-<br>
-<br>
-Array-like values such as `arguments` objects, arrays, buffers, strings, or
-jQuery-like collections are considered empty if they have a `length` of `0`.
-Similarly, maps and sets are considered empty if they have a `size` of `0`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is empty, else `false`.
-
-#### Example
-```js
-_.isEmpty(null);
-// => true
-
-_.isEmpty(true);
-// => true
-
-_.isEmpty(1);
-// => true
-
-_.isEmpty([1, 2, 3]);
-// => false
-
-_.isEmpty({ 'a': 1 });
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isequalvalue-other"></a>`_.isEqual(value, other)`
-<a href="#_isequalvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10707 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isequal "See the npm package")
-
-Performs a deep comparison between two values to determine if they are
-equivalent.
-<br>
-<br>
-**Note:** This method supports comparing arrays, array buffers, booleans,
-date objects, error objects, maps, numbers, `Object` objects, regexes,
-sets, strings, symbols, and typed arrays. `Object` objects are compared
-by their own, not inherited, enumerable properties. Functions and DOM
-nodes are **not** supported.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to compare.
-2. `other` *(&#42;)*: The other value to compare.
-
-#### Returns
-*(boolean)*: Returns `true` if the values are equivalent, else `false`.
-
-#### Example
-```js
-var object = { 'user': 'fred' };
-var other = { 'user': 'fred' };
-
-_.isEqual(object, other);
-// => true
-
-object === other;
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isequalwithvalue-other-customizer"></a>`_.isEqualWith(value, other, [customizer])`
-<a href="#_isequalwithvalue-other-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10744 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isequalwith "See the npm package")
-
-This method is like `_.isEqual` except that it accepts `customizer` which
-is invoked to compare values. If `customizer` returns `undefined`, comparisons
-are handled by the method instead. The `customizer` is invoked with up to
-six arguments: *(objValue, othValue [, index|key, object, other, stack])*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to compare.
-2. `other` *(&#42;)*: The other value to compare.
-3. `[customizer]` *(Function)*: The function to customize comparisons.
-
-#### Returns
-*(boolean)*: Returns `true` if the values are equivalent, else `false`.
-
-#### Example
-```js
-function isGreeting(value) {
-  return /^h(?:i|ello)$/.test(value);
-}
-
-function customizer(objValue, othValue) {
-  if (isGreeting(objValue) && isGreeting(othValue)) {
-    return true;
-  }
-}
-
-var array = ['hello', 'goodbye'];
-var other = ['hi', 'goodbye'];
-
-_.isEqualWith(array, other, customizer);
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_iserrorvalue"></a>`_.isError(value)`
-<a href="#_iserrorvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10769 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.iserror "See the npm package")
-
-Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
-`SyntaxError`, `TypeError`, or `URIError` object.
-
-#### Since
-3.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is an error object, else `false`.
-
-#### Example
-```js
-_.isError(new Error);
-// => true
-
-_.isError(Error);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isfinitevalue"></a>`_.isFinite(value)`
-<a href="#_isfinitevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10804 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isfinite "See the npm package")
-
-Checks if `value` is a finite primitive number.
-<br>
-<br>
-**Note:** This method is based on
-[`Number.isFinite`](https://mdn.io/Number/isFinite).
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is a finite number, else `false`.
-
-#### Example
-```js
-_.isFinite(3);
-// => true
-
-_.isFinite(Number.MAX_VALUE);
-// => true
-
-_.isFinite(3.14);
-// => true
-
-_.isFinite(Infinity);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
-<a href="#_isfunctionvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10826 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isfunction "See the npm package")
-
-Checks if `value` is classified as a `Function` object.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isFunction(_);
-// => true
-
-_.isFunction(/abc/);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isintegervalue"></a>`_.isInteger(value)`
-<a href="#_isintegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10860 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isinteger "See the npm package")
-
-Checks if `value` is an integer.
-<br>
-<br>
-**Note:** This method is based on
-[`Number.isInteger`](https://mdn.io/Number/isInteger).
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is an integer, else `false`.
-
-#### Example
-```js
-_.isInteger(3);
-// => true
-
-_.isInteger(Number.MIN_VALUE);
-// => false
-
-_.isInteger(Infinity);
-// => false
-
-_.isInteger('3');
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_islengthvalue"></a>`_.isLength(value)`
-<a href="#_islengthvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10891 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.islength "See the npm package")
-
-Checks if `value` is a valid array-like length.
-<br>
-<br>
-**Note:** This function is loosely based on
-[`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is a valid length, else `false`.
-
-#### Example
-```js
-_.isLength(3);
-// => true
-
-_.isLength(Number.MIN_VALUE);
-// => false
-
-_.isLength(Infinity);
-// => false
-
-_.isLength('3');
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_ismapvalue"></a>`_.isMap(value)`
-<a href="#_ismapvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10972 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ismap "See the npm package")
-
-Checks if `value` is classified as a `Map` object.
-
-#### Since
-4.3.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isMap(new Map);
-// => true
-
-_.isMap(new WeakMap);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_ismatchobject-source"></a>`_.isMatch(object, source)`
-<a href="#_ismatchobject-source">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11000 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ismatch "See the npm package")
-
-Performs a partial deep comparison between `object` and `source` to
-determine if `object` contains equivalent property values. This method is
-equivalent to a `_.matches` function when `source` is partially applied.
-<br>
-<br>
-**Note:** This method supports comparing the same values as `_.isEqual`.
-
-#### Since
-3.0.0
-#### Arguments
-1. `object` *(Object)*: The object to inspect.
-2. `source` *(Object)*: The object of property values to match.
-
-#### Returns
-*(boolean)*: Returns `true` if `object` is a match, else `false`.
-
-#### Example
-```js
-var object = { 'user': 'fred', 'age': 40 };
-
-_.isMatch(object, { 'age': 40 });
-// => true
-
-_.isMatch(object, { 'age': 36 });
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_ismatchwithobject-source-customizer"></a>`_.isMatchWith(object, source, [customizer])`
-<a href="#_ismatchwithobject-source-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11036 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package")
-
-This method is like `_.isMatch` except that it accepts `customizer` which
-is invoked to compare values. If `customizer` returns `undefined`, comparisons
-are handled by the method instead. The `customizer` is invoked with five
-arguments: *(objValue, srcValue, index|key, object, source)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `object` *(Object)*: The object to inspect.
-2. `source` *(Object)*: The object of property values to match.
-3. `[customizer]` *(Function)*: The function to customize comparisons.
-
-#### Returns
-*(boolean)*: Returns `true` if `object` is a match, else `false`.
-
-#### Example
-```js
-function isGreeting(value) {
-  return /^h(?:i|ello)$/.test(value);
-}
-
-function customizer(objValue, srcValue) {
-  if (isGreeting(objValue) && isGreeting(srcValue)) {
-    return true;
-  }
-}
-
-var object = { 'greeting': 'hello' };
-var source = { 'greeting': 'hi' };
-
-_.isMatchWith(object, source, customizer);
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isnanvalue"></a>`_.isNaN(value)`
-<a href="#_isnanvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11069 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnan "See the npm package")
-
-Checks if `value` is `NaN`.
-<br>
-<br>
-**Note:** This method is based on
-[`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
-global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
-`undefined` and other non-number values.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is `NaN`, else `false`.
-
-#### Example
-```js
-_.isNaN(NaN);
-// => true
-
-_.isNaN(new Number(NaN));
-// => true
-
-isNaN(undefined);
-// => true
-
-_.isNaN(undefined);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isnativevalue"></a>`_.isNative(value)`
-<a href="#_isnativevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11094 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnative "See the npm package")
-
-Checks if `value` is a native function.
-
-#### Since
-3.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is a native function, else `false`.
-
-#### Example
-```js
-_.isNative(Array.prototype.push);
-// => true
-
-_.isNative(_);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isnilvalue"></a>`_.isNil(value)`
-<a href="#_isnilvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11143 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnil "See the npm package")
-
-Checks if `value` is `null` or `undefined`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is nullish, else `false`.
-
-#### Example
-```js
-_.isNil(null);
-// => true
-
-_.isNil(void 0);
-// => true
-
-_.isNil(NaN);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isnullvalue"></a>`_.isNull(value)`
-<a href="#_isnullvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11119 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnull "See the npm package")
-
-Checks if `value` is `null`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is `null`, else `false`.
-
-#### Example
-```js
-_.isNull(null);
-// => true
-
-_.isNull(void 0);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isnumbervalue"></a>`_.isNumber(value)`
-<a href="#_isnumbervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11174 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnumber "See the npm package")
-
-Checks if `value` is classified as a `Number` primitive or object.
-<br>
-<br>
-**Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
-classified as numbers, use the `_.isFinite` method.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isNumber(3);
-// => true
-
-_.isNumber(Number.MIN_VALUE);
-// => true
-
-_.isNumber(Infinity);
-// => true
-
-_.isNumber('3');
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isobjectvalue"></a>`_.isObject(value)`
-<a href="#_isobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10921 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isobject "See the npm package")
-
-Checks if `value` is the
-[language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
-of `Object`. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)*
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is an object, else `false`.
-
-#### Example
-```js
-_.isObject({});
-// => true
-
-_.isObject([1, 2, 3]);
-// => true
-
-_.isObject(_.noop);
-// => true
-
-_.isObject(null);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isobjectlikevalue"></a>`_.isObjectLike(value)`
-<a href="#_isobjectlikevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10950 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package")
-
-Checks if `value` is object-like. A value is object-like if it's not `null`
-and has a `typeof` result of "object".
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is object-like, else `false`.
-
-#### Example
-```js
-_.isObjectLike({});
-// => true
-
-_.isObjectLike([1, 2, 3]);
-// => true
-
-_.isObjectLike(_.noop);
-// => false
-
-_.isObjectLike(null);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isplainobjectvalue"></a>`_.isPlainObject(value)`
-<a href="#_isplainobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11208 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isplainobject "See the npm package")
-
-Checks if `value` is a plain object, that is, an object created by the
-`Object` constructor or one with a `[[Prototype]]` of `null`.
-
-#### Since
-0.8.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is a plain object, else `false`.
-
-#### Example
-```js
-function Foo() {
-  this.a = 1;
-}
-
-_.isPlainObject(new Foo);
-// => false
-
-_.isPlainObject([1, 2, 3]);
-// => false
-
-_.isPlainObject({ 'x': 0, 'y': 0 });
-// => true
-
-_.isPlainObject(Object.create(null));
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
-<a href="#_isregexpvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11240 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isregexp "See the npm package")
-
-Checks if `value` is classified as a `RegExp` object.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isRegExp(/abc/);
-// => true
-
-_.isRegExp('/abc/');
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_issafeintegervalue"></a>`_.isSafeInteger(value)`
-<a href="#_issafeintegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11272 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package")
-
-Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
-double precision number which isn't the result of a rounded unsafe integer.
-<br>
-<br>
-**Note:** This method is based on
-[`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is a safe integer, else `false`.
-
-#### Example
-```js
-_.isSafeInteger(3);
-// => true
-
-_.isSafeInteger(Number.MIN_VALUE);
-// => false
-
-_.isSafeInteger(Infinity);
-// => false
-
-_.isSafeInteger('3');
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_issetvalue"></a>`_.isSet(value)`
-<a href="#_issetvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11294 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isset "See the npm package")
-
-Checks if `value` is classified as a `Set` object.
-
-#### Since
-4.3.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isSet(new Set);
-// => true
-
-_.isSet(new WeakSet);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isstringvalue"></a>`_.isString(value)`
-<a href="#_isstringvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11316 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isstring "See the npm package")
-
-Checks if `value` is classified as a `String` primitive or object.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isString('abc');
-// => true
-
-_.isString(1);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_issymbolvalue"></a>`_.isSymbol(value)`
-<a href="#_issymbolvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11339 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.issymbol "See the npm package")
-
-Checks if `value` is classified as a `Symbol` primitive or object.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isSymbol(Symbol.iterator);
-// => true
-
-_.isSymbol('abc');
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_istypedarrayvalue"></a>`_.isTypedArray(value)`
-<a href="#_istypedarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11362 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.istypedarray "See the npm package")
-
-Checks if `value` is classified as a typed array.
-
-#### Since
-3.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isTypedArray(new Uint8Array);
-// => true
-
-_.isTypedArray([]);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
-<a href="#_isundefinedvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11384 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isundefined "See the npm package")
-
-Checks if `value` is `undefined`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is `undefined`, else `false`.
-
-#### Example
-```js
-_.isUndefined(void 0);
-// => true
-
-_.isUndefined(null);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isweakmapvalue"></a>`_.isWeakMap(value)`
-<a href="#_isweakmapvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11406 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isweakmap "See the npm package")
-
-Checks if `value` is classified as a `WeakMap` object.
-
-#### Since
-4.3.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isWeakMap(new WeakMap);
-// => true
-
-_.isWeakMap(new Map);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_isweaksetvalue"></a>`_.isWeakSet(value)`
-<a href="#_isweaksetvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11428 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isweakset "See the npm package")
-
-Checks if `value` is classified as a `WeakSet` object.
-
-#### Since
-4.3.0
-#### Arguments
-1. `value` *(&#42;)*: The value to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
-
-#### Example
-```js
-_.isWeakSet(new WeakSet);
-// => true
-
-_.isWeakSet(new Set);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_ltvalue-other"></a>`_.lt(value, other)`
-<a href="#_ltvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11455 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lt "See the npm package")
-
-Checks if `value` is less than `other`.
-
-#### Since
-3.9.0
-#### Arguments
-1. `value` *(&#42;)*: The value to compare.
-2. `other` *(&#42;)*: The other value to compare.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is less than `other`, else `false`.
-
-#### Example
-```js
-_.lt(1, 3);
-// => true
-
-_.lt(3, 3);
-// => false
-
-_.lt(3, 1);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_ltevalue-other"></a>`_.lte(value, other)`
-<a href="#_ltevalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11480 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lte "See the npm package")
-
-Checks if `value` is less than or equal to `other`.
-
-#### Since
-3.9.0
-#### Arguments
-1. `value` *(&#42;)*: The value to compare.
-2. `other` *(&#42;)*: The other value to compare.
-
-#### Returns
-*(boolean)*: Returns `true` if `value` is less than or equal to `other`, else `false`.
-
-#### Example
-```js
-_.lte(1, 3);
-// => true
-
-_.lte(3, 3);
-// => true
-
-_.lte(3, 1);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_toarrayvalue"></a>`_.toArray(value)`
-<a href="#_toarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11507 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.toarray "See the npm package")
-
-Converts `value` to an array.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to convert.
-
-#### Returns
-*(Array)*: Returns the converted array.
-
-#### Example
-```js
-_.toArray({ 'a': 1, 'b': 2 });
-// => [1, 2]
-
-_.toArray('abc');
-// => ['a', 'b', 'c']
-
-_.toArray(1);
-// => []
-
-_.toArray(null);
-// => []
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_tointegervalue"></a>`_.toInteger(value)`
-<a href="#_tointegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11549 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tointeger "See the npm package")
-
-Converts `value` to an integer.
-<br>
-<br>
-**Note:** This function is loosely based on
-[`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to convert.
-
-#### Returns
-*(number)*: Returns the converted integer.
-
-#### Example
-```js
-_.toInteger(3);
-// => 3
-
-_.toInteger(Number.MIN_VALUE);
-// => 0
-
-_.toInteger(Infinity);
-// => 1.7976931348623157e+308
-
-_.toInteger('3');
-// => 3
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_tolengthvalue"></a>`_.toLength(value)`
-<a href="#_tolengthvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11589 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tolength "See the npm package")
-
-Converts `value` to an integer suitable for use as the length of an
-array-like object.
-<br>
-<br>
-**Note:** This method is based on
-[`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to convert.
-
-#### Returns
-*(number)*: Returns the converted integer.
-
-#### Example
-```js
-_.toLength(3);
-// => 3
-
-_.toLength(Number.MIN_VALUE);
-// => 0
-
-_.toLength(Infinity);
-// => 4294967295
-
-_.toLength('3');
-// => 3
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_tonumbervalue"></a>`_.toNumber(value)`
-<a href="#_tonumbervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11616 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tonumber "See the npm package")
-
-Converts `value` to a number.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to process.
-
-#### Returns
-*(number)*: Returns the number.
-
-#### Example
-```js
-_.toNumber(3);
-// => 3
-
-_.toNumber(Number.MIN_VALUE);
-// => 5e-324
-
-_.toNumber(Infinity);
-// => Infinity
-
-_.toNumber('3');
-// => 3
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_toplainobjectvalue"></a>`_.toPlainObject(value)`
-<a href="#_toplainobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11661 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.toplainobject "See the npm package")
-
-Converts `value` to a plain object flattening inherited enumerable string
-keyed properties of `value` to own properties of the plain object.
-
-#### Since
-3.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to convert.
-
-#### Returns
-*(Object)*: Returns the converted plain object.
-
-#### Example
-```js
-function Foo() {
-  this.b = 2;
-}
-
-Foo.prototype.c = 3;
-
-_.assign({ 'a': 1 }, new Foo);
-// => { 'a': 1, 'b': 2 }
-
-_.assign({ 'a': 1 }, _.toPlainObject(new Foo));
-// => { 'a': 1, 'b': 2, 'c': 3 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_tosafeintegervalue"></a>`_.toSafeInteger(value)`
-<a href="#_tosafeintegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11689 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package")
-
-Converts `value` to a safe integer. A safe integer can be compared and
-represented correctly.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to convert.
-
-#### Returns
-*(number)*: Returns the converted integer.
-
-#### Example
-```js
-_.toSafeInteger(3);
-// => 3
-
-_.toSafeInteger(Number.MIN_VALUE);
-// => 0
-
-_.toSafeInteger(Infinity);
-// => 9007199254740991
-
-_.toSafeInteger('3');
-// => 3
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_tostringvalue"></a>`_.toString(value)`
-<a href="#_tostringvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11714 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tostring "See the npm package")
-
-Converts `value` to a string. An empty string is returned for `null`
-and `undefined` values. The sign of `-0` is preserved.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to process.
-
-#### Returns
-*(string)*: Returns the string.
-
-#### Example
-```js
-_.toString(null);
-// => ''
-
-_.toString(-0);
-// => '-0'
-
-_.toString([1, 2, 3]);
-// => '1,2,3'
-```
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `“Math” Methods`
-
-<!-- div -->
-
-### <a id="_addaugend-addend"></a>`_.add(augend, addend)`
-<a href="#_addaugend-addend">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15229 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.add "See the npm package")
-
-Adds two numbers.
-
-#### Since
-3.4.0
-#### Arguments
-1. `augend` *(number)*: The first number in an addition.
-2. `addend` *(number)*: The second number in an addition.
-
-#### Returns
-*(number)*: Returns the total.
-
-#### Example
-```js
-_.add(6, 4);
-// => 10
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_ceilnumber-precision0"></a>`_.ceil(number, [precision=0])`
-<a href="#_ceilnumber-precision0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15254 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ceil "See the npm package")
-
-Computes `number` rounded up to `precision`.
-
-#### Since
-3.10.0
-#### Arguments
-1. `number` *(number)*: The number to round up.
-2. `[precision=0]` *(number)*: The precision to round up to.
-
-#### Returns
-*(number)*: Returns the rounded up number.
-
-#### Example
-```js
-_.ceil(4.006);
-// => 5
-
-_.ceil(6.004, 2);
-// => 6.01
-
-_.ceil(6040, -2);
-// => 6100
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_dividedividend-divisor"></a>`_.divide(dividend, divisor)`
-<a href="#_dividedividend-divisor">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15271 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.divide "See the npm package")
-
-Divide two numbers.
-
-#### Since
-4.7.0
-#### Arguments
-1. `dividend` *(number)*: The first number in a division.
-2. `divisor` *(number)*: The second number in a division.
-
-#### Returns
-*(number)*: Returns the quotient.
-
-#### Example
-```js
-_.divide(6, 4);
-// => 1.5
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_floornumber-precision0"></a>`_.floor(number, [precision=0])`
-<a href="#_floornumber-precision0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15296 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.floor "See the npm package")
-
-Computes `number` rounded down to `precision`.
-
-#### Since
-3.10.0
-#### Arguments
-1. `number` *(number)*: The number to round down.
-2. `[precision=0]` *(number)*: The precision to round down to.
-
-#### Returns
-*(number)*: Returns the rounded down number.
-
-#### Example
-```js
-_.floor(4.006);
-// => 4
-
-_.floor(0.046, 2);
-// => 0.04
-
-_.floor(4060, -2);
-// => 4000
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_maxarray"></a>`_.max(array)`
-<a href="#_maxarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15316 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.max "See the npm package")
-
-Computes the maximum value of `array`. If `array` is empty or falsey,
-`undefined` is returned.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to iterate over.
-
-#### Returns
-*(&#42;)*: Returns the maximum value.
-
-#### Example
-```js
-_.max([4, 2, 8, 6]);
-// => 8
-
-_.max([]);
-// => undefined
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_maxbyarray-iteratee_identity"></a>`_.maxBy(array, [iteratee=_.identity])`
-<a href="#_maxbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15346 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.maxby "See the npm package")
-
-This method is like `_.max` except that it accepts `iteratee` which is
-invoked for each element in `array` to generate the criterion by which
-the value is ranked. The iteratee is invoked with one argument: *(value)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(&#42;)*: Returns the maximum value.
-
-#### Example
-```js
-var objects = [{ 'n': 1 }, { 'n': 2 }];
-
-_.maxBy(objects, function(o) { return o.n; });
-// => { 'n': 2 }
-
-// The `_.property` iteratee shorthand.
-_.maxBy(objects, 'n');
-// => { 'n': 2 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_meanarray"></a>`_.mean(array)`
-<a href="#_meanarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15366 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mean "See the npm package")
-
-Computes the mean of the values in `array`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to iterate over.
-
-#### Returns
-*(number)*: Returns the mean.
-
-#### Example
-```js
-_.mean([4, 2, 8, 6]);
-// => 5
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_meanbyarray-iteratee_identity"></a>`_.meanBy(array, [iteratee=_.identity])`
-<a href="#_meanbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15394 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.meanby "See the npm package")
-
-This method is like `_.mean` except that it accepts `iteratee` which is
-invoked for each element in `array` to generate the value to be averaged.
-The iteratee is invoked with one argument: *(value)*.
-
-#### Since
-4.7.0
-#### Arguments
-1. `array` *(Array)*: The array to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(number)*: Returns the mean.
-
-#### Example
-```js
-var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
-
-_.meanBy(objects, function(o) { return o.n; });
-// => 5
-
-// The `_.property` iteratee shorthand.
-_.meanBy(objects, 'n');
-// => 5
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_minarray"></a>`_.min(array)`
-<a href="#_minarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15416 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.min "See the npm package")
-
-Computes the minimum value of `array`. If `array` is empty or falsey,
-`undefined` is returned.
-
-#### Since
-0.1.0
-#### Arguments
-1. `array` *(Array)*: The array to iterate over.
-
-#### Returns
-*(&#42;)*: Returns the minimum value.
-
-#### Example
-```js
-_.min([4, 2, 8, 6]);
-// => 2
-
-_.min([]);
-// => undefined
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_minbyarray-iteratee_identity"></a>`_.minBy(array, [iteratee=_.identity])`
-<a href="#_minbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15446 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.minby "See the npm package")
-
-This method is like `_.min` except that it accepts `iteratee` which is
-invoked for each element in `array` to generate the criterion by which
-the value is ranked. The iteratee is invoked with one argument: *(value)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(&#42;)*: Returns the minimum value.
-
-#### Example
-```js
-var objects = [{ 'n': 1 }, { 'n': 2 }];
-
-_.minBy(objects, function(o) { return o.n; });
-// => { 'n': 1 }
-
-// The `_.property` iteratee shorthand.
-_.minBy(objects, 'n');
-// => { 'n': 1 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_multiplymultiplier-multiplicand"></a>`_.multiply(multiplier, multiplicand)`
-<a href="#_multiplymultiplier-multiplicand">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15467 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.multiply "See the npm package")
-
-Multiply two numbers.
-
-#### Since
-4.7.0
-#### Arguments
-1. `multiplier` *(number)*: The first number in a multiplication.
-2. `multiplicand` *(number)*: The second number in a multiplication.
-
-#### Returns
-*(number)*: Returns the product.
-
-#### Example
-```js
-_.multiply(6, 4);
-// => 24
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_roundnumber-precision0"></a>`_.round(number, [precision=0])`
-<a href="#_roundnumber-precision0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15492 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.round "See the npm package")
-
-Computes `number` rounded to `precision`.
-
-#### Since
-3.10.0
-#### Arguments
-1. `number` *(number)*: The number to round.
-2. `[precision=0]` *(number)*: The precision to round to.
-
-#### Returns
-*(number)*: Returns the rounded number.
-
-#### Example
-```js
-_.round(4.006);
-// => 4
-
-_.round(4.006, 2);
-// => 4.01
-
-_.round(4060, -2);
-// => 4100
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_subtractminuend-subtrahend"></a>`_.subtract(minuend, subtrahend)`
-<a href="#_subtractminuend-subtrahend">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15509 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.subtract "See the npm package")
-
-Subtract two numbers.
-
-#### Since
-4.0.0
-#### Arguments
-1. `minuend` *(number)*: The first number in a subtraction.
-2. `subtrahend` *(number)*: The second number in a subtraction.
-
-#### Returns
-*(number)*: Returns the difference.
-
-#### Example
-```js
-_.subtract(6, 4);
-// => 2
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sumarray"></a>`_.sum(array)`
-<a href="#_sumarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15527 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sum "See the npm package")
-
-Computes the sum of the values in `array`.
-
-#### Since
-3.4.0
-#### Arguments
-1. `array` *(Array)*: The array to iterate over.
-
-#### Returns
-*(number)*: Returns the sum.
-
-#### Example
-```js
-_.sum([4, 2, 8, 6]);
-// => 20
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_sumbyarray-iteratee_identity"></a>`_.sumBy(array, [iteratee=_.identity])`
-<a href="#_sumbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15557 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sumby "See the npm package")
-
-This method is like `_.sum` except that it accepts `iteratee` which is
-invoked for each element in `array` to generate the value to be summed.
-The iteratee is invoked with one argument: *(value)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `array` *(Array)*: The array to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(number)*: Returns the sum.
-
-#### Example
-```js
-var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
-
-_.sumBy(objects, function(o) { return o.n; });
-// => 20
-
-// The `_.property` iteratee shorthand.
-_.sumBy(objects, 'n');
-// => 20
-```
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `“Number” Methods`
-
-<!-- div -->
-
-### <a id="_clampnumber-lower-upper"></a>`_.clamp(number, [lower], upper)`
-<a href="#_clampnumber-lower-upper">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13139 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clamp "See the npm package")
-
-Clamps `number` within the inclusive `lower` and `upper` bounds.
-
-#### Since
-4.0.0
-#### Arguments
-1. `number` *(number)*: The number to clamp.
-2. `[lower]` *(number)*: The lower bound.
-3. `upper` *(number)*: The upper bound.
-
-#### Returns
-*(number)*: Returns the clamped number.
-
-#### Example
-```js
-_.clamp(-10, -5, 5);
-// => -5
-
-_.clamp(10, -5, 5);
-// => 5
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_inrangenumber-start0-end"></a>`_.inRange(number, [start=0], end)`
-<a href="#_inrangenumber-start0-end">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13193 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.inrange "See the npm package")
-
-Checks if `n` is between `start` and up to, but not including, `end`. If
-`end` is not specified, it's set to `start` with `start` then set to `0`.
-If `start` is greater than `end` the params are swapped to support
-negative ranges.
-
-#### Since
-3.3.0
-#### Arguments
-1. `number` *(number)*: The number to check.
-2. `[start=0]` *(number)*: The start of the range.
-3. `end` *(number)*: The end of the range.
-
-#### Returns
-*(boolean)*: Returns `true` if `number` is in the range, else `false`.
-
-#### Example
-```js
-_.inRange(3, 2, 4);
-// => true
-
-_.inRange(4, 8);
-// => true
-
-_.inRange(4, 2);
-// => false
-
-_.inRange(2, 2);
-// => false
-
-_.inRange(1.2, 2);
-// => true
-
-_.inRange(5.2, 4);
-// => false
-
-_.inRange(-3, -2, -6);
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_randomlower0-upper1-floating"></a>`_.random([lower=0], [upper=1], [floating])`
-<a href="#_randomlower0-upper1-floating">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13236 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.random "See the npm package")
-
-Produces a random number between the inclusive `lower` and `upper` bounds.
-If only one argument is provided a number between `0` and the given number
-is returned. If `floating` is `true`, or either `lower` or `upper` are
-floats, a floating-point number is returned instead of an integer.
-<br>
-<br>
-**Note:** JavaScript follows the IEEE-754 standard for resolving
-floating-point values which can produce unexpected results.
-
-#### Since
-0.7.0
-#### Arguments
-1. `[lower=0]` *(number)*: The lower bound.
-2. `[upper=1]` *(number)*: The upper bound.
-3. `[floating]` *(boolean)*: Specify returning a floating-point number.
-
-#### Returns
-*(number)*: Returns the random number.
-
-#### Example
-```js
-_.random(0, 5);
-// => an integer between 0 and 5
-
-_.random(5);
-// => also an integer between 0 and 5
-
-_.random(5, true);
-// => a floating-point number between 0 and 5
-
-_.random(1.2, 5.2);
-// => a floating-point number between 1.2 and 5.2
-```
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `“Object” Methods`
-
-<!-- div -->
-
-### <a id="_assignobject-sources"></a>`_.assign(object, [sources])`
-<a href="#_assignobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11752 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assign "See the npm package")
-
-Assigns own enumerable string keyed properties of source objects to the
-destination object. Source objects are applied from left to right.
-Subsequent sources overwrite property assignments of previous sources.
-<br>
-<br>
-**Note:** This method mutates `object` and is loosely based on
-[`Object.assign`](https://mdn.io/Object/assign).
-
-#### Since
-0.10.0
-#### Arguments
-1. `object` *(Object)*: The destination object.
-2. `[sources]` *(...Object)*: The source objects.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-function Foo() {
-  this.c = 3;
-}
-
-function Bar() {
-  this.e = 5;
-}
-
-Foo.prototype.d = 4;
-Bar.prototype.f = 6;
-
-_.assign({ 'a': 1 }, new Foo, new Bar);
-// => { 'a': 1, 'c': 3, 'e': 5 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_assigninobject-sources"></a>`_.assignIn(object, [sources])`
-<a href="#_assigninobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11795 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assignin "See the npm package")
-
-This method is like `_.assign` except that it iterates over own and
-inherited source properties.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-4.0.0
-#### Aliases
-*_.extend*
-
-#### Arguments
-1. `object` *(Object)*: The destination object.
-2. `[sources]` *(...Object)*: The source objects.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-function Foo() {
-  this.b = 2;
-}
-
-function Bar() {
-  this.d = 4;
-}
-
-Foo.prototype.c = 3;
-Bar.prototype.e = 5;
-
-_.assignIn({ 'a': 1 }, new Foo, new Bar);
-// => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_assigninwithobject-sources-customizer"></a>`_.assignInWith(object, sources, [customizer])`
-<a href="#_assigninwithobject-sources-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11834 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assigninwith "See the npm package")
-
-This method is like `_.assignIn` except that it accepts `customizer`
-which is invoked to produce the assigned values. If `customizer` returns
-`undefined`, assignment is handled by the method instead. The `customizer`
-is invoked with five arguments: *(objValue, srcValue, key, object, source)*.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-4.0.0
-#### Aliases
-*_.extendWith*
-
-#### Arguments
-1. `object` *(Object)*: The destination object.
-2. `sources` *(...Object)*: The source objects.
-3. `[customizer]` *(Function)*: The function to customize assigned values.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-function customizer(objValue, srcValue) {
-  return _.isUndefined(objValue) ? srcValue : objValue;
-}
-
-var defaults = _.partialRight(_.assignInWith, customizer);
-
-defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
-// => { 'a': 1, 'b': 2 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_assignwithobject-sources-customizer"></a>`_.assignWith(object, sources, [customizer])`
-<a href="#_assignwithobject-sources-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11866 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assignwith "See the npm package")
-
-This method is like `_.assign` except that it accepts `customizer`
-which is invoked to produce the assigned values. If `customizer` returns
-`undefined`, assignment is handled by the method instead. The `customizer`
-is invoked with five arguments: *(objValue, srcValue, key, object, source)*.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `object` *(Object)*: The destination object.
-2. `sources` *(...Object)*: The source objects.
-3. `[customizer]` *(Function)*: The function to customize assigned values.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-function customizer(objValue, srcValue) {
-  return _.isUndefined(objValue) ? srcValue : objValue;
-}
-
-var defaults = _.partialRight(_.assignWith, customizer);
-
-defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
-// => { 'a': 1, 'b': 2 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_atobject-paths"></a>`_.at(object, [paths])`
-<a href="#_atobject-paths">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11890 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.at "See the npm package")
-
-Creates an array of values corresponding to `paths` of `object`.
-
-#### Since
-1.0.0
-#### Arguments
-1. `object` *(Object)*: The object to iterate over.
-2. `[paths]` *(...(string|string&#91;&#93;))*: The property paths of elements to pick.
-
-#### Returns
-*(Array)*: Returns the new array of picked elements.
-
-#### Example
-```js
-var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
-
-_.at(object, ['a[0].b.c', 'a[1]']);
-// => [3, 4]
-
-_.at(['a', 'b', 'c'], 0, 2);
-// => ['a', 'c']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_createprototype-properties"></a>`_.create(prototype, [properties])`
-<a href="#_createprototype-properties">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11928 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.create "See the npm package")
-
-Creates an object that inherits from the `prototype` object. If a
-`properties` object is given, its own enumerable string keyed properties
-are assigned to the created object.
-
-#### Since
-2.3.0
-#### Arguments
-1. `prototype` *(Object)*: The object to inherit from.
-2. `[properties]` *(Object)*: The properties to assign to the object.
-
-#### Returns
-*(Object)*: Returns the new object.
-
-#### Example
-```js
-function Shape() {
-  this.x = 0;
-  this.y = 0;
-}
-
-function Circle() {
-  Shape.call(this);
-}
-
-Circle.prototype = _.create(Shape.prototype, {
-  'constructor': Circle
-});
-
-var circle = new Circle;
-circle instanceof Circle;
-// => true
-
-circle instanceof Shape;
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_defaultsobject-sources"></a>`_.defaults(object, [sources])`
-<a href="#_defaultsobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11954 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.defaults "See the npm package")
-
-Assigns own and inherited enumerable string keyed properties of source
-objects to the destination object for all destination properties that
-resolve to `undefined`. Source objects are applied from left to right.
-Once a property is set, additional values of the same property are ignored.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `object` *(Object)*: The destination object.
-2. `[sources]` *(...Object)*: The source objects.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-_.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
-// => { 'user': 'barney', 'age': 36 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_defaultsdeepobject-sources"></a>`_.defaultsDeep(object, [sources])`
-<a href="#_defaultsdeepobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11979 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package")
-
-This method is like `_.defaults` except that it recursively assigns
-default properties.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-3.10.0
-#### Arguments
-1. `object` *(Object)*: The destination object.
-2. `[sources]` *(...Object)*: The source objects.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-_.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
-// => { 'user': { 'name': 'barney', 'age': 36 } }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_findkeyobject-predicate_identity"></a>`_.findKey(object, [predicate=_.identity])`
-<a href="#_findkeyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12020 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findkey "See the npm package")
-
-This method is like `_.find` except that it returns the key of the first
-element `predicate` returns truthy for instead of the element itself.
-
-#### Since
-1.1.0
-#### Arguments
-1. `object` *(Object)*: The object to search.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(&#42;)*: Returns the key of the matched element, else `undefined`.
-
-#### Example
-```js
-var users = {
-  'barney':  { 'age': 36, 'active': true },
-  'fred':    { 'age': 40, 'active': false },
-  'pebbles': { 'age': 1,  'active': true }
-};
-
-_.findKey(users, function(o) { return o.age < 40; });
-// => 'barney' (iteration order is not guaranteed)
-
-// The `_.matches` iteratee shorthand.
-_.findKey(users, { 'age': 1, 'active': true });
-// => 'pebbles'
-
-// The `_.matchesProperty` iteratee shorthand.
-_.findKey(users, ['active', false]);
-// => 'fred'
-
-// The `_.property` iteratee shorthand.
-_.findKey(users, 'active');
-// => 'barney'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_findlastkeyobject-predicate_identity"></a>`_.findLastKey(object, [predicate=_.identity])`
-<a href="#_findlastkeyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12060 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findlastkey "See the npm package")
-
-This method is like `_.findKey` except that it iterates over elements of
-a collection in the opposite order.
-
-#### Since
-2.0.0
-#### Arguments
-1. `object` *(Object)*: The object to search.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(&#42;)*: Returns the key of the matched element, else `undefined`.
-
-#### Example
-```js
-var users = {
-  'barney':  { 'age': 36, 'active': true },
-  'fred':    { 'age': 40, 'active': false },
-  'pebbles': { 'age': 1,  'active': true }
-};
-
-_.findLastKey(users, function(o) { return o.age < 40; });
-// => returns 'pebbles' assuming `_.findKey` returns 'barney'
-
-// The `_.matches` iteratee shorthand.
-_.findLastKey(users, { 'age': 36, 'active': true });
-// => 'barney'
-
-// The `_.matchesProperty` iteratee shorthand.
-_.findLastKey(users, ['active', false]);
-// => 'fred'
-
-// The `_.property` iteratee shorthand.
-_.findLastKey(users, 'active');
-// => 'pebbles'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_forinobject-iteratee_identity"></a>`_.forIn(object, [iteratee=_.identity])`
-<a href="#_forinobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12092 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forin "See the npm package")
-
-Iterates over own and inherited enumerable string keyed properties of an
-object and invokes `iteratee` for each property. The iteratee is invoked
-with three arguments: *(value, key, object)*. Iteratee functions may exit
-iteration early by explicitly returning `false`.
-
-#### Since
-0.3.0
-#### Arguments
-1. `object` *(Object)*: The object to iterate over.
-2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-function Foo() {
-  this.a = 1;
-  this.b = 2;
-}
-
-Foo.prototype.c = 3;
-
-_.forIn(new Foo, function(value, key) {
-  console.log(key);
-});
-// => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_forinrightobject-iteratee_identity"></a>`_.forInRight(object, [iteratee=_.identity])`
-<a href="#_forinrightobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12124 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forinright "See the npm package")
-
-This method is like `_.forIn` except that it iterates over properties of
-`object` in the opposite order.
-
-#### Since
-2.0.0
-#### Arguments
-1. `object` *(Object)*: The object to iterate over.
-2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-function Foo() {
-  this.a = 1;
-  this.b = 2;
-}
-
-Foo.prototype.c = 3;
-
-_.forInRight(new Foo, function(value, key) {
-  console.log(key);
-});
-// => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_forownobject-iteratee_identity"></a>`_.forOwn(object, [iteratee=_.identity])`
-<a href="#_forownobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12158 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forown "See the npm package")
-
-Iterates over own enumerable string keyed properties of an object and
-invokes `iteratee` for each property. The iteratee is invoked with three
-arguments: *(value, key, object)*. Iteratee functions may exit iteration
-early by explicitly returning `false`.
-
-#### Since
-0.3.0
-#### Arguments
-1. `object` *(Object)*: The object to iterate over.
-2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-function Foo() {
-  this.a = 1;
-  this.b = 2;
-}
-
-Foo.prototype.c = 3;
-
-_.forOwn(new Foo, function(value, key) {
-  console.log(key);
-});
-// => Logs 'a' then 'b' (iteration order is not guaranteed).
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_forownrightobject-iteratee_identity"></a>`_.forOwnRight(object, [iteratee=_.identity])`
-<a href="#_forownrightobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12188 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forownright "See the npm package")
-
-This method is like `_.forOwn` except that it iterates over properties of
-`object` in the opposite order.
-
-#### Since
-2.0.0
-#### Arguments
-1. `object` *(Object)*: The object to iterate over.
-2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-function Foo() {
-  this.a = 1;
-  this.b = 2;
-}
-
-Foo.prototype.c = 3;
-
-_.forOwnRight(new Foo, function(value, key) {
-  console.log(key);
-});
-// => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_functionsobject"></a>`_.functions(object)`
-<a href="#_functionsobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12215 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.functions "See the npm package")
-
-Creates an array of function property names from own enumerable properties
-of `object`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `object` *(Object)*: The object to inspect.
-
-#### Returns
-*(Array)*: Returns the new array of property names.
-
-#### Example
-```js
-function Foo() {
-  this.a = _.constant('a');
-  this.b = _.constant('b');
-}
-
-Foo.prototype.c = _.constant('c');
-
-_.functions(new Foo);
-// => ['a', 'b']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_functionsinobject"></a>`_.functionsIn(object)`
-<a href="#_functionsinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12242 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.functionsin "See the npm package")
-
-Creates an array of function property names from own and inherited
-enumerable properties of `object`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `object` *(Object)*: The object to inspect.
-
-#### Returns
-*(Array)*: Returns the new array of property names.
-
-#### Example
-```js
-function Foo() {
-  this.a = _.constant('a');
-  this.b = _.constant('b');
-}
-
-Foo.prototype.c = _.constant('c');
-
-_.functionsIn(new Foo);
-// => ['a', 'b', 'c']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_getobject-path-defaultvalue"></a>`_.get(object, path, [defaultValue])`
-<a href="#_getobject-path-defaultvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12271 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.get "See the npm package")
-
-Gets the value at `path` of `object`. If the resolved value is
-`undefined`, the `defaultValue` is used in its place.
-
-#### Since
-3.7.0
-#### Arguments
-1. `object` *(Object)*: The object to query.
-2. `path` *(Array|string)*: The path of the property to get.
-3. `[defaultValue]` *(&#42;)*: The value returned for `undefined` resolved values.
-
-#### Returns
-*(&#42;)*: Returns the resolved value.
-
-#### Example
-```js
-var object = { 'a': [{ 'b': { 'c': 3 } }] };
-
-_.get(object, 'a[0].b.c');
-// => 3
-
-_.get(object, ['a', '0', 'b', 'c']);
-// => 3
-
-_.get(object, 'a.b.c', 'default');
-// => 'default'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_hasobject-path"></a>`_.has(object, path)`
-<a href="#_hasobject-path">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12303 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.has "See the npm package")
-
-Checks if `path` is a direct property of `object`.
-
-#### Since
-0.1.0
-#### Arguments
-1. `object` *(Object)*: The object to query.
-2. `path` *(Array|string)*: The path to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `path` exists, else `false`.
-
-#### Example
-```js
-var object = { 'a': { 'b': 2 } };
-var other = _.create({ 'a': _.create({ 'b': 2 }) });
-
-_.has(object, 'a');
-// => true
-
-_.has(object, 'a.b');
-// => true
-
-_.has(object, ['a', 'b']);
-// => true
-
-_.has(other, 'a');
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_hasinobject-path"></a>`_.hasIn(object, path)`
-<a href="#_hasinobject-path">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12333 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.hasin "See the npm package")
-
-Checks if `path` is a direct or inherited property of `object`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `object` *(Object)*: The object to query.
-2. `path` *(Array|string)*: The path to check.
-
-#### Returns
-*(boolean)*: Returns `true` if `path` exists, else `false`.
-
-#### Example
-```js
-var object = _.create({ 'a': _.create({ 'b': 2 }) });
-
-_.hasIn(object, 'a');
-// => true
-
-_.hasIn(object, 'a.b');
-// => true
-
-_.hasIn(object, ['a', 'b']);
-// => true
-
-_.hasIn(object, 'b');
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_invertobject"></a>`_.invert(object)`
-<a href="#_invertobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12355 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invert "See the npm package")
-
-Creates an object composed of the inverted keys and values of `object`.
-If `object` contains duplicate values, subsequent values overwrite
-property assignments of previous values.
-
-#### Since
-0.7.0
-#### Arguments
-1. `object` *(Object)*: The object to invert.
-
-#### Returns
-*(Object)*: Returns the new inverted object.
-
-#### Example
-```js
-var object = { 'a': 1, 'b': 2, 'c': 1 };
-
-_.invert(object);
-// => { '1': 'c', '2': 'b' }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_invertbyobject-iteratee_identity"></a>`_.invertBy(object, [iteratee=_.identity])`
-<a href="#_invertbyobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12386 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invertby "See the npm package")
-
-This method is like `_.invert` except that the inverted object is generated
-from the results of running each element of `object` thru `iteratee`. The
-corresponding inverted value of each inverted key is an array of keys
-responsible for generating the inverted value. The iteratee is invoked
-with one argument: *(value)*.
-
-#### Since
-4.1.0
-#### Arguments
-1. `object` *(Object)*: The object to invert.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
-
-#### Returns
-*(Object)*: Returns the new inverted object.
-
-#### Example
-```js
-var object = { 'a': 1, 'b': 2, 'c': 1 };
-
-_.invertBy(object);
-// => { '1': ['a', 'c'], '2': ['b'] }
-
-_.invertBy(object, function(value) {
-  return 'group' + value;
-});
-// => { 'group1': ['a', 'c'], 'group2': ['b'] }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_invokeobject-path-args"></a>`_.invoke(object, path, [args])`
-<a href="#_invokeobject-path-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12412 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invoke "See the npm package")
-
-Invokes the method at `path` of `object`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `object` *(Object)*: The object to query.
-2. `path` *(Array|string)*: The path of the method to invoke.
-3. `[args]` *(...&#42;)*: The arguments to invoke the method with.
-
-#### Returns
-*(&#42;)*: Returns the result of the invoked method.
-
-#### Example
-```js
-var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
-
-_.invoke(object, 'a[0].b.c.slice', 1, 3);
-// => [2, 3]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_keysobject"></a>`_.keys(object)`
-<a href="#_keysobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12442 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.keys "See the npm package")
-
-Creates an array of the own enumerable property names of `object`.
-<br>
-<br>
-**Note:** Non-object values are coerced to objects. See the
-[ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
-for more details.
-
-#### Since
-0.1.0
-#### Arguments
-1. `object` *(Object)*: The object to query.
-
-#### Returns
-*(Array)*: Returns the array of property names.
-
-#### Example
-```js
-function Foo() {
-  this.a = 1;
-  this.b = 2;
-}
-
-Foo.prototype.c = 3;
-
-_.keys(new Foo);
-// => ['a', 'b'] (iteration order is not guaranteed)
-
-_.keys('hi');
-// => ['0', '1']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_keysinobject"></a>`_.keysIn(object)`
-<a href="#_keysinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12485 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.keysin "See the npm package")
-
-Creates an array of the own and inherited enumerable property names of `object`.
-<br>
-<br>
-**Note:** Non-object values are coerced to objects.
-
-#### Since
-3.0.0
-#### Arguments
-1. `object` *(Object)*: The object to query.
-
-#### Returns
-*(Array)*: Returns the array of property names.
-
-#### Example
-```js
-function Foo() {
-  this.a = 1;
-  this.b = 2;
-}
-
-Foo.prototype.c = 3;
-
-_.keysIn(new Foo);
-// => ['a', 'b', 'c'] (iteration order is not guaranteed)
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_mapkeysobject-iteratee_identity"></a>`_.mapKeys(object, [iteratee=_.identity])`
-<a href="#_mapkeysobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12527 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mapkeys "See the npm package")
-
-The opposite of `_.mapValues`; this method creates an object with the
-same values as `object` and keys generated by running each own enumerable
-string keyed property of `object` thru `iteratee`. The iteratee is invoked
-with three arguments: *(value, key, object)*.
-
-#### Since
-3.8.0
-#### Arguments
-1. `object` *(Object)*: The object to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Object)*: Returns the new mapped object.
-
-#### Example
-```js
-_.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
-  return key + value;
-});
-// => { 'a1': 1, 'b2': 2 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_mapvaluesobject-iteratee_identity"></a>`_.mapValues(object, [iteratee=_.identity])`
-<a href="#_mapvaluesobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12566 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mapvalues "See the npm package")
-
-Creates an object with the same keys as `object` and values generated
-by running each own enumerable string keyed property of `object` thru
-`iteratee`. The iteratee is invoked with three arguments:<br>
-*(value, key, object)*.
-
-#### Since
-2.4.0
-#### Arguments
-1. `object` *(Object)*: The object to iterate over.
-2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
-
-#### Returns
-*(Object)*: Returns the new mapped object.
-
-#### Example
-```js
-var users = {
-  'fred':    { 'user': 'fred',    'age': 40 },
-  'pebbles': { 'user': 'pebbles', 'age': 1 }
-};
-
-_.mapValues(users, function(o) { return o.age; });
-// => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
-
-// The `_.property` iteratee shorthand.
-_.mapValues(users, 'age');
-// => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_mergeobject-sources"></a>`_.merge(object, [sources])`
-<a href="#_mergeobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12607 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.merge "See the npm package")
-
-This method is like `_.assign` except that it recursively merges own and
-inherited enumerable string keyed properties of source objects into the
-destination object. Source properties that resolve to `undefined` are
-skipped if a destination value exists. Array and plain object properties
-are merged recursively.Other objects and value types are overridden by
-assignment. Source objects are applied from left to right. Subsequent
-sources overwrite property assignments of previous sources.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-0.5.0
-#### Arguments
-1. `object` *(Object)*: The destination object.
-2. `[sources]` *(...Object)*: The source objects.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-var users = {
-  'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
-};
-
-var ages = {
-  'data': [{ 'age': 36 }, { 'age': 40 }]
-};
-
-_.merge(users, ages);
-// => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_mergewithobject-sources-customizer"></a>`_.mergeWith(object, sources, customizer)`
-<a href="#_mergewithobject-sources-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12649 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mergewith "See the npm package")
-
-This method is like `_.merge` except that it accepts `customizer` which
-is invoked to produce the merged values of the destination and source
-properties. If `customizer` returns `undefined`, merging is handled by the
-method instead. The `customizer` is invoked with seven arguments:<br>
-*(objValue, srcValue, key, object, source, stack)*.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `object` *(Object)*: The destination object.
-2. `sources` *(...Object)*: The source objects.
-3. `customizer` *(Function)*: The function to customize assigned values.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-function customizer(objValue, srcValue) {
-  if (_.isArray(objValue)) {
-    return objValue.concat(srcValue);
-  }
-}
-
-var object = {
-  'fruits': ['apple'],
-  'vegetables': ['beet']
-};
-
-var other = {
-  'fruits': ['banana'],
-  'vegetables': ['carrot']
-};
-
-_.mergeWith(object, other, customizer);
-// => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_omitobject-props"></a>`_.omit(object, [props])`
-<a href="#_omitobject-props">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12672 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.omit "See the npm package")
-
-The opposite of `_.pick`; this method creates an object composed of the
-own and inherited enumerable string keyed properties of `object` that are
-not omitted.
-
-#### Since
-0.1.0
-#### Arguments
-1. `object` *(Object)*: The source object.
-2. `[props]` *(...(string|string&#91;&#93;))*: The property identifiers to omit.
-
-#### Returns
-*(Object)*: Returns the new object.
-
-#### Example
-```js
-var object = { 'a': 1, 'b': '2', 'c': 3 };
-
-_.omit(object, ['a', 'c']);
-// => { 'b': '2' }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_omitbyobject-predicate_identity"></a>`_.omitBy(object, [predicate=_.identity])`
-<a href="#_omitbyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12701 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.omitby "See the npm package")
-
-The opposite of `_.pickBy`; this method creates an object composed of
-the own and inherited enumerable string keyed properties of `object` that
-`predicate` doesn't return truthy for. The predicate is invoked with two
-arguments: *(value, key)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `object` *(Object)*: The source object.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per property.
-
-#### Returns
-*(Object)*: Returns the new object.
-
-#### Example
-```js
-var object = { 'a': 1, 'b': '2', 'c': 3 };
-
-_.omitBy(object, _.isNumber);
-// => { 'b': '2' }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_pickobject-props"></a>`_.pick(object, [props])`
-<a href="#_pickobject-props">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12725 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pick "See the npm package")
-
-Creates an object composed of the picked `object` properties.
-
-#### Since
-0.1.0
-#### Arguments
-1. `object` *(Object)*: The source object.
-2. `[props]` *(...(string|string&#91;&#93;))*: The property identifiers to pick.
-
-#### Returns
-*(Object)*: Returns the new object.
-
-#### Example
-```js
-var object = { 'a': 1, 'b': '2', 'c': 3 };
-
-_.pick(object, ['a', 'c']);
-// => { 'a': 1, 'c': 3 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_pickbyobject-predicate_identity"></a>`_.pickBy(object, [predicate=_.identity])`
-<a href="#_pickbyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12748 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pickby "See the npm package")
-
-Creates an object composed of the `object` properties `predicate` returns
-truthy for. The predicate is invoked with two arguments: *(value, key)*.
-
-#### Since
-4.0.0
-#### Arguments
-1. `object` *(Object)*: The source object.
-2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per property.
-
-#### Returns
-*(Object)*: Returns the new object.
-
-#### Example
-```js
-var object = { 'a': 1, 'b': '2', 'c': 3 };
-
-_.pickBy(object, _.isNumber);
-// => { 'a': 1, 'c': 3 }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_resultobject-path-defaultvalue"></a>`_.result(object, path, [defaultValue])`
-<a href="#_resultobject-path-defaultvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12781 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.result "See the npm package")
-
-This method is like `_.get` except that if the resolved value is a
-function it's invoked with the `this` binding of its parent object and
-its result is returned.
-
-#### Since
-0.1.0
-#### Arguments
-1. `object` *(Object)*: The object to query.
-2. `path` *(Array|string)*: The path of the property to resolve.
-3. `[defaultValue]` *(&#42;)*: The value returned for `undefined` resolved values.
-
-#### Returns
-*(&#42;)*: Returns the resolved value.
-
-#### Example
-```js
-var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
-
-_.result(object, 'a[0].b.c1');
-// => 3
-
-_.result(object, 'a[0].b.c2');
-// => 4
-
-_.result(object, 'a[0].b.c3', 'default');
-// => 'default'
-
-_.result(object, 'a[0].b.c3', _.constant('default'));
-// => 'default'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_setobject-path-value"></a>`_.set(object, path, value)`
-<a href="#_setobject-path-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12831 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.set "See the npm package")
-
-Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
-it's created. Arrays are created for missing index properties while objects
-are created for all other missing properties. Use `_.setWith` to customize
-`path` creation.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-3.7.0
-#### Arguments
-1. `object` *(Object)*: The object to modify.
-2. `path` *(Array|string)*: The path of the property to set.
-3. `value` *(&#42;)*: The value to set.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-var object = { 'a': [{ 'b': { 'c': 3 } }] };
-
-_.set(object, 'a[0].b.c', 4);
-console.log(object.a[0].b.c);
-// => 4
-
-_.set(object, ['x', '0', 'y', 'z'], 5);
-console.log(object.x[0].y.z);
-// => 5
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_setwithobject-path-value-customizer"></a>`_.setWith(object, path, value, [customizer])`
-<a href="#_setwithobject-path-value-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12859 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.setwith "See the npm package")
-
-This method is like `_.set` except that it accepts `customizer` which is
-invoked to produce the objects of `path`.  If `customizer` returns `undefined`
-path creation is handled by the method instead. The `customizer` is invoked
-with three arguments: *(nsValue, key, nsObject)*.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `object` *(Object)*: The object to modify.
-2. `path` *(Array|string)*: The path of the property to set.
-3. `value` *(&#42;)*: The value to set.
-4. `[customizer]` *(Function)*: The function to customize assigned values.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-var object = {};
-
-_.setWith(object, '[0][1]', 'a', Object);
-// => { '0': { '1': 'a' } }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_topairsobject"></a>`_.toPairs(object)`
-<a href="#_topairsobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12887 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.topairs "See the npm package")
-
-Creates an array of own enumerable string keyed-value pairs for `object`
-which can be consumed by `_.fromPairs`.
-
-#### Since
-4.0.0
-#### Aliases
-*_.entries*
-
-#### Arguments
-1. `object` *(Object)*: The object to query.
-
-#### Returns
-*(Array)*: Returns the new array of key-value pairs.
-
-#### Example
-```js
-function Foo() {
-  this.a = 1;
-  this.b = 2;
-}
-
-Foo.prototype.c = 3;
-
-_.toPairs(new Foo);
-// => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_topairsinobject"></a>`_.toPairsIn(object)`
-<a href="#_topairsinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12914 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.topairsin "See the npm package")
-
-Creates an array of own and inherited enumerable string keyed-value pairs
-for `object` which can be consumed by `_.fromPairs`.
-
-#### Since
-4.0.0
-#### Aliases
-*_.entriesIn*
-
-#### Arguments
-1. `object` *(Object)*: The object to query.
-
-#### Returns
-*(Array)*: Returns the new array of key-value pairs.
-
-#### Example
-```js
-function Foo() {
-  this.a = 1;
-  this.b = 2;
-}
-
-Foo.prototype.c = 3;
-
-_.toPairsIn(new Foo);
-// => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_transformobject-iteratee_identity-accumulator"></a>`_.transform(object, [iteratee=_.identity], [accumulator])`
-<a href="#_transformobject-iteratee_identity-accumulator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12947 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.transform "See the npm package")
-
-An alternative to `_.reduce`; this method transforms `object` to a new
-`accumulator` object which is the result of running each of its own
-enumerable string keyed properties thru `iteratee`, with each invocation
-potentially mutating the `accumulator` object. The iteratee is invoked
-with four arguments: *(accumulator, value, key, object)*. Iteratee functions
-may exit iteration early by explicitly returning `false`.
-
-#### Since
-1.3.0
-#### Arguments
-1. `object` *(Array|Object)*: The object to iterate over.
-2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
-3. `[accumulator]` *(&#42;)*: The custom accumulator value.
-
-#### Returns
-*(&#42;)*: Returns the accumulated value.
-
-#### Example
-```js
-_.transform([2, 3, 4], function(result, n) {
-  result.push(n *= n);
-  return n % 2 == 0;
-}, []);
-// => [4, 9]
-
-_.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
-  (result[value] || (result[value] = [])).push(key);
-}, {});
-// => { '1': ['a', 'c'], '2': ['b'] }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_unsetobject-path"></a>`_.unset(object, path)`
-<a href="#_unsetobject-path">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12996 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unset "See the npm package")
-
-Removes the property at `path` of `object`.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `object` *(Object)*: The object to modify.
-2. `path` *(Array|string)*: The path of the property to unset.
-
-#### Returns
-*(boolean)*: Returns `true` if the property is deleted, else `false`.
-
-#### Example
-```js
-var object = { 'a': [{ 'b': { 'c': 7 } }] };
-_.unset(object, 'a[0].b.c');
-// => true
-
-console.log(object);
-// => { 'a': [{ 'b': {} }] };
-
-_.unset(object, ['a', '0', 'b', 'c']);
-// => true
-
-console.log(object);
-// => { 'a': [{ 'b': {} }] };
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_updateobject-path-updater"></a>`_.update(object, path, updater)`
-<a href="#_updateobject-path-updater">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13027 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.update "See the npm package")
-
-This method is like `_.set` except that accepts `updater` to produce the
-value to set. Use `_.updateWith` to customize `path` creation. The `updater`
-is invoked with one argument: *(value)*.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-4.6.0
-#### Arguments
-1. `object` *(Object)*: The object to modify.
-2. `path` *(Array|string)*: The path of the property to set.
-3. `updater` *(Function)*: The function to produce the updated value.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-var object = { 'a': [{ 'b': { 'c': 3 } }] };
-
-_.update(object, 'a[0].b.c', function(n) { return n * n; });
-console.log(object.a[0].b.c);
-// => 9
-
-_.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
-console.log(object.x[0].y.z);
-// => 0
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_updatewithobject-path-updater-customizer"></a>`_.updateWith(object, path, updater, [customizer])`
-<a href="#_updatewithobject-path-updater-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13055 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.updatewith "See the npm package")
-
-This method is like `_.update` except that it accepts `customizer` which is
-invoked to produce the objects of `path`.  If `customizer` returns `undefined`
-path creation is handled by the method instead. The `customizer` is invoked
-with three arguments: *(nsValue, key, nsObject)*.
-<br>
-<br>
-**Note:** This method mutates `object`.
-
-#### Since
-4.6.0
-#### Arguments
-1. `object` *(Object)*: The object to modify.
-2. `path` *(Array|string)*: The path of the property to set.
-3. `updater` *(Function)*: The function to produce the updated value.
-4. `[customizer]` *(Function)*: The function to customize assigned values.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-var object = {};
-
-_.updateWith(object, '[0][1]', _.constant('a'), Object);
-// => { '0': { '1': 'a' } }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_valuesobject"></a>`_.values(object)`
-<a href="#_valuesobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13086 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.values "See the npm package")
-
-Creates an array of the own enumerable string keyed property values of `object`.
-<br>
-<br>
-**Note:** Non-object values are coerced to objects.
-
-#### Since
-0.1.0
-#### Arguments
-1. `object` *(Object)*: The object to query.
-
-#### Returns
-*(Array)*: Returns the array of property values.
-
-#### Example
-```js
-function Foo() {
-  this.a = 1;
-  this.b = 2;
-}
-
-Foo.prototype.c = 3;
-
-_.values(new Foo);
-// => [1, 2] (iteration order is not guaranteed)
-
-_.values('hi');
-// => ['h', 'i']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_valuesinobject"></a>`_.valuesIn(object)`
-<a href="#_valuesinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13114 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.valuesin "See the npm package")
-
-Creates an array of the own and inherited enumerable string keyed property
-values of `object`.
-<br>
-<br>
-**Note:** Non-object values are coerced to objects.
-
-#### Since
-3.0.0
-#### Arguments
-1. `object` *(Object)*: The object to query.
-
-#### Returns
-*(Array)*: Returns the array of property values.
-
-#### Example
-```js
-function Foo() {
-  this.a = 1;
-  this.b = 2;
-}
-
-Foo.prototype.c = 3;
-
-_.valuesIn(new Foo);
-// => [1, 2, 3] (iteration order is not guaranteed)
-```
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `“Seq” Methods`
-
-<!-- div -->
-
-### <a id="_value"></a>`_(value)`
-<a href="#_value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1457 "View in source") [&#x24C9;][1]
-
-Creates a `lodash` object which wraps `value` to enable implicit method
-chain sequences. Methods that operate on and return arrays, collections,
-and functions can be chained together. Methods that retrieve a single value
-or may return a primitive value will automatically end the chain sequence
-and return the unwrapped value. Otherwise, the value must be unwrapped
-with `_#value`.
-<br>
-<br>
-Explicit chain sequences, which must be unwrapped with `_#value`, may be
-enabled using `_.chain`.
-<br>
-<br>
-The execution of chained methods is lazy, that is, it's deferred until
-`_#value` is implicitly or explicitly called.
-<br>
-<br>
-Lazy evaluation allows several methods to support shortcut fusion.
-Shortcut fusion is an optimization to merge iteratee calls; this avoids
-the creation of intermediate arrays and can greatly reduce the number of
-iteratee executions. Sections of a chain sequence qualify for shortcut
-fusion if the section is applied to an array of at least `200` elements
-and any iteratees accept only one argument. The heuristic for whether a
-section qualifies for shortcut fusion is subject to change.
-<br>
-<br>
-Chaining is supported in custom builds as long as the `_#value` method is
-directly or indirectly included in the build.
-<br>
-<br>
-In addition to lodash methods, wrappers have `Array` and `String` methods.
-<br>
-<br>
-The wrapper `Array` methods are:<br>
-`concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
-<br>
-<br>
-The wrapper `String` methods are:<br>
-`replace` and `split`
-<br>
-<br>
-The wrapper methods that support shortcut fusion are:<br>
-`at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
-`findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
-`tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
-<br>
-<br>
-The chainable wrapper methods are:<br>
-`after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
-`before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
-`commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
-`curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
-`difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
-`dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
-`flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
-`flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
-`functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
-`intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
-`keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
-`memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
-`nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
-`overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
-`pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
-`pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
-`remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
-`slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
-`takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
-`toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
-`union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
-`unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
-`valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
-`zipObject`, `zipObjectDeep`, and `zipWith`
-<br>
-<br>
-The wrapper methods that are **not** chainable by default are:<br>
-`add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
-`cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`,
-`eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`,
-`findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`,
-`floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`,
-`forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`,
-`includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`,
-`isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`,
-`isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`,
-`isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`,
-`isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
-`isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
-`isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
-`join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
-`lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`,
-`noConflict`, `noop`, `now`, `nth`, `pad`, `padEnd`, `padStart`, `parseInt`,
-`pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`,
-`runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
-`sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`,
-`startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`,
-`toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`,
-`toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`,
-`uniqueId`, `upperCase`, `upperFirst`, `value`, and `words`
-
-#### Arguments
-1. `value` *(&#42;)*: The value to wrap in a `lodash` instance.
-
-#### Returns
-*(Object)*: Returns the new `lodash` wrapper instance.
-
-#### Example
-```js
-function square(n) {
-  return n * n;
-}
-
-var wrapped = _([1, 2, 3]);
-
-// Returns an unwrapped value.
-wrapped.reduce(_.add);
-// => 6
-
-// Returns a wrapped value.
-var squares = wrapped.map(square);
-
-_.isArray(squares);
-// => false
-
-_.isArray(squares.value());
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_chainvalue"></a>`_.chain(value)`
-<a href="#_chainvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7876 "View in source") [&#x24C9;][1]
-
-Creates a `lodash` wrapper instance that wraps `value` with explicit method
-chain sequences enabled. The result of such sequences must be unwrapped
-with `_#value`.
-
-#### Since
-1.3.0
-#### Arguments
-1. `value` *(&#42;)*: The value to wrap.
-
-#### Returns
-*(Object)*: Returns the new `lodash` wrapper instance.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney',  'age': 36 },
-  { 'user': 'fred',    'age': 40 },
-  { 'user': 'pebbles', 'age': 1 }
-];
-
-var youngest = _
-  .chain(users)
-  .sortBy('age')
-  .map(function(o) {
-    return o.user + ' is ' + o.age;
-  })
-  .head()
-  .value();
-// => 'pebbles is 1'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
-<a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7905 "View in source") [&#x24C9;][1]
-
-This method invokes `interceptor` and returns `value`. The interceptor
-is invoked with one argument; *(value)*. The purpose of this method is to
-"tap into" a method chain sequence in order to modify intermediate results.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: The value to provide to `interceptor`.
-2. `interceptor` *(Function)*: The function to invoke.
-
-#### Returns
-*(&#42;)*: Returns `value`.
-
-#### Example
-```js
-_([1, 2, 3])
- .tap(function(array) {
-   // Mutate input array.
-   array.pop();
- })
- .reverse()
- .value();
-// => [2, 1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_thruvalue-interceptor"></a>`_.thru(value, interceptor)`
-<a href="#_thruvalue-interceptor">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7933 "View in source") [&#x24C9;][1]
-
-This method is like `_.tap` except that it returns the result of `interceptor`.
-The purpose of this method is to "pass thru" values replacing intermediate
-results in a method chain sequence.
-
-#### Since
-3.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to provide to `interceptor`.
-2. `interceptor` *(Function)*: The function to invoke.
-
-#### Returns
-*(&#42;)*: Returns the result of `interceptor`.
-
-#### Example
-```js
-_('  abc  ')
- .chain()
- .trim()
- .thru(function(value) {
-   return [value];
- })
- .value();
-// => ['abc']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_prototypesymboliterator"></a>`_.prototype[Symbol.iterator]()`
-<a href="#_prototypesymboliterator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8092 "View in source") [&#x24C9;][1]
-
-Enables the wrapper to be iterable.
-
-#### Since
-4.0.0
-#### Returns
-*(Object)*: Returns the wrapper object.
-
-#### Example
-```js
-var wrapped = _([1, 2]);
-
-wrapped[Symbol.iterator]() === wrapped;
-// => true
-
-Array.from(wrapped);
-// => [1, 2]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_prototypeatpaths"></a>`_.prototype.at([paths])`
-<a href="#_prototypeatpaths">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7956 "View in source") [&#x24C9;][1]
-
-This method is the wrapper version of `_.at`.
-
-#### Since
-1.0.0
-#### Arguments
-1. `[paths]` *(...(string|string&#91;&#93;))*: The property paths of elements to pick.
-
-#### Returns
-*(Object)*: Returns the new `lodash` wrapper instance.
-
-#### Example
-```js
-var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
-
-_(object).at(['a[0].b.c', 'a[1]']).value();
-// => [3, 4]
-
-_(['a', 'b', 'c']).at(0, 2).value();
-// => ['a', 'c']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_prototypechain"></a>`_.prototype.chain()`
-<a href="#_prototypechain">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8008 "View in source") [&#x24C9;][1]
-
-Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
-
-#### Since
-0.1.0
-#### Returns
-*(Object)*: Returns the new `lodash` wrapper instance.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney', 'age': 36 },
-  { 'user': 'fred',   'age': 40 }
-];
-
-// A sequence without explicit chaining.
-_(users).head();
-// => { 'user': 'barney', 'age': 36 }
-
-// A sequence with explicit chaining.
-_(users)
-  .chain()
-  .head()
-  .pick('user')
-  .value();
-// => { 'user': 'barney' }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_prototypecommit"></a>`_.prototype.commit()`
-<a href="#_prototypecommit">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8038 "View in source") [&#x24C9;][1]
-
-Executes the chain sequence and returns the wrapped result.
-
-#### Since
-3.2.0
-#### Returns
-*(Object)*: Returns the new `lodash` wrapper instance.
-
-#### Example
-```js
-var array = [1, 2];
-var wrapped = _(array).push(3);
-
-console.log(array);
-// => [1, 2]
-
-wrapped = wrapped.commit();
-console.log(array);
-// => [1, 2, 3]
-
-wrapped.last();
-// => 3
-
-console.log(array);
-// => [1, 2, 3]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_prototypenext"></a>`_.prototype.next()`
-<a href="#_prototypenext">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8064 "View in source") [&#x24C9;][1]
-
-Gets the next value on a wrapped object following the
-[iterator protocol](https://mdn.io/iteration_protocols#iterator).
-
-#### Since
-4.0.0
-#### Returns
-*(Object)*: Returns the next iterator value.
-
-#### Example
-```js
-var wrapped = _([1, 2]);
-
-wrapped.next();
-// => { 'done': false, 'value': 1 }
-
-wrapped.next();
-// => { 'done': false, 'value': 2 }
-
-wrapped.next();
-// => { 'done': true, 'value': undefined }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_prototypeplantvalue"></a>`_.prototype.plant(value)`
-<a href="#_prototypeplantvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8120 "View in source") [&#x24C9;][1]
-
-Creates a clone of the chain sequence planting `value` as the wrapped value.
-
-#### Since
-3.2.0
-#### Arguments
-1. `value` *(&#42;)*: The value to plant.
-
-#### Returns
-*(Object)*: Returns the new `lodash` wrapper instance.
-
-#### Example
-```js
-function square(n) {
-  return n * n;
-}
-
-var wrapped = _([1, 2]).map(square);
-var other = wrapped.plant([3, 4]);
-
-other.value();
-// => [9, 16]
-
-wrapped.value();
-// => [1, 4]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_prototypereverse"></a>`_.prototype.reverse()`
-<a href="#_prototypereverse">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8160 "View in source") [&#x24C9;][1]
-
-This method is the wrapper version of `_.reverse`.
-<br>
-<br>
-**Note:** This method mutates the wrapped array.
-
-#### Since
-0.1.0
-#### Returns
-*(Object)*: Returns the new `lodash` wrapper instance.
-
-#### Example
-```js
-var array = [1, 2, 3];
-
-_(array).reverse().value()
-// => [3, 2, 1]
-
-console.log(array);
-// => [3, 2, 1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_prototypevalue"></a>`_.prototype.value()`
-<a href="#_prototypevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8192 "View in source") [&#x24C9;][1]
-
-Executes the chain sequence to resolve the unwrapped value.
-
-#### Since
-0.1.0
-#### Aliases
-*_.prototype.toJSON, _.prototype.valueOf*
-
-#### Returns
-*(&#42;)*: Returns the resolved unwrapped value.
-
-#### Example
-```js
-_([1, 2, 3]).value();
-// => [1, 2, 3]
-```
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `“String” Methods`
-
-<!-- div -->
-
-### <a id="_camelcasestring"></a>`_.camelCase([string=''])`
-<a href="#_camelcasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13297 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.camelcase "See the npm package")
-
-Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to convert.
-
-#### Returns
-*(string)*: Returns the camel cased string.
-
-#### Example
-```js
-_.camelCase('Foo Bar');
-// => 'fooBar'
-
-_.camelCase('--foo-bar--');
-// => 'fooBar'
-
-_.camelCase('__FOO_BAR__');
-// => 'fooBar'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_capitalizestring"></a>`_.capitalize([string=''])`
-<a href="#_capitalizestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13317 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.capitalize "See the npm package")
-
-Converts the first character of `string` to upper case and the remaining
-to lower case.
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to capitalize.
-
-#### Returns
-*(string)*: Returns the capitalized string.
-
-#### Example
-```js
-_.capitalize('FRED');
-// => 'Fred'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_deburrstring"></a>`_.deburr([string=''])`
-<a href="#_deburrstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13338 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.deburr "See the npm package")
-
-Deburrs `string` by converting
-[latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
-to basic latin letters and removing
-[combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to deburr.
-
-#### Returns
-*(string)*: Returns the deburred string.
-
-#### Example
-```js
-_.deburr('déjà vu');
-// => 'deja vu'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_endswithstring-target-positionstringlength"></a>`_.endsWith([string=''], [target], [position=string.length])`
-<a href="#_endswithstring-target-positionstringlength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13366 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.endswith "See the npm package")
-
-Checks if `string` ends with the given target string.
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to search.
-2. `[target]` *(string)*: The string to search for.
-3. `[position=string.length]` *(number)*: The position to search from.
-
-#### Returns
-*(boolean)*: Returns `true` if `string` ends with `target`, else `false`.
-
-#### Example
-```js
-_.endsWith('abc', 'c');
-// => true
-
-_.endsWith('abc', 'b');
-// => false
-
-_.endsWith('abc', 'b', 2);
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_escapestring"></a>`_.escape([string=''])`
-<a href="#_escapestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13413 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.escape "See the npm package")
-
-Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
-their corresponding HTML entities.
-<br>
-<br>
-**Note:** No other characters are escaped. To escape additional
-characters use a third-party library like [_he_](https://mths.be/he).
-<br>
-<br>
-Though the ">" character is escaped for symmetry, characters like
-">" and "/" don't need escaping in HTML and have no special meaning
-unless they're part of a tag or unquoted attribute value. See
-[Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
-*(under "semi-related fun fact")* for more details.
-<br>
-<br>
-Backticks are escaped because in IE < `9`, they can break out of
-attribute values or HTML comments. See [#59](https://html5sec.org/#59),
-[#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
-[#133](https://html5sec.org/#133) of the
-[HTML5 Security Cheatsheet](https://html5sec.org/) for more details.
-<br>
-<br>
-When working with HTML you should always
-[quote attribute values](http://wonko.com/post/html-escaping) to reduce
-XSS vectors.
-
-#### Since
-0.1.0
-#### Arguments
-1. `[string='']` *(string)*: The string to escape.
-
-#### Returns
-*(string)*: Returns the escaped string.
-
-#### Example
-```js
-_.escape('fred, barney, & pebbles');
-// => 'fred, barney, &amp; pebbles'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_escaperegexpstring"></a>`_.escapeRegExp([string=''])`
-<a href="#_escaperegexpstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13435 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package")
-
-Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
-"?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to escape.
-
-#### Returns
-*(string)*: Returns the escaped string.
-
-#### Example
-```js
-_.escapeRegExp('[lodash](https://lodash.com/)');
-// => '\[lodash\]\(https://lodash\.com/\)'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_kebabcasestring"></a>`_.kebabCase([string=''])`
-<a href="#_kebabcasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13463 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.kebabcase "See the npm package")
-
-Converts `string` to
-[kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to convert.
-
-#### Returns
-*(string)*: Returns the kebab cased string.
-
-#### Example
-```js
-_.kebabCase('Foo Bar');
-// => 'foo-bar'
-
-_.kebabCase('fooBar');
-// => 'foo-bar'
-
-_.kebabCase('__FOO_BAR__');
-// => 'foo-bar'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_lowercasestring"></a>`_.lowerCase([string=''])`
-<a href="#_lowercasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13487 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lowercase "See the npm package")
-
-Converts `string`, as space separated words, to lower case.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to convert.
-
-#### Returns
-*(string)*: Returns the lower cased string.
-
-#### Example
-```js
-_.lowerCase('--Foo-Bar--');
-// => 'foo bar'
-
-_.lowerCase('fooBar');
-// => 'foo bar'
-
-_.lowerCase('__FOO_BAR__');
-// => 'foo bar'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_lowerfirststring"></a>`_.lowerFirst([string=''])`
-<a href="#_lowerfirststring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13508 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package")
-
-Converts the first character of `string` to lower case.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to convert.
-
-#### Returns
-*(string)*: Returns the converted string.
-
-#### Example
-```js
-_.lowerFirst('Fred');
-// => 'fred'
-
-_.lowerFirst('FRED');
-// => 'fRED'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_padstring-length0-chars"></a>`_.pad([string=''], [length=0], [chars=' '])`
-<a href="#_padstring-length0-chars">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13533 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pad "See the npm package")
-
-Pads `string` on the left and right sides if it's shorter than `length`.
-Padding characters are truncated if they can't be evenly divided by `length`.
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to pad.
-2. `[length=0]` *(number)*: The padding length.
-3. `[chars=' ']` *(string)*: The string used as padding.
-
-#### Returns
-*(string)*: Returns the padded string.
-
-#### Example
-```js
-_.pad('abc', 8);
-// => '  abc   '
-
-_.pad('abc', 8, '_-');
-// => '_-abc_-_'
-
-_.pad('abc', 3);
-// => 'abc'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_padendstring-length0-chars"></a>`_.padEnd([string=''], [length=0], [chars=' '])`
-<a href="#_padendstring-length0-chars">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13572 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.padend "See the npm package")
-
-Pads `string` on the right side if it's shorter than `length`. Padding
-characters are truncated if they exceed `length`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to pad.
-2. `[length=0]` *(number)*: The padding length.
-3. `[chars=' ']` *(string)*: The string used as padding.
-
-#### Returns
-*(string)*: Returns the padded string.
-
-#### Example
-```js
-_.padEnd('abc', 6);
-// => 'abc   '
-
-_.padEnd('abc', 6, '_-');
-// => 'abc_-_'
-
-_.padEnd('abc', 3);
-// => 'abc'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_padstartstring-length0-chars"></a>`_.padStart([string=''], [length=0], [chars=' '])`
-<a href="#_padstartstring-length0-chars">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13605 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.padstart "See the npm package")
-
-Pads `string` on the left side if it's shorter than `length`. Padding
-characters are truncated if they exceed `length`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to pad.
-2. `[length=0]` *(number)*: The padding length.
-3. `[chars=' ']` *(string)*: The string used as padding.
-
-#### Returns
-*(string)*: Returns the padded string.
-
-#### Example
-```js
-_.padStart('abc', 6);
-// => '   abc'
-
-_.padStart('abc', 6, '_-');
-// => '_-_abc'
-
-_.padStart('abc', 3);
-// => 'abc'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_parseintstring-radix10"></a>`_.parseInt(string, [radix=10])`
-<a href="#_parseintstring-radix10">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13639 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.parseint "See the npm package")
-
-Converts `string` to an integer of the specified radix. If `radix` is
-`undefined` or `0`, a `radix` of `10` is used unless `value` is a
-hexadecimal, in which case a `radix` of `16` is used.
-<br>
-<br>
-**Note:** This method aligns with the
-[ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
-
-#### Since
-1.1.0
-#### Arguments
-1. `string` *(string)*: The string to convert.
-2. `[radix=10]` *(number)*: The radix to interpret `value` by.
-
-#### Returns
-*(number)*: Returns the converted integer.
-
-#### Example
-```js
-_.parseInt('08');
-// => 8
-
-_.map(['6', '08', '10'], _.parseInt);
-// => [6, 8, 10]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_repeatstring-n1"></a>`_.repeat([string=''], [n=1])`
-<a href="#_repeatstring-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13673 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.repeat "See the npm package")
-
-Repeats the given string `n` times.
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to repeat.
-2. `[n=1]` *(number)*: The number of times to repeat the string.
-
-#### Returns
-*(string)*: Returns the repeated string.
-
-#### Example
-```js
-_.repeat('*', 3);
-// => '***'
-
-_.repeat('abc', 2);
-// => 'abcabc'
-
-_.repeat('abc', 0);
-// => ''
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_replacestring-pattern-replacement"></a>`_.replace([string=''], pattern, replacement)`
-<a href="#_replacestring-pattern-replacement">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13701 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.replace "See the npm package")
-
-Replaces matches for `pattern` in `string` with `replacement`.
-<br>
-<br>
-**Note:** This method is based on
-[`String#replace`](https://mdn.io/String/replace).
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to modify.
-2. `pattern` *(RegExp|string)*: The pattern to replace.
-3. `replacement` *(Function|string)*: The match replacement.
-
-#### Returns
-*(string)*: Returns the modified string.
-
-#### Example
-```js
-_.replace('Hi Fred', 'Fred', 'Barney');
-// => 'Hi Barney'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_snakecasestring"></a>`_.snakeCase([string=''])`
-<a href="#_snakecasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13729 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.snakecase "See the npm package")
-
-Converts `string` to
-[snake case](https://en.wikipedia.org/wiki/Snake_case).
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to convert.
-
-#### Returns
-*(string)*: Returns the snake cased string.
-
-#### Example
-```js
-_.snakeCase('Foo Bar');
-// => 'foo_bar'
-
-_.snakeCase('fooBar');
-// => 'foo_bar'
-
-_.snakeCase('--FOO-BAR--');
-// => 'foo_bar'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_splitstring-separator-limit"></a>`_.split([string=''], separator, [limit])`
-<a href="#_splitstring-separator-limit">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13752 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.split "See the npm package")
-
-Splits `string` by `separator`.
-<br>
-<br>
-**Note:** This method is based on
-[`String#split`](https://mdn.io/String/split).
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to split.
-2. `separator` *(RegExp|string)*: The separator pattern to split by.
-3. `[limit]` *(number)*: The length to truncate results to.
-
-#### Returns
-*(Array)*: Returns the new array of string segments.
-
-#### Example
-```js
-_.split('a-b-c', '-', 2);
-// => ['a', 'b']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_startcasestring"></a>`_.startCase([string=''])`
-<a href="#_startcasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13794 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.startcase "See the npm package")
-
-Converts `string` to
-[start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
-
-#### Since
-3.1.0
-#### Arguments
-1. `[string='']` *(string)*: The string to convert.
-
-#### Returns
-*(string)*: Returns the start cased string.
-
-#### Example
-```js
-_.startCase('--foo-bar--');
-// => 'Foo Bar'
-
-_.startCase('fooBar');
-// => 'Foo Bar'
-
-_.startCase('__FOO_BAR__');
-// => 'FOO BAR'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_startswithstring-target-position0"></a>`_.startsWith([string=''], [target], [position=0])`
-<a href="#_startswithstring-target-position0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13821 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.startswith "See the npm package")
-
-Checks if `string` starts with the given target string.
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to search.
-2. `[target]` *(string)*: The string to search for.
-3. `[position=0]` *(number)*: The position to search from.
-
-#### Returns
-*(boolean)*: Returns `true` if `string` starts with `target`, else `false`.
-
-#### Example
-```js
-_.startsWith('abc', 'a');
-// => true
-
-_.startsWith('abc', 'b');
-// => false
-
-_.startsWith('abc', 'b', 1);
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_templatestring-options-optionsescape_templatesettingsescape-optionsevaluate_templatesettingsevaluate-optionsimports_templatesettingsimports-optionsinterpolate_templatesettingsinterpolate-optionssourceurllodashtemplatesourcesn-optionsvariableobj"></a>`_.template([string=''], [options={}], [options.escape=_.templateSettings.escape], [options.evaluate=_.templateSettings.evaluate], [options.imports=_.templateSettings.imports], [options.interpolate=_.templateSettings.interpolate], [options.sourceURL='lodash.templateSources[n]'], [options.variable='obj'])`
-<a href="#_templatestring-options-optionsescape_templatesettingsescape-optionsevaluate_templatesettingsevaluate-optionsimports_templatesettingsimports-optionsinterpolate_templatesettingsinterpolate-optionssourceurllodashtemplatesourcesn-optionsvariableobj">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13930 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.template "See the npm package")
-
-Creates a compiled template function that can interpolate data properties
-in "interpolate" delimiters, HTML-escape interpolated data properties in
-"escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
-properties may be accessed as free variables in the template. If a setting
-object is given, it takes precedence over `_.templateSettings` values.
-<br>
-<br>
-**Note:** In the development build `_.template` utilizes
-[sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
-for easier debugging.
-<br>
-<br>
-For more information on precompiling templates see
-[lodash's custom builds documentation](https://lodash.com/custom-builds).
-<br>
-<br>
-For more information on Chrome extension sandboxes see
-[Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
-
-#### Since
-0.1.0
-#### Arguments
-1. `[string='']` *(string)*: The template string.
-2. `[options={}]` *(Object)*: The options object.
-3. `[options.escape=_.templateSettings.escape]` *(RegExp)*: The HTML "escape" delimiter.
-4. `[options.evaluate=_.templateSettings.evaluate]` *(RegExp)*: The "evaluate" delimiter.
-5. `[options.imports=_.templateSettings.imports]` *(Object)*: An object to import into the template as free variables.
-6. `[options.interpolate=_.templateSettings.interpolate]` *(RegExp)*: The "interpolate" delimiter.
-7. `[options.sourceURL='lodash.templateSources[n]']` *(string)*: The sourceURL of the compiled template.
-8. `[options.variable='obj']` *(string)*: The data object variable name.
-
-#### Returns
-*(Function)*: Returns the compiled template function.
-
-#### Example
-```js
-// Use the "interpolate" delimiter to create a compiled template.
-var compiled = _.template('hello <%= user %>!');
-compiled({ 'user': 'fred' });
-// => 'hello fred!'
-
-// Use the HTML "escape" delimiter to escape data property values.
-var compiled = _.template('<b><%- value %></b>');
-compiled({ 'value': '<script>' });
-// => '<b>&lt;script&gt;</b>'
-
-// Use the "evaluate" delimiter to execute JavaScript and generate HTML.
-var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
-compiled({ 'users': ['fred', 'barney'] });
-// => '<li>fred</li><li>barney</li>'
-
-// Use the internal `print` function in "evaluate" delimiters.
-var compiled = _.template('<% print("hello " + user); %>!');
-compiled({ 'user': 'barney' });
-// => 'hello barney!'
-
-// Use the ES delimiter as an alternative to the default "interpolate" delimiter.
-var compiled = _.template('hello ${ user }!');
-compiled({ 'user': 'pebbles' });
-// => 'hello pebbles!'
-
-// Use custom template delimiters.
-_.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
-var compiled = _.template('hello {{ user }}!');
-compiled({ 'user': 'mustache' });
-// => 'hello mustache!'
-
-// Use backslashes to treat delimiters as plain text.
-var compiled = _.template('<%= "\\<%- value %\\>" %>');
-compiled({ 'value': 'ignored' });
-// => '<%- value %>'
-
-// Use the `imports` option to import `jQuery` as `jq`.
-var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
-var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
-compiled({ 'users': ['fred', 'barney'] });
-// => '<li>fred</li><li>barney</li>'
-
-// Use the `sourceURL` option to specify a custom sourceURL for the template.
-var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
-compiled(data);
-// => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
-
-// Use the `variable` option to ensure a with-statement isn't used in the compiled template.
-var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
-compiled.source;
-// => function(data) {
-//   var __t, __p = '';
-//   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
-//   return __p;
-// }
-
-// Use the `source` property to inline compiled templates for meaningful
-// line numbers in error messages and stack traces.
-fs.writeFileSync(path.join(cwd, 'jst.js'), '\
-  var JST = {\
-    "main": ' + _.template(mainText).source + '\
-  };\
-');
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_tolowerstring"></a>`_.toLower([string=''])`
-<a href="#_tolowerstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14059 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tolower "See the npm package")
-
-Converts `string`, as a whole, to lower case just like
-[String#toLowerCase](https://mdn.io/toLowerCase).
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to convert.
-
-#### Returns
-*(string)*: Returns the lower cased string.
-
-#### Example
-```js
-_.toLower('--Foo-Bar--');
-// => '--foo-bar--'
-
-_.toLower('fooBar');
-// => 'foobar'
-
-_.toLower('__FOO_BAR__');
-// => '__foo_bar__'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_toupperstring"></a>`_.toUpper([string=''])`
-<a href="#_toupperstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14084 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.toupper "See the npm package")
-
-Converts `string`, as a whole, to upper case just like
-[String#toUpperCase](https://mdn.io/toUpperCase).
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to convert.
-
-#### Returns
-*(string)*: Returns the upper cased string.
-
-#### Example
-```js
-_.toUpper('--foo-bar--');
-// => '--FOO-BAR--'
-
-_.toUpper('fooBar');
-// => 'FOOBAR'
-
-_.toUpper('__foo_bar__');
-// => '__FOO_BAR__'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_trimstring-charswhitespace"></a>`_.trim([string=''], [chars=whitespace])`
-<a href="#_trimstring-charswhitespace">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14110 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.trim "See the npm package")
-
-Removes leading and trailing whitespace or specified characters from `string`.
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to trim.
-2. `[chars=whitespace]` *(string)*: The characters to trim.
-
-#### Returns
-*(string)*: Returns the trimmed string.
-
-#### Example
-```js
-_.trim('  abc  ');
-// => 'abc'
-
-_.trim('-_-abc-_-', '_-');
-// => 'abc'
-
-_.map(['  foo  ', '  bar  '], _.trim);
-// => ['foo', 'bar']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_trimendstring-charswhitespace"></a>`_.trimEnd([string=''], [chars=whitespace])`
-<a href="#_trimendstring-charswhitespace">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14145 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.trimend "See the npm package")
-
-Removes trailing whitespace or specified characters from `string`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to trim.
-2. `[chars=whitespace]` *(string)*: The characters to trim.
-
-#### Returns
-*(string)*: Returns the trimmed string.
-
-#### Example
-```js
-_.trimEnd('  abc  ');
-// => '  abc'
-
-_.trimEnd('-_-abc-_-', '_-');
-// => '-_-abc'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_trimstartstring-charswhitespace"></a>`_.trimStart([string=''], [chars=whitespace])`
-<a href="#_trimstartstring-charswhitespace">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14178 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.trimstart "See the npm package")
-
-Removes leading whitespace or specified characters from `string`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to trim.
-2. `[chars=whitespace]` *(string)*: The characters to trim.
-
-#### Returns
-*(string)*: Returns the trimmed string.
-
-#### Example
-```js
-_.trimStart('  abc  ');
-// => 'abc  '
-
-_.trimStart('-_-abc-_-', '_-');
-// => 'abc-_-'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_truncatestring-options-optionslength30-optionsomission-optionsseparator"></a>`_.truncate([string=''], [options={}], [options.length=30], [options.omission='...'], [options.separator])`
-<a href="#_truncatestring-options-optionslength30-optionsomission-optionsseparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14229 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.truncate "See the npm package")
-
-Truncates `string` if it's longer than the given maximum string length.
-The last characters of the truncated string are replaced with the omission
-string which defaults to "...".
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to truncate.
-2. `[options={}]` *(Object)*: The options object.
-3. `[options.length=30]` *(number)*: The maximum string length.
-4. `[options.omission='...']` *(string)*: The string to indicate text is omitted.
-5. `[options.separator]` *(RegExp|string)*: The separator pattern to truncate to.
-
-#### Returns
-*(string)*: Returns the truncated string.
-
-#### Example
-```js
-_.truncate('hi-diddly-ho there, neighborino');
-// => 'hi-diddly-ho there, neighbo...'
-
-_.truncate('hi-diddly-ho there, neighborino', {
-  'length': 24,
-  'separator': ' '
-});
-// => 'hi-diddly-ho there,...'
-
-_.truncate('hi-diddly-ho there, neighborino', {
-  'length': 24,
-  'separator': /,? +/
-});
-// => 'hi-diddly-ho there...'
-
-_.truncate('hi-diddly-ho there, neighborino', {
-  'omission': ' [...]'
-});
-// => 'hi-diddly-ho there, neig [...]'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_unescapestring"></a>`_.unescape([string=''])`
-<a href="#_unescapestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14304 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unescape "See the npm package")
-
-The inverse of `_.escape`; this method converts the HTML entities
-`&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to
-their corresponding characters.
-<br>
-<br>
-**Note:** No other HTML entities are unescaped. To unescape additional
-HTML entities use a third-party library like [_he_](https://mths.be/he).
-
-#### Since
-0.6.0
-#### Arguments
-1. `[string='']` *(string)*: The string to unescape.
-
-#### Returns
-*(string)*: Returns the unescaped string.
-
-#### Example
-```js
-_.unescape('fred, barney, &amp; pebbles');
-// => 'fred, barney, & pebbles'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_uppercasestring"></a>`_.upperCase([string=''])`
-<a href="#_uppercasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14331 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uppercase "See the npm package")
-
-Converts `string`, as space separated words, to upper case.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to convert.
-
-#### Returns
-*(string)*: Returns the upper cased string.
-
-#### Example
-```js
-_.upperCase('--foo-bar');
-// => 'FOO BAR'
-
-_.upperCase('fooBar');
-// => 'FOO BAR'
-
-_.upperCase('__foo_bar__');
-// => 'FOO BAR'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_upperfirststring"></a>`_.upperFirst([string=''])`
-<a href="#_upperfirststring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14352 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.upperfirst "See the npm package")
-
-Converts the first character of `string` to upper case.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to convert.
-
-#### Returns
-*(string)*: Returns the converted string.
-
-#### Example
-```js
-_.upperFirst('fred');
-// => 'Fred'
-
-_.upperFirst('FRED');
-// => 'FRED'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_wordsstring-pattern"></a>`_.words([string=''], [pattern])`
-<a href="#_wordsstring-pattern">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14373 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.words "See the npm package")
-
-Splits `string` into an array of its words.
-
-#### Since
-3.0.0
-#### Arguments
-1. `[string='']` *(string)*: The string to inspect.
-2. `[pattern]` *(RegExp|string)*: The pattern to match words.
-
-#### Returns
-*(Array)*: Returns the words of `string`.
-
-#### Example
-```js
-_.words('fred, barney, & pebbles');
-// => ['fred', 'barney', 'pebbles']
-
-_.words('fred, barney, & pebbles', /[^, ]+/g);
-// => ['fred', 'barney', '&', 'pebbles']
-```
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `“Util” Methods`
-
-<!-- div -->
-
-### <a id="_attemptfunc-args"></a>`_.attempt(func, [args])`
-<a href="#_attemptfunc-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14407 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.attempt "See the npm package")
-
-Attempts to invoke `func`, returning either the result or the caught error
-object. Any additional arguments are provided to `func` when it's invoked.
-
-#### Since
-3.0.0
-#### Arguments
-1. `func` *(Function)*: The function to attempt.
-2. `[args]` *(...&#42;)*: The arguments to invoke `func` with.
-
-#### Returns
-*(&#42;)*: Returns the `func` result or error object.
-
-#### Example
-```js
-// Avoid throwing errors for invalid selectors.
-var elements = _.attempt(function(selector) {
-  return document.querySelectorAll(selector);
-}, '>_>');
-
-if (_.isError(elements)) {
-  elements = [];
-}
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_bindallobject-methodnames"></a>`_.bindAll(object, methodNames)`
-<a href="#_bindallobject-methodnames">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14441 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.bindall "See the npm package")
-
-Binds methods of an object to the object itself, overwriting the existing
-method.
-<br>
-<br>
-**Note:** This method doesn't set the "length" property of bound functions.
-
-#### Since
-0.1.0
-#### Arguments
-1. `object` *(Object)*: The object to bind and assign the bound methods to.
-2. `methodNames` *(...(string|string&#91;&#93;))*: The object method names to bind.
-
-#### Returns
-*(Object)*: Returns `object`.
-
-#### Example
-```js
-var view = {
-  'label': 'docs',
-  'onClick': function() {
-    console.log('clicked ' + this.label);
-  }
-};
-
-_.bindAll(view, 'onClick');
-jQuery(element).on('click', view.onClick);
-// => Logs 'clicked docs' when clicked.
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_condpairs"></a>`_.cond(pairs)`
-<a href="#_condpairs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14478 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.cond "See the npm package")
-
-Creates a function that iterates over `pairs` and invokes the corresponding
-function of the first predicate to return truthy. The predicate-function
-pairs are invoked with the `this` binding and arguments of the created
-function.
-
-#### Since
-4.0.0
-#### Arguments
-1. `pairs` *(Array)*: The predicate-function pairs.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var func = _.cond([
-  [_.matches({ 'a': 1 }),           _.constant('matches A')],
-  [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
-  [_.constant(true),                _.constant('no match')]
-]);
-
-func({ 'a': 1, 'b': 2 });
-// => 'matches A'
-
-func({ 'a': 0, 'b': 1 });
-// => 'matches B'
-
-func({ 'a': '1', 'b': '2' });
-// => 'no match'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_conformssource"></a>`_.conforms(source)`
-<a href="#_conformssource">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14521 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.conforms "See the npm package")
-
-Creates a function that invokes the predicate properties of `source` with
-the corresponding property values of a given object, returning `true` if
-all predicates return truthy, else `false`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `source` *(Object)*: The object of property predicates to conform to.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney', 'age': 36 },
-  { 'user': 'fred',   'age': 40 }
-];
-
-_.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) }));
-// => [{ 'user': 'fred', 'age': 40 }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_constantvalue"></a>`_.constant(value)`
-<a href="#_constantvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14542 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.constant "See the npm package")
-
-Creates a function that returns `value`.
-
-#### Since
-2.4.0
-#### Arguments
-1. `value` *(&#42;)*: The value to return from the new function.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var object = { 'user': 'fred' };
-var getter = _.constant(object);
-
-getter() === object;
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_flowfuncs"></a>`_.flow([funcs])`
-<a href="#_flowfuncs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14570 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flow "See the npm package")
-
-Creates a function that returns the result of invoking the given functions
-with the `this` binding of the created function, where each successive
-invocation is supplied the return value of the previous.
-
-#### Since
-3.0.0
-#### Arguments
-1. `[funcs]` *(...(Function|Function&#91;&#93;))*: Functions to invoke.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-function square(n) {
-  return n * n;
-}
-
-var addSquare = _.flow(_.add, square);
-addSquare(1, 2);
-// => 9
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_flowrightfuncs"></a>`_.flowRight([funcs])`
-<a href="#_flowrightfuncs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14593 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flowright "See the npm package")
-
-This method is like `_.flow` except that it creates a function that
-invokes the given functions from right to left.
-
-#### Since
-3.0.0
-#### Arguments
-1. `[funcs]` *(...(Function|Function&#91;&#93;))*: Functions to invoke.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-function square(n) {
-  return n * n;
-}
-
-var addSquare = _.flowRight(square, _.add);
-addSquare(1, 2);
-// => 9
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_identityvalue"></a>`_.identity(value)`
-<a href="#_identityvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14611 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.identity "See the npm package")
-
-This method returns the first argument given to it.
-
-#### Since
-0.1.0
-#### Arguments
-1. `value` *(&#42;)*: Any value.
-
-#### Returns
-*(&#42;)*: Returns `value`.
-
-#### Example
-```js
-var object = { 'user': 'fred' };
-
-_.identity(object) === object;
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_iterateefunc_identity"></a>`_.iteratee([func=_.identity])`
-<a href="#_iterateefunc_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14657 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.iteratee "See the npm package")
-
-Creates a function that invokes `func` with the arguments of the created
-function. If `func` is a property name, the created function returns the
-property value for a given element. If `func` is an array or object, the
-created function returns `true` for elements that contain the equivalent
-source properties, otherwise it returns `false`.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[func=_.identity]` *(&#42;)*: The value to convert to a callback.
-
-#### Returns
-*(Function)*: Returns the callback.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney', 'age': 36, 'active': true },
-  { 'user': 'fred',   'age': 40, 'active': false }
-];
-
-// The `_.matches` iteratee shorthand.
-_.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
-// => [{ 'user': 'barney', 'age': 36, 'active': true }]
-
-// The `_.matchesProperty` iteratee shorthand.
-_.filter(users, _.iteratee(['user', 'fred']));
-// => [{ 'user': 'fred', 'age': 40 }]
-
-// The `_.property` iteratee shorthand.
-_.map(users, _.iteratee('user'));
-// => ['barney', 'fred']
-
-// Create custom iteratee shorthands.
-_.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
-  return !_.isRegExp(func) ? iteratee(func) : function(string) {
-    return func.test(string);
-  };
-});
-
-_.filter(['abc', 'def'], /ef/);
-// => ['def']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_matchessource"></a>`_.matches(source)`
-<a href="#_matchessource">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14685 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.matches "See the npm package")
-
-Creates a function that performs a partial deep comparison between a given
-object and `source`, returning `true` if the given object has equivalent
-property values, else `false`. The created function is equivalent to
-`_.isMatch` with a `source` partially applied.
-<br>
-<br>
-**Note:** This method supports comparing the same values as `_.isEqual`.
-
-#### Since
-3.0.0
-#### Arguments
-1. `source` *(Object)*: The object of property values to match.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney', 'age': 36, 'active': true },
-  { 'user': 'fred',   'age': 40, 'active': false }
-];
-
-_.filter(users, _.matches({ 'age': 40, 'active': false }));
-// => [{ 'user': 'fred', 'age': 40, 'active': false }]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_matchespropertypath-srcvalue"></a>`_.matchesProperty(path, srcValue)`
-<a href="#_matchespropertypath-srcvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14713 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package")
-
-Creates a function that performs a partial deep comparison between the
-value at `path` of a given object to `srcValue`, returning `true` if the
-object value is equivalent, else `false`.
-<br>
-<br>
-**Note:** This method supports comparing the same values as `_.isEqual`.
-
-#### Since
-3.2.0
-#### Arguments
-1. `path` *(Array|string)*: The path of the property to get.
-2. `srcValue` *(&#42;)*: The value to match.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var users = [
-  { 'user': 'barney' },
-  { 'user': 'fred' }
-];
-
-_.find(users, _.matchesProperty('user', 'fred'));
-// => { 'user': 'fred' }
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_methodpath-args"></a>`_.method(path, [args])`
-<a href="#_methodpath-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14741 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.method "See the npm package")
-
-Creates a function that invokes the method at `path` of a given object.
-Any additional arguments are provided to the invoked method.
-
-#### Since
-3.7.0
-#### Arguments
-1. `path` *(Array|string)*: The path of the method to invoke.
-2. `[args]` *(...&#42;)*: The arguments to invoke the method with.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var objects = [
-  { 'a': { 'b': _.constant(2) } },
-  { 'a': { 'b': _.constant(1) } }
-];
-
-_.map(objects, _.method('a.b'));
-// => [2, 1]
-
-_.map(objects, _.method(['a', 'b']));
-// => [2, 1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_methodofobject-args"></a>`_.methodOf(object, [args])`
-<a href="#_methodofobject-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14770 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.methodof "See the npm package")
-
-The opposite of `_.method`; this method creates a function that invokes
-the method at a given path of `object`. Any additional arguments are
-provided to the invoked method.
-
-#### Since
-3.7.0
-#### Arguments
-1. `object` *(Object)*: The object to query.
-2. `[args]` *(...&#42;)*: The arguments to invoke the method with.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var array = _.times(3, _.constant),
-    object = { 'a': array, 'b': array, 'c': array };
-
-_.map(['a[2]', 'c[0]'], _.methodOf(object));
-// => [2, 0]
-
-_.map([['a', '2'], ['c', '0']], _.methodOf(object));
-// => [2, 0]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_mixinobjectlodash-source-options-optionschaintrue"></a>`_.mixin([object=lodash], source, [options={}], [options.chain=true])`
-<a href="#_mixinobjectlodash-source-options-optionschaintrue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14812 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mixin "See the npm package")
-
-Adds all own enumerable string keyed function properties of a source
-object to the destination object. If `object` is a function, then methods
-are added to its prototype as well.
-<br>
-<br>
-**Note:** Use `_.runInContext` to create a pristine `lodash` function to
-avoid conflicts caused by modifying the original.
-
-#### Since
-0.1.0
-#### Arguments
-1. `[object=lodash]` *(Function|Object)*: The destination object.
-2. `source` *(Object)*: The object of functions to add.
-3. `[options={}]` *(Object)*: The options object.
-4. `[options.chain=true]` *(boolean)*: Specify whether mixins are chainable.
-
-#### Returns
-*(&#42;)*: Returns `object`.
-
-#### Example
-```js
-function vowels(string) {
-  return _.filter(string, function(v) {
-    return /[aeiou]/i.test(v);
-  });
-}
-
-_.mixin({ 'vowels': vowels });
-_.vowels('fred');
-// => ['e']
-
-_('fred').vowels().value();
-// => ['e']
-
-_.mixin({ 'vowels': vowels }, { 'chain': false });
-_('fred').vowels();
-// => ['e']
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_noconflict"></a>`_.noConflict()`
-<a href="#_noconflict">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14861 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.noconflict "See the npm package")
-
-Reverts the `_` variable to its previous value and returns a reference to
-the `lodash` function.
-
-#### Since
-0.1.0
-#### Returns
-*(Function)*: Returns the `lodash` function.
-
-#### Example
-```js
-var lodash = _.noConflict();
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_noop"></a>`_.noop()`
-<a href="#_noop">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14883 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.noop "See the npm package")
-
-A no-operation function that returns `undefined` regardless of the
-arguments it receives.
-
-#### Since
-2.3.0
-#### Example
-```js
-var object = { 'user': 'fred' };
-
-_.noop(object) === undefined;
-// => true
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_nthargn0"></a>`_.nthArg([n=0])`
-<a href="#_nthargn0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14907 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ntharg "See the npm package")
-
-Creates a function that returns its nth argument. If `n` is negative,
-the nth argument from the end is returned.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[n=0]` *(number)*: The index of the argument to return.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var func = _.nthArg(1);
-func('a', 'b', 'c', 'd');
-// => 'b'
-
-var func = _.nthArg(-2);
-func('a', 'b', 'c', 'd');
-// => 'c'
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_overiteratees_identity"></a>`_.over([iteratees=[_.identity]])`
-<a href="#_overiteratees_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14932 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.over "See the npm package")
-
-Creates a function that invokes `iteratees` with the arguments it receives
-and returns their results.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[iteratees=[_.identity]]` *(...(Array|Array&#91;&#93;|Function|Function&#91;&#93;|Object|Object&#91;&#93;|string|string&#91;&#93;))*: The iteratees to invoke.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var func = _.over(Math.max, Math.min);
-
-func(1, 2, 3, 4);
-// => [4, 1]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_overeverypredicates_identity"></a>`_.overEvery([predicates=[_.identity]])`
-<a href="#_overeverypredicates_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14958 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.overevery "See the npm package")
-
-Creates a function that checks if **all** of the `predicates` return
-truthy when invoked with the arguments it receives.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[predicates=[_.identity]]` *(...(Array|Array&#91;&#93;|Function|Function&#91;&#93;|Object|Object&#91;&#93;|string|string&#91;&#93;))*: The predicates to check.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var func = _.overEvery(Boolean, isFinite);
-
-func('1');
-// => true
-
-func(null);
-// => false
-
-func(NaN);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_oversomepredicates_identity"></a>`_.overSome([predicates=[_.identity]])`
-<a href="#_oversomepredicates_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14984 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.oversome "See the npm package")
-
-Creates a function that checks if **any** of the `predicates` return
-truthy when invoked with the arguments it receives.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[predicates=[_.identity]]` *(...(Array|Array&#91;&#93;|Function|Function&#91;&#93;|Object|Object&#91;&#93;|string|string&#91;&#93;))*: The predicates to check.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var func = _.overSome(Boolean, isFinite);
-
-func('1');
-// => true
-
-func(null);
-// => true
-
-func(NaN);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_propertypath"></a>`_.property(path)`
-<a href="#_propertypath">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15008 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.property "See the npm package")
-
-Creates a function that returns the value at `path` of a given object.
-
-#### Since
-2.4.0
-#### Arguments
-1. `path` *(Array|string)*: The path of the property to get.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var objects = [
-  { 'a': { 'b': 2 } },
-  { 'a': { 'b': 1 } }
-];
-
-_.map(objects, _.property('a.b'));
-// => [2, 1]
-
-_.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
-// => [1, 2]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_propertyofobject"></a>`_.propertyOf(object)`
-<a href="#_propertyofobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15033 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.propertyof "See the npm package")
-
-The opposite of `_.property`; this method creates a function that returns
-the value at a given path of `object`.
-
-#### Since
-3.0.0
-#### Arguments
-1. `object` *(Object)*: The object to query.
-
-#### Returns
-*(Function)*: Returns the new function.
-
-#### Example
-```js
-var array = [0, 1, 2],
-    object = { 'a': array, 'b': array, 'c': array };
-
-_.map(['a[2]', 'c[0]'], _.propertyOf(object));
-// => [2, 0]
-
-_.map([['a', '2'], ['c', '0']], _.propertyOf(object));
-// => [2, 0]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_rangestart0-end-step1"></a>`_.range([start=0], end, [step=1])`
-<a href="#_rangestart0-end-step1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15080 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.range "See the npm package")
-
-Creates an array of numbers *(positive and/or negative)* progressing from
-`start` up to, but not including, `end`. A step of `-1` is used if a negative
-`start` is specified without an `end` or `step`. If `end` is not specified,
-it's set to `start` with `start` then set to `0`.
-<br>
-<br>
-**Note:** JavaScript follows the IEEE-754 standard for resolving
-floating-point values which can produce unexpected results.
-
-#### Since
-0.1.0
-#### Arguments
-1. `[start=0]` *(number)*: The start of the range.
-2. `end` *(number)*: The end of the range.
-3. `[step=1]` *(number)*: The value to increment or decrement by.
-
-#### Returns
-*(Array)*: Returns the new array of numbers.
-
-#### Example
-```js
-_.range(4);
-// => [0, 1, 2, 3]
-
-_.range(-4);
-// => [0, -1, -2, -3]
-
-_.range(1, 5);
-// => [1, 2, 3, 4]
-
-_.range(0, 20, 5);
-// => [0, 5, 10, 15]
-
-_.range(0, -4, -1);
-// => [0, -1, -2, -3]
-
-_.range(1, 4, 0);
-// => [1, 1, 1]
-
-_.range(0);
-// => []
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_rangerightstart0-end-step1"></a>`_.rangeRight([start=0], end, [step=1])`
-<a href="#_rangerightstart0-end-step1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15118 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.rangeright "See the npm package")
-
-This method is like `_.range` except that it populates values in
-descending order.
-
-#### Since
-4.0.0
-#### Arguments
-1. `[start=0]` *(number)*: The start of the range.
-2. `end` *(number)*: The end of the range.
-3. `[step=1]` *(number)*: The value to increment or decrement by.
-
-#### Returns
-*(Array)*: Returns the new array of numbers.
-
-#### Example
-```js
-_.rangeRight(4);
-// => [3, 2, 1, 0]
-
-_.rangeRight(-4);
-// => [-3, -2, -1, 0]
-
-_.rangeRight(1, 5);
-// => [4, 3, 2, 1]
-
-_.rangeRight(0, 20, 5);
-// => [15, 10, 5, 0]
-
-_.rangeRight(0, -4, -1);
-// => [-3, -2, -1, 0]
-
-_.rangeRight(1, 4, 0);
-// => [1, 1, 1]
-
-_.rangeRight(0);
-// => []
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_runincontextcontextroot"></a>`_.runInContext([context=root])`
-<a href="#_runincontextcontextroot">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1239 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.runincontext "See the npm package")
-
-Create a new pristine `lodash` function using the `context` object.
-
-#### Since
-1.1.0
-#### Arguments
-1. `[context=root]` *(Object)*: The context object.
-
-#### Returns
-*(Function)*: Returns a new `lodash` function.
-
-#### Example
-```js
-_.mixin({ 'foo': _.constant('foo') });
-
-var lodash = _.runInContext();
-lodash.mixin({ 'bar': lodash.constant('bar') });
-
-_.isFunction(_.foo);
-// => true
-_.isFunction(_.bar);
-// => false
-
-lodash.isFunction(lodash.foo);
-// => false
-lodash.isFunction(lodash.bar);
-// => true
-
-// Use `context` to mock `Date#getTime` use in `_.now`.
-var mock = _.runInContext({
-  'Date': function() {
-    return { 'getTime': getTimeMock };
-  }
-});
-
-// Create a suped-up `defer` in Node.js.
-var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_timesn-iteratee_identity"></a>`_.times(n, [iteratee=_.identity])`
-<a href="#_timesn-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15139 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.times "See the npm package")
-
-Invokes the iteratee `n` times, returning an array of the results of
-each invocation. The iteratee is invoked with one argument; *(index)*.
-
-#### Since
-0.1.0
-#### Arguments
-1. `n` *(number)*: The number of times to invoke `iteratee`.
-2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
-
-#### Returns
-*(Array)*: Returns the array of results.
-
-#### Example
-```js
-_.times(3, String);
-// => ['0', '1', '2']
-
- _.times(4, _.constant(true));
-// => [true, true, true, true]
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_topathvalue"></a>`_.toPath(value)`
-<a href="#_topathvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15183 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.topath "See the npm package")
-
-Converts `value` to a property path array.
-
-#### Since
-4.0.0
-#### Arguments
-1. `value` *(&#42;)*: The value to convert.
-
-#### Returns
-*(Array)*: Returns the new property path array.
-
-#### Example
-```js
-_.toPath('a.b.c');
-// => ['a', 'b', 'c']
-
-_.toPath('a[0].b.c');
-// => ['a', '0', 'b', 'c']
-
-var path = ['a', 'b', 'c'],
-    newPath = _.toPath(path);
-
-console.log(newPath);
-// => ['a', 'b', 'c']
-
-console.log(path === newPath);
-// => false
-```
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix=''])`
-<a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15207 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniqueid "See the npm package")
-
-Generates a unique ID. If `prefix` is given, the ID is appended to it.
-
-#### Since
-0.1.0
-#### Arguments
-1. `[prefix='']` *(string)*: The value to prefix the ID with.
-
-#### Returns
-*(string)*: Returns the unique ID.
-
-#### Example
-```js
-_.uniqueId('contact_');
-// => 'contact_104'
-
-_.uniqueId();
-// => '105'
-```
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Properties`
-
-<!-- div -->
-
-### <a id="_version"></a>`_.VERSION`
-<a href="#_version">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15894 "View in source") [&#x24C9;][1]
-
-(string): The semantic version number.
-
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_templatesettings"></a>`_.templateSettings`
-<a href="#_templatesettings">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1502 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.templatesettings "See the npm package")
-
-(Object): By default, the template delimiters used by lodash are like those in
-embedded Ruby *(ERB)*. Change the following template settings to use
-alternative delimiters.
-
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_templatesettingsescape"></a>`_.templateSettings.escape`
-<a href="#_templatesettingsescape">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1510 "View in source") [&#x24C9;][1]
-
-(RegExp): Used to detect `data` property values to be HTML-escaped.
-
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_templatesettingsevaluate"></a>`_.templateSettings.evaluate`
-<a href="#_templatesettingsevaluate">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1518 "View in source") [&#x24C9;][1]
-
-(RegExp): Used to detect code to be evaluated.
-
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_templatesettingsimports"></a>`_.templateSettings.imports`
-<a href="#_templatesettingsimports">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1542 "View in source") [&#x24C9;][1]
-
-(Object): Used to import variables into the compiled template.
-
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_templatesettingsinterpolate"></a>`_.templateSettings.interpolate`
-<a href="#_templatesettingsinterpolate">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1526 "View in source") [&#x24C9;][1]
-
-(RegExp): Used to detect `data` property values to inject.
-
-* * *
-
-<!-- /div -->
-
-<!-- div -->
-
-### <a id="_templatesettingsvariable"></a>`_.templateSettings.variable`
-<a href="#_templatesettingsvariable">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1534 "View in source") [&#x24C9;][1]
-
-(string): Used to reference the data object in the template text.
-
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- div -->
-
-## `Methods`
-
-<!-- div -->
-
-### <a id="_templatesettingsimports_"></a>`_.templateSettings.imports._`
-<a href="#_templatesettingsimports_">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1550 "View in source") [&#x24C9;][1]
-
-A reference to the `lodash` function.
-
-* * *
-
-<!-- /div -->
-
-<!-- /div -->
-
-<!-- /div -->
-
- [1]: #array "Jump back to the TOC."
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/_baseConvert.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/_baseConvert.js
deleted file mode 100644
index e7e631c..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/_baseConvert.js
+++ /dev/null
@@ -1,469 +0,0 @@
-var mapping = require('./_mapping'),
-    mutateMap = mapping.mutate,
-    fallbackHolder = require('./placeholder');
-
-/**
- * Creates a function, with an arity of `n`, that invokes `func` with the
- * arguments it receives.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} n The arity of the new function.
- * @returns {Function} Returns the new function.
- */
-function baseArity(func, n) {
-  return n == 2
-    ? function(a, b) { return func.apply(undefined, arguments); }
-    : function(a) { return func.apply(undefined, arguments); };
-}
-
-/**
- * Creates a function that invokes `func`, with up to `n` arguments, ignoring
- * any additional arguments.
- *
- * @private
- * @param {Function} func The function to cap arguments for.
- * @param {number} n The arity cap.
- * @returns {Function} Returns the new function.
- */
-function baseAry(func, n) {
-  return n == 2
-    ? function(a, b) { return func(a, b); }
-    : function(a) { return func(a); };
-}
-
-/**
- * Creates a clone of `array`.
- *
- * @private
- * @param {Array} array The array to clone.
- * @returns {Array} Returns the cloned array.
- */
-function cloneArray(array) {
-  var length = array ? array.length : 0,
-      result = Array(length);
-
-  while (length--) {
-    result[length] = array[length];
-  }
-  return result;
-}
-
-/**
- * Creates a function that clones a given object using the assignment `func`.
- *
- * @private
- * @param {Function} func The assignment function.
- * @returns {Function} Returns the new cloner function.
- */
-function createCloner(func) {
-  return function(object) {
-    return func({}, object);
-  };
-}
-
-/**
- * Creates a function that wraps `func` and uses `cloner` to clone the first
- * argument it receives.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {Function} cloner The function to clone arguments.
- * @returns {Function} Returns the new immutable function.
- */
-function immutWrap(func, cloner) {
-  return function() {
-    var length = arguments.length;
-    if (!length) {
-      return result;
-    }
-    var args = Array(length);
-    while (length--) {
-      args[length] = arguments[length];
-    }
-    var result = args[0] = cloner.apply(undefined, args);
-    func.apply(undefined, args);
-    return result;
-  };
-}
-
-/**
- * The base implementation of `convert` which accepts a `util` object of methods
- * required to perform conversions.
- *
- * @param {Object} util The util object.
- * @param {string} name The name of the function to convert.
- * @param {Function} func The function to convert.
- * @param {Object} [options] The options object.
- * @param {boolean} [options.cap=true] Specify capping iteratee arguments.
- * @param {boolean} [options.curry=true] Specify currying.
- * @param {boolean} [options.fixed=true] Specify fixed arity.
- * @param {boolean} [options.immutable=true] Specify immutable operations.
- * @param {boolean} [options.rearg=true] Specify rearranging arguments.
- * @returns {Function|Object} Returns the converted function or object.
- */
-function baseConvert(util, name, func, options) {
-  var setPlaceholder,
-      isLib = typeof name == 'function',
-      isObj = name === Object(name);
-
-  if (isObj) {
-    options = func;
-    func = name;
-    name = undefined;
-  }
-  if (func == null) {
-    throw new TypeError;
-  }
-  options || (options = {});
-
-  var config = {
-    'cap': 'cap' in options ? options.cap : true,
-    'curry': 'curry' in options ? options.curry : true,
-    'fixed': 'fixed' in options ? options.fixed : true,
-    'immutable': 'immutable' in options ? options.immutable : true,
-    'rearg': 'rearg' in options ? options.rearg : true
-  };
-
-  var forceCurry = ('curry' in options) && options.curry,
-      forceFixed = ('fixed' in options) && options.fixed,
-      forceRearg = ('rearg' in options) && options.rearg,
-      placeholder = isLib ? func : fallbackHolder,
-      pristine = isLib ? func.runInContext() : undefined;
-
-  var helpers = isLib ? func : {
-    'ary': util.ary,
-    'assign': util.assign,
-    'clone': util.clone,
-    'curry': util.curry,
-    'forEach': util.forEach,
-    'isArray': util.isArray,
-    'isFunction': util.isFunction,
-    'iteratee': util.iteratee,
-    'keys': util.keys,
-    'rearg': util.rearg,
-    'spread': util.spread,
-    'toPath': util.toPath
-  };
-
-  var ary = helpers.ary,
-      assign = helpers.assign,
-      clone = helpers.clone,
-      curry = helpers.curry,
-      each = helpers.forEach,
-      isArray = helpers.isArray,
-      isFunction = helpers.isFunction,
-      keys = helpers.keys,
-      rearg = helpers.rearg,
-      spread = helpers.spread,
-      toPath = helpers.toPath;
-
-  var aryMethodKeys = keys(mapping.aryMethod);
-
-  var wrappers = {
-    'castArray': function(castArray) {
-      return function() {
-        var value = arguments[0];
-        return isArray(value)
-          ? castArray(cloneArray(value))
-          : castArray.apply(undefined, arguments);
-      };
-    },
-    'iteratee': function(iteratee) {
-      return function() {
-        var func = arguments[0],
-            arity = arguments[1],
-            result = iteratee(func, arity),
-            length = result.length;
-
-        if (config.cap && typeof arity == 'number') {
-          arity = arity > 2 ? (arity - 2) : 1;
-          return (length && length <= arity) ? result : baseAry(result, arity);
-        }
-        return result;
-      };
-    },
-    'mixin': function(mixin) {
-      return function(source) {
-        var func = this;
-        if (!isFunction(func)) {
-          return mixin(func, Object(source));
-        }
-        var methods = [],
-            methodNames = [];
-
-        each(keys(source), function(key) {
-          var value = source[key];
-          if (isFunction(value)) {
-            methodNames.push(key);
-            methods.push(func.prototype[key]);
-          }
-        });
-
-        mixin(func, Object(source));
-
-        each(methodNames, function(methodName, index) {
-          var method = methods[index];
-          if (isFunction(method)) {
-            func.prototype[methodName] = method;
-          } else {
-            delete func.prototype[methodName];
-          }
-        });
-        return func;
-      };
-    },
-    'runInContext': function(runInContext) {
-      return function(context) {
-        return baseConvert(util, runInContext(context), options);
-      };
-    }
-  };
-
-  /*--------------------------------------------------------------------------*/
-
-  /**
-   * Creates a clone of `object` by `path`.
-   *
-   * @private
-   * @param {Object} object The object to clone.
-   * @param {Array|string} path The path to clone by.
-   * @returns {Object} Returns the cloned object.
-   */
-  function cloneByPath(object, path) {
-    path = toPath(path);
-
-    var index = -1,
-        length = path.length,
-        result = clone(Object(object)),
-        nested = result;
-
-    while (nested != null && ++index < length) {
-      var key = path[index],
-          value = nested[key];
-
-      if (value != null) {
-        nested[key] = clone(Object(value));
-      }
-      nested = nested[key];
-    }
-    return result;
-  }
-
-  /**
-   * Converts `lodash` to an immutable auto-curried iteratee-first data-last
-   * version with conversion `options` applied.
-   *
-   * @param {Object} [options] The options object. See `baseConvert` for more details.
-   * @returns {Function} Returns the converted `lodash`.
-   */
-  function convertLib(options) {
-    return _.runInContext.convert(options)(undefined);
-  }
-
-  /**
-   * Create a converter function for `func` of `name`.
-   *
-   * @param {string} name The name of the function to convert.
-   * @param {Function} func The function to convert.
-   * @returns {Function} Returns the new converter function.
-   */
-  function createConverter(name, func) {
-    var oldOptions = options;
-    return function(options) {
-      var newUtil = isLib ? pristine : helpers,
-          newFunc = isLib ? pristine[name] : func,
-          newOptions = assign(assign({}, oldOptions), options);
-
-      return baseConvert(newUtil, name, newFunc, newOptions);
-    };
-  }
-
-  /**
-   * Creates a function that wraps `func` to invoke its iteratee, with up to `n`
-   * arguments, ignoring any additional arguments.
-   *
-   * @private
-   * @param {Function} func The function to cap iteratee arguments for.
-   * @param {number} n The arity cap.
-   * @returns {Function} Returns the new function.
-   */
-  function iterateeAry(func, n) {
-    return overArg(func, function(func) {
-      return typeof func == 'function' ? baseAry(func, n) : func;
-    });
-  }
-
-  /**
-   * Creates a function that wraps `func` to invoke its iteratee with arguments
-   * arranged according to the specified `indexes` where the argument value at
-   * the first index is provided as the first argument, the argument value at
-   * the second index is provided as the second argument, and so on.
-   *
-   * @private
-   * @param {Function} func The function to rearrange iteratee arguments for.
-   * @param {number[]} indexes The arranged argument indexes.
-   * @returns {Function} Returns the new function.
-   */
-  function iterateeRearg(func, indexes) {
-    return overArg(func, function(func) {
-      var n = indexes.length;
-      return baseArity(rearg(baseAry(func, n), indexes), n);
-    });
-  }
-
-  /**
-   * Creates a function that invokes `func` with its first argument passed
-   * thru `transform`.
-   *
-   * @private
-   * @param {Function} func The function to wrap.
-   * @param {...Function} transform The functions to transform the first argument.
-   * @returns {Function} Returns the new function.
-   */
-  function overArg(func, transform) {
-    return function() {
-      var length = arguments.length;
-      if (!length) {
-        return func();
-      }
-      var args = Array(length);
-      while (length--) {
-        args[length] = arguments[length];
-      }
-      var index = config.rearg ? 0 : (length - 1);
-      args[index] = transform(args[index]);
-      return func.apply(undefined, args);
-    };
-  }
-
-  /**
-   * Creates a function that wraps `func` and applys the conversions
-   * rules by `name`.
-   *
-   * @private
-   * @param {string} name The name of the function to wrap.
-   * @param {Function} func The function to wrap.
-   * @returns {Function} Returns the converted function.
-   */
-  function wrap(name, func) {
-    name = mapping.aliasToReal[name] || name;
-
-    var result,
-        wrapped = func,
-        wrapper = wrappers[name];
-
-    if (wrapper) {
-      wrapped = wrapper(func);
-    }
-    else if (config.immutable) {
-      if (mutateMap.array[name]) {
-        wrapped = immutWrap(func, cloneArray);
-      }
-      else if (mutateMap.object[name]) {
-        wrapped = immutWrap(func, createCloner(func));
-      }
-      else if (mutateMap.set[name]) {
-        wrapped = immutWrap(func, cloneByPath);
-      }
-    }
-    each(aryMethodKeys, function(aryKey) {
-      each(mapping.aryMethod[aryKey], function(otherName) {
-        if (name == otherName) {
-          var aryN = !isLib && mapping.iterateeAry[name],
-              reargIndexes = mapping.iterateeRearg[name],
-              spreadStart = mapping.methodSpread[name];
-
-          result = wrapped;
-          if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
-            result = spreadStart === undefined
-              ? ary(result, aryKey)
-              : spread(result, spreadStart);
-          }
-          if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
-            result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
-          }
-          if (config.cap) {
-            if (reargIndexes) {
-              result = iterateeRearg(result, reargIndexes);
-            } else if (aryN) {
-              result = iterateeAry(result, aryN);
-            }
-          }
-          if (forceCurry || (config.curry && aryKey > 1)) {
-            forceCurry  && console.log(forceCurry, name);
-            result = curry(result, aryKey);
-          }
-          return false;
-        }
-      });
-      return !result;
-    });
-
-    result || (result = wrapped);
-    if (result == func) {
-      result = forceCurry ? curry(result, 1) : function() {
-        return func.apply(this, arguments);
-      };
-    }
-    result.convert = createConverter(name, func);
-    if (mapping.placeholder[name]) {
-      setPlaceholder = true;
-      result.placeholder = func.placeholder = placeholder;
-    }
-    return result;
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  if (!isObj) {
-    return wrap(name, func);
-  }
-  var _ = func;
-
-  // Convert methods by ary cap.
-  var pairs = [];
-  each(aryMethodKeys, function(aryKey) {
-    each(mapping.aryMethod[aryKey], function(key) {
-      var func = _[mapping.remap[key] || key];
-      if (func) {
-        pairs.push([key, wrap(key, func)]);
-      }
-    });
-  });
-
-  // Convert remaining methods.
-  each(keys(_), function(key) {
-    var func = _[key];
-    if (typeof func == 'function') {
-      var length = pairs.length;
-      while (length--) {
-        if (pairs[length][0] == key) {
-          return;
-        }
-      }
-      func.convert = createConverter(key, func);
-      pairs.push([key, func]);
-    }
-  });
-
-  // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
-  each(pairs, function(pair) {
-    _[pair[0]] = pair[1];
-  });
-
-  _.convert = convertLib;
-  if (setPlaceholder) {
-    _.placeholder = placeholder;
-  }
-  // Assign aliases.
-  each(keys(_), function(key) {
-    each(mapping.realToAlias[key] || [], function(alias) {
-      _[alias] = _[key];
-    });
-  });
-
-  return _;
-}
-
-module.exports = baseConvert;
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/_convertBrowser.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/_convertBrowser.js
deleted file mode 100644
index 1874a54..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/_convertBrowser.js
+++ /dev/null
@@ -1,18 +0,0 @@
-var baseConvert = require('./_baseConvert');
-
-/**
- * Converts `lodash` to an immutable auto-curried iteratee-first data-last
- * version with conversion `options` applied.
- *
- * @param {Function} lodash The lodash function to convert.
- * @param {Object} [options] The options object. See `baseConvert` for more details.
- * @returns {Function} Returns the converted `lodash`.
- */
-function browserConvert(lodash, options) {
-  return baseConvert(lodash, lodash, options);
-}
-
-if (typeof _ == 'function') {
-  _ = browserConvert(_.runInContext());
-}
-module.exports = browserConvert;
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/_mapping.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/_mapping.js
deleted file mode 100644
index 18a3196..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/_mapping.js
+++ /dev/null
@@ -1,290 +0,0 @@
-/** Used to map aliases to their real names. */
-exports.aliasToReal = {
-
-  // Lodash aliases.
-  'each': 'forEach',
-  'eachRight': 'forEachRight',
-  'entries': 'toPairs',
-  'entriesIn': 'toPairsIn',
-  'extend': 'assignIn',
-  'extendWith': 'assignInWith',
-  'first': 'head',
-
-  // Ramda aliases.
-  '__': 'placeholder',
-  'all': 'every',
-  'allPass': 'overEvery',
-  'always': 'constant',
-  'any': 'some',
-  'anyPass': 'overSome',
-  'apply': 'spread',
-  'assoc': 'set',
-  'assocPath': 'set',
-  'complement': 'negate',
-  'compose': 'flowRight',
-  'contains': 'includes',
-  'dissoc': 'unset',
-  'dissocPath': 'unset',
-  'equals': 'isEqual',
-  'identical': 'eq',
-  'init': 'initial',
-  'invertObj': 'invert',
-  'juxt': 'over',
-  'omitAll': 'omit',
-  'nAry': 'ary',
-  'path': 'get',
-  'pathEq': 'matchesProperty',
-  'pathOr': 'getOr',
-  'paths': 'at',
-  'pickAll': 'pick',
-  'pipe': 'flow',
-  'pluck': 'map',
-  'prop': 'get',
-  'propEq': 'matchesProperty',
-  'propOr': 'getOr',
-  'props': 'at',
-  'unapply': 'rest',
-  'unnest': 'flatten',
-  'useWith': 'overArgs',
-  'whereEq': 'filter',
-  'zipObj': 'zipObject'
-};
-
-/** Used to map ary to method names. */
-exports.aryMethod = {
-  '1': [
-    'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
-    'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
-    'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
-    'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
-    'uniqueId', 'words'
-  ],
-  '2': [
-    'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
-    'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
-    'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
-    'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
-    'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast',
-    'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
-    'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
-    'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
-    'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
-    'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
-    'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth',
-    'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
-    'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
-    'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
-    'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
-    'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
-    'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
-    'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
-    'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
-    'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
-    'zipObjectDeep'
-  ],
-  '3': [
-    'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
-    'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
-    'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith',
-    'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy',
-    'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice',
-    'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith',
-    'update', 'xorBy', 'xorWith', 'zipWith'
-  ],
-  '4': [
-    'fill', 'setWith', 'updateWith'
-  ]
-};
-
-/** Used to map ary to rearg configs. */
-exports.aryRearg = {
-  '2': [1, 0],
-  '3': [2, 0, 1],
-  '4': [3, 2, 0, 1]
-};
-
-/** Used to map method names to their iteratee ary. */
-exports.iterateeAry = {
-  'dropRightWhile': 1,
-  'dropWhile': 1,
-  'every': 1,
-  'filter': 1,
-  'find': 1,
-  'findIndex': 1,
-  'findKey': 1,
-  'findLast': 1,
-  'findLastIndex': 1,
-  'findLastKey': 1,
-  'flatMap': 1,
-  'flatMapDeep': 1,
-  'flatMapDepth': 1,
-  'forEach': 1,
-  'forEachRight': 1,
-  'forIn': 1,
-  'forInRight': 1,
-  'forOwn': 1,
-  'forOwnRight': 1,
-  'map': 1,
-  'mapKeys': 1,
-  'mapValues': 1,
-  'partition': 1,
-  'reduce': 2,
-  'reduceRight': 2,
-  'reject': 1,
-  'remove': 1,
-  'some': 1,
-  'takeRightWhile': 1,
-  'takeWhile': 1,
-  'times': 1,
-  'transform': 2
-};
-
-/** Used to map method names to iteratee rearg configs. */
-exports.iterateeRearg = {
-  'mapKeys': [1]
-};
-
-/** Used to map method names to rearg configs. */
-exports.methodRearg = {
-  'assignInWith': [1, 2, 0],
-  'assignWith': [1, 2, 0],
-  'getOr': [2, 1, 0],
-  'isEqualWith': [1, 2, 0],
-  'isMatchWith': [2, 1, 0],
-  'mergeWith': [1, 2, 0],
-  'padChars': [2, 1, 0],
-  'padCharsEnd': [2, 1, 0],
-  'padCharsStart': [2, 1, 0],
-  'pullAllBy': [2, 1, 0],
-  'pullAllWith': [2, 1, 0],
-  'setWith': [3, 1, 2, 0],
-  'sortedIndexBy': [2, 1, 0],
-  'sortedLastIndexBy': [2, 1, 0],
-  'updateWith': [3, 1, 2, 0],
-  'zipWith': [1, 2, 0]
-};
-
-/** Used to map method names to spread configs. */
-exports.methodSpread = {
-  'invokeArgs': 2,
-  'invokeArgsMap': 2,
-  'partial': 1,
-  'partialRight': 1,
-  'without': 1
-};
-
-/** Used to identify methods which mutate arrays or objects. */
-exports.mutate = {
-  'array': {
-    'fill': true,
-    'pull': true,
-    'pullAll': true,
-    'pullAllBy': true,
-    'pullAllWith': true,
-    'pullAt': true,
-    'remove': true,
-    'reverse': true
-  },
-  'object': {
-    'assign': true,
-    'assignIn': true,
-    'assignInWith': true,
-    'assignWith': true,
-    'defaults': true,
-    'defaultsDeep': true,
-    'merge': true,
-    'mergeWith': true
-  },
-  'set': {
-    'set': true,
-    'setWith': true,
-    'unset': true,
-    'update': true,
-    'updateWith': true
-  }
-};
-
-/** Used to track methods with placeholder support */
-exports.placeholder = {
-  'bind': true,
-  'bindKey': true,
-  'curry': true,
-  'curryRight': true,
-  'partial': true,
-  'partialRight': true
-};
-
-/** Used to map real names to their aliases. */
-exports.realToAlias = (function() {
-  var hasOwnProperty = Object.prototype.hasOwnProperty,
-      object = exports.aliasToReal,
-      result = {};
-
-  for (var key in object) {
-    var value = object[key];
-    if (hasOwnProperty.call(result, value)) {
-      result[value].push(key);
-    } else {
-      result[value] = [key];
-    }
-  }
-  return result;
-}());
-
-/** Used to map method names to other names. */
-exports.remap = {
-  'curryN': 'curry',
-  'curryRightN': 'curryRight',
-  'getOr': 'get',
-  'invokeArgs': 'invoke',
-  'invokeArgsMap': 'invokeMap',
-  'padChars': 'pad',
-  'padCharsEnd': 'padEnd',
-  'padCharsStart': 'padStart',
-  'restFrom': 'rest',
-  'spreadFrom': 'spread',
-  'trimChars': 'trim',
-  'trimCharsEnd': 'trimEnd',
-  'trimCharsStart': 'trimStart'
-};
-
-/** Used to track methods that skip fixing their arity. */
-exports.skipFixed = {
-  'castArray': true,
-  'flow': true,
-  'flowRight': true,
-  'iteratee': true,
-  'mixin': true,
-  'runInContext': true
-};
-
-/** Used to track methods that skip rearranging arguments. */
-exports.skipRearg = {
-  'add': true,
-  'assign': true,
-  'assignIn': true,
-  'bind': true,
-  'bindKey': true,
-  'concat': true,
-  'difference': true,
-  'divide': true,
-  'eq': true,
-  'gt': true,
-  'gte': true,
-  'isEqual': true,
-  'lt': true,
-  'lte': true,
-  'matchesProperty': true,
-  'merge': true,
-  'multiply': true,
-  'overArgs': true,
-  'partial': true,
-  'partialRight': true,
-  'random': true,
-  'range': true,
-  'rangeRight': true,
-  'subtract': true,
-  'without': true,
-  'zip': true,
-  'zipObject': true
-};
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/placeholder.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/placeholder.js
deleted file mode 100644
index 1ce1739..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/fp/placeholder.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * The default argument placeholder value for methods.
- *
- * @type {Object}
- */
-module.exports = {};
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/file.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/file.js
deleted file mode 100644
index 9f9016f..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/file.js
+++ /dev/null
@@ -1,71 +0,0 @@
-'use strict';
-
-var _ = require('lodash'),
-    fs = require('fs-extra'),
-    glob = require('glob'),
-    path = require('path');
-
-var minify = require('../common/minify.js');
-
-/*----------------------------------------------------------------------------*/
-
-/**
- * Creates a [fs.copy](https://github.com/jprichardson/node-fs-extra#copy)
- * function with `srcPath` and `destPath` partially applied.
- *
- * @memberOf file
- * @param {string} srcPath The path of the file to copy.
- * @param {string} destPath The path to copy the file to.
- * @returns {Function} Returns the partially applied function.
- */
-function copy(srcPath, destPath) {
-  return _.partial(fs.copy, srcPath, destPath);
-}
-
-/**
- * Creates an object of compiled template and base name pairs that match `pattern`.
- *
- * @memberOf file
- * @param {string} pattern The glob pattern to be match.
- * @returns {Object} Returns the object of compiled templates.
- */
-function globTemplate(pattern) {
-  return _.transform(glob.sync(pattern), function(result, filePath) {
-    var key = path.basename(filePath, path.extname(filePath));
-    result[key] = _.template(fs.readFileSync(filePath, 'utf8'));
-  }, {});
-}
-
-/**
- * Creates a `minify` function with `srcPath` and `destPath` partially applied.
- *
- * @memberOf file
- * @param {string} srcPath The path of the file to minify.
- * @param {string} destPath The path to write the file to.
- * @returns {Function} Returns the partially applied function.
- */
-function min(srcPath, destPath) {
-  return _.partial(minify, srcPath, destPath);
-}
-
-/**
- * Creates a [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback)
- * function with `filePath` and `data` partially applied.
- *
- * @memberOf file
- * @param {string} destPath The path to write the file to.
- * @param {string} data The data to write to the file.
- * @returns {Function} Returns the partially applied function.
- */
-function write(destPath, data) {
-  return _.partial(fs.writeFile, destPath, data);
-}
-
-/*----------------------------------------------------------------------------*/
-
-module.exports = {
-  'copy': copy,
-  'globTemplate': globTemplate,
-  'min': min,
-  'write': write
-};
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/mapping.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/mapping.js
deleted file mode 100644
index 332f5af..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/mapping.js
+++ /dev/null
@@ -1,9 +0,0 @@
-'use strict';
-
-var _mapping = require('../../fp/_mapping'),
-    util = require('./util'),
-    Hash = util.Hash;
-
-/*----------------------------------------------------------------------------*/
-
-module.exports = new Hash(_mapping);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/minify.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/minify.js
deleted file mode 100644
index 7a0082d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/minify.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict';
-
-var _ = require('lodash'),
-    fs = require('fs-extra'),
-    uglify = require('uglify-js');
-
-var uglifyOptions = require('./uglify.options');
-
-/*----------------------------------------------------------------------------*/
-
-/**
- * Asynchronously minifies the file at `srcPath`, writes it to `destPath`, and
- * invokes `callback` upon completion. The callback is invoked with one argument:
- * (error).
- *
- * If unspecified, `destPath` is `srcPath` with an extension of `.min.js`. For
- * example, a `srcPath` of `path/to/foo.js` would have a `destPath` of `path/to/foo.min.js`.
- *
- * @param {string} srcPath The path of the file to minify.
- * @param {string} [destPath] The path to write the file to.
- * @param {Function} callback The function invoked upon completion.
- * @param {Object} [option] The UglifyJS options object.
- */
-function minify(srcPath, destPath, callback, options) {
-  if (_.isFunction(destPath)) {
-    if (_.isObject(callback)) {
-      options = callback;
-    }
-    callback = destPath;
-    destPath = undefined;
-  }
-  if (!destPath) {
-    destPath = srcPath.replace(/(?=\.js$)/, '.min');
-  }
-  var output = uglify.minify(srcPath, _.defaults(options || {}, uglifyOptions));
-  fs.writeFile(destPath, output.code, 'utf-8', callback);
-}
-
-module.exports = minify;
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/uglify.options.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/uglify.options.js
deleted file mode 100644
index af0ff43..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/uglify.options.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-
-/**
- * The UglifyJS options object for
- * [compress](https://github.com/mishoo/UglifyJS2#compressor-options),
- * [mangle](https://github.com/mishoo/UglifyJS2#mangler-options), and
- * [output](https://github.com/mishoo/UglifyJS2#beautifier-options) options.
- */
-module.exports = {
-  'compress': {
-    'pure_getters': true,
-    'unsafe': true,
-    'warnings': false
-  },
-  'mangle': {
-    'except': ['define']
-  },
-  'output': {
-    'ascii_only': true,
-    'comments': /^!|@cc_on|@license|@preserve/i,
-    'max_line_len': 500
-  }
-};
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/util.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/util.js
deleted file mode 100644
index 6445186..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/common/util.js
+++ /dev/null
@@ -1,27 +0,0 @@
-'use strict';
-
-var _ = require('lodash');
-
-/*----------------------------------------------------------------------------*/
-
-/**
- * Creates a hash object. If a `properties` object is provided, its own
- * enumerable properties are assigned to the created object.
- *
- * @memberOf util
- * @param {Object} [properties] The properties to assign to the object.
- * @returns {Object} Returns the new hash object.
- */
-function Hash(properties) {
-  return _.transform(properties, function(result, value, key) {
-    result[key] = (_.isPlainObject(value) && !(value instanceof Hash))
-      ? new Hash(value)
-      : value;
-  }, this);
-}
-
-Hash.prototype = Object.create(null);
-
-module.exports = {
-  'Hash': Hash
-};
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/build-dist.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/build-dist.js
deleted file mode 100644
index bad62d2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/build-dist.js
+++ /dev/null
@@ -1,55 +0,0 @@
-'use strict';
-
-var _ = require('lodash'),
-    async = require('async'),
-    path = require('path'),
-    webpack = require('webpack');
-
-var file = require('../common/file');
-
-var basePath = path.join(__dirname, '..', '..'),
-    distPath = path.join(basePath, 'dist'),
-    fpPath = path.join(basePath, 'fp'),
-    filename = 'lodash.fp.js';
-
-var fpConfig = {
-  'entry': path.join(fpPath, '_convertBrowser.js'),
-  'output': {
-    'path': distPath,
-    'filename': filename,
-    'library': 'fp',
-    'libraryTarget': 'umd'
-  },
-  'plugins': [
-    new webpack.optimize.OccurenceOrderPlugin,
-    new webpack.optimize.DedupePlugin
-  ]
-};
-
-var mappingConfig = {
-  'entry': path.join(fpPath, '_mapping.js'),
-  'output': {
-    'path': distPath,
-    'filename': 'mapping.fp.js',
-    'library': 'mapping',
-    'libraryTarget': 'umd'
-  }
-};
-
-/*----------------------------------------------------------------------------*/
-
-function onComplete(error) {
-  if (error) {
-    throw error;
-  }
-}
-
-function build() {
-  async.series([
-    _.partial(webpack, mappingConfig),
-    _.partial(webpack, fpConfig),
-    file.min(path.join(distPath, filename))
-  ], onComplete);
-}
-
-build();
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/build-doc.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/build-doc.js
deleted file mode 100644
index 02800bc..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/build-doc.js
+++ /dev/null
@@ -1,65 +0,0 @@
-'use strict';
-
-var _ = require('lodash'),
-    fs = require('fs-extra'),
-    path = require('path');
-
-var file = require('../common/file'),
-    mapping = require('../common/mapping');
-
-var templatePath = path.join(__dirname, 'template/doc'),
-    template = file.globTemplate(path.join(templatePath, '*.jst'));
-
-var argNames = ['a', 'b', 'c', 'd'];
-
-var templateData = {
-  'mapping': mapping,
-  'toArgOrder': toArgOrder,
-  'toFuncList': toFuncList
-};
-
-function toArgOrder(array) {
-  var reordered = [];
-  _.each(array, function(newIndex, index) {
-    reordered[newIndex] = argNames[index];
-  });
-  return '`(' + reordered.join(', ') + ')`';
-}
-
-function toFuncList(array) {
-  var chunks = _.chunk(array.slice().sort(), 5),
-      lastChunk = _.last(chunks),
-      last = lastChunk ? lastChunk.pop() : undefined;
-
-  chunks = _.reject(chunks, _.isEmpty);
-  lastChunk = _.last(chunks);
-
-  var result = '`' + _.map(chunks, function(chunk) {
-    return chunk.join('`, `') + '`';
-  }).join(',\n`');
-
-  if (last == null) {
-    return result;
-  }
-  if (_.size(chunks) > 1 || _.size(lastChunk) > 1) {
-    result += ',';
-  }
-  result += ' &';
-  result += _.size(lastChunk) < 5 ? ' ' : '\n';
-  return result + '`' + last + '`';
-}
-
-/*----------------------------------------------------------------------------*/
-
-function onComplete(error) {
-  if (error) {
-    throw error;
-  }
-}
-
-function build(target) {
-  target = path.resolve(target);
-  fs.writeFile(target, template.wiki(templateData), onComplete);
-}
-
-build(_.last(process.argv));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/build-modules.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/build-modules.js
deleted file mode 100644
index 43902e0..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/build-modules.js
+++ /dev/null
@@ -1,120 +0,0 @@
-'use strict';
-
-var _ = require('lodash'),
-    async = require('async'),
-    glob = require('glob'),
-    path = require('path');
-
-var file = require('../common/file'),
-    mapping = require('../common/mapping');
-
-var templatePath = path.join(__dirname, 'template/modules'),
-    template = file.globTemplate(path.join(templatePath, '*.jst'));
-
-var aryMethods = _.union(
-  mapping.aryMethod[1],
-  mapping.aryMethod[2],
-  mapping.aryMethod[3],
-  mapping.aryMethod[4]
-);
-
-var categories = [
-  'array',
-  'collection',
-  'date',
-  'function',
-  'lang',
-  'math',
-  'number',
-  'object',
-  'seq',
-  'string',
-  'util'
-];
-
-var ignored = [
-  '_*.js',
-  'core.js',
-  'core.min.js',
-  'fp.js',
-  'index.js',
-  'lodash.js',
-  'lodash.min.js'
-];
-
-function isAlias(funcName) {
-  return _.has(mapping.aliasToReal, funcName);
-}
-
-function isCategory(funcName) {
-  return _.includes(categories, funcName);
-}
-
-function isThru(funcName) {
-  return !_.includes(aryMethods, funcName);
-}
-
-function getTemplate(moduleName) {
-  var data = {
-    'name': _.result(mapping.aliasToReal, moduleName, moduleName),
-    'mapping': mapping
-  };
-
-  if (isAlias(moduleName)) {
-    return template.alias(data);
-  }
-  if (isCategory(moduleName)) {
-    return template.category(data);
-  }
-  if (isThru(moduleName)) {
-    return template.thru(data);
-  }
-  return template.module(data);
-}
-
-/*----------------------------------------------------------------------------*/
-
-function onComplete(error) {
-  if (error) {
-    throw error;
-  }
-}
-
-function build(target) {
-  target = path.resolve(target);
-
-  var fpPath = path.join(target, 'fp');
-
-  // Glob existing lodash module paths.
-  var modulePaths = glob.sync(path.join(target, '*.js'), {
-    'nodir': true,
-    'ignore': ignored.map(function(filename) {
-      return path.join(target, filename);
-    })
-  });
-
-  // Add FP alias and remapped module paths.
-  _.each([mapping.aliasToReal, mapping.remap], function(data) {
-    _.forOwn(data, function(realName, alias) {
-      var modulePath = path.join(target, alias + '.js');
-      if (!_.includes(modulePaths, modulePath)) {
-        modulePaths.push(modulePath);
-      }
-    });
-  });
-
-  var actions = modulePaths.map(function(modulePath) {
-    var moduleName = path.basename(modulePath, '.js');
-    return file.write(path.join(fpPath, moduleName + '.js'), getTemplate(moduleName));
-  });
-
-  actions.unshift(file.copy(path.join(__dirname, '../../fp'), fpPath));
-  actions.push(file.write(path.join(fpPath, '_falseOptions.js'), template._falseOptions()));
-  actions.push(file.write(path.join(fpPath, '_util.js'), template._util()));
-  actions.push(file.write(path.join(target, 'fp.js'), template.fp()));
-  actions.push(file.write(path.join(fpPath, 'convert.js'), template.convert()));
-
-  async.series(actions, onComplete);
-}
-
-build(_.last(process.argv));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/doc/wiki.jst b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/doc/wiki.jst
deleted file mode 100644
index 188302f..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/doc/wiki.jst
+++ /dev/null
@@ -1,220 +0,0 @@
-## lodash/fp
-
-The `lodash/fp` module is an instance of `lodash` with its methods wrapped to
-produce immutable auto-curried iteratee-first data-last methods.
-
-## Installation
-
-In a browser:
-```html
-<script src='path/to/lodash.js'></script>
-<script src='path/to/lodash.fp.js'></script>
-<script>
-// Loading `lodash.fp.js` converts `_` to its fp variant.
-_.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 });
-// → { 'a: 1, 'b': 2 }
-
-// Use `noConflict` to restore the pre-fp variant.
-var fp = _.noConflict();
-
-_.defaults({ 'a': 1 }, { 'a': 2, 'b': 2 });
-// → { 'a: 1, 'b': 2 }
-fp.defaults({ 'a': 2, 'b': 2 })({ 'a': 1 });
-// → { 'a: 1, 'b': 2 }
-</script>
-```
-
-In Node.js:
-```js
-// Load the fp build.
-var fp = require('lodash/fp');
-
-// Load a method category.
-var object = require('lodash/fp/object');
-
-// Load a single method for smaller builds with browserify/rollup/webpack.
-var extend = require('lodash/fp/extend');
-```
-
-## Mapping
-
-Immutable auto-curried iteratee-first data-last methods sound great, but what
-does that really mean for each method? Below is a breakdown of the mapping used
-to convert each method.
-
-#### Capped Iteratee Arguments
-
-Iteratee arguments are capped to avoid gotchas with variadic iteratees.
-```js
-// The `lodash/map` iteratee receives three arguments:
-// (value, index|key, collection)
-_.map(['6', '8', '10'], parseInt);
-// → [6, NaN, 2]
-
-// The `lodash/fp/map` iteratee is capped at one argument:
-// (value)
-fp.map(parseInt)(['6', '8', '10']);
-// → [6, 8, 10]
-```
-
-Methods that cap iteratees to one argument:<br>
-<%= toFuncList(_.keys(_.pickBy(mapping.iterateeAry, _.partial(_.eq, _, 1)))) %>
-
-Methods that cap iteratees to two arguments:<br>
-<%= toFuncList(_.keys(_.pickBy(mapping.iterateeAry, _.partial(_.eq, _, 2)))) %>
-
-The iteratee of `mapKeys` is invoked with one argument: (key)
-
-#### Fixed Arity
-
-Methods have fixed arities to support auto-currying.
-```js
-// `lodash/padStart` accepts an optional `chars` param.
-_.padStart('a', 3, '-')
-// → '--a'
-
-// `lodash/fp/padStart` does not.
-fp.padStart(3)('a');
-// → '  a'
-fp.padCharsStart('-')(3)('a');
-// → '--a'
-```
-
-Methods with a fixed arity of one:<br>
-<%= toFuncList(_.difference(mapping.aryMethod[1], _.keys(mapping.skipFixed))) %>
-
-Methods with a fixed arity of two:<br>
-<%= toFuncList(_.difference(mapping.aryMethod[2], _.keys(mapping.skipFixed))) %>
-
-Methods with a fixed arity of three:<br>
-<%= toFuncList(_.difference(mapping.aryMethod[3], _.keys(mapping.skipFixed))) %>
-
-Methods with a fixed arity of four:<br>
-<%= toFuncList(_.difference(mapping.aryMethod[4], _.keys(mapping.skipFixed))) %>
-
-#### Rearranged Arguments
-
-Method arguments are rearranged to make composition easier.
-```js
-// `lodash/filter` is data-first iteratee-last:
-// (collection, iteratee)
-var compact = _.partial(_.filter, _, Boolean);
-compact(['a', null, 'c']);
-// → ['a', 'c']
-
-// `lodash/fp/filter` is iteratee-first data-last:
-// (iteratee, collection)
-var compact = fp.filter(Boolean);
-compact(['a', null, 'c']);
-// → ['a', 'c']
-```
-
-##### Most methods follow these rules
-
-A fixed arity of two has an argument order of:<br>
-<%= toArgOrder(mapping.aryRearg[2]) %>
-
-A fixed arity of three has an argument order of:<br>
-<%= toArgOrder(mapping.aryRearg[3]) %>
-
-A fixed arity of four has an argument order of:<br>
-<%= toArgOrder(mapping.aryRearg[4]) %>
-
-##### Exceptions to the rules
-
-Methods that accept an array of arguments as their second parameter:<br>
-<%= toFuncList(_.keys(mapping.methodSpread)) %>
-
-Methods with unchanged argument orders:<br>
-<%= toFuncList(_.keys(mapping.skipRearg)) %>
-
-Methods with custom argument orders:<br>
-<%= _.map(_.keys(mapping.methodRearg), function(methodName) {
-  var orders = mapping.methodRearg[methodName];
-  return ' * `_.' + methodName + '` has an order of ' + toArgOrder(orders);
-}).join('\n') %>
-
-#### New Methods
-
-Not all variadic methods have corresponding new method variants. Feel free to
-[request](https://github.com/lodash/lodash/blob/master/.github/CONTRIBUTING.md#feature-requests)
-any additions.
-
-Methods created to accommodate Lodash’s variadic methods:<br>
-<%= toFuncList(_.keys(mapping.remap)) %>
-
-#### Aliases
-
-There are <%= _.size(mapping.aliasToReal) %> method aliases:<br>
-<%= _.map(_.keys(mapping.aliasToReal).sort(), function(alias) {
-  var realName = mapping.aliasToReal[alias];
-  return ' * `_.' + alias + '` is an alias of `_.' + realName + '`';
-}).join('\n') %>
-
-## Placeholders
-
-The placeholder argument, which defaults to `_`, may be used to fill in method
-arguments in a different order. Placeholders are filled by the first available
-arguments of the curried returned function.
-```js
-// The equivalent of `2 > 5`.
-_.gt(2)(5);
-// → false
-
-// The equivalent of `_.gt(5, 2)` or `5 > 2`.
-_.gt(_, 2)(5);
-// → true
-```
-
-## Chaining
-
-The `lodash/fp` module **does not** convert chain sequence methods. See
-[Izaak Schroeder’s article](https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba)
-on using functional composition as an alternative to method chaining.
-
-## Convert
-
-Although `lodash/fp` & its method modules come pre-converted, there are times
-when you may want to customize the conversion. That’s when the `convert` method
-comes in handy.
-```js
-// Every option is `true` by default.
-var _fp = fp.convert({
-  // Specify capping iteratee arguments.
-  'cap': true,
-  // Specify currying.
-  'curry': true,
-  // Specify fixed arity.
-  'fixed': true,
-  // Specify immutable operations.
-  'immutable': true,
-  // Specify rearranging arguments.
-  'rearg': true
-});
-
-// The `convert` method is available on each method too.
-var mapValuesWithKey = fp.mapValues.convert({ 'cap': false });
-
-// Here’s an example of disabling iteratee argument caps to access the `key` param.
-mapValuesWithKey(function(value, key) {
-  return key == 'a' ? -1 : value;
-})({ 'a': 1, 'b': 1 });
-// => { 'a': -1, 'b': 1 }
-```
-
-Manual conversions are also possible with the `convert` module.
-```js
-var convert = require('lodash/fp/convert');
-
-// Convert by name.
-var assign = convert('assign', require('lodash.assign'));
-
-// Convert by object.
-var fp = convert({
-  'assign': require('lodash.assign'),
-  'chunk': require('lodash.chunk')
-});
-
-// Convert by `lodash` instance.
-var fp = convert(lodash.runInContext());
-```
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/_falseOptions.jst b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/_falseOptions.jst
deleted file mode 100644
index 773235e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/_falseOptions.jst
+++ /dev/null
@@ -1,7 +0,0 @@
-module.exports = {
-  'cap': false,
-  'curry': false,
-  'fixed': false,
-  'immutable': false,
-  'rearg': false
-};
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/_util.jst b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/_util.jst
deleted file mode 100644
index d450396..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/_util.jst
+++ /dev/null
@@ -1,14 +0,0 @@
-module.exports = {
-  'ary': require('../ary'),
-  'assign': require('../_baseAssign'),
-  'clone': require('../clone'),
-  'curry': require('../curry'),
-  'forEach': require('../_arrayEach'),
-  'isArray': require('../isArray'),
-  'isFunction': require('../isFunction'),
-  'iteratee': require('../iteratee'),
-  'keys': require('../_baseKeys'),
-  'rearg': require('../rearg'),
-  'spread': require('../spread'),
-  'toPath': require('../toPath')
-};
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/alias.jst b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/alias.jst
deleted file mode 100644
index 6d72710..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/alias.jst
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./<%= name %>');
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/category.jst b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/category.jst
deleted file mode 100644
index 62c2db8..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/category.jst
+++ /dev/null
@@ -1,2 +0,0 @@
-var convert = require('./convert');
-module.exports = convert(require('../<%= name %>'));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/convert.jst b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/convert.jst
deleted file mode 100644
index 4795dc4..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/convert.jst
+++ /dev/null
@@ -1,18 +0,0 @@
-var baseConvert = require('./_baseConvert'),
-    util = require('./_util');
-
-/**
- * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
- * version with conversion `options` applied. If `name` is an object its methods
- * will be converted.
- *
- * @param {string} name The name of the function to wrap.
- * @param {Function} [func] The function to wrap.
- * @param {Object} [options] The options object. See `baseConvert` for more details.
- * @returns {Function|Object} Returns the converted function or object.
- */
-function convert(name, func, options) {
-  return baseConvert(util, name, func, options);
-}
-
-module.exports = convert;
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/fp.jst b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/fp.jst
deleted file mode 100644
index e372dbb..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/fp.jst
+++ /dev/null
@@ -1,2 +0,0 @@
-var _ = require('./lodash.min').runInContext();
-module.exports = require('./fp/_baseConvert')(_, _);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/module.jst b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/module.jst
deleted file mode 100644
index 289bd2b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/module.jst
+++ /dev/null
@@ -1,5 +0,0 @@
-var convert = require('./convert'),
-    func = convert('<%= name %>', require('../<%= _.result(mapping.remap, name, name) %>'));
-
-func.placeholder = require('./placeholder');
-module.exports = func;
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/thru.jst b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/thru.jst
deleted file mode 100644
index 5bc1a7b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/fp/template/modules/thru.jst
+++ /dev/null
@@ -1,5 +0,0 @@
-var convert = require('./convert'),
-    func = convert('<%= name %>', require('../<%= _.result(mapping.remap, name, name) %>'), require('./_falseOptions'));
-
-func.placeholder = require('./placeholder');
-module.exports = func;
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/main/build-dist.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/main/build-dist.js
deleted file mode 100644
index 14b3fd3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/main/build-dist.js
+++ /dev/null
@@ -1,30 +0,0 @@
-'use strict';
-
-var async = require('async'),
-    path = require('path');
-
-var file = require('../common/file');
-
-var basePath = path.join(__dirname, '..', '..'),
-    distPath = path.join(basePath, 'dist'),
-    filename = 'lodash.js';
-
-var baseLodash = path.join(basePath, filename),
-    distLodash = path.join(distPath, filename);
-
-/*----------------------------------------------------------------------------*/
-
-function onComplete(error) {
-  if (error) {
-    throw error;
-  }
-}
-
-function build() {
-  async.series([
-    file.copy(baseLodash, distLodash),
-    file.min(distLodash)
-  ], onComplete);
-}
-
-build();
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/main/build-doc.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/main/build-doc.js
deleted file mode 100644
index 9756954..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/main/build-doc.js
+++ /dev/null
@@ -1,60 +0,0 @@
-'use strict';
-
-var _ = require('lodash'),
-    docdown = require('docdown'),
-    fs = require('fs-extra'),
-    path = require('path');
-
-var basePath = path.join(__dirname, '..', '..'),
-    docPath = path.join(basePath, 'doc'),
-    readmePath = path.join(docPath, 'README.md');
-
-var pkg = require('../../package.json'),
-    version = pkg.version;
-
-var config = {
-  'base': {
-    'entryLinks': [
-      '<% if (name == "templateSettings" || !/^(?:methods|properties|seq)$/i.test(category)) {' +
-      'print("[&#x24C3;](https://www.npmjs.com/package/lodash." + name.toLowerCase() + " \\"See the npm package\\")")' +
-      '} %>'
-    ],
-    'path': path.join(basePath, 'lodash.js'),
-    'title': '<a href="https://lodash.com/">lodash</a> <span>v' + version + '</span>',
-    'toc': 'categories',
-    'url': 'https://github.com/lodash/lodash/blob/' + version + '/lodash.js'
-  },
-  'github': {
-    'hash': 'github'
-  },
-  'site': {
-    'tocLink': '#docs'
-  }
-};
-
-function postprocess(string) {
-  // Fix docdown bugs.
-  return string
-    // Repair the default value of `chars`.
-    // See https://github.com/eslint/doctrine/issues/157 for more details.
-    .replace(/\bchars=''/g, "chars=' '")
-    // Wrap symbol property identifiers in brackets.
-    .replace(/\.(Symbol\.(?:[a-z]+[A-Z]?)+)/g, '[$1]');
-}
-
-/*----------------------------------------------------------------------------*/
-
-function onComplete(error) {
-  if (error) {
-    throw error;
-  }
-}
-
-function build(type) {
-  var options = _.defaults({}, config.base, config[type]),
-      markdown = docdown(options);
-
-  fs.writeFile(readmePath, postprocess(markdown), onComplete);
-}
-
-build(_.last(process.argv));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/main/build-modules.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/main/build-modules.js
deleted file mode 100644
index 5d89e0d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lib/main/build-modules.js
+++ /dev/null
@@ -1,34 +0,0 @@
-'use strict';
-
-var _ = require('lodash'),
-    async = require('async'),
-    path = require('path');
-
-var file = require('../common/file');
-
-var basePath = path.join(__dirname, '..', '..'),
-    distPath = path.join(basePath, 'dist');
-
-var filePairs = [
-  [path.join(distPath, 'lodash.core.js'), 'core.js'],
-  [path.join(distPath, 'lodash.core.min.js'), 'core.min.js'],
-  [path.join(distPath, 'lodash.min.js'), 'lodash.min.js']
-];
-
-/*----------------------------------------------------------------------------*/
-
-function onComplete(error) {
-  if (error) {
-    throw error;
-  }
-}
-
-function build(target) {
-  var actions = _.map(filePairs, function(pair) {
-    return file.copy(pair[0], path.join(target, pair[1]));
-  });
-
-  async.series(actions, onComplete);
-}
-
-build(_.last(process.argv));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/lodash.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/lodash.js
deleted file mode 100644
index 9f472f6..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/lodash.js
+++ /dev/null
@@ -1,16148 +0,0 @@
-/**
- * @license
- * lodash 4.11.2 <https://lodash.com/>
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-;(function() {
-
-  /** Used as a safe reference for `undefined` in pre-ES5 environments. */
-  var undefined;
-
-  /** Used as the semantic version number. */
-  var VERSION = '4.11.2';
-
-  /** Used as the size to enable large array optimizations. */
-  var LARGE_ARRAY_SIZE = 200;
-
-  /** Used as the `TypeError` message for "Functions" methods. */
-  var FUNC_ERROR_TEXT = 'Expected a function';
-
-  /** Used to stand-in for `undefined` hash values. */
-  var HASH_UNDEFINED = '__lodash_hash_undefined__';
-
-  /** Used as the internal argument placeholder. */
-  var PLACEHOLDER = '__lodash_placeholder__';
-
-  /** Used to compose bitmasks for wrapper metadata. */
-  var BIND_FLAG = 1,
-      BIND_KEY_FLAG = 2,
-      CURRY_BOUND_FLAG = 4,
-      CURRY_FLAG = 8,
-      CURRY_RIGHT_FLAG = 16,
-      PARTIAL_FLAG = 32,
-      PARTIAL_RIGHT_FLAG = 64,
-      ARY_FLAG = 128,
-      REARG_FLAG = 256,
-      FLIP_FLAG = 512;
-
-  /** Used to compose bitmasks for comparison styles. */
-  var UNORDERED_COMPARE_FLAG = 1,
-      PARTIAL_COMPARE_FLAG = 2;
-
-  /** Used as default options for `_.truncate`. */
-  var DEFAULT_TRUNC_LENGTH = 30,
-      DEFAULT_TRUNC_OMISSION = '...';
-
-  /** Used to detect hot functions by number of calls within a span of milliseconds. */
-  var HOT_COUNT = 150,
-      HOT_SPAN = 16;
-
-  /** Used to indicate the type of lazy iteratees. */
-  var LAZY_FILTER_FLAG = 1,
-      LAZY_MAP_FLAG = 2,
-      LAZY_WHILE_FLAG = 3;
-
-  /** Used as references for various `Number` constants. */
-  var INFINITY = 1 / 0,
-      MAX_SAFE_INTEGER = 9007199254740991,
-      MAX_INTEGER = 1.7976931348623157e+308,
-      NAN = 0 / 0;
-
-  /** Used as references for the maximum length and index of an array. */
-  var MAX_ARRAY_LENGTH = 4294967295,
-      MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
-      HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
-
-  /** `Object#toString` result references. */
-  var argsTag = '[object Arguments]',
-      arrayTag = '[object Array]',
-      boolTag = '[object Boolean]',
-      dateTag = '[object Date]',
-      errorTag = '[object Error]',
-      funcTag = '[object Function]',
-      genTag = '[object GeneratorFunction]',
-      mapTag = '[object Map]',
-      numberTag = '[object Number]',
-      objectTag = '[object Object]',
-      promiseTag = '[object Promise]',
-      regexpTag = '[object RegExp]',
-      setTag = '[object Set]',
-      stringTag = '[object String]',
-      symbolTag = '[object Symbol]',
-      weakMapTag = '[object WeakMap]',
-      weakSetTag = '[object WeakSet]';
-
-  var arrayBufferTag = '[object ArrayBuffer]',
-      dataViewTag = '[object DataView]',
-      float32Tag = '[object Float32Array]',
-      float64Tag = '[object Float64Array]',
-      int8Tag = '[object Int8Array]',
-      int16Tag = '[object Int16Array]',
-      int32Tag = '[object Int32Array]',
-      uint8Tag = '[object Uint8Array]',
-      uint8ClampedTag = '[object Uint8ClampedArray]',
-      uint16Tag = '[object Uint16Array]',
-      uint32Tag = '[object Uint32Array]';
-
-  /** Used to match empty string literals in compiled template source. */
-  var reEmptyStringLeading = /\b__p \+= '';/g,
-      reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
-      reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
-
-  /** Used to match HTML entities and HTML characters. */
-  var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
-      reUnescapedHtml = /[&<>"'`]/g,
-      reHasEscapedHtml = RegExp(reEscapedHtml.source),
-      reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
-
-  /** Used to match template delimiters. */
-  var reEscape = /<%-([\s\S]+?)%>/g,
-      reEvaluate = /<%([\s\S]+?)%>/g,
-      reInterpolate = /<%=([\s\S]+?)%>/g;
-
-  /** Used to match property names within property paths. */
-  var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
-      reIsPlainProp = /^\w*$/,
-      rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g;
-
-  /**
-   * Used to match `RegExp`
-   * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
-   */
-  var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
-      reHasRegExpChar = RegExp(reRegExpChar.source);
-
-  /** Used to match leading and trailing whitespace. */
-  var reTrim = /^\s+|\s+$/g,
-      reTrimStart = /^\s+/,
-      reTrimEnd = /\s+$/;
-
-  /** Used to match non-compound words composed of alphanumeric characters. */
-  var reBasicWord = /[a-zA-Z0-9]+/g;
-
-  /** Used to match backslashes in property paths. */
-  var reEscapeChar = /\\(\\)?/g;
-
-  /**
-   * Used to match
-   * [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components).
-   */
-  var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
-
-  /** Used to match `RegExp` flags from their coerced string values. */
-  var reFlags = /\w*$/;
-
-  /** Used to detect hexadecimal string values. */
-  var reHasHexPrefix = /^0x/i;
-
-  /** Used to detect bad signed hexadecimal string values. */
-  var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
-
-  /** Used to detect binary string values. */
-  var reIsBinary = /^0b[01]+$/i;
-
-  /** Used to detect host constructors (Safari). */
-  var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
-  /** Used to detect octal string values. */
-  var reIsOctal = /^0o[0-7]+$/i;
-
-  /** Used to detect unsigned integer values. */
-  var reIsUint = /^(?:0|[1-9]\d*)$/;
-
-  /** Used to match latin-1 supplementary letters (excluding mathematical operators). */
-  var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
-
-  /** Used to ensure capturing order of template delimiters. */
-  var reNoMatch = /($^)/;
-
-  /** Used to match unescaped characters in compiled string literals. */
-  var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
-
-  /** Used to compose unicode character classes. */
-  var rsAstralRange = '\\ud800-\\udfff',
-      rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
-      rsComboSymbolsRange = '\\u20d0-\\u20f0',
-      rsDingbatRange = '\\u2700-\\u27bf',
-      rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
-      rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
-      rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
-      rsPunctuationRange = '\\u2000-\\u206f',
-      rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
-      rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
-      rsVarRange = '\\ufe0e\\ufe0f',
-      rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
-
-  /** Used to compose unicode capture groups. */
-  var rsApos = "['\u2019]",
-      rsAstral = '[' + rsAstralRange + ']',
-      rsBreak = '[' + rsBreakRange + ']',
-      rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
-      rsDigits = '\\d+',
-      rsDingbat = '[' + rsDingbatRange + ']',
-      rsLower = '[' + rsLowerRange + ']',
-      rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
-      rsFitz = '\\ud83c[\\udffb-\\udfff]',
-      rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
-      rsNonAstral = '[^' + rsAstralRange + ']',
-      rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
-      rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
-      rsUpper = '[' + rsUpperRange + ']',
-      rsZWJ = '\\u200d';
-
-  /** Used to compose unicode regexes. */
-  var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')',
-      rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')',
-      rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
-      rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
-      reOptMod = rsModifier + '?',
-      rsOptVar = '[' + rsVarRange + ']?',
-      rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
-      rsSeq = rsOptVar + reOptMod + rsOptJoin,
-      rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
-      rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
-
-  /** Used to match apostrophes. */
-  var reApos = RegExp(rsApos, 'g');
-
-  /**
-   * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
-   * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
-   */
-  var reComboMark = RegExp(rsCombo, 'g');
-
-  /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
-  var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
-
-  /** Used to match complex or compound words. */
-  var reComplexWord = RegExp([
-    rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
-    rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',
-    rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr,
-    rsUpper + '+' + rsOptUpperContr,
-    rsDigits,
-    rsEmoji
-  ].join('|'), 'g');
-
-  /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
-  var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange  + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
-
-  /** Used to detect strings that need a more robust regexp to match words. */
-  var reHasComplexWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
-
-  /** Used to assign default `context` object properties. */
-  var contextProps = [
-    'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
-    'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
-    'Promise', 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError',
-    'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
-    '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
-  ];
-
-  /** Used to make template sourceURLs easier to identify. */
-  var templateCounter = -1;
-
-  /** Used to identify `toStringTag` values of typed arrays. */
-  var typedArrayTags = {};
-  typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
-  typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
-  typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
-  typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
-  typedArrayTags[uint32Tag] = true;
-  typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
-  typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
-  typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
-  typedArrayTags[errorTag] = typedArrayTags[funcTag] =
-  typedArrayTags[mapTag] = typedArrayTags[numberTag] =
-  typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
-  typedArrayTags[setTag] = typedArrayTags[stringTag] =
-  typedArrayTags[weakMapTag] = false;
-
-  /** Used to identify `toStringTag` values supported by `_.clone`. */
-  var cloneableTags = {};
-  cloneableTags[argsTag] = cloneableTags[arrayTag] =
-  cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
-  cloneableTags[boolTag] = cloneableTags[dateTag] =
-  cloneableTags[float32Tag] = cloneableTags[float64Tag] =
-  cloneableTags[int8Tag] = cloneableTags[int16Tag] =
-  cloneableTags[int32Tag] = cloneableTags[mapTag] =
-  cloneableTags[numberTag] = cloneableTags[objectTag] =
-  cloneableTags[regexpTag] = cloneableTags[setTag] =
-  cloneableTags[stringTag] = cloneableTags[symbolTag] =
-  cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
-  cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
-  cloneableTags[errorTag] = cloneableTags[funcTag] =
-  cloneableTags[weakMapTag] = false;
-
-  /** Used to map latin-1 supplementary letters to basic latin letters. */
-  var deburredLetters = {
-    '\xc0': 'A',  '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
-    '\xe0': 'a',  '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
-    '\xc7': 'C',  '\xe7': 'c',
-    '\xd0': 'D',  '\xf0': 'd',
-    '\xc8': 'E',  '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
-    '\xe8': 'e',  '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
-    '\xcC': 'I',  '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
-    '\xeC': 'i',  '\xed': 'i', '\xee': 'i', '\xef': 'i',
-    '\xd1': 'N',  '\xf1': 'n',
-    '\xd2': 'O',  '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
-    '\xf2': 'o',  '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
-    '\xd9': 'U',  '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
-    '\xf9': 'u',  '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
-    '\xdd': 'Y',  '\xfd': 'y', '\xff': 'y',
-    '\xc6': 'Ae', '\xe6': 'ae',
-    '\xde': 'Th', '\xfe': 'th',
-    '\xdf': 'ss'
-  };
-
-  /** Used to map characters to HTML entities. */
-  var htmlEscapes = {
-    '&': '&amp;',
-    '<': '&lt;',
-    '>': '&gt;',
-    '"': '&quot;',
-    "'": '&#39;',
-    '`': '&#96;'
-  };
-
-  /** Used to map HTML entities to characters. */
-  var htmlUnescapes = {
-    '&amp;': '&',
-    '&lt;': '<',
-    '&gt;': '>',
-    '&quot;': '"',
-    '&#39;': "'",
-    '&#96;': '`'
-  };
-
-  /** Used to determine if values are of the language type `Object`. */
-  var objectTypes = {
-    'function': true,
-    'object': true
-  };
-
-  /** Used to escape characters for inclusion in compiled string literals. */
-  var stringEscapes = {
-    '\\': '\\',
-    "'": "'",
-    '\n': 'n',
-    '\r': 'r',
-    '\u2028': 'u2028',
-    '\u2029': 'u2029'
-  };
-
-  /** Built-in method references without a dependency on `root`. */
-  var freeParseFloat = parseFloat,
-      freeParseInt = parseInt;
-
-  /** Detect free variable `exports`. */
-  var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)
-    ? exports
-    : undefined;
-
-  /** Detect free variable `module`. */
-  var freeModule = (objectTypes[typeof module] && module && !module.nodeType)
-    ? module
-    : undefined;
-
-  /** Detect the popular CommonJS extension `module.exports`. */
-  var moduleExports = (freeModule && freeModule.exports === freeExports)
-    ? freeExports
-    : undefined;
-
-  /** Detect free variable `global` from Node.js. */
-  var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
-
-  /** Detect free variable `self`. */
-  var freeSelf = checkGlobal(objectTypes[typeof self] && self);
-
-  /** Detect free variable `window`. */
-  var freeWindow = checkGlobal(objectTypes[typeof window] && window);
-
-  /** Detect `this` as the global object. */
-  var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
-
-  /**
-   * Used as a reference to the global object.
-   *
-   * The `this` value is used if it's the global object to avoid Greasemonkey's
-   * restricted `window` object, otherwise the `window` object is used.
-   */
-  var root = freeGlobal ||
-    ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||
-      freeSelf || thisGlobal || Function('return this')();
-
-  /*--------------------------------------------------------------------------*/
-
-  /**
-   * Adds the key-value `pair` to `map`.
-   *
-   * @private
-   * @param {Object} map The map to modify.
-   * @param {Array} pair The key-value pair to add.
-   * @returns {Object} Returns `map`.
-   */
-  function addMapEntry(map, pair) {
-    // Don't return `Map#set` because it doesn't return the map instance in IE 11.
-    map.set(pair[0], pair[1]);
-    return map;
-  }
-
-  /**
-   * Adds `value` to `set`.
-   *
-   * @private
-   * @param {Object} set The set to modify.
-   * @param {*} value The value to add.
-   * @returns {Object} Returns `set`.
-   */
-  function addSetEntry(set, value) {
-    set.add(value);
-    return set;
-  }
-
-  /**
-   * A faster alternative to `Function#apply`, this function invokes `func`
-   * with the `this` binding of `thisArg` and the arguments of `args`.
-   *
-   * @private
-   * @param {Function} func The function to invoke.
-   * @param {*} thisArg The `this` binding of `func`.
-   * @param {Array} args The arguments to invoke `func` with.
-   * @returns {*} Returns the result of `func`.
-   */
-  function apply(func, thisArg, args) {
-    var length = args.length;
-    switch (length) {
-      case 0: return func.call(thisArg);
-      case 1: return func.call(thisArg, args[0]);
-      case 2: return func.call(thisArg, args[0], args[1]);
-      case 3: return func.call(thisArg, args[0], args[1], args[2]);
-    }
-    return func.apply(thisArg, args);
-  }
-
-  /**
-   * A specialized version of `baseAggregator` for arrays.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} setter The function to set `accumulator` values.
-   * @param {Function} iteratee The iteratee to transform keys.
-   * @param {Object} accumulator The initial aggregated object.
-   * @returns {Function} Returns `accumulator`.
-   */
-  function arrayAggregator(array, setter, iteratee, accumulator) {
-    var index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      var value = array[index];
-      setter(accumulator, value, iteratee(value), array);
-    }
-    return accumulator;
-  }
-
-  /**
-   * Creates a new array concatenating `array` with `other`.
-   *
-   * @private
-   * @param {Array} array The first array to concatenate.
-   * @param {Array} other The second array to concatenate.
-   * @returns {Array} Returns the new concatenated array.
-   */
-  function arrayConcat(array, other) {
-    var index = -1,
-        length = array.length,
-        othIndex = -1,
-        othLength = other.length,
-        result = Array(length + othLength);
-
-    while (++index < length) {
-      result[index] = array[index];
-    }
-    while (++othIndex < othLength) {
-      result[index++] = other[othIndex];
-    }
-    return result;
-  }
-
-  /**
-   * A specialized version of `_.forEach` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Array} Returns `array`.
-   */
-  function arrayEach(array, iteratee) {
-    var index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      if (iteratee(array[index], index, array) === false) {
-        break;
-      }
-    }
-    return array;
-  }
-
-  /**
-   * A specialized version of `_.forEachRight` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Array} Returns `array`.
-   */
-  function arrayEachRight(array, iteratee) {
-    var length = array.length;
-
-    while (length--) {
-      if (iteratee(array[length], length, array) === false) {
-        break;
-      }
-    }
-    return array;
-  }
-
-  /**
-   * A specialized version of `_.every` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} predicate The function invoked per iteration.
-   * @returns {boolean} Returns `true` if all elements pass the predicate check,
-   *  else `false`.
-   */
-  function arrayEvery(array, predicate) {
-    var index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      if (!predicate(array[index], index, array)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  /**
-   * A specialized version of `_.filter` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} predicate The function invoked per iteration.
-   * @returns {Array} Returns the new filtered array.
-   */
-  function arrayFilter(array, predicate) {
-    var index = -1,
-        length = array.length,
-        resIndex = 0,
-        result = [];
-
-    while (++index < length) {
-      var value = array[index];
-      if (predicate(value, index, array)) {
-        result[resIndex++] = value;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * A specialized version of `_.includes` for arrays without support for
-   * specifying an index to search from.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {*} target The value to search for.
-   * @returns {boolean} Returns `true` if `target` is found, else `false`.
-   */
-  function arrayIncludes(array, value) {
-    return !!array.length && baseIndexOf(array, value, 0) > -1;
-  }
-
-  /**
-   * This function is like `arrayIncludes` except that it accepts a comparator.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {*} target The value to search for.
-   * @param {Function} comparator The comparator invoked per element.
-   * @returns {boolean} Returns `true` if `target` is found, else `false`.
-   */
-  function arrayIncludesWith(array, value, comparator) {
-    var index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      if (comparator(value, array[index])) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * A specialized version of `_.map` for arrays without support for iteratee
-   * shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Array} Returns the new mapped array.
-   */
-  function arrayMap(array, iteratee) {
-    var index = -1,
-        length = array.length,
-        result = Array(length);
-
-    while (++index < length) {
-      result[index] = iteratee(array[index], index, array);
-    }
-    return result;
-  }
-
-  /**
-   * Appends the elements of `values` to `array`.
-   *
-   * @private
-   * @param {Array} array The array to modify.
-   * @param {Array} values The values to append.
-   * @returns {Array} Returns `array`.
-   */
-  function arrayPush(array, values) {
-    var index = -1,
-        length = values.length,
-        offset = array.length;
-
-    while (++index < length) {
-      array[offset + index] = values[index];
-    }
-    return array;
-  }
-
-  /**
-   * A specialized version of `_.reduce` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @param {*} [accumulator] The initial value.
-   * @param {boolean} [initAccum] Specify using the first element of `array` as
-   *  the initial value.
-   * @returns {*} Returns the accumulated value.
-   */
-  function arrayReduce(array, iteratee, accumulator, initAccum) {
-    var index = -1,
-        length = array.length;
-
-    if (initAccum && length) {
-      accumulator = array[++index];
-    }
-    while (++index < length) {
-      accumulator = iteratee(accumulator, array[index], index, array);
-    }
-    return accumulator;
-  }
-
-  /**
-   * A specialized version of `_.reduceRight` for arrays without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @param {*} [accumulator] The initial value.
-   * @param {boolean} [initAccum] Specify using the last element of `array` as
-   *  the initial value.
-   * @returns {*} Returns the accumulated value.
-   */
-  function arrayReduceRight(array, iteratee, accumulator, initAccum) {
-    var length = array.length;
-    if (initAccum && length) {
-      accumulator = array[--length];
-    }
-    while (length--) {
-      accumulator = iteratee(accumulator, array[length], length, array);
-    }
-    return accumulator;
-  }
-
-  /**
-   * A specialized version of `_.some` for arrays without support for iteratee
-   * shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} predicate The function invoked per iteration.
-   * @returns {boolean} Returns `true` if any element passes the predicate check,
-   *  else `false`.
-   */
-  function arraySome(array, predicate) {
-    var index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      if (predicate(array[index], index, array)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * The base implementation of methods like `_.find` and `_.findKey`, without
-   * support for iteratee shorthands, which iterates over `collection` using
-   * `eachFunc`.
-   *
-   * @private
-   * @param {Array|Object} collection The collection to search.
-   * @param {Function} predicate The function invoked per iteration.
-   * @param {Function} eachFunc The function to iterate over `collection`.
-   * @param {boolean} [retKey] Specify returning the key of the found element
-   *  instead of the element itself.
-   * @returns {*} Returns the found element or its key, else `undefined`.
-   */
-  function baseFind(collection, predicate, eachFunc, retKey) {
-    var result;
-    eachFunc(collection, function(value, key, collection) {
-      if (predicate(value, key, collection)) {
-        result = retKey ? key : value;
-        return false;
-      }
-    });
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.findIndex` and `_.findLastIndex` without
-   * support for iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {Function} predicate The function invoked per iteration.
-   * @param {boolean} [fromRight] Specify iterating from right to left.
-   * @returns {number} Returns the index of the matched value, else `-1`.
-   */
-  function baseFindIndex(array, predicate, fromRight) {
-    var length = array.length,
-        index = fromRight ? length : -1;
-
-    while ((fromRight ? index-- : ++index < length)) {
-      if (predicate(array[index], index, array)) {
-        return index;
-      }
-    }
-    return -1;
-  }
-
-  /**
-   * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {*} value The value to search for.
-   * @param {number} fromIndex The index to search from.
-   * @returns {number} Returns the index of the matched value, else `-1`.
-   */
-  function baseIndexOf(array, value, fromIndex) {
-    if (value !== value) {
-      return indexOfNaN(array, fromIndex);
-    }
-    var index = fromIndex - 1,
-        length = array.length;
-
-    while (++index < length) {
-      if (array[index] === value) {
-        return index;
-      }
-    }
-    return -1;
-  }
-
-  /**
-   * This function is like `baseIndexOf` except that it accepts a comparator.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {*} value The value to search for.
-   * @param {number} fromIndex The index to search from.
-   * @param {Function} comparator The comparator invoked per element.
-   * @returns {number} Returns the index of the matched value, else `-1`.
-   */
-  function baseIndexOfWith(array, value, fromIndex, comparator) {
-    var index = fromIndex - 1,
-        length = array.length;
-
-    while (++index < length) {
-      if (comparator(array[index], value)) {
-        return index;
-      }
-    }
-    return -1;
-  }
-
-  /**
-   * The base implementation of `_.mean` and `_.meanBy` without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {number} Returns the mean.
-   */
-  function baseMean(array, iteratee) {
-    var length = array ? array.length : 0;
-    return length ? (baseSum(array, iteratee) / length) : NAN;
-  }
-
-  /**
-   * The base implementation of `_.reduce` and `_.reduceRight`, without support
-   * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
-   *
-   * @private
-   * @param {Array|Object} collection The collection to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @param {*} accumulator The initial value.
-   * @param {boolean} initAccum Specify using the first or last element of
-   *  `collection` as the initial value.
-   * @param {Function} eachFunc The function to iterate over `collection`.
-   * @returns {*} Returns the accumulated value.
-   */
-  function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
-    eachFunc(collection, function(value, index, collection) {
-      accumulator = initAccum
-        ? (initAccum = false, value)
-        : iteratee(accumulator, value, index, collection);
-    });
-    return accumulator;
-  }
-
-  /**
-   * The base implementation of `_.sortBy` which uses `comparer` to define the
-   * sort order of `array` and replaces criteria objects with their corresponding
-   * values.
-   *
-   * @private
-   * @param {Array} array The array to sort.
-   * @param {Function} comparer The function to define sort order.
-   * @returns {Array} Returns `array`.
-   */
-  function baseSortBy(array, comparer) {
-    var length = array.length;
-
-    array.sort(comparer);
-    while (length--) {
-      array[length] = array[length].value;
-    }
-    return array;
-  }
-
-  /**
-   * The base implementation of `_.sum` and `_.sumBy` without support for
-   * iteratee shorthands.
-   *
-   * @private
-   * @param {Array} array The array to iterate over.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {number} Returns the sum.
-   */
-  function baseSum(array, iteratee) {
-    var result,
-        index = -1,
-        length = array.length;
-
-    while (++index < length) {
-      var current = iteratee(array[index]);
-      if (current !== undefined) {
-        result = result === undefined ? current : (result + current);
-      }
-    }
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.times` without support for iteratee shorthands
-   * or max array length checks.
-   *
-   * @private
-   * @param {number} n The number of times to invoke `iteratee`.
-   * @param {Function} iteratee The function invoked per iteration.
-   * @returns {Array} Returns the array of results.
-   */
-  function baseTimes(n, iteratee) {
-    var index = -1,
-        result = Array(n);
-
-    while (++index < n) {
-      result[index] = iteratee(index);
-    }
-    return result;
-  }
-
-  /**
-   * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
-   * of key-value pairs for `object` corresponding to the property names of `props`.
-   *
-   * @private
-   * @param {Object} object The object to query.
-   * @param {Array} props The property names to get values for.
-   * @returns {Object} Returns the new array of key-value pairs.
-   */
-  function baseToPairs(object, props) {
-    return arrayMap(props, function(key) {
-      return [key, object[key]];
-    });
-  }
-
-  /**
-   * The base implementation of `_.unary` without support for storing wrapper metadata.
-   *
-   * @private
-   * @param {Function} func The function to cap arguments for.
-   * @returns {Function} Returns the new function.
-   */
-  function baseUnary(func) {
-    return function(value) {
-      return func(value);
-    };
-  }
-
-  /**
-   * The base implementation of `_.values` and `_.valuesIn` which creates an
-   * array of `object` property values corresponding to the property names
-   * of `props`.
-   *
-   * @private
-   * @param {Object} object The object to query.
-   * @param {Array} props The property names to get values for.
-   * @returns {Object} Returns the array of property values.
-   */
-  function baseValues(object, props) {
-    return arrayMap(props, function(key) {
-      return object[key];
-    });
-  }
-
-  /**
-   * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
-   * that is not found in the character symbols.
-   *
-   * @private
-   * @param {Array} strSymbols The string symbols to inspect.
-   * @param {Array} chrSymbols The character symbols to find.
-   * @returns {number} Returns the index of the first unmatched string symbol.
-   */
-  function charsStartIndex(strSymbols, chrSymbols) {
-    var index = -1,
-        length = strSymbols.length;
-
-    while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
-    return index;
-  }
-
-  /**
-   * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
-   * that is not found in the character symbols.
-   *
-   * @private
-   * @param {Array} strSymbols The string symbols to inspect.
-   * @param {Array} chrSymbols The character symbols to find.
-   * @returns {number} Returns the index of the last unmatched string symbol.
-   */
-  function charsEndIndex(strSymbols, chrSymbols) {
-    var index = strSymbols.length;
-
-    while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
-    return index;
-  }
-
-  /**
-   * Checks if `value` is a global object.
-   *
-   * @private
-   * @param {*} value The value to check.
-   * @returns {null|Object} Returns `value` if it's a global object, else `null`.
-   */
-  function checkGlobal(value) {
-    return (value && value.Object === Object) ? value : null;
-  }
-
-  /**
-   * Gets the number of `placeholder` occurrences in `array`.
-   *
-   * @private
-   * @param {Array} array The array to inspect.
-   * @param {*} placeholder The placeholder to search for.
-   * @returns {number} Returns the placeholder count.
-   */
-  function countHolders(array, placeholder) {
-    var length = array.length,
-        result = 0;
-
-    while (length--) {
-      if (array[length] === placeholder) {
-        result++;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
-   *
-   * @private
-   * @param {string} letter The matched letter to deburr.
-   * @returns {string} Returns the deburred letter.
-   */
-  function deburrLetter(letter) {
-    return deburredLetters[letter];
-  }
-
-  /**
-   * Used by `_.escape` to convert characters to HTML entities.
-   *
-   * @private
-   * @param {string} chr The matched character to escape.
-   * @returns {string} Returns the escaped character.
-   */
-  function escapeHtmlChar(chr) {
-    return htmlEscapes[chr];
-  }
-
-  /**
-   * Used by `_.template` to escape characters for inclusion in compiled string literals.
-   *
-   * @private
-   * @param {string} chr The matched character to escape.
-   * @returns {string} Returns the escaped character.
-   */
-  function escapeStringChar(chr) {
-    return '\\' + stringEscapes[chr];
-  }
-
-  /**
-   * Gets the index at which the first occurrence of `NaN` is found in `array`.
-   *
-   * @private
-   * @param {Array} array The array to search.
-   * @param {number} fromIndex The index to search from.
-   * @param {boolean} [fromRight] Specify iterating from right to left.
-   * @returns {number} Returns the index of the matched `NaN`, else `-1`.
-   */
-  function indexOfNaN(array, fromIndex, fromRight) {
-    var length = array.length,
-        index = fromIndex + (fromRight ? 0 : -1);
-
-    while ((fromRight ? index-- : ++index < length)) {
-      var other = array[index];
-      if (other !== other) {
-        return index;
-      }
-    }
-    return -1;
-  }
-
-  /**
-   * Checks if `value` is a host object in IE < 9.
-   *
-   * @private
-   * @param {*} value The value to check.
-   * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
-   */
-  function isHostObject(value) {
-    // Many host objects are `Object` objects that can coerce to strings
-    // despite having improperly defined `toString` methods.
-    var result = false;
-    if (value != null && typeof value.toString != 'function') {
-      try {
-        result = !!(value + '');
-      } catch (e) {}
-    }
-    return result;
-  }
-
-  /**
-   * Converts `iterator` to an array.
-   *
-   * @private
-   * @param {Object} iterator The iterator to convert.
-   * @returns {Array} Returns the converted array.
-   */
-  function iteratorToArray(iterator) {
-    var data,
-        result = [];
-
-    while (!(data = iterator.next()).done) {
-      result.push(data.value);
-    }
-    return result;
-  }
-
-  /**
-   * Converts `map` to an array.
-   *
-   * @private
-   * @param {Object} map The map to convert.
-   * @returns {Array} Returns the converted array.
-   */
-  function mapToArray(map) {
-    var index = -1,
-        result = Array(map.size);
-
-    map.forEach(function(value, key) {
-      result[++index] = [key, value];
-    });
-    return result;
-  }
-
-  /**
-   * Replaces all `placeholder` elements in `array` with an internal placeholder
-   * and returns an array of their indexes.
-   *
-   * @private
-   * @param {Array} array The array to modify.
-   * @param {*} placeholder The placeholder to replace.
-   * @returns {Array} Returns the new array of placeholder indexes.
-   */
-  function replaceHolders(array, placeholder) {
-    var index = -1,
-        length = array.length,
-        resIndex = 0,
-        result = [];
-
-    while (++index < length) {
-      var value = array[index];
-      if (value === placeholder || value === PLACEHOLDER) {
-        array[index] = PLACEHOLDER;
-        result[resIndex++] = index;
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Converts `set` to an array.
-   *
-   * @private
-   * @param {Object} set The set to convert.
-   * @returns {Array} Returns the converted array.
-   */
-  function setToArray(set) {
-    var index = -1,
-        result = Array(set.size);
-
-    set.forEach(function(value) {
-      result[++index] = value;
-    });
-    return result;
-  }
-
-  /**
-   * Gets the number of symbols in `string`.
-   *
-   * @private
-   * @param {string} string The string to inspect.
-   * @returns {number} Returns the string size.
-   */
-  function stringSize(string) {
-    if (!(string && reHasComplexSymbol.test(string))) {
-      return string.length;
-    }
-    var result = reComplexSymbol.lastIndex = 0;
-    while (reComplexSymbol.test(string)) {
-      result++;
-    }
-    return result;
-  }
-
-  /**
-   * Converts `string` to an array.
-   *
-   * @private
-   * @param {string} string The string to convert.
-   * @returns {Array} Returns the converted array.
-   */
-  function stringToArray(string) {
-    return string.match(reComplexSymbol);
-  }
-
-  /**
-   * Used by `_.unescape` to convert HTML entities to characters.
-   *
-   * @private
-   * @param {string} chr The matched character to unescape.
-   * @returns {string} Returns the unescaped character.
-   */
-  function unescapeHtmlChar(chr) {
-    return htmlUnescapes[chr];
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  /**
-   * Create a new pristine `lodash` function using the `context` object.
-   *
-   * @static
-   * @memberOf _
-   * @since 1.1.0
-   * @category Util
-   * @param {Object} [context=root] The context object.
-   * @returns {Function} Returns a new `lodash` function.
-   * @example
-   *
-   * _.mixin({ 'foo': _.constant('foo') });
-   *
-   * var lodash = _.runInContext();
-   * lodash.mixin({ 'bar': lodash.constant('bar') });
-   *
-   * _.isFunction(_.foo);
-   * // => true
-   * _.isFunction(_.bar);
-   * // => false
-   *
-   * lodash.isFunction(lodash.foo);
-   * // => false
-   * lodash.isFunction(lodash.bar);
-   * // => true
-   *
-   * // Use `context` to mock `Date#getTime` use in `_.now`.
-   * var mock = _.runInContext({
-   *   'Date': function() {
-   *     return { 'getTime': getTimeMock };
-   *   }
-   * });
-   *
-   * // Create a suped-up `defer` in Node.js.
-   * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
-   */
-  function runInContext(context) {
-    context = context ? _.defaults({}, context, _.pick(root, contextProps)) : root;
-
-    /** Built-in constructor references. */
-    var Date = context.Date,
-        Error = context.Error,
-        Math = context.Math,
-        RegExp = context.RegExp,
-        TypeError = context.TypeError;
-
-    /** Used for built-in method references. */
-    var arrayProto = context.Array.prototype,
-        objectProto = context.Object.prototype,
-        stringProto = context.String.prototype;
-
-    /** Used to resolve the decompiled source of functions. */
-    var funcToString = context.Function.prototype.toString;
-
-    /** Used to check objects for own properties. */
-    var hasOwnProperty = objectProto.hasOwnProperty;
-
-    /** Used to generate unique IDs. */
-    var idCounter = 0;
-
-    /** Used to infer the `Object` constructor. */
-    var objectCtorString = funcToString.call(Object);
-
-    /**
-     * Used to resolve the
-     * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
-     * of values.
-     */
-    var objectToString = objectProto.toString;
-
-    /** Used to restore the original `_` reference in `_.noConflict`. */
-    var oldDash = root._;
-
-    /** Used to detect if a method is native. */
-    var reIsNative = RegExp('^' +
-      funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
-      .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
-    );
-
-    /** Built-in value references. */
-    var Buffer = moduleExports ? context.Buffer : undefined,
-        Reflect = context.Reflect,
-        Symbol = context.Symbol,
-        Uint8Array = context.Uint8Array,
-        clearTimeout = context.clearTimeout,
-        enumerate = Reflect ? Reflect.enumerate : undefined,
-        getOwnPropertySymbols = Object.getOwnPropertySymbols,
-        iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined,
-        objectCreate = Object.create,
-        propertyIsEnumerable = objectProto.propertyIsEnumerable,
-        setTimeout = context.setTimeout,
-        splice = arrayProto.splice;
-
-    /* Built-in method references for those with the same name as other `lodash` methods. */
-    var nativeCeil = Math.ceil,
-        nativeFloor = Math.floor,
-        nativeGetPrototype = Object.getPrototypeOf,
-        nativeIsFinite = context.isFinite,
-        nativeJoin = arrayProto.join,
-        nativeKeys = Object.keys,
-        nativeMax = Math.max,
-        nativeMin = Math.min,
-        nativeParseInt = context.parseInt,
-        nativeRandom = Math.random,
-        nativeReplace = stringProto.replace,
-        nativeReverse = arrayProto.reverse,
-        nativeSplit = stringProto.split;
-
-    /* Built-in method references that are verified to be native. */
-    var DataView = getNative(context, 'DataView'),
-        Map = getNative(context, 'Map'),
-        Promise = getNative(context, 'Promise'),
-        Set = getNative(context, 'Set'),
-        WeakMap = getNative(context, 'WeakMap'),
-        nativeCreate = getNative(Object, 'create');
-
-    /** Used to store function metadata. */
-    var metaMap = WeakMap && new WeakMap;
-
-    /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
-    var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
-
-    /** Used to lookup unminified function names. */
-    var realNames = {};
-
-    /** Used to detect maps, sets, and weakmaps. */
-    var dataViewCtorString = toSource(DataView),
-        mapCtorString = toSource(Map),
-        promiseCtorString = toSource(Promise),
-        setCtorString = toSource(Set),
-        weakMapCtorString = toSource(WeakMap);
-
-    /** Used to convert symbols to primitives and strings. */
-    var symbolProto = Symbol ? Symbol.prototype : undefined,
-        symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
-        symbolToString = symbolProto ? symbolProto.toString : undefined;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a `lodash` object which wraps `value` to enable implicit method
-     * chain sequences. Methods that operate on and return arrays, collections,
-     * and functions can be chained together. Methods that retrieve a single value
-     * or may return a primitive value will automatically end the chain sequence
-     * and return the unwrapped value. Otherwise, the value must be unwrapped
-     * with `_#value`.
-     *
-     * Explicit chain sequences, which must be unwrapped with `_#value`, may be
-     * enabled using `_.chain`.
-     *
-     * The execution of chained methods is lazy, that is, it's deferred until
-     * `_#value` is implicitly or explicitly called.
-     *
-     * Lazy evaluation allows several methods to support shortcut fusion.
-     * Shortcut fusion is an optimization to merge iteratee calls; this avoids
-     * the creation of intermediate arrays and can greatly reduce the number of
-     * iteratee executions. Sections of a chain sequence qualify for shortcut
-     * fusion if the section is applied to an array of at least `200` elements
-     * and any iteratees accept only one argument. The heuristic for whether a
-     * section qualifies for shortcut fusion is subject to change.
-     *
-     * Chaining is supported in custom builds as long as the `_#value` method is
-     * directly or indirectly included in the build.
-     *
-     * In addition to lodash methods, wrappers have `Array` and `String` methods.
-     *
-     * The wrapper `Array` methods are:
-     * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
-     *
-     * The wrapper `String` methods are:
-     * `replace` and `split`
-     *
-     * The wrapper methods that support shortcut fusion are:
-     * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
-     * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
-     * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
-     *
-     * The chainable wrapper methods are:
-     * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
-     * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
-     * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
-     * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
-     * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
-     * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
-     * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
-     * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
-     * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
-     * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
-     * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
-     * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
-     * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
-     * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
-     * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
-     * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
-     * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
-     * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
-     * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
-     * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
-     * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
-     * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
-     * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
-     * `zipObject`, `zipObjectDeep`, and `zipWith`
-     *
-     * The wrapper methods that are **not** chainable by default are:
-     * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
-     * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`,
-     * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`,
-     * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`,
-     * `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`,
-     * `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`,
-     * `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`,
-     * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`,
-     * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`,
-     * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`,
-     * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
-     * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
-     * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
-     * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
-     * `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`,
-     * `noConflict`, `noop`, `now`, `nth`, `pad`, `padEnd`, `padStart`, `parseInt`,
-     * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`,
-     * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
-     * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`,
-     * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`,
-     * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`,
-     * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`,
-     * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words`
-     *
-     * @name _
-     * @constructor
-     * @category Seq
-     * @param {*} value The value to wrap in a `lodash` instance.
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * var wrapped = _([1, 2, 3]);
-     *
-     * // Returns an unwrapped value.
-     * wrapped.reduce(_.add);
-     * // => 6
-     *
-     * // Returns a wrapped value.
-     * var squares = wrapped.map(square);
-     *
-     * _.isArray(squares);
-     * // => false
-     *
-     * _.isArray(squares.value());
-     * // => true
-     */
-    function lodash(value) {
-      if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
-        if (value instanceof LodashWrapper) {
-          return value;
-        }
-        if (hasOwnProperty.call(value, '__wrapped__')) {
-          return wrapperClone(value);
-        }
-      }
-      return new LodashWrapper(value);
-    }
-
-    /**
-     * The function whose prototype chain sequence wrappers inherit from.
-     *
-     * @private
-     */
-    function baseLodash() {
-      // No operation performed.
-    }
-
-    /**
-     * The base constructor for creating `lodash` wrapper objects.
-     *
-     * @private
-     * @param {*} value The value to wrap.
-     * @param {boolean} [chainAll] Enable explicit method chain sequences.
-     */
-    function LodashWrapper(value, chainAll) {
-      this.__wrapped__ = value;
-      this.__actions__ = [];
-      this.__chain__ = !!chainAll;
-      this.__index__ = 0;
-      this.__values__ = undefined;
-    }
-
-    /**
-     * By default, the template delimiters used by lodash are like those in
-     * embedded Ruby (ERB). Change the following template settings to use
-     * alternative delimiters.
-     *
-     * @static
-     * @memberOf _
-     * @type {Object}
-     */
-    lodash.templateSettings = {
-
-      /**
-       * Used to detect `data` property values to be HTML-escaped.
-       *
-       * @memberOf _.templateSettings
-       * @type {RegExp}
-       */
-      'escape': reEscape,
-
-      /**
-       * Used to detect code to be evaluated.
-       *
-       * @memberOf _.templateSettings
-       * @type {RegExp}
-       */
-      'evaluate': reEvaluate,
-
-      /**
-       * Used to detect `data` property values to inject.
-       *
-       * @memberOf _.templateSettings
-       * @type {RegExp}
-       */
-      'interpolate': reInterpolate,
-
-      /**
-       * Used to reference the data object in the template text.
-       *
-       * @memberOf _.templateSettings
-       * @type {string}
-       */
-      'variable': '',
-
-      /**
-       * Used to import variables into the compiled template.
-       *
-       * @memberOf _.templateSettings
-       * @type {Object}
-       */
-      'imports': {
-
-        /**
-         * A reference to the `lodash` function.
-         *
-         * @memberOf _.templateSettings.imports
-         * @type {Function}
-         */
-        '_': lodash
-      }
-    };
-
-    // Ensure wrappers are instances of `baseLodash`.
-    lodash.prototype = baseLodash.prototype;
-    lodash.prototype.constructor = lodash;
-
-    LodashWrapper.prototype = baseCreate(baseLodash.prototype);
-    LodashWrapper.prototype.constructor = LodashWrapper;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
-     *
-     * @private
-     * @constructor
-     * @param {*} value The value to wrap.
-     */
-    function LazyWrapper(value) {
-      this.__wrapped__ = value;
-      this.__actions__ = [];
-      this.__dir__ = 1;
-      this.__filtered__ = false;
-      this.__iteratees__ = [];
-      this.__takeCount__ = MAX_ARRAY_LENGTH;
-      this.__views__ = [];
-    }
-
-    /**
-     * Creates a clone of the lazy wrapper object.
-     *
-     * @private
-     * @name clone
-     * @memberOf LazyWrapper
-     * @returns {Object} Returns the cloned `LazyWrapper` object.
-     */
-    function lazyClone() {
-      var result = new LazyWrapper(this.__wrapped__);
-      result.__actions__ = copyArray(this.__actions__);
-      result.__dir__ = this.__dir__;
-      result.__filtered__ = this.__filtered__;
-      result.__iteratees__ = copyArray(this.__iteratees__);
-      result.__takeCount__ = this.__takeCount__;
-      result.__views__ = copyArray(this.__views__);
-      return result;
-    }
-
-    /**
-     * Reverses the direction of lazy iteration.
-     *
-     * @private
-     * @name reverse
-     * @memberOf LazyWrapper
-     * @returns {Object} Returns the new reversed `LazyWrapper` object.
-     */
-    function lazyReverse() {
-      if (this.__filtered__) {
-        var result = new LazyWrapper(this);
-        result.__dir__ = -1;
-        result.__filtered__ = true;
-      } else {
-        result = this.clone();
-        result.__dir__ *= -1;
-      }
-      return result;
-    }
-
-    /**
-     * Extracts the unwrapped value from its lazy wrapper.
-     *
-     * @private
-     * @name value
-     * @memberOf LazyWrapper
-     * @returns {*} Returns the unwrapped value.
-     */
-    function lazyValue() {
-      var array = this.__wrapped__.value(),
-          dir = this.__dir__,
-          isArr = isArray(array),
-          isRight = dir < 0,
-          arrLength = isArr ? array.length : 0,
-          view = getView(0, arrLength, this.__views__),
-          start = view.start,
-          end = view.end,
-          length = end - start,
-          index = isRight ? end : (start - 1),
-          iteratees = this.__iteratees__,
-          iterLength = iteratees.length,
-          resIndex = 0,
-          takeCount = nativeMin(length, this.__takeCount__);
-
-      if (!isArr || arrLength < LARGE_ARRAY_SIZE ||
-          (arrLength == length && takeCount == length)) {
-        return baseWrapperValue(array, this.__actions__);
-      }
-      var result = [];
-
-      outer:
-      while (length-- && resIndex < takeCount) {
-        index += dir;
-
-        var iterIndex = -1,
-            value = array[index];
-
-        while (++iterIndex < iterLength) {
-          var data = iteratees[iterIndex],
-              iteratee = data.iteratee,
-              type = data.type,
-              computed = iteratee(value);
-
-          if (type == LAZY_MAP_FLAG) {
-            value = computed;
-          } else if (!computed) {
-            if (type == LAZY_FILTER_FLAG) {
-              continue outer;
-            } else {
-              break outer;
-            }
-          }
-        }
-        result[resIndex++] = value;
-      }
-      return result;
-    }
-
-    // Ensure `LazyWrapper` is an instance of `baseLodash`.
-    LazyWrapper.prototype = baseCreate(baseLodash.prototype);
-    LazyWrapper.prototype.constructor = LazyWrapper;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a hash object.
-     *
-     * @private
-     * @constructor
-     * @returns {Object} Returns the new hash object.
-     */
-    function Hash() {}
-
-    /**
-     * Removes `key` and its value from the hash.
-     *
-     * @private
-     * @param {Object} hash The hash to modify.
-     * @param {string} key The key of the value to remove.
-     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
-     */
-    function hashDelete(hash, key) {
-      return hashHas(hash, key) && delete hash[key];
-    }
-
-    /**
-     * Gets the hash value for `key`.
-     *
-     * @private
-     * @param {Object} hash The hash to query.
-     * @param {string} key The key of the value to get.
-     * @returns {*} Returns the entry value.
-     */
-    function hashGet(hash, key) {
-      if (nativeCreate) {
-        var result = hash[key];
-        return result === HASH_UNDEFINED ? undefined : result;
-      }
-      return hasOwnProperty.call(hash, key) ? hash[key] : undefined;
-    }
-
-    /**
-     * Checks if a hash value for `key` exists.
-     *
-     * @private
-     * @param {Object} hash The hash to query.
-     * @param {string} key The key of the entry to check.
-     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
-     */
-    function hashHas(hash, key) {
-      return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key);
-    }
-
-    /**
-     * Sets the hash `key` to `value`.
-     *
-     * @private
-     * @param {Object} hash The hash to modify.
-     * @param {string} key The key of the value to set.
-     * @param {*} value The value to set.
-     */
-    function hashSet(hash, key, value) {
-      hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
-    }
-
-    // Avoid inheriting from `Object.prototype` when possible.
-    Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a map cache object to store key-value pairs.
-     *
-     * @private
-     * @constructor
-     * @param {Array} [values] The values to cache.
-     */
-    function MapCache(values) {
-      var index = -1,
-          length = values ? values.length : 0;
-
-      this.clear();
-      while (++index < length) {
-        var entry = values[index];
-        this.set(entry[0], entry[1]);
-      }
-    }
-
-    /**
-     * Removes all key-value entries from the map.
-     *
-     * @private
-     * @name clear
-     * @memberOf MapCache
-     */
-    function mapClear() {
-      this.__data__ = {
-        'hash': new Hash,
-        'map': Map ? new Map : [],
-        'string': new Hash
-      };
-    }
-
-    /**
-     * Removes `key` and its value from the map.
-     *
-     * @private
-     * @name delete
-     * @memberOf MapCache
-     * @param {string} key The key of the value to remove.
-     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
-     */
-    function mapDelete(key) {
-      var data = this.__data__;
-      if (isKeyable(key)) {
-        return hashDelete(typeof key == 'string' ? data.string : data.hash, key);
-      }
-      return Map ? data.map['delete'](key) : assocDelete(data.map, key);
-    }
-
-    /**
-     * Gets the map value for `key`.
-     *
-     * @private
-     * @name get
-     * @memberOf MapCache
-     * @param {string} key The key of the value to get.
-     * @returns {*} Returns the entry value.
-     */
-    function mapGet(key) {
-      var data = this.__data__;
-      if (isKeyable(key)) {
-        return hashGet(typeof key == 'string' ? data.string : data.hash, key);
-      }
-      return Map ? data.map.get(key) : assocGet(data.map, key);
-    }
-
-    /**
-     * Checks if a map value for `key` exists.
-     *
-     * @private
-     * @name has
-     * @memberOf MapCache
-     * @param {string} key The key of the entry to check.
-     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
-     */
-    function mapHas(key) {
-      var data = this.__data__;
-      if (isKeyable(key)) {
-        return hashHas(typeof key == 'string' ? data.string : data.hash, key);
-      }
-      return Map ? data.map.has(key) : assocHas(data.map, key);
-    }
-
-    /**
-     * Sets the map `key` to `value`.
-     *
-     * @private
-     * @name set
-     * @memberOf MapCache
-     * @param {string} key The key of the value to set.
-     * @param {*} value The value to set.
-     * @returns {Object} Returns the map cache instance.
-     */
-    function mapSet(key, value) {
-      var data = this.__data__;
-      if (isKeyable(key)) {
-        hashSet(typeof key == 'string' ? data.string : data.hash, key, value);
-      } else if (Map) {
-        data.map.set(key, value);
-      } else {
-        assocSet(data.map, key, value);
-      }
-      return this;
-    }
-
-    // Add methods to `MapCache`.
-    MapCache.prototype.clear = mapClear;
-    MapCache.prototype['delete'] = mapDelete;
-    MapCache.prototype.get = mapGet;
-    MapCache.prototype.has = mapHas;
-    MapCache.prototype.set = mapSet;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     *
-     * Creates a set cache object to store unique values.
-     *
-     * @private
-     * @constructor
-     * @param {Array} [values] The values to cache.
-     */
-    function SetCache(values) {
-      var index = -1,
-          length = values ? values.length : 0;
-
-      this.__data__ = new MapCache;
-      while (++index < length) {
-        this.push(values[index]);
-      }
-    }
-
-    /**
-     * Checks if `value` is in `cache`.
-     *
-     * @private
-     * @param {Object} cache The set cache to search.
-     * @param {*} value The value to search for.
-     * @returns {number} Returns `true` if `value` is found, else `false`.
-     */
-    function cacheHas(cache, value) {
-      var map = cache.__data__;
-      if (isKeyable(value)) {
-        var data = map.__data__,
-            hash = typeof value == 'string' ? data.string : data.hash;
-
-        return hash[value] === HASH_UNDEFINED;
-      }
-      return map.has(value);
-    }
-
-    /**
-     * Adds `value` to the set cache.
-     *
-     * @private
-     * @name push
-     * @memberOf SetCache
-     * @param {*} value The value to cache.
-     */
-    function cachePush(value) {
-      var map = this.__data__;
-      if (isKeyable(value)) {
-        var data = map.__data__,
-            hash = typeof value == 'string' ? data.string : data.hash;
-
-        hash[value] = HASH_UNDEFINED;
-      }
-      else {
-        map.set(value, HASH_UNDEFINED);
-      }
-    }
-
-    // Add methods to `SetCache`.
-    SetCache.prototype.push = cachePush;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a stack cache object to store key-value pairs.
-     *
-     * @private
-     * @constructor
-     * @param {Array} [values] The values to cache.
-     */
-    function Stack(values) {
-      var index = -1,
-          length = values ? values.length : 0;
-
-      this.clear();
-      while (++index < length) {
-        var entry = values[index];
-        this.set(entry[0], entry[1]);
-      }
-    }
-
-    /**
-     * Removes all key-value entries from the stack.
-     *
-     * @private
-     * @name clear
-     * @memberOf Stack
-     */
-    function stackClear() {
-      this.__data__ = { 'array': [], 'map': null };
-    }
-
-    /**
-     * Removes `key` and its value from the stack.
-     *
-     * @private
-     * @name delete
-     * @memberOf Stack
-     * @param {string} key The key of the value to remove.
-     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
-     */
-    function stackDelete(key) {
-      var data = this.__data__,
-          array = data.array;
-
-      return array ? assocDelete(array, key) : data.map['delete'](key);
-    }
-
-    /**
-     * Gets the stack value for `key`.
-     *
-     * @private
-     * @name get
-     * @memberOf Stack
-     * @param {string} key The key of the value to get.
-     * @returns {*} Returns the entry value.
-     */
-    function stackGet(key) {
-      var data = this.__data__,
-          array = data.array;
-
-      return array ? assocGet(array, key) : data.map.get(key);
-    }
-
-    /**
-     * Checks if a stack value for `key` exists.
-     *
-     * @private
-     * @name has
-     * @memberOf Stack
-     * @param {string} key The key of the entry to check.
-     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
-     */
-    function stackHas(key) {
-      var data = this.__data__,
-          array = data.array;
-
-      return array ? assocHas(array, key) : data.map.has(key);
-    }
-
-    /**
-     * Sets the stack `key` to `value`.
-     *
-     * @private
-     * @name set
-     * @memberOf Stack
-     * @param {string} key The key of the value to set.
-     * @param {*} value The value to set.
-     * @returns {Object} Returns the stack cache instance.
-     */
-    function stackSet(key, value) {
-      var data = this.__data__,
-          array = data.array;
-
-      if (array) {
-        if (array.length < (LARGE_ARRAY_SIZE - 1)) {
-          assocSet(array, key, value);
-        } else {
-          data.array = null;
-          data.map = new MapCache(array);
-        }
-      }
-      var map = data.map;
-      if (map) {
-        map.set(key, value);
-      }
-      return this;
-    }
-
-    // Add methods to `Stack`.
-    Stack.prototype.clear = stackClear;
-    Stack.prototype['delete'] = stackDelete;
-    Stack.prototype.get = stackGet;
-    Stack.prototype.has = stackHas;
-    Stack.prototype.set = stackSet;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Removes `key` and its value from the associative array.
-     *
-     * @private
-     * @param {Array} array The array to modify.
-     * @param {string} key The key of the value to remove.
-     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
-     */
-    function assocDelete(array, key) {
-      var index = assocIndexOf(array, key);
-      if (index < 0) {
-        return false;
-      }
-      var lastIndex = array.length - 1;
-      if (index == lastIndex) {
-        array.pop();
-      } else {
-        splice.call(array, index, 1);
-      }
-      return true;
-    }
-
-    /**
-     * Gets the associative array value for `key`.
-     *
-     * @private
-     * @param {Array} array The array to query.
-     * @param {string} key The key of the value to get.
-     * @returns {*} Returns the entry value.
-     */
-    function assocGet(array, key) {
-      var index = assocIndexOf(array, key);
-      return index < 0 ? undefined : array[index][1];
-    }
-
-    /**
-     * Checks if an associative array value for `key` exists.
-     *
-     * @private
-     * @param {Array} array The array to query.
-     * @param {string} key The key of the entry to check.
-     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
-     */
-    function assocHas(array, key) {
-      return assocIndexOf(array, key) > -1;
-    }
-
-    /**
-     * Gets the index at which the `key` is found in `array` of key-value pairs.
-     *
-     * @private
-     * @param {Array} array The array to search.
-     * @param {*} key The key to search for.
-     * @returns {number} Returns the index of the matched value, else `-1`.
-     */
-    function assocIndexOf(array, key) {
-      var length = array.length;
-      while (length--) {
-        if (eq(array[length][0], key)) {
-          return length;
-        }
-      }
-      return -1;
-    }
-
-    /**
-     * Sets the associative array `key` to `value`.
-     *
-     * @private
-     * @param {Array} array The array to modify.
-     * @param {string} key The key of the value to set.
-     * @param {*} value The value to set.
-     */
-    function assocSet(array, key, value) {
-      var index = assocIndexOf(array, key);
-      if (index < 0) {
-        array.push([key, value]);
-      } else {
-        array[index][1] = value;
-      }
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Used by `_.defaults` to customize its `_.assignIn` use.
-     *
-     * @private
-     * @param {*} objValue The destination value.
-     * @param {*} srcValue The source value.
-     * @param {string} key The key of the property to assign.
-     * @param {Object} object The parent object of `objValue`.
-     * @returns {*} Returns the value to assign.
-     */
-    function assignInDefaults(objValue, srcValue, key, object) {
-      if (objValue === undefined ||
-          (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
-        return srcValue;
-      }
-      return objValue;
-    }
-
-    /**
-     * This function is like `assignValue` except that it doesn't assign
-     * `undefined` values.
-     *
-     * @private
-     * @param {Object} object The object to modify.
-     * @param {string} key The key of the property to assign.
-     * @param {*} value The value to assign.
-     */
-    function assignMergeValue(object, key, value) {
-      if ((value !== undefined && !eq(object[key], value)) ||
-          (typeof key == 'number' && value === undefined && !(key in object))) {
-        object[key] = value;
-      }
-    }
-
-    /**
-     * Assigns `value` to `key` of `object` if the existing value is not equivalent
-     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons.
-     *
-     * @private
-     * @param {Object} object The object to modify.
-     * @param {string} key The key of the property to assign.
-     * @param {*} value The value to assign.
-     */
-    function assignValue(object, key, value) {
-      var objValue = object[key];
-      if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
-          (value === undefined && !(key in object))) {
-        object[key] = value;
-      }
-    }
-
-    /**
-     * Aggregates elements of `collection` on `accumulator` with keys transformed
-     * by `iteratee` and values set by `setter`.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} setter The function to set `accumulator` values.
-     * @param {Function} iteratee The iteratee to transform keys.
-     * @param {Object} accumulator The initial aggregated object.
-     * @returns {Function} Returns `accumulator`.
-     */
-    function baseAggregator(collection, setter, iteratee, accumulator) {
-      baseEach(collection, function(value, key, collection) {
-        setter(accumulator, value, iteratee(value), collection);
-      });
-      return accumulator;
-    }
-
-    /**
-     * The base implementation of `_.assign` without support for multiple sources
-     * or `customizer` functions.
-     *
-     * @private
-     * @param {Object} object The destination object.
-     * @param {Object} source The source object.
-     * @returns {Object} Returns `object`.
-     */
-    function baseAssign(object, source) {
-      return object && copyObject(source, keys(source), object);
-    }
-
-    /**
-     * The base implementation of `_.at` without support for individual paths.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {string[]} paths The property paths of elements to pick.
-     * @returns {Array} Returns the new array of picked elements.
-     */
-    function baseAt(object, paths) {
-      var index = -1,
-          isNil = object == null,
-          length = paths.length,
-          result = Array(length);
-
-      while (++index < length) {
-        result[index] = isNil ? undefined : get(object, paths[index]);
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.clamp` which doesn't coerce arguments to numbers.
-     *
-     * @private
-     * @param {number} number The number to clamp.
-     * @param {number} [lower] The lower bound.
-     * @param {number} upper The upper bound.
-     * @returns {number} Returns the clamped number.
-     */
-    function baseClamp(number, lower, upper) {
-      if (number === number) {
-        if (upper !== undefined) {
-          number = number <= upper ? number : upper;
-        }
-        if (lower !== undefined) {
-          number = number >= lower ? number : lower;
-        }
-      }
-      return number;
-    }
-
-    /**
-     * The base implementation of `_.clone` and `_.cloneDeep` which tracks
-     * traversed objects.
-     *
-     * @private
-     * @param {*} value The value to clone.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @param {boolean} [isFull] Specify a clone including symbols.
-     * @param {Function} [customizer] The function to customize cloning.
-     * @param {string} [key] The key of `value`.
-     * @param {Object} [object] The parent object of `value`.
-     * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
-     * @returns {*} Returns the cloned value.
-     */
-    function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
-      var result;
-      if (customizer) {
-        result = object ? customizer(value, key, object, stack) : customizer(value);
-      }
-      if (result !== undefined) {
-        return result;
-      }
-      if (!isObject(value)) {
-        return value;
-      }
-      var isArr = isArray(value);
-      if (isArr) {
-        result = initCloneArray(value);
-        if (!isDeep) {
-          return copyArray(value, result);
-        }
-      } else {
-        var tag = getTag(value),
-            isFunc = tag == funcTag || tag == genTag;
-
-        if (isBuffer(value)) {
-          return cloneBuffer(value, isDeep);
-        }
-        if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
-          if (isHostObject(value)) {
-            return object ? value : {};
-          }
-          result = initCloneObject(isFunc ? {} : value);
-          if (!isDeep) {
-            return copySymbols(value, baseAssign(result, value));
-          }
-        } else {
-          if (!cloneableTags[tag]) {
-            return object ? value : {};
-          }
-          result = initCloneByTag(value, tag, baseClone, isDeep);
-        }
-      }
-      // Check for circular references and return its corresponding clone.
-      stack || (stack = new Stack);
-      var stacked = stack.get(value);
-      if (stacked) {
-        return stacked;
-      }
-      stack.set(value, result);
-
-      if (!isArr) {
-        var props = isFull ? getAllKeys(value) : keys(value);
-      }
-      // Recursively populate clone (susceptible to call stack limits).
-      arrayEach(props || value, function(subValue, key) {
-        if (props) {
-          key = subValue;
-          subValue = value[key];
-        }
-        assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
-      });
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.conforms` which doesn't clone `source`.
-     *
-     * @private
-     * @param {Object} source The object of property predicates to conform to.
-     * @returns {Function} Returns the new function.
-     */
-    function baseConforms(source) {
-      var props = keys(source),
-          length = props.length;
-
-      return function(object) {
-        if (object == null) {
-          return !length;
-        }
-        var index = length;
-        while (index--) {
-          var key = props[index],
-              predicate = source[key],
-              value = object[key];
-
-          if ((value === undefined &&
-              !(key in Object(object))) || !predicate(value)) {
-            return false;
-          }
-        }
-        return true;
-      };
-    }
-
-    /**
-     * The base implementation of `_.create` without support for assigning
-     * properties to the created object.
-     *
-     * @private
-     * @param {Object} prototype The object to inherit from.
-     * @returns {Object} Returns the new object.
-     */
-    function baseCreate(proto) {
-      return isObject(proto) ? objectCreate(proto) : {};
-    }
-
-    /**
-     * The base implementation of `_.delay` and `_.defer` which accepts an array
-     * of `func` arguments.
-     *
-     * @private
-     * @param {Function} func The function to delay.
-     * @param {number} wait The number of milliseconds to delay invocation.
-     * @param {Object} args The arguments to provide to `func`.
-     * @returns {number} Returns the timer id.
-     */
-    function baseDelay(func, wait, args) {
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      return setTimeout(function() { func.apply(undefined, args); }, wait);
-    }
-
-    /**
-     * The base implementation of methods like `_.difference` without support
-     * for excluding multiple arrays or iteratee shorthands.
-     *
-     * @private
-     * @param {Array} array The array to inspect.
-     * @param {Array} values The values to exclude.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of filtered values.
-     */
-    function baseDifference(array, values, iteratee, comparator) {
-      var index = -1,
-          includes = arrayIncludes,
-          isCommon = true,
-          length = array.length,
-          result = [],
-          valuesLength = values.length;
-
-      if (!length) {
-        return result;
-      }
-      if (iteratee) {
-        values = arrayMap(values, baseUnary(iteratee));
-      }
-      if (comparator) {
-        includes = arrayIncludesWith;
-        isCommon = false;
-      }
-      else if (values.length >= LARGE_ARRAY_SIZE) {
-        includes = cacheHas;
-        isCommon = false;
-        values = new SetCache(values);
-      }
-      outer:
-      while (++index < length) {
-        var value = array[index],
-            computed = iteratee ? iteratee(value) : value;
-
-        value = (comparator || value !== 0) ? value : 0;
-        if (isCommon && computed === computed) {
-          var valuesIndex = valuesLength;
-          while (valuesIndex--) {
-            if (values[valuesIndex] === computed) {
-              continue outer;
-            }
-          }
-          result.push(value);
-        }
-        else if (!includes(values, computed, comparator)) {
-          result.push(value);
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.forEach` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @returns {Array|Object} Returns `collection`.
-     */
-    var baseEach = createBaseEach(baseForOwn);
-
-    /**
-     * The base implementation of `_.forEachRight` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @returns {Array|Object} Returns `collection`.
-     */
-    var baseEachRight = createBaseEach(baseForOwnRight, true);
-
-    /**
-     * The base implementation of `_.every` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} predicate The function invoked per iteration.
-     * @returns {boolean} Returns `true` if all elements pass the predicate check,
-     *  else `false`
-     */
-    function baseEvery(collection, predicate) {
-      var result = true;
-      baseEach(collection, function(value, index, collection) {
-        result = !!predicate(value, index, collection);
-        return result;
-      });
-      return result;
-    }
-
-    /**
-     * The base implementation of methods like `_.max` and `_.min` which accepts a
-     * `comparator` to determine the extremum value.
-     *
-     * @private
-     * @param {Array} array The array to iterate over.
-     * @param {Function} iteratee The iteratee invoked per iteration.
-     * @param {Function} comparator The comparator used to compare values.
-     * @returns {*} Returns the extremum value.
-     */
-    function baseExtremum(array, iteratee, comparator) {
-      var index = -1,
-          length = array.length;
-
-      while (++index < length) {
-        var value = array[index],
-            current = iteratee(value);
-
-        if (current != null && (computed === undefined
-              ? (current === current && !isSymbol(current))
-              : comparator(current, computed)
-            )) {
-          var computed = current,
-              result = value;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.fill` without an iteratee call guard.
-     *
-     * @private
-     * @param {Array} array The array to fill.
-     * @param {*} value The value to fill `array` with.
-     * @param {number} [start=0] The start position.
-     * @param {number} [end=array.length] The end position.
-     * @returns {Array} Returns `array`.
-     */
-    function baseFill(array, value, start, end) {
-      var length = array.length;
-
-      start = toInteger(start);
-      if (start < 0) {
-        start = -start > length ? 0 : (length + start);
-      }
-      end = (end === undefined || end > length) ? length : toInteger(end);
-      if (end < 0) {
-        end += length;
-      }
-      end = start > end ? 0 : toLength(end);
-      while (start < end) {
-        array[start++] = value;
-      }
-      return array;
-    }
-
-    /**
-     * The base implementation of `_.filter` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} predicate The function invoked per iteration.
-     * @returns {Array} Returns the new filtered array.
-     */
-    function baseFilter(collection, predicate) {
-      var result = [];
-      baseEach(collection, function(value, index, collection) {
-        if (predicate(value, index, collection)) {
-          result.push(value);
-        }
-      });
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.flatten` with support for restricting flattening.
-     *
-     * @private
-     * @param {Array} array The array to flatten.
-     * @param {number} depth The maximum recursion depth.
-     * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
-     * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
-     * @param {Array} [result=[]] The initial result value.
-     * @returns {Array} Returns the new flattened array.
-     */
-    function baseFlatten(array, depth, predicate, isStrict, result) {
-      var index = -1,
-          length = array.length;
-
-      predicate || (predicate = isFlattenable);
-      result || (result = []);
-
-      while (++index < length) {
-        var value = array[index];
-        if (depth > 0 && predicate(value)) {
-          if (depth > 1) {
-            // Recursively flatten arrays (susceptible to call stack limits).
-            baseFlatten(value, depth - 1, predicate, isStrict, result);
-          } else {
-            arrayPush(result, value);
-          }
-        } else if (!isStrict) {
-          result[result.length] = value;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `baseForOwn` which iterates over `object`
-     * properties returned by `keysFunc` and invokes `iteratee` for each property.
-     * Iteratee functions may exit iteration early by explicitly returning `false`.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @param {Function} keysFunc The function to get the keys of `object`.
-     * @returns {Object} Returns `object`.
-     */
-    var baseFor = createBaseFor();
-
-    /**
-     * This function is like `baseFor` except that it iterates over properties
-     * in the opposite order.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @param {Function} keysFunc The function to get the keys of `object`.
-     * @returns {Object} Returns `object`.
-     */
-    var baseForRight = createBaseFor(true);
-
-    /**
-     * The base implementation of `_.forOwn` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     */
-    function baseForOwn(object, iteratee) {
-      return object && baseFor(object, iteratee, keys);
-    }
-
-    /**
-     * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     */
-    function baseForOwnRight(object, iteratee) {
-      return object && baseForRight(object, iteratee, keys);
-    }
-
-    /**
-     * The base implementation of `_.functions` which creates an array of
-     * `object` function property names filtered from `props`.
-     *
-     * @private
-     * @param {Object} object The object to inspect.
-     * @param {Array} props The property names to filter.
-     * @returns {Array} Returns the new array of filtered property names.
-     */
-    function baseFunctions(object, props) {
-      return arrayFilter(props, function(key) {
-        return isFunction(object[key]);
-      });
-    }
-
-    /**
-     * The base implementation of `_.get` without support for default values.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the property to get.
-     * @returns {*} Returns the resolved value.
-     */
-    function baseGet(object, path) {
-      path = isKey(path, object) ? [path] : castPath(path);
-
-      var index = 0,
-          length = path.length;
-
-      while (object != null && index < length) {
-        object = object[toKey(path[index++])];
-      }
-      return (index && index == length) ? object : undefined;
-    }
-
-    /**
-     * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
-     * `keysFunc` and `symbolsFunc` to get the enumerable property names and
-     * symbols of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Function} keysFunc The function to get the keys of `object`.
-     * @param {Function} symbolsFunc The function to get the symbols of `object`.
-     * @returns {Array} Returns the array of property names and symbols.
-     */
-    function baseGetAllKeys(object, keysFunc, symbolsFunc) {
-      var result = keysFunc(object);
-      return isArray(object)
-        ? result
-        : arrayPush(result, symbolsFunc(object));
-    }
-
-    /**
-     * The base implementation of `_.gt` which doesn't coerce arguments to numbers.
-     *
-     * @private
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is greater than `other`,
-     *  else `false`.
-     */
-    function baseGt(value, other) {
-      return value > other;
-    }
-
-    /**
-     * The base implementation of `_.has` without support for deep paths.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} key The key to check.
-     * @returns {boolean} Returns `true` if `key` exists, else `false`.
-     */
-    function baseHas(object, key) {
-      // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
-      // that are composed entirely of index properties, return `false` for
-      // `hasOwnProperty` checks of them.
-      return hasOwnProperty.call(object, key) ||
-        (typeof object == 'object' && key in object && getPrototype(object) === null);
-    }
-
-    /**
-     * The base implementation of `_.hasIn` without support for deep paths.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} key The key to check.
-     * @returns {boolean} Returns `true` if `key` exists, else `false`.
-     */
-    function baseHasIn(object, key) {
-      return key in Object(object);
-    }
-
-    /**
-     * The base implementation of `_.inRange` which doesn't coerce arguments to numbers.
-     *
-     * @private
-     * @param {number} number The number to check.
-     * @param {number} start The start of the range.
-     * @param {number} end The end of the range.
-     * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
-     */
-    function baseInRange(number, start, end) {
-      return number >= nativeMin(start, end) && number < nativeMax(start, end);
-    }
-
-    /**
-     * The base implementation of methods like `_.intersection`, without support
-     * for iteratee shorthands, that accepts an array of arrays to inspect.
-     *
-     * @private
-     * @param {Array} arrays The arrays to inspect.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of shared values.
-     */
-    function baseIntersection(arrays, iteratee, comparator) {
-      var includes = comparator ? arrayIncludesWith : arrayIncludes,
-          length = arrays[0].length,
-          othLength = arrays.length,
-          othIndex = othLength,
-          caches = Array(othLength),
-          maxLength = Infinity,
-          result = [];
-
-      while (othIndex--) {
-        var array = arrays[othIndex];
-        if (othIndex && iteratee) {
-          array = arrayMap(array, baseUnary(iteratee));
-        }
-        maxLength = nativeMin(array.length, maxLength);
-        caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
-          ? new SetCache(othIndex && array)
-          : undefined;
-      }
-      array = arrays[0];
-
-      var index = -1,
-          seen = caches[0];
-
-      outer:
-      while (++index < length && result.length < maxLength) {
-        var value = array[index],
-            computed = iteratee ? iteratee(value) : value;
-
-        value = (comparator || value !== 0) ? value : 0;
-        if (!(seen
-              ? cacheHas(seen, computed)
-              : includes(result, computed, comparator)
-            )) {
-          othIndex = othLength;
-          while (--othIndex) {
-            var cache = caches[othIndex];
-            if (!(cache
-                  ? cacheHas(cache, computed)
-                  : includes(arrays[othIndex], computed, comparator))
-                ) {
-              continue outer;
-            }
-          }
-          if (seen) {
-            seen.push(computed);
-          }
-          result.push(value);
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.invert` and `_.invertBy` which inverts
-     * `object` with values transformed by `iteratee` and set by `setter`.
-     *
-     * @private
-     * @param {Object} object The object to iterate over.
-     * @param {Function} setter The function to set `accumulator` values.
-     * @param {Function} iteratee The iteratee to transform values.
-     * @param {Object} accumulator The initial inverted object.
-     * @returns {Function} Returns `accumulator`.
-     */
-    function baseInverter(object, setter, iteratee, accumulator) {
-      baseForOwn(object, function(value, key, object) {
-        setter(accumulator, iteratee(value), key, object);
-      });
-      return accumulator;
-    }
-
-    /**
-     * The base implementation of `_.invoke` without support for individual
-     * method arguments.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the method to invoke.
-     * @param {Array} args The arguments to invoke the method with.
-     * @returns {*} Returns the result of the invoked method.
-     */
-    function baseInvoke(object, path, args) {
-      if (!isKey(path, object)) {
-        path = castPath(path);
-        object = parent(object, path);
-        path = last(path);
-      }
-      var func = object == null ? object : object[toKey(path)];
-      return func == null ? undefined : apply(func, object, args);
-    }
-
-    /**
-     * The base implementation of `_.isEqual` which supports partial comparisons
-     * and tracks traversed objects.
-     *
-     * @private
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @param {Function} [customizer] The function to customize comparisons.
-     * @param {boolean} [bitmask] The bitmask of comparison flags.
-     *  The bitmask may be composed of the following flags:
-     *     1 - Unordered comparison
-     *     2 - Partial comparison
-     * @param {Object} [stack] Tracks traversed `value` and `other` objects.
-     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
-     */
-    function baseIsEqual(value, other, customizer, bitmask, stack) {
-      if (value === other) {
-        return true;
-      }
-      if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
-        return value !== value && other !== other;
-      }
-      return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
-    }
-
-    /**
-     * A specialized version of `baseIsEqual` for arrays and objects which performs
-     * deep comparisons and tracks traversed objects enabling objects with circular
-     * references to be compared.
-     *
-     * @private
-     * @param {Object} object The object to compare.
-     * @param {Object} other The other object to compare.
-     * @param {Function} equalFunc The function to determine equivalents of values.
-     * @param {Function} [customizer] The function to customize comparisons.
-     * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
-     *  for more details.
-     * @param {Object} [stack] Tracks traversed `object` and `other` objects.
-     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
-     */
-    function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
-      var objIsArr = isArray(object),
-          othIsArr = isArray(other),
-          objTag = arrayTag,
-          othTag = arrayTag;
-
-      if (!objIsArr) {
-        objTag = getTag(object);
-        objTag = objTag == argsTag ? objectTag : objTag;
-      }
-      if (!othIsArr) {
-        othTag = getTag(other);
-        othTag = othTag == argsTag ? objectTag : othTag;
-      }
-      var objIsObj = objTag == objectTag && !isHostObject(object),
-          othIsObj = othTag == objectTag && !isHostObject(other),
-          isSameTag = objTag == othTag;
-
-      if (isSameTag && !objIsObj) {
-        stack || (stack = new Stack);
-        return (objIsArr || isTypedArray(object))
-          ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)
-          : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
-      }
-      if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
-        var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
-            othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
-
-        if (objIsWrapped || othIsWrapped) {
-          var objUnwrapped = objIsWrapped ? object.value() : object,
-              othUnwrapped = othIsWrapped ? other.value() : other;
-
-          stack || (stack = new Stack);
-          return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
-        }
-      }
-      if (!isSameTag) {
-        return false;
-      }
-      stack || (stack = new Stack);
-      return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
-    }
-
-    /**
-     * The base implementation of `_.isMatch` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Object} object The object to inspect.
-     * @param {Object} source The object of property values to match.
-     * @param {Array} matchData The property names, values, and compare flags to match.
-     * @param {Function} [customizer] The function to customize comparisons.
-     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
-     */
-    function baseIsMatch(object, source, matchData, customizer) {
-      var index = matchData.length,
-          length = index,
-          noCustomizer = !customizer;
-
-      if (object == null) {
-        return !length;
-      }
-      object = Object(object);
-      while (index--) {
-        var data = matchData[index];
-        if ((noCustomizer && data[2])
-              ? data[1] !== object[data[0]]
-              : !(data[0] in object)
-            ) {
-          return false;
-        }
-      }
-      while (++index < length) {
-        data = matchData[index];
-        var key = data[0],
-            objValue = object[key],
-            srcValue = data[1];
-
-        if (noCustomizer && data[2]) {
-          if (objValue === undefined && !(key in object)) {
-            return false;
-          }
-        } else {
-          var stack = new Stack;
-          if (customizer) {
-            var result = customizer(objValue, srcValue, key, object, source, stack);
-          }
-          if (!(result === undefined
-                ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)
-                : result
-              )) {
-            return false;
-          }
-        }
-      }
-      return true;
-    }
-
-    /**
-     * The base implementation of `_.iteratee`.
-     *
-     * @private
-     * @param {*} [value=_.identity] The value to convert to an iteratee.
-     * @returns {Function} Returns the iteratee.
-     */
-    function baseIteratee(value) {
-      // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
-      // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
-      if (typeof value == 'function') {
-        return value;
-      }
-      if (value == null) {
-        return identity;
-      }
-      if (typeof value == 'object') {
-        return isArray(value)
-          ? baseMatchesProperty(value[0], value[1])
-          : baseMatches(value);
-      }
-      return property(value);
-    }
-
-    /**
-     * The base implementation of `_.keys` which doesn't skip the constructor
-     * property of prototypes or treat sparse arrays as dense.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names.
-     */
-    function baseKeys(object) {
-      return nativeKeys(Object(object));
-    }
-
-    /**
-     * The base implementation of `_.keysIn` which doesn't skip the constructor
-     * property of prototypes or treat sparse arrays as dense.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names.
-     */
-    function baseKeysIn(object) {
-      object = object == null ? object : Object(object);
-
-      var result = [];
-      for (var key in object) {
-        result.push(key);
-      }
-      return result;
-    }
-
-    // Fallback for IE < 9 with es6-shim.
-    if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
-      baseKeysIn = function(object) {
-        return iteratorToArray(enumerate(object));
-      };
-    }
-
-    /**
-     * The base implementation of `_.lt` which doesn't coerce arguments to numbers.
-     *
-     * @private
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is less than `other`,
-     *  else `false`.
-     */
-    function baseLt(value, other) {
-      return value < other;
-    }
-
-    /**
-     * The base implementation of `_.map` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} iteratee The function invoked per iteration.
-     * @returns {Array} Returns the new mapped array.
-     */
-    function baseMap(collection, iteratee) {
-      var index = -1,
-          result = isArrayLike(collection) ? Array(collection.length) : [];
-
-      baseEach(collection, function(value, key, collection) {
-        result[++index] = iteratee(value, key, collection);
-      });
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.matches` which doesn't clone `source`.
-     *
-     * @private
-     * @param {Object} source The object of property values to match.
-     * @returns {Function} Returns the new function.
-     */
-    function baseMatches(source) {
-      var matchData = getMatchData(source);
-      if (matchData.length == 1 && matchData[0][2]) {
-        return matchesStrictComparable(matchData[0][0], matchData[0][1]);
-      }
-      return function(object) {
-        return object === source || baseIsMatch(object, source, matchData);
-      };
-    }
-
-    /**
-     * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
-     *
-     * @private
-     * @param {string} path The path of the property to get.
-     * @param {*} srcValue The value to match.
-     * @returns {Function} Returns the new function.
-     */
-    function baseMatchesProperty(path, srcValue) {
-      if (isKey(path) && isStrictComparable(srcValue)) {
-        return matchesStrictComparable(toKey(path), srcValue);
-      }
-      return function(object) {
-        var objValue = get(object, path);
-        return (objValue === undefined && objValue === srcValue)
-          ? hasIn(object, path)
-          : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
-      };
-    }
-
-    /**
-     * The base implementation of `_.merge` without support for multiple sources.
-     *
-     * @private
-     * @param {Object} object The destination object.
-     * @param {Object} source The source object.
-     * @param {number} srcIndex The index of `source`.
-     * @param {Function} [customizer] The function to customize merged values.
-     * @param {Object} [stack] Tracks traversed source values and their merged
-     *  counterparts.
-     */
-    function baseMerge(object, source, srcIndex, customizer, stack) {
-      if (object === source) {
-        return;
-      }
-      if (!(isArray(source) || isTypedArray(source))) {
-        var props = keysIn(source);
-      }
-      arrayEach(props || source, function(srcValue, key) {
-        if (props) {
-          key = srcValue;
-          srcValue = source[key];
-        }
-        if (isObject(srcValue)) {
-          stack || (stack = new Stack);
-          baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
-        }
-        else {
-          var newValue = customizer
-            ? customizer(object[key], srcValue, (key + ''), object, source, stack)
-            : undefined;
-
-          if (newValue === undefined) {
-            newValue = srcValue;
-          }
-          assignMergeValue(object, key, newValue);
-        }
-      });
-    }
-
-    /**
-     * A specialized version of `baseMerge` for arrays and objects which performs
-     * deep merges and tracks traversed objects enabling objects with circular
-     * references to be merged.
-     *
-     * @private
-     * @param {Object} object The destination object.
-     * @param {Object} source The source object.
-     * @param {string} key The key of the value to merge.
-     * @param {number} srcIndex The index of `source`.
-     * @param {Function} mergeFunc The function to merge values.
-     * @param {Function} [customizer] The function to customize assigned values.
-     * @param {Object} [stack] Tracks traversed source values and their merged
-     *  counterparts.
-     */
-    function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
-      var objValue = object[key],
-          srcValue = source[key],
-          stacked = stack.get(srcValue);
-
-      if (stacked) {
-        assignMergeValue(object, key, stacked);
-        return;
-      }
-      var newValue = customizer
-        ? customizer(objValue, srcValue, (key + ''), object, source, stack)
-        : undefined;
-
-      var isCommon = newValue === undefined;
-
-      if (isCommon) {
-        newValue = srcValue;
-        if (isArray(srcValue) || isTypedArray(srcValue)) {
-          if (isArray(objValue)) {
-            newValue = objValue;
-          }
-          else if (isArrayLikeObject(objValue)) {
-            newValue = copyArray(objValue);
-          }
-          else {
-            isCommon = false;
-            newValue = baseClone(srcValue, true);
-          }
-        }
-        else if (isPlainObject(srcValue) || isArguments(srcValue)) {
-          if (isArguments(objValue)) {
-            newValue = toPlainObject(objValue);
-          }
-          else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
-            isCommon = false;
-            newValue = baseClone(srcValue, true);
-          }
-          else {
-            newValue = objValue;
-          }
-        }
-        else {
-          isCommon = false;
-        }
-      }
-      stack.set(srcValue, newValue);
-
-      if (isCommon) {
-        // Recursively merge objects and arrays (susceptible to call stack limits).
-        mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
-      }
-      stack['delete'](srcValue);
-      assignMergeValue(object, key, newValue);
-    }
-
-    /**
-     * The base implementation of `_.nth` which doesn't coerce `n` to an integer.
-     *
-     * @private
-     * @param {Array} array The array to query.
-     * @param {number} n The index of the element to return.
-     * @returns {*} Returns the nth element of `array`.
-     */
-    function baseNth(array, n) {
-      var length = array.length;
-      if (!length) {
-        return;
-      }
-      n += n < 0 ? length : 0;
-      return isIndex(n, length) ? array[n] : undefined;
-    }
-
-    /**
-     * The base implementation of `_.orderBy` without param guards.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
-     * @param {string[]} orders The sort orders of `iteratees`.
-     * @returns {Array} Returns the new sorted array.
-     */
-    function baseOrderBy(collection, iteratees, orders) {
-      var index = -1;
-      iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
-
-      var result = baseMap(collection, function(value, key, collection) {
-        var criteria = arrayMap(iteratees, function(iteratee) {
-          return iteratee(value);
-        });
-        return { 'criteria': criteria, 'index': ++index, 'value': value };
-      });
-
-      return baseSortBy(result, function(object, other) {
-        return compareMultiple(object, other, orders);
-      });
-    }
-
-    /**
-     * The base implementation of `_.pick` without support for individual
-     * property identifiers.
-     *
-     * @private
-     * @param {Object} object The source object.
-     * @param {string[]} props The property identifiers to pick.
-     * @returns {Object} Returns the new object.
-     */
-    function basePick(object, props) {
-      object = Object(object);
-      return arrayReduce(props, function(result, key) {
-        if (key in object) {
-          result[key] = object[key];
-        }
-        return result;
-      }, {});
-    }
-
-    /**
-     * The base implementation of  `_.pickBy` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Object} object The source object.
-     * @param {Function} predicate The function invoked per property.
-     * @returns {Object} Returns the new object.
-     */
-    function basePickBy(object, predicate) {
-      var index = -1,
-          props = getAllKeysIn(object),
-          length = props.length,
-          result = {};
-
-      while (++index < length) {
-        var key = props[index],
-            value = object[key];
-
-        if (predicate(value, key)) {
-          result[key] = value;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.property` without support for deep paths.
-     *
-     * @private
-     * @param {string} key The key of the property to get.
-     * @returns {Function} Returns the new function.
-     */
-    function baseProperty(key) {
-      return function(object) {
-        return object == null ? undefined : object[key];
-      };
-    }
-
-    /**
-     * A specialized version of `baseProperty` which supports deep paths.
-     *
-     * @private
-     * @param {Array|string} path The path of the property to get.
-     * @returns {Function} Returns the new function.
-     */
-    function basePropertyDeep(path) {
-      return function(object) {
-        return baseGet(object, path);
-      };
-    }
-
-    /**
-     * The base implementation of `_.pullAllBy` without support for iteratee
-     * shorthands.
-     *
-     * @private
-     * @param {Array} array The array to modify.
-     * @param {Array} values The values to remove.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns `array`.
-     */
-    function basePullAll(array, values, iteratee, comparator) {
-      var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
-          index = -1,
-          length = values.length,
-          seen = array;
-
-      if (iteratee) {
-        seen = arrayMap(array, baseUnary(iteratee));
-      }
-      while (++index < length) {
-        var fromIndex = 0,
-            value = values[index],
-            computed = iteratee ? iteratee(value) : value;
-
-        while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
-          if (seen !== array) {
-            splice.call(seen, fromIndex, 1);
-          }
-          splice.call(array, fromIndex, 1);
-        }
-      }
-      return array;
-    }
-
-    /**
-     * The base implementation of `_.pullAt` without support for individual
-     * indexes or capturing the removed elements.
-     *
-     * @private
-     * @param {Array} array The array to modify.
-     * @param {number[]} indexes The indexes of elements to remove.
-     * @returns {Array} Returns `array`.
-     */
-    function basePullAt(array, indexes) {
-      var length = array ? indexes.length : 0,
-          lastIndex = length - 1;
-
-      while (length--) {
-        var index = indexes[length];
-        if (length == lastIndex || index !== previous) {
-          var previous = index;
-          if (isIndex(index)) {
-            splice.call(array, index, 1);
-          }
-          else if (!isKey(index, array)) {
-            var path = castPath(index),
-                object = parent(array, path);
-
-            if (object != null) {
-              delete object[toKey(last(path))];
-            }
-          }
-          else {
-            delete array[toKey(index)];
-          }
-        }
-      }
-      return array;
-    }
-
-    /**
-     * The base implementation of `_.random` without support for returning
-     * floating-point numbers.
-     *
-     * @private
-     * @param {number} lower The lower bound.
-     * @param {number} upper The upper bound.
-     * @returns {number} Returns the random number.
-     */
-    function baseRandom(lower, upper) {
-      return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
-    }
-
-    /**
-     * The base implementation of `_.range` and `_.rangeRight` which doesn't
-     * coerce arguments to numbers.
-     *
-     * @private
-     * @param {number} start The start of the range.
-     * @param {number} end The end of the range.
-     * @param {number} step The value to increment or decrement by.
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Array} Returns the new array of numbers.
-     */
-    function baseRange(start, end, step, fromRight) {
-      var index = -1,
-          length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
-          result = Array(length);
-
-      while (length--) {
-        result[fromRight ? length : ++index] = start;
-        start += step;
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.repeat` which doesn't coerce arguments.
-     *
-     * @private
-     * @param {string} string The string to repeat.
-     * @param {number} n The number of times to repeat the string.
-     * @returns {string} Returns the repeated string.
-     */
-    function baseRepeat(string, n) {
-      var result = '';
-      if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
-        return result;
-      }
-      // Leverage the exponentiation by squaring algorithm for a faster repeat.
-      // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
-      do {
-        if (n % 2) {
-          result += string;
-        }
-        n = nativeFloor(n / 2);
-        if (n) {
-          string += string;
-        }
-      } while (n);
-
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.set`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the property to set.
-     * @param {*} value The value to set.
-     * @param {Function} [customizer] The function to customize path creation.
-     * @returns {Object} Returns `object`.
-     */
-    function baseSet(object, path, value, customizer) {
-      path = isKey(path, object) ? [path] : castPath(path);
-
-      var index = -1,
-          length = path.length,
-          lastIndex = length - 1,
-          nested = object;
-
-      while (nested != null && ++index < length) {
-        var key = toKey(path[index]);
-        if (isObject(nested)) {
-          var newValue = value;
-          if (index != lastIndex) {
-            var objValue = nested[key];
-            newValue = customizer ? customizer(objValue, key, nested) : undefined;
-            if (newValue === undefined) {
-              newValue = objValue == null
-                ? (isIndex(path[index + 1]) ? [] : {})
-                : objValue;
-            }
-          }
-          assignValue(nested, key, newValue);
-        }
-        nested = nested[key];
-      }
-      return object;
-    }
-
-    /**
-     * The base implementation of `setData` without support for hot loop detection.
-     *
-     * @private
-     * @param {Function} func The function to associate metadata with.
-     * @param {*} data The metadata.
-     * @returns {Function} Returns `func`.
-     */
-    var baseSetData = !metaMap ? identity : function(func, data) {
-      metaMap.set(func, data);
-      return func;
-    };
-
-    /**
-     * The base implementation of `_.slice` without an iteratee call guard.
-     *
-     * @private
-     * @param {Array} array The array to slice.
-     * @param {number} [start=0] The start position.
-     * @param {number} [end=array.length] The end position.
-     * @returns {Array} Returns the slice of `array`.
-     */
-    function baseSlice(array, start, end) {
-      var index = -1,
-          length = array.length;
-
-      if (start < 0) {
-        start = -start > length ? 0 : (length + start);
-      }
-      end = end > length ? length : end;
-      if (end < 0) {
-        end += length;
-      }
-      length = start > end ? 0 : ((end - start) >>> 0);
-      start >>>= 0;
-
-      var result = Array(length);
-      while (++index < length) {
-        result[index] = array[index + start];
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.some` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} predicate The function invoked per iteration.
-     * @returns {boolean} Returns `true` if any element passes the predicate check,
-     *  else `false`.
-     */
-    function baseSome(collection, predicate) {
-      var result;
-
-      baseEach(collection, function(value, index, collection) {
-        result = predicate(value, index, collection);
-        return !result;
-      });
-      return !!result;
-    }
-
-    /**
-     * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
-     * performs a binary search of `array` to determine the index at which `value`
-     * should be inserted into `array` in order to maintain its sort order.
-     *
-     * @private
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @param {boolean} [retHighest] Specify returning the highest qualified index.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     */
-    function baseSortedIndex(array, value, retHighest) {
-      var low = 0,
-          high = array ? array.length : low;
-
-      if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
-        while (low < high) {
-          var mid = (low + high) >>> 1,
-              computed = array[mid];
-
-          if (computed !== null && !isSymbol(computed) &&
-              (retHighest ? (computed <= value) : (computed < value))) {
-            low = mid + 1;
-          } else {
-            high = mid;
-          }
-        }
-        return high;
-      }
-      return baseSortedIndexBy(array, value, identity, retHighest);
-    }
-
-    /**
-     * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
-     * which invokes `iteratee` for `value` and each element of `array` to compute
-     * their sort ranking. The iteratee is invoked with one argument; (value).
-     *
-     * @private
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @param {Function} iteratee The iteratee invoked per element.
-     * @param {boolean} [retHighest] Specify returning the highest qualified index.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     */
-    function baseSortedIndexBy(array, value, iteratee, retHighest) {
-      value = iteratee(value);
-
-      var low = 0,
-          high = array ? array.length : 0,
-          valIsNaN = value !== value,
-          valIsNull = value === null,
-          valIsSymbol = isSymbol(value),
-          valIsUndefined = value === undefined;
-
-      while (low < high) {
-        var mid = nativeFloor((low + high) / 2),
-            computed = iteratee(array[mid]),
-            othIsDefined = computed !== undefined,
-            othIsNull = computed === null,
-            othIsReflexive = computed === computed,
-            othIsSymbol = isSymbol(computed);
-
-        if (valIsNaN) {
-          var setLow = retHighest || othIsReflexive;
-        } else if (valIsUndefined) {
-          setLow = othIsReflexive && (retHighest || othIsDefined);
-        } else if (valIsNull) {
-          setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
-        } else if (valIsSymbol) {
-          setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
-        } else if (othIsNull || othIsSymbol) {
-          setLow = false;
-        } else {
-          setLow = retHighest ? (computed <= value) : (computed < value);
-        }
-        if (setLow) {
-          low = mid + 1;
-        } else {
-          high = mid;
-        }
-      }
-      return nativeMin(high, MAX_ARRAY_INDEX);
-    }
-
-    /**
-     * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
-     * support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array} array The array to inspect.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @returns {Array} Returns the new duplicate free array.
-     */
-    function baseSortedUniq(array, iteratee) {
-      var index = -1,
-          length = array.length,
-          resIndex = 0,
-          result = [];
-
-      while (++index < length) {
-        var value = array[index],
-            computed = iteratee ? iteratee(value) : value;
-
-        if (!index || !eq(computed, seen)) {
-          var seen = computed;
-          result[resIndex++] = value === 0 ? 0 : value;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.toNumber` which doesn't ensure correct
-     * conversions of binary, hexadecimal, or octal string values.
-     *
-     * @private
-     * @param {*} value The value to process.
-     * @returns {number} Returns the number.
-     */
-    function baseToNumber(value) {
-      if (typeof value == 'number') {
-        return value;
-      }
-      if (isSymbol(value)) {
-        return NAN;
-      }
-      return +value;
-    }
-
-    /**
-     * The base implementation of `_.toString` which doesn't convert nullish
-     * values to empty strings.
-     *
-     * @private
-     * @param {*} value The value to process.
-     * @returns {string} Returns the string.
-     */
-    function baseToString(value) {
-      // Exit early for strings to avoid a performance hit in some environments.
-      if (typeof value == 'string') {
-        return value;
-      }
-      if (isSymbol(value)) {
-        return symbolToString ? symbolToString.call(value) : '';
-      }
-      var result = (value + '');
-      return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
-    }
-
-    /**
-     * The base implementation of `_.uniqBy` without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array} array The array to inspect.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new duplicate free array.
-     */
-    function baseUniq(array, iteratee, comparator) {
-      var index = -1,
-          includes = arrayIncludes,
-          length = array.length,
-          isCommon = true,
-          result = [],
-          seen = result;
-
-      if (comparator) {
-        isCommon = false;
-        includes = arrayIncludesWith;
-      }
-      else if (length >= LARGE_ARRAY_SIZE) {
-        var set = iteratee ? null : createSet(array);
-        if (set) {
-          return setToArray(set);
-        }
-        isCommon = false;
-        includes = cacheHas;
-        seen = new SetCache;
-      }
-      else {
-        seen = iteratee ? [] : result;
-      }
-      outer:
-      while (++index < length) {
-        var value = array[index],
-            computed = iteratee ? iteratee(value) : value;
-
-        value = (comparator || value !== 0) ? value : 0;
-        if (isCommon && computed === computed) {
-          var seenIndex = seen.length;
-          while (seenIndex--) {
-            if (seen[seenIndex] === computed) {
-              continue outer;
-            }
-          }
-          if (iteratee) {
-            seen.push(computed);
-          }
-          result.push(value);
-        }
-        else if (!includes(seen, computed, comparator)) {
-          if (seen !== result) {
-            seen.push(computed);
-          }
-          result.push(value);
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The base implementation of `_.unset`.
-     *
-     * @private
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to unset.
-     * @returns {boolean} Returns `true` if the property is deleted, else `false`.
-     */
-    function baseUnset(object, path) {
-      path = isKey(path, object) ? [path] : castPath(path);
-      object = parent(object, path);
-
-      var key = toKey(last(path));
-      return !(object != null && baseHas(object, key)) || delete object[key];
-    }
-
-    /**
-     * The base implementation of `_.update`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the property to update.
-     * @param {Function} updater The function to produce the updated value.
-     * @param {Function} [customizer] The function to customize path creation.
-     * @returns {Object} Returns `object`.
-     */
-    function baseUpdate(object, path, updater, customizer) {
-      return baseSet(object, path, updater(baseGet(object, path)), customizer);
-    }
-
-    /**
-     * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
-     * without support for iteratee shorthands.
-     *
-     * @private
-     * @param {Array} array The array to query.
-     * @param {Function} predicate The function invoked per iteration.
-     * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Array} Returns the slice of `array`.
-     */
-    function baseWhile(array, predicate, isDrop, fromRight) {
-      var length = array.length,
-          index = fromRight ? length : -1;
-
-      while ((fromRight ? index-- : ++index < length) &&
-        predicate(array[index], index, array)) {}
-
-      return isDrop
-        ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
-        : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
-    }
-
-    /**
-     * The base implementation of `wrapperValue` which returns the result of
-     * performing a sequence of actions on the unwrapped `value`, where each
-     * successive action is supplied the return value of the previous.
-     *
-     * @private
-     * @param {*} value The unwrapped value.
-     * @param {Array} actions Actions to perform to resolve the unwrapped value.
-     * @returns {*} Returns the resolved value.
-     */
-    function baseWrapperValue(value, actions) {
-      var result = value;
-      if (result instanceof LazyWrapper) {
-        result = result.value();
-      }
-      return arrayReduce(actions, function(result, action) {
-        return action.func.apply(action.thisArg, arrayPush([result], action.args));
-      }, result);
-    }
-
-    /**
-     * The base implementation of methods like `_.xor`, without support for
-     * iteratee shorthands, that accepts an array of arrays to inspect.
-     *
-     * @private
-     * @param {Array} arrays The arrays to inspect.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of values.
-     */
-    function baseXor(arrays, iteratee, comparator) {
-      var index = -1,
-          length = arrays.length;
-
-      while (++index < length) {
-        var result = result
-          ? arrayPush(
-              baseDifference(result, arrays[index], iteratee, comparator),
-              baseDifference(arrays[index], result, iteratee, comparator)
-            )
-          : arrays[index];
-      }
-      return (result && result.length) ? baseUniq(result, iteratee, comparator) : [];
-    }
-
-    /**
-     * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
-     *
-     * @private
-     * @param {Array} props The property identifiers.
-     * @param {Array} values The property values.
-     * @param {Function} assignFunc The function to assign values.
-     * @returns {Object} Returns the new object.
-     */
-    function baseZipObject(props, values, assignFunc) {
-      var index = -1,
-          length = props.length,
-          valsLength = values.length,
-          result = {};
-
-      while (++index < length) {
-        var value = index < valsLength ? values[index] : undefined;
-        assignFunc(result, props[index], value);
-      }
-      return result;
-    }
-
-    /**
-     * Casts `value` to an empty array if it's not an array like object.
-     *
-     * @private
-     * @param {*} value The value to inspect.
-     * @returns {Array|Object} Returns the cast array-like object.
-     */
-    function castArrayLikeObject(value) {
-      return isArrayLikeObject(value) ? value : [];
-    }
-
-    /**
-     * Casts `value` to `identity` if it's not a function.
-     *
-     * @private
-     * @param {*} value The value to inspect.
-     * @returns {Function} Returns cast function.
-     */
-    function castFunction(value) {
-      return typeof value == 'function' ? value : identity;
-    }
-
-    /**
-     * Casts `value` to a path array if it's not one.
-     *
-     * @private
-     * @param {*} value The value to inspect.
-     * @returns {Array} Returns the cast property path array.
-     */
-    function castPath(value) {
-      return isArray(value) ? value : stringToPath(value);
-    }
-
-    /**
-     * Casts `array` to a slice if it's needed.
-     *
-     * @private
-     * @param {Array} array The array to inspect.
-     * @param {number} start The start position.
-     * @param {number} [end=array.length] The end position.
-     * @returns {Array} Returns the cast slice.
-     */
-    function castSlice(array, start, end) {
-      var length = array.length;
-      end = end === undefined ? length : end;
-      return (!start && end >= length) ? array : baseSlice(array, start, end);
-    }
-
-    /**
-     * Creates a clone of  `buffer`.
-     *
-     * @private
-     * @param {Buffer} buffer The buffer to clone.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Buffer} Returns the cloned buffer.
-     */
-    function cloneBuffer(buffer, isDeep) {
-      if (isDeep) {
-        return buffer.slice();
-      }
-      var result = new buffer.constructor(buffer.length);
-      buffer.copy(result);
-      return result;
-    }
-
-    /**
-     * Creates a clone of `arrayBuffer`.
-     *
-     * @private
-     * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
-     * @returns {ArrayBuffer} Returns the cloned array buffer.
-     */
-    function cloneArrayBuffer(arrayBuffer) {
-      var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
-      new Uint8Array(result).set(new Uint8Array(arrayBuffer));
-      return result;
-    }
-
-    /**
-     * Creates a clone of `dataView`.
-     *
-     * @private
-     * @param {Object} dataView The data view to clone.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Object} Returns the cloned data view.
-     */
-    function cloneDataView(dataView, isDeep) {
-      var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
-      return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
-    }
-
-    /**
-     * Creates a clone of `map`.
-     *
-     * @private
-     * @param {Object} map The map to clone.
-     * @param {Function} cloneFunc The function to clone values.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Object} Returns the cloned map.
-     */
-    function cloneMap(map, isDeep, cloneFunc) {
-      var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
-      return arrayReduce(array, addMapEntry, new map.constructor);
-    }
-
-    /**
-     * Creates a clone of `regexp`.
-     *
-     * @private
-     * @param {Object} regexp The regexp to clone.
-     * @returns {Object} Returns the cloned regexp.
-     */
-    function cloneRegExp(regexp) {
-      var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
-      result.lastIndex = regexp.lastIndex;
-      return result;
-    }
-
-    /**
-     * Creates a clone of `set`.
-     *
-     * @private
-     * @param {Object} set The set to clone.
-     * @param {Function} cloneFunc The function to clone values.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Object} Returns the cloned set.
-     */
-    function cloneSet(set, isDeep, cloneFunc) {
-      var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
-      return arrayReduce(array, addSetEntry, new set.constructor);
-    }
-
-    /**
-     * Creates a clone of the `symbol` object.
-     *
-     * @private
-     * @param {Object} symbol The symbol object to clone.
-     * @returns {Object} Returns the cloned symbol object.
-     */
-    function cloneSymbol(symbol) {
-      return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
-    }
-
-    /**
-     * Creates a clone of `typedArray`.
-     *
-     * @private
-     * @param {Object} typedArray The typed array to clone.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Object} Returns the cloned typed array.
-     */
-    function cloneTypedArray(typedArray, isDeep) {
-      var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
-      return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
-    }
-
-    /**
-     * Compares values to sort them in ascending order.
-     *
-     * @private
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {number} Returns the sort order indicator for `value`.
-     */
-    function compareAscending(value, other) {
-      if (value !== other) {
-        var valIsDefined = value !== undefined,
-            valIsNull = value === null,
-            valIsReflexive = value === value,
-            valIsSymbol = isSymbol(value);
-
-        var othIsDefined = other !== undefined,
-            othIsNull = other === null,
-            othIsReflexive = other === other,
-            othIsSymbol = isSymbol(other);
-
-        if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
-            (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
-            (valIsNull && othIsDefined && othIsReflexive) ||
-            (!valIsDefined && othIsReflexive) ||
-            !valIsReflexive) {
-          return 1;
-        }
-        if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
-            (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
-            (othIsNull && valIsDefined && valIsReflexive) ||
-            (!othIsDefined && valIsReflexive) ||
-            !othIsReflexive) {
-          return -1;
-        }
-      }
-      return 0;
-    }
-
-    /**
-     * Used by `_.orderBy` to compare multiple properties of a value to another
-     * and stable sort them.
-     *
-     * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
-     * specify an order of "desc" for descending or "asc" for ascending sort order
-     * of corresponding values.
-     *
-     * @private
-     * @param {Object} object The object to compare.
-     * @param {Object} other The other object to compare.
-     * @param {boolean[]|string[]} orders The order to sort by for each property.
-     * @returns {number} Returns the sort order indicator for `object`.
-     */
-    function compareMultiple(object, other, orders) {
-      var index = -1,
-          objCriteria = object.criteria,
-          othCriteria = other.criteria,
-          length = objCriteria.length,
-          ordersLength = orders.length;
-
-      while (++index < length) {
-        var result = compareAscending(objCriteria[index], othCriteria[index]);
-        if (result) {
-          if (index >= ordersLength) {
-            return result;
-          }
-          var order = orders[index];
-          return result * (order == 'desc' ? -1 : 1);
-        }
-      }
-      // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
-      // that causes it, under certain circumstances, to provide the same value for
-      // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
-      // for more details.
-      //
-      // This also ensures a stable sort in V8 and other engines.
-      // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
-      return object.index - other.index;
-    }
-
-    /**
-     * Creates an array that is the composition of partially applied arguments,
-     * placeholders, and provided arguments into a single array of arguments.
-     *
-     * @private
-     * @param {Array|Object} args The provided arguments.
-     * @param {Array} partials The arguments to prepend to those provided.
-     * @param {Array} holders The `partials` placeholder indexes.
-     * @params {boolean} [isCurried] Specify composing for a curried function.
-     * @returns {Array} Returns the new array of composed arguments.
-     */
-    function composeArgs(args, partials, holders, isCurried) {
-      var argsIndex = -1,
-          argsLength = args.length,
-          holdersLength = holders.length,
-          leftIndex = -1,
-          leftLength = partials.length,
-          rangeLength = nativeMax(argsLength - holdersLength, 0),
-          result = Array(leftLength + rangeLength),
-          isUncurried = !isCurried;
-
-      while (++leftIndex < leftLength) {
-        result[leftIndex] = partials[leftIndex];
-      }
-      while (++argsIndex < holdersLength) {
-        if (isUncurried || argsIndex < argsLength) {
-          result[holders[argsIndex]] = args[argsIndex];
-        }
-      }
-      while (rangeLength--) {
-        result[leftIndex++] = args[argsIndex++];
-      }
-      return result;
-    }
-
-    /**
-     * This function is like `composeArgs` except that the arguments composition
-     * is tailored for `_.partialRight`.
-     *
-     * @private
-     * @param {Array|Object} args The provided arguments.
-     * @param {Array} partials The arguments to append to those provided.
-     * @param {Array} holders The `partials` placeholder indexes.
-     * @params {boolean} [isCurried] Specify composing for a curried function.
-     * @returns {Array} Returns the new array of composed arguments.
-     */
-    function composeArgsRight(args, partials, holders, isCurried) {
-      var argsIndex = -1,
-          argsLength = args.length,
-          holdersIndex = -1,
-          holdersLength = holders.length,
-          rightIndex = -1,
-          rightLength = partials.length,
-          rangeLength = nativeMax(argsLength - holdersLength, 0),
-          result = Array(rangeLength + rightLength),
-          isUncurried = !isCurried;
-
-      while (++argsIndex < rangeLength) {
-        result[argsIndex] = args[argsIndex];
-      }
-      var offset = argsIndex;
-      while (++rightIndex < rightLength) {
-        result[offset + rightIndex] = partials[rightIndex];
-      }
-      while (++holdersIndex < holdersLength) {
-        if (isUncurried || argsIndex < argsLength) {
-          result[offset + holders[holdersIndex]] = args[argsIndex++];
-        }
-      }
-      return result;
-    }
-
-    /**
-     * Copies the values of `source` to `array`.
-     *
-     * @private
-     * @param {Array} source The array to copy values from.
-     * @param {Array} [array=[]] The array to copy values to.
-     * @returns {Array} Returns `array`.
-     */
-    function copyArray(source, array) {
-      var index = -1,
-          length = source.length;
-
-      array || (array = Array(length));
-      while (++index < length) {
-        array[index] = source[index];
-      }
-      return array;
-    }
-
-    /**
-     * Copies properties of `source` to `object`.
-     *
-     * @private
-     * @param {Object} source The object to copy properties from.
-     * @param {Array} props The property identifiers to copy.
-     * @param {Object} [object={}] The object to copy properties to.
-     * @param {Function} [customizer] The function to customize copied values.
-     * @returns {Object} Returns `object`.
-     */
-    function copyObject(source, props, object, customizer) {
-      object || (object = {});
-
-      var index = -1,
-          length = props.length;
-
-      while (++index < length) {
-        var key = props[index];
-
-        var newValue = customizer
-          ? customizer(object[key], source[key], key, object, source)
-          : source[key];
-
-        assignValue(object, key, newValue);
-      }
-      return object;
-    }
-
-    /**
-     * Copies own symbol properties of `source` to `object`.
-     *
-     * @private
-     * @param {Object} source The object to copy symbols from.
-     * @param {Object} [object={}] The object to copy symbols to.
-     * @returns {Object} Returns `object`.
-     */
-    function copySymbols(source, object) {
-      return copyObject(source, getSymbols(source), object);
-    }
-
-    /**
-     * Creates a function like `_.groupBy`.
-     *
-     * @private
-     * @param {Function} setter The function to set accumulator values.
-     * @param {Function} [initializer] The accumulator object initializer.
-     * @returns {Function} Returns the new aggregator function.
-     */
-    function createAggregator(setter, initializer) {
-      return function(collection, iteratee) {
-        var func = isArray(collection) ? arrayAggregator : baseAggregator,
-            accumulator = initializer ? initializer() : {};
-
-        return func(collection, setter, getIteratee(iteratee), accumulator);
-      };
-    }
-
-    /**
-     * Creates a function like `_.assign`.
-     *
-     * @private
-     * @param {Function} assigner The function to assign values.
-     * @returns {Function} Returns the new assigner function.
-     */
-    function createAssigner(assigner) {
-      return rest(function(object, sources) {
-        var index = -1,
-            length = sources.length,
-            customizer = length > 1 ? sources[length - 1] : undefined,
-            guard = length > 2 ? sources[2] : undefined;
-
-        customizer = typeof customizer == 'function'
-          ? (length--, customizer)
-          : undefined;
-
-        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
-          customizer = length < 3 ? undefined : customizer;
-          length = 1;
-        }
-        object = Object(object);
-        while (++index < length) {
-          var source = sources[index];
-          if (source) {
-            assigner(object, source, index, customizer);
-          }
-        }
-        return object;
-      });
-    }
-
-    /**
-     * Creates a `baseEach` or `baseEachRight` function.
-     *
-     * @private
-     * @param {Function} eachFunc The function to iterate over a collection.
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Function} Returns the new base function.
-     */
-    function createBaseEach(eachFunc, fromRight) {
-      return function(collection, iteratee) {
-        if (collection == null) {
-          return collection;
-        }
-        if (!isArrayLike(collection)) {
-          return eachFunc(collection, iteratee);
-        }
-        var length = collection.length,
-            index = fromRight ? length : -1,
-            iterable = Object(collection);
-
-        while ((fromRight ? index-- : ++index < length)) {
-          if (iteratee(iterable[index], index, iterable) === false) {
-            break;
-          }
-        }
-        return collection;
-      };
-    }
-
-    /**
-     * Creates a base function for methods like `_.forIn` and `_.forOwn`.
-     *
-     * @private
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Function} Returns the new base function.
-     */
-    function createBaseFor(fromRight) {
-      return function(object, iteratee, keysFunc) {
-        var index = -1,
-            iterable = Object(object),
-            props = keysFunc(object),
-            length = props.length;
-
-        while (length--) {
-          var key = props[fromRight ? length : ++index];
-          if (iteratee(iterable[key], key, iterable) === false) {
-            break;
-          }
-        }
-        return object;
-      };
-    }
-
-    /**
-     * Creates a function that wraps `func` to invoke it with the optional `this`
-     * binding of `thisArg`.
-     *
-     * @private
-     * @param {Function} func The function to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
-     *  for more details.
-     * @param {*} [thisArg] The `this` binding of `func`.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createBaseWrapper(func, bitmask, thisArg) {
-      var isBind = bitmask & BIND_FLAG,
-          Ctor = createCtorWrapper(func);
-
-      function wrapper() {
-        var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
-        return fn.apply(isBind ? thisArg : this, arguments);
-      }
-      return wrapper;
-    }
-
-    /**
-     * Creates a function like `_.lowerFirst`.
-     *
-     * @private
-     * @param {string} methodName The name of the `String` case method to use.
-     * @returns {Function} Returns the new function.
-     */
-    function createCaseFirst(methodName) {
-      return function(string) {
-        string = toString(string);
-
-        var strSymbols = reHasComplexSymbol.test(string)
-          ? stringToArray(string)
-          : undefined;
-
-        var chr = strSymbols
-          ? strSymbols[0]
-          : string.charAt(0);
-
-        var trailing = strSymbols
-          ? castSlice(strSymbols, 1).join('')
-          : string.slice(1);
-
-        return chr[methodName]() + trailing;
-      };
-    }
-
-    /**
-     * Creates a function like `_.camelCase`.
-     *
-     * @private
-     * @param {Function} callback The function to combine each word.
-     * @returns {Function} Returns the new compounder function.
-     */
-    function createCompounder(callback) {
-      return function(string) {
-        return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
-      };
-    }
-
-    /**
-     * Creates a function that produces an instance of `Ctor` regardless of
-     * whether it was invoked as part of a `new` expression or by `call` or `apply`.
-     *
-     * @private
-     * @param {Function} Ctor The constructor to wrap.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createCtorWrapper(Ctor) {
-      return function() {
-        // Use a `switch` statement to work with class constructors. See
-        // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
-        // for more details.
-        var args = arguments;
-        switch (args.length) {
-          case 0: return new Ctor;
-          case 1: return new Ctor(args[0]);
-          case 2: return new Ctor(args[0], args[1]);
-          case 3: return new Ctor(args[0], args[1], args[2]);
-          case 4: return new Ctor(args[0], args[1], args[2], args[3]);
-          case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
-          case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
-          case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
-        }
-        var thisBinding = baseCreate(Ctor.prototype),
-            result = Ctor.apply(thisBinding, args);
-
-        // Mimic the constructor's `return` behavior.
-        // See https://es5.github.io/#x13.2.2 for more details.
-        return isObject(result) ? result : thisBinding;
-      };
-    }
-
-    /**
-     * Creates a function that wraps `func` to enable currying.
-     *
-     * @private
-     * @param {Function} func The function to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
-     *  for more details.
-     * @param {number} arity The arity of `func`.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createCurryWrapper(func, bitmask, arity) {
-      var Ctor = createCtorWrapper(func);
-
-      function wrapper() {
-        var length = arguments.length,
-            args = Array(length),
-            index = length,
-            placeholder = getPlaceholder(wrapper);
-
-        while (index--) {
-          args[index] = arguments[index];
-        }
-        var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
-          ? []
-          : replaceHolders(args, placeholder);
-
-        length -= holders.length;
-        if (length < arity) {
-          return createRecurryWrapper(
-            func, bitmask, createHybridWrapper, wrapper.placeholder, undefined,
-            args, holders, undefined, undefined, arity - length);
-        }
-        var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
-        return apply(fn, this, args);
-      }
-      return wrapper;
-    }
-
-    /**
-     * Creates a `_.flow` or `_.flowRight` function.
-     *
-     * @private
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Function} Returns the new flow function.
-     */
-    function createFlow(fromRight) {
-      return rest(function(funcs) {
-        funcs = baseFlatten(funcs, 1);
-
-        var length = funcs.length,
-            index = length,
-            prereq = LodashWrapper.prototype.thru;
-
-        if (fromRight) {
-          funcs.reverse();
-        }
-        while (index--) {
-          var func = funcs[index];
-          if (typeof func != 'function') {
-            throw new TypeError(FUNC_ERROR_TEXT);
-          }
-          if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
-            var wrapper = new LodashWrapper([], true);
-          }
-        }
-        index = wrapper ? index : length;
-        while (++index < length) {
-          func = funcs[index];
-
-          var funcName = getFuncName(func),
-              data = funcName == 'wrapper' ? getData(func) : undefined;
-
-          if (data && isLaziable(data[0]) &&
-                data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) &&
-                !data[4].length && data[9] == 1
-              ) {
-            wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
-          } else {
-            wrapper = (func.length == 1 && isLaziable(func))
-              ? wrapper[funcName]()
-              : wrapper.thru(func);
-          }
-        }
-        return function() {
-          var args = arguments,
-              value = args[0];
-
-          if (wrapper && args.length == 1 &&
-              isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
-            return wrapper.plant(value).value();
-          }
-          var index = 0,
-              result = length ? funcs[index].apply(this, args) : value;
-
-          while (++index < length) {
-            result = funcs[index].call(this, result);
-          }
-          return result;
-        };
-      });
-    }
-
-    /**
-     * Creates a function that wraps `func` to invoke it with optional `this`
-     * binding of `thisArg`, partial application, and currying.
-     *
-     * @private
-     * @param {Function|string} func The function or method name to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
-     *  for more details.
-     * @param {*} [thisArg] The `this` binding of `func`.
-     * @param {Array} [partials] The arguments to prepend to those provided to
-     *  the new function.
-     * @param {Array} [holders] The `partials` placeholder indexes.
-     * @param {Array} [partialsRight] The arguments to append to those provided
-     *  to the new function.
-     * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
-     * @param {Array} [argPos] The argument positions of the new function.
-     * @param {number} [ary] The arity cap of `func`.
-     * @param {number} [arity] The arity of `func`.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
-      var isAry = bitmask & ARY_FLAG,
-          isBind = bitmask & BIND_FLAG,
-          isBindKey = bitmask & BIND_KEY_FLAG,
-          isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG),
-          isFlip = bitmask & FLIP_FLAG,
-          Ctor = isBindKey ? undefined : createCtorWrapper(func);
-
-      function wrapper() {
-        var length = arguments.length,
-            index = length,
-            args = Array(length);
-
-        while (index--) {
-          args[index] = arguments[index];
-        }
-        if (isCurried) {
-          var placeholder = getPlaceholder(wrapper),
-              holdersCount = countHolders(args, placeholder);
-        }
-        if (partials) {
-          args = composeArgs(args, partials, holders, isCurried);
-        }
-        if (partialsRight) {
-          args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
-        }
-        length -= holdersCount;
-        if (isCurried && length < arity) {
-          var newHolders = replaceHolders(args, placeholder);
-          return createRecurryWrapper(
-            func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg,
-            args, newHolders, argPos, ary, arity - length
-          );
-        }
-        var thisBinding = isBind ? thisArg : this,
-            fn = isBindKey ? thisBinding[func] : func;
-
-        length = args.length;
-        if (argPos) {
-          args = reorder(args, argPos);
-        } else if (isFlip && length > 1) {
-          args.reverse();
-        }
-        if (isAry && ary < length) {
-          args.length = ary;
-        }
-        if (this && this !== root && this instanceof wrapper) {
-          fn = Ctor || createCtorWrapper(fn);
-        }
-        return fn.apply(thisBinding, args);
-      }
-      return wrapper;
-    }
-
-    /**
-     * Creates a function like `_.invertBy`.
-     *
-     * @private
-     * @param {Function} setter The function to set accumulator values.
-     * @param {Function} toIteratee The function to resolve iteratees.
-     * @returns {Function} Returns the new inverter function.
-     */
-    function createInverter(setter, toIteratee) {
-      return function(object, iteratee) {
-        return baseInverter(object, setter, toIteratee(iteratee), {});
-      };
-    }
-
-    /**
-     * Creates a function that performs a mathematical operation on two values.
-     *
-     * @private
-     * @param {Function} operator The function to perform the operation.
-     * @returns {Function} Returns the new mathematical operation function.
-     */
-    function createMathOperation(operator) {
-      return function(value, other) {
-        var result;
-        if (value === undefined && other === undefined) {
-          return 0;
-        }
-        if (value !== undefined) {
-          result = value;
-        }
-        if (other !== undefined) {
-          if (result === undefined) {
-            return other;
-          }
-          if (typeof value == 'string' || typeof other == 'string') {
-            value = baseToString(value);
-            other = baseToString(other);
-          } else {
-            value = baseToNumber(value);
-            other = baseToNumber(other);
-          }
-          result = operator(value, other);
-        }
-        return result;
-      };
-    }
-
-    /**
-     * Creates a function like `_.over`.
-     *
-     * @private
-     * @param {Function} arrayFunc The function to iterate over iteratees.
-     * @returns {Function} Returns the new invoker function.
-     */
-    function createOver(arrayFunc) {
-      return rest(function(iteratees) {
-        iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
-          ? arrayMap(iteratees[0], baseUnary(getIteratee()))
-          : arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseUnary(getIteratee()));
-
-        return rest(function(args) {
-          var thisArg = this;
-          return arrayFunc(iteratees, function(iteratee) {
-            return apply(iteratee, thisArg, args);
-          });
-        });
-      });
-    }
-
-    /**
-     * Creates the padding for `string` based on `length`. The `chars` string
-     * is truncated if the number of characters exceeds `length`.
-     *
-     * @private
-     * @param {number} length The padding length.
-     * @param {string} [chars=' '] The string used as padding.
-     * @returns {string} Returns the padding for `string`.
-     */
-    function createPadding(length, chars) {
-      chars = chars === undefined ? ' ' : baseToString(chars);
-
-      var charsLength = chars.length;
-      if (charsLength < 2) {
-        return charsLength ? baseRepeat(chars, length) : chars;
-      }
-      var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
-      return reHasComplexSymbol.test(chars)
-        ? castSlice(stringToArray(result), 0, length).join('')
-        : result.slice(0, length);
-    }
-
-    /**
-     * Creates a function that wraps `func` to invoke it with the `this` binding
-     * of `thisArg` and `partials` prepended to the arguments it receives.
-     *
-     * @private
-     * @param {Function} func The function to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
-     *  for more details.
-     * @param {*} thisArg The `this` binding of `func`.
-     * @param {Array} partials The arguments to prepend to those provided to
-     *  the new function.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createPartialWrapper(func, bitmask, thisArg, partials) {
-      var isBind = bitmask & BIND_FLAG,
-          Ctor = createCtorWrapper(func);
-
-      function wrapper() {
-        var argsIndex = -1,
-            argsLength = arguments.length,
-            leftIndex = -1,
-            leftLength = partials.length,
-            args = Array(leftLength + argsLength),
-            fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
-
-        while (++leftIndex < leftLength) {
-          args[leftIndex] = partials[leftIndex];
-        }
-        while (argsLength--) {
-          args[leftIndex++] = arguments[++argsIndex];
-        }
-        return apply(fn, isBind ? thisArg : this, args);
-      }
-      return wrapper;
-    }
-
-    /**
-     * Creates a `_.range` or `_.rangeRight` function.
-     *
-     * @private
-     * @param {boolean} [fromRight] Specify iterating from right to left.
-     * @returns {Function} Returns the new range function.
-     */
-    function createRange(fromRight) {
-      return function(start, end, step) {
-        if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
-          end = step = undefined;
-        }
-        // Ensure the sign of `-0` is preserved.
-        start = toNumber(start);
-        start = start === start ? start : 0;
-        if (end === undefined) {
-          end = start;
-          start = 0;
-        } else {
-          end = toNumber(end) || 0;
-        }
-        step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);
-        return baseRange(start, end, step, fromRight);
-      };
-    }
-
-    /**
-     * Creates a function that performs a relational operation on two values.
-     *
-     * @private
-     * @param {Function} operator The function to perform the operation.
-     * @returns {Function} Returns the new relational operation function.
-     */
-    function createRelationalOperation(operator) {
-      return function(value, other) {
-        if (!(typeof value == 'string' && typeof other == 'string')) {
-          value = toNumber(value);
-          other = toNumber(other);
-        }
-        return operator(value, other);
-      };
-    }
-
-    /**
-     * Creates a function that wraps `func` to continue currying.
-     *
-     * @private
-     * @param {Function} func The function to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper`
-     *  for more details.
-     * @param {Function} wrapFunc The function to create the `func` wrapper.
-     * @param {*} placeholder The placeholder value.
-     * @param {*} [thisArg] The `this` binding of `func`.
-     * @param {Array} [partials] The arguments to prepend to those provided to
-     *  the new function.
-     * @param {Array} [holders] The `partials` placeholder indexes.
-     * @param {Array} [argPos] The argument positions of the new function.
-     * @param {number} [ary] The arity cap of `func`.
-     * @param {number} [arity] The arity of `func`.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
-      var isCurry = bitmask & CURRY_FLAG,
-          newHolders = isCurry ? holders : undefined,
-          newHoldersRight = isCurry ? undefined : holders,
-          newPartials = isCurry ? partials : undefined,
-          newPartialsRight = isCurry ? undefined : partials;
-
-      bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
-      bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
-
-      if (!(bitmask & CURRY_BOUND_FLAG)) {
-        bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
-      }
-      var newData = [
-        func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
-        newHoldersRight, argPos, ary, arity
-      ];
-
-      var result = wrapFunc.apply(undefined, newData);
-      if (isLaziable(func)) {
-        setData(result, newData);
-      }
-      result.placeholder = placeholder;
-      return result;
-    }
-
-    /**
-     * Creates a function like `_.round`.
-     *
-     * @private
-     * @param {string} methodName The name of the `Math` method to use when rounding.
-     * @returns {Function} Returns the new round function.
-     */
-    function createRound(methodName) {
-      var func = Math[methodName];
-      return function(number, precision) {
-        number = toNumber(number);
-        precision = toInteger(precision);
-        if (precision) {
-          // Shift with exponential notation to avoid floating-point issues.
-          // See [MDN](https://mdn.io/round#Examples) for more details.
-          var pair = (toString(number) + 'e').split('e'),
-              value = func(pair[0] + 'e' + (+pair[1] + precision));
-
-          pair = (toString(value) + 'e').split('e');
-          return +(pair[0] + 'e' + (+pair[1] - precision));
-        }
-        return func(number);
-      };
-    }
-
-    /**
-     * Creates a set of `values`.
-     *
-     * @private
-     * @param {Array} values The values to add to the set.
-     * @returns {Object} Returns the new set.
-     */
-    var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
-      return new Set(values);
-    };
-
-    /**
-     * Creates a function that either curries or invokes `func` with optional
-     * `this` binding and partially applied arguments.
-     *
-     * @private
-     * @param {Function|string} func The function or method name to wrap.
-     * @param {number} bitmask The bitmask of wrapper flags.
-     *  The bitmask may be composed of the following flags:
-     *     1 - `_.bind`
-     *     2 - `_.bindKey`
-     *     4 - `_.curry` or `_.curryRight` of a bound function
-     *     8 - `_.curry`
-     *    16 - `_.curryRight`
-     *    32 - `_.partial`
-     *    64 - `_.partialRight`
-     *   128 - `_.rearg`
-     *   256 - `_.ary`
-     * @param {*} [thisArg] The `this` binding of `func`.
-     * @param {Array} [partials] The arguments to be partially applied.
-     * @param {Array} [holders] The `partials` placeholder indexes.
-     * @param {Array} [argPos] The argument positions of the new function.
-     * @param {number} [ary] The arity cap of `func`.
-     * @param {number} [arity] The arity of `func`.
-     * @returns {Function} Returns the new wrapped function.
-     */
-    function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
-      var isBindKey = bitmask & BIND_KEY_FLAG;
-      if (!isBindKey && typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      var length = partials ? partials.length : 0;
-      if (!length) {
-        bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
-        partials = holders = undefined;
-      }
-      ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
-      arity = arity === undefined ? arity : toInteger(arity);
-      length -= holders ? holders.length : 0;
-
-      if (bitmask & PARTIAL_RIGHT_FLAG) {
-        var partialsRight = partials,
-            holdersRight = holders;
-
-        partials = holders = undefined;
-      }
-      var data = isBindKey ? undefined : getData(func);
-
-      var newData = [
-        func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
-        argPos, ary, arity
-      ];
-
-      if (data) {
-        mergeData(newData, data);
-      }
-      func = newData[0];
-      bitmask = newData[1];
-      thisArg = newData[2];
-      partials = newData[3];
-      holders = newData[4];
-      arity = newData[9] = newData[9] == null
-        ? (isBindKey ? 0 : func.length)
-        : nativeMax(newData[9] - length, 0);
-
-      if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) {
-        bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG);
-      }
-      if (!bitmask || bitmask == BIND_FLAG) {
-        var result = createBaseWrapper(func, bitmask, thisArg);
-      } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) {
-        result = createCurryWrapper(func, bitmask, arity);
-      } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) {
-        result = createPartialWrapper(func, bitmask, thisArg, partials);
-      } else {
-        result = createHybridWrapper.apply(undefined, newData);
-      }
-      var setter = data ? baseSetData : setData;
-      return setter(result, newData);
-    }
-
-    /**
-     * A specialized version of `baseIsEqualDeep` for arrays with support for
-     * partial deep comparisons.
-     *
-     * @private
-     * @param {Array} array The array to compare.
-     * @param {Array} other The other array to compare.
-     * @param {Function} equalFunc The function to determine equivalents of values.
-     * @param {Function} customizer The function to customize comparisons.
-     * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
-     *  for more details.
-     * @param {Object} stack Tracks traversed `array` and `other` objects.
-     * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
-     */
-    function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
-      var index = -1,
-          isPartial = bitmask & PARTIAL_COMPARE_FLAG,
-          isUnordered = bitmask & UNORDERED_COMPARE_FLAG,
-          arrLength = array.length,
-          othLength = other.length;
-
-      if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
-        return false;
-      }
-      // Assume cyclic values are equal.
-      var stacked = stack.get(array);
-      if (stacked) {
-        return stacked == other;
-      }
-      var result = true;
-      stack.set(array, other);
-
-      // Ignore non-index properties.
-      while (++index < arrLength) {
-        var arrValue = array[index],
-            othValue = other[index];
-
-        if (customizer) {
-          var compared = isPartial
-            ? customizer(othValue, arrValue, index, other, array, stack)
-            : customizer(arrValue, othValue, index, array, other, stack);
-        }
-        if (compared !== undefined) {
-          if (compared) {
-            continue;
-          }
-          result = false;
-          break;
-        }
-        // Recursively compare arrays (susceptible to call stack limits).
-        if (isUnordered) {
-          if (!arraySome(other, function(othValue) {
-                return arrValue === othValue ||
-                  equalFunc(arrValue, othValue, customizer, bitmask, stack);
-              })) {
-            result = false;
-            break;
-          }
-        } else if (!(
-              arrValue === othValue ||
-                equalFunc(arrValue, othValue, customizer, bitmask, stack)
-            )) {
-          result = false;
-          break;
-        }
-      }
-      stack['delete'](array);
-      return result;
-    }
-
-    /**
-     * A specialized version of `baseIsEqualDeep` for comparing objects of
-     * the same `toStringTag`.
-     *
-     * **Note:** This function only supports comparing values with tags of
-     * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
-     *
-     * @private
-     * @param {Object} object The object to compare.
-     * @param {Object} other The other object to compare.
-     * @param {string} tag The `toStringTag` of the objects to compare.
-     * @param {Function} equalFunc The function to determine equivalents of values.
-     * @param {Function} customizer The function to customize comparisons.
-     * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
-     *  for more details.
-     * @param {Object} stack Tracks traversed `object` and `other` objects.
-     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
-     */
-    function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
-      switch (tag) {
-        case dataViewTag:
-          if ((object.byteLength != other.byteLength) ||
-              (object.byteOffset != other.byteOffset)) {
-            return false;
-          }
-          object = object.buffer;
-          other = other.buffer;
-
-        case arrayBufferTag:
-          if ((object.byteLength != other.byteLength) ||
-              !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
-            return false;
-          }
-          return true;
-
-        case boolTag:
-        case dateTag:
-          // Coerce dates and booleans to numbers, dates to milliseconds and
-          // booleans to `1` or `0` treating invalid dates coerced to `NaN` as
-          // not equal.
-          return +object == +other;
-
-        case errorTag:
-          return object.name == other.name && object.message == other.message;
-
-        case numberTag:
-          // Treat `NaN` vs. `NaN` as equal.
-          return (object != +object) ? other != +other : object == +other;
-
-        case regexpTag:
-        case stringTag:
-          // Coerce regexes to strings and treat strings, primitives and objects,
-          // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring
-          // for more details.
-          return object == (other + '');
-
-        case mapTag:
-          var convert = mapToArray;
-
-        case setTag:
-          var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
-          convert || (convert = setToArray);
-
-          if (object.size != other.size && !isPartial) {
-            return false;
-          }
-          // Assume cyclic values are equal.
-          var stacked = stack.get(object);
-          if (stacked) {
-            return stacked == other;
-          }
-          bitmask |= UNORDERED_COMPARE_FLAG;
-          stack.set(object, other);
-
-          // Recursively compare objects (susceptible to call stack limits).
-          return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
-
-        case symbolTag:
-          if (symbolValueOf) {
-            return symbolValueOf.call(object) == symbolValueOf.call(other);
-          }
-      }
-      return false;
-    }
-
-    /**
-     * A specialized version of `baseIsEqualDeep` for objects with support for
-     * partial deep comparisons.
-     *
-     * @private
-     * @param {Object} object The object to compare.
-     * @param {Object} other The other object to compare.
-     * @param {Function} equalFunc The function to determine equivalents of values.
-     * @param {Function} customizer The function to customize comparisons.
-     * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
-     *  for more details.
-     * @param {Object} stack Tracks traversed `object` and `other` objects.
-     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
-     */
-    function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
-      var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
-          objProps = keys(object),
-          objLength = objProps.length,
-          othProps = keys(other),
-          othLength = othProps.length;
-
-      if (objLength != othLength && !isPartial) {
-        return false;
-      }
-      var index = objLength;
-      while (index--) {
-        var key = objProps[index];
-        if (!(isPartial ? key in other : baseHas(other, key))) {
-          return false;
-        }
-      }
-      // Assume cyclic values are equal.
-      var stacked = stack.get(object);
-      if (stacked) {
-        return stacked == other;
-      }
-      var result = true;
-      stack.set(object, other);
-
-      var skipCtor = isPartial;
-      while (++index < objLength) {
-        key = objProps[index];
-        var objValue = object[key],
-            othValue = other[key];
-
-        if (customizer) {
-          var compared = isPartial
-            ? customizer(othValue, objValue, key, other, object, stack)
-            : customizer(objValue, othValue, key, object, other, stack);
-        }
-        // Recursively compare objects (susceptible to call stack limits).
-        if (!(compared === undefined
-              ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))
-              : compared
-            )) {
-          result = false;
-          break;
-        }
-        skipCtor || (skipCtor = key == 'constructor');
-      }
-      if (result && !skipCtor) {
-        var objCtor = object.constructor,
-            othCtor = other.constructor;
-
-        // Non `Object` object instances with different constructors are not equal.
-        if (objCtor != othCtor &&
-            ('constructor' in object && 'constructor' in other) &&
-            !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
-              typeof othCtor == 'function' && othCtor instanceof othCtor)) {
-          result = false;
-        }
-      }
-      stack['delete'](object);
-      return result;
-    }
-
-    /**
-     * Creates an array of own enumerable property names and symbols of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names and symbols.
-     */
-    function getAllKeys(object) {
-      return baseGetAllKeys(object, keys, getSymbols);
-    }
-
-    /**
-     * Creates an array of own and inherited enumerable property names and
-     * symbols of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names and symbols.
-     */
-    function getAllKeysIn(object) {
-      return baseGetAllKeys(object, keysIn, getSymbolsIn);
-    }
-
-    /**
-     * Gets metadata for `func`.
-     *
-     * @private
-     * @param {Function} func The function to query.
-     * @returns {*} Returns the metadata for `func`.
-     */
-    var getData = !metaMap ? noop : function(func) {
-      return metaMap.get(func);
-    };
-
-    /**
-     * Gets the name of `func`.
-     *
-     * @private
-     * @param {Function} func The function to query.
-     * @returns {string} Returns the function name.
-     */
-    function getFuncName(func) {
-      var result = (func.name + ''),
-          array = realNames[result],
-          length = hasOwnProperty.call(realNames, result) ? array.length : 0;
-
-      while (length--) {
-        var data = array[length],
-            otherFunc = data.func;
-        if (otherFunc == null || otherFunc == func) {
-          return data.name;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
-     * this function returns the custom method, otherwise it returns `baseIteratee`.
-     * If arguments are provided, the chosen function is invoked with them and
-     * its result is returned.
-     *
-     * @private
-     * @param {*} [value] The value to convert to an iteratee.
-     * @param {number} [arity] The arity of the created iteratee.
-     * @returns {Function} Returns the chosen function or its result.
-     */
-    function getIteratee() {
-      var result = lodash.iteratee || iteratee;
-      result = result === iteratee ? baseIteratee : result;
-      return arguments.length ? result(arguments[0], arguments[1]) : result;
-    }
-
-    /**
-     * Gets the "length" property value of `object`.
-     *
-     * **Note:** This function is used to avoid a
-     * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
-     * Safari on at least iOS 8.1-8.3 ARM64.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {*} Returns the "length" value.
-     */
-    var getLength = baseProperty('length');
-
-    /**
-     * Gets the property names, values, and compare flags of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the match data of `object`.
-     */
-    function getMatchData(object) {
-      var result = toPairs(object),
-          length = result.length;
-
-      while (length--) {
-        result[length][2] = isStrictComparable(result[length][1]);
-      }
-      return result;
-    }
-
-    /**
-     * Gets the native function at `key` of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {string} key The key of the method to get.
-     * @returns {*} Returns the function if it's native, else `undefined`.
-     */
-    function getNative(object, key) {
-      var value = object[key];
-      return isNative(value) ? value : undefined;
-    }
-
-    /**
-     * Gets the argument placeholder value for `func`.
-     *
-     * @private
-     * @param {Function} func The function to inspect.
-     * @returns {*} Returns the placeholder value.
-     */
-    function getPlaceholder(func) {
-      var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
-      return object.placeholder;
-    }
-
-    /**
-     * Gets the `[[Prototype]]` of `value`.
-     *
-     * @private
-     * @param {*} value The value to query.
-     * @returns {null|Object} Returns the `[[Prototype]]`.
-     */
-    function getPrototype(value) {
-      return nativeGetPrototype(Object(value));
-    }
-
-    /**
-     * Creates an array of the own enumerable symbol properties of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of symbols.
-     */
-    function getSymbols(object) {
-      // Coerce `object` to an object to avoid non-object errors in V8.
-      // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details.
-      return getOwnPropertySymbols(Object(object));
-    }
-
-    // Fallback for IE < 11.
-    if (!getOwnPropertySymbols) {
-      getSymbols = function() {
-        return [];
-      };
-    }
-
-    /**
-     * Creates an array of the own and inherited enumerable symbol properties
-     * of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of symbols.
-     */
-    var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) {
-      var result = [];
-      while (object) {
-        arrayPush(result, getSymbols(object));
-        object = getPrototype(object);
-      }
-      return result;
-    };
-
-    /**
-     * Gets the `toStringTag` of `value`.
-     *
-     * @private
-     * @param {*} value The value to query.
-     * @returns {string} Returns the `toStringTag`.
-     */
-    function getTag(value) {
-      return objectToString.call(value);
-    }
-
-    // Fallback for data views, maps, sets, and weak maps in IE 11,
-    // for data views in Edge, and promises in Node.js.
-    if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
-        (Map && getTag(new Map) != mapTag) ||
-        (Promise && getTag(Promise.resolve()) != promiseTag) ||
-        (Set && getTag(new Set) != setTag) ||
-        (WeakMap && getTag(new WeakMap) != weakMapTag)) {
-      getTag = function(value) {
-        var result = objectToString.call(value),
-            Ctor = result == objectTag ? value.constructor : undefined,
-            ctorString = Ctor ? toSource(Ctor) : undefined;
-
-        if (ctorString) {
-          switch (ctorString) {
-            case dataViewCtorString: return dataViewTag;
-            case mapCtorString: return mapTag;
-            case promiseCtorString: return promiseTag;
-            case setCtorString: return setTag;
-            case weakMapCtorString: return weakMapTag;
-          }
-        }
-        return result;
-      };
-    }
-
-    /**
-     * Gets the view, applying any `transforms` to the `start` and `end` positions.
-     *
-     * @private
-     * @param {number} start The start of the view.
-     * @param {number} end The end of the view.
-     * @param {Array} transforms The transformations to apply to the view.
-     * @returns {Object} Returns an object containing the `start` and `end`
-     *  positions of the view.
-     */
-    function getView(start, end, transforms) {
-      var index = -1,
-          length = transforms.length;
-
-      while (++index < length) {
-        var data = transforms[index],
-            size = data.size;
-
-        switch (data.type) {
-          case 'drop':      start += size; break;
-          case 'dropRight': end -= size; break;
-          case 'take':      end = nativeMin(end, start + size); break;
-          case 'takeRight': start = nativeMax(start, end - size); break;
-        }
-      }
-      return { 'start': start, 'end': end };
-    }
-
-    /**
-     * Checks if `path` exists on `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path to check.
-     * @param {Function} hasFunc The function to check properties.
-     * @returns {boolean} Returns `true` if `path` exists, else `false`.
-     */
-    function hasPath(object, path, hasFunc) {
-      path = isKey(path, object) ? [path] : castPath(path);
-
-      var result,
-          index = -1,
-          length = path.length;
-
-      while (++index < length) {
-        var key = toKey(path[index]);
-        if (!(result = object != null && hasFunc(object, key))) {
-          break;
-        }
-        object = object[key];
-      }
-      if (result) {
-        return result;
-      }
-      var length = object ? object.length : 0;
-      return !!length && isLength(length) && isIndex(key, length) &&
-        (isArray(object) || isString(object) || isArguments(object));
-    }
-
-    /**
-     * Initializes an array clone.
-     *
-     * @private
-     * @param {Array} array The array to clone.
-     * @returns {Array} Returns the initialized clone.
-     */
-    function initCloneArray(array) {
-      var length = array.length,
-          result = array.constructor(length);
-
-      // Add properties assigned by `RegExp#exec`.
-      if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
-        result.index = array.index;
-        result.input = array.input;
-      }
-      return result;
-    }
-
-    /**
-     * Initializes an object clone.
-     *
-     * @private
-     * @param {Object} object The object to clone.
-     * @returns {Object} Returns the initialized clone.
-     */
-    function initCloneObject(object) {
-      return (typeof object.constructor == 'function' && !isPrototype(object))
-        ? baseCreate(getPrototype(object))
-        : {};
-    }
-
-    /**
-     * Initializes an object clone based on its `toStringTag`.
-     *
-     * **Note:** This function only supports cloning values with tags of
-     * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
-     *
-     * @private
-     * @param {Object} object The object to clone.
-     * @param {string} tag The `toStringTag` of the object to clone.
-     * @param {Function} cloneFunc The function to clone values.
-     * @param {boolean} [isDeep] Specify a deep clone.
-     * @returns {Object} Returns the initialized clone.
-     */
-    function initCloneByTag(object, tag, cloneFunc, isDeep) {
-      var Ctor = object.constructor;
-      switch (tag) {
-        case arrayBufferTag:
-          return cloneArrayBuffer(object);
-
-        case boolTag:
-        case dateTag:
-          return new Ctor(+object);
-
-        case dataViewTag:
-          return cloneDataView(object, isDeep);
-
-        case float32Tag: case float64Tag:
-        case int8Tag: case int16Tag: case int32Tag:
-        case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
-          return cloneTypedArray(object, isDeep);
-
-        case mapTag:
-          return cloneMap(object, isDeep, cloneFunc);
-
-        case numberTag:
-        case stringTag:
-          return new Ctor(object);
-
-        case regexpTag:
-          return cloneRegExp(object);
-
-        case setTag:
-          return cloneSet(object, isDeep, cloneFunc);
-
-        case symbolTag:
-          return cloneSymbol(object);
-      }
-    }
-
-    /**
-     * Creates an array of index keys for `object` values of arrays,
-     * `arguments` objects, and strings, otherwise `null` is returned.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @returns {Array|null} Returns index keys, else `null`.
-     */
-    function indexKeys(object) {
-      var length = object ? object.length : undefined;
-      if (isLength(length) &&
-          (isArray(object) || isString(object) || isArguments(object))) {
-        return baseTimes(length, String);
-      }
-      return null;
-    }
-
-    /**
-     * Checks if `value` is a flattenable `arguments` object or array.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
-     */
-    function isFlattenable(value) {
-      return isArrayLikeObject(value) && (isArray(value) || isArguments(value));
-    }
-
-    /**
-     * Checks if `value` is a flattenable array and not a `_.matchesProperty`
-     * iteratee shorthand.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
-     */
-    function isFlattenableIteratee(value) {
-      return isArray(value) && !(value.length == 2 && !isFunction(value[0]));
-    }
-
-    /**
-     * Checks if `value` is a valid array-like index.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
-     * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
-     */
-    function isIndex(value, length) {
-      length = length == null ? MAX_SAFE_INTEGER : length;
-      return !!length &&
-        (typeof value == 'number' || reIsUint.test(value)) &&
-        (value > -1 && value % 1 == 0 && value < length);
-    }
-
-    /**
-     * Checks if the given arguments are from an iteratee call.
-     *
-     * @private
-     * @param {*} value The potential iteratee value argument.
-     * @param {*} index The potential iteratee index or key argument.
-     * @param {*} object The potential iteratee object argument.
-     * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
-     *  else `false`.
-     */
-    function isIterateeCall(value, index, object) {
-      if (!isObject(object)) {
-        return false;
-      }
-      var type = typeof index;
-      if (type == 'number'
-            ? (isArrayLike(object) && isIndex(index, object.length))
-            : (type == 'string' && index in object)
-          ) {
-        return eq(object[index], value);
-      }
-      return false;
-    }
-
-    /**
-     * Checks if `value` is a property name and not a property path.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @param {Object} [object] The object to query keys on.
-     * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
-     */
-    function isKey(value, object) {
-      if (isArray(value)) {
-        return false;
-      }
-      var type = typeof value;
-      if (type == 'number' || type == 'symbol' || type == 'boolean' ||
-          value == null || isSymbol(value)) {
-        return true;
-      }
-      return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
-        (object != null && value in Object(object));
-    }
-
-    /**
-     * Checks if `value` is suitable for use as unique object key.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
-     */
-    function isKeyable(value) {
-      var type = typeof value;
-      return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
-        ? (value !== '__proto__')
-        : (value === null);
-    }
-
-    /**
-     * Checks if `func` has a lazy counterpart.
-     *
-     * @private
-     * @param {Function} func The function to check.
-     * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
-     *  else `false`.
-     */
-    function isLaziable(func) {
-      var funcName = getFuncName(func),
-          other = lodash[funcName];
-
-      if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
-        return false;
-      }
-      if (func === other) {
-        return true;
-      }
-      var data = getData(other);
-      return !!data && func === data[0];
-    }
-
-    /**
-     * Checks if `value` is likely a prototype object.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
-     */
-    function isPrototype(value) {
-      var Ctor = value && value.constructor,
-          proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
-
-      return value === proto;
-    }
-
-    /**
-     * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
-     *
-     * @private
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` if suitable for strict
-     *  equality comparisons, else `false`.
-     */
-    function isStrictComparable(value) {
-      return value === value && !isObject(value);
-    }
-
-    /**
-     * A specialized version of `matchesProperty` for source values suitable
-     * for strict equality comparisons, i.e. `===`.
-     *
-     * @private
-     * @param {string} key The key of the property to get.
-     * @param {*} srcValue The value to match.
-     * @returns {Function} Returns the new function.
-     */
-    function matchesStrictComparable(key, srcValue) {
-      return function(object) {
-        if (object == null) {
-          return false;
-        }
-        return object[key] === srcValue &&
-          (srcValue !== undefined || (key in Object(object)));
-      };
-    }
-
-    /**
-     * Merges the function metadata of `source` into `data`.
-     *
-     * Merging metadata reduces the number of wrappers used to invoke a function.
-     * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
-     * may be applied regardless of execution order. Methods like `_.ary` and
-     * `_.rearg` modify function arguments, making the order in which they are
-     * executed important, preventing the merging of metadata. However, we make
-     * an exception for a safe combined case where curried functions have `_.ary`
-     * and or `_.rearg` applied.
-     *
-     * @private
-     * @param {Array} data The destination metadata.
-     * @param {Array} source The source metadata.
-     * @returns {Array} Returns `data`.
-     */
-    function mergeData(data, source) {
-      var bitmask = data[1],
-          srcBitmask = source[1],
-          newBitmask = bitmask | srcBitmask,
-          isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG);
-
-      var isCombo =
-        ((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) ||
-        ((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
-        ((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
-
-      // Exit early if metadata can't be merged.
-      if (!(isCommon || isCombo)) {
-        return data;
-      }
-      // Use source `thisArg` if available.
-      if (srcBitmask & BIND_FLAG) {
-        data[2] = source[2];
-        // Set when currying a bound function.
-        newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG;
-      }
-      // Compose partial arguments.
-      var value = source[3];
-      if (value) {
-        var partials = data[3];
-        data[3] = partials ? composeArgs(partials, value, source[4]) : value;
-        data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
-      }
-      // Compose partial right arguments.
-      value = source[5];
-      if (value) {
-        partials = data[5];
-        data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
-        data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
-      }
-      // Use source `argPos` if available.
-      value = source[7];
-      if (value) {
-        data[7] = value;
-      }
-      // Use source `ary` if it's smaller.
-      if (srcBitmask & ARY_FLAG) {
-        data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
-      }
-      // Use source `arity` if one is not provided.
-      if (data[9] == null) {
-        data[9] = source[9];
-      }
-      // Use source `func` and merge bitmasks.
-      data[0] = source[0];
-      data[1] = newBitmask;
-
-      return data;
-    }
-
-    /**
-     * Used by `_.defaultsDeep` to customize its `_.merge` use.
-     *
-     * @private
-     * @param {*} objValue The destination value.
-     * @param {*} srcValue The source value.
-     * @param {string} key The key of the property to merge.
-     * @param {Object} object The parent object of `objValue`.
-     * @param {Object} source The parent object of `srcValue`.
-     * @param {Object} [stack] Tracks traversed source values and their merged
-     *  counterparts.
-     * @returns {*} Returns the value to assign.
-     */
-    function mergeDefaults(objValue, srcValue, key, object, source, stack) {
-      if (isObject(objValue) && isObject(srcValue)) {
-        baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue));
-      }
-      return objValue;
-    }
-
-    /**
-     * Gets the parent value at `path` of `object`.
-     *
-     * @private
-     * @param {Object} object The object to query.
-     * @param {Array} path The path to get the parent value of.
-     * @returns {*} Returns the parent value.
-     */
-    function parent(object, path) {
-      return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
-    }
-
-    /**
-     * Reorder `array` according to the specified indexes where the element at
-     * the first index is assigned as the first element, the element at
-     * the second index is assigned as the second element, and so on.
-     *
-     * @private
-     * @param {Array} array The array to reorder.
-     * @param {Array} indexes The arranged array indexes.
-     * @returns {Array} Returns `array`.
-     */
-    function reorder(array, indexes) {
-      var arrLength = array.length,
-          length = nativeMin(indexes.length, arrLength),
-          oldArray = copyArray(array);
-
-      while (length--) {
-        var index = indexes[length];
-        array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
-      }
-      return array;
-    }
-
-    /**
-     * Sets metadata for `func`.
-     *
-     * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
-     * period of time, it will trip its breaker and transition to an identity
-     * function to avoid garbage collection pauses in V8. See
-     * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
-     * for more details.
-     *
-     * @private
-     * @param {Function} func The function to associate metadata with.
-     * @param {*} data The metadata.
-     * @returns {Function} Returns `func`.
-     */
-    var setData = (function() {
-      var count = 0,
-          lastCalled = 0;
-
-      return function(key, value) {
-        var stamp = now(),
-            remaining = HOT_SPAN - (stamp - lastCalled);
-
-        lastCalled = stamp;
-        if (remaining > 0) {
-          if (++count >= HOT_COUNT) {
-            return key;
-          }
-        } else {
-          count = 0;
-        }
-        return baseSetData(key, value);
-      };
-    }());
-
-    /**
-     * Converts `string` to a property path array.
-     *
-     * @private
-     * @param {string} string The string to convert.
-     * @returns {Array} Returns the property path array.
-     */
-    var stringToPath = memoize(function(string) {
-      var result = [];
-      toString(string).replace(rePropName, function(match, number, quote, string) {
-        result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
-      });
-      return result;
-    });
-
-    /**
-     * Converts `value` to a string key if it's not a string or symbol.
-     *
-     * @private
-     * @param {*} value The value to inspect.
-     * @returns {string|symbol} Returns the key.
-     */
-    function toKey(value) {
-      if (typeof value == 'string' || isSymbol(value)) {
-        return value;
-      }
-      var result = (value + '');
-      return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
-    }
-
-    /**
-     * Converts `func` to its source code.
-     *
-     * @private
-     * @param {Function} func The function to process.
-     * @returns {string} Returns the source code.
-     */
-    function toSource(func) {
-      if (func != null) {
-        try {
-          return funcToString.call(func);
-        } catch (e) {}
-        try {
-          return (func + '');
-        } catch (e) {}
-      }
-      return '';
-    }
-
-    /**
-     * Creates a clone of `wrapper`.
-     *
-     * @private
-     * @param {Object} wrapper The wrapper to clone.
-     * @returns {Object} Returns the cloned wrapper.
-     */
-    function wrapperClone(wrapper) {
-      if (wrapper instanceof LazyWrapper) {
-        return wrapper.clone();
-      }
-      var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
-      result.__actions__ = copyArray(wrapper.__actions__);
-      result.__index__  = wrapper.__index__;
-      result.__values__ = wrapper.__values__;
-      return result;
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates an array of elements split into groups the length of `size`.
-     * If `array` can't be split evenly, the final chunk will be the remaining
-     * elements.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to process.
-     * @param {number} [size=1] The length of each chunk
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the new array containing chunks.
-     * @example
-     *
-     * _.chunk(['a', 'b', 'c', 'd'], 2);
-     * // => [['a', 'b'], ['c', 'd']]
-     *
-     * _.chunk(['a', 'b', 'c', 'd'], 3);
-     * // => [['a', 'b', 'c'], ['d']]
-     */
-    function chunk(array, size, guard) {
-      if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
-        size = 1;
-      } else {
-        size = nativeMax(toInteger(size), 0);
-      }
-      var length = array ? array.length : 0;
-      if (!length || size < 1) {
-        return [];
-      }
-      var index = 0,
-          resIndex = 0,
-          result = Array(nativeCeil(length / size));
-
-      while (index < length) {
-        result[resIndex++] = baseSlice(array, index, (index += size));
-      }
-      return result;
-    }
-
-    /**
-     * Creates an array with all falsey values removed. The values `false`, `null`,
-     * `0`, `""`, `undefined`, and `NaN` are falsey.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to compact.
-     * @returns {Array} Returns the new array of filtered values.
-     * @example
-     *
-     * _.compact([0, 1, false, 2, '', 3]);
-     * // => [1, 2, 3]
-     */
-    function compact(array) {
-      var index = -1,
-          length = array ? array.length : 0,
-          resIndex = 0,
-          result = [];
-
-      while (++index < length) {
-        var value = array[index];
-        if (value) {
-          result[resIndex++] = value;
-        }
-      }
-      return result;
-    }
-
-    /**
-     * Creates a new array concatenating `array` with any additional arrays
-     * and/or values.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to concatenate.
-     * @param {...*} [values] The values to concatenate.
-     * @returns {Array} Returns the new concatenated array.
-     * @example
-     *
-     * var array = [1];
-     * var other = _.concat(array, 2, [3], [[4]]);
-     *
-     * console.log(other);
-     * // => [1, 2, 3, [4]]
-     *
-     * console.log(array);
-     * // => [1]
-     */
-    function concat() {
-      var length = arguments.length,
-          array = castArray(arguments[0]);
-
-      if (length < 2) {
-        return length ? copyArray(array) : [];
-      }
-      var args = Array(length - 1);
-      while (length--) {
-        args[length - 1] = arguments[length];
-      }
-      return arrayConcat(array, baseFlatten(args, 1));
-    }
-
-    /**
-     * Creates an array of unique `array` values not included in the other given
-     * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons. The order of result values is determined by the
-     * order they occur in the first array.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {...Array} [values] The values to exclude.
-     * @returns {Array} Returns the new array of filtered values.
-     * @see _.without, _.xor
-     * @example
-     *
-     * _.difference([3, 2, 1], [4, 2]);
-     * // => [3, 1]
-     */
-    var difference = rest(function(array, values) {
-      return isArrayLikeObject(array)
-        ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
-        : [];
-    });
-
-    /**
-     * This method is like `_.difference` except that it accepts `iteratee` which
-     * is invoked for each element of `array` and `values` to generate the criterion
-     * by which they're compared. Result values are chosen from the first array.
-     * The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {...Array} [values] The values to exclude.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns the new array of filtered values.
-     * @example
-     *
-     * _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);
-     * // => [3.1, 1.3]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
-     * // => [{ 'x': 2 }]
-     */
-    var differenceBy = rest(function(array, values) {
-      var iteratee = last(values);
-      if (isArrayLikeObject(iteratee)) {
-        iteratee = undefined;
-      }
-      return isArrayLikeObject(array)
-        ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee))
-        : [];
-    });
-
-    /**
-     * This method is like `_.difference` except that it accepts `comparator`
-     * which is invoked to compare elements of `array` to `values`. Result values
-     * are chosen from the first array. The comparator is invoked with two arguments:
-     * (arrVal, othVal).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {...Array} [values] The values to exclude.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of filtered values.
-     * @example
-     *
-     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-     *
-     * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
-     * // => [{ 'x': 2, 'y': 1 }]
-     */
-    var differenceWith = rest(function(array, values) {
-      var comparator = last(values);
-      if (isArrayLikeObject(comparator)) {
-        comparator = undefined;
-      }
-      return isArrayLikeObject(array)
-        ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
-        : [];
-    });
-
-    /**
-     * Creates a slice of `array` with `n` elements dropped from the beginning.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.5.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {number} [n=1] The number of elements to drop.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.drop([1, 2, 3]);
-     * // => [2, 3]
-     *
-     * _.drop([1, 2, 3], 2);
-     * // => [3]
-     *
-     * _.drop([1, 2, 3], 5);
-     * // => []
-     *
-     * _.drop([1, 2, 3], 0);
-     * // => [1, 2, 3]
-     */
-    function drop(array, n, guard) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      n = (guard || n === undefined) ? 1 : toInteger(n);
-      return baseSlice(array, n < 0 ? 0 : n, length);
-    }
-
-    /**
-     * Creates a slice of `array` with `n` elements dropped from the end.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {number} [n=1] The number of elements to drop.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.dropRight([1, 2, 3]);
-     * // => [1, 2]
-     *
-     * _.dropRight([1, 2, 3], 2);
-     * // => [1]
-     *
-     * _.dropRight([1, 2, 3], 5);
-     * // => []
-     *
-     * _.dropRight([1, 2, 3], 0);
-     * // => [1, 2, 3]
-     */
-    function dropRight(array, n, guard) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      n = (guard || n === undefined) ? 1 : toInteger(n);
-      n = length - n;
-      return baseSlice(array, 0, n < 0 ? 0 : n);
-    }
-
-    /**
-     * Creates a slice of `array` excluding elements dropped from the end.
-     * Elements are dropped until `predicate` returns falsey. The predicate is
-     * invoked with three arguments: (value, index, array).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': true },
-     *   { 'user': 'fred',    'active': false },
-     *   { 'user': 'pebbles', 'active': false }
-     * ];
-     *
-     * _.dropRightWhile(users, function(o) { return !o.active; });
-     * // => objects for ['barney']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
-     * // => objects for ['barney', 'fred']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.dropRightWhile(users, ['active', false]);
-     * // => objects for ['barney']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.dropRightWhile(users, 'active');
-     * // => objects for ['barney', 'fred', 'pebbles']
-     */
-    function dropRightWhile(array, predicate) {
-      return (array && array.length)
-        ? baseWhile(array, getIteratee(predicate, 3), true, true)
-        : [];
-    }
-
-    /**
-     * Creates a slice of `array` excluding elements dropped from the beginning.
-     * Elements are dropped until `predicate` returns falsey. The predicate is
-     * invoked with three arguments: (value, index, array).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': false },
-     *   { 'user': 'fred',    'active': false },
-     *   { 'user': 'pebbles', 'active': true }
-     * ];
-     *
-     * _.dropWhile(users, function(o) { return !o.active; });
-     * // => objects for ['pebbles']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.dropWhile(users, { 'user': 'barney', 'active': false });
-     * // => objects for ['fred', 'pebbles']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.dropWhile(users, ['active', false]);
-     * // => objects for ['pebbles']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.dropWhile(users, 'active');
-     * // => objects for ['barney', 'fred', 'pebbles']
-     */
-    function dropWhile(array, predicate) {
-      return (array && array.length)
-        ? baseWhile(array, getIteratee(predicate, 3), true)
-        : [];
-    }
-
-    /**
-     * Fills elements of `array` with `value` from `start` up to, but not
-     * including, `end`.
-     *
-     * **Note:** This method mutates `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.2.0
-     * @category Array
-     * @param {Array} array The array to fill.
-     * @param {*} value The value to fill `array` with.
-     * @param {number} [start=0] The start position.
-     * @param {number} [end=array.length] The end position.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [1, 2, 3];
-     *
-     * _.fill(array, 'a');
-     * console.log(array);
-     * // => ['a', 'a', 'a']
-     *
-     * _.fill(Array(3), 2);
-     * // => [2, 2, 2]
-     *
-     * _.fill([4, 6, 8, 10], '*', 1, 3);
-     * // => [4, '*', '*', 10]
-     */
-    function fill(array, value, start, end) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
-        start = 0;
-        end = length;
-      }
-      return baseFill(array, value, start, end);
-    }
-
-    /**
-     * This method is like `_.find` except that it returns the index of the first
-     * element `predicate` returns truthy for instead of the element itself.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.1.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {number} Returns the index of the found element, else `-1`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': false },
-     *   { 'user': 'fred',    'active': false },
-     *   { 'user': 'pebbles', 'active': true }
-     * ];
-     *
-     * _.findIndex(users, function(o) { return o.user == 'barney'; });
-     * // => 0
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.findIndex(users, { 'user': 'fred', 'active': false });
-     * // => 1
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.findIndex(users, ['active', false]);
-     * // => 0
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.findIndex(users, 'active');
-     * // => 2
-     */
-    function findIndex(array, predicate) {
-      return (array && array.length)
-        ? baseFindIndex(array, getIteratee(predicate, 3))
-        : -1;
-    }
-
-    /**
-     * This method is like `_.findIndex` except that it iterates over elements
-     * of `collection` from right to left.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {number} Returns the index of the found element, else `-1`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': true },
-     *   { 'user': 'fred',    'active': false },
-     *   { 'user': 'pebbles', 'active': false }
-     * ];
-     *
-     * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
-     * // => 2
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.findLastIndex(users, { 'user': 'barney', 'active': true });
-     * // => 0
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.findLastIndex(users, ['active', false]);
-     * // => 2
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.findLastIndex(users, 'active');
-     * // => 0
-     */
-    function findLastIndex(array, predicate) {
-      return (array && array.length)
-        ? baseFindIndex(array, getIteratee(predicate, 3), true)
-        : -1;
-    }
-
-    /**
-     * Flattens `array` a single level deep.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to flatten.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * _.flatten([1, [2, [3, [4]], 5]]);
-     * // => [1, 2, [3, [4]], 5]
-     */
-    function flatten(array) {
-      var length = array ? array.length : 0;
-      return length ? baseFlatten(array, 1) : [];
-    }
-
-    /**
-     * Recursively flattens `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to flatten.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * _.flattenDeep([1, [2, [3, [4]], 5]]);
-     * // => [1, 2, 3, 4, 5]
-     */
-    function flattenDeep(array) {
-      var length = array ? array.length : 0;
-      return length ? baseFlatten(array, INFINITY) : [];
-    }
-
-    /**
-     * Recursively flatten `array` up to `depth` times.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.4.0
-     * @category Array
-     * @param {Array} array The array to flatten.
-     * @param {number} [depth=1] The maximum recursion depth.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * var array = [1, [2, [3, [4]], 5]];
-     *
-     * _.flattenDepth(array, 1);
-     * // => [1, 2, [3, [4]], 5]
-     *
-     * _.flattenDepth(array, 2);
-     * // => [1, 2, 3, [4], 5]
-     */
-    function flattenDepth(array, depth) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      depth = depth === undefined ? 1 : toInteger(depth);
-      return baseFlatten(array, depth);
-    }
-
-    /**
-     * The inverse of `_.toPairs`; this method returns an object composed
-     * from key-value `pairs`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} pairs The key-value pairs.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * _.fromPairs([['fred', 30], ['barney', 40]]);
-     * // => { 'fred': 30, 'barney': 40 }
-     */
-    function fromPairs(pairs) {
-      var index = -1,
-          length = pairs ? pairs.length : 0,
-          result = {};
-
-      while (++index < length) {
-        var pair = pairs[index];
-        result[pair[0]] = pair[1];
-      }
-      return result;
-    }
-
-    /**
-     * Gets the first element of `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @alias first
-     * @category Array
-     * @param {Array} array The array to query.
-     * @returns {*} Returns the first element of `array`.
-     * @example
-     *
-     * _.head([1, 2, 3]);
-     * // => 1
-     *
-     * _.head([]);
-     * // => undefined
-     */
-    function head(array) {
-      return (array && array.length) ? array[0] : undefined;
-    }
-
-    /**
-     * Gets the index at which the first occurrence of `value` is found in `array`
-     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons. If `fromIndex` is negative, it's used as the
-     * offset from the end of `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {*} value The value to search for.
-     * @param {number} [fromIndex=0] The index to search from.
-     * @returns {number} Returns the index of the matched value, else `-1`.
-     * @example
-     *
-     * _.indexOf([1, 2, 1, 2], 2);
-     * // => 1
-     *
-     * // Search from the `fromIndex`.
-     * _.indexOf([1, 2, 1, 2], 2, 2);
-     * // => 3
-     */
-    function indexOf(array, value, fromIndex) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return -1;
-      }
-      fromIndex = toInteger(fromIndex);
-      if (fromIndex < 0) {
-        fromIndex = nativeMax(length + fromIndex, 0);
-      }
-      return baseIndexOf(array, value, fromIndex);
-    }
-
-    /**
-     * Gets all but the last element of `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.initial([1, 2, 3]);
-     * // => [1, 2]
-     */
-    function initial(array) {
-      return dropRight(array, 1);
-    }
-
-    /**
-     * Creates an array of unique values that are included in all given arrays
-     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons. The order of result values is determined by the
-     * order they occur in the first array.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @returns {Array} Returns the new array of intersecting values.
-     * @example
-     *
-     * _.intersection([2, 1], [4, 2], [1, 2]);
-     * // => [2]
-     */
-    var intersection = rest(function(arrays) {
-      var mapped = arrayMap(arrays, castArrayLikeObject);
-      return (mapped.length && mapped[0] === arrays[0])
-        ? baseIntersection(mapped)
-        : [];
-    });
-
-    /**
-     * This method is like `_.intersection` except that it accepts `iteratee`
-     * which is invoked for each element of each `arrays` to generate the criterion
-     * by which they're compared. Result values are chosen from the first array.
-     * The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns the new array of intersecting values.
-     * @example
-     *
-     * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-     * // => [2.1]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-     * // => [{ 'x': 1 }]
-     */
-    var intersectionBy = rest(function(arrays) {
-      var iteratee = last(arrays),
-          mapped = arrayMap(arrays, castArrayLikeObject);
-
-      if (iteratee === last(mapped)) {
-        iteratee = undefined;
-      } else {
-        mapped.pop();
-      }
-      return (mapped.length && mapped[0] === arrays[0])
-        ? baseIntersection(mapped, getIteratee(iteratee))
-        : [];
-    });
-
-    /**
-     * This method is like `_.intersection` except that it accepts `comparator`
-     * which is invoked to compare elements of `arrays`. Result values are chosen
-     * from the first array. The comparator is invoked with two arguments:
-     * (arrVal, othVal).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of intersecting values.
-     * @example
-     *
-     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-     * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
-     *
-     * _.intersectionWith(objects, others, _.isEqual);
-     * // => [{ 'x': 1, 'y': 2 }]
-     */
-    var intersectionWith = rest(function(arrays) {
-      var comparator = last(arrays),
-          mapped = arrayMap(arrays, castArrayLikeObject);
-
-      if (comparator === last(mapped)) {
-        comparator = undefined;
-      } else {
-        mapped.pop();
-      }
-      return (mapped.length && mapped[0] === arrays[0])
-        ? baseIntersection(mapped, undefined, comparator)
-        : [];
-    });
-
-    /**
-     * Converts all elements in `array` into a string separated by `separator`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to convert.
-     * @param {string} [separator=','] The element separator.
-     * @returns {string} Returns the joined string.
-     * @example
-     *
-     * _.join(['a', 'b', 'c'], '~');
-     * // => 'a~b~c'
-     */
-    function join(array, separator) {
-      return array ? nativeJoin.call(array, separator) : '';
-    }
-
-    /**
-     * Gets the last element of `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @returns {*} Returns the last element of `array`.
-     * @example
-     *
-     * _.last([1, 2, 3]);
-     * // => 3
-     */
-    function last(array) {
-      var length = array ? array.length : 0;
-      return length ? array[length - 1] : undefined;
-    }
-
-    /**
-     * This method is like `_.indexOf` except that it iterates over elements of
-     * `array` from right to left.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {*} value The value to search for.
-     * @param {number} [fromIndex=array.length-1] The index to search from.
-     * @returns {number} Returns the index of the matched value, else `-1`.
-     * @example
-     *
-     * _.lastIndexOf([1, 2, 1, 2], 2);
-     * // => 3
-     *
-     * // Search from the `fromIndex`.
-     * _.lastIndexOf([1, 2, 1, 2], 2, 2);
-     * // => 1
-     */
-    function lastIndexOf(array, value, fromIndex) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return -1;
-      }
-      var index = length;
-      if (fromIndex !== undefined) {
-        index = toInteger(fromIndex);
-        index = (
-          index < 0
-            ? nativeMax(length + index, 0)
-            : nativeMin(index, length - 1)
-        ) + 1;
-      }
-      if (value !== value) {
-        return indexOfNaN(array, index, true);
-      }
-      while (index--) {
-        if (array[index] === value) {
-          return index;
-        }
-      }
-      return -1;
-    }
-
-    /**
-     * Gets the nth element of `array`. If `n` is negative, the nth element
-     * from the end is returned.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.11.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {number} [n=0] The index of the element to return.
-     * @returns {*} Returns the nth element of `array`.
-     * @example
-     *
-     * var array = ['a', 'b', 'c', 'd'];
-     *
-     * _.nth(array, 1);
-     * // => 'b'
-     *
-     * _.nth(array, -2);
-     * // => 'c';
-     */
-    function nth(array, n) {
-      return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
-    }
-
-    /**
-     * Removes all given values from `array` using
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons.
-     *
-     * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
-     * to remove elements from an array by predicate.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {...*} [values] The values to remove.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [1, 2, 3, 1, 2, 3];
-     *
-     * _.pull(array, 2, 3);
-     * console.log(array);
-     * // => [1, 1]
-     */
-    var pull = rest(pullAll);
-
-    /**
-     * This method is like `_.pull` except that it accepts an array of values to remove.
-     *
-     * **Note:** Unlike `_.difference`, this method mutates `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {Array} values The values to remove.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [1, 2, 3, 1, 2, 3];
-     *
-     * _.pullAll(array, [2, 3]);
-     * console.log(array);
-     * // => [1, 1]
-     */
-    function pullAll(array, values) {
-      return (array && array.length && values && values.length)
-        ? basePullAll(array, values)
-        : array;
-    }
-
-    /**
-     * This method is like `_.pullAll` except that it accepts `iteratee` which is
-     * invoked for each element of `array` and `values` to generate the criterion
-     * by which they're compared. The iteratee is invoked with one argument: (value).
-     *
-     * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {Array} values The values to remove.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
-     *
-     * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
-     * console.log(array);
-     * // => [{ 'x': 2 }]
-     */
-    function pullAllBy(array, values, iteratee) {
-      return (array && array.length && values && values.length)
-        ? basePullAll(array, values, getIteratee(iteratee))
-        : array;
-    }
-
-    /**
-     * This method is like `_.pullAll` except that it accepts `comparator` which
-     * is invoked to compare elements of `array` to `values`. The comparator is
-     * invoked with two arguments: (arrVal, othVal).
-     *
-     * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.6.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {Array} values The values to remove.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
-     *
-     * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
-     * console.log(array);
-     * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
-     */
-    function pullAllWith(array, values, comparator) {
-      return (array && array.length && values && values.length)
-        ? basePullAll(array, values, undefined, comparator)
-        : array;
-    }
-
-    /**
-     * Removes elements from `array` corresponding to `indexes` and returns an
-     * array of removed elements.
-     *
-     * **Note:** Unlike `_.at`, this method mutates `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {...(number|number[])} [indexes] The indexes of elements to remove.
-     * @returns {Array} Returns the new array of removed elements.
-     * @example
-     *
-     * var array = [5, 10, 15, 20];
-     * var evens = _.pullAt(array, 1, 3);
-     *
-     * console.log(array);
-     * // => [5, 15]
-     *
-     * console.log(evens);
-     * // => [10, 20]
-     */
-    var pullAt = rest(function(array, indexes) {
-      indexes = baseFlatten(indexes, 1);
-
-      var length = array ? array.length : 0,
-          result = baseAt(array, indexes);
-
-      basePullAt(array, arrayMap(indexes, function(index) {
-        return isIndex(index, length) ? +index : index;
-      }).sort(compareAscending));
-
-      return result;
-    });
-
-    /**
-     * Removes all elements from `array` that `predicate` returns truthy for
-     * and returns an array of the removed elements. The predicate is invoked
-     * with three arguments: (value, index, array).
-     *
-     * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
-     * to pull elements from an array by value.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new array of removed elements.
-     * @example
-     *
-     * var array = [1, 2, 3, 4];
-     * var evens = _.remove(array, function(n) {
-     *   return n % 2 == 0;
-     * });
-     *
-     * console.log(array);
-     * // => [1, 3]
-     *
-     * console.log(evens);
-     * // => [2, 4]
-     */
-    function remove(array, predicate) {
-      var result = [];
-      if (!(array && array.length)) {
-        return result;
-      }
-      var index = -1,
-          indexes = [],
-          length = array.length;
-
-      predicate = getIteratee(predicate, 3);
-      while (++index < length) {
-        var value = array[index];
-        if (predicate(value, index, array)) {
-          result.push(value);
-          indexes.push(index);
-        }
-      }
-      basePullAt(array, indexes);
-      return result;
-    }
-
-    /**
-     * Reverses `array` so that the first element becomes the last, the second
-     * element becomes the second to last, and so on.
-     *
-     * **Note:** This method mutates `array` and is based on
-     * [`Array#reverse`](https://mdn.io/Array/reverse).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to modify.
-     * @returns {Array} Returns `array`.
-     * @example
-     *
-     * var array = [1, 2, 3];
-     *
-     * _.reverse(array);
-     * // => [3, 2, 1]
-     *
-     * console.log(array);
-     * // => [3, 2, 1]
-     */
-    function reverse(array) {
-      return array ? nativeReverse.call(array) : array;
-    }
-
-    /**
-     * Creates a slice of `array` from `start` up to, but not including, `end`.
-     *
-     * **Note:** This method is used instead of
-     * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
-     * returned.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to slice.
-     * @param {number} [start=0] The start position.
-     * @param {number} [end=array.length] The end position.
-     * @returns {Array} Returns the slice of `array`.
-     */
-    function slice(array, start, end) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
-        start = 0;
-        end = length;
-      }
-      else {
-        start = start == null ? 0 : toInteger(start);
-        end = end === undefined ? length : toInteger(end);
-      }
-      return baseSlice(array, start, end);
-    }
-
-    /**
-     * Uses a binary search to determine the lowest index at which `value`
-     * should be inserted into `array` in order to maintain its sort order.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     * @example
-     *
-     * _.sortedIndex([30, 50], 40);
-     * // => 1
-     *
-     * _.sortedIndex([4, 5], 4);
-     * // => 0
-     */
-    function sortedIndex(array, value) {
-      return baseSortedIndex(array, value);
-    }
-
-    /**
-     * This method is like `_.sortedIndex` except that it accepts `iteratee`
-     * which is invoked for `value` and each element of `array` to compute their
-     * sort ranking. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     * @example
-     *
-     * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
-     *
-     * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
-     * // => 1
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
-     * // => 0
-     */
-    function sortedIndexBy(array, value, iteratee) {
-      return baseSortedIndexBy(array, value, getIteratee(iteratee));
-    }
-
-    /**
-     * This method is like `_.indexOf` except that it performs a binary
-     * search on a sorted `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {*} value The value to search for.
-     * @returns {number} Returns the index of the matched value, else `-1`.
-     * @example
-     *
-     * _.sortedIndexOf([1, 1, 2, 2], 2);
-     * // => 2
-     */
-    function sortedIndexOf(array, value) {
-      var length = array ? array.length : 0;
-      if (length) {
-        var index = baseSortedIndex(array, value);
-        if (index < length && eq(array[index], value)) {
-          return index;
-        }
-      }
-      return -1;
-    }
-
-    /**
-     * This method is like `_.sortedIndex` except that it returns the highest
-     * index at which `value` should be inserted into `array` in order to
-     * maintain its sort order.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     * @example
-     *
-     * _.sortedLastIndex([4, 5], 4);
-     * // => 1
-     */
-    function sortedLastIndex(array, value) {
-      return baseSortedIndex(array, value, true);
-    }
-
-    /**
-     * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
-     * which is invoked for `value` and each element of `array` to compute their
-     * sort ranking. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The sorted array to inspect.
-     * @param {*} value The value to evaluate.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {number} Returns the index at which `value` should be inserted
-     *  into `array`.
-     * @example
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
-     * // => 1
-     */
-    function sortedLastIndexBy(array, value, iteratee) {
-      return baseSortedIndexBy(array, value, getIteratee(iteratee), true);
-    }
-
-    /**
-     * This method is like `_.lastIndexOf` except that it performs a binary
-     * search on a sorted `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to search.
-     * @param {*} value The value to search for.
-     * @returns {number} Returns the index of the matched value, else `-1`.
-     * @example
-     *
-     * _.sortedLastIndexOf([1, 1, 2, 2], 2);
-     * // => 3
-     */
-    function sortedLastIndexOf(array, value) {
-      var length = array ? array.length : 0;
-      if (length) {
-        var index = baseSortedIndex(array, value, true) - 1;
-        if (eq(array[index], value)) {
-          return index;
-        }
-      }
-      return -1;
-    }
-
-    /**
-     * This method is like `_.uniq` except that it's designed and optimized
-     * for sorted arrays.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @returns {Array} Returns the new duplicate free array.
-     * @example
-     *
-     * _.sortedUniq([1, 1, 2]);
-     * // => [1, 2]
-     */
-    function sortedUniq(array) {
-      return (array && array.length)
-        ? baseSortedUniq(array)
-        : [];
-    }
-
-    /**
-     * This method is like `_.uniqBy` except that it's designed and optimized
-     * for sorted arrays.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {Function} [iteratee] The iteratee invoked per element.
-     * @returns {Array} Returns the new duplicate free array.
-     * @example
-     *
-     * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
-     * // => [1.1, 2.3]
-     */
-    function sortedUniqBy(array, iteratee) {
-      return (array && array.length)
-        ? baseSortedUniq(array, getIteratee(iteratee))
-        : [];
-    }
-
-    /**
-     * Gets all but the first element of `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.tail([1, 2, 3]);
-     * // => [2, 3]
-     */
-    function tail(array) {
-      return drop(array, 1);
-    }
-
-    /**
-     * Creates a slice of `array` with `n` elements taken from the beginning.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {number} [n=1] The number of elements to take.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.take([1, 2, 3]);
-     * // => [1]
-     *
-     * _.take([1, 2, 3], 2);
-     * // => [1, 2]
-     *
-     * _.take([1, 2, 3], 5);
-     * // => [1, 2, 3]
-     *
-     * _.take([1, 2, 3], 0);
-     * // => []
-     */
-    function take(array, n, guard) {
-      if (!(array && array.length)) {
-        return [];
-      }
-      n = (guard || n === undefined) ? 1 : toInteger(n);
-      return baseSlice(array, 0, n < 0 ? 0 : n);
-    }
-
-    /**
-     * Creates a slice of `array` with `n` elements taken from the end.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {number} [n=1] The number of elements to take.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * _.takeRight([1, 2, 3]);
-     * // => [3]
-     *
-     * _.takeRight([1, 2, 3], 2);
-     * // => [2, 3]
-     *
-     * _.takeRight([1, 2, 3], 5);
-     * // => [1, 2, 3]
-     *
-     * _.takeRight([1, 2, 3], 0);
-     * // => []
-     */
-    function takeRight(array, n, guard) {
-      var length = array ? array.length : 0;
-      if (!length) {
-        return [];
-      }
-      n = (guard || n === undefined) ? 1 : toInteger(n);
-      n = length - n;
-      return baseSlice(array, n < 0 ? 0 : n, length);
-    }
-
-    /**
-     * Creates a slice of `array` with elements taken from the end. Elements are
-     * taken until `predicate` returns falsey. The predicate is invoked with
-     * three arguments: (value, index, array).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': true },
-     *   { 'user': 'fred',    'active': false },
-     *   { 'user': 'pebbles', 'active': false }
-     * ];
-     *
-     * _.takeRightWhile(users, function(o) { return !o.active; });
-     * // => objects for ['fred', 'pebbles']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
-     * // => objects for ['pebbles']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.takeRightWhile(users, ['active', false]);
-     * // => objects for ['fred', 'pebbles']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.takeRightWhile(users, 'active');
-     * // => []
-     */
-    function takeRightWhile(array, predicate) {
-      return (array && array.length)
-        ? baseWhile(array, getIteratee(predicate, 3), false, true)
-        : [];
-    }
-
-    /**
-     * Creates a slice of `array` with elements taken from the beginning. Elements
-     * are taken until `predicate` returns falsey. The predicate is invoked with
-     * three arguments: (value, index, array).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Array
-     * @param {Array} array The array to query.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the slice of `array`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'active': false },
-     *   { 'user': 'fred',    'active': false},
-     *   { 'user': 'pebbles', 'active': true }
-     * ];
-     *
-     * _.takeWhile(users, function(o) { return !o.active; });
-     * // => objects for ['barney', 'fred']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.takeWhile(users, { 'user': 'barney', 'active': false });
-     * // => objects for ['barney']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.takeWhile(users, ['active', false]);
-     * // => objects for ['barney', 'fred']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.takeWhile(users, 'active');
-     * // => []
-     */
-    function takeWhile(array, predicate) {
-      return (array && array.length)
-        ? baseWhile(array, getIteratee(predicate, 3))
-        : [];
-    }
-
-    /**
-     * Creates an array of unique values, in order, from all given arrays using
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @returns {Array} Returns the new array of combined values.
-     * @example
-     *
-     * _.union([2, 1], [4, 2], [1, 2]);
-     * // => [2, 1, 4]
-     */
-    var union = rest(function(arrays) {
-      return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
-    });
-
-    /**
-     * This method is like `_.union` except that it accepts `iteratee` which is
-     * invoked for each element of each `arrays` to generate the criterion by
-     * which uniqueness is computed. The iteratee is invoked with one argument:
-     * (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns the new array of combined values.
-     * @example
-     *
-     * _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-     * // => [2.1, 1.2, 4.3]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-     * // => [{ 'x': 1 }, { 'x': 2 }]
-     */
-    var unionBy = rest(function(arrays) {
-      var iteratee = last(arrays);
-      if (isArrayLikeObject(iteratee)) {
-        iteratee = undefined;
-      }
-      return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee));
-    });
-
-    /**
-     * This method is like `_.union` except that it accepts `comparator` which
-     * is invoked to compare elements of `arrays`. The comparator is invoked
-     * with two arguments: (arrVal, othVal).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of combined values.
-     * @example
-     *
-     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-     * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
-     *
-     * _.unionWith(objects, others, _.isEqual);
-     * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
-     */
-    var unionWith = rest(function(arrays) {
-      var comparator = last(arrays);
-      if (isArrayLikeObject(comparator)) {
-        comparator = undefined;
-      }
-      return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
-    });
-
-    /**
-     * Creates a duplicate-free version of an array, using
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons, in which only the first occurrence of each
-     * element is kept.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @returns {Array} Returns the new duplicate free array.
-     * @example
-     *
-     * _.uniq([2, 1, 2]);
-     * // => [2, 1]
-     */
-    function uniq(array) {
-      return (array && array.length)
-        ? baseUniq(array)
-        : [];
-    }
-
-    /**
-     * This method is like `_.uniq` except that it accepts `iteratee` which is
-     * invoked for each element in `array` to generate the criterion by which
-     * uniqueness is computed. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns the new duplicate free array.
-     * @example
-     *
-     * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
-     * // => [2.1, 1.2]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
-     * // => [{ 'x': 1 }, { 'x': 2 }]
-     */
-    function uniqBy(array, iteratee) {
-      return (array && array.length)
-        ? baseUniq(array, getIteratee(iteratee))
-        : [];
-    }
-
-    /**
-     * This method is like `_.uniq` except that it accepts `comparator` which
-     * is invoked to compare elements of `array`. The comparator is invoked with
-     * two arguments: (arrVal, othVal).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {Array} array The array to inspect.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new duplicate free array.
-     * @example
-     *
-     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 },  { 'x': 1, 'y': 2 }];
-     *
-     * _.uniqWith(objects, _.isEqual);
-     * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
-     */
-    function uniqWith(array, comparator) {
-      return (array && array.length)
-        ? baseUniq(array, undefined, comparator)
-        : [];
-    }
-
-    /**
-     * This method is like `_.zip` except that it accepts an array of grouped
-     * elements and creates an array regrouping the elements to their pre-zip
-     * configuration.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.2.0
-     * @category Array
-     * @param {Array} array The array of grouped elements to process.
-     * @returns {Array} Returns the new array of regrouped elements.
-     * @example
-     *
-     * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
-     * // => [['fred', 30, true], ['barney', 40, false]]
-     *
-     * _.unzip(zipped);
-     * // => [['fred', 'barney'], [30, 40], [true, false]]
-     */
-    function unzip(array) {
-      if (!(array && array.length)) {
-        return [];
-      }
-      var length = 0;
-      array = arrayFilter(array, function(group) {
-        if (isArrayLikeObject(group)) {
-          length = nativeMax(group.length, length);
-          return true;
-        }
-      });
-      return baseTimes(length, function(index) {
-        return arrayMap(array, baseProperty(index));
-      });
-    }
-
-    /**
-     * This method is like `_.unzip` except that it accepts `iteratee` to specify
-     * how regrouped values should be combined. The iteratee is invoked with the
-     * elements of each group: (...group).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.8.0
-     * @category Array
-     * @param {Array} array The array of grouped elements to process.
-     * @param {Function} [iteratee=_.identity] The function to combine
-     *  regrouped values.
-     * @returns {Array} Returns the new array of regrouped elements.
-     * @example
-     *
-     * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
-     * // => [[1, 10, 100], [2, 20, 200]]
-     *
-     * _.unzipWith(zipped, _.add);
-     * // => [3, 30, 300]
-     */
-    function unzipWith(array, iteratee) {
-      if (!(array && array.length)) {
-        return [];
-      }
-      var result = unzip(array);
-      if (iteratee == null) {
-        return result;
-      }
-      return arrayMap(result, function(group) {
-        return apply(iteratee, undefined, group);
-      });
-    }
-
-    /**
-     * Creates an array excluding all given values using
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * for equality comparisons.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {Array} array The array to filter.
-     * @param {...*} [values] The values to exclude.
-     * @returns {Array} Returns the new array of filtered values.
-     * @see _.difference, _.xor
-     * @example
-     *
-     * _.without([1, 2, 1, 3], 1, 2);
-     * // => [3]
-     */
-    var without = rest(function(array, values) {
-      return isArrayLikeObject(array)
-        ? baseDifference(array, values)
-        : [];
-    });
-
-    /**
-     * Creates an array of unique values that is the
-     * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
-     * of the given arrays. The order of result values is determined by the order
-     * they occur in the arrays.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.4.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @returns {Array} Returns the new array of values.
-     * @see _.difference, _.without
-     * @example
-     *
-     * _.xor([2, 1], [4, 2]);
-     * // => [1, 4]
-     */
-    var xor = rest(function(arrays) {
-      return baseXor(arrayFilter(arrays, isArrayLikeObject));
-    });
-
-    /**
-     * This method is like `_.xor` except that it accepts `iteratee` which is
-     * invoked for each element of each `arrays` to generate the criterion by
-     * which by which they're compared. The iteratee is invoked with one argument:
-     * (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Array} Returns the new array of values.
-     * @example
-     *
-     * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-     * // => [1.2, 4.3]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-     * // => [{ 'x': 2 }]
-     */
-    var xorBy = rest(function(arrays) {
-      var iteratee = last(arrays);
-      if (isArrayLikeObject(iteratee)) {
-        iteratee = undefined;
-      }
-      return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee));
-    });
-
-    /**
-     * This method is like `_.xor` except that it accepts `comparator` which is
-     * invoked to compare elements of `arrays`. The comparator is invoked with
-     * two arguments: (arrVal, othVal).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to inspect.
-     * @param {Function} [comparator] The comparator invoked per element.
-     * @returns {Array} Returns the new array of values.
-     * @example
-     *
-     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
-     * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
-     *
-     * _.xorWith(objects, others, _.isEqual);
-     * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
-     */
-    var xorWith = rest(function(arrays) {
-      var comparator = last(arrays);
-      if (isArrayLikeObject(comparator)) {
-        comparator = undefined;
-      }
-      return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
-    });
-
-    /**
-     * Creates an array of grouped elements, the first of which contains the
-     * first elements of the given arrays, the second of which contains the
-     * second elements of the given arrays, and so on.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to process.
-     * @returns {Array} Returns the new array of grouped elements.
-     * @example
-     *
-     * _.zip(['fred', 'barney'], [30, 40], [true, false]);
-     * // => [['fred', 30, true], ['barney', 40, false]]
-     */
-    var zip = rest(unzip);
-
-    /**
-     * This method is like `_.fromPairs` except that it accepts two arrays,
-     * one of property identifiers and one of corresponding values.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.4.0
-     * @category Array
-     * @param {Array} [props=[]] The property identifiers.
-     * @param {Array} [values=[]] The property values.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * _.zipObject(['a', 'b'], [1, 2]);
-     * // => { 'a': 1, 'b': 2 }
-     */
-    function zipObject(props, values) {
-      return baseZipObject(props || [], values || [], assignValue);
-    }
-
-    /**
-     * This method is like `_.zipObject` except that it supports property paths.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.1.0
-     * @category Array
-     * @param {Array} [props=[]] The property identifiers.
-     * @param {Array} [values=[]] The property values.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
-     * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
-     */
-    function zipObjectDeep(props, values) {
-      return baseZipObject(props || [], values || [], baseSet);
-    }
-
-    /**
-     * This method is like `_.zip` except that it accepts `iteratee` to specify
-     * how grouped values should be combined. The iteratee is invoked with the
-     * elements of each group: (...group).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.8.0
-     * @category Array
-     * @param {...Array} [arrays] The arrays to process.
-     * @param {Function} [iteratee=_.identity] The function to combine grouped values.
-     * @returns {Array} Returns the new array of grouped elements.
-     * @example
-     *
-     * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
-     *   return a + b + c;
-     * });
-     * // => [111, 222]
-     */
-    var zipWith = rest(function(arrays) {
-      var length = arrays.length,
-          iteratee = length > 1 ? arrays[length - 1] : undefined;
-
-      iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
-      return unzipWith(arrays, iteratee);
-    });
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates a `lodash` wrapper instance that wraps `value` with explicit method
-     * chain sequences enabled. The result of such sequences must be unwrapped
-     * with `_#value`.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.3.0
-     * @category Seq
-     * @param {*} value The value to wrap.
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'age': 36 },
-     *   { 'user': 'fred',    'age': 40 },
-     *   { 'user': 'pebbles', 'age': 1 }
-     * ];
-     *
-     * var youngest = _
-     *   .chain(users)
-     *   .sortBy('age')
-     *   .map(function(o) {
-     *     return o.user + ' is ' + o.age;
-     *   })
-     *   .head()
-     *   .value();
-     * // => 'pebbles is 1'
-     */
-    function chain(value) {
-      var result = lodash(value);
-      result.__chain__ = true;
-      return result;
-    }
-
-    /**
-     * This method invokes `interceptor` and returns `value`. The interceptor
-     * is invoked with one argument; (value). The purpose of this method is to
-     * "tap into" a method chain sequence in order to modify intermediate results.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Seq
-     * @param {*} value The value to provide to `interceptor`.
-     * @param {Function} interceptor The function to invoke.
-     * @returns {*} Returns `value`.
-     * @example
-     *
-     * _([1, 2, 3])
-     *  .tap(function(array) {
-     *    // Mutate input array.
-     *    array.pop();
-     *  })
-     *  .reverse()
-     *  .value();
-     * // => [2, 1]
-     */
-    function tap(value, interceptor) {
-      interceptor(value);
-      return value;
-    }
-
-    /**
-     * This method is like `_.tap` except that it returns the result of `interceptor`.
-     * The purpose of this method is to "pass thru" values replacing intermediate
-     * results in a method chain sequence.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Seq
-     * @param {*} value The value to provide to `interceptor`.
-     * @param {Function} interceptor The function to invoke.
-     * @returns {*} Returns the result of `interceptor`.
-     * @example
-     *
-     * _('  abc  ')
-     *  .chain()
-     *  .trim()
-     *  .thru(function(value) {
-     *    return [value];
-     *  })
-     *  .value();
-     * // => ['abc']
-     */
-    function thru(value, interceptor) {
-      return interceptor(value);
-    }
-
-    /**
-     * This method is the wrapper version of `_.at`.
-     *
-     * @name at
-     * @memberOf _
-     * @since 1.0.0
-     * @category Seq
-     * @param {...(string|string[])} [paths] The property paths of elements to pick.
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
-     *
-     * _(object).at(['a[0].b.c', 'a[1]']).value();
-     * // => [3, 4]
-     *
-     * _(['a', 'b', 'c']).at(0, 2).value();
-     * // => ['a', 'c']
-     */
-    var wrapperAt = rest(function(paths) {
-      paths = baseFlatten(paths, 1);
-      var length = paths.length,
-          start = length ? paths[0] : 0,
-          value = this.__wrapped__,
-          interceptor = function(object) { return baseAt(object, paths); };
-
-      if (length > 1 || this.__actions__.length ||
-          !(value instanceof LazyWrapper) || !isIndex(start)) {
-        return this.thru(interceptor);
-      }
-      value = value.slice(start, +start + (length ? 1 : 0));
-      value.__actions__.push({
-        'func': thru,
-        'args': [interceptor],
-        'thisArg': undefined
-      });
-      return new LodashWrapper(value, this.__chain__).thru(function(array) {
-        if (length && !array.length) {
-          array.push(undefined);
-        }
-        return array;
-      });
-    });
-
-    /**
-     * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
-     *
-     * @name chain
-     * @memberOf _
-     * @since 0.1.0
-     * @category Seq
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36 },
-     *   { 'user': 'fred',   'age': 40 }
-     * ];
-     *
-     * // A sequence without explicit chaining.
-     * _(users).head();
-     * // => { 'user': 'barney', 'age': 36 }
-     *
-     * // A sequence with explicit chaining.
-     * _(users)
-     *   .chain()
-     *   .head()
-     *   .pick('user')
-     *   .value();
-     * // => { 'user': 'barney' }
-     */
-    function wrapperChain() {
-      return chain(this);
-    }
-
-    /**
-     * Executes the chain sequence and returns the wrapped result.
-     *
-     * @name commit
-     * @memberOf _
-     * @since 3.2.0
-     * @category Seq
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * var array = [1, 2];
-     * var wrapped = _(array).push(3);
-     *
-     * console.log(array);
-     * // => [1, 2]
-     *
-     * wrapped = wrapped.commit();
-     * console.log(array);
-     * // => [1, 2, 3]
-     *
-     * wrapped.last();
-     * // => 3
-     *
-     * console.log(array);
-     * // => [1, 2, 3]
-     */
-    function wrapperCommit() {
-      return new LodashWrapper(this.value(), this.__chain__);
-    }
-
-    /**
-     * Gets the next value on a wrapped object following the
-     * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
-     *
-     * @name next
-     * @memberOf _
-     * @since 4.0.0
-     * @category Seq
-     * @returns {Object} Returns the next iterator value.
-     * @example
-     *
-     * var wrapped = _([1, 2]);
-     *
-     * wrapped.next();
-     * // => { 'done': false, 'value': 1 }
-     *
-     * wrapped.next();
-     * // => { 'done': false, 'value': 2 }
-     *
-     * wrapped.next();
-     * // => { 'done': true, 'value': undefined }
-     */
-    function wrapperNext() {
-      if (this.__values__ === undefined) {
-        this.__values__ = toArray(this.value());
-      }
-      var done = this.__index__ >= this.__values__.length,
-          value = done ? undefined : this.__values__[this.__index__++];
-
-      return { 'done': done, 'value': value };
-    }
-
-    /**
-     * Enables the wrapper to be iterable.
-     *
-     * @name Symbol.iterator
-     * @memberOf _
-     * @since 4.0.0
-     * @category Seq
-     * @returns {Object} Returns the wrapper object.
-     * @example
-     *
-     * var wrapped = _([1, 2]);
-     *
-     * wrapped[Symbol.iterator]() === wrapped;
-     * // => true
-     *
-     * Array.from(wrapped);
-     * // => [1, 2]
-     */
-    function wrapperToIterator() {
-      return this;
-    }
-
-    /**
-     * Creates a clone of the chain sequence planting `value` as the wrapped value.
-     *
-     * @name plant
-     * @memberOf _
-     * @since 3.2.0
-     * @category Seq
-     * @param {*} value The value to plant.
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * var wrapped = _([1, 2]).map(square);
-     * var other = wrapped.plant([3, 4]);
-     *
-     * other.value();
-     * // => [9, 16]
-     *
-     * wrapped.value();
-     * // => [1, 4]
-     */
-    function wrapperPlant(value) {
-      var result,
-          parent = this;
-
-      while (parent instanceof baseLodash) {
-        var clone = wrapperClone(parent);
-        clone.__index__ = 0;
-        clone.__values__ = undefined;
-        if (result) {
-          previous.__wrapped__ = clone;
-        } else {
-          result = clone;
-        }
-        var previous = clone;
-        parent = parent.__wrapped__;
-      }
-      previous.__wrapped__ = value;
-      return result;
-    }
-
-    /**
-     * This method is the wrapper version of `_.reverse`.
-     *
-     * **Note:** This method mutates the wrapped array.
-     *
-     * @name reverse
-     * @memberOf _
-     * @since 0.1.0
-     * @category Seq
-     * @returns {Object} Returns the new `lodash` wrapper instance.
-     * @example
-     *
-     * var array = [1, 2, 3];
-     *
-     * _(array).reverse().value()
-     * // => [3, 2, 1]
-     *
-     * console.log(array);
-     * // => [3, 2, 1]
-     */
-    function wrapperReverse() {
-      var value = this.__wrapped__;
-      if (value instanceof LazyWrapper) {
-        var wrapped = value;
-        if (this.__actions__.length) {
-          wrapped = new LazyWrapper(this);
-        }
-        wrapped = wrapped.reverse();
-        wrapped.__actions__.push({
-          'func': thru,
-          'args': [reverse],
-          'thisArg': undefined
-        });
-        return new LodashWrapper(wrapped, this.__chain__);
-      }
-      return this.thru(reverse);
-    }
-
-    /**
-     * Executes the chain sequence to resolve the unwrapped value.
-     *
-     * @name value
-     * @memberOf _
-     * @since 0.1.0
-     * @alias toJSON, valueOf
-     * @category Seq
-     * @returns {*} Returns the resolved unwrapped value.
-     * @example
-     *
-     * _([1, 2, 3]).value();
-     * // => [1, 2, 3]
-     */
-    function wrapperValue() {
-      return baseWrapperValue(this.__wrapped__, this.__actions__);
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Creates an object composed of keys generated from the results of running
-     * each element of `collection` thru `iteratee`. The corresponding value of
-     * each key is the number of times the key was returned by `iteratee`. The
-     * iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.5.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee to transform keys.
-     * @returns {Object} Returns the composed aggregate object.
-     * @example
-     *
-     * _.countBy([6.1, 4.2, 6.3], Math.floor);
-     * // => { '4': 1, '6': 2 }
-     *
-     * _.countBy(['one', 'two', 'three'], 'length');
-     * // => { '3': 2, '5': 1 }
-     */
-    var countBy = createAggregator(function(result, value, key) {
-      hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
-    });
-
-    /**
-     * Checks if `predicate` returns truthy for **all** elements of `collection`.
-     * Iteration is stopped once `predicate` returns falsey. The predicate is
-     * invoked with three arguments: (value, index|key, collection).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {boolean} Returns `true` if all elements pass the predicate check,
-     *  else `false`.
-     * @example
-     *
-     * _.every([true, 1, null, 'yes'], Boolean);
-     * // => false
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36, 'active': false },
-     *   { 'user': 'fred',   'age': 40, 'active': false }
-     * ];
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.every(users, { 'user': 'barney', 'active': false });
-     * // => false
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.every(users, ['active', false]);
-     * // => true
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.every(users, 'active');
-     * // => false
-     */
-    function every(collection, predicate, guard) {
-      var func = isArray(collection) ? arrayEvery : baseEvery;
-      if (guard && isIterateeCall(collection, predicate, guard)) {
-        predicate = undefined;
-      }
-      return func(collection, getIteratee(predicate, 3));
-    }
-
-    /**
-     * Iterates over elements of `collection`, returning an array of all elements
-     * `predicate` returns truthy for. The predicate is invoked with three
-     * arguments: (value, index|key, collection).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new filtered array.
-     * @see _.reject
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36, 'active': true },
-     *   { 'user': 'fred',   'age': 40, 'active': false }
-     * ];
-     *
-     * _.filter(users, function(o) { return !o.active; });
-     * // => objects for ['fred']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.filter(users, { 'age': 36, 'active': true });
-     * // => objects for ['barney']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.filter(users, ['active', false]);
-     * // => objects for ['fred']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.filter(users, 'active');
-     * // => objects for ['barney']
-     */
-    function filter(collection, predicate) {
-      var func = isArray(collection) ? arrayFilter : baseFilter;
-      return func(collection, getIteratee(predicate, 3));
-    }
-
-    /**
-     * Iterates over elements of `collection`, returning the first element
-     * `predicate` returns truthy for. The predicate is invoked with three
-     * arguments: (value, index|key, collection).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {*} Returns the matched element, else `undefined`.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'age': 36, 'active': true },
-     *   { 'user': 'fred',    'age': 40, 'active': false },
-     *   { 'user': 'pebbles', 'age': 1,  'active': true }
-     * ];
-     *
-     * _.find(users, function(o) { return o.age < 40; });
-     * // => object for 'barney'
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.find(users, { 'age': 1, 'active': true });
-     * // => object for 'pebbles'
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.find(users, ['active', false]);
-     * // => object for 'fred'
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.find(users, 'active');
-     * // => object for 'barney'
-     */
-    function find(collection, predicate) {
-      predicate = getIteratee(predicate, 3);
-      if (isArray(collection)) {
-        var index = baseFindIndex(collection, predicate);
-        return index > -1 ? collection[index] : undefined;
-      }
-      return baseFind(collection, predicate, baseEach);
-    }
-
-    /**
-     * This method is like `_.find` except that it iterates over elements of
-     * `collection` from right to left.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {*} Returns the matched element, else `undefined`.
-     * @example
-     *
-     * _.findLast([1, 2, 3, 4], function(n) {
-     *   return n % 2 == 1;
-     * });
-     * // => 3
-     */
-    function findLast(collection, predicate) {
-      predicate = getIteratee(predicate, 3);
-      if (isArray(collection)) {
-        var index = baseFindIndex(collection, predicate, true);
-        return index > -1 ? collection[index] : undefined;
-      }
-      return baseFind(collection, predicate, baseEachRight);
-    }
-
-    /**
-     * Creates a flattened array of values by running each element in `collection`
-     * thru `iteratee` and flattening the mapped results. The iteratee is invoked
-     * with three arguments: (value, index|key, collection).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * function duplicate(n) {
-     *   return [n, n];
-     * }
-     *
-     * _.flatMap([1, 2], duplicate);
-     * // => [1, 1, 2, 2]
-     */
-    function flatMap(collection, iteratee) {
-      return baseFlatten(map(collection, iteratee), 1);
-    }
-
-    /**
-     * This method is like `_.flatMap` except that it recursively flattens the
-     * mapped results.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.7.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * function duplicate(n) {
-     *   return [[[n, n]]];
-     * }
-     *
-     * _.flatMapDeep([1, 2], duplicate);
-     * // => [1, 1, 2, 2]
-     */
-    function flatMapDeep(collection, iteratee) {
-      return baseFlatten(map(collection, iteratee), INFINITY);
-    }
-
-    /**
-     * This method is like `_.flatMap` except that it recursively flattens the
-     * mapped results up to `depth` times.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.7.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @param {number} [depth=1] The maximum recursion depth.
-     * @returns {Array} Returns the new flattened array.
-     * @example
-     *
-     * function duplicate(n) {
-     *   return [[[n, n]]];
-     * }
-     *
-     * _.flatMapDepth([1, 2], duplicate, 2);
-     * // => [[1, 1], [2, 2]]
-     */
-    function flatMapDepth(collection, iteratee, depth) {
-      depth = depth === undefined ? 1 : toInteger(depth);
-      return baseFlatten(map(collection, iteratee), depth);
-    }
-
-    /**
-     * Iterates over elements of `collection` and invokes `iteratee` for each element.
-     * The iteratee is invoked with three arguments: (value, index|key, collection).
-     * Iteratee functions may exit iteration early by explicitly returning `false`.
-     *
-     * **Note:** As with other "Collections" methods, objects with a "length"
-     * property are iterated like arrays. To avoid this behavior use `_.forIn`
-     * or `_.forOwn` for object iteration.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @alias each
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Array|Object} Returns `collection`.
-     * @see _.forEachRight
-     * @example
-     *
-     * _([1, 2]).forEach(function(value) {
-     *   console.log(value);
-     * });
-     * // => Logs `1` then `2`.
-     *
-     * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
-     *   console.log(key);
-     * });
-     * // => Logs 'a' then 'b' (iteration order is not guaranteed).
-     */
-    function forEach(collection, iteratee) {
-      return (typeof iteratee == 'function' && isArray(collection))
-        ? arrayEach(collection, iteratee)
-        : baseEach(collection, getIteratee(iteratee));
-    }
-
-    /**
-     * This method is like `_.forEach` except that it iterates over elements of
-     * `collection` from right to left.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @alias eachRight
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Array|Object} Returns `collection`.
-     * @see _.forEach
-     * @example
-     *
-     * _.forEachRight([1, 2], function(value) {
-     *   console.log(value);
-     * });
-     * // => Logs `2` then `1`.
-     */
-    function forEachRight(collection, iteratee) {
-      return (typeof iteratee == 'function' && isArray(collection))
-        ? arrayEachRight(collection, iteratee)
-        : baseEachRight(collection, getIteratee(iteratee));
-    }
-
-    /**
-     * Creates an object composed of keys generated from the results of running
-     * each element of `collection` thru `iteratee`. The order of grouped values
-     * is determined by the order they occur in `collection`. The corresponding
-     * value of each key is an array of elements responsible for generating the
-     * key. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee to transform keys.
-     * @returns {Object} Returns the composed aggregate object.
-     * @example
-     *
-     * _.groupBy([6.1, 4.2, 6.3], Math.floor);
-     * // => { '4': [4.2], '6': [6.1, 6.3] }
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.groupBy(['one', 'two', 'three'], 'length');
-     * // => { '3': ['one', 'two'], '5': ['three'] }
-     */
-    var groupBy = createAggregator(function(result, value, key) {
-      if (hasOwnProperty.call(result, key)) {
-        result[key].push(value);
-      } else {
-        result[key] = [value];
-      }
-    });
-
-    /**
-     * Checks if `value` is in `collection`. If `collection` is a string, it's
-     * checked for a substring of `value`, otherwise
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * is used for equality comparisons. If `fromIndex` is negative, it's used as
-     * the offset from the end of `collection`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object|string} collection The collection to search.
-     * @param {*} value The value to search for.
-     * @param {number} [fromIndex=0] The index to search from.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
-     * @returns {boolean} Returns `true` if `value` is found, else `false`.
-     * @example
-     *
-     * _.includes([1, 2, 3], 1);
-     * // => true
-     *
-     * _.includes([1, 2, 3], 1, 2);
-     * // => false
-     *
-     * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
-     * // => true
-     *
-     * _.includes('pebbles', 'eb');
-     * // => true
-     */
-    function includes(collection, value, fromIndex, guard) {
-      collection = isArrayLike(collection) ? collection : values(collection);
-      fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
-
-      var length = collection.length;
-      if (fromIndex < 0) {
-        fromIndex = nativeMax(length + fromIndex, 0);
-      }
-      return isString(collection)
-        ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
-        : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
-    }
-
-    /**
-     * Invokes the method at `path` of each element in `collection`, returning
-     * an array of the results of each invoked method. Any additional arguments
-     * are provided to each invoked method. If `methodName` is a function, it's
-     * invoked for and `this` bound to, each element in `collection`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|string} path The path of the method to invoke or
-     *  the function invoked per iteration.
-     * @param {...*} [args] The arguments to invoke each method with.
-     * @returns {Array} Returns the array of results.
-     * @example
-     *
-     * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
-     * // => [[1, 5, 7], [1, 2, 3]]
-     *
-     * _.invokeMap([123, 456], String.prototype.split, '');
-     * // => [['1', '2', '3'], ['4', '5', '6']]
-     */
-    var invokeMap = rest(function(collection, path, args) {
-      var index = -1,
-          isFunc = typeof path == 'function',
-          isProp = isKey(path),
-          result = isArrayLike(collection) ? Array(collection.length) : [];
-
-      baseEach(collection, function(value) {
-        var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
-        result[++index] = func ? apply(func, value, args) : baseInvoke(value, path, args);
-      });
-      return result;
-    });
-
-    /**
-     * Creates an object composed of keys generated from the results of running
-     * each element of `collection` thru `iteratee`. The corresponding value of
-     * each key is the last element responsible for generating the key. The
-     * iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee to transform keys.
-     * @returns {Object} Returns the composed aggregate object.
-     * @example
-     *
-     * var array = [
-     *   { 'dir': 'left', 'code': 97 },
-     *   { 'dir': 'right', 'code': 100 }
-     * ];
-     *
-     * _.keyBy(array, function(o) {
-     *   return String.fromCharCode(o.code);
-     * });
-     * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
-     *
-     * _.keyBy(array, 'dir');
-     * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
-     */
-    var keyBy = createAggregator(function(result, value, key) {
-      result[key] = value;
-    });
-
-    /**
-     * Creates an array of values by running each element in `collection` thru
-     * `iteratee`. The iteratee is invoked with three arguments:
-     * (value, index|key, collection).
-     *
-     * Many lodash methods are guarded to work as iteratees for methods like
-     * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
-     *
-     * The guarded methods are:
-     * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
-     * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
-     * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
-     * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new mapped array.
-     * @example
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * _.map([4, 8], square);
-     * // => [16, 64]
-     *
-     * _.map({ 'a': 4, 'b': 8 }, square);
-     * // => [16, 64] (iteration order is not guaranteed)
-     *
-     * var users = [
-     *   { 'user': 'barney' },
-     *   { 'user': 'fred' }
-     * ];
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.map(users, 'user');
-     * // => ['barney', 'fred']
-     */
-    function map(collection, iteratee) {
-      var func = isArray(collection) ? arrayMap : baseMap;
-      return func(collection, getIteratee(iteratee, 3));
-    }
-
-    /**
-     * This method is like `_.sortBy` except that it allows specifying the sort
-     * orders of the iteratees to sort by. If `orders` is unspecified, all values
-     * are sorted in ascending order. Otherwise, specify an order of "desc" for
-     * descending or "asc" for ascending sort order of corresponding values.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
-     *  The iteratees to sort by.
-     * @param {string[]} [orders] The sort orders of `iteratees`.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
-     * @returns {Array} Returns the new sorted array.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'fred',   'age': 48 },
-     *   { 'user': 'barney', 'age': 34 },
-     *   { 'user': 'fred',   'age': 40 },
-     *   { 'user': 'barney', 'age': 36 }
-     * ];
-     *
-     * // Sort by `user` in ascending order and by `age` in descending order.
-     * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
-     * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
-     */
-    function orderBy(collection, iteratees, orders, guard) {
-      if (collection == null) {
-        return [];
-      }
-      if (!isArray(iteratees)) {
-        iteratees = iteratees == null ? [] : [iteratees];
-      }
-      orders = guard ? undefined : orders;
-      if (!isArray(orders)) {
-        orders = orders == null ? [] : [orders];
-      }
-      return baseOrderBy(collection, iteratees, orders);
-    }
-
-    /**
-     * Creates an array of elements split into two groups, the first of which
-     * contains elements `predicate` returns truthy for, the second of which
-     * contains elements `predicate` returns falsey for. The predicate is
-     * invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the array of grouped elements.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney',  'age': 36, 'active': false },
-     *   { 'user': 'fred',    'age': 40, 'active': true },
-     *   { 'user': 'pebbles', 'age': 1,  'active': false }
-     * ];
-     *
-     * _.partition(users, function(o) { return o.active; });
-     * // => objects for [['fred'], ['barney', 'pebbles']]
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.partition(users, { 'age': 1, 'active': false });
-     * // => objects for [['pebbles'], ['barney', 'fred']]
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.partition(users, ['active', false]);
-     * // => objects for [['barney', 'pebbles'], ['fred']]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.partition(users, 'active');
-     * // => objects for [['fred'], ['barney', 'pebbles']]
-     */
-    var partition = createAggregator(function(result, value, key) {
-      result[key ? 0 : 1].push(value);
-    }, function() { return [[], []]; });
-
-    /**
-     * Reduces `collection` to a value which is the accumulated result of running
-     * each element in `collection` thru `iteratee`, where each successive
-     * invocation is supplied the return value of the previous. If `accumulator`
-     * is not given, the first element of `collection` is used as the initial
-     * value. The iteratee is invoked with four arguments:
-     * (accumulator, value, index|key, collection).
-     *
-     * Many lodash methods are guarded to work as iteratees for methods like
-     * `_.reduce`, `_.reduceRight`, and `_.transform`.
-     *
-     * The guarded methods are:
-     * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
-     * and `sortBy`
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @param {*} [accumulator] The initial value.
-     * @returns {*} Returns the accumulated value.
-     * @see _.reduceRight
-     * @example
-     *
-     * _.reduce([1, 2], function(sum, n) {
-     *   return sum + n;
-     * }, 0);
-     * // => 3
-     *
-     * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
-     *   (result[value] || (result[value] = [])).push(key);
-     *   return result;
-     * }, {});
-     * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
-     */
-    function reduce(collection, iteratee, accumulator) {
-      var func = isArray(collection) ? arrayReduce : baseReduce,
-          initAccum = arguments.length < 3;
-
-      return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
-    }
-
-    /**
-     * This method is like `_.reduce` except that it iterates over elements of
-     * `collection` from right to left.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @param {*} [accumulator] The initial value.
-     * @returns {*} Returns the accumulated value.
-     * @see _.reduce
-     * @example
-     *
-     * var array = [[0, 1], [2, 3], [4, 5]];
-     *
-     * _.reduceRight(array, function(flattened, other) {
-     *   return flattened.concat(other);
-     * }, []);
-     * // => [4, 5, 2, 3, 0, 1]
-     */
-    function reduceRight(collection, iteratee, accumulator) {
-      var func = isArray(collection) ? arrayReduceRight : baseReduce,
-          initAccum = arguments.length < 3;
-
-      return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
-    }
-
-    /**
-     * The opposite of `_.filter`; this method returns the elements of `collection`
-     * that `predicate` does **not** return truthy for.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Array} Returns the new filtered array.
-     * @see _.filter
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36, 'active': false },
-     *   { 'user': 'fred',   'age': 40, 'active': true }
-     * ];
-     *
-     * _.reject(users, function(o) { return !o.active; });
-     * // => objects for ['fred']
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.reject(users, { 'age': 40, 'active': true });
-     * // => objects for ['barney']
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.reject(users, ['active', false]);
-     * // => objects for ['fred']
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.reject(users, 'active');
-     * // => objects for ['barney']
-     */
-    function reject(collection, predicate) {
-      var func = isArray(collection) ? arrayFilter : baseFilter;
-      predicate = getIteratee(predicate, 3);
-      return func(collection, function(value, index, collection) {
-        return !predicate(value, index, collection);
-      });
-    }
-
-    /**
-     * Gets a random element from `collection`.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to sample.
-     * @returns {*} Returns the random element.
-     * @example
-     *
-     * _.sample([1, 2, 3, 4]);
-     * // => 2
-     */
-    function sample(collection) {
-      var array = isArrayLike(collection) ? collection : values(collection),
-          length = array.length;
-
-      return length > 0 ? array[baseRandom(0, length - 1)] : undefined;
-    }
-
-    /**
-     * Gets `n` random elements at unique keys from `collection` up to the
-     * size of `collection`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to sample.
-     * @param {number} [n=1] The number of elements to sample.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the random elements.
-     * @example
-     *
-     * _.sampleSize([1, 2, 3], 2);
-     * // => [3, 1]
-     *
-     * _.sampleSize([1, 2, 3], 4);
-     * // => [2, 3, 1]
-     */
-    function sampleSize(collection, n, guard) {
-      var index = -1,
-          result = toArray(collection),
-          length = result.length,
-          lastIndex = length - 1;
-
-      if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
-        n = 1;
-      } else {
-        n = baseClamp(toInteger(n), 0, length);
-      }
-      while (++index < n) {
-        var rand = baseRandom(index, lastIndex),
-            value = result[rand];
-
-        result[rand] = result[index];
-        result[index] = value;
-      }
-      result.length = n;
-      return result;
-    }
-
-    /**
-     * Creates an array of shuffled values, using a version of the
-     * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to shuffle.
-     * @returns {Array} Returns the new shuffled array.
-     * @example
-     *
-     * _.shuffle([1, 2, 3, 4]);
-     * // => [4, 1, 3, 2]
-     */
-    function shuffle(collection) {
-      return sampleSize(collection, MAX_ARRAY_LENGTH);
-    }
-
-    /**
-     * Gets the size of `collection` by returning its length for array-like
-     * values or the number of own enumerable string keyed properties for objects.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to inspect.
-     * @returns {number} Returns the collection size.
-     * @example
-     *
-     * _.size([1, 2, 3]);
-     * // => 3
-     *
-     * _.size({ 'a': 1, 'b': 2 });
-     * // => 2
-     *
-     * _.size('pebbles');
-     * // => 7
-     */
-    function size(collection) {
-      if (collection == null) {
-        return 0;
-      }
-      if (isArrayLike(collection)) {
-        var result = collection.length;
-        return (result && isString(collection)) ? stringSize(collection) : result;
-      }
-      if (isObjectLike(collection)) {
-        var tag = getTag(collection);
-        if (tag == mapTag || tag == setTag) {
-          return collection.size;
-        }
-      }
-      return keys(collection).length;
-    }
-
-    /**
-     * Checks if `predicate` returns truthy for **any** element of `collection`.
-     * Iteration is stopped once `predicate` returns truthy. The predicate is
-     * invoked with three arguments: (value, index|key, collection).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {boolean} Returns `true` if any element passes the predicate check,
-     *  else `false`.
-     * @example
-     *
-     * _.some([null, 0, 'yes', false], Boolean);
-     * // => true
-     *
-     * var users = [
-     *   { 'user': 'barney', 'active': true },
-     *   { 'user': 'fred',   'active': false }
-     * ];
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.some(users, { 'user': 'barney', 'active': false });
-     * // => false
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.some(users, ['active', false]);
-     * // => true
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.some(users, 'active');
-     * // => true
-     */
-    function some(collection, predicate, guard) {
-      var func = isArray(collection) ? arraySome : baseSome;
-      if (guard && isIterateeCall(collection, predicate, guard)) {
-        predicate = undefined;
-      }
-      return func(collection, getIteratee(predicate, 3));
-    }
-
-    /**
-     * Creates an array of elements, sorted in ascending order by the results of
-     * running each element in a collection thru each iteratee. This method
-     * performs a stable sort, that is, it preserves the original sort order of
-     * equal elements. The iteratees are invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Collection
-     * @param {Array|Object} collection The collection to iterate over.
-     * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
-     *  [iteratees=[_.identity]] The iteratees to sort by.
-     * @returns {Array} Returns the new sorted array.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'fred',   'age': 48 },
-     *   { 'user': 'barney', 'age': 36 },
-     *   { 'user': 'fred',   'age': 40 },
-     *   { 'user': 'barney', 'age': 34 }
-     * ];
-     *
-     * _.sortBy(users, function(o) { return o.user; });
-     * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
-     *
-     * _.sortBy(users, ['user', 'age']);
-     * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
-     *
-     * _.sortBy(users, 'user', function(o) {
-     *   return Math.floor(o.age / 10);
-     * });
-     * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
-     */
-    var sortBy = rest(function(collection, iteratees) {
-      if (collection == null) {
-        return [];
-      }
-      var length = iteratees.length;
-      if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
-        iteratees = [];
-      } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
-        iteratees = [iteratees[0]];
-      }
-      iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
-        ? iteratees[0]
-        : baseFlatten(iteratees, 1, isFlattenableIteratee);
-
-      return baseOrderBy(collection, iteratees, []);
-    });
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Gets the timestamp of the number of milliseconds that have elapsed since
-     * the Unix epoch (1 January 1970 00:00:00 UTC).
-     *
-     * @static
-     * @memberOf _
-     * @since 2.4.0
-     * @type {Function}
-     * @category Date
-     * @returns {number} Returns the timestamp.
-     * @example
-     *
-     * _.defer(function(stamp) {
-     *   console.log(_.now() - stamp);
-     * }, _.now());
-     * // => Logs the number of milliseconds it took for the deferred function to be invoked.
-     */
-    var now = Date.now;
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * The opposite of `_.before`; this method creates a function that invokes
-     * `func` once it's called `n` or more times.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {number} n The number of calls before `func` is invoked.
-     * @param {Function} func The function to restrict.
-     * @returns {Function} Returns the new restricted function.
-     * @example
-     *
-     * var saves = ['profile', 'settings'];
-     *
-     * var done = _.after(saves.length, function() {
-     *   console.log('done saving!');
-     * });
-     *
-     * _.forEach(saves, function(type) {
-     *   asyncSave({ 'type': type, 'complete': done });
-     * });
-     * // => Logs 'done saving!' after the two async saves have completed.
-     */
-    function after(n, func) {
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      n = toInteger(n);
-      return function() {
-        if (--n < 1) {
-          return func.apply(this, arguments);
-        }
-      };
-    }
-
-    /**
-     * Creates a function that invokes `func`, with up to `n` arguments,
-     * ignoring any additional arguments.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Function
-     * @param {Function} func The function to cap arguments for.
-     * @param {number} [n=func.length] The arity cap.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * _.map(['6', '8', '10'], _.ary(parseInt, 1));
-     * // => [6, 8, 10]
-     */
-    function ary(func, n, guard) {
-      n = guard ? undefined : n;
-      n = (func && n == null) ? func.length : n;
-      return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
-    }
-
-    /**
-     * Creates a function that invokes `func`, with the `this` binding and arguments
-     * of the created function, while it's called less than `n` times. Subsequent
-     * calls to the created function return the result of the last `func` invocation.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Function
-     * @param {number} n The number of calls at which `func` is no longer invoked.
-     * @param {Function} func The function to restrict.
-     * @returns {Function} Returns the new restricted function.
-     * @example
-     *
-     * jQuery(element).on('click', _.before(5, addContactToList));
-     * // => allows adding up to 4 contacts to the list
-     */
-    function before(n, func) {
-      var result;
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      n = toInteger(n);
-      return function() {
-        if (--n > 0) {
-          result = func.apply(this, arguments);
-        }
-        if (n <= 1) {
-          func = undefined;
-        }
-        return result;
-      };
-    }
-
-    /**
-     * Creates a function that invokes `func` with the `this` binding of `thisArg`
-     * and `partials` prepended to the arguments it receives.
-     *
-     * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
-     * may be used as a placeholder for partially applied arguments.
-     *
-     * **Note:** Unlike native `Function#bind` this method doesn't set the "length"
-     * property of bound functions.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to bind.
-     * @param {*} thisArg The `this` binding of `func`.
-     * @param {...*} [partials] The arguments to be partially applied.
-     * @returns {Function} Returns the new bound function.
-     * @example
-     *
-     * var greet = function(greeting, punctuation) {
-     *   return greeting + ' ' + this.user + punctuation;
-     * };
-     *
-     * var object = { 'user': 'fred' };
-     *
-     * var bound = _.bind(greet, object, 'hi');
-     * bound('!');
-     * // => 'hi fred!'
-     *
-     * // Bound with placeholders.
-     * var bound = _.bind(greet, object, _, '!');
-     * bound('hi');
-     * // => 'hi fred!'
-     */
-    var bind = rest(function(func, thisArg, partials) {
-      var bitmask = BIND_FLAG;
-      if (partials.length) {
-        var holders = replaceHolders(partials, getPlaceholder(bind));
-        bitmask |= PARTIAL_FLAG;
-      }
-      return createWrapper(func, bitmask, thisArg, partials, holders);
-    });
-
-    /**
-     * Creates a function that invokes the method at `object[key]` with `partials`
-     * prepended to the arguments it receives.
-     *
-     * This method differs from `_.bind` by allowing bound functions to reference
-     * methods that may be redefined or don't yet exist. See
-     * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
-     * for more details.
-     *
-     * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
-     * builds, may be used as a placeholder for partially applied arguments.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.10.0
-     * @category Function
-     * @param {Object} object The object to invoke the method on.
-     * @param {string} key The key of the method.
-     * @param {...*} [partials] The arguments to be partially applied.
-     * @returns {Function} Returns the new bound function.
-     * @example
-     *
-     * var object = {
-     *   'user': 'fred',
-     *   'greet': function(greeting, punctuation) {
-     *     return greeting + ' ' + this.user + punctuation;
-     *   }
-     * };
-     *
-     * var bound = _.bindKey(object, 'greet', 'hi');
-     * bound('!');
-     * // => 'hi fred!'
-     *
-     * object.greet = function(greeting, punctuation) {
-     *   return greeting + 'ya ' + this.user + punctuation;
-     * };
-     *
-     * bound('!');
-     * // => 'hiya fred!'
-     *
-     * // Bound with placeholders.
-     * var bound = _.bindKey(object, 'greet', _, '!');
-     * bound('hi');
-     * // => 'hiya fred!'
-     */
-    var bindKey = rest(function(object, key, partials) {
-      var bitmask = BIND_FLAG | BIND_KEY_FLAG;
-      if (partials.length) {
-        var holders = replaceHolders(partials, getPlaceholder(bindKey));
-        bitmask |= PARTIAL_FLAG;
-      }
-      return createWrapper(key, bitmask, object, partials, holders);
-    });
-
-    /**
-     * Creates a function that accepts arguments of `func` and either invokes
-     * `func` returning its result, if at least `arity` number of arguments have
-     * been provided, or returns a function that accepts the remaining `func`
-     * arguments, and so on. The arity of `func` may be specified if `func.length`
-     * is not sufficient.
-     *
-     * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
-     * may be used as a placeholder for provided arguments.
-     *
-     * **Note:** This method doesn't set the "length" property of curried functions.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Function
-     * @param {Function} func The function to curry.
-     * @param {number} [arity=func.length] The arity of `func`.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Function} Returns the new curried function.
-     * @example
-     *
-     * var abc = function(a, b, c) {
-     *   return [a, b, c];
-     * };
-     *
-     * var curried = _.curry(abc);
-     *
-     * curried(1)(2)(3);
-     * // => [1, 2, 3]
-     *
-     * curried(1, 2)(3);
-     * // => [1, 2, 3]
-     *
-     * curried(1, 2, 3);
-     * // => [1, 2, 3]
-     *
-     * // Curried with placeholders.
-     * curried(1)(_, 3)(2);
-     * // => [1, 2, 3]
-     */
-    function curry(func, arity, guard) {
-      arity = guard ? undefined : arity;
-      var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
-      result.placeholder = curry.placeholder;
-      return result;
-    }
-
-    /**
-     * This method is like `_.curry` except that arguments are applied to `func`
-     * in the manner of `_.partialRight` instead of `_.partial`.
-     *
-     * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
-     * builds, may be used as a placeholder for provided arguments.
-     *
-     * **Note:** This method doesn't set the "length" property of curried functions.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Function
-     * @param {Function} func The function to curry.
-     * @param {number} [arity=func.length] The arity of `func`.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Function} Returns the new curried function.
-     * @example
-     *
-     * var abc = function(a, b, c) {
-     *   return [a, b, c];
-     * };
-     *
-     * var curried = _.curryRight(abc);
-     *
-     * curried(3)(2)(1);
-     * // => [1, 2, 3]
-     *
-     * curried(2, 3)(1);
-     * // => [1, 2, 3]
-     *
-     * curried(1, 2, 3);
-     * // => [1, 2, 3]
-     *
-     * // Curried with placeholders.
-     * curried(3)(1, _)(2);
-     * // => [1, 2, 3]
-     */
-    function curryRight(func, arity, guard) {
-      arity = guard ? undefined : arity;
-      var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
-      result.placeholder = curryRight.placeholder;
-      return result;
-    }
-
-    /**
-     * Creates a debounced function that delays invoking `func` until after `wait`
-     * milliseconds have elapsed since the last time the debounced function was
-     * invoked. The debounced function comes with a `cancel` method to cancel
-     * delayed `func` invocations and a `flush` method to immediately invoke them.
-     * Provide an options object to indicate whether `func` should be invoked on
-     * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
-     * with the last arguments provided to the debounced function. Subsequent calls
-     * to the debounced function return the result of the last `func` invocation.
-     *
-     * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
-     * on the trailing edge of the timeout only if the debounced function is
-     * invoked more than once during the `wait` timeout.
-     *
-     * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
-     * for details over the differences between `_.debounce` and `_.throttle`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to debounce.
-     * @param {number} [wait=0] The number of milliseconds to delay.
-     * @param {Object} [options={}] The options object.
-     * @param {boolean} [options.leading=false]
-     *  Specify invoking on the leading edge of the timeout.
-     * @param {number} [options.maxWait]
-     *  The maximum time `func` is allowed to be delayed before it's invoked.
-     * @param {boolean} [options.trailing=true]
-     *  Specify invoking on the trailing edge of the timeout.
-     * @returns {Function} Returns the new debounced function.
-     * @example
-     *
-     * // Avoid costly calculations while the window size is in flux.
-     * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
-     *
-     * // Invoke `sendMail` when clicked, debouncing subsequent calls.
-     * jQuery(element).on('click', _.debounce(sendMail, 300, {
-     *   'leading': true,
-     *   'trailing': false
-     * }));
-     *
-     * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
-     * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
-     * var source = new EventSource('/stream');
-     * jQuery(source).on('message', debounced);
-     *
-     * // Cancel the trailing debounced invocation.
-     * jQuery(window).on('popstate', debounced.cancel);
-     */
-    function debounce(func, wait, options) {
-      var lastArgs,
-          lastThis,
-          maxWait,
-          result,
-          timerId,
-          lastCallTime = 0,
-          lastInvokeTime = 0,
-          leading = false,
-          maxing = false,
-          trailing = true;
-
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      wait = toNumber(wait) || 0;
-      if (isObject(options)) {
-        leading = !!options.leading;
-        maxing = 'maxWait' in options;
-        maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
-        trailing = 'trailing' in options ? !!options.trailing : trailing;
-      }
-
-      function invokeFunc(time) {
-        var args = lastArgs,
-            thisArg = lastThis;
-
-        lastArgs = lastThis = undefined;
-        lastInvokeTime = time;
-        result = func.apply(thisArg, args);
-        return result;
-      }
-
-      function leadingEdge(time) {
-        // Reset any `maxWait` timer.
-        lastInvokeTime = time;
-        // Start the timer for the trailing edge.
-        timerId = setTimeout(timerExpired, wait);
-        // Invoke the leading edge.
-        return leading ? invokeFunc(time) : result;
-      }
-
-      function remainingWait(time) {
-        var timeSinceLastCall = time - lastCallTime,
-            timeSinceLastInvoke = time - lastInvokeTime,
-            result = wait - timeSinceLastCall;
-
-        return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
-      }
-
-      function shouldInvoke(time) {
-        var timeSinceLastCall = time - lastCallTime,
-            timeSinceLastInvoke = time - lastInvokeTime;
-
-        // Either this is the first call, activity has stopped and we're at the
-        // trailing edge, the system time has gone backwards and we're treating
-        // it as the trailing edge, or we've hit the `maxWait` limit.
-        return (!lastCallTime || (timeSinceLastCall >= wait) ||
-          (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
-      }
-
-      function timerExpired() {
-        var time = now();
-        if (shouldInvoke(time)) {
-          return trailingEdge(time);
-        }
-        // Restart the timer.
-        timerId = setTimeout(timerExpired, remainingWait(time));
-      }
-
-      function trailingEdge(time) {
-        clearTimeout(timerId);
-        timerId = undefined;
-
-        // Only invoke if we have `lastArgs` which means `func` has been
-        // debounced at least once.
-        if (trailing && lastArgs) {
-          return invokeFunc(time);
-        }
-        lastArgs = lastThis = undefined;
-        return result;
-      }
-
-      function cancel() {
-        if (timerId !== undefined) {
-          clearTimeout(timerId);
-        }
-        lastCallTime = lastInvokeTime = 0;
-        lastArgs = lastThis = timerId = undefined;
-      }
-
-      function flush() {
-        return timerId === undefined ? result : trailingEdge(now());
-      }
-
-      function debounced() {
-        var time = now(),
-            isInvoking = shouldInvoke(time);
-
-        lastArgs = arguments;
-        lastThis = this;
-        lastCallTime = time;
-
-        if (isInvoking) {
-          if (timerId === undefined) {
-            return leadingEdge(lastCallTime);
-          }
-          if (maxing) {
-            // Handle invocations in a tight loop.
-            clearTimeout(timerId);
-            timerId = setTimeout(timerExpired, wait);
-            return invokeFunc(lastCallTime);
-          }
-        }
-        if (timerId === undefined) {
-          timerId = setTimeout(timerExpired, wait);
-        }
-        return result;
-      }
-      debounced.cancel = cancel;
-      debounced.flush = flush;
-      return debounced;
-    }
-
-    /**
-     * Defers invoking the `func` until the current call stack has cleared. Any
-     * additional arguments are provided to `func` when it's invoked.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to defer.
-     * @param {...*} [args] The arguments to invoke `func` with.
-     * @returns {number} Returns the timer id.
-     * @example
-     *
-     * _.defer(function(text) {
-     *   console.log(text);
-     * }, 'deferred');
-     * // => Logs 'deferred' after one or more milliseconds.
-     */
-    var defer = rest(function(func, args) {
-      return baseDelay(func, 1, args);
-    });
-
-    /**
-     * Invokes `func` after `wait` milliseconds. Any additional arguments are
-     * provided to `func` when it's invoked.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to delay.
-     * @param {number} wait The number of milliseconds to delay invocation.
-     * @param {...*} [args] The arguments to invoke `func` with.
-     * @returns {number} Returns the timer id.
-     * @example
-     *
-     * _.delay(function(text) {
-     *   console.log(text);
-     * }, 1000, 'later');
-     * // => Logs 'later' after one second.
-     */
-    var delay = rest(function(func, wait, args) {
-      return baseDelay(func, toNumber(wait) || 0, args);
-    });
-
-    /**
-     * Creates a function that invokes `func` with arguments reversed.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Function
-     * @param {Function} func The function to flip arguments for.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var flipped = _.flip(function() {
-     *   return _.toArray(arguments);
-     * });
-     *
-     * flipped('a', 'b', 'c', 'd');
-     * // => ['d', 'c', 'b', 'a']
-     */
-    function flip(func) {
-      return createWrapper(func, FLIP_FLAG);
-    }
-
-    /**
-     * Creates a function that memoizes the result of `func`. If `resolver` is
-     * provided, it determines the cache key for storing the result based on the
-     * arguments provided to the memoized function. By default, the first argument
-     * provided to the memoized function is used as the map cache key. The `func`
-     * is invoked with the `this` binding of the memoized function.
-     *
-     * **Note:** The cache is exposed as the `cache` property on the memoized
-     * function. Its creation may be customized by replacing the `_.memoize.Cache`
-     * constructor with one whose instances implement the
-     * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
-     * method interface of `delete`, `get`, `has`, and `set`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to have its output memoized.
-     * @param {Function} [resolver] The function to resolve the cache key.
-     * @returns {Function} Returns the new memoizing function.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': 2 };
-     * var other = { 'c': 3, 'd': 4 };
-     *
-     * var values = _.memoize(_.values);
-     * values(object);
-     * // => [1, 2]
-     *
-     * values(other);
-     * // => [3, 4]
-     *
-     * object.a = 2;
-     * values(object);
-     * // => [1, 2]
-     *
-     * // Modify the result cache.
-     * values.cache.set(object, ['a', 'b']);
-     * values(object);
-     * // => ['a', 'b']
-     *
-     * // Replace `_.memoize.Cache`.
-     * _.memoize.Cache = WeakMap;
-     */
-    function memoize(func, resolver) {
-      if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      var memoized = function() {
-        var args = arguments,
-            key = resolver ? resolver.apply(this, args) : args[0],
-            cache = memoized.cache;
-
-        if (cache.has(key)) {
-          return cache.get(key);
-        }
-        var result = func.apply(this, args);
-        memoized.cache = cache.set(key, result);
-        return result;
-      };
-      memoized.cache = new (memoize.Cache || MapCache);
-      return memoized;
-    }
-
-    // Assign cache to `_.memoize`.
-    memoize.Cache = MapCache;
-
-    /**
-     * Creates a function that negates the result of the predicate `func`. The
-     * `func` predicate is invoked with the `this` binding and arguments of the
-     * created function.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Function
-     * @param {Function} predicate The predicate to negate.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * function isEven(n) {
-     *   return n % 2 == 0;
-     * }
-     *
-     * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
-     * // => [1, 3, 5]
-     */
-    function negate(predicate) {
-      if (typeof predicate != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      return function() {
-        return !predicate.apply(this, arguments);
-      };
-    }
-
-    /**
-     * Creates a function that is restricted to invoking `func` once. Repeat calls
-     * to the function return the value of the first invocation. The `func` is
-     * invoked with the `this` binding and arguments of the created function.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to restrict.
-     * @returns {Function} Returns the new restricted function.
-     * @example
-     *
-     * var initialize = _.once(createApplication);
-     * initialize();
-     * initialize();
-     * // `initialize` invokes `createApplication` once
-     */
-    function once(func) {
-      return before(2, func);
-    }
-
-    /**
-     * Creates a function that invokes `func` with arguments transformed by
-     * corresponding `transforms`.
-     *
-     * @static
-     * @since 4.0.0
-     * @memberOf _
-     * @category Function
-     * @param {Function} func The function to wrap.
-     * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
-     *  [transforms[_.identity]] The functions to transform.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * function doubled(n) {
-     *   return n * 2;
-     * }
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * var func = _.overArgs(function(x, y) {
-     *   return [x, y];
-     * }, square, doubled);
-     *
-     * func(9, 3);
-     * // => [81, 6]
-     *
-     * func(10, 5);
-     * // => [100, 10]
-     */
-    var overArgs = rest(function(func, transforms) {
-      transforms = (transforms.length == 1 && isArray(transforms[0]))
-        ? arrayMap(transforms[0], baseUnary(getIteratee()))
-        : arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), baseUnary(getIteratee()));
-
-      var funcsLength = transforms.length;
-      return rest(function(args) {
-        var index = -1,
-            length = nativeMin(args.length, funcsLength);
-
-        while (++index < length) {
-          args[index] = transforms[index].call(this, args[index]);
-        }
-        return apply(func, this, args);
-      });
-    });
-
-    /**
-     * Creates a function that invokes `func` with `partials` prepended to the
-     * arguments it receives. This method is like `_.bind` except it does **not**
-     * alter the `this` binding.
-     *
-     * The `_.partial.placeholder` value, which defaults to `_` in monolithic
-     * builds, may be used as a placeholder for partially applied arguments.
-     *
-     * **Note:** This method doesn't set the "length" property of partially
-     * applied functions.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.2.0
-     * @category Function
-     * @param {Function} func The function to partially apply arguments to.
-     * @param {...*} [partials] The arguments to be partially applied.
-     * @returns {Function} Returns the new partially applied function.
-     * @example
-     *
-     * var greet = function(greeting, name) {
-     *   return greeting + ' ' + name;
-     * };
-     *
-     * var sayHelloTo = _.partial(greet, 'hello');
-     * sayHelloTo('fred');
-     * // => 'hello fred'
-     *
-     * // Partially applied with placeholders.
-     * var greetFred = _.partial(greet, _, 'fred');
-     * greetFred('hi');
-     * // => 'hi fred'
-     */
-    var partial = rest(function(func, partials) {
-      var holders = replaceHolders(partials, getPlaceholder(partial));
-      return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);
-    });
-
-    /**
-     * This method is like `_.partial` except that partially applied arguments
-     * are appended to the arguments it receives.
-     *
-     * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
-     * builds, may be used as a placeholder for partially applied arguments.
-     *
-     * **Note:** This method doesn't set the "length" property of partially
-     * applied functions.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.0.0
-     * @category Function
-     * @param {Function} func The function to partially apply arguments to.
-     * @param {...*} [partials] The arguments to be partially applied.
-     * @returns {Function} Returns the new partially applied function.
-     * @example
-     *
-     * var greet = function(greeting, name) {
-     *   return greeting + ' ' + name;
-     * };
-     *
-     * var greetFred = _.partialRight(greet, 'fred');
-     * greetFred('hi');
-     * // => 'hi fred'
-     *
-     * // Partially applied with placeholders.
-     * var sayHelloTo = _.partialRight(greet, 'hello', _);
-     * sayHelloTo('fred');
-     * // => 'hello fred'
-     */
-    var partialRight = rest(function(func, partials) {
-      var holders = replaceHolders(partials, getPlaceholder(partialRight));
-      return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
-    });
-
-    /**
-     * Creates a function that invokes `func` with arguments arranged according
-     * to the specified `indexes` where the argument value at the first index is
-     * provided as the first argument, the argument value at the second index is
-     * provided as the second argument, and so on.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Function
-     * @param {Function} func The function to rearrange arguments for.
-     * @param {...(number|number[])} indexes The arranged argument indexes.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var rearged = _.rearg(function(a, b, c) {
-     *   return [a, b, c];
-     * }, 2, 0, 1);
-     *
-     * rearged('b', 'c', 'a')
-     * // => ['a', 'b', 'c']
-     */
-    var rearg = rest(function(func, indexes) {
-      return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1));
-    });
-
-    /**
-     * Creates a function that invokes `func` with the `this` binding of the
-     * created function and arguments from `start` and beyond provided as
-     * an array.
-     *
-     * **Note:** This method is based on the
-     * [rest parameter](https://mdn.io/rest_parameters).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Function
-     * @param {Function} func The function to apply a rest parameter to.
-     * @param {number} [start=func.length-1] The start position of the rest parameter.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var say = _.rest(function(what, names) {
-     *   return what + ' ' + _.initial(names).join(', ') +
-     *     (_.size(names) > 1 ? ', & ' : '') + _.last(names);
-     * });
-     *
-     * say('hello', 'fred', 'barney', 'pebbles');
-     * // => 'hello fred, barney, & pebbles'
-     */
-    function rest(func, start) {
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);
-      return function() {
-        var args = arguments,
-            index = -1,
-            length = nativeMax(args.length - start, 0),
-            array = Array(length);
-
-        while (++index < length) {
-          array[index] = args[start + index];
-        }
-        switch (start) {
-          case 0: return func.call(this, array);
-          case 1: return func.call(this, args[0], array);
-          case 2: return func.call(this, args[0], args[1], array);
-        }
-        var otherArgs = Array(start + 1);
-        index = -1;
-        while (++index < start) {
-          otherArgs[index] = args[index];
-        }
-        otherArgs[start] = array;
-        return apply(func, this, otherArgs);
-      };
-    }
-
-    /**
-     * Creates a function that invokes `func` with the `this` binding of the
-     * create function and an array of arguments much like
-     * [`Function#apply`](http://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.apply).
-     *
-     * **Note:** This method is based on the
-     * [spread operator](https://mdn.io/spread_operator).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.2.0
-     * @category Function
-     * @param {Function} func The function to spread arguments over.
-     * @param {number} [start=0] The start position of the spread.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var say = _.spread(function(who, what) {
-     *   return who + ' says ' + what;
-     * });
-     *
-     * say(['fred', 'hello']);
-     * // => 'fred says hello'
-     *
-     * var numbers = Promise.all([
-     *   Promise.resolve(40),
-     *   Promise.resolve(36)
-     * ]);
-     *
-     * numbers.then(_.spread(function(x, y) {
-     *   return x + y;
-     * }));
-     * // => a Promise of 76
-     */
-    function spread(func, start) {
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      start = start === undefined ? 0 : nativeMax(toInteger(start), 0);
-      return rest(function(args) {
-        var array = args[start],
-            otherArgs = castSlice(args, 0, start);
-
-        if (array) {
-          arrayPush(otherArgs, array);
-        }
-        return apply(func, this, otherArgs);
-      });
-    }
-
-    /**
-     * Creates a throttled function that only invokes `func` at most once per
-     * every `wait` milliseconds. The throttled function comes with a `cancel`
-     * method to cancel delayed `func` invocations and a `flush` method to
-     * immediately invoke them. Provide an options object to indicate whether
-     * `func` should be invoked on the leading and/or trailing edge of the `wait`
-     * timeout. The `func` is invoked with the last arguments provided to the
-     * throttled function. Subsequent calls to the throttled function return the
-     * result of the last `func` invocation.
-     *
-     * **Note:** If `leading` and `trailing` options are `true`, `func` is
-     * invoked on the trailing edge of the timeout only if the throttled function
-     * is invoked more than once during the `wait` timeout.
-     *
-     * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
-     * for details over the differences between `_.throttle` and `_.debounce`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {Function} func The function to throttle.
-     * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
-     * @param {Object} [options={}] The options object.
-     * @param {boolean} [options.leading=true]
-     *  Specify invoking on the leading edge of the timeout.
-     * @param {boolean} [options.trailing=true]
-     *  Specify invoking on the trailing edge of the timeout.
-     * @returns {Function} Returns the new throttled function.
-     * @example
-     *
-     * // Avoid excessively updating the position while scrolling.
-     * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
-     *
-     * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
-     * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
-     * jQuery(element).on('click', throttled);
-     *
-     * // Cancel the trailing throttled invocation.
-     * jQuery(window).on('popstate', throttled.cancel);
-     */
-    function throttle(func, wait, options) {
-      var leading = true,
-          trailing = true;
-
-      if (typeof func != 'function') {
-        throw new TypeError(FUNC_ERROR_TEXT);
-      }
-      if (isObject(options)) {
-        leading = 'leading' in options ? !!options.leading : leading;
-        trailing = 'trailing' in options ? !!options.trailing : trailing;
-      }
-      return debounce(func, wait, {
-        'leading': leading,
-        'maxWait': wait,
-        'trailing': trailing
-      });
-    }
-
-    /**
-     * Creates a function that accepts up to one argument, ignoring any
-     * additional arguments.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Function
-     * @param {Function} func The function to cap arguments for.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * _.map(['6', '8', '10'], _.unary(parseInt));
-     * // => [6, 8, 10]
-     */
-    function unary(func) {
-      return ary(func, 1);
-    }
-
-    /**
-     * Creates a function that provides `value` to the wrapper function as its
-     * first argument. Any additional arguments provided to the function are
-     * appended to those provided to the wrapper function. The wrapper is invoked
-     * with the `this` binding of the created function.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Function
-     * @param {*} value The value to wrap.
-     * @param {Function} [wrapper=identity] The wrapper function.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var p = _.wrap(_.escape, function(func, text) {
-     *   return '<p>' + func(text) + '</p>';
-     * });
-     *
-     * p('fred, barney, & pebbles');
-     * // => '<p>fred, barney, &amp; pebbles</p>'
-     */
-    function wrap(value, wrapper) {
-      wrapper = wrapper == null ? identity : wrapper;
-      return partial(wrapper, value);
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Casts `value` as an array if it's not one.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.4.0
-     * @category Lang
-     * @param {*} value The value to inspect.
-     * @returns {Array} Returns the cast array.
-     * @example
-     *
-     * _.castArray(1);
-     * // => [1]
-     *
-     * _.castArray({ 'a': 1 });
-     * // => [{ 'a': 1 }]
-     *
-     * _.castArray('abc');
-     * // => ['abc']
-     *
-     * _.castArray(null);
-     * // => [null]
-     *
-     * _.castArray(undefined);
-     * // => [undefined]
-     *
-     * _.castArray();
-     * // => []
-     *
-     * var array = [1, 2, 3];
-     * console.log(_.castArray(array) === array);
-     * // => true
-     */
-    function castArray() {
-      if (!arguments.length) {
-        return [];
-      }
-      var value = arguments[0];
-      return isArray(value) ? value : [value];
-    }
-
-    /**
-     * Creates a shallow clone of `value`.
-     *
-     * **Note:** This method is loosely based on the
-     * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
-     * and supports cloning arrays, array buffers, booleans, date objects, maps,
-     * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
-     * arrays. The own enumerable properties of `arguments` objects are cloned
-     * as plain objects. An empty object is returned for uncloneable values such
-     * as error objects, functions, DOM nodes, and WeakMaps.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to clone.
-     * @returns {*} Returns the cloned value.
-     * @see _.cloneDeep
-     * @example
-     *
-     * var objects = [{ 'a': 1 }, { 'b': 2 }];
-     *
-     * var shallow = _.clone(objects);
-     * console.log(shallow[0] === objects[0]);
-     * // => true
-     */
-    function clone(value) {
-      return baseClone(value, false, true);
-    }
-
-    /**
-     * This method is like `_.clone` except that it accepts `customizer` which
-     * is invoked to produce the cloned value. If `customizer` returns `undefined`,
-     * cloning is handled by the method instead. The `customizer` is invoked with
-     * up to four arguments; (value [, index|key, object, stack]).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to clone.
-     * @param {Function} [customizer] The function to customize cloning.
-     * @returns {*} Returns the cloned value.
-     * @see _.cloneDeepWith
-     * @example
-     *
-     * function customizer(value) {
-     *   if (_.isElement(value)) {
-     *     return value.cloneNode(false);
-     *   }
-     * }
-     *
-     * var el = _.cloneWith(document.body, customizer);
-     *
-     * console.log(el === document.body);
-     * // => false
-     * console.log(el.nodeName);
-     * // => 'BODY'
-     * console.log(el.childNodes.length);
-     * // => 0
-     */
-    function cloneWith(value, customizer) {
-      return baseClone(value, false, true, customizer);
-    }
-
-    /**
-     * This method is like `_.clone` except that it recursively clones `value`.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.0.0
-     * @category Lang
-     * @param {*} value The value to recursively clone.
-     * @returns {*} Returns the deep cloned value.
-     * @see _.clone
-     * @example
-     *
-     * var objects = [{ 'a': 1 }, { 'b': 2 }];
-     *
-     * var deep = _.cloneDeep(objects);
-     * console.log(deep[0] === objects[0]);
-     * // => false
-     */
-    function cloneDeep(value) {
-      return baseClone(value, true, true);
-    }
-
-    /**
-     * This method is like `_.cloneWith` except that it recursively clones `value`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to recursively clone.
-     * @param {Function} [customizer] The function to customize cloning.
-     * @returns {*} Returns the deep cloned value.
-     * @see _.cloneWith
-     * @example
-     *
-     * function customizer(value) {
-     *   if (_.isElement(value)) {
-     *     return value.cloneNode(true);
-     *   }
-     * }
-     *
-     * var el = _.cloneDeepWith(document.body, customizer);
-     *
-     * console.log(el === document.body);
-     * // => false
-     * console.log(el.nodeName);
-     * // => 'BODY'
-     * console.log(el.childNodes.length);
-     * // => 20
-     */
-    function cloneDeepWith(value, customizer) {
-      return baseClone(value, true, true, customizer);
-    }
-
-    /**
-     * Performs a
-     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
-     * comparison between two values to determine if they are equivalent.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
-     * @example
-     *
-     * var object = { 'user': 'fred' };
-     * var other = { 'user': 'fred' };
-     *
-     * _.eq(object, object);
-     * // => true
-     *
-     * _.eq(object, other);
-     * // => false
-     *
-     * _.eq('a', 'a');
-     * // => true
-     *
-     * _.eq('a', Object('a'));
-     * // => false
-     *
-     * _.eq(NaN, NaN);
-     * // => true
-     */
-    function eq(value, other) {
-      return value === other || (value !== value && other !== other);
-    }
-
-    /**
-     * Checks if `value` is greater than `other`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.9.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is greater than `other`,
-     *  else `false`.
-     * @see _.lt
-     * @example
-     *
-     * _.gt(3, 1);
-     * // => true
-     *
-     * _.gt(3, 3);
-     * // => false
-     *
-     * _.gt(1, 3);
-     * // => false
-     */
-    var gt = createRelationalOperation(baseGt);
-
-    /**
-     * Checks if `value` is greater than or equal to `other`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.9.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is greater than or equal to
-     *  `other`, else `false`.
-     * @see _.lte
-     * @example
-     *
-     * _.gte(3, 1);
-     * // => true
-     *
-     * _.gte(3, 3);
-     * // => true
-     *
-     * _.gte(1, 3);
-     * // => false
-     */
-    var gte = createRelationalOperation(function(value, other) {
-      return value >= other;
-    });
-
-    /**
-     * Checks if `value` is likely an `arguments` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isArguments(function() { return arguments; }());
-     * // => true
-     *
-     * _.isArguments([1, 2, 3]);
-     * // => false
-     */
-    function isArguments(value) {
-      // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
-      return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
-        (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
-    }
-
-    /**
-     * Checks if `value` is classified as an `Array` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @type {Function}
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isArray([1, 2, 3]);
-     * // => true
-     *
-     * _.isArray(document.body.children);
-     * // => false
-     *
-     * _.isArray('abc');
-     * // => false
-     *
-     * _.isArray(_.noop);
-     * // => false
-     */
-    var isArray = Array.isArray;
-
-    /**
-     * Checks if `value` is classified as an `ArrayBuffer` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isArrayBuffer(new ArrayBuffer(2));
-     * // => true
-     *
-     * _.isArrayBuffer(new Array(2));
-     * // => false
-     */
-    function isArrayBuffer(value) {
-      return isObjectLike(value) && objectToString.call(value) == arrayBufferTag;
-    }
-
-    /**
-     * Checks if `value` is array-like. A value is considered array-like if it's
-     * not a function and has a `value.length` that's an integer greater than or
-     * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
-     * @example
-     *
-     * _.isArrayLike([1, 2, 3]);
-     * // => true
-     *
-     * _.isArrayLike(document.body.children);
-     * // => true
-     *
-     * _.isArrayLike('abc');
-     * // => true
-     *
-     * _.isArrayLike(_.noop);
-     * // => false
-     */
-    function isArrayLike(value) {
-      return value != null && isLength(getLength(value)) && !isFunction(value);
-    }
-
-    /**
-     * This method is like `_.isArrayLike` except that it also checks if `value`
-     * is an object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is an array-like object,
-     *  else `false`.
-     * @example
-     *
-     * _.isArrayLikeObject([1, 2, 3]);
-     * // => true
-     *
-     * _.isArrayLikeObject(document.body.children);
-     * // => true
-     *
-     * _.isArrayLikeObject('abc');
-     * // => false
-     *
-     * _.isArrayLikeObject(_.noop);
-     * // => false
-     */
-    function isArrayLikeObject(value) {
-      return isObjectLike(value) && isArrayLike(value);
-    }
-
-    /**
-     * Checks if `value` is classified as a boolean primitive or object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isBoolean(false);
-     * // => true
-     *
-     * _.isBoolean(null);
-     * // => false
-     */
-    function isBoolean(value) {
-      return value === true || value === false ||
-        (isObjectLike(value) && objectToString.call(value) == boolTag);
-    }
-
-    /**
-     * Checks if `value` is a buffer.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
-     * @example
-     *
-     * _.isBuffer(new Buffer(2));
-     * // => true
-     *
-     * _.isBuffer(new Uint8Array(2));
-     * // => false
-     */
-    var isBuffer = !Buffer ? constant(false) : function(value) {
-      return value instanceof Buffer;
-    };
-
-    /**
-     * Checks if `value` is classified as a `Date` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isDate(new Date);
-     * // => true
-     *
-     * _.isDate('Mon April 23 2012');
-     * // => false
-     */
-    function isDate(value) {
-      return isObjectLike(value) && objectToString.call(value) == dateTag;
-    }
-
-    /**
-     * Checks if `value` is likely a DOM element.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a DOM element,
-     *  else `false`.
-     * @example
-     *
-     * _.isElement(document.body);
-     * // => true
-     *
-     * _.isElement('<body>');
-     * // => false
-     */
-    function isElement(value) {
-      return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
-    }
-
-    /**
-     * Checks if `value` is an empty object, collection, map, or set.
-     *
-     * Objects are considered empty if they have no own enumerable string keyed
-     * properties.
-     *
-     * Array-like values such as `arguments` objects, arrays, buffers, strings, or
-     * jQuery-like collections are considered empty if they have a `length` of `0`.
-     * Similarly, maps and sets are considered empty if they have a `size` of `0`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is empty, else `false`.
-     * @example
-     *
-     * _.isEmpty(null);
-     * // => true
-     *
-     * _.isEmpty(true);
-     * // => true
-     *
-     * _.isEmpty(1);
-     * // => true
-     *
-     * _.isEmpty([1, 2, 3]);
-     * // => false
-     *
-     * _.isEmpty({ 'a': 1 });
-     * // => false
-     */
-    function isEmpty(value) {
-      if (isArrayLike(value) &&
-          (isArray(value) || isString(value) || isFunction(value.splice) ||
-            isArguments(value) || isBuffer(value))) {
-        return !value.length;
-      }
-      if (isObjectLike(value)) {
-        var tag = getTag(value);
-        if (tag == mapTag || tag == setTag) {
-          return !value.size;
-        }
-      }
-      for (var key in value) {
-        if (hasOwnProperty.call(value, key)) {
-          return false;
-        }
-      }
-      return !(nonEnumShadows && keys(value).length);
-    }
-
-    /**
-     * Performs a deep comparison between two values to determine if they are
-     * equivalent.
-     *
-     * **Note:** This method supports comparing arrays, array buffers, booleans,
-     * date objects, error objects, maps, numbers, `Object` objects, regexes,
-     * sets, strings, symbols, and typed arrays. `Object` objects are compared
-     * by their own, not inherited, enumerable properties. Functions and DOM
-     * nodes are **not** supported.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if the values are equivalent,
-     *  else `false`.
-     * @example
-     *
-     * var object = { 'user': 'fred' };
-     * var other = { 'user': 'fred' };
-     *
-     * _.isEqual(object, other);
-     * // => true
-     *
-     * object === other;
-     * // => false
-     */
-    function isEqual(value, other) {
-      return baseIsEqual(value, other);
-    }
-
-    /**
-     * This method is like `_.isEqual` except that it accepts `customizer` which
-     * is invoked to compare values. If `customizer` returns `undefined`, comparisons
-     * are handled by the method instead. The `customizer` is invoked with up to
-     * six arguments: (objValue, othValue [, index|key, object, other, stack]).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @param {Function} [customizer] The function to customize comparisons.
-     * @returns {boolean} Returns `true` if the values are equivalent,
-     *  else `false`.
-     * @example
-     *
-     * function isGreeting(value) {
-     *   return /^h(?:i|ello)$/.test(value);
-     * }
-     *
-     * function customizer(objValue, othValue) {
-     *   if (isGreeting(objValue) && isGreeting(othValue)) {
-     *     return true;
-     *   }
-     * }
-     *
-     * var array = ['hello', 'goodbye'];
-     * var other = ['hi', 'goodbye'];
-     *
-     * _.isEqualWith(array, other, customizer);
-     * // => true
-     */
-    function isEqualWith(value, other, customizer) {
-      customizer = typeof customizer == 'function' ? customizer : undefined;
-      var result = customizer ? customizer(value, other) : undefined;
-      return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
-    }
-
-    /**
-     * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
-     * `SyntaxError`, `TypeError`, or `URIError` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is an error object,
-     *  else `false`.
-     * @example
-     *
-     * _.isError(new Error);
-     * // => true
-     *
-     * _.isError(Error);
-     * // => false
-     */
-    function isError(value) {
-      if (!isObjectLike(value)) {
-        return false;
-      }
-      return (objectToString.call(value) == errorTag) ||
-        (typeof value.message == 'string' && typeof value.name == 'string');
-    }
-
-    /**
-     * Checks if `value` is a finite primitive number.
-     *
-     * **Note:** This method is based on
-     * [`Number.isFinite`](https://mdn.io/Number/isFinite).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a finite number,
-     *  else `false`.
-     * @example
-     *
-     * _.isFinite(3);
-     * // => true
-     *
-     * _.isFinite(Number.MAX_VALUE);
-     * // => true
-     *
-     * _.isFinite(3.14);
-     * // => true
-     *
-     * _.isFinite(Infinity);
-     * // => false
-     */
-    function isFinite(value) {
-      return typeof value == 'number' && nativeIsFinite(value);
-    }
-
-    /**
-     * Checks if `value` is classified as a `Function` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isFunction(_);
-     * // => true
-     *
-     * _.isFunction(/abc/);
-     * // => false
-     */
-    function isFunction(value) {
-      // The use of `Object#toString` avoids issues with the `typeof` operator
-      // in Safari 8 which returns 'object' for typed array and weak map constructors,
-      // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
-      var tag = isObject(value) ? objectToString.call(value) : '';
-      return tag == funcTag || tag == genTag;
-    }
-
-    /**
-     * Checks if `value` is an integer.
-     *
-     * **Note:** This method is based on
-     * [`Number.isInteger`](https://mdn.io/Number/isInteger).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
-     * @example
-     *
-     * _.isInteger(3);
-     * // => true
-     *
-     * _.isInteger(Number.MIN_VALUE);
-     * // => false
-     *
-     * _.isInteger(Infinity);
-     * // => false
-     *
-     * _.isInteger('3');
-     * // => false
-     */
-    function isInteger(value) {
-      return typeof value == 'number' && value == toInteger(value);
-    }
-
-    /**
-     * Checks if `value` is a valid array-like length.
-     *
-     * **Note:** This function is loosely based on
-     * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a valid length,
-     *  else `false`.
-     * @example
-     *
-     * _.isLength(3);
-     * // => true
-     *
-     * _.isLength(Number.MIN_VALUE);
-     * // => false
-     *
-     * _.isLength(Infinity);
-     * // => false
-     *
-     * _.isLength('3');
-     * // => false
-     */
-    function isLength(value) {
-      return typeof value == 'number' &&
-        value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-    }
-
-    /**
-     * Checks if `value` is the
-     * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
-     * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is an object, else `false`.
-     * @example
-     *
-     * _.isObject({});
-     * // => true
-     *
-     * _.isObject([1, 2, 3]);
-     * // => true
-     *
-     * _.isObject(_.noop);
-     * // => true
-     *
-     * _.isObject(null);
-     * // => false
-     */
-    function isObject(value) {
-      var type = typeof value;
-      return !!value && (type == 'object' || type == 'function');
-    }
-
-    /**
-     * Checks if `value` is object-like. A value is object-like if it's not `null`
-     * and has a `typeof` result of "object".
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
-     * @example
-     *
-     * _.isObjectLike({});
-     * // => true
-     *
-     * _.isObjectLike([1, 2, 3]);
-     * // => true
-     *
-     * _.isObjectLike(_.noop);
-     * // => false
-     *
-     * _.isObjectLike(null);
-     * // => false
-     */
-    function isObjectLike(value) {
-      return !!value && typeof value == 'object';
-    }
-
-    /**
-     * Checks if `value` is classified as a `Map` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isMap(new Map);
-     * // => true
-     *
-     * _.isMap(new WeakMap);
-     * // => false
-     */
-    function isMap(value) {
-      return isObjectLike(value) && getTag(value) == mapTag;
-    }
-
-    /**
-     * Performs a partial deep comparison between `object` and `source` to
-     * determine if `object` contains equivalent property values. This method is
-     * equivalent to a `_.matches` function when `source` is partially applied.
-     *
-     * **Note:** This method supports comparing the same values as `_.isEqual`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Lang
-     * @param {Object} object The object to inspect.
-     * @param {Object} source The object of property values to match.
-     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
-     * @example
-     *
-     * var object = { 'user': 'fred', 'age': 40 };
-     *
-     * _.isMatch(object, { 'age': 40 });
-     * // => true
-     *
-     * _.isMatch(object, { 'age': 36 });
-     * // => false
-     */
-    function isMatch(object, source) {
-      return object === source || baseIsMatch(object, source, getMatchData(source));
-    }
-
-    /**
-     * This method is like `_.isMatch` except that it accepts `customizer` which
-     * is invoked to compare values. If `customizer` returns `undefined`, comparisons
-     * are handled by the method instead. The `customizer` is invoked with five
-     * arguments: (objValue, srcValue, index|key, object, source).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {Object} object The object to inspect.
-     * @param {Object} source The object of property values to match.
-     * @param {Function} [customizer] The function to customize comparisons.
-     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
-     * @example
-     *
-     * function isGreeting(value) {
-     *   return /^h(?:i|ello)$/.test(value);
-     * }
-     *
-     * function customizer(objValue, srcValue) {
-     *   if (isGreeting(objValue) && isGreeting(srcValue)) {
-     *     return true;
-     *   }
-     * }
-     *
-     * var object = { 'greeting': 'hello' };
-     * var source = { 'greeting': 'hi' };
-     *
-     * _.isMatchWith(object, source, customizer);
-     * // => true
-     */
-    function isMatchWith(object, source, customizer) {
-      customizer = typeof customizer == 'function' ? customizer : undefined;
-      return baseIsMatch(object, source, getMatchData(source), customizer);
-    }
-
-    /**
-     * Checks if `value` is `NaN`.
-     *
-     * **Note:** This method is based on
-     * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
-     * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
-     * `undefined` and other non-number values.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
-     * @example
-     *
-     * _.isNaN(NaN);
-     * // => true
-     *
-     * _.isNaN(new Number(NaN));
-     * // => true
-     *
-     * isNaN(undefined);
-     * // => true
-     *
-     * _.isNaN(undefined);
-     * // => false
-     */
-    function isNaN(value) {
-      // An `NaN` primitive is the only value that is not equal to itself.
-      // Perform the `toStringTag` check first to avoid errors with some
-      // ActiveX objects in IE.
-      return isNumber(value) && value != +value;
-    }
-
-    /**
-     * Checks if `value` is a native function.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a native function,
-     *  else `false`.
-     * @example
-     *
-     * _.isNative(Array.prototype.push);
-     * // => true
-     *
-     * _.isNative(_);
-     * // => false
-     */
-    function isNative(value) {
-      if (!isObject(value)) {
-        return false;
-      }
-      var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
-      return pattern.test(toSource(value));
-    }
-
-    /**
-     * Checks if `value` is `null`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
-     * @example
-     *
-     * _.isNull(null);
-     * // => true
-     *
-     * _.isNull(void 0);
-     * // => false
-     */
-    function isNull(value) {
-      return value === null;
-    }
-
-    /**
-     * Checks if `value` is `null` or `undefined`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
-     * @example
-     *
-     * _.isNil(null);
-     * // => true
-     *
-     * _.isNil(void 0);
-     * // => true
-     *
-     * _.isNil(NaN);
-     * // => false
-     */
-    function isNil(value) {
-      return value == null;
-    }
-
-    /**
-     * Checks if `value` is classified as a `Number` primitive or object.
-     *
-     * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
-     * classified as numbers, use the `_.isFinite` method.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isNumber(3);
-     * // => true
-     *
-     * _.isNumber(Number.MIN_VALUE);
-     * // => true
-     *
-     * _.isNumber(Infinity);
-     * // => true
-     *
-     * _.isNumber('3');
-     * // => false
-     */
-    function isNumber(value) {
-      return typeof value == 'number' ||
-        (isObjectLike(value) && objectToString.call(value) == numberTag);
-    }
-
-    /**
-     * Checks if `value` is a plain object, that is, an object created by the
-     * `Object` constructor or one with a `[[Prototype]]` of `null`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.8.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a plain object,
-     *  else `false`.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     * }
-     *
-     * _.isPlainObject(new Foo);
-     * // => false
-     *
-     * _.isPlainObject([1, 2, 3]);
-     * // => false
-     *
-     * _.isPlainObject({ 'x': 0, 'y': 0 });
-     * // => true
-     *
-     * _.isPlainObject(Object.create(null));
-     * // => true
-     */
-    function isPlainObject(value) {
-      if (!isObjectLike(value) ||
-          objectToString.call(value) != objectTag || isHostObject(value)) {
-        return false;
-      }
-      var proto = getPrototype(value);
-      if (proto === null) {
-        return true;
-      }
-      var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
-      return (typeof Ctor == 'function' &&
-        Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
-    }
-
-    /**
-     * Checks if `value` is classified as a `RegExp` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.1.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isRegExp(/abc/);
-     * // => true
-     *
-     * _.isRegExp('/abc/');
-     * // => false
-     */
-    function isRegExp(value) {
-      return isObject(value) && objectToString.call(value) == regexpTag;
-    }
-
-    /**
-     * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
-     * double precision number which isn't the result of a rounded unsafe integer.
-     *
-     * **Note:** This method is based on
-     * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is a safe integer,
-     *  else `false`.
-     * @example
-     *
-     * _.isSafeInteger(3);
-     * // => true
-     *
-     * _.isSafeInteger(Number.MIN_VALUE);
-     * // => false
-     *
-     * _.isSafeInteger(Infinity);
-     * // => false
-     *
-     * _.isSafeInteger('3');
-     * // => false
-     */
-    function isSafeInteger(value) {
-      return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
-    }
-
-    /**
-     * Checks if `value` is classified as a `Set` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isSet(new Set);
-     * // => true
-     *
-     * _.isSet(new WeakSet);
-     * // => false
-     */
-    function isSet(value) {
-      return isObjectLike(value) && getTag(value) == setTag;
-    }
-
-    /**
-     * Checks if `value` is classified as a `String` primitive or object.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isString('abc');
-     * // => true
-     *
-     * _.isString(1);
-     * // => false
-     */
-    function isString(value) {
-      return typeof value == 'string' ||
-        (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
-    }
-
-    /**
-     * Checks if `value` is classified as a `Symbol` primitive or object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isSymbol(Symbol.iterator);
-     * // => true
-     *
-     * _.isSymbol('abc');
-     * // => false
-     */
-    function isSymbol(value) {
-      return typeof value == 'symbol' ||
-        (isObjectLike(value) && objectToString.call(value) == symbolTag);
-    }
-
-    /**
-     * Checks if `value` is classified as a typed array.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isTypedArray(new Uint8Array);
-     * // => true
-     *
-     * _.isTypedArray([]);
-     * // => false
-     */
-    function isTypedArray(value) {
-      return isObjectLike(value) &&
-        isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
-    }
-
-    /**
-     * Checks if `value` is `undefined`.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
-     * @example
-     *
-     * _.isUndefined(void 0);
-     * // => true
-     *
-     * _.isUndefined(null);
-     * // => false
-     */
-    function isUndefined(value) {
-      return value === undefined;
-    }
-
-    /**
-     * Checks if `value` is classified as a `WeakMap` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isWeakMap(new WeakMap);
-     * // => true
-     *
-     * _.isWeakMap(new Map);
-     * // => false
-     */
-    function isWeakMap(value) {
-      return isObjectLike(value) && getTag(value) == weakMapTag;
-    }
-
-    /**
-     * Checks if `value` is classified as a `WeakSet` object.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.3.0
-     * @category Lang
-     * @param {*} value The value to check.
-     * @returns {boolean} Returns `true` if `value` is correctly classified,
-     *  else `false`.
-     * @example
-     *
-     * _.isWeakSet(new WeakSet);
-     * // => true
-     *
-     * _.isWeakSet(new Set);
-     * // => false
-     */
-    function isWeakSet(value) {
-      return isObjectLike(value) && objectToString.call(value) == weakSetTag;
-    }
-
-    /**
-     * Checks if `value` is less than `other`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.9.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is less than `other`,
-     *  else `false`.
-     * @see _.gt
-     * @example
-     *
-     * _.lt(1, 3);
-     * // => true
-     *
-     * _.lt(3, 3);
-     * // => false
-     *
-     * _.lt(3, 1);
-     * // => false
-     */
-    var lt = createRelationalOperation(baseLt);
-
-    /**
-     * Checks if `value` is less than or equal to `other`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.9.0
-     * @category Lang
-     * @param {*} value The value to compare.
-     * @param {*} other The other value to compare.
-     * @returns {boolean} Returns `true` if `value` is less than or equal to
-     *  `other`, else `false`.
-     * @see _.gte
-     * @example
-     *
-     * _.lte(1, 3);
-     * // => true
-     *
-     * _.lte(3, 3);
-     * // => true
-     *
-     * _.lte(3, 1);
-     * // => false
-     */
-    var lte = createRelationalOperation(function(value, other) {
-      return value <= other;
-    });
-
-    /**
-     * Converts `value` to an array.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Lang
-     * @param {*} value The value to convert.
-     * @returns {Array} Returns the converted array.
-     * @example
-     *
-     * _.toArray({ 'a': 1, 'b': 2 });
-     * // => [1, 2]
-     *
-     * _.toArray('abc');
-     * // => ['a', 'b', 'c']
-     *
-     * _.toArray(1);
-     * // => []
-     *
-     * _.toArray(null);
-     * // => []
-     */
-    function toArray(value) {
-      if (!value) {
-        return [];
-      }
-      if (isArrayLike(value)) {
-        return isString(value) ? stringToArray(value) : copyArray(value);
-      }
-      if (iteratorSymbol && value[iteratorSymbol]) {
-        return iteratorToArray(value[iteratorSymbol]());
-      }
-      var tag = getTag(value),
-          func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
-
-      return func(value);
-    }
-
-    /**
-     * Converts `value` to an integer.
-     *
-     * **Note:** This function is loosely based on
-     * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to convert.
-     * @returns {number} Returns the converted integer.
-     * @example
-     *
-     * _.toInteger(3);
-     * // => 3
-     *
-     * _.toInteger(Number.MIN_VALUE);
-     * // => 0
-     *
-     * _.toInteger(Infinity);
-     * // => 1.7976931348623157e+308
-     *
-     * _.toInteger('3');
-     * // => 3
-     */
-    function toInteger(value) {
-      if (!value) {
-        return value === 0 ? value : 0;
-      }
-      value = toNumber(value);
-      if (value === INFINITY || value === -INFINITY) {
-        var sign = (value < 0 ? -1 : 1);
-        return sign * MAX_INTEGER;
-      }
-      var remainder = value % 1;
-      return value === value ? (remainder ? value - remainder : value) : 0;
-    }
-
-    /**
-     * Converts `value` to an integer suitable for use as the length of an
-     * array-like object.
-     *
-     * **Note:** This method is based on
-     * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to convert.
-     * @returns {number} Returns the converted integer.
-     * @example
-     *
-     * _.toLength(3);
-     * // => 3
-     *
-     * _.toLength(Number.MIN_VALUE);
-     * // => 0
-     *
-     * _.toLength(Infinity);
-     * // => 4294967295
-     *
-     * _.toLength('3');
-     * // => 3
-     */
-    function toLength(value) {
-      return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
-    }
-
-    /**
-     * Converts `value` to a number.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to process.
-     * @returns {number} Returns the number.
-     * @example
-     *
-     * _.toNumber(3);
-     * // => 3
-     *
-     * _.toNumber(Number.MIN_VALUE);
-     * // => 5e-324
-     *
-     * _.toNumber(Infinity);
-     * // => Infinity
-     *
-     * _.toNumber('3');
-     * // => 3
-     */
-    function toNumber(value) {
-      if (typeof value == 'number') {
-        return value;
-      }
-      if (isSymbol(value)) {
-        return NAN;
-      }
-      if (isObject(value)) {
-        var other = isFunction(value.valueOf) ? value.valueOf() : value;
-        value = isObject(other) ? (other + '') : other;
-      }
-      if (typeof value != 'string') {
-        return value === 0 ? value : +value;
-      }
-      value = value.replace(reTrim, '');
-      var isBinary = reIsBinary.test(value);
-      return (isBinary || reIsOctal.test(value))
-        ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
-        : (reIsBadHex.test(value) ? NAN : +value);
-    }
-
-    /**
-     * Converts `value` to a plain object flattening inherited enumerable string
-     * keyed properties of `value` to own properties of the plain object.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Lang
-     * @param {*} value The value to convert.
-     * @returns {Object} Returns the converted plain object.
-     * @example
-     *
-     * function Foo() {
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.assign({ 'a': 1 }, new Foo);
-     * // => { 'a': 1, 'b': 2 }
-     *
-     * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
-     * // => { 'a': 1, 'b': 2, 'c': 3 }
-     */
-    function toPlainObject(value) {
-      return copyObject(value, keysIn(value));
-    }
-
-    /**
-     * Converts `value` to a safe integer. A safe integer can be compared and
-     * represented correctly.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to convert.
-     * @returns {number} Returns the converted integer.
-     * @example
-     *
-     * _.toSafeInteger(3);
-     * // => 3
-     *
-     * _.toSafeInteger(Number.MIN_VALUE);
-     * // => 0
-     *
-     * _.toSafeInteger(Infinity);
-     * // => 9007199254740991
-     *
-     * _.toSafeInteger('3');
-     * // => 3
-     */
-    function toSafeInteger(value) {
-      return baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
-    }
-
-    /**
-     * Converts `value` to a string. An empty string is returned for `null`
-     * and `undefined` values. The sign of `-0` is preserved.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Lang
-     * @param {*} value The value to process.
-     * @returns {string} Returns the string.
-     * @example
-     *
-     * _.toString(null);
-     * // => ''
-     *
-     * _.toString(-0);
-     * // => '-0'
-     *
-     * _.toString([1, 2, 3]);
-     * // => '1,2,3'
-     */
-    function toString(value) {
-      return value == null ? '' : baseToString(value);
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Assigns own enumerable string keyed properties of source objects to the
-     * destination object. Source objects are applied from left to right.
-     * Subsequent sources overwrite property assignments of previous sources.
-     *
-     * **Note:** This method mutates `object` and is loosely based on
-     * [`Object.assign`](https://mdn.io/Object/assign).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.10.0
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} [sources] The source objects.
-     * @returns {Object} Returns `object`.
-     * @see _.assignIn
-     * @example
-     *
-     * function Foo() {
-     *   this.c = 3;
-     * }
-     *
-     * function Bar() {
-     *   this.e = 5;
-     * }
-     *
-     * Foo.prototype.d = 4;
-     * Bar.prototype.f = 6;
-     *
-     * _.assign({ 'a': 1 }, new Foo, new Bar);
-     * // => { 'a': 1, 'c': 3, 'e': 5 }
-     */
-    var assign = createAssigner(function(object, source) {
-      if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
-        copyObject(source, keys(source), object);
-        return;
-      }
-      for (var key in source) {
-        if (hasOwnProperty.call(source, key)) {
-          assignValue(object, key, source[key]);
-        }
-      }
-    });
-
-    /**
-     * This method is like `_.assign` except that it iterates over own and
-     * inherited source properties.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @alias extend
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} [sources] The source objects.
-     * @returns {Object} Returns `object`.
-     * @see _.assign
-     * @example
-     *
-     * function Foo() {
-     *   this.b = 2;
-     * }
-     *
-     * function Bar() {
-     *   this.d = 4;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     * Bar.prototype.e = 5;
-     *
-     * _.assignIn({ 'a': 1 }, new Foo, new Bar);
-     * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
-     */
-    var assignIn = createAssigner(function(object, source) {
-      if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
-        copyObject(source, keysIn(source), object);
-        return;
-      }
-      for (var key in source) {
-        assignValue(object, key, source[key]);
-      }
-    });
-
-    /**
-     * This method is like `_.assignIn` except that it accepts `customizer`
-     * which is invoked to produce the assigned values. If `customizer` returns
-     * `undefined`, assignment is handled by the method instead. The `customizer`
-     * is invoked with five arguments: (objValue, srcValue, key, object, source).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @alias extendWith
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} sources The source objects.
-     * @param {Function} [customizer] The function to customize assigned values.
-     * @returns {Object} Returns `object`.
-     * @see _.assignWith
-     * @example
-     *
-     * function customizer(objValue, srcValue) {
-     *   return _.isUndefined(objValue) ? srcValue : objValue;
-     * }
-     *
-     * var defaults = _.partialRight(_.assignInWith, customizer);
-     *
-     * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
-     * // => { 'a': 1, 'b': 2 }
-     */
-    var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
-      copyObject(source, keysIn(source), object, customizer);
-    });
-
-    /**
-     * This method is like `_.assign` except that it accepts `customizer`
-     * which is invoked to produce the assigned values. If `customizer` returns
-     * `undefined`, assignment is handled by the method instead. The `customizer`
-     * is invoked with five arguments: (objValue, srcValue, key, object, source).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} sources The source objects.
-     * @param {Function} [customizer] The function to customize assigned values.
-     * @returns {Object} Returns `object`.
-     * @see _.assignInWith
-     * @example
-     *
-     * function customizer(objValue, srcValue) {
-     *   return _.isUndefined(objValue) ? srcValue : objValue;
-     * }
-     *
-     * var defaults = _.partialRight(_.assignWith, customizer);
-     *
-     * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
-     * // => { 'a': 1, 'b': 2 }
-     */
-    var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
-      copyObject(source, keys(source), object, customizer);
-    });
-
-    /**
-     * Creates an array of values corresponding to `paths` of `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.0.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {...(string|string[])} [paths] The property paths of elements to pick.
-     * @returns {Array} Returns the new array of picked elements.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
-     *
-     * _.at(object, ['a[0].b.c', 'a[1]']);
-     * // => [3, 4]
-     *
-     * _.at(['a', 'b', 'c'], 0, 2);
-     * // => ['a', 'c']
-     */
-    var at = rest(function(object, paths) {
-      return baseAt(object, baseFlatten(paths, 1));
-    });
-
-    /**
-     * Creates an object that inherits from the `prototype` object. If a
-     * `properties` object is given, its own enumerable string keyed properties
-     * are assigned to the created object.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.3.0
-     * @category Object
-     * @param {Object} prototype The object to inherit from.
-     * @param {Object} [properties] The properties to assign to the object.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * function Shape() {
-     *   this.x = 0;
-     *   this.y = 0;
-     * }
-     *
-     * function Circle() {
-     *   Shape.call(this);
-     * }
-     *
-     * Circle.prototype = _.create(Shape.prototype, {
-     *   'constructor': Circle
-     * });
-     *
-     * var circle = new Circle;
-     * circle instanceof Circle;
-     * // => true
-     *
-     * circle instanceof Shape;
-     * // => true
-     */
-    function create(prototype, properties) {
-      var result = baseCreate(prototype);
-      return properties ? baseAssign(result, properties) : result;
-    }
-
-    /**
-     * Assigns own and inherited enumerable string keyed properties of source
-     * objects to the destination object for all destination properties that
-     * resolve to `undefined`. Source objects are applied from left to right.
-     * Once a property is set, additional values of the same property are ignored.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} [sources] The source objects.
-     * @returns {Object} Returns `object`.
-     * @see _.defaultsDeep
-     * @example
-     *
-     * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
-     * // => { 'user': 'barney', 'age': 36 }
-     */
-    var defaults = rest(function(args) {
-      args.push(undefined, assignInDefaults);
-      return apply(assignInWith, undefined, args);
-    });
-
-    /**
-     * This method is like `_.defaults` except that it recursively assigns
-     * default properties.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.10.0
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} [sources] The source objects.
-     * @returns {Object} Returns `object`.
-     * @see _.defaults
-     * @example
-     *
-     * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
-     * // => { 'user': { 'name': 'barney', 'age': 36 } }
-     *
-     */
-    var defaultsDeep = rest(function(args) {
-      args.push(undefined, mergeDefaults);
-      return apply(mergeWith, undefined, args);
-    });
-
-    /**
-     * This method is like `_.find` except that it returns the key of the first
-     * element `predicate` returns truthy for instead of the element itself.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.1.0
-     * @category Object
-     * @param {Object} object The object to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {string|undefined} Returns the key of the matched element,
-     *  else `undefined`.
-     * @example
-     *
-     * var users = {
-     *   'barney':  { 'age': 36, 'active': true },
-     *   'fred':    { 'age': 40, 'active': false },
-     *   'pebbles': { 'age': 1,  'active': true }
-     * };
-     *
-     * _.findKey(users, function(o) { return o.age < 40; });
-     * // => 'barney' (iteration order is not guaranteed)
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.findKey(users, { 'age': 1, 'active': true });
-     * // => 'pebbles'
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.findKey(users, ['active', false]);
-     * // => 'fred'
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.findKey(users, 'active');
-     * // => 'barney'
-     */
-    function findKey(object, predicate) {
-      return baseFind(object, getIteratee(predicate, 3), baseForOwn, true);
-    }
-
-    /**
-     * This method is like `_.findKey` except that it iterates over elements of
-     * a collection in the opposite order.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Object
-     * @param {Object} object The object to search.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per iteration.
-     * @returns {string|undefined} Returns the key of the matched element,
-     *  else `undefined`.
-     * @example
-     *
-     * var users = {
-     *   'barney':  { 'age': 36, 'active': true },
-     *   'fred':    { 'age': 40, 'active': false },
-     *   'pebbles': { 'age': 1,  'active': true }
-     * };
-     *
-     * _.findLastKey(users, function(o) { return o.age < 40; });
-     * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.findLastKey(users, { 'age': 36, 'active': true });
-     * // => 'barney'
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.findLastKey(users, ['active', false]);
-     * // => 'fred'
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.findLastKey(users, 'active');
-     * // => 'pebbles'
-     */
-    function findLastKey(object, predicate) {
-      return baseFind(object, getIteratee(predicate, 3), baseForOwnRight, true);
-    }
-
-    /**
-     * Iterates over own and inherited enumerable string keyed properties of an
-     * object and invokes `iteratee` for each property. The iteratee is invoked
-     * with three arguments: (value, key, object). Iteratee functions may exit
-     * iteration early by explicitly returning `false`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.3.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     * @see _.forInRight
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.forIn(new Foo, function(value, key) {
-     *   console.log(key);
-     * });
-     * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
-     */
-    function forIn(object, iteratee) {
-      return object == null
-        ? object
-        : baseFor(object, getIteratee(iteratee), keysIn);
-    }
-
-    /**
-     * This method is like `_.forIn` except that it iterates over properties of
-     * `object` in the opposite order.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     * @see _.forIn
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.forInRight(new Foo, function(value, key) {
-     *   console.log(key);
-     * });
-     * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
-     */
-    function forInRight(object, iteratee) {
-      return object == null
-        ? object
-        : baseForRight(object, getIteratee(iteratee), keysIn);
-    }
-
-    /**
-     * Iterates over own enumerable string keyed properties of an object and
-     * invokes `iteratee` for each property. The iteratee is invoked with three
-     * arguments: (value, key, object). Iteratee functions may exit iteration
-     * early by explicitly returning `false`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.3.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     * @see _.forOwnRight
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.forOwn(new Foo, function(value, key) {
-     *   console.log(key);
-     * });
-     * // => Logs 'a' then 'b' (iteration order is not guaranteed).
-     */
-    function forOwn(object, iteratee) {
-      return object && baseForOwn(object, getIteratee(iteratee));
-    }
-
-    /**
-     * This method is like `_.forOwn` except that it iterates over properties of
-     * `object` in the opposite order.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.0.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Object} Returns `object`.
-     * @see _.forOwn
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.forOwnRight(new Foo, function(value, key) {
-     *   console.log(key);
-     * });
-     * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
-     */
-    function forOwnRight(object, iteratee) {
-      return object && baseForOwnRight(object, getIteratee(iteratee));
-    }
-
-    /**
-     * Creates an array of function property names from own enumerable properties
-     * of `object`.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The object to inspect.
-     * @returns {Array} Returns the new array of property names.
-     * @see _.functionsIn
-     * @example
-     *
-     * function Foo() {
-     *   this.a = _.constant('a');
-     *   this.b = _.constant('b');
-     * }
-     *
-     * Foo.prototype.c = _.constant('c');
-     *
-     * _.functions(new Foo);
-     * // => ['a', 'b']
-     */
-    function functions(object) {
-      return object == null ? [] : baseFunctions(object, keys(object));
-    }
-
-    /**
-     * Creates an array of function property names from own and inherited
-     * enumerable properties of `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The object to inspect.
-     * @returns {Array} Returns the new array of property names.
-     * @see _.functions
-     * @example
-     *
-     * function Foo() {
-     *   this.a = _.constant('a');
-     *   this.b = _.constant('b');
-     * }
-     *
-     * Foo.prototype.c = _.constant('c');
-     *
-     * _.functionsIn(new Foo);
-     * // => ['a', 'b', 'c']
-     */
-    function functionsIn(object) {
-      return object == null ? [] : baseFunctions(object, keysIn(object));
-    }
-
-    /**
-     * Gets the value at `path` of `object`. If the resolved value is
-     * `undefined`, the `defaultValue` is used in its place.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.7.0
-     * @category Object
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the property to get.
-     * @param {*} [defaultValue] The value returned for `undefined` resolved values.
-     * @returns {*} Returns the resolved value.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
-     *
-     * _.get(object, 'a[0].b.c');
-     * // => 3
-     *
-     * _.get(object, ['a', '0', 'b', 'c']);
-     * // => 3
-     *
-     * _.get(object, 'a.b.c', 'default');
-     * // => 'default'
-     */
-    function get(object, path, defaultValue) {
-      var result = object == null ? undefined : baseGet(object, path);
-      return result === undefined ? defaultValue : result;
-    }
-
-    /**
-     * Checks if `path` is a direct property of `object`.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path to check.
-     * @returns {boolean} Returns `true` if `path` exists, else `false`.
-     * @example
-     *
-     * var object = { 'a': { 'b': 2 } };
-     * var other = _.create({ 'a': _.create({ 'b': 2 }) });
-     *
-     * _.has(object, 'a');
-     * // => true
-     *
-     * _.has(object, 'a.b');
-     * // => true
-     *
-     * _.has(object, ['a', 'b']);
-     * // => true
-     *
-     * _.has(other, 'a');
-     * // => false
-     */
-    function has(object, path) {
-      return object != null && hasPath(object, path, baseHas);
-    }
-
-    /**
-     * Checks if `path` is a direct or inherited property of `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path to check.
-     * @returns {boolean} Returns `true` if `path` exists, else `false`.
-     * @example
-     *
-     * var object = _.create({ 'a': _.create({ 'b': 2 }) });
-     *
-     * _.hasIn(object, 'a');
-     * // => true
-     *
-     * _.hasIn(object, 'a.b');
-     * // => true
-     *
-     * _.hasIn(object, ['a', 'b']);
-     * // => true
-     *
-     * _.hasIn(object, 'b');
-     * // => false
-     */
-    function hasIn(object, path) {
-      return object != null && hasPath(object, path, baseHasIn);
-    }
-
-    /**
-     * Creates an object composed of the inverted keys and values of `object`.
-     * If `object` contains duplicate values, subsequent values overwrite
-     * property assignments of previous values.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.7.0
-     * @category Object
-     * @param {Object} object The object to invert.
-     * @returns {Object} Returns the new inverted object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': 2, 'c': 1 };
-     *
-     * _.invert(object);
-     * // => { '1': 'c', '2': 'b' }
-     */
-    var invert = createInverter(function(result, value, key) {
-      result[value] = key;
-    }, constant(identity));
-
-    /**
-     * This method is like `_.invert` except that the inverted object is generated
-     * from the results of running each element of `object` thru `iteratee`. The
-     * corresponding inverted value of each inverted key is an array of keys
-     * responsible for generating the inverted value. The iteratee is invoked
-     * with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.1.0
-     * @category Object
-     * @param {Object} object The object to invert.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {Object} Returns the new inverted object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': 2, 'c': 1 };
-     *
-     * _.invertBy(object);
-     * // => { '1': ['a', 'c'], '2': ['b'] }
-     *
-     * _.invertBy(object, function(value) {
-     *   return 'group' + value;
-     * });
-     * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
-     */
-    var invertBy = createInverter(function(result, value, key) {
-      if (hasOwnProperty.call(result, value)) {
-        result[value].push(key);
-      } else {
-        result[value] = [key];
-      }
-    }, getIteratee);
-
-    /**
-     * Invokes the method at `path` of `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the method to invoke.
-     * @param {...*} [args] The arguments to invoke the method with.
-     * @returns {*} Returns the result of the invoked method.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
-     *
-     * _.invoke(object, 'a[0].b.c.slice', 1, 3);
-     * // => [2, 3]
-     */
-    var invoke = rest(baseInvoke);
-
-    /**
-     * Creates an array of the own enumerable property names of `object`.
-     *
-     * **Note:** Non-object values are coerced to objects. See the
-     * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
-     * for more details.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.keys(new Foo);
-     * // => ['a', 'b'] (iteration order is not guaranteed)
-     *
-     * _.keys('hi');
-     * // => ['0', '1']
-     */
-    function keys(object) {
-      var isProto = isPrototype(object);
-      if (!(isProto || isArrayLike(object))) {
-        return baseKeys(object);
-      }
-      var indexes = indexKeys(object),
-          skipIndexes = !!indexes,
-          result = indexes || [],
-          length = result.length;
-
-      for (var key in object) {
-        if (baseHas(object, key) &&
-            !(skipIndexes && (key == 'length' || isIndex(key, length))) &&
-            !(isProto && key == 'constructor')) {
-          result.push(key);
-        }
-      }
-      return result;
-    }
-
-    /**
-     * Creates an array of the own and inherited enumerable property names of `object`.
-     *
-     * **Note:** Non-object values are coerced to objects.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property names.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.keysIn(new Foo);
-     * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
-     */
-    function keysIn(object) {
-      var index = -1,
-          isProto = isPrototype(object),
-          props = baseKeysIn(object),
-          propsLength = props.length,
-          indexes = indexKeys(object),
-          skipIndexes = !!indexes,
-          result = indexes || [],
-          length = result.length;
-
-      while (++index < propsLength) {
-        var key = props[index];
-        if (!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
-            !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
-          result.push(key);
-        }
-      }
-      return result;
-    }
-
-    /**
-     * The opposite of `_.mapValues`; this method creates an object with the
-     * same values as `object` and keys generated by running each own enumerable
-     * string keyed property of `object` thru `iteratee`. The iteratee is invoked
-     * with three arguments: (value, key, object).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.8.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Object} Returns the new mapped object.
-     * @see _.mapValues
-     * @example
-     *
-     * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
-     *   return key + value;
-     * });
-     * // => { 'a1': 1, 'b2': 2 }
-     */
-    function mapKeys(object, iteratee) {
-      var result = {};
-      iteratee = getIteratee(iteratee, 3);
-
-      baseForOwn(object, function(value, key, object) {
-        result[iteratee(value, key, object)] = value;
-      });
-      return result;
-    }
-
-    /**
-     * Creates an object with the same keys as `object` and values generated
-     * by running each own enumerable string keyed property of `object` thru
-     * `iteratee`. The iteratee is invoked with three arguments:
-     * (value, key, object).
-     *
-     * @static
-     * @memberOf _
-     * @since 2.4.0
-     * @category Object
-     * @param {Object} object The object to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The function invoked per iteration.
-     * @returns {Object} Returns the new mapped object.
-     * @see _.mapKeys
-     * @example
-     *
-     * var users = {
-     *   'fred':    { 'user': 'fred',    'age': 40 },
-     *   'pebbles': { 'user': 'pebbles', 'age': 1 }
-     * };
-     *
-     * _.mapValues(users, function(o) { return o.age; });
-     * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.mapValues(users, 'age');
-     * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
-     */
-    function mapValues(object, iteratee) {
-      var result = {};
-      iteratee = getIteratee(iteratee, 3);
-
-      baseForOwn(object, function(value, key, object) {
-        result[key] = iteratee(value, key, object);
-      });
-      return result;
-    }
-
-    /**
-     * This method is like `_.assign` except that it recursively merges own and
-     * inherited enumerable string keyed properties of source objects into the
-     * destination object. Source properties that resolve to `undefined` are
-     * skipped if a destination value exists. Array and plain object properties
-     * are merged recursively.Other objects and value types are overridden by
-     * assignment. Source objects are applied from left to right. Subsequent
-     * sources overwrite property assignments of previous sources.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.5.0
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} [sources] The source objects.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var users = {
-     *   'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
-     * };
-     *
-     * var ages = {
-     *   'data': [{ 'age': 36 }, { 'age': 40 }]
-     * };
-     *
-     * _.merge(users, ages);
-     * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
-     */
-    var merge = createAssigner(function(object, source, srcIndex) {
-      baseMerge(object, source, srcIndex);
-    });
-
-    /**
-     * This method is like `_.merge` except that it accepts `customizer` which
-     * is invoked to produce the merged values of the destination and source
-     * properties. If `customizer` returns `undefined`, merging is handled by the
-     * method instead. The `customizer` is invoked with seven arguments:
-     * (objValue, srcValue, key, object, source, stack).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The destination object.
-     * @param {...Object} sources The source objects.
-     * @param {Function} customizer The function to customize assigned values.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * function customizer(objValue, srcValue) {
-     *   if (_.isArray(objValue)) {
-     *     return objValue.concat(srcValue);
-     *   }
-     * }
-     *
-     * var object = {
-     *   'fruits': ['apple'],
-     *   'vegetables': ['beet']
-     * };
-     *
-     * var other = {
-     *   'fruits': ['banana'],
-     *   'vegetables': ['carrot']
-     * };
-     *
-     * _.mergeWith(object, other, customizer);
-     * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
-     */
-    var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
-      baseMerge(object, source, srcIndex, customizer);
-    });
-
-    /**
-     * The opposite of `_.pick`; this method creates an object composed of the
-     * own and inherited enumerable string keyed properties of `object` that are
-     * not omitted.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The source object.
-     * @param {...(string|string[])} [props] The property identifiers to omit.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': '2', 'c': 3 };
-     *
-     * _.omit(object, ['a', 'c']);
-     * // => { 'b': '2' }
-     */
-    var omit = rest(function(object, props) {
-      if (object == null) {
-        return {};
-      }
-      props = arrayMap(baseFlatten(props, 1), toKey);
-      return basePick(object, baseDifference(getAllKeysIn(object), props));
-    });
-
-    /**
-     * The opposite of `_.pickBy`; this method creates an object composed of
-     * the own and inherited enumerable string keyed properties of `object` that
-     * `predicate` doesn't return truthy for. The predicate is invoked with two
-     * arguments: (value, key).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The source object.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per property.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': '2', 'c': 3 };
-     *
-     * _.omitBy(object, _.isNumber);
-     * // => { 'b': '2' }
-     */
-    function omitBy(object, predicate) {
-      predicate = getIteratee(predicate);
-      return basePickBy(object, function(value, key) {
-        return !predicate(value, key);
-      });
-    }
-
-    /**
-     * Creates an object composed of the picked `object` properties.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The source object.
-     * @param {...(string|string[])} [props] The property identifiers to pick.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': '2', 'c': 3 };
-     *
-     * _.pick(object, ['a', 'c']);
-     * // => { 'a': 1, 'c': 3 }
-     */
-    var pick = rest(function(object, props) {
-      return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey));
-    });
-
-    /**
-     * Creates an object composed of the `object` properties `predicate` returns
-     * truthy for. The predicate is invoked with two arguments: (value, key).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The source object.
-     * @param {Array|Function|Object|string} [predicate=_.identity]
-     *  The function invoked per property.
-     * @returns {Object} Returns the new object.
-     * @example
-     *
-     * var object = { 'a': 1, 'b': '2', 'c': 3 };
-     *
-     * _.pickBy(object, _.isNumber);
-     * // => { 'a': 1, 'c': 3 }
-     */
-    function pickBy(object, predicate) {
-      return object == null ? {} : basePickBy(object, getIteratee(predicate));
-    }
-
-    /**
-     * This method is like `_.get` except that if the resolved value is a
-     * function it's invoked with the `this` binding of its parent object and
-     * its result is returned.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The object to query.
-     * @param {Array|string} path The path of the property to resolve.
-     * @param {*} [defaultValue] The value returned for `undefined` resolved values.
-     * @returns {*} Returns the resolved value.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
-     *
-     * _.result(object, 'a[0].b.c1');
-     * // => 3
-     *
-     * _.result(object, 'a[0].b.c2');
-     * // => 4
-     *
-     * _.result(object, 'a[0].b.c3', 'default');
-     * // => 'default'
-     *
-     * _.result(object, 'a[0].b.c3', _.constant('default'));
-     * // => 'default'
-     */
-    function result(object, path, defaultValue) {
-      path = isKey(path, object) ? [path] : castPath(path);
-
-      var index = -1,
-          length = path.length;
-
-      // Ensure the loop is entered when path is empty.
-      if (!length) {
-        object = undefined;
-        length = 1;
-      }
-      while (++index < length) {
-        var value = object == null ? undefined : object[toKey(path[index])];
-        if (value === undefined) {
-          index = length;
-          value = defaultValue;
-        }
-        object = isFunction(value) ? value.call(object) : value;
-      }
-      return object;
-    }
-
-    /**
-     * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
-     * it's created. Arrays are created for missing index properties while objects
-     * are created for all other missing properties. Use `_.setWith` to customize
-     * `path` creation.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.7.0
-     * @category Object
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to set.
-     * @param {*} value The value to set.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
-     *
-     * _.set(object, 'a[0].b.c', 4);
-     * console.log(object.a[0].b.c);
-     * // => 4
-     *
-     * _.set(object, ['x', '0', 'y', 'z'], 5);
-     * console.log(object.x[0].y.z);
-     * // => 5
-     */
-    function set(object, path, value) {
-      return object == null ? object : baseSet(object, path, value);
-    }
-
-    /**
-     * This method is like `_.set` except that it accepts `customizer` which is
-     * invoked to produce the objects of `path`.  If `customizer` returns `undefined`
-     * path creation is handled by the method instead. The `customizer` is invoked
-     * with three arguments: (nsValue, key, nsObject).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to set.
-     * @param {*} value The value to set.
-     * @param {Function} [customizer] The function to customize assigned values.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var object = {};
-     *
-     * _.setWith(object, '[0][1]', 'a', Object);
-     * // => { '0': { '1': 'a' } }
-     */
-    function setWith(object, path, value, customizer) {
-      customizer = typeof customizer == 'function' ? customizer : undefined;
-      return object == null ? object : baseSet(object, path, value, customizer);
-    }
-
-    /**
-     * Creates an array of own enumerable string keyed-value pairs for `object`
-     * which can be consumed by `_.fromPairs`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @alias entries
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the new array of key-value pairs.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.toPairs(new Foo);
-     * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
-     */
-    function toPairs(object) {
-      return baseToPairs(object, keys(object));
-    }
-
-    /**
-     * Creates an array of own and inherited enumerable string keyed-value pairs
-     * for `object` which can be consumed by `_.fromPairs`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @alias entriesIn
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the new array of key-value pairs.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.toPairsIn(new Foo);
-     * // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)
-     */
-    function toPairsIn(object) {
-      return baseToPairs(object, keysIn(object));
-    }
-
-    /**
-     * An alternative to `_.reduce`; this method transforms `object` to a new
-     * `accumulator` object which is the result of running each of its own
-     * enumerable string keyed properties thru `iteratee`, with each invocation
-     * potentially mutating the `accumulator` object. The iteratee is invoked
-     * with four arguments: (accumulator, value, key, object). Iteratee functions
-     * may exit iteration early by explicitly returning `false`.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.3.0
-     * @category Object
-     * @param {Array|Object} object The object to iterate over.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @param {*} [accumulator] The custom accumulator value.
-     * @returns {*} Returns the accumulated value.
-     * @example
-     *
-     * _.transform([2, 3, 4], function(result, n) {
-     *   result.push(n *= n);
-     *   return n % 2 == 0;
-     * }, []);
-     * // => [4, 9]
-     *
-     * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
-     *   (result[value] || (result[value] = [])).push(key);
-     * }, {});
-     * // => { '1': ['a', 'c'], '2': ['b'] }
-     */
-    function transform(object, iteratee, accumulator) {
-      var isArr = isArray(object) || isTypedArray(object);
-      iteratee = getIteratee(iteratee, 4);
-
-      if (accumulator == null) {
-        if (isArr || isObject(object)) {
-          var Ctor = object.constructor;
-          if (isArr) {
-            accumulator = isArray(object) ? new Ctor : [];
-          } else {
-            accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
-          }
-        } else {
-          accumulator = {};
-        }
-      }
-      (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
-        return iteratee(accumulator, value, index, object);
-      });
-      return accumulator;
-    }
-
-    /**
-     * Removes the property at `path` of `object`.
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Object
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to unset.
-     * @returns {boolean} Returns `true` if the property is deleted, else `false`.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 7 } }] };
-     * _.unset(object, 'a[0].b.c');
-     * // => true
-     *
-     * console.log(object);
-     * // => { 'a': [{ 'b': {} }] };
-     *
-     * _.unset(object, ['a', '0', 'b', 'c']);
-     * // => true
-     *
-     * console.log(object);
-     * // => { 'a': [{ 'b': {} }] };
-     */
-    function unset(object, path) {
-      return object == null ? true : baseUnset(object, path);
-    }
-
-    /**
-     * This method is like `_.set` except that accepts `updater` to produce the
-     * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
-     * is invoked with one argument: (value).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.6.0
-     * @category Object
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to set.
-     * @param {Function} updater The function to produce the updated value.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
-     *
-     * _.update(object, 'a[0].b.c', function(n) { return n * n; });
-     * console.log(object.a[0].b.c);
-     * // => 9
-     *
-     * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
-     * console.log(object.x[0].y.z);
-     * // => 0
-     */
-    function update(object, path, updater) {
-      return object == null ? object : baseUpdate(object, path, castFunction(updater));
-    }
-
-    /**
-     * This method is like `_.update` except that it accepts `customizer` which is
-     * invoked to produce the objects of `path`.  If `customizer` returns `undefined`
-     * path creation is handled by the method instead. The `customizer` is invoked
-     * with three arguments: (nsValue, key, nsObject).
-     *
-     * **Note:** This method mutates `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.6.0
-     * @category Object
-     * @param {Object} object The object to modify.
-     * @param {Array|string} path The path of the property to set.
-     * @param {Function} updater The function to produce the updated value.
-     * @param {Function} [customizer] The function to customize assigned values.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var object = {};
-     *
-     * _.updateWith(object, '[0][1]', _.constant('a'), Object);
-     * // => { '0': { '1': 'a' } }
-     */
-    function updateWith(object, path, updater, customizer) {
-      customizer = typeof customizer == 'function' ? customizer : undefined;
-      return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
-    }
-
-    /**
-     * Creates an array of the own enumerable string keyed property values of `object`.
-     *
-     * **Note:** Non-object values are coerced to objects.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property values.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.values(new Foo);
-     * // => [1, 2] (iteration order is not guaranteed)
-     *
-     * _.values('hi');
-     * // => ['h', 'i']
-     */
-    function values(object) {
-      return object ? baseValues(object, keys(object)) : [];
-    }
-
-    /**
-     * Creates an array of the own and inherited enumerable string keyed property
-     * values of `object`.
-     *
-     * **Note:** Non-object values are coerced to objects.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Object
-     * @param {Object} object The object to query.
-     * @returns {Array} Returns the array of property values.
-     * @example
-     *
-     * function Foo() {
-     *   this.a = 1;
-     *   this.b = 2;
-     * }
-     *
-     * Foo.prototype.c = 3;
-     *
-     * _.valuesIn(new Foo);
-     * // => [1, 2, 3] (iteration order is not guaranteed)
-     */
-    function valuesIn(object) {
-      return object == null ? [] : baseValues(object, keysIn(object));
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Clamps `number` within the inclusive `lower` and `upper` bounds.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Number
-     * @param {number} number The number to clamp.
-     * @param {number} [lower] The lower bound.
-     * @param {number} upper The upper bound.
-     * @returns {number} Returns the clamped number.
-     * @example
-     *
-     * _.clamp(-10, -5, 5);
-     * // => -5
-     *
-     * _.clamp(10, -5, 5);
-     * // => 5
-     */
-    function clamp(number, lower, upper) {
-      if (upper === undefined) {
-        upper = lower;
-        lower = undefined;
-      }
-      if (upper !== undefined) {
-        upper = toNumber(upper);
-        upper = upper === upper ? upper : 0;
-      }
-      if (lower !== undefined) {
-        lower = toNumber(lower);
-        lower = lower === lower ? lower : 0;
-      }
-      return baseClamp(toNumber(number), lower, upper);
-    }
-
-    /**
-     * Checks if `n` is between `start` and up to, but not including, `end`. If
-     * `end` is not specified, it's set to `start` with `start` then set to `0`.
-     * If `start` is greater than `end` the params are swapped to support
-     * negative ranges.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.3.0
-     * @category Number
-     * @param {number} number The number to check.
-     * @param {number} [start=0] The start of the range.
-     * @param {number} end The end of the range.
-     * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
-     * @see _.range, _.rangeRight
-     * @example
-     *
-     * _.inRange(3, 2, 4);
-     * // => true
-     *
-     * _.inRange(4, 8);
-     * // => true
-     *
-     * _.inRange(4, 2);
-     * // => false
-     *
-     * _.inRange(2, 2);
-     * // => false
-     *
-     * _.inRange(1.2, 2);
-     * // => true
-     *
-     * _.inRange(5.2, 4);
-     * // => false
-     *
-     * _.inRange(-3, -2, -6);
-     * // => true
-     */
-    function inRange(number, start, end) {
-      start = toNumber(start) || 0;
-      if (end === undefined) {
-        end = start;
-        start = 0;
-      } else {
-        end = toNumber(end) || 0;
-      }
-      number = toNumber(number);
-      return baseInRange(number, start, end);
-    }
-
-    /**
-     * Produces a random number between the inclusive `lower` and `upper` bounds.
-     * If only one argument is provided a number between `0` and the given number
-     * is returned. If `floating` is `true`, or either `lower` or `upper` are
-     * floats, a floating-point number is returned instead of an integer.
-     *
-     * **Note:** JavaScript follows the IEEE-754 standard for resolving
-     * floating-point values which can produce unexpected results.
-     *
-     * @static
-     * @memberOf _
-     * @since 0.7.0
-     * @category Number
-     * @param {number} [lower=0] The lower bound.
-     * @param {number} [upper=1] The upper bound.
-     * @param {boolean} [floating] Specify returning a floating-point number.
-     * @returns {number} Returns the random number.
-     * @example
-     *
-     * _.random(0, 5);
-     * // => an integer between 0 and 5
-     *
-     * _.random(5);
-     * // => also an integer between 0 and 5
-     *
-     * _.random(5, true);
-     * // => a floating-point number between 0 and 5
-     *
-     * _.random(1.2, 5.2);
-     * // => a floating-point number between 1.2 and 5.2
-     */
-    function random(lower, upper, floating) {
-      if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
-        upper = floating = undefined;
-      }
-      if (floating === undefined) {
-        if (typeof upper == 'boolean') {
-          floating = upper;
-          upper = undefined;
-        }
-        else if (typeof lower == 'boolean') {
-          floating = lower;
-          lower = undefined;
-        }
-      }
-      if (lower === undefined && upper === undefined) {
-        lower = 0;
-        upper = 1;
-      }
-      else {
-        lower = toNumber(lower) || 0;
-        if (upper === undefined) {
-          upper = lower;
-          lower = 0;
-        } else {
-          upper = toNumber(upper) || 0;
-        }
-      }
-      if (lower > upper) {
-        var temp = lower;
-        lower = upper;
-        upper = temp;
-      }
-      if (floating || lower % 1 || upper % 1) {
-        var rand = nativeRandom();
-        return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
-      }
-      return baseRandom(lower, upper);
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the camel cased string.
-     * @example
-     *
-     * _.camelCase('Foo Bar');
-     * // => 'fooBar'
-     *
-     * _.camelCase('--foo-bar--');
-     * // => 'fooBar'
-     *
-     * _.camelCase('__FOO_BAR__');
-     * // => 'fooBar'
-     */
-    var camelCase = createCompounder(function(result, word, index) {
-      word = word.toLowerCase();
-      return result + (index ? capitalize(word) : word);
-    });
-
-    /**
-     * Converts the first character of `string` to upper case and the remaining
-     * to lower case.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to capitalize.
-     * @returns {string} Returns the capitalized string.
-     * @example
-     *
-     * _.capitalize('FRED');
-     * // => 'Fred'
-     */
-    function capitalize(string) {
-      return upperFirst(toString(string).toLowerCase());
-    }
-
-    /**
-     * Deburrs `string` by converting
-     * [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
-     * to basic latin letters and removing
-     * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to deburr.
-     * @returns {string} Returns the deburred string.
-     * @example
-     *
-     * _.deburr('déjà vu');
-     * // => 'deja vu'
-     */
-    function deburr(string) {
-      string = toString(string);
-      return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
-    }
-
-    /**
-     * Checks if `string` ends with the given target string.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to search.
-     * @param {string} [target] The string to search for.
-     * @param {number} [position=string.length] The position to search from.
-     * @returns {boolean} Returns `true` if `string` ends with `target`,
-     *  else `false`.
-     * @example
-     *
-     * _.endsWith('abc', 'c');
-     * // => true
-     *
-     * _.endsWith('abc', 'b');
-     * // => false
-     *
-     * _.endsWith('abc', 'b', 2);
-     * // => true
-     */
-    function endsWith(string, target, position) {
-      string = toString(string);
-      target = baseToString(target);
-
-      var length = string.length;
-      position = position === undefined
-        ? length
-        : baseClamp(toInteger(position), 0, length);
-
-      position -= target.length;
-      return position >= 0 && string.indexOf(target, position) == position;
-    }
-
-    /**
-     * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
-     * their corresponding HTML entities.
-     *
-     * **Note:** No other characters are escaped. To escape additional
-     * characters use a third-party library like [_he_](https://mths.be/he).
-     *
-     * Though the ">" character is escaped for symmetry, characters like
-     * ">" and "/" don't need escaping in HTML and have no special meaning
-     * unless they're part of a tag or unquoted attribute value. See
-     * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
-     * (under "semi-related fun fact") for more details.
-     *
-     * Backticks are escaped because in IE < 9, they can break out of
-     * attribute values or HTML comments. See [#59](https://html5sec.org/#59),
-     * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
-     * [#133](https://html5sec.org/#133) of the
-     * [HTML5 Security Cheatsheet](https://html5sec.org/) for more details.
-     *
-     * When working with HTML you should always
-     * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
-     * XSS vectors.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category String
-     * @param {string} [string=''] The string to escape.
-     * @returns {string} Returns the escaped string.
-     * @example
-     *
-     * _.escape('fred, barney, & pebbles');
-     * // => 'fred, barney, &amp; pebbles'
-     */
-    function escape(string) {
-      string = toString(string);
-      return (string && reHasUnescapedHtml.test(string))
-        ? string.replace(reUnescapedHtml, escapeHtmlChar)
-        : string;
-    }
-
-    /**
-     * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
-     * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to escape.
-     * @returns {string} Returns the escaped string.
-     * @example
-     *
-     * _.escapeRegExp('[lodash](https://lodash.com/)');
-     * // => '\[lodash\]\(https://lodash\.com/\)'
-     */
-    function escapeRegExp(string) {
-      string = toString(string);
-      return (string && reHasRegExpChar.test(string))
-        ? string.replace(reRegExpChar, '\\$&')
-        : string;
-    }
-
-    /**
-     * Converts `string` to
-     * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the kebab cased string.
-     * @example
-     *
-     * _.kebabCase('Foo Bar');
-     * // => 'foo-bar'
-     *
-     * _.kebabCase('fooBar');
-     * // => 'foo-bar'
-     *
-     * _.kebabCase('__FOO_BAR__');
-     * // => 'foo-bar'
-     */
-    var kebabCase = createCompounder(function(result, word, index) {
-      return result + (index ? '-' : '') + word.toLowerCase();
-    });
-
-    /**
-     * Converts `string`, as space separated words, to lower case.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the lower cased string.
-     * @example
-     *
-     * _.lowerCase('--Foo-Bar--');
-     * // => 'foo bar'
-     *
-     * _.lowerCase('fooBar');
-     * // => 'foo bar'
-     *
-     * _.lowerCase('__FOO_BAR__');
-     * // => 'foo bar'
-     */
-    var lowerCase = createCompounder(function(result, word, index) {
-      return result + (index ? ' ' : '') + word.toLowerCase();
-    });
-
-    /**
-     * Converts the first character of `string` to lower case.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the converted string.
-     * @example
-     *
-     * _.lowerFirst('Fred');
-     * // => 'fred'
-     *
-     * _.lowerFirst('FRED');
-     * // => 'fRED'
-     */
-    var lowerFirst = createCaseFirst('toLowerCase');
-
-    /**
-     * Pads `string` on the left and right sides if it's shorter than `length`.
-     * Padding characters are truncated if they can't be evenly divided by `length`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to pad.
-     * @param {number} [length=0] The padding length.
-     * @param {string} [chars=' '] The string used as padding.
-     * @returns {string} Returns the padded string.
-     * @example
-     *
-     * _.pad('abc', 8);
-     * // => '  abc   '
-     *
-     * _.pad('abc', 8, '_-');
-     * // => '_-abc_-_'
-     *
-     * _.pad('abc', 3);
-     * // => 'abc'
-     */
-    function pad(string, length, chars) {
-      string = toString(string);
-      length = toInteger(length);
-
-      var strLength = length ? stringSize(string) : 0;
-      if (!length || strLength >= length) {
-        return string;
-      }
-      var mid = (length - strLength) / 2;
-      return (
-        createPadding(nativeFloor(mid), chars) +
-        string +
-        createPadding(nativeCeil(mid), chars)
-      );
-    }
-
-    /**
-     * Pads `string` on the right side if it's shorter than `length`. Padding
-     * characters are truncated if they exceed `length`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to pad.
-     * @param {number} [length=0] The padding length.
-     * @param {string} [chars=' '] The string used as padding.
-     * @returns {string} Returns the padded string.
-     * @example
-     *
-     * _.padEnd('abc', 6);
-     * // => 'abc   '
-     *
-     * _.padEnd('abc', 6, '_-');
-     * // => 'abc_-_'
-     *
-     * _.padEnd('abc', 3);
-     * // => 'abc'
-     */
-    function padEnd(string, length, chars) {
-      string = toString(string);
-      length = toInteger(length);
-
-      var strLength = length ? stringSize(string) : 0;
-      return (length && strLength < length)
-        ? (string + createPadding(length - strLength, chars))
-        : string;
-    }
-
-    /**
-     * Pads `string` on the left side if it's shorter than `length`. Padding
-     * characters are truncated if they exceed `length`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to pad.
-     * @param {number} [length=0] The padding length.
-     * @param {string} [chars=' '] The string used as padding.
-     * @returns {string} Returns the padded string.
-     * @example
-     *
-     * _.padStart('abc', 6);
-     * // => '   abc'
-     *
-     * _.padStart('abc', 6, '_-');
-     * // => '_-_abc'
-     *
-     * _.padStart('abc', 3);
-     * // => 'abc'
-     */
-    function padStart(string, length, chars) {
-      string = toString(string);
-      length = toInteger(length);
-
-      var strLength = length ? stringSize(string) : 0;
-      return (length && strLength < length)
-        ? (createPadding(length - strLength, chars) + string)
-        : string;
-    }
-
-    /**
-     * Converts `string` to an integer of the specified radix. If `radix` is
-     * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
-     * hexadecimal, in which case a `radix` of `16` is used.
-     *
-     * **Note:** This method aligns with the
-     * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
-     *
-     * @static
-     * @memberOf _
-     * @since 1.1.0
-     * @category String
-     * @param {string} string The string to convert.
-     * @param {number} [radix=10] The radix to interpret `value` by.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {number} Returns the converted integer.
-     * @example
-     *
-     * _.parseInt('08');
-     * // => 8
-     *
-     * _.map(['6', '08', '10'], _.parseInt);
-     * // => [6, 8, 10]
-     */
-    function parseInt(string, radix, guard) {
-      // Chrome fails to trim leading <BOM> whitespace characters.
-      // See https://bugs.chromium.org/p/v8/issues/detail?id=3109 for more details.
-      if (guard || radix == null) {
-        radix = 0;
-      } else if (radix) {
-        radix = +radix;
-      }
-      string = toString(string).replace(reTrim, '');
-      return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
-    }
-
-    /**
-     * Repeats the given string `n` times.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to repeat.
-     * @param {number} [n=1] The number of times to repeat the string.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {string} Returns the repeated string.
-     * @example
-     *
-     * _.repeat('*', 3);
-     * // => '***'
-     *
-     * _.repeat('abc', 2);
-     * // => 'abcabc'
-     *
-     * _.repeat('abc', 0);
-     * // => ''
-     */
-    function repeat(string, n, guard) {
-      if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
-        n = 1;
-      } else {
-        n = toInteger(n);
-      }
-      return baseRepeat(toString(string), n);
-    }
-
-    /**
-     * Replaces matches for `pattern` in `string` with `replacement`.
-     *
-     * **Note:** This method is based on
-     * [`String#replace`](https://mdn.io/String/replace).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to modify.
-     * @param {RegExp|string} pattern The pattern to replace.
-     * @param {Function|string} replacement The match replacement.
-     * @returns {string} Returns the modified string.
-     * @example
-     *
-     * _.replace('Hi Fred', 'Fred', 'Barney');
-     * // => 'Hi Barney'
-     */
-    function replace() {
-      var args = arguments,
-          string = toString(args[0]);
-
-      return args.length < 3 ? string : nativeReplace.call(string, args[1], args[2]);
-    }
-
-    /**
-     * Converts `string` to
-     * [snake case](https://en.wikipedia.org/wiki/Snake_case).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the snake cased string.
-     * @example
-     *
-     * _.snakeCase('Foo Bar');
-     * // => 'foo_bar'
-     *
-     * _.snakeCase('fooBar');
-     * // => 'foo_bar'
-     *
-     * _.snakeCase('--FOO-BAR--');
-     * // => 'foo_bar'
-     */
-    var snakeCase = createCompounder(function(result, word, index) {
-      return result + (index ? '_' : '') + word.toLowerCase();
-    });
-
-    /**
-     * Splits `string` by `separator`.
-     *
-     * **Note:** This method is based on
-     * [`String#split`](https://mdn.io/String/split).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to split.
-     * @param {RegExp|string} separator The separator pattern to split by.
-     * @param {number} [limit] The length to truncate results to.
-     * @returns {Array} Returns the new array of string segments.
-     * @example
-     *
-     * _.split('a-b-c', '-', 2);
-     * // => ['a', 'b']
-     */
-    function split(string, separator, limit) {
-      if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
-        separator = limit = undefined;
-      }
-      limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
-      if (!limit) {
-        return [];
-      }
-      string = toString(string);
-      if (string && (
-            typeof separator == 'string' ||
-            (separator != null && !isRegExp(separator))
-          )) {
-        separator = baseToString(separator);
-        if (separator == '' && reHasComplexSymbol.test(string)) {
-          return castSlice(stringToArray(string), 0, limit);
-        }
-      }
-      return nativeSplit.call(string, separator, limit);
-    }
-
-    /**
-     * Converts `string` to
-     * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
-     *
-     * @static
-     * @memberOf _
-     * @since 3.1.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the start cased string.
-     * @example
-     *
-     * _.startCase('--foo-bar--');
-     * // => 'Foo Bar'
-     *
-     * _.startCase('fooBar');
-     * // => 'Foo Bar'
-     *
-     * _.startCase('__FOO_BAR__');
-     * // => 'FOO BAR'
-     */
-    var startCase = createCompounder(function(result, word, index) {
-      return result + (index ? ' ' : '') + upperFirst(word);
-    });
-
-    /**
-     * Checks if `string` starts with the given target string.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to search.
-     * @param {string} [target] The string to search for.
-     * @param {number} [position=0] The position to search from.
-     * @returns {boolean} Returns `true` if `string` starts with `target`,
-     *  else `false`.
-     * @example
-     *
-     * _.startsWith('abc', 'a');
-     * // => true
-     *
-     * _.startsWith('abc', 'b');
-     * // => false
-     *
-     * _.startsWith('abc', 'b', 1);
-     * // => true
-     */
-    function startsWith(string, target, position) {
-      string = toString(string);
-      position = baseClamp(toInteger(position), 0, string.length);
-      return string.lastIndexOf(baseToString(target), position) == position;
-    }
-
-    /**
-     * Creates a compiled template function that can interpolate data properties
-     * in "interpolate" delimiters, HTML-escape interpolated data properties in
-     * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
-     * properties may be accessed as free variables in the template. If a setting
-     * object is given, it takes precedence over `_.templateSettings` values.
-     *
-     * **Note:** In the development build `_.template` utilizes
-     * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
-     * for easier debugging.
-     *
-     * For more information on precompiling templates see
-     * [lodash's custom builds documentation](https://lodash.com/custom-builds).
-     *
-     * For more information on Chrome extension sandboxes see
-     * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category String
-     * @param {string} [string=''] The template string.
-     * @param {Object} [options={}] The options object.
-     * @param {RegExp} [options.escape=_.templateSettings.escape]
-     *  The HTML "escape" delimiter.
-     * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
-     *  The "evaluate" delimiter.
-     * @param {Object} [options.imports=_.templateSettings.imports]
-     *  An object to import into the template as free variables.
-     * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
-     *  The "interpolate" delimiter.
-     * @param {string} [options.sourceURL='lodash.templateSources[n]']
-     *  The sourceURL of the compiled template.
-     * @param {string} [options.variable='obj']
-     *  The data object variable name.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Function} Returns the compiled template function.
-     * @example
-     *
-     * // Use the "interpolate" delimiter to create a compiled template.
-     * var compiled = _.template('hello <%= user %>!');
-     * compiled({ 'user': 'fred' });
-     * // => 'hello fred!'
-     *
-     * // Use the HTML "escape" delimiter to escape data property values.
-     * var compiled = _.template('<b><%- value %></b>');
-     * compiled({ 'value': '<script>' });
-     * // => '<b>&lt;script&gt;</b>'
-     *
-     * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
-     * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
-     * compiled({ 'users': ['fred', 'barney'] });
-     * // => '<li>fred</li><li>barney</li>'
-     *
-     * // Use the internal `print` function in "evaluate" delimiters.
-     * var compiled = _.template('<% print("hello " + user); %>!');
-     * compiled({ 'user': 'barney' });
-     * // => 'hello barney!'
-     *
-     * // Use the ES delimiter as an alternative to the default "interpolate" delimiter.
-     * var compiled = _.template('hello ${ user }!');
-     * compiled({ 'user': 'pebbles' });
-     * // => 'hello pebbles!'
-     *
-     * // Use custom template delimiters.
-     * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
-     * var compiled = _.template('hello {{ user }}!');
-     * compiled({ 'user': 'mustache' });
-     * // => 'hello mustache!'
-     *
-     * // Use backslashes to treat delimiters as plain text.
-     * var compiled = _.template('<%= "\\<%- value %\\>" %>');
-     * compiled({ 'value': 'ignored' });
-     * // => '<%- value %>'
-     *
-     * // Use the `imports` option to import `jQuery` as `jq`.
-     * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
-     * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
-     * compiled({ 'users': ['fred', 'barney'] });
-     * // => '<li>fred</li><li>barney</li>'
-     *
-     * // Use the `sourceURL` option to specify a custom sourceURL for the template.
-     * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
-     * compiled(data);
-     * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
-     *
-     * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
-     * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
-     * compiled.source;
-     * // => function(data) {
-     * //   var __t, __p = '';
-     * //   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
-     * //   return __p;
-     * // }
-     *
-     * // Use the `source` property to inline compiled templates for meaningful
-     * // line numbers in error messages and stack traces.
-     * fs.writeFileSync(path.join(cwd, 'jst.js'), '\
-     *   var JST = {\
-     *     "main": ' + _.template(mainText).source + '\
-     *   };\
-     * ');
-     */
-    function template(string, options, guard) {
-      // Based on John Resig's `tmpl` implementation
-      // (http://ejohn.org/blog/javascript-micro-templating/)
-      // and Laura Doktorova's doT.js (https://github.com/olado/doT).
-      var settings = lodash.templateSettings;
-
-      if (guard && isIterateeCall(string, options, guard)) {
-        options = undefined;
-      }
-      string = toString(string);
-      options = assignInWith({}, options, settings, assignInDefaults);
-
-      var imports = assignInWith({}, options.imports, settings.imports, assignInDefaults),
-          importsKeys = keys(imports),
-          importsValues = baseValues(imports, importsKeys);
-
-      var isEscaping,
-          isEvaluating,
-          index = 0,
-          interpolate = options.interpolate || reNoMatch,
-          source = "__p += '";
-
-      // Compile the regexp to match each delimiter.
-      var reDelimiters = RegExp(
-        (options.escape || reNoMatch).source + '|' +
-        interpolate.source + '|' +
-        (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
-        (options.evaluate || reNoMatch).source + '|$'
-      , 'g');
-
-      // Use a sourceURL for easier debugging.
-      var sourceURL = '//# sourceURL=' +
-        ('sourceURL' in options
-          ? options.sourceURL
-          : ('lodash.templateSources[' + (++templateCounter) + ']')
-        ) + '\n';
-
-      string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
-        interpolateValue || (interpolateValue = esTemplateValue);
-
-        // Escape characters that can't be included in string literals.
-        source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
-
-        // Replace delimiters with snippets.
-        if (escapeValue) {
-          isEscaping = true;
-          source += "' +\n__e(" + escapeValue + ") +\n'";
-        }
-        if (evaluateValue) {
-          isEvaluating = true;
-          source += "';\n" + evaluateValue + ";\n__p += '";
-        }
-        if (interpolateValue) {
-          source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
-        }
-        index = offset + match.length;
-
-        // The JS engine embedded in Adobe products needs `match` returned in
-        // order to produce the correct `offset` value.
-        return match;
-      });
-
-      source += "';\n";
-
-      // If `variable` is not specified wrap a with-statement around the generated
-      // code to add the data object to the top of the scope chain.
-      var variable = options.variable;
-      if (!variable) {
-        source = 'with (obj) {\n' + source + '\n}\n';
-      }
-      // Cleanup code by stripping empty strings.
-      source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
-        .replace(reEmptyStringMiddle, '$1')
-        .replace(reEmptyStringTrailing, '$1;');
-
-      // Frame code as the function body.
-      source = 'function(' + (variable || 'obj') + ') {\n' +
-        (variable
-          ? ''
-          : 'obj || (obj = {});\n'
-        ) +
-        "var __t, __p = ''" +
-        (isEscaping
-           ? ', __e = _.escape'
-           : ''
-        ) +
-        (isEvaluating
-          ? ', __j = Array.prototype.join;\n' +
-            "function print() { __p += __j.call(arguments, '') }\n"
-          : ';\n'
-        ) +
-        source +
-        'return __p\n}';
-
-      var result = attempt(function() {
-        return Function(importsKeys, sourceURL + 'return ' + source)
-          .apply(undefined, importsValues);
-      });
-
-      // Provide the compiled function's source by its `toString` method or
-      // the `source` property as a convenience for inlining compiled templates.
-      result.source = source;
-      if (isError(result)) {
-        throw result;
-      }
-      return result;
-    }
-
-    /**
-     * Converts `string`, as a whole, to lower case just like
-     * [String#toLowerCase](https://mdn.io/toLowerCase).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the lower cased string.
-     * @example
-     *
-     * _.toLower('--Foo-Bar--');
-     * // => '--foo-bar--'
-     *
-     * _.toLower('fooBar');
-     * // => 'foobar'
-     *
-     * _.toLower('__FOO_BAR__');
-     * // => '__foo_bar__'
-     */
-    function toLower(value) {
-      return toString(value).toLowerCase();
-    }
-
-    /**
-     * Converts `string`, as a whole, to upper case just like
-     * [String#toUpperCase](https://mdn.io/toUpperCase).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the upper cased string.
-     * @example
-     *
-     * _.toUpper('--foo-bar--');
-     * // => '--FOO-BAR--'
-     *
-     * _.toUpper('fooBar');
-     * // => 'FOOBAR'
-     *
-     * _.toUpper('__foo_bar__');
-     * // => '__FOO_BAR__'
-     */
-    function toUpper(value) {
-      return toString(value).toUpperCase();
-    }
-
-    /**
-     * Removes leading and trailing whitespace or specified characters from `string`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to trim.
-     * @param {string} [chars=whitespace] The characters to trim.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {string} Returns the trimmed string.
-     * @example
-     *
-     * _.trim('  abc  ');
-     * // => 'abc'
-     *
-     * _.trim('-_-abc-_-', '_-');
-     * // => 'abc'
-     *
-     * _.map(['  foo  ', '  bar  '], _.trim);
-     * // => ['foo', 'bar']
-     */
-    function trim(string, chars, guard) {
-      string = toString(string);
-      if (string && (guard || chars === undefined)) {
-        return string.replace(reTrim, '');
-      }
-      if (!string || !(chars = baseToString(chars))) {
-        return string;
-      }
-      var strSymbols = stringToArray(string),
-          chrSymbols = stringToArray(chars),
-          start = charsStartIndex(strSymbols, chrSymbols),
-          end = charsEndIndex(strSymbols, chrSymbols) + 1;
-
-      return castSlice(strSymbols, start, end).join('');
-    }
-
-    /**
-     * Removes trailing whitespace or specified characters from `string`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to trim.
-     * @param {string} [chars=whitespace] The characters to trim.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {string} Returns the trimmed string.
-     * @example
-     *
-     * _.trimEnd('  abc  ');
-     * // => '  abc'
-     *
-     * _.trimEnd('-_-abc-_-', '_-');
-     * // => '-_-abc'
-     */
-    function trimEnd(string, chars, guard) {
-      string = toString(string);
-      if (string && (guard || chars === undefined)) {
-        return string.replace(reTrimEnd, '');
-      }
-      if (!string || !(chars = baseToString(chars))) {
-        return string;
-      }
-      var strSymbols = stringToArray(string),
-          end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
-
-      return castSlice(strSymbols, 0, end).join('');
-    }
-
-    /**
-     * Removes leading whitespace or specified characters from `string`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to trim.
-     * @param {string} [chars=whitespace] The characters to trim.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {string} Returns the trimmed string.
-     * @example
-     *
-     * _.trimStart('  abc  ');
-     * // => 'abc  '
-     *
-     * _.trimStart('-_-abc-_-', '_-');
-     * // => 'abc-_-'
-     */
-    function trimStart(string, chars, guard) {
-      string = toString(string);
-      if (string && (guard || chars === undefined)) {
-        return string.replace(reTrimStart, '');
-      }
-      if (!string || !(chars = baseToString(chars))) {
-        return string;
-      }
-      var strSymbols = stringToArray(string),
-          start = charsStartIndex(strSymbols, stringToArray(chars));
-
-      return castSlice(strSymbols, start).join('');
-    }
-
-    /**
-     * Truncates `string` if it's longer than the given maximum string length.
-     * The last characters of the truncated string are replaced with the omission
-     * string which defaults to "...".
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to truncate.
-     * @param {Object} [options={}] The options object.
-     * @param {number} [options.length=30] The maximum string length.
-     * @param {string} [options.omission='...'] The string to indicate text is omitted.
-     * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
-     * @returns {string} Returns the truncated string.
-     * @example
-     *
-     * _.truncate('hi-diddly-ho there, neighborino');
-     * // => 'hi-diddly-ho there, neighbo...'
-     *
-     * _.truncate('hi-diddly-ho there, neighborino', {
-     *   'length': 24,
-     *   'separator': ' '
-     * });
-     * // => 'hi-diddly-ho there,...'
-     *
-     * _.truncate('hi-diddly-ho there, neighborino', {
-     *   'length': 24,
-     *   'separator': /,? +/
-     * });
-     * // => 'hi-diddly-ho there...'
-     *
-     * _.truncate('hi-diddly-ho there, neighborino', {
-     *   'omission': ' [...]'
-     * });
-     * // => 'hi-diddly-ho there, neig [...]'
-     */
-    function truncate(string, options) {
-      var length = DEFAULT_TRUNC_LENGTH,
-          omission = DEFAULT_TRUNC_OMISSION;
-
-      if (isObject(options)) {
-        var separator = 'separator' in options ? options.separator : separator;
-        length = 'length' in options ? toInteger(options.length) : length;
-        omission = 'omission' in options ? baseToString(options.omission) : omission;
-      }
-      string = toString(string);
-
-      var strLength = string.length;
-      if (reHasComplexSymbol.test(string)) {
-        var strSymbols = stringToArray(string);
-        strLength = strSymbols.length;
-      }
-      if (length >= strLength) {
-        return string;
-      }
-      var end = length - stringSize(omission);
-      if (end < 1) {
-        return omission;
-      }
-      var result = strSymbols
-        ? castSlice(strSymbols, 0, end).join('')
-        : string.slice(0, end);
-
-      if (separator === undefined) {
-        return result + omission;
-      }
-      if (strSymbols) {
-        end += (result.length - end);
-      }
-      if (isRegExp(separator)) {
-        if (string.slice(end).search(separator)) {
-          var match,
-              substring = result;
-
-          if (!separator.global) {
-            separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
-          }
-          separator.lastIndex = 0;
-          while ((match = separator.exec(substring))) {
-            var newEnd = match.index;
-          }
-          result = result.slice(0, newEnd === undefined ? end : newEnd);
-        }
-      } else if (string.indexOf(baseToString(separator), end) != end) {
-        var index = result.lastIndexOf(separator);
-        if (index > -1) {
-          result = result.slice(0, index);
-        }
-      }
-      return result + omission;
-    }
-
-    /**
-     * The inverse of `_.escape`; this method converts the HTML entities
-     * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to
-     * their corresponding characters.
-     *
-     * **Note:** No other HTML entities are unescaped. To unescape additional
-     * HTML entities use a third-party library like [_he_](https://mths.be/he).
-     *
-     * @static
-     * @memberOf _
-     * @since 0.6.0
-     * @category String
-     * @param {string} [string=''] The string to unescape.
-     * @returns {string} Returns the unescaped string.
-     * @example
-     *
-     * _.unescape('fred, barney, &amp; pebbles');
-     * // => 'fred, barney, & pebbles'
-     */
-    function unescape(string) {
-      string = toString(string);
-      return (string && reHasEscapedHtml.test(string))
-        ? string.replace(reEscapedHtml, unescapeHtmlChar)
-        : string;
-    }
-
-    /**
-     * Converts `string`, as space separated words, to upper case.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the upper cased string.
-     * @example
-     *
-     * _.upperCase('--foo-bar');
-     * // => 'FOO BAR'
-     *
-     * _.upperCase('fooBar');
-     * // => 'FOO BAR'
-     *
-     * _.upperCase('__foo_bar__');
-     * // => 'FOO BAR'
-     */
-    var upperCase = createCompounder(function(result, word, index) {
-      return result + (index ? ' ' : '') + word.toUpperCase();
-    });
-
-    /**
-     * Converts the first character of `string` to upper case.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category String
-     * @param {string} [string=''] The string to convert.
-     * @returns {string} Returns the converted string.
-     * @example
-     *
-     * _.upperFirst('fred');
-     * // => 'Fred'
-     *
-     * _.upperFirst('FRED');
-     * // => 'FRED'
-     */
-    var upperFirst = createCaseFirst('toUpperCase');
-
-    /**
-     * Splits `string` into an array of its words.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category String
-     * @param {string} [string=''] The string to inspect.
-     * @param {RegExp|string} [pattern] The pattern to match words.
-     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
-     * @returns {Array} Returns the words of `string`.
-     * @example
-     *
-     * _.words('fred, barney, & pebbles');
-     * // => ['fred', 'barney', 'pebbles']
-     *
-     * _.words('fred, barney, & pebbles', /[^, ]+/g);
-     * // => ['fred', 'barney', '&', 'pebbles']
-     */
-    function words(string, pattern, guard) {
-      string = toString(string);
-      pattern = guard ? undefined : pattern;
-
-      if (pattern === undefined) {
-        pattern = reHasComplexWord.test(string) ? reComplexWord : reBasicWord;
-      }
-      return string.match(pattern) || [];
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Attempts to invoke `func`, returning either the result or the caught error
-     * object. Any additional arguments are provided to `func` when it's invoked.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Util
-     * @param {Function} func The function to attempt.
-     * @param {...*} [args] The arguments to invoke `func` with.
-     * @returns {*} Returns the `func` result or error object.
-     * @example
-     *
-     * // Avoid throwing errors for invalid selectors.
-     * var elements = _.attempt(function(selector) {
-     *   return document.querySelectorAll(selector);
-     * }, '>_>');
-     *
-     * if (_.isError(elements)) {
-     *   elements = [];
-     * }
-     */
-    var attempt = rest(function(func, args) {
-      try {
-        return apply(func, undefined, args);
-      } catch (e) {
-        return isError(e) ? e : new Error(e);
-      }
-    });
-
-    /**
-     * Binds methods of an object to the object itself, overwriting the existing
-     * method.
-     *
-     * **Note:** This method doesn't set the "length" property of bound functions.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {Object} object The object to bind and assign the bound methods to.
-     * @param {...(string|string[])} methodNames The object method names to bind.
-     * @returns {Object} Returns `object`.
-     * @example
-     *
-     * var view = {
-     *   'label': 'docs',
-     *   'onClick': function() {
-     *     console.log('clicked ' + this.label);
-     *   }
-     * };
-     *
-     * _.bindAll(view, 'onClick');
-     * jQuery(element).on('click', view.onClick);
-     * // => Logs 'clicked docs' when clicked.
-     */
-    var bindAll = rest(function(object, methodNames) {
-      arrayEach(baseFlatten(methodNames, 1), function(key) {
-        key = toKey(key);
-        object[key] = bind(object[key], object);
-      });
-      return object;
-    });
-
-    /**
-     * Creates a function that iterates over `pairs` and invokes the corresponding
-     * function of the first predicate to return truthy. The predicate-function
-     * pairs are invoked with the `this` binding and arguments of the created
-     * function.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {Array} pairs The predicate-function pairs.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var func = _.cond([
-     *   [_.matches({ 'a': 1 }),           _.constant('matches A')],
-     *   [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
-     *   [_.constant(true),                _.constant('no match')]
-     * ]);
-     *
-     * func({ 'a': 1, 'b': 2 });
-     * // => 'matches A'
-     *
-     * func({ 'a': 0, 'b': 1 });
-     * // => 'matches B'
-     *
-     * func({ 'a': '1', 'b': '2' });
-     * // => 'no match'
-     */
-    function cond(pairs) {
-      var length = pairs ? pairs.length : 0,
-          toIteratee = getIteratee();
-
-      pairs = !length ? [] : arrayMap(pairs, function(pair) {
-        if (typeof pair[1] != 'function') {
-          throw new TypeError(FUNC_ERROR_TEXT);
-        }
-        return [toIteratee(pair[0]), pair[1]];
-      });
-
-      return rest(function(args) {
-        var index = -1;
-        while (++index < length) {
-          var pair = pairs[index];
-          if (apply(pair[0], this, args)) {
-            return apply(pair[1], this, args);
-          }
-        }
-      });
-    }
-
-    /**
-     * Creates a function that invokes the predicate properties of `source` with
-     * the corresponding property values of a given object, returning `true` if
-     * all predicates return truthy, else `false`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {Object} source The object of property predicates to conform to.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36 },
-     *   { 'user': 'fred',   'age': 40 }
-     * ];
-     *
-     * _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) }));
-     * // => [{ 'user': 'fred', 'age': 40 }]
-     */
-    function conforms(source) {
-      return baseConforms(baseClone(source, true));
-    }
-
-    /**
-     * Creates a function that returns `value`.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.4.0
-     * @category Util
-     * @param {*} value The value to return from the new function.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var object = { 'user': 'fred' };
-     * var getter = _.constant(object);
-     *
-     * getter() === object;
-     * // => true
-     */
-    function constant(value) {
-      return function() {
-        return value;
-      };
-    }
-
-    /**
-     * Creates a function that returns the result of invoking the given functions
-     * with the `this` binding of the created function, where each successive
-     * invocation is supplied the return value of the previous.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Util
-     * @param {...(Function|Function[])} [funcs] Functions to invoke.
-     * @returns {Function} Returns the new function.
-     * @see _.flowRight
-     * @example
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * var addSquare = _.flow(_.add, square);
-     * addSquare(1, 2);
-     * // => 9
-     */
-    var flow = createFlow();
-
-    /**
-     * This method is like `_.flow` except that it creates a function that
-     * invokes the given functions from right to left.
-     *
-     * @static
-     * @since 3.0.0
-     * @memberOf _
-     * @category Util
-     * @param {...(Function|Function[])} [funcs] Functions to invoke.
-     * @returns {Function} Returns the new function.
-     * @see _.flow
-     * @example
-     *
-     * function square(n) {
-     *   return n * n;
-     * }
-     *
-     * var addSquare = _.flowRight(square, _.add);
-     * addSquare(1, 2);
-     * // => 9
-     */
-    var flowRight = createFlow(true);
-
-    /**
-     * This method returns the first argument given to it.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {*} value Any value.
-     * @returns {*} Returns `value`.
-     * @example
-     *
-     * var object = { 'user': 'fred' };
-     *
-     * _.identity(object) === object;
-     * // => true
-     */
-    function identity(value) {
-      return value;
-    }
-
-    /**
-     * Creates a function that invokes `func` with the arguments of the created
-     * function. If `func` is a property name, the created function returns the
-     * property value for a given element. If `func` is an array or object, the
-     * created function returns `true` for elements that contain the equivalent
-     * source properties, otherwise it returns `false`.
-     *
-     * @static
-     * @since 4.0.0
-     * @memberOf _
-     * @category Util
-     * @param {*} [func=_.identity] The value to convert to a callback.
-     * @returns {Function} Returns the callback.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36, 'active': true },
-     *   { 'user': 'fred',   'age': 40, 'active': false }
-     * ];
-     *
-     * // The `_.matches` iteratee shorthand.
-     * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
-     * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
-     *
-     * // The `_.matchesProperty` iteratee shorthand.
-     * _.filter(users, _.iteratee(['user', 'fred']));
-     * // => [{ 'user': 'fred', 'age': 40 }]
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.map(users, _.iteratee('user'));
-     * // => ['barney', 'fred']
-     *
-     * // Create custom iteratee shorthands.
-     * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
-     *   return !_.isRegExp(func) ? iteratee(func) : function(string) {
-     *     return func.test(string);
-     *   };
-     * });
-     *
-     * _.filter(['abc', 'def'], /ef/);
-     * // => ['def']
-     */
-    function iteratee(func) {
-      return baseIteratee(typeof func == 'function' ? func : baseClone(func, true));
-    }
-
-    /**
-     * Creates a function that performs a partial deep comparison between a given
-     * object and `source`, returning `true` if the given object has equivalent
-     * property values, else `false`. The created function is equivalent to
-     * `_.isMatch` with a `source` partially applied.
-     *
-     * **Note:** This method supports comparing the same values as `_.isEqual`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Util
-     * @param {Object} source The object of property values to match.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney', 'age': 36, 'active': true },
-     *   { 'user': 'fred',   'age': 40, 'active': false }
-     * ];
-     *
-     * _.filter(users, _.matches({ 'age': 40, 'active': false }));
-     * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
-     */
-    function matches(source) {
-      return baseMatches(baseClone(source, true));
-    }
-
-    /**
-     * Creates a function that performs a partial deep comparison between the
-     * value at `path` of a given object to `srcValue`, returning `true` if the
-     * object value is equivalent, else `false`.
-     *
-     * **Note:** This method supports comparing the same values as `_.isEqual`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.2.0
-     * @category Util
-     * @param {Array|string} path The path of the property to get.
-     * @param {*} srcValue The value to match.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var users = [
-     *   { 'user': 'barney' },
-     *   { 'user': 'fred' }
-     * ];
-     *
-     * _.find(users, _.matchesProperty('user', 'fred'));
-     * // => { 'user': 'fred' }
-     */
-    function matchesProperty(path, srcValue) {
-      return baseMatchesProperty(path, baseClone(srcValue, true));
-    }
-
-    /**
-     * Creates a function that invokes the method at `path` of a given object.
-     * Any additional arguments are provided to the invoked method.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.7.0
-     * @category Util
-     * @param {Array|string} path The path of the method to invoke.
-     * @param {...*} [args] The arguments to invoke the method with.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var objects = [
-     *   { 'a': { 'b': _.constant(2) } },
-     *   { 'a': { 'b': _.constant(1) } }
-     * ];
-     *
-     * _.map(objects, _.method('a.b'));
-     * // => [2, 1]
-     *
-     * _.map(objects, _.method(['a', 'b']));
-     * // => [2, 1]
-     */
-    var method = rest(function(path, args) {
-      return function(object) {
-        return baseInvoke(object, path, args);
-      };
-    });
-
-    /**
-     * The opposite of `_.method`; this method creates a function that invokes
-     * the method at a given path of `object`. Any additional arguments are
-     * provided to the invoked method.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.7.0
-     * @category Util
-     * @param {Object} object The object to query.
-     * @param {...*} [args] The arguments to invoke the method with.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var array = _.times(3, _.constant),
-     *     object = { 'a': array, 'b': array, 'c': array };
-     *
-     * _.map(['a[2]', 'c[0]'], _.methodOf(object));
-     * // => [2, 0]
-     *
-     * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
-     * // => [2, 0]
-     */
-    var methodOf = rest(function(object, args) {
-      return function(path) {
-        return baseInvoke(object, path, args);
-      };
-    });
-
-    /**
-     * Adds all own enumerable string keyed function properties of a source
-     * object to the destination object. If `object` is a function, then methods
-     * are added to its prototype as well.
-     *
-     * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
-     * avoid conflicts caused by modifying the original.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {Function|Object} [object=lodash] The destination object.
-     * @param {Object} source The object of functions to add.
-     * @param {Object} [options={}] The options object.
-     * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
-     * @returns {Function|Object} Returns `object`.
-     * @example
-     *
-     * function vowels(string) {
-     *   return _.filter(string, function(v) {
-     *     return /[aeiou]/i.test(v);
-     *   });
-     * }
-     *
-     * _.mixin({ 'vowels': vowels });
-     * _.vowels('fred');
-     * // => ['e']
-     *
-     * _('fred').vowels().value();
-     * // => ['e']
-     *
-     * _.mixin({ 'vowels': vowels }, { 'chain': false });
-     * _('fred').vowels();
-     * // => ['e']
-     */
-    function mixin(object, source, options) {
-      var props = keys(source),
-          methodNames = baseFunctions(source, props);
-
-      if (options == null &&
-          !(isObject(source) && (methodNames.length || !props.length))) {
-        options = source;
-        source = object;
-        object = this;
-        methodNames = baseFunctions(source, keys(source));
-      }
-      var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
-          isFunc = isFunction(object);
-
-      arrayEach(methodNames, function(methodName) {
-        var func = source[methodName];
-        object[methodName] = func;
-        if (isFunc) {
-          object.prototype[methodName] = function() {
-            var chainAll = this.__chain__;
-            if (chain || chainAll) {
-              var result = object(this.__wrapped__),
-                  actions = result.__actions__ = copyArray(this.__actions__);
-
-              actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
-              result.__chain__ = chainAll;
-              return result;
-            }
-            return func.apply(object, arrayPush([this.value()], arguments));
-          };
-        }
-      });
-
-      return object;
-    }
-
-    /**
-     * Reverts the `_` variable to its previous value and returns a reference to
-     * the `lodash` function.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @returns {Function} Returns the `lodash` function.
-     * @example
-     *
-     * var lodash = _.noConflict();
-     */
-    function noConflict() {
-      if (root._ === this) {
-        root._ = oldDash;
-      }
-      return this;
-    }
-
-    /**
-     * A no-operation function that returns `undefined` regardless of the
-     * arguments it receives.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.3.0
-     * @category Util
-     * @example
-     *
-     * var object = { 'user': 'fred' };
-     *
-     * _.noop(object) === undefined;
-     * // => true
-     */
-    function noop() {
-      // No operation performed.
-    }
-
-    /**
-     * Creates a function that returns its nth argument. If `n` is negative,
-     * the nth argument from the end is returned.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {number} [n=0] The index of the argument to return.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var func = _.nthArg(1);
-     * func('a', 'b', 'c', 'd');
-     * // => 'b'
-     *
-     * var func = _.nthArg(-2);
-     * func('a', 'b', 'c', 'd');
-     * // => 'c'
-     */
-    function nthArg(n) {
-      n = toInteger(n);
-      return rest(function(args) {
-        return baseNth(args, n);
-      });
-    }
-
-    /**
-     * Creates a function that invokes `iteratees` with the arguments it receives
-     * and returns their results.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
-     *  [iteratees=[_.identity]] The iteratees to invoke.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var func = _.over(Math.max, Math.min);
-     *
-     * func(1, 2, 3, 4);
-     * // => [4, 1]
-     */
-    var over = createOver(arrayMap);
-
-    /**
-     * Creates a function that checks if **all** of the `predicates` return
-     * truthy when invoked with the arguments it receives.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
-     *  [predicates=[_.identity]] The predicates to check.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var func = _.overEvery(Boolean, isFinite);
-     *
-     * func('1');
-     * // => true
-     *
-     * func(null);
-     * // => false
-     *
-     * func(NaN);
-     * // => false
-     */
-    var overEvery = createOver(arrayEvery);
-
-    /**
-     * Creates a function that checks if **any** of the `predicates` return
-     * truthy when invoked with the arguments it receives.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
-     *  [predicates=[_.identity]] The predicates to check.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var func = _.overSome(Boolean, isFinite);
-     *
-     * func('1');
-     * // => true
-     *
-     * func(null);
-     * // => true
-     *
-     * func(NaN);
-     * // => false
-     */
-    var overSome = createOver(arraySome);
-
-    /**
-     * Creates a function that returns the value at `path` of a given object.
-     *
-     * @static
-     * @memberOf _
-     * @since 2.4.0
-     * @category Util
-     * @param {Array|string} path The path of the property to get.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var objects = [
-     *   { 'a': { 'b': 2 } },
-     *   { 'a': { 'b': 1 } }
-     * ];
-     *
-     * _.map(objects, _.property('a.b'));
-     * // => [2, 1]
-     *
-     * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
-     * // => [1, 2]
-     */
-    function property(path) {
-      return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
-    }
-
-    /**
-     * The opposite of `_.property`; this method creates a function that returns
-     * the value at a given path of `object`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.0.0
-     * @category Util
-     * @param {Object} object The object to query.
-     * @returns {Function} Returns the new function.
-     * @example
-     *
-     * var array = [0, 1, 2],
-     *     object = { 'a': array, 'b': array, 'c': array };
-     *
-     * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
-     * // => [2, 0]
-     *
-     * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
-     * // => [2, 0]
-     */
-    function propertyOf(object) {
-      return function(path) {
-        return object == null ? undefined : baseGet(object, path);
-      };
-    }
-
-    /**
-     * Creates an array of numbers (positive and/or negative) progressing from
-     * `start` up to, but not including, `end`. A step of `-1` is used if a negative
-     * `start` is specified without an `end` or `step`. If `end` is not specified,
-     * it's set to `start` with `start` then set to `0`.
-     *
-     * **Note:** JavaScript follows the IEEE-754 standard for resolving
-     * floating-point values which can produce unexpected results.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {number} [start=0] The start of the range.
-     * @param {number} end The end of the range.
-     * @param {number} [step=1] The value to increment or decrement by.
-     * @returns {Array} Returns the new array of numbers.
-     * @see _.inRange, _.rangeRight
-     * @example
-     *
-     * _.range(4);
-     * // => [0, 1, 2, 3]
-     *
-     * _.range(-4);
-     * // => [0, -1, -2, -3]
-     *
-     * _.range(1, 5);
-     * // => [1, 2, 3, 4]
-     *
-     * _.range(0, 20, 5);
-     * // => [0, 5, 10, 15]
-     *
-     * _.range(0, -4, -1);
-     * // => [0, -1, -2, -3]
-     *
-     * _.range(1, 4, 0);
-     * // => [1, 1, 1]
-     *
-     * _.range(0);
-     * // => []
-     */
-    var range = createRange();
-
-    /**
-     * This method is like `_.range` except that it populates values in
-     * descending order.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {number} [start=0] The start of the range.
-     * @param {number} end The end of the range.
-     * @param {number} [step=1] The value to increment or decrement by.
-     * @returns {Array} Returns the new array of numbers.
-     * @see _.inRange, _.range
-     * @example
-     *
-     * _.rangeRight(4);
-     * // => [3, 2, 1, 0]
-     *
-     * _.rangeRight(-4);
-     * // => [-3, -2, -1, 0]
-     *
-     * _.rangeRight(1, 5);
-     * // => [4, 3, 2, 1]
-     *
-     * _.rangeRight(0, 20, 5);
-     * // => [15, 10, 5, 0]
-     *
-     * _.rangeRight(0, -4, -1);
-     * // => [-3, -2, -1, 0]
-     *
-     * _.rangeRight(1, 4, 0);
-     * // => [1, 1, 1]
-     *
-     * _.rangeRight(0);
-     * // => []
-     */
-    var rangeRight = createRange(true);
-
-    /**
-     * Invokes the iteratee `n` times, returning an array of the results of
-     * each invocation. The iteratee is invoked with one argument; (index).
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {number} n The number of times to invoke `iteratee`.
-     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
-     * @returns {Array} Returns the array of results.
-     * @example
-     *
-     * _.times(3, String);
-     * // => ['0', '1', '2']
-     *
-     *  _.times(4, _.constant(true));
-     * // => [true, true, true, true]
-     */
-    function times(n, iteratee) {
-      n = toInteger(n);
-      if (n < 1 || n > MAX_SAFE_INTEGER) {
-        return [];
-      }
-      var index = MAX_ARRAY_LENGTH,
-          length = nativeMin(n, MAX_ARRAY_LENGTH);
-
-      iteratee = getIteratee(iteratee);
-      n -= MAX_ARRAY_LENGTH;
-
-      var result = baseTimes(length, iteratee);
-      while (++index < n) {
-        iteratee(index);
-      }
-      return result;
-    }
-
-    /**
-     * Converts `value` to a property path array.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Util
-     * @param {*} value The value to convert.
-     * @returns {Array} Returns the new property path array.
-     * @example
-     *
-     * _.toPath('a.b.c');
-     * // => ['a', 'b', 'c']
-     *
-     * _.toPath('a[0].b.c');
-     * // => ['a', '0', 'b', 'c']
-     *
-     * var path = ['a', 'b', 'c'],
-     *     newPath = _.toPath(path);
-     *
-     * console.log(newPath);
-     * // => ['a', 'b', 'c']
-     *
-     * console.log(path === newPath);
-     * // => false
-     */
-    function toPath(value) {
-      if (isArray(value)) {
-        return arrayMap(value, toKey);
-      }
-      return isSymbol(value) ? [value] : copyArray(stringToPath(value));
-    }
-
-    /**
-     * Generates a unique ID. If `prefix` is given, the ID is appended to it.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Util
-     * @param {string} [prefix=''] The value to prefix the ID with.
-     * @returns {string} Returns the unique ID.
-     * @example
-     *
-     * _.uniqueId('contact_');
-     * // => 'contact_104'
-     *
-     * _.uniqueId();
-     * // => '105'
-     */
-    function uniqueId(prefix) {
-      var id = ++idCounter;
-      return toString(prefix) + id;
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * Adds two numbers.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.4.0
-     * @category Math
-     * @param {number} augend The first number in an addition.
-     * @param {number} addend The second number in an addition.
-     * @returns {number} Returns the total.
-     * @example
-     *
-     * _.add(6, 4);
-     * // => 10
-     */
-    var add = createMathOperation(function(augend, addend) {
-      return augend + addend;
-    });
-
-    /**
-     * Computes `number` rounded up to `precision`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.10.0
-     * @category Math
-     * @param {number} number The number to round up.
-     * @param {number} [precision=0] The precision to round up to.
-     * @returns {number} Returns the rounded up number.
-     * @example
-     *
-     * _.ceil(4.006);
-     * // => 5
-     *
-     * _.ceil(6.004, 2);
-     * // => 6.01
-     *
-     * _.ceil(6040, -2);
-     * // => 6100
-     */
-    var ceil = createRound('ceil');
-
-    /**
-     * Divide two numbers.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.7.0
-     * @category Math
-     * @param {number} dividend The first number in a division.
-     * @param {number} divisor The second number in a division.
-     * @returns {number} Returns the quotient.
-     * @example
-     *
-     * _.divide(6, 4);
-     * // => 1.5
-     */
-    var divide = createMathOperation(function(dividend, divisor) {
-      return dividend / divisor;
-    });
-
-    /**
-     * Computes `number` rounded down to `precision`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.10.0
-     * @category Math
-     * @param {number} number The number to round down.
-     * @param {number} [precision=0] The precision to round down to.
-     * @returns {number} Returns the rounded down number.
-     * @example
-     *
-     * _.floor(4.006);
-     * // => 4
-     *
-     * _.floor(0.046, 2);
-     * // => 0.04
-     *
-     * _.floor(4060, -2);
-     * // => 4000
-     */
-    var floor = createRound('floor');
-
-    /**
-     * Computes the maximum value of `array`. If `array` is empty or falsey,
-     * `undefined` is returned.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @returns {*} Returns the maximum value.
-     * @example
-     *
-     * _.max([4, 2, 8, 6]);
-     * // => 8
-     *
-     * _.max([]);
-     * // => undefined
-     */
-    function max(array) {
-      return (array && array.length)
-        ? baseExtremum(array, identity, baseGt)
-        : undefined;
-    }
-
-    /**
-     * This method is like `_.max` except that it accepts `iteratee` which is
-     * invoked for each element in `array` to generate the criterion by which
-     * the value is ranked. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {*} Returns the maximum value.
-     * @example
-     *
-     * var objects = [{ 'n': 1 }, { 'n': 2 }];
-     *
-     * _.maxBy(objects, function(o) { return o.n; });
-     * // => { 'n': 2 }
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.maxBy(objects, 'n');
-     * // => { 'n': 2 }
-     */
-    function maxBy(array, iteratee) {
-      return (array && array.length)
-        ? baseExtremum(array, getIteratee(iteratee), baseGt)
-        : undefined;
-    }
-
-    /**
-     * Computes the mean of the values in `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @returns {number} Returns the mean.
-     * @example
-     *
-     * _.mean([4, 2, 8, 6]);
-     * // => 5
-     */
-    function mean(array) {
-      return baseMean(array, identity);
-    }
-
-    /**
-     * This method is like `_.mean` except that it accepts `iteratee` which is
-     * invoked for each element in `array` to generate the value to be averaged.
-     * The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.7.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {number} Returns the mean.
-     * @example
-     *
-     * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
-     *
-     * _.meanBy(objects, function(o) { return o.n; });
-     * // => 5
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.meanBy(objects, 'n');
-     * // => 5
-     */
-    function meanBy(array, iteratee) {
-      return baseMean(array, getIteratee(iteratee));
-    }
-
-    /**
-     * Computes the minimum value of `array`. If `array` is empty or falsey,
-     * `undefined` is returned.
-     *
-     * @static
-     * @since 0.1.0
-     * @memberOf _
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @returns {*} Returns the minimum value.
-     * @example
-     *
-     * _.min([4, 2, 8, 6]);
-     * // => 2
-     *
-     * _.min([]);
-     * // => undefined
-     */
-    function min(array) {
-      return (array && array.length)
-        ? baseExtremum(array, identity, baseLt)
-        : undefined;
-    }
-
-    /**
-     * This method is like `_.min` except that it accepts `iteratee` which is
-     * invoked for each element in `array` to generate the criterion by which
-     * the value is ranked. The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {*} Returns the minimum value.
-     * @example
-     *
-     * var objects = [{ 'n': 1 }, { 'n': 2 }];
-     *
-     * _.minBy(objects, function(o) { return o.n; });
-     * // => { 'n': 1 }
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.minBy(objects, 'n');
-     * // => { 'n': 1 }
-     */
-    function minBy(array, iteratee) {
-      return (array && array.length)
-        ? baseExtremum(array, getIteratee(iteratee), baseLt)
-        : undefined;
-    }
-
-    /**
-     * Multiply two numbers.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.7.0
-     * @category Math
-     * @param {number} multiplier The first number in a multiplication.
-     * @param {number} multiplicand The second number in a multiplication.
-     * @returns {number} Returns the product.
-     * @example
-     *
-     * _.multiply(6, 4);
-     * // => 24
-     */
-    var multiply = createMathOperation(function(multiplier, multiplicand) {
-      return multiplier * multiplicand;
-    });
-
-    /**
-     * Computes `number` rounded to `precision`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.10.0
-     * @category Math
-     * @param {number} number The number to round.
-     * @param {number} [precision=0] The precision to round to.
-     * @returns {number} Returns the rounded number.
-     * @example
-     *
-     * _.round(4.006);
-     * // => 4
-     *
-     * _.round(4.006, 2);
-     * // => 4.01
-     *
-     * _.round(4060, -2);
-     * // => 4100
-     */
-    var round = createRound('round');
-
-    /**
-     * Subtract two numbers.
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Math
-     * @param {number} minuend The first number in a subtraction.
-     * @param {number} subtrahend The second number in a subtraction.
-     * @returns {number} Returns the difference.
-     * @example
-     *
-     * _.subtract(6, 4);
-     * // => 2
-     */
-    var subtract = createMathOperation(function(minuend, subtrahend) {
-      return minuend - subtrahend;
-    });
-
-    /**
-     * Computes the sum of the values in `array`.
-     *
-     * @static
-     * @memberOf _
-     * @since 3.4.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @returns {number} Returns the sum.
-     * @example
-     *
-     * _.sum([4, 2, 8, 6]);
-     * // => 20
-     */
-    function sum(array) {
-      return (array && array.length)
-        ? baseSum(array, identity)
-        : 0;
-    }
-
-    /**
-     * This method is like `_.sum` except that it accepts `iteratee` which is
-     * invoked for each element in `array` to generate the value to be summed.
-     * The iteratee is invoked with one argument: (value).
-     *
-     * @static
-     * @memberOf _
-     * @since 4.0.0
-     * @category Math
-     * @param {Array} array The array to iterate over.
-     * @param {Array|Function|Object|string} [iteratee=_.identity]
-     *  The iteratee invoked per element.
-     * @returns {number} Returns the sum.
-     * @example
-     *
-     * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
-     *
-     * _.sumBy(objects, function(o) { return o.n; });
-     * // => 20
-     *
-     * // The `_.property` iteratee shorthand.
-     * _.sumBy(objects, 'n');
-     * // => 20
-     */
-    function sumBy(array, iteratee) {
-      return (array && array.length)
-        ? baseSum(array, getIteratee(iteratee))
-        : 0;
-    }
-
-    /*------------------------------------------------------------------------*/
-
-    // Add methods that return wrapped values in chain sequences.
-    lodash.after = after;
-    lodash.ary = ary;
-    lodash.assign = assign;
-    lodash.assignIn = assignIn;
-    lodash.assignInWith = assignInWith;
-    lodash.assignWith = assignWith;
-    lodash.at = at;
-    lodash.before = before;
-    lodash.bind = bind;
-    lodash.bindAll = bindAll;
-    lodash.bindKey = bindKey;
-    lodash.castArray = castArray;
-    lodash.chain = chain;
-    lodash.chunk = chunk;
-    lodash.compact = compact;
-    lodash.concat = concat;
-    lodash.cond = cond;
-    lodash.conforms = conforms;
-    lodash.constant = constant;
-    lodash.countBy = countBy;
-    lodash.create = create;
-    lodash.curry = curry;
-    lodash.curryRight = curryRight;
-    lodash.debounce = debounce;
-    lodash.defaults = defaults;
-    lodash.defaultsDeep = defaultsDeep;
-    lodash.defer = defer;
-    lodash.delay = delay;
-    lodash.difference = difference;
-    lodash.differenceBy = differenceBy;
-    lodash.differenceWith = differenceWith;
-    lodash.drop = drop;
-    lodash.dropRight = dropRight;
-    lodash.dropRightWhile = dropRightWhile;
-    lodash.dropWhile = dropWhile;
-    lodash.fill = fill;
-    lodash.filter = filter;
-    lodash.flatMap = flatMap;
-    lodash.flatMapDeep = flatMapDeep;
-    lodash.flatMapDepth = flatMapDepth;
-    lodash.flatten = flatten;
-    lodash.flattenDeep = flattenDeep;
-    lodash.flattenDepth = flattenDepth;
-    lodash.flip = flip;
-    lodash.flow = flow;
-    lodash.flowRight = flowRight;
-    lodash.fromPairs = fromPairs;
-    lodash.functions = functions;
-    lodash.functionsIn = functionsIn;
-    lodash.groupBy = groupBy;
-    lodash.initial = initial;
-    lodash.intersection = intersection;
-    lodash.intersectionBy = intersectionBy;
-    lodash.intersectionWith = intersectionWith;
-    lodash.invert = invert;
-    lodash.invertBy = invertBy;
-    lodash.invokeMap = invokeMap;
-    lodash.iteratee = iteratee;
-    lodash.keyBy = keyBy;
-    lodash.keys = keys;
-    lodash.keysIn = keysIn;
-    lodash.map = map;
-    lodash.mapKeys = mapKeys;
-    lodash.mapValues = mapValues;
-    lodash.matches = matches;
-    lodash.matchesProperty = matchesProperty;
-    lodash.memoize = memoize;
-    lodash.merge = merge;
-    lodash.mergeWith = mergeWith;
-    lodash.method = method;
-    lodash.methodOf = methodOf;
-    lodash.mixin = mixin;
-    lodash.negate = negate;
-    lodash.nthArg = nthArg;
-    lodash.omit = omit;
-    lodash.omitBy = omitBy;
-    lodash.once = once;
-    lodash.orderBy = orderBy;
-    lodash.over = over;
-    lodash.overArgs = overArgs;
-    lodash.overEvery = overEvery;
-    lodash.overSome = overSome;
-    lodash.partial = partial;
-    lodash.partialRight = partialRight;
-    lodash.partition = partition;
-    lodash.pick = pick;
-    lodash.pickBy = pickBy;
-    lodash.property = property;
-    lodash.propertyOf = propertyOf;
-    lodash.pull = pull;
-    lodash.pullAll = pullAll;
-    lodash.pullAllBy = pullAllBy;
-    lodash.pullAllWith = pullAllWith;
-    lodash.pullAt = pullAt;
-    lodash.range = range;
-    lodash.rangeRight = rangeRight;
-    lodash.rearg = rearg;
-    lodash.reject = reject;
-    lodash.remove = remove;
-    lodash.rest = rest;
-    lodash.reverse = reverse;
-    lodash.sampleSize = sampleSize;
-    lodash.set = set;
-    lodash.setWith = setWith;
-    lodash.shuffle = shuffle;
-    lodash.slice = slice;
-    lodash.sortBy = sortBy;
-    lodash.sortedUniq = sortedUniq;
-    lodash.sortedUniqBy = sortedUniqBy;
-    lodash.split = split;
-    lodash.spread = spread;
-    lodash.tail = tail;
-    lodash.take = take;
-    lodash.takeRight = takeRight;
-    lodash.takeRightWhile = takeRightWhile;
-    lodash.takeWhile = takeWhile;
-    lodash.tap = tap;
-    lodash.throttle = throttle;
-    lodash.thru = thru;
-    lodash.toArray = toArray;
-    lodash.toPairs = toPairs;
-    lodash.toPairsIn = toPairsIn;
-    lodash.toPath = toPath;
-    lodash.toPlainObject = toPlainObject;
-    lodash.transform = transform;
-    lodash.unary = unary;
-    lodash.union = union;
-    lodash.unionBy = unionBy;
-    lodash.unionWith = unionWith;
-    lodash.uniq = uniq;
-    lodash.uniqBy = uniqBy;
-    lodash.uniqWith = uniqWith;
-    lodash.unset = unset;
-    lodash.unzip = unzip;
-    lodash.unzipWith = unzipWith;
-    lodash.update = update;
-    lodash.updateWith = updateWith;
-    lodash.values = values;
-    lodash.valuesIn = valuesIn;
-    lodash.without = without;
-    lodash.words = words;
-    lodash.wrap = wrap;
-    lodash.xor = xor;
-    lodash.xorBy = xorBy;
-    lodash.xorWith = xorWith;
-    lodash.zip = zip;
-    lodash.zipObject = zipObject;
-    lodash.zipObjectDeep = zipObjectDeep;
-    lodash.zipWith = zipWith;
-
-    // Add aliases.
-    lodash.entries = toPairs;
-    lodash.entriesIn = toPairsIn;
-    lodash.extend = assignIn;
-    lodash.extendWith = assignInWith;
-
-    // Add methods to `lodash.prototype`.
-    mixin(lodash, lodash);
-
-    /*------------------------------------------------------------------------*/
-
-    // Add methods that return unwrapped values in chain sequences.
-    lodash.add = add;
-    lodash.attempt = attempt;
-    lodash.camelCase = camelCase;
-    lodash.capitalize = capitalize;
-    lodash.ceil = ceil;
-    lodash.clamp = clamp;
-    lodash.clone = clone;
-    lodash.cloneDeep = cloneDeep;
-    lodash.cloneDeepWith = cloneDeepWith;
-    lodash.cloneWith = cloneWith;
-    lodash.deburr = deburr;
-    lodash.divide = divide;
-    lodash.endsWith = endsWith;
-    lodash.eq = eq;
-    lodash.escape = escape;
-    lodash.escapeRegExp = escapeRegExp;
-    lodash.every = every;
-    lodash.find = find;
-    lodash.findIndex = findIndex;
-    lodash.findKey = findKey;
-    lodash.findLast = findLast;
-    lodash.findLastIndex = findLastIndex;
-    lodash.findLastKey = findLastKey;
-    lodash.floor = floor;
-    lodash.forEach = forEach;
-    lodash.forEachRight = forEachRight;
-    lodash.forIn = forIn;
-    lodash.forInRight = forInRight;
-    lodash.forOwn = forOwn;
-    lodash.forOwnRight = forOwnRight;
-    lodash.get = get;
-    lodash.gt = gt;
-    lodash.gte = gte;
-    lodash.has = has;
-    lodash.hasIn = hasIn;
-    lodash.head = head;
-    lodash.identity = identity;
-    lodash.includes = includes;
-    lodash.indexOf = indexOf;
-    lodash.inRange = inRange;
-    lodash.invoke = invoke;
-    lodash.isArguments = isArguments;
-    lodash.isArray = isArray;
-    lodash.isArrayBuffer = isArrayBuffer;
-    lodash.isArrayLike = isArrayLike;
-    lodash.isArrayLikeObject = isArrayLikeObject;
-    lodash.isBoolean = isBoolean;
-    lodash.isBuffer = isBuffer;
-    lodash.isDate = isDate;
-    lodash.isElement = isElement;
-    lodash.isEmpty = isEmpty;
-    lodash.isEqual = isEqual;
-    lodash.isEqualWith = isEqualWith;
-    lodash.isError = isError;
-    lodash.isFinite = isFinite;
-    lodash.isFunction = isFunction;
-    lodash.isInteger = isInteger;
-    lodash.isLength = isLength;
-    lodash.isMap = isMap;
-    lodash.isMatch = isMatch;
-    lodash.isMatchWith = isMatchWith;
-    lodash.isNaN = isNaN;
-    lodash.isNative = isNative;
-    lodash.isNil = isNil;
-    lodash.isNull = isNull;
-    lodash.isNumber = isNumber;
-    lodash.isObject = isObject;
-    lodash.isObjectLike = isObjectLike;
-    lodash.isPlainObject = isPlainObject;
-    lodash.isRegExp = isRegExp;
-    lodash.isSafeInteger = isSafeInteger;
-    lodash.isSet = isSet;
-    lodash.isString = isString;
-    lodash.isSymbol = isSymbol;
-    lodash.isTypedArray = isTypedArray;
-    lodash.isUndefined = isUndefined;
-    lodash.isWeakMap = isWeakMap;
-    lodash.isWeakSet = isWeakSet;
-    lodash.join = join;
-    lodash.kebabCase = kebabCase;
-    lodash.last = last;
-    lodash.lastIndexOf = lastIndexOf;
-    lodash.lowerCase = lowerCase;
-    lodash.lowerFirst = lowerFirst;
-    lodash.lt = lt;
-    lodash.lte = lte;
-    lodash.max = max;
-    lodash.maxBy = maxBy;
-    lodash.mean = mean;
-    lodash.meanBy = meanBy;
-    lodash.min = min;
-    lodash.minBy = minBy;
-    lodash.multiply = multiply;
-    lodash.nth = nth;
-    lodash.noConflict = noConflict;
-    lodash.noop = noop;
-    lodash.now = now;
-    lodash.pad = pad;
-    lodash.padEnd = padEnd;
-    lodash.padStart = padStart;
-    lodash.parseInt = parseInt;
-    lodash.random = random;
-    lodash.reduce = reduce;
-    lodash.reduceRight = reduceRight;
-    lodash.repeat = repeat;
-    lodash.replace = replace;
-    lodash.result = result;
-    lodash.round = round;
-    lodash.runInContext = runInContext;
-    lodash.sample = sample;
-    lodash.size = size;
-    lodash.snakeCase = snakeCase;
-    lodash.some = some;
-    lodash.sortedIndex = sortedIndex;
-    lodash.sortedIndexBy = sortedIndexBy;
-    lodash.sortedIndexOf = sortedIndexOf;
-    lodash.sortedLastIndex = sortedLastIndex;
-    lodash.sortedLastIndexBy = sortedLastIndexBy;
-    lodash.sortedLastIndexOf = sortedLastIndexOf;
-    lodash.startCase = startCase;
-    lodash.startsWith = startsWith;
-    lodash.subtract = subtract;
-    lodash.sum = sum;
-    lodash.sumBy = sumBy;
-    lodash.template = template;
-    lodash.times = times;
-    lodash.toInteger = toInteger;
-    lodash.toLength = toLength;
-    lodash.toLower = toLower;
-    lodash.toNumber = toNumber;
-    lodash.toSafeInteger = toSafeInteger;
-    lodash.toString = toString;
-    lodash.toUpper = toUpper;
-    lodash.trim = trim;
-    lodash.trimEnd = trimEnd;
-    lodash.trimStart = trimStart;
-    lodash.truncate = truncate;
-    lodash.unescape = unescape;
-    lodash.uniqueId = uniqueId;
-    lodash.upperCase = upperCase;
-    lodash.upperFirst = upperFirst;
-
-    // Add aliases.
-    lodash.each = forEach;
-    lodash.eachRight = forEachRight;
-    lodash.first = head;
-
-    mixin(lodash, (function() {
-      var source = {};
-      baseForOwn(lodash, function(func, methodName) {
-        if (!hasOwnProperty.call(lodash.prototype, methodName)) {
-          source[methodName] = func;
-        }
-      });
-      return source;
-    }()), { 'chain': false });
-
-    /*------------------------------------------------------------------------*/
-
-    /**
-     * The semantic version number.
-     *
-     * @static
-     * @memberOf _
-     * @type {string}
-     */
-    lodash.VERSION = VERSION;
-
-    // Assign default placeholders.
-    arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
-      lodash[methodName].placeholder = lodash;
-    });
-
-    // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
-    arrayEach(['drop', 'take'], function(methodName, index) {
-      LazyWrapper.prototype[methodName] = function(n) {
-        var filtered = this.__filtered__;
-        if (filtered && !index) {
-          return new LazyWrapper(this);
-        }
-        n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
-
-        var result = this.clone();
-        if (filtered) {
-          result.__takeCount__ = nativeMin(n, result.__takeCount__);
-        } else {
-          result.__views__.push({
-            'size': nativeMin(n, MAX_ARRAY_LENGTH),
-            'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
-          });
-        }
-        return result;
-      };
-
-      LazyWrapper.prototype[methodName + 'Right'] = function(n) {
-        return this.reverse()[methodName](n).reverse();
-      };
-    });
-
-    // Add `LazyWrapper` methods that accept an `iteratee` value.
-    arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
-      var type = index + 1,
-          isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
-
-      LazyWrapper.prototype[methodName] = function(iteratee) {
-        var result = this.clone();
-        result.__iteratees__.push({
-          'iteratee': getIteratee(iteratee, 3),
-          'type': type
-        });
-        result.__filtered__ = result.__filtered__ || isFilter;
-        return result;
-      };
-    });
-
-    // Add `LazyWrapper` methods for `_.head` and `_.last`.
-    arrayEach(['head', 'last'], function(methodName, index) {
-      var takeName = 'take' + (index ? 'Right' : '');
-
-      LazyWrapper.prototype[methodName] = function() {
-        return this[takeName](1).value()[0];
-      };
-    });
-
-    // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
-    arrayEach(['initial', 'tail'], function(methodName, index) {
-      var dropName = 'drop' + (index ? '' : 'Right');
-
-      LazyWrapper.prototype[methodName] = function() {
-        return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
-      };
-    });
-
-    LazyWrapper.prototype.compact = function() {
-      return this.filter(identity);
-    };
-
-    LazyWrapper.prototype.find = function(predicate) {
-      return this.filter(predicate).head();
-    };
-
-    LazyWrapper.prototype.findLast = function(predicate) {
-      return this.reverse().find(predicate);
-    };
-
-    LazyWrapper.prototype.invokeMap = rest(function(path, args) {
-      if (typeof path == 'function') {
-        return new LazyWrapper(this);
-      }
-      return this.map(function(value) {
-        return baseInvoke(value, path, args);
-      });
-    });
-
-    LazyWrapper.prototype.reject = function(predicate) {
-      predicate = getIteratee(predicate, 3);
-      return this.filter(function(value) {
-        return !predicate(value);
-      });
-    };
-
-    LazyWrapper.prototype.slice = function(start, end) {
-      start = toInteger(start);
-
-      var result = this;
-      if (result.__filtered__ && (start > 0 || end < 0)) {
-        return new LazyWrapper(result);
-      }
-      if (start < 0) {
-        result = result.takeRight(-start);
-      } else if (start) {
-        result = result.drop(start);
-      }
-      if (end !== undefined) {
-        end = toInteger(end);
-        result = end < 0 ? result.dropRight(-end) : result.take(end - start);
-      }
-      return result;
-    };
-
-    LazyWrapper.prototype.takeRightWhile = function(predicate) {
-      return this.reverse().takeWhile(predicate).reverse();
-    };
-
-    LazyWrapper.prototype.toArray = function() {
-      return this.take(MAX_ARRAY_LENGTH);
-    };
-
-    // Add `LazyWrapper` methods to `lodash.prototype`.
-    baseForOwn(LazyWrapper.prototype, function(func, methodName) {
-      var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
-          isTaker = /^(?:head|last)$/.test(methodName),
-          lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
-          retUnwrapped = isTaker || /^find/.test(methodName);
-
-      if (!lodashFunc) {
-        return;
-      }
-      lodash.prototype[methodName] = function() {
-        var value = this.__wrapped__,
-            args = isTaker ? [1] : arguments,
-            isLazy = value instanceof LazyWrapper,
-            iteratee = args[0],
-            useLazy = isLazy || isArray(value);
-
-        var interceptor = function(value) {
-          var result = lodashFunc.apply(lodash, arrayPush([value], args));
-          return (isTaker && chainAll) ? result[0] : result;
-        };
-
-        if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
-          // Avoid lazy use if the iteratee has a "length" value other than `1`.
-          isLazy = useLazy = false;
-        }
-        var chainAll = this.__chain__,
-            isHybrid = !!this.__actions__.length,
-            isUnwrapped = retUnwrapped && !chainAll,
-            onlyLazy = isLazy && !isHybrid;
-
-        if (!retUnwrapped && useLazy) {
-          value = onlyLazy ? value : new LazyWrapper(this);
-          var result = func.apply(value, args);
-          result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
-          return new LodashWrapper(result, chainAll);
-        }
-        if (isUnwrapped && onlyLazy) {
-          return func.apply(this, args);
-        }
-        result = this.thru(interceptor);
-        return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
-      };
-    });
-
-    // Add `Array` methods to `lodash.prototype`.
-    arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
-      var func = arrayProto[methodName],
-          chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
-          retUnwrapped = /^(?:pop|shift)$/.test(methodName);
-
-      lodash.prototype[methodName] = function() {
-        var args = arguments;
-        if (retUnwrapped && !this.__chain__) {
-          var value = this.value();
-          return func.apply(isArray(value) ? value : [], args);
-        }
-        return this[chainName](function(value) {
-          return func.apply(isArray(value) ? value : [], args);
-        });
-      };
-    });
-
-    // Map minified method names to their real names.
-    baseForOwn(LazyWrapper.prototype, function(func, methodName) {
-      var lodashFunc = lodash[methodName];
-      if (lodashFunc) {
-        var key = (lodashFunc.name + ''),
-            names = realNames[key] || (realNames[key] = []);
-
-        names.push({ 'name': methodName, 'func': lodashFunc });
-      }
-    });
-
-    realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{
-      'name': 'wrapper',
-      'func': undefined
-    }];
-
-    // Add methods to `LazyWrapper`.
-    LazyWrapper.prototype.clone = lazyClone;
-    LazyWrapper.prototype.reverse = lazyReverse;
-    LazyWrapper.prototype.value = lazyValue;
-
-    // Add chain sequence methods to the `lodash` wrapper.
-    lodash.prototype.at = wrapperAt;
-    lodash.prototype.chain = wrapperChain;
-    lodash.prototype.commit = wrapperCommit;
-    lodash.prototype.next = wrapperNext;
-    lodash.prototype.plant = wrapperPlant;
-    lodash.prototype.reverse = wrapperReverse;
-    lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
-
-    if (iteratorSymbol) {
-      lodash.prototype[iteratorSymbol] = wrapperToIterator;
-    }
-    return lodash;
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  // Export lodash.
-  var _ = runInContext();
-
-  // Expose Lodash on the free variable `window` or `self` when available so it's
-  // globally accessible, even when bundled with Browserify, Webpack, etc. This
-  // also prevents errors in cases where Lodash is loaded by a script tag in the
-  // presence of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch
-  // for more details. Use `_.noConflict` to remove Lodash from the global object.
-  (freeWindow || freeSelf || {})._ = _;
-
-  // Some AMD build optimizers like r.js check for condition patterns like the following:
-  if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
-    // Define as an anonymous module so, through path mapping, it can be
-    // referenced as the "underscore" module.
-    define(function() {
-      return _;
-    });
-  }
-  // Check for `exports` after `define` in case a build optimizer adds an `exports` object.
-  else if (freeExports && freeModule) {
-    // Export for Node.js.
-    if (moduleExports) {
-      (freeModule.exports = _)._ = _;
-    }
-    // Export for CommonJS support.
-    freeExports._ = _;
-  }
-  else {
-    // Export to the global object.
-    root._ = _;
-  }
-}.call(this));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/package.json b/views/ngXosViews/serviceGrid/src/vendor/lodash/package.json
deleted file mode 100644
index 914499d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/package.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
-  "name": "lodash",
-  "version": "4.11.2",
-  "license": "MIT",
-  "private": true,
-  "main": "lodash.js",
-  "scripts": {
-    "build": "npm run build:main && npm run build:fp",
-    "build:fp": "node lib/fp/build-dist.js",
-    "build:fp-modules": "node lib/fp/build-modules.js",
-    "build:main": "node lib/main/build-dist.js",
-    "build:main-modules": "node lib/main/build-modules.js",
-    "doc": "node lib/main/build-doc github",
-    "doc:fp": "node lib/fp/build-doc",
-    "doc:site": "node lib/main/build-doc site",
-    "pretest": "npm run build",
-    "style": "npm run style:main && npm run style:fp && npm run style:perf && npm run style:test",
-    "style:fp": "jscs fp/*.js lib/**/*.js",
-    "style:main": "jscs lodash.js",
-    "style:perf": "jscs perf/*.js perf/**/*.js",
-    "style:test": "jscs test/*.js test/**/*.js",
-    "test": "npm run test:main && npm run test:fp",
-    "test:fp": "node test/test-fp",
-    "test:main": "node test/test",
-    "validate": "npm run style && npm run test"
-  },
-  "devDependencies": {
-    "async": "^1.5.2",
-    "benchmark": "^2.1.0",
-    "chalk": "^1.1.3",
-    "codecov.io": "~0.1.6",
-    "coveralls": "^2.11.9",
-    "curl-amd": "~0.8.12",
-    "docdown": "~0.5.1",
-    "dojo": "^1.11.1",
-    "ecstatic": "^1.4.0",
-    "fs-extra": "~0.28.0",
-    "glob": "^7.0.3",
-    "istanbul": "0.4.3",
-    "jquery": "^2.2.3",
-    "jscs": "^3.0.1",
-    "lodash": "4.10.0",
-    "platform": "^1.3.1",
-    "qunit-extras": "^1.5.0",
-    "qunitjs": "~1.23.1",
-    "request": "^2.69.0",
-    "requirejs": "^2.2.0",
-    "sauce-tunnel": "^2.4.0",
-    "uglify-js": "2.6.2",
-    "webpack": "^1.12.15"
-  }
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/perf/asset/perf-ui.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/perf/asset/perf-ui.js
deleted file mode 100644
index e3ed64b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/perf/asset/perf-ui.js
+++ /dev/null
@@ -1,131 +0,0 @@
-;(function(window) {
-  'use strict';
-
-  /** The base path of the lodash builds. */
-  var basePath = '../';
-
-  /** The lodash build to load. */
-  var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
-
-  /** The other library to load. */
-  var other = (other = /other=([^&]+)/.exec(location.search)) && decodeURIComponent(other[1]);
-
-  /** The `ui` object. */
-  var ui = {};
-
-  /*--------------------------------------------------------------------------*/
-
-  /**
-   * Registers an event listener on an element.
-   *
-   * @private
-   * @param {Element} element The element.
-   * @param {string} eventName The name of the event.
-   * @param {Function} handler The event handler.
-   * @returns {Element} The element.
-   */
-  function addListener(element, eventName, handler) {
-    if (typeof element.addEventListener != 'undefined') {
-      element.addEventListener(eventName, handler, false);
-    } else if (typeof element.attachEvent != 'undefined') {
-      element.attachEvent('on' + eventName, handler);
-    }
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  // Initialize controls.
-  addListener(window, 'load', function() {
-    function eventHandler(event) {
-      var buildIndex = buildList.selectedIndex,
-          otherIndex = otherList.selectedIndex,
-          search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, '');
-
-      if (event.stopPropagation) {
-        event.stopPropagation();
-      } else {
-        event.cancelBubble = true;
-      }
-      location.href =
-        location.href.split('?')[0] + '?' +
-        (search ? search + '&' : '') +
-        'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' +
-        'other=' + (otherIndex < 0 ? other : otherList[otherIndex].value);
-    }
-
-    var span1 = document.createElement('span');
-    span1.style.cssText = 'float:right';
-    span1.innerHTML =
-      '<label for="perf-build">Build: </label>' +
-      '<select id="perf-build">' +
-      '<option value="lodash">lodash</option>' +
-      '</select>';
-
-    var span2 = document.createElement('span');
-    span2.style.cssText = 'float:right';
-    span2.innerHTML =
-      '<label for="perf-other">Other Library: </label>' +
-      '<select id="perf-other">' +
-      '<option value="underscore-dev">Underscore (development)</option>' +
-      '<option value="underscore">Underscore (production)</option>' +
-      '<option value="lodash">lodash</option>' +
-      '</select>';
-
-    var buildList = span1.lastChild,
-        otherList = span2.lastChild,
-        toolbar = document.getElementById('perf-toolbar');
-
-    toolbar.appendChild(span2);
-    toolbar.appendChild(span1);
-
-    buildList.selectedIndex = (function() {
-      switch (build) {
-        case 'lodash':
-        case null:                return 0;
-      }
-      return -1;
-    }());
-
-    otherList.selectedIndex = (function() {
-      switch (other) {
-        case 'underscore-dev':    return 0;
-        case 'lodash':            return 2;
-        case 'underscore':
-        case null:                return 1;
-      }
-      return -1;
-    }());
-
-    addListener(buildList, 'change', eventHandler);
-    addListener(otherList, 'change', eventHandler);
-  });
-
-  // The lodash build file path.
-  ui.buildPath = (function() {
-    var result;
-    switch (build) {
-      case null:                build  = 'lodash';
-      case 'lodash':            result = 'dist/lodash.min.js'; break;
-      default:                  return build;
-    }
-    return basePath + result;
-  }());
-
-  // The other library file path.
-  ui.otherPath = (function() {
-    var result;
-    switch (other) {
-      case 'lodash':            result = 'dist/lodash.min.js'; break;
-      case 'underscore-dev':    result = 'vendor/underscore/underscore.js'; break;
-      case null:                other  = 'underscore';
-      case 'underscore':        result = 'vendor/underscore/underscore-min.js'; break;
-      default:                  return other;
-    }
-    return basePath + result;
-  }());
-
-  ui.urlParams = { 'build': build, 'other': other };
-
-  window.ui = ui;
-
-}(this));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/perf/index.html b/views/ngXosViews/serviceGrid/src/vendor/lodash/perf/index.html
deleted file mode 100644
index 16d41bf..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/perf/index.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!doctype html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <title>lodash Performance Suite</title>
-    <style>
-      html, body {
-        margin: 0;
-        padding: 0;
-        height: 100%;
-      }
-      #FirebugUI {
-        top: 2em;
-      }
-      #perf-toolbar {
-        background-color: #EEE;
-        color: #5E740B;
-        font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
-        font-size: small;
-        padding: 0.5em 0 0.5em 2em;
-        overflow: hidden;
-      }
-    </style>
-  </head>
-  <body>
-    <div id="perf-toolbar"></div>
-    <script src="../lodash.js"></script>
-    <script src="../node_modules/platform/platform.js"></script>
-    <script src="../node_modules/benchmark/benchmark.js"></script>
-    <script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
-    <script src="./asset/perf-ui.js"></script>
-    <script>
-      document.write('<script src="' + ui.buildPath + '"><\/script>');
-    </script>
-    <script>
-      var lodash = _.noConflict();
-    </script>
-    <script>
-      document.write('<script src="' + ui.otherPath + '"><\/script>');
-    </script>
-    <script src="perf.js"></script>
-    <script>
-      (function() {
-        var measured,
-            perfNow,
-            begin = new Date;
-
-        function init() {
-          var fbUI = document.getElementById('FirebugUI'),
-              fbDoc = fbUI && (fbDoc = fbUI.contentWindow || fbUI.contentDocument).document || fbDoc,
-              fbCommandLine = fbDoc && fbDoc.getElementById('fbCommandLine');
-
-          if (!fbCommandLine) {
-            return setTimeout(init, 15);
-          }
-          fbUI.style.height = (
-            Math.max(document.documentElement.clientHeight, document.body.clientHeight) -
-            document.getElementById('perf-toolbar').clientHeight
-          ) + 'px';
-
-          fbDoc.body.style.height = fbDoc.documentElement.style.height = '100%';
-          setTimeout(run, 15);
-        }
-
-        window.onload = init;
-      }());
-    </script>
-  </body>
-</html>
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/perf/perf.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/perf/perf.js
deleted file mode 100644
index baee142..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/perf/perf.js
+++ /dev/null
@@ -1,1977 +0,0 @@
-;(function() {
-
-  /** Used to access the Firebug Lite panel (set by `run`). */
-  var fbPanel;
-
-  /** Used as a safe reference for `undefined` in pre ES5 environments. */
-  var undefined;
-
-  /** Used as a reference to the global object. */
-  var root = typeof global == 'object' && global || this;
-
-  /** Method and object shortcuts. */
-  var phantom = root.phantom,
-      amd = root.define && define.amd,
-      argv = root.process && process.argv,
-      document = !phantom && root.document,
-      noop = function() {},
-      params = root.arguments,
-      system = root.system;
-
-  /** Add `console.log()` support for Rhino and RingoJS. */
-  var console = root.console || (root.console = { 'log': root.print });
-
-  /** The file path of the lodash file to test. */
-  var filePath = (function() {
-    var min = 0,
-        result = [];
-
-    if (phantom) {
-      result = params = phantom.args;
-    } else if (system) {
-      min = 1;
-      result = params = system.args;
-    } else if (argv) {
-      min = 2;
-      result = params = argv;
-    } else if (params) {
-      result = params;
-    }
-    var last = result[result.length - 1];
-    result = (result.length > min && !/perf(?:\.js)?$/.test(last)) ? last : '../lodash.js';
-
-    if (!amd) {
-      try {
-        result = require('fs').realpathSync(result);
-      } catch (e) {}
-
-      try {
-        result = require.resolve(result);
-      } catch (e) {}
-    }
-    return result;
-  }());
-
-  /** Used to match path separators. */
-  var rePathSeparator = /[\/\\]/;
-
-  /** Used to detect primitive types. */
-  var rePrimitive = /^(?:boolean|number|string|undefined)$/;
-
-  /** Used to match RegExp special characters. */
-  var reSpecialChars = /[.*+?^=!:${}()|[\]\/\\]/g;
-
-  /** The `ui` object. */
-  var ui = root.ui || (root.ui = {
-    'buildPath': basename(filePath, '.js'),
-    'otherPath': 'underscore'
-  });
-
-  /** The lodash build basename. */
-  var buildName = root.buildName = basename(ui.buildPath, '.js');
-
-  /** The other library basename. */
-  var otherName = root.otherName = (function() {
-    var result = basename(ui.otherPath, '.js');
-    return result + (result == buildName ? ' (2)' : '');
-  }());
-
-  /** Used to score performance. */
-  var score = { 'a': [], 'b': [] };
-
-  /** Used to queue benchmark suites. */
-  var suites = [];
-
-  /** Use a single "load" function. */
-  var load = (typeof require == 'function' && !amd)
-    ? require
-    : noop;
-
-  /** Load lodash. */
-  var lodash = root.lodash || (root.lodash = (
-    lodash = load(filePath) || root._,
-    lodash = lodash._ || lodash,
-    (lodash.runInContext ? lodash.runInContext(root) : lodash),
-    lodash.noConflict()
-  ));
-
-  /** Load Underscore. */
-  var _ = root.underscore || (root.underscore = (
-    _ = load('../vendor/underscore/underscore.js') || root._,
-    _._ || _
-  ));
-
-  /** Load Benchmark.js. */
-  var Benchmark = root.Benchmark || (root.Benchmark = (
-    Benchmark = load('../node_modules/benchmark/benchmark.js') || root.Benchmark,
-    Benchmark = Benchmark.Benchmark || Benchmark,
-    Benchmark.runInContext(lodash.extend({}, root, { '_': lodash }))
-  ));
-
-  /*--------------------------------------------------------------------------*/
-
-  /**
-   * Gets the basename of the given `filePath`. If the file `extension` is passed,
-   * it will be removed from the basename.
-   *
-   * @private
-   * @param {string} path The file path to inspect.
-   * @param {string} extension The extension to remove.
-   * @returns {string} Returns the basename.
-   */
-  function basename(filePath, extension) {
-    var result = (filePath || '').split(rePathSeparator).pop();
-    return (arguments.length < 2)
-      ? result
-      : result.replace(RegExp(extension.replace(reSpecialChars, '\\$&') + '$'), '');
-  }
-
-  /**
-   * Computes the geometric mean (log-average) of an array of values.
-   * See http://en.wikipedia.org/wiki/Geometric_mean#Relationship_with_arithmetic_mean_of_logarithms.
-   *
-   * @private
-   * @param {Array} array The array of values.
-   * @returns {number} The geometric mean.
-   */
-  function getGeometricMean(array) {
-    return Math.pow(Math.E, lodash.reduce(array, function(sum, x) {
-      return sum + Math.log(x);
-    }, 0) / array.length) || 0;
-  }
-
-  /**
-   * Gets the Hz, i.e. operations per second, of `bench` adjusted for the
-   * margin of error.
-   *
-   * @private
-   * @param {Object} bench The benchmark object.
-   * @returns {number} Returns the adjusted Hz.
-   */
-  function getHz(bench) {
-    var result = 1 / (bench.stats.mean + bench.stats.moe);
-    return isFinite(result) ? result : 0;
-  }
-
-  /**
-   * Host objects can return type values that are different from their actual
-   * data type. The objects we are concerned with usually return non-primitive
-   * types of "object", "function", or "unknown".
-   *
-   * @private
-   * @param {*} object The owner of the property.
-   * @param {string} property The property to check.
-   * @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`.
-   */
-  function isHostType(object, property) {
-    if (object == null) {
-      return false;
-    }
-    var type = typeof object[property];
-    return !rePrimitive.test(type) && (type != 'object' || !!object[property]);
-  }
-
-  /**
-   * Logs text to the console.
-   *
-   * @private
-   * @param {string} text The text to log.
-   */
-  function log(text) {
-    console.log(text + '');
-    if (fbPanel) {
-      // Scroll the Firebug Lite panel down.
-      fbPanel.scrollTop = fbPanel.scrollHeight;
-    }
-  }
-
-  /**
-   * Runs all benchmark suites.
-   *
-   * @private (@public in the browser)
-   */
-  function run() {
-    fbPanel = (fbPanel = root.document && document.getElementById('FirebugUI')) &&
-      (fbPanel = (fbPanel = fbPanel.contentWindow || fbPanel.contentDocument).document || fbPanel) &&
-      fbPanel.getElementById('fbPanel1');
-
-    log('\nSit back and relax, this may take a while.');
-    suites[0].run({ 'async': true });
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  lodash.extend(Benchmark.Suite.options, {
-    'onStart': function() {
-      log('\n' + this.name + ':');
-    },
-    'onCycle': function(event) {
-      log(event.target);
-    },
-    'onComplete': function() {
-      for (var index = 0, length = this.length; index < length; index++) {
-        var bench = this[index];
-        if (bench.error) {
-          var errored = true;
-        }
-      }
-      if (errored) {
-        log('There was a problem, skipping...');
-      }
-      else {
-        var formatNumber = Benchmark.formatNumber,
-            fastest = this.filter('fastest'),
-            fastestHz = getHz(fastest[0]),
-            slowest = this.filter('slowest'),
-            slowestHz = getHz(slowest[0]),
-            aHz = getHz(this[0]),
-            bHz = getHz(this[1]);
-
-        if (fastest.length > 1) {
-          log('It\'s too close to call.');
-          aHz = bHz = slowestHz;
-        }
-        else {
-          var percent = ((fastestHz / slowestHz) - 1) * 100;
-
-          log(
-            fastest[0].name + ' is ' +
-            formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) +
-            '% faster.'
-          );
-        }
-        // Add score adjusted for margin of error.
-        score.a.push(aHz);
-        score.b.push(bHz);
-      }
-      // Remove current suite from queue.
-      suites.shift();
-
-      if (suites.length) {
-        // Run next suite.
-        suites[0].run({ 'async': true });
-      }
-      else {
-        var aMeanHz = getGeometricMean(score.a),
-            bMeanHz = getGeometricMean(score.b),
-            fastestMeanHz = Math.max(aMeanHz, bMeanHz),
-            slowestMeanHz = Math.min(aMeanHz, bMeanHz),
-            xFaster = fastestMeanHz / slowestMeanHz,
-            percentFaster = formatNumber(Math.round((xFaster - 1) * 100)),
-            message = 'is ' + percentFaster + '% ' + (xFaster == 1 ? '' : '(' + formatNumber(xFaster.toFixed(2)) + 'x) ') + 'faster than';
-
-        // Report results.
-        if (aMeanHz >= bMeanHz) {
-          log('\n' + buildName + ' ' + message + ' ' + otherName + '.');
-        } else {
-          log('\n' + otherName + ' ' + message + ' ' + buildName + '.');
-        }
-      }
-    }
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  lodash.extend(Benchmark.options, {
-    'async': true,
-    'setup': '\
-      var _ = global.underscore,\
-          lodash = global.lodash,\
-          belt = this.name == buildName ? lodash : _;\
-      \
-      var date = new Date,\
-          limit = 50,\
-          regexp = /x/,\
-          object = {},\
-          objects = Array(limit),\
-          numbers = Array(limit),\
-          fourNumbers = [5, 25, 10, 30],\
-          nestedNumbers = [1, [2], [3, [[4]]]],\
-          nestedObjects = [{}, [{}], [{}, [[{}]]]],\
-          twoNumbers = [12, 23];\
-      \
-      for (var index = 0; index < limit; index++) {\
-        numbers[index] = index;\
-        object["key" + index] = index;\
-        objects[index] = { "num": index };\
-      }\
-      var strNumbers = numbers + "";\
-      \
-      if (typeof assign != "undefined") {\
-        var _assign = _.assign || _.extend,\
-            lodashAssign = lodash.assign;\
-      }\
-      if (typeof bind != "undefined") {\
-        var thisArg = { "name": "fred" };\
-        \
-        var func = function(greeting, punctuation) {\
-          return (greeting || "hi") + " " + this.name + (punctuation || ".");\
-        };\
-        \
-        var _boundNormal = _.bind(func, thisArg),\
-            _boundMultiple = _boundNormal,\
-            _boundPartial = _.bind(func, thisArg, "hi");\
-        \
-        var lodashBoundNormal = lodash.bind(func, thisArg),\
-            lodashBoundMultiple = lodashBoundNormal,\
-            lodashBoundPartial = lodash.bind(func, thisArg, "hi");\
-        \
-        for (index = 0; index < 10; index++) {\
-          _boundMultiple = _.bind(_boundMultiple, { "name": "fred" + index });\
-          lodashBoundMultiple = lodash.bind(lodashBoundMultiple, { "name": "fred" + index });\
-        }\
-      }\
-      if (typeof bindAll != "undefined") {\
-        var bindAllCount = -1,\
-            bindAllObjects = Array(this.count);\
-        \
-        var funcNames = belt.reject(belt.functions(belt).slice(0, 40), function(funcName) {\
-          return /^_/.test(funcName);\
-        });\
-        \
-        // Potentially expensive.\n\
-        for (index = 0; index < this.count; index++) {\
-          bindAllObjects[index] = belt.reduce(funcNames, function(object, funcName) {\
-            object[funcName] = belt[funcName];\
-            return object;\
-          }, {});\
-        }\
-      }\
-      if (typeof chaining != "undefined") {\
-        var even = function(v) { return v % 2 == 0; },\
-            square = function(v) { return v * v; };\
-        \
-        var largeArray = belt.range(10000),\
-            _chaining = _(largeArray).chain(),\
-            lodashChaining = lodash(largeArray).chain();\
-      }\
-      if (typeof compact != "undefined") {\
-        var uncompacted = numbers.slice();\
-        uncompacted[2] = false;\
-        uncompacted[6] = null;\
-        uncompacted[18] = "";\
-      }\
-      if (typeof flowRight != "undefined") {\
-        var compAddOne = function(n) { return n + 1; },\
-            compAddTwo = function(n) { return n + 2; },\
-            compAddThree = function(n) { return n + 3; };\
-        \
-        var _composed = _.flowRight && _.flowRight(compAddThree, compAddTwo, compAddOne),\
-            lodashComposed = lodash.flowRight && lodash.flowRight(compAddThree, compAddTwo, compAddOne);\
-      }\
-      if (typeof countBy != "undefined" || typeof omit != "undefined") {\
-        var wordToNumber = {\
-          "one": 1,\
-          "two": 2,\
-          "three": 3,\
-          "four": 4,\
-          "five": 5,\
-          "six": 6,\
-          "seven": 7,\
-          "eight": 8,\
-          "nine": 9,\
-          "ten": 10,\
-          "eleven": 11,\
-          "twelve": 12,\
-          "thirteen": 13,\
-          "fourteen": 14,\
-          "fifteen": 15,\
-          "sixteen": 16,\
-          "seventeen": 17,\
-          "eighteen": 18,\
-          "nineteen": 19,\
-          "twenty": 20,\
-          "twenty-one": 21,\
-          "twenty-two": 22,\
-          "twenty-three": 23,\
-          "twenty-four": 24,\
-          "twenty-five": 25,\
-          "twenty-six": 26,\
-          "twenty-seven": 27,\
-          "twenty-eight": 28,\
-          "twenty-nine": 29,\
-          "thirty": 30,\
-          "thirty-one": 31,\
-          "thirty-two": 32,\
-          "thirty-three": 33,\
-          "thirty-four": 34,\
-          "thirty-five": 35,\
-          "thirty-six": 36,\
-          "thirty-seven": 37,\
-          "thirty-eight": 38,\
-          "thirty-nine": 39,\
-          "forty": 40\
-        };\
-        \
-        var words = belt.keys(wordToNumber).slice(0, limit);\
-      }\
-      if (typeof flatten != "undefined") {\
-        var _flattenDeep = _.flatten([[1]])[0] !== 1,\
-            lodashFlattenDeep = lodash.flatten([[1]])[0] !== 1;\
-      }\
-      if (typeof isEqual != "undefined") {\
-        var objectOfPrimitives = {\
-          "boolean": true,\
-          "number": 1,\
-          "string": "a"\
-        };\
-        \
-        var objectOfObjects = {\
-          "boolean": new Boolean(true),\
-          "number": new Number(1),\
-          "string": new String("a")\
-        };\
-        \
-        var objectOfObjects2 = {\
-          "boolean": new Boolean(true),\
-          "number": new Number(1),\
-          "string": new String("A")\
-        };\
-        \
-        var object2 = {},\
-            object3 = {},\
-            objects2 = Array(limit),\
-            objects3 = Array(limit),\
-            numbers2 = Array(limit),\
-            numbers3 = Array(limit),\
-            nestedNumbers2 = [1, [2], [3, [[4]]]],\
-            nestedNumbers3 = [1, [2], [3, [[6]]]];\
-        \
-        for (index = 0; index < limit; index++) {\
-          object2["key" + index] = index;\
-          object3["key" + index] = index;\
-          objects2[index] = { "num": index };\
-          objects3[index] = { "num": index };\
-          numbers2[index] = index;\
-          numbers3[index] = index;\
-        }\
-        object3["key" + (limit - 1)] = -1;\
-        objects3[limit - 1].num = -1;\
-        numbers3[limit - 1] = -1;\
-      }\
-      if (typeof matches != "undefined") {\
-        var source = { "num": 9 };\
-        \
-        var _matcher = (_.matches || _.noop)(source),\
-            lodashMatcher = (lodash.matches || lodash.noop)(source);\
-      }\
-      if (typeof multiArrays != "undefined") {\
-        var twentyValues = belt.shuffle(belt.range(20)),\
-            fortyValues = belt.shuffle(belt.range(40)),\
-            hundredSortedValues = belt.range(100),\
-            hundredValues = belt.shuffle(hundredSortedValues),\
-            hundredValues2 = belt.shuffle(hundredValues),\
-            hundredTwentyValues = belt.shuffle(belt.range(120)),\
-            hundredTwentyValues2 = belt.shuffle(hundredTwentyValues),\
-            twoHundredValues = belt.shuffle(belt.range(200)),\
-            twoHundredValues2 = belt.shuffle(twoHundredValues);\
-      }\
-      if (typeof partial != "undefined") {\
-        var func = function(greeting, punctuation) {\
-          return greeting + " fred" + (punctuation || ".");\
-        };\
-        \
-        var _partial = _.partial(func, "hi"),\
-            lodashPartial = lodash.partial(func, "hi");\
-      }\
-      if (typeof template != "undefined") {\
-        var tplData = {\
-          "header1": "Header1",\
-          "header2": "Header2",\
-          "header3": "Header3",\
-          "header4": "Header4",\
-          "header5": "Header5",\
-          "header6": "Header6",\
-          "list": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]\
-        };\
-        \
-        var tpl =\
-          "<div>" +\
-          "<h1 class=\'header1\'><%= header1 %></h1>" +\
-          "<h2 class=\'header2\'><%= header2 %></h2>" +\
-          "<h3 class=\'header3\'><%= header3 %></h3>" +\
-          "<h4 class=\'header4\'><%= header4 %></h4>" +\
-          "<h5 class=\'header5\'><%= header5 %></h5>" +\
-          "<h6 class=\'header6\'><%= header6 %></h6>" +\
-          "<ul class=\'list\'>" +\
-          "<% for (var index = 0, length = list.length; index < length; index++) { %>" +\
-          "<li class=\'item\'><%= list[index] %></li>" +\
-          "<% } %>" +\
-          "</ul>" +\
-          "</div>";\
-        \
-        var tplVerbose =\
-          "<div>" +\
-          "<h1 class=\'header1\'><%= data.header1 %></h1>" +\
-          "<h2 class=\'header2\'><%= data.header2 %></h2>" +\
-          "<h3 class=\'header3\'><%= data.header3 %></h3>" +\
-          "<h4 class=\'header4\'><%= data.header4 %></h4>" +\
-          "<h5 class=\'header5\'><%= data.header5 %></h5>" +\
-          "<h6 class=\'header6\'><%= data.header6 %></h6>" +\
-          "<ul class=\'list\'>" +\
-          "<% for (var index = 0, length = data.list.length; index < length; index++) { %>" +\
-          "<li class=\'item\'><%= data.list[index] %></li>" +\
-          "<% } %>" +\
-          "</ul>" +\
-          "</div>";\
-        \
-        var settingsObject = { "variable": "data" };\
-        \
-        var _tpl = _.template(tpl),\
-            _tplVerbose = _.template(tplVerbose, null, settingsObject);\
-        \
-        var lodashTpl = lodash.template(tpl),\
-            lodashTplVerbose = lodash.template(tplVerbose, null, settingsObject);\
-      }\
-      if (typeof wrap != "undefined") {\
-        var add = function(a, b) {\
-          return a + b;\
-        };\
-        \
-        var average = function(func, a, b) {\
-          return (func(a, b) / 2).toFixed(2);\
-        };\
-        \
-        var _wrapped = _.wrap(add, average);\
-            lodashWrapped = lodash.wrap(add, average);\
-      }\
-      if (typeof zip != "undefined") {\
-        var unzipped = [["a", "b", "c"], [1, 2, 3], [true, false, true]];\
-      }'
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_(...).map(...).filter(...).take(...).value()`')
-      .add(buildName, {
-        'fn': 'lodashChaining.map(square).filter(even).take(100).value()',
-        'teardown': 'function chaining(){}'
-      })
-      .add(otherName, {
-        'fn': '_chaining.map(square).filter(even).take(100).value()',
-        'teardown': 'function chaining(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.assign`')
-      .add(buildName, {
-        'fn': 'lodashAssign({}, { "a": 1, "b": 2, "c": 3 })',
-        'teardown': 'function assign(){}'
-      })
-      .add(otherName, {
-        'fn': '_assign({}, { "a": 1, "b": 2, "c": 3 })',
-        'teardown': 'function assign(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.assign` with multiple sources')
-      .add(buildName, {
-        'fn': 'lodashAssign({}, { "a": 1, "b": 2 }, { "c": 3, "d": 4 })',
-        'teardown': 'function assign(){}'
-      })
-      .add(otherName, {
-        'fn': '_assign({}, { "a": 1, "b": 2 }, { "c": 3, "d": 4 })',
-        'teardown': 'function assign(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.bind` (slow path)')
-      .add(buildName, {
-        'fn': 'lodash.bind(function() { return this.name; }, { "name": "fred" })',
-        'teardown': 'function bind(){}'
-      })
-      .add(otherName, {
-        'fn': '_.bind(function() { return this.name; }, { "name": "fred" })',
-        'teardown': 'function bind(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('bound call with arguments')
-      .add(buildName, {
-        'fn': 'lodashBoundNormal("hi", "!")',
-        'teardown': 'function bind(){}'
-      })
-      .add(otherName, {
-        'fn': '_boundNormal("hi", "!")',
-        'teardown': 'function bind(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('bound and partially applied call with arguments')
-      .add(buildName, {
-        'fn': 'lodashBoundPartial("!")',
-        'teardown': 'function bind(){}'
-      })
-      .add(otherName, {
-        'fn': '_boundPartial("!")',
-        'teardown': 'function bind(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('bound multiple times')
-      .add(buildName, {
-        'fn': 'lodashBoundMultiple()',
-        'teardown': 'function bind(){}'
-      })
-      .add(otherName, {
-        'fn': '_boundMultiple()',
-        'teardown': 'function bind(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.bindAll`')
-      .add(buildName, {
-        'fn': 'lodash.bindAll(bindAllObjects[++bindAllCount], funcNames)',
-        'teardown': 'function bindAll(){}'
-      })
-      .add(otherName, {
-        'fn': '_.bindAll(bindAllObjects[++bindAllCount], funcNames)',
-        'teardown': 'function bindAll(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.clone` with an array')
-      .add(buildName, '\
-        lodash.clone(numbers)'
-      )
-      .add(otherName, '\
-        _.clone(numbers)'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.clone` with an object')
-      .add(buildName, '\
-        lodash.clone(object)'
-      )
-      .add(otherName, '\
-        _.clone(object)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.compact`')
-      .add(buildName, {
-        'fn': 'lodash.compact(uncompacted)',
-        'teardown': 'function compact(){}'
-      })
-      .add(otherName, {
-        'fn': '_.compact(uncompacted)',
-        'teardown': 'function compact(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.countBy` with `callback` iterating an array')
-      .add(buildName, '\
-        lodash.countBy(numbers, function(num) { return num >> 1; })'
-      )
-      .add(otherName, '\
-        _.countBy(numbers, function(num) { return num >> 1; })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.countBy` with `property` name iterating an array')
-      .add(buildName, {
-        'fn': 'lodash.countBy(words, "length")',
-        'teardown': 'function countBy(){}'
-      })
-      .add(otherName, {
-        'fn': '_.countBy(words, "length")',
-        'teardown': 'function countBy(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.countBy` with `callback` iterating an object')
-      .add(buildName, {
-        'fn': 'lodash.countBy(wordToNumber, function(num) { return num >> 1; })',
-        'teardown': 'function countBy(){}'
-      })
-      .add(otherName, {
-        'fn': '_.countBy(wordToNumber, function(num) { return num >> 1; })',
-        'teardown': 'function countBy(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.defaults`')
-      .add(buildName, '\
-        lodash.defaults({ "key2": 2, "key6": 6, "key18": 18 }, object)'
-      )
-      .add(otherName, '\
-        _.defaults({ "key2": 2, "key6": 6, "key18": 18 }, object)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.difference`')
-      .add(buildName, '\
-        lodash.difference(numbers, twoNumbers, fourNumbers)'
-      )
-      .add(otherName, '\
-        _.difference(numbers, twoNumbers, fourNumbers)'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.difference` iterating 20 and 40 elements')
-      .add(buildName, {
-        'fn': 'lodash.difference(twentyValues, fortyValues)',
-        'teardown': 'function multiArrays(){}'
-      })
-      .add(otherName, {
-        'fn': '_.difference(twentyValues, fortyValues)',
-        'teardown': 'function multiArrays(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.difference` iterating 200 elements')
-      .add(buildName, {
-        'fn': 'lodash.difference(twoHundredValues, twoHundredValues2)',
-        'teardown': 'function multiArrays(){}'
-      })
-      .add(otherName, {
-        'fn': '_.difference(twoHundredValues, twoHundredValues2)',
-        'teardown': 'function multiArrays(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.each` iterating an array')
-      .add(buildName, '\
-        var result = [];\
-        lodash.each(numbers, function(num) {\
-          result.push(num * 2);\
-        })'
-      )
-      .add(otherName, '\
-        var result = [];\
-        _.each(numbers, function(num) {\
-          result.push(num * 2);\
-        })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.each` iterating an object')
-      .add(buildName, '\
-        var result = [];\
-        lodash.each(object, function(num) {\
-          result.push(num * 2);\
-        })'
-      )
-      .add(otherName, '\
-        var result = [];\
-        _.each(object, function(num) {\
-          result.push(num * 2);\
-        })'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.every` iterating an array')
-      .add(buildName, '\
-        lodash.every(numbers, function(num) {\
-          return num < limit;\
-        })'
-      )
-      .add(otherName, '\
-        _.every(numbers, function(num) {\
-          return num < limit;\
-        })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.every` iterating an object')
-      .add(buildName, '\
-        lodash.every(object, function(num) {\
-          return num < limit;\
-        })'
-      )
-      .add(otherName, '\
-        _.every(object, function(num) {\
-          return num < limit;\
-        })'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.filter` iterating an array')
-      .add(buildName, '\
-        lodash.filter(numbers, function(num) {\
-          return num % 2;\
-        })'
-      )
-      .add(otherName, '\
-        _.filter(numbers, function(num) {\
-          return num % 2;\
-        })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.filter` iterating an object')
-      .add(buildName, '\
-        lodash.filter(object, function(num) {\
-          return num % 2\
-        })'
-      )
-      .add(otherName, '\
-        _.filter(object, function(num) {\
-          return num % 2\
-        })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.filter` with `_.matches` shorthand')
-      .add(buildName, {
-        'fn': 'lodash.filter(objects, source)',
-        'teardown': 'function matches(){}'
-      })
-      .add(otherName, {
-        'fn': '_.filter(objects, source)',
-        'teardown': 'function matches(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.filter` with `_.matches` predicate')
-      .add(buildName, {
-        'fn': 'lodash.filter(objects, lodashMatcher)',
-        'teardown': 'function matches(){}'
-      })
-      .add(otherName, {
-        'fn': '_.filter(objects, _matcher)',
-        'teardown': 'function matches(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.find` iterating an array')
-      .add(buildName, '\
-        lodash.find(numbers, function(num) {\
-          return num === (limit - 1);\
-        })'
-      )
-      .add(otherName, '\
-        _.find(numbers, function(num) {\
-          return num === (limit - 1);\
-        })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.find` iterating an object')
-      .add(buildName, '\
-        lodash.find(object, function(value, key) {\
-          return /\D9$/.test(key);\
-        })'
-      )
-      .add(otherName, '\
-        _.find(object, function(value, key) {\
-          return /\D9$/.test(key);\
-        })'
-      )
-  );
-
-  // Avoid Underscore induced `OutOfMemoryError` in Rhino and Ringo.
-  suites.push(
-    Benchmark.Suite('`_.find` with `_.matches` shorthand')
-      .add(buildName, {
-        'fn': 'lodash.find(objects, source)',
-        'teardown': 'function matches(){}'
-      })
-      .add(otherName, {
-        'fn': '_.find(objects, source)',
-        'teardown': 'function matches(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.flatten`')
-      .add(buildName, {
-        'fn': 'lodash.flatten(nestedNumbers, !lodashFlattenDeep)',
-        'teardown': 'function flatten(){}'
-      })
-      .add(otherName, {
-        'fn': '_.flatten(nestedNumbers, !_flattenDeep)',
-        'teardown': 'function flatten(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.flattenDeep` nested arrays of numbers')
-      .add(buildName, {
-        'fn': 'lodash.flattenDeep(nestedNumbers)',
-        'teardown': 'function flatten(){}'
-      })
-      .add(otherName, {
-        'fn': '_.flattenDeep(nestedNumbers)',
-        'teardown': 'function flatten(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.flattenDeep` nest arrays of objects')
-      .add(buildName, {
-        'fn': 'lodash.flattenDeep(nestedObjects)',
-        'teardown': 'function flatten(){}'
-      })
-      .add(otherName, {
-        'fn': '_.flattenDeep(nestedObjects)',
-        'teardown': 'function flatten(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.flowRight`')
-      .add(buildName, {
-        'fn': 'lodash.flowRight(compAddThree, compAddTwo, compAddOne)',
-        'teardown': 'function flowRight(){}'
-      })
-      .add(otherName, {
-        'fn': '_.flowRight(compAddThree, compAddTwo, compAddOne)',
-        'teardown': 'function flowRight(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('composed call')
-      .add(buildName, {
-        'fn': 'lodashComposed(0)',
-        'teardown': 'function flowRight(){}'
-      })
-      .add(otherName, {
-        'fn': '_composed(0)',
-        'teardown': 'function flowRight(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.functions`')
-      .add(buildName, '\
-        lodash.functions(lodash)'
-      )
-      .add(otherName, '\
-        _.functions(lodash)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.groupBy` with `callback` iterating an array')
-      .add(buildName, '\
-        lodash.groupBy(numbers, function(num) { return num >> 1; })'
-      )
-      .add(otherName, '\
-        _.groupBy(numbers, function(num) { return num >> 1; })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.groupBy` with `property` name iterating an array')
-      .add(buildName, {
-        'fn': 'lodash.groupBy(words, "length")',
-        'teardown': 'function countBy(){}'
-      })
-      .add(otherName, {
-        'fn': '_.groupBy(words, "length")',
-        'teardown': 'function countBy(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.groupBy` with `callback` iterating an object')
-      .add(buildName, {
-        'fn': 'lodash.groupBy(wordToNumber, function(num) { return num >> 1; })',
-        'teardown': 'function countBy(){}'
-      })
-      .add(otherName, {
-        'fn': '_.groupBy(wordToNumber, function(num) { return num >> 1; })',
-        'teardown': 'function countBy(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.includes` searching an array')
-      .add(buildName, '\
-        lodash.includes(numbers, limit - 1)'
-      )
-      .add(otherName, '\
-        _.includes(numbers, limit - 1)'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.includes` searching an object')
-      .add(buildName, '\
-        lodash.includes(object, limit - 1)'
-      )
-      .add(otherName, '\
-        _.includes(object, limit - 1)'
-      )
-  );
-
-  if (lodash.includes('ab', 'ab') && _.includes('ab', 'ab')) {
-    suites.push(
-      Benchmark.Suite('`_.includes` searching a string')
-        .add(buildName, '\
-          lodash.includes(strNumbers, "," + (limit - 1))'
-        )
-        .add(otherName, '\
-          _.includes(strNumbers, "," + (limit - 1))'
-        )
-    );
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.indexOf`')
-      .add(buildName, {
-        'fn': 'lodash.indexOf(hundredSortedValues, 99)',
-        'teardown': 'function multiArrays(){}'
-      })
-      .add(otherName, {
-        'fn': '_.indexOf(hundredSortedValues, 99)',
-        'teardown': 'function multiArrays(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.intersection`')
-      .add(buildName, '\
-        lodash.intersection(numbers, twoNumbers, fourNumbers)'
-      )
-      .add(otherName, '\
-        _.intersection(numbers, twoNumbers, fourNumbers)'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.intersection` iterating 120 elements')
-      .add(buildName, {
-        'fn': 'lodash.intersection(hundredTwentyValues, hundredTwentyValues2)',
-        'teardown': 'function multiArrays(){}'
-      })
-      .add(otherName, {
-        'fn': '_.intersection(hundredTwentyValues, hundredTwentyValues2)',
-        'teardown': 'function multiArrays(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.invert`')
-      .add(buildName, '\
-        lodash.invert(object)'
-      )
-      .add(otherName, '\
-        _.invert(object)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.invokeMap` iterating an array')
-      .add(buildName, '\
-        lodash.invokeMap(numbers, "toFixed")'
-      )
-      .add(otherName, '\
-        _.invokeMap(numbers, "toFixed")'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.invokeMap` with arguments iterating an array')
-      .add(buildName, '\
-        lodash.invokeMap(numbers, "toFixed", 1)'
-      )
-      .add(otherName, '\
-        _.invokeMap(numbers, "toFixed", 1)'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.invokeMap` with a function for `path` iterating an array')
-      .add(buildName, '\
-        lodash.invokeMap(numbers, Number.prototype.toFixed, 1)'
-      )
-      .add(otherName, '\
-        _.invokeMap(numbers, Number.prototype.toFixed, 1)'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.invokeMap` iterating an object')
-      .add(buildName, '\
-        lodash.invokeMap(object, "toFixed", 1)'
-      )
-      .add(otherName, '\
-        _.invokeMap(object, "toFixed", 1)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.isEqual` comparing primitives')
-      .add(buildName, {
-        'fn': '\
-          lodash.isEqual(1, "1");\
-          lodash.isEqual(1, 1)',
-        'teardown': 'function isEqual(){}'
-      })
-      .add(otherName, {
-        'fn': '\
-          _.isEqual(1, "1");\
-          _.isEqual(1, 1);',
-        'teardown': 'function isEqual(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.isEqual` comparing primitives and their object counterparts (edge case)')
-      .add(buildName, {
-        'fn': '\
-          lodash.isEqual(objectOfPrimitives, objectOfObjects);\
-          lodash.isEqual(objectOfPrimitives, objectOfObjects2)',
-        'teardown': 'function isEqual(){}'
-      })
-      .add(otherName, {
-        'fn': '\
-          _.isEqual(objectOfPrimitives, objectOfObjects);\
-          _.isEqual(objectOfPrimitives, objectOfObjects2)',
-        'teardown': 'function isEqual(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.isEqual` comparing arrays')
-      .add(buildName, {
-        'fn': '\
-          lodash.isEqual(numbers, numbers2);\
-          lodash.isEqual(numbers2, numbers3)',
-        'teardown': 'function isEqual(){}'
-      })
-      .add(otherName, {
-        'fn': '\
-          _.isEqual(numbers, numbers2);\
-          _.isEqual(numbers2, numbers3)',
-        'teardown': 'function isEqual(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.isEqual` comparing nested arrays')
-      .add(buildName, {
-        'fn': '\
-          lodash.isEqual(nestedNumbers, nestedNumbers2);\
-          lodash.isEqual(nestedNumbers2, nestedNumbers3)',
-        'teardown': 'function isEqual(){}'
-      })
-      .add(otherName, {
-        'fn': '\
-          _.isEqual(nestedNumbers, nestedNumbers2);\
-          _.isEqual(nestedNumbers2, nestedNumbers3)',
-        'teardown': 'function isEqual(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.isEqual` comparing arrays of objects')
-      .add(buildName, {
-        'fn': '\
-          lodash.isEqual(objects, objects2);\
-          lodash.isEqual(objects2, objects3)',
-        'teardown': 'function isEqual(){}'
-      })
-      .add(otherName, {
-        'fn': '\
-          _.isEqual(objects, objects2);\
-          _.isEqual(objects2, objects3)',
-        'teardown': 'function isEqual(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.isEqual` comparing objects')
-      .add(buildName, {
-        'fn': '\
-          lodash.isEqual(object, object2);\
-          lodash.isEqual(object2, object3)',
-        'teardown': 'function isEqual(){}'
-      })
-      .add(otherName, {
-        'fn': '\
-          _.isEqual(object, object2);\
-          _.isEqual(object2, object3)',
-        'teardown': 'function isEqual(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.isArguments`, `_.isDate`, `_.isFunction`, `_.isNumber`, `_.isObject`, `_.isRegExp`')
-      .add(buildName, '\
-        lodash.isArguments(arguments);\
-        lodash.isArguments(object);\
-        lodash.isDate(date);\
-        lodash.isDate(object);\
-        lodash.isFunction(lodash);\
-        lodash.isFunction(object);\
-        lodash.isNumber(1);\
-        lodash.isNumber(object);\
-        lodash.isObject(object);\
-        lodash.isObject(1);\
-        lodash.isRegExp(regexp);\
-        lodash.isRegExp(object)'
-      )
-      .add(otherName, '\
-        _.isArguments(arguments);\
-        _.isArguments(object);\
-        _.isDate(date);\
-        _.isDate(object);\
-        _.isFunction(_);\
-        _.isFunction(object);\
-        _.isNumber(1);\
-        _.isNumber(object);\
-        _.isObject(object);\
-        _.isObject(1);\
-        _.isRegExp(regexp);\
-        _.isRegExp(object)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.keys` (uses native `Object.keys` if available)')
-      .add(buildName, '\
-        lodash.keys(object)'
-      )
-      .add(otherName, '\
-        _.keys(object)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.lastIndexOf`')
-      .add(buildName, {
-        'fn': 'lodash.lastIndexOf(hundredSortedValues, 0)',
-        'teardown': 'function multiArrays(){}'
-      })
-      .add(otherName, {
-        'fn': '_.lastIndexOf(hundredSortedValues, 0)',
-        'teardown': 'function multiArrays(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.map` iterating an array')
-      .add(buildName, '\
-        lodash.map(objects, function(value) {\
-          return value.num;\
-        })'
-      )
-      .add(otherName, '\
-        _.map(objects, function(value) {\
-          return value.num;\
-        })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.map` iterating an object')
-      .add(buildName, '\
-        lodash.map(object, function(value) {\
-          return value;\
-        })'
-      )
-      .add(otherName, '\
-        _.map(object, function(value) {\
-          return value;\
-        })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.map` with `_.property` shorthand')
-      .add(buildName, '\
-        lodash.map(objects, "num")'
-      )
-      .add(otherName, '\
-        _.map(objects, "num")'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.max`')
-      .add(buildName, '\
-        lodash.max(numbers)'
-      )
-      .add(otherName, '\
-        _.max(numbers)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.min`')
-      .add(buildName, '\
-        lodash.min(numbers)'
-      )
-      .add(otherName, '\
-        _.min(numbers)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.omit` iterating 20 properties, omitting 2 keys')
-      .add(buildName, '\
-        lodash.omit(object, "key6", "key13")'
-      )
-      .add(otherName, '\
-        _.omit(object, "key6", "key13")'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.omit` iterating 40 properties, omitting 20 keys')
-      .add(buildName, {
-        'fn': 'lodash.omit(wordToNumber, words)',
-        'teardown': 'function omit(){}'
-      })
-      .add(otherName, {
-        'fn': '_.omit(wordToNumber, words)',
-        'teardown': 'function omit(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.partial` (slow path)')
-      .add(buildName, {
-        'fn': 'lodash.partial(function(greeting) { return greeting + " " + this.name; }, "hi")',
-        'teardown': 'function partial(){}'
-      })
-      .add(otherName, {
-        'fn': '_.partial(function(greeting) { return greeting + " " + this.name; }, "hi")',
-        'teardown': 'function partial(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('partially applied call with arguments')
-      .add(buildName, {
-        'fn': 'lodashPartial("!")',
-        'teardown': 'function partial(){}'
-      })
-      .add(otherName, {
-        'fn': '_partial("!")',
-        'teardown': 'function partial(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.partition` iterating an array')
-      .add(buildName, '\
-        lodash.partition(numbers, function(num) {\
-          return num % 2;\
-        })'
-      )
-      .add(otherName, '\
-        _.partition(numbers, function(num) {\
-          return num % 2;\
-        })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.partition` iterating an object')
-      .add(buildName, '\
-        lodash.partition(object, function(num) {\
-          return num % 2;\
-        })'
-      )
-      .add(otherName, '\
-        _.partition(object, function(num) {\
-          return num % 2;\
-        })'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.pick`')
-      .add(buildName, '\
-        lodash.pick(object, "key6", "key13")'
-      )
-      .add(otherName, '\
-        _.pick(object, "key6", "key13")'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.reduce` iterating an array')
-      .add(buildName, '\
-        lodash.reduce(numbers, function(result, value, index) {\
-          result[index] = value;\
-          return result;\
-        }, {})'
-      )
-      .add(otherName, '\
-        _.reduce(numbers, function(result, value, index) {\
-          result[index] = value;\
-          return result;\
-        }, {})'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.reduce` iterating an object')
-      .add(buildName, '\
-        lodash.reduce(object, function(result, value, key) {\
-          result.push(key, value);\
-          return result;\
-        }, [])'
-      )
-      .add(otherName, '\
-        _.reduce(object, function(result, value, key) {\
-          result.push(key, value);\
-          return result;\
-        }, [])'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.reduceRight` iterating an array')
-      .add(buildName, '\
-        lodash.reduceRight(numbers, function(result, value, index) {\
-          result[index] = value;\
-          return result;\
-        }, {})'
-      )
-      .add(otherName, '\
-        _.reduceRight(numbers, function(result, value, index) {\
-          result[index] = value;\
-          return result;\
-        }, {})'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.reduceRight` iterating an object')
-      .add(buildName, '\
-        lodash.reduceRight(object, function(result, value, key) {\
-          result.push(key, value);\
-          return result;\
-        }, [])'
-      )
-      .add(otherName, '\
-        _.reduceRight(object, function(result, value, key) {\
-          result.push(key, value);\
-          return result;\
-        }, [])'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.reject` iterating an array')
-      .add(buildName, '\
-        lodash.reject(numbers, function(num) {\
-          return num % 2;\
-        })'
-      )
-      .add(otherName, '\
-        _.reject(numbers, function(num) {\
-          return num % 2;\
-        })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.reject` iterating an object')
-      .add(buildName, '\
-        lodash.reject(object, function(num) {\
-          return num % 2;\
-        })'
-      )
-      .add(otherName, '\
-        _.reject(object, function(num) {\
-          return num % 2;\
-        })'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.sampleSize`')
-      .add(buildName, '\
-        lodash.sampleSize(numbers, limit / 2)'
-      )
-      .add(otherName, '\
-        _.sampleSize(numbers, limit / 2)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.shuffle`')
-      .add(buildName, '\
-        lodash.shuffle(numbers)'
-      )
-      .add(otherName, '\
-        _.shuffle(numbers)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.size` with an object')
-      .add(buildName, '\
-        lodash.size(object)'
-      )
-      .add(otherName, '\
-        _.size(object)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.some` iterating an array')
-      .add(buildName, '\
-        lodash.some(numbers, function(num) {\
-          return num == (limit - 1);\
-        })'
-      )
-      .add(otherName, '\
-        _.some(numbers, function(num) {\
-          return num == (limit - 1);\
-        })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.some` iterating an object')
-      .add(buildName, '\
-        lodash.some(object, function(num) {\
-          return num == (limit - 1);\
-        })'
-      )
-      .add(otherName, '\
-        _.some(object, function(num) {\
-          return num == (limit - 1);\
-        })'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.sortBy` with `callback`')
-      .add(buildName, '\
-        lodash.sortBy(numbers, function(num) { return Math.sin(num); })'
-      )
-      .add(otherName, '\
-        _.sortBy(numbers, function(num) { return Math.sin(num); })'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.sortBy` with `property` name')
-      .add(buildName, {
-        'fn': 'lodash.sortBy(words, "length")',
-        'teardown': 'function countBy(){}'
-      })
-      .add(otherName, {
-        'fn': '_.sortBy(words, "length")',
-        'teardown': 'function countBy(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.sortedIndex`')
-      .add(buildName, '\
-        lodash.sortedIndex(numbers, limit)'
-      )
-      .add(otherName, '\
-        _.sortedIndex(numbers, limit)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.sortedIndexBy`')
-      .add(buildName, {
-        'fn': '\
-          lodash.sortedIndexBy(words, "twenty-five", function(value) {\
-            return wordToNumber[value];\
-          })',
-        'teardown': 'function countBy(){}'
-      })
-      .add(otherName, {
-        'fn': '\
-          _.sortedIndexBy(words, "twenty-five", function(value) {\
-            return wordToNumber[value];\
-          })',
-        'teardown': 'function countBy(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.sortedIndexOf`')
-      .add(buildName, {
-        'fn': 'lodash.sortedIndexOf(hundredSortedValues, 99)',
-        'teardown': 'function multiArrays(){}'
-      })
-      .add(otherName, {
-        'fn': '_.sortedIndexOf(hundredSortedValues, 99)',
-        'teardown': 'function multiArrays(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.sortedLastIndexOf`')
-      .add(buildName, {
-        'fn': 'lodash.sortedLastIndexOf(hundredSortedValues, 0)',
-        'teardown': 'function multiArrays(){}'
-      })
-      .add(otherName, {
-        'fn': '_.sortedLastIndexOf(hundredSortedValues, 0)',
-        'teardown': 'function multiArrays(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.sum`')
-      .add(buildName, '\
-        lodash.sum(numbers)'
-      )
-      .add(otherName, '\
-        _.sum(numbers)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.template` (slow path)')
-      .add(buildName, {
-        'fn': 'lodash.template(tpl)(tplData)',
-        'teardown': 'function template(){}'
-      })
-      .add(otherName, {
-        'fn': '_.template(tpl)(tplData)',
-        'teardown': 'function template(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('compiled template')
-      .add(buildName, {
-        'fn': 'lodashTpl(tplData)',
-        'teardown': 'function template(){}'
-      })
-      .add(otherName, {
-        'fn': '_tpl(tplData)',
-        'teardown': 'function template(){}'
-      })
-  );
-
-  suites.push(
-    Benchmark.Suite('compiled template without a with-statement')
-      .add(buildName, {
-        'fn': 'lodashTplVerbose(tplData)',
-        'teardown': 'function template(){}'
-      })
-      .add(otherName, {
-        'fn': '_tplVerbose(tplData)',
-        'teardown': 'function template(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.times`')
-      .add(buildName, '\
-        var result = [];\
-        lodash.times(limit, function(n) { result.push(n); })'
-      )
-      .add(otherName, '\
-        var result = [];\
-        _.times(limit, function(n) { result.push(n); })'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.toArray` with an array (edge case)')
-      .add(buildName, '\
-        lodash.toArray(numbers)'
-      )
-      .add(otherName, '\
-        _.toArray(numbers)'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.toArray` with an object')
-      .add(buildName, '\
-        lodash.toArray(object)'
-      )
-      .add(otherName, '\
-        _.toArray(object)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.toPairs`')
-      .add(buildName, '\
-        lodash.toPairs(object)'
-      )
-      .add(otherName, '\
-        _.toPairs(object)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.unescape` string without html entities')
-      .add(buildName, '\
-        lodash.unescape("`&`, `<`, `>`, `\\"`, and `\'`")'
-      )
-      .add(otherName, '\
-        _.unescape("`&`, `<`, `>`, `\\"`, and `\'`")'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.unescape` string with html entities')
-      .add(buildName, '\
-        lodash.unescape("`&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;`")'
-      )
-      .add(otherName, '\
-        _.unescape("`&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;`")'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.union`')
-      .add(buildName, '\
-        lodash.union(numbers, twoNumbers, fourNumbers)'
-      )
-      .add(otherName, '\
-        _.union(numbers, twoNumbers, fourNumbers)'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.union` iterating an array of 200 elements')
-      .add(buildName, {
-        'fn': 'lodash.union(hundredValues, hundredValues2)',
-        'teardown': 'function multiArrays(){}'
-      })
-      .add(otherName, {
-        'fn': '_.union(hundredValues, hundredValues2)',
-        'teardown': 'function multiArrays(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.uniq`')
-      .add(buildName, '\
-        lodash.uniq(numbers.concat(twoNumbers, fourNumbers))'
-      )
-      .add(otherName, '\
-        _.uniq(numbers.concat(twoNumbers, fourNumbers))'
-      )
-  );
-
-  suites.push(
-    Benchmark.Suite('`_.uniq` iterating an array of 200 elements')
-      .add(buildName, {
-        'fn': 'lodash.uniq(twoHundredValues)',
-        'teardown': 'function multiArrays(){}'
-      })
-      .add(otherName, {
-        'fn': '_.uniq(twoHundredValues)',
-        'teardown': 'function multiArrays(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.uniqBy`')
-      .add(buildName, '\
-        lodash.uniqBy(numbers.concat(twoNumbers, fourNumbers), function(num) {\
-          return num % 2;\
-        })'
-      )
-      .add(otherName, '\
-        _.uniqBy(numbers.concat(twoNumbers, fourNumbers), function(num) {\
-          return num % 2;\
-        })'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.values`')
-      .add(buildName, '\
-        lodash.values(object)'
-      )
-      .add(otherName, '\
-        _.values(object)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.without`')
-      .add(buildName, '\
-        lodash.without(numbers, 9, 12, 14, 15)'
-      )
-      .add(otherName, '\
-        _.without(numbers, 9, 12, 14, 15)'
-      )
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.wrap` result called')
-      .add(buildName, {
-        'fn': 'lodashWrapped(2, 5)',
-        'teardown': 'function wrap(){}'
-      })
-      .add(otherName, {
-        'fn': '_wrapped(2, 5)',
-        'teardown': 'function wrap(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  suites.push(
-    Benchmark.Suite('`_.zip`')
-      .add(buildName, {
-        'fn': 'lodash.zip.apply(lodash, unzipped)',
-        'teardown': 'function zip(){}'
-      })
-      .add(otherName, {
-        'fn': '_.zip.apply(_, unzipped)',
-        'teardown': 'function zip(){}'
-      })
-  );
-
-  /*--------------------------------------------------------------------------*/
-
-  if (Benchmark.platform + '') {
-    log(Benchmark.platform);
-  }
-  // Expose `run` to be called later when executing in a browser.
-  if (document) {
-    root.run = run;
-  } else {
-    run();
-  }
-}.call(this));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/asset/test-ui.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/test/asset/test-ui.js
deleted file mode 100644
index 24f087a..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/asset/test-ui.js
+++ /dev/null
@@ -1,170 +0,0 @@
-;(function(window) {
-  'use strict';
-
-  /** The base path of the lodash builds. */
-  var basePath = '../';
-
-  /** The lodash build to load. */
-  var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
-
-  /** The module loader to use. */
-  var loader = (loader = /loader=([^&]+)/.exec(location.search)) && decodeURIComponent(loader[1]);
-
-  /** The `ui` object. */
-  var ui = {};
-
-  /*--------------------------------------------------------------------------*/
-
-  /**
-   * Registers an event listener on an element.
-   *
-   * @private
-   * @param {Element} element The element.
-   * @param {string} eventName The name of the event.
-   * @param {Function} handler The event handler.
-   * @returns {Element} The element.
-   */
-  function addListener(element, eventName, handler) {
-    if (typeof element.addEventListener != 'undefined') {
-      element.addEventListener(eventName, handler, false);
-    } else if (typeof element.attachEvent != 'undefined') {
-      element.attachEvent('on' + eventName, handler);
-    }
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  // Initialize controls.
-  addListener(window, 'load', function() {
-    function eventHandler(event) {
-      var buildIndex = buildList.selectedIndex,
-          loaderIndex = loaderList.selectedIndex,
-          search = location.search.replace(/^\?|&?(?:build|loader)=[^&]*&?/g, '');
-
-      if (event.stopPropagation) {
-        event.stopPropagation();
-      } else {
-        event.cancelBubble = true;
-      }
-      location.href =
-        location.href.split('?')[0] + '?' +
-        (search ? search + '&' : '') +
-        'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' +
-        'loader=' + (loaderIndex < 0 ? loader : loaderList[loaderIndex].value);
-    }
-
-    function init() {
-      var toolbar = document.getElementById('qunit-testrunner-toolbar');
-      if (!toolbar) {
-        setTimeout(init, 15);
-        return;
-      }
-      toolbar.appendChild(span1);
-      toolbar.appendChild(span2);
-
-      buildList.selectedIndex = (function() {
-        switch (build) {
-          case 'lodash':            return 1;
-          case 'lodash-core-dev':   return 2;
-          case 'lodash-core':       return 3;
-          case 'lodash-dev':
-          case null:                return 0;
-        }
-        return -1;
-      }());
-
-      loaderList.selectedIndex = (function() {
-        switch (loader) {
-          case 'curl':      return 1;
-          case 'dojo':      return 2;
-          case 'requirejs': return 3;
-          case 'none':
-          case null:        return 0;
-        }
-        return -1;
-      }());
-
-      addListener(buildList, 'change', eventHandler);
-      addListener(loaderList, 'change', eventHandler);
-    }
-
-    var span1 = document.createElement('span');
-    span1.style.cssText = 'float:right';
-    span1.innerHTML =
-      '<label for="qunit-build">Build: </label>' +
-      '<select id="qunit-build">' +
-      '<option value="lodash-dev">lodash (development)</option>' +
-      '<option value="lodash">lodash (production)</option>' +
-      '<option value="lodash-core-dev">lodash-core (development)</option>' +
-      '<option value="lodash-core">lodash-core (production)</option>' +
-      '</select>';
-
-    var span2 = document.createElement('span');
-    span2.style.cssText = 'float:right';
-    span2.innerHTML =
-      '<label for="qunit-loader">Loader: </label>' +
-      '<select id="qunit-loader">' +
-      '<option value="none">None</option>' +
-      '<option value="curl">Curl</option>' +
-      '<option value="dojo">Dojo</option>' +
-      '<option value="requirejs">RequireJS</option>' +
-      '</select>';
-
-    var buildList = span1.lastChild,
-        loaderList = span2.lastChild;
-
-    setTimeout(function() {
-      ui.timing.loadEventEnd = +new Date;
-    }, 1);
-
-    init();
-  });
-
-  // The lodash build file path.
-  ui.buildPath = (function() {
-    var result;
-    switch (build) {
-      case 'lodash':            result = 'dist/lodash.min.js'; break;
-      case 'lodash-core-dev':   result = 'dist/lodash.core.js'; break;
-      case 'lodash-core':       result = 'dist/lodash.core.min.js'; break;
-      case null:                build  = 'lodash-dev';
-      case 'lodash-dev':        result = 'lodash.js'; break;
-      default:                  return build;
-    }
-    return basePath + result;
-  }());
-
-  // The module loader file path.
-  ui.loaderPath = (function() {
-    var result;
-    switch (loader) {
-      case 'curl':      result = 'node_modules/curl-amd/dist/curl-kitchen-sink/curl.js'; break;
-      case 'dojo':      result = 'node_modules/dojo/dojo.js'; break;
-      case 'requirejs': result = 'node_modules/requirejs/require.js'; break;
-      case null:        loader = 'none'; return '';
-      default:          return loader;
-    }
-    return basePath + result;
-  }());
-
-  // Used to indicate testing a core build.
-  ui.isCore = /\bcore(\.min)?\.js\b/.test(ui.buildPath);
-
-  // Used to indicate testing a foreign file.
-  ui.isForeign = RegExp('^(\\w+:)?//').test(build);
-
-  // Used to indicate testing a modularized build.
-  ui.isModularize = /\b(?:amd|commonjs|es|node|npm|(index|main)\.js)\b/.test([location.pathname, location.search]);
-
-  // Used to indicate testing in Sauce Labs' automated test cloud.
-  ui.isSauceLabs = location.port == '9001';
-
-  // Used to indicate that lodash is in strict mode.
-  ui.isStrict = /\bes\b/.test([location.pathname, location.search]);
-
-  ui.urlParams = { 'build': build, 'loader': loader };
-  ui.timing = { 'loadEventEnd': 0 };
-
-  window.ui = ui;
-
-}(this));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/asset/worker.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/test/asset/worker.js
deleted file mode 100644
index 8ccffa8..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/asset/worker.js
+++ /dev/null
@@ -1,15 +0,0 @@
-self.console || (self.console = { 'log': function() {} });
-
-addEventListener('message', function(e) {
-  if (e.data) {
-    try {
-      importScripts('../' + e.data);
-    } catch (e) {
-      var lineNumber = e.lineNumber,
-          message = (lineNumber == null ? '' : (lineNumber + ': ')) + e.message;
-
-      self._ = { 'VERSION': message };
-    }
-    postMessage(_.VERSION);
-  }
-}, false);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/backbone.html b/views/ngXosViews/serviceGrid/src/vendor/lodash/test/backbone.html
deleted file mode 100644
index dd3df9f..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/backbone.html
+++ /dev/null
@@ -1,170 +0,0 @@
-<!doctype html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <title>Backbone Test Suite</title>
-    <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
-  </head>
-  <body>
-    <script>
-      // Avoid reporting tests to Sauce Labs when script errors occur.
-      if (location.port == '9001') {
-        window.onerror = function(message) {
-          if (window.QUnit) {
-            QUnit.config.done.length = 0;
-          }
-          global_test_results = { 'message': message };
-        };
-      }
-    </script>
-    <script src="../node_modules/qunitjs/qunit/qunit.js"></script>
-    <script src="../node_modules/qunit-extras/qunit-extras.js"></script>
-    <script src="../vendor/json-js/json2.js"></script>
-    <script src="../node_modules/platform/platform.js"></script>
-    <script src="./asset/test-ui.js"></script>
-    <script src="../lodash.js"></script>
-    <script>
-      QUnit.config.asyncRetries = 10;
-      QUnit.config.hidepassed = true;
-
-      var mixinPrereqs = (function() {
-        var aliasToReal = {
-          'indexBy': 'keyBy',
-          'invoke': 'invokeMap'
-        };
-
-        var keyMap = {
-          'rest': 'tail'
-        };
-
-        var lodash = _.noConflict();
-
-        return function(_) {
-          lodash.defaultsDeep(_, { 'templateSettings': lodash.templateSettings });
-          lodash.mixin(_, lodash.pick(lodash, lodash.difference([
-            'countBy',
-            'debounce',
-            'difference',
-            'find',
-            'findIndex',
-            'findLastIndex',
-            'groupBy',
-            'includes',
-            'invert',
-            'invokeMap',
-            'keyBy',
-            'omit',
-            'partition',
-            'reduceRight',
-            'reject',
-            'sample',
-            'without'
-          ], lodash.functions(_))));
-
-          lodash.forOwn(keyMap, function(realName, otherName) {
-            _[otherName] = lodash[realName];
-            _.prototype[otherName] = lodash.prototype[realName];
-          });
-
-          lodash.forOwn(aliasToReal, function(realName, alias) {
-            _[alias] = _[realName];
-            _.prototype[alias] = _.prototype[realName];
-          });
-        };
-      }());
-
-      // Load prerequisite scripts.
-      document.write(ui.urlParams.loader == 'none'
-        ? '<script src="' + ui.buildPath + '"><\/script>'
-        : '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
-      );
-    </script>
-    <script>
-      if (ui.urlParams.loader == 'none') {
-        mixinPrereqs(_);
-        document.write([
-          '<script src="../node_modules/jquery/dist/jquery.js"><\/script>',
-          '<script src="../vendor/backbone/backbone.js"><\/script>',
-          '<script src="../vendor/backbone/test/setup/dom-setup.js"><\/script>',
-          '<script src="../vendor/backbone/test/setup/environment.js"><\/script>',
-          '<script src="../vendor/backbone/test/noconflict.js"><\/script>',
-          '<script src="../vendor/backbone/test/events.js"><\/script>',
-          '<script src="../vendor/backbone/test/model.js"><\/script>',
-          '<script src="../vendor/backbone/test/collection.js"><\/script>',
-          '<script src="../vendor/backbone/test/router.js"><\/script>',
-          '<script src="../vendor/backbone/test/view.js"><\/script>',
-          '<script src="../vendor/backbone/test/sync.js"><\/script>'
-        ].join('\n'));
-      }
-    </script>
-    <script>
-      (function() {
-        if (window.curl) {
-          curl.config({ 'apiName': 'require' });
-        }
-        if (!window.require) {
-          return;
-        }
-        var reBasename = /[\w.-]+$/,
-            basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
-            modulePath = ui.buildPath.replace(/\.js$/, ''),
-            locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
-            moduleMain = modulePath.match(reBasename)[0],
-            uid = +new Date;
-
-        function getConfig() {
-          var result = {
-            'baseUrl': './',
-            'urlArgs': 't=' + uid++,
-            'waitSeconds': 0,
-            'paths': {
-              'backbone': '../vendor/backbone/backbone',
-              'jquery': '../node_modules/jquery/dist/jquery'
-            },
-            'packages': [{
-              'name': 'test',
-              'location': '../vendor/backbone/test',
-              'config': {
-                // Work around no global being exported.
-                'exports': 'QUnit',
-                'loader': 'curl/loader/legacy'
-              }
-            }]
-          };
-
-          if (ui.isModularize) {
-            result.packages.push({
-              'name': 'underscore',
-              'location': locationPath,
-              'main': moduleMain
-            });
-          } else {
-            result.paths.underscore = modulePath;
-          }
-          return result;
-        }
-
-        QUnit.config.autostart = false;
-
-        require(getConfig(), ['underscore'], function(lodash) {
-          mixinPrereqs(lodash);
-          require(getConfig(), ['backbone'], function() {
-            require(getConfig(), [
-              'test/setup/dom-setup',
-              'test/setup/environment',
-              'test/noconflict',
-              'test/events',
-              'test/model',
-              'test/collection',
-              'test/router',
-              'test/view',
-              'test/sync'
-            ], function() {
-              QUnit.start();
-            });
-          });
-        });
-      }());
-    </script>
-  </body>
-</html>
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/fp.html b/views/ngXosViews/serviceGrid/src/vendor/lodash/test/fp.html
deleted file mode 100644
index 7122966..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/fp.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!doctype html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <title>lodash-fp Test Suite</title>
-    <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
-  </head>
-  <body>
-    <script>
-      // Avoid reporting tests to Sauce Labs when script errors occur.
-      if (location.port == '9001') {
-        window.onerror = function(message) {
-          if (window.QUnit) {
-            QUnit.config.done.length = 0;
-          }
-          global_test_results = { 'message': message };
-        };
-      }
-    </script>
-    <script src="../lodash.js"></script>
-    <script src="../dist/lodash.fp.js"></script>
-    <script src="../dist/mapping.fp.js"></script>
-    <script src="../node_modules/qunitjs/qunit/qunit.js"></script>
-    <script src="../node_modules/qunit-extras/qunit-extras.js"></script>
-    <script src="../node_modules/platform/platform.js"></script>
-    <script src="./test-fp.js"></script>
-    <div id="qunit"></div>
-    <script>
-      // Set a more readable browser name.
-      window.onload = function() {
-        var timeoutId = setInterval(function() {
-          var ua = document.getElementById('qunit-userAgent');
-          if (ua) {
-            ua.innerHTML = platform;
-            clearInterval(timeoutId);
-          }
-        }, 16);
-      };
-    </script>
-  </body>
-</html>
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/index.html b/views/ngXosViews/serviceGrid/src/vendor/lodash/test/index.html
deleted file mode 100644
index aee3942..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/index.html
+++ /dev/null
@@ -1,351 +0,0 @@
-<!doctype html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <title>lodash Test Suite</title>
-    <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
-    <style>
-      #exports, #module {
-        display: none;
-      }
-    </style>
-  </head>
-  <body>
-    <script>
-      // Avoid reporting tests to Sauce Labs when script errors occur.
-      if (location.port == '9001') {
-        window.onerror = function(message) {
-          if (window.QUnit) {
-            QUnit.config.done.length = 0;
-          }
-          global_test_results = { 'message': message };
-        };
-      }
-    </script>
-    <script src="../node_modules/lodash/lodash.js"></script>
-    <script>var lodashStable = _.noConflict();</script>
-    <script src="../node_modules/qunitjs/qunit/qunit.js"></script>
-    <script src="../node_modules/qunit-extras/qunit-extras.js"></script>
-    <script src="../node_modules/platform/platform.js"></script>
-    <script src="./asset/test-ui.js"></script>
-    <div id="qunit"></div>
-    <div id="exports"></div>
-    <div id="module"></div>
-    <script>
-      function setProperty(object, key, value) {
-        try {
-          Object.defineProperty(object, key, {
-            'configurable': true,
-            'enumerable': false,
-            'writable': true,
-            'value': value
-          });
-        } catch (e) {
-          object[key] = value;
-        }
-        return object;
-      }
-
-      function addBizarroMethods() {
-        var funcProto = Function.prototype,
-            objectProto = Object.prototype;
-
-        var hasOwnProperty = objectProto.hasOwnProperty,
-            fnToString = funcProto.toString,
-            nativeString = fnToString.call(objectProto.toString),
-            noop = function() {},
-            propertyIsEnumerable = objectProto.propertyIsEnumerable,
-            reToString = /toString/g;
-
-        function constant(value) {
-          return function() {
-            return value;
-          };
-        }
-
-        function createToString(funcName) {
-          return constant(nativeString.replace(reToString, funcName));
-        }
-
-        // Allow bypassing native checks.
-        setProperty(funcProto, 'toString', (function() {
-          function wrapper() {
-            setProperty(funcProto, 'toString', fnToString);
-            var result = hasOwnProperty.call(this, 'toString') ? this.toString() : fnToString.call(this);
-            setProperty(funcProto, 'toString', wrapper);
-            return result;
-          }
-          return wrapper;
-        }()));
-
-        // Add prototype extensions.
-        funcProto._method = noop;
-
-        // Set bad shims.
-        setProperty(Object, '_create', Object.create);
-        setProperty(Object, 'create', (function() {
-          function object() {}
-          return function(prototype) {
-            if (prototype === Object(prototype)) {
-              object.prototype = prototype;
-              var result = new object;
-              object.prototype = undefined;
-            }
-            return result || {};
-          };
-        }()));
-
-        setProperty(Object, '_getOwnPropertySymbols', Object.getOwnPropertySymbols);
-        setProperty(Object, 'getOwnPropertySymbols', undefined);
-
-        setProperty(objectProto, '_propertyIsEnumerable', propertyIsEnumerable);
-        setProperty(objectProto, 'propertyIsEnumerable', function(key) {
-          return !(key == 'valueOf' && this && this.valueOf === 1) && _propertyIsEnumerable.call(this, key);
-        });
-
-        setProperty(window, '_Map', window.Map);
-        if (_Map) {
-          setProperty(window, 'Map', (function(Map) {
-            var count = 0;
-            return function() {
-              if (count++) {
-                return new Map;
-              }
-              var result = {};
-              setProperty(window, 'Map', Map);
-              return result;
-            };
-          }(_Map)));
-
-          setProperty(Map, 'toString', createToString('Map'));
-        }
-        setProperty(window, '_Promise', window.Promise);
-        setProperty(window, 'Promise', noop);
-
-        setProperty(window, '_Set', window.Set);
-        setProperty(window, 'Set', noop);
-
-        setProperty(window, '_Symbol', window.Symbol);
-        setProperty(window, 'Symbol', undefined);
-
-        setProperty(window, '_WeakMap', window.WeakMap);
-        setProperty(window, 'WeakMap', noop);
-
-        // Fake `WinRTError`.
-        setProperty(window, 'WinRTError', Error);
-
-        // Fake free variable `global`.
-        setProperty(window, 'exports', window);
-        setProperty(window, 'global', window);
-        setProperty(window, 'module', {});
-      }
-
-      function removeBizarroMethods() {
-        var funcProto = Function.prototype,
-            objectProto = Object.prototype;
-
-        setProperty(objectProto, 'propertyIsEnumerable', objectProto._propertyIsEnumerable);
-
-        if (Object._create) {
-          Object.create = Object._create;
-        } else {
-          delete Object.create;
-        }
-        if (Object._getOwnPropertySymbols) {
-          Object.getOwnPropertySymbols = Object._getOwnPropertySymbols;
-        } else {
-          delete Object.getOwnPropertySymbols;
-        }
-        if (_Map) {
-          Map = _Map;
-        } else {
-          setProperty(window, 'Map', undefined);
-        }
-        if (_Promise) {
-          Promise = _Promise;
-        } else {
-          setProperty(window, 'Promise', undefined);
-        }
-        if (_Set) {
-          Set = _Set;
-        } else {
-          setProperty(window, 'Set', undefined);
-        }
-        if (_Symbol) {
-          Symbol = _Symbol;
-        }
-        if (_WeakMap) {
-          WeakMap = _WeakMap;
-        } else {
-          setProperty(window, 'WeakMap', undefined);
-        }
-        setProperty(window, '_Map', undefined);
-        setProperty(window, '_Promise', undefined);
-        setProperty(window, '_Set', undefined);
-        setProperty(window, '_Symbol', undefined);
-        setProperty(window, '_WeakMap', undefined);
-
-        setProperty(window, 'WinRTError', undefined);
-
-        setProperty(window, 'exports', document.getElementById('exports'));
-        setProperty(window, 'global', undefined);
-        setProperty(window, 'module', document.getElementById('module'));
-
-        delete funcProto._method;
-        delete Object._create;
-        delete Object._getOwnPropertySymbols;
-        delete objectProto._propertyIsEnumerable;
-      }
-
-      // Load lodash to expose it to the bad extensions/shims.
-      if (!ui.isModularize) {
-        addBizarroMethods();
-        document.write('<script src="' + ui.buildPath + '"><\/script>');
-      }
-    </script>
-    <script>
-      // Store lodash to test for bad extensions/shims.
-      if (!ui.isModularize) {
-        var lodashBizarro = window._;
-        window._ = undefined;
-        removeBizarroMethods();
-      }
-      // Load test scripts.
-      document.write((ui.isForeign || ui.urlParams.loader == 'none')
-        ? '<script src="' + ui.buildPath + '"><\/script><script src="test.js"><\/script>'
-        : '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
-      );
-    </script>
-    <script>
-      var lodashModule,
-          shimmedModule,
-          underscoreModule;
-
-      (function() {
-        if (window.curl) {
-          curl.config({ 'apiName': 'require' });
-        }
-        if (ui.isForeign || !window.require) {
-          return;
-        }
-        var reBasename = /[\w.-]+$/,
-            basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
-            modulePath = ui.buildPath.replace(/\.js$/, ''),
-            moduleMain = modulePath.match(reBasename)[0],
-            locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
-            shimmedLocationPath = './abc/../' + locationPath,
-            underscoreLocationPath = './xyz/../' + locationPath,
-            uid = +new Date;
-
-        function getConfig() {
-          var result = {
-            'baseUrl': './',
-            'urlArgs': 't=' + uid++,
-            'waitSeconds': 0,
-            'paths': {},
-            'packages': [{
-              'name': 'test',
-              'location': basePath + 'test',
-              'main': 'test',
-              'config': {
-                // Work around no global being exported.
-                'exports': 'QUnit',
-                'loader': 'curl/loader/legacy'
-              }
-            }],
-            'shim': {
-              'shimmed': {
-                'exports': '_'
-              }
-            }
-          };
-
-          if (ui.isModularize) {
-            result.packages.push({
-              'name': 'lodash',
-              'location': locationPath,
-              'main': moduleMain
-            }, {
-              'name': 'shimmed',
-              'location': shimmedLocationPath,
-              'main': moduleMain
-            }, {
-              'name': 'underscore',
-              'location': underscoreLocationPath,
-              'main': moduleMain
-            });
-          } else {
-            result.paths.lodash = modulePath;
-            result.paths.shimmed = shimmedLocationPath + '/' + moduleMain;
-            result.paths.underscore = underscoreLocationPath + '/' + moduleMain;
-          }
-          return result;
-        }
-
-        function loadTests() {
-          require(getConfig(), ['test'], function() {
-            QUnit.start();
-          });
-        }
-
-        function loadModulesAndTests() {
-          require(getConfig(), ['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
-            lodashModule = lodash;
-            lodashModule.moduleName = 'lodash';
-
-            if (shimmed) {
-              shimmedModule = shimmed.result(shimmed, 'noConflict') || shimmed;
-              shimmedModule.moduleName = 'shimmed';
-            }
-            if (underscore) {
-              underscoreModule = underscore.result(underscore, 'noConflict') || underscore;
-              underscoreModule.moduleName = 'underscore';
-            }
-            window._ = lodash;
-
-            if (ui.isModularize) {
-              require(getConfig(), [
-                'lodash/_baseEach',
-                'lodash/_isIndex',
-                'lodash/_isIterateeCall'
-              ], function(baseEach, isIndex, isIterateeCall) {
-                lodash._baseEach = baseEach;
-                lodash._isIndex = isIndex;
-                lodash._isIterateeCall = isIterateeCall;
-                loadTests();
-              });
-            } else {
-              loadTests();
-            }
-          });
-        }
-
-        QUnit.config.autostart = false;
-
-        if (window.requirejs) {
-          addBizarroMethods();
-          require(getConfig(), ['lodash'], function(lodash) {
-            lodashBizarro = lodash.result(lodash, 'noConflict') || lodash;
-            delete requirejs.s.contexts._;
-
-            removeBizarroMethods();
-            loadModulesAndTests();
-          });
-        } else {
-          loadModulesAndTests();
-        }
-      }());
-
-      // Set a more readable browser name.
-      window.onload = function() {
-        var timeoutId = setInterval(function() {
-          var ua = document.getElementById('qunit-userAgent');
-          if (ua) {
-            ua.innerHTML = platform;
-            clearInterval(timeoutId);
-          }
-        }, 16);
-      };
-    </script>
-  </body>
-</html>
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/remove.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/test/remove.js
deleted file mode 100644
index bd5aaf9..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/remove.js
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env node
-'use strict';
-
-var _ = require('../lodash'),
-    fs = require('fs'),
-    path = require('path');
-
-var args = (args = process.argv)
-  .slice((args[0] === process.execPath || args[0] === 'node') ? 2 : 0);
-
-var filePath = path.resolve(args[1]),
-    reLine = /.*/gm;
-
-var pattern = (function() {
-  var result = args[0],
-      delimiter = result.charAt(0),
-      lastIndex = result.lastIndexOf(delimiter);
-
-  return RegExp(result.slice(1, lastIndex), result.slice(lastIndex + 1));
-}());
-
-/*----------------------------------------------------------------------------*/
-
-fs.writeFileSync(filePath, fs.readFileSync(filePath, 'utf8').replace(pattern, function(match) {
-  var snippet = _.slice(arguments, -3, -2)[0];
-  return match.replace(snippet, snippet.replace(reLine, ''));
-}));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/saucelabs.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/test/saucelabs.js
deleted file mode 100644
index d10a313..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/saucelabs.js
+++ /dev/null
@@ -1,914 +0,0 @@
-#!/usr/bin/env node
-'use strict';
-
-/** Environment shortcut. */
-var env = process.env;
-
-if (env.TRAVIS_SECURE_ENV_VARS == 'false') {
-  console.log('Skipping Sauce Labs jobs; secure environment variables are unavailable');
-  process.exit(0);
-}
-
-/** Load Node.js modules. */
-var EventEmitter = require('events').EventEmitter,
-    http = require('http'),
-    path = require('path'),
-    url = require('url'),
-    util = require('util');
-
-/** Load other modules. */
-var _ = require('../lodash.js'),
-    chalk = require('chalk'),
-    ecstatic = require('ecstatic'),
-    request = require('request'),
-    SauceTunnel = require('sauce-tunnel');
-
-/** Used for Sauce Labs credentials. */
-var accessKey = env.SAUCE_ACCESS_KEY,
-    username = env.SAUCE_USERNAME;
-
-/** Used as the default maximum number of times to retry a job and tunnel. */
-var maxJobRetries = 3,
-    maxTunnelRetries = 3;
-
-/** Used as the static file server middleware. */
-var mount = ecstatic({
-  'cache': 'no-cache',
-  'root': process.cwd()
-});
-
-/** Used as the list of ports supported by Sauce Connect. */
-var ports = [
-  80, 443, 888, 2000, 2001, 2020, 2109, 2222, 2310, 3000, 3001, 3030, 3210,
-  3333, 4000, 4001, 4040, 4321, 4502, 4503, 4567, 5000, 5001, 5050, 5555, 5432,
-  6000, 6001, 6060, 6666, 6543, 7000, 7070, 7774, 7777, 8000, 8001, 8003, 8031,
-  8080, 8081, 8765, 8777, 8888, 9000, 9001, 9080, 9090, 9876, 9877, 9999, 49221,
-  55001
-];
-
-/** Used by `logInline` to clear previously logged messages. */
-var prevLine = '';
-
-/** Method shortcut. */
-var push = Array.prototype.push;
-
-/** Used to detect error messages. */
-var reError = /(?:\be|E)rror\b/;
-
-/** Used to detect valid job ids. */
-var reJobId = /^[a-z0-9]{32}$/;
-
-/** Used to display the wait throbber. */
-var throbberDelay = 500,
-    waitCount = -1;
-
-/**
- * Used as Sauce Labs config values.
- * See the [Sauce Labs documentation](https://docs.saucelabs.com/reference/test-configuration/)
- * for more details.
- */
-var advisor = getOption('advisor', false),
-    build = getOption('build', (env.TRAVIS_COMMIT || '').slice(0, 10)),
-    commandTimeout = getOption('commandTimeout', 90),
-    compatMode = getOption('compatMode', null),
-    customData = Function('return {' + getOption('customData', '').replace(/^\{|}$/g, '') + '}')(),
-    deviceOrientation = getOption('deviceOrientation', 'portrait'),
-    framework = getOption('framework', 'qunit'),
-    idleTimeout = getOption('idleTimeout', 60),
-    jobName = getOption('name', 'unit tests'),
-    maxDuration = getOption('maxDuration', 180),
-    port = ports[Math.min(_.sortedIndex(ports, getOption('port', 9001)), ports.length - 1)],
-    publicAccess = getOption('public', true),
-    queueTimeout = getOption('queueTimeout', 240),
-    recordVideo = getOption('recordVideo', true),
-    recordScreenshots = getOption('recordScreenshots', false),
-    runner = getOption('runner', 'test/index.html').replace(/^\W+/, ''),
-    runnerUrl = getOption('runnerUrl', 'http://localhost:' + port + '/' + runner),
-    statusInterval = getOption('statusInterval', 5),
-    tags = getOption('tags', []),
-    throttled = getOption('throttled', 10),
-    tunneled = getOption('tunneled', true),
-    tunnelId = getOption('tunnelId', 'tunnel_' + (env.TRAVIS_JOB_ID || 0)),
-    tunnelTimeout = getOption('tunnelTimeout', 120),
-    videoUploadOnPass = getOption('videoUploadOnPass', false);
-
-/** Used to convert Sauce Labs browser identifiers to their formal names. */
-var browserNameMap = {
-  'googlechrome': 'Chrome',
-  'iehta': 'Internet Explorer',
-  'ipad': 'iPad',
-  'iphone': 'iPhone',
-  'microsoftedge': 'Edge'
-};
-
-/** List of platforms to load the runner on. */
-var platforms = [
-  ['Linux', 'android', '5.1'],
-  ['Windows 10', 'chrome', '49'],
-  ['Windows 10', 'chrome', '48'],
-  ['Windows 10', 'firefox', '45'],
-  ['Windows 10', 'firefox', '44'],
-  ['Windows 10', 'microsoftedge', '13'],
-  ['Windows 10', 'internet explorer', '11'],
-  ['Windows 8', 'internet explorer', '10'],
-  ['Windows 7', 'internet explorer', '9'],
-  // ['OS X 10.10', 'ipad', '9.1'],
-  ['OS X 10.11', 'safari', '9'],
-  ['OS X 10.10', 'safari', '8']
-];
-
-/** Used to tailor the `platforms` array. */
-var isAMD = _.includes(tags, 'amd'),
-    isBackbone = _.includes(tags, 'backbone'),
-    isModern = _.includes(tags, 'modern');
-
-// The platforms to test IE compatibility modes.
-if (compatMode) {
-  platforms = [
-    ['Windows 10', 'internet explorer', '11'],
-    ['Windows 8', 'internet explorer', '10'],
-    ['Windows 7', 'internet explorer', '9'],
-    ['Windows 7', 'internet explorer', '8']
-  ];
-}
-// The platforms for AMD tests.
-if (isAMD) {
-  platforms = _.filter(platforms, function(platform) {
-    var browser = browserName(platform[1]),
-        version = +platform[2];
-
-    switch (browser) {
-      case 'Android': return version >= 4.4;
-      case 'Opera': return version >= 10;
-    }
-    return true;
-  });
-}
-// The platforms for Backbone tests.
-if (isBackbone) {
-  platforms = _.filter(platforms, function(platform) {
-    var browser = browserName(platform[1]),
-        version = +platform[2];
-
-    switch (browser) {
-      case 'Firefox': return version >= 4;
-      case 'Internet Explorer': return version >= 7;
-      case 'iPad': return version >= 5;
-      case 'Opera': return version >= 12;
-    }
-    return true;
-  });
-}
-// The platforms for modern builds.
-if (isModern) {
-  platforms = _.filter(platforms, function(platform) {
-    var browser = browserName(platform[1]),
-        version = +platform[2];
-
-    switch (browser) {
-      case 'Android': return version >= 4.1;
-      case 'Firefox': return version >= 10;
-      case 'Internet Explorer': return version >= 9;
-      case 'iPad': return version >= 6;
-      case 'Opera': return version >= 12;
-      case 'Safari': return version >= 6;
-    }
-    return true;
-  });
-}
-
-/** Used as the default `Job` options object. */
-var jobOptions = {
-  'build': build,
-  'command-timeout': commandTimeout,
-  'custom-data': customData,
-  'device-orientation': deviceOrientation,
-  'framework': framework,
-  'idle-timeout': idleTimeout,
-  'max-duration': maxDuration,
-  'name': jobName,
-  'public': publicAccess,
-  'platforms': platforms,
-  'record-screenshots': recordScreenshots,
-  'record-video': recordVideo,
-  'sauce-advisor': advisor,
-  'tags': tags,
-  'url': runnerUrl,
-  'video-upload-on-pass': videoUploadOnPass
-};
-
-if (publicAccess === true) {
-  jobOptions['public'] = 'public';
-}
-if (tunneled) {
-  jobOptions['tunnel-identifier'] = tunnelId;
-}
-
-/*----------------------------------------------------------------------------*/
-
-/**
- * Resolves the formal browser name for a given Sauce Labs browser identifier.
- *
- * @private
- * @param {string} identifier The browser identifier.
- * @returns {string} Returns the formal browser name.
- */
-function browserName(identifier) {
-  return browserNameMap[identifier] || _.startCase(identifier);
-}
-
-/**
- * Gets the value for the given option name. If no value is available the
- * `defaultValue` is returned.
- *
- * @private
- * @param {string} name The name of the option.
- * @param {*} defaultValue The default option value.
- * @returns {*} Returns the option value.
- */
-function getOption(name, defaultValue) {
-  var isArr = _.isArray(defaultValue);
-  return _.reduce(process.argv, function(result, value) {
-    if (isArr) {
-      value = optionToArray(name, value);
-      return _.isEmpty(value) ? result : value;
-    }
-    value = optionToValue(name, value);
-
-    return value == null ? result : value;
-  }, defaultValue);
-}
-
-/**
- * Checks if `value` is a job ID.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a job ID, else `false`.
- */
-function isJobId(value) {
-  return reJobId.test(value);
-}
-
-/**
- * Writes an inline message to standard output.
- *
- * @private
- * @param {string} [text=''] The text to log.
- */
-function logInline(text) {
-  var blankLine = _.repeat(' ', _.size(prevLine));
-  prevLine = text = _.truncate(text, { 'length': 40 });
-  process.stdout.write(text + blankLine.slice(text.length) + '\r');
-}
-
-/**
- * Writes the wait throbber to standard output.
- *
- * @private
- */
-function logThrobber() {
-  logInline('Please wait' + _.repeat('.', (++waitCount % 3) + 1));
-}
-
-/**
- * Converts a comma separated option value into an array.
- *
- * @private
- * @param {string} name The name of the option to inspect.
- * @param {string} string The options string.
- * @returns {Array} Returns the new converted array.
- */
-function optionToArray(name, string) {
-  return _.compact(_.invokeMap((optionToValue(name, string) || '').split(/, */), 'trim'));
-}
-
-/**
- * Extracts the option value from an option string.
- *
- * @private
- * @param {string} name The name of the option to inspect.
- * @param {string} string The options string.
- * @returns {string|undefined} Returns the option value, else `undefined`.
- */
-function optionToValue(name, string) {
-  var result = string.match(RegExp('^' + name + '(?:=([\\s\\S]+))?$'));
-  if (result) {
-    result = _.result(result, 1);
-    result = result ? _.trim(result) : true;
-  }
-  if (result === 'false') {
-    return false;
-  }
-  return result || undefined;
-}
-
-/*----------------------------------------------------------------------------*/
-
-/**
- * The `Job#remove` and `Tunnel#stop` callback used by `Jobs#restart`
- * and `Tunnel#restart` respectively.
- *
- * @private
- */
-function onGenericRestart() {
-  this.restarting = false;
-  this.emit('restart');
-  this.start();
-}
-
-/**
- * The `request.put` and `SauceTunnel#stop` callback used by `Jobs#stop`
- * and `Tunnel#stop` respectively.
- *
- * @private
- * @param {Object} [error] The error object.
- */
-function onGenericStop(error) {
-  this.running = this.stopping = false;
-  this.emit('stop', error);
-}
-
-/**
- * The `request.del` callback used by `Jobs#remove`.
- *
- * @private
- */
-function onJobRemove(error, res, body) {
-  this.id = this.taskId = this.url = null;
-  this.removing = false;
-  this.emit('remove');
-}
-
-/**
- * The `Job#remove` callback used by `Jobs#reset`.
- *
- * @private
- */
-function onJobReset() {
-  this.attempts = 0;
-  this.failed = this.resetting = false;
-  this._pollerId = this.id = this.result = this.taskId = this.url = null;
-  this.emit('reset');
-}
-
-/**
- * The `request.post` callback used by `Jobs#start`.
- *
- * @private
- * @param {Object} [error] The error object.
- * @param {Object} res The response data object.
- * @param {Object} body The response body JSON object.
- */
-function onJobStart(error, res, body) {
-  this.starting = false;
-
-  if (this.stopping) {
-    return;
-  }
-  var statusCode = _.result(res, 'statusCode'),
-      taskId = _.first(_.result(body, 'js tests'));
-
-  if (error || !taskId || statusCode != 200) {
-    if (this.attempts < this.retries) {
-      this.restart();
-      return;
-    }
-    var na = 'unavailable',
-        bodyStr = _.isObject(body) ? '\n' + JSON.stringify(body) : na,
-        statusStr = _.isFinite(statusCode) ? statusCode : na;
-
-    logInline();
-    console.error('Failed to start job; status: %s, body: %s', statusStr, bodyStr);
-    if (error) {
-      console.error(error);
-    }
-    this.failed = true;
-    this.emit('complete');
-    return;
-  }
-  this.running = true;
-  this.taskId = taskId;
-  this.timestamp = _.now();
-  this.emit('start');
-  this.status();
-}
-
-/**
- * The `request.post` callback used by `Job#status`.
- *
- * @private
- * @param {Object} [error] The error object.
- * @param {Object} res The response data object.
- * @param {Object} body The response body JSON object.
- */
-function onJobStatus(error, res, body) {
-  this.checking = false;
-
-  if (!this.running || this.stopping) {
-    return;
-  }
-  var completed = _.result(body, 'completed', false),
-      data = _.first(_.result(body, 'js tests')),
-      elapsed = (_.now() - this.timestamp) / 1000,
-      jobId = _.result(data, 'job_id', null),
-      jobResult = _.result(data, 'result', null),
-      jobStatus = _.result(data, 'status', ''),
-      jobUrl = _.result(data, 'url', null),
-      expired = (elapsed >= queueTimeout && !_.includes(jobStatus, 'in progress')),
-      options = this.options,
-      platform = options.platforms[0];
-
-  if (_.isObject(jobResult)) {
-    var message = _.result(jobResult, 'message');
-  } else {
-    if (typeof jobResult == 'string') {
-      message = jobResult;
-    }
-    jobResult = null;
-  }
-  if (isJobId(jobId)) {
-    this.id = jobId;
-    this.result = jobResult;
-    this.url = jobUrl;
-  } else {
-    completed = false;
-  }
-  this.emit('status', jobStatus);
-
-  if (!completed && !expired) {
-    this._pollerId = _.delay(_.bind(this.status, this), this.statusInterval * 1000);
-    return;
-  }
-  var description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + _.startCase(platform[0]),
-      errored = !jobResult || !jobResult.passed || reError.test(message) || reError.test(jobStatus),
-      failures = _.result(jobResult, 'failed'),
-      label = options.name + ':',
-      tunnel = this.tunnel;
-
-  if (errored || failures) {
-    if (errored && this.attempts < this.retries) {
-      this.restart();
-      return;
-    }
-    var details = 'See ' + jobUrl + ' for details.';
-    this.failed = true;
-
-    logInline();
-    if (failures) {
-      console.error(label + ' %s ' + chalk.red('failed') + ' %d test' + (failures > 1 ? 's' : '') + '. %s', description, failures, details);
-    }
-    else if (tunnel.attempts < tunnel.retries) {
-      tunnel.restart();
-      return;
-    }
-    else {
-      if (typeof message == 'undefined') {
-        message = 'Results are unavailable. ' + details;
-      }
-      console.error(label, description, chalk.red('failed') + ';', message);
-    }
-  }
-  else {
-    logInline();
-    console.log(label, description, chalk.green('passed'));
-  }
-  this.running = false;
-  this.emit('complete');
-}
-
-/**
- * The `SauceTunnel#start` callback used by `Tunnel#start`.
- *
- * @private
- * @param {boolean} success The connection success indicator.
- */
-function onTunnelStart(success) {
-  this.starting = false;
-
-  if (this._timeoutId) {
-    clearTimeout(this._timeoutId);
-    this._timeoutId = null;
-  }
-  if (!success) {
-    if (this.attempts < this.retries) {
-      this.restart();
-      return;
-    }
-    logInline();
-    console.error('Failed to open Sauce Connect tunnel');
-    process.exit(2);
-  }
-  logInline();
-  console.log('Sauce Connect tunnel opened');
-
-  var jobs = this.jobs;
-  push.apply(jobs.queue, jobs.all);
-
-  this.running = true;
-  this.emit('start');
-
-  console.log('Starting jobs...');
-  this.dequeue();
-}
-
-/*----------------------------------------------------------------------------*/
-
-/**
- * The Job constructor.
- *
- * @private
- * @param {Object} [properties] The properties to initialize a job with.
- */
-function Job(properties) {
-  EventEmitter.call(this);
-
-  this.options = {};
-  _.merge(this, properties);
-  _.defaults(this.options, _.cloneDeep(jobOptions));
-
-  this.attempts = 0;
-  this.checking = this.failed = this.removing = this.resetting = this.restarting = this.running = this.starting = this.stopping = false;
-  this._pollerId = this.id = this.result = this.taskId = this.url = null;
-}
-
-util.inherits(Job, EventEmitter);
-
-/**
- * Removes the job.
- *
- * @memberOf Job
- * @param {Function} callback The function called once the job is removed.
- * @param {Object} Returns the job instance.
- */
-Job.prototype.remove = function(callback) {
-  this.once('remove', _.iteratee(callback));
-  if (this.removing) {
-    return this;
-  }
-  this.removing = true;
-  return this.stop(function() {
-    var onRemove = _.bind(onJobRemove, this);
-    if (!this.id) {
-      _.defer(onRemove);
-      return;
-    }
-    request.del(_.template('https://saucelabs.com/rest/v1/${user}/jobs/${id}')(this), {
-      'auth': { 'user': this.user, 'pass': this.pass }
-    }, onRemove);
-  });
-};
-
-/**
- * Resets the job.
- *
- * @memberOf Job
- * @param {Function} callback The function called once the job is reset.
- * @param {Object} Returns the job instance.
- */
-Job.prototype.reset = function(callback) {
-  this.once('reset', _.iteratee(callback));
-  if (this.resetting) {
-    return this;
-  }
-  this.resetting = true;
-  return this.remove(onJobReset);
-};
-
-/**
- * Restarts the job.
- *
- * @memberOf Job
- * @param {Function} callback The function called once the job is restarted.
- * @param {Object} Returns the job instance.
- */
-Job.prototype.restart = function(callback) {
-  this.once('restart', _.iteratee(callback));
-  if (this.restarting) {
-    return this;
-  }
-  this.restarting = true;
-
-  var options = this.options,
-      platform = options.platforms[0],
-      description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + _.startCase(platform[0]),
-      label = options.name + ':';
-
-  logInline();
-  console.log('%s %s restart %d of %d', label, description, ++this.attempts, this.retries);
-
-  return this.remove(onGenericRestart);
-};
-
-/**
- * Starts the job.
- *
- * @memberOf Job
- * @param {Function} callback The function called once the job is started.
- * @param {Object} Returns the job instance.
- */
-Job.prototype.start = function(callback) {
-  this.once('start', _.iteratee(callback));
-  if (this.starting || this.running) {
-    return this;
-  }
-  this.starting = true;
-  request.post(_.template('https://saucelabs.com/rest/v1/${user}/js-tests')(this), {
-    'auth': { 'user': this.user, 'pass': this.pass },
-    'json': this.options
-  }, _.bind(onJobStart, this));
-
-  return this;
-};
-
-/**
- * Checks the status of a job.
- *
- * @memberOf Job
- * @param {Function} callback The function called once the status is resolved.
- * @param {Object} Returns the job instance.
- */
-Job.prototype.status = function(callback) {
-  this.once('status', _.iteratee(callback));
-  if (this.checking || this.removing || this.resetting || this.restarting || this.starting || this.stopping) {
-    return this;
-  }
-  this._pollerId = null;
-  this.checking = true;
-  request.post(_.template('https://saucelabs.com/rest/v1/${user}/js-tests/status')(this), {
-    'auth': { 'user': this.user, 'pass': this.pass },
-    'json': { 'js tests': [this.taskId] }
-  }, _.bind(onJobStatus, this));
-
-  return this;
-};
-
-/**
- * Stops the job.
- *
- * @memberOf Job
- * @param {Function} callback The function called once the job is stopped.
- * @param {Object} Returns the job instance.
- */
-Job.prototype.stop = function(callback) {
-  this.once('stop', _.iteratee(callback));
-  if (this.stopping) {
-    return this;
-  }
-  this.stopping = true;
-  if (this._pollerId) {
-    clearTimeout(this._pollerId);
-    this._pollerId = null;
-    this.checking = false;
-  }
-  var onStop = _.bind(onGenericStop, this);
-  if (!this.running || !this.id) {
-    _.defer(onStop);
-    return this;
-  }
-  request.put(_.template('https://saucelabs.com/rest/v1/${user}/jobs/${id}/stop')(this), {
-    'auth': { 'user': this.user, 'pass': this.pass }
-  }, onStop);
-
-  return this;
-};
-
-/*----------------------------------------------------------------------------*/
-
-/**
- * The Tunnel constructor.
- *
- * @private
- * @param {Object} [properties] The properties to initialize the tunnel with.
- */
-function Tunnel(properties) {
-  EventEmitter.call(this);
-
-  _.merge(this, properties);
-
-  var active = [],
-      queue = [];
-
-  var all = _.map(this.platforms, _.bind(function(platform) {
-    return new Job(_.merge({
-      'user': this.user,
-      'pass': this.pass,
-      'tunnel': this,
-      'options': { 'platforms': [platform] }
-    }, this.job));
-  }, this));
-
-  var completed = 0,
-      restarted = [],
-      success = true,
-      total = all.length,
-      tunnel = this;
-
-  _.invokeMap(all, 'on', 'complete', function() {
-    _.pull(active, this);
-    if (success) {
-      success = !this.failed;
-    }
-    if (++completed == total) {
-      tunnel.stop(_.partial(tunnel.emit, 'complete', success));
-      return;
-    }
-    tunnel.dequeue();
-  });
-
-  _.invokeMap(all, 'on', 'restart', function() {
-    if (!_.includes(restarted, this)) {
-      restarted.push(this);
-    }
-    // Restart tunnel if all active jobs have restarted.
-    var threshold = Math.min(all.length, _.isFinite(throttled) ? throttled : 3);
-    if (tunnel.attempts < tunnel.retries &&
-        active.length >= threshold && _.isEmpty(_.difference(active, restarted))) {
-      tunnel.restart();
-    }
-  });
-
-  this.on('restart', function() {
-    completed = 0;
-    success = true;
-    restarted.length = 0;
-  });
-
-  this._timeoutId = null;
-  this.attempts = 0;
-  this.restarting = this.running = this.starting = this.stopping = false;
-  this.jobs = { 'active': active, 'all': all, 'queue': queue };
-  this.connection = new SauceTunnel(this.user, this.pass, this.id, this.tunneled, ['-P', '0']);
-}
-
-util.inherits(Tunnel, EventEmitter);
-
-/**
- * Restarts the tunnel.
- *
- * @memberOf Tunnel
- * @param {Function} callback The function called once the tunnel is restarted.
- */
-Tunnel.prototype.restart = function(callback) {
-  this.once('restart', _.iteratee(callback));
-  if (this.restarting) {
-    return this;
-  }
-  this.restarting = true;
-
-  logInline();
-  console.log('Tunnel %s: restart %d of %d', this.id, ++this.attempts, this.retries);
-
-  var jobs = this.jobs,
-      active = jobs.active,
-      all = jobs.all;
-
-  var reset = _.after(all.length, _.bind(this.stop, this, onGenericRestart)),
-      stop = _.after(active.length, _.partial(_.invokeMap, all, 'reset', reset));
-
-  if (_.isEmpty(active)) {
-    _.defer(stop);
-  }
-  if (_.isEmpty(all)) {
-    _.defer(reset);
-  }
-  _.invokeMap(active, 'stop', function() {
-    _.pull(active, this);
-    stop();
-  });
-
-  if (this._timeoutId) {
-    clearTimeout(this._timeoutId);
-    this._timeoutId = null;
-  }
-  return this;
-};
-
-/**
- * Starts the tunnel.
- *
- * @memberOf Tunnel
- * @param {Function} callback The function called once the tunnel is started.
- * @param {Object} Returns the tunnel instance.
- */
-Tunnel.prototype.start = function(callback) {
-  this.once('start', _.iteratee(callback));
-  if (this.starting || this.running) {
-    return this;
-  }
-  this.starting = true;
-
-  logInline();
-  console.log('Opening Sauce Connect tunnel...');
-
-  var onStart = _.bind(onTunnelStart, this);
-  if (this.timeout) {
-    this._timeoutId = _.delay(onStart, this.timeout * 1000, false);
-  }
-  this.connection.start(onStart);
-  return this;
-};
-
-/**
- * Removes jobs from the queue and starts them.
- *
- * @memberOf Tunnel
- * @param {Object} Returns the tunnel instance.
- */
-Tunnel.prototype.dequeue = function() {
-  var count = 0,
-      jobs = this.jobs,
-      active = jobs.active,
-      queue = jobs.queue,
-      throttled = this.throttled;
-
-  while (queue.length && (active.length < throttled)) {
-    var job = queue.shift();
-    active.push(job);
-    _.delay(_.bind(job.start, job), ++count * 1000);
-  }
-  return this;
-};
-
-/**
- * Stops the tunnel.
- *
- * @memberOf Tunnel
- * @param {Function} callback The function called once the tunnel is stopped.
- * @param {Object} Returns the tunnel instance.
- */
-Tunnel.prototype.stop = function(callback) {
-  this.once('stop', _.iteratee(callback));
-  if (this.stopping) {
-    return this;
-  }
-  this.stopping = true;
-
-  logInline();
-  console.log('Shutting down Sauce Connect tunnel...');
-
-  var jobs = this.jobs,
-      active = jobs.active;
-
-  var stop = _.after(active.length, _.bind(function() {
-    var onStop = _.bind(onGenericStop, this);
-    if (this.running) {
-      this.connection.stop(onStop);
-    } else {
-      onStop();
-    }
-  }, this));
-
-  jobs.queue.length = 0;
-  if (_.isEmpty(active)) {
-    _.defer(stop);
-  }
-  _.invokeMap(active, 'stop', function() {
-    _.pull(active, this);
-    stop();
-  });
-
-  if (this._timeoutId) {
-    clearTimeout(this._timeoutId);
-    this._timeoutId = null;
-  }
-  return this;
-};
-
-/*----------------------------------------------------------------------------*/
-
-// Cleanup any inline logs when exited via `ctrl+c`.
-process.on('SIGINT', function() {
-  logInline();
-  process.exit();
-});
-
-// Create a web server for the current working directory.
-http.createServer(function(req, res) {
-  // See http://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx.
-  if (compatMode && path.extname(url.parse(req.url).pathname) == '.html') {
-    res.setHeader('X-UA-Compatible', 'IE=' + compatMode);
-  }
-  mount(req, res);
-}).listen(port);
-
-// Setup Sauce Connect so we can use this server from Sauce Labs.
-var tunnel = new Tunnel({
-  'user': username,
-  'pass': accessKey,
-  'id': tunnelId,
-  'job': { 'retries': maxJobRetries, 'statusInterval': statusInterval },
-  'platforms': platforms,
-  'retries': maxTunnelRetries,
-  'throttled': throttled,
-  'tunneled': tunneled,
-  'timeout': tunnelTimeout
-});
-
-tunnel.on('complete', function(success) {
-  process.exit(success ? 0 : 1);
-});
-
-tunnel.start();
-
-setInterval(logThrobber, throbberDelay);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/test-fp.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/test/test-fp.js
deleted file mode 100644
index 775d7ee..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/test-fp.js
+++ /dev/null
@@ -1,1769 +0,0 @@
-;(function() {
-
-  /** Used as a safe reference for `undefined` in pre-ES5 environments. */
-  var undefined;
-
-  /** Used as the size to cover large array optimizations. */
-  var LARGE_ARRAY_SIZE = 200;
-
-  /** Used as a reference to the global object. */
-  var root = (typeof global == 'object' && global) || this;
-
-  /** Used for native method references. */
-  var arrayProto = Array.prototype;
-
-  /** Method and object shortcuts. */
-  var phantom = root.phantom,
-      amd = root.define && define.amd,
-      argv = root.process && process.argv,
-      document = !phantom && root.document,
-      noop = function() {},
-      slice = arrayProto.slice,
-      WeakMap = root.WeakMap;
-
-  // Leak to avoid sporadic `noglobals` fails on Edge in Sauce Labs.
-  root.msWDfn = undefined;
-
-  /*--------------------------------------------------------------------------*/
-
-  /** Use a single "load" function. */
-  var load = (!amd && typeof require == 'function')
-    ? require
-    : noop;
-
-  /** The unit testing framework. */
-  var QUnit = root.QUnit || (root.QUnit = (
-    QUnit = load('../node_modules/qunitjs/qunit/qunit.js') || root.QUnit,
-    QUnit = QUnit.QUnit || QUnit
-  ));
-
-  /** Load stable Lodash and QUnit Extras. */
-  var _ = root._ || (root._ = (
-    _ = load('../lodash.js'),
-    _.runInContext(root)
-  ));
-
-  var QUnitExtras = load('../node_modules/qunit-extras/qunit-extras.js');
-  if (QUnitExtras) {
-    QUnitExtras.runInContext(root);
-  }
-
-  var convert = (function() {
-    var baseConvert = root.fp || load('../fp/_baseConvert.js');
-    if (!root.fp) {
-      return function(name, func, options) {
-        return baseConvert(_, name, func, options);
-      };
-    }
-    return function(name, func, options) {
-      if (typeof name == 'function') {
-        options = func;
-        func = name;
-        name = undefined;
-      }
-      return name === undefined
-        ? baseConvert(func, options)
-        : baseConvert(_.runInContext(), options)[name];
-    };
-  }());
-
-  var allFalseOptions = {
-    'cap': false,
-    'curry': false,
-    'fixed': false,
-    'immutable': false,
-    'rearg': false
-  };
-
-  var fp = root.fp
-    ? (fp = _.noConflict(), _ = root._, fp)
-    : convert(_.runInContext());
-
-  var mapping = root.mapping || load('../fp/_mapping.js');
-
-  /*--------------------------------------------------------------------------*/
-
-  /**
-   * Skips a given number of tests with a passing result.
-   *
-   * @private
-   * @param {Object} assert The QUnit assert object.
-   * @param {number} [count=1] The number of tests to skip.
-   */
-  function skipAssert(assert, count) {
-    count || (count = 1);
-    while (count--) {
-      assert.ok(true, 'test skipped');
-    }
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  if (argv) {
-    console.log('Running lodash/fp tests.');
-  }
-
-  QUnit.module('convert module');
-
-  (function() {
-    QUnit.test('should work with `name` and `func`', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3, 4],
-          remove = convert('remove', _.remove);
-
-      var actual = remove(function(n) {
-        return n % 2 == 0;
-      })(array);
-
-      assert.deepEqual(array, [1, 2, 3, 4]);
-      assert.deepEqual(actual, [1, 3]);
-    });
-
-    QUnit.test('should work with `name`, `func`, and `options`', function(assert) {
-      assert.expect(3);
-
-      var array = [1, 2, 3, 4],
-          remove = convert('remove', _.remove, allFalseOptions);
-
-      var actual = remove(array, function(n, index) {
-        return index % 2 == 0;
-      });
-
-      assert.deepEqual(array, [2, 4]);
-      assert.deepEqual(actual, [1, 3]);
-      assert.deepEqual(remove(), []);
-    });
-
-    QUnit.test('should work with an object', function(assert) {
-      assert.expect(2);
-
-      if (!document) {
-        var array = [1, 2, 3, 4],
-            lodash = convert({ 'remove': _.remove });
-
-        var actual = lodash.remove(function(n) {
-          return n % 2 == 0;
-        })(array);
-
-        assert.deepEqual(array, [1, 2, 3, 4]);
-        assert.deepEqual(actual, [1, 3]);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should work with an object and `options`', function(assert) {
-      assert.expect(3);
-
-      if (!document) {
-        var array = [1, 2, 3, 4],
-            lodash = convert({ 'remove': _.remove }, allFalseOptions);
-
-        var actual = lodash.remove(array, function(n, index) {
-          return index % 2 == 0;
-        });
-
-        assert.deepEqual(array, [2, 4]);
-        assert.deepEqual(actual, [1, 3]);
-        assert.deepEqual(lodash.remove(), []);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should work with lodash and `options`', function(assert) {
-      assert.expect(3);
-
-      var array = [1, 2, 3, 4],
-          lodash = convert(_.runInContext(), allFalseOptions);
-
-      var actual = lodash.remove(array, function(n, index) {
-        return index % 2 == 0;
-      });
-
-      assert.deepEqual(array, [2, 4]);
-      assert.deepEqual(actual, [1, 3]);
-      assert.deepEqual(lodash.remove(), []);
-    });
-
-    QUnit.test('should work with `runInContext` and `options`', function(assert) {
-      assert.expect(3);
-
-      var array = [1, 2, 3, 4],
-          runInContext = convert('runInContext', _.runInContext, allFalseOptions),
-          lodash = runInContext();
-
-      var actual = lodash.remove(array, function(n, index) {
-        return index % 2 == 0;
-      });
-
-      assert.deepEqual(array, [2, 4]);
-      assert.deepEqual(actual, [1, 3]);
-      assert.deepEqual(lodash.remove(), []);
-    });
-
-    QUnit.test('should accept a variety of options', function(assert) {
-      assert.expect(8);
-
-      var array = [1, 2, 3, 4],
-          predicate = function(n) { return n % 2 == 0; },
-          value = _.clone(array),
-          remove = convert('remove', _.remove, { 'cap': false }),
-          actual = remove(function(n, index) { return index % 2 == 0; })(value);
-
-      assert.deepEqual(value, [1, 2, 3, 4]);
-      assert.deepEqual(actual, [2, 4]);
-
-      remove = convert('remove', _.remove, { 'curry': false });
-      actual = remove(predicate);
-
-      assert.deepEqual(actual, []);
-
-      var trim = convert('trim', _.trim, { 'fixed': false });
-      assert.strictEqual(trim('_-abc-_', '_-'), 'abc');
-
-      value = _.clone(array);
-      remove = convert('remove', _.remove, { 'immutable': false });
-      actual = remove(predicate)(value);
-
-      assert.deepEqual(value, [1, 3]);
-      assert.deepEqual(actual, [2, 4]);
-
-      value = _.clone(array);
-      remove = convert('remove', _.remove, { 'rearg': false });
-      actual = remove(value)(predicate);
-
-      assert.deepEqual(value, [1, 2, 3, 4]);
-      assert.deepEqual(actual, [1, 3]);
-    });
-
-    QUnit.test('should respect the `cap` option', function(assert) {
-      assert.expect(1);
-
-      var iteratee = convert('iteratee', _.iteratee, { 'cap': false });
-
-      var func = iteratee(function(a, b, c) {
-        return [a, b, c];
-      }, 3);
-
-      assert.deepEqual(func(1, 2, 3), [1, 2, 3]);
-    });
-
-    QUnit.test('should respect the `rearg` option', function(assert) {
-      assert.expect(1);
-
-      var add = convert('add', _.add, { 'rearg': true });
-
-      assert.strictEqual(add('2')('1'), '12');
-    });
-
-    QUnit.test('should only add a `placeholder` property if needed', function(assert) {
-      assert.expect(2);
-
-      if (!document) {
-        var methodNames = _.keys(mapping.placeholder),
-            expected = _.map(methodNames, _.constant(true));
-
-        var actual = _.map(methodNames, function(methodName) {
-          var object = {};
-          object[methodName] = _[methodName];
-
-          var lodash = convert(object);
-          return methodName in lodash;
-        });
-
-        assert.deepEqual(actual, expected);
-
-        var lodash = convert({ 'add': _.add });
-        assert.notOk('placeholder' in lodash);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('method.convert');
-
-  (function() {
-    QUnit.test('should exist on unconverted methods', function(assert) {
-      assert.expect(2);
-
-      var array = [],
-          isArray = fp.isArray.convert({ 'curry': true });
-
-      assert.strictEqual(fp.isArray(array), true);
-      assert.strictEqual(isArray()(array), true);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('convert methods');
-
-  _.each(['fp.convert', 'method.convert'], function(methodName) {
-    var isFp = methodName == 'fp.convert',
-        func = isFp ? fp.convert : fp.remove.convert;
-
-    QUnit.test('`' + methodName + '` should work with an object', function(assert) {
-      assert.expect(3);
-
-      var array = [1, 2, 3, 4],
-          lodash = func(allFalseOptions),
-          remove = isFp ? lodash.remove : lodash;
-
-      var actual = remove(array, function(n, index) {
-        return index % 2 == 0;
-      });
-
-      assert.deepEqual(array, [2, 4]);
-      assert.deepEqual(actual, [1, 3]);
-      assert.deepEqual(remove(), []);
-    });
-
-    QUnit.test('`' + methodName + '` should extend existing configs', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3, 4],
-          lodash = func({ 'cap': false }),
-          remove = (isFp ? lodash.remove : lodash).convert({ 'rearg': false });
-
-      var actual = remove(array)(function(n, index) {
-        return index % 2 == 0;
-      });
-
-      assert.deepEqual(array, [1, 2, 3, 4]);
-      assert.deepEqual(actual, [2, 4]);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('method arity checks');
-
-  (function() {
-    QUnit.test('should wrap methods with an arity > `1`', function(assert) {
-      assert.expect(1);
-
-      var methodNames = _.filter(_.functions(fp), function(methodName) {
-        return fp[methodName].length > 1;
-      });
-
-      assert.deepEqual(methodNames, []);
-    });
-
-    QUnit.test('should have >= arity of `aryMethod` designation', function(assert) {
-      assert.expect(4);
-
-      _.times(4, function(index) {
-        var aryCap = index + 1;
-
-        var methodNames = _.filter(mapping.aryMethod[aryCap], function(methodName) {
-          var key = _.result(mapping.remap, methodName, methodName),
-              arity = _[key].length;
-
-          return arity != 0 && arity < aryCap;
-        });
-
-        assert.deepEqual(methodNames, [], '`aryMethod[' + aryCap + ']`');
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('method aliases');
-
-  (function() {
-    QUnit.test('should have correct aliases', function(assert) {
-      assert.expect(1);
-
-      var actual = _.transform(mapping.aliasToReal, function(result, realName, alias) {
-        result.push([alias, fp[alias] === fp[realName]]);
-      }, []);
-
-      assert.deepEqual(_.reject(actual, 1), []);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('method ary caps');
-
-  (function() {
-    QUnit.test('should have a cap of 1', function(assert) {
-      assert.expect(1);
-
-      var funcMethods = [
-        'curry', 'iteratee', 'memoize', 'over', 'overEvery', 'overSome',
-        'method', 'methodOf', 'rest', 'runInContext'
-      ];
-
-      var exceptions = funcMethods.concat('mixin', 'template'),
-          expected = _.map(mapping.aryMethod[1], _.constant(true));
-
-      var actual = _.map(mapping.aryMethod[1], function(methodName) {
-        var arg = _.includes(funcMethods, methodName) ? _.noop : 1,
-            result = _.attempt(function() { return fp[methodName](arg); });
-
-        if (_.includes(exceptions, methodName)
-              ? typeof result == 'function'
-              : typeof result != 'function'
-            ) {
-          return true;
-        }
-        console.log(methodName, result);
-        return false;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should have a cap of 2', function(assert) {
-      assert.expect(1);
-
-      var funcMethods = [
-        'after', 'ary', 'before', 'bind', 'bindKey', 'curryN', 'debounce',
-        'delay', 'overArgs', 'partial', 'partialRight', 'rearg', 'throttle',
-        'wrap'
-      ];
-
-      var exceptions = _.difference(funcMethods.concat('matchesProperty'), ['cloneDeepWith', 'cloneWith', 'delay']),
-          expected = _.map(mapping.aryMethod[2], _.constant(true));
-
-      var actual = _.map(mapping.aryMethod[2], function(methodName) {
-        var args = _.includes(funcMethods, methodName) ? [methodName == 'curryN' ? 1 : _.noop, _.noop] : [1, []],
-            result = _.attempt(function() { return fp[methodName](args[0])(args[1]); });
-
-        if (_.includes(exceptions, methodName)
-              ? typeof result == 'function'
-              : typeof result != 'function'
-            ) {
-          return true;
-        }
-        console.log(methodName, result);
-        return false;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should have a cap of 3', function(assert) {
-      assert.expect(1);
-
-      var funcMethods = [
-        'assignWith', 'extendWith', 'isEqualWith', 'isMatchWith', 'reduce',
-        'reduceRight', 'transform', 'zipWith'
-      ];
-
-      var expected = _.map(mapping.aryMethod[3], _.constant(true));
-
-      var actual = _.map(mapping.aryMethod[3], function(methodName) {
-        var args = _.includes(funcMethods, methodName) ? [_.noop, 0, 1] : [0, 1, []],
-            result = _.attempt(function() { return fp[methodName](args[0])(args[1])(args[2]); });
-
-        if (typeof result != 'function') {
-          return true;
-        }
-        console.log(methodName, result);
-        return false;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('methods that use `indexOf`');
-
-  (function() {
-    QUnit.test('should work with `fp.indexOf`', function(assert) {
-      assert.expect(10);
-
-      var array = ['a', 'b', 'c'],
-          other = ['b', 'd', 'b'],
-          object = { 'a': 1, 'b': 2, 'c': 2 },
-          actual = fp.difference(array)(other);
-
-      assert.deepEqual(actual, ['a', 'c'], 'fp.difference');
-
-      actual = fp.includes('b')(array);
-      assert.strictEqual(actual, true, 'fp.includes');
-
-      actual = fp.intersection(other)(array);
-      assert.deepEqual(actual, ['b'], 'fp.intersection');
-
-      actual = fp.omit(other)(object);
-      assert.deepEqual(actual, { 'a': 1, 'c': 2 }, 'fp.omit');
-
-      actual = fp.union(other)(array);
-      assert.deepEqual(actual, ['a', 'b', 'c', 'd'], 'fp.union');
-
-      actual = fp.uniq(other);
-      assert.deepEqual(actual, ['b', 'd'], 'fp.uniq');
-
-      actual = fp.uniqBy(_.identity, other);
-      assert.deepEqual(actual, ['b', 'd'], 'fp.uniqBy');
-
-      actual = fp.without(array)(other);
-      assert.deepEqual(actual, ['a', 'c'], 'fp.without');
-
-      actual = fp.xor(other)(array);
-      assert.deepEqual(actual, ['a', 'c', 'd'], 'fp.xor');
-
-      actual = fp.pull('b')(array);
-      assert.deepEqual(actual, ['a', 'c'], 'fp.pull');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('cherry-picked methods');
-
-  (function() {
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(4);
-
-      var args,
-          array = [1, 2, 3],
-          object = { 'a': 1, 'b': 2 },
-          isFIFO = _.keys(object)[0] == 'a',
-          map = convert('map', _.map),
-          reduce = convert('reduce', _.reduce);
-
-      map(function() {
-        args || (args = slice.call(arguments));
-      })(array);
-
-      assert.deepEqual(args, [1]);
-
-      args = undefined;
-      map(function() {
-        args || (args = slice.call(arguments));
-      })(object);
-
-      assert.deepEqual(args, isFIFO ? [1] : [2]);
-
-      args = undefined;
-      reduce(function() {
-        args || (args = slice.call(arguments));
-      })(0)(array);
-
-      assert.deepEqual(args, [0, 1]);
-
-      args = undefined;
-      reduce(function() {
-        args || (args = slice.call(arguments));
-      })(0)(object);
-
-      assert.deepEqual(args, isFIFO ? [0, 1] : [0, 2]);
-    });
-
-    QUnit.test('should not support shortcut fusion', function(assert) {
-      assert.expect(3);
-
-      var array = fp.range(0, LARGE_ARRAY_SIZE),
-          filterCount = 0,
-          mapCount = 0;
-
-      var iteratee = function(value) {
-        mapCount++;
-        return value * value;
-      };
-
-      var predicate = function(value) {
-        filterCount++;
-        return value % 2 == 0;
-      };
-
-      var map1 = convert('map', _.map),
-          filter1 = convert('filter', _.filter),
-          take1 = convert('take', _.take);
-
-      var filter2 = filter1(predicate),
-          map2 = map1(iteratee),
-          take2 = take1(2);
-
-      var combined = fp.flow(map2, filter2, fp.compact, take2);
-
-      assert.deepEqual(combined(array), [4, 16]);
-      assert.strictEqual(filterCount, 200, 'filterCount');
-      assert.strictEqual(mapCount, 200, 'mapCount');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('iteratee shorthands');
-
-  (function() {
-    var objects = [{ 'a': 1, 'b': 2 }, { 'a': 3, 'b': 4 }];
-
-    QUnit.test('should work with "_.matches" shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(fp.filter({ 'a': 3 })(objects), [objects[1]]);
-    });
-
-    QUnit.test('should work with "_.matchesProperty" shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(fp.filter(['a', 3])(objects), [objects[1]]);
-    });
-
-    QUnit.test('should work with "_.property" shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(fp.map('a')(objects), [1, 3]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('mutation methods');
-
-  (function() {
-    var array = [1, 2, 3],
-        object = { 'a': 1 },
-        deepObject = { 'a': { 'b': 2, 'c': 3 } };
-
-    QUnit.test('should not mutate values', function(assert) {
-      assert.expect(42);
-
-      function Foo() {}
-      Foo.prototype = { 'b': 2 };
-
-      var value = _.clone(object),
-          actual = fp.assign(value)({ 'b': 2 });
-
-      assert.deepEqual(value, object, 'fp.assign');
-      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assign');
-
-      value = _.clone(object);
-      actual = fp.assignWith(function(objValue, srcValue) {
-        return srcValue;
-      })(value)({ 'b': 2 });
-
-      assert.deepEqual(value, object, 'fp.assignWith');
-      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assignWith');
-
-      value = _.clone(object);
-      actual = fp.assignIn(value)(new Foo);
-
-      assert.deepEqual(value, object, 'fp.assignIn');
-      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assignIn');
-
-      value = _.clone(object);
-      actual = fp.assignInWith(function(objValue, srcValue) {
-        return srcValue;
-      })(value)(new Foo);
-
-      assert.deepEqual(value, object, 'fp.assignInWith');
-      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assignInWith');
-
-      value = _.clone(object);
-      actual = fp.defaults({ 'a': 2, 'b': 2 })(value);
-
-      assert.deepEqual(value, object, 'fp.defaults');
-      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.defaults');
-
-      value = _.cloneDeep(deepObject);
-      actual = fp.defaultsDeep({ 'a': { 'c': 4, 'd': 4 } })(deepObject);
-
-      assert.deepEqual(value, { 'a': { 'b': 2, 'c': 3 } }, 'fp.defaultsDeep');
-      assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3, 'd': 4 } }, 'fp.defaultsDeep');
-
-      value = _.clone(object);
-      actual = fp.extend(value)(new Foo);
-
-      assert.deepEqual(value, object, 'fp.extend');
-      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.extend');
-
-      value = _.clone(object);
-      actual = fp.extendWith(function(objValue, srcValue) {
-        return srcValue;
-      })(value)(new Foo);
-
-      assert.deepEqual(value, object, 'fp.extendWith');
-      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.extendWith');
-
-      value = _.clone(array);
-      actual = fp.fill(1)(2)('*')(value);
-
-      assert.deepEqual(value, array, 'fp.fill');
-      assert.deepEqual(actual, [1, '*', 3], 'fp.fill');
-
-      value = _.cloneDeep(deepObject);
-      actual = fp.merge(value)({ 'a': { 'd': 4 } });
-
-      assert.deepEqual(value, { 'a': { 'b': 2, 'c': 3 } }, 'fp.merge');
-      assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3, 'd': 4 } }, 'fp.merge');
-
-      value = _.cloneDeep(deepObject);
-      value.a.b = [1];
-
-      actual = fp.mergeWith(function(objValue, srcValue) {
-        if (_.isArray(objValue)) {
-          return objValue.concat(srcValue);
-        }
-      }, value, { 'a': { 'b': [2, 3] } });
-
-      assert.deepEqual(value, { 'a': { 'b': [1], 'c': 3 } }, 'fp.mergeWith');
-      assert.deepEqual(actual, { 'a': { 'b': [1, 2, 3], 'c': 3 } }, 'fp.mergeWith');
-
-      value = _.clone(array);
-      actual = fp.pull(2)(value);
-
-      assert.deepEqual(value, array, 'fp.pull');
-      assert.deepEqual(actual, [1, 3], 'fp.pull');
-
-      value = _.clone(array);
-      actual = fp.pullAll([1, 3])(value);
-
-      assert.deepEqual(value, array, 'fp.pullAll');
-      assert.deepEqual(actual, [2], 'fp.pullAll');
-
-      value = _.clone(array);
-      actual = fp.pullAt([0, 2])(value);
-
-      assert.deepEqual(value, array, 'fp.pullAt');
-      assert.deepEqual(actual, [2], 'fp.pullAt');
-
-      value = _.clone(array);
-      actual = fp.remove(function(value) {
-        return value === 2;
-      })(value);
-
-      assert.deepEqual(value, array, 'fp.remove');
-      assert.deepEqual(actual, [1, 3], 'fp.remove');
-
-      value = _.clone(array);
-      actual = fp.reverse(value);
-
-      assert.deepEqual(value, array, 'fp.reverse');
-      assert.deepEqual(actual, [3, 2, 1], 'fp.reverse');
-
-      value = _.cloneDeep(deepObject);
-      actual = fp.set('a.b')(3)(value);
-
-      assert.deepEqual(value, deepObject, 'fp.set');
-      assert.deepEqual(actual, { 'a': { 'b': 3, 'c': 3 } }, 'fp.set');
-
-      value = _.cloneDeep(deepObject);
-      actual = fp.setWith(Object)('d.e')(4)(value);
-
-      assert.deepEqual(value, deepObject, 'fp.setWith');
-      assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3 }, 'd': { 'e': 4 } }, 'fp.setWith');
-
-      value = _.cloneDeep(deepObject);
-      actual = fp.unset('a.b')(value);
-
-      assert.deepEqual(value, deepObject, 'fp.unset');
-      assert.deepEqual(actual, { 'a': { 'c': 3 } }, 'fp.unset');
-
-      value = _.cloneDeep(deepObject);
-      actual = fp.update('a.b')(function(n) { return n * n; })(value);
-
-      assert.deepEqual(value, deepObject, 'fp.update');
-      assert.deepEqual(actual, { 'a': { 'b': 4, 'c': 3 } }, 'fp.update');
-
-      value = _.cloneDeep(deepObject);
-      actual = fp.updateWith(Object)('d.e')(_.constant(4))(value);
-
-      assert.deepEqual(value, deepObject, 'fp.updateWith');
-      assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3 }, 'd': { 'e': 4 } }, 'fp.updateWith');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('placeholder methods');
-
-  (function() {
-    QUnit.test('should use `fp` as the default placeholder', function(assert) {
-      assert.expect(3);
-
-      var actual = fp.add(fp, 'b')('a');
-      assert.strictEqual(actual, 'ab');
-
-      actual = fp.slice(fp, 2)(1)(['a', 'b', 'c']);
-      assert.deepEqual(actual, ['b']);
-
-      actual = fp.fill(fp, 2)(1, '*')([1, 2, 3]);
-      assert.deepEqual(actual, [1, '*', 3]);
-    });
-
-    QUnit.test('should support `fp.placeholder`', function(assert) {
-      assert.expect(6);
-
-      _.each([[], fp.__], function(ph) {
-        fp.placeholder = ph;
-
-        var actual = fp.add(ph, 'b')('a');
-        assert.strictEqual(actual, 'ab');
-
-        actual = fp.slice(ph, 2)(1)(['a', 'b', 'c']);
-        assert.deepEqual(actual, ['b']);
-
-        actual = fp.fill(ph, 2)(1, '*')([1, 2, 3]);
-        assert.deepEqual(actual, [1, '*', 3]);
-      });
-    });
-
-    _.forOwn(mapping.placeholder, function(truthy, methodName) {
-      var func = fp[methodName];
-
-      QUnit.test('`_.' + methodName + '` should have a `placeholder` property', function(assert) {
-        assert.expect(2);
-
-        assert.ok(_.isObject(func.placeholder));
-        assert.strictEqual(func.placeholder, fp.__);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('set methods');
-
-  (function() {
-    QUnit.test('should only clone objects in `path`', function(assert) {
-      assert.expect(11);
-
-      var object = { 'a': { 'b': 2, 'c': 3 }, 'd': { 'e': 4 } },
-          value = _.cloneDeep(object),
-          actual = fp.set('a.b.c.d', 5, value);
-
-      assert.ok(_.isObject(actual.a.b), 'fp.set');
-      assert.ok(_.isNumber(actual.a.b), 'fp.set');
-
-      assert.strictEqual(actual.a.b.c.d, 5, 'fp.set');
-      assert.strictEqual(actual.d, value.d, 'fp.set');
-
-      value = _.cloneDeep(object);
-      actual = fp.setWith(Object)('[0][1]')('a')(value);
-
-      assert.deepEqual(actual[0], { '1': 'a' }, 'fp.setWith');
-
-      value = _.cloneDeep(object);
-      actual = fp.unset('a.b')(value);
-
-      assert.notOk('b' in actual.a, 'fp.unset');
-      assert.strictEqual(actual.a.c, value.a.c, 'fp.unset');
-
-      value = _.cloneDeep(object);
-      actual = fp.update('a.b')(function(n) { return n * n; })(value);
-
-      assert.strictEqual(actual.a.b, 4, 'fp.update');
-      assert.strictEqual(actual.d, value.d, 'fp.update');
-
-      value = _.cloneDeep(object);
-      actual = fp.updateWith(Object)('[0][1]')(_.constant('a'))(value);
-
-      assert.deepEqual(actual[0], { '1': 'a' }, 'fp.updateWith');
-      assert.strictEqual(actual.d, value.d, 'fp.updateWith');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('with methods');
-
-  (function() {
-    var object = { 'a': 1 };
-
-    QUnit.test('should provide the correct `customizer` arguments', function(assert) {
-      assert.expect(7);
-
-      var args,
-          value = _.clone(object);
-
-      fp.assignWith(function() {
-        args || (args = _.map(arguments, _.cloneDeep));
-      })(value)({ 'b': 2 });
-
-      assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.assignWith');
-
-      args = undefined;
-      value = _.clone(object);
-
-      fp.extendWith(function() {
-        args || (args = _.map(arguments, _.cloneDeep));
-      })(value)({ 'b': 2 });
-
-      assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.extendWith');
-
-      var iteration = 0,
-          objects = [{ 'a': 1 }, { 'a': 2 }],
-          stack = { '__data__': { 'array': [[objects[0], objects[1]]], 'map': null } },
-          expected = [1, 2, 'a', objects[0], objects[1], stack];
-
-      args = undefined;
-
-      fp.isEqualWith(function() {
-        if (++iteration == 2) {
-          args = _.map(arguments, _.cloneDeep);
-        }
-      })(objects[0])(objects[1]);
-
-      args[5] = _.omitBy(args[5], _.isFunction);
-      assert.deepEqual(args, expected, 'fp.isEqualWith');
-
-      args = undefined;
-      stack = { '__data__': { 'array': [], 'map': null } };
-      expected = [2, 1, 'a', objects[1], objects[0], stack];
-
-      fp.isMatchWith(function() {
-        args || (args = _.map(arguments, _.cloneDeep));
-      })(objects[0])(objects[1]);
-
-      args[5] = _.omitBy(args[5], _.isFunction);
-      assert.deepEqual(args, expected, 'fp.isMatchWith');
-
-      args = undefined;
-      value = { 'a': [1] };
-      expected = [[1], [2, 3], 'a', { 'a': [1] }, { 'a': [2, 3] }, stack];
-
-      fp.mergeWith(function() {
-        args || (args = _.map(arguments, _.cloneDeep));
-      })(value)({ 'a': [2, 3] });
-
-      args[5] = _.omitBy(args[5], _.isFunction);
-      assert.deepEqual(args, expected, 'fp.mergeWith');
-
-      args = undefined;
-      value = _.clone(object);
-
-      fp.setWith(function() {
-        args || (args = _.map(arguments, _.cloneDeep));
-      })('b.c')(2)(value);
-
-      assert.deepEqual(args, [undefined, 'b', { 'a': 1 }], 'fp.setWith');
-
-      args = undefined;
-      value = _.clone(object);
-
-      fp.updateWith(function() {
-        args || (args = _.map(arguments, _.cloneDeep));
-      })('b.c')(_.constant(2))(value);
-
-      assert.deepEqual(args, [undefined, 'b', { 'a': 1 }], 'fp.updateWith');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.add and fp.subtract');
-
-  _.each(['add', 'subtract'], function(methodName) {
-    var func = fp[methodName],
-        isAdd = methodName == 'add';
-
-    QUnit.test('`fp.' + methodName + '` should not have `rearg` applied', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(func('1')('2'), isAdd ? '12' : -1);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.castArray');
-
-  (function() {
-    QUnit.test('should shallow clone array values', function(assert) {
-      assert.expect(2);
-
-      var array = [1],
-          actual = fp.castArray(array);
-
-      assert.deepEqual(actual, array);
-      assert.notStrictEqual(actual, array);
-    });
-
-    QUnit.test('should not shallow clone non-array values', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': 1 },
-          actual = fp.castArray(object);
-
-      assert.deepEqual(actual, [object]);
-      assert.strictEqual(actual[0], object);
-    });
-
-    QUnit.test('should convert by name', function(assert) {
-      assert.expect(4);
-
-      var array = [1],
-          object = { 'a': 1 },
-          castArray = convert('castArray', _.castArray),
-          actual = castArray(array);
-
-      assert.deepEqual(actual, array);
-      assert.notStrictEqual(actual, array);
-
-      actual = castArray(object);
-      assert.deepEqual(actual, [object]);
-      assert.strictEqual(actual[0], object);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.curry and fp.curryRight');
-
-  _.each(['curry', 'curryRight'], function(methodName) {
-    var func = fp[methodName];
-
-    QUnit.test('`_.' + methodName + '` should only accept a `func` param', function(assert) {
-      assert.expect(1);
-
-      assert.raises(function() { func(1, _.noop); }, TypeError);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.curryN and fp.curryRightN');
-
-  _.each(['curryN', 'curryRightN'], function(methodName) {
-    var func = fp[methodName];
-
-    QUnit.test('`_.' + methodName + '` should accept an `arity` param', function(assert) {
-      assert.expect(1);
-
-      var actual = func(1)(function(a, b) { return [a, b]; })('a');
-      assert.deepEqual(actual, ['a', undefined]);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.difference');
-
-  (function() {
-    QUnit.test('should return the elements of the first array not included in the second array', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(fp.difference([1, 2])([2, 3]), [1]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.divide and fp.multiply');
-
-  _.each(['divide', 'multiply'], function(methodName) {
-    var func = fp[methodName],
-        isDivide = methodName == 'divide';
-
-    QUnit.test('`fp.' + methodName + '` should not have `rearg` applied', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(func('2')('4'), isDivide ? 0.5 : 8);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.extend');
-
-  (function() {
-    QUnit.test('should convert by name', function(assert) {
-      assert.expect(2);
-
-      function Foo() {}
-      Foo.prototype = { 'b': 2 };
-
-      var object = { 'a': 1 },
-          extend = convert('extend', _.extend),
-          value = _.clone(object),
-          actual = extend(value)(new Foo);
-
-      assert.deepEqual(value, object);
-      assert.deepEqual(actual, { 'a': 1, 'b': 2 });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.fill');
-
-  (function() {
-    QUnit.test('should have an argument order of `start`, `end`, then `value`', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3];
-      assert.deepEqual(fp.fill(1)(2)('*')(array), [1, '*', 3]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.flatMapDepth');
-
-  (function() {
-    QUnit.test('should have an argument order of `iteratee`, `depth`, then `collection`', function(assert) {
-      assert.expect(2);
-
-      function duplicate(n) {
-        return [[[n, n]]];
-      }
-
-      var array = [1, 2],
-          object = { 'a': 1, 'b': 2 },
-          expected = [[1, 1], [2, 2]];
-
-      assert.deepEqual(fp.flatMapDepth(duplicate)(2)(array), expected);
-      assert.deepEqual(fp.flatMapDepth(duplicate)(2)(object), expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.flow and fp.flowRight');
-
-  _.each(['flow', 'flowRight'], function(methodName) {
-    var func = fp[methodName],
-        isFlow = methodName == 'flow';
-
-    QUnit.test('`fp.' + methodName + '` should support shortcut fusion', function(assert) {
-      assert.expect(6);
-
-      var filterCount,
-          mapCount,
-          array = fp.range(0, LARGE_ARRAY_SIZE);
-
-      var iteratee = function(value) {
-        mapCount++;
-        return value * value;
-      };
-
-      var predicate = function(value) {
-        filterCount++;
-        return value % 2 == 0;
-      };
-
-      var filter = fp.filter(predicate),
-          map = fp.map(iteratee),
-          take = fp.take(2);
-
-      _.times(2, function(index) {
-        var combined = isFlow
-          ? func(map, filter, fp.compact, take)
-          : func(take, fp.compact, filter, map);
-
-        filterCount = mapCount = 0;
-
-        if (WeakMap && WeakMap.name) {
-          assert.deepEqual(combined(array), [4, 16]);
-          assert.strictEqual(filterCount, 5, 'filterCount');
-          assert.strictEqual(mapCount, 5, 'mapCount');
-        }
-        else {
-          skipAssert(assert, 3);
-        }
-      });
-    });
-  });
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.getOr');
-
-  (function() {
-    QUnit.test('should accept a `defaultValue` param', function(assert) {
-      assert.expect(1);
-
-      var actual = fp.getOr('default')('path')({});
-      assert.strictEqual(actual, 'default');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.gt and fp.gte');
-
-  _.each(['gt', 'gte'], function(methodName) {
-    var func = fp[methodName];
-
-    QUnit.test('`fp.' + methodName + '` should have `rearg` applied', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(func(2)(1), true);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.inRange');
-
-  (function() {
-    QUnit.test('should have an argument order of `start`, `end`, then `value`', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(fp.inRange(2)(4)(3), true);
-      assert.strictEqual(fp.inRange(-2)(-6)(-3), true);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.invoke');
-
-  (function() {
-    QUnit.test('should not accept an `args` param', function(assert) {
-      assert.expect(1);
-
-      var actual = fp.invoke('toUpperCase')('a');
-      assert.strictEqual(actual, 'A');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.invokeMap');
-
-  (function() {
-    QUnit.test('should not accept an `args` param', function(assert) {
-      assert.expect(1);
-
-      var actual = fp.invokeMap('toUpperCase')(['a', 'b']);
-      assert.deepEqual(actual, ['A', 'B']);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.invokeArgs');
-
-  (function() {
-    QUnit.test('should accept an `args` param', function(assert) {
-      assert.expect(1);
-
-      var actual = fp.invokeArgs('concat')(['b', 'c'])('a');
-      assert.strictEqual(actual, 'abc');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.invokeArgsMap');
-
-  (function() {
-    QUnit.test('should accept an `args` param', function(assert) {
-      assert.expect(1);
-
-      var actual = fp.invokeArgsMap('concat')(['b', 'c'])(['a', 'A']);
-      assert.deepEqual(actual, ['abc', 'Abc']);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.iteratee');
-
-  (function() {
-    QUnit.test('should return a iteratee with capped params', function(assert) {
-      assert.expect(1);
-
-      var func = fp.iteratee(function(a, b, c) { return [a, b, c]; }, 3);
-      assert.deepEqual(func(1, 2, 3), [1, undefined, undefined]);
-    });
-
-    QUnit.test('should convert by name', function(assert) {
-      assert.expect(1);
-
-      var iteratee = convert('iteratee', _.iteratee),
-          func = iteratee(function(a, b, c) { return [a, b, c]; }, 3);
-
-      assert.deepEqual(func(1, 2, 3), [1, undefined, undefined]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.lt and fp.lte');
-
-  _.each(['lt', 'lte'], function(methodName) {
-    var func = fp[methodName];
-
-    QUnit.test('`fp.' + methodName + '` should have `rearg` applied', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(func(1)(2), true);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.mapKeys');
-
-  (function() {
-    QUnit.test('should only provide `key` to `iteratee`', function(assert) {
-      assert.expect(1);
-
-      var args,
-          object = { 'a': 1 };
-
-      fp.mapKeys(function() {
-        args || (args = slice.call(arguments));
-      }, object);
-
-      assert.deepEqual(args, ['a']);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.maxBy and fp.minBy');
-
-  _.each(['maxBy', 'minBy'], function(methodName) {
-    var array = [1, 2, 3],
-        func = fp[methodName],
-        isMax = methodName == 'maxBy';
-
-    QUnit.test('`fp.' + methodName + '` should work with an `iteratee` argument', function(assert) {
-      assert.expect(1);
-
-      var actual = func(function(num) {
-        return -num;
-      })(array);
-
-      assert.strictEqual(actual, isMax ? 1 : 3);
-    });
-
-    QUnit.test('`fp.' + methodName + '` should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      func(function() {
-        args || (args = slice.call(arguments));
-      })(array);
-
-      assert.deepEqual(args, [1]);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.mixin');
-
-  (function() {
-    var source = { 'a': _.noop };
-
-    QUnit.test('should mixin static methods but not prototype methods', function(assert) {
-      assert.expect(2);
-
-      fp.mixin(source);
-
-      assert.strictEqual(typeof fp.a, 'function');
-      assert.notOk('a' in fp.prototype);
-
-      delete fp.a;
-      delete fp.prototype.a;
-    });
-
-    QUnit.test('should not assign inherited `source` methods', function(assert) {
-      assert.expect(2);
-
-      function Foo() {}
-      Foo.prototype.a = _.noop;
-      fp.mixin(new Foo);
-
-      assert.notOk('a' in fp);
-      assert.notOk('a' in fp.prototype);
-
-      delete fp.a;
-      delete fp.prototype.a;
-    });
-
-    QUnit.test('should not remove existing prototype methods', function(assert) {
-      assert.expect(2);
-
-      var each1 = fp.each,
-          each2 = fp.prototype.each;
-
-      fp.mixin({ 'each': source.a });
-
-      assert.strictEqual(fp.each, source.a);
-      assert.strictEqual(fp.prototype.each, each2);
-
-      fp.each = each1;
-      fp.prototype.each = each2;
-    });
-
-    QUnit.test('should not export to the global when `source` is not an object', function(assert) {
-      assert.expect(2);
-
-      var props = _.without(_.keys(_), '_');
-
-      _.times(2, function(index) {
-        fp.mixin.apply(fp, index ? [1] : []);
-
-        assert.ok(_.every(props, function(key) {
-          return root[key] !== fp[key];
-        }));
-
-        _.each(props, function(key) {
-          if (root[key] === fp[key]) {
-            delete root[key];
-          }
-        });
-      });
-    });
-
-    QUnit.test('should convert by name', function(assert) {
-      assert.expect(3);
-
-      var object = { 'mixin': convert('mixin', _.mixin) };
-
-      function Foo() {}
-      Foo.mixin = object.mixin;
-      Foo.mixin(source);
-
-      assert.strictEqual(typeof Foo.a, 'function');
-      assert.notOk('a' in Foo.prototype);
-
-      object.mixin(source);
-      assert.strictEqual(typeof object.a, 'function');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.over');
-
-  (function() {
-    QUnit.test('should not cap iteratee args', function(assert) {
-      assert.expect(2);
-
-      _.each([fp.over, convert('over', _.over)], function(func) {
-        var over = func([Math.max, Math.min]);
-        assert.deepEqual(over(1, 2, 3, 4), [4, 1]);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.omitBy and fp.pickBy');
-
-  _.each(['omitBy', 'pickBy'], function(methodName) {
-    var func = fp[methodName];
-
-    QUnit.test('`fp.' + methodName + '` should provide `value` and `key` to `iteratee`', function(assert) {
-      assert.expect(1);
-
-      var args,
-          object = { 'a': 1 };
-
-      func(function() {
-        args || (args = slice.call(arguments));
-      })(object);
-
-      assert.deepEqual(args, [1, 'a']);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('padChars methods');
-
-  _.each(['padChars', 'padCharsStart', 'padCharsEnd'], function(methodName) {
-    var func = fp[methodName],
-        isPad = methodName == 'padChars',
-        isStart = methodName == 'padCharsStart';
-
-    QUnit.test('`_.' + methodName + '` should truncate pad characters to fit the pad length', function(assert) {
-      assert.expect(1);
-
-      if (isPad) {
-        assert.strictEqual(func('_-')(8)('abc'), '_-abc_-_');
-      } else {
-        assert.strictEqual(func('_-')(6)('abc'), isStart ? '_-_abc' : 'abc_-_');
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.partial and fp.partialRight');
-
-  _.each(['partial', 'partialRight'], function(methodName) {
-    var func = fp[methodName],
-        isPartial = methodName == 'partial';
-
-    QUnit.test('`_.' + methodName + '` should accept an `args` param', function(assert) {
-      assert.expect(1);
-
-      var expected = isPartial ? [1, 2, 3] : [0, 1, 2];
-
-      var actual = func(function(a, b, c) {
-        return [a, b, c];
-      })([1, 2])(isPartial ? 3 : 0);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should convert by name', function(assert) {
-      assert.expect(2);
-
-      var expected = isPartial ? [1, 2, 3] : [0, 1, 2],
-          par = convert(methodName, _[methodName]),
-          ph = par.placeholder;
-
-      var actual = par(function(a, b, c) {
-        return [a, b, c];
-      })([1, 2])(isPartial ? 3 : 0);
-
-      assert.deepEqual(actual, expected);
-
-      actual = par(function(a, b, c) {
-        return [a, b, c];
-      })([ph, 2])(isPartial ? 1 : 0, isPartial ? 3 : 1);
-
-      assert.deepEqual(actual, expected);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.random');
-
-  (function() {
-    var array = Array(1000);
-
-    QUnit.test('should support a `min` and `max` argument', function(assert) {
-      assert.expect(1);
-
-      var min = 5,
-          max = 10;
-
-      assert.ok(_.some(array, function() {
-        var result = fp.random(min)(max);
-        return result >= min && result <= max;
-      }));
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.range');
-
-  (function() {
-    QUnit.test('should have an argument order of `start` then `end`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(fp.range(1)(4), [1, 2, 3]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.reduce and fp.reduceRight');
-
-  _.each(['reduce', 'reduceRight'], function(methodName) {
-    var func = fp[methodName],
-        isReduce = methodName == 'reduce';
-
-    QUnit.test('`_.' + methodName + '` should provide the correct `iteratee` arguments when iterating an array', function(assert) {
-      assert.expect(1);
-
-      var args,
-          array = [1, 2, 3];
-
-      func(function() {
-        args || (args = slice.call(arguments));
-      })(0)(array);
-
-      assert.deepEqual(args, isReduce ? [0, 1] : [0, 3]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should provide the correct `iteratee` arguments when iterating an object', function(assert) {
-      assert.expect(1);
-
-      var args,
-          object = { 'a': 1, 'b': 2 },
-          isFIFO = _.keys(object)[0] == 'a';
-
-      var expected = isFIFO
-        ? (isReduce ? [0, 1] : [0, 2])
-        : (isReduce ? [0, 2] : [0, 1]);
-
-      func(function() {
-        args || (args = slice.call(arguments));
-      })(0)(object);
-
-      assert.deepEqual(args, expected);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.restFrom');
-
-  (function() {
-    QUnit.test('should accept a `start` param', function(assert) {
-      assert.expect(1);
-
-      var actual = fp.restFrom(2)(function() {
-        return slice.call(arguments);
-      })('a', 'b', 'c', 'd');
-
-      assert.deepEqual(actual, ['a', 'b', ['c', 'd']]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.runInContext');
-
-  (function() {
-    QUnit.test('should return a converted lodash instance', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(typeof fp.runInContext({}).curryN, 'function');
-    });
-
-    QUnit.test('should convert by name', function(assert) {
-      assert.expect(1);
-
-      var runInContext = convert('runInContext', _.runInContext);
-      assert.strictEqual(typeof runInContext({}).curryN, 'function');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.spreadFrom');
-
-  (function() {
-    QUnit.test('should accept a `start` param', function(assert) {
-      assert.expect(1);
-
-      var actual = fp.spreadFrom(2)(function() {
-        return slice.call(arguments);
-      })('a', 'b', ['c', 'd']);
-
-      assert.deepEqual(actual, ['a', 'b', 'c', 'd']);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('trimChars methods');
-
-  _.each(['trimChars', 'trimCharsStart', 'trimCharsEnd'], function(methodName, index) {
-    var func = fp[methodName],
-        parts = [];
-
-    if (index != 2) {
-      parts.push('leading');
-    }
-    if (index != 1) {
-      parts.push('trailing');
-    }
-    parts = parts.join(' and ');
-
-    QUnit.test('`_.' + methodName + '` should remove ' + parts + ' `chars`', function(assert) {
-      assert.expect(1);
-
-      var string = '-_-a-b-c-_-',
-          expected = (index == 2 ? '-_-' : '') + 'a-b-c' + (index == 1 ? '-_-' : '');
-
-      assert.strictEqual(func('_-')(string), expected);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.uniqBy');
-
-  (function() {
-    var objects = [{ 'a': 2 }, { 'a': 3 }, { 'a': 1 }, { 'a': 2 }, { 'a': 3 }, { 'a': 1 }];
-
-    QUnit.test('should work with an `iteratee` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = objects.slice(0, 3);
-
-      var actual = fp.uniqBy(function(object) {
-        return object.a;
-      })(objects);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      fp.uniqBy(function() {
-        args || (args = slice.call(arguments));
-      })(objects);
-
-      assert.deepEqual(args, [objects[0]]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.zip');
-
-  (function() {
-    QUnit.test('should zip together two arrays', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(fp.zip([1, 2])([3, 4]), [[1, 3], [2, 4]]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.zipObject');
-
-  (function() {
-    QUnit.test('should zip together key/value arrays into an object', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(fp.zipObject(['a', 'b'])([1, 2]), { 'a': 1, 'b': 2 });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('fp.zipWith');
-
-  (function() {
-    QUnit.test('should zip arrays combining grouped elements with `iteratee`', function(assert) {
-      assert.expect(1);
-
-      var array1 = [1, 2, 3],
-          array2 = [4, 5, 6];
-
-      var actual = fp.zipWith(function(a, b) {
-        return a + b;
-      })(array1)(array2);
-
-      assert.deepEqual(actual, [5, 7, 9]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.config.asyncRetries = 10;
-  QUnit.config.hidepassed = true;
-
-  if (!document) {
-    QUnit.config.noglobals = true;
-    QUnit.load();
-  }
-}.call(this));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/test.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/test/test.js
deleted file mode 100644
index 0df49ab..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/test.js
+++ /dev/null
@@ -1,26225 +0,0 @@
-;(function() {
-
-  /** Used as a safe reference for `undefined` in pre-ES5 environments. */
-  var undefined;
-
-  /** Used to detect when a function becomes hot. */
-  var HOT_COUNT = 150;
-
-  /** Used as the size to cover large array optimizations. */
-  var LARGE_ARRAY_SIZE = 200;
-
-  /** Used as the `TypeError` message for "Functions" methods. */
-  var FUNC_ERROR_TEXT = 'Expected a function';
-
-  /** Used as references for various `Number` constants. */
-  var MAX_SAFE_INTEGER = 9007199254740991,
-      MAX_INTEGER = 1.7976931348623157e+308;
-
-  /** Used as references for the maximum length and index of an array. */
-  var MAX_ARRAY_LENGTH = 4294967295,
-      MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
-
-  /** `Object#toString` result references. */
-  var funcTag = '[object Function]',
-      numberTag = '[object Number]',
-      objectTag = '[object Object]';
-
-  /** Used as a reference to the global object. */
-  var root = (typeof global == 'object' && global) || this;
-
-  /** Used to store lodash to test for bad extensions/shims. */
-  var lodashBizarro = root.lodashBizarro;
-
-  /** Used for native method references. */
-  var arrayProto = Array.prototype,
-      funcProto = Function.prototype,
-      objectProto = Object.prototype,
-      numberProto = Number.prototype,
-      stringProto = String.prototype;
-
-  /** Method and object shortcuts. */
-  var phantom = root.phantom,
-      process = root.process,
-      amd = root.define && define.amd,
-      argv = process && process.argv,
-      defineProperty = Object.defineProperty,
-      document = !phantom && root.document,
-      body = root.document && root.document.body,
-      create = Object.create,
-      fnToString = funcProto.toString,
-      freeze = Object.freeze,
-      getSymbols = Object.getOwnPropertySymbols,
-      identity = function(value) { return value; },
-      JSON = root.JSON,
-      noop = function() {},
-      objToString = objectProto.toString,
-      params = argv,
-      push = arrayProto.push,
-      realm = {},
-      slice = arrayProto.slice;
-
-  var ArrayBuffer = root.ArrayBuffer,
-      Buffer = root.Buffer,
-      Promise = root.Promise,
-      Map = root.Map,
-      Set = root.Set,
-      Symbol = root.Symbol,
-      Uint8Array = root.Uint8Array,
-      WeakMap = root.WeakMap,
-      WeakSet = root.WeakSet;
-
-  var arrayBuffer = ArrayBuffer ? new ArrayBuffer(2) : undefined,
-      map = Map ? new Map : undefined,
-      promise = Promise ? Promise.resolve(1) : undefined,
-      set = Set ? new Set : undefined,
-      symbol = Symbol ? Symbol('a') : undefined,
-      weakMap = WeakMap ? new WeakMap : undefined,
-      weakSet = WeakSet ? new WeakSet : undefined;
-
-  /** Math helpers. */
-  var add = function(x, y) { return x + y; },
-      doubled = function(n) { return n * 2; },
-      isEven = function(n) { return n % 2 == 0; },
-      square = function(n) { return n * n; };
-
-  /** Constant functions. */
-  var alwaysA = function() { return 'a'; },
-      alwaysB = function() { return 'b'; },
-      alwaysC = function() { return 'c'; };
-
-  var alwaysTrue = function() { return true; },
-      alwaysFalse = function() { return false; };
-
-  var alwaysNaN = function() { return NaN; },
-      alwaysNull = function() { return null; };
-
-  var alwaysZero = function() { return 0; },
-      alwaysOne = function() { return 1; },
-      alwaysTwo = function() { return 2; },
-      alwaysThree = function() { return 3; },
-      alwaysFour = function() { return 4; };
-
-  var alwaysEmptyArray = function() { return []; },
-      alwaysEmptyObject = function() { return {}; },
-      alwaysEmptyString = function() { return ''; };
-
-  /** List of latin-1 supplementary letters to basic latin letters. */
-  var burredLetters = [
-    '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7', '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce',
-    '\xcf', '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd8', '\xd9', '\xda', '\xdb', '\xdc', '\xdd', '\xde',
-    '\xdf', '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee',
-    '\xef', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff'
-  ];
-
-  /** List of combining diacritical marks. */
-  var comboMarks = [
-    '\u0300', '\u0301', '\u0302', '\u0303', '\u0304', '\u0305', '\u0306', '\u0307', '\u0308', '\u0309', '\u030a', '\u030b', '\u030c', '\u030d', '\u030e', '\u030f',
-    '\u0310', '\u0311', '\u0312', '\u0313', '\u0314', '\u0315', '\u0316', '\u0317', '\u0318', '\u0319', '\u031a', '\u031b', '\u031c', '\u031d', '\u031e', '\u031f',
-    '\u0320', '\u0321', '\u0322', '\u0323', '\u0324', '\u0325', '\u0326', '\u0327', '\u0328', '\u0329', '\u032a', '\u032b', '\u032c', '\u032d', '\u032e', '\u032f',
-    '\u0330', '\u0331', '\u0332', '\u0333', '\u0334', '\u0335', '\u0336', '\u0337', '\u0338', '\u0339', '\u033a', '\u033b', '\u033c', '\u033d', '\u033e', '\u033f',
-    '\u0340', '\u0341', '\u0342', '\u0343', '\u0344', '\u0345', '\u0346', '\u0347', '\u0348', '\u0349', '\u034a', '\u034b', '\u034c', '\u034d', '\u034e', '\u034f',
-    '\u0350', '\u0351', '\u0352', '\u0353', '\u0354', '\u0355', '\u0356', '\u0357', '\u0358', '\u0359', '\u035a', '\u035b', '\u035c', '\u035d', '\u035e', '\u035f',
-    '\u0360', '\u0361', '\u0362', '\u0363', '\u0364', '\u0365', '\u0366', '\u0367', '\u0368', '\u0369', '\u036a', '\u036b', '\u036c', '\u036d', '\u036e', '\u036f',
-    '\ufe20', '\ufe21', '\ufe22', '\ufe23'
-  ];
-
-  /** List of `burredLetters` translated to basic latin letters. */
-  var deburredLetters = [
-    'A',  'A', 'A', 'A', 'A', 'A', 'Ae', 'C',  'E', 'E', 'E', 'E', 'I', 'I', 'I',
-    'I',  'D', 'N', 'O', 'O', 'O', 'O',  'O',  'O', 'U', 'U', 'U', 'U', 'Y', 'Th',
-    'ss', 'a', 'a', 'a', 'a', 'a', 'a',  'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i',  'i',
-    'i',  'd', 'n', 'o', 'o', 'o', 'o',  'o',  'o', 'u', 'u', 'u', 'u', 'y', 'th', 'y'
-  ];
-
-  /** Used to provide falsey values to methods. */
-  var falsey = [, null, undefined, false, 0, NaN, ''];
-
-  /** Used to specify the emoji style glyph variant of characters. */
-  var emojiVar = '\ufe0f';
-
-  /** Used to provide empty values to methods. */
-  var empties = [[], {}].concat(falsey.slice(1));
-
-  /** Used to test error objects. */
-  var errors = [
-    new Error,
-    new EvalError,
-    new RangeError,
-    new ReferenceError,
-    new SyntaxError,
-    new TypeError,
-    new URIError
-  ];
-
-  /** List of fitzpatrick modifiers. */
-  var fitzModifiers = [
-    '\ud83c\udffb',
-    '\ud83c\udffc',
-    '\ud83c\udffd',
-    '\ud83c\udffe',
-    '\ud83c\udfff'
-  ];
-
-  /** Used to provide primitive values to methods. */
-  var primitives = [null, undefined, false, true, 1, NaN, 'a'];
-
-  /** Used to check whether methods support typed arrays. */
-  var typedArrays = [
-    'Float32Array',
-    'Float64Array',
-    'Int8Array',
-    'Int16Array',
-    'Int32Array',
-    'Uint8Array',
-    'Uint8ClampedArray',
-    'Uint16Array',
-    'Uint32Array'
-  ];
-
-  /** Used to check whether methods support array views. */
-  var arrayViews = typedArrays.concat('DataView');
-
-  /** The file path of the lodash file to test. */
-  var filePath = (function() {
-    var min = 2,
-        result = params || [];
-
-    if (phantom) {
-      min = 0;
-      result = params = phantom.args || require('system').args;
-    }
-    var last = result[result.length - 1];
-    result = (result.length > min && !/test(?:\.js)?$/.test(last)) ? last : '../lodash.js';
-
-    if (!amd) {
-      try {
-        result = require('fs').realpathSync(result);
-      } catch (e) {}
-
-      try {
-        result = require.resolve(result);
-      } catch (e) {}
-    }
-    return result;
-  }());
-
-  /** The `ui` object. */
-  var ui = root.ui || (root.ui = {
-    'buildPath': filePath,
-    'loaderPath': '',
-    'isModularize': /\b(?:amd|commonjs|es|node|npm|(index|main)\.js)\b/.test(filePath),
-    'isStrict': /\bes\b/.test(filePath),
-    'urlParams': {}
-  });
-
-  /** The basename of the lodash file to test. */
-  var basename = /[\w.-]+$/.exec(filePath)[0];
-
-  /** Used to indicate testing a modularized build. */
-  var isModularize = ui.isModularize;
-
-  /** Detect if testing `npm` modules. */
-  var isNpm = isModularize && /\bnpm\b/.test([ui.buildPath, ui.urlParams.build]);
-
-  /** Detect if running in PhantomJS. */
-  var isPhantom = phantom || (typeof callPhantom == 'function');
-
-  /** Detect if lodash is in strict mode. */
-  var isStrict = ui.isStrict;
-
-  /*--------------------------------------------------------------------------*/
-
-  // Leak to avoid sporadic `noglobals` fails on Edge in Sauce Labs.
-  root.msWDfn = undefined;
-
-  // Exit early if going to run tests in a PhantomJS web page.
-  if (phantom && isModularize) {
-    var page = require('webpage').create();
-
-    page.onCallback = function(details) {
-      var coverage = details.coverage;
-      if (coverage) {
-        var fs = require('fs'),
-            cwd = fs.workingDirectory,
-            sep = fs.separator;
-
-        fs.write([cwd, 'coverage', 'coverage.json'].join(sep), JSON.stringify(coverage));
-      }
-      phantom.exit(details.failed ? 1 : 0);
-    };
-
-    page.onConsoleMessage = function(message) {
-      console.log(message);
-    };
-
-    page.onInitialized = function() {
-      page.evaluate(function() {
-        document.addEventListener('DOMContentLoaded', function() {
-          QUnit.done(function(details) {
-            details.coverage = window.__coverage__;
-            callPhantom(details);
-          });
-        });
-      });
-    };
-
-    page.open(filePath, function(status) {
-      if (status != 'success') {
-        console.log('PhantomJS failed to load page: ' + filePath);
-        phantom.exit(1);
-      }
-    });
-
-    console.log('test.js invoked with arguments: ' + JSON.stringify(slice.call(params)));
-    return;
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  /** Used to test Web Workers. */
-  var Worker = !(ui.isForeign || ui.isSauceLabs || isModularize) &&
-    (document && document.origin != 'null') && root.Worker;
-
-  /** Used to test host objects in IE. */
-  try {
-    var xml = new ActiveXObject('Microsoft.XMLDOM');
-  } catch (e) {}
-
-  /** Poison the free variable `root` in Node.js */
-  try {
-    defineProperty(global.root, 'root', {
-      'configurable': false,
-      'enumerable': false,
-      'get': function() { throw new ReferenceError; }
-    });
-  } catch (e) {}
-
-  /** Use a single "load" function. */
-  var load = (!amd && typeof require == 'function')
-    ? require
-    : noop;
-
-  /** The unit testing framework. */
-  var QUnit = root.QUnit || (root.QUnit = load('../node_modules/qunitjs/qunit/qunit.js'));
-
-  /** Load stable Lodash and QUnit Extras. */
-  var lodashStable = root.lodashStable;
-  if (!lodashStable) {
-    try {
-      lodashStable = load('../node_modules/lodash/lodash.js');
-    } catch (e) {
-      console.log('Error: The stable lodash dev dependency should be at least a version behind master branch.');
-      return;
-    }
-    lodashStable = lodashStable.noConflict();
-  }
-  lodashStable = lodashStable.runInContext(root);
-
-  var QUnitExtras = load('../node_modules/qunit-extras/qunit-extras.js');
-  if (QUnitExtras) {
-    QUnitExtras.runInContext(root);
-  }
-
-  /** The `lodash` function to test. */
-  var _ = root._ || (root._ = (
-    _ = load(filePath),
-    _ = _._ || (isStrict = ui.isStrict = isStrict || 'default' in _, _['default']) || _,
-    (_.runInContext ? _.runInContext(root) : _)
-  ));
-
-  /** Used to detect instrumented istanbul code coverage runs. */
-  var coverage = root.__coverage__ || root[lodashStable.findKey(root, function(value, key) {
-    return /^(?:\$\$cov_\d+\$\$)$/.test(key);
-  })];
-
-  /** Used to test generator functions. */
-  var generator = lodashStable.attempt(function() {
-    return Function('return function*(){}');
-  });
-
-  /** Used to restore the `_` reference. */
-  var oldDash = root._;
-
-  /**
-   * Used to check for problems removing whitespace. For a whitespace reference,
-   * see [V8's unit test](https://code.google.com/p/v8/source/browse/branches/bleeding_edge/test/mjsunit/whitespaces.js).
-   */
-  var whitespace = lodashStable.filter([
-    // Basic whitespace characters.
-    ' ', '\t', '\x0b', '\f', '\xa0', '\ufeff',
-
-    // Line terminators.
-    '\n', '\r', '\u2028', '\u2029',
-
-    // Unicode category "Zs" space separators.
-    '\u1680', '\u180e', '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005',
-    '\u2006', '\u2007', '\u2008', '\u2009', '\u200a', '\u202f', '\u205f', '\u3000'
-  ],
-  function(chr) { return /\s/.exec(chr); })
-  .join('');
-
-  /**
-   * Creates a custom error object.
-   *
-   * @private
-   * @constructor
-   * @param {string} message The error message.
-   */
-  function CustomError(message) {
-    this.name = 'CustomError';
-    this.message = message;
-  }
-
-  CustomError.prototype = lodashStable.create(Error.prototype, {
-    'constructor': CustomError
-  });
-
-  /**
-   * Removes all own enumerable string keyed properties from a given object.
-   *
-   * @private
-   * @param {Object} object The object to empty.
-   */
-  function emptyObject(object) {
-    lodashStable.forOwn(object, function(value, key, object) {
-      delete object[key];
-    });
-  }
-
-  /**
-   * Extracts the unwrapped value from its wrapper.
-   *
-   * @private
-   * @param {Object} wrapper The wrapper to unwrap.
-   * @returns {*} Returns the unwrapped value.
-   */
-  function getUnwrappedValue(wrapper) {
-    var index = -1,
-        actions = wrapper.__actions__,
-        length = actions.length,
-        result = wrapper.__wrapped__;
-
-    while (++index < length) {
-      var args = [result],
-          action = actions[index];
-
-      push.apply(args, action.args);
-      result = action.func.apply(action.thisArg, args);
-    }
-    return result;
-  }
-
-  /**
-   * Sets a non-enumerable property value on `object`.
-   *
-   * Note: This function is used to avoid a bug in older versions of V8 where
-   * overwriting non-enumerable built-ins makes them enumerable.
-   * See https://code.google.com/p/v8/issues/detail?id=1623
-   *
-   * @private
-   * @param {Object} object The object modify.
-   * @param {string} key The name of the property to set.
-   * @param {*} value The property value.
-   */
-  function setProperty(object, key, value) {
-    try {
-      defineProperty(object, key, {
-        'configurable': true,
-        'enumerable': false,
-        'writable': true,
-        'value': value
-      });
-    } catch (e) {
-      object[key] = value;
-    }
-    return object;
-  }
-
-  /**
-   * Skips a given number of tests with a passing result.
-   *
-   * @private
-   * @param {Object} assert The QUnit assert object.
-   * @param {number} [count=1] The number of tests to skip.
-   */
-  function skipAssert(assert, count) {
-    count || (count = 1);
-    while (count--) {
-      assert.ok(true, 'test skipped');
-    }
-  }
-
-  /*--------------------------------------------------------------------------*/
-
-  // Add bizarro values.
-  (function() {
-    if (document || (typeof require != 'function')) {
-      return;
-    }
-    var nativeString = fnToString.call(toString),
-        reToString = /toString/g;
-
-    function createToString(funcName) {
-      return lodashStable.constant(nativeString.replace(reToString, funcName));
-    }
-
-    // Allow bypassing native checks.
-    setProperty(funcProto, 'toString', function wrapper() {
-      setProperty(funcProto, 'toString', fnToString);
-      var result = lodashStable.has(this, 'toString') ? this.toString() : fnToString.call(this);
-      setProperty(funcProto, 'toString', wrapper);
-      return result;
-    });
-
-    // Add prototype extensions.
-    funcProto._method = noop;
-
-    // Set bad shims.
-    setProperty(Object, 'create', (function() {
-      function object() {}
-      return function(prototype) {
-        if (lodashStable.isObject(prototype)) {
-          object.prototype = prototype;
-          var result = new object;
-          object.prototype = undefined;
-        }
-        return result || {};
-      };
-    }()));
-
-    setProperty(Object, 'getOwnPropertySymbols', undefined);
-
-    var _propertyIsEnumerable = objectProto.propertyIsEnumerable;
-    setProperty(objectProto, 'propertyIsEnumerable', function(key) {
-      return !(key == 'valueOf' && this && this.valueOf === 1) && _propertyIsEnumerable.call(this, key);
-    });
-
-    if (Buffer) {
-      defineProperty(root, 'Buffer', {
-        'configurable': true,
-        'enumerable': true,
-        'get': function get() {
-          var caller = get.caller,
-              name = caller ? caller.name : '';
-
-          if (!(name == 'runInContext' || name.length == 1 || /\b_\.isBuffer\b/.test(caller))) {
-            return Buffer;
-          }
-        }
-      });
-    }
-    if (Map) {
-      setProperty(root, 'Map', (function() {
-        var count = 0;
-        return function() {
-          if (count++) {
-            return new Map;
-          }
-          setProperty(root, 'Map', Map);
-          return {};
-        };
-      }()));
-
-      setProperty(root.Map, 'toString', createToString('Map'));
-    }
-    setProperty(root, 'Promise', noop);
-    setProperty(root, 'Set', noop);
-    setProperty(root, 'Symbol', undefined);
-    setProperty(root, 'WeakMap', noop);
-
-    // Fake `WinRTError`.
-    setProperty(root, 'WinRTError', Error);
-
-    // Clear cache so lodash can be reloaded.
-    emptyObject(require.cache);
-
-    // Load lodash and expose it to the bad extensions/shims.
-    lodashBizarro = (lodashBizarro = require(filePath))._ || lodashBizarro['default'] || lodashBizarro;
-    root._ = oldDash;
-
-    // Restore built-in methods.
-    setProperty(Object, 'create', create);
-    setProperty(objectProto, 'propertyIsEnumerable', _propertyIsEnumerable);
-    setProperty(root, 'Buffer', Buffer);
-
-    if (getSymbols) {
-      Object.getOwnPropertySymbols = getSymbols;
-    } else {
-      delete Object.getOwnPropertySymbols;
-    }
-    if (Map) {
-      setProperty(root, 'Map', Map);
-    } else {
-      delete root.Map;
-    }
-    if (Promise) {
-      setProperty(root, 'Promise', Promise);
-    } else {
-      delete root.Promise;
-    }
-    if (Set) {
-      setProperty(root, 'Set', Set);
-    } else {
-      delete root.Set;
-    }
-    if (Symbol) {
-      setProperty(root, 'Symbol', Symbol);
-    } else {
-      delete root.Symbol;
-    }
-    if (WeakMap) {
-      setProperty(root, 'WeakMap', WeakMap);
-    } else {
-      delete root.WeakMap;
-    }
-    delete root.WinRTError;
-    delete funcProto._method;
-  }());
-
-  // Add other realm values from the `vm` module.
-  lodashStable.attempt(function() {
-    lodashStable.assign(realm, require('vm').runInNewContext([
-      '(function() {',
-      '  var noop = function() {},',
-      '      root = this;',
-      '',
-      '  var object = {',
-      "    'ArrayBuffer': root.ArrayBuffer,",
-      "    'arguments': (function() { return arguments; }(1, 2, 3)),",
-      "    'array': [1],",
-      "    'arrayBuffer': root.ArrayBuffer ? new root.ArrayBuffer : undefined,",
-      "    'boolean': Object(false),",
-      "    'date': new Date,",
-      "    'errors': [new Error, new EvalError, new RangeError, new ReferenceError, new SyntaxError, new TypeError, new URIError],",
-      "    'function': noop,",
-      "    'map': root.Map ? new root.Map : undefined,",
-      "    'nan': NaN,",
-      "    'null': null,",
-      "    'number': Object(0),",
-      "    'object': { 'a': 1 },",
-      "    'promise': root.Promise ? Promise.resolve(1) : undefined,",
-      "    'regexp': /x/,",
-      "    'set': root.Set ? new root.Set : undefined,",
-      "    'string': Object('a'),",
-      "    'symbol': root.Symbol ? root.Symbol() : undefined,",
-      "    'undefined': undefined,",
-      "    'weakMap': root.WeakMap ? new root.WeakMap : undefined,",
-      "    'weakSet': root.WeakSet ? new root.WeakSet : undefined",
-      '  };',
-      '',
-      "  ['" + arrayViews.join("', '") + "'].forEach(function(type) {",
-      '    var Ctor = root[type]',
-      '    object[type] = Ctor;',
-      '    object[type.toLowerCase()] = Ctor ? new Ctor(new ArrayBuffer(24)) : undefined;',
-      '  });',
-      '',
-      '  return object;',
-      '}())'
-    ].join('\n')));
-  });
-
-  // Add other realm values from an iframe.
-  lodashStable.attempt(function() {
-    _._realm = realm;
-
-    var iframe = document.createElement('iframe');
-    iframe.frameBorder = iframe.height = iframe.width = 0;
-    body.appendChild(iframe);
-
-    var idoc = (idoc = iframe.contentDocument || iframe.contentWindow).document || idoc;
-    idoc.write([
-      '<script>',
-      'var _ = parent._;',
-      '',
-      '  var noop = function() {},',
-      '      root = this;',
-      '',
-      'var object = {',
-      "  'ArrayBuffer': root.ArrayBuffer,",
-      "  'arguments': (function() { return arguments; }(1, 2, 3)),",
-      "  'array': [1],",
-      "  'arrayBuffer': root.ArrayBuffer ? new root.ArrayBuffer : undefined,",
-      "  'boolean': Object(false),",
-      "  'date': new Date,",
-      "  'errors': [new Error, new EvalError, new RangeError, new ReferenceError, new SyntaxError, new TypeError, new URIError],",
-      "  'function': noop,",
-      "  'map': root.Map ? new root.Map : undefined,",
-      "  'nan': NaN,",
-      "  'null': null,",
-      "  'number': Object(0),",
-      "  'object': { 'a': 1 },",
-      "  'promise': root.Promise ? Promise.resolve(1) : undefined,",
-      "  'regexp': /x/,",
-      "  'set': root.Set ? new root.Set : undefined,",
-      "  'string': Object('a'),",
-      "  'symbol': root.Symbol ? root.Symbol() : undefined,",
-      "  'undefined': undefined,",
-      "  'weakMap': root.WeakMap ? new root.WeakMap : undefined,",
-      "  'weakSet': root.WeakSet ? new root.WeakSet : undefined",
-      '};',
-      '',
-      "_.each(['" + arrayViews.join("', '") + "'], function(type) {",
-      '  var Ctor = root[type];',
-      '  object[type] = Ctor;',
-      '  object[type.toLowerCase()] = Ctor ? new Ctor(new ArrayBuffer(24)) : undefined;',
-      '});',
-      '',
-      '_.assign(_._realm, object);',
-      '<\/script>'
-    ].join('\n'));
-
-    idoc.close();
-    delete _._realm;
-  });
-
-  // Add a web worker.
-  lodashStable.attempt(function() {
-    var worker = new Worker('./asset/worker.js?t=' + (+new Date));
-    worker.addEventListener('message', function(e) {
-      _._VERSION = e.data || '';
-    }, false);
-
-    worker.postMessage(ui.buildPath);
-  });
-
-  // Expose internal modules for better code coverage.
-  lodashStable.attempt(function() {
-    var path = require('path'),
-        basePath = path.dirname(filePath);
-
-    if (isModularize && !(amd || isNpm)) {
-      lodashStable.each([
-        '_baseEach',
-        '_isIndex',
-        '_isIterateeCall'
-      ], function(relPath) {
-        var func = require(path.join(basePath, relPath)),
-            funcName = path.basename(relPath);
-
-        _['_' + funcName] = func[funcName] || func['default'] || func;
-      });
-    }
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  if (params) {
-    console.log('Running lodash tests.');
-    console.log('test.js invoked with arguments: ' + JSON.stringify(slice.call(params)));
-  }
-
-  QUnit.module(basename);
-
-  (function() {
-    QUnit.test('should support loading ' + basename + ' as the "lodash" module', function(assert) {
-      assert.expect(1);
-
-      if (amd) {
-        assert.strictEqual((lodashModule || {}).moduleName, 'lodash');
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should support loading ' + basename + ' with the Require.js "shim" configuration option', function(assert) {
-      assert.expect(1);
-
-      if (amd && lodashStable.includes(ui.loaderPath, 'requirejs')) {
-        assert.strictEqual((shimmedModule || {}).moduleName, 'shimmed');
-      } else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should support loading ' + basename + ' as the "underscore" module', function(assert) {
-      assert.expect(1);
-
-      if (amd) {
-        assert.strictEqual((underscoreModule || {}).moduleName, 'underscore');
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should support loading ' + basename + ' in a web worker', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      if (Worker) {
-        var limit = 30000 / QUnit.config.asyncRetries,
-            start = +new Date;
-
-        var attempt = function() {
-          var actual = _._VERSION;
-          if ((new Date - start) < limit && typeof actual != 'string') {
-            setTimeout(attempt, 16);
-            return;
-          }
-          assert.strictEqual(actual, _.VERSION);
-          done();
-        };
-
-        attempt();
-      }
-      else {
-        skipAssert(assert);
-        done();
-      }
-    });
-
-    QUnit.test('should not add `Function.prototype` extensions to lodash', function(assert) {
-      assert.expect(1);
-
-      if (lodashBizarro) {
-        assert.notOk('_method' in lodashBizarro);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should avoid non-native built-ins', function(assert) {
-      assert.expect(7);
-
-      function message(lodashMethod, nativeMethod) {
-        return '`' + lodashMethod + '` should avoid overwritten native `' + nativeMethod + '`';
-      }
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var object = { 'a': 1 },
-          otherObject = { 'b': 2 },
-          largeArray = lodashStable.times(LARGE_ARRAY_SIZE, lodashStable.constant(object));
-
-      if (lodashBizarro) {
-        try {
-          var actual = lodashBizarro.keysIn(new Foo).sort();
-        } catch (e) {
-          actual = null;
-        }
-        var label = message('_.keysIn', 'Object#propertyIsEnumerable');
-        assert.deepEqual(actual, ['a', 'b'], label);
-
-        try {
-          var actual = lodashBizarro.isEmpty({});
-        } catch (e) {
-          actual = null;
-        }
-        var label = message('_.isEmpty', 'Object#propertyIsEnumerable');
-        assert.strictEqual(actual, true, label);
-
-        try {
-          actual = [
-            lodashBizarro.difference([object, otherObject], largeArray),
-            lodashBizarro.intersection(largeArray, [object]),
-            lodashBizarro.uniq(largeArray)
-          ];
-        } catch (e) {
-          actual = null;
-        }
-        label = message('_.difference`, `_.intersection`, and `_.uniq', 'Object.create` and `Map');
-        assert.deepEqual(actual, [[otherObject], [object], [object]], label);
-
-        try {
-          if (Symbol) {
-            object[symbol] = {};
-          }
-          actual = [
-            lodashBizarro.clone(object),
-            lodashBizarro.cloneDeep(object)
-          ];
-        } catch (e) {
-          actual = null;
-        }
-        label = message('_.clone` and `_.cloneDeep', 'Object.getOwnPropertySymbols');
-        assert.deepEqual(actual, [object, object], label);
-
-        try {
-          var symObject = Object(symbol);
-
-          // Avoid symbol detection in Babel's `typeof` helper.
-          symObject.constructor = Object;
-
-          actual = [
-            Symbol ? lodashBizarro.clone(symObject) : { 'constructor': Object },
-            Symbol ? lodashBizarro.isEqual(symObject, Object(symbol)) : false,
-            Symbol ? lodashBizarro.toString(symObject) : ''
-          ];
-        } catch (e) {
-          actual = null;
-        }
-        label = message('_.clone`, `_.isEqual`, and `_.toString', 'Symbol');
-        assert.deepEqual(actual, [{ 'constructor': Object }, false, ''], label);
-
-        try {
-          var map = new lodashBizarro.memoize.Cache;
-          actual = map.set('a', 1).get('a');
-        } catch (e) {
-          actual = null;
-        }
-        label = message('_.memoize.Cache', 'Map');
-        assert.deepEqual(actual, 1, label);
-
-        try {
-          map = new (Map || Object);
-          if (Symbol && Symbol.iterator) {
-            map[Symbol.iterator] = null;
-          }
-          actual = lodashBizarro.toArray(map);
-        } catch (e) {
-          actual = null;
-        }
-        label = message('_.toArray', 'Map');
-        assert.deepEqual(actual, [], label);
-      }
-      else {
-        skipAssert(assert, 7);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('isIndex');
-
-  (function() {
-    var func = _._isIndex;
-
-    QUnit.test('should return `true` for indexes', function(assert) {
-      assert.expect(1);
-
-      if (func) {
-        var values = [[0], ['0'], ['1'], [3, 4], [MAX_SAFE_INTEGER - 1]],
-            expected = lodashStable.map(values, alwaysTrue);
-
-        var actual = lodashStable.map(values, function(args) {
-          return func.apply(undefined, args);
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for non-indexes', function(assert) {
-      assert.expect(1);
-
-      if (func) {
-        var values = [['1abc'], ['07'], ['0001'], [-1], [3, 3], [1.1], [MAX_SAFE_INTEGER]],
-            expected = lodashStable.map(values, alwaysFalse);
-
-        var actual = lodashStable.map(values, function(args) {
-          return func.apply(undefined, args);
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('isIterateeCall');
-
-  (function() {
-    var array = [1],
-        func = _._isIterateeCall,
-        object =  { 'a': 1 };
-
-    QUnit.test('should return `true` for iteratee calls', function(assert) {
-      assert.expect(3);
-
-      function Foo() {}
-      Foo.prototype.a = 1;
-
-      if (func) {
-        assert.strictEqual(func(1, 0, array), true);
-        assert.strictEqual(func(1, 'a', object), true);
-        assert.strictEqual(func(1, 'a', new Foo), true);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should return `false` for non-iteratee calls', function(assert) {
-      assert.expect(4);
-
-      if (func) {
-        assert.strictEqual(func(2, 0, array), false);
-        assert.strictEqual(func(1, 1.1, array), false);
-        assert.strictEqual(func(1, 0, { 'length': MAX_SAFE_INTEGER + 1 }), false);
-        assert.strictEqual(func(1, 'b', object), false);
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should work with `NaN` values', function(assert) {
-      assert.expect(2);
-
-      if (func) {
-        assert.strictEqual(func(NaN, 0, [NaN]), true);
-        assert.strictEqual(func(NaN, 'a', { 'a': NaN }), true);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should not error when `index` is an object without a `toString` method', function(assert) {
-      assert.expect(1);
-
-      if (func) {
-        try {
-          var actual = func(1, { 'toString': null }, [1]);
-        } catch (e) {
-          var message = e.message;
-        }
-        assert.strictEqual(actual, false, message || '');
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash constructor');
-
-  (function() {
-    var values = empties.concat(true, 1, 'a'),
-        expected = lodashStable.map(values, alwaysTrue);
-
-    QUnit.test('should create a new instance when called without the `new` operator', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var actual = lodashStable.map(values, function(value) {
-          return _(value) instanceof _;
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return the given `lodash` instances', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var actual = lodashStable.map(values, function(value) {
-          var wrapped = _(value);
-          return _(wrapped) === wrapped;
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should convert foreign wrapped values to `lodash` instances', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm && lodashBizarro) {
-        var actual = lodashStable.map(values, function(value) {
-          var wrapped = _(lodashBizarro(value)),
-              unwrapped = wrapped.value();
-
-          return wrapped instanceof _ &&
-            ((unwrapped === value) || (unwrapped !== unwrapped && value !== value));
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.add');
-
-  (function() {
-    QUnit.test('should add two numbers', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.add(6, 4), 10);
-      assert.strictEqual(_.add(-6, 4), -2);
-      assert.strictEqual(_.add(-6, -4), -10);
-    });
-
-    QUnit.test('should not coerce arguments to numbers', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.add('6', '4'), '64');
-      assert.strictEqual(_.add('x', 'y'), 'xy');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.after');
-
-  (function() {
-    function after(n, times) {
-      var count = 0;
-      lodashStable.times(times, _.after(n, function() { count++; }));
-      return count;
-    }
-
-    QUnit.test('should create a function that invokes `func` after `n` calls', function(assert) {
-      assert.expect(4);
-
-      assert.strictEqual(after(5, 5), 1, 'after(n) should invoke `func` after being called `n` times');
-      assert.strictEqual(after(5, 4), 0, 'after(n) should not invoke `func` before being called `n` times');
-      assert.strictEqual(after(0, 0), 0, 'after(0) should not invoke `func` immediately');
-      assert.strictEqual(after(0, 1), 1, 'after(0) should invoke `func` when called once');
-    });
-
-    QUnit.test('should coerce `n` values of `NaN` to `0`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(after(NaN, 1), 1);
-    });
-
-    QUnit.test('should not set a `this` binding', function(assert) {
-      assert.expect(2);
-
-      var after = _.after(1, function(assert) { return ++this.count; }),
-          object = { 'after': after, 'count': 0 };
-
-      object.after();
-      assert.strictEqual(object.after(), 2);
-      assert.strictEqual(object.count, 2);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.ary');
-
-  (function() {
-    function fn(a, b, c) {
-      return slice.call(arguments);
-    }
-
-    QUnit.test('should cap the number of arguments provided to `func`', function(assert) {
-      assert.expect(2);
-
-      var actual = lodashStable.map(['6', '8', '10'], _.ary(parseInt, 1));
-      assert.deepEqual(actual, [6, 8, 10]);
-
-      var capped = _.ary(fn, 2);
-      assert.deepEqual(capped('a', 'b', 'c', 'd'), ['a', 'b']);
-    });
-
-    QUnit.test('should use `func.length` if `n` is not given', function(assert) {
-      assert.expect(1);
-
-      var capped = _.ary(fn);
-      assert.deepEqual(capped('a', 'b', 'c', 'd'), ['a', 'b', 'c']);
-    });
-
-    QUnit.test('should treat a negative `n` as `0`', function(assert) {
-      assert.expect(1);
-
-      var capped = _.ary(fn, -1);
-
-      try {
-        var actual = capped('a');
-      } catch (e) {}
-
-      assert.deepEqual(actual, []);
-    });
-
-    QUnit.test('should coerce `n` to an integer', function(assert) {
-      assert.expect(1);
-
-      var values = ['1', 1.6, 'xyz'],
-          expected = [['a'], ['a'], []];
-
-      var actual = lodashStable.map(values, function(n) {
-        var capped = _.ary(fn, n);
-        return capped('a', 'b');
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work when given less than the capped number of arguments', function(assert) {
-      assert.expect(1);
-
-      var capped = _.ary(fn, 3);
-      assert.deepEqual(capped('a'), ['a']);
-    });
-
-    QUnit.test('should use the existing `ary` if smaller', function(assert) {
-      assert.expect(1);
-
-      var capped = _.ary(_.ary(fn, 1), 2);
-      assert.deepEqual(capped('a', 'b', 'c'), ['a']);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var funcs = lodashStable.map([fn], _.ary),
-          actual = funcs[0]('a', 'b', 'c');
-
-      assert.deepEqual(actual, ['a', 'b', 'c']);
-    });
-
-    QUnit.test('should work when combined with other methods that use metadata', function(assert) {
-      assert.expect(2);
-
-      var array = ['a', 'b', 'c'],
-          includes = _.curry(_.rearg(_.ary(_.includes, 2), 1, 0), 2);
-
-      assert.strictEqual(includes('b')(array, 2), true);
-
-      if (!isNpm) {
-        includes = _(_.includes).ary(2).rearg(1, 0).curry(2).value();
-        assert.strictEqual(includes('b')(array, 2), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.assignIn');
-
-  (function() {
-    QUnit.test('should be aliased', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.extend, _.assignIn);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.assign and lodash.assignIn');
-
-  lodashStable.each(['assign', 'assignIn'], function(methodName) {
-    var func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should assign source properties to `object`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func({ 'a': 1 }, { 'b': 2 }), { 'a': 1, 'b': 2 });
-    });
-
-    QUnit.test('`_.' + methodName + '` should accept multiple sources', function(assert) {
-      assert.expect(2);
-
-      var expected = { 'a': 1, 'b': 2, 'c': 3 };
-      assert.deepEqual(func({ 'a': 1 }, { 'b': 2 }, { 'c': 3 }), expected);
-      assert.deepEqual(func({ 'a': 1 }, { 'b': 2, 'c': 2 }, { 'c': 3 }), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should overwrite destination properties', function(assert) {
-      assert.expect(1);
-
-      var expected = { 'a': 3, 'b': 2, 'c': 1 };
-      assert.deepEqual(func({ 'a': 1, 'b': 2 }, expected), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should assign source properties with nullish values', function(assert) {
-      assert.expect(1);
-
-      var expected = { 'a': null, 'b': undefined, 'c': null };
-      assert.deepEqual(func({ 'a': 1, 'b': 2 }, expected), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should skip assignments if values are the same', function(assert) {
-      assert.expect(1);
-
-      var object = {};
-
-      var descriptor = {
-        'configurable': true,
-        'enumerable': true,
-        'set': function() { throw new Error; }
-      };
-
-      var source = {
-        'a': 1,
-        'b': undefined,
-        'c': NaN,
-        'd': undefined,
-        'constructor': Object,
-        'toString': lodashStable.constant('source')
-      };
-
-      defineProperty(object, 'a', lodashStable.assign({}, descriptor, {
-        'get': alwaysOne
-      }));
-
-      defineProperty(object, 'b', lodashStable.assign({}, descriptor, {
-        'get': noop
-      }));
-
-      defineProperty(object, 'c', lodashStable.assign({}, descriptor, {
-        'get': alwaysNaN
-      }));
-
-      defineProperty(object, 'constructor', lodashStable.assign({}, descriptor, {
-        'get': lodashStable.constant(Object)
-      }));
-
-      try {
-        var actual = func(object, source);
-      } catch (e) {}
-
-      assert.deepEqual(actual, source);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat sparse array sources as dense', function(assert) {
-      assert.expect(1);
-
-      var array = [1];
-      array[2] = 3;
-
-      assert.deepEqual(func({}, array), { '0': 1, '1': undefined, '2': 3 });
-    });
-
-    QUnit.test('`_.' + methodName + '` should assign values of prototype objects', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.prototype.a = 1;
-
-      assert.deepEqual(func({}, Foo.prototype), { 'a': 1 });
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce string sources to objects', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func({}, 'a'), { '0': 'a' });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.assignInWith');
-
-  (function() {
-    QUnit.test('should be aliased', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.extendWith, _.assignInWith);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.assignWith and lodash.assignInWith');
-
-  lodashStable.each(['assignWith', 'assignInWith'], function(methodName) {
-    var func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should work with a `customizer` callback', function(assert) {
-      assert.expect(1);
-
-      var actual = func({ 'a': 1, 'b': 2 }, { 'a': 3, 'c': 3 }, function(a, b) {
-        return a === undefined ? b : a;
-      });
-
-      assert.deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3 });
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with a `customizer` that returns `undefined`', function(assert) {
-      assert.expect(1);
-
-      var expected = { 'a': undefined };
-      assert.deepEqual(func({}, expected, noop), expected);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.at');
-
-  (function() {
-    var args = arguments,
-        array = ['a', 'b', 'c'],
-        object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
-
-    QUnit.test('should return the elements corresponding to the specified keys', function(assert) {
-      assert.expect(1);
-
-      var actual = _.at(array, [0, 2]);
-      assert.deepEqual(actual, ['a', 'c']);
-    });
-
-    QUnit.test('should return `undefined` for nonexistent keys', function(assert) {
-      assert.expect(1);
-
-      var actual = _.at(array, [2, 4, 0]);
-      assert.deepEqual(actual, ['c', undefined, 'a']);
-    });
-
-    QUnit.test('should work with non-index keys on array values', function(assert) {
-      assert.expect(1);
-
-      var values = lodashStable.reject(empties, function(value) {
-        return (value === 0) || lodashStable.isArray(value);
-      }).concat(-1, 1.1);
-
-      var array = lodashStable.transform(values, function(result, value) {
-        result[value] = 1;
-      }, []);
-
-      var expected = lodashStable.map(values, alwaysOne),
-          actual = _.at(array, values);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return an empty array when no keys are given', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(_.at(array), []);
-      assert.deepEqual(_.at(array, [], []), []);
-    });
-
-    QUnit.test('should accept multiple key arguments', function(assert) {
-      assert.expect(1);
-
-      var actual = _.at(['a', 'b', 'c', 'd'], 3, 0, 2);
-      assert.deepEqual(actual, ['d', 'a', 'c']);
-    });
-
-    QUnit.test('should work with a falsey `object` argument when keys are given', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, lodashStable.constant(Array(4)));
-
-      var actual = lodashStable.map(falsey, function(object) {
-        try {
-          return _.at(object, 0, 1, 'pop', 'push');
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with an `arguments` object for `object`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.at(args, [2, 0]);
-      assert.deepEqual(actual, [3, 1]);
-    });
-
-    QUnit.test('should work with `arguments` object as secondary arguments', function(assert) {
-      assert.expect(1);
-
-      var actual = _.at([1, 2, 3, 4, 5], args);
-      assert.deepEqual(actual, [2, 3, 4]);
-    });
-
-    QUnit.test('should work with an object for `object`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.at(object, ['a[0].b.c', 'a[1]']);
-      assert.deepEqual(actual, [3, 4]);
-    });
-
-    QUnit.test('should pluck inherited property values', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var actual = _.at(new Foo, 'b');
-      assert.deepEqual(actual, [2]);
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(6);
-
-      if (!isNpm) {
-        var largeArray = lodashStable.range(LARGE_ARRAY_SIZE),
-            smallArray = array;
-
-        lodashStable.each([[2], ['2'], [2, 1]], function(paths) {
-          lodashStable.times(2, function(index) {
-            var array = index ? largeArray : smallArray,
-                wrapped = _(array).map(identity).at(paths);
-
-            assert.deepEqual(wrapped.value(), _.at(_.map(array, identity), paths));
-          });
-        });
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-
-    QUnit.test('should support shortcut fusion', function(assert) {
-      assert.expect(8);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE),
-            count = 0,
-            iteratee = function(value) { count++; return square(value); },
-            lastIndex = LARGE_ARRAY_SIZE - 1;
-
-        lodashStable.each([lastIndex, lastIndex + '', LARGE_ARRAY_SIZE, []], function(n, index) {
-          count = 0;
-          var actual = _(array).map(iteratee).at(n).value(),
-              expected = index < 2 ? 1 : 0;
-
-          assert.strictEqual(count, expected);
-
-          expected = index == 3 ? [] : [index == 2 ? undefined : square(lastIndex)];
-          assert.deepEqual(actual, expected);
-        });
-      }
-      else {
-        skipAssert(assert, 8);
-      }
-    });
-
-    QUnit.test('work with an object for `object` when chaining', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var paths = ['a[0].b.c', 'a[1]'],
-            actual = _(object).map(identity).at(paths).value();
-
-        assert.deepEqual(actual, _.at(_.map(object, identity), paths));
-
-        var indexObject = { '0': 1 };
-        actual = _(indexObject).at(0).value();
-        assert.deepEqual(actual, _.at(indexObject, 0));
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.attempt');
-
-  (function() {
-    QUnit.test('should return the result of `func`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.attempt(lodashStable.constant('x')), 'x');
-    });
-
-    QUnit.test('should provide additional arguments to `func`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.attempt(function() { return slice.call(arguments); }, 1, 2);
-      assert.deepEqual(actual, [1, 2]);
-    });
-
-    QUnit.test('should return the caught error', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(errors, alwaysTrue);
-
-      var actual = lodashStable.map(errors, function(error) {
-        return _.attempt(function() { throw error; }) === error;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should coerce errors to error objects', function(assert) {
-      assert.expect(1);
-
-      var actual = _.attempt(function() { throw 'x'; });
-      assert.ok(lodashStable.isEqual(actual, Error('x')));
-    });
-
-    QUnit.test('should preserve custom errors', function(assert) {
-      assert.expect(1);
-
-      var actual = _.attempt(function() { throw new CustomError('x'); });
-      assert.ok(actual instanceof CustomError);
-    });
-
-    QUnit.test('should work with an error object from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.errors) {
-        var expected = lodashStable.map(realm.errors, alwaysTrue);
-
-        var actual = lodashStable.map(realm.errors, function(error) {
-          return _.attempt(function() { throw error; }) === error;
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return an unwrapped value when implicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.strictEqual(_(lodashStable.constant('x')).attempt(), 'x');
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.ok(_(lodashStable.constant('x')).chain().attempt() instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.before');
-
-  (function() {
-    function before(n, times) {
-      var count = 0;
-      lodashStable.times(times, _.before(n, function() { count++; }));
-      return count;
-    }
-
-    QUnit.test('should create a function that invokes `func` after `n` calls', function(assert) {
-      assert.expect(4);
-
-      assert.strictEqual(before(5, 4), 4, 'before(n) should invoke `func` before being called `n` times');
-      assert.strictEqual(before(5, 6), 4, 'before(n) should not invoke `func` after being called `n - 1` times');
-      assert.strictEqual(before(0, 0), 0, 'before(0) should not invoke `func` immediately');
-      assert.strictEqual(before(0, 1), 0, 'before(0) should not invoke `func` when called');
-    });
-
-    QUnit.test('should coerce `n` values of `NaN` to `0`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(before(NaN, 1), 0);
-    });
-
-    QUnit.test('should not set a `this` binding', function(assert) {
-      assert.expect(2);
-
-      var before = _.before(2, function(assert) { return ++this.count; }),
-          object = { 'before': before, 'count': 0 };
-
-      object.before();
-      assert.strictEqual(object.before(), 1);
-      assert.strictEqual(object.count, 1);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.bind');
-
-  (function() {
-    function fn() {
-      var result = [this];
-      push.apply(result, arguments);
-      return result;
-    }
-
-    QUnit.test('should bind a function to an object', function(assert) {
-      assert.expect(1);
-
-      var object = {},
-          bound = _.bind(fn, object);
-
-      assert.deepEqual(bound('a'), [object, 'a']);
-    });
-
-    QUnit.test('should accept a falsey `thisArg` argument', function(assert) {
-      assert.expect(1);
-
-      var values = lodashStable.reject(falsey.slice(1), function(value) { return value == null; }),
-          expected = lodashStable.map(values, function(value) { return [value]; });
-
-      var actual = lodashStable.map(values, function(value) {
-        try {
-          var bound = _.bind(fn, value);
-          return bound();
-        } catch (e) {}
-      });
-
-      assert.ok(lodashStable.every(actual, function(value, index) {
-        return lodashStable.isEqual(value, expected[index]);
-      }));
-    });
-
-    QUnit.test('should bind a function to nullish values', function(assert) {
-      assert.expect(6);
-
-      var bound = _.bind(fn, null),
-          actual = bound('a');
-
-      assert.ok((actual[0] === null) || (actual[0] && actual[0].Array));
-      assert.strictEqual(actual[1], 'a');
-
-      lodashStable.times(2, function(index) {
-        bound = index ? _.bind(fn, undefined) : _.bind(fn);
-        actual = bound('b');
-
-        assert.ok((actual[0] === undefined) || (actual[0] && actual[0].Array));
-        assert.strictEqual(actual[1], 'b');
-      });
-    });
-
-    QUnit.test('should partially apply arguments ', function(assert) {
-      assert.expect(4);
-
-      var object = {},
-          bound = _.bind(fn, object, 'a');
-
-      assert.deepEqual(bound(), [object, 'a']);
-
-      bound = _.bind(fn, object, 'a');
-      assert.deepEqual(bound('b'), [object, 'a', 'b']);
-
-      bound = _.bind(fn, object, 'a', 'b');
-      assert.deepEqual(bound(), [object, 'a', 'b']);
-      assert.deepEqual(bound('c', 'd'), [object, 'a', 'b', 'c', 'd']);
-    });
-
-    QUnit.test('should support placeholders', function(assert) {
-      assert.expect(4);
-
-      var object = {},
-          ph = _.bind.placeholder,
-          bound = _.bind(fn, object, ph, 'b', ph);
-
-      assert.deepEqual(bound('a', 'c'), [object, 'a', 'b', 'c']);
-      assert.deepEqual(bound('a'), [object, 'a', 'b', undefined]);
-      assert.deepEqual(bound('a', 'c', 'd'), [object, 'a', 'b', 'c', 'd']);
-      assert.deepEqual(bound(), [object, undefined, 'b', undefined]);
-    });
-
-    QUnit.test('should use `_.placeholder` when set', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var _ph = _.placeholder = {},
-            ph = _.bind.placeholder,
-            object = {},
-            bound = _.bind(fn, object, _ph, 'b', ph);
-
-        assert.deepEqual(bound('a', 'c'), [object, 'a', 'b', ph, 'c']);
-        delete _.placeholder;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should create a function with a `length` of `0`', function(assert) {
-      assert.expect(2);
-
-      var fn = function(a, b, c) {},
-          bound = _.bind(fn, {});
-
-      assert.strictEqual(bound.length, 0);
-
-      bound = _.bind(fn, {}, 1);
-      assert.strictEqual(bound.length, 0);
-    });
-
-    QUnit.test('should ignore binding when called with the `new` operator', function(assert) {
-      assert.expect(3);
-
-      function Foo() {
-        return this;
-      }
-
-      var bound = _.bind(Foo, { 'a': 1 }),
-          newBound = new bound;
-
-      assert.strictEqual(bound().a, 1);
-      assert.strictEqual(newBound.a, undefined);
-      assert.ok(newBound instanceof Foo);
-    });
-
-    QUnit.test('should handle a number of arguments when called with the `new` operator', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        return this;
-      }
-
-      function Bar() {}
-
-      var thisArg = { 'a': 1 },
-          boundFoo = _.bind(Foo, thisArg),
-          boundBar = _.bind(Bar, thisArg),
-          count = 9,
-          expected = lodashStable.times(count, lodashStable.constant([undefined, undefined]));
-
-      var actual = lodashStable.times(count, function(index) {
-        try {
-          switch (index) {
-            case 0: return [new boundFoo().a, new boundBar().a];
-            case 1: return [new boundFoo(1).a, new boundBar(1).a];
-            case 2: return [new boundFoo(1, 2).a, new boundBar(1, 2).a];
-            case 3: return [new boundFoo(1, 2, 3).a, new boundBar(1, 2, 3).a];
-            case 4: return [new boundFoo(1, 2, 3, 4).a, new boundBar(1, 2, 3, 4).a];
-            case 5: return [new boundFoo(1, 2, 3, 4, 5).a, new boundBar(1, 2, 3, 4, 5).a];
-            case 6: return [new boundFoo(1, 2, 3, 4, 5, 6).a, new boundBar(1, 2, 3, 4, 5, 6).a];
-            case 7: return [new boundFoo(1, 2, 3, 4, 5, 6, 7).a, new boundBar(1, 2, 3, 4, 5, 6, 7).a];
-            case 8: return [new boundFoo(1, 2, 3, 4, 5, 6, 7, 8).a, new boundBar(1, 2, 3, 4, 5, 6, 7, 8).a];
-          }
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should ensure `new bound` is an instance of `func`', function(assert) {
-      assert.expect(2);
-
-      function Foo(value) {
-        return value && object;
-      }
-
-      var bound = _.bind(Foo),
-          object = {};
-
-      assert.ok(new bound instanceof Foo);
-      assert.strictEqual(new bound(true), object);
-    });
-
-    QUnit.test('should append array arguments to partially applied arguments', function(assert) {
-      assert.expect(1);
-
-      var object = {},
-          bound = _.bind(fn, object, 'a');
-
-      assert.deepEqual(bound(['b'], 'c'), [object, 'a', ['b'], 'c']);
-    });
-
-    QUnit.test('should not rebind functions', function(assert) {
-      assert.expect(3);
-
-      var object1 = {},
-          object2 = {},
-          object3 = {};
-
-      var bound1 = _.bind(fn, object1),
-          bound2 = _.bind(bound1, object2, 'a'),
-          bound3 = _.bind(bound1, object3, 'b');
-
-      assert.deepEqual(bound1(), [object1]);
-      assert.deepEqual(bound2(), [object1, 'a']);
-      assert.deepEqual(bound3(), [object1, 'b']);
-    });
-
-    QUnit.test('should not error when instantiating bound built-ins', function(assert) {
-      assert.expect(2);
-
-      var Ctor = _.bind(Date, null),
-          expected = new Date(2012, 4, 23, 0, 0, 0, 0);
-
-      try {
-        var actual = new Ctor(2012, 4, 23, 0, 0, 0, 0);
-      } catch (e) {}
-
-      assert.deepEqual(actual, expected);
-
-      Ctor = _.bind(Date, null, 2012, 4, 23);
-
-      try {
-        actual = new Ctor(0, 0, 0, 0);
-      } catch (e) {}
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should not error when calling bound class constructors with the `new` operator', function(assert) {
-      assert.expect(1);
-
-      var createCtor = lodashStable.attempt(Function, '"use strict";return class A{}');
-
-      if (typeof createCtor == 'function') {
-        var bound = _.bind(createCtor()),
-            count = 8,
-            expected = lodashStable.times(count, alwaysTrue);
-
-        var actual = lodashStable.times(count, function(index) {
-          try {
-            switch (index) {
-              case 0: return !!(new bound);
-              case 1: return !!(new bound(1));
-              case 2: return !!(new bound(1, 2));
-              case 3: return !!(new bound(1, 2, 3));
-              case 4: return !!(new bound(1, 2, 3, 4));
-              case 5: return !!(new bound(1, 2, 3, 4, 5));
-              case 6: return !!(new bound(1, 2, 3, 4, 5, 6));
-              case 7: return !!(new bound(1, 2, 3, 4, 5, 6, 7));
-            }
-          } catch (e) {}
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return a wrapped value when chaining', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var object = {},
-            bound = _(fn).bind({}, 'a', 'b');
-
-        assert.ok(bound instanceof _);
-
-        var actual = bound.value()('c');
-        assert.deepEqual(actual, [object, 'a', 'b', 'c']);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.bindAll');
-
-  (function() {
-    var args = arguments;
-
-    var source = {
-      '_n0': -2,
-      '_p0': -1,
-      '_a': 1,
-      '_b': 2,
-      '_c': 3,
-      '_d': 4,
-      '-0': function() { return this._n0; },
-      '0': function() { return this._p0; },
-      'a': function() { return this._a; },
-      'b': function() { return this._b; },
-      'c': function() { return this._c; },
-      'd': function() { return this._d; }
-    };
-
-    QUnit.test('should accept individual method names', function(assert) {
-      assert.expect(1);
-
-      var object = lodashStable.cloneDeep(source);
-      _.bindAll(object, 'a', 'b');
-
-      var actual = lodashStable.map(['a', 'b', 'c'], function(key) {
-        return object[key].call({});
-      });
-
-      assert.deepEqual(actual, [1, 2, undefined]);
-    });
-
-    QUnit.test('should accept arrays of method names', function(assert) {
-      assert.expect(1);
-
-      var object = lodashStable.cloneDeep(source);
-      _.bindAll(object, ['a', 'b'], ['c']);
-
-      var actual = lodashStable.map(['a', 'b', 'c', 'd'], function(key) {
-        return object[key].call({});
-      });
-
-      assert.deepEqual(actual, [1, 2, 3, undefined]);
-    });
-
-    QUnit.test('should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var props = [-0, Object(-0), 0, Object(0)];
-
-      var actual = lodashStable.map(props, function(key) {
-        var object = lodashStable.cloneDeep(source);
-        _.bindAll(object, key);
-        return object[lodashStable.toString(key)].call({});
-      });
-
-      assert.deepEqual(actual, [-2, -2, -1, -1]);
-    });
-
-    QUnit.test('should work with an array `object` argument', function(assert) {
-      assert.expect(1);
-
-      var array = ['push', 'pop'];
-      _.bindAll(array);
-      assert.strictEqual(array.pop, arrayProto.pop);
-    });
-
-    QUnit.test('should work with `arguments` objects as secondary arguments', function(assert) {
-      assert.expect(1);
-
-      var object = lodashStable.cloneDeep(source);
-      _.bindAll(object, args);
-
-      var actual = lodashStable.map(args, function(key) {
-        return object[key].call({});
-      });
-
-      assert.deepEqual(actual, [1]);
-    });
-  }('a'));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.bindKey');
-
-  (function() {
-    QUnit.test('should work when the target function is overwritten', function(assert) {
-      assert.expect(2);
-
-      var object = {
-        'user': 'fred',
-        'greet': function(greeting) {
-          return this.user + ' says: ' + greeting;
-        }
-      };
-
-      var bound = _.bindKey(object, 'greet', 'hi');
-      assert.strictEqual(bound(), 'fred says: hi');
-
-      object.greet = function(greeting) {
-        return this.user + ' says: ' + greeting + '!';
-      };
-
-      assert.strictEqual(bound(), 'fred says: hi!');
-    });
-
-    QUnit.test('should support placeholders', function(assert) {
-      assert.expect(4);
-
-      var object = {
-        'fn': function() {
-          return slice.call(arguments);
-        }
-      };
-
-      var ph = _.bindKey.placeholder,
-          bound = _.bindKey(object, 'fn', ph, 'b', ph);
-
-      assert.deepEqual(bound('a', 'c'), ['a', 'b', 'c']);
-      assert.deepEqual(bound('a'), ['a', 'b', undefined]);
-      assert.deepEqual(bound('a', 'c', 'd'), ['a', 'b', 'c', 'd']);
-      assert.deepEqual(bound(), [undefined, 'b', undefined]);
-    });
-
-    QUnit.test('should use `_.placeholder` when set', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var object = {
-          'fn': function() {
-            return slice.call(arguments);
-          }
-        };
-
-        var _ph = _.placeholder = {},
-            ph = _.bindKey.placeholder,
-            bound = _.bindKey(object, 'fn', _ph, 'b', ph);
-
-        assert.deepEqual(bound('a', 'c'), ['a', 'b', ph, 'c']);
-        delete _.placeholder;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should ensure `new bound` is an instance of `object[key]`', function(assert) {
-      assert.expect(2);
-
-      function Foo(value) {
-        return value && object;
-      }
-
-      var object = { 'Foo': Foo },
-          bound = _.bindKey(object, 'Foo');
-
-      assert.ok(new bound instanceof Foo);
-      assert.strictEqual(new bound(true), object);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('case methods');
-
-  lodashStable.each(['camel', 'kebab', 'lower', 'snake', 'start', 'upper'], function(caseName) {
-    var methodName = caseName + 'Case',
-        func = _[methodName];
-
-    var strings = [
-      'foo bar', 'Foo bar', 'foo Bar', 'Foo Bar',
-      'FOO BAR', 'fooBar', '--foo-bar--', '__foo_bar__'
-    ];
-
-    var converted = (function() {
-      switch (caseName) {
-        case 'camel': return 'fooBar';
-        case 'kebab': return 'foo-bar';
-        case 'lower': return 'foo bar';
-        case 'snake': return 'foo_bar';
-        case 'start': return 'Foo Bar';
-        case 'upper': return 'FOO BAR';
-      }
-    }());
-
-    QUnit.test('`_.' + methodName + '` should convert `string` to ' + caseName + ' case', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(strings, function(string) {
-        var expected = (caseName == 'start' && string == 'FOO BAR') ? string : converted;
-        return func(string) === expected;
-      });
-
-      assert.deepEqual(actual, lodashStable.map(strings, alwaysTrue));
-    });
-
-    QUnit.test('`_.' + methodName + '` should handle double-converting strings', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(strings, function(string) {
-        var expected = (caseName == 'start' && string == 'FOO BAR') ? string : converted;
-        return func(func(string)) === expected;
-      });
-
-      assert.deepEqual(actual, lodashStable.map(strings, alwaysTrue));
-    });
-
-    QUnit.test('`_.' + methodName + '` should deburr letters', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(burredLetters, function(burred, index) {
-        var letter = deburredLetters[index];
-        if (caseName == 'start') {
-          letter = lodashStable.capitalize(letter);
-        } else if (caseName == 'upper') {
-          letter = letter.toUpperCase();
-        } else {
-          letter = letter.toLowerCase();
-        }
-        return func(burred) === letter;
-      });
-
-      assert.deepEqual(actual, lodashStable.map(burredLetters, alwaysTrue));
-    });
-
-    QUnit.test('`_.' + methodName + '` should remove contraction apostrophes', function(assert) {
-      assert.expect(2);
-
-      var postfixes = ['d', 'll', 'm', 're', 's', 't', 've'];
-
-      lodashStable.each(["'", '\u2019'], function(apos) {
-        var actual = lodashStable.map(postfixes, function(postfix) {
-          return func('a b' + apos + postfix +  ' c');
-        });
-
-        var expected = lodashStable.map(postfixes, function(postfix) {
-          switch (caseName) {
-            case 'camel': return 'aB'  + postfix + 'C';
-            case 'kebab': return 'a-b' + postfix + '-c';
-            case 'lower': return 'a b' + postfix + ' c';
-            case 'snake': return 'a_b' + postfix + '_c';
-            case 'start': return 'A B' + postfix + ' C';
-            case 'upper': return 'A B' + postfix.toUpperCase() + ' C';
-          }
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should remove latin-1 mathematical operators', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(['\xd7', '\xf7'], func);
-      assert.deepEqual(actual, ['', '']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce `string` to a string', function(assert) {
-      assert.expect(2);
-
-      var string = 'foo bar';
-      assert.strictEqual(func(Object(string)), converted);
-      assert.strictEqual(func({ 'toString': lodashStable.constant(string) }), converted);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return an unwrapped value implicitly when chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.strictEqual(_('foo bar')[methodName](), converted);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.ok(_('foo bar').chain()[methodName]() instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  (function() {
-    QUnit.test('should get the original value after cycling through all case methods', function(assert) {
-      assert.expect(1);
-
-      var funcs = [_.camelCase, _.kebabCase, _.lowerCase, _.snakeCase, _.startCase, _.lowerCase, _.camelCase];
-
-      var actual = lodashStable.reduce(funcs, function(result, func) {
-        return func(result);
-      }, 'enable 6h format');
-
-      assert.strictEqual(actual, 'enable6HFormat');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.camelCase');
-
-  (function() {
-    QUnit.test('should work with numbers', function(assert) {
-      assert.expect(6);
-
-      assert.strictEqual(_.camelCase('12 feet'), '12Feet');
-      assert.strictEqual(_.camelCase('enable 6h format'), 'enable6HFormat');
-      assert.strictEqual(_.camelCase('enable 24H format'), 'enable24HFormat');
-      assert.strictEqual(_.camelCase('too legit 2 quit'), 'tooLegit2Quit');
-      assert.strictEqual(_.camelCase('walk 500 miles'), 'walk500Miles');
-      assert.strictEqual(_.camelCase('xhr2 request'), 'xhr2Request');
-    });
-
-    QUnit.test('should handle acronyms', function(assert) {
-      assert.expect(6);
-
-      lodashStable.each(['safe HTML', 'safeHTML'], function(string) {
-        assert.strictEqual(_.camelCase(string), 'safeHtml');
-      });
-
-      lodashStable.each(['escape HTML entities', 'escapeHTMLEntities'], function(string) {
-        assert.strictEqual(_.camelCase(string), 'escapeHtmlEntities');
-      });
-
-      lodashStable.each(['XMLHttpRequest', 'XmlHTTPRequest'], function(string) {
-        assert.strictEqual(_.camelCase(string), 'xmlHttpRequest');
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.capitalize');
-
-  (function() {
-    QUnit.test('should capitalize the first character of a string', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.capitalize('fred'), 'Fred');
-      assert.strictEqual(_.capitalize('Fred'), 'Fred');
-      assert.strictEqual(_.capitalize(' fred'), ' fred');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.castArray');
-
-  (function() {
-    QUnit.test('should wrap non-array items in an array', function(assert) {
-      assert.expect(1);
-
-      var values = falsey.concat(true, 1, 'a', { 'a': 1 }),
-          expected = lodashStable.map(values, function(value) { return [value]; }),
-          actual = lodashStable.map(values, _.castArray);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return array values by reference', function(assert) {
-      assert.expect(1);
-
-      var array = [1];
-      assert.strictEqual(_.castArray(array), array);
-    });
-
-    QUnit.test('should return an empty array when no arguments are given', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.castArray(), []);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.chain');
-
-  (function() {
-    QUnit.test('should return a wrapped value', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var actual = _.chain({ 'a': 0 });
-        assert.ok(actual instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return existing wrapped values', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var wrapped = _({ 'a': 0 });
-        assert.strictEqual(_.chain(wrapped), wrapped);
-        assert.strictEqual(wrapped.chain(), wrapped);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should enable chaining for methods that return unwrapped values', function(assert) {
-      assert.expect(6);
-
-      if (!isNpm) {
-        var array = ['c', 'b', 'a'];
-
-        assert.ok(_.chain(array).head() instanceof _);
-        assert.ok(_(array).chain().head() instanceof _);
-
-        assert.ok(_.chain(array).isArray() instanceof _);
-        assert.ok(_(array).chain().isArray() instanceof _);
-
-        assert.ok(_.chain(array).sortBy().head() instanceof _);
-        assert.ok(_(array).chain().sortBy().head() instanceof _);
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-
-    QUnit.test('should chain multiple methods', function(assert) {
-      assert.expect(6);
-
-      if (!isNpm) {
-        lodashStable.times(2, function(index) {
-          var array = ['one two three four', 'five six seven eight', 'nine ten eleven twelve'],
-              expected = { ' ': 9, 'e': 14, 'f': 2, 'g': 1, 'h': 2, 'i': 4, 'l': 2, 'n': 6, 'o': 3, 'r': 2, 's': 2, 't': 5, 'u': 1, 'v': 4, 'w': 2, 'x': 1 },
-              wrapped = index ? _(array).chain() : _.chain(array);
-
-          var actual = wrapped
-            .chain()
-            .map(function(value) { return value.split(''); })
-            .flatten()
-            .reduce(function(object, chr) {
-              object[chr] || (object[chr] = 0);
-              object[chr]++;
-              return object;
-            }, {})
-            .value();
-
-          assert.deepEqual(actual, expected);
-
-          array = [1, 2, 3, 4, 5, 6];
-          wrapped = index ? _(array).chain() : _.chain(array);
-          actual = wrapped
-            .chain()
-            .filter(function(n) { return n % 2 != 0; })
-            .reject(function(n) { return n % 3 == 0; })
-            .sortBy(function(n) { return -n; })
-            .value();
-
-          assert.deepEqual(actual, [5, 1]);
-
-          array = [3, 4];
-          wrapped = index ? _(array).chain() : _.chain(array);
-          actual = wrapped
-            .reverse()
-            .concat([2, 1])
-            .unshift(5)
-            .tap(function(value) { value.pop(); })
-            .map(square)
-            .value();
-
-          assert.deepEqual(actual, [25, 16, 9, 4]);
-        });
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.chunk');
-
-  (function() {
-    var array = [0, 1, 2, 3, 4, 5];
-
-    QUnit.test('should return chunked arrays', function(assert) {
-      assert.expect(1);
-
-      var actual = _.chunk(array, 3);
-      assert.deepEqual(actual, [[0, 1, 2], [3, 4, 5]]);
-    });
-
-    QUnit.test('should return the last chunk as remaining elements', function(assert) {
-      assert.expect(1);
-
-      var actual = _.chunk(array, 4);
-      assert.deepEqual(actual, [[0, 1, 2, 3], [4, 5]]);
-    });
-
-    QUnit.test('should treat falsey `size` values, except `undefined`, as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === undefined ? [[0], [1], [2], [3], [4], [5]] : [];
-      });
-
-      var actual = lodashStable.map(falsey, function(size, index) {
-        return index ? _.chunk(array, size) : _.chunk(array);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should ensure the minimum `size` is `0`', function(assert) {
-      assert.expect(1);
-
-      var values = lodashStable.reject(falsey, lodashStable.isUndefined).concat(-1, -Infinity),
-          expected = lodashStable.map(values, alwaysEmptyArray);
-
-      var actual = lodashStable.map(values, function(n) {
-        return _.chunk(array, n);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should coerce `size` to an integer', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.chunk(array, array.length / 4), [[0], [1], [2], [3], [4], [5]]);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map([[1, 2], [3, 4]], _.chunk);
-      assert.deepEqual(actual, [[[1], [2]], [[3], [4]]]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.clamp');
-
-  (function() {
-    QUnit.test('should work with a `max` argument', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.clamp(5, 3), 3);
-      assert.strictEqual(_.clamp(1, 3), 1);
-    });
-
-    QUnit.test('should clamp negative numbers', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.clamp(-10, -5, 5), -5);
-      assert.strictEqual(_.clamp(-10.2, -5.5, 5.5), -5.5);
-      assert.strictEqual(_.clamp(-Infinity, -5, 5), -5);
-    });
-
-    QUnit.test('should clamp positive numbers', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.clamp(10, -5, 5), 5);
-      assert.strictEqual(_.clamp(10.6, -5.6, 5.4), 5.4);
-      assert.strictEqual(_.clamp(Infinity, -5, 5), 5);
-    });
-
-    QUnit.test('should not alter negative numbers in range', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.clamp(-4, -5, 5), -4);
-      assert.strictEqual(_.clamp(-5, -5, 5), -5);
-      assert.strictEqual(_.clamp(-5.5, -5.6, 5.6), -5.5);
-    });
-
-    QUnit.test('should not alter positive numbers in range', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.clamp(4, -5, 5), 4);
-      assert.strictEqual(_.clamp(5, -5, 5), 5);
-      assert.strictEqual(_.clamp(4.5, -5.1, 5.2), 4.5);
-    });
-
-    QUnit.test('should not alter `0` in range', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(1 / _.clamp(0, -5, 5), Infinity);
-    });
-
-    QUnit.test('should clamp to `0`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(1 / _.clamp(-10, 0, 5), Infinity);
-    });
-
-    QUnit.test('should not alter `-0` in range', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(1 / _.clamp(-0, -5, 5), -Infinity);
-    });
-
-    QUnit.test('should clamp to `-0`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(1 / _.clamp(-10, -0, 5), -Infinity);
-    });
-
-    QUnit.test('should return `NaN` when `number` is `NaN`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.clamp(NaN, -5, 5), NaN);
-    });
-
-    QUnit.test('should coerce `min` and `max` of `NaN` to `0`', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(_.clamp(1, -5, NaN), 0);
-      assert.deepEqual(_.clamp(-1, NaN, 5), 0);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('clone methods');
-
-  (function() {
-    function Foo() {
-      this.a = 1;
-    }
-    Foo.prototype.b = 1;
-    Foo.c = function() {};
-
-    if (Map) {
-      var map = new Map;
-      map.set('a', 1);
-      map.set('b', 2);
-    }
-    if (Set) {
-      var set = new Set;
-      set.add(1);
-      set.add(2);
-    }
-    var objects = {
-      '`arguments` objects': arguments,
-      'arrays': ['a', ''],
-      'array-like-objects': { '0': 'a', '1': '', 'length': 3 },
-      'booleans': false,
-      'boolean objects': Object(false),
-      'date objects': new Date,
-      'Foo instances': new Foo,
-      'objects': { 'a': 0, 'b': 1, 'c': 2 },
-      'objects with object values': { 'a': /a/, 'b': ['B'], 'c': { 'C': 1 } },
-      'objects from another document': realm.object || {},
-      'maps': map,
-      'null values': null,
-      'numbers': 0,
-      'number objects': Object(0),
-      'regexes': /a/gim,
-      'sets': set,
-      'strings': 'a',
-      'string objects': Object('a'),
-      'undefined values': undefined
-    };
-
-    objects.arrays.length = 3;
-
-    var uncloneable = {
-      'DOM elements': body,
-      'functions': Foo,
-      'generators': generator
-    };
-
-    lodashStable.each(errors, function(error) {
-      uncloneable[error.name + 's'] = error;
-    });
-
-    QUnit.test('`_.clone` should perform a shallow clone', function(assert) {
-      assert.expect(2);
-
-      var array = [{ 'a': 0 }, { 'b': 1 }],
-          actual = _.clone(array);
-
-      assert.deepEqual(actual, array);
-      assert.ok(actual !== array && actual[0] === array[0]);
-    });
-
-    QUnit.test('`_.cloneDeep` should deep clone objects with circular references', function(assert) {
-      assert.expect(1);
-
-      var object = {
-        'foo': { 'b': { 'c': { 'd': {} } } },
-        'bar': {}
-      };
-
-      object.foo.b.c.d = object;
-      object.bar.b = object.foo.b;
-
-      var actual = _.cloneDeep(object);
-      assert.ok(actual.bar.b === actual.foo.b && actual === actual.foo.b.c.d && actual !== object);
-    });
-
-    QUnit.test('`_.cloneDeep` should deep clone objects with lots of circular references', function(assert) {
-      assert.expect(2);
-
-      var cyclical = {};
-      lodashStable.times(LARGE_ARRAY_SIZE + 1, function(index) {
-        cyclical['v' + index] = [index ? cyclical['v' + (index - 1)] : cyclical];
-      });
-
-      var clone = _.cloneDeep(cyclical),
-          actual = clone['v' + LARGE_ARRAY_SIZE][0];
-
-      assert.strictEqual(actual, clone['v' + (LARGE_ARRAY_SIZE - 1)]);
-      assert.notStrictEqual(actual, cyclical['v' + (LARGE_ARRAY_SIZE - 1)]);
-    });
-
-    QUnit.test('`_.cloneDeepWith` should provide `stack` to `customizer`', function(assert) {
-      assert.expect(164);
-
-      var Stack,
-          keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || {}];
-
-      var pairs = lodashStable.map(keys, function(key, index) {
-        var lastIndex = keys.length - 1;
-        return [key, keys[lastIndex - index]];
-      });
-
-      _.cloneDeepWith({ 'a': 1 }, function() {
-        if (arguments.length > 1) {
-          Stack || (Stack = _.last(arguments).constructor);
-        }
-      });
-
-      var stacks = [new Stack(pairs), new Stack(pairs)];
-
-      lodashStable.times(LARGE_ARRAY_SIZE - pairs.length + 1, function() {
-        stacks[1].set({}, {});
-      });
-
-      lodashStable.each(stacks, function(stack) {
-        lodashStable.each(keys, function(key, index) {
-          var value = pairs[index][1];
-
-          assert.deepEqual(stack.get(key), value);
-          assert.strictEqual(stack.has(key), true);
-          assert.strictEqual(stack['delete'](key), true);
-          assert.strictEqual(stack.has(key), false);
-          assert.strictEqual(stack.get(key), undefined);
-          assert.strictEqual(stack['delete'](key), false);
-          assert.strictEqual(stack.set(key, value), stack);
-          assert.strictEqual(stack.has(key), true);
-        });
-
-        assert.strictEqual(stack.clear(), undefined);
-        assert.ok(lodashStable.every(keys, function(key) {
-          return !stack.has(key);
-        }));
-      });
-    });
-
-    lodashStable.each(['clone', 'cloneDeep'], function(methodName) {
-      var func = _[methodName],
-          isDeep = methodName == 'cloneDeep';
-
-      lodashStable.forOwn(objects, function(object, key) {
-        QUnit.test('`_.' + methodName + '` should clone ' + key, function(assert) {
-          assert.expect(2);
-
-          var isEqual = (key == 'maps' || key == 'sets') ? _.isEqual : lodashStable.isEqual,
-              actual = func(object);
-
-          assert.ok(isEqual(actual, object));
-
-          if (lodashStable.isObject(object)) {
-            assert.notStrictEqual(actual, object);
-          } else {
-            assert.strictEqual(actual, object);
-          }
-        });
-      });
-
-      QUnit.test('`_.' + methodName + '` should clone array buffers', function(assert) {
-        assert.expect(2);
-
-        if (ArrayBuffer) {
-          var actual = func(arrayBuffer);
-          assert.strictEqual(actual.byteLength, arrayBuffer.byteLength);
-          assert.notStrictEqual(actual, arrayBuffer);
-        }
-        else {
-          skipAssert(assert, 2);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should clone buffers', function(assert) {
-        assert.expect(4);
-
-        if (Buffer) {
-          var buffer = new Buffer([1, 2]),
-              actual = func(buffer);
-
-          assert.strictEqual(actual.byteLength, buffer.byteLength);
-          assert.strictEqual(actual.inspect(), buffer.inspect());
-          assert.notStrictEqual(actual, buffer);
-
-          buffer[0] = 2;
-          assert.strictEqual(actual[0], isDeep ? 2 : 1);
-        }
-        else {
-          skipAssert(assert, 4);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should clone `index` and `input` array properties', function(assert) {
-        assert.expect(2);
-
-        var array = /c/.exec('abcde'),
-            actual = func(array);
-
-        assert.strictEqual(actual.index, 2);
-        assert.strictEqual(actual.input, 'abcde');
-      });
-
-      QUnit.test('`_.' + methodName + '` should clone `lastIndex` regexp property', function(assert) {
-        assert.expect(1);
-
-        var regexp = /c/g;
-        regexp.exec('abcde');
-
-        assert.strictEqual(func(regexp).lastIndex, 3);
-      });
-
-      QUnit.test('`_.' + methodName + '` should clone expando properties', function(assert) {
-        assert.expect(1);
-
-        var values = lodashStable.map([false, true, 1, 'a'], function(value) {
-          var object = Object(value);
-          object.a = 1;
-          return object;
-        });
-
-        var expected = lodashStable.map(values, alwaysTrue);
-
-        var actual = lodashStable.map(values, function(value) {
-          return func(value).a === 1;
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-
-      QUnit.test('`_.' + methodName + '` should clone prototype objects', function(assert) {
-        assert.expect(2);
-
-        var actual = func(Foo.prototype);
-
-        assert.notOk(actual instanceof Foo);
-        assert.deepEqual(actual, { 'b': 1 });
-      });
-
-      QUnit.test('`_.' + methodName + '` should set the `[[Prototype]]` of a clone', function(assert) {
-        assert.expect(1);
-
-        assert.ok(func(new Foo) instanceof Foo);
-      });
-
-      QUnit.test('`_.' + methodName + '` should set the `[[Prototype]]` of a clone even when the `constructor` is incorrect', function(assert) {
-        assert.expect(1);
-
-        Foo.prototype.constructor = Object;
-        assert.ok(func(new Foo) instanceof Foo);
-        Foo.prototype.constructor = Foo;
-      });
-
-      QUnit.test('`_.' + methodName + '` should ensure `value` constructor is a function before using its `[[Prototype]]`', function(assert) {
-        assert.expect(1);
-
-        Foo.prototype.constructor = null;
-        assert.notOk(func(new Foo) instanceof Foo);
-        Foo.prototype.constructor = Foo;
-      });
-
-      QUnit.test('`_.' + methodName + '` should clone properties that shadow those on `Object.prototype`', function(assert) {
-        assert.expect(2);
-
-        var object = {
-          'constructor': objectProto.constructor,
-          'hasOwnProperty': objectProto.hasOwnProperty,
-          'isPrototypeOf': objectProto.isPrototypeOf,
-          'propertyIsEnumerable': objectProto.propertyIsEnumerable,
-          'toLocaleString': objectProto.toLocaleString,
-          'toString': objectProto.toString,
-          'valueOf': objectProto.valueOf
-        };
-
-        var actual = func(object);
-
-        assert.deepEqual(actual, object);
-        assert.notStrictEqual(actual, object);
-      });
-
-      QUnit.test('`_.' + methodName + '` should clone symbol properties', function(assert) {
-        assert.expect(3);
-
-        function Foo() {
-          this[symbol] = { 'c': 1 };
-        }
-
-        if (Symbol) {
-          var symbol2 = Symbol('b');
-          Foo.prototype[symbol2] = 2;
-
-          var object = { 'a': { 'b': new Foo } };
-          object[symbol] = { 'b': 1 };
-
-          var actual = func(object);
-
-          assert.deepEqual(getSymbols(actual.a.b), [symbol]);
-
-          if (isDeep) {
-            assert.deepEqual(actual[symbol], object[symbol]);
-            assert.deepEqual(actual.a.b[symbol], object.a.b[symbol]);
-          }
-          else {
-            assert.strictEqual(actual[symbol], object[symbol]);
-            assert.strictEqual(actual.a, object.a);
-          }
-        }
-        else {
-          skipAssert(assert, 3);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should clone symbol objects', function(assert) {
-        assert.expect(4);
-
-        if (Symbol) {
-          assert.strictEqual(func(symbol), symbol);
-
-          var object = Object(symbol),
-              actual = func(object);
-
-          assert.strictEqual(typeof actual, 'object');
-          assert.strictEqual(typeof actual.valueOf(), 'symbol');
-          assert.notStrictEqual(actual, object);
-        }
-        else {
-          skipAssert(assert, 4);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should not clone symbol primitives', function(assert) {
-        assert.expect(1);
-
-        if (Symbol) {
-          assert.strictEqual(func(symbol), symbol);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should not error on DOM elements', function(assert) {
-        assert.expect(1);
-
-        if (document) {
-          var element = document.createElement('div');
-
-          try {
-            assert.deepEqual(func(element), {});
-          } catch (e) {
-            assert.ok(false, e.message);
-          }
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should create an object from the same realm as `value`', function(assert) {
-        assert.expect(1);
-
-        var props = [];
-
-        var objects = lodashStable.transform(_, function(result, value, key) {
-          if (lodashStable.startsWith(key, '_') && lodashStable.isObject(value) &&
-              !lodashStable.isArguments(value) && !lodashStable.isElement(value) &&
-              !lodashStable.isFunction(value)) {
-            props.push(lodashStable.capitalize(lodashStable.camelCase(key)));
-            result.push(value);
-          }
-        }, []);
-
-        var expected = lodashStable.map(objects, alwaysTrue);
-
-        var actual = lodashStable.map(objects, function(object) {
-          var Ctor = object.constructor,
-              result = func(object);
-
-          return result !== object && ((result instanceof Ctor) || !(new Ctor instanceof Ctor));
-        });
-
-        assert.deepEqual(actual, expected, props.join(', '));
-      });
-
-      QUnit.test('`_.' + methodName + '` should perform a ' + (isDeep ? 'deep' : 'shallow') + ' clone when used as an iteratee for methods like `_.map`', function(assert) {
-        assert.expect(2);
-
-        var expected = [{ 'a': [0] }, { 'b': [1] }],
-            actual = lodashStable.map(expected, func);
-
-        assert.deepEqual(actual, expected);
-
-        if (isDeep) {
-          assert.ok(actual[0] !== expected[0] && actual[0].a !== expected[0].a && actual[1].b !== expected[1].b);
-        } else {
-          assert.ok(actual[0] !== expected[0] && actual[0].a === expected[0].a && actual[1].b === expected[1].b);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should return a unwrapped value when chaining', function(assert) {
-        assert.expect(2);
-
-        if (!isNpm) {
-          var object = objects.objects,
-              actual = _(object)[methodName]();
-
-          assert.deepEqual(actual, object);
-          assert.notStrictEqual(actual, object);
-        }
-        else {
-          skipAssert(assert, 2);
-        }
-      });
-
-      lodashStable.each(arrayViews, function(type) {
-        QUnit.test('`_.' + methodName + '` should clone ' + type + ' values', function(assert) {
-          assert.expect(10);
-
-          var Ctor = root[type];
-
-          lodashStable.times(2, function(index) {
-            if (Ctor) {
-              var buffer = new ArrayBuffer(24),
-                  view = index ? new Ctor(buffer, 8, 1) : new Ctor(buffer),
-                  actual = func(view);
-
-              assert.deepEqual(actual, view);
-              assert.notStrictEqual(actual, view);
-              assert.strictEqual(actual.buffer === view.buffer, !isDeep);
-              assert.strictEqual(actual.byteOffset, view.byteOffset);
-              assert.strictEqual(actual.length, view.length);
-            }
-            else {
-              skipAssert(assert, 5);
-            }
-          });
-        });
-      });
-
-      lodashStable.forOwn(uncloneable, function(value, key) {
-        QUnit.test('`_.' + methodName + '` should not clone ' + key, function(assert) {
-          assert.expect(3);
-
-          if (value) {
-            var object = { 'a': value, 'b': { 'c': value } },
-                actual = func(object),
-                expected = (typeof value == 'function' && !!value.c) ? { 'c': Foo.c } : {};
-
-            assert.deepEqual(actual, object);
-            assert.notStrictEqual(actual, object);
-            assert.deepEqual(func(value), expected);
-          }
-          else {
-            skipAssert(assert, 3);
-          }
-        });
-      });
-    });
-
-    lodashStable.each(['cloneWith', 'cloneDeepWith'], function(methodName) {
-      var func = _[methodName],
-          isDeep = methodName == 'cloneDeepWith';
-
-      QUnit.test('`_.' + methodName + '` should provide the correct `customizer` arguments', function(assert) {
-        assert.expect(1);
-
-        var argsList = [],
-            object = new Foo;
-
-        func(object, function() {
-          var length = arguments.length,
-              args = slice.call(arguments, 0, length - (length > 1 ? 1 : 0));
-
-          argsList.push(args);
-        });
-
-        assert.deepEqual(argsList, isDeep ? [[object], [1, 'a', object]] : [[object]]);
-      });
-
-      QUnit.test('`_.' + methodName + '` should handle cloning if `customizer` returns `undefined`', function(assert) {
-        assert.expect(1);
-
-        var actual = func({ 'a': { 'b': 'c' } }, noop);
-        assert.deepEqual(actual, { 'a': { 'b': 'c' } });
-      });
-
-      lodashStable.forOwn(uncloneable, function(value, key) {
-        QUnit.test('`_.' + methodName + '` should work with a `customizer` callback and ' + key, function(assert) {
-          assert.expect(4);
-
-          var customizer = function(value) {
-            return lodashStable.isPlainObject(value) ? undefined : value;
-          };
-
-          var actual = func(value, customizer);
-
-          assert.deepEqual(actual, value);
-          assert.strictEqual(actual, value);
-
-          var object = { 'a': value, 'b': { 'c': value } };
-          actual = func(object, customizer);
-
-          assert.deepEqual(actual, object);
-          assert.notStrictEqual(actual, object);
-        });
-      });
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.compact');
-
-  (function() {
-    var largeArray = lodashStable.range(LARGE_ARRAY_SIZE).concat(null);
-
-    QUnit.test('should filter falsey values', function(assert) {
-      assert.expect(1);
-
-      var array = ['0', '1', '2'];
-      assert.deepEqual(_.compact(falsey.concat(array)), array);
-    });
-
-    QUnit.test('should work when in-between lazy operators', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var actual = _(falsey).thru(_.slice).compact().thru(_.slice).value();
-        assert.deepEqual(actual, []);
-
-        actual = _(falsey).thru(_.slice).push(true, 1).compact().push('a').value();
-        assert.deepEqual(actual, [true, 1, 'a']);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var actual = _(largeArray).slice(1).compact().reverse().take().value();
-        assert.deepEqual(actual, _.take(_.compact(_.slice(largeArray, 1)).reverse()));
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should work in a lazy sequence with a custom `_.iteratee`', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var iteratee = _.iteratee,
-            pass = false;
-
-        _.iteratee = identity;
-
-        try {
-          var actual = _(largeArray).slice(1).compact().value();
-          pass = lodashStable.isEqual(actual, _.compact(_.slice(largeArray, 1)));
-        } catch (e) {console.log(e);}
-
-        assert.ok(pass);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.concat');
-
-  (function() {
-    QUnit.test('should shallow clone `array`', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3],
-          actual = _.concat(array);
-
-      assert.deepEqual(actual, array);
-      assert.notStrictEqual(actual, array);
-    });
-
-    QUnit.test('should concat arrays and values', function(assert) {
-      assert.expect(2);
-
-      var array = [1],
-          actual = _.concat(array, 2, [3], [[4]]);
-
-      assert.deepEqual(actual, [1, 2, 3, [4]]);
-      assert.deepEqual(array, [1]);
-    });
-
-    QUnit.test('should cast non-array `array` values to arrays', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined, false, true, 1, NaN, 'a'];
-
-      var expected = lodashStable.map(values, function(value, index) {
-        return index ? [value] : [];
-      });
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.concat(value) : _.concat();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      expected = lodashStable.map(values, function(value) {
-        return [value, 2, [3]];
-      });
-
-      actual = lodashStable.map(values, function(value) {
-        return _.concat(value, [2], [[3]]);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should treat sparse arrays as dense', function(assert) {
-      assert.expect(3);
-
-      var expected = [],
-          actual = _.concat(Array(1), Array(1));
-
-      expected.push(undefined, undefined);
-
-      assert.ok('0'in actual);
-      assert.ok('1' in actual);
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return a new wrapped array', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var array = [1],
-            wrapped = _(array).concat([2, 3]),
-            actual = wrapped.value();
-
-        assert.deepEqual(array, [1]);
-        assert.deepEqual(actual, [1, 2, 3]);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.cond');
-
-  (function() {
-    QUnit.test('should create a conditional function', function(assert) {
-      assert.expect(3);
-
-      var cond = _.cond([
-        [lodashStable.matches({ 'a': 1 }),     alwaysA],
-        [lodashStable.matchesProperty('b', 1), alwaysB],
-        [lodashStable.property('c'),           alwaysC]
-      ]);
-
-      assert.strictEqual(cond({ 'a':  1, 'b': 2, 'c': 3 }), 'a');
-      assert.strictEqual(cond({ 'a':  0, 'b': 1, 'c': 2 }), 'b');
-      assert.strictEqual(cond({ 'a': -1, 'b': 0, 'c': 1 }), 'c');
-    });
-
-    QUnit.test('should provide arguments to functions', function(assert) {
-      assert.expect(2);
-
-      var args1,
-          args2,
-          expected = ['a', 'b', 'c'];
-
-      var cond = _.cond([[
-        function() { args1 || (args1 = slice.call(arguments)); return true; },
-        function() { args2 || (args2 = slice.call(arguments)); }
-      ]]);
-
-      cond('a', 'b', 'c');
-
-      assert.deepEqual(args1, expected);
-      assert.deepEqual(args2, expected);
-    });
-
-    QUnit.test('should work with predicate shorthands', function(assert) {
-      assert.expect(3);
-
-      var cond = _.cond([
-        [{ 'a': 1 }, alwaysA],
-        [['b', 1],   alwaysB],
-        ['c',        alwaysC]
-      ]);
-
-      assert.strictEqual(cond({ 'a':  1, 'b': 2, 'c': 3 }), 'a');
-      assert.strictEqual(cond({ 'a':  0, 'b': 1, 'c': 2 }), 'b');
-      assert.strictEqual(cond({ 'a': -1, 'b': 0, 'c': 1 }), 'c');
-    });
-
-    QUnit.test('should return `undefined` when no condition is met', function(assert) {
-      assert.expect(1);
-
-      var cond = _.cond([[alwaysFalse, alwaysA]]);
-      assert.strictEqual(cond({ 'a': 1 }), undefined);
-    });
-
-    QUnit.test('should throw a TypeError if `pairs` is not composed of functions', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each([false, true], function(value) {
-        assert.raises(function() { _.cond([[alwaysTrue, value]])(); }, TypeError);
-      });
-    });
-
-    QUnit.test('should use `this` binding of function for `pairs`', function(assert) {
-      assert.expect(1);
-
-      var cond = _.cond([
-        [function(a) { return this[a]; }, function(a, b) { return this[b]; }]
-      ]);
-
-      var object = { 'cond': cond, 'a': 1, 'b': 2 };
-      assert.strictEqual(object.cond('a', 'b'), 2);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.conforms');
-
-  (function() {
-    var objects = [
-      { 'a': 1, 'b': 8 },
-      { 'a': 2, 'b': 4 },
-      { 'a': 3, 'b': 16 }
-    ];
-
-    QUnit.test('should create a function that checks if a given object conforms to `source`', function(assert) {
-      assert.expect(2);
-
-      var conforms = _.conforms({
-        'b': function(value) { return value > 4; }
-      });
-
-      var actual = lodashStable.filter(objects, conforms);
-      assert.deepEqual(actual, [objects[0], objects[2]]);
-
-      conforms = _.conforms({
-        'b': function(value) { return value > 8; },
-        'a': function(value) { return value > 1; }
-      });
-
-      actual = lodashStable.filter(objects, conforms);
-      assert.deepEqual(actual, [objects[2]]);
-    });
-
-    QUnit.test('should not match by inherited `source` properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = function(value) {
-          return value > 1;
-        };
-      }
-      Foo.prototype.b = function(value) {
-        return value > 8;
-      };
-
-      var conforms = _.conforms(new Foo),
-          actual = lodashStable.filter(objects, conforms);
-
-      assert.deepEqual(actual, [objects[1], objects[2]]);
-    });
-
-    QUnit.test('should not invoke `source` predicates for missing `object` properties', function(assert) {
-      assert.expect(2);
-
-      var count = 0;
-
-      var conforms = _.conforms({
-        'a': function() { count++; return true; }
-      });
-
-      assert.strictEqual(conforms({}), false);
-      assert.strictEqual(count, 0);
-    });
-
-    QUnit.test('should work with a function for `object`', function(assert) {
-      assert.expect(2);
-
-      function Foo() {}
-      Foo.a = 1;
-
-      function Bar() {}
-      Bar.a = 2;
-
-      var conforms = _.conforms({
-        'a': function(value) { return value > 1; }
-      });
-
-      assert.strictEqual(conforms(Foo), false);
-      assert.strictEqual(conforms(Bar), true);
-    });
-
-    QUnit.test('should work with a function for `source`', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.a = function(value) { return value > 1; };
-
-      var objects = [{ 'a': 1 }, { 'a': 2 }],
-          actual = lodashStable.filter(objects, _.conforms(Foo));
-
-      assert.deepEqual(actual, [objects[1]]);
-    });
-
-    QUnit.test('should work with a non-plain `object`', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var conforms = _.conforms({
-        'b': function(value) { return value > 1; }
-      });
-
-      assert.strictEqual(conforms(new Foo), true);
-    });
-
-    QUnit.test('should return `false` when `object` is nullish', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      var conforms = _.conforms({
-        'a': function(value) { return value > 1; }
-      });
-
-      var actual = lodashStable.map(values, function(value, index) {
-        try {
-          return index ? conforms(value) : conforms();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `true` when comparing an empty `source` to a nullish `object`', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, alwaysTrue),
-          conforms = _.conforms({});
-
-      var actual = lodashStable.map(values, function(value, index) {
-        try {
-          return index ? conforms(value) : conforms();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `true` when comparing an empty `source`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1 },
-          expected = lodashStable.map(empties, alwaysTrue);
-
-      var actual = lodashStable.map(empties, function(value) {
-        var conforms = _.conforms(value);
-        return conforms(object);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should not change behavior if `source` is modified', function(assert) {
-      assert.expect(2);
-
-      var source = {
-        'a': function(value) { return value > 1; }
-      };
-
-      var object = { 'a': 2 },
-          conforms = _.conforms(source);
-
-      assert.strictEqual(conforms(object), true);
-
-      source.a = function(value) { return value < 2; };
-      assert.strictEqual(conforms(object), true);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.constant');
-
-  (function() {
-    QUnit.test('should create a function that returns `value`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1 },
-          values = Array(2).concat(empties, true, 1, 'a'),
-          constant = _.constant(object),
-          expected = lodashStable.map(values, function() { return true; });
-
-      var actual = lodashStable.map(values, function(value, index) {
-        if (index == 0) {
-          var result = constant();
-        } else if (index == 1) {
-          result = constant.call({});
-        } else {
-          result = constant(value);
-        }
-        return result === object;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with falsey values', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, function() { return true; });
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        var constant = index ? _.constant(value) : _.constant(),
-            result = constant();
-
-        return (result === value) || (result !== result && value !== value);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return a wrapped value when chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var wrapped = _(true).constant();
-        assert.ok(wrapped instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.countBy');
-
-  (function() {
-    var array = [6.1, 4.2, 6.3];
-
-    QUnit.test('should transform keys by `iteratee`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.countBy(array, Math.floor);
-      assert.deepEqual(actual, { '4': 1, '6': 2 });
-    });
-
-    QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) {
-      assert.expect(1);
-
-      var array = [4, 6, 6],
-          values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant({ '4': 1, '6':  2 }));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.countBy(array, value) : _.countBy(array);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var actual = _.countBy(['one', 'two', 'three'], 'length');
-      assert.deepEqual(actual, { '3': 2, '5': 1 });
-    });
-
-    QUnit.test('should only add values to own, not inherited, properties', function(assert) {
-      assert.expect(2);
-
-      var actual = _.countBy(array, function(n) {
-        return Math.floor(n) > 4 ? 'hasOwnProperty' : 'constructor';
-      });
-
-      assert.deepEqual(actual.constructor, 1);
-      assert.deepEqual(actual.hasOwnProperty, 2);
-    });
-
-    QUnit.test('should work with a number for `iteratee`', function(assert) {
-      assert.expect(2);
-
-      var array = [
-        [1, 'a'],
-        [2, 'a'],
-        [2, 'b']
-      ];
-
-      assert.deepEqual(_.countBy(array, 0), { '1': 1, '2': 2 });
-      assert.deepEqual(_.countBy(array, 1), { 'a': 2, 'b': 1 });
-    });
-
-    QUnit.test('should work with an object for `collection`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.countBy({ 'a': 6.1, 'b': 4.2, 'c': 6.3 }, Math.floor);
-      assert.deepEqual(actual, { '4': 1, '6': 2 });
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE).concat(
-          lodashStable.range(Math.floor(LARGE_ARRAY_SIZE / 2), LARGE_ARRAY_SIZE),
-          lodashStable.range(Math.floor(LARGE_ARRAY_SIZE / 1.5), LARGE_ARRAY_SIZE)
-        );
-
-        var actual = _(array).countBy().map(square).filter(isEven).take().value();
-
-        assert.deepEqual(actual, _.take(_.filter(_.map(_.countBy(array), square), isEven)));
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.create');
-
-  (function() {
-    function Shape() {
-      this.x = 0;
-      this.y = 0;
-    }
-
-    function Circle() {
-      Shape.call(this);
-    }
-
-    QUnit.test('should create an object that inherits from the given `prototype` object', function(assert) {
-      assert.expect(3);
-
-      Circle.prototype = _.create(Shape.prototype);
-      Circle.prototype.constructor = Circle;
-
-      var actual = new Circle;
-
-      assert.ok(actual instanceof Circle);
-      assert.ok(actual instanceof Shape);
-      assert.notStrictEqual(Circle.prototype, Shape.prototype);
-    });
-
-    QUnit.test('should assign `properties` to the created object', function(assert) {
-      assert.expect(3);
-
-      var expected = { 'constructor': Circle, 'radius': 0 };
-      Circle.prototype = _.create(Shape.prototype, expected);
-
-      var actual = new Circle;
-
-      assert.ok(actual instanceof Circle);
-      assert.ok(actual instanceof Shape);
-      assert.deepEqual(Circle.prototype, expected);
-    });
-
-    QUnit.test('should assign own properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-        this.c = 3;
-      }
-      Foo.prototype.b = 2;
-
-      assert.deepEqual(_.create({}, new Foo), { 'a': 1, 'c': 3 });
-    });
-
-    QUnit.test('should assign properties that shadow those of `prototype`', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      var object = _.create(new Foo, { 'a': 1 });
-      assert.deepEqual(lodashStable.keys(object), ['a']);
-    });
-
-    QUnit.test('should accept a falsey `prototype` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysEmptyObject);
-
-      var actual = lodashStable.map(falsey, function(prototype, index) {
-        return index ? _.create(prototype) : _.create();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should ignore primitive `prototype` arguments and use an empty object instead', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(primitives, alwaysTrue);
-
-      var actual = lodashStable.map(primitives, function(value, index) {
-        return lodashStable.isPlainObject(index ? _.create(value) : _.create());
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [{ 'a': 1 }, { 'a': 1 }, { 'a': 1 }],
-          expected = lodashStable.map(array, alwaysTrue),
-          objects = lodashStable.map(array, _.create);
-
-      var actual = lodashStable.map(objects, function(object) {
-        return object.a === 1 && !_.keys(object).length;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.curry');
-
-  (function() {
-    function fn(a, b, c, d) {
-      return slice.call(arguments);
-    }
-
-    QUnit.test('should curry based on the number of arguments given', function(assert) {
-      assert.expect(3);
-
-      var curried = _.curry(fn),
-          expected = [1, 2, 3, 4];
-
-      assert.deepEqual(curried(1)(2)(3)(4), expected);
-      assert.deepEqual(curried(1, 2)(3, 4), expected);
-      assert.deepEqual(curried(1, 2, 3, 4), expected);
-    });
-
-    QUnit.test('should allow specifying `arity`', function(assert) {
-      assert.expect(3);
-
-      var curried = _.curry(fn, 3),
-          expected = [1, 2, 3];
-
-      assert.deepEqual(curried(1)(2, 3), expected);
-      assert.deepEqual(curried(1, 2)(3), expected);
-      assert.deepEqual(curried(1, 2, 3), expected);
-    });
-
-    QUnit.test('should coerce `arity` to an integer', function(assert) {
-      assert.expect(2);
-
-      var values = ['0', 0.6, 'xyz'],
-          expected = lodashStable.map(values, alwaysEmptyArray);
-
-      var actual = lodashStable.map(values, function(arity) {
-        return _.curry(fn, arity)();
-      });
-
-      assert.deepEqual(actual, expected);
-      assert.deepEqual(_.curry(fn, '2')(1)(2), [1, 2]);
-    });
-
-    QUnit.test('should support placeholders', function(assert) {
-      assert.expect(4);
-
-      var curried = _.curry(fn),
-          ph = curried.placeholder;
-
-      assert.deepEqual(curried(1)(ph, 3)(ph, 4)(2), [1, 2, 3, 4]);
-      assert.deepEqual(curried(ph, 2)(1)(ph, 4)(3), [1, 2, 3, 4]);
-      assert.deepEqual(curried(ph, ph, 3)(ph, 2)(ph, 4)(1), [1, 2, 3, 4]);
-      assert.deepEqual(curried(ph, ph, ph, 4)(ph, ph, 3)(ph, 2)(1), [1, 2, 3, 4]);
-    });
-
-    QUnit.test('should persist placeholders', function(assert) {
-      assert.expect(1);
-
-      var curried = _.curry(fn),
-          ph = curried.placeholder,
-          actual = curried(ph, ph, ph, 'd')('a')(ph)('b')('c');
-
-      assert.deepEqual(actual, ['a', 'b', 'c', 'd']);
-    });
-
-    QUnit.test('should use `_.placeholder` when set', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var curried = _.curry(fn),
-            _ph = _.placeholder = {},
-            ph = curried.placeholder;
-
-        assert.deepEqual(curried(1)(_ph, 3)(ph, 4), [1, ph, 3, 4]);
-        delete _.placeholder;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should provide additional arguments after reaching the target arity', function(assert) {
-      assert.expect(3);
-
-      var curried = _.curry(fn, 3);
-      assert.deepEqual(curried(1)(2, 3, 4), [1, 2, 3, 4]);
-      assert.deepEqual(curried(1, 2)(3, 4, 5), [1, 2, 3, 4, 5]);
-      assert.deepEqual(curried(1, 2, 3, 4, 5, 6), [1, 2, 3, 4, 5, 6]);
-    });
-
-    QUnit.test('should create a function with a `length` of `0`', function(assert) {
-      assert.expect(6);
-
-      lodashStable.times(2, function(index) {
-        var curried = index ? _.curry(fn, 4) : _.curry(fn);
-        assert.strictEqual(curried.length, 0);
-        assert.strictEqual(curried(1).length, 0);
-        assert.strictEqual(curried(1, 2).length, 0);
-      });
-    });
-
-    QUnit.test('should ensure `new curried` is an instance of `func`', function(assert) {
-      assert.expect(2);
-
-      function Foo(value) {
-        return value && object;
-      }
-
-      var curried = _.curry(Foo),
-          object = {};
-
-      assert.ok(new curried(false) instanceof Foo);
-      assert.strictEqual(new curried(true), object);
-    });
-
-    QUnit.test('should not set a `this` binding', function(assert) {
-      assert.expect(9);
-
-      var fn = function(a, b, c) {
-        var value = this || {};
-        return [value[a], value[b], value[c]];
-      };
-
-      var object = { 'a': 1, 'b': 2, 'c': 3 },
-          expected = [1, 2, 3];
-
-      assert.deepEqual(_.curry(_.bind(fn, object), 3)('a')('b')('c'), expected);
-      assert.deepEqual(_.curry(_.bind(fn, object), 3)('a', 'b')('c'), expected);
-      assert.deepEqual(_.curry(_.bind(fn, object), 3)('a', 'b', 'c'), expected);
-
-      assert.deepEqual(_.bind(_.curry(fn), object)('a')('b')('c'), Array(3));
-      assert.deepEqual(_.bind(_.curry(fn), object)('a', 'b')('c'), Array(3));
-      assert.deepEqual(_.bind(_.curry(fn), object)('a', 'b', 'c'), expected);
-
-      object.curried = _.curry(fn);
-      assert.deepEqual(object.curried('a')('b')('c'), Array(3));
-      assert.deepEqual(object.curried('a', 'b')('c'), Array(3));
-      assert.deepEqual(object.curried('a', 'b', 'c'), expected);
-    });
-
-    QUnit.test('should work with partialed methods', function(assert) {
-      assert.expect(2);
-
-      var curried = _.curry(fn),
-          expected = [1, 2, 3, 4];
-
-      var a = _.partial(curried, 1),
-          b = _.bind(a, null, 2),
-          c = _.partialRight(b, 4),
-          d = _.partialRight(b(3), 4);
-
-      assert.deepEqual(c(3), expected);
-      assert.deepEqual(d(), expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.curryRight');
-
-  (function() {
-    function fn(a, b, c, d) {
-      return slice.call(arguments);
-    }
-
-    QUnit.test('should curry based on the number of arguments given', function(assert) {
-      assert.expect(3);
-
-      var curried = _.curryRight(fn),
-          expected = [1, 2, 3, 4];
-
-      assert.deepEqual(curried(4)(3)(2)(1), expected);
-      assert.deepEqual(curried(3, 4)(1, 2), expected);
-      assert.deepEqual(curried(1, 2, 3, 4), expected);
-    });
-
-    QUnit.test('should allow specifying `arity`', function(assert) {
-      assert.expect(3);
-
-      var curried = _.curryRight(fn, 3),
-          expected = [1, 2, 3];
-
-      assert.deepEqual(curried(3)(1, 2), expected);
-      assert.deepEqual(curried(2, 3)(1), expected);
-      assert.deepEqual(curried(1, 2, 3), expected);
-    });
-
-    QUnit.test('should coerce `arity` to an integer', function(assert) {
-      assert.expect(2);
-
-      var values = ['0', 0.6, 'xyz'],
-          expected = lodashStable.map(values, alwaysEmptyArray);
-
-      var actual = lodashStable.map(values, function(arity) {
-        return _.curryRight(fn, arity)();
-      });
-
-      assert.deepEqual(actual, expected);
-      assert.deepEqual(_.curryRight(fn, '2')(1)(2), [2, 1]);
-    });
-
-    QUnit.test('should support placeholders', function(assert) {
-      assert.expect(4);
-
-      var curried = _.curryRight(fn),
-          expected = [1, 2, 3, 4],
-          ph = curried.placeholder;
-
-      assert.deepEqual(curried(4)(2, ph)(1, ph)(3), expected);
-      assert.deepEqual(curried(3, ph)(4)(1, ph)(2), expected);
-      assert.deepEqual(curried(ph, ph, 4)(ph, 3)(ph, 2)(1), expected);
-      assert.deepEqual(curried(ph, ph, ph, 4)(ph, ph, 3)(ph, 2)(1), expected);
-    });
-
-    QUnit.test('should persist placeholders', function(assert) {
-      assert.expect(1);
-
-      var curried = _.curryRight(fn),
-          ph = curried.placeholder,
-          actual = curried('a', ph, ph, ph)('b')(ph)('c')('d');
-
-      assert.deepEqual(actual, ['a', 'b', 'c', 'd']);
-    });
-
-    QUnit.test('should use `_.placeholder` when set', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var curried = _.curryRight(fn),
-            _ph = _.placeholder = {},
-            ph = curried.placeholder;
-
-        assert.deepEqual(curried(4)(2, _ph)(1, ph), [1, 2, ph, 4]);
-        delete _.placeholder;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should provide additional arguments after reaching the target arity', function(assert) {
-      assert.expect(3);
-
-      var curried = _.curryRight(fn, 3);
-      assert.deepEqual(curried(4)(1, 2, 3), [1, 2, 3, 4]);
-      assert.deepEqual(curried(4, 5)(1, 2, 3), [1, 2, 3, 4, 5]);
-      assert.deepEqual(curried(1, 2, 3, 4, 5, 6), [1, 2, 3, 4, 5, 6]);
-    });
-
-    QUnit.test('should create a function with a `length` of `0`', function(assert) {
-      assert.expect(6);
-
-      lodashStable.times(2, function(index) {
-        var curried = index ? _.curryRight(fn, 4) : _.curryRight(fn);
-        assert.strictEqual(curried.length, 0);
-        assert.strictEqual(curried(4).length, 0);
-        assert.strictEqual(curried(3, 4).length, 0);
-      });
-    });
-
-    QUnit.test('should ensure `new curried` is an instance of `func`', function(assert) {
-      assert.expect(2);
-
-      function Foo(value) {
-        return value && object;
-      }
-
-      var curried = _.curryRight(Foo),
-          object = {};
-
-      assert.ok(new curried(false) instanceof Foo);
-      assert.strictEqual(new curried(true), object);
-    });
-
-    QUnit.test('should not set a `this` binding', function(assert) {
-      assert.expect(9);
-
-      var fn = function(a, b, c) {
-        var value = this || {};
-        return [value[a], value[b], value[c]];
-      };
-
-      var object = { 'a': 1, 'b': 2, 'c': 3 },
-          expected = [1, 2, 3];
-
-      assert.deepEqual(_.curryRight(_.bind(fn, object), 3)('c')('b')('a'), expected);
-      assert.deepEqual(_.curryRight(_.bind(fn, object), 3)('b', 'c')('a'), expected);
-      assert.deepEqual(_.curryRight(_.bind(fn, object), 3)('a', 'b', 'c'), expected);
-
-      assert.deepEqual(_.bind(_.curryRight(fn), object)('c')('b')('a'), Array(3));
-      assert.deepEqual(_.bind(_.curryRight(fn), object)('b', 'c')('a'), Array(3));
-      assert.deepEqual(_.bind(_.curryRight(fn), object)('a', 'b', 'c'), expected);
-
-      object.curried = _.curryRight(fn);
-      assert.deepEqual(object.curried('c')('b')('a'), Array(3));
-      assert.deepEqual(object.curried('b', 'c')('a'), Array(3));
-      assert.deepEqual(object.curried('a', 'b', 'c'), expected);
-    });
-
-    QUnit.test('should work with partialed methods', function(assert) {
-      assert.expect(2);
-
-      var curried = _.curryRight(fn),
-          expected = [1, 2, 3, 4];
-
-      var a = _.partialRight(curried, 4),
-          b = _.partialRight(a, 3),
-          c = _.bind(b, null, 1),
-          d = _.partial(b(2), 1);
-
-      assert.deepEqual(c(2), expected);
-      assert.deepEqual(d(), expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('curry methods');
-
-  lodashStable.each(['curry', 'curryRight'], function(methodName) {
-    var func = _[methodName],
-        fn = function(a, b) { return slice.call(arguments); },
-        isCurry = methodName == 'curry';
-
-    QUnit.test('`_.' + methodName + '` should not error on functions with the same name as lodash methods', function(assert) {
-      assert.expect(1);
-
-      function run(a, b) {
-        return a + b;
-      }
-
-      var curried = func(run);
-
-      try {
-        var actual = curried(1)(2);
-      } catch (e) {}
-
-      assert.strictEqual(actual, 3);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work for function names that shadow those on `Object.prototype`', function(assert) {
-      assert.expect(1);
-
-      var curried = _.curry(function hasOwnProperty(a, b, c) {
-        return [a, b, c];
-      });
-
-      var expected = [1, 2, 3];
-
-      assert.deepEqual(curried(1)(2)(3), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(2);
-
-      var array = [fn, fn, fn],
-          object = { 'a': fn, 'b': fn, 'c': fn };
-
-      lodashStable.each([array, object], function(collection) {
-        var curries = lodashStable.map(collection, func),
-            expected = lodashStable.map(collection, lodashStable.constant(isCurry ? ['a', 'b'] : ['b', 'a']));
-
-        var actual = lodashStable.map(curries, function(curried) {
-          return curried('a')('b');
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.debounce');
-
-  (function() {
-    QUnit.test('should debounce a function', function(assert) {
-      assert.expect(6);
-
-      var done = assert.async();
-
-      var callCount = 0;
-
-      var debounced = _.debounce(function(value) {
-        ++callCount;
-        return value;
-      }, 32);
-
-      var actual = [debounced(0), debounced(1), debounced(2)];
-      assert.deepEqual(actual, [undefined, undefined, undefined]);
-      assert.strictEqual(callCount, 0);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 1);
-
-        var actual = [debounced(3), debounced(4), debounced(5)];
-        assert.deepEqual(actual, [2, 2, 2]);
-        assert.strictEqual(callCount, 1);
-      }, 128);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 2);
-        done();
-      }, 256);
-    });
-
-    QUnit.test('subsequent debounced calls return the last `func` result', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var debounced = _.debounce(identity, 32);
-      debounced('x');
-
-      setTimeout(function() {
-        assert.notEqual(debounced('y'), 'y');
-      }, 64);
-
-      setTimeout(function() {
-        assert.notEqual(debounced('z'), 'z');
-        done();
-      }, 128);
-    });
-
-    QUnit.test('should not immediately call `func` when `wait` is `0`', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var callCount = 0,
-          debounced = _.debounce(function() { ++callCount; }, 0);
-
-      debounced();
-      debounced();
-      assert.strictEqual(callCount, 0);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 1);
-        done();
-      }, 5);
-    });
-
-    QUnit.test('should apply default options', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var callCount = 0,
-          debounced = _.debounce(function() { callCount++; }, 32, {});
-
-      debounced();
-      assert.strictEqual(callCount, 0);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 1);
-        done();
-      }, 64);
-    });
-
-    QUnit.test('should support a `leading` option', function(assert) {
-      assert.expect(4);
-
-      var done = assert.async();
-
-      var callCounts = [0, 0];
-
-      var withLeading = _.debounce(function() {
-        callCounts[0]++;
-      }, 32, { 'leading': true });
-
-      var withLeadingAndTrailing = _.debounce(function() {
-        callCounts[1]++;
-      }, 32, { 'leading': true });
-
-      withLeading();
-      assert.strictEqual(callCounts[0], 1);
-
-      withLeadingAndTrailing();
-      withLeadingAndTrailing();
-      assert.strictEqual(callCounts[1], 1);
-
-      setTimeout(function() {
-        assert.deepEqual(callCounts, [1, 2]);
-
-        withLeading();
-        assert.strictEqual(callCounts[0], 2);
-
-        done();
-      }, 64);
-    });
-
-    QUnit.test('subsequent leading debounced calls return the last `func` result', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var debounced = _.debounce(identity, 32, { 'leading': true, 'trailing': false }),
-          result = [debounced('x'), debounced('y')];
-
-      assert.deepEqual(result, ['x', 'x']);
-
-      setTimeout(function() {
-        var result = [debounced('a'), debounced('b')];
-        assert.deepEqual(result, ['a', 'a']);
-        done();
-      }, 64);
-    });
-
-    QUnit.test('should support a `trailing` option', function(assert) {
-      assert.expect(4);
-
-      var done = assert.async();
-
-      var withCount = 0,
-          withoutCount = 0;
-
-      var withTrailing = _.debounce(function() {
-        withCount++;
-      }, 32, { 'trailing': true });
-
-      var withoutTrailing = _.debounce(function() {
-        withoutCount++;
-      }, 32, { 'trailing': false });
-
-      withTrailing();
-      assert.strictEqual(withCount, 0);
-
-      withoutTrailing();
-      assert.strictEqual(withoutCount, 0);
-
-      setTimeout(function() {
-        assert.strictEqual(withCount, 1);
-        assert.strictEqual(withoutCount, 0);
-        done();
-      }, 64);
-    });
-
-    QUnit.test('should support a `maxWait` option', function(assert) {
-      assert.expect(4);
-
-      var done = assert.async();
-
-      var callCount = 0;
-
-      var debounced = _.debounce(function(value) {
-        ++callCount;
-        return value;
-      }, 32, { 'maxWait': 64 });
-
-      debounced();
-      debounced();
-      assert.strictEqual(callCount, 0);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 1);
-        debounced();
-        debounced();
-        assert.strictEqual(callCount, 1);
-      }, 128);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 2);
-        done();
-      }, 256);
-    });
-
-    QUnit.test('should support `maxWait` in a tight loop', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      var limit = (argv || isPhantom) ? 1000 : 320,
-          withCount = 0,
-          withoutCount = 0;
-
-      var withMaxWait = _.debounce(function() {
-        withCount++;
-      }, 64, { 'maxWait': 128 });
-
-      var withoutMaxWait = _.debounce(function() {
-        withoutCount++;
-      }, 96);
-
-      var start = +new Date;
-      while ((new Date - start) < limit) {
-        withMaxWait();
-        withoutMaxWait();
-      }
-      var actual = [Boolean(withoutCount), Boolean(withCount)];
-      setTimeout(function() {
-        assert.deepEqual(actual, [false, true]);
-        done();
-      }, 1);
-    });
-
-    QUnit.test('should queue a trailing call for subsequent debounced calls after `maxWait`', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      var callCount = 0;
-
-      var debounced = _.debounce(function() {
-        ++callCount;
-      }, 64, { 'maxWait': 64 });
-
-      debounced();
-
-      lodashStable.times(20, function(index) {
-        setTimeout(debounced, 54 + index);
-      });
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 2);
-        done();
-      }, 160);
-    });
-
-    QUnit.test('should cancel `maxDelayed` when `delayed` is invoked', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var callCount = 0;
-
-      var debounced = _.debounce(function() {
-        callCount++;
-      }, 32, { 'maxWait': 64 });
-
-      debounced();
-
-      setTimeout(function() {
-        debounced();
-        assert.strictEqual(callCount, 1);
-      }, 128);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 2);
-        done();
-      }, 192);
-    });
-
-    QUnit.test('should invoke the trailing call with the correct arguments and `this` binding', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var actual,
-          callCount = 0,
-          object = {};
-
-      var debounced = _.debounce(function(value) {
-        actual = [this];
-        push.apply(actual, arguments);
-        return ++callCount != 2;
-      }, 32, { 'leading': true, 'maxWait': 64 });
-
-      while (true) {
-        if (!debounced.call(object, 'a')) {
-          break;
-        }
-      }
-      setTimeout(function() {
-        assert.strictEqual(callCount, 2);
-        assert.deepEqual(actual, [object, 'a']);
-        done();
-      }, 64);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.deburr');
-
-  (function() {
-    QUnit.test('should convert latin-1 supplementary letters to basic latin', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(burredLetters, _.deburr);
-      assert.deepEqual(actual, deburredLetters);
-    });
-
-    QUnit.test('should not deburr latin-1 mathematical operators', function(assert) {
-      assert.expect(1);
-
-      var operators = ['\xd7', '\xf7'],
-          actual = lodashStable.map(operators, _.deburr);
-
-      assert.deepEqual(actual, operators);
-    });
-
-    QUnit.test('should deburr combining diacritical marks', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(comboMarks, lodashStable.constant('ei'));
-
-      var actual = lodashStable.map(comboMarks, function(chr) {
-        return _.deburr('e' + chr + 'i');
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.defaults');
-
-  (function() {
-    QUnit.test('should assign source properties if missing on `object`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.defaults({ 'a': 1 }, { 'a': 2, 'b': 2 }), { 'a': 1, 'b': 2 });
-    });
-
-    QUnit.test('should accept multiple sources', function(assert) {
-      assert.expect(2);
-
-      var expected = { 'a': 1, 'b': 2, 'c': 3 };
-      assert.deepEqual(_.defaults({ 'a': 1, 'b': 2 }, { 'b': 3 }, { 'c': 3 }), expected);
-      assert.deepEqual(_.defaults({ 'a': 1, 'b': 2 }, { 'b': 3, 'c': 3 }, { 'c': 2 }), expected);
-    });
-
-    QUnit.test('should not overwrite `null` values', function(assert) {
-      assert.expect(1);
-
-      var actual = _.defaults({ 'a': null }, { 'a': 1 });
-      assert.strictEqual(actual.a, null);
-    });
-
-    QUnit.test('should overwrite `undefined` values', function(assert) {
-      assert.expect(1);
-
-      var actual = _.defaults({ 'a': undefined }, { 'a': 1 });
-      assert.strictEqual(actual.a, 1);
-    });
-
-    QUnit.test('should assign properties that shadow those on `Object.prototype`', function(assert) {
-      assert.expect(2);
-
-      var object = {
-        'constructor': objectProto.constructor,
-        'hasOwnProperty': objectProto.hasOwnProperty,
-        'isPrototypeOf': objectProto.isPrototypeOf,
-        'propertyIsEnumerable': objectProto.propertyIsEnumerable,
-        'toLocaleString': objectProto.toLocaleString,
-        'toString': objectProto.toString,
-        'valueOf': objectProto.valueOf
-      };
-
-      var source = {
-        'constructor': 1,
-        'hasOwnProperty': 2,
-        'isPrototypeOf': 3,
-        'propertyIsEnumerable': 4,
-        'toLocaleString': 5,
-        'toString': 6,
-        'valueOf': 7
-      };
-
-      assert.deepEqual(_.defaults({}, source), source);
-      assert.deepEqual(_.defaults({}, object, source), object);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.defaultsDeep');
-
-  (function() {
-    QUnit.test('should deep assign source properties if missing on `object`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': { 'b': 2 }, 'd': 4 },
-          source = { 'a': { 'b': 1, 'c': 3 }, 'e': 5 },
-          expected = { 'a': { 'b': 2, 'c': 3 }, 'd': 4, 'e': 5 };
-
-      assert.deepEqual(_.defaultsDeep(object, source), expected);
-    });
-
-    QUnit.test('should accept multiple sources', function(assert) {
-      assert.expect(2);
-
-      var source1 = { 'a': { 'b': 3 } },
-          source2 = { 'a': { 'c': 3 } },
-          source3 = { 'a': { 'b': 3, 'c': 3 } },
-          source4 = { 'a': { 'c': 4 } },
-          expected = { 'a': { 'b': 2, 'c': 3 } };
-
-      assert.deepEqual(_.defaultsDeep({ 'a': { 'b': 2 } }, source1, source2), expected);
-      assert.deepEqual(_.defaultsDeep({ 'a': { 'b': 2 } }, source3, source4), expected);
-    });
-
-    QUnit.test('should not overwrite `null` values', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': { 'b': null } },
-          source = { 'a': { 'b': 2 } },
-          actual = _.defaultsDeep(object, source);
-
-      assert.strictEqual(actual.a.b, null);
-    });
-
-    QUnit.test('should not overwrite regexp values', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': { 'b': /x/ } },
-          source = { 'a': { 'b': /y/ } },
-          actual = _.defaultsDeep(object, source);
-
-      assert.deepEqual(actual.a.b, /x/);
-    });
-
-    QUnit.test('should not convert function properties to objects', function(assert) {
-      assert.expect(2);
-
-      var actual = _.defaultsDeep({}, { 'a': noop });
-      assert.strictEqual(actual.a, noop);
-
-      actual = _.defaultsDeep({}, { 'a': { 'b': noop } });
-      assert.strictEqual(actual.a.b, noop);
-    });
-
-    QUnit.test('should overwrite `undefined` values', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': { 'b': undefined } },
-          source = { 'a': { 'b': 2 } },
-          actual = _.defaultsDeep(object, source);
-
-      assert.strictEqual(actual.a.b, 2);
-    });
-
-    QUnit.test('should merge sources containing circular references', function(assert) {
-      assert.expect(2);
-
-      var object = {
-        'foo': { 'b': { 'c': { 'd': {} } } },
-        'bar': { 'a': 2 }
-      };
-
-      var source = {
-        'foo': { 'b': { 'c': { 'd': {} } } },
-        'bar': {}
-      };
-
-      object.foo.b.c.d = object;
-      source.foo.b.c.d = source;
-      source.bar.b = source.foo.b;
-
-      var actual = _.defaultsDeep(object, source);
-
-      assert.strictEqual(actual.bar.b, actual.foo.b);
-      assert.strictEqual(actual.foo.b.c.d, actual.foo.b.c.d.foo.b.c.d);
-    });
-
-    QUnit.test('should not modify sources', function(assert) {
-      assert.expect(3);
-
-      var source1 = { 'a': 1, 'b': { 'c': 2 } },
-          source2 = { 'b': { 'c': 3, 'd': 3 } },
-          actual = _.defaultsDeep({}, source1, source2);
-
-      assert.deepEqual(actual, { 'a': 1, 'b': { 'c': 2, 'd': 3 } });
-      assert.deepEqual(source1, { 'a': 1, 'b': { 'c': 2 } });
-      assert.deepEqual(source2, { 'b': { 'c': 3, 'd': 3 } });
-    });
-
-    QUnit.test('should not attempt a merge of a string into an array', function(assert) {
-      assert.expect(1);
-
-      var actual = _.defaultsDeep({ 'a': ['abc'] }, { 'a': 'abc' });
-      assert.deepEqual(actual, { 'a': ['abc'] });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.defer');
-
-  (function() {
-    QUnit.test('should defer `func` execution', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      var pass = false;
-      _.defer(function() { pass = true; });
-
-      setTimeout(function() {
-        assert.ok(pass);
-        done();
-      }, 32);
-    });
-
-    QUnit.test('should provide additional arguments to `func`', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      var args;
-
-      _.defer(function() {
-        args = slice.call(arguments);
-      }, 1, 2);
-
-      setTimeout(function() {
-        assert.deepEqual(args, [1, 2]);
-        done();
-      }, 32);
-    });
-
-    QUnit.test('should be cancelable', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      var pass = true;
-
-      var timerId = _.defer(function() {
-        pass = false;
-      });
-
-      clearTimeout(timerId);
-
-      setTimeout(function() {
-        assert.ok(pass);
-        done();
-      }, 32);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.delay');
-
-  (function() {
-    QUnit.test('should delay `func` execution', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var pass = false;
-      _.delay(function() { pass = true; }, 32);
-
-      setTimeout(function() {
-        assert.notOk(pass);
-      }, 1);
-
-      setTimeout(function() {
-        assert.ok(pass);
-        done();
-      }, 64);
-    });
-
-    QUnit.test('should provide additional arguments to `func`', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      var args;
-
-      _.delay(function() {
-        args = slice.call(arguments);
-      }, 32, 1, 2);
-
-      setTimeout(function() {
-        assert.deepEqual(args, [1, 2]);
-        done();
-      }, 64);
-    });
-
-    QUnit.test('should use a default `wait` of `0`', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var pass = false;
-
-      _.delay(function() {
-        pass = true;
-      });
-
-      assert.notOk(pass);
-
-      setTimeout(function() {
-        assert.ok(pass);
-        done();
-      }, 0);
-    });
-
-    QUnit.test('should be cancelable', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      var pass = true;
-
-      var timerId = _.delay(function() {
-        pass = false;
-      }, 32);
-
-      clearTimeout(timerId);
-
-      setTimeout(function() {
-        assert.ok(pass);
-        done();
-      }, 64);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('difference methods');
-
-  lodashStable.each(['difference', 'differenceBy', 'differenceWith'], function(methodName) {
-    var args = (function() { return arguments; }(1, 2, 3)),
-        func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should return the difference of the given arrays', function(assert) {
-      assert.expect(2);
-
-      var actual = func([1, 2, 3, 4, 5], [5, 2, 10]);
-      assert.deepEqual(actual, [1, 3, 4]);
-
-      actual = func([1, 2, 3, 4, 5], [5, 2, 10], [8, 4]);
-      assert.deepEqual(actual, [1, 3]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat `-0` as `0`', function(assert) {
-      assert.expect(2);
-
-      var array = [-0, 0];
-
-      var actual = lodashStable.map(array, function(value) {
-        return func(array, [value]);
-      });
-
-      assert.deepEqual(actual, [[], []]);
-
-      actual = lodashStable.map(func([-0, 1], [1]), lodashStable.toString);
-      assert.deepEqual(actual, ['0']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should match `NaN`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func([1, NaN, 3], [NaN, 5, NaN]), [1, 3]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays', function(assert) {
-      assert.expect(1);
-
-      var array1 = lodashStable.range(LARGE_ARRAY_SIZE + 1),
-          array2 = lodashStable.range(LARGE_ARRAY_SIZE),
-          a = {},
-          b = {},
-          c = {};
-
-      array1.push(a, b, c);
-      array2.push(b, c, a);
-
-      assert.deepEqual(func(array1, array2), [LARGE_ARRAY_SIZE]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays of `-0` as `0`', function(assert) {
-      assert.expect(2);
-
-      var array = [-0, 0];
-
-      var actual = lodashStable.map(array, function(value) {
-        var largeArray = lodashStable.times(LARGE_ARRAY_SIZE, lodashStable.constant(value));
-        return func(array, largeArray);
-      });
-
-      assert.deepEqual(actual, [[], []]);
-
-      var largeArray = lodashStable.times(LARGE_ARRAY_SIZE, alwaysOne);
-      actual = lodashStable.map(func([-0, 1], largeArray), lodashStable.toString);
-      assert.deepEqual(actual, ['0']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays of `NaN`', function(assert) {
-      assert.expect(1);
-
-      var largeArray = lodashStable.times(LARGE_ARRAY_SIZE, alwaysNaN);
-      assert.deepEqual(func([1, NaN, 3], largeArray), [1, 3]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays of objects', function(assert) {
-      assert.expect(1);
-
-      var object1 = {},
-          object2 = {},
-          largeArray = lodashStable.times(LARGE_ARRAY_SIZE, lodashStable.constant(object1));
-
-      assert.deepEqual(func([object1, object2], largeArray), [object2]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ignore values that are not array-like', function(assert) {
-      assert.expect(3);
-
-      var array = [1, null, 3];
-
-      assert.deepEqual(func(args, 3, { '0': 1 }), [1, 2, 3]);
-      assert.deepEqual(func(null, array, 1), []);
-      assert.deepEqual(func(array, args, null), [null]);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.differenceBy');
-
-  (function() {
-    QUnit.test('should accept an `iteratee` argument', function(assert) {
-      assert.expect(2);
-
-      var actual = _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);
-      assert.deepEqual(actual, [3.1, 1.3]);
-
-      actual = _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
-      assert.deepEqual(actual, [{ 'x': 2 }]);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [4.4]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.differenceWith');
-
-  (function() {
-    QUnit.test('should work with a `comparator` argument', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }],
-          actual = _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], lodashStable.isEqual);
-
-      assert.deepEqual(actual, [objects[1]]);
-    });
-
-    QUnit.test('should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var array = [-0, 1],
-          largeArray = lodashStable.times(LARGE_ARRAY_SIZE, alwaysOne),
-          others = [[1], largeArray],
-          expected = lodashStable.map(others, lodashStable.constant(['-0']));
-
-      var actual = lodashStable.map(others, function(other) {
-        return lodashStable.map(_.differenceWith(array, other, lodashStable.eq), lodashStable.toString);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.divide');
-
-  (function() {
-    QUnit.test('should divide two numbers', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.divide(6, 4), 1.5);
-      assert.strictEqual(_.divide(-6, 4), -1.5);
-      assert.strictEqual(_.divide(-6, -4), 1.5);
-    });
-
-    QUnit.test('should coerce arguments to numbers', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.divide('6', '4'), 1.5);
-      assert.deepEqual(_.divide('x', 'y'), NaN);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.drop');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should drop the first two elements', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.drop(array, 2), [3]);
-    });
-
-    QUnit.test('should treat falsey `n` values, except `undefined`, as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === undefined ? [2, 3] : array;
-      });
-
-      var actual = lodashStable.map(falsey, function(n) {
-        return _.drop(array, n);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return all elements when `n` < `1`', function(assert) {
-      assert.expect(3);
-
-      lodashStable.each([0, -1, -Infinity], function(n) {
-        assert.deepEqual(_.drop(array, n), array);
-      });
-    });
-
-    QUnit.test('should return an empty array when `n` >= `array.length`', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([3, 4, Math.pow(2, 32), Infinity], function(n) {
-        assert.deepEqual(_.drop(array, n), []);
-      });
-    });
-
-    QUnit.test('should coerce `n` to an integer', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.drop(array, 1.6), [2, 3]);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
-          actual = lodashStable.map(array, _.drop);
-
-      assert.deepEqual(actual, [[2, 3], [5, 6], [8, 9]]);
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(6);
-
-      if (!isNpm) {
-        var array = lodashStable.range(1, LARGE_ARRAY_SIZE + 1),
-            predicate = function(value) { values.push(value); return isEven(value); },
-            values = [],
-            actual = _(array).drop(2).drop().value();
-
-        assert.deepEqual(actual, array.slice(3));
-
-        actual = _(array).filter(predicate).drop(2).drop().value();
-        assert.deepEqual(values, array);
-        assert.deepEqual(actual, _.drop(_.drop(_.filter(array, predicate), 2)));
-
-        actual = _(array).drop(2).dropRight().drop().dropRight(2).value();
-        assert.deepEqual(actual, _.dropRight(_.drop(_.dropRight(_.drop(array, 2))), 2));
-
-        values = [];
-
-        actual = _(array).drop().filter(predicate).drop(2).dropRight().drop().dropRight(2).value();
-        assert.deepEqual(values, array.slice(1));
-        assert.deepEqual(actual, _.dropRight(_.drop(_.dropRight(_.drop(_.filter(_.drop(array), predicate), 2))), 2));
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.dropRight');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should drop the last two elements', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.dropRight(array, 2), [1]);
-    });
-
-    QUnit.test('should treat falsey `n` values, except `undefined`, as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === undefined ? [1, 2] : array;
-      });
-
-      var actual = lodashStable.map(falsey, function(n) {
-        return _.dropRight(array, n);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return all elements when `n` < `1`', function(assert) {
-      assert.expect(3);
-
-      lodashStable.each([0, -1, -Infinity], function(n) {
-        assert.deepEqual(_.dropRight(array, n), array);
-      });
-    });
-
-    QUnit.test('should return an empty array when `n` >= `array.length`', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([3, 4, Math.pow(2, 32), Infinity], function(n) {
-        assert.deepEqual(_.dropRight(array, n), []);
-      });
-    });
-
-    QUnit.test('should coerce `n` to an integer', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.dropRight(array, 1.6), [1, 2]);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
-          actual = lodashStable.map(array, _.dropRight);
-
-      assert.deepEqual(actual, [[1, 2], [4, 5], [7, 8]]);
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(6);
-
-      if (!isNpm) {
-        var array = lodashStable.range(1, LARGE_ARRAY_SIZE + 1),
-            predicate = function(value) { values.push(value); return isEven(value); },
-            values = [],
-            actual = _(array).dropRight(2).dropRight().value();
-
-        assert.deepEqual(actual, array.slice(0, -3));
-
-        actual = _(array).filter(predicate).dropRight(2).dropRight().value();
-        assert.deepEqual(values, array);
-        assert.deepEqual(actual, _.dropRight(_.dropRight(_.filter(array, predicate), 2)));
-
-        actual = _(array).dropRight(2).drop().dropRight().drop(2).value();
-        assert.deepEqual(actual, _.drop(_.dropRight(_.drop(_.dropRight(array, 2))), 2));
-
-        values = [];
-
-        actual = _(array).dropRight().filter(predicate).dropRight(2).drop().dropRight().drop(2).value();
-        assert.deepEqual(values, array.slice(0, -1));
-        assert.deepEqual(actual, _.drop(_.dropRight(_.drop(_.dropRight(_.filter(_.dropRight(array), predicate), 2))), 2));
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.dropRightWhile');
-
-  (function() {
-    var array = [1, 2, 3, 4];
-
-    var objects = [
-      { 'a': 0, 'b': 0 },
-      { 'a': 1, 'b': 1 },
-      { 'a': 2, 'b': 2 }
-    ];
-
-    QUnit.test('should drop elements while `predicate` returns truthy', function(assert) {
-      assert.expect(1);
-
-      var actual = _.dropRightWhile(array, function(n) {
-        return n > 2;
-      });
-
-      assert.deepEqual(actual, [1, 2]);
-    });
-
-    QUnit.test('should provide the correct `predicate` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.dropRightWhile(array, function() {
-        args = slice.call(arguments);
-      });
-
-      assert.deepEqual(args, [4, 3, array]);
-    });
-
-    QUnit.test('should work with `_.matches` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.dropRightWhile(objects, { 'b': 2 }), objects.slice(0, 2));
-    });
-
-    QUnit.test('should work with `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.dropRightWhile(objects, ['b', 2]), objects.slice(0, 2));
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.dropRightWhile(objects, 'b'), objects.slice(0, 1));
-    });
-
-    QUnit.test('should return a wrapped value when chaining', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var wrapped = _(array).dropRightWhile(function(n) {
-          return n > 2;
-        });
-
-        assert.ok(wrapped instanceof _);
-        assert.deepEqual(wrapped.value(), [1, 2]);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.dropWhile');
-
-  (function() {
-    var array = [1, 2, 3, 4];
-
-    var objects = [
-      { 'a': 2, 'b': 2 },
-      { 'a': 1, 'b': 1 },
-      { 'a': 0, 'b': 0 }
-    ];
-
-    QUnit.test('should drop elements while `predicate` returns truthy', function(assert) {
-      assert.expect(1);
-
-      var actual = _.dropWhile(array, function(n) {
-        return n < 3;
-      });
-
-      assert.deepEqual(actual, [3, 4]);
-    });
-
-    QUnit.test('should provide the correct `predicate` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.dropWhile(array, function() {
-        args = slice.call(arguments);
-      });
-
-      assert.deepEqual(args, [1, 0, array]);
-    });
-
-    QUnit.test('should work with `_.matches` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.dropWhile(objects, { 'b': 2 }), objects.slice(1));
-    });
-
-    QUnit.test('should work with `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.dropWhile(objects, ['b', 2]), objects.slice(1));
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.dropWhile(objects, 'b'), objects.slice(2));
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(3);
-
-      if (!isNpm) {
-        var array = lodashStable.range(1, LARGE_ARRAY_SIZE + 3),
-            predicate = function(n) { return n < 3; },
-            expected = _.dropWhile(array, predicate),
-            wrapped = _(array).dropWhile(predicate);
-
-        assert.deepEqual(wrapped.value(), expected);
-        assert.deepEqual(wrapped.reverse().value(), expected.slice().reverse());
-        assert.strictEqual(wrapped.last(), _.last(expected));
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should work in a lazy sequence with `drop`', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var array = lodashStable.range(1, LARGE_ARRAY_SIZE + 3);
-
-        var actual = _(array)
-          .dropWhile(function(n) { return n == 1; })
-          .drop()
-          .dropWhile(function(n) { return n == 3; })
-          .value();
-
-        assert.deepEqual(actual, array.slice(3));
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.endsWith');
-
-  (function() {
-    var string = 'abc';
-
-    QUnit.test('should return `true` if a string ends with `target`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.endsWith(string, 'c'), true);
-    });
-
-    QUnit.test('should return `false` if a string does not end with `target`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.endsWith(string, 'b'), false);
-    });
-
-    QUnit.test('should work with a `position` argument', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.endsWith(string, 'b', 2), true);
-    });
-
-    QUnit.test('should work with `position` >= `string.length`', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([3, 5, MAX_SAFE_INTEGER, Infinity], function(position) {
-        assert.strictEqual(_.endsWith(string, 'c', position), true);
-      });
-    });
-
-    QUnit.test('should treat falsey `position` values, except `undefined`, as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysTrue);
-
-      var actual = lodashStable.map(falsey, function(position) {
-        return _.endsWith(string, position === undefined ? 'c' : '', position);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should treat a negative `position` as `0`', function(assert) {
-      assert.expect(6);
-
-      lodashStable.each([-1, -3, -Infinity], function(position) {
-        assert.ok(lodashStable.every(string, function(chr) {
-          return _.endsWith(string, chr, position) === false;
-        }));
-        assert.strictEqual(_.endsWith(string, '', position), true);
-      });
-    });
-
-    QUnit.test('should coerce `position` to an integer', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.endsWith(string, 'ab', 2.2), true);
-    });
-
-    QUnit.test('should return `true` when `target` is an empty string regardless of `position`', function(assert) {
-      assert.expect(1);
-
-      assert.ok(lodashStable.every([-Infinity, NaN, -3, -1, 0, 1, 2, 3, 5, MAX_SAFE_INTEGER, Infinity], function(position) {
-        return _.endsWith(string, '', position, true);
-      }));
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.eq');
-
-  (function() {
-    QUnit.test('should perform a `SameValueZero` comparison of two values', function(assert) {
-      assert.expect(11);
-
-      assert.strictEqual(_.eq(), true);
-      assert.strictEqual(_.eq(undefined), true);
-      assert.strictEqual(_.eq(0, -0), true);
-      assert.strictEqual(_.eq(NaN, NaN), true);
-      assert.strictEqual(_.eq(1, 1), true);
-
-      assert.strictEqual(_.eq(null, undefined), false);
-      assert.strictEqual(_.eq(1, Object(1)), false);
-      assert.strictEqual(_.eq(1, '1'), false);
-      assert.strictEqual(_.eq(1, '1'), false);
-
-      var object = { 'a': 1 };
-      assert.strictEqual(_.eq(object, object), true);
-      assert.strictEqual(_.eq(object, { 'a': 1 }), false);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.escape');
-
-  (function() {
-    var escaped = '&amp;&lt;&gt;&quot;&#39;&#96;\/',
-        unescaped = '&<>"\'`\/';
-
-    escaped += escaped;
-    unescaped += unescaped;
-
-    QUnit.test('should escape values', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.escape(unescaped), escaped);
-    });
-
-    QUnit.test('should not escape the "/" character', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.escape('/'), '/');
-    });
-
-    QUnit.test('should handle strings with nothing to escape', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.escape('abc'), 'abc');
-    });
-
-    QUnit.test('should escape the same characters unescaped by `_.unescape`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.escape(_.unescape(escaped)), escaped);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.escapeRegExp');
-
-  (function() {
-    var escaped = '\\^\\$\\.\\*\\+\\?\\(\\)\\[\\]\\{\\}\\|\\\\',
-        unescaped = '^$.*+?()[]{}|\\';
-
-    QUnit.test('should escape values', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.escapeRegExp(unescaped + unescaped), escaped + escaped);
-    });
-
-    QUnit.test('should handle strings with nothing to escape', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.escapeRegExp('abc'), 'abc');
-    });
-
-    QUnit.test('should return an empty string for empty values', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined, ''],
-          expected = lodashStable.map(values, alwaysEmptyString);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.escapeRegExp(value) : _.escapeRegExp();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.every');
-
-  (function() {
-    QUnit.test('should return `true` if `predicate` returns truthy for all elements', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(lodashStable.every([true, 1, 'a'], identity), true);
-    });
-
-    QUnit.test('should return `true` for empty collections', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(empties, alwaysTrue);
-
-      var actual = lodashStable.map(empties, function(value) {
-        try {
-          return _.every(value, identity);
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `false` as soon as `predicate` returns falsey', function(assert) {
-      assert.expect(2);
-
-      var count = 0;
-
-      assert.strictEqual(_.every([true, null, true], function(value) {
-        count++;
-        return value;
-      }), false);
-
-      assert.strictEqual(count, 2);
-    });
-
-    QUnit.test('should work with collections of `undefined` values (test in IE < 9)', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.every([undefined, undefined, undefined], identity), false);
-    });
-
-    QUnit.test('should use `_.identity` when `predicate` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        var array = [0];
-        return index ? _.every(array, value) : _.every(array);
-      });
-
-      assert.deepEqual(actual, expected);
-
-      expected = lodashStable.map(values, alwaysTrue);
-      actual = lodashStable.map(values, function(value, index) {
-        var array = [1];
-        return index ? _.every(array, value) : _.every(array);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(2);
-
-      var objects = [{ 'a': 0, 'b': 1 }, { 'a': 1, 'b': 2 }];
-      assert.strictEqual(_.every(objects, 'a'), false);
-      assert.strictEqual(_.every(objects, 'b'), true);
-    });
-
-    QUnit.test('should work with `_.matches` shorthands', function(assert) {
-      assert.expect(2);
-
-      var objects = [{ 'a': 0, 'b': 0 }, { 'a': 0, 'b': 1 }];
-      assert.strictEqual(_.every(objects, { 'a': 0 }), true);
-      assert.strictEqual(_.every(objects, { 'b': 1 }), false);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map([[1]], _.every);
-      assert.deepEqual(actual, [true]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('strict mode checks');
-
-  lodashStable.each(['assign', 'assignIn', 'bindAll', 'defaults'], function(methodName) {
-    var func = _[methodName],
-        isBindAll = methodName == 'bindAll';
-
-    QUnit.test('`_.' + methodName + '` should ' + (isStrict ? '' : 'not ') + 'throw strict mode errors', function(assert) {
-      assert.expect(1);
-
-      if (freeze) {
-        var object = freeze({ 'a': undefined, 'b': function() {} }),
-            pass = !isStrict;
-
-        try {
-          func(object, isBindAll ? 'b' : { 'a': 1 });
-        } catch (e) {
-          pass = !pass;
-        }
-        assert.ok(pass);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.fill');
-
-  (function() {
-    QUnit.test('should use a default `start` of `0` and a default `end` of `array.length`', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3];
-      assert.deepEqual(_.fill(array, 'a'), ['a', 'a', 'a']);
-    });
-
-    QUnit.test('should use `undefined` for `value` if not given', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3],
-          actual = _.fill(array);
-
-      assert.deepEqual(actual, Array(3));
-      assert.ok(lodashStable.every(actual, function(value, index) {
-        return index in actual;
-      }));
-    });
-
-    QUnit.test('should work with a positive `start`', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3];
-      assert.deepEqual(_.fill(array, 'a', 1), [1, 'a', 'a']);
-    });
-
-    QUnit.test('should work with a `start` >= `array.length`', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([3, 4, Math.pow(2, 32), Infinity], function(start) {
-        var array = [1, 2, 3];
-        assert.deepEqual(_.fill(array, 'a', start), [1, 2, 3]);
-      });
-    });
-
-    QUnit.test('should treat falsey `start` values as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, lodashStable.constant(['a', 'a', 'a']));
-
-      var actual = lodashStable.map(falsey, function(start) {
-        var array = [1, 2, 3];
-        return _.fill(array, 'a', start);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with a negative `start`', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3];
-      assert.deepEqual(_.fill(array, 'a', -1), [1, 2, 'a']);
-    });
-
-    QUnit.test('should work with a negative `start` <= negative `array.length`', function(assert) {
-      assert.expect(3);
-
-      lodashStable.each([-3, -4, -Infinity], function(start) {
-        var array = [1, 2, 3];
-        assert.deepEqual(_.fill(array, 'a', start), ['a', 'a', 'a']);
-      });
-    });
-
-    QUnit.test('should work with `start` >= `end`', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each([2, 3], function(start) {
-        var array = [1, 2, 3];
-        assert.deepEqual(_.fill(array, 'a', start, 2), [1, 2, 3]);
-      });
-    });
-
-    QUnit.test('should work with a positive `end`', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3];
-      assert.deepEqual(_.fill(array, 'a', 0, 1), ['a', 2, 3]);
-    });
-
-    QUnit.test('should work with a `end` >= `array.length`', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([3, 4, Math.pow(2, 32), Infinity], function(end) {
-        var array = [1, 2, 3];
-        assert.deepEqual(_.fill(array, 'a', 0, end), ['a', 'a', 'a']);
-      });
-    });
-
-    QUnit.test('should treat falsey `end` values, except `undefined`, as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === undefined ? ['a', 'a', 'a'] : [1, 2, 3];
-      });
-
-      var actual = lodashStable.map(falsey, function(end) {
-        var array = [1, 2, 3];
-        return _.fill(array, 'a', 0, end);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with a negative `end`', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3];
-      assert.deepEqual(_.fill(array, 'a', 0, -1), ['a', 'a', 3]);
-    });
-
-    QUnit.test('should work with a negative `end` <= negative `array.length`', function(assert) {
-      assert.expect(3);
-
-      lodashStable.each([-3, -4, -Infinity], function(end) {
-        var array = [1, 2, 3];
-        assert.deepEqual(_.fill(array, 'a', 0, end), [1, 2, 3]);
-      });
-    });
-
-    QUnit.test('should coerce `start` and `end` to integers', function(assert) {
-      assert.expect(1);
-
-      var positions = [[0.1, 1.6], ['0', 1], [0, '1'], ['1'], [NaN, 1], [1, NaN]];
-
-      var actual = lodashStable.map(positions, function(pos) {
-        var array = [1, 2, 3];
-        return _.fill.apply(_, [array, 'a'].concat(pos));
-      });
-
-      assert.deepEqual(actual, [['a', 2, 3], ['a', 2, 3], ['a', 2, 3], [1, 'a', 'a'], ['a', 2, 3], [1, 2, 3]]);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 2], [3, 4]],
-          actual = lodashStable.map(array, _.fill);
-
-      assert.deepEqual(actual, [[0, 0], [1, 1]]);
-    });
-
-    QUnit.test('should return a wrapped value when chaining', function(assert) {
-      assert.expect(3);
-
-      if (!isNpm) {
-        var array = [1, 2, 3],
-            wrapped = _(array).fill('a'),
-            actual = wrapped.value();
-
-        assert.ok(wrapped instanceof _);
-        assert.deepEqual(actual, ['a', 'a', 'a']);
-        assert.strictEqual(actual, array);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.filter');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should return elements `predicate` returns truthy for', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.filter(array, isEven), [2]);
-    });
-
-    QUnit.test('should iterate over an object with numeric keys (test in Mobile Safari 8)', function(assert) {
-      assert.expect(1);
-
-      // Trigger a mobile Safari 8 JIT bug.
-      // See https://github.com/lodash/lodash/issues/799.
-      var counter = 0,
-          object = { '1': 'foo', '8': 'bar', '50': 'baz' };
-
-      lodashStable.times(1000, function(assert) {
-        _.filter([], alwaysTrue);
-      });
-
-      _.filter(object, function() {
-        counter++;
-        return true;
-      });
-
-      assert.strictEqual(counter, 3);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  lodashStable.each(['find', 'findLast', 'findIndex', 'findLastIndex', 'findKey', 'findLastKey'], function(methodName) {
-    QUnit.module('lodash.' + methodName);
-
-    var func = _[methodName];
-
-    (function() {
-      var objects = [
-        { 'a': 0, 'b': 0 },
-        { 'a': 1, 'b': 1 },
-        { 'a': 2, 'b': 2 }
-      ];
-
-      var expected = ({
-        'find': [objects[1], undefined, objects[2], objects[1]],
-        'findLast': [objects[2], undefined, objects[2], objects[2]],
-        'findIndex': [1, -1, 2, 1],
-        'findLastIndex': [2, -1, 2, 2],
-        'findKey': ['1', undefined, '2', '1'],
-        'findLastKey': ['2', undefined, '2', '2']
-      })[methodName];
-
-      QUnit.test('`_.' + methodName + '` should return the found value', function(assert) {
-        assert.expect(1);
-
-        assert.strictEqual(func(objects, function(object) { return object.a; }), expected[0]);
-      });
-
-      QUnit.test('`_.' + methodName + '` should return `' + expected[1] + '` if value is not found', function(assert) {
-        assert.expect(1);
-
-        assert.strictEqual(func(objects, function(object) { return object.a === 3; }), expected[1]);
-      });
-
-      QUnit.test('`_.' + methodName + '` should work with `_.matches` shorthands', function(assert) {
-        assert.expect(1);
-
-        assert.strictEqual(func(objects, { 'b': 2 }), expected[2]);
-      });
-
-      QUnit.test('`_.' + methodName + '` should work with `_.matchesProperty` shorthands', function(assert) {
-        assert.expect(1);
-
-        assert.strictEqual(func(objects, ['b', 2]), expected[2]);
-      });
-
-      QUnit.test('`_.' + methodName + '` should work with `_.property` shorthands', function(assert) {
-        assert.expect(1);
-
-        assert.strictEqual(func(objects, 'b'), expected[3]);
-      });
-
-      QUnit.test('`_.' + methodName + '` should return `' + expected[1] + '` for empty collections', function(assert) {
-        assert.expect(1);
-
-        var emptyValues = lodashStable.endsWith(methodName, 'Index') ? lodashStable.reject(empties, lodashStable.isPlainObject) : empties,
-            expecting = lodashStable.map(emptyValues, lodashStable.constant(expected[1]));
-
-        var actual = lodashStable.map(emptyValues, function(value) {
-          try {
-            return func(value, { 'a': 3 });
-          } catch (e) {}
-        });
-
-        assert.deepEqual(actual, expecting);
-      });
-    }());
-
-    (function() {
-      var array = [1, 2, 3, 4];
-
-      var expected = ({
-        'find': 1,
-        'findLast': 4,
-        'findIndex': 0,
-        'findLastIndex': 3,
-        'findKey': '0',
-        'findLastKey': '3'
-      })[methodName];
-
-      QUnit.test('`_.' + methodName + '` should return an unwrapped value when implicitly chaining', function(assert) {
-        assert.expect(1);
-
-        if (!isNpm) {
-          assert.strictEqual(_(array)[methodName](), expected);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should return a wrapped value when explicitly chaining', function(assert) {
-        assert.expect(1);
-
-        if (!isNpm) {
-          assert.ok(_(array).chain()[methodName]() instanceof _);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should not execute immediately when explicitly chaining', function(assert) {
-        assert.expect(1);
-
-        if (!isNpm) {
-          var wrapped = _(array).chain()[methodName]();
-          assert.strictEqual(wrapped.__wrapped__, array);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should work in a lazy sequence', function(assert) {
-        assert.expect(2);
-
-        if (!isNpm) {
-          var largeArray = lodashStable.range(1, LARGE_ARRAY_SIZE + 1),
-              smallArray = array;
-
-          lodashStable.times(2, function(index) {
-            var array = index ? largeArray : smallArray,
-                wrapped = _(array).filter(isEven);
-
-            assert.strictEqual(wrapped[methodName](), func(lodashStable.filter(array, isEven)));
-          });
-        }
-        else {
-          skipAssert(assert, 2);
-        }
-      });
-    }());
-
-    (function() {
-      var expected = ({
-        'find': 1,
-        'findLast': 2,
-        'findKey': 'a',
-        'findLastKey': 'b'
-      })[methodName];
-
-      if (expected != null) {
-        QUnit.test('`_.' + methodName + '` should work with an object for `collection`', function(assert) {
-          assert.expect(1);
-
-          var actual = func({ 'a': 1, 'b': 2, 'c': 3 }, function(n) {
-            return n < 3;
-          });
-
-          assert.strictEqual(actual, expected);
-        });
-      }
-    }());
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.find and lodash.findLast');
-
-  lodashStable.each(['find', 'findLast'], function(methodName) {
-    var isFind = methodName == 'find';
-
-    QUnit.test('`_.' + methodName + '` should support shortcut fusion', function(assert) {
-      assert.expect(3);
-
-      if (!isNpm) {
-        var findCount = 0,
-            mapCount = 0,
-            array = lodashStable.range(1, LARGE_ARRAY_SIZE + 1),
-            iteratee = function(value) { mapCount++; return square(value); },
-            predicate = function(value) { findCount++; return isEven(value); },
-            actual = _(array).map(iteratee)[methodName](predicate);
-
-        assert.strictEqual(findCount, isFind ? 2 : 1);
-        assert.strictEqual(mapCount, isFind ? 2 : 1);
-        assert.strictEqual(actual, isFind ? 4 : square(LARGE_ARRAY_SIZE));
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.flip');
-
-  (function() {
-    function fn() {
-      return slice.call(arguments);
-    }
-
-    QUnit.test('should flip arguments provided to `func`', function(assert) {
-      assert.expect(1);
-
-      var flipped = _.flip(fn);
-      assert.deepEqual(flipped('a', 'b', 'c', 'd'), ['d', 'c', 'b', 'a']);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.flatMapDepth');
-
-  (function() {
-    var array = [1, [2, [3, [4]], 5]];
-
-    QUnit.test('should use a default `depth` of `1`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.flatMapDepth(array, identity), [1, 2, [3, [4]], 5]);
-    });
-
-    QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant([1, 2, [3, [4]], 5]));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.flatMapDepth(array, value) : _.flatMapDepth(array);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should treat a `depth` of < `1` as a shallow clone', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each([-1, 0], function(depth) {
-        assert.deepEqual(_.flatMapDepth(array, identity, depth), [1, [2, [3, [4]], 5]]);
-      });
-    });
-
-    QUnit.test('should coerce `depth` to an integer', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.flatMapDepth(array, identity, 2.2), [1, 2, 3, [4], 5]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('flatMap methods');
-
-  lodashStable.each(['flatMap', 'flatMapDeep', 'flatMapDepth'], function(methodName) {
-    var func = _[methodName],
-        array = [1, 2, 3, 4];
-
-    function duplicate(n) {
-      return [n, n];
-    }
-
-    QUnit.test('`_.' + methodName + '` should map values in `array` to a new flattened array', function(assert) {
-      assert.expect(1);
-
-      var actual = func(array, duplicate),
-          expected = lodashStable.flatten(lodashStable.map(array, duplicate));
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'a': [1, 2] }, { 'a': [3, 4] }];
-      assert.deepEqual(func(objects, 'a'), array);
-    });
-
-    QUnit.test('`_.' + methodName + '` should iterate over own string keyed properties of objects', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = [1, 2];
-      }
-      Foo.prototype.b = [3, 4];
-
-      var actual = func(new Foo, identity);
-      assert.deepEqual(actual, [1, 2]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should use `_.identity` when `iteratee` is nullish', function(assert) {
-      assert.expect(2);
-
-      var array = [[1, 2], [3, 4]],
-          object = { 'a': [1, 2], 'b': [3, 4] },
-          values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant([1, 2, 3, 4]));
-
-      lodashStable.each([array, object], function(collection) {
-        var actual = lodashStable.map(values, function(value, index) {
-          return index ? func(collection, value) : func(collection);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should accept a falsey `collection` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysEmptyArray);
-
-      var actual = lodashStable.map(falsey, function(collection, index) {
-        try {
-          return index ? func(collection) : func();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat number values for `collection` as empty', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func(1), []);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with objects with non-number length properties', function(assert) {
-      assert.expect(1);
-
-      var object = { 'length': [1, 2] };
-      assert.deepEqual(func(object, identity), [1, 2]);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.flattenDepth');
-
-  (function() {
-    var array = [1, [2, [3, [4]], 5]];
-
-    QUnit.test('should use a default `depth` of `1`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.flattenDepth(array), [1, 2, [3, [4]], 5]);
-    });
-
-    QUnit.test('should treat a `depth` of < `1` as a shallow clone', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each([-1, 0], function(depth) {
-        assert.deepEqual(_.flattenDepth(array, depth), [1, [2, [3, [4]], 5]]);
-      });
-    });
-
-    QUnit.test('should coerce `depth` to an integer', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.flattenDepth(array, 2.2), [1, 2, 3, [4], 5]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('flatten methods');
-
-  (function() {
-    var args = arguments,
-        array = [1, [2, [3, [4]], 5]];
-
-    QUnit.test('should flatten `arguments` objects', function(assert) {
-      assert.expect(3);
-
-      var array = [args, [args]];
-
-      assert.deepEqual(_.flatten(array), [1, 2, 3, args]);
-      assert.deepEqual(_.flattenDeep(array), [1, 2, 3, 1, 2, 3]);
-      assert.deepEqual(_.flattenDepth(array, 2), [1, 2, 3, 1, 2, 3]);
-    });
-
-    QUnit.test('should treat sparse arrays as dense', function(assert) {
-      assert.expect(6);
-
-      var array = [[1, 2, 3], Array(3)],
-          expected = [1, 2, 3];
-
-      expected.push(undefined, undefined, undefined);
-
-      lodashStable.each([_.flatten(array), _.flattenDeep(array), _.flattenDepth(array)], function(actual) {
-        assert.deepEqual(actual, expected);
-        assert.ok('4' in actual);
-      });
-    });
-
-    QUnit.test('should work with extremely large arrays', function(assert) {
-      assert.expect(3);
-
-      lodashStable.times(3, function(index) {
-        var expected = Array(5e5);
-        try {
-          var func = _.flatten;
-          if (index == 1) {
-            func = _.flattenDeep;
-          } else if (index == 2) {
-            func = _.flattenDepth;
-          }
-          assert.deepEqual(func([expected]), expected);
-        } catch (e) {
-          assert.ok(false, e.message);
-        }
-      });
-    });
-
-    QUnit.test('should work with empty arrays', function(assert) {
-      assert.expect(3);
-
-      var array = [[], [[]], [[], [[[]]]]];
-
-      assert.deepEqual(_.flatten(array), [[], [], [[[]]]]);
-      assert.deepEqual(_.flattenDeep(array), []);
-      assert.deepEqual(_.flattenDepth(array, 2), [[[]]]);
-    });
-
-    QUnit.test('should support flattening of nested arrays', function(assert) {
-      assert.expect(3);
-
-      assert.deepEqual(_.flatten(array), [1, 2, [3, [4]], 5]);
-      assert.deepEqual(_.flattenDeep(array), [1, 2, 3, 4, 5]);
-      assert.deepEqual(_.flattenDepth(array, 2), [1, 2, 3, [4], 5]);
-    });
-
-    QUnit.test('should return an empty array for non array-like objects', function(assert) {
-      assert.expect(3);
-
-      var expected = [],
-          nonArray = { 'a': 1 };
-
-      assert.deepEqual(_.flatten(nonArray), expected);
-      assert.deepEqual(_.flattenDeep(nonArray), expected);
-      assert.deepEqual(_.flattenDepth(nonArray, 2), expected);
-    });
-
-    QUnit.test('should return a wrapped value when chaining', function(assert) {
-      assert.expect(6);
-
-      if (!isNpm) {
-        var wrapped = _(array),
-            actual = wrapped.flatten();
-
-        assert.ok(actual instanceof _);
-        assert.deepEqual(actual.value(), [1, 2, [3, [4]], 5]);
-
-        actual = wrapped.flattenDeep();
-
-        assert.ok(actual instanceof _);
-        assert.deepEqual(actual.value(), [1, 2, 3, 4, 5]);
-
-        actual = wrapped.flattenDepth(2);
-
-        assert.ok(actual instanceof _);
-        assert.deepEqual(actual.value(), [1, 2, 3, [4], 5]);
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('flow methods');
-
-  lodashStable.each(['flow', 'flowRight'], function(methodName) {
-    var func = _[methodName],
-        isFlow = methodName == 'flow';
-
-    QUnit.test('`_.' + methodName + '` should supply each function with the return value of the previous', function(assert) {
-      assert.expect(1);
-
-      var fixed = function(n) { return n.toFixed(1); },
-          combined = isFlow ? func(add, square, fixed) : func(fixed, square, add);
-
-      assert.strictEqual(combined(1, 2), '9.0');
-    });
-
-    QUnit.test('`_.' + methodName + '` should return a new function', function(assert) {
-      assert.expect(1);
-
-      assert.notStrictEqual(func(noop), noop);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return an identity function when no arguments are given', function(assert) {
-      assert.expect(6);
-
-      _.times(2, function(index) {
-        try {
-          var combined = index ? func([]) : func();
-          assert.strictEqual(combined('a'), 'a');
-        } catch (e) {
-          assert.ok(false, e.message);
-        }
-        assert.strictEqual(combined.length, 0);
-        assert.notStrictEqual(combined, identity);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with a curried function and `_.head`', function(assert) {
-      assert.expect(1);
-
-      var curried = _.curry(identity);
-
-      var combined = isFlow
-        ? func(_.head, curried)
-        : func(curried, _.head);
-
-      assert.strictEqual(combined([1]), 1);
-    });
-
-    QUnit.test('`_.' + methodName + '` should support shortcut fusion', function(assert) {
-      assert.expect(6);
-
-      var filterCount,
-          mapCount,
-          array = lodashStable.range(LARGE_ARRAY_SIZE),
-          iteratee = function(value) { mapCount++; return square(value); },
-          predicate = function(value) { filterCount++; return isEven(value); };
-
-      lodashStable.times(2, function(index) {
-        var filter1 = _.filter,
-            filter2 = _.curry(_.rearg(_.ary(_.filter, 2), 1, 0), 2),
-            filter3 = (_.filter = index ? filter2 : filter1, filter2(predicate));
-
-        var map1 = _.map,
-            map2 = _.curry(_.rearg(_.ary(_.map, 2), 1, 0), 2),
-            map3 = (_.map = index ? map2 : map1, map2(iteratee));
-
-        var take1 = _.take,
-            take2 = _.curry(_.rearg(_.ary(_.take, 2), 1, 0), 2),
-            take3 = (_.take = index ? take2 : take1, take2(2));
-
-        var combined = isFlow
-          ? func(map3, filter3, _.compact, take3)
-          : func(take3, _.compact, filter3, map3);
-
-        filterCount = mapCount = 0;
-        assert.deepEqual(combined(array), [4, 16]);
-
-        if (!isNpm && WeakMap && WeakMap.name) {
-          assert.strictEqual(filterCount, 5, 'filterCount');
-          assert.strictEqual(mapCount, 5, 'mapCount');
-        }
-        else {
-          skipAssert(assert, 2);
-        }
-        _.filter = filter1;
-        _.map = map1;
-        _.take = take1;
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with curried functions with placeholders', function(assert) {
-      assert.expect(1);
-
-      var curried = _.curry(_.ary(_.map, 2), 2),
-          getProp = curried(curried.placeholder, 'a'),
-          objects = [{ 'a': 1 }, { 'a': 2 }, { 'a': 1 }];
-
-      var combined = isFlow
-        ? func(getProp, _.uniq)
-        : func(_.uniq, getProp);
-
-      assert.deepEqual(combined(objects), [1, 2]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return a wrapped value when chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var wrapped = _(noop)[methodName]();
-        assert.ok(wrapped instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.forEach');
-
-  (function() {
-    QUnit.test('should be aliased', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.each, _.forEach);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.forEachRight');
-
-  (function() {
-    QUnit.test('should be aliased', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.eachRight, _.forEachRight);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('forIn methods');
-
-  lodashStable.each(['forIn', 'forInRight'], function(methodName) {
-    var func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` iterates over inherited string keyed properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var keys = [];
-      func(new Foo, function(value, key) { keys.push(key); });
-      assert.deepEqual(keys.sort(), ['a', 'b']);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('forOwn methods');
-
-  lodashStable.each(['forOwn', 'forOwnRight'], function(methodName) {
-    var func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should iterate over `length` properties', function(assert) {
-      assert.expect(1);
-
-      var object = { '0': 'zero', '1': 'one', 'length': 2 },
-          props = [];
-
-      func(object, function(value, prop) { props.push(prop); });
-      assert.deepEqual(props.sort(), ['0', '1', 'length']);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('iteration methods');
-
-  (function() {
-    var methods = [
-      '_baseEach',
-      'countBy',
-      'every',
-      'filter',
-      'find',
-      'findIndex',
-      'findKey',
-      'findLast',
-      'findLastIndex',
-      'findLastKey',
-      'forEach',
-      'forEachRight',
-      'forIn',
-      'forInRight',
-      'forOwn',
-      'forOwnRight',
-      'groupBy',
-      'keyBy',
-      'map',
-      'mapKeys',
-      'mapValues',
-      'maxBy',
-      'minBy',
-      'omitBy',
-      'partition',
-      'pickBy',
-      'reject',
-      'some'
-    ];
-
-    var arrayMethods = [
-      'findIndex',
-      'findLastIndex',
-      'maxBy',
-      'minBy'
-    ];
-
-    var collectionMethods = [
-      '_baseEach',
-      'countBy',
-      'every',
-      'filter',
-      'find',
-      'findLast',
-      'forEach',
-      'forEachRight',
-      'groupBy',
-      'keyBy',
-      'map',
-      'partition',
-      'reduce',
-      'reduceRight',
-      'reject',
-      'some'
-    ];
-
-    var forInMethods = [
-      'forIn',
-      'forInRight',
-      'omitBy',
-      'pickBy'
-    ];
-
-    var iterationMethods = [
-      '_baseEach',
-      'forEach',
-      'forEachRight',
-      'forIn',
-      'forInRight',
-      'forOwn',
-      'forOwnRight'
-    ];
-
-    var objectMethods = [
-      'findKey',
-      'findLastKey',
-      'forIn',
-      'forInRight',
-      'forOwn',
-      'forOwnRight',
-      'mapKeys',
-      'mapValues',
-      'omitBy',
-      'pickBy'
-    ];
-
-    var rightMethods = [
-      'findLast',
-      'findLastIndex',
-      'findLastKey',
-      'forEachRight',
-      'forInRight',
-      'forOwnRight'
-    ];
-
-    var unwrappedMethods = [
-      'each',
-      'eachRight',
-      'every',
-      'find',
-      'findIndex',
-      'findKey',
-      'findLast',
-      'findLastIndex',
-      'findLastKey',
-      'forEach',
-      'forEachRight',
-      'forIn',
-      'forInRight',
-      'forOwn',
-      'forOwnRight',
-      'max',
-      'maxBy',
-      'min',
-      'minBy',
-      'some'
-    ];
-
-    lodashStable.each(methods, function(methodName) {
-      var array = [1, 2, 3],
-          func = _[methodName],
-          isBy = /(^partition|By)$/.test(methodName),
-          isFind = /^find/.test(methodName),
-          isOmitPick = /^(?:omit|pick)By$/.test(methodName),
-          isSome = methodName == 'some';
-
-      QUnit.test('`_.' + methodName + '` should provide the correct iteratee arguments', function(assert) {
-        assert.expect(1);
-
-        if (func) {
-          var args,
-              expected = [1, 0, array];
-
-          func(array, function() {
-            args || (args = slice.call(arguments));
-          });
-
-          if (lodashStable.includes(rightMethods, methodName)) {
-            expected[0] = 3;
-            expected[1] = 2;
-          }
-          if (lodashStable.includes(objectMethods, methodName)) {
-            expected[1] += '';
-          }
-          if (isBy) {
-            expected.length = isOmitPick ? 2 : 1;
-          }
-          assert.deepEqual(args, expected);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should treat sparse arrays as dense', function(assert) {
-        assert.expect(1);
-
-        if (func) {
-          var array = [1];
-          array[2] = 3;
-
-          var expected = lodashStable.includes(objectMethods, methodName)
-            ? [[1, '0', array], [undefined, '1', array], [3, '2', array]]
-            : [[1,  0, array],  [undefined,  1,  array], [3,  2,  array]];
-
-          if (isBy) {
-            expected = lodashStable.map(expected, function(args) {
-              return args.slice(0, isOmitPick ? 2 : 1);
-            });
-          }
-          else if (lodashStable.includes(objectMethods, methodName)) {
-            expected = lodashStable.map(expected, function(args) {
-              args[1] += '';
-              return args;
-            });
-          }
-          if (lodashStable.includes(rightMethods, methodName)) {
-            expected.reverse();
-          }
-          var argsList = [];
-          func(array, function() {
-            argsList.push(slice.call(arguments));
-            return !(isFind || isSome);
-          });
-
-          assert.deepEqual(argsList, expected);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    lodashStable.each(lodashStable.difference(methods, objectMethods), function(methodName) {
-      var array = [1, 2, 3],
-          func = _[methodName],
-          isEvery = methodName == 'every';
-
-      array.a = 1;
-
-      QUnit.test('`_.' + methodName + '` should not iterate custom properties on arrays', function(assert) {
-        assert.expect(1);
-
-        if (func) {
-          var keys = [];
-          func(array, function(value, key) {
-            keys.push(key);
-            return isEvery;
-          });
-
-          assert.notOk(lodashStable.includes(keys, 'a'));
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    lodashStable.each(lodashStable.difference(methods, unwrappedMethods), function(methodName) {
-      var array = [1, 2, 3],
-          isBaseEach = methodName == '_baseEach';
-
-      QUnit.test('`_.' + methodName + '` should return a wrapped value when implicitly chaining', function(assert) {
-        assert.expect(1);
-
-        if (!(isBaseEach || isNpm)) {
-          var wrapped = _(array)[methodName](noop);
-          assert.ok(wrapped instanceof _);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    lodashStable.each(unwrappedMethods, function(methodName) {
-      var array = [1, 2, 3];
-
-      QUnit.test('`_.' + methodName + '` should return an unwrapped value when implicitly chaining', function(assert) {
-        assert.expect(1);
-
-        if (!isNpm) {
-          var actual = _(array)[methodName](noop);
-          assert.notOk(actual instanceof _);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-
-      QUnit.test('`_.' + methodName + '` should return a wrapped value when explicitly chaining', function(assert) {
-        assert.expect(2);
-
-        if (!isNpm) {
-          var wrapped = _(array).chain(),
-              actual = wrapped[methodName](noop);
-
-          assert.ok(actual instanceof _);
-          assert.notStrictEqual(actual, wrapped);
-        }
-        else {
-          skipAssert(assert, 2);
-        }
-      });
-    });
-
-    lodashStable.each(lodashStable.difference(methods, arrayMethods, forInMethods), function(methodName) {
-      var func = _[methodName];
-
-      QUnit.test('`_.' + methodName + '` iterates over own string keyed properties of objects', function(assert) {
-        assert.expect(1);
-
-        function Foo() {
-          this.a = 1;
-        }
-        Foo.prototype.b = 2;
-
-        if (func) {
-          var values = [];
-          func(new Foo, function(value) { values.push(value); });
-          assert.deepEqual(values, [1]);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    lodashStable.each(iterationMethods, function(methodName) {
-      var array = [1, 2, 3],
-          func = _[methodName];
-
-      QUnit.test('`_.' + methodName + '` should return the collection', function(assert) {
-        assert.expect(1);
-
-        if (func) {
-          assert.strictEqual(func(array, Boolean), array);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    lodashStable.each(collectionMethods, function(methodName) {
-      var func = _[methodName];
-
-      QUnit.test('`_.' + methodName + '` should use `isArrayLike` to determine whether a value is array-like', function(assert) {
-        assert.expect(3);
-
-        if (func) {
-          var isIteratedAsObject = function(object) {
-            var result = false;
-            func(object, function() { result = true; }, 0);
-            return result;
-          };
-
-          var values = [-1, '1', 1.1, Object(1), MAX_SAFE_INTEGER + 1],
-              expected = lodashStable.map(values, alwaysTrue);
-
-          var actual = lodashStable.map(values, function(length) {
-            return isIteratedAsObject({ 'length': length });
-          });
-
-          var Foo = function(a) {};
-          Foo.a = 1;
-
-          assert.deepEqual(actual, expected);
-          assert.ok(isIteratedAsObject(Foo));
-          assert.notOk(isIteratedAsObject({ 'length': 0 }));
-        }
-        else {
-          skipAssert(assert, 3);
-        }
-      });
-    });
-
-    lodashStable.each(methods, function(methodName) {
-      var func = _[methodName],
-          isFind = /^find/.test(methodName),
-          isSome = methodName == 'some',
-          isReduce = /^reduce/.test(methodName);
-
-      QUnit.test('`_.' + methodName + '` should ignore changes to `array.length`', function(assert) {
-        assert.expect(1);
-
-        if (func) {
-          var count = 0,
-              array = [1];
-
-          func(array, function() {
-            if (++count == 1) {
-              array.push(2);
-            }
-            return !(isFind || isSome);
-          }, isReduce ? array : null);
-
-          assert.strictEqual(count, 1);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    lodashStable.each(lodashStable.difference(lodashStable.union(methods, collectionMethods), arrayMethods), function(methodName) {
-      var func = _[methodName],
-          isFind = /^find/.test(methodName),
-          isSome = methodName == 'some',
-          isReduce = /^reduce/.test(methodName);
-
-      QUnit.test('`_.' + methodName + '` should ignore added `object` properties', function(assert) {
-        assert.expect(1);
-
-        if (func) {
-          var count = 0,
-              object = { 'a': 1 };
-
-          func(object, function() {
-            if (++count == 1) {
-              object.b = 2;
-            }
-            return !(isFind || isSome);
-          }, isReduce ? object : null);
-
-          assert.strictEqual(count, 1);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('object assignments');
-
-  lodashStable.each(['assign', 'assignIn', 'defaults', 'merge'], function(methodName) {
-    var func = _[methodName],
-        isAssign = methodName == 'assign',
-        isDefaults = methodName == 'defaults';
-
-    QUnit.test('`_.' + methodName + '` should coerce primitives to objects', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(primitives, function(value) {
-        var object = Object(value);
-        object.a = 1;
-        return object;
-      });
-
-      var actual = lodashStable.map(primitives, function(value) {
-        return func(value, { 'a': 1 });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should assign own ' + (isAssign ? '' : 'and inherited ') + 'string keyed source properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var expected = isAssign ? { 'a': 1 } : { 'a': 1, 'b': 2 };
-      assert.deepEqual(func({}, new Foo), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should not error on nullish sources', function(assert) {
-      assert.expect(1);
-
-      try {
-        assert.deepEqual(func({ 'a': 1 }, undefined, { 'b': 2 }, null), { 'a': 1, 'b': 2 });
-      } catch (e) {
-        assert.ok(false, e.message);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should create an object when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var source = { 'a': 1 },
-          values = [null, undefined],
-          expected = lodashStable.map(values, alwaysTrue);
-
-      var actual = lodashStable.map(values, function(value) {
-        var object = func(value, source);
-        return object !== source && lodashStable.isEqual(object, source);
-      });
-
-      assert.deepEqual(actual, expected);
-
-      actual = lodashStable.map(values, function(value) {
-        return lodashStable.isEqual(func(value), {});
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work as an iteratee for methods like `_.reduce`', function(assert) {
-      assert.expect(2);
-
-      var array = [{ 'a': 1 }, { 'b': 2 }, { 'c': 3 }],
-          expected = { 'a': isDefaults ? 0 : 1, 'b': 2, 'c': 3 };
-
-      assert.deepEqual(lodashStable.reduce(array, func, { 'a': 0 }), expected);
-
-      var fn = function() {};
-      fn.a = array[0];
-      fn.b = array[1];
-      fn.c = array[2];
-
-      assert.deepEqual(_.reduce(fn, func, { 'a': 0 }), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should not return the existing wrapped value when chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var wrapped = _({ 'a': 1 }),
-            actual = wrapped[methodName]({ 'b': 2 });
-
-        assert.notStrictEqual(actual, wrapped);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  lodashStable.each(['assign', 'assignIn', 'merge'], function(methodName) {
-    var func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should not treat `object` as `source`', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.prototype.a = 1;
-
-      var actual = func(new Foo, { 'b': 2 });
-      assert.notOk(_.has(actual, 'a'));
-    });
-  });
-
-  lodashStable.each(['assign', 'assignIn', 'assignInWith', 'assignWith', 'defaults', 'merge', 'mergeWith'], function(methodName) {
-    var func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should not assign values that are the same as their destinations', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each(['a', ['a'], { 'a': 1 }, NaN], function(value) {
-        if (defineProperty) {
-          var object = {},
-              pass = true;
-
-          defineProperty(object, 'a', {
-            'enumerable': true,
-            'configurable': true,
-            'get': lodashStable.constant(value),
-            'set': function() { pass = false; }
-          });
-
-          func(object, { 'a': value });
-          assert.ok(pass);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-  });
-
-  lodashStable.each(['assignWith', 'assignInWith', 'mergeWith'], function(methodName) {
-    var func = _[methodName],
-        isMergeWith = methodName == 'mergeWith';
-
-    QUnit.test('`_.' + methodName + '` should provide the correct `customizer` arguments', function(assert) {
-      assert.expect(3);
-
-      var args,
-          object = { 'a': 1 },
-          source = { 'a': 2 },
-          expected = lodashStable.map([1, 2, 'a', object, source], lodashStable.cloneDeep);
-
-      func(object, source, function() {
-        args || (args = lodashStable.map(slice.call(arguments, 0, 5), lodashStable.cloneDeep));
-      });
-
-      assert.deepEqual(args, expected, 'primitive property values');
-
-      args = undefined;
-      object = { 'a': 1 };
-      source = { 'b': 2 };
-      expected = lodashStable.map([undefined, 2, 'b', object, source], lodashStable.cloneDeep);
-
-      func(object, source, function() {
-        args || (args = lodashStable.map(slice.call(arguments, 0, 5), lodashStable.cloneDeep));
-      });
-
-      assert.deepEqual(args, expected, 'missing destination property');
-
-      var argsList = [],
-          objectValue = [1, 2],
-          sourceValue = { 'b': 2 };
-
-      object = { 'a': objectValue };
-      source = { 'a': sourceValue };
-      expected = [lodashStable.map([objectValue, sourceValue, 'a', object, source], lodashStable.cloneDeep)];
-
-      if (isMergeWith) {
-        expected.push(lodashStable.map([undefined, 2, 'b', objectValue, sourceValue], lodashStable.cloneDeep));
-      }
-      func(object, source, function() {
-        argsList.push(lodashStable.map(slice.call(arguments, 0, 5), lodashStable.cloneDeep));
-      });
-
-      assert.deepEqual(argsList, expected, 'object property values');
-    });
-
-    QUnit.test('`_.' + methodName + '` should not treat the second argument as a `customizer` callback', function(assert) {
-      assert.expect(2);
-
-      function callback() {}
-      callback.b = 2;
-
-      var actual = func({ 'a': 1 }, callback);
-      assert.deepEqual(actual, { 'a': 1, 'b': 2 });
-
-      actual = func({ 'a': 1 }, callback, { 'c': 3 });
-      assert.deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3 });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('exit early');
-
-  lodashStable.each(['_baseEach', 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'transform'], function(methodName) {
-    var func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` can exit early when iterating arrays', function(assert) {
-      assert.expect(1);
-
-      if (func) {
-        var array = [1, 2, 3],
-            values = [];
-
-        func(array, function(value, other) {
-          values.push(lodashStable.isArray(value) ? other : value);
-          return false;
-        });
-
-        assert.deepEqual(values, [lodashStable.endsWith(methodName, 'Right') ? 3 : 1]);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` can exit early when iterating objects', function(assert) {
-      assert.expect(1);
-
-      if (func) {
-        var object = { 'a': 1, 'b': 2, 'c': 3 },
-            values = [];
-
-        func(object, function(value, other) {
-          values.push(lodashStable.isArray(value) ? other : value);
-          return false;
-        });
-
-        assert.strictEqual(values.length, 1);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('`__proto__` property bugs');
-
-  (function() {
-    QUnit.test('internal data objects should work with the `__proto__` key', function(assert) {
-      assert.expect(4);
-
-      var stringLiteral = '__proto__',
-          stringObject = Object(stringLiteral),
-          expected = [stringLiteral, stringObject];
-
-      var largeArray = lodashStable.times(LARGE_ARRAY_SIZE, function(count) {
-        return isEven(count) ? stringLiteral : stringObject;
-      });
-
-      assert.deepEqual(_.difference(largeArray, largeArray), []);
-      assert.deepEqual(_.intersection(largeArray, largeArray), expected);
-      assert.deepEqual(_.uniq(largeArray), expected);
-      assert.deepEqual(_.without.apply(_, [largeArray].concat(largeArray)), []);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.fromPairs');
-
-  (function() {
-    QUnit.test('should accept a two dimensional array', function(assert) {
-      assert.expect(1);
-
-      var array = [['a', 1], ['b', 2]],
-          object = { 'a': 1, 'b': 2 },
-          actual = _.fromPairs(array);
-
-      assert.deepEqual(actual, object);
-    });
-
-    QUnit.test('should accept a falsey `array` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysEmptyObject);
-
-      var actual = lodashStable.map(falsey, function(array, index) {
-        try {
-          return index ? _.fromPairs(array) : _.fromPairs();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should not support deep paths', function(assert) {
-      assert.expect(1);
-
-      var actual = _.fromPairs([['a.b', 1]]);
-      assert.deepEqual(actual, { 'a.b': 1 });
-    });
-
-    QUnit.test('should support consuming the return value of `_.toPairs`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a.b': 1 };
-      assert.deepEqual(_.fromPairs(_.toPairs(object)), object);
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var array = lodashStable.times(LARGE_ARRAY_SIZE, function(index) {
-          return ['key' + index, index];
-        });
-
-        var actual = _(array).fromPairs().map(square).filter(isEven).take().value();
-
-        assert.deepEqual(actual, _.take(_.filter(_.map(_.fromPairs(array), square), isEven)));
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.functions');
-
-  (function() {
-    QUnit.test('should return the function names of an object', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 'a', 'b': identity, 'c': /x/, 'd': noop },
-          actual = _.functions(object).sort();
-
-      assert.deepEqual(actual, ['b', 'd']);
-    });
-
-    QUnit.test('should not include inherited functions', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = identity;
-        this.b = 'b';
-      }
-      Foo.prototype.c = noop;
-
-      assert.deepEqual(_.functions(new Foo), ['a']);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.groupBy');
-
-  (function() {
-    var array = [6.1, 4.2, 6.3];
-
-    QUnit.test('should transform keys by `iteratee`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.groupBy(array, Math.floor);
-      assert.deepEqual(actual, { '4': [4.2], '6': [6.1, 6.3] });
-    });
-
-    QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) {
-      assert.expect(1);
-
-      var array = [6, 4, 6],
-          values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant({ '4': [4], '6':  [6, 6] }));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.groupBy(array, value) : _.groupBy(array);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var actual = _.groupBy(['one', 'two', 'three'], 'length');
-      assert.deepEqual(actual, { '3': ['one', 'two'], '5': ['three'] });
-    });
-
-    QUnit.test('should only add values to own, not inherited, properties', function(assert) {
-      assert.expect(2);
-
-      var actual = _.groupBy(array, function(n) {
-        return Math.floor(n) > 4 ? 'hasOwnProperty' : 'constructor';
-      });
-
-      assert.deepEqual(actual.constructor, [4.2]);
-      assert.deepEqual(actual.hasOwnProperty, [6.1, 6.3]);
-    });
-
-    QUnit.test('should work with a number for `iteratee`', function(assert) {
-      assert.expect(2);
-
-      var array = [
-        [1, 'a'],
-        [2, 'a'],
-        [2, 'b']
-      ];
-
-      assert.deepEqual(_.groupBy(array, 0), { '1': [[1, 'a']], '2': [[2, 'a'], [2, 'b']] });
-      assert.deepEqual(_.groupBy(array, 1), { 'a': [[1, 'a'], [2, 'a']], 'b': [[2, 'b']] });
-    });
-
-    QUnit.test('should work with an object for `collection`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.groupBy({ 'a': 6.1, 'b': 4.2, 'c': 6.3 }, Math.floor);
-      assert.deepEqual(actual, { '4': [4.2], '6': [6.1, 6.3] });
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE).concat(
-          lodashStable.range(Math.floor(LARGE_ARRAY_SIZE / 2), LARGE_ARRAY_SIZE),
-          lodashStable.range(Math.floor(LARGE_ARRAY_SIZE / 1.5), LARGE_ARRAY_SIZE)
-        );
-
-        var iteratee = function(value) { value.push(value[0]); return value; },
-            predicate = function(value) { return isEven(value[0]); },
-            actual = _(array).groupBy().map(iteratee).filter(predicate).take().value();
-
-        assert.deepEqual(actual, _.take(_.filter(lodashStable.map(_.groupBy(array), iteratee), predicate)));
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.gt');
-
-  (function() {
-    QUnit.test('should return `true` if `value` > `other`', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.gt(3, 1), true);
-      assert.strictEqual(_.gt('def', 'abc'), true);
-    });
-
-    QUnit.test('should return `false` if `value` is <= `other`', function(assert) {
-      assert.expect(4);
-
-      assert.strictEqual(_.gt(1, 3), false);
-      assert.strictEqual(_.gt(3, 3), false);
-      assert.strictEqual(_.gt('abc', 'def'), false);
-      assert.strictEqual(_.gt('def', 'def'), false);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.gte');
-
-  (function() {
-    QUnit.test('should return `true` if `value` >= `other`', function(assert) {
-      assert.expect(4);
-
-      assert.strictEqual(_.gte(3, 1), true);
-      assert.strictEqual(_.gte(3, 3), true);
-      assert.strictEqual(_.gte('def', 'abc'), true);
-      assert.strictEqual(_.gte('def', 'def'), true);
-    });
-
-    QUnit.test('should return `false` if `value` is less than `other`', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.gte(1, 3), false);
-      assert.strictEqual(_.gte('abc', 'def'), false);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('has methods');
-
-  lodashStable.each(['has', 'hasIn'], function(methodName) {
-    var args = (function() { return arguments; }(1, 2, 3)),
-        func = _[methodName],
-        isHas = methodName == 'has';
-
-    QUnit.test('`_.' + methodName + '` should check for own properties', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': 1 };
-
-      lodashStable.each(['a', ['a']], function(path) {
-        assert.strictEqual(func(object, path), true);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should not use the `hasOwnProperty` method of the object', function(assert) {
-      assert.expect(1);
-
-      var object = { 'hasOwnProperty': null, 'a': 1 };
-      assert.strictEqual(func(object, 'a'), true);
-    });
-
-    QUnit.test('`_.' + methodName + '` should support deep paths', function(assert) {
-      assert.expect(4);
-
-      var object = { 'a': { 'b': 2 } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        assert.strictEqual(func(object, path), true);
-      });
-
-      lodashStable.each(['a.a', ['a', 'a']], function(path) {
-        assert.strictEqual(func(object, path), false);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce `path` to a string', function(assert) {
-      assert.expect(1);
-
-      function fn() {}
-      fn.toString = lodashStable.constant('fn');
-
-      var expected = [1, 1, 2, 2, 3, 3, 4, 4],
-          objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }],
-          values = [null, undefined, fn, {}];
-
-      var actual = lodashStable.transform(objects, function(result, object, index) {
-        var key = values[index];
-        lodashStable.each([key, [key]], function(path) {
-          var prop = _.property(key);
-          result.push(prop(object));
-        });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with `arguments` objects', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(func(args, 1), true);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with a non-string `path`', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3];
-
-      lodashStable.each([1, [1]], function(path) {
-        assert.strictEqual(func(array, path), true);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var object = { '-0': 'a', '0': 'b' },
-          props = [-0, Object(-0), 0, Object(0)],
-          expected = lodashStable.map(props, alwaysTrue);
-
-      var actual = lodashStable.map(props, function(key) {
-        return func(object, key);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with a symbol `path`', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this[symbol] = 1;
-      }
-
-      if (Symbol) {
-        var symbol2 = Symbol('b');
-        Foo.prototype[symbol2] = 2;
-        var path = isHas ? symbol : symbol2;
-
-        assert.strictEqual(func(new Foo, path), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should work for objects with a `[[Prototype]]` of `null`', function(assert) {
-      assert.expect(1);
-
-      if (create)  {
-        var object = create(null);
-        object[1] = 'a';
-        assert.strictEqual(func(object, 1), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should check for a key over a path', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a.b': 1 };
-
-      lodashStable.each(['a.b', ['a.b']], function(path) {
-        assert.strictEqual(func(object, path), true);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `' + (isHas ? 'false' : 'true') + '` for inherited properties', function(assert) {
-      assert.expect(2);
-
-      function Foo() {}
-      Foo.prototype.a = 1;
-
-      lodashStable.each(['a', ['a']], function(path) {
-        assert.strictEqual(func(new Foo, path), !isHas);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `' + (isHas ? 'false' : 'true') + '` for nested inherited properties', function(assert) {
-      assert.expect(2);
-
-      function Foo() {}
-      Foo.prototype.a = { 'b': 1 };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        assert.strictEqual(func(new Foo, path), !isHas);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `true` for index values within bounds for arrays, `arguments` objects, and strings', function(assert) {
-      assert.expect(2);
-
-      var string = Object('abc');
-      delete args[0];
-      delete string[0];
-
-      var values = [Array(3), args, string],
-          expected = lodashStable.map(values, alwaysTrue);
-
-      var actual = lodashStable.map(values, function(value) {
-        return func(value, 0);
-      });
-
-      assert.deepEqual(actual, expected);
-
-      expected = lodashStable.map(values, lodashStable.constant([true, true]));
-
-      actual = lodashStable.map(values, function(value) {
-        return lodashStable.map(['a[0]', ['a', '0']], function(path) {
-          return func({ 'a': value }, path);
-        });
-      });
-
-      assert.deepEqual(actual, expected);
-      args[0] = 1;
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `false` when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [null, undefined],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      lodashStable.each(['constructor', ['constructor']], function(path) {
-        var actual = lodashStable.map(values, function(value) {
-          return func(value, path);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `false` for deep paths when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [null, undefined],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      lodashStable.each(['constructor.prototype.valueOf', ['constructor', 'prototype', 'valueOf']], function(path) {
-        var actual = lodashStable.map(values, function(value) {
-          return func(value, path);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `false` for nullish values of nested objects', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        var actual = lodashStable.map(values, function(value, index) {
-          var object = index ? { 'a': value } : {};
-          return func(object, path);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.head');
-
-  (function() {
-    var array = [1, 2, 3, 4];
-
-    QUnit.test('should return the first element', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.head(array), 1);
-    });
-
-    QUnit.test('should return `undefined` when querying empty arrays', function(assert) {
-      assert.expect(1);
-
-      arrayProto[0] = 1;
-      assert.strictEqual(_.head([]), undefined);
-      arrayProto.length = 0;
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
-          actual = lodashStable.map(array, _.head);
-
-      assert.deepEqual(actual, [1, 4, 7]);
-    });
-
-    QUnit.test('should return an unwrapped value when implicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.strictEqual(_(array).head(), 1);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.ok(_(array).chain().head() instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should not execute immediately when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var wrapped = _(array).chain().head();
-        assert.strictEqual(wrapped.__wrapped__, array);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var largeArray = lodashStable.range(LARGE_ARRAY_SIZE),
-            smallArray = array;
-
-        lodashStable.times(2, function(index) {
-          var array = index ? largeArray : smallArray,
-              wrapped = _(array).filter(isEven);
-
-          assert.strictEqual(wrapped.head(), _.head(_.filter(array, isEven)));
-        });
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should be aliased', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.first, _.head);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.identity');
-
-  (function() {
-    QUnit.test('should return the first argument given', function(assert) {
-      assert.expect(1);
-
-      var object = { 'name': 'fred' };
-      assert.strictEqual(_.identity(object), object);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.includes');
-
-  (function() {
-    lodashStable.each({
-      'an `arguments` object': arguments,
-      'an array': [1, 2, 3, 4],
-      'an object': { 'a': 1, 'b': 2, 'c': 3, 'd': 4 },
-      'a string': '1234'
-    },
-    function(collection, key) {
-      var isStr = typeof collection == 'string',
-          values = _.toArray(collection),
-          length = values.length;
-
-      QUnit.test('should work with ' + key + ' and  return `true` for  matched values', function(assert) {
-        assert.expect(1);
-
-        assert.strictEqual(_.includes(collection, 3), true);
-      });
-
-      QUnit.test('should work with ' + key + ' and  return `false` for unmatched values', function(assert) {
-        assert.expect(1);
-
-        assert.strictEqual(_.includes(collection, 5), false);
-      });
-
-      QUnit.test('should work with ' + key + ' and a positive `fromIndex`', function(assert) {
-        assert.expect(2);
-
-        assert.strictEqual(_.includes(collection, values[2], 2), true);
-        assert.strictEqual(_.includes(collection, values[1], 2), false);
-      });
-
-      QUnit.test('should work with ' + key + ' and a `fromIndex` >= `collection.length`', function(assert) {
-        assert.expect(12);
-
-        lodashStable.each([4, 6, Math.pow(2, 32), Infinity], function(fromIndex) {
-          assert.strictEqual(_.includes(collection, 1, fromIndex), false);
-          assert.strictEqual(_.includes(collection, undefined, fromIndex), false);
-          assert.strictEqual(_.includes(collection, '', fromIndex), (isStr && fromIndex == length));
-        });
-      });
-
-      QUnit.test('should work with ' + key + ' and treat falsey `fromIndex` values as `0`', function(assert) {
-        assert.expect(1);
-
-        var expected = lodashStable.map(falsey, alwaysTrue);
-
-        var actual = lodashStable.map(falsey, function(fromIndex) {
-          return _.includes(collection, values[0], fromIndex);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-
-      QUnit.test('should work with ' + key + ' and coerce non-integer `fromIndex` values to integers', function(assert) {
-        assert.expect(3);
-
-        assert.strictEqual(_.includes(collection, values[0], '1'), false);
-        assert.strictEqual(_.includes(collection, values[0], 0.1), true);
-        assert.strictEqual(_.includes(collection, values[0], NaN), true);
-      });
-
-      QUnit.test('should work with ' + key + ' and a negative `fromIndex`', function(assert) {
-        assert.expect(2);
-
-        assert.strictEqual(_.includes(collection, values[2], -2), true);
-        assert.strictEqual(_.includes(collection, values[1], -2), false);
-      });
-
-      QUnit.test('should work with ' + key + ' and a negative `fromIndex` <= negative `collection.length`', function(assert) {
-        assert.expect(3);
-
-        lodashStable.each([-4, -6, -Infinity], function(fromIndex) {
-          assert.strictEqual(_.includes(collection, values[0], fromIndex), true);
-        });
-      });
-
-      QUnit.test('should work with ' + key + ' and floor `position` values', function(assert) {
-        assert.expect(1);
-
-        assert.strictEqual(_.includes(collection, 2, 1.2), true);
-      });
-
-      QUnit.test('should work with ' + key + ' and return an unwrapped value implicitly when chaining', function(assert) {
-        assert.expect(1);
-
-        if (!isNpm) {
-          assert.strictEqual(_(collection).includes(3), true);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-
-      QUnit.test('should work with ' + key + ' and return a wrapped value when explicitly chaining', function(assert) {
-        assert.expect(1);
-
-        if (!isNpm) {
-          assert.ok(_(collection).chain().includes(3) instanceof _);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    lodashStable.each({
-      'literal': 'abc',
-      'object': Object('abc')
-    },
-    function(collection, key) {
-      QUnit.test('should work with a string ' + key + ' for `collection`', function(assert) {
-        assert.expect(2);
-
-        assert.strictEqual(_.includes(collection, 'bc'), true);
-        assert.strictEqual(_.includes(collection, 'd'), false);
-      });
-    });
-
-    QUnit.test('should return `false` for empty collections', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(empties, alwaysFalse);
-
-      var actual = lodashStable.map(empties, function(value) {
-        try {
-          return _.includes(value);
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should match `NaN`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.includes([1, NaN, 3], NaN), true);
-    });
-
-    QUnit.test('should match `-0` as `0`', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.includes([-0], 0), true);
-      assert.strictEqual(_.includes([0], -0), true);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.every`', function(assert) {
-      assert.expect(1);
-
-      var array1 = [1, 2, 3],
-          array2 = [2, 3, 1];
-
-      assert.ok(lodashStable.every(array1, lodashStable.partial(_.includes, array2)));
-    });
-  }(1, 2, 3, 4));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.indexOf');
-
-  (function() {
-    var array = [1, 2, 3, 1, 2, 3];
-
-    QUnit.test('should return the index of the first matched value', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.indexOf(array, 3), 2);
-    });
-
-    QUnit.test('should work with a positive `fromIndex`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.indexOf(array, 1, 2), 3);
-    });
-
-    QUnit.test('should work with `fromIndex` >= `array.length`', function(assert) {
-      assert.expect(1);
-
-      var values = [6, 8, Math.pow(2, 32), Infinity],
-          expected = lodashStable.map(values, lodashStable.constant([-1, -1, -1]));
-
-      var actual = lodashStable.map(values, function(fromIndex) {
-        return [
-          _.indexOf(array, undefined, fromIndex),
-          _.indexOf(array, 1, fromIndex),
-          _.indexOf(array, '', fromIndex)
-        ];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with a negative `fromIndex`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.indexOf(array, 2, -3), 4);
-    });
-
-    QUnit.test('should work with a negative `fromIndex` <= `-array.length`', function(assert) {
-      assert.expect(1);
-
-      var values = [-6, -8, -Infinity],
-          expected = lodashStable.map(values, alwaysZero);
-
-      var actual = lodashStable.map(values, function(fromIndex) {
-        return _.indexOf(array, 1, fromIndex);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should treat falsey `fromIndex` values as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysZero);
-
-      var actual = lodashStable.map(falsey, function(fromIndex) {
-        return _.indexOf(array, 1, fromIndex);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should coerce `fromIndex` to an integer', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.indexOf(array, 2, 1.2), 1);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.initial');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should accept a falsey `array` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysEmptyArray);
-
-      var actual = lodashStable.map(falsey, function(array, index) {
-        try {
-          return index ? _.initial(array) : _.initial();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should exclude last element', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.initial(array), [1, 2]);
-    });
-
-    QUnit.test('should return an empty when querying empty arrays', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.initial([]), []);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
-          actual = lodashStable.map(array, _.initial);
-
-      assert.deepEqual(actual, [[1, 2], [4, 5], [7, 8]]);
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(4);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE),
-            values = [];
-
-        var actual = _(array).initial().filter(function(value) {
-          values.push(value);
-          return false;
-        })
-        .value();
-
-        assert.deepEqual(actual, []);
-        assert.deepEqual(values, _.initial(array));
-
-        values = [];
-
-        actual = _(array).filter(function(value) {
-          values.push(value);
-          return isEven(value);
-        })
-        .initial()
-        .value();
-
-        assert.deepEqual(actual, _.initial(lodashStable.filter(array, isEven)));
-        assert.deepEqual(values, array);
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.inRange');
-
-  (function() {
-    QUnit.test('should work with an `end` argument', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.inRange(3, 5), true);
-      assert.strictEqual(_.inRange(5, 5), false);
-      assert.strictEqual(_.inRange(6, 5), false);
-    });
-
-    QUnit.test('should work with `start` and `end` arguments', function(assert) {
-      assert.expect(4);
-
-      assert.strictEqual(_.inRange(1, 1, 5), true);
-      assert.strictEqual(_.inRange(3, 1, 5), true);
-      assert.strictEqual(_.inRange(0, 1, 5), false);
-      assert.strictEqual(_.inRange(5, 1, 5), false);
-    });
-
-    QUnit.test('should treat falsey `start` arguments as `0`', function(assert) {
-      assert.expect(13);
-
-      lodashStable.each(falsey, function(value, index) {
-        if (index) {
-          assert.strictEqual(_.inRange(0, value), false);
-          assert.strictEqual(_.inRange(0, value, 1), true);
-        } else {
-          assert.strictEqual(_.inRange(0), false);
-        }
-      });
-    });
-
-    QUnit.test('should swap `start` and `end` when `start` > `end`', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.inRange(2, 5, 1), true);
-      assert.strictEqual(_.inRange(-3, -2, -6), true);
-    });
-
-    QUnit.test('should work with a floating point `n` value', function(assert) {
-      assert.expect(4);
-
-      assert.strictEqual(_.inRange(0.5, 5), true);
-      assert.strictEqual(_.inRange(1.2, 1, 5), true);
-      assert.strictEqual(_.inRange(5.2, 5), false);
-      assert.strictEqual(_.inRange(0.5, 1, 5), false);
-    });
-
-    QUnit.test('should coerce arguments to finite numbers', function(assert) {
-      assert.expect(1);
-
-      var actual = [_.inRange(0, '0', 1), _.inRange(0, '1'), _.inRange(0, 0, '1'), _.inRange(0, NaN, 1), _.inRange(-1, -1, NaN)],
-          expected = lodashStable.map(actual, alwaysTrue);
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('intersection methods');
-
-  lodashStable.each(['intersection', 'intersectionBy', 'intersectionWith'], function(methodName) {
-    var args = (function() { return arguments; }(1, 2, 3)),
-        func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should return the intersection of two arrays', function(assert) {
-      assert.expect(2);
-
-      var actual = func([1, 3, 2], [5, 2, 1, 4]);
-      assert.deepEqual(actual, [1, 2]);
-
-      actual = func([5, 2, 1, 4], [1, 3, 2]);
-      assert.deepEqual(actual, [2, 1]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return the intersection of multiple arrays', function(assert) {
-      assert.expect(2);
-
-      var actual = func([1, 3, 2], [5, 2, 1, 4], [2, 1]);
-      assert.deepEqual(actual, [1, 2]);
-
-      actual = func([5, 2, 1, 4], [2, 1], [1, 3, 2]);
-      assert.deepEqual(actual, [2, 1]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return an array of unique values', function(assert) {
-      assert.expect(1);
-
-      var actual = func([1, 1, 3, 2, 2], [5, 2, 2, 1, 4], [2, 1, 1]);
-      assert.deepEqual(actual, [1, 2]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with a single array', function(assert) {
-      assert.expect(1);
-
-      var actual = func([1, 1, 3, 2, 2]);
-      assert.deepEqual(actual, [1, 3, 2]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with `arguments` objects', function(assert) {
-      assert.expect(2);
-
-      var array = [0, 1, null, 3],
-          expected = [1, 3];
-
-      assert.deepEqual(func(array, args), expected);
-      assert.deepEqual(func(args, array), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat `-0` as `0`', function(assert) {
-      assert.expect(1);
-
-      var values = [-0, 0],
-          expected = lodashStable.map(values, lodashStable.constant(['0']));
-
-      var actual = lodashStable.map(values, function(value) {
-        return lodashStable.map(func(values, [value]), lodashStable.toString);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should match `NaN`', function(assert) {
-      assert.expect(1);
-
-      var actual = func([1, NaN, 3], [NaN, 5, NaN]);
-      assert.deepEqual(actual, [NaN]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays of `-0` as `0`', function(assert) {
-      assert.expect(1);
-
-      var values = [-0, 0],
-          expected = lodashStable.map(values, lodashStable.constant(['0']));
-
-      var actual = lodashStable.map(values, function(value) {
-        var largeArray = lodashStable.times(LARGE_ARRAY_SIZE, lodashStable.constant(value));
-        return lodashStable.map(func(values, largeArray), lodashStable.toString);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays of `NaN`', function(assert) {
-      assert.expect(1);
-
-      var largeArray = lodashStable.times(LARGE_ARRAY_SIZE, alwaysNaN);
-      assert.deepEqual(func([1, NaN, 3], largeArray), [NaN]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays of objects', function(assert) {
-      assert.expect(2);
-
-      var object = {},
-          largeArray = lodashStable.times(LARGE_ARRAY_SIZE, lodashStable.constant(object));
-
-      assert.deepEqual(func([object], largeArray), [object]);
-      assert.deepEqual(func(lodashStable.range(LARGE_ARRAY_SIZE), [1]), [1]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat values that are not arrays or `arguments` objects as empty', function(assert) {
-      assert.expect(3);
-
-      var array = [0, 1, null, 3];
-      assert.deepEqual(func(array, 3, { '0': 1 }, null), []);
-      assert.deepEqual(func(null, array, null, [2, 3]), []);
-      assert.deepEqual(func(array, null, args, null), []);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return a wrapped value when chaining', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var wrapped = _([1, 3, 2])[methodName]([5, 2, 1, 4]);
-        assert.ok(wrapped instanceof _);
-        assert.deepEqual(wrapped.value(), [1, 2]);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.intersectionBy');
-
-  (function() {
-    QUnit.test('should accept an `iteratee` argument', function(assert) {
-      assert.expect(2);
-
-      var actual = _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-      assert.deepEqual(actual, [2.1]);
-
-      actual = _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-      assert.deepEqual(actual, [{ 'x': 1 }]);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.intersectionBy([2.1, 1.2], [4.3, 2.4], function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [4.3]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.intersectionWith');
-
-  (function() {
-    QUnit.test('should work with a `comparator` argument', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }],
-          others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }],
-          actual = _.intersectionWith(objects, others, lodashStable.isEqual);
-
-      assert.deepEqual(actual, [objects[0]]);
-    });
-
-    QUnit.test('should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var array = [-0],
-          largeArray = lodashStable.times(LARGE_ARRAY_SIZE, alwaysZero),
-          others = [[0], largeArray],
-          expected = lodashStable.map(others, lodashStable.constant(['-0']));
-
-      var actual = lodashStable.map(others, function(other) {
-        return lodashStable.map(_.intersectionWith(array, other, lodashStable.eq), lodashStable.toString);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.invert');
-
-  (function() {
-    QUnit.test('should invert an object', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': 1, 'b': 2 },
-          actual = _.invert(object);
-
-      assert.deepEqual(actual, { '1': 'a', '2': 'b' });
-      assert.deepEqual(_.invert(actual), { 'a': '1', 'b': '2' });
-    });
-
-    QUnit.test('should work with values that shadow keys on `Object.prototype`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 'hasOwnProperty', 'b': 'constructor' };
-      assert.deepEqual(_.invert(object), { 'hasOwnProperty': 'a', 'constructor': 'b' });
-    });
-
-    QUnit.test('should work with an object that has a `length` property', function(assert) {
-      assert.expect(1);
-
-      var object = { '0': 'a', '1': 'b', 'length': 2 };
-      assert.deepEqual(_.invert(object), { 'a': '0', 'b': '1', '2': 'length' });
-    });
-
-    QUnit.test('should return a wrapped value when chaining', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var object = { 'a': 1, 'b': 2 },
-            wrapped = _(object).invert();
-
-        assert.ok(wrapped instanceof _);
-        assert.deepEqual(wrapped.value(), { '1': 'a', '2': 'b' });
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.invertBy');
-
-  (function() {
-    var object = { 'a': 1, 'b': 2, 'c': 1 };
-
-    QUnit.test('should transform keys by `iteratee`', function(assert) {
-      assert.expect(1);
-
-      var expected = { 'group1': ['a', 'c'], 'group2': ['b'] };
-
-      var actual = _.invertBy(object, function(value) {
-        return 'group' + value;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant({ '1': ['a', 'c'], '2': ['b'] }));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.invertBy(object, value) : _.invertBy(object);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should only add multiple values to own, not inherited, properties', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 'hasOwnProperty', 'b': 'constructor' },
-          expected = { 'hasOwnProperty': ['a'], 'constructor': ['b'] };
-
-      assert.ok(lodashStable.isEqual(_.invertBy(object), expected));
-    });
-
-    QUnit.test('should return a wrapped value when chaining', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var wrapped = _(object).invertBy();
-
-        assert.ok(wrapped instanceof _);
-        assert.deepEqual(wrapped.value(), { '1': ['a', 'c'], '2': ['b'] });
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.invoke');
-
-  (function() {
-    QUnit.test('should invoke a method on `object`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': lodashStable.constant('A') },
-          actual = _.invoke(object, 'a');
-
-      assert.strictEqual(actual, 'A');
-    });
-
-    QUnit.test('should support invoking with arguments', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': function(a, b) { return [a, b]; } },
-          actual = _.invoke(object, 'a', 1, 2);
-
-      assert.deepEqual(actual, [1, 2]);
-    });
-
-    QUnit.test('should not error on nullish elements', function(assert) {
-      assert.expect(1);
-
-      var values = [null, undefined],
-          expected = lodashStable.map(values, noop);
-
-      var actual = lodashStable.map(values, function(value) {
-        try {
-          return _.invoke(value, 'a.b', 1, 2);
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var object = { '-0': alwaysA, '0': alwaysB },
-          props = [-0, Object(-0), 0, Object(0)];
-
-      var actual = lodashStable.map(props, function(key) {
-        return _.invoke(object, key);
-      });
-
-      assert.deepEqual(actual, ['a', 'a', 'b', 'b']);
-    });
-
-    QUnit.test('should support deep paths', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': function(a, b) { return [a, b]; } } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        var actual = _.invoke(object, path, 1, 2);
-        assert.deepEqual(actual, [1, 2]);
-      });
-    });
-
-    QUnit.test('should invoke deep property methods with the correct `this` binding', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': function() { return this.c; }, 'c': 1 } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        assert.deepEqual(_.invoke(object, path), 1);
-      });
-    });
-
-    QUnit.test('should return an unwrapped value when implicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var object = { 'a': alwaysOne };
-        assert.strictEqual(_(object).invoke('a'), 1);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var object = { 'a': alwaysOne };
-        assert.ok(_(object).chain().invoke('a') instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.invokeMap');
-
-  (function() {
-    QUnit.test('should invoke a methods on each element of `collection`', function(assert) {
-      assert.expect(1);
-
-      var array = ['a', 'b', 'c'],
-          actual = _.invokeMap(array, 'toUpperCase');
-
-      assert.deepEqual(actual, ['A', 'B', 'C']);
-    });
-
-    QUnit.test('should support invoking with arguments', function(assert) {
-      assert.expect(1);
-
-      var array = [function() { return slice.call(arguments); }],
-          actual = _.invokeMap(array, 'call', null, 'a', 'b', 'c');
-
-      assert.deepEqual(actual, [['a', 'b', 'c']]);
-    });
-
-    QUnit.test('should work with a function for `methodName`', function(assert) {
-      assert.expect(1);
-
-      var array = ['a', 'b', 'c'];
-
-      var actual = _.invokeMap(array, function(left, right) {
-        return left + this.toUpperCase() + right;
-      }, '(', ')');
-
-      assert.deepEqual(actual, ['(A)', '(B)', '(C)']);
-    });
-
-    QUnit.test('should work with an object for `collection`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1, 'b': 2, 'c': 3 },
-          actual = _.invokeMap(object, 'toFixed', 1);
-
-      assert.deepEqual(actual, ['1.0', '2.0', '3.0']);
-    });
-
-    QUnit.test('should treat number values for `collection` as empty', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.invokeMap(1), []);
-    });
-
-    QUnit.test('should not error on nullish elements', function(assert) {
-      assert.expect(1);
-
-      var array = ['a', null, undefined, 'd'];
-
-      try {
-        var actual = _.invokeMap(array, 'toUpperCase');
-      } catch (e) {}
-
-      assert.deepEqual(actual, ['A', undefined, undefined, 'D']);
-    });
-
-    QUnit.test('should not error on elements with missing properties', function(assert) {
-      assert.expect(1);
-
-      var objects = lodashStable.map([null, undefined, alwaysOne], function(value) {
-        return { 'a': value };
-      });
-
-      var expected = lodashStable.map(objects, function(object) {
-        return object.a ? object.a() : undefined;
-      });
-
-      try {
-        var actual = _.invokeMap(objects, 'a');
-      } catch (e) {}
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should invoke deep property methods with the correct `this` binding', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': function() { return this.c; }, 'c': 1 } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        assert.deepEqual(_.invokeMap([object], path), [1]);
-      });
-    });
-
-    QUnit.test('should return a wrapped value when chaining', function(assert) {
-      assert.expect(4);
-
-      if (!isNpm) {
-        var array = ['a', 'b', 'c'],
-            wrapped = _(array),
-            actual = wrapped.invokeMap('toUpperCase');
-
-        assert.ok(actual instanceof _);
-        assert.deepEqual(actual.valueOf(), ['A', 'B', 'C']);
-
-        actual = wrapped.invokeMap(function(left, right) {
-          return left + this.toUpperCase() + right;
-        }, '(', ')');
-
-        assert.ok(actual instanceof _);
-        assert.deepEqual(actual.valueOf(), ['(A)', '(B)', '(C)']);
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should support shortcut fusion', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var count = 0,
-            method = function() { count++; return this.index; };
-
-        var array = lodashStable.times(LARGE_ARRAY_SIZE, function(index) {
-          return { 'index': index, 'method': method };
-        });
-
-        var actual = _(array).invokeMap('method').take(1).value();
-
-        assert.strictEqual(count, 1);
-        assert.deepEqual(actual, [0]);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isArguments');
-
-  (function() {
-    var args = (function() { return arguments; }(1, 2, 3)),
-        strictArgs = (function() { 'use strict'; return arguments; }(1, 2, 3));
-
-    QUnit.test('should return `true` for `arguments` objects', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.isArguments(args), true);
-      assert.strictEqual(_.isArguments(strictArgs), true);
-    });
-
-    QUnit.test('should return `false` for non `arguments` objects', function(assert) {
-      assert.expect(12);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isArguments(value) : _.isArguments();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isArguments([1, 2, 3]), false);
-      assert.strictEqual(_.isArguments(true), false);
-      assert.strictEqual(_.isArguments(new Date), false);
-      assert.strictEqual(_.isArguments(new Error), false);
-      assert.strictEqual(_.isArguments(_), false);
-      assert.strictEqual(_.isArguments(slice), false);
-      assert.strictEqual(_.isArguments({ '0': 1, 'callee': noop, 'length': 1 }), false);
-      assert.strictEqual(_.isArguments(1), false);
-      assert.strictEqual(_.isArguments(/x/), false);
-      assert.strictEqual(_.isArguments('a'), false);
-      assert.strictEqual(_.isArguments(symbol), false);
-    });
-
-    QUnit.test('should work with an `arguments` object from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.arguments) {
-        assert.strictEqual(_.isArguments(realm.arguments), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isArray');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for arrays', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.isArray([1, 2, 3]), true);
-    });
-
-    QUnit.test('should return `false` for non-arrays', function(assert) {
-      assert.expect(12);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isArray(value) : _.isArray();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isArray(args), false);
-      assert.strictEqual(_.isArray(true), false);
-      assert.strictEqual(_.isArray(new Date), false);
-      assert.strictEqual(_.isArray(new Error), false);
-      assert.strictEqual(_.isArray(_), false);
-      assert.strictEqual(_.isArray(slice), false);
-      assert.strictEqual(_.isArray({ '0': 1, 'length': 1 }), false);
-      assert.strictEqual(_.isArray(1), false);
-      assert.strictEqual(_.isArray(/x/), false);
-      assert.strictEqual(_.isArray('a'), false);
-      assert.strictEqual(_.isArray(symbol), false);
-    });
-
-    QUnit.test('should work with an array from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.array) {
-        assert.strictEqual(_.isArray(realm.array), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isArrayBuffer');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for array buffers', function(assert) {
-      assert.expect(1);
-
-      if (ArrayBuffer) {
-        assert.strictEqual(_.isArrayBuffer(arrayBuffer), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for non array buffers', function(assert) {
-      assert.expect(13);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isArrayBuffer(value) : _.isArrayBuffer();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isArrayBuffer(args), false);
-      assert.strictEqual(_.isArrayBuffer([1, 2, 3]), false);
-      assert.strictEqual(_.isArrayBuffer(true), false);
-      assert.strictEqual(_.isArrayBuffer(new Date), false);
-      assert.strictEqual(_.isArrayBuffer(new Error), false);
-      assert.strictEqual(_.isArrayBuffer(_), false);
-      assert.strictEqual(_.isArrayBuffer(slice), false);
-      assert.strictEqual(_.isArrayBuffer({ 'a': 1 }), false);
-      assert.strictEqual(_.isArrayBuffer(1), false);
-      assert.strictEqual(_.isArrayBuffer(/x/), false);
-      assert.strictEqual(_.isArrayBuffer('a'), false);
-      assert.strictEqual(_.isArrayBuffer(symbol), false);
-    });
-
-    QUnit.test('should work with array buffers from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.arrayBuffer) {
-        assert.strictEqual(_.isArrayBuffer(realm.arrayBuffer), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isArrayLike');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for array-like values', function(assert) {
-      assert.expect(1);
-
-      var values = [args, [1, 2, 3], { '0': 1, 'length': 1 }, 'a'],
-          expected = lodashStable.map(values, alwaysTrue),
-          actual = lodashStable.map(values, _.isArrayLike);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `false` for non-arrays', function(assert) {
-      assert.expect(11);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === '';
-      });
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isArrayLike(value) : _.isArrayLike();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isArrayLike(true), false);
-      assert.strictEqual(_.isArrayLike(new Date), false);
-      assert.strictEqual(_.isArrayLike(new Error), false);
-      assert.strictEqual(_.isArrayLike(_), false);
-      assert.strictEqual(_.isArrayLike(generator), false);
-      assert.strictEqual(_.isArrayLike(slice), false);
-      assert.strictEqual(_.isArrayLike({ 'a': 1 }), false);
-      assert.strictEqual(_.isArrayLike(1), false);
-      assert.strictEqual(_.isArrayLike(/x/), false);
-      assert.strictEqual(_.isArrayLike(symbol), false);
-    });
-
-    QUnit.test('should work with an array from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.object) {
-        var values = [realm.arguments, realm.array, realm.string],
-            expected = lodashStable.map(values, alwaysTrue),
-            actual = lodashStable.map(values, _.isArrayLike);
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isBoolean');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for booleans', function(assert) {
-      assert.expect(4);
-
-      assert.strictEqual(_.isBoolean(true), true);
-      assert.strictEqual(_.isBoolean(false), true);
-      assert.strictEqual(_.isBoolean(Object(true)), true);
-      assert.strictEqual(_.isBoolean(Object(false)), true);
-    });
-
-    QUnit.test('should return `false` for non-booleans', function(assert) {
-      assert.expect(12);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === false;
-      });
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isBoolean(value) : _.isBoolean();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isBoolean(args), false);
-      assert.strictEqual(_.isBoolean([1, 2, 3]), false);
-      assert.strictEqual(_.isBoolean(new Date), false);
-      assert.strictEqual(_.isBoolean(new Error), false);
-      assert.strictEqual(_.isBoolean(_), false);
-      assert.strictEqual(_.isBoolean(slice), false);
-      assert.strictEqual(_.isBoolean({ 'a': 1 }), false);
-      assert.strictEqual(_.isBoolean(1), false);
-      assert.strictEqual(_.isBoolean(/x/), false);
-      assert.strictEqual(_.isBoolean('a'), false);
-      assert.strictEqual(_.isBoolean(symbol), false);
-    });
-
-    QUnit.test('should work with a boolean from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.boolean) {
-        assert.strictEqual(_.isBoolean(realm.boolean), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isBuffer');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for buffers', function(assert) {
-      assert.expect(1);
-
-      if (Buffer) {
-        assert.strictEqual(_.isBuffer(new Buffer(2)), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for non-buffers', function(assert) {
-      assert.expect(13);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isBuffer(value) : _.isBuffer();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isBuffer(args), false);
-      assert.strictEqual(_.isBuffer([1, 2, 3]), false);
-      assert.strictEqual(_.isBuffer(true), false);
-      assert.strictEqual(_.isBuffer(new Date), false);
-      assert.strictEqual(_.isBuffer(new Error), false);
-      assert.strictEqual(_.isBuffer(_), false);
-      assert.strictEqual(_.isBuffer(slice), false);
-      assert.strictEqual(_.isBuffer({ 'a': 1 }), false);
-      assert.strictEqual(_.isBuffer(1), false);
-      assert.strictEqual(_.isBuffer(/x/), false);
-      assert.strictEqual(_.isBuffer('a'), false);
-      assert.strictEqual(_.isBuffer(symbol), false);
-    });
-
-    QUnit.test('should return `false` if `Buffer` is not defined', function(assert) {
-      assert.expect(1);
-
-      if (!isStrict && Buffer && lodashBizarro) {
-        assert.strictEqual(lodashBizarro.isBuffer(new Buffer(2)), false);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isDate');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for dates', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.isDate(new Date), true);
-    });
-
-    QUnit.test('should return `false` for non-dates', function(assert) {
-      assert.expect(12);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isDate(value) : _.isDate();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isDate(args), false);
-      assert.strictEqual(_.isDate([1, 2, 3]), false);
-      assert.strictEqual(_.isDate(true), false);
-      assert.strictEqual(_.isDate(new Error), false);
-      assert.strictEqual(_.isDate(_), false);
-      assert.strictEqual(_.isDate(slice), false);
-      assert.strictEqual(_.isDate({ 'a': 1 }), false);
-      assert.strictEqual(_.isDate(1), false);
-      assert.strictEqual(_.isDate(/x/), false);
-      assert.strictEqual(_.isDate('a'), false);
-      assert.strictEqual(_.isDate(symbol), false);
-    });
-
-    QUnit.test('should work with a date object from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.date) {
-        assert.strictEqual(_.isDate(realm.date), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isElement');
-
-  (function() {
-    var args = arguments;
-
-    function Element() {
-      this.nodeType = 1;
-    }
-
-    QUnit.test('should return `false` for plain objects', function(assert) {
-      assert.expect(7);
-
-      var element = body || new Element;
-
-      assert.strictEqual(_.isElement(element), true);
-      assert.strictEqual(_.isElement({ 'nodeType': 1 }), false);
-      assert.strictEqual(_.isElement({ 'nodeType': Object(1) }), false);
-      assert.strictEqual(_.isElement({ 'nodeType': true }), false);
-      assert.strictEqual(_.isElement({ 'nodeType': [1] }), false);
-      assert.strictEqual(_.isElement({ 'nodeType': '1' }), false);
-      assert.strictEqual(_.isElement({ 'nodeType': '001' }), false);
-    });
-
-    QUnit.test('should return `false` for non DOM elements', function(assert) {
-      assert.expect(13);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isElement(value) : _.isElement();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isElement(args), false);
-      assert.strictEqual(_.isElement([1, 2, 3]), false);
-      assert.strictEqual(_.isElement(true), false);
-      assert.strictEqual(_.isElement(new Date), false);
-      assert.strictEqual(_.isElement(new Error), false);
-      assert.strictEqual(_.isElement(_), false);
-      assert.strictEqual(_.isElement(slice), false);
-      assert.strictEqual(_.isElement({ 'a': 1 }), false);
-      assert.strictEqual(_.isElement(1), false);
-      assert.strictEqual(_.isElement(/x/), false);
-      assert.strictEqual(_.isElement('a'), false);
-      assert.strictEqual(_.isElement(symbol), false);
-    });
-
-    QUnit.test('should work with a DOM element from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.element) {
-        assert.strictEqual(_.isElement(realm.element), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isEmpty');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for empty values', function(assert) {
-      assert.expect(10);
-
-      var expected = lodashStable.map(empties, alwaysTrue),
-          actual = lodashStable.map(empties, _.isEmpty);
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isEmpty(true), true);
-      assert.strictEqual(_.isEmpty(slice), true);
-      assert.strictEqual(_.isEmpty(1), true);
-      assert.strictEqual(_.isEmpty(NaN), true);
-      assert.strictEqual(_.isEmpty(/x/), true);
-      assert.strictEqual(_.isEmpty(symbol), true);
-      assert.strictEqual(_.isEmpty(), true);
-
-      if (Buffer) {
-        assert.strictEqual(_.isEmpty(new Buffer(0)), true);
-        assert.strictEqual(_.isEmpty(new Buffer(1)), false);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should return `false` for non-empty values', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.isEmpty([0]), false);
-      assert.strictEqual(_.isEmpty({ 'a': 0 }), false);
-      assert.strictEqual(_.isEmpty('a'), false);
-    });
-
-    QUnit.test('should work with an object that has a `length` property', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.isEmpty({ 'length': 0 }), false);
-    });
-
-    QUnit.test('should work with `arguments` objects', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.isEmpty(args), false);
-    });
-
-    QUnit.test('should work with jQuery/MooTools DOM query collections', function(assert) {
-      assert.expect(1);
-
-      function Foo(elements) {
-        push.apply(this, elements);
-      }
-      Foo.prototype = { 'length': 0, 'splice': arrayProto.splice };
-
-      assert.strictEqual(_.isEmpty(new Foo([])), true);
-    });
-
-    QUnit.test('should work with maps', function(assert) {
-      assert.expect(4);
-
-      if (Map) {
-        lodashStable.each([new Map, realm.map], function(map) {
-          assert.strictEqual(_.isEmpty(map), true);
-          map.set('a', 1);
-          assert.strictEqual(_.isEmpty(map), false);
-          map.clear();
-        });
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should work with sets', function(assert) {
-      assert.expect(4);
-
-      if (Set) {
-        lodashStable.each([new Set, realm.set], function(set) {
-          assert.strictEqual(_.isEmpty(set), true);
-          set.add(1);
-          assert.strictEqual(_.isEmpty(set), false);
-          set.clear();
-        });
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should not treat objects with negative lengths as array-like', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.prototype.length = -1;
-
-      assert.strictEqual(_.isEmpty(new Foo), true);
-    });
-
-    QUnit.test('should not treat objects with lengths larger than `MAX_SAFE_INTEGER` as array-like', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.prototype.length = MAX_SAFE_INTEGER + 1;
-
-      assert.strictEqual(_.isEmpty(new Foo), true);
-    });
-
-    QUnit.test('should not treat objects with non-number lengths as array-like', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.isEmpty({ 'length': '0' }), false);
-    });
-
-    QUnit.test('should return an unwrapped value when implicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.strictEqual(_({}).isEmpty(), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.ok(_({}).chain().isEmpty() instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isEqual');
-
-  (function() {
-    var symbol1 = Symbol ? Symbol('a') : true,
-        symbol2 = Symbol ? Symbol('b') : false;
-
-    QUnit.test('should compare primitives', function(assert) {
-      assert.expect(1);
-
-      var pairs = [
-        [1, 1, true], [1, Object(1), true], [1, '1', false], [1, 2, false],
-        [-0, -0, true], [0, 0, true], [0, Object(0), true], [Object(0), Object(0), true], [-0, 0, true], [0, '0', false], [0, null, false],
-        [NaN, NaN, true], [NaN, Object(NaN), true], [Object(NaN), Object(NaN), true], [NaN, 'a', false], [NaN, Infinity, false],
-        ['a', 'a', true], ['a', Object('a'), true], [Object('a'), Object('a'), true], ['a', 'b', false], ['a', ['a'], false],
-        [true, true, true], [true, Object(true), true], [Object(true), Object(true), true], [true, 1, false], [true, 'a', false],
-        [false, false, true], [false, Object(false), true], [Object(false), Object(false), true], [false, 0, false], [false, '', false],
-        [symbol1, symbol1, true], [symbol1, Object(symbol1), true], [Object(symbol1), Object(symbol1), true], [symbol1, symbol2, false],
-        [null, null, true], [null, undefined, false], [null, {}, false], [null, '', false],
-        [undefined, undefined, true], [undefined, null, false], [undefined, '', false]
-      ];
-
-      var expected = lodashStable.map(pairs, function(pair) {
-        return pair[2];
-      });
-
-      var actual = lodashStable.map(pairs, function(pair) {
-        return _.isEqual(pair[0], pair[1]);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should compare arrays', function(assert) {
-      assert.expect(6);
-
-      var array1 = [true, null, 1, 'a', undefined],
-          array2 = [true, null, 1, 'a', undefined];
-
-      assert.strictEqual(_.isEqual(array1, array2), true);
-
-      array1 = [[1, 2, 3], new Date(2012, 4, 23), /x/, { 'e': 1 }];
-      array2 = [[1, 2, 3], new Date(2012, 4, 23), /x/, { 'e': 1 }];
-
-      assert.strictEqual(_.isEqual(array1, array2), true);
-
-      array1 = [1];
-      array1[2] = 3;
-
-      array2 = [1];
-      array2[1] = undefined;
-      array2[2] = 3;
-
-      assert.strictEqual(_.isEqual(array1, array2), true);
-
-      array1 = [Object(1), false, Object('a'), /x/, new Date(2012, 4, 23), ['a', 'b', [Object('c')]], { 'a': 1 }];
-      array2 = [1, Object(false), 'a', /x/, new Date(2012, 4, 23), ['a', Object('b'), ['c']], { 'a': 1 }];
-
-      assert.strictEqual(_.isEqual(array1, array2), true);
-
-      array1 = [1, 2, 3];
-      array2 = [3, 2, 1];
-
-      assert.strictEqual(_.isEqual(array1, array2), false);
-
-      array1 = [1, 2];
-      array2 = [1, 2, 3];
-
-      assert.strictEqual(_.isEqual(array1, array2), false);
-    });
-
-    QUnit.test('should treat arrays with identical values but different non-index properties as equal', function(assert) {
-      assert.expect(3);
-
-      var array1 = [1, 2, 3],
-          array2 = [1, 2, 3];
-
-      array1.every = array1.filter = array1.forEach =
-      array1.indexOf = array1.lastIndexOf = array1.map =
-      array1.some = array1.reduce = array1.reduceRight = null;
-
-      array2.concat = array2.join = array2.pop =
-      array2.reverse = array2.shift = array2.slice =
-      array2.sort = array2.splice = array2.unshift = null;
-
-      assert.strictEqual(_.isEqual(array1, array2), true);
-
-      array1 = [1, 2, 3];
-      array1.a = 1;
-
-      array2 = [1, 2, 3];
-      array2.b = 1;
-
-      assert.strictEqual(_.isEqual(array1, array2), true);
-
-      array1 = /c/.exec('abcde');
-      array2 = ['c'];
-
-      assert.strictEqual(_.isEqual(array1, array2), true);
-    });
-
-    QUnit.test('should compare sparse arrays', function(assert) {
-      assert.expect(3);
-
-      var array = Array(1);
-
-      assert.strictEqual(_.isEqual(array, Array(1)), true);
-      assert.strictEqual(_.isEqual(array, [undefined]), true);
-      assert.strictEqual(_.isEqual(array, Array(2)), false);
-    });
-
-    QUnit.test('should compare plain objects', function(assert) {
-      assert.expect(5);
-
-      var object1 = { 'a': true, 'b': null, 'c': 1, 'd': 'a', 'e': undefined },
-          object2 = { 'a': true, 'b': null, 'c': 1, 'd': 'a', 'e': undefined };
-
-      assert.strictEqual(_.isEqual(object1, object2), true);
-
-      object1 = { 'a': [1, 2, 3], 'b': new Date(2012, 4, 23), 'c': /x/, 'd': { 'e': 1 } };
-      object2 = { 'a': [1, 2, 3], 'b': new Date(2012, 4, 23), 'c': /x/, 'd': { 'e': 1 } };
-
-      assert.strictEqual(_.isEqual(object1, object2), true);
-
-      object1 = { 'a': 1, 'b': 2, 'c': 3 };
-      object2 = { 'a': 3, 'b': 2, 'c': 1 };
-
-      assert.strictEqual(_.isEqual(object1, object2), false);
-
-      object1 = { 'a': 1, 'b': 2, 'c': 3 };
-      object2 = { 'd': 1, 'e': 2, 'f': 3 };
-
-      assert.strictEqual(_.isEqual(object1, object2), false);
-
-      object1 = { 'a': 1, 'b': 2 };
-      object2 = { 'a': 1, 'b': 2, 'c': 3 };
-
-      assert.strictEqual(_.isEqual(object1, object2), false);
-    });
-
-    QUnit.test('should compare objects regardless of key order', function(assert) {
-      assert.expect(1);
-
-      var object1 = { 'a': 1, 'b': 2, 'c': 3 },
-          object2 = { 'c': 3, 'a': 1, 'b': 2 };
-
-      assert.strictEqual(_.isEqual(object1, object2), true);
-    });
-
-    QUnit.test('should compare nested objects', function(assert) {
-      assert.expect(1);
-
-      var object1 = {
-        'a': [1, 2, 3],
-        'b': true,
-        'c': Object(1),
-        'd': 'a',
-        'e': {
-          'f': ['a', Object('b'), 'c'],
-          'g': Object(false),
-          'h': new Date(2012, 4, 23),
-          'i': noop,
-          'j': 'a'
-        }
-      };
-
-      var object2 = {
-        'a': [1, Object(2), 3],
-        'b': Object(true),
-        'c': 1,
-        'd': Object('a'),
-        'e': {
-          'f': ['a', 'b', 'c'],
-          'g': false,
-          'h': new Date(2012, 4, 23),
-          'i': noop,
-          'j': 'a'
-        }
-      };
-
-      assert.strictEqual(_.isEqual(object1, object2), true);
-    });
-
-    QUnit.test('should compare object instances', function(assert) {
-      assert.expect(4);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.a = 1;
-
-      function Bar() {
-        this.a = 1;
-      }
-      Bar.prototype.a = 2;
-
-      assert.strictEqual(_.isEqual(new Foo, new Foo), true);
-      assert.strictEqual(_.isEqual(new Foo, new Bar), false);
-      assert.strictEqual(_.isEqual({ 'a': 1 }, new Foo), false);
-      assert.strictEqual(_.isEqual({ 'a': 2 }, new Bar), false);
-    });
-
-    QUnit.test('should compare objects with constructor properties', function(assert) {
-      assert.expect(5);
-
-      assert.strictEqual(_.isEqual({ 'constructor': 1 },   { 'constructor': 1 }), true);
-      assert.strictEqual(_.isEqual({ 'constructor': 1 },   { 'constructor': '1' }), false);
-      assert.strictEqual(_.isEqual({ 'constructor': [1] }, { 'constructor': [1] }), true);
-      assert.strictEqual(_.isEqual({ 'constructor': [1] }, { 'constructor': ['1'] }), false);
-      assert.strictEqual(_.isEqual({ 'constructor': Object }, {}), false);
-    });
-
-    QUnit.test('should compare arrays with circular references', function(assert) {
-      assert.expect(4);
-
-      var array1 = [],
-          array2 = [];
-
-      array1.push(array1);
-      array2.push(array2);
-
-      assert.strictEqual(_.isEqual(array1, array2), true);
-
-      array1.push('b');
-      array2.push('b');
-
-      assert.strictEqual(_.isEqual(array1, array2), true);
-
-      array1.push('c');
-      array2.push('d');
-
-      assert.strictEqual(_.isEqual(array1, array2), false);
-
-      array1 = ['a', 'b', 'c'];
-      array1[1] = array1;
-      array2 = ['a', ['a', 'b', 'c'], 'c'];
-
-      assert.strictEqual(_.isEqual(array1, array2), false);
-    });
-
-    QUnit.test('should compare objects with circular references', function(assert) {
-      assert.expect(4);
-
-      var object1 = {},
-          object2 = {};
-
-      object1.a = object1;
-      object2.a = object2;
-
-      assert.strictEqual(_.isEqual(object1, object2), true);
-
-      object1.b = 0;
-      object2.b = Object(0);
-
-      assert.strictEqual(_.isEqual(object1, object2), true);
-
-      object1.c = Object(1);
-      object2.c = Object(2);
-
-      assert.strictEqual(_.isEqual(object1, object2), false);
-
-      object1 = { 'a': 1, 'b': 2, 'c': 3 };
-      object1.b = object1;
-      object2 = { 'a': 1, 'b': { 'a': 1, 'b': 2, 'c': 3 }, 'c': 3 };
-
-      assert.strictEqual(_.isEqual(object1, object2), false);
-    });
-
-    QUnit.test('should compare objects with multiple circular references', function(assert) {
-      assert.expect(3);
-
-      var array1 = [{}],
-          array2 = [{}];
-
-      (array1[0].a = array1).push(array1);
-      (array2[0].a = array2).push(array2);
-
-      assert.strictEqual(_.isEqual(array1, array2), true);
-
-      array1[0].b = 0;
-      array2[0].b = Object(0);
-
-      assert.strictEqual(_.isEqual(array1, array2), true);
-
-      array1[0].c = Object(1);
-      array2[0].c = Object(2);
-
-      assert.strictEqual(_.isEqual(array1, array2), false);
-    });
-
-    QUnit.test('should compare objects with complex circular references', function(assert) {
-      assert.expect(1);
-
-      var object1 = {
-        'foo': { 'b': { 'c': { 'd': {} } } },
-        'bar': { 'a': 2 }
-      };
-
-      var object2 = {
-        'foo': { 'b': { 'c': { 'd': {} } } },
-        'bar': { 'a': 2 }
-      };
-
-      object1.foo.b.c.d = object1;
-      object1.bar.b = object1.foo.b;
-
-      object2.foo.b.c.d = object2;
-      object2.bar.b = object2.foo.b;
-
-      assert.strictEqual(_.isEqual(object1, object2), true);
-    });
-
-    QUnit.test('should compare objects with shared property values', function(assert) {
-      assert.expect(1);
-
-      var object1 = {
-        'a': [1, 2]
-      };
-
-      var object2 = {
-        'a': [1, 2],
-        'b': [1, 2]
-      };
-
-      object1.b = object1.a;
-
-      assert.strictEqual(_.isEqual(object1, object2), true);
-    });
-
-    QUnit.test('should treat objects created by `Object.create(null)` like a plain object', function(assert) {
-      assert.expect(2);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.constructor = null;
-
-      var object2 = { 'a': 1 };
-      assert.strictEqual(_.isEqual(new Foo, object2), false);
-
-      if (create)  {
-        var object1 = create(null);
-        object1.a = 1;
-        assert.strictEqual(_.isEqual(object1, object2), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for objects with custom `toString` methods', function(assert) {
-      assert.expect(1);
-
-      var primitive,
-          object = { 'toString': function() { return primitive; } },
-          values = [true, null, 1, 'a', undefined],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      var actual = lodashStable.map(values, function(value) {
-        primitive = value;
-        return _.isEqual(object, value);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should avoid common type coercions', function(assert) {
-      assert.expect(9);
-
-      assert.strictEqual(_.isEqual(true, Object(false)), false);
-      assert.strictEqual(_.isEqual(Object(false), Object(0)), false);
-      assert.strictEqual(_.isEqual(false, Object('')), false);
-      assert.strictEqual(_.isEqual(Object(36), Object('36')), false);
-      assert.strictEqual(_.isEqual(0, ''), false);
-      assert.strictEqual(_.isEqual(1, true), false);
-      assert.strictEqual(_.isEqual(1337756400000, new Date(2012, 4, 23)), false);
-      assert.strictEqual(_.isEqual('36', 36), false);
-      assert.strictEqual(_.isEqual(36, '36'), false);
-    });
-
-    QUnit.test('should compare `arguments` objects', function(assert) {
-      assert.expect(2);
-
-      var args1 = (function() { return arguments; }(1, 2, 3)),
-          args2 = (function() { return arguments; }(1, 2, 3)),
-          args3 = (function() { return arguments; }(1, 2));
-
-      assert.strictEqual(_.isEqual(args1, args2), true);
-      assert.strictEqual(_.isEqual(args1, args3), false);
-    });
-
-    QUnit.test('should treat `arguments` objects like `Object` objects', function(assert) {
-      assert.expect(4);
-
-      var args = (function() { return arguments; }(1, 2, 3)),
-          object = { '0': 1, '1': 2, '2': 3 };
-
-      function Foo() {}
-      Foo.prototype = object;
-
-      assert.strictEqual(_.isEqual(args, object), true);
-      assert.strictEqual(_.isEqual(object, args), true);
-
-      assert.strictEqual(_.isEqual(args, new Foo), false);
-      assert.strictEqual(_.isEqual(new Foo, args), false);
-    });
-
-    QUnit.test('should compare array buffers', function(assert) {
-      assert.expect(2);
-
-      if (ArrayBuffer) {
-        var buffer1 = new ArrayBuffer(4),
-            buffer2 = new ArrayBuffer(8);
-
-        assert.strictEqual(_.isEqual(buffer1, buffer2), false);
-
-        buffer1 = new Int8Array([-1]).buffer;
-        buffer2 = new Uint8Array([255]).buffer;
-
-        assert.strictEqual(_.isEqual(buffer1, buffer2), true);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should compare array views', function(assert) {
-      assert.expect(2);
-
-      lodashStable.times(2, function(index) {
-        var ns = index ? realm : root;
-
-        var pairs = lodashStable.map(arrayViews, function(type, viewIndex) {
-          var otherType = arrayViews[(viewIndex + 1) % arrayViews.length],
-              CtorA = ns[type] || function(n) { this.n = n; },
-              CtorB = ns[otherType] || function(n) { this.n = n; },
-              bufferA = ns[type] ? new ns.ArrayBuffer(8) : 8,
-              bufferB = ns[otherType] ? new ns.ArrayBuffer(8) : 8,
-              bufferC = ns[otherType] ? new ns.ArrayBuffer(16) : 16;
-
-          return [new CtorA(bufferA), new CtorA(bufferA), new CtorB(bufferB), new CtorB(bufferC)];
-        });
-
-        var expected = lodashStable.map(pairs, lodashStable.constant([true, false, false]));
-
-        var actual = lodashStable.map(pairs, function(pair) {
-          return [_.isEqual(pair[0], pair[1]), _.isEqual(pair[0], pair[2]), _.isEqual(pair[2], pair[3])];
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should compare date objects', function(assert) {
-      assert.expect(4);
-
-      var date = new Date(2012, 4, 23);
-
-      assert.strictEqual(_.isEqual(date, new Date(2012, 4, 23)), true);
-      assert.strictEqual(_.isEqual(date, new Date(2013, 3, 25)), false);
-      assert.strictEqual(_.isEqual(date, { 'getTime': lodashStable.constant(+date) }), false);
-      assert.strictEqual(_.isEqual(new Date('a'), new Date('a')), false);
-    });
-
-    QUnit.test('should compare error objects', function(assert) {
-      assert.expect(1);
-
-      var pairs = lodashStable.map([
-        'Error',
-        'EvalError',
-        'RangeError',
-        'ReferenceError',
-        'SyntaxError',
-        'TypeError',
-        'URIError'
-      ], function(type, index, errorTypes) {
-        var otherType = errorTypes[++index % errorTypes.length],
-            CtorA = root[type],
-            CtorB = root[otherType];
-
-        return [new CtorA('a'), new CtorA('a'), new CtorB('a'), new CtorB('b')];
-      });
-
-      var expected = lodashStable.map(pairs, lodashStable.constant([true, false, false]));
-
-      var actual = lodashStable.map(pairs, function(pair) {
-        return [_.isEqual(pair[0], pair[1]), _.isEqual(pair[0], pair[2]), _.isEqual(pair[2], pair[3])];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should compare functions', function(assert) {
-      assert.expect(2);
-
-      function a() { return 1 + 2; }
-      function b() { return 1 + 2; }
-
-      assert.strictEqual(_.isEqual(a, a), true);
-      assert.strictEqual(_.isEqual(a, b), false);
-    });
-
-    QUnit.test('should compare maps', function(assert) {
-      assert.expect(8);
-
-      if (Map) {
-        lodashStable.each([[map, new Map], [map, realm.map]], function(maps) {
-          var map1 = maps[0],
-              map2 = maps[1];
-
-          map1.set('a', 1);
-          map2.set('b', 2);
-          assert.strictEqual(_.isEqual(map1, map2), false);
-
-          map1.set('b', 2);
-          map2.set('a', 1);
-          assert.strictEqual(_.isEqual(map1, map2), true);
-
-          map1['delete']('a');
-          map1.set('a', 1);
-          assert.strictEqual(_.isEqual(map1, map2), true);
-
-          map2['delete']('a');
-          assert.strictEqual(_.isEqual(map1, map2), false);
-
-          map1.clear();
-          map2.clear();
-        });
-      }
-      else {
-        skipAssert(assert, 8);
-      }
-    });
-
-    QUnit.test('should compare maps with circular references', function(assert) {
-      assert.expect(2);
-
-      if (Map) {
-        var map1 = new Map,
-            map2 = new Map;
-
-        map1.set('a', map1);
-        map2.set('a', map2);
-        assert.strictEqual(_.isEqual(map1, map2), true);
-
-        map1.set('b', 1);
-        map2.set('b', 2);
-        assert.strictEqual(_.isEqual(map1, map2), false);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should compare promises by reference', function(assert) {
-      assert.expect(4);
-
-      if (promise) {
-        lodashStable.each([[promise, Promise.resolve(1)], [promise, realm.promise]], function(promises) {
-          var promise1 = promises[0],
-              promise2 = promises[1];
-
-          assert.strictEqual(_.isEqual(promise1, promise2), false);
-          assert.strictEqual(_.isEqual(promise1, promise1), true);
-        });
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should compare regexes', function(assert) {
-      assert.expect(5);
-
-      assert.strictEqual(_.isEqual(/x/gim, /x/gim), true);
-      assert.strictEqual(_.isEqual(/x/gim, /x/mgi), true);
-      assert.strictEqual(_.isEqual(/x/gi, /x/g), false);
-      assert.strictEqual(_.isEqual(/x/, /y/), false);
-      assert.strictEqual(_.isEqual(/x/g, { 'global': true, 'ignoreCase': false, 'multiline': false, 'source': 'x' }), false);
-    });
-
-    QUnit.test('should compare sets', function(assert) {
-      assert.expect(8);
-
-      if (Set) {
-        lodashStable.each([[set, new Set], [set, realm.set]], function(sets) {
-          var set1 = sets[0],
-              set2 = sets[1];
-
-          set1.add(1);
-          set2.add(2);
-          assert.strictEqual(_.isEqual(set1, set2), false);
-
-          set1.add(2);
-          set2.add(1);
-          assert.strictEqual(_.isEqual(set1, set2), true);
-
-          set1['delete'](1);
-          set1.add(1);
-          assert.strictEqual(_.isEqual(set1, set2), true);
-
-          set2['delete'](1);
-          assert.strictEqual(_.isEqual(set1, set2), false);
-
-          set1.clear();
-          set2.clear();
-        });
-      }
-      else {
-        skipAssert(assert, 8);
-      }
-    });
-
-    QUnit.test('should compare sets with circular references', function(assert) {
-      assert.expect(2);
-
-      if (Set) {
-        var set1 = new Set,
-            set2 = new Set;
-
-        set1.add(set1);
-        set2.add(set2);
-        assert.strictEqual(_.isEqual(set1, set2), true);
-
-        set1.add(1);
-        set2.add(2);
-        assert.strictEqual(_.isEqual(set1, set2), false);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should work as an iteratee for `_.every`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.every([1, 1, 1], lodashStable.partial(_.isEqual, 1));
-      assert.ok(actual);
-    });
-
-    QUnit.test('should return `true` for like-objects from different documents', function(assert) {
-      assert.expect(4);
-
-      if (realm.object) {
-        assert.strictEqual(_.isEqual([1], realm.array), true);
-        assert.strictEqual(_.isEqual([2], realm.array), false);
-        assert.strictEqual(_.isEqual({ 'a': 1 }, realm.object), true);
-        assert.strictEqual(_.isEqual({ 'a': 2 }, realm.object), false);
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should not error on DOM elements', function(assert) {
-      assert.expect(1);
-
-      if (document) {
-        var element1 = document.createElement('div'),
-            element2 = element1.cloneNode(true);
-
-        try {
-          assert.strictEqual(_.isEqual(element1, element2), false);
-        } catch (e) {
-          assert.ok(false, e.message);
-        }
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should compare wrapped values', function(assert) {
-      assert.expect(32);
-
-      var stamp = +new Date;
-
-      var values = [
-        [[1, 2], [1, 2], [1, 2, 3]],
-        [true, true, false],
-        [new Date(stamp), new Date(stamp), new Date(stamp - 100)],
-        [{ 'a': 1, 'b': 2 }, { 'a': 1, 'b': 2 }, { 'a': 1, 'b': 1 }],
-        [1, 1, 2],
-        [NaN, NaN, Infinity],
-        [/x/, /x/, /x/i],
-        ['a', 'a', 'A']
-      ];
-
-      lodashStable.each(values, function(vals) {
-        if (!isNpm) {
-          var wrapped1 = _(vals[0]),
-              wrapped2 = _(vals[1]),
-              actual = wrapped1.isEqual(wrapped2);
-
-          assert.strictEqual(actual, true);
-          assert.strictEqual(_.isEqual(_(actual), _(true)), true);
-
-          wrapped1 = _(vals[0]);
-          wrapped2 = _(vals[2]);
-
-          actual = wrapped1.isEqual(wrapped2);
-          assert.strictEqual(actual, false);
-          assert.strictEqual(_.isEqual(_(actual), _(false)), true);
-        }
-        else {
-          skipAssert(assert, 4);
-        }
-      });
-    });
-
-    QUnit.test('should compare wrapped and non-wrapped values', function(assert) {
-      assert.expect(4);
-
-      if (!isNpm) {
-        var object1 = _({ 'a': 1, 'b': 2 }),
-            object2 = { 'a': 1, 'b': 2 };
-
-        assert.strictEqual(object1.isEqual(object2), true);
-        assert.strictEqual(_.isEqual(object1, object2), true);
-
-        object1 = _({ 'a': 1, 'b': 2 });
-        object2 = { 'a': 1, 'b': 1 };
-
-        assert.strictEqual(object1.isEqual(object2), false);
-        assert.strictEqual(_.isEqual(object1, object2), false);
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should return an unwrapped value when implicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.strictEqual(_('a').isEqual('a'), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.ok(_('a').chain().isEqual('a') instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isEqualWith');
-
-  (function() {
-    QUnit.test('should provide the correct `customizer` arguments', function(assert) {
-      assert.expect(1);
-
-      var argsList = [],
-          object1 = { 'a': [1, 2], 'b': null },
-          object2 = { 'a': [1, 2], 'b': null };
-
-      object1.b = object2;
-      object2.b = object1;
-
-      var expected = [
-        [object1, object2],
-        [object1.a, object2.a, 'a', object1, object2],
-        [object1.a[0], object2.a[0], 0, object1.a, object2.a],
-        [object1.a[1], object2.a[1], 1, object1.a, object2.a],
-        [object1.b, object2.b, 'b', object1.b, object2.b],
-        [object1.b.a, object2.b.a, 'a', object1.b, object2.b],
-        [object1.b.a[0], object2.b.a[0], 0, object1.b.a, object2.b.a],
-        [object1.b.a[1], object2.b.a[1], 1, object1.b.a, object2.b.a],
-        [object1.b.b, object2.b.b, 'b', object1.b.b, object2.b.b]
-      ];
-
-      _.isEqualWith(object1, object2, function(assert) {
-        var length = arguments.length,
-            args = slice.call(arguments, 0, length - (length > 2 ? 1 : 0));
-
-        argsList.push(args);
-      });
-
-      assert.deepEqual(argsList, expected);
-    });
-
-    QUnit.test('should handle comparisons if `customizer` returns `undefined`', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.isEqualWith('a', 'a', noop), true);
-      assert.strictEqual(_.isEqualWith(['a'], ['a'], noop), true);
-      assert.strictEqual(_.isEqualWith({ '0': 'a' }, { '0': 'a' }, noop), true);
-    });
-
-    QUnit.test('should not handle comparisons if `customizer` returns `true`', function(assert) {
-      assert.expect(3);
-
-      var customizer = function(value) {
-        return _.isString(value) || undefined;
-      };
-
-      assert.strictEqual(_.isEqualWith('a', 'b', customizer), true);
-      assert.strictEqual(_.isEqualWith(['a'], ['b'], customizer), true);
-      assert.strictEqual(_.isEqualWith({ '0': 'a' }, { '0': 'b' }, customizer), true);
-    });
-
-    QUnit.test('should not handle comparisons if `customizer` returns `false`', function(assert) {
-      assert.expect(3);
-
-      var customizer = function(value) {
-        return _.isString(value) ? false : undefined;
-      };
-
-      assert.strictEqual(_.isEqualWith('a', 'a', customizer), false);
-      assert.strictEqual(_.isEqualWith(['a'], ['a'], customizer), false);
-      assert.strictEqual(_.isEqualWith({ '0': 'a' }, { '0': 'a' }, customizer), false);
-    });
-
-    QUnit.test('should return a boolean value even if `customizer` does not', function(assert) {
-      assert.expect(2);
-
-      var actual = _.isEqualWith('a', 'b', alwaysC);
-      assert.strictEqual(actual, true);
-
-      var values = _.without(falsey, undefined),
-          expected = lodashStable.map(values, alwaysFalse);
-
-      actual = [];
-      lodashStable.each(values, function(value) {
-        actual.push(_.isEqualWith('a', 'a', lodashStable.constant(value)));
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should ensure `customizer` is a function', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3],
-          eq = _.partial(_.isEqualWith, array),
-          actual = lodashStable.map([array, [1, 0, 3]], eq);
-
-      assert.deepEqual(actual, [true, false]);
-    });
-
-    QUnit.test('should call `customizer` for values maps and sets', function(assert) {
-      assert.expect(2);
-
-      var value = { 'a': { 'b': 2 } };
-
-      if (Map) {
-        var map1 = new Map;
-        map1.set('a', value);
-
-        var map2 = new Map;
-        map2.set('a', value);
-      }
-      if (Set) {
-        var set1 = new Set;
-        set1.add(value);
-
-        var set2 = new Set;
-        set2.add(value);
-      }
-      lodashStable.each([[map1, map2], [set1, set2]], function(pair, index) {
-        if (pair[0]) {
-          var argsList = [],
-              array = _.toArray(pair[0]);
-
-          var expected = [
-            [pair[0], pair[1]],
-            [array[0], array[0], 0, array, array],
-            [array[0][0], array[0][0], 0, array[0], array[0]],
-            [array[0][1], array[0][1], 1, array[0], array[0]]
-          ];
-
-          if (index) {
-            expected.length = 2;
-          }
-          _.isEqualWith(pair[0], pair[1], function() {
-            var length = arguments.length,
-                args = slice.call(arguments, 0, length - (length > 2 ? 1 : 0));
-
-            argsList.push(args);
-          });
-
-          assert.deepEqual(argsList, expected, index ? 'Set' : 'Map');
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isError');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for error objects', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(errors, alwaysTrue);
-
-      var actual = lodashStable.map(errors, function(error) {
-        return _.isError(error) === true;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `true` for subclassed values', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.isError(new CustomError('x')), true);
-    });
-
-    QUnit.test('should return `false` for non error objects', function(assert) {
-      assert.expect(12);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isError(value) : _.isError();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isError(args), false);
-      assert.strictEqual(_.isError([1, 2, 3]), false);
-      assert.strictEqual(_.isError(true), false);
-      assert.strictEqual(_.isError(new Date), false);
-      assert.strictEqual(_.isError(_), false);
-      assert.strictEqual(_.isError(slice), false);
-      assert.strictEqual(_.isError({ 'a': 1 }), false);
-      assert.strictEqual(_.isError(1), false);
-      assert.strictEqual(_.isError(/x/), false);
-      assert.strictEqual(_.isError('a'), false);
-      assert.strictEqual(_.isError(symbol), false);
-    });
-
-    QUnit.test('should work with an error object from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.errors) {
-        var expected = lodashStable.map(realm.errors, alwaysTrue);
-
-        var actual = lodashStable.map(realm.errors, function(error) {
-          return _.isError(error) === true;
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isFinite');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for finite values', function(assert) {
-      assert.expect(1);
-
-      var values = [0, 1, 3.14, -1],
-          expected = lodashStable.map(values, alwaysTrue),
-          actual = lodashStable.map(values, _.isFinite);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `false` for non-finite values', function(assert) {
-      assert.expect(1);
-
-      var values = [NaN, Infinity, -Infinity, Object(1)],
-          expected = lodashStable.map(values, alwaysFalse),
-          actual = lodashStable.map(values, _.isFinite);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `false` for non-numeric values', function(assert) {
-      assert.expect(10);
-
-      var values = [undefined, [], true, '', ' ', '2px'],
-          expected = lodashStable.map(values, alwaysFalse),
-          actual = lodashStable.map(values, _.isFinite);
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isFinite(args), false);
-      assert.strictEqual(_.isFinite([1, 2, 3]), false);
-      assert.strictEqual(_.isFinite(true), false);
-      assert.strictEqual(_.isFinite(new Date), false);
-      assert.strictEqual(_.isFinite(new Error), false);
-      assert.strictEqual(_.isFinite({ 'a': 1 }), false);
-      assert.strictEqual(_.isFinite(/x/), false);
-      assert.strictEqual(_.isFinite('a'), false);
-      assert.strictEqual(_.isFinite(symbol), false);
-    });
-
-    QUnit.test('should return `false` for numeric string values', function(assert) {
-      assert.expect(1);
-
-      var values = ['2', '0', '08'],
-          expected = lodashStable.map(values, alwaysFalse),
-          actual = lodashStable.map(values, _.isFinite);
-
-      assert.deepEqual(actual, expected);
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isFunction');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for functions', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.isFunction(_), true);
-      assert.strictEqual(_.isFunction(slice), true);
-    });
-
-    QUnit.test('should return `true` for generator functions', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.isFunction(generator), typeof generator == 'function');
-    });
-
-    QUnit.test('should return `true` for array view constructors', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(arrayViews, function(type) {
-        return objToString.call(root[type]) == funcTag;
-      });
-
-      var actual = lodashStable.map(arrayViews, function(type) {
-        return _.isFunction(root[type]);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `false` for non-functions', function(assert) {
-      assert.expect(12);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isFunction(value) : _.isFunction();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isFunction(args), false);
-      assert.strictEqual(_.isFunction([1, 2, 3]), false);
-      assert.strictEqual(_.isFunction(true), false);
-      assert.strictEqual(_.isFunction(new Date), false);
-      assert.strictEqual(_.isFunction(new Error), false);
-      assert.strictEqual(_.isFunction({ 'a': 1 }), false);
-      assert.strictEqual(_.isFunction(1), false);
-      assert.strictEqual(_.isFunction(/x/), false);
-      assert.strictEqual(_.isFunction('a'), false);
-      assert.strictEqual(_.isFunction(symbol), false);
-
-      if (document) {
-        assert.strictEqual(_.isFunction(document.getElementsByTagName('body')), false);
-      } else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should work with host objects in IE 8 document mode (test in IE 11)', function(assert) {
-      assert.expect(2);
-
-      // Trigger a Chakra JIT bug.
-      // See https://github.com/jashkenas/underscore/issues/1621.
-      lodashStable.each([body, xml], function(object) {
-        if (object) {
-          lodashStable.times(100, _.isFunction);
-          assert.strictEqual(_.isFunction(object), false);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    QUnit.test('should work with a function from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.function) {
-        assert.strictEqual(_.isFunction(realm.function), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('isInteger methods');
-
-  lodashStable.each(['isInteger', 'isSafeInteger'], function(methodName) {
-    var args = arguments,
-        func = _[methodName],
-        isSafe = methodName == 'isSafeInteger';
-
-    QUnit.test('`_.' + methodName + '` should return `true` for integer values', function(assert) {
-      assert.expect(2);
-
-      var values = [-1, 0, 1],
-          expected = lodashStable.map(values, alwaysTrue);
-
-      var actual = lodashStable.map(values, function(value) {
-        return func(value);
-      });
-
-      assert.deepEqual(actual, expected);
-      assert.strictEqual(func(MAX_INTEGER), !isSafe);
-    });
-
-    QUnit.test('should return `false` for non-integer number values', function(assert) {
-      assert.expect(1);
-
-      var values = [NaN, Infinity, -Infinity, Object(1), 3.14],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      var actual = lodashStable.map(values, function(value) {
-        return func(value);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `false` for non-numeric values', function(assert) {
-      assert.expect(10);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === 0;
-      });
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? func(value) : func();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(func(args), false);
-      assert.strictEqual(func([1, 2, 3]), false);
-      assert.strictEqual(func(true), false);
-      assert.strictEqual(func(new Date), false);
-      assert.strictEqual(func(new Error), false);
-      assert.strictEqual(func({ 'a': 1 }), false);
-      assert.strictEqual(func(/x/), false);
-      assert.strictEqual(func('a'), false);
-      assert.strictEqual(func(symbol), false);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isLength');
-
-  (function() {
-    QUnit.test('should return `true` for lengths', function(assert) {
-      assert.expect(1);
-
-      var values = [0, 3, MAX_SAFE_INTEGER],
-          expected = lodashStable.map(values, alwaysTrue),
-          actual = lodashStable.map(values, _.isLength);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `false` for non-lengths', function(assert) {
-      assert.expect(1);
-
-      var values = [-1, '1', 1.1, MAX_SAFE_INTEGER + 1],
-          expected = lodashStable.map(values, alwaysFalse),
-          actual = lodashStable.map(values, _.isLength);
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isMap');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for maps', function(assert) {
-      assert.expect(1);
-
-      if (Map) {
-        assert.strictEqual(_.isMap(map), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for non-maps', function(assert) {
-      assert.expect(14);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isMap(value) : _.isMap();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isMap(args), false);
-      assert.strictEqual(_.isMap([1, 2, 3]), false);
-      assert.strictEqual(_.isMap(true), false);
-      assert.strictEqual(_.isMap(new Date), false);
-      assert.strictEqual(_.isMap(new Error), false);
-      assert.strictEqual(_.isMap(_), false);
-      assert.strictEqual(_.isMap(slice), false);
-      assert.strictEqual(_.isMap({ 'a': 1 }), false);
-      assert.strictEqual(_.isMap(1), false);
-      assert.strictEqual(_.isMap(/x/), false);
-      assert.strictEqual(_.isMap('a'), false);
-      assert.strictEqual(_.isMap(symbol), false);
-      assert.strictEqual(_.isMap(weakMap), false);
-    });
-
-    QUnit.test('should work for objects with a non-function `constructor` (test in IE 11)', function(assert) {
-      assert.expect(1);
-
-      var values = [false, true],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      var actual = lodashStable.map(values, function(value) {
-        return _.isMap({ 'constructor': value });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with maps from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.map) {
-        assert.strictEqual(_.isMap(realm.map), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isMatch');
-
-  (function() {
-    QUnit.test('should perform a deep comparison between `object` and `source`', function(assert) {
-      assert.expect(5);
-
-      var object = { 'a': 1, 'b': 2, 'c': 3 };
-      assert.strictEqual(_.isMatch(object, { 'a': 1 }), true);
-      assert.strictEqual(_.isMatch(object, { 'b': 1 }), false);
-      assert.strictEqual(_.isMatch(object, { 'a': 1, 'c': 3 }), true);
-      assert.strictEqual(_.isMatch(object, { 'c': 3, 'd': 4 }), false);
-
-      object = { 'a': { 'b': { 'c': 1, 'd': 2 }, 'e': 3 }, 'f': 4 };
-      assert.strictEqual(_.isMatch(object, { 'a': { 'b': { 'c': 1 } } }), true);
-    });
-
-    QUnit.test('should match inherited string keyed `object` properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      assert.strictEqual(_.isMatch({ 'a': new Foo }, { 'a': { 'b': 2 } }), true);
-    });
-
-    QUnit.test('should not match by inherited `source` properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var objects = [{ 'a': 1 }, { 'a': 1, 'b': 2 }],
-          source = new Foo,
-          expected = lodashStable.map(objects, alwaysTrue);
-
-      var actual = lodashStable.map(objects, function(object) {
-        return _.isMatch(object, source);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should compare a variety of `source` property values', function(assert) {
-      assert.expect(2);
-
-      var object1 = { 'a': false, 'b': true, 'c': '3', 'd': 4, 'e': [5], 'f': { 'g': 6 } },
-          object2 = { 'a': 0, 'b': 1, 'c': 3, 'd': '4', 'e': ['5'], 'f': { 'g': '6' } };
-
-      assert.strictEqual(_.isMatch(object1, object1), true);
-      assert.strictEqual(_.isMatch(object1, object2), false);
-    });
-
-    QUnit.test('should match `-0` as `0`', function(assert) {
-      assert.expect(2);
-
-      var object1 = { 'a': -0 },
-          object2 = { 'a': 0 };
-
-      assert.strictEqual(_.isMatch(object1, object2), true);
-      assert.strictEqual(_.isMatch(object2, object1), true);
-    });
-
-    QUnit.test('should compare functions by reference', function(assert) {
-      assert.expect(3);
-
-      var object1 = { 'a': lodashStable.noop },
-          object2 = { 'a': noop },
-          object3 = { 'a': {} };
-
-      assert.strictEqual(_.isMatch(object1, object1), true);
-      assert.strictEqual(_.isMatch(object2, object1), false);
-      assert.strictEqual(_.isMatch(object3, object1), false);
-    });
-
-    QUnit.test('should work with a function for `object`', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.a = { 'b': 1, 'c': 2 };
-
-      assert.strictEqual(_.isMatch(Foo, { 'a': { 'b': 1 } }), true);
-    });
-
-    QUnit.test('should work with a function for `source`', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.a = 1;
-      Foo.b = function() {};
-      Foo.c = 3;
-
-      var objects = [{ 'a': 1 }, { 'a': 1, 'b': Foo.b, 'c': 3 }];
-
-      var actual = lodashStable.map(objects, function(object) {
-        return _.isMatch(object, Foo);
-      });
-
-      assert.deepEqual(actual, [false, true]);
-    });
-
-    QUnit.test('should work with a non-plain `object`', function(assert) {
-      assert.expect(1);
-
-      function Foo(object) { lodashStable.assign(this, object); }
-
-      var object = new Foo({ 'a': new Foo({ 'b': 1, 'c': 2 }) });
-      assert.strictEqual(_.isMatch(object, { 'a': { 'b': 1 } }), true);
-    });
-
-    QUnit.test('should partial match arrays', function(assert) {
-      assert.expect(3);
-
-      var objects = [{ 'a': ['b'] }, { 'a': ['c', 'd'] }],
-          source = { 'a': ['d'] },
-          predicate = function(object) { return _.isMatch(object, source); },
-          actual = lodashStable.filter(objects, predicate);
-
-      assert.deepEqual(actual, [objects[1]]);
-
-      source = { 'a': ['b', 'd'] };
-      actual = lodashStable.filter(objects, predicate);
-
-      assert.deepEqual(actual, []);
-
-      source = { 'a': ['d', 'b'] };
-      actual = lodashStable.filter(objects, predicate);
-      assert.deepEqual(actual, []);
-    });
-
-    QUnit.test('should partial match arrays of objects', function(assert) {
-      assert.expect(1);
-
-      var source = { 'a': [{ 'b': 1 }, { 'b': 4, 'c': 5 }] };
-
-      var objects = [
-        { 'a': [{ 'b': 1, 'c': 2 }, { 'b': 4, 'c': 5, 'd': 6 }] },
-        { 'a': [{ 'b': 1, 'c': 2 }, { 'b': 4, 'c': 6, 'd': 7 }] }
-      ];
-
-      var actual = lodashStable.filter(objects, function(object) {
-        return _.isMatch(object, source);
-      });
-
-      assert.deepEqual(actual, [objects[0]]);
-    });
-
-    QUnit.test('should partial match maps', function(assert) {
-      assert.expect(3);
-
-      if (Map) {
-        var objects = [{ 'a': new Map }, { 'a': new Map }];
-        objects[0].a.set('a', 1);
-        objects[1].a.set('a', 1);
-        objects[1].a.set('b', 2);
-
-        var map = new Map;
-        map.set('b', 2);
-
-        var source = { 'a': map },
-            predicate = function(object) { return _.isMatch(object, source); },
-            actual = lodashStable.filter(objects, predicate);
-
-        assert.deepEqual(actual, [objects[1]]);
-
-        map['delete']('b');
-        actual = lodashStable.filter(objects, predicate);
-
-        assert.deepEqual(actual, objects);
-
-        map.set('c', 3);
-        actual = lodashStable.filter(objects, predicate);
-
-        assert.deepEqual(actual, []);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should partial match sets', function(assert) {
-      assert.expect(3);
-
-      if (Set) {
-        var objects = [{ 'a': new Set }, { 'a': new Set }];
-        objects[0].a.add(1);
-        objects[1].a.add(1);
-        objects[1].a.add(2);
-
-        var set = new Set;
-        set.add(2);
-
-        var source = { 'a': set },
-            predicate = function(object) { return _.isMatch(object, source); },
-            actual = lodashStable.filter(objects, predicate);
-
-        assert.deepEqual(actual, [objects[1]]);
-
-        set['delete'](2);
-        actual = lodashStable.filter(objects, predicate);
-
-        assert.deepEqual(actual, objects);
-
-        set.add(3);
-        actual = lodashStable.filter(objects, predicate);
-
-        assert.deepEqual(actual, []);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should match `undefined` values', function(assert) {
-      assert.expect(3);
-
-      var objects = [{ 'a': 1 }, { 'a': 1, 'b': 1 }, { 'a': 1, 'b': undefined }],
-          source = { 'b': undefined },
-          predicate = function(object) { return _.isMatch(object, source); },
-          actual = lodashStable.map(objects, predicate),
-          expected = [false, false, true];
-
-      assert.deepEqual(actual, expected);
-
-      source = { 'a': 1, 'b': undefined };
-      actual = lodashStable.map(objects, predicate);
-
-      assert.deepEqual(actual, expected);
-
-      objects = [{ 'a': { 'b': 1 } }, { 'a': { 'b': 1, 'c': 1 } }, { 'a': { 'b': 1, 'c': undefined } }];
-      source = { 'a': { 'c': undefined } };
-      actual = lodashStable.map(objects, predicate);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should match `undefined` values on primitives', function(assert) {
-      assert.expect(3);
-
-      numberProto.a = 1;
-      numberProto.b = undefined;
-
-      try {
-        assert.strictEqual(_.isMatch(1, { 'b': undefined }), true);
-      } catch (e) {
-        assert.ok(false, e.message);
-      }
-      try {
-        assert.strictEqual(_.isMatch(1, { 'a': 1, 'b': undefined }), true);
-      } catch (e) {
-        assert.ok(false, e.message);
-      }
-      numberProto.a = { 'b': 1, 'c': undefined };
-      try {
-        assert.strictEqual(_.isMatch(1, { 'a': { 'c': undefined } }), true);
-      } catch (e) {
-        assert.ok(false, e.message);
-      }
-      delete numberProto.a;
-      delete numberProto.b;
-    });
-
-    QUnit.test('should return `false` when `object` is nullish', function(assert) {
-      assert.expect(1);
-
-      var values = [null, undefined],
-          expected = lodashStable.map(values, alwaysFalse),
-          source = { 'a': 1 };
-
-      var actual = lodashStable.map(values, function(value) {
-        try {
-          return _.isMatch(value, source);
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `true` when comparing an empty `source` to a nullish `object`', function(assert) {
-      assert.expect(1);
-
-      var values = [null, undefined],
-          expected = lodashStable.map(values, alwaysTrue),
-          source = {};
-
-      var actual = lodashStable.map(values, function(value) {
-        try {
-          return _.isMatch(value, source);
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `true` when comparing an empty `source`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1 },
-          expected = lodashStable.map(empties, alwaysTrue);
-
-      var actual = lodashStable.map(empties, function(value) {
-        return _.isMatch(object, value);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `true` when comparing a `source` of empty arrays and objects', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'a': [1], 'b': { 'c': 1 } }, { 'a': [2, 3], 'b': { 'd': 2 } }],
-          source = { 'a': [], 'b': {} };
-
-      var actual = lodashStable.filter(objects, function(object) {
-        return _.isMatch(object, source);
-      });
-
-      assert.deepEqual(actual, objects);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isMatchWith');
-
-  (function() {
-    QUnit.test('should provide the correct `customizer` arguments', function(assert) {
-      assert.expect(1);
-
-      var argsList = [],
-          object1 = { 'a': [1, 2], 'b': null },
-          object2 = { 'a': [1, 2], 'b': null };
-
-      object1.b = object2;
-      object2.b = object1;
-
-      var expected = [
-        [object1.a, object2.a, 'a', object1, object2],
-        [object1.a[0], object2.a[0], 0, object1.a, object2.a],
-        [object1.a[1], object2.a[1], 1, object1.a, object2.a],
-        [object1.b, object2.b, 'b', object1, object2],
-        [object1.b.a, object2.b.a, 'a', object1.b, object2.b],
-        [object1.b.a[0], object2.b.a[0], 0, object1.b.a, object2.b.a],
-        [object1.b.a[1], object2.b.a[1], 1, object1.b.a, object2.b.a],
-        [object1.b.b, object2.b.b, 'b', object1.b, object2.b],
-        [object1.b.b.a, object2.b.b.a, 'a', object1.b.b, object2.b.b],
-        [object1.b.b.a[0], object2.b.b.a[0], 0, object1.b.b.a, object2.b.b.a],
-        [object1.b.b.a[1], object2.b.b.a[1], 1, object1.b.b.a, object2.b.b.a],
-        [object1.b.b.b, object2.b.b.b, 'b', object1.b.b, object2.b.b]
-      ];
-
-      _.isMatchWith(object1, object2, function(assert) {
-        argsList.push(slice.call(arguments, 0, -1));
-      });
-
-      assert.deepEqual(argsList, expected);
-    });
-
-    QUnit.test('should handle comparisons if `customizer` returns `undefined`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.isMatchWith({ 'a': 1 }, { 'a': 1 }, noop), true);
-    });
-
-    QUnit.test('should not handle comparisons if `customizer` returns `true`', function(assert) {
-      assert.expect(2);
-
-      var customizer = function(value) {
-        return _.isString(value) || undefined;
-      };
-
-      assert.strictEqual(_.isMatchWith(['a'], ['b'], customizer), true);
-      assert.strictEqual(_.isMatchWith({ '0': 'a' }, { '0': 'b' }, customizer), true);
-    });
-
-    QUnit.test('should not handle comparisons if `customizer` returns `false`', function(assert) {
-      assert.expect(2);
-
-      var customizer = function(value) {
-        return _.isString(value) ? false : undefined;
-      };
-
-      assert.strictEqual(_.isMatchWith(['a'], ['a'], customizer), false);
-      assert.strictEqual(_.isMatchWith({ '0': 'a' }, { '0': 'a' }, customizer), false);
-    });
-
-    QUnit.test('should return a boolean value even if `customizer` does not', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': 1 },
-          actual = _.isMatchWith(object, { 'a': 1 }, alwaysA);
-
-      assert.strictEqual(actual, true);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      actual = [];
-      lodashStable.each(falsey, function(value) {
-        actual.push(_.isMatchWith(object, { 'a': 2 }, lodashStable.constant(value)));
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should ensure `customizer` is a function', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1 },
-          matches = _.partial(_.isMatchWith, object),
-          actual = lodashStable.map([object, { 'a': 2 }], matches);
-
-      assert.deepEqual(actual, [true, false]);
-    });
-
-    QUnit.test('should call `customizer` for values maps and sets', function(assert) {
-      assert.expect(2);
-
-      var value = { 'a': { 'b': 2 } };
-
-      if (Map) {
-        var map1 = new Map;
-        map1.set('a', value);
-
-        var map2 = new Map;
-        map2.set('a', value);
-      }
-      if (Set) {
-        var set1 = new Set;
-        set1.add(value);
-
-        var set2 = new Set;
-        set2.add(value);
-      }
-      lodashStable.each([[map1, map2], [set1, set2]], function(pair, index) {
-        if (pair[0]) {
-          var argsList = [],
-              array = _.toArray(pair[0]),
-              object1 = { 'a': pair[0] },
-              object2 = { 'a': pair[1] };
-
-          var expected = [
-            [pair[0], pair[1], 'a', object1, object2],
-            [array[0], array[0], 0, array, array],
-            [array[0][0], array[0][0], 0, array[0], array[0]],
-            [array[0][1], array[0][1], 1, array[0], array[0]]
-          ];
-
-          if (index) {
-            expected.length = 2;
-          }
-          _.isMatchWith({ 'a': pair[0] }, { 'a': pair[1] }, function() {
-            argsList.push(slice.call(arguments, 0, -1));
-          });
-
-          assert.deepEqual(argsList, expected, index ? 'Set' : 'Map');
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isNaN');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for NaNs', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.isNaN(NaN), true);
-      assert.strictEqual(_.isNaN(Object(NaN)), true);
-    });
-
-    QUnit.test('should return `false` for non-NaNs', function(assert) {
-      assert.expect(14);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value !== value;
-      });
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isNaN(value) : _.isNaN();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isNaN(args), false);
-      assert.strictEqual(_.isNaN([1, 2, 3]), false);
-      assert.strictEqual(_.isNaN(true), false);
-      assert.strictEqual(_.isNaN(new Date), false);
-      assert.strictEqual(_.isNaN(new Error), false);
-      assert.strictEqual(_.isNaN(_), false);
-      assert.strictEqual(_.isNaN(slice), false);
-      assert.strictEqual(_.isNaN({ 'a': 1 }), false);
-      assert.strictEqual(_.isNaN(1), false);
-      assert.strictEqual(_.isNaN(Object(1)), false);
-      assert.strictEqual(_.isNaN(/x/), false);
-      assert.strictEqual(_.isNaN('a'), false);
-      assert.strictEqual(_.isNaN(symbol), false);
-    });
-
-    QUnit.test('should work with `NaN` from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.object) {
-        assert.strictEqual(_.isNaN(realm.nan), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isNative');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for native methods', function(assert) {
-      assert.expect(1);
-
-      var values = [Array, body && body.cloneNode, create, root.encodeURI, Promise, slice, Uint8Array],
-          expected = lodashStable.map(values, Boolean),
-          actual = lodashStable.map(values, _.isNative);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `false` for non-native methods', function(assert) {
-      assert.expect(12);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isNative(value) : _.isNative();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isNative(args), false);
-      assert.strictEqual(_.isNative([1, 2, 3]), false);
-      assert.strictEqual(_.isNative(true), false);
-      assert.strictEqual(_.isNative(new Date), false);
-      assert.strictEqual(_.isNative(new Error), false);
-      assert.strictEqual(_.isNative(_), false);
-      assert.strictEqual(_.isNative({ 'a': 1 }), false);
-      assert.strictEqual(_.isNative(1), false);
-      assert.strictEqual(_.isNative(/x/), false);
-      assert.strictEqual(_.isNative('a'), false);
-      assert.strictEqual(_.isNative(symbol), false);
-    });
-
-    QUnit.test('should work with native functions from another realm', function(assert) {
-      assert.expect(2);
-
-      if (realm.element) {
-        assert.strictEqual(_.isNative(realm.element.cloneNode), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-      if (realm.object) {
-        assert.strictEqual(_.isNative(realm.object.valueOf), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isNil');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for nullish values', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.isNil(null), true);
-      assert.strictEqual(_.isNil(), true);
-      assert.strictEqual(_.isNil(undefined), true);
-    });
-
-    QUnit.test('should return `false` for non-nullish values', function(assert) {
-      assert.expect(13);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value == null;
-      });
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isNil(value) : _.isNil();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isNil(args), false);
-      assert.strictEqual(_.isNil([1, 2, 3]), false);
-      assert.strictEqual(_.isNil(true), false);
-      assert.strictEqual(_.isNil(new Date), false);
-      assert.strictEqual(_.isNil(new Error), false);
-      assert.strictEqual(_.isNil(_), false);
-      assert.strictEqual(_.isNil(slice), false);
-      assert.strictEqual(_.isNil({ 'a': 1 }), false);
-      assert.strictEqual(_.isNil(1), false);
-      assert.strictEqual(_.isNil(/x/), false);
-      assert.strictEqual(_.isNil('a'), false);
-
-      if (Symbol) {
-        assert.strictEqual(_.isNil(symbol), false);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should work with nulls from another realm', function(assert) {
-      assert.expect(2);
-
-      if (realm.object) {
-        assert.strictEqual(_.isNil(realm.null), true);
-        assert.strictEqual(_.isNil(realm.undefined), true);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isNull');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for `null` values', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.isNull(null), true);
-    });
-
-    QUnit.test('should return `false` for non `null` values', function(assert) {
-      assert.expect(13);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === null;
-      });
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isNull(value) : _.isNull();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isNull(args), false);
-      assert.strictEqual(_.isNull([1, 2, 3]), false);
-      assert.strictEqual(_.isNull(true), false);
-      assert.strictEqual(_.isNull(new Date), false);
-      assert.strictEqual(_.isNull(new Error), false);
-      assert.strictEqual(_.isNull(_), false);
-      assert.strictEqual(_.isNull(slice), false);
-      assert.strictEqual(_.isNull({ 'a': 1 }), false);
-      assert.strictEqual(_.isNull(1), false);
-      assert.strictEqual(_.isNull(/x/), false);
-      assert.strictEqual(_.isNull('a'), false);
-      assert.strictEqual(_.isNull(symbol), false);
-    });
-
-    QUnit.test('should work with nulls from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.object) {
-        assert.strictEqual(_.isNull(realm.null), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isNumber');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for numbers', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.isNumber(0), true);
-      assert.strictEqual(_.isNumber(Object(0)), true);
-      assert.strictEqual(_.isNumber(NaN), true);
-    });
-
-    QUnit.test('should return `false` for non-numbers', function(assert) {
-      assert.expect(12);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return typeof value == 'number';
-      });
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isNumber(value) : _.isNumber();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isNumber(args), false);
-      assert.strictEqual(_.isNumber([1, 2, 3]), false);
-      assert.strictEqual(_.isNumber(true), false);
-      assert.strictEqual(_.isNumber(new Date), false);
-      assert.strictEqual(_.isNumber(new Error), false);
-      assert.strictEqual(_.isNumber(_), false);
-      assert.strictEqual(_.isNumber(slice), false);
-      assert.strictEqual(_.isNumber({ 'a': 1 }), false);
-      assert.strictEqual(_.isNumber(/x/), false);
-      assert.strictEqual(_.isNumber('a'), false);
-      assert.strictEqual(_.isNumber(symbol), false);
-    });
-
-    QUnit.test('should work with numbers from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.number) {
-        assert.strictEqual(_.isNumber(realm.number), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should avoid `[xpconnect wrapped native prototype]` in Firefox', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.isNumber(+'2'), true);
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isObject');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for objects', function(assert) {
-      assert.expect(13);
-
-      assert.strictEqual(_.isObject(args), true);
-      assert.strictEqual(_.isObject([1, 2, 3]), true);
-      assert.strictEqual(_.isObject(Object(false)), true);
-      assert.strictEqual(_.isObject(new Date), true);
-      assert.strictEqual(_.isObject(new Error), true);
-      assert.strictEqual(_.isObject(_), true);
-      assert.strictEqual(_.isObject(slice), true);
-      assert.strictEqual(_.isObject({ 'a': 1 }), true);
-      assert.strictEqual(_.isObject(Object(0)), true);
-      assert.strictEqual(_.isObject(/x/), true);
-      assert.strictEqual(_.isObject(Object('a')), true);
-
-      if (document) {
-        assert.strictEqual(_.isObject(body), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-      if (Symbol) {
-        assert.strictEqual(_.isObject(Object(symbol)), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for non-objects', function(assert) {
-      assert.expect(1);
-
-      var values = falsey.concat(true, 1, 'a', symbol),
-          expected = lodashStable.map(values, alwaysFalse);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.isObject(value) : _.isObject();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with objects from another realm', function(assert) {
-      assert.expect(8);
-
-      if (realm.element) {
-        assert.strictEqual(_.isObject(realm.element), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-      if (realm.object) {
-        assert.strictEqual(_.isObject(realm.boolean), true);
-        assert.strictEqual(_.isObject(realm.date), true);
-        assert.strictEqual(_.isObject(realm.function), true);
-        assert.strictEqual(_.isObject(realm.number), true);
-        assert.strictEqual(_.isObject(realm.object), true);
-        assert.strictEqual(_.isObject(realm.regexp), true);
-        assert.strictEqual(_.isObject(realm.string), true);
-      }
-      else {
-        skipAssert(assert, 7);
-      }
-    });
-
-    QUnit.test('should avoid V8 bug #2291 (test in Chrome 19-20)', function(assert) {
-      assert.expect(1);
-
-      // Trigger a V8 JIT bug.
-      // See https://code.google.com/p/v8/issues/detail?id=2291.
-      var object = {};
-
-      // First, have a comparison statement.
-      object == object;
-
-      // Then perform the check with `object`.
-      _.isObject(object);
-
-      assert.strictEqual(_.isObject('a'), false);
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isObjectLike');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for objects', function(assert) {
-      assert.expect(9);
-
-      assert.strictEqual(_.isObjectLike(args), true);
-      assert.strictEqual(_.isObjectLike([1, 2, 3]), true);
-      assert.strictEqual(_.isObjectLike(Object(false)), true);
-      assert.strictEqual(_.isObjectLike(new Date), true);
-      assert.strictEqual(_.isObjectLike(new Error), true);
-      assert.strictEqual(_.isObjectLike({ 'a': 1 }), true);
-      assert.strictEqual(_.isObjectLike(Object(0)), true);
-      assert.strictEqual(_.isObjectLike(/x/), true);
-      assert.strictEqual(_.isObjectLike(Object('a')), true);
-    });
-
-    QUnit.test('should return `false` for non-objects', function(assert) {
-      assert.expect(1);
-
-      var values = falsey.concat(true, _, slice, 1, 'a', symbol),
-          expected = lodashStable.map(values, alwaysFalse);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.isObjectLike(value) : _.isObjectLike();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with objects from another realm', function(assert) {
-      assert.expect(6);
-
-      if (realm.object) {
-        assert.strictEqual(_.isObjectLike(realm.boolean), true);
-        assert.strictEqual(_.isObjectLike(realm.date), true);
-        assert.strictEqual(_.isObjectLike(realm.number), true);
-        assert.strictEqual(_.isObjectLike(realm.object), true);
-        assert.strictEqual(_.isObjectLike(realm.regexp), true);
-        assert.strictEqual(_.isObjectLike(realm.string), true);
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isPlainObject');
-
-  (function() {
-    var element = document && document.createElement('div');
-
-    QUnit.test('should detect plain objects', function(assert) {
-      assert.expect(5);
-
-      function Foo(a) {
-        this.a = 1;
-      }
-
-      assert.strictEqual(_.isPlainObject({}), true);
-      assert.strictEqual(_.isPlainObject({ 'a': 1 }), true);
-      assert.strictEqual(_.isPlainObject({ 'constructor': Foo }), true);
-      assert.strictEqual(_.isPlainObject([1, 2, 3]), false);
-      assert.strictEqual(_.isPlainObject(new Foo(1)), false);
-    });
-
-    QUnit.test('should return `true` for objects with a `[[Prototype]]` of `null`', function(assert) {
-      assert.expect(2);
-
-      if (create) {
-        var object = create(null);
-        assert.strictEqual(_.isPlainObject(object), true);
-
-        object.constructor = objectProto.constructor;
-        assert.strictEqual(_.isPlainObject(object), true);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should return `true` for plain objects with a custom `valueOf` property', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.isPlainObject({ 'valueOf': 0 }), true);
-
-      if (element) {
-        var valueOf = element.valueOf;
-        element.valueOf = 0;
-
-        assert.strictEqual(_.isPlainObject(element), false);
-        element.valueOf = valueOf;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for objects with a custom `[[Prototype]]`', function(assert) {
-      assert.expect(1);
-
-      if (create) {
-        var object = create({ 'a': 1 });
-        assert.strictEqual(_.isPlainObject(object), false);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for DOM elements', function(assert) {
-      assert.expect(1);
-
-      if (element) {
-        assert.strictEqual(_.isPlainObject(element), false);
-      } else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for Object objects without a `toStringTag` of "Object"', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.isPlainObject(arguments), false);
-      assert.strictEqual(_.isPlainObject(Error), false);
-      assert.strictEqual(_.isPlainObject(Math), false);
-    });
-
-    QUnit.test('should return `false` for non-objects', function(assert) {
-      assert.expect(4);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isPlainObject(value) : _.isPlainObject();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isPlainObject(true), false);
-      assert.strictEqual(_.isPlainObject('a'), false);
-      assert.strictEqual(_.isPlainObject(symbol), false);
-    });
-
-    QUnit.test('should work with objects from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.object) {
-        assert.strictEqual(_.isPlainObject(realm.object), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isRegExp');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for regexes', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.isRegExp(/x/), true);
-      assert.strictEqual(_.isRegExp(RegExp('x')), true);
-    });
-
-    QUnit.test('should return `false` for non-regexes', function(assert) {
-      assert.expect(12);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isRegExp(value) : _.isRegExp();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isRegExp(args), false);
-      assert.strictEqual(_.isRegExp([1, 2, 3]), false);
-      assert.strictEqual(_.isRegExp(true), false);
-      assert.strictEqual(_.isRegExp(new Date), false);
-      assert.strictEqual(_.isRegExp(new Error), false);
-      assert.strictEqual(_.isRegExp(_), false);
-      assert.strictEqual(_.isRegExp(slice), false);
-      assert.strictEqual(_.isRegExp({ 'a': 1 }), false);
-      assert.strictEqual(_.isRegExp(1), false);
-      assert.strictEqual(_.isRegExp('a'), false);
-      assert.strictEqual(_.isRegExp(symbol), false);
-    });
-
-    QUnit.test('should work with regexes from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.regexp) {
-        assert.strictEqual(_.isRegExp(realm.regexp), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isSet');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for sets', function(assert) {
-      assert.expect(1);
-
-      if (Set) {
-        assert.strictEqual(_.isSet(set), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for non-sets', function(assert) {
-      assert.expect(14);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isSet(value) : _.isSet();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isSet(args), false);
-      assert.strictEqual(_.isSet([1, 2, 3]), false);
-      assert.strictEqual(_.isSet(true), false);
-      assert.strictEqual(_.isSet(new Date), false);
-      assert.strictEqual(_.isSet(new Error), false);
-      assert.strictEqual(_.isSet(_), false);
-      assert.strictEqual(_.isSet(slice), false);
-      assert.strictEqual(_.isSet({ 'a': 1 }), false);
-      assert.strictEqual(_.isSet(1), false);
-      assert.strictEqual(_.isSet(/x/), false);
-      assert.strictEqual(_.isSet('a'), false);
-      assert.strictEqual(_.isSet(symbol), false);
-      assert.strictEqual(_.isSet(weakSet), false);
-    });
-
-    QUnit.test('should work for objects with a non-function `constructor` (test in IE 11)', function(assert) {
-      assert.expect(1);
-
-      var values = [false, true],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      var actual = lodashStable.map(values, function(value) {
-        return _.isSet({ 'constructor': value });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with weak sets from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.set) {
-        assert.strictEqual(_.isSet(realm.set), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isString');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for strings', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.isString('a'), true);
-      assert.strictEqual(_.isString(Object('a')), true);
-    });
-
-    QUnit.test('should return `false` for non-strings', function(assert) {
-      assert.expect(12);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === '';
-      });
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isString(value) : _.isString();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isString(args), false);
-      assert.strictEqual(_.isString([1, 2, 3]), false);
-      assert.strictEqual(_.isString(true), false);
-      assert.strictEqual(_.isString(new Date), false);
-      assert.strictEqual(_.isString(new Error), false);
-      assert.strictEqual(_.isString(_), false);
-      assert.strictEqual(_.isString(slice), false);
-      assert.strictEqual(_.isString({ '0': 1, 'length': 1 }), false);
-      assert.strictEqual(_.isString(1), false);
-      assert.strictEqual(_.isString(/x/), false);
-      assert.strictEqual(_.isString(symbol), false);
-    });
-
-    QUnit.test('should work with strings from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.string) {
-        assert.strictEqual(_.isString(realm.string), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isSymbol');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for symbols', function(assert) {
-      assert.expect(2);
-
-      if (Symbol) {
-        assert.strictEqual(_.isSymbol(symbol), true);
-        assert.strictEqual(_.isSymbol(Object(symbol)), true);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should return `false` for non-symbols', function(assert) {
-      assert.expect(12);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isSymbol(value) : _.isSymbol();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isSymbol(args), false);
-      assert.strictEqual(_.isSymbol([1, 2, 3]), false);
-      assert.strictEqual(_.isSymbol(true), false);
-      assert.strictEqual(_.isSymbol(new Date), false);
-      assert.strictEqual(_.isSymbol(new Error), false);
-      assert.strictEqual(_.isSymbol(_), false);
-      assert.strictEqual(_.isSymbol(slice), false);
-      assert.strictEqual(_.isSymbol({ '0': 1, 'length': 1 }), false);
-      assert.strictEqual(_.isSymbol(1), false);
-      assert.strictEqual(_.isSymbol(/x/), false);
-      assert.strictEqual(_.isSymbol('a'), false);
-    });
-
-    QUnit.test('should work with symbols from another realm', function(assert) {
-      assert.expect(1);
-
-      if (Symbol && realm.symbol) {
-        assert.strictEqual(_.isSymbol(realm.symbol), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isTypedArray');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for typed arrays', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(typedArrays, function(type) {
-        return type in root;
-      });
-
-      var actual = lodashStable.map(typedArrays, function(type) {
-        var Ctor = root[type];
-        return Ctor ? _.isTypedArray(new Ctor(new ArrayBuffer(8))) : false;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `false` for non typed arrays', function(assert) {
-      assert.expect(13);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isTypedArray(value) : _.isTypedArray();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isTypedArray(args), false);
-      assert.strictEqual(_.isTypedArray([1, 2, 3]), false);
-      assert.strictEqual(_.isTypedArray(true), false);
-      assert.strictEqual(_.isTypedArray(new Date), false);
-      assert.strictEqual(_.isTypedArray(new Error), false);
-      assert.strictEqual(_.isTypedArray(_), false);
-      assert.strictEqual(_.isTypedArray(slice), false);
-      assert.strictEqual(_.isTypedArray({ 'a': 1 }), false);
-      assert.strictEqual(_.isTypedArray(1), false);
-      assert.strictEqual(_.isTypedArray(/x/), false);
-      assert.strictEqual(_.isTypedArray('a'), false);
-      assert.strictEqual(_.isTypedArray(symbol), false);
-    });
-
-    QUnit.test('should work with typed arrays from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.object) {
-        var props = lodashStable.invokeMap(typedArrays, 'toLowerCase');
-
-        var expected = lodashStable.map(props, function(key) {
-          return realm[key] !== undefined;
-        });
-
-        var actual = lodashStable.map(props, function(key) {
-          var value = realm[key];
-          return value ? _.isTypedArray(value) : false;
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isUndefined');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for `undefined` values', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.isUndefined(), true);
-      assert.strictEqual(_.isUndefined(undefined), true);
-    });
-
-    QUnit.test('should return `false` for non `undefined` values', function(assert) {
-      assert.expect(13);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === undefined;
-      });
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isUndefined(value) : _.isUndefined();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isUndefined(args), false);
-      assert.strictEqual(_.isUndefined([1, 2, 3]), false);
-      assert.strictEqual(_.isUndefined(true), false);
-      assert.strictEqual(_.isUndefined(new Date), false);
-      assert.strictEqual(_.isUndefined(new Error), false);
-      assert.strictEqual(_.isUndefined(_), false);
-      assert.strictEqual(_.isUndefined(slice), false);
-      assert.strictEqual(_.isUndefined({ 'a': 1 }), false);
-      assert.strictEqual(_.isUndefined(1), false);
-      assert.strictEqual(_.isUndefined(/x/), false);
-      assert.strictEqual(_.isUndefined('a'), false);
-
-      if (Symbol) {
-        assert.strictEqual(_.isUndefined(symbol), false);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should work with `undefined` from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.object) {
-        assert.strictEqual(_.isUndefined(realm.undefined), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isWeakMap');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for weak maps', function(assert) {
-      assert.expect(1);
-
-      if (WeakMap) {
-        assert.strictEqual(_.isWeakMap(weakMap), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for non weak maps', function(assert) {
-      assert.expect(14);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isWeakMap(value) : _.isWeakMap();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isWeakMap(args), false);
-      assert.strictEqual(_.isWeakMap([1, 2, 3]), false);
-      assert.strictEqual(_.isWeakMap(true), false);
-      assert.strictEqual(_.isWeakMap(new Date), false);
-      assert.strictEqual(_.isWeakMap(new Error), false);
-      assert.strictEqual(_.isWeakMap(_), false);
-      assert.strictEqual(_.isWeakMap(slice), false);
-      assert.strictEqual(_.isWeakMap({ 'a': 1 }), false);
-      assert.strictEqual(_.isWeakMap(map), false);
-      assert.strictEqual(_.isWeakMap(1), false);
-      assert.strictEqual(_.isWeakMap(/x/), false);
-      assert.strictEqual(_.isWeakMap('a'), false);
-      assert.strictEqual(_.isWeakMap(symbol), false);
-    });
-
-    QUnit.test('should work for objects with a non-function `constructor` (test in IE 11)', function(assert) {
-      assert.expect(1);
-
-      var values = [false, true],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      var actual = lodashStable.map(values, function(value) {
-        return _.isWeakMap({ 'constructor': value });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with weak maps from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.weakMap) {
-        assert.strictEqual(_.isWeakMap(realm.weakMap), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.isWeakSet');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should return `true` for weak sets', function(assert) {
-      assert.expect(1);
-
-      if (WeakSet) {
-        assert.strictEqual(_.isWeakSet(weakSet), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return `false` for non weak sets', function(assert) {
-      assert.expect(14);
-
-      var expected = lodashStable.map(falsey, alwaysFalse);
-
-      var actual = lodashStable.map(falsey, function(value, index) {
-        return index ? _.isWeakSet(value) : _.isWeakSet();
-      });
-
-      assert.deepEqual(actual, expected);
-
-      assert.strictEqual(_.isWeakSet(args), false);
-      assert.strictEqual(_.isWeakSet([1, 2, 3]), false);
-      assert.strictEqual(_.isWeakSet(true), false);
-      assert.strictEqual(_.isWeakSet(new Date), false);
-      assert.strictEqual(_.isWeakSet(new Error), false);
-      assert.strictEqual(_.isWeakSet(_), false);
-      assert.strictEqual(_.isWeakSet(slice), false);
-      assert.strictEqual(_.isWeakSet({ 'a': 1 }), false);
-      assert.strictEqual(_.isWeakSet(1), false);
-      assert.strictEqual(_.isWeakSet(/x/), false);
-      assert.strictEqual(_.isWeakSet('a'), false);
-      assert.strictEqual(_.isWeakSet(set), false);
-      assert.strictEqual(_.isWeakSet(symbol), false);
-    });
-
-    QUnit.test('should work with weak sets from another realm', function(assert) {
-      assert.expect(1);
-
-      if (realm.weakSet) {
-        assert.strictEqual(_.isWeakSet(realm.weakSet), true);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('isType checks');
-
-  (function() {
-    QUnit.test('should return `false` for subclassed values', function(assert) {
-      assert.expect(7);
-
-      var funcs = [
-        'isArray', 'isBoolean', 'isDate', 'isFunction',
-        'isNumber', 'isRegExp', 'isString'
-      ];
-
-      lodashStable.each(funcs, function(methodName) {
-        function Foo() {}
-        Foo.prototype = root[methodName.slice(2)].prototype;
-
-        var object = new Foo;
-        if (objToString.call(object) == objectTag) {
-          assert.strictEqual(_[methodName](object), false, '`_.' + methodName + '` returns `false`');
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    QUnit.test('should not error on host objects (test in IE)', function(assert) {
-      assert.expect(26);
-
-      var funcs = [
-        'isArguments', 'isArray', 'isArrayBuffer', 'isArrayLike', 'isBoolean',
-        'isBuffer', 'isDate', 'isElement', 'isError', 'isFinite', 'isFunction',
-        'isInteger', 'isMap', 'isNaN', 'isNil', 'isNull', 'isNumber', 'isObject',
-        'isObjectLike', 'isRegExp', 'isSet', 'isSafeInteger', 'isString',
-        'isUndefined', 'isWeakMap', 'isWeakSet'
-      ];
-
-      lodashStable.each(funcs, function(methodName) {
-        if (xml) {
-          var pass = true;
-
-          try {
-            _[methodName](xml);
-          } catch (e) {
-            pass = false;
-          }
-          assert.ok(pass, '`_.' + methodName + '` should not error');
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.iteratee');
-
-  (function() {
-    QUnit.test('should provide arguments to `func`', function(assert) {
-      assert.expect(1);
-
-      var fn = function() { return slice.call(arguments); },
-          iteratee = _.iteratee(fn),
-          actual = iteratee('a', 'b', 'c', 'd', 'e', 'f');
-
-      assert.deepEqual(actual, ['a', 'b', 'c', 'd', 'e', 'f']);
-    });
-
-    QUnit.test('should return `_.identity` when `func` is nullish', function(assert) {
-      assert.expect(1);
-
-      var object = {},
-          values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant([!isNpm && _.identity, object]));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        var identity = index ? _.iteratee(value) : _.iteratee();
-        return [!isNpm && identity, identity(object)];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return an iteratee created by `_.matches` when `func` is an object', function(assert) {
-      assert.expect(2);
-
-      var matches = _.iteratee({ 'a': 1, 'b': 2 });
-      assert.strictEqual(matches({ 'a': 1, 'b': 2, 'c': 3 }), true);
-      assert.strictEqual(matches({ 'b': 2 }), false);
-    });
-
-    QUnit.test('should not change `_.matches` behavior if `source` is modified', function(assert) {
-      assert.expect(9);
-
-      var sources = [
-        { 'a': { 'b': 2, 'c': 3 } },
-        { 'a': 1, 'b': 2 },
-        { 'a': 1 }
-      ];
-
-      lodashStable.each(sources, function(source, index) {
-        var object = lodashStable.cloneDeep(source),
-            matches = _.iteratee(source);
-
-        assert.strictEqual(matches(object), true);
-
-        if (index) {
-          source.a = 2;
-          source.b = 1;
-          source.c = 3;
-        } else {
-          source.a.b = 1;
-          source.a.c = 2;
-          source.a.d = 3;
-        }
-        assert.strictEqual(matches(object), true);
-        assert.strictEqual(matches(source), false);
-      });
-    });
-
-    QUnit.test('should return an iteratee created by `_.matchesProperty` when `func` is an array', function(assert) {
-      assert.expect(3);
-
-      var array = ['a', undefined],
-          matches = _.iteratee([0, 'a']);
-
-      assert.strictEqual(matches(array), true);
-
-      matches = _.iteratee(['0', 'a']);
-      assert.strictEqual(matches(array), true);
-
-      matches = _.iteratee([1, undefined]);
-      assert.strictEqual(matches(array), true);
-    });
-
-    QUnit.test('should support deep paths for `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': { 'b': { 'c': 1, 'd': 2 } } },
-          matches = _.iteratee(['a.b', { 'c': 1 }]);
-
-      assert.strictEqual(matches(object), true);
-    });
-
-    QUnit.test('should not change `_.matchesProperty` behavior if `source` is modified', function(assert) {
-      assert.expect(9);
-
-      var sources = [
-        { 'a': { 'b': 2, 'c': 3 } },
-        { 'a': 1, 'b': 2 },
-        { 'a': 1 }
-      ];
-
-      lodashStable.each(sources, function(source, index) {
-        var object = { 'a': lodashStable.cloneDeep(source) },
-            matches = _.iteratee(['a', source]);
-
-        assert.strictEqual(matches(object), true);
-
-        if (index) {
-          source.a = 2;
-          source.b = 1;
-          source.c = 3;
-        } else {
-          source.a.b = 1;
-          source.a.c = 2;
-          source.a.d = 3;
-        }
-        assert.strictEqual(matches(object), true);
-        assert.strictEqual(matches({ 'a': source }), false);
-      });
-    });
-
-    QUnit.test('should return an iteratee created by `_.property` when `func` is a number or string', function(assert) {
-      assert.expect(2);
-
-      var array = ['a'],
-          prop = _.iteratee(0);
-
-      assert.strictEqual(prop(array), 'a');
-
-      prop = _.iteratee('0');
-      assert.strictEqual(prop(array), 'a');
-    });
-
-    QUnit.test('should support deep paths for `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': { 'b': 2 } },
-          prop = _.iteratee('a.b');
-
-      assert.strictEqual(prop(object), 2);
-    });
-
-    QUnit.test('should work with functions created by `_.partial` and `_.partialRight`', function(assert) {
-      assert.expect(2);
-
-      var fn = function() {
-        var result = [this.a];
-        push.apply(result, arguments);
-        return result;
-      };
-
-      var expected = [1, 2, 3],
-          object = { 'a': 1 , 'iteratee': _.iteratee(_.partial(fn, 2)) };
-
-      assert.deepEqual(object.iteratee(3), expected);
-
-      object.iteratee = _.iteratee(_.partialRight(fn, 3));
-      assert.deepEqual(object.iteratee(2), expected);
-    });
-
-    QUnit.test('should use internal `iteratee` if external is unavailable', function(assert) {
-      assert.expect(1);
-
-      var iteratee = _.iteratee;
-      delete _.iteratee;
-
-      assert.deepEqual(_.map([{ 'a': 1 }], 'a'), [1]);
-
-      _.iteratee = iteratee;
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var fn = function() { return this instanceof Number; },
-          array = [fn, fn, fn],
-          iteratees = lodashStable.map(array, _.iteratee),
-          expected = lodashStable.map(array, alwaysFalse);
-
-      var actual = lodashStable.map(iteratees, function(iteratee) {
-        return iteratee();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('custom `_.iteratee` methods');
-
-  (function() {
-    var array = ['one', 'two', 'three'],
-        getPropA = _.partial(_.property, 'a'),
-        getPropB = _.partial(_.property, 'b'),
-        getLength = _.partial(_.property, 'length'),
-        iteratee = _.iteratee;
-
-    var getSum = function() {
-      return function(result, object) {
-        return result + object.a;
-      };
-    };
-
-    var objects = [
-      { 'a': 0, 'b': 0 },
-      { 'a': 1, 'b': 0 },
-      { 'a': 1, 'b': 1 }
-    ];
-
-    QUnit.test('`_.countBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getLength;
-        assert.deepEqual(_.countBy(array), { '3': 2, '5': 1 });
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.differenceBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.deepEqual(_.differenceBy(objects, [objects[1]]), [objects[0]]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.dropRightWhile` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.deepEqual(_.dropRightWhile(objects), objects.slice(0, 2));
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.dropWhile` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.deepEqual(_.dropWhile(objects.reverse()).reverse(), objects.reverse().slice(0, 2));
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.every` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.strictEqual(_.every(objects.slice(1)), true);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.filter` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var objects = [{ 'a': 0 }, { 'a': 1 }];
-
-        _.iteratee = getPropA;
-        assert.deepEqual(_.filter(objects), [objects[1]]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.find` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.strictEqual(_.find(objects), objects[1]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.findIndex` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.strictEqual(_.findIndex(objects), 1);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.findLast` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.strictEqual(_.findLast(objects), objects[2]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.findLastIndex` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.strictEqual(_.findLastIndex(objects), 2);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.findKey` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.strictEqual(_.findKey(objects), '2');
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.findLastKey` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.strictEqual(_.findLastKey(objects), '2');
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.groupBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getLength;
-        assert.deepEqual(_.groupBy(array), { '3': ['one', 'two'], '5': ['three'] });
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.intersectionBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.deepEqual(_.intersectionBy(objects, [objects[2]]), [objects[1]]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.keyBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getLength;
-        assert.deepEqual(_.keyBy(array), { '3': 'two', '5': 'three' });
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.map` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.deepEqual(_.map(objects), [0, 1, 1]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.mapKeys` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.deepEqual(_.mapKeys({ 'a': { 'b': 1 } }), { '1':  { 'b': 1 } });
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.mapValues` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.deepEqual(_.mapValues({ 'a': { 'b': 1 } }), { 'a': 1 });
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.maxBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.deepEqual(_.maxBy(objects), objects[2]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.meanBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.strictEqual(_.meanBy(objects), 2 / 3);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.minBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.deepEqual(_.minBy(objects), objects[0]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.partition` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var objects = [{ 'a': 1 }, { 'a': 1 }, { 'b': 2 }];
-
-        _.iteratee = getPropA;
-        assert.deepEqual(_.partition(objects), [objects.slice(0, 2), objects.slice(2)]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.pullAllBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.deepEqual(_.pullAllBy(objects.slice(), [{ 'a': 1, 'b': 0 }]), [objects[0]]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.reduce` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getSum;
-        assert.strictEqual(_.reduce(objects, undefined, 0), 2);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.reduceRight` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getSum;
-        assert.strictEqual(_.reduceRight(objects, undefined, 0), 2);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.reject` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var objects = [{ 'a': 0 }, { 'a': 1 }];
-
-        _.iteratee = getPropA;
-        assert.deepEqual(_.reject(objects), [objects[0]]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.remove` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var objects = [{ 'a': 0 }, { 'a': 1 }];
-
-        _.iteratee = getPropA;
-        _.remove(objects);
-        assert.deepEqual(objects, [{ 'a': 0 }]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.some` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.strictEqual(_.some(objects), true);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.sortBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.deepEqual(_.sortBy(objects.slice().reverse()), [objects[0], objects[2], objects[1]]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.sortedIndexBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var objects = [{ 'a': 30 }, { 'a': 50 }];
-
-        _.iteratee = getPropA;
-        assert.strictEqual(_.sortedIndexBy(objects, { 'a': 40 }), 1);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.sortedLastIndexBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var objects = [{ 'a': 30 }, { 'a': 50 }];
-
-        _.iteratee = getPropA;
-        assert.strictEqual(_.sortedLastIndexBy(objects, { 'a': 40 }), 1);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.sumBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.strictEqual(_.sumBy(objects), 1);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.takeRightWhile` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.deepEqual(_.takeRightWhile(objects), objects.slice(2));
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.takeWhile` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.deepEqual(_.takeWhile(objects.reverse()), objects.reverse().slice(2));
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.transform` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = function() {
-          return function(result, object) {
-            result.sum += object.a;
-          };
-        };
-
-        assert.deepEqual(_.transform(objects, undefined, { 'sum': 0 }), { 'sum': 2 });
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.uniqBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.deepEqual(_.uniqBy(objects), [objects[0], objects[2]]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.unionBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropB;
-        assert.deepEqual(_.unionBy(objects.slice(0, 1), [objects[2]]), [objects[0], objects[2]]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.xorBy` should use `_.iteratee` internally', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        _.iteratee = getPropA;
-        assert.deepEqual(_.xorBy(objects, objects.slice(1)), [objects[0]]);
-        _.iteratee = iteratee;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.join');
-
-  (function() {
-    var array = ['a', 'b', 'c'];
-
-    QUnit.test('should return join all array elements into a string', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.join(array, '~'), 'a~b~c');
-    });
-
-    QUnit.test('should return an unwrapped value when implicitly chaining', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var wrapped = _(array);
-        assert.strictEqual(wrapped.join('~'), 'a~b~c');
-        assert.strictEqual(wrapped.value(), array);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.ok(_(array).chain().join('~') instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.keyBy');
-
-  (function() {
-    var array = [
-      { 'dir': 'left', 'code': 97 },
-      { 'dir': 'right', 'code': 100 }
-    ];
-
-    QUnit.test('should transform keys by `iteratee`', function(assert) {
-      assert.expect(1);
-
-      var expected = { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } };
-
-      var actual = _.keyBy(array, function(object) {
-        return String.fromCharCode(object.code);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) {
-      assert.expect(1);
-
-      var array = [4, 6, 6],
-          values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant({ '4': 4, '6': 6 }));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.keyBy(array, value) : _.keyBy(array);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var expected = { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } },
-          actual = _.keyBy(array, 'dir');
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should only add values to own, not inherited, properties', function(assert) {
-      assert.expect(2);
-
-      var actual = _.keyBy([6.1, 4.2, 6.3], function(n) {
-        return Math.floor(n) > 4 ? 'hasOwnProperty' : 'constructor';
-      });
-
-      assert.deepEqual(actual.constructor, 4.2);
-      assert.deepEqual(actual.hasOwnProperty, 6.3);
-    });
-
-    QUnit.test('should work with a number for `iteratee`', function(assert) {
-      assert.expect(2);
-
-      var array = [
-        [1, 'a'],
-        [2, 'a'],
-        [2, 'b']
-      ];
-
-      assert.deepEqual(_.keyBy(array, 0), { '1': [1, 'a'], '2': [2, 'b'] });
-      assert.deepEqual(_.keyBy(array, 1), { 'a': [2, 'a'], 'b': [2, 'b'] });
-    });
-
-    QUnit.test('should work with an object for `collection`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.keyBy({ 'a': 6.1, 'b': 4.2, 'c': 6.3 }, Math.floor);
-      assert.deepEqual(actual, { '4': 4.2, '6': 6.3 });
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE).concat(
-          lodashStable.range(Math.floor(LARGE_ARRAY_SIZE / 2), LARGE_ARRAY_SIZE),
-          lodashStable.range(Math.floor(LARGE_ARRAY_SIZE / 1.5), LARGE_ARRAY_SIZE)
-        );
-
-        var actual = _(array).keyBy().map(square).filter(isEven).take().value();
-
-        assert.deepEqual(actual, _.take(_.filter(_.map(_.keyBy(array), square), isEven)));
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('keys methods');
-
-  lodashStable.each(['keys', 'keysIn'], function(methodName) {
-    var args = (function() { return arguments; }(1, 2, 3)),
-        strictArgs = (function() { 'use strict'; return arguments; }(1, 2, 3)),
-        func = _[methodName],
-        isKeys = methodName == 'keys';
-
-    QUnit.test('`_.' + methodName + '` should return the string keyed property names of `object`', function(assert) {
-      assert.expect(1);
-
-      var actual = func({ 'a': 1, 'b': 1 }).sort();
-
-      assert.deepEqual(actual, ['a', 'b']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ' + (isKeys ? 'not ' : '') + 'include inherited string keyed properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var expected = isKeys ? ['a'] : ['a', 'b'],
-          actual = func(new Foo).sort();
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce primitives to objects (test in IE 9)', function(assert) {
-      assert.expect(2);
-
-      var expected = lodashStable.map(primitives, function(value) {
-        return typeof value == 'string' ? ['0'] : [];
-      });
-
-      var actual = lodashStable.map(primitives, func);
-      assert.deepEqual(actual, expected);
-
-      // IE 9 doesn't box numbers in for-in loops.
-      numberProto.a = 1;
-      assert.deepEqual(func(0), isKeys ? [] : ['a']);
-      delete numberProto.a;
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat sparse arrays as dense', function(assert) {
-      assert.expect(1);
-
-      var array = [1];
-      array[2] = 3;
-
-      var actual = func(array).sort();
-
-      assert.deepEqual(actual, ['0', '1', '2']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should not coerce nullish values to objects', function(assert) {
-      assert.expect(2);
-
-      objectProto.a = 1;
-      lodashStable.each([null, undefined], function(value) {
-        assert.deepEqual(func(value), []);
-      });
-      delete objectProto.a;
-    });
-
-    QUnit.test('`_.' + methodName + '` should return keys for custom properties on arrays', function(assert) {
-      assert.expect(1);
-
-      var array = [1];
-      array.a = 1;
-
-      var actual = func(array).sort();
-
-      assert.deepEqual(actual, ['0', 'a']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ' + (isKeys ? 'not ' : '') + 'include inherited string keyed properties of arrays', function(assert) {
-      assert.expect(1);
-
-      arrayProto.a = 1;
-
-      var expected = isKeys ? ['0'] : ['0', 'a'],
-          actual = func([1]).sort();
-
-      assert.deepEqual(actual, expected);
-
-      delete arrayProto.a;
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with `arguments` objects', function(assert) {
-      assert.expect(1);
-
-      var values = [args, strictArgs],
-          expected = lodashStable.map(values, lodashStable.constant(['0', '1', '2']));
-
-      var actual = lodashStable.map(values, function(value) {
-        return func(value).sort();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return keys for custom properties on `arguments` objects', function(assert) {
-      assert.expect(1);
-
-      var values = [args, strictArgs],
-          expected = lodashStable.map(values, lodashStable.constant(['0', '1', '2', 'a']));
-
-      var actual = lodashStable.map(values, function(value) {
-        value.a = 1;
-        var result = func(value).sort();
-        delete value.a;
-        return result;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ' + (isKeys ? 'not ' : '') + 'include inherited string keyed properties of `arguments` objects', function(assert) {
-      assert.expect(1);
-
-      var values = [args, strictArgs],
-          expected = lodashStable.map(values, lodashStable.constant(isKeys ? ['0', '1', '2'] : ['0', '1', '2', 'a']));
-
-      var actual = lodashStable.map(values, function(value) {
-        objectProto.a = 1;
-        var result = func(value).sort();
-        delete objectProto.a;
-        return result;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with string objects', function(assert) {
-      assert.expect(1);
-
-      var actual = func(Object('abc')).sort();
-
-      assert.deepEqual(actual, ['0', '1', '2']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return keys for custom properties on string objects', function(assert) {
-      assert.expect(1);
-
-      var object = Object('a');
-      object.a = 1;
-
-      var actual = func(object).sort();
-
-      assert.deepEqual(actual, ['0', 'a']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ' + (isKeys ? 'not ' : '') + 'include inherited string keyed properties of string objects', function(assert) {
-      assert.expect(1);
-
-      stringProto.a = 1;
-
-      var expected = isKeys ? ['0'] : ['0', 'a'],
-          actual = func(Object('a')).sort();
-
-      assert.deepEqual(actual, expected);
-
-      delete stringProto.a;
-    });
-
-    QUnit.test('`_.' + methodName + '` skips the `constructor` property on prototype objects', function(assert) {
-      assert.expect(3);
-
-      function Foo() {}
-      Foo.prototype.a = 1;
-
-      var expected = ['a'];
-      assert.deepEqual(func(Foo.prototype), expected);
-
-      Foo.prototype = { 'constructor': Foo, 'a': 1 };
-      assert.deepEqual(func(Foo.prototype), expected);
-
-      var Fake = { 'prototype': {} };
-      Fake.prototype.constructor = Fake;
-      assert.deepEqual(func(Fake.prototype), ['constructor']);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.last');
-
-  (function() {
-    var array = [1, 2, 3, 4];
-
-    QUnit.test('should return the last element', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.last(array), 4);
-    });
-
-    QUnit.test('should return `undefined` when querying empty arrays', function(assert) {
-      assert.expect(1);
-
-      var array = [];
-      array['-1'] = 1;
-
-      assert.strictEqual(_.last([]), undefined);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
-          actual = lodashStable.map(array, _.last);
-
-      assert.deepEqual(actual, [3, 6, 9]);
-    });
-
-    QUnit.test('should return an unwrapped value when implicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.strictEqual(_(array).last(), 4);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.ok(_(array).chain().last() instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should not execute immediately when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var wrapped = _(array).chain().last();
-        assert.strictEqual(wrapped.__wrapped__, array);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var largeArray = lodashStable.range(LARGE_ARRAY_SIZE),
-            smallArray = array;
-
-        lodashStable.times(2, function(index) {
-          var array = index ? largeArray : smallArray,
-              wrapped = _(array).filter(isEven);
-
-          assert.strictEqual(wrapped.last(), _.last(_.filter(array, isEven)));
-        });
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.lowerCase');
-
-  (function() {
-    QUnit.test('should lowercase as space-separated words', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.lowerCase('--Foo-Bar--'), 'foo bar');
-      assert.strictEqual(_.lowerCase('fooBar'), 'foo bar');
-      assert.strictEqual(_.lowerCase('__FOO_BAR__'), 'foo bar');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.lowerFirst');
-
-  (function() {
-    QUnit.test('should lowercase only the first character', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.lowerFirst('fred'), 'fred');
-      assert.strictEqual(_.lowerFirst('Fred'), 'fred');
-      assert.strictEqual(_.lowerFirst('FRED'), 'fRED');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.lt');
-
-  (function() {
-    QUnit.test('should return `true` if `value` is less than `other`', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.lt(1, 3), true);
-      assert.strictEqual(_.lt('abc', 'def'), true);
-    });
-
-    QUnit.test('should return `false` if `value` >= `other`', function(assert) {
-      assert.expect(4);
-
-      assert.strictEqual(_.lt(3, 1), false);
-      assert.strictEqual(_.lt(3, 3), false);
-      assert.strictEqual(_.lt('def', 'abc'), false);
-      assert.strictEqual(_.lt('def', 'def'), false);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.lte');
-
-  (function() {
-    QUnit.test('should return `true` if `value` is <= `other`', function(assert) {
-      assert.expect(4);
-
-      assert.strictEqual(_.lte(1, 3), true);
-      assert.strictEqual(_.lte(3, 3), true);
-      assert.strictEqual(_.lte('abc', 'def'), true);
-      assert.strictEqual(_.lte('def', 'def'), true);
-    });
-
-    QUnit.test('should return `false` if `value` > `other`', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.lt(3, 1), false);
-      assert.strictEqual(_.lt('def', 'abc'), false);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.lastIndexOf');
-
-  (function() {
-    var array = [1, 2, 3, 1, 2, 3];
-
-    QUnit.test('should return the index of the last matched value', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.lastIndexOf(array, 3), 5);
-    });
-
-    QUnit.test('should work with a positive `fromIndex`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.lastIndexOf(array, 1, 2), 0);
-    });
-
-    QUnit.test('should work with `fromIndex` >= `array.length`', function(assert) {
-      assert.expect(1);
-
-      var values = [6, 8, Math.pow(2, 32), Infinity],
-          expected = lodashStable.map(values, lodashStable.constant([-1, 3, -1]));
-
-      var actual = lodashStable.map(values, function(fromIndex) {
-        return [
-          _.lastIndexOf(array, undefined, fromIndex),
-          _.lastIndexOf(array, 1, fromIndex),
-          _.lastIndexOf(array, '', fromIndex)
-        ];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with a negative `fromIndex`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.lastIndexOf(array, 2, -3), 1);
-    });
-
-    QUnit.test('should work with a negative `fromIndex` <= `-array.length`', function(assert) {
-      assert.expect(1);
-
-      var values = [-6, -8, -Infinity],
-          expected = lodashStable.map(values, alwaysZero);
-
-      var actual = lodashStable.map(values, function(fromIndex) {
-        return _.lastIndexOf(array, 1, fromIndex);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should treat falsey `fromIndex` values correctly', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === undefined ? 5 : -1;
-      });
-
-      var actual = lodashStable.map(falsey, function(fromIndex) {
-        return _.lastIndexOf(array, 3, fromIndex);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should coerce `fromIndex` to an integer', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.lastIndexOf(array, 2, 4.2), 4);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('indexOf methods');
-
-  lodashStable.each(['indexOf', 'lastIndexOf', 'sortedIndexOf', 'sortedLastIndexOf'], function(methodName) {
-    var func = _[methodName],
-        isIndexOf = !/last/i.test(methodName),
-        isSorted = /^sorted/.test(methodName);
-
-    QUnit.test('`_.' + methodName + '` should accept a falsey `array` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, lodashStable.constant(-1));
-
-      var actual = lodashStable.map(falsey, function(array, index) {
-        try {
-          return index ? func(array) : func();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `-1` for an unmatched value', function(assert) {
-      assert.expect(5);
-
-      var array = [1, 2, 3],
-          empty = [];
-
-      assert.strictEqual(func(array, 4), -1);
-      assert.strictEqual(func(array, 4, true), -1);
-      assert.strictEqual(func(array, undefined, true), -1);
-
-      assert.strictEqual(func(empty, undefined), -1);
-      assert.strictEqual(func(empty, undefined, true), -1);
-    });
-
-    QUnit.test('`_.' + methodName + '` should not match values on empty arrays', function(assert) {
-      assert.expect(2);
-
-      var array = [];
-      array[-1] = 0;
-
-      assert.strictEqual(func(array, undefined), -1);
-      assert.strictEqual(func(array, 0, true), -1);
-    });
-
-    QUnit.test('`_.' + methodName + '` should match `NaN`', function(assert) {
-      assert.expect(3);
-
-      var array = isSorted
-        ? [1, 2, NaN, NaN]
-        : [1, NaN, 3, NaN, 5, NaN];
-
-      if (isSorted) {
-        assert.strictEqual(func(array, NaN, true), isIndexOf ? 2 : 3);
-        skipAssert(assert, 2);
-      }
-      else {
-        assert.strictEqual(func(array, NaN), isIndexOf ? 1 : 5);
-        assert.strictEqual(func(array, NaN, 2), isIndexOf ? 3 : 1);
-        assert.strictEqual(func(array, NaN, -2), isIndexOf ? 5 : 3);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should match `-0` as `0`', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(func([-0], 0), 0);
-      assert.strictEqual(func([0], -0), 0);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.map');
-
-  (function() {
-    var array = [1, 2];
-
-    QUnit.test('should map values in `collection` to a new array', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': 1, 'b': 2 },
-          expected = ['1', '2'];
-
-      assert.deepEqual(_.map(array, String), expected);
-      assert.deepEqual(_.map(object, String), expected);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'a': 'x' }, { 'a': 'y' }];
-      assert.deepEqual(_.map(objects, 'a'), ['x', 'y']);
-    });
-
-    QUnit.test('should iterate over own string keyed properties of objects', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var actual = _.map(new Foo, identity);
-      assert.deepEqual(actual, [1]);
-    });
-
-    QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': 1, 'b': 2 },
-          values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant([1, 2]));
-
-      lodashStable.each([array, object], function(collection) {
-        var actual = lodashStable.map(values, function(value, index) {
-          return index ? _.map(collection, value) : _.map(collection);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should accept a falsey `collection` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysEmptyArray);
-
-      var actual = lodashStable.map(falsey, function(collection, index) {
-        try {
-          return index ? _.map(collection) : _.map();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should treat number values for `collection` as empty', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.map(1), []);
-    });
-
-    QUnit.test('should treat a nodelist as an array-like object', function(assert) {
-      assert.expect(1);
-
-      if (document) {
-        var actual = _.map(document.getElementsByTagName('body'), function(element) {
-          return element.nodeName.toLowerCase();
-        });
-
-        assert.deepEqual(actual, ['body']);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should work with objects with non-number length properties', function(assert) {
-      assert.expect(1);
-
-      var value = { 'value': 'x' },
-          object = { 'length': { 'value': 'x' } };
-
-      assert.deepEqual(_.map(object, identity), [value]);
-    });
-
-    QUnit.test('should return a wrapped value when chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.ok(_(array).map(noop) instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should provide the correct `predicate` arguments in a lazy sequence', function(assert) {
-      assert.expect(5);
-
-      if (!isNpm) {
-        var args,
-            array = lodashStable.range(LARGE_ARRAY_SIZE + 1),
-            expected = [1, 0, _.map(array.slice(1), square)];
-
-        _(array).slice(1).map(function(value, index, array) {
-          args || (args = slice.call(arguments));
-        }).value();
-
-        assert.deepEqual(args, [1, 0, array.slice(1)]);
-
-        args = undefined;
-        _(array).slice(1).map(square).map(function(value, index, array) {
-          args || (args = slice.call(arguments));
-        }).value();
-
-        assert.deepEqual(args, expected);
-
-        args = undefined;
-        _(array).slice(1).map(square).map(function(value, index) {
-          args || (args = slice.call(arguments));
-        }).value();
-
-        assert.deepEqual(args, expected);
-
-        args = undefined;
-        _(array).slice(1).map(square).map(function(value) {
-          args || (args = slice.call(arguments));
-        }).value();
-
-        assert.deepEqual(args, [1]);
-
-        args = undefined;
-        _(array).slice(1).map(square).map(function() {
-          args || (args = slice.call(arguments));
-        }).value();
-
-        assert.deepEqual(args, expected);
-      }
-      else {
-        skipAssert(assert, 5);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.mapKeys');
-
-  (function() {
-    var array = [1, 2],
-        object = { 'a': 1, 'b': 2 };
-
-    QUnit.test('should map keys in `object` to a new object', function(assert) {
-      assert.expect(1);
-
-      var actual = _.mapKeys(object, String);
-      assert.deepEqual(actual, { '1': 1, '2': 2 });
-    });
-
-    QUnit.test('should treat arrays like objects', function(assert) {
-      assert.expect(1);
-
-      var actual = _.mapKeys(array, String);
-      assert.deepEqual(actual, { '1': 1, '2': 2 });
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var actual = _.mapKeys({ 'a': { 'b': 'c' } }, 'b');
-      assert.deepEqual(actual, { 'c': { 'b': 'c' } });
-    });
-
-    QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1, 'b': 2 },
-          values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant({ '1': 1, '2': 2 }));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.mapKeys(object, value) : _.mapKeys(object);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.mapValues');
-
-  (function() {
-    var array = [1, 2],
-        object = { 'a': 1, 'b': 2 };
-
-    QUnit.test('should map values in `object` to a new object', function(assert) {
-      assert.expect(1);
-
-      var actual = _.mapValues(object, String);
-      assert.deepEqual(actual, { 'a': '1', 'b': '2' });
-    });
-
-    QUnit.test('should treat arrays like objects', function(assert) {
-      assert.expect(1);
-
-      var actual = _.mapValues(array, String);
-      assert.deepEqual(actual, { '0': '1', '1': '2' });
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var actual = _.mapValues({ 'a': { 'b': 1 } }, 'b');
-      assert.deepEqual(actual, { 'a': 1 });
-    });
-
-    QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1, 'b': 2 },
-          values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant([true, false]));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        var result = index ? _.mapValues(object, value) : _.mapValues(object);
-        return [lodashStable.isEqual(result, object), result === object];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.mapKeys and lodash.mapValues');
-
-  lodashStable.each(['mapKeys', 'mapValues'], function(methodName) {
-    var func = _[methodName],
-        object = { 'a': 1, 'b': 2 };
-
-    QUnit.test('`_.' + methodName + '` should iterate over own string keyed properties of objects', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 'a';
-      }
-      Foo.prototype.b = 'b';
-
-      var actual = func(new Foo, function(value, key) { return key; });
-      assert.deepEqual(actual, { 'a': 'a' });
-    });
-
-    QUnit.test('`_.' + methodName + '` should accept a falsey `object` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysEmptyObject);
-
-      var actual = lodashStable.map(falsey, function(object, index) {
-        try {
-          return index ? func(object) : func();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return a wrapped value when chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.ok(_(object)[methodName](noop) instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.matches');
-
-  (function() {
-    QUnit.test('should create a function that performs a deep comparison between `source` and a given object', function(assert) {
-      assert.expect(6);
-
-      var object = { 'a': 1, 'b': 2, 'c': 3 },
-          matches = _.matches({ 'a': 1 });
-
-      assert.strictEqual(matches.length, 1);
-      assert.strictEqual(matches(object), true);
-
-      matches = _.matches({ 'b': 1 });
-      assert.strictEqual(matches(object), false);
-
-      matches = _.matches({ 'a': 1, 'c': 3 });
-      assert.strictEqual(matches(object), true);
-
-      matches = _.matches({ 'c': 3, 'd': 4 });
-      assert.strictEqual(matches(object), false);
-
-      object = { 'a': { 'b': { 'c': 1, 'd': 2 }, 'e': 3 }, 'f': 4 };
-      matches = _.matches({ 'a': { 'b': { 'c': 1 } } });
-
-      assert.strictEqual(matches(object), true);
-    });
-
-    QUnit.test('should match inherited string keyed `object` properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var object = { 'a': new Foo },
-          matches = _.matches({ 'a': { 'b': 2 } });
-
-      assert.strictEqual(matches(object), true);
-    });
-
-    QUnit.test('should not match by inherited `source` properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var objects = [{ 'a': 1 }, { 'a': 1, 'b': 2 }],
-          source = new Foo,
-          actual = lodashStable.map(objects, _.matches(source)),
-          expected = lodashStable.map(objects, alwaysTrue);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should compare a variety of `source` property values', function(assert) {
-      assert.expect(2);
-
-      var object1 = { 'a': false, 'b': true, 'c': '3', 'd': 4, 'e': [5], 'f': { 'g': 6 } },
-          object2 = { 'a': 0, 'b': 1, 'c': 3, 'd': '4', 'e': ['5'], 'f': { 'g': '6' } },
-          matches = _.matches(object1);
-
-      assert.strictEqual(matches(object1), true);
-      assert.strictEqual(matches(object2), false);
-    });
-
-    QUnit.test('should match `-0` as `0`', function(assert) {
-      assert.expect(2);
-
-      var object1 = { 'a': -0 },
-          object2 = { 'a': 0 },
-          matches = _.matches(object1);
-
-      assert.strictEqual(matches(object2), true);
-
-      matches = _.matches(object2);
-      assert.strictEqual(matches(object1), true);
-    });
-
-    QUnit.test('should compare functions by reference', function(assert) {
-      assert.expect(3);
-
-      var object1 = { 'a': lodashStable.noop },
-          object2 = { 'a': noop },
-          object3 = { 'a': {} },
-          matches = _.matches(object1);
-
-      assert.strictEqual(matches(object1), true);
-      assert.strictEqual(matches(object2), false);
-      assert.strictEqual(matches(object3), false);
-    });
-
-    QUnit.test('should work with a function for `object`', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.a = { 'b': 1, 'c': 2 };
-
-      var matches = _.matches({ 'a': { 'b': 1 } });
-      assert.strictEqual(matches(Foo), true);
-    });
-
-    QUnit.test('should work with a function for `source`', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.a = 1;
-      Foo.b = function() {};
-      Foo.c = 3;
-
-      var objects = [{ 'a': 1 }, { 'a': 1, 'b': Foo.b, 'c': 3 }],
-          actual = lodashStable.map(objects, _.matches(Foo));
-
-      assert.deepEqual(actual, [false, true]);
-    });
-
-    QUnit.test('should work with a non-plain `object`', function(assert) {
-      assert.expect(1);
-
-      function Foo(object) { lodashStable.assign(this, object); }
-
-      var object = new Foo({ 'a': new Foo({ 'b': 1, 'c': 2 }) }),
-          matches = _.matches({ 'a': { 'b': 1 } });
-
-      assert.strictEqual(matches(object), true);
-    });
-
-    QUnit.test('should partial match arrays', function(assert) {
-      assert.expect(3);
-
-      var objects = [{ 'a': ['b'] }, { 'a': ['c', 'd'] }],
-          actual = lodashStable.filter(objects, _.matches({ 'a': ['d'] }));
-
-      assert.deepEqual(actual, [objects[1]]);
-
-      actual = lodashStable.filter(objects, _.matches({ 'a': ['b', 'd'] }));
-      assert.deepEqual(actual, []);
-
-      actual = lodashStable.filter(objects, _.matches({ 'a': ['d', 'b'] }));
-      assert.deepEqual(actual, []);
-    });
-
-    QUnit.test('should partial match arrays of objects', function(assert) {
-      assert.expect(1);
-
-      var objects = [
-        { 'a': [{ 'b': 1, 'c': 2 }, { 'b': 4, 'c': 5, 'd': 6 }] },
-        { 'a': [{ 'b': 1, 'c': 2 }, { 'b': 4, 'c': 6, 'd': 7 }] }
-      ];
-
-      var actual = lodashStable.filter(objects, _.matches({ 'a': [{ 'b': 1 }, { 'b': 4, 'c': 5 }] }));
-      assert.deepEqual(actual, [objects[0]]);
-    });
-
-    QUnit.test('should partial match maps', function(assert) {
-      assert.expect(3);
-
-      if (Map) {
-        var objects = [{ 'a': new Map }, { 'a': new Map }];
-        objects[0].a.set('a', 1);
-        objects[1].a.set('a', 1);
-        objects[1].a.set('b', 2);
-
-        var map = new Map;
-        map.set('b', 2);
-        var actual = lodashStable.filter(objects, _.matches({ 'a': map }));
-
-        assert.deepEqual(actual, [objects[1]]);
-
-        map['delete']('b');
-        actual = lodashStable.filter(objects, _.matches({ 'a': map }));
-
-        assert.deepEqual(actual, objects);
-
-        map.set('c', 3);
-        actual = lodashStable.filter(objects, _.matches({ 'a': map }));
-
-        assert.deepEqual(actual, []);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should partial match sets', function(assert) {
-      assert.expect(3);
-
-      if (Set) {
-        var objects = [{ 'a': new Set }, { 'a': new Set }];
-        objects[0].a.add(1);
-        objects[1].a.add(1);
-        objects[1].a.add(2);
-
-        var set = new Set;
-        set.add(2);
-        var actual = lodashStable.filter(objects, _.matches({ 'a': set }));
-
-        assert.deepEqual(actual, [objects[1]]);
-
-        set['delete'](2);
-        actual = lodashStable.filter(objects, _.matches({ 'a': set }));
-
-        assert.deepEqual(actual, objects);
-
-        set.add(3);
-        actual = lodashStable.filter(objects, _.matches({ 'a': set }));
-
-        assert.deepEqual(actual, []);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should match `undefined` values', function(assert) {
-      assert.expect(3);
-
-      var objects = [{ 'a': 1 }, { 'a': 1, 'b': 1 }, { 'a': 1, 'b': undefined }],
-          actual = lodashStable.map(objects, _.matches({ 'b': undefined })),
-          expected = [false, false, true];
-
-      assert.deepEqual(actual, expected);
-
-      actual = lodashStable.map(objects, _.matches({ 'a': 1, 'b': undefined }));
-
-      assert.deepEqual(actual, expected);
-
-      objects = [{ 'a': { 'b': 1 } }, { 'a': { 'b': 1, 'c': 1 } }, { 'a': { 'b': 1, 'c': undefined } }];
-      actual = lodashStable.map(objects, _.matches({ 'a': { 'c': undefined } }));
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should match `undefined` values on primitives', function(assert) {
-      assert.expect(3);
-
-      numberProto.a = 1;
-      numberProto.b = undefined;
-
-      try {
-        var matches = _.matches({ 'b': undefined });
-        assert.strictEqual(matches(1), true);
-      } catch (e) {
-        assert.ok(false, e.message);
-      }
-      try {
-        matches = _.matches({ 'a': 1, 'b': undefined });
-        assert.strictEqual(matches(1), true);
-      } catch (e) {
-        assert.ok(false, e.message);
-      }
-      numberProto.a = { 'b': 1, 'c': undefined };
-      try {
-        matches = _.matches({ 'a': { 'c': undefined } });
-        assert.strictEqual(matches(1), true);
-      } catch (e) {
-        assert.ok(false, e.message);
-      }
-      delete numberProto.a;
-      delete numberProto.b;
-    });
-
-    QUnit.test('should return `false` when `object` is nullish', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, alwaysFalse),
-          matches = _.matches({ 'a': 1 });
-
-      var actual = lodashStable.map(values, function(value, index) {
-        try {
-          return index ? matches(value) : matches();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `true` when comparing an empty `source` to a nullish `object`', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, alwaysTrue),
-          matches = _.matches({});
-
-      var actual = lodashStable.map(values, function(value, index) {
-        try {
-          return index ? matches(value) : matches();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `true` when comparing an empty `source`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1 },
-          expected = lodashStable.map(empties, alwaysTrue);
-
-      var actual = lodashStable.map(empties, function(value) {
-        var matches = _.matches(value);
-        return matches(object);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `true` when comparing a `source` of empty arrays and objects', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'a': [1], 'b': { 'c': 1 } }, { 'a': [2, 3], 'b': { 'd': 2 } }],
-          actual = lodashStable.filter(objects, _.matches({ 'a': [], 'b': {} }));
-
-      assert.deepEqual(actual, objects);
-    });
-
-    QUnit.test('should not change behavior if `source` is modified', function(assert) {
-      assert.expect(9);
-
-      var sources = [
-        { 'a': { 'b': 2, 'c': 3 } },
-        { 'a': 1, 'b': 2 },
-        { 'a': 1 }
-      ];
-
-      lodashStable.each(sources, function(source, index) {
-        var object = lodashStable.cloneDeep(source),
-            matches = _.matches(source);
-
-        assert.strictEqual(matches(object), true);
-
-        if (index) {
-          source.a = 2;
-          source.b = 1;
-          source.c = 3;
-        } else {
-          source.a.b = 1;
-          source.a.c = 2;
-          source.a.d = 3;
-        }
-        assert.strictEqual(matches(object), true);
-        assert.strictEqual(matches(source), false);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.matchesProperty');
-
-  (function() {
-    QUnit.test('should create a function that performs a deep comparison between a property value and `srcValue`', function(assert) {
-      assert.expect(6);
-
-      var object = { 'a': 1, 'b': 2, 'c': 3 },
-          matches = _.matchesProperty('a', 1);
-
-      assert.strictEqual(matches.length, 1);
-      assert.strictEqual(matches(object), true);
-
-      matches = _.matchesProperty('b', 3);
-      assert.strictEqual(matches(object), false);
-
-      matches = _.matchesProperty('a', { 'a': 1, 'c': 3 });
-      assert.strictEqual(matches({ 'a': object }), true);
-
-      matches = _.matchesProperty('a', { 'c': 3, 'd': 4 });
-      assert.strictEqual(matches(object), false);
-
-      object = { 'a': { 'b': { 'c': 1, 'd': 2 }, 'e': 3 }, 'f': 4 };
-      matches = _.matchesProperty('a', { 'b': { 'c': 1 } });
-
-      assert.strictEqual(matches(object), true);
-    });
-
-    QUnit.test('should support deep paths', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': 2 } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        var matches = _.matchesProperty(path, 2);
-        assert.strictEqual(matches(object), true);
-      });
-    });
-
-    QUnit.test('should work with a non-string `path`', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3];
-
-      lodashStable.each([1, [1]], function(path) {
-        var matches = _.matchesProperty(path, 2);
-        assert.strictEqual(matches(array), true);
-      });
-    });
-
-    QUnit.test('should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var object1 = { '-0': 'a' },
-          object2 = { '0': 'b' },
-          pairs = [[object1, object2], [object1, object2], [object2, object1], [object2, object1]],
-          props = [-0, Object(-0), 0, Object(0)],
-          values = ['a', 'a', 'b', 'b'],
-          expected = lodashStable.map(props, lodashStable.constant([true, false]));
-
-      var actual = lodashStable.map(props, function(key, index) {
-        var matches = _.matchesProperty(key, values[index]),
-            pair = pairs[index];
-
-        return [matches(pair[0]), matches(pair[1])];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should coerce key to a string', function(assert) {
-      assert.expect(1);
-
-      function fn() {}
-      fn.toString = lodashStable.constant('fn');
-
-      var objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }],
-          values = [null, undefined, fn, {}];
-
-      var expected = lodashStable.transform(values, function(result) {
-        result.push(true, true);
-      });
-
-      var actual = lodashStable.transform(objects, function(result, object, index) {
-        var key = values[index];
-        lodashStable.each([key, [key]], function(path) {
-          var matches = _.matchesProperty(path, object[key]);
-          result.push(matches(object));
-        });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should match a key over a path', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a.b': 1, 'a': { 'b': 2 } };
-
-      lodashStable.each(['a.b', ['a.b']], function(path) {
-        var matches = _.matchesProperty(path, 1);
-        assert.strictEqual(matches(object), true);
-      });
-    });
-
-    QUnit.test('should return `false` if parts of `path` are missing', function(assert) {
-      assert.expect(4);
-
-      var object = {};
-
-      lodashStable.each(['a', 'a[1].b.c', ['a'], ['a', '1', 'b', 'c']], function(path) {
-        var matches = _.matchesProperty(path, 1);
-        assert.strictEqual(matches(object), false);
-      });
-    });
-
-    QUnit.test('should return `false` for deep paths when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      lodashStable.each(['constructor.prototype.valueOf', ['constructor', 'prototype', 'valueOf']], function(path) {
-        var matches = _.matchesProperty(path, 1);
-
-        var actual = lodashStable.map(values, function(value, index) {
-          try {
-            return index ? matches(value) : matches();
-          } catch (e) {}
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should match inherited string keyed `srcValue` properties', function(assert) {
-      assert.expect(2);
-
-      function Foo() {}
-      Foo.prototype.b = 2;
-
-      var object = { 'a': new Foo };
-
-      lodashStable.each(['a', ['a']], function(path) {
-        var matches = _.matchesProperty(path, { 'b': 2 });
-        assert.strictEqual(matches(object), true);
-      });
-    });
-
-    QUnit.test('should not match by inherited `srcValue` properties', function(assert) {
-      assert.expect(2);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var objects = [{ 'a': { 'a': 1 } }, { 'a': { 'a': 1, 'b': 2 } }],
-          expected = lodashStable.map(objects, alwaysTrue);
-
-      lodashStable.each(['a', ['a']], function(path) {
-        assert.deepEqual(lodashStable.map(objects, _.matchesProperty(path, new Foo)), expected);
-      });
-    });
-
-    QUnit.test('should compare a variety of values', function(assert) {
-      assert.expect(2);
-
-      var object1 = { 'a': false, 'b': true, 'c': '3', 'd': 4, 'e': [5], 'f': { 'g': 6 } },
-          object2 = { 'a': 0, 'b': 1, 'c': 3, 'd': '4', 'e': ['5'], 'f': { 'g': '6' } },
-          matches = _.matchesProperty('a', object1);
-
-      assert.strictEqual(matches({ 'a': object1 }), true);
-      assert.strictEqual(matches({ 'a': object2 }), false);
-    });
-
-    QUnit.test('should match `-0` as `0`', function(assert) {
-      assert.expect(2);
-
-      var matches = _.matchesProperty('a', -0);
-      assert.strictEqual(matches({ 'a': 0 }), true);
-
-      matches = _.matchesProperty('a', 0);
-      assert.strictEqual(matches({ 'a': -0 }), true);
-    });
-
-    QUnit.test('should compare functions by reference', function(assert) {
-      assert.expect(3);
-
-      var object1 = { 'a': lodashStable.noop },
-          object2 = { 'a': noop },
-          object3 = { 'a': {} },
-          matches = _.matchesProperty('a', object1);
-
-      assert.strictEqual(matches({ 'a': object1 }), true);
-      assert.strictEqual(matches({ 'a': object2 }), false);
-      assert.strictEqual(matches({ 'a': object3 }), false);
-    });
-
-    QUnit.test('should work with a function for `srcValue`', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.a = 1;
-      Foo.b = function() {};
-      Foo.c = 3;
-
-      var objects = [{ 'a': { 'a': 1 } }, { 'a': { 'a': 1, 'b': Foo.b, 'c': 3 } }],
-          actual = lodashStable.map(objects, _.matchesProperty('a', Foo));
-
-      assert.deepEqual(actual, [false, true]);
-    });
-
-    QUnit.test('should work with a non-plain `srcValue`', function(assert) {
-      assert.expect(1);
-
-      function Foo(object) { lodashStable.assign(this, object); }
-
-      var object = new Foo({ 'a': new Foo({ 'b': 1, 'c': 2 }) }),
-          matches = _.matchesProperty('a', { 'b': 1 });
-
-      assert.strictEqual(matches(object), true);
-    });
-
-    QUnit.test('should partial match arrays', function(assert) {
-      assert.expect(3);
-
-      var objects = [{ 'a': ['b'] }, { 'a': ['c', 'd'] }],
-          actual = lodashStable.filter(objects, _.matchesProperty('a', ['d']));
-
-      assert.deepEqual(actual, [objects[1]]);
-
-      actual = lodashStable.filter(objects, _.matchesProperty('a', ['b', 'd']));
-      assert.deepEqual(actual, []);
-
-      actual = lodashStable.filter(objects, _.matchesProperty('a', ['d', 'b']));
-      assert.deepEqual(actual, []);
-    });
-
-    QUnit.test('should partial match arrays of objects', function(assert) {
-      assert.expect(1);
-
-      var objects = [
-        { 'a': [{ 'a': 1, 'b': 2 }, { 'a': 4, 'b': 5, 'c': 6 }] },
-        { 'a': [{ 'a': 1, 'b': 2 }, { 'a': 4, 'b': 6, 'c': 7 }] }
-      ];
-
-      var actual = lodashStable.filter(objects, _.matchesProperty('a', [{ 'a': 1 }, { 'a': 4, 'b': 5 }]));
-      assert.deepEqual(actual, [objects[0]]);
-    });
-    QUnit.test('should partial match maps', function(assert) {
-      assert.expect(3);
-
-      if (Map) {
-        var objects = [{ 'a': new Map }, { 'a': new Map }];
-        objects[0].a.set('a', 1);
-        objects[1].a.set('a', 1);
-        objects[1].a.set('b', 2);
-
-        var map = new Map;
-        map.set('b', 2);
-        var actual = lodashStable.filter(objects, _.matchesProperty('a', map));
-
-        assert.deepEqual(actual, [objects[1]]);
-
-        map['delete']('b');
-        actual = lodashStable.filter(objects, _.matchesProperty('a', map));
-
-        assert.deepEqual(actual, objects);
-
-        map.set('c', 3);
-        actual = lodashStable.filter(objects, _.matchesProperty('a', map));
-
-        assert.deepEqual(actual, []);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should partial match sets', function(assert) {
-      assert.expect(3);
-
-      if (Set) {
-        var objects = [{ 'a': new Set }, { 'a': new Set }];
-        objects[0].a.add(1);
-        objects[1].a.add(1);
-        objects[1].a.add(2);
-
-        var set = new Set;
-        set.add(2);
-        var actual = lodashStable.filter(objects, _.matchesProperty('a', set));
-
-        assert.deepEqual(actual, [objects[1]]);
-
-        set['delete'](2);
-        actual = lodashStable.filter(objects, _.matchesProperty('a', set));
-
-        assert.deepEqual(actual, objects);
-
-        set.add(3);
-        actual = lodashStable.filter(objects, _.matchesProperty('a', set));
-
-        assert.deepEqual(actual, []);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should match `undefined` values', function(assert) {
-      assert.expect(2);
-
-      var objects = [{ 'a': 1 }, { 'a': 1, 'b': 1 }, { 'a': 1, 'b': undefined }],
-          actual = lodashStable.map(objects, _.matchesProperty('b', undefined)),
-          expected = [false, false, true];
-
-      assert.deepEqual(actual, expected);
-
-      objects = [{ 'a': { 'a': 1 } }, { 'a': { 'a': 1, 'b': 1 } }, { 'a': { 'a': 1, 'b': undefined } }];
-      actual = lodashStable.map(objects, _.matchesProperty('a', { 'b': undefined }));
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should match `undefined` values of nested objects', function(assert) {
-      assert.expect(4);
-
-      var object = { 'a': { 'b': undefined } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        var matches = _.matchesProperty(path, undefined);
-        assert.strictEqual(matches(object), true);
-      });
-
-      lodashStable.each(['a.a', ['a', 'a']], function(path) {
-        var matches = _.matchesProperty(path, undefined);
-        assert.strictEqual(matches(object), false);
-      });
-    });
-
-    QUnit.test('should match `undefined` values on primitives', function(assert) {
-      assert.expect(2);
-
-      numberProto.a = 1;
-      numberProto.b = undefined;
-
-      try {
-        var matches = _.matchesProperty('b', undefined);
-        assert.strictEqual(matches(1), true);
-      } catch (e) {
-        assert.ok(false, e.message);
-      }
-      numberProto.a = { 'b': 1, 'c': undefined };
-      try {
-        matches = _.matchesProperty('a', { 'c': undefined });
-        assert.strictEqual(matches(1), true);
-      } catch (e) {
-        assert.ok(false, e.message);
-      }
-      delete numberProto.a;
-      delete numberProto.b;
-    });
-
-    QUnit.test('should return `false` when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      lodashStable.each(['constructor', ['constructor']], function(path) {
-        var matches = _.matchesProperty(path, 1);
-
-        var actual = lodashStable.map(values, function(value, index) {
-          try {
-            return index ? matches(value) : matches();
-          } catch (e) {}
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should return `true` when comparing a `srcValue` of empty arrays and objects', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'a': [1], 'b': { 'c': 1 } }, { 'a': [2, 3], 'b': { 'd': 2 } }],
-          matches = _.matchesProperty('a', { 'a': [], 'b': {} });
-
-      var actual = lodashStable.filter(objects, function(object) {
-        return matches({ 'a': object });
-      });
-
-      assert.deepEqual(actual, objects);
-    });
-
-    QUnit.test('should not change behavior if `srcValue` is modified', function(assert) {
-      assert.expect(9);
-
-      lodashStable.each([{ 'a': { 'b': 2, 'c': 3 } }, { 'a': 1, 'b': 2 }, { 'a': 1 }], function(source, index) {
-        var object = lodashStable.cloneDeep(source),
-            matches = _.matchesProperty('a', source);
-
-        assert.strictEqual(matches({ 'a': object }), true);
-
-        if (index) {
-          source.a = 2;
-          source.b = 1;
-          source.c = 3;
-        } else {
-          source.a.b = 1;
-          source.a.c = 2;
-          source.a.d = 3;
-        }
-        assert.strictEqual(matches({ 'a': object }), true);
-        assert.strictEqual(matches({ 'a': source }), false);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.max');
-
-  (function() {
-    QUnit.test('should return the largest value from a collection', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.max([1, 2, 3]), 3);
-    });
-
-    QUnit.test('should return `undefined` for empty collections', function(assert) {
-      assert.expect(1);
-
-      var values = falsey.concat([[]]),
-          expected = lodashStable.map(values, noop);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        try {
-          return index ? _.max(value) : _.max();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with non-numeric collection values', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.max(['a', 'b']), 'b');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.mean');
-
-  (function() {
-    QUnit.test('should return the mean of an array of numbers', function(assert) {
-      assert.expect(1);
-
-      var array = [4, 2, 8, 6];
-      assert.strictEqual(_.mean(array), 5);
-    });
-
-    QUnit.test('should return `NaN` when passing empty `array` values', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(empties, alwaysNaN),
-          actual = lodashStable.map(empties, _.mean);
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.meanBy');
-
-  (function() {
-    var objects = [{ 'a': 2 }, { 'a': 3 }, { 'a': 1 }];
-
-    QUnit.test('should work with an `iteratee` argument', function(assert) {
-      assert.expect(1);
-
-      var actual = _.meanBy(objects, function(object) {
-        return object.a;
-      });
-
-      assert.deepEqual(actual, 2);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.meanBy(objects, function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [{ 'a': 2 }]);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(2);
-
-      var arrays = [[2], [3], [1]];
-      assert.strictEqual(_.meanBy(arrays, 0), 2);
-      assert.strictEqual(_.meanBy(objects, 'a'), 2);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.memoize');
-
-  (function() {
-    QUnit.test('should memoize results based on the first argument given', function(assert) {
-      assert.expect(2);
-
-      var memoized = _.memoize(function(a, b, c) {
-        return a + b + c;
-      });
-
-      assert.strictEqual(memoized(1, 2, 3), 6);
-      assert.strictEqual(memoized(1, 3, 5), 6);
-    });
-
-    QUnit.test('should support a `resolver` argument', function(assert) {
-      assert.expect(2);
-
-      var fn = function(a, b, c) { return a + b + c; },
-          memoized = _.memoize(fn, fn);
-
-      assert.strictEqual(memoized(1, 2, 3), 6);
-      assert.strictEqual(memoized(1, 3, 5), 9);
-    });
-
-    QUnit.test('should use `this` binding of function for `resolver`', function(assert) {
-      assert.expect(2);
-
-      var fn = function(a, b, c) { return a + this.b + this.c; },
-          memoized = _.memoize(fn, fn);
-
-      var object = { 'memoized': memoized, 'b': 2, 'c': 3 };
-      assert.strictEqual(object.memoized(1), 6);
-
-      object.b = 3;
-      object.c = 5;
-      assert.strictEqual(object.memoized(1), 9);
-    });
-
-    QUnit.test('should throw a TypeError if `resolve` is truthy and not a function', function(assert) {
-      assert.expect(1);
-
-      assert.raises(function() { _.memoize(noop, true); }, TypeError);
-    });
-
-    QUnit.test('should not error if `resolver` is falsey', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysTrue);
-
-      var actual = lodashStable.map(falsey, function(resolver, index) {
-        try {
-          return _.isFunction(index ? _.memoize(noop, resolver) : _.memoize(noop));
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should check cache for own properties', function(assert) {
-      assert.expect(1);
-
-      var props = [
-        'constructor',
-        'hasOwnProperty',
-        'isPrototypeOf',
-        'propertyIsEnumerable',
-        'toLocaleString',
-        'toString',
-        'valueOf'
-      ];
-
-      var memoized = _.memoize(identity);
-
-      var actual = lodashStable.map(props, function(value) {
-        return memoized(value);
-      });
-
-      assert.deepEqual(actual, props);
-    });
-
-    QUnit.test('should cache the `__proto__` key', function(assert) {
-      assert.expect(8);
-
-      var array = [],
-          key = '__proto__';
-
-      lodashStable.times(2, function(index) {
-        var count = 0,
-            resolver = index && identity;
-
-        var memoized = _.memoize(function() {
-          count++;
-          return array;
-        }, resolver);
-
-        var cache = memoized.cache;
-
-        memoized(key);
-        memoized(key);
-
-        assert.strictEqual(count, 1);
-        assert.strictEqual(cache.get(key), array);
-        assert.notOk(cache.__data__ instanceof Array);
-        assert.strictEqual(cache['delete'](key), true);
-      });
-    });
-
-    QUnit.test('should allow `_.memoize.Cache` to be customized', function(assert) {
-      assert.expect(4);
-
-      var oldCache = _.memoize.Cache;
-
-      function Cache() {
-        this.__data__ = [];
-      }
-
-      Cache.prototype = {
-        'get': function(key) {
-          var entry = _.find(this.__data__, function(entry) {
-            return key === entry.key;
-          });
-          return entry && entry.value;
-        },
-        'has': function(key) {
-          return _.some(this.__data__, function(entry) {
-            return key === entry.key;
-          });
-        },
-        'set': function(key, value) {
-          this.__data__.push({ 'key': key, 'value': value });
-          return this;
-        }
-      };
-
-      _.memoize.Cache = Cache;
-
-      var memoized = _.memoize(function(object) {
-        return 'value:' + object.id;
-      });
-
-      var cache = memoized.cache,
-          key1 = { 'id': 'a' },
-          key2 = { 'id': 'b' };
-
-      assert.strictEqual(memoized(key1), 'value:a');
-      assert.strictEqual(cache.has(key1), true);
-
-      assert.strictEqual(memoized(key2), 'value:b');
-      assert.strictEqual(cache.has(key2), true);
-
-      _.memoize.Cache = oldCache;
-    });
-
-    QUnit.test('should works with an immutable `_.memoize.Cache` ', function(assert) {
-      assert.expect(2);
-
-      var oldCache = _.memoize.Cache;
-
-      function Cache() {
-        this.__data__ = [];
-      }
-
-      Cache.prototype = {
-        'get': function(key) {
-          return _.find(this.__data__, function(entry) {
-            return key === entry.key;
-          }).value;
-        },
-        'has': function(key) {
-          return _.some(this.__data__, function(entry) {
-            return key === entry.key;
-          });
-        },
-        'set': function(key, value) {
-          var result = new Cache;
-          result.__data__ = this.__data__.concat({ 'key': key, 'value': value });
-          return result;
-        }
-      };
-
-      _.memoize.Cache = Cache;
-
-      var memoized = _.memoize(function(object) {
-        return object.id;
-      });
-
-      var key1 = { 'id': 'a' },
-          key2 = { 'id': 'b' };
-
-      memoized(key1);
-      memoized(key2);
-
-      var cache = memoized.cache;
-      assert.strictEqual(cache.has(key1), true);
-      assert.strictEqual(cache.has(key2), true);
-
-      _.memoize.Cache = oldCache;
-    });
-
-    QUnit.test('should implement a `Map` interface on the cache object', function(assert) {
-      assert.expect(164);
-
-      var keys = [null, undefined, false, true, 1, -Infinity, NaN, {}, 'a', symbol || {}];
-
-      var pairs = lodashStable.map(keys, function(key, index) {
-        var lastIndex = keys.length - 1;
-        return [key, keys[lastIndex - index]];
-      });
-
-      lodashStable.times(2, function(index) {
-        var memoize = (index ? (lodashBizarro || {}) : _).memoize,
-            Cache = memoize ? memoize.Cache : undefined,
-            cache = Cache ? new Cache(pairs) : undefined;
-
-        lodashStable.each(keys, function(key, index) {
-          if (cache) {
-            var value = pairs[index][1];
-
-            assert.deepEqual(cache.get(key), value);
-            assert.strictEqual(cache.has(key), true);
-            assert.strictEqual(cache['delete'](key), true);
-            assert.strictEqual(cache.has(key), false);
-            assert.strictEqual(cache.get(key), undefined);
-            assert.strictEqual(cache['delete'](key), false);
-            assert.strictEqual(cache.set(key, value), cache);
-            assert.strictEqual(cache.has(key), true);
-          }
-          else {
-            skipAssert(assert, 8);
-          }
-        });
-
-        if (cache) {
-          assert.strictEqual(cache.clear(), undefined);
-          assert.ok(lodashStable.every(keys, function(key) {
-            return !cache.has(key);
-          }));
-        }
-        else {
-          skipAssert(assert, 2);
-        }
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.merge');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should merge `source` into `object`', function(assert) {
-      assert.expect(1);
-
-      var names = {
-        'characters': [
-          { 'name': 'barney' },
-          { 'name': 'fred' }
-        ]
-      };
-
-      var ages = {
-        'characters': [
-          { 'age': 36 },
-          { 'age': 40 }
-        ]
-      };
-
-      var heights = {
-        'characters': [
-          { 'height': '5\'4"' },
-          { 'height': '5\'5"' }
-        ]
-      };
-
-      var expected = {
-        'characters': [
-          { 'name': 'barney', 'age': 36, 'height': '5\'4"' },
-          { 'name': 'fred', 'age': 40, 'height': '5\'5"' }
-        ]
-      };
-
-      assert.deepEqual(_.merge(names, ages, heights), expected);
-    });
-
-    QUnit.test('should merge sources containing circular references', function(assert) {
-      assert.expect(2);
-
-      var object = {
-        'foo': { 'a': 1 },
-        'bar': { 'a': 2 }
-      };
-
-      var source = {
-        'foo': { 'b': { 'c': { 'd': {} } } },
-        'bar': {}
-      };
-
-      source.foo.b.c.d = source;
-      source.bar.b = source.foo.b;
-
-      var actual = _.merge(object, source);
-
-      assert.notStrictEqual(actual.bar.b, actual.foo.b);
-      assert.strictEqual(actual.foo.b.c.d, actual.foo.b.c.d.foo.b.c.d);
-    });
-
-    QUnit.test('should work with four arguments', function(assert) {
-      assert.expect(1);
-
-      var expected = { 'a': 4 },
-          actual = _.merge({ 'a': 1 }, { 'a': 2 }, { 'a': 3 }, expected);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should merge onto function `object` values', function(assert) {
-      assert.expect(2);
-
-      function Foo() {}
-
-      var source = { 'a': 1 },
-          actual = _.merge(Foo, source);
-
-      assert.strictEqual(actual, Foo);
-      assert.strictEqual(Foo.a, 1);
-    });
-
-    QUnit.test('should not merge onto nested function values', function(assert) {
-      assert.expect(3);
-
-      var source1 = { 'a': function() {} },
-          source2 = { 'a': { 'b': 1 } },
-          actual = _.merge({}, source1, source2),
-          expected = { 'a': { 'b': 1 } };
-
-      assert.deepEqual(actual, expected);
-
-      source1 = { 'a': function() {} };
-      source2 = { 'a': { 'b': 1 } };
-
-      expected = { 'a': function() {} };
-      expected.a.b = 1;
-
-      actual = _.merge(source1, source2);
-      assert.strictEqual(typeof actual.a, 'function');
-      assert.strictEqual(actual.a.b, 1);
-    });
-
-    QUnit.test('should merge onto non-plain `object` values', function(assert) {
-      assert.expect(2);
-
-      function Foo() {}
-
-      var object = new Foo,
-          actual = _.merge(object, { 'a': 1 });
-
-      assert.strictEqual(actual, object);
-      assert.strictEqual(object.a, 1);
-    });
-
-    QUnit.test('should treat sparse array sources as dense', function(assert) {
-      assert.expect(2);
-
-      var array = [1];
-      array[2] = 3;
-
-      var actual = _.merge([], array),
-          expected = array.slice();
-
-      expected[1] = undefined;
-
-      assert.ok('1' in actual);
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should merge `arguments` objects', function(assert) {
-      assert.expect(7);
-
-      var object1 = { 'value': args },
-          object2 = { 'value': { '3': 4 } },
-          expected = { '0': 1, '1': 2, '2': 3, '3': 4 },
-          actual = _.merge(object1, object2);
-
-      assert.notOk('3' in args);
-      assert.notOk(_.isArguments(actual.value));
-      assert.deepEqual(actual.value, expected);
-      object1.value = args;
-
-      actual = _.merge(object2, object1);
-      assert.notOk(_.isArguments(actual.value));
-      assert.deepEqual(actual.value, expected);
-
-      expected = { '0': 1, '1': 2, '2': 3 };
-
-      actual = _.merge({}, object1);
-      assert.notOk(_.isArguments(actual.value));
-      assert.deepEqual(actual.value, expected);
-    });
-
-    QUnit.test('should merge typed arrays', function(assert) {
-      assert.expect(4);
-
-      var array1 = [0],
-          array2 = [0, 0],
-          array3 = [0, 0, 0, 0],
-          array4 = [0, 0, 0, 0, 0, 0, 0, 0];
-
-      var arrays = [array2, array1, array4, array3, array2, array4, array4, array3, array2],
-          buffer = ArrayBuffer && new ArrayBuffer(8);
-
-      // Juggle for `Float64Array` shim.
-      if (root.Float64Array && (new Float64Array(buffer)).length == 8) {
-        arrays[1] = array4;
-      }
-      var expected = lodashStable.map(typedArrays, function(type, index) {
-        var array = arrays[index].slice();
-        array[0] = 1;
-        return root[type] ? { 'value': array } : false;
-      });
-
-      var actual = lodashStable.map(typedArrays, function(type) {
-        var Ctor = root[type];
-        return Ctor ? _.merge({ 'value': new Ctor(buffer) }, { 'value': [1] }) : false;
-      });
-
-      assert.ok(lodashStable.isArray(actual));
-      assert.deepEqual(actual, expected);
-
-      expected = lodashStable.map(typedArrays, function(type, index) {
-        var array = arrays[index].slice();
-        array.push(1);
-        return root[type] ? { 'value': array } : false;
-      });
-
-      actual = lodashStable.map(typedArrays, function(type, index) {
-        var Ctor = root[type],
-            array = lodashStable.range(arrays[index].length);
-
-        array.push(1);
-        return Ctor ? _.merge({ 'value': array }, { 'value': new Ctor(buffer) }) : false;
-      });
-
-      assert.ok(lodashStable.isArray(actual));
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should assign `null` values', function(assert) {
-      assert.expect(1);
-
-      var actual = _.merge({ 'a': 1 }, { 'a': null });
-      assert.strictEqual(actual.a, null);
-    });
-
-    QUnit.test('should assign non array/typed-array/plain-object sources directly', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-
-      var values = [new Foo, new Boolean, new Date, Foo, new Number, new String, new RegExp],
-          expected = lodashStable.map(values, alwaysTrue);
-
-      var actual = lodashStable.map(values, function(value) {
-        var object = _.merge({}, { 'value': value });
-        return object.value === value;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should deep clone array/typed-array/plain-object sources', function(assert) {
-      assert.expect(1);
-
-      var typedArray = Uint8Array
-        ? new Uint8Array(new ArrayBuffer(2))
-        : { 'buffer': [0, 0] };
-
-      var props = ['0', 'a', 'buffer'],
-          values = [[{ 'a': 1 }], { 'a': [1] }, typedArray],
-          expected = lodashStable.map(values, alwaysTrue);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        var key = props[index],
-            object = _.merge({}, { 'value': value }),
-            newValue = object.value;
-
-        return (
-          newValue !== value &&
-          newValue[key] !== value[key] &&
-          lodashStable.isEqual(newValue, value)
-        );
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should not augment source objects', function(assert) {
-      assert.expect(6);
-
-      var source1 = { 'a': [{ 'a': 1 }] },
-          source2 = { 'a': [{ 'b': 2 }] },
-          actual = _.merge({}, source1, source2);
-
-      assert.deepEqual(source1.a, [{ 'a': 1 }]);
-      assert.deepEqual(source2.a, [{ 'b': 2 }]);
-      assert.deepEqual(actual.a, [{ 'a': 1, 'b': 2 }]);
-
-      var source1 = { 'a': [[1, 2, 3]] },
-          source2 = { 'a': [[3, 4]] },
-          actual = _.merge({}, source1, source2);
-
-      assert.deepEqual(source1.a, [[1, 2, 3]]);
-      assert.deepEqual(source2.a, [[3, 4]]);
-      assert.deepEqual(actual.a, [[3, 4, 3]]);
-    });
-
-    QUnit.test('should merge plain-objects onto non plain-objects', function(assert) {
-      assert.expect(4);
-
-      function Foo(object) {
-        lodashStable.assign(this, object);
-      }
-
-      var object = { 'a': 1 },
-          actual = _.merge(new Foo, object);
-
-      assert.ok(actual instanceof Foo);
-      assert.deepEqual(actual, new Foo(object));
-
-      actual = _.merge([new Foo], [object]);
-      assert.ok(actual[0] instanceof Foo);
-      assert.deepEqual(actual, [new Foo(object)]);
-    });
-
-    QUnit.test('should not assign `undefined` values', function(assert) {
-      assert.expect(1);
-
-      var actual = _.merge({ 'a': 1 }, { 'a': undefined, 'b': undefined });
-      assert.deepEqual(actual, { 'a': 1 });
-    });
-
-    QUnit.test('should skip `undefined` values in array sources if a destination value exists', function(assert) {
-      assert.expect(2);
-
-      var array = [1];
-      array[2] = 3;
-
-      var actual = _.merge([4, 5, 6], array),
-          expected = [1, 5, 3];
-
-      assert.deepEqual(actual, expected);
-
-      array = [1, , 3];
-      array[1] = undefined;
-
-      actual = _.merge([4, 5, 6], array);
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should skip merging when `object` and `source` are the same value', function(assert) {
-      assert.expect(1);
-
-      if (defineProperty) {
-        var object = {},
-            pass = true;
-
-        defineProperty(object, 'a', {
-          'enumerable': true,
-          'configurable': true,
-          'get': function() { pass = false; },
-          'set': function() { pass = false; }
-        });
-
-        _.merge(object, object);
-        assert.ok(pass);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should convert values to arrays when merging arrays of `source`', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { '1': 'y', 'b': 'z', 'length': 2 } },
-          actual = _.merge(object, { 'a': ['x'] });
-
-      assert.deepEqual(actual, { 'a': ['x', 'y'] });
-
-      actual = _.merge({ 'a': {} }, { 'a': [] });
-      assert.deepEqual(actual, { 'a': [] });
-    });
-
-    QUnit.test('should not convert strings to arrays when merging arrays of `source`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 'abcde' },
-          actual = _.merge(object, { 'a': ['x', 'y', 'z'] });
-
-      assert.deepEqual(actual, { 'a': ['x', 'y', 'z'] });
-    });
-
-    QUnit.test('should not error on DOM elements', function(assert) {
-      assert.expect(1);
-
-      var object1 = { 'el': document && document.createElement('div') },
-          object2 = { 'el': document && document.createElement('div') },
-          pairs = [[{}, object1], [object1, object2]],
-          expected = lodashStable.map(pairs, alwaysTrue);
-
-      var actual = lodashStable.map(pairs, function(pair) {
-        try {
-          return _.merge(pair[0], pair[1]).el === pair[1].el;
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.mergeWith');
-
-  (function() {
-    QUnit.test('should handle merging if `customizer` returns `undefined`', function(assert) {
-      assert.expect(2);
-
-      var actual = _.mergeWith({ 'a': { 'b': [1, 1] } }, { 'a': { 'b': [0] } }, noop);
-      assert.deepEqual(actual, { 'a': { 'b': [0, 1] } });
-
-      actual = _.mergeWith([], [undefined], identity);
-      assert.deepEqual(actual, [undefined]);
-    });
-
-    QUnit.test('should defer to `customizer` when it returns a non `undefined` value', function(assert) {
-      assert.expect(1);
-
-      var actual = _.mergeWith({ 'a': { 'b': [0, 1] } }, { 'a': { 'b': [2] } }, function(a, b) {
-        return lodashStable.isArray(a) ? a.concat(b) : undefined;
-      });
-
-      assert.deepEqual(actual, { 'a': { 'b': [0, 1, 2] } });
-    });
-
-    QUnit.test('should overwrite primitives with source object clones', function(assert) {
-      assert.expect(1);
-
-      var actual = _.mergeWith({ 'a': 0 }, { 'a': { 'b': ['c'] } }, function(a, b) {
-        return lodashStable.isArray(a) ? a.concat(b) : undefined;
-      });
-
-      assert.deepEqual(actual, { 'a': { 'b': ['c'] } });
-    });
-
-    QUnit.test('should clone sources when `customizer` result is `undefined`', function(assert) {
-      assert.expect(1);
-
-      var source1 = { 'a': { 'b': { 'c': 1 } } },
-          source2 = { 'a': { 'b': { 'd': 2 } } };
-
-      _.mergeWith({}, source1, source2, noop);
-      assert.deepEqual(source1.a.b, { 'c': 1 });
-    });
-
-    QUnit.test('should pop the stack of sources for each sibling property', function(assert) {
-      assert.expect(1);
-
-      var array = ['b', 'c'],
-          object = { 'a': ['a'] },
-          source = { 'a': array, 'b': array };
-
-      var actual = _.mergeWith(object, source, function(a, b) {
-        return lodashStable.isArray(a) ? a.concat(b) : undefined;
-      });
-
-      assert.deepEqual(actual, { 'a': ['a', 'b', 'c'], 'b': ['b', 'c'] });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.method');
-
-  (function() {
-    QUnit.test('should create a function that calls a method of a given object', function(assert) {
-      assert.expect(4);
-
-      var object = { 'a': alwaysOne };
-
-      lodashStable.each(['a', ['a']], function(path) {
-        var method = _.method(path);
-        assert.strictEqual(method.length, 1);
-        assert.strictEqual(method(object), 1);
-      });
-    });
-
-    QUnit.test('should work with deep property values', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': alwaysTwo } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        var method = _.method(path);
-        assert.strictEqual(method(object), 2);
-      });
-    });
-
-    QUnit.test('should work with a non-string `path`', function(assert) {
-      assert.expect(2);
-
-      var array = lodashStable.times(3, _.constant);
-
-      lodashStable.each([1, [1]], function(path) {
-        var method = _.method(path);
-        assert.strictEqual(method(array), 1);
-      });
-    });
-
-    QUnit.test('should coerce key to a string', function(assert) {
-      assert.expect(1);
-
-      function fn() {}
-      fn.toString = lodashStable.constant('fn');
-
-      var expected = [1, 1, 2, 2, 3, 3, 4, 4],
-          objects = [{ 'null': alwaysOne }, { 'undefined': alwaysTwo }, { 'fn': alwaysThree }, { '[object Object]': alwaysFour }],
-          values = [null, undefined, fn, {}];
-
-      var actual = lodashStable.transform(objects, function(result, object, index) {
-        var key = values[index];
-        lodashStable.each([key, [key]], function(path) {
-          var method = _.method(key);
-          result.push(method(object));
-        });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with inherited property values', function(assert) {
-      assert.expect(2);
-
-      function Foo() {}
-      Foo.prototype.a = alwaysOne;
-
-      lodashStable.each(['a', ['a']], function(path) {
-        var method = _.method(path);
-        assert.strictEqual(method(new Foo), 1);
-      });
-    });
-
-    QUnit.test('should use a key over a path', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a.b': alwaysOne, 'a': { 'b': alwaysTwo } };
-
-      lodashStable.each(['a.b', ['a.b']], function(path) {
-        var method = _.method(path);
-        assert.strictEqual(method(object), 1);
-      });
-    });
-
-    QUnit.test('should return `undefined` when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, noop);
-
-      lodashStable.each(['constructor', ['constructor']], function(path) {
-        var method = _.method(path);
-
-        var actual = lodashStable.map(values, function(value, index) {
-          return index ? method(value) : method();
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should return `undefined` with deep paths when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, noop);
-
-      lodashStable.each(['constructor.prototype.valueOf', ['constructor', 'prototype', 'valueOf']], function(path) {
-        var method = _.method(path);
-
-        var actual = lodashStable.map(values, function(value, index) {
-          return index ? method(value) : method();
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should return `undefined` if parts of `path` are missing', function(assert) {
-      assert.expect(4);
-
-      var object = {};
-
-      lodashStable.each(['a', 'a[1].b.c', ['a'], ['a', '1', 'b', 'c']], function(path) {
-        var method = _.method(path);
-        assert.strictEqual(method(object), undefined);
-      });
-    });
-
-    QUnit.test('should apply partial arguments to function', function(assert) {
-      assert.expect(2);
-
-      var object = {
-        'fn': function() {
-          return slice.call(arguments);
-        }
-      };
-
-      lodashStable.each(['fn', ['fn']], function(path) {
-        var method = _.method(path, 1, 2, 3);
-        assert.deepEqual(method(object), [1, 2, 3]);
-      });
-    });
-
-    QUnit.test('should invoke deep property methods with the correct `this` binding', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': function() { return this.c; }, 'c': 1 } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        var method = _.method(path);
-        assert.strictEqual(method(object), 1);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.methodOf');
-
-  (function() {
-    QUnit.test('should create a function that calls a method of a given key', function(assert) {
-      assert.expect(4);
-
-      var object = { 'a': alwaysOne };
-
-      lodashStable.each(['a', ['a']], function(path) {
-        var methodOf = _.methodOf(object);
-        assert.strictEqual(methodOf.length, 1);
-        assert.strictEqual(methodOf(path), 1);
-      });
-    });
-
-    QUnit.test('should work with deep property values', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': alwaysTwo } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        var methodOf = _.methodOf(object);
-        assert.strictEqual(methodOf(path), 2);
-      });
-    });
-
-    QUnit.test('should work with a non-string `path`', function(assert) {
-      assert.expect(2);
-
-      var array = lodashStable.times(3, _.constant);
-
-      lodashStable.each([1, [1]], function(path) {
-        var methodOf = _.methodOf(array);
-        assert.strictEqual(methodOf(path), 1);
-      });
-    });
-
-    QUnit.test('should coerce key to a string', function(assert) {
-      assert.expect(1);
-
-      function fn() {}
-      fn.toString = lodashStable.constant('fn');
-
-      var expected = [1, 1, 2, 2, 3, 3, 4, 4],
-          objects = [{ 'null': alwaysOne }, { 'undefined': alwaysTwo }, { 'fn': alwaysThree }, { '[object Object]': alwaysFour }],
-          values = [null, undefined, fn, {}];
-
-      var actual = lodashStable.transform(objects, function(result, object, index) {
-        var key = values[index];
-        lodashStable.each([key, [key]], function(path) {
-          var methodOf = _.methodOf(object);
-          result.push(methodOf(key));
-        });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with inherited property values', function(assert) {
-      assert.expect(2);
-
-      function Foo() {}
-      Foo.prototype.a = alwaysOne;
-
-      lodashStable.each(['a', ['a']], function(path) {
-        var methodOf = _.methodOf(new Foo);
-        assert.strictEqual(methodOf(path), 1);
-      });
-    });
-
-    QUnit.test('should use a key over a path', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a.b': alwaysOne, 'a': { 'b': alwaysTwo } };
-
-      lodashStable.each(['a.b', ['a.b']], function(path) {
-        var methodOf = _.methodOf(object);
-        assert.strictEqual(methodOf(path), 1);
-      });
-    });
-
-    QUnit.test('should return `undefined` when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, noop);
-
-      lodashStable.each(['constructor', ['constructor']], function(path) {
-        var actual = lodashStable.map(values, function(value, index) {
-          var methodOf = index ? _.methodOf() : _.methodOf(value);
-          return methodOf(path);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should return `undefined` with deep paths when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, noop);
-
-      lodashStable.each(['constructor.prototype.valueOf', ['constructor', 'prototype', 'valueOf']], function(path) {
-        var actual = lodashStable.map(values, function(value, index) {
-          var methodOf = index ? _.methodOf() : _.methodOf(value);
-          return methodOf(path);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should return `undefined` if parts of `path` are missing', function(assert) {
-      assert.expect(4);
-
-      var object = {},
-          methodOf = _.methodOf(object);
-
-      lodashStable.each(['a', 'a[1].b.c', ['a'], ['a', '1', 'b', 'c']], function(path) {
-        assert.strictEqual(methodOf(path), undefined);
-      });
-    });
-
-    QUnit.test('should apply partial arguments to function', function(assert) {
-      assert.expect(2);
-
-      var object = {
-        'fn': function() {
-          return slice.call(arguments);
-        }
-      };
-
-      var methodOf = _.methodOf(object, 1, 2, 3);
-
-      lodashStable.each(['fn', ['fn']], function(path) {
-        assert.deepEqual(methodOf(path), [1, 2, 3]);
-      });
-    });
-
-    QUnit.test('should invoke deep property methods with the correct `this` binding', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': function() { return this.c; }, 'c': 1 } },
-          methodOf = _.methodOf(object);
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        assert.strictEqual(methodOf(path), 1);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.min');
-
-  (function() {
-    QUnit.test('should return the smallest value from a collection', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.min([1, 2, 3]), 1);
-    });
-
-    QUnit.test('should return `undefined` for empty collections', function(assert) {
-      assert.expect(1);
-
-      var values = falsey.concat([[]]),
-          expected = lodashStable.map(values, noop);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        try {
-          return index ? _.min(value) : _.min();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with non-numeric collection values', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.min(['a', 'b']), 'a');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('extremum methods');
-
-  lodashStable.each(['max', 'maxBy', 'min', 'minBy'], function(methodName) {
-    var func = _[methodName],
-        isMax = /^max/.test(methodName);
-
-    QUnit.test('`_.' + methodName + '` should work with Date objects', function(assert) {
-      assert.expect(1);
-
-      var curr = new Date,
-          past = new Date(0);
-
-      assert.strictEqual(func([curr, past]), isMax ? curr : past);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with extremely large arrays', function(assert) {
-      assert.expect(1);
-
-      var array = lodashStable.range(0, 5e5);
-      assert.strictEqual(func(array), isMax ? 499999 : 0);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work when chaining on an array with only one value', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var actual = _([40])[methodName]();
-        assert.strictEqual(actual, 40);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  lodashStable.each(['maxBy', 'minBy'], function(methodName) {
-    var array = [1, 2, 3],
-        func = _[methodName],
-        isMax = methodName == 'maxBy';
-
-    QUnit.test('`_.' + methodName + '` should work with an `iteratee` argument', function(assert) {
-      assert.expect(1);
-
-      var actual = func(array, function(n) {
-        return -n;
-      });
-
-      assert.strictEqual(actual, isMax ? 1 : 3);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(2);
-
-      var objects = [{ 'a': 2 }, { 'a': 3 }, { 'a': 1 }],
-          actual = func(objects, 'a');
-
-      assert.deepEqual(actual, objects[isMax ? 1 : 2]);
-
-      var arrays = [[2], [3], [1]];
-      actual = func(arrays, 0);
-
-      assert.deepEqual(actual, arrays[isMax ? 1 : 2]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work when `iteratee` returns +/-Infinity', function(assert) {
-      assert.expect(1);
-
-      var value = isMax ? -Infinity : Infinity,
-          object = { 'a': value };
-
-      var actual = func([object, { 'a': value }], function(object) {
-        return object.a;
-      });
-
-      assert.strictEqual(actual, object);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.mixin');
-
-  (function() {
-    function reset(wrapper) {
-      delete wrapper.a;
-      delete wrapper.prototype.a;
-      delete wrapper.b;
-      delete wrapper.prototype.b;
-    }
-
-    function Wrapper(value) {
-      if (!(this instanceof Wrapper)) {
-        return new Wrapper(value);
-      }
-      if (_.has(value, '__wrapped__')) {
-        var actions = slice.call(value.__actions__),
-            chain = value.__chain__;
-
-        value = value.__wrapped__;
-      }
-      this.__wrapped__ = value;
-      this.__actions__ = actions || [];
-      this.__chain__ = chain || false;
-    }
-
-    Wrapper.prototype.value = function() {
-      return getUnwrappedValue(this);
-    };
-
-    var array = ['a'],
-        source = { 'a': function(array) { return array[0]; }, 'b': 'B' };
-
-    QUnit.test('should mixin `source` methods into lodash', function(assert) {
-      assert.expect(4);
-
-      if (!isNpm) {
-        _.mixin(source);
-
-        assert.strictEqual(_.a(array), 'a');
-        assert.strictEqual(_(array).a().value(), 'a');
-        assert.notOk('b' in _);
-        assert.notOk('b' in _.prototype);
-
-        reset(_);
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should mixin chaining methods by reference', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        _.mixin(source);
-        _.a = alwaysB;
-
-        assert.strictEqual(_.a(array), 'b');
-        assert.strictEqual(_(array).a().value(), 'a');
-
-        reset(_);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should use a default `object` of `this`', function(assert) {
-      assert.expect(3);
-
-      var object = lodashStable.create(_);
-      object.mixin(source);
-
-      assert.strictEqual(object.a(array), 'a');
-      assert.notOk('a' in _);
-      assert.notOk('a' in _.prototype);
-
-      reset(_);
-    });
-
-    QUnit.test('should accept an `object` argument', function(assert) {
-      assert.expect(1);
-
-      var object = {};
-      _.mixin(object, source);
-      assert.strictEqual(object.a(array), 'a');
-    });
-
-    QUnit.test('should accept a function `object`', function(assert) {
-      assert.expect(2);
-
-      _.mixin(Wrapper, source);
-
-      var wrapped = Wrapper(array),
-          actual = wrapped.a();
-
-      assert.strictEqual(actual.value(), 'a');
-      assert.ok(actual instanceof Wrapper);
-
-      reset(Wrapper);
-    });
-
-    QUnit.test('should return `object`', function(assert) {
-      assert.expect(3);
-
-      var object = {};
-      assert.strictEqual(_.mixin(object, source), object);
-      assert.strictEqual(_.mixin(Wrapper, source), Wrapper);
-      assert.strictEqual(_.mixin(), _);
-
-      reset(Wrapper);
-    });
-
-    QUnit.test('should not assign inherited `source` methods', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.prototype.a = noop;
-
-      var object = {};
-      assert.strictEqual(_.mixin(object, new Foo), object);
-    });
-
-    QUnit.test('should accept an `options` argument', function(assert) {
-      assert.expect(8);
-
-      function message(func, chain) {
-        return (func === _ ? 'lodash' : 'given') + ' function should ' + (chain ? '' : 'not ') + 'chain';
-      }
-
-      lodashStable.each([_, Wrapper], function(func) {
-        lodashStable.each([{ 'chain': false }, { 'chain': true }], function(options) {
-          if (!isNpm) {
-            if (func === _) {
-              _.mixin(source, options);
-            } else {
-              _.mixin(func, source, options);
-            }
-            var wrapped = func(array),
-                actual = wrapped.a();
-
-            if (options.chain) {
-              assert.strictEqual(actual.value(), 'a', message(func, true));
-              assert.ok(actual instanceof func, message(func, true));
-            } else {
-              assert.strictEqual(actual, 'a', message(func, false));
-              assert.notOk(actual instanceof func, message(func, false));
-            }
-            reset(func);
-          }
-          else {
-            skipAssert(assert, 2);
-          }
-        });
-      });
-    });
-
-    QUnit.test('should not extend lodash when an `object` is given with an empty `options` object', function(assert) {
-      assert.expect(1);
-
-      _.mixin({ 'a': noop }, {});
-      assert.notOk('a' in _);
-      reset(_);
-    });
-
-    QUnit.test('should not error for non-object `options` values', function(assert) {
-      assert.expect(2);
-
-      var pass = true;
-
-      try {
-        _.mixin({}, source, 1);
-      } catch (e) {
-        pass = false;
-      }
-      assert.ok(pass);
-
-      pass = true;
-
-      try {
-        _.mixin(source, 1);
-      } catch (e) {
-        pass = false;
-      }
-      assert.ok(pass);
-
-      reset(_);
-    });
-
-    QUnit.test('should not return the existing wrapped value when chaining', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each([_, Wrapper], function(func) {
-        if (!isNpm) {
-          if (func === _) {
-            var wrapped = _(source),
-                actual = wrapped.mixin();
-
-            assert.strictEqual(actual.value(), _);
-          }
-          else {
-            wrapped = _(func);
-            actual = wrapped.mixin(source);
-            assert.notStrictEqual(actual, wrapped);
-          }
-          reset(func);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    QUnit.test('should produce methods that work in a lazy sequence', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        _.mixin({ 'a': _.countBy, 'b': _.filter });
-
-        var array = lodashStable.range(LARGE_ARRAY_SIZE),
-            actual = _(array).a().map(square).b(isEven).take().value();
-
-        assert.deepEqual(actual, _.take(_.b(_.map(_.a(array), square), isEven)));
-
-        reset(_);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.multiply');
-
-  (function() {
-    QUnit.test('should multiply two numbers', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.multiply(6, 4), 24);
-      assert.strictEqual(_.multiply(-6, 4), -24);
-      assert.strictEqual(_.multiply(-6, -4), 24);
-    });
-
-    QUnit.test('should coerce arguments to numbers', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.multiply('6', '4'), 24);
-      assert.deepEqual(_.multiply('x', 'y'), NaN);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.orderBy');
-
-  (function() {
-    var objects = [
-      { 'a': 'x', 'b': 3 },
-      { 'a': 'y', 'b': 4 },
-      { 'a': 'x', 'b': 1 },
-      { 'a': 'y', 'b': 2 }
-    ];
-
-    QUnit.test('should sort by a single property by a specified order', function(assert) {
-      assert.expect(1);
-
-      var actual = _.orderBy(objects, 'a', 'desc');
-      assert.deepEqual(actual, [objects[1], objects[3], objects[0], objects[2]]);
-    });
-
-    QUnit.test('should sort by multiple properties by specified orders', function(assert) {
-      assert.expect(1);
-
-      var actual = _.orderBy(objects, ['a', 'b'], ['desc', 'asc']);
-      assert.deepEqual(actual, [objects[3], objects[1], objects[2], objects[0]]);
-    });
-
-    QUnit.test('should sort by a property in ascending order when its order is not specified', function(assert) {
-      assert.expect(2);
-
-      var expected = [objects[2], objects[0], objects[3], objects[1]],
-          actual = _.orderBy(objects, ['a', 'b']);
-
-      assert.deepEqual(actual, expected);
-
-      expected = lodashStable.map(falsey, lodashStable.constant([objects[3], objects[1], objects[2], objects[0]]));
-
-      actual = lodashStable.map(falsey, function(order, index) {
-        return _.orderBy(objects, ['a', 'b'], index ? ['desc', order] : ['desc']);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with `orders` specified as string objects', function(assert) {
-      assert.expect(1);
-
-      var actual = _.orderBy(objects, ['a'], [Object('desc')]);
-      assert.deepEqual(actual, [objects[1], objects[3], objects[0], objects[2]]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.overArgs');
-
-  (function() {
-    function fn() {
-      return slice.call(arguments);
-    }
-
-    QUnit.test('should transform each argument', function(assert) {
-      assert.expect(1);
-
-      var over = _.overArgs(fn, doubled, square);
-      assert.deepEqual(over(5, 10), [10, 100]);
-    });
-
-    QUnit.test('should use `_.identity` when a predicate is nullish', function(assert) {
-      assert.expect(1);
-
-      var over = _.overArgs(fn, undefined, null);
-      assert.deepEqual(over('a', 'b'), ['a', 'b']);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var over = _.overArgs(fn, 'b', 'a');
-      assert.deepEqual(over({ 'b': 2 }, { 'a': 1 }), [2, 1]);
-    });
-
-    QUnit.test('should work with `_.matches` shorthands', function(assert) {
-      assert.expect(1);
-
-      var over = _.overArgs(fn, { 'b': 1 }, { 'a': 1 });
-      assert.deepEqual(over({ 'b': 2 }, { 'a': 1 }), [false, true]);
-    });
-
-    QUnit.test('should work with `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(1);
-
-      var over = _.overArgs(fn, ['b', 1], [['a', 1]]);
-      assert.deepEqual(over({ 'b': 2 }, { 'a': 1 }), [false, true]);
-    });
-
-    QUnit.test('should differentiate between `_.property` and `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(2);
-
-      var over = _.overArgs(fn, ['a', 1]);
-      assert.deepEqual(over({ 'a': 1 }, { '1': 2 }), [1, 2]);
-
-      over = _.overArgs(fn, [['a', 1]]);
-      assert.deepEqual(over({ 'a': 1 }), [true]);
-    });
-
-    QUnit.test('should flatten `transforms`', function(assert) {
-      assert.expect(1);
-
-      var over = _.overArgs(fn, [doubled, square], String);
-      assert.deepEqual(over(5, 10, 15), [10, 100, '15']);
-    });
-
-    QUnit.test('should not transform any argument greater than the number of transforms', function(assert) {
-      assert.expect(1);
-
-      var over = _.overArgs(fn, doubled, square);
-      assert.deepEqual(over(5, 10, 18), [10, 100, 18]);
-    });
-
-    QUnit.test('should not transform any arguments if no transforms are given', function(assert) {
-      assert.expect(1);
-
-      var over = _.overArgs(fn);
-      assert.deepEqual(over(5, 10, 18), [5, 10, 18]);
-    });
-
-    QUnit.test('should not pass `undefined` if there are more transforms than arguments', function(assert) {
-      assert.expect(1);
-
-      var over = _.overArgs(fn, doubled, identity);
-      assert.deepEqual(over(5), [10]);
-    });
-
-    QUnit.test('should provide the correct argument to each transform', function(assert) {
-      assert.expect(1);
-
-      var argsList = [],
-          transform = function() { argsList.push(slice.call(arguments)); },
-          over = _.overArgs(noop, transform, transform, transform);
-
-      over('a', 'b');
-      assert.deepEqual(argsList, [['a'], ['b']]);
-    });
-
-    QUnit.test('should use `this` binding of function for `transforms`', function(assert) {
-      assert.expect(1);
-
-      var over = _.overArgs(function(x) {
-        return this[x];
-      }, function(x) {
-        return this === x;
-      });
-
-      var object = { 'over': over, 'true': 1 };
-      assert.strictEqual(object.over(object), 1);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.negate');
-
-  (function() {
-    QUnit.test('should create a function that negates the result of `func`', function(assert) {
-      assert.expect(2);
-
-      var negate = _.negate(isEven);
-
-      assert.strictEqual(negate(1), true);
-      assert.strictEqual(negate(2), false);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.noop');
-
-  (function() {
-    QUnit.test('should return `undefined`', function(assert) {
-      assert.expect(1);
-
-      var values = empties.concat(true, new Date, _, 1, /x/, 'a'),
-          expected = lodashStable.map(values, noop);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.noop(value) : _.noop();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.noConflict');
-
-  (function() {
-    QUnit.test('should return the `lodash` function', function(assert) {
-      assert.expect(2);
-
-      if (!isModularize) {
-        assert.strictEqual(_.noConflict(), oldDash);
-        assert.notStrictEqual(root._, oldDash);
-        root._ = oldDash;
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should restore `_` only if `lodash` is the current `_` value', function(assert) {
-      assert.expect(2);
-
-      if (!isModularize) {
-        var object = root._ = {};
-        assert.strictEqual(_.noConflict(), oldDash);
-        assert.strictEqual(root._, object);
-        root._ = oldDash;
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should work with a `root` of `this`', function(assert) {
-      assert.expect(2);
-
-      if (!isModularize && !coverage && (!document && realm.object)) {
-        var fs = require('fs'),
-            vm = require('vm'),
-            expected = {},
-            context = vm.createContext({ '_': expected, 'console': console }),
-            source = fs.readFileSync(filePath, 'utf8');
-
-        vm.runInContext(source + '\nthis.lodash = this._.noConflict()', context);
-
-        assert.strictEqual(context._, expected);
-        assert.ok(context.lodash);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.now');
-
-  (function() {
-    QUnit.test('should return the number of milliseconds that have elapsed since the Unix epoch', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var stamp = +new Date,
-          actual = _.now();
-
-      assert.ok(actual >= stamp);
-
-      setTimeout(function() {
-        assert.ok(_.now() > actual);
-        done();
-      }, 32);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.nth');
-
-  (function() {
-    var array = ['a', 'b', 'c', 'd'];
-
-    QUnit.test('should get the nth element of `array`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(array, function(value, index) {
-        return _.nth(array, index);
-      });
-
-      assert.deepEqual(actual, array);
-    });
-
-    QUnit.test('should work with a negative `n`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(lodashStable.range(1, array.length + 1), function(n) {
-        return _.nth(array, -n);
-      });
-
-      assert.deepEqual(actual, ['d', 'c', 'b', 'a']);
-    });
-
-    QUnit.test('should coerce `n` to an integer', function(assert) {
-      assert.expect(2);
-
-      var values = falsey,
-          expected = lodashStable.map(values, alwaysA);
-
-      var actual = lodashStable.map(values, function(n) {
-        return n ? _.nth(array, n) : _.nth(array);
-      });
-
-      assert.deepEqual(actual, expected);
-
-      values = ['1', 1.6];
-      expected = lodashStable.map(values, alwaysB);
-
-      actual = lodashStable.map(values, function(n) {
-        return _.nth(array, n);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `undefined` for empty arrays', function(assert) {
-      assert.expect(1);
-
-      var values = [null, undefined, []],
-          expected = lodashStable.map(values, noop);
-
-      var actual = lodashStable.map(values, function(array) {
-        return _.nth(array, 1);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `undefined` for non-indexes', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2],
-          values = [Infinity, array.length],
-          expected = lodashStable.map(values, noop);
-
-      array[-1] = 3;
-
-      var actual = lodashStable.map(values, function(n) {
-        return _.nth(array, n);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.nthArg');
-
-  (function() {
-    var args = ['a', 'b', 'c', 'd'];
-
-    QUnit.test('should create a function that returns its nth argument', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(args, function(value, index) {
-        var func = _.nthArg(index);
-        return func.apply(undefined, args);
-      });
-
-      assert.deepEqual(actual, args);
-    });
-
-    QUnit.test('should work with a negative `n`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(lodashStable.range(1, args.length + 1), function(n) {
-        var func = _.nthArg(-n);
-        return func.apply(undefined, args);
-      });
-
-      assert.deepEqual(actual, ['d', 'c', 'b', 'a']);
-    });
-
-    QUnit.test('should coerce `n` to an integer', function(assert) {
-      assert.expect(2);
-
-      var values = falsey,
-          expected = lodashStable.map(values, alwaysA);
-
-      var actual = lodashStable.map(values, function(n) {
-        var func = n ? _.nthArg(n) : _.nthArg();
-        return func.apply(undefined, args);
-      });
-
-      assert.deepEqual(actual, expected);
-
-      values = ['1', 1.6];
-      expected = lodashStable.map(values, alwaysB);
-
-      actual = lodashStable.map(values, function(n) {
-        var func = _.nthArg(n);
-        return func.apply(undefined, args);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `undefined` for empty arrays', function(assert) {
-      assert.expect(1);
-
-      var func = _.nthArg(1);
-      assert.strictEqual(func(), undefined);
-    });
-
-    QUnit.test('should return `undefined` for non-indexes', function(assert) {
-      assert.expect(1);
-
-      var values = [Infinity, args.length],
-          expected = lodashStable.map(values, noop);
-
-      var actual = lodashStable.map(values, function(n) {
-        var func = _.nthArg(n);
-        return func.apply(undefined, args);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.omit');
-
-  (function() {
-    var args = arguments,
-        object = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 };
-
-    QUnit.test('should flatten `props`', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(_.omit(object, 'a', 'c'), { 'b': 2, 'd': 4 });
-      assert.deepEqual(_.omit(object, ['a', 'd'], 'c'), { 'b': 2 });
-    });
-
-    QUnit.test('should work with a primitive `object` argument', function(assert) {
-      assert.expect(1);
-
-      stringProto.a = 1;
-      stringProto.b = 2;
-
-      assert.deepEqual(_.omit('', 'b'), { 'a': 1 });
-
-      delete stringProto.a;
-      delete stringProto.b;
-    });
-
-    QUnit.test('should return an empty object when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      objectProto.a = 1;
-      lodashStable.each([null, undefined], function(value) {
-        assert.deepEqual(_.omit(value, 'valueOf'), {});
-      });
-      delete objectProto.a;
-    });
-
-    QUnit.test('should work with `arguments` objects as secondary arguments', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.omit(object, args), { 'b': 2, 'd': 4 });
-    });
-
-    QUnit.test('should coerce property names to strings', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.omit({ '0': 'a' }, 0), {});
-    });
-  }('a', 'c'));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.omitBy');
-
-  (function() {
-    QUnit.test('should work with a predicate argument', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 };
-
-      var actual = _.omitBy(object, function(n) {
-        return n != 2 && n != 4;
-      });
-
-      assert.deepEqual(actual, { 'b': 2, 'd': 4 });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('omit methods');
-
-  lodashStable.each(['omit', 'omitBy'], function(methodName) {
-    var expected = { 'b': 2, 'd': 4 },
-        func = _[methodName],
-        object = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 },
-        prop = lodashStable.nthArg(1);
-
-    if (methodName == 'omitBy') {
-      prop = function(object, props) {
-        props = lodashStable.castArray(props);
-        return function(value) {
-          return lodashStable.some(props, function(key) {
-            key = lodashStable.isSymbol(key) ? key : lodashStable.toString(key);
-            return object[key] === value;
-          });
-        };
-      };
-    }
-    QUnit.test('`_.' + methodName + '` should create an object with omitted string keyed properties', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(func(object, prop(object, 'a')), { 'b': 2, 'c': 3, 'd': 4 });
-      assert.deepEqual(func(object, prop(object, ['a', 'c'])), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should include inherited string keyed properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.prototype = object;
-
-      assert.deepEqual(func(new Foo, prop(object, ['a', 'c'])), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var object = { '-0': 'a', '0': 'b' },
-          props = [-0, Object(-0), 0, Object(0)],
-          expected = [{ '0': 'b' }, { '0': 'b' }, { '-0': 'a' }, { '-0': 'a' }];
-
-      var actual = lodashStable.map(props, function(key) {
-        return func(object, prop(object, key));
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should include symbol properties', function(assert) {
-      assert.expect(2);
-
-      function Foo() {
-        this.a = 0;
-        this[symbol] = 1;
-      }
-
-      if (Symbol) {
-        var symbol2 = Symbol('b');
-        Foo.prototype[symbol2] = 2;
-
-        var foo = new Foo,
-            actual = func(foo, prop(foo, 'a'));
-
-        assert.strictEqual(actual[symbol], 1);
-        assert.strictEqual(actual[symbol2], 2);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should create an object with omitted symbol properties', function(assert) {
-      assert.expect(6);
-
-      function Foo() {
-        this.a = 0;
-        this[symbol] = 1;
-      }
-
-      if (Symbol) {
-        var symbol2 = Symbol('b');
-        Foo.prototype[symbol2] = 2;
-
-        var foo = new Foo,
-            actual = func(foo, prop(foo, symbol));
-
-        assert.strictEqual(actual.a, 0);
-        assert.strictEqual(actual[symbol], undefined);
-        assert.strictEqual(actual[symbol2], 2);
-
-        actual = func(foo, prop(foo, symbol2));
-
-        assert.strictEqual(actual.a, 0);
-        assert.strictEqual(actual[symbol], 1);
-        assert.strictEqual(actual[symbol2], undefined);
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with an array `object` argument', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3];
-      assert.deepEqual(func(array, prop(array, ['0', '2'])), { '1': 2 });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.once');
-
-  (function() {
-    QUnit.test('should invoke `func` once', function(assert) {
-      assert.expect(2);
-
-      var count = 0,
-          once = _.once(function() { return ++count; });
-
-      once();
-      assert.strictEqual(once(), 1);
-      assert.strictEqual(count, 1);
-    });
-
-    QUnit.test('should ignore recursive calls', function(assert) {
-      assert.expect(2);
-
-      var count = 0;
-
-      var once = _.once(function() {
-        once();
-        return ++count;
-      });
-
-      assert.strictEqual(once(), 1);
-      assert.strictEqual(count, 1);
-    });
-
-    QUnit.test('should not throw more than once', function(assert) {
-      assert.expect(2);
-
-      var pass = true;
-
-      var once = _.once(function() {
-        throw new Error;
-      });
-
-      assert.raises(once);
-
-      try {
-        once();
-      } catch (e) {
-        pass = false;
-      }
-      assert.ok(pass);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.over');
-
-  (function() {
-    QUnit.test('should create a function that invokes `iteratees`', function(assert) {
-      assert.expect(1);
-
-      var over = _.over(Math.max, Math.min);
-      assert.deepEqual(over(1, 2, 3, 4), [4, 1]);
-    });
-
-    QUnit.test('should use `_.identity` when a predicate is nullish', function(assert) {
-      assert.expect(1);
-
-      var over = _.over(undefined, null);
-      assert.deepEqual(over('a', 'b', 'c'), ['a', 'a']);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var over = _.over('b', 'a');
-      assert.deepEqual(over({ 'a': 1, 'b': 2 }), [2, 1]);
-    });
-
-    QUnit.test('should work with `_.matches` shorthands', function(assert) {
-      assert.expect(1);
-
-      var over = _.over({ 'b': 1 }, { 'a': 1 });
-      assert.deepEqual(over({ 'a': 1, 'b': 2 }), [false, true]);
-    });
-
-    QUnit.test('should work with `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(2);
-
-      var over = _.over(['b', 2], [['a', 2]]);
-
-      assert.deepEqual(over({ 'a': 1, 'b': 2 }), [true, false]);
-      assert.deepEqual(over({ 'a': 2, 'b': 1 }), [false, true]);
-    });
-
-    QUnit.test('should differentiate between `_.property` and `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(4);
-
-      var over = _.over(['a', 1]);
-
-      assert.deepEqual(over({ 'a': 1, '1': 2 }), [1, 2]);
-      assert.deepEqual(over({ 'a': 2, '1': 1 }), [2, 1]);
-
-      over = _.over([['a', 1]]);
-
-      assert.deepEqual(over({ 'a': 1 }), [true]);
-      assert.deepEqual(over({ 'a': 2 }), [false]);
-    });
-
-    QUnit.test('should provide arguments to predicates', function(assert) {
-      assert.expect(1);
-
-      var over = _.over(function() {
-        return slice.call(arguments);
-      });
-
-      assert.deepEqual(over('a', 'b', 'c'), [['a', 'b', 'c']]);
-    });
-
-    QUnit.test('should use `this` binding of function for `iteratees`', function(assert) {
-      assert.expect(1);
-
-      var over = _.over(function() { return this.b; }, function() { return this.a; }),
-          object = { 'over': over, 'a': 1, 'b': 2 };
-
-      assert.deepEqual(object.over(), [2, 1]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.overEvery');
-
-  (function() {
-    QUnit.test('should create a function that returns `true` if all predicates return truthy', function(assert) {
-      assert.expect(1);
-
-      var over = _.overEvery(alwaysTrue, alwaysOne, alwaysA);
-      assert.strictEqual(over(), true);
-    });
-
-    QUnit.test('should return `false` as soon as a predicate returns falsey', function(assert) {
-      assert.expect(2);
-
-      var count = 0,
-          countFalse = function() { count++; return false; },
-          countTrue = function() { count++; return true; },
-          over = _.overEvery(countTrue, countFalse, countTrue);
-
-      assert.strictEqual(over(), false);
-      assert.strictEqual(count, 2);
-    });
-
-    QUnit.test('should use `_.identity` when a predicate is nullish', function(assert) {
-      assert.expect(2);
-
-      var over = _.overEvery(undefined, null);
-
-      assert.strictEqual(over(true), true);
-      assert.strictEqual(over(false), false);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(2);
-
-      var over = _.overEvery('b', 'a');
-
-      assert.strictEqual(over({ 'a': 1, 'b': 1 }), true);
-      assert.strictEqual(over({ 'a': 0, 'b': 1 }), false);
-    });
-
-    QUnit.test('should work with `_.matches` shorthands', function(assert) {
-      assert.expect(2);
-
-      var over = _.overEvery({ 'b': 2 }, { 'a': 1 });
-
-      assert.strictEqual(over({ 'a': 1, 'b': 2 }), true);
-      assert.strictEqual(over({ 'a': 0, 'b': 2 }), false);
-    });
-
-    QUnit.test('should work with `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(2);
-
-      var over = _.overEvery(['b', 2], [['a', 1]]);
-
-      assert.strictEqual(over({ 'a': 1, 'b': 2 }), true);
-      assert.strictEqual(over({ 'a': 0, 'b': 2 }), false);
-    });
-
-    QUnit.test('should differentiate between `_.property` and `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(5);
-
-      var over = _.overEvery(['a', 1]);
-
-      assert.strictEqual(over({ 'a': 1, '1': 1 }), true);
-      assert.strictEqual(over({ 'a': 1, '1': 0 }), false);
-      assert.strictEqual(over({ 'a': 0, '1': 1 }), false);
-
-      over = _.overEvery([['a', 1]]);
-
-      assert.strictEqual(over({ 'a': 1 }), true);
-      assert.strictEqual(over({ 'a': 2 }), false);
-    });
-
-    QUnit.test('should flatten `predicates`', function(assert) {
-      assert.expect(1);
-
-      var over = _.overEvery(alwaysTrue, [alwaysFalse]);
-      assert.strictEqual(over(), false);
-    });
-
-    QUnit.test('should provide arguments to predicates', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      var over = _.overEvery(function() {
-        args = slice.call(arguments);
-      });
-
-      over('a', 'b', 'c');
-      assert.deepEqual(args, ['a', 'b', 'c']);
-    });
-
-    QUnit.test('should use `this` binding of function for `predicates`', function(assert) {
-      assert.expect(2);
-
-      var over = _.overEvery(function() { return this.b; }, function() { return this.a; }),
-          object = { 'over': over, 'a': 1, 'b': 2 };
-
-      assert.strictEqual(object.over(), true);
-
-      object.a = 0;
-      assert.strictEqual(object.over(), false);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.overSome');
-
-  (function() {
-    QUnit.test('should create a function that returns `true` if any predicates return truthy', function(assert) {
-      assert.expect(2);
-
-      var over = _.overSome(alwaysFalse, alwaysOne, alwaysEmptyString);
-      assert.strictEqual(over(), true);
-
-      over = _.overSome(alwaysNull, alwaysA, alwaysZero);
-      assert.strictEqual(over(), true);
-    });
-
-    QUnit.test('should return `true` as soon as `predicate` returns truthy', function(assert) {
-      assert.expect(2);
-
-      var count = 0,
-          countFalse = function() { count++; return false; },
-          countTrue = function() { count++; return true; },
-          over = _.overSome(countFalse, countTrue, countFalse);
-
-      assert.strictEqual(over(), true);
-      assert.strictEqual(count, 2);
-    });
-
-    QUnit.test('should return `false` if all predicates return falsey', function(assert) {
-      assert.expect(2);
-
-      var over = _.overSome(alwaysFalse, alwaysFalse, alwaysFalse);
-      assert.strictEqual(over(), false);
-
-      over = _.overSome(alwaysNull, alwaysZero, alwaysEmptyString);
-      assert.strictEqual(over(), false);
-    });
-
-    QUnit.test('should use `_.identity` when a predicate is nullish', function(assert) {
-      assert.expect(2);
-
-      var over = _.overSome(undefined, null);
-
-      assert.strictEqual(over(true), true);
-      assert.strictEqual(over(false), false);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(2);
-
-      var over = _.overSome('b', 'a');
-
-      assert.strictEqual(over({ 'a': 1, 'b': 0 }), true);
-      assert.strictEqual(over({ 'a': 0, 'b': 0 }), false);
-    });
-
-    QUnit.test('should work with `_.matches` shorthands', function(assert) {
-      assert.expect(2);
-
-      var over = _.overSome({ 'b': 2 }, { 'a': 1 });
-
-      assert.strictEqual(over({ 'a': 0, 'b': 2 }), true);
-      assert.strictEqual(over({ 'a': 0, 'b': 0 }), false);
-    });
-
-    QUnit.test('should work with `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(2);
-
-      var over = _.overSome(['a', 1], [['b', 2]]);
-
-      assert.strictEqual(over({ 'a': 0, 'b': 2 }), true);
-      assert.strictEqual(over({ 'a': 0, 'b': 0 }), false);
-    });
-
-    QUnit.test('should differentiate between `_.property` and `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(5);
-
-      var over = _.overSome(['a', 1]);
-
-      assert.strictEqual(over({ 'a': 0, '1': 0 }), false);
-      assert.strictEqual(over({ 'a': 1, '1': 0 }), true);
-      assert.strictEqual(over({ 'a': 0, '1': 1 }), true);
-
-      over = _.overSome([['a', 1]]);
-
-      assert.strictEqual(over({ 'a': 1 }), true);
-      assert.strictEqual(over({ 'a': 2 }), false);
-    });
-
-    QUnit.test('should flatten `predicates`', function(assert) {
-      assert.expect(1);
-
-      var over = _.overSome(alwaysFalse, [alwaysTrue]);
-      assert.strictEqual(over(), true);
-    });
-
-    QUnit.test('should provide arguments to predicates', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      var over = _.overSome(function() {
-        args = slice.call(arguments);
-      });
-
-      over('a', 'b', 'c');
-      assert.deepEqual(args, ['a', 'b', 'c']);
-    });
-
-    QUnit.test('should use `this` binding of function for `predicates`', function(assert) {
-      assert.expect(2);
-
-      var over = _.overSome(function() { return this.b; }, function() { return this.a; }),
-          object = { 'over': over, 'a': 1, 'b': 2 };
-
-      assert.strictEqual(object.over(), true);
-
-      object.a = object.b = 0;
-      assert.strictEqual(object.over(), false);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.pad');
-
-  (function() {
-    var string = 'abc';
-
-    QUnit.test('should pad a string to a given length', function(assert) {
-      assert.expect(1);
-
-      var values = [, undefined],
-          expected = lodashStable.map(values, lodashStable.constant(' abc  '));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.pad(string, 6, value) : _.pad(string, 6);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should truncate pad characters to fit the pad length', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.pad(string, 8), '  abc   ');
-      assert.strictEqual(_.pad(string, 8, '_-'), '_-abc_-_');
-    });
-
-    QUnit.test('should coerce `string` to a string', function(assert) {
-      assert.expect(1);
-
-      var values = [Object(string), { 'toString': lodashStable.constant(string) }],
-          expected = lodashStable.map(values, alwaysTrue);
-
-      var actual = lodashStable.map(values, function(value) {
-        return _.pad(value, 6) === ' abc  ';
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.padEnd');
-
-  (function() {
-    var string = 'abc';
-
-    QUnit.test('should pad a string to a given length', function(assert) {
-      assert.expect(1);
-
-      var values = [, undefined],
-          expected = lodashStable.map(values, lodashStable.constant('abc   '));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.padEnd(string, 6, value) : _.padEnd(string, 6);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should truncate pad characters to fit the pad length', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.padEnd(string, 6, '_-'), 'abc_-_');
-    });
-
-    QUnit.test('should coerce `string` to a string', function(assert) {
-      assert.expect(1);
-
-      var values = [Object(string), { 'toString': lodashStable.constant(string) }],
-          expected = lodashStable.map(values, alwaysTrue);
-
-      var actual = lodashStable.map(values, function(value) {
-        return _.padEnd(value, 6) === 'abc   ';
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.padStart');
-
-  (function() {
-    var string = 'abc';
-
-    QUnit.test('should pad a string to a given length', function(assert) {
-      assert.expect(1);
-
-      var values = [, undefined],
-          expected = lodashStable.map(values, lodashStable.constant('   abc'));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.padStart(string, 6, value) : _.padStart(string, 6);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should truncate pad characters to fit the pad length', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.padStart(string, 6, '_-'), '_-_abc');
-    });
-
-    QUnit.test('should coerce `string` to a string', function(assert) {
-      assert.expect(1);
-
-      var values = [Object(string), { 'toString': lodashStable.constant(string) }],
-          expected = lodashStable.map(values, alwaysTrue);
-
-      var actual = lodashStable.map(values, function(value) {
-        return _.padStart(value, 6) === '   abc';
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('pad methods');
-
-  lodashStable.each(['pad', 'padStart', 'padEnd'], function(methodName) {
-    var func = _[methodName],
-        isPad = methodName == 'pad',
-        isStart = methodName == 'padStart',
-        string = 'abc';
-
-    QUnit.test('`_.' + methodName + '` should not pad if string is >= `length`', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(func(string, 2), string);
-      assert.strictEqual(func(string, 3), string);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat negative `length` as `0`', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each([0, -2], function(length) {
-        assert.strictEqual(func(string, length), string);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce `length` to a number', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each(['', '4'], function(length) {
-        var actual = length ? (isStart ? ' abc' : 'abc ') : string;
-        assert.strictEqual(func(string, length), actual);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat nullish values as empty strings', function(assert) {
-      assert.expect(6);
-
-      lodashStable.each([undefined, '_-'], function(chars) {
-        var expected = chars ? (isPad ? '__' : chars) : '  ';
-        assert.strictEqual(func(null, 2, chars), expected);
-        assert.strictEqual(func(undefined, 2, chars), expected);
-        assert.strictEqual(func('', 2, chars), expected);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `string` when `chars` coerces to an empty string', function(assert) {
-      assert.expect(1);
-
-      var values = ['', Object('')],
-          expected = lodashStable.map(values, lodashStable.constant(string));
-
-      var actual = lodashStable.map(values, function(value) {
-        return _.pad(string, 6, value);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.parseInt');
-
-  (function() {
-    QUnit.test('should accept a `radix` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.range(2, 37);
-
-      var actual = lodashStable.map(expected, function(radix) {
-        return _.parseInt('10', radix);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should use a radix of `10`, for non-hexadecimals, if `radix` is `undefined` or `0`', function(assert) {
-      assert.expect(4);
-
-      assert.strictEqual(_.parseInt('10'), 10);
-      assert.strictEqual(_.parseInt('10', 0), 10);
-      assert.strictEqual(_.parseInt('10', 10), 10);
-      assert.strictEqual(_.parseInt('10', undefined), 10);
-    });
-
-    QUnit.test('should use a radix of `16`, for hexadecimals, if `radix` is `undefined` or `0`', function(assert) {
-      assert.expect(8);
-
-      lodashStable.each(['0x20', '0X20'], function(string) {
-        assert.strictEqual(_.parseInt(string), 32);
-        assert.strictEqual(_.parseInt(string, 0), 32);
-        assert.strictEqual(_.parseInt(string, 16), 32);
-        assert.strictEqual(_.parseInt(string, undefined), 32);
-      });
-    });
-
-    QUnit.test('should use a radix of `10` for string with leading zeros', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.parseInt('08'), 8);
-      assert.strictEqual(_.parseInt('08', 10), 8);
-    });
-
-    QUnit.test('should parse strings with leading whitespace (test in Chrome and Firefox)', function(assert) {
-      assert.expect(2);
-
-      var expected = [8, 8, 10, 10, 32, 32, 32, 32];
-
-      lodashStable.times(2, function(index) {
-        var actual = [],
-            func = (index ? (lodashBizarro || {}) : _).parseInt;
-
-        if (func) {
-          lodashStable.times(2, function(otherIndex) {
-            var string = otherIndex ? '10' : '08';
-            actual.push(
-              func(whitespace + string, 10),
-              func(whitespace + string)
-            );
-          });
-
-          lodashStable.each(['0x20', '0X20'], function(string) {
-            actual.push(
-              func(whitespace + string),
-              func(whitespace + string, 16)
-            );
-          });
-
-          assert.deepEqual(actual, expected);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    QUnit.test('should coerce `radix` to a number', function(assert) {
-      assert.expect(2);
-
-      var object = { 'valueOf': alwaysZero };
-      assert.strictEqual(_.parseInt('08', object), 8);
-      assert.strictEqual(_.parseInt('0x20', object), 32);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(2);
-
-      var strings = lodashStable.map(['6', '08', '10'], Object),
-          actual = lodashStable.map(strings, _.parseInt);
-
-      assert.deepEqual(actual, [6, 8, 10]);
-
-      actual = lodashStable.map('123', _.parseInt);
-      assert.deepEqual(actual, [1, 2, 3]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('partial methods');
-
-  lodashStable.each(['partial', 'partialRight'], function(methodName) {
-    var func = _[methodName],
-        isPartial = methodName == 'partial',
-        ph = func.placeholder;
-
-    QUnit.test('`_.' + methodName + '` partially applies arguments', function(assert) {
-      assert.expect(1);
-
-      var par = func(identity, 'a');
-      assert.strictEqual(par(), 'a');
-    });
-
-    QUnit.test('`_.' + methodName + '` creates a function that can be invoked with additional arguments', function(assert) {
-      assert.expect(1);
-
-      var fn = function(a, b) { return [a, b]; },
-          par = func(fn, 'a'),
-          expected = isPartial ? ['a', 'b'] : ['b', 'a'];
-
-      assert.deepEqual(par('b'), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` works when there are no partially applied arguments and the created function is invoked without additional arguments', function(assert) {
-      assert.expect(1);
-
-      var fn = function() { return arguments.length; },
-          par = func(fn);
-
-      assert.strictEqual(par(), 0);
-    });
-
-    QUnit.test('`_.' + methodName + '` works when there are no partially applied arguments and the created function is invoked with additional arguments', function(assert) {
-      assert.expect(1);
-
-      var par = func(identity);
-      assert.strictEqual(par('a'), 'a');
-    });
-
-    QUnit.test('`_.' + methodName + '` should support placeholders', function(assert) {
-      assert.expect(4);
-
-      var fn = function() { return slice.call(arguments); },
-          par = func(fn, ph, 'b', ph);
-
-      assert.deepEqual(par('a', 'c'), ['a', 'b', 'c']);
-      assert.deepEqual(par('a'), ['a', 'b', undefined]);
-      assert.deepEqual(par(), [undefined, 'b', undefined]);
-
-      if (isPartial) {
-        assert.deepEqual(par('a', 'c', 'd'), ['a', 'b', 'c', 'd']);
-      } else {
-        par = func(fn, ph, 'c', ph);
-        assert.deepEqual(par('a', 'b', 'd'), ['a', 'b', 'c', 'd']);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should use `_.placeholder` when set', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var _ph = _.placeholder = {},
-            fn = function() { return slice.call(arguments); },
-            par = func(fn, _ph, 'b', ph),
-            expected = isPartial ? ['a', 'b', ph, 'c'] : ['a', 'c', 'b', ph];
-
-        assert.deepEqual(par('a', 'c'), expected);
-        delete _.placeholder;
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` creates a function with a `length` of `0`', function(assert) {
-      assert.expect(1);
-
-      var fn = function(a, b, c) {},
-          par = func(fn, 'a');
-
-      assert.strictEqual(par.length, 0);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ensure `new par` is an instance of `func`', function(assert) {
-      assert.expect(2);
-
-      function Foo(value) {
-        return value && object;
-      }
-
-      var object = {},
-          par = func(Foo);
-
-      assert.ok(new par instanceof Foo);
-      assert.strictEqual(new par(true), object);
-    });
-
-    QUnit.test('`_.' + methodName + '` should clone metadata for created functions', function(assert) {
-      assert.expect(3);
-
-      function greet(greeting, name) {
-        return greeting + ' ' + name;
-      }
-
-      var par1 = func(greet, 'hi'),
-          par2 = func(par1, 'barney'),
-          par3 = func(par1, 'pebbles');
-
-      assert.strictEqual(par1('fred'), isPartial ? 'hi fred' : 'fred hi');
-      assert.strictEqual(par2(), isPartial ? 'hi barney'  : 'barney hi');
-      assert.strictEqual(par3(), isPartial ? 'hi pebbles' : 'pebbles hi');
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with curried functions', function(assert) {
-      assert.expect(2);
-
-      var fn = function(a, b, c) { return a + b + c; },
-          curried = _.curry(func(fn, 1), 2);
-
-      assert.strictEqual(curried(2, 3), 6);
-      assert.strictEqual(curried(2)(3), 6);
-    });
-
-    QUnit.test('should work with placeholders and curried functions', function(assert) {
-      assert.expect(1);
-
-      var fn = function() { return slice.call(arguments); },
-          curried = _.curry(fn),
-          par = func(curried, ph, 'b', ph, 'd');
-
-      assert.deepEqual(par('a', 'c'), ['a', 'b', 'c', 'd']);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.partialRight');
-
-  (function() {
-    QUnit.test('should work as a deep `_.defaults`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': { 'b': 1 } },
-          source = { 'a': { 'b': 2, 'c': 3 } },
-          expected = { 'a': { 'b': 1, 'c': 3 } };
-
-      var defaultsDeep = _.partialRight(_.mergeWith, function deep(value, other) {
-        return lodashStable.isObject(value) ? _.mergeWith(value, other, deep) : value;
-      });
-
-      assert.deepEqual(defaultsDeep(object, source), expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('methods using `createWrapper`');
-
-  (function() {
-    function fn() {
-      return slice.call(arguments);
-    }
-
-    var ph1 = _.bind.placeholder,
-        ph2 = _.bindKey.placeholder,
-        ph3 = _.partial.placeholder,
-        ph4 = _.partialRight.placeholder;
-
-    QUnit.test('should work with combinations of partial functions', function(assert) {
-      assert.expect(1);
-
-      var a = _.partial(fn),
-          b = _.partialRight(a, 3),
-          c = _.partial(b, 1);
-
-      assert.deepEqual(c(2), [1, 2, 3]);
-    });
-
-    QUnit.test('should work with combinations of bound and partial functions', function(assert) {
-      assert.expect(3);
-
-      var fn = function() {
-        var result = [this.a];
-        push.apply(result, arguments);
-        return result;
-      };
-
-      var expected = [1, 2, 3, 4],
-          object = { 'a': 1, 'fn': fn };
-
-      var a = _.bindKey(object, 'fn'),
-          b = _.partialRight(a, 4),
-          c = _.partial(b, 2);
-
-      assert.deepEqual(c(3), expected);
-
-      a = _.bind(fn, object);
-      b = _.partialRight(a, 4);
-      c = _.partial(b, 2);
-
-      assert.deepEqual(c(3), expected);
-
-      a = _.partial(fn, 2);
-      b = _.bind(a, object);
-      c = _.partialRight(b, 4);
-
-      assert.deepEqual(c(3), expected);
-    });
-
-    QUnit.test('should ensure `new combo` is an instance of `func`', function(assert) {
-      assert.expect(2);
-
-      function Foo(a, b, c) {
-        return b === 0 && object;
-      }
-
-      var combo = _.partial(_.partialRight(Foo, 3), 1),
-          object = {};
-
-      assert.ok(new combo(2) instanceof Foo);
-      assert.strictEqual(new combo(0), object);
-    });
-
-    QUnit.test('should work with combinations of functions with placeholders', function(assert) {
-      assert.expect(3);
-
-      var expected = [1, 2, 3, 4, 5, 6],
-          object = { 'fn': fn };
-
-      var a = _.bindKey(object, 'fn', ph2, 2),
-          b = _.partialRight(a, ph4, 6),
-          c = _.partial(b, 1, ph3, 4);
-
-      assert.deepEqual(c(3, 5), expected);
-
-      a = _.bind(fn, object, ph1, 2);
-      b = _.partialRight(a, ph4, 6);
-      c = _.partial(b, 1, ph3, 4);
-
-      assert.deepEqual(c(3, 5), expected);
-
-      a = _.partial(fn, ph3, 2);
-      b = _.bind(a, object, 1, ph1, 4);
-      c = _.partialRight(b, ph4, 6);
-
-      assert.deepEqual(c(3, 5), expected);
-    });
-
-    QUnit.test('should work with combinations of functions with overlapping placeholders', function(assert) {
-      assert.expect(3);
-
-      var expected = [1, 2, 3, 4],
-          object = { 'fn': fn };
-
-      var a = _.bindKey(object, 'fn', ph2, 2),
-          b = _.partialRight(a, ph4, 4),
-          c = _.partial(b, ph3, 3);
-
-      assert.deepEqual(c(1), expected);
-
-      a = _.bind(fn, object, ph1, 2);
-      b = _.partialRight(a, ph4, 4);
-      c = _.partial(b, ph3, 3);
-
-      assert.deepEqual(c(1), expected);
-
-      a = _.partial(fn, ph3, 2);
-      b = _.bind(a, object, ph1, 3);
-      c = _.partialRight(b, ph4, 4);
-
-      assert.deepEqual(c(1), expected);
-    });
-
-    QUnit.test('should work with recursively bound functions', function(assert) {
-      assert.expect(1);
-
-      var fn = function() {
-        return this.a;
-      };
-
-      var a = _.bind(fn, { 'a': 1 }),
-          b = _.bind(a,  { 'a': 2 }),
-          c = _.bind(b,  { 'a': 3 });
-
-      assert.strictEqual(c(), 1);
-    });
-
-    QUnit.test('should work when hot', function(assert) {
-      assert.expect(12);
-
-      lodashStable.times(2, function(index) {
-        var fn = function() {
-          var result = [this];
-          push.apply(result, arguments);
-          return result;
-        };
-
-        var object = {},
-            bound1 = index ? _.bind(fn, object, 1) : _.bind(fn, object),
-            expected = [object, 1, 2, 3];
-
-        var actual = _.last(lodashStable.times(HOT_COUNT, function() {
-          var bound2 = index ? _.bind(bound1, null, 2) : _.bind(bound1);
-          return index ? bound2(3) : bound2(1, 2, 3);
-        }));
-
-        assert.deepEqual(actual, expected);
-
-        actual = _.last(lodashStable.times(HOT_COUNT, function() {
-          var bound1 = index ? _.bind(fn, object, 1) : _.bind(fn, object),
-              bound2 = index ? _.bind(bound1, null, 2) : _.bind(bound1);
-
-          return index ? bound2(3) : bound2(1, 2, 3);
-        }));
-
-        assert.deepEqual(actual, expected);
-      });
-
-      lodashStable.each(['curry', 'curryRight'], function(methodName, index) {
-        var fn = function(a, b, c) { return [a, b, c]; },
-            curried = _[methodName](fn),
-            expected = index ? [3, 2, 1] :  [1, 2, 3];
-
-        var actual = _.last(lodashStable.times(HOT_COUNT, function() {
-          return curried(1)(2)(3);
-        }));
-
-        assert.deepEqual(actual, expected);
-
-        actual = _.last(lodashStable.times(HOT_COUNT, function() {
-          var curried = _[methodName](fn);
-          return curried(1)(2)(3);
-        }));
-
-        assert.deepEqual(actual, expected);
-      });
-
-      lodashStable.each(['partial', 'partialRight'], function(methodName, index) {
-        var func = _[methodName],
-            fn = function() { return slice.call(arguments); },
-            par1 = func(fn, 1),
-            expected = index ? [3, 2, 1] : [1, 2, 3];
-
-        var actual = _.last(lodashStable.times(HOT_COUNT, function() {
-          var par2 = func(par1, 2);
-          return par2(3);
-        }));
-
-        assert.deepEqual(actual, expected);
-
-        actual = _.last(lodashStable.times(HOT_COUNT, function() {
-          var par1 = func(fn, 1),
-              par2 = func(par1, 2);
-
-          return par2(3);
-        }));
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.partition');
-
-  (function() {
-    var array = [1, 0, 1];
-
-    QUnit.test('should split elements into two groups by `predicate`', function(assert) {
-      assert.expect(3);
-
-      assert.deepEqual(_.partition([], identity), [[], []]);
-      assert.deepEqual(_.partition(array, alwaysTrue), [array, []]);
-      assert.deepEqual(_.partition(array, alwaysFalse), [[], array]);
-    });
-
-    QUnit.test('should use `_.identity` when `predicate` is nullish', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant([[1, 1], [0]]));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.partition(array, value) : _.partition(array);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'a': 1 }, { 'a': 1 }, { 'b': 2 }],
-          actual = _.partition(objects, 'a');
-
-      assert.deepEqual(actual, [objects.slice(0, 2), objects.slice(2)]);
-    });
-
-    QUnit.test('should work with a number for `predicate`', function(assert) {
-      assert.expect(2);
-
-      var array = [
-        [1, 0],
-        [0, 1],
-        [1, 0]
-      ];
-
-      assert.deepEqual(_.partition(array, 0), [[array[0], array[2]], [array[1]]]);
-      assert.deepEqual(_.partition(array, 1), [[array[1]], [array[0], array[2]]]);
-    });
-
-    QUnit.test('should work with an object for `collection`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.partition({ 'a': 1.1, 'b': 0.2, 'c': 1.3 }, Math.floor);
-      assert.deepEqual(actual, [[1.1, 1.3], [0.2]]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.pick');
-
-  (function() {
-    var args = arguments,
-        object = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 };
-
-    QUnit.test('should flatten `props`', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(_.pick(object, 'a', 'c'), { 'a': 1, 'c': 3 });
-      assert.deepEqual(_.pick(object, ['a', 'd'], 'c'), { 'a': 1, 'c': 3, 'd': 4 });
-    });
-
-    QUnit.test('should work with a primitive `object` argument', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.pick('', 'slice'), { 'slice': ''.slice });
-    });
-
-    QUnit.test('should return an empty object when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each([null, undefined], function(value) {
-        assert.deepEqual(_.pick(value, 'valueOf'), {});
-      });
-    });
-
-    QUnit.test('should work with `arguments` objects as secondary arguments', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.pick(object, args), { 'a': 1, 'c': 3 });
-    });
-
-    QUnit.test('should coerce property names to strings', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.pick({ '0': 'a', '1': 'b' }, 0), { '0': 'a' });
-    });
-  }('a', 'c'));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.pickBy');
-
-  (function() {
-    QUnit.test('should work with a predicate argument', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 };
-
-      var actual = _.pickBy(object, function(n) {
-        return n == 1 || n == 3;
-      });
-
-      assert.deepEqual(actual, { 'a': 1, 'c': 3 });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('pick methods');
-
-  lodashStable.each(['pick', 'pickBy'], function(methodName) {
-    var expected = { 'a': 1, 'c': 3 },
-        func = _[methodName],
-        object = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 },
-        prop = lodashStable.nthArg(1);
-
-    if (methodName == 'pickBy') {
-      prop = function(object, props) {
-        props = lodashStable.castArray(props);
-        return function(value) {
-          return lodashStable.some(props, function(key) {
-            key = lodashStable.isSymbol(key) ? key : lodashStable.toString(key);
-            return object[key] === value;
-          });
-        };
-      };
-    }
-    QUnit.test('`_.' + methodName + '` should create an object of picked string keyed properties', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(func(object, prop(object, 'a')), { 'a': 1 });
-      assert.deepEqual(func(object, prop(object, ['a', 'c'])), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should pick inherited string keyed properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {}
-      Foo.prototype = object;
-
-      var foo = new Foo;
-      assert.deepEqual(func(foo, prop(foo, ['a', 'c'])), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var object = { '-0': 'a', '0': 'b' },
-          props = [-0, Object(-0), 0, Object(0)],
-          expected = [{ '-0': 'a' }, { '-0': 'a' }, { '0': 'b' }, { '0': 'b' }];
-
-      var actual = lodashStable.map(props, function(key) {
-        return func(object, prop(object, key));
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should pick symbol properties', function(assert) {
-      assert.expect(2);
-
-      function Foo() {
-        this[symbol] = 1;
-      }
-
-      if (Symbol) {
-        var symbol2 = Symbol('b');
-        Foo.prototype[symbol2] = 2;
-
-        var foo = new Foo,
-            actual = func(foo, prop(foo, [symbol, symbol2]));
-
-        assert.strictEqual(actual[symbol], 1);
-        assert.strictEqual(actual[symbol2], 2);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with an array `object` argument', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3];
-      assert.deepEqual(func(array, prop(array, '1')), { '1': 2 });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.property');
-
-  (function() {
-    QUnit.test('should create a function that plucks a property value of a given object', function(assert) {
-      assert.expect(4);
-
-      var object = { 'a': 1 };
-
-      lodashStable.each(['a', ['a']], function(path) {
-        var prop = _.property(path);
-        assert.strictEqual(prop.length, 1);
-        assert.strictEqual(prop(object), 1);
-      });
-    });
-
-    QUnit.test('should pluck deep property values', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': 2 } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        var prop = _.property(path);
-        assert.strictEqual(prop(object), 2);
-      });
-    });
-
-    QUnit.test('should pluck inherited property values', function(assert) {
-      assert.expect(2);
-
-      function Foo() {}
-      Foo.prototype.a = 1;
-
-      lodashStable.each(['a', ['a']], function(path) {
-        var prop = _.property(path);
-        assert.strictEqual(prop(new Foo), 1);
-      });
-    });
-
-    QUnit.test('should work with a non-string `path`', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3];
-
-      lodashStable.each([1, [1]], function(path) {
-        var prop = _.property(path);
-        assert.strictEqual(prop(array), 2);
-      });
-    });
-
-    QUnit.test('should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var object = { '-0': 'a', '0': 'b' },
-          props = [-0, Object(-0), 0, Object(0)];
-
-      var actual = lodashStable.map(props, function(key) {
-        var prop = _.property(key);
-        return prop(object);
-      });
-
-      assert.deepEqual(actual, ['a', 'a', 'b', 'b']);
-    });
-
-    QUnit.test('should coerce key to a string', function(assert) {
-      assert.expect(1);
-
-      function fn() {}
-      fn.toString = lodashStable.constant('fn');
-
-      var objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }],
-          values = [null, undefined, fn, {}];
-
-      var actual = lodashStable.transform(objects, function(result, object, index) {
-        var key = values[index];
-        lodashStable.each([key, [key]], function(path) {
-          var prop = _.property(key);
-          result.push(prop(object));
-        });
-      });
-
-      assert.deepEqual(actual, [1, 1, 2, 2, 3, 3, 4, 4]);
-    });
-
-    QUnit.test('should pluck a key over a path', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a.b': 1, 'a': { 'b': 2 } };
-
-      lodashStable.each(['a.b', ['a.b']], function(path) {
-        var prop = _.property(path);
-        assert.strictEqual(prop(object), 1);
-      });
-    });
-
-    QUnit.test('should return `undefined` when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, noop);
-
-      lodashStable.each(['constructor', ['constructor']], function(path) {
-        var prop = _.property(path);
-
-        var actual = lodashStable.map(values, function(value, index) {
-          return index ? prop(value) : prop();
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should return `undefined` with deep paths when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, noop);
-
-      lodashStable.each(['constructor.prototype.valueOf', ['constructor', 'prototype', 'valueOf']], function(path) {
-        var prop = _.property(path);
-
-        var actual = lodashStable.map(values, function(value, index) {
-          return index ? prop(value) : prop();
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should return `undefined` if parts of `path` are missing', function(assert) {
-      assert.expect(4);
-
-      var object = {};
-
-      lodashStable.each(['a', 'a[1].b.c', ['a'], ['a', '1', 'b', 'c']], function(path) {
-        var prop = _.property(path);
-        assert.strictEqual(prop(object), undefined);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.propertyOf');
-
-  (function() {
-    QUnit.test('should create a function that plucks a property value of a given key', function(assert) {
-      assert.expect(3);
-
-      var object = { 'a': 1 },
-          propOf = _.propertyOf(object);
-
-      assert.strictEqual(propOf.length, 1);
-      lodashStable.each(['a', ['a']], function(path) {
-        assert.strictEqual(propOf(path), 1);
-      });
-    });
-
-    QUnit.test('should pluck deep property values', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': 2 } },
-          propOf = _.propertyOf(object);
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        assert.strictEqual(propOf(path), 2);
-      });
-    });
-
-    QUnit.test('should pluck inherited property values', function(assert) {
-      assert.expect(2);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var propOf = _.propertyOf(new Foo);
-
-      lodashStable.each(['b', ['b']], function(path) {
-        assert.strictEqual(propOf(path), 2);
-      });
-    });
-
-    QUnit.test('should work with a non-string `path`', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3],
-          propOf = _.propertyOf(array);
-
-      lodashStable.each([1, [1]], function(path) {
-        assert.strictEqual(propOf(path), 2);
-      });
-    });
-
-    QUnit.test('should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var object = { '-0': 'a', '0': 'b' },
-          props = [-0, Object(-0), 0, Object(0)];
-
-      var actual = lodashStable.map(props, function(key) {
-        var propOf = _.propertyOf(object);
-        return propOf(key);
-      });
-
-      assert.deepEqual(actual, ['a', 'a', 'b', 'b']);
-    });
-
-    QUnit.test('should coerce key to a string', function(assert) {
-      assert.expect(1);
-
-      function fn() {}
-      fn.toString = lodashStable.constant('fn');
-
-      var objects = [{ 'null': 1 }, { 'undefined': 2 }, { 'fn': 3 }, { '[object Object]': 4 }],
-          values = [null, undefined, fn, {}];
-
-      var actual = lodashStable.transform(objects, function(result, object, index) {
-        var key = values[index];
-        lodashStable.each([key, [key]], function(path) {
-          var propOf = _.propertyOf(object);
-          result.push(propOf(key));
-        });
-      });
-
-      assert.deepEqual(actual, [1, 1, 2, 2, 3, 3, 4, 4]);
-    });
-
-    QUnit.test('should pluck a key over a path', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a.b': 1, 'a': { 'b': 2 } },
-          propOf = _.propertyOf(object);
-
-      lodashStable.each(['a.b', ['a.b']], function(path) {
-        assert.strictEqual(propOf(path), 1);
-      });
-    });
-
-    QUnit.test('should return `undefined` when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, noop);
-
-      lodashStable.each(['constructor', ['constructor']], function(path) {
-        var actual = lodashStable.map(values, function(value, index) {
-          var propOf = index ? _.propertyOf(value) : _.propertyOf();
-          return propOf(path);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should return `undefined` with deep paths when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, noop);
-
-      lodashStable.each(['constructor.prototype.valueOf', ['constructor', 'prototype', 'valueOf']], function(path) {
-        var actual = lodashStable.map(values, function(value, index) {
-          var propOf = index ? _.propertyOf(value) : _.propertyOf();
-          return propOf(path);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should return `undefined` if parts of `path` are missing', function(assert) {
-      assert.expect(4);
-
-      var propOf = _.propertyOf({});
-
-      lodashStable.each(['a', 'a[1].b.c', ['a'], ['a', '1', 'b', 'c']], function(path) {
-        assert.strictEqual(propOf(path), undefined);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.pullAllBy');
-
-  (function() {
-    QUnit.test('should accept an `iteratee` argument', function(assert) {
-      assert.expect(1);
-
-      var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
-
-      var actual = _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], function(object) {
-        return object.x;
-      });
-
-      assert.deepEqual(actual, [{ 'x': 2 }]);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args,
-          array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
-
-      _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [{ 'x': 1 }]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.pullAllWith');
-
-  (function() {
-    QUnit.test('should work with a `comparator` argument', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'x': 1, 'y': 1 }, { 'x': 2, 'y': 2 }, { 'x': 3, 'y': 3 }],
-          expected = [objects[0], objects[2]],
-          actual = _.pullAllWith(objects, [{ 'x': 2, 'y': 2 }], lodashStable.isEqual);
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('pull methods');
-
-  lodashStable.each(['pull', 'pullAll', 'pullAllWith'], function(methodName) {
-    var func = _[methodName],
-        isPull = methodName == 'pull';
-
-    function pull(array, values) {
-      return isPull
-        ? func.apply(undefined, [array].concat(values))
-        : func(array, values);
-    }
-
-    QUnit.test('`_.' + methodName + '` should modify and return the array', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3],
-          actual = pull(array, [1, 3]);
-
-      assert.deepEqual(array, [2]);
-      assert.ok(actual === array);
-    });
-
-    QUnit.test('`_.' + methodName + '` should preserve holes in arrays', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3, 4];
-      delete array[1];
-      delete array[3];
-
-      pull(array, [1]);
-      assert.notOk('0' in array);
-      assert.notOk('2' in array);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat holes as `undefined`', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3];
-      delete array[1];
-
-      pull(array, [undefined]);
-      assert.deepEqual(array, [1, 3]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should match `NaN`', function(assert) {
-      assert.expect(1);
-
-      var array = [1, NaN, 3, NaN];
-
-      pull(array, [NaN]);
-      assert.deepEqual(array, [1, 3]);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.pullAt');
-
-  (function() {
-    QUnit.test('should modify the array and return removed elements', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3],
-          actual = _.pullAt(array, [0, 1]);
-
-      assert.deepEqual(array, [3]);
-      assert.deepEqual(actual, [1, 2]);
-    });
-
-    QUnit.test('should work with unsorted indexes', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
-          actual = _.pullAt(array, [1, 3, 11, 7, 5, 9]);
-
-      assert.deepEqual(array, [1, 3, 5, 7, 9, 11]);
-      assert.deepEqual(actual, [2, 4, 12, 8, 6, 10]);
-    });
-
-    QUnit.test('should work with repeated indexes', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3, 4],
-          actual = _.pullAt(array, [0, 2, 0, 1, 0, 2]);
-
-      assert.deepEqual(array, [4]);
-      assert.deepEqual(actual, [1, 3, 1, 2, 1, 3]);
-    });
-
-    QUnit.test('should use `undefined` for nonexistent indexes', function(assert) {
-      assert.expect(2);
-
-      var array = ['a', 'b', 'c'],
-          actual = _.pullAt(array, [2, 4, 0]);
-
-      assert.deepEqual(array, ['b']);
-      assert.deepEqual(actual, ['c', undefined, 'a']);
-    });
-
-    QUnit.test('should flatten `indexes`', function(assert) {
-      assert.expect(4);
-
-      var array = ['a', 'b', 'c'];
-      assert.deepEqual(_.pullAt(array, 2, 0), ['c', 'a']);
-      assert.deepEqual(array, ['b']);
-
-      array = ['a', 'b', 'c', 'd'];
-      assert.deepEqual(_.pullAt(array, [3, 0], 2), ['d', 'a', 'c']);
-      assert.deepEqual(array, ['b']);
-    });
-
-    QUnit.test('should return an empty array when no indexes are given', function(assert) {
-      assert.expect(4);
-
-      var array = ['a', 'b', 'c'],
-          actual = _.pullAt(array);
-
-      assert.deepEqual(array, ['a', 'b', 'c']);
-      assert.deepEqual(actual, []);
-
-      actual = _.pullAt(array, [], []);
-
-      assert.deepEqual(array, ['a', 'b', 'c']);
-      assert.deepEqual(actual, []);
-    });
-
-    QUnit.test('should work with non-index paths', function(assert) {
-      assert.expect(2);
-
-      var values = lodashStable.reject(empties, function(value) {
-        return (value === 0) || lodashStable.isArray(value);
-      }).concat(-1, 1.1);
-
-      var array = lodashStable.transform(values, function(result, value) {
-        result[value] = 1;
-      }, []);
-
-      var expected = lodashStable.map(values, alwaysOne),
-          actual = _.pullAt(array, values);
-
-      assert.deepEqual(actual, expected);
-
-      expected = lodashStable.map(values, noop),
-      actual = lodashStable.at(array, values);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var props = [-0, Object(-0), 0, Object(0)];
-
-      var actual = lodashStable.map(props, function(key) {
-        var array = [-1];
-        array['-0'] = -2;
-        return _.pullAt(array, key);
-      });
-
-      assert.deepEqual(actual, [[-2], [-2], [-1], [-1]]);
-    });
-
-    QUnit.test('should work with deep paths', function(assert) {
-      assert.expect(3);
-
-      var array = [];
-      array.a = { 'b': 2 };
-
-      var actual = _.pullAt(array, 'a.b');
-
-      assert.deepEqual(actual, [2]);
-      assert.deepEqual(array.a, {});
-
-      try {
-        actual = _.pullAt(array, 'a.b.c');
-      } catch (e) {}
-
-      assert.deepEqual(actual, [undefined]);
-    });
-
-    QUnit.test('should work with a falsey `array` argument when keys are given', function(assert) {
-      assert.expect(1);
-
-      var values = falsey.slice(),
-          expected = lodashStable.map(values, lodashStable.constant(Array(4)));
-
-      var actual = lodashStable.map(values, function(array) {
-        try {
-          return _.pullAt(array, 0, 1, 'pop', 'push');
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.random');
-
-  (function() {
-    var array = Array(1000);
-
-    QUnit.test('should return `0` or `1` when no arguments are given', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.uniq(lodashStable.map(array, function() {
-        return _.random();
-      })).sort();
-
-      assert.deepEqual(actual, [0, 1]);
-    });
-
-    QUnit.test('should support a `min` and `max` argument', function(assert) {
-      assert.expect(1);
-
-      var min = 5,
-          max = 10;
-
-      assert.ok(_.some(array, function() {
-        var result = _.random(min, max);
-        return result >= min && result <= max;
-      }));
-    });
-
-    QUnit.test('should support not providing a `max` argument', function(assert) {
-      assert.expect(1);
-
-      var min = 0,
-          max = 5;
-
-      assert.ok(_.some(array, function() {
-        var result = _.random(max);
-        return result >= min && result <= max;
-      }));
-    });
-
-    QUnit.test('should swap `min` and `max` when `min` > `max`', function(assert) {
-      assert.expect(1);
-
-      var min = 4,
-          max = 2,
-          expected = [2, 3, 4];
-
-      var actual = lodashStable.uniq(lodashStable.map(array, function() {
-        return _.random(min, max);
-      })).sort();
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should support large integer values', function(assert) {
-      assert.expect(2);
-
-      var min = Math.pow(2, 31),
-          max = Math.pow(2, 62);
-
-      assert.ok(lodashStable.every(array, function() {
-        var result = _.random(min, max);
-        return result >= min && result <= max;
-      }));
-
-      assert.ok(_.some(array, function() {
-        return _.random(MAX_INTEGER) > 0;
-      }));
-    });
-
-    QUnit.test('should coerce arguments to finite numbers', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.random('1', '1'), 1);
-      assert.strictEqual(_.random(NaN, NaN), 0);
-    });
-
-    QUnit.test('should support floats', function(assert) {
-      assert.expect(2);
-
-      var min = 1.5,
-          max = 1.6,
-          actual = _.random(min, max);
-
-      assert.ok(actual % 1);
-      assert.ok(actual >= min && actual <= max);
-    });
-
-    QUnit.test('should support providing a `floating` argument', function(assert) {
-      assert.expect(3);
-
-      var actual = _.random(true);
-      assert.ok(actual % 1 && actual >= 0 && actual <= 1);
-
-      actual = _.random(2, true);
-      assert.ok(actual % 1 && actual >= 0 && actual <= 2);
-
-      actual = _.random(2, 4, true);
-      assert.ok(actual % 1 && actual >= 2 && actual <= 4);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3],
-          expected = lodashStable.map(array, alwaysTrue),
-          randoms = lodashStable.map(array, _.random);
-
-      var actual = lodashStable.map(randoms, function(result, index) {
-        return result >= 0 && result <= array[index] && (result % 1) == 0;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('range methods');
-
-  lodashStable.each(['range', 'rangeRight'], function(methodName) {
-    var func = _[methodName],
-        isRange = methodName == 'range';
-
-    function resolve(range) {
-      return isRange ? range : range.reverse();
-    }
-
-    QUnit.test('`_.' + methodName + '` should infer the sign of `step` when only `end` is given', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(func(4), resolve([0, 1, 2, 3]));
-      assert.deepEqual(func(-4), resolve([0, -1, -2, -3]));
-    });
-
-    QUnit.test('`_.' + methodName + '` should infer the sign of `step` when only `start` and `end` are given', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(func(1, 5), resolve([1, 2, 3, 4]));
-      assert.deepEqual(func(5, 1), resolve([5, 4, 3, 2]));
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with `start`, `end`, and `step` arguments', function(assert) {
-      assert.expect(3);
-
-      assert.deepEqual(func(0, -4, -1), resolve([0, -1, -2, -3]));
-      assert.deepEqual(func(5, 1, -1), resolve([5, 4, 3, 2]));
-      assert.deepEqual(func(0, 20, 5), resolve([0, 5, 10, 15]));
-    });
-
-    QUnit.test('`_.' + methodName + '` should support a `step` of `0`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func(1, 4, 0), [1, 1, 1]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with a `step` larger than `end`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func(1, 5, 20), [1]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with a negative `step`', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(func(0, -4, -1), resolve([0, -1, -2, -3]));
-      assert.deepEqual(func(21, 10, -3), resolve([21, 18, 15, 12]));
-    });
-
-    QUnit.test('`_.' + methodName + '` should support `start` of `-0`', function(assert) {
-      assert.expect(1);
-
-      var actual = func(-0, 1);
-      assert.strictEqual(1 / actual[0], -Infinity);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat falsey `start` arguments as `0`', function(assert) {
-      assert.expect(13);
-
-      lodashStable.each(falsey, function(value, index) {
-        if (index) {
-          assert.deepEqual(func(value), []);
-          assert.deepEqual(func(value, 1), [0]);
-        } else {
-          assert.deepEqual(func(), []);
-        }
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce arguments to finite numbers', function(assert) {
-      assert.expect(1);
-
-      var actual = [func('0', 1), func('1'), func(0, 1, '1'), func(NaN), func(NaN, NaN)];
-      assert.deepEqual(actual, [[0], [0], [0], [], []]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3],
-          object = { 'a': 1, 'b': 2, 'c': 3 },
-          expected = lodashStable.map([[0], [0, 1], [0, 1, 2]], resolve);
-
-      lodashStable.each([array, object], function(collection) {
-        var actual = lodashStable.map(collection, func);
-        assert.deepEqual(actual, expected);
-      });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.rearg');
-
-  (function() {
-    function fn() {
-      return slice.call(arguments);
-    }
-
-    QUnit.test('should reorder arguments provided to `func`', function(assert) {
-      assert.expect(1);
-
-      var rearged = _.rearg(fn, [2, 0, 1]);
-      assert.deepEqual(rearged('b', 'c', 'a'), ['a', 'b', 'c']);
-    });
-
-    QUnit.test('should work with repeated indexes', function(assert) {
-      assert.expect(1);
-
-      var rearged = _.rearg(fn, [1, 1, 1]);
-      assert.deepEqual(rearged('c', 'a', 'b'), ['a', 'a', 'a']);
-    });
-
-    QUnit.test('should use `undefined` for nonexistent indexes', function(assert) {
-      assert.expect(1);
-
-      var rearged = _.rearg(fn, [1, 4]);
-      assert.deepEqual(rearged('b', 'a', 'c'), ['a', undefined, 'c']);
-    });
-
-    QUnit.test('should use `undefined` for non-index values', function(assert) {
-      assert.expect(1);
-
-      var values = lodashStable.reject(empties, function(value) {
-        return (value === 0) || lodashStable.isArray(value);
-      }).concat(-1, 1.1);
-
-      var expected = lodashStable.map(values, lodashStable.constant([undefined, 'b', 'c']));
-
-      var actual = lodashStable.map(values, function(value) {
-        var rearged = _.rearg(fn, [value]);
-        return rearged('a', 'b', 'c');
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should not rearrange arguments when no indexes are given', function(assert) {
-      assert.expect(2);
-
-      var rearged = _.rearg(fn);
-      assert.deepEqual(rearged('a', 'b', 'c'), ['a', 'b', 'c']);
-
-      rearged = _.rearg(fn, [], []);
-      assert.deepEqual(rearged('a', 'b', 'c'), ['a', 'b', 'c']);
-    });
-
-    QUnit.test('should accept multiple index arguments', function(assert) {
-      assert.expect(1);
-
-      var rearged = _.rearg(fn, 2, 0, 1);
-      assert.deepEqual(rearged('b', 'c', 'a'), ['a', 'b', 'c']);
-    });
-
-    QUnit.test('should accept multiple arrays of indexes', function(assert) {
-      assert.expect(1);
-
-      var rearged = _.rearg(fn, [2], [0, 1]);
-      assert.deepEqual(rearged('b', 'c', 'a'), ['a', 'b', 'c']);
-    });
-
-    QUnit.test('should work with fewer indexes than arguments', function(assert) {
-      assert.expect(1);
-
-      var rearged = _.rearg(fn, [1, 0]);
-      assert.deepEqual(rearged('b', 'a', 'c'), ['a', 'b', 'c']);
-    });
-
-    QUnit.test('should work on functions that have been rearged', function(assert) {
-      assert.expect(1);
-
-      var rearged1 = _.rearg(fn, 2, 1, 0),
-          rearged2 = _.rearg(rearged1, 1, 0, 2);
-
-      assert.deepEqual(rearged2('b', 'c', 'a'), ['a', 'b', 'c']);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.reduce');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should use the first element of a collection as the default `accumulator`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.reduce(array), 1);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments when iterating an array', function(assert) {
-      assert.expect(2);
-
-      var args;
-
-      _.reduce(array, function() {
-        args || (args = slice.call(arguments));
-      }, 0);
-
-      assert.deepEqual(args, [0, 1, 0, array]);
-
-      args = undefined;
-      _.reduce(array, function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [1, 2, 1, array]);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments when iterating an object', function(assert) {
-      assert.expect(2);
-
-      var args,
-          object = { 'a': 1, 'b': 2 },
-          firstKey = _.head(_.keys(object));
-
-      var expected = firstKey == 'a'
-        ? [0, 1, 'a', object]
-        : [0, 2, 'b', object];
-
-      _.reduce(object, function() {
-        args || (args = slice.call(arguments));
-      }, 0);
-
-      assert.deepEqual(args, expected);
-
-      args = undefined;
-      expected = firstKey == 'a'
-        ? [1, 2, 'b', object]
-        : [2, 1, 'a', object];
-
-      _.reduce(object, function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.reduceRight');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should use the last element of a collection as the default `accumulator`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.reduceRight(array), 3);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments when iterating an array', function(assert) {
-      assert.expect(2);
-
-      var args;
-
-      _.reduceRight(array, function() {
-        args || (args = slice.call(arguments));
-      }, 0);
-
-      assert.deepEqual(args, [0, 3, 2, array]);
-
-      args = undefined;
-      _.reduceRight(array, function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [3, 2, 1, array]);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments when iterating an object', function(assert) {
-      assert.expect(2);
-
-      var args,
-          object = { 'a': 1, 'b': 2 },
-          isFIFO = lodashStable.keys(object)[0] == 'a';
-
-      var expected = isFIFO
-        ? [0, 2, 'b', object]
-        : [0, 1, 'a', object];
-
-      _.reduceRight(object, function() {
-        args || (args = slice.call(arguments));
-      }, 0);
-
-      assert.deepEqual(args, expected);
-
-      args = undefined;
-      expected = isFIFO
-        ? [2, 1, 'a', object]
-        : [1, 2, 'b', object];
-
-      _.reduceRight(object, function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('reduce methods');
-
-  lodashStable.each(['reduce', 'reduceRight'], function(methodName) {
-    var func = _[methodName],
-        array = [1, 2, 3],
-        isReduce = methodName == 'reduce';
-
-    QUnit.test('`_.' + methodName + '` should reduce a collection to a single value', function(assert) {
-      assert.expect(1);
-
-      var actual = func(['a', 'b', 'c'], function(accumulator, value) {
-        return accumulator + value;
-      }, '');
-
-      assert.strictEqual(actual, isReduce ? 'abc' : 'cba');
-    });
-
-    QUnit.test('`_.' + methodName + '` should support empty collections without an initial `accumulator` value', function(assert) {
-      assert.expect(1);
-
-      var actual = [],
-          expected = lodashStable.map(empties, noop);
-
-      lodashStable.each(empties, function(value) {
-        try {
-          actual.push(func(value, noop));
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should support empty collections with an initial `accumulator` value', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(empties, lodashStable.constant('x'));
-
-      var actual = lodashStable.map(empties, function(value) {
-        try {
-          return func(value, noop, 'x');
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should handle an initial `accumulator` value of `undefined`', function(assert) {
-      assert.expect(1);
-
-      var actual = func([], noop, undefined);
-      assert.strictEqual(actual, undefined);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `undefined` for empty collections when no `accumulator` is given (test in IE > 9 and modern browsers)', function(assert) {
-      assert.expect(2);
-
-      var array = [],
-          object = { '0': 1, 'length': 0 };
-
-      if ('__proto__' in array) {
-        array.__proto__ = object;
-        assert.strictEqual(func(array, noop), undefined);
-      }
-      else {
-        skipAssert(assert);
-      }
-      assert.strictEqual(func(object, noop), undefined);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return an unwrapped value when implicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.strictEqual(_(array)[methodName](add), 6);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.ok(_(array).chain()[methodName](add) instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.reject');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should return elements the `predicate` returns falsey for', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.reject(array, isEven), [1, 3]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('filter methods');
-
-  lodashStable.each(['filter', 'reject'], function(methodName) {
-    var array = [1, 2, 3, 4],
-        func = _[methodName],
-        isFilter = methodName == 'filter',
-        objects = [{ 'a': 0 }, { 'a': 1 }];
-
-    QUnit.test('`_.' + methodName + '` should not modify the resulting value from within `predicate`', function(assert) {
-      assert.expect(1);
-
-      var actual = func([0], function(value, index, array) {
-        array[index] = 1;
-        return isFilter;
-      });
-
-      assert.deepEqual(actual, [0]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func(objects, 'a'), [objects[isFilter ? 1 : 0]]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with `_.matches` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func(objects, objects[1]), [objects[isFilter ? 1 : 0]]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should not modify wrapped values', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var wrapped = _(array);
-
-        var actual = wrapped[methodName](function(n) {
-          return n < 3;
-        });
-
-        assert.deepEqual(actual.value(), isFilter ? [1, 2] : [3, 4]);
-
-        actual = wrapped[methodName](function(n) {
-          return n > 2;
-        });
-
-        assert.deepEqual(actual.value(), isFilter ? [3, 4] : [1, 2]);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should work in a lazy sequence', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE + 1),
-            predicate = function(value) { return isFilter ? isEven(value) : !isEven(value); },
-            actual = _(array).slice(1).map(square)[methodName](predicate).value();
-
-        assert.deepEqual(actual, _[methodName](lodashStable.map(array.slice(1), square), predicate));
-
-        var object = lodashStable.zipObject(lodashStable.times(LARGE_ARRAY_SIZE, function(index) {
-          return ['key' + index, index];
-        }));
-
-        actual = _(object).mapValues(square)[methodName](predicate).value();
-        assert.deepEqual(actual, _[methodName](lodashStable.mapValues(object, square), predicate));
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should provide the correct `predicate` arguments in a lazy sequence', function(assert) {
-      assert.expect(5);
-
-      if (!isNpm) {
-        var args,
-            array = lodashStable.range(LARGE_ARRAY_SIZE + 1),
-            expected = [1, 0, lodashStable.map(array.slice(1), square)];
-
-        _(array).slice(1)[methodName](function(value, index, array) {
-          args || (args = slice.call(arguments));
-        }).value();
-
-        assert.deepEqual(args, [1, 0, array.slice(1)]);
-
-        args = undefined;
-        _(array).slice(1).map(square)[methodName](function(value, index, array) {
-          args || (args = slice.call(arguments));
-        }).value();
-
-        assert.deepEqual(args, expected);
-
-        args = undefined;
-        _(array).slice(1).map(square)[methodName](function(value, index) {
-          args || (args = slice.call(arguments));
-        }).value();
-
-        assert.deepEqual(args, expected);
-
-        args = undefined;
-        _(array).slice(1).map(square)[methodName](function(value) {
-          args || (args = slice.call(arguments));
-        }).value();
-
-        assert.deepEqual(args, [1]);
-
-        args = undefined;
-        _(array).slice(1).map(square)[methodName](function() {
-          args || (args = slice.call(arguments));
-        }).value();
-
-        assert.deepEqual(args, expected);
-      }
-      else {
-        skipAssert(assert, 5);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.remove');
-
-  (function() {
-    QUnit.test('should modify the array and return removed elements', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3, 4];
-
-      var actual = _.remove(array, function(n) {
-        return n % 2 == 0;
-      });
-
-      assert.deepEqual(array, [1, 3]);
-      assert.deepEqual(actual, [2, 4]);
-    });
-
-    QUnit.test('should provide the correct `predicate` arguments', function(assert) {
-      assert.expect(1);
-
-      var argsList = [],
-          array = [1, 2, 3],
-          clone = array.slice();
-
-      _.remove(array, function(n, index) {
-        var args = slice.call(arguments);
-        args[2] = args[2].slice();
-        argsList.push(args);
-        return isEven(index);
-      });
-
-      assert.deepEqual(argsList, [[1, 0, clone], [2, 1, clone], [3, 2, clone]]);
-    });
-
-    QUnit.test('should work with `_.matches` shorthands', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'a': 0, 'b': 1 }, { 'a': 1, 'b': 2 }];
-      _.remove(objects, { 'a': 1 });
-      assert.deepEqual(objects, [{ 'a': 0, 'b': 1 }]);
-    });
-
-    QUnit.test('should work with `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'a': 0, 'b': 1 }, { 'a': 1, 'b': 2 }];
-      _.remove(objects, ['a', 1]);
-      assert.deepEqual(objects, [{ 'a': 0, 'b': 1 }]);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'a': 0 }, { 'a': 1 }];
-      _.remove(objects, 'a');
-      assert.deepEqual(objects, [{ 'a': 0 }]);
-    });
-
-    QUnit.test('should preserve holes in arrays', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3, 4];
-      delete array[1];
-      delete array[3];
-
-      _.remove(array, function(n) {
-        return n === 1;
-      });
-
-      assert.notOk('0' in array);
-      assert.notOk('2' in array);
-    });
-
-    QUnit.test('should treat holes as `undefined`', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3];
-      delete array[1];
-
-      _.remove(array, function(n) {
-        return n == null;
-      });
-
-      assert.deepEqual(array, [1, 3]);
-    });
-
-    QUnit.test('should not mutate the array until all elements to remove are determined', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3];
-
-      _.remove(array, function(n, index) {
-        return isEven(index);
-      });
-
-      assert.deepEqual(array, [2]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.repeat');
-
-  (function() {
-    var string = 'abc';
-
-    QUnit.test('should repeat a string `n` times', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.repeat('*', 3), '***');
-      assert.strictEqual(_.repeat(string, 2), 'abcabc');
-    });
-
-    QUnit.test('should treat falsey `n` values, except `undefined`, as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === undefined ? string : '';
-      });
-
-      var actual = lodashStable.map(falsey, function(n, index) {
-        return index ? _.repeat(string, n) : _.repeat(string);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return an empty string if `n` is <= `0`', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.repeat(string, 0), '');
-      assert.strictEqual(_.repeat(string, -2), '');
-    });
-
-    QUnit.test('should coerce `n` to an integer', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.repeat(string, '2'), 'abcabc');
-      assert.strictEqual(_.repeat(string, 2.6), 'abcabc');
-      assert.strictEqual(_.repeat('*', { 'valueOf': alwaysThree }), '***');
-    });
-
-    QUnit.test('should coerce `string` to a string', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.repeat(Object(string), 2), 'abcabc');
-      assert.strictEqual(_.repeat({ 'toString': lodashStable.constant('*') }, 3), '***');
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(['a', 'b', 'c'], _.repeat);
-      assert.deepEqual(actual, ['a', 'b', 'c']);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.replace');
-
-  (function() {
-    QUnit.test('should replace the matched pattern', function(assert) {
-      assert.expect(2);
-
-      var string = 'abcde';
-      assert.strictEqual(_.replace(string, 'de', '123'), 'abc123');
-      assert.strictEqual(_.replace(string, /[bd]/g, '-'), 'a-c-e');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.result');
-
-  (function() {
-    var object = { 'a': 1, 'b': alwaysB };
-
-    QUnit.test('should invoke function values', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.result(object, 'b'), 'b');
-    });
-
-    QUnit.test('should invoke default function values', function(assert) {
-      assert.expect(1);
-
-      var actual = _.result(object, 'c', object.b);
-      assert.strictEqual(actual, 'b');
-    });
-
-    QUnit.test('should invoke nested function values', function(assert) {
-      assert.expect(2);
-
-      var value = { 'a': lodashStable.constant({ 'b': alwaysB }) };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        assert.strictEqual(_.result(value, path), 'b');
-      });
-    });
-
-    QUnit.test('should invoke deep property methods with the correct `this` binding', function(assert) {
-      assert.expect(2);
-
-      var value = { 'a': { 'b': function() { return this.c; }, 'c': 1 } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        assert.strictEqual(_.result(value, path), 1);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.get and lodash.result');
-
-  lodashStable.each(['get', 'result'], function(methodName) {
-    var func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should get string keyed property values', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': 1 };
-
-      lodashStable.each(['a', ['a']], function(path) {
-        assert.strictEqual(func(object, path), 1);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var object = { '-0': 'a', '0': 'b' },
-          props = [-0, Object(-0), 0, Object(0)];
-
-      var actual = lodashStable.map(props, function(key) {
-        return func(object, key);
-      });
-
-      assert.deepEqual(actual, ['a', 'a', 'b', 'b']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should get symbol keyed property values', function(assert) {
-      assert.expect(1);
-
-      if (Symbol) {
-        var object = {};
-        object[symbol] = 1;
-
-        assert.strictEqual(func(object, symbol), 1);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should get deep property values', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': 2 } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        assert.strictEqual(func(object, path), 2);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should get a key over a path', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a.b': 1, 'a': { 'b': 2 } };
-
-      lodashStable.each(['a.b', ['a.b']], function(path) {
-        assert.strictEqual(func(object, path), 1);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should not coerce array paths to strings', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a,b,c': 3, 'a': { 'b': { 'c': 4 } } };
-      assert.strictEqual(func(object, ['a', 'b', 'c']), 4);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ignore empty brackets', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1 };
-      assert.strictEqual(func(object, 'a[]'), 1);
-    });
-
-    QUnit.test('`_.' + methodName + '` should handle empty paths', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([['', ''], [[], ['']]], function(pair) {
-        assert.strictEqual(func({}, pair[0]), undefined);
-        assert.strictEqual(func({ '': 3 }, pair[1]), 3);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should handle complex paths', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { '-1.23': { '["b"]': { 'c': { "['d']": { '\ne\n': { 'f': { 'g': 8 } } } } } } } };
-
-      var paths = [
-        'a[-1.23]["[\\"b\\"]"].c[\'[\\\'d\\\']\'][\ne\n][f].g',
-        ['a', '-1.23', '["b"]', 'c', "['d']", '\ne\n', 'f', 'g']
-      ];
-
-      lodashStable.each(paths, function(path) {
-        assert.strictEqual(func(object, path), 8);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `undefined` when `object` is nullish', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each(['constructor', ['constructor']], function(path) {
-        assert.strictEqual(func(null, path), undefined);
-        assert.strictEqual(func(undefined, path), undefined);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `undefined` with deep paths when `object` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [null, undefined],
-          expected = lodashStable.map(values, noop),
-          paths = ['constructor.prototype.valueOf', ['constructor', 'prototype', 'valueOf']];
-
-      lodashStable.each(paths, function(path) {
-        var actual = lodashStable.map(values, function(value) {
-          return func(value, path);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `undefined` if parts of `path` are missing', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': [, null] };
-
-      lodashStable.each(['a[1].b.c', ['a', '1', 'b', 'c']], function(path) {
-        assert.strictEqual(func(object, path), undefined);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should be able to return `null` values', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { 'b': null } };
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        assert.strictEqual(func(object, path), null);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should follow `path` over non-plain objects', function(assert) {
-      assert.expect(2);
-
-      var paths = ['a.b', ['a', 'b']];
-
-      lodashStable.each(paths, function(path) {
-        numberProto.a = { 'b': 2 };
-        assert.strictEqual(func(0, path), 2);
-        delete numberProto.a;
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should return the default value for `undefined` values', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': {} },
-          values = empties.concat(true, new Date, 1, /x/, 'a');
-
-      var expected = lodashStable.transform(values, function(result, value) {
-        result.push(value, value, value, value);
-      });
-
-      var actual = lodashStable.transform(values, function(result, value) {
-        lodashStable.each(['a.b', ['a', 'b']], function(path) {
-          result.push(
-            func(object, path, value),
-            func(null, path, value)
-          );
-        });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return the default value when `path` is empty', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(func({}, [], 'a'), 'a');
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.rest');
-
-  (function() {
-    function fn(a, b, c) {
-      return slice.call(arguments);
-    }
-
-    QUnit.test('should apply a rest parameter to `func`', function(assert) {
-      assert.expect(1);
-
-      var rest = _.rest(fn);
-      assert.deepEqual(rest(1, 2, 3, 4), [1, 2, [3, 4]]);
-    });
-
-    QUnit.test('should work with `start`', function(assert) {
-      assert.expect(1);
-
-      var rest = _.rest(fn, 1);
-      assert.deepEqual(rest(1, 2, 3, 4), [1, [2, 3, 4]]);
-    });
-
-    QUnit.test('should treat `start` as `0` for negative or `NaN` values', function(assert) {
-      assert.expect(1);
-
-      var values = [-1, NaN, 'a'],
-          expected = lodashStable.map(values, lodashStable.constant([[1, 2, 3, 4]]));
-
-      var actual = lodashStable.map(values, function(value) {
-        var rest = _.rest(fn, value);
-        return rest(1, 2, 3, 4);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should coerce `start` to an integer', function(assert) {
-      assert.expect(1);
-
-      var rest = _.rest(fn, 1.6);
-      assert.deepEqual(rest(1, 2, 3), [1, [2, 3]]);
-    });
-
-    QUnit.test('should use an empty array when `start` is not reached', function(assert) {
-      assert.expect(1);
-
-      var rest = _.rest(fn);
-      assert.deepEqual(rest(1), [1, undefined, []]);
-    });
-
-    QUnit.test('should work on functions with more than three parameters', function(assert) {
-      assert.expect(1);
-
-      var rest = _.rest(function(a, b, c, d) {
-        return slice.call(arguments);
-      });
-
-      assert.deepEqual(rest(1, 2, 3, 4, 5), [1, 2, 3, [4, 5]]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.reverse');
-
-  (function() {
-    var largeArray = lodashStable.range(LARGE_ARRAY_SIZE).concat(null),
-        smallArray = [0, 1, 2, null];
-
-    QUnit.test('should reverse `array`', function(assert) {
-      assert.expect(2);
-
-      var array = [1, 2, 3],
-          actual = _.reverse(array);
-
-      assert.deepEqual(array, [3, 2, 1]);
-      assert.strictEqual(actual, array);
-    });
-
-    QUnit.test('should return the wrapped reversed `array`', function(assert) {
-      assert.expect(6);
-
-      if (!isNpm) {
-        lodashStable.times(2, function(index) {
-          var array = (index ? largeArray : smallArray).slice(),
-              clone = array.slice(),
-              wrapped = _(array).reverse(),
-              actual = wrapped.value();
-
-          assert.ok(wrapped instanceof _);
-          assert.strictEqual(actual, array);
-          assert.deepEqual(actual, clone.slice().reverse());
-        });
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(4);
-
-      if (!isNpm) {
-        lodashStable.times(2, function(index) {
-          var array = (index ? largeArray : smallArray).slice(),
-              expected = array.slice(),
-              actual = _(array).slice(1).reverse().value();
-
-          assert.deepEqual(actual, expected.slice(1).reverse());
-          assert.deepEqual(array, expected);
-        });
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should be lazy when in a lazy sequence', function(assert) {
-      assert.expect(3);
-
-      if (!isNpm) {
-        var spy = {
-          'toString': function() {
-            throw new Error('spy was revealed');
-          }
-        };
-
-        var array = largeArray.concat(spy),
-            expected = array.slice();
-
-        try {
-          var wrapped = _(array).slice(1).map(String).reverse(),
-              actual = wrapped.last();
-        } catch (e) {}
-
-        assert.ok(wrapped instanceof _);
-        assert.strictEqual(actual, '1');
-        assert.deepEqual(array, expected);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should work in a hybrid sequence', function(assert) {
-      assert.expect(8);
-
-      if (!isNpm) {
-        lodashStable.times(2, function(index) {
-          var clone = (index ? largeArray : smallArray).slice();
-
-          lodashStable.each(['map', 'filter'], function(methodName) {
-            var array = clone.slice(),
-                expected = clone.slice(1, -1).reverse(),
-                actual = _(array)[methodName](identity).thru(_.compact).reverse().value();
-
-            assert.deepEqual(actual, expected);
-
-            array = clone.slice();
-            actual = _(array).thru(_.compact)[methodName](identity).pull(1).push(3).reverse().value();
-
-            assert.deepEqual(actual, [3].concat(expected.slice(0, -1)));
-          });
-        });
-      }
-      else {
-        skipAssert(assert, 8);
-      }
-    });
-
-    QUnit.test('should track the `__chain__` value of a wrapper', function(assert) {
-      assert.expect(6);
-
-      if (!isNpm) {
-        lodashStable.times(2, function(index) {
-          var array = (index ? largeArray : smallArray).slice(),
-              expected = array.slice().reverse(),
-              wrapped = _(array).chain().reverse().head();
-
-          assert.ok(wrapped instanceof _);
-          assert.strictEqual(wrapped.value(), _.head(expected));
-          assert.deepEqual(array, expected);
-        });
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('round methods');
-
-  lodashStable.each(['ceil', 'floor', 'round'], function(methodName) {
-    var func = _[methodName],
-        isCeil = methodName == 'ceil',
-        isFloor = methodName == 'floor';
-
-    QUnit.test('`_.' + methodName + '` should return a rounded number without a precision', function(assert) {
-      assert.expect(1);
-
-      var actual = func(4.006);
-      assert.strictEqual(actual, isCeil ? 5 : 4);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with a precision of `0`', function(assert) {
-      assert.expect(1);
-
-      var actual = func(4.006, 0);
-      assert.strictEqual(actual, isCeil ? 5 : 4);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with a positive precision', function(assert) {
-      assert.expect(2);
-
-      var actual = func(4.016, 2);
-      assert.strictEqual(actual, isFloor ? 4.01 : 4.02);
-
-      actual = func(4.1, 2);
-      assert.strictEqual(actual, 4.1);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with a negative precision', function(assert) {
-      assert.expect(1);
-
-      var actual = func(4160, -2);
-      assert.strictEqual(actual, isFloor ? 4100 : 4200);
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce `precision` to an integer', function(assert) {
-      assert.expect(3);
-
-      var actual = func(4.006, NaN);
-      assert.strictEqual(actual, isCeil ? 5 : 4);
-
-      var expected = isFloor ? 4.01 : 4.02;
-
-      actual = func(4.016, 2.6);
-      assert.strictEqual(actual, expected);
-
-      actual = func(4.016, '+2');
-      assert.strictEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with exponential notation and `precision`', function(assert) {
-      assert.expect(3);
-
-      var actual = func(5e1, 2);
-      assert.deepEqual(actual, 50);
-
-      actual = func('5e', 1);
-      assert.deepEqual(actual, NaN);
-
-      actual = func('5e1e1', 1);
-      assert.deepEqual(actual, NaN);
-    });
-
-    QUnit.test('`_.' + methodName + '` should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var values = [[0], [-0], ['0'], ['-0'], [0, 1], [-0, 1], ['0', 1], ['-0', 1]],
-          expected = [Infinity, -Infinity, Infinity, -Infinity, Infinity, -Infinity, Infinity, -Infinity];
-
-      var actual = lodashStable.map(values, function(args) {
-        return 1 / func.apply(undefined, args);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.runInContext');
-
-  (function() {
-    QUnit.test('should not require a fully populated `context` object', function(assert) {
-      assert.expect(1);
-
-      if (!isModularize) {
-        var lodash = _.runInContext({
-          'setTimeout': function(callback) {
-            callback();
-          }
-        });
-
-        var pass = false;
-        lodash.delay(function() { pass = true; }, 32);
-        assert.ok(pass);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should use a zeroed `_.uniqueId` counter', function(assert) {
-      assert.expect(3);
-
-      if (!isModularize) {
-        lodashStable.times(2, _.uniqueId);
-
-        var oldId = Number(_.uniqueId()),
-            lodash = _.runInContext();
-
-        assert.ok(_.uniqueId() > oldId);
-
-        var id = lodash.uniqueId();
-        assert.strictEqual(id, '1');
-        assert.ok(id < oldId);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.sample');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should return a random element', function(assert) {
-      assert.expect(1);
-
-      var actual = _.sample(array);
-      assert.ok(lodashStable.includes(array, actual));
-    });
-
-    QUnit.test('should return `undefined` when sampling empty collections', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(empties, noop);
-
-      var actual = lodashStable.transform(empties, function(result, value) {
-        try {
-          result.push(_.sample(value));
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should sample an object', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1, 'b': 2, 'c': 3 },
-          actual = _.sample(object);
-
-      assert.ok(lodashStable.includes(array, actual));
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.sampleSize');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should return an array of random elements', function(assert) {
-      assert.expect(2);
-
-      var actual = _.sampleSize(array, 2);
-
-      assert.strictEqual(actual.length, 2);
-      assert.deepEqual(lodashStable.difference(actual, array), []);
-    });
-
-    QUnit.test('should contain elements of the collection', function(assert) {
-      assert.expect(1);
-
-      var actual = _.sampleSize(array, array.length).sort();
-
-      assert.deepEqual(actual, array);
-    });
-
-    QUnit.test('should treat falsey `size` values, except `undefined`, as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === undefined ? ['a'] : [];
-      });
-
-      var actual = lodashStable.map(falsey, function(size, index) {
-        return index ? _.sampleSize(['a'], size) : _.sampleSize(['a']);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return an empty array when `n` < `1` or `NaN`', function(assert) {
-      assert.expect(3);
-
-      lodashStable.each([0, -1, -Infinity], function(n) {
-        assert.deepEqual(_.sampleSize(array, n), []);
-      });
-    });
-
-    QUnit.test('should return all elements when `n` >= `array.length`', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([3, 4, Math.pow(2, 32), Infinity], function(n) {
-        var actual = _.sampleSize(array, n).sort();
-        assert.deepEqual(actual, array);
-      });
-    });
-
-    QUnit.test('should coerce `n` to an integer', function(assert) {
-      assert.expect(1);
-
-      var actual = _.sampleSize(array, 1.6);
-      assert.strictEqual(actual.length, 1);
-    });
-
-    QUnit.test('should return an empty array for empty collections', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(empties, alwaysEmptyArray);
-
-      var actual = lodashStable.transform(empties, function(result, value) {
-        try {
-          result.push(_.sampleSize(value, 1));
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should sample an object', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': 1, 'b': 2, 'c': 3 },
-          actual = _.sampleSize(object, 2);
-
-      assert.strictEqual(actual.length, 2);
-      assert.deepEqual(lodashStable.difference(actual, lodashStable.values(object)), []);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map([['a']], _.sampleSize);
-      assert.deepEqual(actual, [['a']]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.setWith');
-
-  (function() {
-    QUnit.test('should work with a `customizer` callback', function(assert) {
-      assert.expect(1);
-
-      var actual = _.setWith({ '0': {} }, '[0][1][2]', 3, function(value) {
-        return lodashStable.isObject(value) ? undefined : {};
-      });
-
-      assert.deepEqual(actual, { '0': { '1': { '2': 3 } } });
-    });
-
-    QUnit.test('should work with a `customizer` that returns `undefined`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.setWith({}, 'a[0].b.c', 4, noop);
-      assert.deepEqual(actual, { 'a': [{ 'b': { 'c': 4 } }] });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('set methods');
-
-  lodashStable.each(['update', 'updateWith', 'set', 'setWith'], function(methodName) {
-    var func = _[methodName],
-        isUpdate = methodName == 'update' || methodName == 'updateWith';
-
-    var oldValue = 1,
-        value = 2,
-        updater = isUpdate ? lodashStable.constant(value) : value;
-
-    QUnit.test('`_.' + methodName + '` should set property values', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each(['a', ['a']], function(path) {
-        var object = { 'a': oldValue },
-            actual = func(object, path, updater);
-
-        assert.strictEqual(actual, object);
-        assert.strictEqual(object.a, value);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var props = [-0, Object(-0), 0, Object(0)],
-          expected = lodashStable.map(props, lodashStable.constant(value));
-
-      var actual = lodashStable.map(props, function(key) {
-        var object = { '-0': 'a', '0': 'b' };
-        func(object, key, updater);
-        return object[lodashStable.toString(key)];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should unset symbol keyed property values', function(assert) {
-      assert.expect(2);
-
-      if (Symbol) {
-        var object = {};
-        object[symbol] = 1;
-
-        assert.strictEqual(_.unset(object, symbol), true);
-        assert.notOk(symbol in object);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should set deep property values', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        var object = { 'a': { 'b': oldValue } },
-            actual = func(object, path, updater);
-
-        assert.strictEqual(actual, object);
-        assert.strictEqual(object.a.b, value);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should set a key over a path', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each(['a.b', ['a.b']], function(path) {
-        var object = { 'a.b': oldValue },
-            actual = func(object, path, updater);
-
-        assert.strictEqual(actual, object);
-        assert.deepEqual(object, { 'a.b': value });
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should not coerce array paths to strings', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a,b,c': 1, 'a': { 'b': { 'c': 1 } } };
-
-      func(object, ['a', 'b', 'c'], updater);
-      assert.strictEqual(object.a.b.c, value);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ignore empty brackets', function(assert) {
-      assert.expect(1);
-
-      var object = {};
-
-      func(object, 'a[]', updater);
-      assert.deepEqual(object, { 'a': value });
-    });
-
-    QUnit.test('`_.' + methodName + '` should handle empty paths', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([['', ''], [[], ['']]], function(pair, index) {
-        var object = {};
-
-        func(object, pair[0], updater);
-        assert.deepEqual(object, index ? {} : { '': value });
-
-        func(object, pair[1], updater);
-        assert.deepEqual(object, { '': value });
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should handle complex paths', function(assert) {
-      assert.expect(2);
-
-      var object = { 'a': { '1.23': { '["b"]': { 'c': { "['d']": { '\ne\n': { 'f': { 'g': oldValue } } } } } } } };
-
-      var paths = [
-        'a[-1.23]["[\\"b\\"]"].c[\'[\\\'d\\\']\'][\ne\n][f].g',
-        ['a', '-1.23', '["b"]', 'c', "['d']", '\ne\n', 'f', 'g']
-      ];
-
-      lodashStable.each(paths, function(path) {
-        func(object, path, updater);
-        assert.strictEqual(object.a[-1.23]['["b"]'].c["['d']"]['\ne\n'].f.g, value);
-        object.a[-1.23]['["b"]'].c["['d']"]['\ne\n'].f.g = oldValue;
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should create parts of `path` that are missing', function(assert) {
-      assert.expect(6);
-
-      var object = {};
-
-      lodashStable.each(['a[1].b.c', ['a', '1', 'b', 'c']], function(path) {
-        var actual = func(object, path, updater);
-
-        assert.strictEqual(actual, object);
-        assert.deepEqual(actual, { 'a': [undefined, { 'b': { 'c': value } }] });
-        assert.notOk('0' in object.a);
-
-        delete object.a;
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should not error when `object` is nullish', function(assert) {
-      assert.expect(1);
-
-      var values = [null, undefined],
-          expected = [[null, null], [undefined, undefined]];
-
-      var actual = lodashStable.map(values, function(value) {
-        try {
-          return [func(value, 'a.b', updater), func(value, ['a', 'b'], updater)];
-        } catch (e) {
-          return e.message;
-        }
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should follow `path` over non-plain objects', function(assert) {
-      assert.expect(4);
-
-      var object = { 'a': '' },
-          paths = ['constructor.prototype.a', ['constructor', 'prototype', 'a']];
-
-      lodashStable.each(paths, function(path) {
-        func(0, path, updater);
-        assert.strictEqual(0..a, value);
-        delete numberProto.a;
-      });
-
-      lodashStable.each(['a.replace.b', ['a', 'replace', 'b']], function(path) {
-        func(object, path, updater);
-        assert.strictEqual(stringProto.replace.b, value);
-        delete stringProto.replace.b;
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should not error on paths over primitives in strict mode', function(assert) {
-      'use strict';
-
-      assert.expect(2);
-
-      lodashStable.each(['a', 'a.a.a'], function(path) {
-        numberProto.a = oldValue;
-        try {
-          func(0, path, updater);
-          assert.strictEqual(0..a, oldValue);
-        } catch (e) {
-          assert.ok(false, e.message);
-        }
-      });
-
-      delete numberProto.a;
-    });
-
-    QUnit.test('`_.' + methodName + '` should not create an array for missing non-index property names that start with numbers', function(assert) {
-      assert.expect(1);
-
-      var object = {};
-
-      func(object, ['1a', '2b', '3c'], updater);
-      assert.deepEqual(object, { '1a': { '2b': { '3c': value } } });
-    });
-
-    QUnit.test('`_.' + methodName + '` should not assign values that are the same as their destinations', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each(['a', ['a'], { 'a': 1 }, NaN], function(value) {
-        if (defineProperty) {
-          var object = {},
-              pass = true,
-              updater = isUpdate ? lodashStable.constant(value) : value;
-
-          defineProperty(object, 'a', {
-            'enumerable': true,
-            'configurable': true,
-            'get': lodashStable.constant(value),
-            'set': function() { pass = false; }
-          });
-
-          func(object, 'a', updater);
-          assert.ok(pass);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.shuffle');
-
-  (function() {
-    var array = [1, 2, 3],
-        object = { 'a': 1, 'b': 2, 'c': 3 };
-
-    QUnit.test('should return a new array', function(assert) {
-      assert.expect(1);
-
-      assert.notStrictEqual(_.shuffle(array), array);
-    });
-
-    QUnit.test('should contain the same elements after a collection is shuffled', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(_.shuffle(array).sort(), array);
-      assert.deepEqual(_.shuffle(object).sort(), array);
-    });
-
-    QUnit.test('should shuffle small collections', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.times(1000, function(assert) {
-        return _.shuffle([1, 2]);
-      });
-
-      assert.deepEqual(lodashStable.sortBy(lodashStable.uniqBy(actual, String), '0'), [[1, 2], [2, 1]]);
-    });
-
-    QUnit.test('should treat number values for `collection` as empty', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.shuffle(1), []);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.size');
-
-  (function() {
-    var args = arguments,
-        array = [1, 2, 3];
-
-    QUnit.test('should return the number of own enumerable string keyed properties of an object', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.size({ 'one': 1, 'two': 2, 'three': 3 }), 3);
-    });
-
-    QUnit.test('should return the length of an array', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.size(array), 3);
-    });
-
-    QUnit.test('should accept a falsey `object` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysZero);
-
-      var actual = lodashStable.map(falsey, function(object, index) {
-        try {
-          return index ? _.size(object) : _.size();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with `arguments` objects', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.size(args), 3);
-    });
-
-    QUnit.test('should work with jQuery/MooTools DOM query collections', function(assert) {
-      assert.expect(1);
-
-      function Foo(elements) {
-        push.apply(this, elements);
-      }
-      Foo.prototype = { 'length': 0, 'splice': arrayProto.splice };
-
-      assert.strictEqual(_.size(new Foo(array)), 3);
-    });
-
-    QUnit.test('should work with maps', function(assert) {
-      assert.expect(2);
-
-      if (Map) {
-        lodashStable.each([new Map, realm.map], function(map) {
-          map.set('a', 1);
-          map.set('b', 2);
-          assert.strictEqual(_.size(map), 2);
-          map.clear();
-        });
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should work with sets', function(assert) {
-      assert.expect(2);
-
-      if (Set) {
-        lodashStable.each([new Set, realm.set], function(set) {
-          set.add(1);
-          set.add(2);
-          assert.strictEqual(_.size(set), 2);
-          set.clear();
-        });
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should not treat objects with negative lengths as array-like', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.size({ 'length': -1 }), 1);
-    });
-
-    QUnit.test('should not treat objects with lengths larger than `MAX_SAFE_INTEGER` as array-like', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.size({ 'length': MAX_SAFE_INTEGER + 1 }), 1);
-    });
-
-    QUnit.test('should not treat objects with non-number lengths as array-like', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.size({ 'length': '0' }), 1);
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.slice');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should use a default `start` of `0` and a default `end` of `array.length`', function(assert) {
-      assert.expect(2);
-
-      var actual = _.slice(array);
-      assert.deepEqual(actual, array);
-      assert.notStrictEqual(actual, array);
-    });
-
-    QUnit.test('should work with a positive `start`', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(_.slice(array, 1), [2, 3]);
-      assert.deepEqual(_.slice(array, 1, 3), [2, 3]);
-    });
-
-    QUnit.test('should work with a `start` >= `array.length`', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([3, 4, Math.pow(2, 32), Infinity], function(start) {
-        assert.deepEqual(_.slice(array, start), []);
-      });
-    });
-
-    QUnit.test('should treat falsey `start` values as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, lodashStable.constant(array));
-
-      var actual = lodashStable.map(falsey, function(start) {
-        return _.slice(array, start);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with a negative `start`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.slice(array, -1), [3]);
-    });
-
-    QUnit.test('should work with a negative `start` <= negative `array.length`', function(assert) {
-      assert.expect(3);
-
-      lodashStable.each([-3, -4, -Infinity], function(start) {
-        assert.deepEqual(_.slice(array, start), array);
-      });
-    });
-
-    QUnit.test('should work with `start` >= `end`', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each([2, 3], function(start) {
-        assert.deepEqual(_.slice(array, start, 2), []);
-      });
-    });
-
-    QUnit.test('should work with a positive `end`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.slice(array, 0, 1), [1]);
-    });
-
-    QUnit.test('should work with a `end` >= `array.length`', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([3, 4, Math.pow(2, 32), Infinity], function(end) {
-        assert.deepEqual(_.slice(array, 0, end), array);
-      });
-    });
-
-    QUnit.test('should treat falsey `end` values, except `undefined`, as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === undefined ? array : [];
-      });
-
-      var actual = lodashStable.map(falsey, function(end, index) {
-        return index ? _.slice(array, 0, end) : _.slice(array, 0);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with a negative `end`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.slice(array, 0, -1), [1, 2]);
-    });
-
-    QUnit.test('should work with a negative `end` <= negative `array.length`', function(assert) {
-      assert.expect(3);
-
-      lodashStable.each([-3, -4, -Infinity], function(end) {
-        assert.deepEqual(_.slice(array, 0, end), []);
-      });
-    });
-
-    QUnit.test('should coerce `start` and `end` to integers', function(assert) {
-      assert.expect(1);
-
-      var positions = [[0.1, 1.6], ['0', 1], [0, '1'], ['1'], [NaN, 1], [1, NaN]];
-
-      var actual = lodashStable.map(positions, function(pos) {
-        return _.slice.apply(_, [array].concat(pos));
-      });
-
-      assert.deepEqual(actual, [[1], [1], [1], [2, 3], [1], []]);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(2);
-
-      var array = [[1], [2, 3]],
-          actual = lodashStable.map(array, _.slice);
-
-      assert.deepEqual(actual, array);
-      assert.notStrictEqual(actual, array);
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(38);
-
-      if (!isNpm) {
-        var array = lodashStable.range(1, LARGE_ARRAY_SIZE + 1),
-            length = array.length,
-            wrapped = _(array);
-
-        lodashStable.each(['map', 'filter'], function(methodName) {
-          assert.deepEqual(wrapped[methodName]().slice(0, -1).value(), array.slice(0, -1));
-          assert.deepEqual(wrapped[methodName]().slice(1).value(), array.slice(1));
-          assert.deepEqual(wrapped[methodName]().slice(1, 3).value(), array.slice(1, 3));
-          assert.deepEqual(wrapped[methodName]().slice(-1).value(), array.slice(-1));
-
-          assert.deepEqual(wrapped[methodName]().slice(length).value(), array.slice(length));
-          assert.deepEqual(wrapped[methodName]().slice(3, 2).value(), array.slice(3, 2));
-          assert.deepEqual(wrapped[methodName]().slice(0, -length).value(), array.slice(0, -length));
-          assert.deepEqual(wrapped[methodName]().slice(0, null).value(), array.slice(0, null));
-
-          assert.deepEqual(wrapped[methodName]().slice(0, length).value(), array.slice(0, length));
-          assert.deepEqual(wrapped[methodName]().slice(-length).value(), array.slice(-length));
-          assert.deepEqual(wrapped[methodName]().slice(null).value(), array.slice(null));
-
-          assert.deepEqual(wrapped[methodName]().slice(0, 1).value(), array.slice(0, 1));
-          assert.deepEqual(wrapped[methodName]().slice(NaN, '1').value(), array.slice(NaN, '1'));
-
-          assert.deepEqual(wrapped[methodName]().slice(0.1, 1.1).value(), array.slice(0.1, 1.1));
-          assert.deepEqual(wrapped[methodName]().slice('0', 1).value(), array.slice('0', 1));
-          assert.deepEqual(wrapped[methodName]().slice(0, '1').value(), array.slice(0, '1'));
-          assert.deepEqual(wrapped[methodName]().slice('1').value(), array.slice('1'));
-          assert.deepEqual(wrapped[methodName]().slice(NaN, 1).value(), array.slice(NaN, 1));
-          assert.deepEqual(wrapped[methodName]().slice(1, NaN).value(), array.slice(1, NaN));
-        });
-      }
-      else {
-        skipAssert(assert, 38);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.some');
-
-  (function() {
-    QUnit.test('should return `true` if `predicate` returns truthy for any element', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.some([false, 1, ''], identity), true);
-      assert.strictEqual(_.some([null, 'a', 0], identity), true);
-    });
-
-    QUnit.test('should return `false` for empty collections', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(empties, alwaysFalse);
-
-      var actual = lodashStable.map(empties, function(value) {
-        try {
-          return _.some(value, identity);
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return `true` as soon as `predicate` returns truthy', function(assert) {
-      assert.expect(2);
-
-      var count = 0;
-
-      assert.strictEqual(_.some([null, true, null], function(value) {
-        count++;
-        return value;
-      }), true);
-
-      assert.strictEqual(count, 2);
-    });
-
-    QUnit.test('should return `false` if `predicate` returns falsey for all elements', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.some([false, false, false], identity), false);
-      assert.strictEqual(_.some([null, 0, ''], identity), false);
-    });
-
-    QUnit.test('should use `_.identity` when `predicate` is nullish', function(assert) {
-      assert.expect(2);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, alwaysFalse);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        var array = [0, 0];
-        return index ? _.some(array, value) : _.some(array);
-      });
-
-      assert.deepEqual(actual, expected);
-
-      expected = lodashStable.map(values, alwaysTrue);
-      actual = lodashStable.map(values, function(value, index) {
-        var array = [0, 1];
-        return index ? _.some(array, value) : _.some(array);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(2);
-
-      var objects = [{ 'a': 0, 'b': 0 }, { 'a': 0, 'b': 1 }];
-      assert.strictEqual(_.some(objects, 'a'), false);
-      assert.strictEqual(_.some(objects, 'b'), true);
-    });
-
-    QUnit.test('should work with `_.matches` shorthands', function(assert) {
-      assert.expect(2);
-
-      var objects = [{ 'a': 0, 'b': 0 }, { 'a': 1, 'b': 1}];
-      assert.strictEqual(_.some(objects, { 'a': 0 }), true);
-      assert.strictEqual(_.some(objects, { 'b': 2 }), false);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map([[1]], _.some);
-      assert.deepEqual(actual, [true]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.sortBy');
-
-  (function() {
-    var objects = [
-      { 'a': 'x', 'b': 3 },
-      { 'a': 'y', 'b': 4 },
-      { 'a': 'x', 'b': 1 },
-      { 'a': 'y', 'b': 2 }
-    ];
-
-    QUnit.test('should sort in ascending order by `iteratee`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(_.sortBy(objects, function(object) {
-        return object.b;
-      }), 'b');
-
-      assert.deepEqual(actual, [1, 2, 3, 4]);
-    });
-
-    QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) {
-      assert.expect(1);
-
-      var array = [3, 2, 1],
-          values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant([1, 2, 3]));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.sortBy(array, value) : _.sortBy(array);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(_.sortBy(objects.concat(undefined), 'b'), 'b');
-      assert.deepEqual(actual, [1, 2, 3, 4, undefined]);
-    });
-
-    QUnit.test('should work with an object for `collection`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.sortBy({ 'a': 1, 'b': 2, 'c': 3 }, Math.sin);
-      assert.deepEqual(actual, [3, 1, 2]);
-    });
-
-    QUnit.test('should move symbol, `null`, `undefined`, and `NaN` values to the end', function(assert) {
-      assert.expect(2);
-
-      var symbol1 = Symbol ? Symbol('a') : null,
-          symbol2 = Symbol ? Symbol('b') : null,
-          array = [NaN, undefined, null, 4, symbol1, null, 1, symbol2, undefined, 3, NaN, 2],
-          expected = [1, 2, 3, 4, symbol1, symbol2, null, null, undefined, undefined, NaN, NaN];
-
-      assert.deepEqual(_.sortBy(array), expected);
-
-      array = [NaN, undefined, symbol1, null, 'd', null, 'a', symbol2, undefined, 'c', NaN, 'b'];
-      expected = ['a', 'b', 'c', 'd', symbol1, symbol2, null, null, undefined, undefined, NaN, NaN];
-
-      assert.deepEqual(_.sortBy(array), expected);
-    });
-
-    QUnit.test('should treat number values for `collection` as empty', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.sortBy(1), []);
-    });
-
-    QUnit.test('should coerce arrays returned from `iteratee`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.sortBy(objects, function(object) {
-        var result = [object.a, object.b];
-        result.toString = function() { return String(this[0]); };
-        return result;
-      });
-
-      assert.deepEqual(actual, [objects[0], objects[2], objects[1], objects[3]]);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map([[2, 1, 3], [3, 2, 1]], _.sortBy);
-      assert.deepEqual(actual, [[1, 2, 3], [1, 2, 3]]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('sortBy methods');
-
-  lodashStable.each(['orderBy', 'sortBy'], function(methodName) {
-    var func = _[methodName];
-
-    function Pair(a, b, c) {
-      this.a = a;
-      this.b = b;
-      this.c = c;
-    }
-
-    var objects = [
-      { 'a': 'x', 'b': 3 },
-      { 'a': 'y', 'b': 4 },
-      { 'a': 'x', 'b': 1 },
-      { 'a': 'y', 'b': 2 }
-    ];
-
-    var stableArray = [
-      new Pair(1, 1, 1), new Pair(1, 2, 1),
-      new Pair(1, 1, 1), new Pair(1, 2, 1),
-      new Pair(1, 3, 1), new Pair(1, 4, 1),
-      new Pair(1, 5, 1), new Pair(1, 6, 1),
-      new Pair(2, 1, 2), new Pair(2, 2, 2),
-      new Pair(2, 3, 2), new Pair(2, 4, 2),
-      new Pair(2, 5, 2), new Pair(2, 6, 2),
-      new Pair(undefined, 1, 1), new Pair(undefined, 2, 1),
-      new Pair(undefined, 3, 1), new Pair(undefined, 4, 1),
-      new Pair(undefined, 5, 1), new Pair(undefined, 6, 1)
-    ];
-
-    var stableObject = lodashStable.zipObject('abcdefghijklmnopqrst'.split(''), stableArray);
-
-    QUnit.test('`_.' + methodName + '` should sort multiple properties in ascending order', function(assert) {
-      assert.expect(1);
-
-      var actual = func(objects, ['a', 'b']);
-      assert.deepEqual(actual, [objects[2], objects[0], objects[3], objects[1]]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should support iteratees', function(assert) {
-      assert.expect(1);
-
-      var actual = func(objects, ['a', function(object) { return object.b; }]);
-      assert.deepEqual(actual, [objects[2], objects[0], objects[3], objects[1]]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should perform a stable sort (test in IE > 8 and V8)', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each([stableArray, stableObject], function(value, index) {
-        var actual = func(value, ['a', 'c']);
-        assert.deepEqual(actual, stableArray, index ? 'object' : 'array');
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should not error on nullish elements', function(assert) {
-      assert.expect(1);
-
-      try {
-        var actual = func(objects.concat(null, undefined), ['a', 'b']);
-      } catch (e) {}
-
-      assert.deepEqual(actual, [objects[2], objects[0], objects[3], objects[1], null, undefined]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work as an iteratee for methods like `_.reduce`', function(assert) {
-      assert.expect(3);
-
-      var objects = [
-        { 'a': 'x', '0': 3 },
-        { 'a': 'y', '0': 4 },
-        { 'a': 'x', '0': 1 },
-        { 'a': 'y', '0': 2 }
-      ];
-
-      var funcs = [func, lodashStable.partialRight(func, 'bogus')];
-
-      lodashStable.each(['a', 0, [0]], function(props, index) {
-        var expected = lodashStable.map(funcs, lodashStable.constant(
-          index
-            ? [objects[2], objects[3], objects[0], objects[1]]
-            : [objects[0], objects[2], objects[1], objects[3]]
-        ));
-
-        var actual = lodashStable.map(funcs, function(func) {
-          return lodashStable.reduce([props], func, objects);
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('sortedIndex methods');
-
-  lodashStable.each(['sortedIndex', 'sortedLastIndex'], function(methodName) {
-    var func = _[methodName],
-        isSortedIndex = methodName == 'sortedIndex';
-
-    QUnit.test('`_.' + methodName + '` should return the insert index', function(assert) {
-      assert.expect(1);
-
-      var array = [30, 50],
-          values = [30, 40, 50],
-          expected = isSortedIndex ? [0, 1, 1] : [1, 1, 2];
-
-      var actual = lodashStable.map(values, function(value) {
-        return func(array, value);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with an array of strings', function(assert) {
-      assert.expect(1);
-
-      var array = ['a', 'c'],
-          values = ['a', 'b', 'c'],
-          expected = isSortedIndex ? [0, 1, 1] : [1, 1, 2];
-
-      var actual = lodashStable.map(values, function(value) {
-        return func(array, value);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should accept a falsey `array` argument and a `value`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, lodashStable.constant([0, 0, 0]));
-
-      var actual = lodashStable.map(falsey, function(array) {
-        return [func(array, 1), func(array, undefined), func(array, NaN)];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should align with `_.sortBy`', function(assert) {
-      assert.expect(12);
-
-      var symbol1 = Symbol ? Symbol('a') : null,
-          symbol2 = Symbol ? Symbol('b') : null,
-          expected = [1, '2', {}, symbol1, symbol2, null, undefined, NaN, NaN];
-
-      lodashStable.each([
-        [NaN, symbol1, null, 1, '2', {}, symbol2, NaN, undefined],
-        ['2', null, 1, symbol1, NaN, {}, NaN, symbol2, undefined]
-      ], function(array) {
-        assert.deepEqual(_.sortBy(array), expected);
-        assert.strictEqual(func(expected, 3), 2);
-        assert.strictEqual(func(expected, symbol1), (isSortedIndex ? 3 : (Symbol ? 5 : 6)));
-        assert.strictEqual(func(expected, null), (isSortedIndex ? (Symbol ? 5 : 3) : 6));
-        assert.strictEqual(func(expected, undefined), isSortedIndex ? 6 : 7);
-        assert.strictEqual(func(expected, NaN), isSortedIndex ? 7 : 9);
-      });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('sortedIndexBy methods');
-
-  lodashStable.each(['sortedIndexBy', 'sortedLastIndexBy'], function(methodName) {
-    var func = _[methodName],
-        isSortedIndexBy = methodName == 'sortedIndexBy';
-
-    QUnit.test('`_.' + methodName + '` should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      func([30, 50], 40, function(assert) {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [40]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'x': 30 }, { 'x': 50 }],
-          actual = func(objects, { 'x': 40 }, 'x');
-
-      assert.strictEqual(actual, 1);
-    });
-
-    QUnit.test('`_.' + methodName + '` should support arrays larger than `MAX_ARRAY_LENGTH / 2`', function(assert) {
-      assert.expect(12);
-
-      lodashStable.each([Math.ceil(MAX_ARRAY_LENGTH / 2), MAX_ARRAY_LENGTH], function(length) {
-        var array = [],
-            values = [MAX_ARRAY_LENGTH, NaN, undefined];
-
-        array.length = length;
-
-        lodashStable.each(values, function(value) {
-          var steps = 0;
-
-          var actual = func(array, value, function(value) {
-            steps++;
-            return value;
-          });
-
-          var expected = (isSortedIndexBy ? !lodashStable.isNaN(value) : lodashStable.isFinite(value))
-            ? 0
-            : Math.min(length, MAX_ARRAY_INDEX);
-
-          // Avoid false fails in older Firefox.
-          if (array.length == length) {
-            assert.ok(steps == 32 || steps == 33);
-            assert.strictEqual(actual, expected);
-          }
-          else {
-            skipAssert(assert, 2);
-          }
-        });
-      });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('sortedIndexOf methods');
-
-  lodashStable.each(['sortedIndexOf', 'sortedLastIndexOf'], function(methodName) {
-    var func = _[methodName],
-        isSortedIndexOf = methodName == 'sortedIndexOf';
-
-    QUnit.test('`_.' + methodName + '` should perform a binary search', function(assert) {
-      assert.expect(1);
-
-      var sorted = [4, 4, 5, 5, 6, 6];
-      assert.deepEqual(func(sorted, 5), isSortedIndexOf ? 2 : 3);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.sortedUniq');
-
-  (function() {
-    QUnit.test('should return unique values of a sorted array', function(assert) {
-      assert.expect(3);
-
-      var expected = [1, 2, 3];
-
-      lodashStable.each([[1, 2, 3], [1, 1, 2, 2, 3], [1, 2, 3, 3, 3, 3, 3]], function(array) {
-        assert.deepEqual(_.sortedUniq(array), expected);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.split');
-
-  (function() {
-    QUnit.test('should split a string by `separator`', function(assert) {
-      assert.expect(3);
-
-      var string = 'abcde';
-      assert.deepEqual(_.split(string, 'c'), ['ab', 'de']);
-      assert.deepEqual(_.split(string, /[bd]/), ['a', 'c', 'e']);
-      assert.deepEqual(_.split(string, '', 2), ['a', 'b']);
-    });
-
-    QUnit.test('should return an array containing an empty string for empty values', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined, ''],
-          expected = lodashStable.map(values, lodashStable.constant(['']));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.split(value) : _.split();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var strings = ['abc', 'def', 'ghi'],
-          actual = lodashStable.map(strings, _.split);
-
-      assert.deepEqual(actual, [['abc'], ['def'], ['ghi']]);
-    });
-
-    QUnit.test('should allow mixed string and array prototype methods', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var wrapped = _('abc');
-        assert.strictEqual(wrapped.split('b').join(','), 'a,c');
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.spread');
-
-  (function() {
-    function fn(a, b, c) {
-      return slice.call(arguments);
-    }
-
-    QUnit.test('should spread arguments to `func`', function(assert) {
-      assert.expect(1);
-
-      var spread = _.spread(fn);
-      assert.deepEqual(spread([4, 2]), [4, 2]);
-    });
-
-    QUnit.test('should accept a falsey `array` argument', function(assert) {
-      assert.expect(1);
-
-      var spread = _.spread(alwaysTrue),
-          expected = lodashStable.map(falsey, alwaysTrue);
-
-      var actual = lodashStable.map(falsey, function(array, index) {
-        try {
-          return index ? spread(array) : spread();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should provide the correct `func` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      var spread = _.spread(function() {
-        args = slice.call(arguments);
-      });
-
-      spread([4, 2], 'ignored');
-      assert.deepEqual(args, [4, 2]);
-    });
-
-    QUnit.test('should work with `start`', function(assert) {
-      assert.expect(1);
-
-      var spread = _.spread(fn, 1);
-      assert.deepEqual(spread(1, [2, 3, 4]), [1, 2, 3, 4]);
-    });
-
-    QUnit.test('should treat `start` as `0` for negative or `NaN` values', function(assert) {
-      assert.expect(1);
-
-      var values = [-1, NaN, 'a'],
-          expected = lodashStable.map(values, lodashStable.constant([1, 2, 3, 4]));
-
-      var actual = lodashStable.map(values, function(value) {
-        var spread = _.spread(fn, value);
-        return spread([1, 2, 3, 4]);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should coerce `start` to an integer', function(assert) {
-      assert.expect(1);
-
-      var spread = _.spread(fn, 1.6);
-      assert.deepEqual(spread(1, [2, 3]), [1, 2, 3]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.startCase');
-
-  (function() {
-    QUnit.test('should uppercase only the first character of each word', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.startCase('--foo-bar--'), 'Foo Bar');
-      assert.strictEqual(_.startCase('fooBar'), 'Foo Bar');
-      assert.strictEqual(_.startCase('__FOO_BAR__'), 'FOO BAR');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.startsWith');
-
-  (function() {
-    var string = 'abc';
-
-    QUnit.test('should return `true` if a string starts with `target`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.startsWith(string, 'a'), true);
-    });
-
-    QUnit.test('should return `false` if a string does not start with `target`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.startsWith(string, 'b'), false);
-    });
-
-    QUnit.test('should work with a `position` argument', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.startsWith(string, 'b', 1), true);
-    });
-
-    QUnit.test('should work with `position` >= `string.length`', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([3, 5, MAX_SAFE_INTEGER, Infinity], function(position) {
-        assert.strictEqual(_.startsWith(string, 'a', position), false);
-      });
-    });
-
-    QUnit.test('should treat falsey `position` values as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysTrue);
-
-      var actual = lodashStable.map(falsey, function(position) {
-        return _.startsWith(string, 'a', position);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should treat a negative `position` as `0`', function(assert) {
-      assert.expect(6);
-
-      lodashStable.each([-1, -3, -Infinity], function(position) {
-        assert.strictEqual(_.startsWith(string, 'a', position), true);
-        assert.strictEqual(_.startsWith(string, 'b', position), false);
-      });
-    });
-
-    QUnit.test('should coerce `position` to an integer', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.startsWith(string, 'bc', 1.2), true);
-    });
-
-    QUnit.test('should return `true` when `target` is an empty string regardless of `position`', function(assert) {
-      assert.expect(1);
-
-      assert.ok(lodashStable.every([-Infinity, NaN, -3, -1, 0, 1, 2, 3, 5, MAX_SAFE_INTEGER, Infinity], function(position) {
-        return _.startsWith(string, '', position, true);
-      }));
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.startsWith and lodash.endsWith');
-
-  lodashStable.each(['startsWith', 'endsWith'], function(methodName) {
-    var func = _[methodName],
-        isStartsWith = methodName == 'startsWith';
-
-    var string = 'abc',
-        chr = isStartsWith ? 'a' : 'c';
-
-    QUnit.test('`_.' + methodName + '` should coerce `string` to a string', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(func(Object(string), chr), true);
-      assert.strictEqual(func({ 'toString': lodashStable.constant(string) }, chr), true);
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce `target` to a string', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(func(string, Object(chr)), true);
-      assert.strictEqual(func(string, { 'toString': lodashStable.constant(chr) }), true);
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce `position` to a number', function(assert) {
-      assert.expect(2);
-
-      var position = isStartsWith ? 1 : 2;
-      assert.strictEqual(func(string, 'b', Object(position)), true);
-      assert.strictEqual(func(string, 'b', { 'toString': lodashStable.constant(String(position)) }), true);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.subtract');
-
-  (function() {
-    QUnit.test('should subtract two numbers', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.subtract(6, 4), 2);
-      assert.strictEqual(_.subtract(-6, 4), -10);
-      assert.strictEqual(_.subtract(-6, -4), -2);
-    });
-
-    QUnit.test('should coerce arguments to numbers', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.subtract('6', '4'), 2);
-      assert.deepEqual(_.subtract('x', 'y'), NaN);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('math operator methods');
-
-  lodashStable.each(['add', 'divide', 'multiply', 'subtract'], function(methodName) {
-    var func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should return `0` when no arguments are given', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(func(), 0);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with only one defined argument', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(func(6), 6);
-      assert.strictEqual(func(6, undefined), 6);
-      assert.strictEqual(func(undefined, 4), 4);
-    });
-
-    QUnit.test('`_.' + methodName + '` should preserve the sign of `0`', function(assert) {
-      assert.expect(2);
-
-      var values = [0, '0', -0, '-0'],
-          expected = [[0, Infinity], ['0', Infinity], [-0, -Infinity], ['-0', -Infinity]];
-
-      lodashStable.times(2, function(index) {
-        var actual = lodashStable.map(values, function(value) {
-          var result = index ? func(undefined, value) : func(value);
-          return [result, 1 / result];
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should convert objects to `NaN`', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(func(0, {}), NaN);
-      assert.deepEqual(func({}, 0), NaN);
-    });
-
-    QUnit.test('`_.' + methodName + '` should convert symbols to `NaN`', function(assert) {
-      assert.expect(2);
-
-      if (Symbol) {
-        assert.deepEqual(func(0, symbol), NaN);
-        assert.deepEqual(func(symbol, 0), NaN);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should return an unwrapped value when implicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var actual = _(1)[methodName](2);
-        assert.notOk(actual instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var actual = _(1).chain()[methodName](2);
-        assert.ok(actual instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.sumBy');
-
-  (function() {
-    var array = [6, 4, 2],
-        objects = [{ 'a': 2 }, { 'a': 3 }, { 'a': 1 }];
-
-    QUnit.test('should work with an `iteratee` argument', function(assert) {
-      assert.expect(1);
-
-      var actual = _.sumBy(objects, function(object) {
-        return object.a;
-      });
-
-      assert.deepEqual(actual, 6);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.sumBy(array, function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [6]);
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(2);
-
-      var arrays = [[2], [3], [1]];
-      assert.strictEqual(_.sumBy(arrays, 0), 6);
-      assert.strictEqual(_.sumBy(objects, 'a'), 6);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('sum methods');
-
-  lodashStable.each(['sum', 'sumBy'], function(methodName) {
-    var array = [6, 4, 2],
-        func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should return the sum of an array of numbers', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(func(array), 12);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return `0` when passing empty `array` values', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(empties, alwaysZero);
-
-      var actual = lodashStable.map(empties, function(value) {
-        return func(value);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should skip `undefined` values', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(func([1, undefined]), 1);
-    });
-
-    QUnit.test('`_.' + methodName + '` should not skip `NaN` values', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func([1, NaN]), NaN);
-    });
-
-    QUnit.test('`_.' + methodName + '` should not coerce values to numbers', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(func(['1', '2']), '12');
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.tail');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should accept a falsey `array` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysEmptyArray);
-
-      var actual = lodashStable.map(falsey, function(array, index) {
-        try {
-          return index ? _.tail(array) : _.tail();
-        } catch (e) {}
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should exclude the first element', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.tail(array), [2, 3]);
-    });
-
-    QUnit.test('should return an empty when querying empty arrays', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.tail([]), []);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
-          actual = lodashStable.map(array, _.tail);
-
-      assert.deepEqual(actual, [[2, 3], [5, 6], [8, 9]]);
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(4);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE),
-            values = [];
-
-        var actual = _(array).tail().filter(function(value) {
-          values.push(value);
-          return false;
-        })
-        .value();
-
-        assert.deepEqual(actual, []);
-        assert.deepEqual(values, array.slice(1));
-
-        values = [];
-
-        actual = _(array).filter(function(value) {
-          values.push(value);
-          return isEven(value);
-        })
-        .tail()
-        .value();
-
-        assert.deepEqual(actual, _.tail(_.filter(array, isEven)));
-        assert.deepEqual(values, array);
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should not execute subsequent iteratees on an empty array in a lazy sequence', function(assert) {
-      assert.expect(4);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE),
-            iteratee = function() { pass = false; },
-            pass = true,
-            actual = _(array).slice(0, 1).tail().map(iteratee).value();
-
-        assert.ok(pass);
-        assert.deepEqual(actual, []);
-
-        pass = true;
-        actual = _(array).filter().slice(0, 1).tail().map(iteratee).value();
-
-        assert.ok(pass);
-        assert.deepEqual(actual, []);
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.take');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should take the first two elements', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.take(array, 2), [1, 2]);
-    });
-
-    QUnit.test('should treat falsey `n` values, except `undefined`, as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === undefined ? [1] : [];
-      });
-
-      var actual = lodashStable.map(falsey, function(n) {
-        return _.take(array, n);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return an empty array when `n` < `1`', function(assert) {
-      assert.expect(3);
-
-      lodashStable.each([0, -1, -Infinity], function(n) {
-        assert.deepEqual(_.take(array, n), []);
-      });
-    });
-
-    QUnit.test('should return all elements when `n` >= `array.length`', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([3, 4, Math.pow(2, 32), Infinity], function(n) {
-        assert.deepEqual(_.take(array, n), array);
-      });
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
-          actual = lodashStable.map(array, _.take);
-
-      assert.deepEqual(actual, [[1], [4], [7]]);
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(6);
-
-      if (!isNpm) {
-        var array = lodashStable.range(1, LARGE_ARRAY_SIZE + 1),
-            predicate = function(value) { values.push(value); return isEven(value); },
-            values = [],
-            actual = _(array).take(2).take().value();
-
-        assert.deepEqual(actual, _.take(_.take(array, 2)));
-
-        actual = _(array).filter(predicate).take(2).take().value();
-        assert.deepEqual(values, [1, 2]);
-        assert.deepEqual(actual, _.take(_.take(_.filter(array, predicate), 2)));
-
-        actual = _(array).take(6).takeRight(4).take(2).takeRight().value();
-        assert.deepEqual(actual, _.takeRight(_.take(_.takeRight(_.take(array, 6), 4), 2)));
-
-        values = [];
-
-        actual = _(array).take(array.length - 1).filter(predicate).take(6).takeRight(4).take(2).takeRight().value();
-        assert.deepEqual(values, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
-        assert.deepEqual(actual, _.takeRight(_.take(_.takeRight(_.take(_.filter(_.take(array, array.length - 1), predicate), 6), 4), 2)));
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.takeRight');
-
-  (function() {
-    var array = [1, 2, 3];
-
-    QUnit.test('should take the last two elements', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.takeRight(array, 2), [2, 3]);
-    });
-
-    QUnit.test('should treat falsey `n` values, except `undefined`, as `0`', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, function(value) {
-        return value === undefined ? [3] : [];
-      });
-
-      var actual = lodashStable.map(falsey, function(n) {
-        return _.takeRight(array, n);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return an empty array when `n` < `1`', function(assert) {
-      assert.expect(3);
-
-      lodashStable.each([0, -1, -Infinity], function(n) {
-        assert.deepEqual(_.takeRight(array, n), []);
-      });
-    });
-
-    QUnit.test('should return all elements when `n` >= `array.length`', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each([3, 4, Math.pow(2, 32), Infinity], function(n) {
-        assert.deepEqual(_.takeRight(array, n), array);
-      });
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
-          actual = lodashStable.map(array, _.takeRight);
-
-      assert.deepEqual(actual, [[3], [6], [9]]);
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(6);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE),
-            predicate = function(value) { values.push(value); return isEven(value); },
-            values = [],
-            actual = _(array).takeRight(2).takeRight().value();
-
-        assert.deepEqual(actual, _.takeRight(_.takeRight(array)));
-
-        actual = _(array).filter(predicate).takeRight(2).takeRight().value();
-        assert.deepEqual(values, array);
-        assert.deepEqual(actual, _.takeRight(_.takeRight(_.filter(array, predicate), 2)));
-
-        actual = _(array).takeRight(6).take(4).takeRight(2).take().value();
-        assert.deepEqual(actual, _.take(_.takeRight(_.take(_.takeRight(array, 6), 4), 2)));
-
-        values = [];
-
-        actual = _(array).filter(predicate).takeRight(6).take(4).takeRight(2).take().value();
-        assert.deepEqual(values, array);
-        assert.deepEqual(actual, _.take(_.takeRight(_.take(_.takeRight(_.filter(array, predicate), 6), 4), 2)));
-      }
-      else {
-        skipAssert(assert, 6);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.takeRightWhile');
-
-  (function() {
-    var array = [1, 2, 3, 4];
-
-    var objects = [
-      { 'a': 0, 'b': 0 },
-      { 'a': 1, 'b': 1 },
-      { 'a': 2, 'b': 2 }
-    ];
-
-    QUnit.test('should take elements while `predicate` returns truthy', function(assert) {
-      assert.expect(1);
-
-      var actual = _.takeRightWhile(array, function(n) {
-        return n > 2;
-      });
-
-      assert.deepEqual(actual, [3, 4]);
-    });
-
-    QUnit.test('should provide the correct `predicate` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.takeRightWhile(array, function() {
-        args = slice.call(arguments);
-      });
-
-      assert.deepEqual(args, [4, 3, array]);
-    });
-
-    QUnit.test('should work with `_.matches` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.takeRightWhile(objects, { 'b': 2 }), objects.slice(2));
-    });
-
-    QUnit.test('should work with `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.takeRightWhile(objects, ['b', 2]), objects.slice(2));
-    });
-
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.takeRightWhile(objects, 'b'), objects.slice(1));
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(3);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE),
-            predicate = function(n) { return n > 2; },
-            expected = _.takeRightWhile(array, predicate),
-            wrapped = _(array).takeRightWhile(predicate);
-
-        assert.deepEqual(wrapped.value(), expected);
-        assert.deepEqual(wrapped.reverse().value(), expected.slice().reverse());
-        assert.strictEqual(wrapped.last(), _.last(expected));
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should provide the correct `predicate` arguments in a lazy sequence', function(assert) {
-      assert.expect(5);
-
-      if (!isNpm) {
-        var args,
-            array = lodashStable.range(LARGE_ARRAY_SIZE + 1),
-            expected = [square(LARGE_ARRAY_SIZE), LARGE_ARRAY_SIZE - 1, lodashStable.map(array.slice(1), square)];
-
-        _(array).slice(1).takeRightWhile(function(value, index, array) {
-          args = slice.call(arguments);
-        }).value();
-
-        assert.deepEqual(args, [LARGE_ARRAY_SIZE, LARGE_ARRAY_SIZE - 1, array.slice(1)]);
-
-        _(array).slice(1).map(square).takeRightWhile(function(value, index, array) {
-          args = slice.call(arguments);
-        }).value();
-
-        assert.deepEqual(args, expected);
-
-        _(array).slice(1).map(square).takeRightWhile(function(value, index) {
-          args = slice.call(arguments);
-        }).value();
-
-        assert.deepEqual(args, expected);
-
-        _(array).slice(1).map(square).takeRightWhile(function(index) {
-          args = slice.call(arguments);
-        }).value();
-
-        assert.deepEqual(args, [square(LARGE_ARRAY_SIZE)]);
-
-        _(array).slice(1).map(square).takeRightWhile(function() {
-          args = slice.call(arguments);
-        }).value();
-
-        assert.deepEqual(args, expected);
-      }
-      else {
-        skipAssert(assert, 5);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.takeWhile');
-
-  (function() {
-    var array = [1, 2, 3, 4];
-
-    var objects = [
-      { 'a': 2, 'b': 2 },
-      { 'a': 1, 'b': 1 },
-      { 'a': 0, 'b': 0 }
-    ];
-
-    QUnit.test('should take elements while `predicate` returns truthy', function(assert) {
-      assert.expect(1);
-
-      var actual = _.takeWhile(array, function(n) {
-        return n < 3;
-      });
-
-      assert.deepEqual(actual, [1, 2]);
-    });
-
-    QUnit.test('should provide the correct `predicate` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.takeWhile(array, function() {
-        args = slice.call(arguments);
-      });
-
-      assert.deepEqual(args, [1, 0, array]);
-    });
-
-    QUnit.test('should work with `_.matches` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.takeWhile(objects, { 'b': 2 }), objects.slice(0, 1));
-    });
-
-    QUnit.test('should work with `_.matchesProperty` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.takeWhile(objects, ['b', 2]), objects.slice(0, 1));
-    });
-    QUnit.test('should work with `_.property` shorthands', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.takeWhile(objects, 'b'), objects.slice(0, 2));
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(3);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE),
-            predicate = function(n) { return n < 3; },
-            expected = _.takeWhile(array, predicate),
-            wrapped = _(array).takeWhile(predicate);
-
-        assert.deepEqual(wrapped.value(), expected);
-        assert.deepEqual(wrapped.reverse().value(), expected.slice().reverse());
-        assert.strictEqual(wrapped.last(), _.last(expected));
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should work in a lazy sequence with `take`', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE);
-
-        var actual = _(array)
-          .takeWhile(function(n) { return n < 4; })
-          .take(2)
-          .takeWhile(function(n) { return n == 0; })
-          .value();
-
-        assert.deepEqual(actual, [0]);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should provide the correct `predicate` arguments in a lazy sequence', function(assert) {
-      assert.expect(5);
-
-      if (!isNpm) {
-        var args,
-            array = lodashStable.range(LARGE_ARRAY_SIZE + 1),
-            expected = [1, 0, lodashStable.map(array.slice(1), square)];
-
-        _(array).slice(1).takeWhile(function(value, index, array) {
-          args = slice.call(arguments);
-        }).value();
-
-        assert.deepEqual(args, [1, 0, array.slice(1)]);
-
-        _(array).slice(1).map(square).takeWhile(function(value, index, array) {
-          args = slice.call(arguments);
-        }).value();
-
-        assert.deepEqual(args, expected);
-
-        _(array).slice(1).map(square).takeWhile(function(value, index) {
-          args = slice.call(arguments);
-        }).value();
-
-        assert.deepEqual(args, expected);
-
-        _(array).slice(1).map(square).takeWhile(function(value) {
-          args = slice.call(arguments);
-        }).value();
-
-        assert.deepEqual(args, [1]);
-
-        _(array).slice(1).map(square).takeWhile(function() {
-          args = slice.call(arguments);
-        }).value();
-
-        assert.deepEqual(args, expected);
-      }
-      else {
-        skipAssert(assert, 5);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.tap');
-
-  (function() {
-    QUnit.test('should intercept and return the given value', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var intercepted,
-            array = [1, 2, 3];
-
-        var actual = _.tap(array, function(value) {
-          intercepted = value;
-        });
-
-        assert.strictEqual(actual, array);
-        assert.strictEqual(intercepted, array);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should intercept unwrapped values and return wrapped values when chaining', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var intercepted,
-            array = [1, 2, 3];
-
-        var wrapped = _(array).tap(function(value) {
-          intercepted = value;
-          value.pop();
-        });
-
-        assert.ok(wrapped instanceof _);
-
-        wrapped.value();
-        assert.strictEqual(intercepted, array);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.template');
-
-  (function() {
-    QUnit.test('should escape values in "escape" delimiters', function(assert) {
-      assert.expect(1);
-
-      var strings = ['<p><%- value %></p>', '<p><%-value%></p>', '<p><%-\nvalue\n%></p>'],
-          expected = lodashStable.map(strings, lodashStable.constant('<p>&amp;&lt;&gt;&quot;&#39;&#96;\/</p>')),
-          data = { 'value': '&<>"\'`\/' };
-
-      var actual = lodashStable.map(strings, function(string) {
-        return _.template(string)(data);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should not reference `_.escape` when "escape" delimiters are not used', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<%= typeof __e %>');
-      assert.strictEqual(compiled({}), 'undefined');
-    });
-
-    QUnit.test('should evaluate JavaScript in "evaluate" delimiters', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template(
-        '<ul><%\
-        for (var key in collection) {\
-          %><li><%= collection[key] %></li><%\
-        } %></ul>'
-      );
-
-      var data = { 'collection': { 'a': 'A', 'b': 'B' } },
-          actual = compiled(data);
-
-      assert.strictEqual(actual, '<ul><li>A</li><li>B</li></ul>');
-    });
-
-    QUnit.test('should support "evaluate" delimiters with single line comments (test production builds)', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<% // A code comment. %><% if (value) { %>yap<% } else { %>nope<% } %>'),
-          data = { 'value': true };
-
-      assert.strictEqual(compiled(data), 'yap');
-    });
-
-    QUnit.test('should support referencing variables declared in "evaluate" delimiters from other delimiters', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<% var b = a; %><%= b.value %>'),
-          data = { 'a': { 'value': 1 } };
-
-      assert.strictEqual(compiled(data), '1');
-    });
-
-    QUnit.test('should interpolate data properties in "interpolate" delimiters', function(assert) {
-      assert.expect(1);
-
-      var strings = ['<%= a %>BC', '<%=a%>BC', '<%=\na\n%>BC'],
-          expected = lodashStable.map(strings, lodashStable.constant('ABC')),
-          data = { 'a': 'A' };
-
-      var actual = lodashStable.map(strings, function(string) {
-        return _.template(string)(data);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should support "interpolate" delimiters with escaped values', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<%= a ? "a=\\"A\\"" : "" %>'),
-          data = { 'a': true };
-
-      assert.strictEqual(compiled(data), 'a="A"');
-    });
-
-    QUnit.test('should support "interpolate" delimiters containing ternary operators', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<%= value ? value : "b" %>'),
-          data = { 'value': 'a' };
-
-      assert.strictEqual(compiled(data), 'a');
-    });
-
-    QUnit.test('should support "interpolate" delimiters containing global values', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<%= typeof Math.abs %>');
-
-      try {
-        var actual = compiled();
-      } catch (e) {}
-
-      assert.strictEqual(actual, 'function');
-    });
-
-    QUnit.test('should support complex "interpolate" delimiters', function(assert) {
-      assert.expect(22);
-
-      lodashStable.forOwn({
-        '<%= a + b %>': '3',
-        '<%= b - a %>': '1',
-        '<%= a = b %>': '2',
-        '<%= !a %>': 'false',
-        '<%= ~a %>': '-2',
-        '<%= a * b %>': '2',
-        '<%= a / b %>': '0.5',
-        '<%= a % b %>': '1',
-        '<%= a >> b %>': '0',
-        '<%= a << b %>': '4',
-        '<%= a & b %>': '0',
-        '<%= a ^ b %>': '3',
-        '<%= a | b %>': '3',
-        '<%= {}.toString.call(0) %>': numberTag,
-        '<%= a.toFixed(2) %>': '1.00',
-        '<%= obj["a"] %>': '1',
-        '<%= delete a %>': 'true',
-        '<%= "a" in obj %>': 'true',
-        '<%= obj instanceof Object %>': 'true',
-        '<%= new Boolean %>': 'false',
-        '<%= typeof a %>': 'number',
-        '<%= void a %>': ''
-      },
-      function(value, key) {
-        var compiled = _.template(key),
-            data = { 'a': 1, 'b': 2 };
-
-        assert.strictEqual(compiled(data), value, key);
-      });
-    });
-
-    QUnit.test('should support ES6 template delimiters', function(assert) {
-      assert.expect(2);
-
-      var data = { 'value': 2 };
-      assert.strictEqual(_.template('1${value}3')(data), '123');
-      assert.strictEqual(_.template('${"{" + value + "\\}"}')(data), '{2}');
-    });
-
-    QUnit.test('should support the "imports" option', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<%= a %>', { 'imports': { 'a': 1 } });
-      assert.strictEqual(compiled({}), '1');
-    });
-
-    QUnit.test('should support the "variable" options', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template(
-        '<% _.each( data.a, function( value ) { %>' +
-            '<%= value.valueOf() %>' +
-        '<% }) %>', { 'variable': 'data' }
-      );
-
-      var data = { 'a': [1, 2, 3] };
-
-      try {
-        assert.strictEqual(compiled(data), '123');
-      } catch (e) {
-        assert.ok(false, e.message);
-      }
-    });
-
-    QUnit.test('should support custom delimiters', function(assert) {
-      assert.expect(2);
-
-      lodashStable.times(2, function(index) {
-        var settingsClone = lodashStable.clone(_.templateSettings);
-
-        var settings = lodashStable.assign(index ? _.templateSettings : {}, {
-          'escape': /\{\{-([\s\S]+?)\}\}/g,
-          'evaluate': /\{\{([\s\S]+?)\}\}/g,
-          'interpolate': /\{\{=([\s\S]+?)\}\}/g
-        });
-
-        var expected = '<ul><li>0: a &amp; A</li><li>1: b &amp; B</li></ul>',
-            compiled = _.template('<ul>{{ _.each(collection, function(value, index) {}}<li>{{= index }}: {{- value }}</li>{{}); }}</ul>', index ? null : settings),
-            data = { 'collection': ['a & A', 'b & B'] };
-
-        assert.strictEqual(compiled(data), expected);
-        lodashStable.assign(_.templateSettings, settingsClone);
-      });
-    });
-
-    QUnit.test('should support custom delimiters containing special characters', function(assert) {
-      assert.expect(2);
-
-      lodashStable.times(2, function(index) {
-        var settingsClone = lodashStable.clone(_.templateSettings);
-
-        var settings = lodashStable.assign(index ? _.templateSettings : {}, {
-          'escape': /<\?-([\s\S]+?)\?>/g,
-          'evaluate': /<\?([\s\S]+?)\?>/g,
-          'interpolate': /<\?=([\s\S]+?)\?>/g
-        });
-
-        var expected = '<ul><li>0: a &amp; A</li><li>1: b &amp; B</li></ul>',
-            compiled = _.template('<ul><? _.each(collection, function(value, index) { ?><li><?= index ?>: <?- value ?></li><? }); ?></ul>', index ? null : settings),
-            data = { 'collection': ['a & A', 'b & B'] };
-
-        assert.strictEqual(compiled(data), expected);
-        lodashStable.assign(_.templateSettings, settingsClone);
-      });
-    });
-
-    QUnit.test('should use a `with` statement by default', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<%= index %><%= collection[index] %><% _.each(collection, function(value, index) { %><%= index %><% }); %>'),
-          actual = compiled({ 'index': 1, 'collection': ['a', 'b', 'c'] });
-
-      assert.strictEqual(actual, '1b012');
-    });
-
-    QUnit.test('should use `_.templateSettings.imports._.templateSettings`', function(assert) {
-      assert.expect(1);
-
-      var lodash = _.templateSettings.imports._,
-          settingsClone = lodashStable.clone(lodash.templateSettings);
-
-      lodash.templateSettings = lodashStable.assign(lodash.templateSettings, {
-        'interpolate': /\{\{=([\s\S]+?)\}\}/g
-      });
-
-      var compiled = _.template('{{= a }}');
-      assert.strictEqual(compiled({ 'a': 1 }), '1');
-
-      if (settingsClone) {
-        lodashStable.assign(lodash.templateSettings, settingsClone);
-      } else {
-        delete lodash.templateSettings;
-      }
-    });
-
-    QUnit.test('should fallback to `_.templateSettings`', function(assert) {
-      assert.expect(1);
-
-      var lodash = _.templateSettings.imports._,
-          delimiter = _.templateSettings.interpolate;
-
-      _.templateSettings.imports._ = { 'escape': lodashStable.escape };
-      _.templateSettings.interpolate = /\{\{=([\s\S]+?)\}\}/g;
-
-      var compiled = _.template('{{= a }}');
-      assert.strictEqual(compiled({ 'a': 1 }), '1');
-
-      _.templateSettings.imports._ = lodash;
-      _.templateSettings.interpolate = delimiter;
-    });
-
-    QUnit.test('should ignore `null` delimiters', function(assert) {
-      assert.expect(3);
-
-      var delimiter = {
-        'escape': /\{\{-([\s\S]+?)\}\}/g,
-        'evaluate': /\{\{([\s\S]+?)\}\}/g,
-        'interpolate': /\{\{=([\s\S]+?)\}\}/g
-      };
-
-      lodashStable.forOwn({
-        'escape': '{{- a }}',
-        'evaluate': '{{ print(a) }}',
-        'interpolate': '{{= a }}'
-      },
-      function(value, key) {
-        var settings = { 'escape': null, 'evaluate': null, 'interpolate': null };
-        settings[key] = delimiter[key];
-
-        var expected = '1 <%- a %> <% print(a) %> <%= a %>',
-            compiled = _.template(value + ' <%- a %> <% print(a) %> <%= a %>', settings),
-            data = { 'a': 1 };
-
-        assert.strictEqual(compiled(data), expected);
-      });
-    });
-
-    QUnit.test('should work without delimiters', function(assert) {
-      assert.expect(1);
-
-      var expected = 'abc';
-      assert.strictEqual(_.template(expected)({}), expected);
-    });
-
-    QUnit.test('should work with `this` references', function(assert) {
-      assert.expect(2);
-
-      var compiled = _.template('a<%= this.String("b") %>c');
-      assert.strictEqual(compiled(), 'abc');
-
-      var object = { 'b': 'B' };
-      object.compiled = _.template('A<%= this.b %>C', { 'variable': 'obj' });
-      assert.strictEqual(object.compiled(), 'ABC');
-    });
-
-    QUnit.test('should work with backslashes', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<%= a %> \\b'),
-          data = { 'a': 'A' };
-
-      assert.strictEqual(compiled(data), 'A \\b');
-    });
-
-    QUnit.test('should work with escaped characters in string literals', function(assert) {
-      assert.expect(2);
-
-      var compiled = _.template('<% print("\'\\n\\r\\t\\u2028\\u2029\\\\") %>');
-      assert.strictEqual(compiled(), "'\n\r\t\u2028\u2029\\");
-
-      var data = { 'a': 'A' };
-      compiled = _.template('\'\n\r\t<%= a %>\u2028\u2029\\"');
-      assert.strictEqual(compiled(data), '\'\n\r\tA\u2028\u2029\\"');
-    });
-
-    QUnit.test('should handle \\u2028 & \\u2029 characters', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('\u2028<%= "\\u2028\\u2029" %>\u2029');
-      assert.strictEqual(compiled(), '\u2028\u2028\u2029\u2029');
-    });
-
-    QUnit.test('should work with statements containing quotes', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template("<%\
-        if (a == 'A' || a == \"a\") {\
-          %>'a',\"A\"<%\
-        } %>"
-      );
-
-      var data = { 'a': 'A' };
-      assert.strictEqual(compiled(data), "'a',\"A\"");
-    });
-
-    QUnit.test('should work with templates containing newlines and comments', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<%\n\
-        // A code comment.\n\
-        if (value) { value += 3; }\n\
-        %><p><%= value %></p>'
-      );
-
-      assert.strictEqual(compiled({ 'value': 3 }), '<p>6</p>');
-    });
-
-    QUnit.test('should not error with IE conditional comments enabled (test with development build)', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template(''),
-          pass = true;
-
-      /*@cc_on @*/
-      try {
-        compiled();
-      } catch (e) {
-        pass = false;
-      }
-      assert.ok(pass);
-    });
-
-    QUnit.test('should tokenize delimiters', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<span class="icon-<%= type %>2"></span>'),
-          data = { 'type': 1 };
-
-      assert.strictEqual(compiled(data), '<span class="icon-12"></span>');
-    });
-
-    QUnit.test('should evaluate delimiters once', function(assert) {
-      assert.expect(1);
-
-      var actual = [],
-          compiled = _.template('<%= func("a") %><%- func("b") %><% func("c") %>'),
-          data = { 'func': function(value) { actual.push(value); } };
-
-      compiled(data);
-      assert.deepEqual(actual, ['a', 'b', 'c']);
-    });
-
-    QUnit.test('should match delimiters before escaping text', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<<\n a \n>>', { 'evaluate': /<<(.*?)>>/g });
-      assert.strictEqual(compiled(), '<<\n a \n>>');
-    });
-
-    QUnit.test('should resolve nullish values to an empty string', function(assert) {
-      assert.expect(3);
-
-      var compiled = _.template('<%= a %><%- a %>'),
-          data = { 'a': null };
-
-      assert.strictEqual(compiled(data), '');
-
-      data = { 'a': undefined };
-      assert.strictEqual(compiled(data), '');
-
-      data = { 'a': {} };
-      compiled = _.template('<%= a.b %><%- a.b %>');
-      assert.strictEqual(compiled(data), '');
-    });
-
-    QUnit.test('should return an empty string for empty values', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined, ''],
-          expected = lodashStable.map(values, alwaysEmptyString),
-          data = { 'a': 1 };
-
-      var actual = lodashStable.map(values, function(value, index) {
-        var compiled = index ? _.template(value) : _.template();
-        return compiled(data);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should parse delimiters without newlines', function(assert) {
-      assert.expect(1);
-
-      var expected = '<<\nprint("<p>" + (value ? "yes" : "no") + "</p>")\n>>',
-          compiled = _.template(expected, { 'evaluate': /<<(.+?)>>/g }),
-          data = { 'value': true };
-
-      assert.strictEqual(compiled(data), expected);
-    });
-
-    QUnit.test('should support recursive calls', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('<%= a %><% a = _.template(c)(obj) %><%= a %>'),
-          data = { 'a': 'A', 'b': 'B', 'c': '<%= b %>' };
-
-      assert.strictEqual(compiled(data), 'AB');
-    });
-
-    QUnit.test('should coerce `text` argument to a string', function(assert) {
-      assert.expect(1);
-
-      var object = { 'toString': lodashStable.constant('<%= a %>') },
-          data = { 'a': 1 };
-
-      assert.strictEqual(_.template(object)(data), '1');
-    });
-
-    QUnit.test('should not modify the `options` object', function(assert) {
-      assert.expect(1);
-
-      var options = {};
-      _.template('', options);
-      assert.deepEqual(options, {});
-    });
-
-    QUnit.test('should not modify `_.templateSettings` when `options` are given', function(assert) {
-      assert.expect(2);
-
-      var data = { 'a': 1 };
-
-      assert.notOk('a' in _.templateSettings);
-      _.template('', {}, data);
-      assert.notOk('a' in _.templateSettings);
-
-      delete _.templateSettings.a;
-    });
-
-    QUnit.test('should not error for non-object `data` and `options` values', function(assert) {
-      assert.expect(2);
-
-      var pass = true;
-
-      try {
-        _.template('')(1);
-      } catch (e) {
-        pass = false;
-      }
-      assert.ok(pass, '`data` value');
-
-      pass = true;
-
-      try {
-        _.template('', 1)(1);
-      } catch (e) {
-        pass = false;
-      }
-      assert.ok(pass, '`options` value');
-    });
-
-    QUnit.test('should expose the source on compiled templates', function(assert) {
-      assert.expect(1);
-
-      var compiled = _.template('x'),
-          values = [String(compiled), compiled.source],
-          expected = lodashStable.map(values, alwaysTrue);
-
-      var actual = lodashStable.map(values, function(value) {
-        return lodashStable.includes(value, '__p');
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should expose the source on SyntaxErrors', function(assert) {
-      assert.expect(1);
-
-      try {
-        _.template('<% if x %>');
-      } catch (e) {
-        var source = e.source;
-      }
-      assert.ok(lodashStable.includes(source, '__p'));
-    });
-
-    QUnit.test('should not include sourceURLs in the source', function(assert) {
-      assert.expect(1);
-
-      var options = { 'sourceURL': '/a/b/c' },
-          compiled = _.template('x', options),
-          values = [compiled.source, undefined];
-
-      try {
-        _.template('<% if x %>', options);
-      } catch (e) {
-        values[1] = e.source;
-      }
-      var expected = lodashStable.map(values, alwaysFalse);
-
-      var actual = lodashStable.map(values, function(value) {
-        return lodashStable.includes(value, 'sourceURL');
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = ['<%= a %>', '<%- b %>', '<% print(c) %>'],
-          compiles = lodashStable.map(array, _.template),
-          data = { 'a': 'one', 'b': '`two`', 'c': 'three' };
-
-      var actual = lodashStable.map(compiles, function(compiled) {
-        return compiled(data);
-      });
-
-      assert.deepEqual(actual, ['one', '&#96;two&#96;', 'three']);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.truncate');
-
-  (function() {
-    var string = 'hi-diddly-ho there, neighborino';
-
-    QUnit.test('should use a default `length` of `30`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.truncate(string), 'hi-diddly-ho there, neighbo...');
-    });
-
-    QUnit.test('should not truncate if `string` is <= `length`', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.truncate(string, { 'length': string.length }), string);
-      assert.strictEqual(_.truncate(string, { 'length': string.length + 2 }), string);
-    });
-
-    QUnit.test('should truncate string the given length', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.truncate(string, { 'length': 24 }), 'hi-diddly-ho there, n...');
-    });
-
-    QUnit.test('should support a `omission` option', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.truncate(string, { 'omission': ' [...]' }), 'hi-diddly-ho there, neig [...]');
-    });
-
-    QUnit.test('should coerce nullish `omission` values to strings', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.truncate(string, { 'omission': null }), 'hi-diddly-ho there, neighbnull');
-      assert.strictEqual(_.truncate(string, { 'omission': undefined }), 'hi-diddly-ho there, nundefined');
-    });
-
-    QUnit.test('should support a `length` option', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.truncate(string, { 'length': 4 }), 'h...');
-    });
-
-    QUnit.test('should support a `separator` option', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.truncate(string, { 'length': 24, 'separator': ' ' }), 'hi-diddly-ho there,...');
-      assert.strictEqual(_.truncate(string, { 'length': 24, 'separator': /,? +/ }), 'hi-diddly-ho there...');
-      assert.strictEqual(_.truncate(string, { 'length': 24, 'separator': /,? +/g }), 'hi-diddly-ho there...');
-    });
-
-    QUnit.test('should treat negative `length` as `0`', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each([0, -2], function(length) {
-        assert.strictEqual(_.truncate(string, { 'length': length }), '...');
-      });
-    });
-
-    QUnit.test('should coerce `length` to an integer', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each(['', NaN, 4.6, '4'], function(length, index) {
-        var actual = index > 1 ? 'h...' : '...';
-        assert.strictEqual(_.truncate(string, { 'length': { 'valueOf': lodashStable.constant(length) } }), actual);
-      });
-    });
-
-    QUnit.test('should coerce `string` to a string', function(assert) {
-      assert.expect(2);
-
-      assert.strictEqual(_.truncate(Object(string), { 'length': 4 }), 'h...');
-      assert.strictEqual(_.truncate({ 'toString': lodashStable.constant(string) }, { 'length': 5 }), 'hi...');
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map([string, string, string], _.truncate),
-          truncated = 'hi-diddly-ho there, neighbo...';
-
-      assert.deepEqual(actual, [truncated, truncated, truncated]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.throttle');
-
-  (function() {
-    QUnit.test('should throttle a function', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var callCount = 0,
-          throttled = _.throttle(function() { callCount++; }, 32);
-
-      throttled();
-      throttled();
-      throttled();
-
-      var lastCount = callCount;
-      assert.ok(callCount > 0);
-
-      setTimeout(function() {
-        assert.ok(callCount > lastCount);
-        done();
-      }, 64);
-    });
-
-    QUnit.test('subsequent calls should return the result of the first call', function(assert) {
-      assert.expect(5);
-
-      var done = assert.async();
-
-      var throttled = _.throttle(identity, 32),
-          result = [throttled('a'), throttled('b')];
-
-      assert.deepEqual(result, ['a', 'a']);
-
-      setTimeout(function() {
-        var result = [throttled('x'), throttled('y')];
-        assert.notEqual(result[0], 'a');
-        assert.notStrictEqual(result[0], undefined);
-
-        assert.notEqual(result[1], 'y');
-        assert.notStrictEqual(result[1], undefined);
-        done();
-      }, 64);
-    });
-
-    QUnit.test('should clear timeout when `func` is called', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      if (!isModularize) {
-        var callCount = 0,
-            dateCount = 0;
-
-        var getTime = function() {
-          return ++dateCount == 5
-            ? Infinity
-            : +new Date;
-        };
-
-        var lodash = _.runInContext(lodashStable.assign({}, root, {
-          'Date': lodashStable.assign(function() {
-            return { 'getTime': getTime };
-          }, {
-            'now': Date.now
-          })
-        }));
-
-        var throttled = lodash.throttle(function() { callCount++; }, 32);
-
-        throttled();
-        throttled();
-
-        setTimeout(function() {
-          assert.strictEqual(callCount, 2);
-          done();
-        }, 64);
-      }
-      else {
-        skipAssert(assert);
-        done();
-      }
-    });
-
-    QUnit.test('should not trigger a trailing call when invoked once', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var callCount = 0,
-          throttled = _.throttle(function() { callCount++; }, 32);
-
-      throttled();
-      assert.strictEqual(callCount, 1);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 1);
-        done();
-      }, 64);
-    });
-
-    lodashStable.times(2, function(index) {
-      QUnit.test('should trigger a call when invoked repeatedly' + (index ? ' and `leading` is `false`' : ''), function(assert) {
-        assert.expect(1);
-
-        var done = assert.async();
-
-        var callCount = 0,
-            limit = (argv || isPhantom) ? 1000 : 320,
-            options = index ? { 'leading': false } : {},
-            throttled = _.throttle(function() { callCount++; }, 32, options);
-
-        var start = +new Date;
-        while ((new Date - start) < limit) {
-          throttled();
-        }
-        var actual = callCount > 1;
-        setTimeout(function() {
-          assert.ok(actual);
-          done();
-        }, 1);
-      });
-    });
-
-    QUnit.test('should trigger a second throttled call as soon as possible', function(assert) {
-      assert.expect(3);
-
-      var done = assert.async();
-
-      var callCount = 0;
-
-      var throttled = _.throttle(function() {
-        callCount++;
-      }, 128, { 'leading': false });
-
-      throttled();
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 1);
-        throttled();
-      }, 192);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 1);
-      }, 254);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 2);
-        done();
-      }, 384);
-    });
-
-    QUnit.test('should apply default options', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var callCount = 0,
-          throttled = _.throttle(function() { callCount++; }, 32, {});
-
-      throttled();
-      throttled();
-      assert.strictEqual(callCount, 1);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 2);
-        done();
-      }, 128);
-    });
-
-    QUnit.test('should support a `leading` option', function(assert) {
-      assert.expect(2);
-
-      var withLeading = _.throttle(identity, 32, { 'leading': true });
-      assert.strictEqual(withLeading('a'), 'a');
-
-      var withoutLeading = _.throttle(identity, 32, { 'leading': false });
-      assert.strictEqual(withoutLeading('a'), undefined);
-    });
-
-    QUnit.test('should support a `trailing` option', function(assert) {
-      assert.expect(6);
-
-      var done = assert.async();
-
-      var withCount = 0,
-          withoutCount = 0;
-
-      var withTrailing = _.throttle(function(value) {
-        withCount++;
-        return value;
-      }, 64, { 'trailing': true });
-
-      var withoutTrailing = _.throttle(function(value) {
-        withoutCount++;
-        return value;
-      }, 64, { 'trailing': false });
-
-      assert.strictEqual(withTrailing('a'), 'a');
-      assert.strictEqual(withTrailing('b'), 'a');
-
-      assert.strictEqual(withoutTrailing('a'), 'a');
-      assert.strictEqual(withoutTrailing('b'), 'a');
-
-      setTimeout(function() {
-        assert.strictEqual(withCount, 2);
-        assert.strictEqual(withoutCount, 1);
-        done();
-      }, 256);
-    });
-
-    QUnit.test('should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      var callCount = 0;
-
-      var throttled = _.throttle(function() {
-        callCount++;
-      }, 64, { 'trailing': false });
-
-      throttled();
-      throttled();
-
-      setTimeout(function() {
-        throttled();
-        throttled();
-      }, 96);
-
-      setTimeout(function() {
-        assert.ok(callCount > 1);
-        done();
-      }, 192);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.debounce and lodash.throttle');
-
-  lodashStable.each(['debounce', 'throttle'], function(methodName) {
-    var func = _[methodName],
-        isDebounce = methodName == 'debounce';
-
-    QUnit.test('`_.' + methodName + '` should not error for non-object `options` values', function(assert) {
-      assert.expect(1);
-
-      var pass = true;
-
-      try {
-        func(noop, 32, 1);
-      } catch (e) {
-        pass = false;
-      }
-      assert.ok(pass);
-    });
-
-    QUnit.test('`_.' + methodName + '` should use a default `wait` of `0`', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      var callCount = 0,
-          funced = func(function() { callCount++; });
-
-      funced();
-
-      setTimeout(function() {
-        funced();
-        assert.strictEqual(callCount, isDebounce ? 1 : 2);
-        done();
-      }, 32);
-    });
-
-    QUnit.test('`_.' + methodName + '` should invoke `func` with the correct `this` binding', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      var actual = [],
-          object = { 'funced': func(function() { actual.push(this); }, 32) },
-          expected = lodashStable.times(isDebounce ? 1 : 2, lodashStable.constant(object));
-
-      object.funced();
-      if (!isDebounce) {
-        object.funced();
-      }
-      setTimeout(function() {
-        assert.deepEqual(actual, expected);
-        done();
-      }, 64);
-    });
-
-    QUnit.test('`_.' + methodName + '` supports recursive calls', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var actual = [],
-          args = lodashStable.map(['a', 'b', 'c'], function(chr) { return [{}, chr]; }),
-          expected = args.slice(),
-          queue = args.slice();
-
-      var funced = func(function() {
-        var current = [this];
-        push.apply(current, arguments);
-        actual.push(current);
-
-        var next = queue.shift();
-        if (next) {
-          funced.call(next[0], next[1]);
-        }
-      }, 32);
-
-      var next = queue.shift();
-      funced.call(next[0], next[1]);
-      assert.deepEqual(actual, expected.slice(0, isDebounce ? 0 : 1));
-
-      setTimeout(function() {
-        assert.deepEqual(actual, expected.slice(0, actual.length));
-        done();
-      }, 256);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work if the system time is set backwards', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      if (!isModularize) {
-        var callCount = 0,
-            dateCount = 0;
-
-        var getTime = function() {
-          return ++dateCount === 4
-            ? +new Date(2012, 3, 23, 23, 27, 18)
-            : +new Date;
-        };
-
-        var lodash = _.runInContext(lodashStable.assign({}, root, {
-          'Date': lodashStable.assign(function() {
-            return { 'getTime': getTime, 'valueOf': getTime };
-          }, {
-            'now': Date.now
-          })
-        }));
-
-        var funced = lodash[methodName](function() {
-          callCount++;
-        }, 32);
-
-        funced();
-
-        setTimeout(function() {
-          funced();
-          assert.strictEqual(callCount, isDebounce ? 1 : 2);
-          done();
-        }, 64);
-      }
-      else {
-        skipAssert(assert);
-        done();
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should support cancelling delayed calls', function(assert) {
-      assert.expect(1);
-
-      var done = assert.async();
-
-      var callCount = 0;
-
-      var funced = func(function() {
-        callCount++;
-      }, 32, { 'leading': false });
-
-      funced();
-      funced.cancel();
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 0);
-        done();
-      }, 64);
-    });
-
-    QUnit.test('`_.' + methodName + '` should reset `lastCalled` after cancelling', function(assert) {
-      assert.expect(3);
-
-      var done = assert.async();
-
-      var callCount = 0;
-
-      var funced = func(function() {
-        return ++callCount;
-      }, 32, { 'leading': true });
-
-      assert.strictEqual(funced(), 1);
-      funced.cancel();
-
-      assert.strictEqual(funced(), 2);
-      funced();
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 3);
-        done();
-      }, 64);
-    });
-
-    QUnit.test('`_.' + methodName + '` should support flushing delayed calls', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var callCount = 0;
-
-      var funced = func(function() {
-        return ++callCount;
-      }, 32, { 'leading': false });
-
-      funced();
-      assert.strictEqual(funced.flush(), 1);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 1);
-        done();
-      }, 64);
-    });
-
-    QUnit.test('`_.' + methodName + '` should noop `cancel` and `flush` when nothing is queued', function(assert) {
-      assert.expect(2);
-
-      var done = assert.async();
-
-      var callCount = 0,
-          funced = func(function() { callCount++; }, 32);
-
-      funced.cancel();
-      assert.strictEqual(funced.flush(), undefined);
-
-      setTimeout(function() {
-        assert.strictEqual(callCount, 0);
-        done();
-      }, 64);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.times');
-
-  (function() {
-    QUnit.test('should coerce non-finite `n` values to `0`', function(assert) {
-      assert.expect(3);
-
-      lodashStable.each([-Infinity, NaN, Infinity], function(n) {
-        assert.deepEqual(_.times(n), []);
-      });
-    });
-
-    QUnit.test('should coerce `n` to an integer', function(assert) {
-      assert.expect(1);
-
-      var actual = _.times(2.6, _.indentify);
-      assert.deepEqual(actual, [0, 1]);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.times(1, function(assert) {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [0]);
-    });
-
-    QUnit.test('should use `_.identity` when `iteratee` is nullish', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant([0, 1, 2]));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.times(3, value) : _.times(3);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return an array of the results of each `iteratee` execution', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.times(3, doubled), [0, 2, 4]);
-    });
-
-    QUnit.test('should return an empty array for falsey and negative `n` arguments', function(assert) {
-      assert.expect(1);
-
-      var values = falsey.concat(-1, -Infinity),
-          expected = lodashStable.map(values, alwaysEmptyArray);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.times(value) : _.times();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should return an unwrapped value when implicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.deepEqual(_(3).times(), [0, 1, 2]);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        assert.ok(_(3).chain().times() instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.toArray');
-
-  (function() {
-    QUnit.test('should convert objects to arrays', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(_.toArray({ 'a': 1, 'b': 2 }), [1, 2]);
-    });
-
-    QUnit.test('should convert strings to arrays', function(assert) {
-      assert.expect(3);
-
-      assert.deepEqual(_.toArray(''), []);
-      assert.deepEqual(_.toArray('ab'), ['a', 'b']);
-      assert.deepEqual(_.toArray(Object('ab')), ['a', 'b']);
-    });
-
-    QUnit.test('should convert iterables to arrays', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm && Symbol && Symbol.iterator) {
-        var object = { '0': 'a', 'length': 1 };
-        object[Symbol.iterator] = arrayProto[Symbol.iterator];
-
-        assert.deepEqual(_.toArray(object), ['a']);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should work in a lazy sequence', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE + 1),
-            actual = _(array).slice(1).map(String).toArray().value();
-
-        assert.deepEqual(actual, lodashStable.map(array.slice(1), String));
-
-        var object = lodashStable.zipObject(lodashStable.times(LARGE_ARRAY_SIZE, function(index) {
-          return ['key' + index, index];
-        }));
-
-        actual = _(object).toArray().slice(1).map(String).value();
-        assert.deepEqual(actual, _.map(_.toArray(object).slice(1), String));
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.toLower');
-
-  (function() {
-    QUnit.test('should convert whole string to lower case', function(assert) {
-      assert.expect(3);
-
-      assert.deepEqual(_.toLower('--Foo-Bar--'), '--foo-bar--');
-      assert.deepEqual(_.toLower('fooBar'), 'foobar');
-      assert.deepEqual(_.toLower('__FOO_BAR__'), '__foo_bar__');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.toUpper');
-
-  (function() {
-    QUnit.test('should convert whole string to upper case', function(assert) {
-      assert.expect(3);
-
-      assert.deepEqual(_.toUpper('--Foo-Bar'), '--FOO-BAR');
-      assert.deepEqual(_.toUpper('fooBar'), 'FOOBAR');
-      assert.deepEqual(_.toUpper('__FOO_BAR__'), '__FOO_BAR__');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.slice and lodash.toArray');
-
-  lodashStable.each(['slice', 'toArray'], function(methodName) {
-    var args = (function() { return arguments; }(1, 2, 3)),
-        array = [1, 2, 3],
-        func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should return a dense array', function(assert) {
-      assert.expect(3);
-
-      var sparse = Array(3);
-      sparse[1] = 2;
-
-      var actual = func(sparse);
-
-      assert.ok('0' in actual);
-      assert.ok('2' in actual);
-      assert.deepEqual(actual, sparse);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat array-like objects like arrays', function(assert) {
-      assert.expect(2);
-
-      var object = { '0': 'a', '1': 'b', '2': 'c', 'length': 3 };
-      assert.deepEqual(func(object), ['a', 'b', 'c']);
-      assert.deepEqual(func(args), array);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return a shallow clone of arrays', function(assert) {
-      assert.expect(2);
-
-      var actual = func(array);
-      assert.deepEqual(actual, array);
-      assert.notStrictEqual(actual, array);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with a node list for `collection`', function(assert) {
-      assert.expect(1);
-
-      if (document) {
-        try {
-          var actual = func(document.getElementsByTagName('body'));
-        } catch (e) {}
-
-        assert.deepEqual(actual, [body]);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('toInteger methods');
-
-  lodashStable.each(['toInteger', 'toSafeInteger'], function(methodName) {
-    var func = _[methodName],
-        isSafe = methodName == 'toSafeInteger';
-
-    QUnit.test('`_.' + methodName + '` should convert values to integers', function(assert) {
-      assert.expect(6);
-
-      assert.strictEqual(func(-5.6), -5);
-      assert.strictEqual(func('5.6'), 5);
-      assert.strictEqual(func(), 0);
-      assert.strictEqual(func(NaN), 0);
-
-      var expected = isSafe ? MAX_SAFE_INTEGER : MAX_INTEGER;
-      assert.strictEqual(func(Infinity), expected);
-      assert.strictEqual(func(-Infinity), -expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should support `value` of `-0`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(1 / func(-0), -Infinity);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.toLength');
-
-  (function() {
-    QUnit.test('should return a valid length', function(assert) {
-      assert.expect(4);
-
-      assert.strictEqual(_.toLength(-1), 0);
-      assert.strictEqual(_.toLength('1'), 1);
-      assert.strictEqual(_.toLength(1.1), 1);
-      assert.strictEqual(_.toLength(MAX_INTEGER), MAX_ARRAY_LENGTH);
-    });
-
-    QUnit.test('should return `value` if a valid length', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.toLength(0), 0);
-      assert.strictEqual(_.toLength(3), 3);
-      assert.strictEqual(_.toLength(MAX_ARRAY_LENGTH), MAX_ARRAY_LENGTH);
-    });
-
-    QUnit.test('should convert `-0` to `0`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(1 / _.toLength(-0), Infinity);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('number coercion methods');
-
-  lodashStable.each(['toInteger', 'toNumber', 'toSafeInteger'], function(methodName) {
-    var func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should preserve the sign of `0`', function(assert) {
-      assert.expect(2);
-
-      var values = [0, '0', -0, '-0'],
-          expected = [[0, Infinity], [0, Infinity], [-0, -Infinity], [-0, -Infinity]];
-
-      lodashStable.times(2, function(index) {
-        var others = lodashStable.map(values, index ? Object : identity);
-
-        var actual = lodashStable.map(others, function(value) {
-          var result = func(value);
-          return [result, 1 / result];
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-  });
-
-  lodashStable.each(['toInteger', 'toLength', 'toNumber', 'toSafeInteger'], function(methodName) {
-    var func = _[methodName],
-        isToLength = methodName == 'toLength',
-        isToNumber = methodName == 'toNumber',
-        isToSafeInteger = methodName == 'toSafeInteger';
-
-    function negative(string) {
-      return '-' + string;
-    }
-
-    function pad(string) {
-      return whitespace + string + whitespace;
-    }
-
-    function positive(string) {
-      return '+' + string;
-    }
-
-    QUnit.test('`_.' + methodName + '` should pass thru primitive number values', function(assert) {
-      assert.expect(1);
-
-      var values = [0, 1, NaN];
-
-      var expected = lodashStable.map(values, function(value) {
-        return (!isToNumber && value !== value) ? 0 : value;
-      });
-
-      var actual = lodashStable.map(values, func);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should convert number primitives and objects to numbers', function(assert) {
-      assert.expect(1);
-
-      var values = [2, 1.2, MAX_SAFE_INTEGER, MAX_INTEGER, Infinity, NaN];
-
-      var expected = lodashStable.map(values, function(value) {
-        if (!isToNumber) {
-          if (value == 1.2) {
-            value = 1;
-          }
-          else if (value == Infinity) {
-            value = MAX_INTEGER;
-          }
-          else if (value !== value) {
-            value = 0;
-          }
-          if (isToLength || isToSafeInteger) {
-            value = Math.min(value, isToLength ? MAX_ARRAY_LENGTH : MAX_SAFE_INTEGER);
-          }
-        }
-        var neg = isToLength ? 0 : -value;
-        return [value, value, neg, neg];
-      });
-
-      var actual = lodashStable.map(values, function(value) {
-        return [func(value), func(Object(value)), func(-value), func(Object(-value))];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should convert string primitives and objects to numbers', function(assert) {
-      assert.expect(1);
-
-      var transforms = [identity, pad, positive, negative];
-
-      var values = [
-        '10', '1.234567890', (MAX_SAFE_INTEGER + ''),
-        '1e+308', '1e308', '1E+308', '1E308',
-        '5e-324', '5E-324',
-        'Infinity', 'NaN'
-      ];
-
-      var expected = lodashStable.map(values, function(value) {
-        var n = +value;
-        if (!isToNumber) {
-          if (n == 1.234567890) {
-            n = 1;
-          }
-          else if (n == Infinity) {
-            n = MAX_INTEGER;
-          }
-          else if (n == Number.MIN_VALUE || n !== n) {
-            n = 0;
-          }
-          if (isToLength || isToSafeInteger) {
-            n = Math.min(n, isToLength ? MAX_ARRAY_LENGTH : MAX_SAFE_INTEGER);
-          }
-        }
-        var neg = isToLength ? 0 : -n;
-        return [n, n, n, n, n, n, neg, neg];
-      });
-
-      var actual = lodashStable.map(values, function(value) {
-        return lodashStable.flatMap(transforms, function(mod) {
-          return [func(mod(value)), func(Object(mod(value)))];
-        });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should convert binary/octal strings to numbers', function(assert) {
-      assert.expect(1);
-
-      var numbers = [42, 5349, 1715004],
-          transforms = [identity, pad],
-          values = ['0b101010', '0o12345', '0x1a2b3c'];
-
-      var expected = lodashStable.map(numbers, function(n) {
-        return lodashStable.times(8, lodashStable.constant(n));
-      });
-
-      var actual = lodashStable.map(values, function(value) {
-        var upper = value.toUpperCase();
-        return lodashStable.flatMap(transforms, function(mod) {
-          return [func(mod(value)), func(Object(mod(value))), func(mod(upper)), func(Object(mod(upper)))];
-        });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should convert invalid binary/octal strings to `' + (isToNumber ? 'NaN' : '0') + '`', function(assert) {
-      assert.expect(1);
-
-      var transforms = [identity, pad, positive, negative],
-          values = ['0b', '0o', '0x', '0b1010102', '0o123458', '0x1a2b3x'];
-
-      var expected = lodashStable.map(values, function(n) {
-        return lodashStable.times(8, lodashStable.constant(isToNumber ? NaN : 0));
-      });
-
-      var actual = lodashStable.map(values, function(value) {
-        return lodashStable.flatMap(transforms, function(mod) {
-          return [func(mod(value)), func(Object(mod(value)))];
-        });
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should convert symbols to `' + (isToNumber ? 'NaN' : '0') + '`', function(assert) {
-      assert.expect(1);
-
-      if (Symbol) {
-        var object1 = Object(symbol),
-            object2 = Object(symbol),
-            values = [symbol, object1, object2],
-            expected = lodashStable.map(values, lodashStable.constant(isToNumber ? NaN : 0));
-
-        object2.valueOf = undefined;
-        var actual = lodashStable.map(values, func);
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should convert empty values to `0` or `NaN`', function(assert) {
-      assert.expect(1);
-
-      var values = falsey.concat(whitespace);
-
-      var expected = lodashStable.map(values, function(value) {
-        return (isToNumber && value !== whitespace) ? Number(value) : 0;
-      });
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? func(value) : func();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce objects to numbers', function(assert) {
-      assert.expect(1);
-
-      var values = [
-        {},
-        [],
-        [1],
-        [1, 2],
-        { 'valueOf': '1.1' },
-        { 'valueOf': '1.1', 'toString': lodashStable.constant('2.2') },
-        { 'valueOf': lodashStable.constant('1.1'), 'toString': '2.2' },
-        { 'valueOf': lodashStable.constant('1.1'), 'toString': lodashStable.constant('2.2') },
-        { 'valueOf': lodashStable.constant('-0x1a2b3c') },
-        { 'toString': lodashStable.constant('-0x1a2b3c') },
-        { 'valueOf': lodashStable.constant('0o12345') },
-        { 'toString': lodashStable.constant('0o12345') },
-        { 'valueOf': lodashStable.constant('0b101010') },
-        { 'toString': lodashStable.constant('0b101010') }
-      ];
-
-      var expected = [
-        NaN,   0,   1,   NaN,
-        NaN,  2.2,  1.1, 1.1,
-        NaN,  NaN,
-        5349, 5349,
-        42,   42
-      ];
-
-      if (!isToNumber) {
-        expected = [
-          0, 0, 1, 0,
-          0, 2, 1, 1,
-          0, 0,
-          5349, 5349,
-          42, 42
-        ];
-      }
-      var actual = lodashStable.map(values, func);
-
-      assert.deepEqual(actual, expected);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.toPairs');
-
-  (function() {
-    QUnit.test('should be aliased', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.entries, _.toPairs);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.toPairsIn');
-
-  (function() {
-    QUnit.test('should be aliased', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.entriesIn, _.toPairsIn);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('toPairs methods');
-
-  lodashStable.each(['toPairs', 'toPairsIn'], function(methodName) {
-    var func = _[methodName],
-        isToPairs = methodName == 'toPairs';
-
-    QUnit.test('`_.' + methodName + '` should create an array of string keyed-value pairs', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1, 'b': 2 },
-          actual = lodashStable.sortBy(func(object), 0);
-
-      assert.deepEqual(actual, [['a', 1], ['b', 2]]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with an object that has a `length` property', function(assert) {
-      assert.expect(1);
-
-      var object = { '0': 'a', '1': 'b', 'length': 2 },
-          actual = lodashStable.sortBy(func(object), 0);
-
-      assert.deepEqual(actual, [['0', 'a'], ['1', 'b'], ['length', 2]]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ' + (isToPairs ? 'not ' : '') + 'include inherited string keyed property values', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var expected = isToPairs ? [['a', 1]] : [['a', 1], ['b', 2]],
-          actual = lodashStable.sortBy(func(new Foo), 0);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with strings', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each(['xo', Object('xo')], function(string) {
-        var actual = lodashStable.sortBy(func(string), 0);
-        assert.deepEqual(actual, [['0', 'x'], ['1', 'o']]);
-      });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.toPath');
-
-  (function() {
-    QUnit.test('should convert a string to a path', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(_.toPath('a.b.c'), ['a', 'b', 'c']);
-      assert.deepEqual(_.toPath('a[0].b.c'), ['a', '0', 'b', 'c']);
-    });
-
-    QUnit.test('should coerce array elements to strings', function(assert) {
-      assert.expect(4);
-
-      var array = ['a', 'b', 'c'];
-
-      lodashStable.each([array, lodashStable.map(array, Object)], function(value) {
-        var actual = _.toPath(value);
-        assert.deepEqual(actual, array);
-        assert.notStrictEqual(actual, array);
-      });
-    });
-
-    QUnit.test('should a new path array', function(assert) {
-      assert.expect(1);
-
-      assert.notStrictEqual(_.toPath('a.b.c'), _.toPath('a.b.c'));
-    });
-
-    QUnit.test('should not coerce symbols to strings', function(assert) {
-      assert.expect(4);
-
-      if (Symbol) {
-        var object = Object(symbol);
-        lodashStable.each([symbol, object, [symbol], [object]], function(value) {
-          var actual = _.toPath(value);
-          assert.ok(lodashStable.isSymbol(actual[0]));
-        });
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should handle complex paths', function(assert) {
-      assert.expect(1);
-
-      var actual = _.toPath('a[-1.23]["[\\"b\\"]"].c[\'[\\\'d\\\']\'][\ne\n][f].g');
-      assert.deepEqual(actual, ['a', '-1.23', '["b"]', 'c', "['d']", '\ne\n', 'f', 'g']);
-    });
-
-    QUnit.test('should ignore consecutive brackets and dots', function(assert) {
-      assert.expect(4);
-
-      var expected = ['a'];
-      assert.deepEqual(_.toPath('a.'), expected);
-      assert.deepEqual(_.toPath('a[]'), expected);
-
-      expected = ['a', 'b'];
-      assert.deepEqual(_.toPath('a..b'), expected);
-      assert.deepEqual(_.toPath('a[][]b'), expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.toPlainObject');
-
-  (function() {
-    var args = arguments;
-
-    QUnit.test('should flatten inherited string keyed properties', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.b = 2;
-      }
-      Foo.prototype.c = 3;
-
-      var actual = lodashStable.assign({ 'a': 1 }, _.toPlainObject(new Foo));
-      assert.deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3 });
-    });
-
-    QUnit.test('should convert `arguments` objects to plain objects', function(assert) {
-      assert.expect(1);
-
-      var actual = _.toPlainObject(args),
-          expected = { '0': 1, '1': 2, '2': 3 };
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should convert arrays to plain objects', function(assert) {
-      assert.expect(1);
-
-      var actual = _.toPlainObject(['a', 'b', 'c']),
-          expected = { '0': 'a', '1': 'b', '2': 'c' };
-
-      assert.deepEqual(actual, expected);
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.toString');
-
-  (function() {
-    QUnit.test('should treat nullish values as empty strings', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, alwaysEmptyString);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.toString(value) : _.toString();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var values = [-0, Object(-0), 0, Object(0)],
-          expected = ['-0', '-0', '0', '0'],
-          actual = lodashStable.map(values, _.toString);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should not error on symbols', function(assert) {
-      assert.expect(1);
-
-      if (Symbol) {
-        try {
-          assert.strictEqual(_.toString(symbol), 'Symbol(a)');
-        } catch (e) {
-          assert.ok(false, e.message);
-        }
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should return the `toString` result of the wrapped value', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var wrapped = _([1, 2, 3]);
-        assert.strictEqual(wrapped.toString(), '1,2,3');
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.transform');
-
-  (function() {
-    function Foo() {
-      this.a = 1;
-      this.b = 2;
-      this.c = 3;
-    }
-
-    QUnit.test('should create an object with the same `[[Prototype]]` as `object` when `accumulator` is nullish', function(assert) {
-      assert.expect(4);
-
-      var accumulators = [, null, undefined],
-          object = new Foo,
-          expected = lodashStable.map(accumulators, alwaysTrue);
-
-      var iteratee = function(result, value, key) {
-        result[key] = square(value);
-      };
-
-      var mapper = function(accumulator, index) {
-        return index ? _.transform(object, iteratee, accumulator) : _.transform(object, iteratee);
-      };
-
-      var results = lodashStable.map(accumulators, mapper);
-
-      var actual = lodashStable.map(results, function(result) {
-        return result instanceof Foo;
-      });
-
-      assert.deepEqual(actual, expected);
-
-      expected = lodashStable.map(accumulators, lodashStable.constant({ 'a': 1, 'b': 4, 'c': 9 }));
-      actual = lodashStable.map(results, lodashStable.toPlainObject);
-
-      assert.deepEqual(actual, expected);
-
-      object = { 'a': 1, 'b': 2, 'c': 3 };
-      actual = lodashStable.map(accumulators, mapper);
-
-      assert.deepEqual(actual, expected);
-
-      object = [1, 2, 3];
-      expected = lodashStable.map(accumulators, lodashStable.constant([1, 4, 9]));
-      actual = lodashStable.map(accumulators, mapper);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should create regular arrays from typed arrays', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(typedArrays, alwaysTrue);
-
-      var actual = lodashStable.map(typedArrays, function(type) {
-        var Ctor = root[type],
-            array = Ctor ? new Ctor(new ArrayBuffer(24)) : [];
-
-        return lodashStable.isArray(_.transform(array, noop));
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should support an `accumulator` value', function(assert) {
-      assert.expect(6);
-
-      var values = [new Foo, [1, 2, 3], { 'a': 1, 'b': 2, 'c': 3 }],
-          expected = lodashStable.map(values, lodashStable.constant([1, 4, 9]));
-
-      var actual = lodashStable.map(values, function(value) {
-        return _.transform(value, function(result, value) {
-          result.push(square(value));
-        }, []);
-      });
-
-      assert.deepEqual(actual, expected);
-
-      var object = { 'a': 1, 'b': 4, 'c': 9 },
-      expected = [object, { '0': 1, '1': 4, '2': 9 }, object];
-
-      actual = lodashStable.map(values, function(value) {
-        return _.transform(value, function(result, value, key) {
-          result[key] = square(value);
-        }, {});
-      });
-
-      assert.deepEqual(actual, expected);
-
-      lodashStable.each([[], {}], function(accumulator) {
-        var actual = lodashStable.map(values, function(value) {
-          return _.transform(value, noop, accumulator);
-        });
-
-        assert.ok(lodashStable.every(actual, function(result) {
-          return result === accumulator;
-        }));
-
-        assert.strictEqual(_.transform(null, null, accumulator), accumulator);
-      });
-    });
-
-    QUnit.test('should treat sparse arrays as dense', function(assert) {
-      assert.expect(1);
-
-      var actual = _.transform(Array(1), function(result, value, index) {
-        result[index] = String(value);
-      });
-
-      assert.deepEqual(actual, ['undefined']);
-    });
-
-    QUnit.test('should work without an `iteratee` argument', function(assert) {
-      assert.expect(1);
-
-      assert.ok(_.transform(new Foo) instanceof Foo);
-    });
-
-    QUnit.test('should ensure `object` is an object before using its `[[Prototype]]`', function(assert) {
-      assert.expect(2);
-
-      var Ctors = [Boolean, Boolean, Number, Number, Number, String, String],
-          values = [false, true, 0, 1, NaN, '', 'a'],
-          expected = lodashStable.map(values, alwaysEmptyObject);
-
-      var results = lodashStable.map(values, function(value) {
-        return _.transform(value);
-      });
-
-      assert.deepEqual(results, expected);
-
-      expected = lodashStable.map(values, alwaysFalse);
-
-      var actual = lodashStable.map(results, function(value, index) {
-        return value instanceof Ctors[index];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should ensure `object` constructor is a function before using its `[[Prototype]]`', function(assert) {
-      assert.expect(1);
-
-      Foo.prototype.constructor = null;
-      assert.notOk(_.transform(new Foo) instanceof Foo);
-      Foo.prototype.constructor = Foo;
-    });
-
-    QUnit.test('should create an empty object when given a falsey `object` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysEmptyObject);
-
-      var actual = lodashStable.map(falsey, function(object, index) {
-        return index ? _.transform(object) : _.transform();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    lodashStable.each({
-      'array': [1, 2, 3],
-      'object': { 'a': 1, 'b': 2, 'c': 3 }
-    },
-    function(object, key) {
-      QUnit.test('should provide the correct `iteratee` arguments when transforming an ' + key, function(assert) {
-        assert.expect(2);
-
-        var args;
-
-        _.transform(object, function() {
-          args || (args = slice.call(arguments));
-        });
-
-        var first = args[0];
-        if (key == 'array') {
-          assert.ok(first !== object && lodashStable.isArray(first));
-          assert.deepEqual(args, [first, 1, 0, object]);
-        } else {
-          assert.ok(first !== object && lodashStable.isPlainObject(first));
-          assert.deepEqual(args, [first, 1, 'a', object]);
-        }
-      });
-    });
-
-    QUnit.test('should create an object from the same realm as `object`', function(assert) {
-      assert.expect(1);
-
-      var objects = lodashStable.filter(realm, function(value) {
-        return lodashStable.isObject(value) && !lodashStable.isElement(value);
-      });
-
-      var expected = lodashStable.map(objects, alwaysTrue);
-
-      var actual = lodashStable.map(objects, function(object) {
-        var Ctor = object.constructor,
-            result = _.transform(object);
-
-        if (result === object) {
-          return false;
-        }
-        if (lodashStable.isTypedArray(object)) {
-          return result instanceof Array;
-        }
-        return result instanceof Ctor || !(new Ctor instanceof Ctor);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('trim methods');
-
-  lodashStable.each(['trim', 'trimStart', 'trimEnd'], function(methodName, index) {
-    var func = _[methodName],
-        parts = [];
-
-    if (index != 2) {
-      parts.push('leading');
-    }
-    if (index != 1) {
-      parts.push('trailing');
-    }
-    parts = parts.join(' and ');
-
-    QUnit.test('`_.' + methodName + '` should remove ' + parts + ' whitespace', function(assert) {
-      assert.expect(1);
-
-      var string = whitespace + 'a b c' + whitespace,
-          expected = (index == 2 ? whitespace : '') + 'a b c' + (index == 1 ? whitespace : '');
-
-      assert.strictEqual(func(string), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce `string` to a string', function(assert) {
-      assert.expect(1);
-
-      var object = { 'toString': lodashStable.constant(whitespace + 'a b c' + whitespace) },
-          expected = (index == 2 ? whitespace : '') + 'a b c' + (index == 1 ? whitespace : '');
-
-      assert.strictEqual(func(object), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should remove ' + parts + ' `chars`', function(assert) {
-      assert.expect(1);
-
-      var string = '-_-a-b-c-_-',
-          expected = (index == 2 ? '-_-' : '') + 'a-b-c' + (index == 1 ? '-_-' : '');
-
-      assert.strictEqual(func(string, '_-'), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should coerce `chars` to a string', function(assert) {
-      assert.expect(1);
-
-      var object = { 'toString': lodashStable.constant('_-') },
-          string = '-_-a-b-c-_-',
-          expected = (index == 2 ? '-_-' : '') + 'a-b-c' + (index == 1 ? '-_-' : '');
-
-      assert.strictEqual(func(string, object), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return an empty string for empty values and `chars`', function(assert) {
-      assert.expect(6);
-
-      lodashStable.each([null, '_-'], function(chars) {
-        assert.strictEqual(func(null, chars), '');
-        assert.strictEqual(func(undefined, chars), '');
-        assert.strictEqual(func('', chars), '');
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with `undefined` or empty string values for `chars`', function(assert) {
-      assert.expect(2);
-
-      var string = whitespace + 'a b c' + whitespace,
-          expected = (index == 2 ? whitespace : '') + 'a b c' + (index == 1 ? whitespace : '');
-
-      assert.strictEqual(func(string, undefined), expected);
-      assert.strictEqual(func(string, ''), string);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var string = Object(whitespace + 'a b c' + whitespace),
-          trimmed = (index == 2 ? whitespace : '') + 'a b c' + (index == 1 ? whitespace : ''),
-          actual = lodashStable.map([string, string, string], func);
-
-      assert.deepEqual(actual, [trimmed, trimmed, trimmed]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return an unwrapped value when implicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var string = whitespace + 'a b c' + whitespace,
-            expected = (index == 2 ? whitespace : '') + 'a b c' + (index == 1 ? whitespace : '');
-
-        assert.strictEqual(_(string)[methodName](), expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should return a wrapped value when explicitly chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var string = whitespace + 'a b c' + whitespace;
-        assert.ok(_(string).chain()[methodName]() instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('uncommon symbols');
-
-  (function() {
-    var flag = '\ud83c\uddfa\ud83c\uddf8',
-        heart = '\u2764' + emojiVar,
-        hearts = '\ud83d\udc95',
-        comboGlyph = '\ud83d\udc68\u200d' + heart + '\u200d\ud83d\udc8B\u200d\ud83d\udc68',
-        hashKeycap = '#' + emojiVar + '\u20e3',
-        leafs = '\ud83c\udf42',
-        mic = '\ud83c\udf99',
-        noMic = mic + '\u20e0',
-        raisedHand = '\u270B' + emojiVar,
-        rocket = '\ud83d\ude80',
-        thumbsUp = '\ud83d\udc4d';
-
-    QUnit.test('should account for astral symbols', function(assert) {
-      assert.expect(34);
-
-      var allHearts = _.repeat(hearts, 10),
-          chars = hearts + comboGlyph,
-          string = 'A ' + leafs + ', ' + comboGlyph + ', and ' + rocket,
-          trimChars = comboGlyph + hearts,
-          trimString = trimChars + string + trimChars;
-
-      assert.strictEqual(_.camelCase(hearts + ' the ' + leafs), hearts + 'The' + leafs);
-      assert.strictEqual(_.camelCase(string), 'a' + leafs + comboGlyph + 'And' + rocket);
-      assert.strictEqual(_.capitalize(rocket), rocket);
-
-      assert.strictEqual(_.pad(string, 16), ' ' + string + '  ');
-      assert.strictEqual(_.padStart(string, 16), '   ' + string);
-      assert.strictEqual(_.padEnd(string, 16), string + '   ');
-
-      assert.strictEqual(_.pad(string, 16, chars), hearts + string + chars);
-      assert.strictEqual(_.padStart(string, 16, chars), chars + hearts + string);
-      assert.strictEqual(_.padEnd(string, 16, chars), string + chars + hearts);
-
-      assert.strictEqual(_.size(string), 13);
-      assert.deepEqual(_.split(string, ' '), ['A', leafs + ',', comboGlyph + ',', 'and', rocket]);
-      assert.deepEqual(_.split(string, ' ', 3), ['A', leafs + ',', comboGlyph + ',']);
-      assert.deepEqual(_.split(string, undefined), [string]);
-      assert.deepEqual(_.split(string, undefined, -1), [string]);
-      assert.deepEqual(_.split(string, undefined, 0), []);
-
-      var expected = ['A', ' ', leafs, ',', ' ', comboGlyph, ',', ' ', 'a', 'n', 'd', ' ', rocket];
-
-      assert.deepEqual(_.split(string, ''), expected);
-      assert.deepEqual(_.split(string, '', 6), expected.slice(0, 6));
-      assert.deepEqual(_.toArray(string), expected);
-
-      assert.strictEqual(_.trim(trimString, chars), string);
-      assert.strictEqual(_.trimStart(trimString, chars), string + trimChars);
-      assert.strictEqual(_.trimEnd(trimString, chars), trimChars + string);
-
-      assert.strictEqual(_.truncate(string, { 'length': 13 }), string);
-      assert.strictEqual(_.truncate(string, { 'length': 6 }), 'A ' + leafs + '...');
-
-      assert.deepEqual(_.words(string), ['A', leafs, comboGlyph, 'and', rocket]);
-      assert.deepEqual(_.toArray(hashKeycap), [hashKeycap]);
-      assert.deepEqual(_.toArray(noMic), [noMic]);
-
-      lodashStable.times(2, function(index) {
-        var separator = index ? RegExp(hearts) : hearts,
-            options = { 'length': 4, 'separator': separator },
-            actual = _.truncate(string, options);
-
-        assert.strictEqual(actual, 'A...');
-        assert.strictEqual(actual.length, 4);
-
-        actual = _.truncate(allHearts, options);
-        assert.strictEqual(actual, hearts + '...');
-        assert.strictEqual(actual.length, 5);
-      });
-    });
-
-    QUnit.test('should account for combining diacritical marks', function(assert) {
-      assert.expect(1);
-
-      var values = lodashStable.map(comboMarks, function(mark) {
-        return 'o' + mark;
-      });
-
-      var expected = lodashStable.map(values, function(value) {
-        return [1, [value], [value]];
-      });
-
-      var actual = lodashStable.map(values, function(value) {
-        return [_.size(value), _.toArray(value), _.words(value)];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should account for fitzpatrick modifiers', function(assert) {
-      assert.expect(1);
-
-      var values = lodashStable.map(fitzModifiers, function(modifier) {
-        return thumbsUp + modifier;
-      });
-
-      var expected = lodashStable.map(values, function(value) {
-        return [1, [value], [value]];
-      });
-
-      var actual = lodashStable.map(values, function(value) {
-        return [_.size(value), _.toArray(value), _.words(value)];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should account for regional symbols', function(assert) {
-      assert.expect(6);
-
-      var pair = flag.match(/\ud83c[\udde6-\uddff]/g),
-          regionals = pair.join(' ');
-
-      assert.strictEqual(_.size(flag), 1);
-      assert.strictEqual(_.size(regionals), 3);
-
-      assert.deepEqual(_.toArray(flag), [flag]);
-      assert.deepEqual(_.toArray(regionals), [pair[0], ' ', pair[1]]);
-
-      assert.deepEqual(_.words(flag), [flag]);
-      assert.deepEqual(_.words(regionals), [pair[0], pair[1]]);
-    });
-
-    QUnit.test('should account for variation selectors', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.size(heart), 1);
-      assert.deepEqual(_.toArray(heart), [heart]);
-      assert.deepEqual(_.words(heart), [heart]);
-    });
-
-    QUnit.test('should account for variation selectors with fitzpatrick modifiers', function(assert) {
-      assert.expect(1);
-
-      var values = lodashStable.map(fitzModifiers, function(modifier) {
-        return raisedHand + modifier;
-      });
-
-      var expected = lodashStable.map(values, function(value) {
-        return [1, [value], [value]];
-      });
-
-      var actual = lodashStable.map(values, function(value) {
-        return [_.size(value), _.toArray(value), _.words(value)];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should match lone surrogates', function(assert) {
-      assert.expect(3);
-
-      var pair = hearts.split(''),
-          surrogates = pair[0] + ' ' + pair[1];
-
-      assert.strictEqual(_.size(surrogates), 3);
-      assert.deepEqual(_.toArray(surrogates), [pair[0], ' ', pair[1]]);
-      assert.deepEqual(_.words(surrogates), []);
-    });
-
-    QUnit.test('should match side by side fitzpatrick modifiers separately ', function(assert) {
-      assert.expect(1);
-
-      var string = fitzModifiers[0] + fitzModifiers[0];
-      assert.deepEqual(_.toArray(string), [fitzModifiers[0], fitzModifiers[0]]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.unary');
-
-  (function() {
-    function fn() {
-      return slice.call(arguments);
-    }
-
-    QUnit.test('should cap the number of arguments provided to `func`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(['6', '8', '10'], _.unary(parseInt));
-      assert.deepEqual(actual, [6, 8, 10]);
-    });
-
-    QUnit.test('should work when provided less than the capped number of arguments', function(assert) {
-      assert.expect(1);
-
-      var capped = _.unary(fn);
-      assert.deepEqual(capped(), []);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.unescape');
-
-  (function() {
-    var escaped = '&amp;&lt;&gt;&quot;&#39;\/',
-        unescaped = '&<>"\'\/';
-
-    escaped += escaped;
-    unescaped += unescaped;
-
-    QUnit.test('should unescape entities in order', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.unescape('&amp;lt;'), '&lt;');
-    });
-
-    QUnit.test('should unescape the proper entities', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.unescape(escaped), unescaped);
-    });
-
-    QUnit.test('should not unescape the "&#x2F;" entity', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.unescape('&#x2F;'), '&#x2F;');
-    });
-
-    QUnit.test('should handle strings with nothing to unescape', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.unescape('abc'), 'abc');
-    });
-
-    QUnit.test('should unescape the same characters escaped by `_.escape`', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(_.unescape(_.escape(unescaped)), unescaped);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.unionBy');
-
-  (function() {
-    QUnit.test('should accept an `iteratee` argument', function(assert) {
-      assert.expect(2);
-
-      var actual = _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-      assert.deepEqual(actual, [2.1, 1.2, 4.3]);
-
-      actual = _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-      assert.deepEqual(actual, [{ 'x': 1 }, { 'x': 2 }]);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.unionBy([2.1, 1.2], [4.3, 2.4], function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [2.1]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.unionWith');
-
-  (function() {
-    QUnit.test('should work with a `comparator` argument', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }],
-          others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }],
-          actual = _.unionWith(objects, others, lodashStable.isEqual);
-
-      assert.deepEqual(actual, [objects[0], objects[1], others[0]]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('union methods');
-
-  lodashStable.each(['union', 'unionBy', 'unionWith'], function(methodName) {
-    var args = (function() { return arguments; }(1, 2, 3)),
-        func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should return the union of the given arrays', function(assert) {
-      assert.expect(1);
-
-      var actual = func([1, 3, 2], [5, 2, 1, 4], [2, 1]);
-      assert.deepEqual(actual, [1, 3, 2, 5, 4]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should not flatten nested arrays', function(assert) {
-      assert.expect(1);
-
-      var actual = func([1, 3, 2], [1, [5]], [2, [4]]);
-      assert.deepEqual(actual, [1, 3, 2, [5], [4]]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ignore values that are not arrays or `arguments` objects', function(assert) {
-      assert.expect(3);
-
-      var array = [0];
-      assert.deepEqual(func(array, 3, { '0': 1 }, null), array);
-      assert.deepEqual(func(null, array, null, [2, 1]), [0, 2, 1]);
-      assert.deepEqual(func(array, null, args, null), [0, 1, 2, 3]);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.uniq');
-
-  (function() {
-    QUnit.test('should perform an unsorted uniq when used as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var array = [[2, 1, 2], [1, 2, 1]],
-          actual = lodashStable.map(array, lodashStable.uniq);
-
-      assert.deepEqual(actual, [[2, 1], [1, 2]]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('uniqBy methods');
-
-  lodashStable.each(['uniqBy', 'sortedUniqBy'], function(methodName) {
-    var func = _[methodName],
-        isSorted = methodName == 'sortedUniqBy',
-        objects = [{ 'a': 2 }, { 'a': 3 }, { 'a': 1 }, { 'a': 2 }, { 'a': 3 }, { 'a': 1 }];
-
-    if (isSorted) {
-      objects = _.sortBy(objects, 'a');
-    }
-    QUnit.test('`_.' + methodName + '` should work with an `iteratee` argument', function(assert) {
-      assert.expect(1);
-
-      var expected = isSorted ? [{ 'a': 1 }, { 'a': 2 }, { 'a': 3 }] : objects.slice(0, 3);
-
-      var actual = func(objects, function(object) {
-        return object.a;
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should work with large arrays', function(assert) {
-      assert.expect(2);
-
-      var largeArray = lodashStable.times(LARGE_ARRAY_SIZE, function() {
-        return [1, 2];
-      });
-
-      var actual = func(largeArray, String);
-
-      assert.deepEqual(actual, [[1, 2]]);
-      assert.strictEqual(actual[0], largeArray[0]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      func(objects, function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [objects[0]]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with `_.property` shorthands', function(assert) {
-      assert.expect(2);
-
-      var expected = isSorted ? [{ 'a': 1 }, { 'a': 2 }, { 'a': 3 }] : objects.slice(0, 3),
-          actual = func(objects, 'a');
-
-      assert.deepEqual(actual, expected);
-
-      var arrays = [[2], [3], [1], [2], [3], [1]];
-      if (isSorted) {
-        arrays = lodashStable.sortBy(arrays, 0);
-      }
-      expected = isSorted ? [[1], [2], [3]] : arrays.slice(0, 3);
-      actual = func(arrays, 0);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    lodashStable.each({
-      'an array': [0, 'a'],
-      'an object': { '0': 'a' },
-      'a number': 0,
-      'a string': '0'
-    },
-    function(iteratee, key) {
-      QUnit.test('`_.' + methodName + '` should work with ' + key + ' for `iteratee`', function(assert) {
-        assert.expect(1);
-
-        var actual = func([['a'], ['a'], ['b']], iteratee);
-        assert.deepEqual(actual, [['a'], ['b']]);
-      });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.uniqWith');
-
-  (function() {
-    QUnit.test('should work with a `comparator` argument', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 },  { 'x': 1, 'y': 2 }],
-          actual = _.uniqWith(objects, lodashStable.isEqual);
-
-      assert.deepEqual(actual, [objects[0], objects[1]]);
-    });
-
-    QUnit.test('should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var largeArray = lodashStable.times(LARGE_ARRAY_SIZE, function(index) {
-        return isEven(index) ? -0 : 0;
-      });
-
-      var arrays = [[-0, 0], largeArray],
-          expected = lodashStable.map(arrays, lodashStable.constant(['-0']));
-
-      var actual = lodashStable.map(arrays, function(array) {
-        return lodashStable.map(_.uniqWith(array, lodashStable.eq), lodashStable.toString);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('uniq methods');
-
-  lodashStable.each(['uniq', 'uniqBy', 'uniqWith', 'sortedUniq', 'sortedUniqBy'], function(methodName) {
-    var func = _[methodName],
-        isSorted = /^sorted/.test(methodName),
-        objects = [{ 'a': 2 }, { 'a': 3 }, { 'a': 1 }, { 'a': 2 }, { 'a': 3 }, { 'a': 1 }];
-
-    if (isSorted) {
-      objects = _.sortBy(objects, 'a');
-    }
-    else {
-      QUnit.test('`_.' + methodName + '` should return unique values of an unsorted array', function(assert) {
-        assert.expect(1);
-
-        var array = [2, 3, 1, 2, 3, 1];
-        assert.deepEqual(func(array), [2, 3, 1]);
-      });
-    }
-    QUnit.test('`_.' + methodName + '` should return unique values of a sorted array', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 1, 2, 2, 3];
-      assert.deepEqual(func(array), [1, 2, 3]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat object instances as unique', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func(objects), objects);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat `-0` as `0`', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.map(func([-0, 0]), lodashStable.toString);
-      assert.deepEqual(actual, ['0']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should match `NaN`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func([NaN, NaN]), [NaN]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays', function(assert) {
-      assert.expect(1);
-
-      var largeArray = [],
-          expected = [0, {}, 'a'],
-          count = Math.ceil(LARGE_ARRAY_SIZE / expected.length);
-
-      lodashStable.each(expected, function(value) {
-        lodashStable.times(count, function() {
-          largeArray.push(value);
-        });
-      });
-
-      assert.deepEqual(func(largeArray), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays of `-0` as `0`', function(assert) {
-      assert.expect(1);
-
-      var largeArray = lodashStable.times(LARGE_ARRAY_SIZE, function(index) {
-        return isEven(index) ? -0 : 0;
-      });
-
-      var actual = lodashStable.map(func(largeArray), lodashStable.toString);
-      assert.deepEqual(actual, ['0']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays of boolean, `NaN`, and nullish values', function(assert) {
-      assert.expect(1);
-
-      var largeArray = [],
-          expected = [null, undefined, false, true, NaN],
-          count = Math.ceil(LARGE_ARRAY_SIZE / expected.length);
-
-      lodashStable.each(expected, function(value) {
-        lodashStable.times(count, function() {
-          largeArray.push(value);
-        });
-      });
-
-      assert.deepEqual(func(largeArray), expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays of symbols', function(assert) {
-      assert.expect(1);
-
-      if (Symbol) {
-        var largeArray = lodashStable.times(LARGE_ARRAY_SIZE, Symbol);
-        assert.deepEqual(func(largeArray), largeArray);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with large arrays of well-known symbols', function(assert) {
-      assert.expect(1);
-
-      // See http://www.ecma-international.org/ecma-262/6.0/#sec-well-known-symbols.
-      if (Symbol) {
-        var expected = [
-          Symbol.hasInstance, Symbol.isConcatSpreadable, Symbol.iterator,
-          Symbol.match, Symbol.replace, Symbol.search, Symbol.species,
-          Symbol.split, Symbol.toPrimitive, Symbol.toStringTag, Symbol.unscopables
-        ];
-
-        var largeArray = [],
-            count = Math.ceil(LARGE_ARRAY_SIZE / expected.length);
-
-        expected = lodashStable.map(expected, function(symbol) {
-          return symbol || {};
-        });
-
-        lodashStable.each(expected, function(value) {
-          lodashStable.times(count, function() {
-            largeArray.push(value);
-          });
-        });
-
-        assert.deepEqual(func(largeArray), expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should distinguish between numbers and numeric strings', function(assert) {
-      assert.expect(1);
-
-      var largeArray = [],
-          expected = ['2', 2, Object('2'), Object(2)],
-          count = Math.ceil(LARGE_ARRAY_SIZE / expected.length);
-
-      lodashStable.each(expected, function(value) {
-        lodashStable.times(count, function() {
-          largeArray.push(value);
-        });
-      });
-
-      assert.deepEqual(func(largeArray), expected);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.uniqueId');
-
-  (function() {
-    QUnit.test('should generate unique ids', function(assert) {
-      assert.expect(1);
-
-      var actual = lodashStable.times(1000, function(assert) {
-        return _.uniqueId();
-      });
-
-      assert.strictEqual(lodashStable.uniq(actual).length, actual.length);
-    });
-
-    QUnit.test('should return a string value when not providing a prefix argument', function(assert) {
-      assert.expect(1);
-
-      assert.strictEqual(typeof _.uniqueId(), 'string');
-    });
-
-    QUnit.test('should coerce the prefix argument to a string', function(assert) {
-      assert.expect(1);
-
-      var actual = [_.uniqueId(3), _.uniqueId(2), _.uniqueId(1)];
-      assert.ok(/3\d+,2\d+,1\d+/.test(actual));
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.unset');
-
-  (function() {
-    QUnit.test('should unset property values', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each(['a', ['a']], function(path) {
-        var object = { 'a': 1, 'c': 2 };
-        assert.strictEqual(_.unset(object, path), true);
-        assert.deepEqual(object, { 'c': 2 });
-      });
-    });
-
-    QUnit.test('should preserve the sign of `0`', function(assert) {
-      assert.expect(1);
-
-      var props = [-0, Object(-0), 0, Object(0)],
-          expected = lodashStable.map(props, lodashStable.constant([true, false]));
-
-      var actual = lodashStable.map(props, function(key) {
-        var object = { '-0': 'a', '0': 'b' };
-        return [_.unset(object, key), lodashStable.toString(key) in object];
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should unset symbol keyed property values', function(assert) {
-      assert.expect(2);
-
-      if (Symbol) {
-        var object = {};
-        object[symbol] = 1;
-
-        assert.strictEqual(_.unset(object, symbol), true);
-        assert.notOk(symbol in object);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should unset deep property values', function(assert) {
-      assert.expect(4);
-
-      lodashStable.each(['a.b', ['a', 'b']], function(path) {
-        var object = { 'a': { 'b': null } };
-        assert.strictEqual(_.unset(object, path), true);
-        assert.deepEqual(object, { 'a': {} });
-      });
-    });
-
-    QUnit.test('should handle complex paths', function(assert) {
-      assert.expect(4);
-
-      var paths = [
-        'a[-1.23]["[\\"b\\"]"].c[\'[\\\'d\\\']\'][\ne\n][f].g',
-        ['a', '-1.23', '["b"]', 'c', "['d']", '\ne\n', 'f', 'g']
-      ];
-
-      lodashStable.each(paths, function(path) {
-        var object = { 'a': { '-1.23': { '["b"]': { 'c': { "['d']": { '\ne\n': { 'f': { 'g': 8 } } } } } } } };
-        assert.strictEqual(_.unset(object, path), true);
-        assert.notOk('g' in object.a[-1.23]['["b"]'].c["['d']"]['\ne\n'].f);
-      });
-    });
-
-    QUnit.test('should return `true` for nonexistent paths', function(assert) {
-      assert.expect(5);
-
-      var object = { 'a': { 'b': { 'c': null } } };
-
-      lodashStable.each(['z', 'a.z', 'a.b.z', 'a.b.c.z'], function(path) {
-        assert.strictEqual(_.unset(object, path), true);
-      });
-
-      assert.deepEqual(object, { 'a': { 'b': { 'c': null } } });
-    });
-
-    QUnit.test('should not error when `object` is nullish', function(assert) {
-      assert.expect(1);
-
-      var values = [null, undefined],
-          expected = [[true, true], [true, true]];
-
-      var actual = lodashStable.map(values, function(value) {
-        try {
-          return [_.unset(value, 'a.b'), _.unset(value, ['a', 'b'])];
-        } catch (e) {
-          return e.message;
-        }
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should follow `path` over non-plain objects', function(assert) {
-      assert.expect(8);
-
-      var object = { 'a': '' },
-          paths = ['constructor.prototype.a', ['constructor', 'prototype', 'a']];
-
-      lodashStable.each(paths, function(path) {
-        numberProto.a = 1;
-
-        var actual = _.unset(0, path);
-        assert.strictEqual(actual, true);
-        assert.notOk('a' in numberProto);
-
-        delete numberProto.a;
-      });
-
-      lodashStable.each(['a.replace.b', ['a', 'replace', 'b']], function(path) {
-        stringProto.replace.b = 1;
-
-        var actual = _.unset(object, path);
-        assert.strictEqual(actual, true);
-        assert.notOk('a' in stringProto.replace);
-
-        delete stringProto.replace.b;
-      });
-    });
-
-    QUnit.test('should return `false` for non-configurable properties', function(assert) {
-      assert.expect(1);
-
-      var object = {};
-
-      if (!isStrict && defineProperty) {
-        defineProperty(object, 'a', {
-          'configurable': false,
-          'enumerable': true,
-          'writable': true,
-          'value': 1,
-        });
-        assert.strictEqual(_.unset(object, 'a'), false);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.unzipWith');
-
-  (function() {
-    QUnit.test('should unzip arrays combining regrouped elements with `iteratee`', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 4], [2, 5], [3, 6]];
-
-      var actual = _.unzipWith(array, function(a, b, c) {
-        return a + b + c;
-      });
-
-      assert.deepEqual(actual, [6, 15]);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.unzipWith([[1, 3, 5], [2, 4, 6]], function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [1, 2]);
-    });
-
-    QUnit.test('should perform a basic unzip when `iteratee` is nullish', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 3], [2, 4]],
-          values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant(_.unzip(array)));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.unzipWith(array, value) : _.unzipWith(array);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.updateWith');
-
-  (function() {
-    QUnit.test('should work with a `customizer` callback', function(assert) {
-      assert.expect(1);
-
-      var actual = _.updateWith({ '0': {} }, '[0][1][2]', alwaysThree, function(value) {
-        return lodashStable.isObject(value) ? undefined : {};
-      });
-
-      assert.deepEqual(actual, { '0': { '1': { '2': 3 } } });
-    });
-
-    QUnit.test('should work with a `customizer` that returns `undefined`', function(assert) {
-      assert.expect(1);
-
-      var actual = _.updateWith({}, 'a[0].b.c', alwaysFour, noop);
-      assert.deepEqual(actual, { 'a': [{ 'b': { 'c': 4 } }] });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('update methods');
-
-  lodashStable.each(['update', 'updateWith'], function(methodName) {
-    var func = _[methodName],
-        oldValue = 1;
-
-    QUnit.test('`_.' + methodName + '` should invoke `updater` with the value on `path` of `object`', function(assert) {
-      assert.expect(4);
-
-      var object = { 'a': [{ 'b': { 'c': oldValue } }] },
-          expected = oldValue + 1;
-
-      lodashStable.each(['a[0].b.c', ['a', '0', 'b', 'c']], function(path) {
-        func(object, path, function(n) {
-          assert.strictEqual(n, oldValue);
-          return ++n;
-        });
-
-        assert.strictEqual(object.a[0].b.c, expected);
-        object.a[0].b.c = oldValue;
-      });
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.upperCase');
-
-  (function() {
-    QUnit.test('should uppercase as space-separated words', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.upperCase('--foo-bar--'), 'FOO BAR');
-      assert.strictEqual(_.upperCase('fooBar'), 'FOO BAR');
-      assert.strictEqual(_.upperCase('__foo_bar__'), 'FOO BAR');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.upperFirst');
-
-  (function() {
-    QUnit.test('should uppercase only the first character', function(assert) {
-      assert.expect(3);
-
-      assert.strictEqual(_.upperFirst('fred'), 'Fred');
-      assert.strictEqual(_.upperFirst('Fred'), 'Fred');
-      assert.strictEqual(_.upperFirst('FRED'), 'FRED');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('values methods');
-
-  lodashStable.each(['values', 'valuesIn'], function(methodName) {
-    var args = (function() { return arguments; }(1, 2, 3)),
-        strictArgs = (function() { 'use strict'; return arguments; }(1, 2, 3)),
-        func = _[methodName],
-        isValues = methodName == 'values';
-
-    QUnit.test('`_.' + methodName + '` should get string keyed values of `object`', function(assert) {
-      assert.expect(1);
-
-      var object = { 'a': 1, 'b': 2 },
-          actual = func(object).sort();
-
-      assert.deepEqual(actual, [1, 2]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with an object that has a `length` property', function(assert) {
-      assert.expect(1);
-
-      var object = { '0': 'a', '1': 'b', 'length': 2 },
-          actual = func(object).sort();
-
-      assert.deepEqual(actual, [2, 'a', 'b']);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ' + (isValues ? 'not ' : '') + 'include inherited string keyed property values', function(assert) {
-      assert.expect(1);
-
-      function Foo() {
-        this.a = 1;
-      }
-      Foo.prototype.b = 2;
-
-      var expected = isValues ? [1] : [1, 2],
-          actual = func(new Foo).sort();
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with `arguments` objects', function(assert) {
-      assert.expect(1);
-
-      var values = [args, strictArgs],
-          expected = lodashStable.map(values, lodashStable.constant([1, 2, 3]));
-
-      var actual = lodashStable.map(values, function(value) {
-        return func(value).sort();
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.without');
-
-  (function() {
-    QUnit.test('should use strict equality to determine the values to reject', function(assert) {
-      assert.expect(2);
-
-      var object1 = { 'a': 1 },
-          object2 = { 'b': 2 },
-          array = [object1, object2];
-
-      assert.deepEqual(_.without(array, { 'a': 1 }), array);
-      assert.deepEqual(_.without(array, object1), [object2]);
-    });
-
-    QUnit.test('should remove all occurrences of each value from an array', function(assert) {
-      assert.expect(1);
-
-      var array = [1, 2, 3, 1, 2, 3];
-      assert.deepEqual(_.without(array, 1, 2), [3, 3]);
-    });
-  }(1, 2, 3));
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.words');
-
-  (function() {
-    QUnit.test('should treat latin-1 supplementary letters as words', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(burredLetters, function(letter) {
-        return [letter];
-      });
-
-      var actual = lodashStable.map(burredLetters, function(letter) {
-        return _.words(letter);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should not treat mathematical operators as words', function(assert) {
-      assert.expect(1);
-
-      var operators = ['\xac', '\xb1', '\xd7', '\xf7'],
-          expected = lodashStable.map(operators, alwaysEmptyArray),
-          actual = lodashStable.map(operators, _.words);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should not treat punctuation as words', function(assert) {
-      assert.expect(1);
-
-      var marks = [
-        '\u2012', '\u2013', '\u2014', '\u2015',
-        '\u2024', '\u2025', '\u2026',
-        '\u205d', '\u205e'
-      ];
-
-      var expected = lodashStable.map(marks, alwaysEmptyArray),
-          actual = lodashStable.map(marks, _.words);
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should support a `pattern` argument', function(assert) {
-      assert.expect(2);
-
-      assert.deepEqual(_.words('abcd', /ab|cd/g), ['ab', 'cd']);
-      assert.deepEqual(_.words('abcd', 'ab|cd'), ['ab']);
-    });
-
-    QUnit.test('should work with compound words', function(assert) {
-      assert.expect(12);
-
-      assert.deepEqual(_.words('12Feet'), ['12', 'Feet']);
-      assert.deepEqual(_.words('aeiouAreVowels'), ['aeiou', 'Are', 'Vowels']);
-      assert.deepEqual(_.words('enable 6h format'), ['enable', '6', 'h', 'format']);
-      assert.deepEqual(_.words('enable 24H format'), ['enable', '24', 'H', 'format']);
-      assert.deepEqual(_.words('isISO8601'), ['is', 'ISO', '8601']);
-      assert.deepEqual(_.words('LETTERSAeiouAreVowels'), ['LETTERS', 'Aeiou', 'Are', 'Vowels']);
-      assert.deepEqual(_.words('tooLegit2Quit'), ['too', 'Legit', '2', 'Quit']);
-      assert.deepEqual(_.words('walk500Miles'), ['walk', '500', 'Miles']);
-      assert.deepEqual(_.words('xhr2Request'), ['xhr', '2', 'Request']);
-      assert.deepEqual(_.words('XMLHttp'), ['XML', 'Http']);
-      assert.deepEqual(_.words('XmlHTTP'), ['Xml', 'HTTP']);
-      assert.deepEqual(_.words('XmlHttp'), ['Xml', 'Http']);
-    });
-
-    QUnit.test('should work with compound words containing diacritical marks', function(assert) {
-      assert.expect(3);
-
-      assert.deepEqual(_.words('LETTERSÆiouAreVowels'), ['LETTERS', 'Æiou', 'Are', 'Vowels']);
-      assert.deepEqual(_.words('æiouAreVowels'), ['æiou', 'Are', 'Vowels']);
-      assert.deepEqual(_.words('æiou2Consonants'), ['æiou', '2', 'Consonants']);
-    });
-
-    QUnit.test('should work with contractions', function(assert) {
-      assert.expect(2);
-
-      var postfixes = ['d', 'll', 'm', 're', 's', 't', 've'];
-
-      lodashStable.each(["'", '\u2019'], function(apos) {
-        var actual = lodashStable.map(postfixes, function(postfix) {
-          return _.words('a b' + apos + postfix +  ' c');
-        });
-
-        var expected = lodashStable.map(postfixes, function(postfix) {
-          return ['a', 'b' + apos + postfix, 'c'];
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-
-    QUnit.test('should work as an iteratee for methods like `_.map`', function(assert) {
-      assert.expect(1);
-
-      var strings = lodashStable.map(['a', 'b', 'c'], Object),
-          actual = lodashStable.map(strings, _.words);
-
-      assert.deepEqual(actual, [['a'], ['b'], ['c']]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.wrap');
-
-  (function() {
-    QUnit.test('should create a wrapped function', function(assert) {
-      assert.expect(1);
-
-      var p = _.wrap(_.escape, function(func, text) {
-        return '<p>' + func(text) + '</p>';
-      });
-
-      assert.strictEqual(p('fred, barney, & pebbles'), '<p>fred, barney, &amp; pebbles</p>');
-    });
-
-    QUnit.test('should provide the correct `wrapper` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      var wrapped = _.wrap(noop, function() {
-        args || (args = slice.call(arguments));
-      });
-
-      wrapped(1, 2, 3);
-      assert.deepEqual(args, [noop, 1, 2, 3]);
-    });
-
-    QUnit.test('should use `_.identity` when `wrapper` is nullish', function(assert) {
-      assert.expect(1);
-
-      var values = [, null, undefined],
-          expected = lodashStable.map(values, alwaysA);
-
-      var actual = lodashStable.map(values, function(value, index) {
-        var wrapped = index ? _.wrap('a', value) : _.wrap('a');
-        return wrapped('b', 'c');
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('should not set a `this` binding', function(assert) {
-      assert.expect(1);
-
-      var p = _.wrap(_.escape, function(func) {
-        return '<p>' + func(this.text) + '</p>';
-      });
-
-      var object = { 'p': p, 'text': 'fred, barney, & pebbles' };
-      assert.strictEqual(object.p(), '<p>fred, barney, &amp; pebbles</p>');
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('xor methods');
-
-  lodashStable.each(['xor', 'xorBy', 'xorWith'], function(methodName) {
-    var args = (function() { return arguments; }(1, 2, 3)),
-        func = _[methodName];
-
-    QUnit.test('`_.' + methodName + '` should return the symmetric difference of the given arrays', function(assert) {
-      assert.expect(1);
-
-      var actual = func([1, 2, 5], [2, 3, 5], [3, 4, 5]);
-      assert.deepEqual(actual, [1, 4, 5]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return an array of unique values', function(assert) {
-      assert.expect(2);
-
-      var actual = func([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]);
-      assert.deepEqual(actual, [1, 4, 5]);
-
-      actual = func([1, 1]);
-      assert.deepEqual(actual, [1]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return a new array when a single array is given', function(assert) {
-      assert.expect(1);
-
-      var array = [1];
-      assert.notStrictEqual(func(array), array);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ignore individual secondary arguments', function(assert) {
-      assert.expect(1);
-
-      var array = [0];
-      assert.deepEqual(func(array, 3, null, { '0': 1 }), array);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ignore values that are not arrays or `arguments` objects', function(assert) {
-      assert.expect(3);
-
-      var array = [1, 2];
-      assert.deepEqual(func(array, 3, { '0': 1 }, null), array);
-      assert.deepEqual(func(null, array, null, [2, 3]), [1, 3]);
-      assert.deepEqual(func(array, null, args, null), [3]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should return a wrapped value when chaining', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var wrapped = _([1, 2, 3])[methodName]([5, 2, 1, 4]);
-        assert.ok(wrapped instanceof _);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('`_.' + methodName + '` should work when in a lazy sequence before `head` or `last`', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE + 1),
-            wrapped = _(array).slice(1)[methodName]([LARGE_ARRAY_SIZE, LARGE_ARRAY_SIZE + 1]);
-
-        var actual = lodashStable.map(['head', 'last'], function(methodName) {
-          return wrapped[methodName]();
-        });
-
-        assert.deepEqual(actual, [1, LARGE_ARRAY_SIZE + 1]);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.xorBy');
-
-  (function() {
-    QUnit.test('should accept an `iteratee` argument', function(assert) {
-      assert.expect(2);
-
-      var actual = _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
-      assert.deepEqual(actual, [1.2, 4.3]);
-
-      actual = _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
-      assert.deepEqual(actual, [{ 'x': 2 }]);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.xorBy([2.1, 1.2], [4.3, 2.4], function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [4.3]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.xorWith');
-
-  (function() {
-    QUnit.test('should work with a `comparator` argument', function(assert) {
-      assert.expect(1);
-
-      var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }],
-          others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }],
-          actual = _.xorWith(objects, others, lodashStable.isEqual);
-
-      assert.deepEqual(actual, [objects[1], others[0]]);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('zipObject methods');
-
-  lodashStable.each(['zipObject', 'zipObjectDeep'], function(methodName) {
-    var func = _[methodName],
-        object = { 'barney': 36, 'fred': 40 },
-        isDeep = methodName == 'zipObjectDeep';
-
-    QUnit.test('`_.' + methodName + '` should zip together key/value arrays into an object', function(assert) {
-      assert.expect(1);
-
-      var actual = func(['barney', 'fred'], [36, 40]);
-      assert.deepEqual(actual, object);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ignore extra `values`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func(['a'], [1, 2]), { 'a': 1 });
-    });
-
-    QUnit.test('`_.' + methodName + '` should assign `undefined` values for extra `keys`', function(assert) {
-      assert.expect(1);
-
-      assert.deepEqual(func(['a', 'b'], [1]), { 'a': 1, 'b': undefined });
-    });
-
-    QUnit.test('`_.' + methodName + '` should ' + (isDeep ? '' : 'not ') + 'support deep paths', function(assert) {
-      assert.expect(2);
-
-      lodashStable.each(['a.b.c', ['a', 'b', 'c']], function(path, index) {
-        var expected = isDeep ? ({ 'a': { 'b': { 'c': 1 } } }) : (index ? { 'a,b,c': 1 } : { 'a.b.c': 1 });
-        assert.deepEqual(func([path], [1]), expected);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should work in a lazy sequence', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var values = lodashStable.range(LARGE_ARRAY_SIZE),
-            props = lodashStable.map(values, function(value) { return 'key' + value; }),
-            actual = _(props)[methodName](values).map(square).filter(isEven).take().value();
-
-        assert.deepEqual(actual, _.take(_.filter(_.map(func(props, values), square), isEven)));
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.zipWith');
-
-  (function() {
-    QUnit.test('should zip arrays combining grouped elements with `iteratee`', function(assert) {
-      assert.expect(2);
-
-      var array1 = [1, 2, 3],
-          array2 = [4, 5, 6],
-          array3 = [7, 8, 9];
-
-      var actual = _.zipWith(array1, array2, array3, function(a, b, c) {
-        return a + b + c;
-      });
-
-      assert.deepEqual(actual, [12, 15, 18]);
-
-      var actual = _.zipWith(array1, [], function(a, b) {
-        return a + (b || 0);
-      });
-
-      assert.deepEqual(actual, [1, 2, 3]);
-    });
-
-    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
-      assert.expect(1);
-
-      var args;
-
-      _.zipWith([1, 2], [3, 4], [5, 6], function() {
-        args || (args = slice.call(arguments));
-      });
-
-      assert.deepEqual(args, [1, 3, 5]);
-    });
-
-    QUnit.test('should perform a basic zip when `iteratee` is nullish', function(assert) {
-      assert.expect(1);
-
-      var array1 = [1, 2],
-          array2 = [3, 4],
-          values = [, null, undefined],
-          expected = lodashStable.map(values, lodashStable.constant(_.zip(array1, array2)));
-
-      var actual = lodashStable.map(values, function(value, index) {
-        return index ? _.zipWith(array1, array2, value) : _.zipWith(array1, array2);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash.unzip and lodash.zip');
-
-  lodashStable.each(['unzip', 'zip'], function(methodName, index) {
-    var func = _[methodName];
-    func = lodashStable.bind(index ? func.apply : func.call, func, null);
-
-    var object = {
-      'an empty array': [
-        [],
-        []
-      ],
-      '0-tuples': [
-        [[], []],
-        []
-      ],
-      '2-tuples': [
-        [['barney', 'fred'], [36, 40]],
-        [['barney', 36], ['fred', 40]]
-      ],
-      '3-tuples': [
-        [['barney', 'fred'], [36, 40], [false, true]],
-        [['barney', 36, false], ['fred', 40, true]]
-      ]
-    };
-
-    lodashStable.forOwn(object, function(pair, key) {
-      QUnit.test('`_.' + methodName + '` should work with ' + key, function(assert) {
-        assert.expect(2);
-
-        var actual = func(pair[0]);
-        assert.deepEqual(actual, pair[1]);
-        assert.deepEqual(func(actual), actual.length ? pair[0] : []);
-      });
-    });
-
-    QUnit.test('`_.' + methodName + '` should work with tuples of different lengths', function(assert) {
-      assert.expect(4);
-
-      var pair = [
-        [['barney', 36], ['fred', 40, false]],
-        [['barney', 'fred'], [36, 40], [undefined, false]]
-      ];
-
-      var actual = func(pair[0]);
-      assert.ok('0' in actual[2]);
-      assert.deepEqual(actual, pair[1]);
-
-      actual = func(actual);
-      assert.ok('2' in actual[0]);
-      assert.deepEqual(actual, [['barney', 36, undefined], ['fred', 40, false]]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should treat falsey values as empty arrays', function(assert) {
-      assert.expect(1);
-
-      var expected = lodashStable.map(falsey, alwaysEmptyArray);
-
-      var actual = lodashStable.map(falsey, function(value) {
-        return func([value, value, value]);
-      });
-
-      assert.deepEqual(actual, expected);
-    });
-
-    QUnit.test('`_.' + methodName + '` should ignore values that are not arrays or `arguments` objects', function(assert) {
-      assert.expect(1);
-
-      var array = [[1, 2], [3, 4], null, undefined, { '0': 1 }];
-      assert.deepEqual(func(array), [[1, 3], [2, 4]]);
-    });
-
-    QUnit.test('`_.' + methodName + '` should support consuming its return value', function(assert) {
-      assert.expect(1);
-
-      var expected = [['barney', 'fred'], [36, 40]];
-      assert.deepEqual(func(func(func(func(expected)))), expected);
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...).commit');
-
-  (function() {
-    QUnit.test('should execute the chained sequence and returns the wrapped result', function(assert) {
-      assert.expect(4);
-
-      if (!isNpm) {
-        var array = [1],
-            wrapped = _(array).push(2).push(3);
-
-        assert.deepEqual(array, [1]);
-
-        var otherWrapper = wrapped.commit();
-        assert.ok(otherWrapper instanceof _);
-        assert.deepEqual(otherWrapper.value(), [1, 2, 3]);
-        assert.deepEqual(wrapped.value(), [1, 2, 3, 2, 3]);
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should track the `__chain__` value of a wrapper', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var wrapped = _([1]).chain().commit().head();
-        assert.ok(wrapped instanceof _);
-        assert.strictEqual(wrapped.value(), 1);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...).next');
-
-  lodashStable.each([false, true], function(implict) {
-    function chain(value) {
-      return implict ? _(value) : _.chain(value);
-    }
-
-    var chainType = 'in an ' + (implict ? 'implict' : 'explict') + ' chain';
-
-    QUnit.test('should follow the iterator protocol ' + chainType, function(assert) {
-      assert.expect(3);
-
-      if (!isNpm) {
-        var wrapped = chain([1, 2]);
-
-        assert.deepEqual(wrapped.next(), { 'done': false, 'value': 1 });
-        assert.deepEqual(wrapped.next(), { 'done': false, 'value': 2 });
-        assert.deepEqual(wrapped.next(), { 'done': true,  'value': undefined });
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should act as an iterable ' + chainType, function(assert) {
-      assert.expect(2);
-
-      if (!isNpm && Symbol && Symbol.iterator) {
-        var array = [1, 2],
-            wrapped = chain(array);
-
-        assert.strictEqual(wrapped[Symbol.iterator](), wrapped);
-        assert.deepEqual(_.toArray(wrapped), array);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should use `_.toArray` to generate the iterable result ' + chainType, function(assert) {
-      assert.expect(3);
-
-      if (!isNpm && Array.from) {
-        var hearts = '\ud83d\udc95',
-            values = [[1], { 'a': 1 }, hearts];
-
-        lodashStable.each(values, function(value) {
-          var wrapped = chain(value);
-          assert.deepEqual(Array.from(wrapped), _.toArray(value));
-        });
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-
-    QUnit.test('should reset the iterator correctly ' + chainType, function(assert) {
-      assert.expect(4);
-
-      if (!isNpm && Symbol && Symbol.iterator) {
-        var array = [1, 2],
-            wrapped = chain(array);
-
-        assert.deepEqual(_.toArray(wrapped), array);
-        assert.deepEqual(_.toArray(wrapped), [], 'produces an empty array for exhausted iterator');
-
-        var other = wrapped.filter();
-        assert.deepEqual(_.toArray(other), array, 'reset for new chain segments');
-        assert.deepEqual(_.toArray(wrapped), [], 'iterator is still exhausted');
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should work in a lazy sequence ' + chainType, function(assert) {
-      assert.expect(3);
-
-      if (!isNpm && Symbol && Symbol.iterator) {
-        var array = lodashStable.range(LARGE_ARRAY_SIZE),
-            predicate = function(value) { values.push(value); return isEven(value); },
-            values = [],
-            wrapped = chain(array);
-
-        assert.deepEqual(_.toArray(wrapped), array);
-
-        wrapped = wrapped.filter(predicate);
-        assert.deepEqual(_.toArray(wrapped), _.filter(array, isEven), 'reset for new lazy chain segments');
-        assert.deepEqual(values, array, 'memoizes iterator values');
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-  });
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...).plant');
-
-  (function() {
-    QUnit.test('should clone the chained sequence planting `value` as the wrapped value', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var array1 = [5, null, 3, null, 1],
-            array2 = [10, null, 8, null, 6],
-            wrapped1 = _(array1).thru(_.compact).map(square).takeRight(2).sort(),
-            wrapped2 = wrapped1.plant(array2);
-
-        assert.deepEqual(wrapped2.value(), [36, 64]);
-        assert.deepEqual(wrapped1.value(), [1, 9]);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should clone `chainAll` settings', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var array1 = [2, 4],
-            array2 = [6, 8],
-            wrapped1 = _(array1).chain().map(square),
-            wrapped2 = wrapped1.plant(array2);
-
-        assert.deepEqual(wrapped2.head().value(), 36);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should reset iterator data on cloned sequences', function(assert) {
-      assert.expect(3);
-
-      if (!isNpm && Symbol && Symbol.iterator) {
-        var array1 = [2, 4],
-            array2 = [6, 8],
-            wrapped1 = _(array1).map(square);
-
-        assert.deepEqual(_.toArray(wrapped1), [4, 16]);
-        assert.deepEqual(_.toArray(wrapped1), []);
-
-        var wrapped2 = wrapped1.plant(array2);
-        assert.deepEqual(_.toArray(wrapped2), [36, 64]);
-      }
-      else {
-        skipAssert(assert, 3);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...).pop');
-
-  (function() {
-    QUnit.test('should remove elements from the end of `array`', function(assert) {
-      assert.expect(5);
-
-      if (!isNpm) {
-        var array = [1, 2],
-            wrapped = _(array);
-
-        assert.strictEqual(wrapped.pop(), 2);
-        assert.deepEqual(wrapped.value(), [1]);
-        assert.strictEqual(wrapped.pop(), 1);
-
-        var actual = wrapped.value();
-        assert.deepEqual(actual, []);
-        assert.strictEqual(actual, array);
-      }
-      else {
-        skipAssert(assert, 5);
-      }
-    });
-
-    QUnit.test('should accept falsey arguments', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var expected = lodashStable.map(falsey, alwaysTrue);
-
-        var actual = lodashStable.map(falsey, function(value, index) {
-          try {
-            var result = index ? _(value).pop() : _().pop();
-            return result === undefined;
-          } catch (e) {}
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...).push');
-
-  (function() {
-    QUnit.test('should append elements to `array`', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var array = [1],
-            wrapped = _(array).push(2, 3),
-            actual = wrapped.value();
-
-        assert.strictEqual(actual, array);
-        assert.deepEqual(actual, [1, 2, 3]);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should accept falsey arguments', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var expected = lodashStable.map(falsey, alwaysTrue);
-
-        var actual = lodashStable.map(falsey, function(value, index) {
-          try {
-            var result = index ? _(value).push(1).value() : _().push(1).value();
-            return lodashStable.eq(result, value);
-          } catch (e) {}
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...).shift');
-
-  (function() {
-    QUnit.test('should remove elements from the front of `array`', function(assert) {
-      assert.expect(5);
-
-      if (!isNpm) {
-        var array = [1, 2],
-            wrapped = _(array);
-
-        assert.strictEqual(wrapped.shift(), 1);
-        assert.deepEqual(wrapped.value(), [2]);
-        assert.strictEqual(wrapped.shift(), 2);
-
-        var actual = wrapped.value();
-        assert.deepEqual(actual, []);
-        assert.strictEqual(actual, array);
-      }
-      else {
-        skipAssert(assert, 5);
-      }
-    });
-
-    QUnit.test('should accept falsey arguments', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var expected = lodashStable.map(falsey, alwaysTrue);
-
-        var actual = lodashStable.map(falsey, function(value, index) {
-          try {
-            var result = index ? _(value).shift() : _().shift();
-            return result === undefined;
-          } catch (e) {}
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...).sort');
-
-  (function() {
-    QUnit.test('should return the wrapped sorted `array`', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var array = [3, 1, 2],
-            wrapped = _(array).sort(),
-            actual = wrapped.value();
-
-        assert.strictEqual(actual, array);
-        assert.deepEqual(actual, [1, 2, 3]);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should accept falsey arguments', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var expected = lodashStable.map(falsey, alwaysTrue);
-
-        var actual = lodashStable.map(falsey, function(value, index) {
-          try {
-            var result = index ? _(value).sort().value() : _().sort().value();
-            return lodashStable.eq(result, value);
-          } catch (e) {}
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...).splice');
-
-  (function() {
-    QUnit.test('should support removing and inserting elements', function(assert) {
-      assert.expect(5);
-
-      if (!isNpm) {
-        var array = [1, 2],
-            wrapped = _(array);
-
-        assert.deepEqual(wrapped.splice(1, 1, 3).value(), [2]);
-        assert.deepEqual(wrapped.value(), [1, 3]);
-        assert.deepEqual(wrapped.splice(0, 2).value(), [1, 3]);
-
-        var actual = wrapped.value();
-        assert.deepEqual(actual, []);
-        assert.strictEqual(actual, array);
-      }
-      else {
-        skipAssert(assert, 5);
-      }
-    });
-
-    QUnit.test('should accept falsey arguments', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var expected = lodashStable.map(falsey, alwaysTrue);
-
-        var actual = lodashStable.map(falsey, function(value, index) {
-          try {
-            var result = index ? _(value).splice(0, 1).value() : _().splice(0, 1).value();
-            return lodashStable.isEqual(result, []);
-          } catch (e) {}
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...).unshift');
-
-  (function() {
-    QUnit.test('should prepend elements to `array`', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var array = [3],
-            wrapped = _(array).unshift(1, 2),
-            actual = wrapped.value();
-
-        assert.strictEqual(actual, array);
-        assert.deepEqual(actual, [1, 2, 3]);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-
-    QUnit.test('should accept falsey arguments', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var expected = lodashStable.map(falsey, alwaysTrue);
-
-        var actual = lodashStable.map(falsey, function(value, index) {
-          try {
-            var result = index ? _(value).unshift(1).value() : _().unshift(1).value();
-            return lodashStable.eq(result, value);
-          } catch (e) {}
-        });
-
-        assert.deepEqual(actual, expected);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...).value');
-
-  (function() {
-    QUnit.test('should execute the chained sequence and extract the unwrapped value', function(assert) {
-      assert.expect(4);
-
-      if (!isNpm) {
-        var array = [1],
-            wrapped = _(array).push(2).push(3);
-
-        assert.deepEqual(array, [1]);
-        assert.deepEqual(wrapped.value(), [1, 2, 3]);
-        assert.deepEqual(wrapped.value(), [1, 2, 3, 2, 3]);
-        assert.deepEqual(array, [1, 2, 3, 2, 3]);
-      }
-      else {
-        skipAssert(assert, 4);
-      }
-    });
-
-    QUnit.test('should return the `valueOf` result of the wrapped value', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm) {
-        var wrapped = _(123);
-        assert.strictEqual(Number(wrapped), 123);
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should stringify the wrapped value when used by `JSON.stringify`', function(assert) {
-      assert.expect(1);
-
-      if (!isNpm && JSON) {
-        var wrapped = _([1, 2, 3]);
-        assert.strictEqual(JSON.stringify(wrapped), '[1,2,3]');
-      }
-      else {
-        skipAssert(assert);
-      }
-    });
-
-    QUnit.test('should be aliased', function(assert) {
-      assert.expect(2);
-
-      if (!isNpm) {
-        var expected = _.prototype.value;
-        assert.strictEqual(_.prototype.toJSON, expected);
-        assert.strictEqual(_.prototype.valueOf, expected);
-      }
-      else {
-        skipAssert(assert, 2);
-      }
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...) methods that return the wrapped modified array');
-
-  (function() {
-    var funcs = [
-      'push',
-      'reverse',
-      'sort',
-      'unshift'
-    ];
-
-    lodashStable.each(funcs, function(methodName) {
-      QUnit.test('`_(...).' + methodName + '` should return a new wrapper', function(assert) {
-        assert.expect(2);
-
-        if (!isNpm) {
-          var array = [1, 2, 3],
-              wrapped = _(array),
-              actual = wrapped[methodName]();
-
-          assert.ok(actual instanceof _);
-          assert.notStrictEqual(actual, wrapped);
-        }
-        else {
-          skipAssert(assert, 2);
-        }
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...) methods that return new wrapped values');
-
-  (function() {
-    var funcs = [
-      'castArray',
-      'concat',
-      'difference',
-      'differenceBy',
-      'differenceWith',
-      'intersection',
-      'intersectionBy',
-      'intersectionWith',
-      'pull',
-      'pullAll',
-      'pullAt',
-      'sampleSize',
-      'shuffle',
-      'slice',
-      'splice',
-      'split',
-      'toArray',
-      'union',
-      'unionBy',
-      'unionWith',
-      'uniq',
-      'uniqBy',
-      'uniqWith',
-      'words',
-      'xor',
-      'xorBy',
-      'xorWith'
-    ];
-
-    lodashStable.each(funcs, function(methodName) {
-      QUnit.test('`_(...).' + methodName + '` should return a new wrapped value', function(assert) {
-        assert.expect(2);
-
-        if (!isNpm) {
-          var value = methodName == 'split' ? 'abc' : [1, 2, 3],
-              wrapped = _(value),
-              actual = wrapped[methodName]();
-
-          assert.ok(actual instanceof _);
-          assert.notStrictEqual(actual, wrapped);
-        }
-        else {
-          skipAssert(assert, 2);
-        }
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash(...) methods that return unwrapped values');
-
-  (function() {
-    var funcs = [
-      'add',
-      'camelCase',
-      'capitalize',
-      'ceil',
-      'clone',
-      'deburr',
-      'divide',
-      'endsWith',
-      'escape',
-      'escapeRegExp',
-      'every',
-      'find',
-      'floor',
-      'has',
-      'hasIn',
-      'head',
-      'includes',
-      'isArguments',
-      'isArray',
-      'isArrayBuffer',
-      'isArrayLike',
-      'isBoolean',
-      'isBuffer',
-      'isDate',
-      'isElement',
-      'isEmpty',
-      'isEqual',
-      'isError',
-      'isFinite',
-      'isFunction',
-      'isInteger',
-      'isMap',
-      'isNaN',
-      'isNative',
-      'isNil',
-      'isNull',
-      'isNumber',
-      'isObject',
-      'isObjectLike',
-      'isPlainObject',
-      'isRegExp',
-      'isSafeInteger',
-      'isSet',
-      'isString',
-      'isUndefined',
-      'isWeakMap',
-      'isWeakSet',
-      'join',
-      'kebabCase',
-      'last',
-      'lowerCase',
-      'lowerFirst',
-      'max',
-      'maxBy',
-      'min',
-      'minBy',
-      'multiply',
-      'nth',
-      'pad',
-      'padEnd',
-      'padStart',
-      'parseInt',
-      'pop',
-      'random',
-      'reduce',
-      'reduceRight',
-      'repeat',
-      'replace',
-      'round',
-      'sample',
-      'shift',
-      'size',
-      'snakeCase',
-      'some',
-      'startCase',
-      'startsWith',
-      'subtract',
-      'sum',
-      'toInteger',
-      'toLower',
-      'toNumber',
-      'toSafeInteger',
-      'toString',
-      'toUpper',
-      'trim',
-      'trimEnd',
-      'trimStart',
-      'truncate',
-      'unescape',
-      'upperCase',
-      'upperFirst'
-    ];
-
-    lodashStable.each(funcs, function(methodName) {
-      QUnit.test('`_(...).' + methodName + '` should return an unwrapped value when implicitly chaining', function(assert) {
-        assert.expect(1);
-
-        if (!isNpm) {
-          var actual = _()[methodName]();
-          assert.notOk(actual instanceof _);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-
-      QUnit.test('`_(...).' + methodName + '` should return a wrapped value when explicitly chaining', function(assert) {
-        assert.expect(1);
-
-        if (!isNpm) {
-          var actual = _().chain()[methodName]();
-          assert.ok(actual instanceof _);
-        }
-        else {
-          skipAssert(assert);
-        }
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('"Arrays" category methods');
-
-  (function() {
-    var args = (function() { return arguments; }(1, null, [3], null, 5)),
-        sortedArgs = (function() { return arguments; }(1, [3], 5, null, null)),
-        array = [1, 2, 3, 4, 5, 6];
-
-    QUnit.test('should work with `arguments` objects', function(assert) {
-      assert.expect(30);
-
-      function message(methodName) {
-        return '`_.' + methodName + '` should work with `arguments` objects';
-      }
-
-      assert.deepEqual(_.difference(args, [null]), [1, [3], 5], message('difference'));
-      assert.deepEqual(_.difference(array, args), [2, 3, 4, 6], '_.difference should work with `arguments` objects as secondary arguments');
-
-      assert.deepEqual(_.union(args, [null, 6]), [1, null, [3], 5, 6], message('union'));
-      assert.deepEqual(_.union(array, args), array.concat([null, [3]]), '_.union should work with `arguments` objects as secondary arguments');
-
-      assert.deepEqual(_.compact(args), [1, [3], 5], message('compact'));
-      assert.deepEqual(_.drop(args, 3), [null, 5], message('drop'));
-      assert.deepEqual(_.dropRight(args, 3), [1, null], message('dropRight'));
-      assert.deepEqual(_.dropRightWhile(args,identity), [1, null, [3], null], message('dropRightWhile'));
-      assert.deepEqual(_.dropWhile(args,identity), [null, [3], null, 5], message('dropWhile'));
-      assert.deepEqual(_.findIndex(args, identity), 0, message('findIndex'));
-      assert.deepEqual(_.findLastIndex(args, identity), 4, message('findLastIndex'));
-      assert.deepEqual(_.flatten(args), [1, null, 3, null, 5], message('flatten'));
-      assert.deepEqual(_.head(args), 1, message('head'));
-      assert.deepEqual(_.indexOf(args, 5), 4, message('indexOf'));
-      assert.deepEqual(_.initial(args), [1, null, [3], null], message('initial'));
-      assert.deepEqual(_.intersection(args, [1]), [1], message('intersection'));
-      assert.deepEqual(_.last(args), 5, message('last'));
-      assert.deepEqual(_.lastIndexOf(args, 1), 0, message('lastIndexOf'));
-      assert.deepEqual(_.sortedIndex(sortedArgs, 6), 3, message('sortedIndex'));
-      assert.deepEqual(_.sortedIndexOf(sortedArgs, 5), 2, message('sortedIndexOf'));
-      assert.deepEqual(_.sortedLastIndex(sortedArgs, 5), 3, message('sortedLastIndex'));
-      assert.deepEqual(_.sortedLastIndexOf(sortedArgs, 1), 0, message('sortedLastIndexOf'));
-      assert.deepEqual(_.tail(args, 4), [null, [3], null, 5], message('tail'));
-      assert.deepEqual(_.take(args, 2), [1, null], message('take'));
-      assert.deepEqual(_.takeRight(args, 1), [5], message('takeRight'));
-      assert.deepEqual(_.takeRightWhile(args, identity), [5], message('takeRightWhile'));
-      assert.deepEqual(_.takeWhile(args, identity), [1], message('takeWhile'));
-      assert.deepEqual(_.uniq(args), [1, null, [3], 5], message('uniq'));
-      assert.deepEqual(_.without(args, null), [1, [3], 5], message('without'));
-      assert.deepEqual(_.zip(args, args), [[1, 1], [null, null], [[3], [3]], [null, null], [5, 5]], message('zip'));
-    });
-
-    QUnit.test('should accept falsey primary arguments', function(assert) {
-      assert.expect(4);
-
-      function message(methodName) {
-        return '`_.' + methodName + '` should accept falsey primary arguments';
-      }
-
-      assert.deepEqual(_.difference(null, array), [], message('difference'));
-      assert.deepEqual(_.intersection(null, array), [], message('intersection'));
-      assert.deepEqual(_.union(null, array), array, message('union'));
-      assert.deepEqual(_.xor(null, array), array, message('xor'));
-    });
-
-    QUnit.test('should accept falsey secondary arguments', function(assert) {
-      assert.expect(3);
-
-      function message(methodName) {
-        return '`_.' + methodName + '` should accept falsey secondary arguments';
-      }
-
-      assert.deepEqual(_.difference(array, null), array, message('difference'));
-      assert.deepEqual(_.intersection(array, null), [], message('intersection'));
-      assert.deepEqual(_.union(array, null), array, message('union'));
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('"Strings" category methods');
-
-  (function() {
-    var stringMethods = [
-      'camelCase',
-      'capitalize',
-      'escape',
-      'kebabCase',
-      'lowerCase',
-      'lowerFirst',
-      'pad',
-      'padEnd',
-      'padStart',
-      'repeat',
-      'snakeCase',
-      'toLower',
-      'toUpper',
-      'trim',
-      'trimEnd',
-      'trimStart',
-      'truncate',
-      'unescape',
-      'upperCase',
-      'upperFirst'
-    ];
-
-    lodashStable.each(stringMethods, function(methodName) {
-      var func = _[methodName];
-
-      QUnit.test('`_.' + methodName + '` should return an empty string for empty values', function(assert) {
-        assert.expect(1);
-
-        var values = [, null, undefined, ''],
-            expected = lodashStable.map(values, alwaysEmptyString);
-
-        var actual = lodashStable.map(values, function(value, index) {
-          return index ? func(value) : func();
-        });
-
-        assert.deepEqual(actual, expected);
-      });
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.module('lodash methods');
-
-  (function() {
-    var allMethods = lodashStable.reject(_.functions(_).sort(), function(methodName) {
-      return lodashStable.startsWith(methodName, '_');
-    });
-
-    var checkFuncs = [
-      'after',
-      'ary',
-      'before',
-      'bind',
-      'curry',
-      'curryRight',
-      'debounce',
-      'defer',
-      'delay',
-      'flip',
-      'flow',
-      'flowRight',
-      'memoize',
-      'negate',
-      'once',
-      'partial',
-      'partialRight',
-      'rearg',
-      'rest',
-      'spread',
-      'throttle',
-      'unary'
-    ];
-
-    var noBinding = [
-      'flip',
-      'memoize',
-      'negate',
-      'once',
-      'overArgs',
-      'partial',
-      'partialRight',
-      'rearg',
-      'rest',
-      'spread'
-    ];
-
-    var rejectFalsey = [
-      'tap',
-      'thru'
-    ].concat(checkFuncs);
-
-    var returnArrays = [
-      'at',
-      'chunk',
-      'compact',
-      'difference',
-      'drop',
-      'filter',
-      'flatten',
-      'functions',
-      'initial',
-      'intersection',
-      'invokeMap',
-      'keys',
-      'map',
-      'orderBy',
-      'pull',
-      'pullAll',
-      'pullAt',
-      'range',
-      'rangeRight',
-      'reject',
-      'remove',
-      'shuffle',
-      'sortBy',
-      'tail',
-      'take',
-      'times',
-      'toArray',
-      'toPairs',
-      'toPairsIn',
-      'union',
-      'uniq',
-      'values',
-      'without',
-      'xor',
-      'zip'
-    ];
-
-    var acceptFalsey = lodashStable.difference(allMethods, rejectFalsey);
-
-    QUnit.test('should accept falsey arguments', function(assert) {
-      assert.expect(308);
-
-      var emptyArrays = lodashStable.map(falsey, alwaysEmptyArray);
-
-      lodashStable.each(acceptFalsey, function(methodName) {
-        var expected = emptyArrays,
-            func = _[methodName],
-            pass = true;
-
-        var actual = lodashStable.map(falsey, function(value, index) {
-          try {
-            return index ? func(value) : func();
-          } catch (e) {
-            pass = false;
-          }
-        });
-
-        if (methodName == 'noConflict') {
-          root._ = oldDash;
-        }
-        else if (methodName == 'pull' || methodName == 'pullAll') {
-          expected = falsey;
-        }
-        if (lodashStable.includes(returnArrays, methodName) && methodName != 'sample') {
-          assert.deepEqual(actual, expected, '_.' + methodName + ' returns an array');
-        }
-        assert.ok(pass, '`_.' + methodName + '` accepts falsey arguments');
-      });
-
-      // Skip tests for missing methods of modularized builds.
-      lodashStable.each(['chain', 'noConflict', 'runInContext'], function(methodName) {
-        if (!_[methodName]) {
-          skipAssert(assert);
-        }
-      });
-    });
-
-    QUnit.test('should return an array', function(assert) {
-      assert.expect(70);
-
-      var array = [1, 2, 3];
-
-      lodashStable.each(returnArrays, function(methodName) {
-        var actual,
-            func = _[methodName];
-
-        switch (methodName) {
-          case 'invokeMap':
-            actual = func(array, 'toFixed');
-            break;
-          case 'sample':
-            actual = func(array, 1);
-            break;
-          default:
-            actual = func(array);
-        }
-        assert.ok(lodashStable.isArray(actual), '_.' + methodName + ' returns an array');
-
-        var isPull = methodName == 'pull' || methodName == 'pullAll';
-        assert.strictEqual(actual === array, isPull, '_.' + methodName + ' should ' + (isPull ? '' : 'not ') + 'return the given array');
-      });
-    });
-
-    QUnit.test('should throw an error for falsey arguments', function(assert) {
-      assert.expect(24);
-
-      lodashStable.each(rejectFalsey, function(methodName) {
-        var expected = lodashStable.map(falsey, alwaysTrue),
-            func = _[methodName];
-
-        var actual = lodashStable.map(falsey, function(value, index) {
-          var pass = !index && /^(?:backflow|compose|cond|flow(Right)?|over(?:Every|Some)?)$/.test(methodName);
-
-          try {
-            index ? func(value) : func();
-          } catch (e) {
-            pass = !pass && (e instanceof TypeError) &&
-              (!lodashStable.includes(checkFuncs, methodName) || (e.message == FUNC_ERROR_TEXT));
-          }
-          return pass;
-        });
-
-        assert.deepEqual(actual, expected, '`_.' + methodName + '` rejects falsey arguments');
-      });
-    });
-
-    QUnit.test('should not set a `this` binding', function(assert) {
-      assert.expect(30);
-
-      lodashStable.each(noBinding, function(methodName) {
-        var fn = function() { return this.a; },
-            func = _[methodName],
-            isNegate = methodName == 'negate',
-            object = { 'a': 1 },
-            expected = isNegate ? false : 1;
-
-        var wrapper = func(_.bind(fn, object));
-        assert.strictEqual(wrapper(), expected, '`_.' + methodName + '` can consume a bound function');
-
-        wrapper = _.bind(func(fn), object);
-        assert.strictEqual(wrapper(), expected, '`_.' + methodName + '` can be bound');
-
-        object.wrapper = func(fn);
-        assert.strictEqual(object.wrapper(), expected, '`_.' + methodName + '` uses the `this` of its parent object');
-      });
-    });
-
-    QUnit.test('should not contain minified method names (test production builds)', function(assert) {
-      assert.expect(1);
-
-      var shortNames = ['_', 'at', 'eq', 'gt', 'lt'];
-      assert.ok(lodashStable.every(_.functions(_), function(methodName) {
-        return methodName.length > 2 || lodashStable.includes(shortNames, methodName);
-      }));
-    });
-  }());
-
-  /*--------------------------------------------------------------------------*/
-
-  QUnit.config.asyncRetries = 10;
-  QUnit.config.hidepassed = true;
-
-  if (!document) {
-    QUnit.config.noglobals = true;
-    QUnit.load();
-  }
-}.call(this));
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/underscore.html b/views/ngXosViews/serviceGrid/src/vendor/lodash/test/underscore.html
deleted file mode 100644
index a3e56e8..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/test/underscore.html
+++ /dev/null
@@ -1,484 +0,0 @@
-<!doctype html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <title>Underscore Test Suite</title>
-    <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
-  </head>
-  <body>
-    <div id="qunit"></div>
-    <script>
-      // Avoid reporting tests to Sauce Labs when script errors occur.
-      if (location.port == '9001') {
-        window.onerror = function(message) {
-          if (window.QUnit) {
-            QUnit.config.done.length = 0;
-          }
-          global_test_results = { 'message': message };
-        };
-      }
-    </script>
-    <script src="../node_modules/qunitjs/qunit/qunit.js"></script>
-    <script src="../node_modules/qunit-extras/qunit-extras.js"></script>
-    <script src="../node_modules/jquery/dist/jquery.js"></script>
-    <script src="../node_modules/platform/platform.js"></script>
-    <script src="./asset/test-ui.js"></script>
-    <script src="../lodash.js"></script>
-    <script>
-      QUnit.config.asyncRetries = 10;
-      QUnit.config.hidepassed = true;
-      QUnit.config.excused = {
-        'Arrays': {
-          'chunk': [
-            'defaults to empty array (chunk size 0)'
-          ],
-          'difference': [
-            'can perform an OO-style difference'
-          ],
-          'drop': [
-            'is an alias for rest'
-          ],
-          'first': [
-            'returns an empty array when n <= 0 (0 case)',
-            'returns an empty array when n <= 0 (negative case)',
-            'can fetch the first n elements',
-            'returns the whole array if n > length'
-          ],
-          'findIndex': [
-            'called with context'
-          ],
-          'findLastIndex': [
-            'called with context'
-          ],
-          'flatten': [
-            'supports empty arrays',
-            'can flatten nested arrays',
-            'works on an arguments object',
-            'can handle very deep arrays'
-          ],
-          'head': [
-            'is an alias for first'
-          ],
-          'indexOf': [
-            "sorted indexOf doesn't uses binary search",
-            '0'
-          ],
-          'initial': [
-            'returns all but the last n elements',
-            'returns an empty array when n > length',
-            'works on an arguments object'
-          ],
-          'intersection': [
-            'can perform an OO-style intersection'
-          ],
-          'last': [
-            'returns an empty array when n <= 0 (0 case)',
-            'returns an empty array when n <= 0 (negative case)',
-            'can fetch the last n elements',
-            'returns the whole array if n > length'
-          ],
-          'lastIndexOf': [
-            'should treat falsey `fromIndex` values, except `0` and `NaN`, as `array.length`',
-            'should treat non-number `fromIndex` values as `array.length`',
-            '[0,-1,-1]'
-          ],
-          'object': [
-            'an array of pairs zipped together into an object',
-            'an object converted to pairs and back to an object'
-          ],
-          'range': [
-            'range with two arguments a &amp; b, b&lt;a generates an empty array'
-          ],
-          'rest': [
-            'returns the whole array when index is 0',
-            'returns elements starting at the given index',
-            'works on an arguments object'
-          ],
-          'sortedIndex': [
-            '2',
-            '3'
-          ],
-          'tail': [
-            'is an alias for rest'
-          ],
-          'take': [
-            'is an alias for first'
-          ],
-          'uniq': [
-            'uses the result of `iterator` for uniqueness comparisons (unsorted case)',
-            '`sorted` argument defaults to false when omitted',
-            'when `iterator` is a string, uses that key for comparisons (unsorted case)',
-            'uses the result of `iterator` for uniqueness comparisons (sorted case)',
-            'when `iterator` is a string, uses that key for comparisons (sorted case)',
-            'can use falsey pluck like iterator'
-          ],
-          'union': [
-            'can perform an OO-style union'
-          ]
-        },
-        'Chaining': {
-          'pop': true,
-          'shift': true,
-          'splice': true,
-          'reverse/concat/unshift/pop/map': [
-            'can chain together array functions.'
-          ]
-        },
-        'Collections': {
-          'lookupIterator with contexts': true,
-          'Iterating objects with sketchy length properties': true,
-          'Resistant to collection length and properties changing while iterating': true,
-          'countBy': [
-            'true'
-          ],
-          'each': [
-            'context object property accessed'
-          ],
-          'every': [
-            'Can be called with object',
-            'Died on test #15',
-            'context works'
-          ],
-          'filter': [
-            'given context',
-            '[{"a":1,"b":2},{"a":1,"b":3},{"a":1,"b":4}]',
-            '[{"a":1,"b":2},{"a":2,"b":2}]',
-            'Empty object accepts all items',
-            'OO-filter'
-          ],
-          'find': [
-            '{"a":1,"b":4}',
-            'undefined when not found',
-            'undefined when searching empty list',
-            'works on objects',
-            'undefined',
-            'called with context'
-          ],
-          'findWhere': [
-            'checks properties given function'
-          ],
-          'groupBy': [
-            'true'
-          ],
-          'includes': [
-            "doesn't delegate to binary search"
-          ],
-          'invoke': [
-            'handles null & undefined'
-          ],
-          'map': [
-            'tripled numbers with context',
-            'OO-style doubled numbers'
-          ],
-          'max': [
-            'can handle null/undefined',
-            'can perform a computation-based max',
-            'Maximum value of an empty object',
-            'Maximum value of an empty array',
-            'Maximum value of a non-numeric collection',
-            'Finds correct max in array starting with num and containing a NaN',
-            'Finds correct max in array starting with NaN',
-            'Respects iterator return value of -Infinity',
-            'String keys use property iterator',
-            'Iterator context',
-            'Lookup falsy iterator'
-          ],
-          'min': [
-            'can handle null/undefined',
-            'can perform a computation-based min',
-            'Minimum value of an empty object',
-            'Minimum value of an empty array',
-            'Minimum value of a non-numeric collection',
-            'Finds correct min in array starting with NaN',
-            'Respects iterator return value of Infinity',
-            'String keys use property iterator',
-            'Iterator context',
-            'Lookup falsy iterator'
-          ],
-          'partition': [
-            'can reference the array index',
-            'Died on test #8',
-            'partition takes a context argument',
-            'function(a){[code]}'
-          ],
-          'pluck': [
-            '[1]'
-          ],
-          'reduce': [
-            'can reduce with a context object'
-          ],
-          'reject': [
-            'Returns empty list given empty array'
-          ],
-          'sample': [
-            'behaves correctly on negative n',
-            'Died on test #3'
-          ],
-          'some': [
-            'Can be called with object',
-            'Died on test #17',
-            'context works'
-          ],
-          'where': [
-            'checks properties given function'
-          ],
-          'Can use various collection methods on NodeLists': [
-            '<span id="id2"></span>',
-            '<span id="id1"></span>'
-          ]
-        },
-        'Functions': {
-          'debounce asap': true,
-          'debounce asap cancel': true,
-          'debounce after system time is set backwards': true,
-          'debounce asap recursively': true,
-          'throttle repeatedly with results': true,
-          'more throttle does not trigger leading call when leading is set to false': true,
-          'throttle does not trigger trailing call when trailing is set to false': true,
-          'before': [
-            'stores a memo to the last value',
-            'provides context'
-          ],
-          'bind': [
-            'Died on test #2'
-          ],
-          'bindAll': [
-            'throws an error for bindAll with no functions named'
-          ],
-          'memoize': [
-            '{"bar":"BAR","foo":"FOO"}',
-            'Died on test #8'
-          ],
-          'partial':[
-            'can partially apply with placeholders',
-            'accepts more arguments than the number of placeholders',
-            'accepts fewer arguments than the number of placeholders',
-            'unfilled placeholders are undefined',
-            'keeps prototype',
-            'allows the placeholder to be swapped out'
-          ]
-        },
-        'Objects': {
-          '#1929 Typed Array constructors are functions': true,
-          'allKeys': [
-            'is not fooled by sparse arrays; see issue #95',
-            'is not fooled by sparse arrays with additional properties',
-            '[]'
-          ],
-          'defaults': [
-            'defaults skips nulls',
-            'defaults skips undefined'
-          ],
-          'extend': [
-            'extending null results in null',
-            'extending undefined results in undefined'
-          ],
-          'extendOwn': [
-            'extending non-objects results in returning the non-object value',
-            'extending undefined results in undefined'
-          ],
-          'functions': [
-            'also looks up functions on the prototype'
-          ],
-          'isEqual': [
-            '`0` is not equal to `-0`',
-            'Commutative equality is implemented for `0` and `-0`',
-            '`new Number(0)` and `-0` are not equal',
-            'Commutative equality is implemented for `new Number(0)` and `-0`',
-            'false'
-          ],
-          'isFinite': [
-            'Numeric strings are numbers',
-            'Number instances can be finite'
-          ],
-          'isMatch': [
-            'doesnt falsey match constructor on undefined/null'
-          ],
-          'isSet': [
-            'Died on test #9'
-          ],
-          'findKey': [
-            'called with context'
-          ],
-          'keys': [
-            'is not fooled by sparse arrays; see issue #95',
-            '[]'
-          ],
-          'mapObject': [
-            'keep context',
-            'called with context',
-            'mapValue identity'
-          ],
-          'matcher': [
-            'null matches null',
-            'treats primitives as empty'
-          ],
-          'omit': [
-            'can accept a predicate',
-            'function is given context'
-          ],
-          'pick': [
-            'can accept a predicate and context',
-            'function is given context'
-          ]
-        },
-        'Utility': {
-          'noConflict (node vm)': true,
-          'now': [
-            'Produces the correct time in milliseconds'
-          ],
-          'times': [
-            'works as a wrapper'
-          ]
-        }
-      };
-
-      var mixinPrereqs = (function() {
-        var aliasToReal = {
-          'all': 'every',
-          'allKeys': 'keysIn',
-          'any': 'some',
-          'collect': 'map',
-          'compose': 'flowRight',
-          'contains': 'includes',
-          'detect': 'find',
-          'extendOwn': 'assign',
-          'findWhere': 'find',
-          'foldl': 'reduce',
-          'foldr': 'reduceRight',
-          'include': 'includes',
-          'indexBy': 'keyBy',
-          'inject': 'reduce',
-          'invoke': 'invokeMap',
-          'mapObject': 'mapValues',
-          'matcher': 'matches',
-          'methods': 'functions',
-          'object': 'zipObject',
-          'pairs': 'toPairs',
-          'pluck': 'map',
-          'restParam': 'restArgs',
-          'select': 'filter',
-          'unique': 'uniq',
-          'where': 'filter'
-        };
-
-        var keyMap = {
-          'rest': 'tail',
-          'restArgs': 'rest'
-        };
-
-        var lodash = _.noConflict();
-
-        return function(_) {
-          lodash.defaultsDeep(_, { 'templateSettings': lodash.templateSettings });
-          lodash.mixin(_, lodash.pick(lodash, lodash.difference(lodash.functions(lodash), lodash.functions(_))));
-
-          lodash.forOwn(keyMap, function(realName, otherName) {
-            _[otherName] = lodash[realName];
-            _.prototype[otherName] = lodash.prototype[realName];
-          });
-
-          lodash.forOwn(aliasToReal, function(realName, alias) {
-            _[alias] = _[realName];
-            _.prototype[alias] = _.prototype[realName];
-          });
-        };
-      }());
-
-      // Only excuse in Sauce Labs.
-      if (!ui.isSauceLabs) {
-        delete QUnit.config.excused.Functions['throttle does not trigger trailing call when trailing is set to false'];
-        delete QUnit.config.excused.Utility.now;
-      }
-      // Load prerequisite scripts.
-      document.write(ui.urlParams.loader == 'none'
-        ? '<script src="' + ui.buildPath + '"><\/script>'
-        : '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
-      );
-    </script>
-    <script>
-      if (ui.urlParams.loader == 'none') {
-        mixinPrereqs(_);
-        document.write([
-          '<script src="../vendor/underscore/test/collections.js"><\/script>',
-          '<script src="../vendor/underscore/test/arrays.js"><\/script>',
-          '<script src="../vendor/underscore/test/functions.js"><\/script>',
-          '<script src="../vendor/underscore/test/objects.js"><\/script>',
-          '<script src="../vendor/underscore/test/cross-document.js"><\/script>',
-          '<script src="../vendor/underscore/test/utility.js"><\/script>',
-          '<script src="../vendor/underscore/test/chaining.js"><\/script>'
-        ].join('\n'));
-      }
-    </script>
-    <script>
-      (function() {
-        if (window.curl) {
-          curl.config({ 'apiName': 'require' });
-        }
-        if (!window.require) {
-          return;
-        }
-        // Wrap to work around tests assuming Node `require` use.
-        require = (function(func) {
-          return function() {
-            return arguments[0] === '..' ? window._ : func.apply(null, arguments);
-          };
-        }(require));
-
-        var reBasename = /[\w.-]+$/,
-            basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
-            modulePath = ui.buildPath.replace(/\.js$/, ''),
-            locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
-            moduleId = /\bunderscore\b/i.test(ui.buildPath) ? 'underscore' : 'lodash',
-            moduleMain = modulePath.match(reBasename)[0],
-            uid = +new Date;
-
-        function getConfig() {
-          var result = {
-            'baseUrl': './',
-            'urlArgs': 't=' + uid++,
-            'waitSeconds': 0,
-            'paths': {},
-            'packages': [{
-              'name': 'test',
-              'location': '../vendor/underscore/test',
-              'config': {
-                // Work around no global being exported.
-                'exports': 'QUnit',
-                'loader': 'curl/loader/legacy'
-              }
-            }]
-          };
-
-          if (ui.isModularize) {
-            result.packages.push({
-              'name': moduleId,
-              'location': locationPath,
-              'main': moduleMain
-            });
-          } else {
-            result.paths[moduleId] = modulePath;
-          }
-          return result;
-        }
-
-        QUnit.config.autostart = false;
-
-        require(getConfig(), [moduleId], function(lodash) {
-          mixinPrereqs(lodash);
-          require(getConfig(), [
-            'test/collections',
-            'test/arrays',
-            'test/functions',
-            'test/objects',
-            'test/cross-document',
-            'test/utility',
-            'test/chaining'
-          ], function() {
-            QUnit.start();
-          });
-        });
-      }());
-    </script>
-  </body>
-</html>
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/LICENSE b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/LICENSE
deleted file mode 100644
index 02c89b2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2010-2016 Jeremy Ashkenas, DocumentCloud
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/backbone.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/backbone.js
deleted file mode 100644
index 55ccb22..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/backbone.js
+++ /dev/null
@@ -1,1920 +0,0 @@
-//     Backbone.js 1.3.3
-
-//     (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-//     Backbone may be freely distributed under the MIT license.
-//     For all details and documentation:
-//     http://backbonejs.org
-
-(function(factory) {
-
-  // Establish the root object, `window` (`self`) in the browser, or `global` on the server.
-  // We use `self` instead of `window` for `WebWorker` support.
-  var root = (typeof self == 'object' && self.self === self && self) ||
-            (typeof global == 'object' && global.global === global && global);
-
-  // Set up Backbone appropriately for the environment. Start with AMD.
-  if (typeof define === 'function' && define.amd) {
-    define(['underscore', 'jquery', 'exports'], function(_, $, exports) {
-      // Export global even in AMD case in case this script is loaded with
-      // others that may still expect a global Backbone.
-      root.Backbone = factory(root, exports, _, $);
-    });
-
-  // Next for Node.js or CommonJS. jQuery may not be needed as a module.
-  } else if (typeof exports !== 'undefined') {
-    var _ = require('underscore'), $;
-    try { $ = require('jquery'); } catch (e) {}
-    factory(root, exports, _, $);
-
-  // Finally, as a browser global.
-  } else {
-    root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$));
-  }
-
-})(function(root, Backbone, _, $) {
-
-  // Initial Setup
-  // -------------
-
-  // Save the previous value of the `Backbone` variable, so that it can be
-  // restored later on, if `noConflict` is used.
-  var previousBackbone = root.Backbone;
-
-  // Create a local reference to a common array method we'll want to use later.
-  var slice = Array.prototype.slice;
-
-  // Current version of the library. Keep in sync with `package.json`.
-  Backbone.VERSION = '1.3.3';
-
-  // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
-  // the `$` variable.
-  Backbone.$ = $;
-
-  // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
-  // to its previous owner. Returns a reference to this Backbone object.
-  Backbone.noConflict = function() {
-    root.Backbone = previousBackbone;
-    return this;
-  };
-
-  // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
-  // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and
-  // set a `X-Http-Method-Override` header.
-  Backbone.emulateHTTP = false;
-
-  // Turn on `emulateJSON` to support legacy servers that can't deal with direct
-  // `application/json` requests ... this will encode the body as
-  // `application/x-www-form-urlencoded` instead and will send the model in a
-  // form param named `model`.
-  Backbone.emulateJSON = false;
-
-  // Proxy Backbone class methods to Underscore functions, wrapping the model's
-  // `attributes` object or collection's `models` array behind the scenes.
-  //
-  // collection.filter(function(model) { return model.get('age') > 10 });
-  // collection.each(this.addView);
-  //
-  // `Function#apply` can be slow so we use the method's arg count, if we know it.
-  var addMethod = function(length, method, attribute) {
-    switch (length) {
-      case 1: return function() {
-        return _[method](this[attribute]);
-      };
-      case 2: return function(value) {
-        return _[method](this[attribute], value);
-      };
-      case 3: return function(iteratee, context) {
-        return _[method](this[attribute], cb(iteratee, this), context);
-      };
-      case 4: return function(iteratee, defaultVal, context) {
-        return _[method](this[attribute], cb(iteratee, this), defaultVal, context);
-      };
-      default: return function() {
-        var args = slice.call(arguments);
-        args.unshift(this[attribute]);
-        return _[method].apply(_, args);
-      };
-    }
-  };
-  var addUnderscoreMethods = function(Class, methods, attribute) {
-    _.each(methods, function(length, method) {
-      if (_[method]) Class.prototype[method] = addMethod(length, method, attribute);
-    });
-  };
-
-  // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`.
-  var cb = function(iteratee, instance) {
-    if (_.isFunction(iteratee)) return iteratee;
-    if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee);
-    if (_.isString(iteratee)) return function(model) { return model.get(iteratee); };
-    return iteratee;
-  };
-  var modelMatcher = function(attrs) {
-    var matcher = _.matches(attrs);
-    return function(model) {
-      return matcher(model.attributes);
-    };
-  };
-
-  // Backbone.Events
-  // ---------------
-
-  // A module that can be mixed in to *any object* in order to provide it with
-  // a custom event channel. You may bind a callback to an event with `on` or
-  // remove with `off`; `trigger`-ing an event fires all callbacks in
-  // succession.
-  //
-  //     var object = {};
-  //     _.extend(object, Backbone.Events);
-  //     object.on('expand', function(){ alert('expanded'); });
-  //     object.trigger('expand');
-  //
-  var Events = Backbone.Events = {};
-
-  // Regular expression used to split event strings.
-  var eventSplitter = /\s+/;
-
-  // Iterates over the standard `event, callback` (as well as the fancy multiple
-  // space-separated events `"change blur", callback` and jQuery-style event
-  // maps `{event: callback}`).
-  var eventsApi = function(iteratee, events, name, callback, opts) {
-    var i = 0, names;
-    if (name && typeof name === 'object') {
-      // Handle event maps.
-      if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback;
-      for (names = _.keys(name); i < names.length ; i++) {
-        events = eventsApi(iteratee, events, names[i], name[names[i]], opts);
-      }
-    } else if (name && eventSplitter.test(name)) {
-      // Handle space-separated event names by delegating them individually.
-      for (names = name.split(eventSplitter); i < names.length; i++) {
-        events = iteratee(events, names[i], callback, opts);
-      }
-    } else {
-      // Finally, standard events.
-      events = iteratee(events, name, callback, opts);
-    }
-    return events;
-  };
-
-  // Bind an event to a `callback` function. Passing `"all"` will bind
-  // the callback to all events fired.
-  Events.on = function(name, callback, context) {
-    return internalOn(this, name, callback, context);
-  };
-
-  // Guard the `listening` argument from the public API.
-  var internalOn = function(obj, name, callback, context, listening) {
-    obj._events = eventsApi(onApi, obj._events || {}, name, callback, {
-      context: context,
-      ctx: obj,
-      listening: listening
-    });
-
-    if (listening) {
-      var listeners = obj._listeners || (obj._listeners = {});
-      listeners[listening.id] = listening;
-    }
-
-    return obj;
-  };
-
-  // Inversion-of-control versions of `on`. Tell *this* object to listen to
-  // an event in another object... keeping track of what it's listening to
-  // for easier unbinding later.
-  Events.listenTo = function(obj, name, callback) {
-    if (!obj) return this;
-    var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
-    var listeningTo = this._listeningTo || (this._listeningTo = {});
-    var listening = listeningTo[id];
-
-    // This object is not listening to any other events on `obj` yet.
-    // Setup the necessary references to track the listening callbacks.
-    if (!listening) {
-      var thisId = this._listenId || (this._listenId = _.uniqueId('l'));
-      listening = listeningTo[id] = {obj: obj, objId: id, id: thisId, listeningTo: listeningTo, count: 0};
-    }
-
-    // Bind callbacks on obj, and keep track of them on listening.
-    internalOn(obj, name, callback, this, listening);
-    return this;
-  };
-
-  // The reducing API that adds a callback to the `events` object.
-  var onApi = function(events, name, callback, options) {
-    if (callback) {
-      var handlers = events[name] || (events[name] = []);
-      var context = options.context, ctx = options.ctx, listening = options.listening;
-      if (listening) listening.count++;
-
-      handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});
-    }
-    return events;
-  };
-
-  // Remove one or many callbacks. If `context` is null, removes all
-  // callbacks with that function. If `callback` is null, removes all
-  // callbacks for the event. If `name` is null, removes all bound
-  // callbacks for all events.
-  Events.off = function(name, callback, context) {
-    if (!this._events) return this;
-    this._events = eventsApi(offApi, this._events, name, callback, {
-      context: context,
-      listeners: this._listeners
-    });
-    return this;
-  };
-
-  // Tell this object to stop listening to either specific events ... or
-  // to every object it's currently listening to.
-  Events.stopListening = function(obj, name, callback) {
-    var listeningTo = this._listeningTo;
-    if (!listeningTo) return this;
-
-    var ids = obj ? [obj._listenId] : _.keys(listeningTo);
-
-    for (var i = 0; i < ids.length; i++) {
-      var listening = listeningTo[ids[i]];
-
-      // If listening doesn't exist, this object is not currently
-      // listening to obj. Break out early.
-      if (!listening) break;
-
-      listening.obj.off(name, callback, this);
-    }
-
-    return this;
-  };
-
-  // The reducing API that removes a callback from the `events` object.
-  var offApi = function(events, name, callback, options) {
-    if (!events) return;
-
-    var i = 0, listening;
-    var context = options.context, listeners = options.listeners;
-
-    // Delete all events listeners and "drop" events.
-    if (!name && !callback && !context) {
-      var ids = _.keys(listeners);
-      for (; i < ids.length; i++) {
-        listening = listeners[ids[i]];
-        delete listeners[listening.id];
-        delete listening.listeningTo[listening.objId];
-      }
-      return;
-    }
-
-    var names = name ? [name] : _.keys(events);
-    for (; i < names.length; i++) {
-      name = names[i];
-      var handlers = events[name];
-
-      // Bail out if there are no events stored.
-      if (!handlers) break;
-
-      // Replace events if there are any remaining.  Otherwise, clean up.
-      var remaining = [];
-      for (var j = 0; j < handlers.length; j++) {
-        var handler = handlers[j];
-        if (
-          callback && callback !== handler.callback &&
-            callback !== handler.callback._callback ||
-              context && context !== handler.context
-        ) {
-          remaining.push(handler);
-        } else {
-          listening = handler.listening;
-          if (listening && --listening.count === 0) {
-            delete listeners[listening.id];
-            delete listening.listeningTo[listening.objId];
-          }
-        }
-      }
-
-      // Update tail event if the list has any events.  Otherwise, clean up.
-      if (remaining.length) {
-        events[name] = remaining;
-      } else {
-        delete events[name];
-      }
-    }
-    return events;
-  };
-
-  // Bind an event to only be triggered a single time. After the first time
-  // the callback is invoked, its listener will be removed. If multiple events
-  // are passed in using the space-separated syntax, the handler will fire
-  // once for each event, not once for a combination of all events.
-  Events.once = function(name, callback, context) {
-    // Map the event into a `{event: once}` object.
-    var events = eventsApi(onceMap, {}, name, callback, _.bind(this.off, this));
-    if (typeof name === 'string' && context == null) callback = void 0;
-    return this.on(events, callback, context);
-  };
-
-  // Inversion-of-control versions of `once`.
-  Events.listenToOnce = function(obj, name, callback) {
-    // Map the event into a `{event: once}` object.
-    var events = eventsApi(onceMap, {}, name, callback, _.bind(this.stopListening, this, obj));
-    return this.listenTo(obj, events);
-  };
-
-  // Reduces the event callbacks into a map of `{event: onceWrapper}`.
-  // `offer` unbinds the `onceWrapper` after it has been called.
-  var onceMap = function(map, name, callback, offer) {
-    if (callback) {
-      var once = map[name] = _.once(function() {
-        offer(name, once);
-        callback.apply(this, arguments);
-      });
-      once._callback = callback;
-    }
-    return map;
-  };
-
-  // Trigger one or many events, firing all bound callbacks. Callbacks are
-  // passed the same arguments as `trigger` is, apart from the event name
-  // (unless you're listening on `"all"`, which will cause your callback to
-  // receive the true name of the event as the first argument).
-  Events.trigger = function(name) {
-    if (!this._events) return this;
-
-    var length = Math.max(0, arguments.length - 1);
-    var args = Array(length);
-    for (var i = 0; i < length; i++) args[i] = arguments[i + 1];
-
-    eventsApi(triggerApi, this._events, name, void 0, args);
-    return this;
-  };
-
-  // Handles triggering the appropriate event callbacks.
-  var triggerApi = function(objEvents, name, callback, args) {
-    if (objEvents) {
-      var events = objEvents[name];
-      var allEvents = objEvents.all;
-      if (events && allEvents) allEvents = allEvents.slice();
-      if (events) triggerEvents(events, args);
-      if (allEvents) triggerEvents(allEvents, [name].concat(args));
-    }
-    return objEvents;
-  };
-
-  // A difficult-to-believe, but optimized internal dispatch function for
-  // triggering events. Tries to keep the usual cases speedy (most internal
-  // Backbone events have 3 arguments).
-  var triggerEvents = function(events, args) {
-    var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
-    switch (args.length) {
-      case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
-      case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
-      case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
-      case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
-      default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;
-    }
-  };
-
-  // Aliases for backwards compatibility.
-  Events.bind   = Events.on;
-  Events.unbind = Events.off;
-
-  // Allow the `Backbone` object to serve as a global event bus, for folks who
-  // want global "pubsub" in a convenient place.
-  _.extend(Backbone, Events);
-
-  // Backbone.Model
-  // --------------
-
-  // Backbone **Models** are the basic data object in the framework --
-  // frequently representing a row in a table in a database on your server.
-  // A discrete chunk of data and a bunch of useful, related methods for
-  // performing computations and transformations on that data.
-
-  // Create a new model with the specified attributes. A client id (`cid`)
-  // is automatically generated and assigned for you.
-  var Model = Backbone.Model = function(attributes, options) {
-    var attrs = attributes || {};
-    options || (options = {});
-    this.cid = _.uniqueId(this.cidPrefix);
-    this.attributes = {};
-    if (options.collection) this.collection = options.collection;
-    if (options.parse) attrs = this.parse(attrs, options) || {};
-    var defaults = _.result(this, 'defaults');
-    attrs = _.defaults(_.extend({}, defaults, attrs), defaults);
-    this.set(attrs, options);
-    this.changed = {};
-    this.initialize.apply(this, arguments);
-  };
-
-  // Attach all inheritable methods to the Model prototype.
-  _.extend(Model.prototype, Events, {
-
-    // A hash of attributes whose current and previous value differ.
-    changed: null,
-
-    // The value returned during the last failed validation.
-    validationError: null,
-
-    // The default name for the JSON `id` attribute is `"id"`. MongoDB and
-    // CouchDB users may want to set this to `"_id"`.
-    idAttribute: 'id',
-
-    // The prefix is used to create the client id which is used to identify models locally.
-    // You may want to override this if you're experiencing name clashes with model ids.
-    cidPrefix: 'c',
-
-    // Initialize is an empty function by default. Override it with your own
-    // initialization logic.
-    initialize: function(){},
-
-    // Return a copy of the model's `attributes` object.
-    toJSON: function(options) {
-      return _.clone(this.attributes);
-    },
-
-    // Proxy `Backbone.sync` by default -- but override this if you need
-    // custom syncing semantics for *this* particular model.
-    sync: function() {
-      return Backbone.sync.apply(this, arguments);
-    },
-
-    // Get the value of an attribute.
-    get: function(attr) {
-      return this.attributes[attr];
-    },
-
-    // Get the HTML-escaped value of an attribute.
-    escape: function(attr) {
-      return _.escape(this.get(attr));
-    },
-
-    // Returns `true` if the attribute contains a value that is not null
-    // or undefined.
-    has: function(attr) {
-      return this.get(attr) != null;
-    },
-
-    // Special-cased proxy to underscore's `_.matches` method.
-    matches: function(attrs) {
-      return !!_.iteratee(attrs, this)(this.attributes);
-    },
-
-    // Set a hash of model attributes on the object, firing `"change"`. This is
-    // the core primitive operation of a model, updating the data and notifying
-    // anyone who needs to know about the change in state. The heart of the beast.
-    set: function(key, val, options) {
-      if (key == null) return this;
-
-      // Handle both `"key", value` and `{key: value}` -style arguments.
-      var attrs;
-      if (typeof key === 'object') {
-        attrs = key;
-        options = val;
-      } else {
-        (attrs = {})[key] = val;
-      }
-
-      options || (options = {});
-
-      // Run validation.
-      if (!this._validate(attrs, options)) return false;
-
-      // Extract attributes and options.
-      var unset      = options.unset;
-      var silent     = options.silent;
-      var changes    = [];
-      var changing   = this._changing;
-      this._changing = true;
-
-      if (!changing) {
-        this._previousAttributes = _.clone(this.attributes);
-        this.changed = {};
-      }
-
-      var current = this.attributes;
-      var changed = this.changed;
-      var prev    = this._previousAttributes;
-
-      // For each `set` attribute, update or delete the current value.
-      for (var attr in attrs) {
-        val = attrs[attr];
-        if (!_.isEqual(current[attr], val)) changes.push(attr);
-        if (!_.isEqual(prev[attr], val)) {
-          changed[attr] = val;
-        } else {
-          delete changed[attr];
-        }
-        unset ? delete current[attr] : current[attr] = val;
-      }
-
-      // Update the `id`.
-      if (this.idAttribute in attrs) this.id = this.get(this.idAttribute);
-
-      // Trigger all relevant attribute changes.
-      if (!silent) {
-        if (changes.length) this._pending = options;
-        for (var i = 0; i < changes.length; i++) {
-          this.trigger('change:' + changes[i], this, current[changes[i]], options);
-        }
-      }
-
-      // You might be wondering why there's a `while` loop here. Changes can
-      // be recursively nested within `"change"` events.
-      if (changing) return this;
-      if (!silent) {
-        while (this._pending) {
-          options = this._pending;
-          this._pending = false;
-          this.trigger('change', this, options);
-        }
-      }
-      this._pending = false;
-      this._changing = false;
-      return this;
-    },
-
-    // Remove an attribute from the model, firing `"change"`. `unset` is a noop
-    // if the attribute doesn't exist.
-    unset: function(attr, options) {
-      return this.set(attr, void 0, _.extend({}, options, {unset: true}));
-    },
-
-    // Clear all attributes on the model, firing `"change"`.
-    clear: function(options) {
-      var attrs = {};
-      for (var key in this.attributes) attrs[key] = void 0;
-      return this.set(attrs, _.extend({}, options, {unset: true}));
-    },
-
-    // Determine if the model has changed since the last `"change"` event.
-    // If you specify an attribute name, determine if that attribute has changed.
-    hasChanged: function(attr) {
-      if (attr == null) return !_.isEmpty(this.changed);
-      return _.has(this.changed, attr);
-    },
-
-    // Return an object containing all the attributes that have changed, or
-    // false if there are no changed attributes. Useful for determining what
-    // parts of a view need to be updated and/or what attributes need to be
-    // persisted to the server. Unset attributes will be set to undefined.
-    // You can also pass an attributes object to diff against the model,
-    // determining if there *would be* a change.
-    changedAttributes: function(diff) {
-      if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
-      var old = this._changing ? this._previousAttributes : this.attributes;
-      var changed = {};
-      for (var attr in diff) {
-        var val = diff[attr];
-        if (_.isEqual(old[attr], val)) continue;
-        changed[attr] = val;
-      }
-      return _.size(changed) ? changed : false;
-    },
-
-    // Get the previous value of an attribute, recorded at the time the last
-    // `"change"` event was fired.
-    previous: function(attr) {
-      if (attr == null || !this._previousAttributes) return null;
-      return this._previousAttributes[attr];
-    },
-
-    // Get all of the attributes of the model at the time of the previous
-    // `"change"` event.
-    previousAttributes: function() {
-      return _.clone(this._previousAttributes);
-    },
-
-    // Fetch the model from the server, merging the response with the model's
-    // local attributes. Any changed attributes will trigger a "change" event.
-    fetch: function(options) {
-      options = _.extend({parse: true}, options);
-      var model = this;
-      var success = options.success;
-      options.success = function(resp) {
-        var serverAttrs = options.parse ? model.parse(resp, options) : resp;
-        if (!model.set(serverAttrs, options)) return false;
-        if (success) success.call(options.context, model, resp, options);
-        model.trigger('sync', model, resp, options);
-      };
-      wrapError(this, options);
-      return this.sync('read', this, options);
-    },
-
-    // Set a hash of model attributes, and sync the model to the server.
-    // If the server returns an attributes hash that differs, the model's
-    // state will be `set` again.
-    save: function(key, val, options) {
-      // Handle both `"key", value` and `{key: value}` -style arguments.
-      var attrs;
-      if (key == null || typeof key === 'object') {
-        attrs = key;
-        options = val;
-      } else {
-        (attrs = {})[key] = val;
-      }
-
-      options = _.extend({validate: true, parse: true}, options);
-      var wait = options.wait;
-
-      // If we're not waiting and attributes exist, save acts as
-      // `set(attr).save(null, opts)` with validation. Otherwise, check if
-      // the model will be valid when the attributes, if any, are set.
-      if (attrs && !wait) {
-        if (!this.set(attrs, options)) return false;
-      } else if (!this._validate(attrs, options)) {
-        return false;
-      }
-
-      // After a successful server-side save, the client is (optionally)
-      // updated with the server-side state.
-      var model = this;
-      var success = options.success;
-      var attributes = this.attributes;
-      options.success = function(resp) {
-        // Ensure attributes are restored during synchronous saves.
-        model.attributes = attributes;
-        var serverAttrs = options.parse ? model.parse(resp, options) : resp;
-        if (wait) serverAttrs = _.extend({}, attrs, serverAttrs);
-        if (serverAttrs && !model.set(serverAttrs, options)) return false;
-        if (success) success.call(options.context, model, resp, options);
-        model.trigger('sync', model, resp, options);
-      };
-      wrapError(this, options);
-
-      // Set temporary attributes if `{wait: true}` to properly find new ids.
-      if (attrs && wait) this.attributes = _.extend({}, attributes, attrs);
-
-      var method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
-      if (method === 'patch' && !options.attrs) options.attrs = attrs;
-      var xhr = this.sync(method, this, options);
-
-      // Restore attributes.
-      this.attributes = attributes;
-
-      return xhr;
-    },
-
-    // Destroy this model on the server if it was already persisted.
-    // Optimistically removes the model from its collection, if it has one.
-    // If `wait: true` is passed, waits for the server to respond before removal.
-    destroy: function(options) {
-      options = options ? _.clone(options) : {};
-      var model = this;
-      var success = options.success;
-      var wait = options.wait;
-
-      var destroy = function() {
-        model.stopListening();
-        model.trigger('destroy', model, model.collection, options);
-      };
-
-      options.success = function(resp) {
-        if (wait) destroy();
-        if (success) success.call(options.context, model, resp, options);
-        if (!model.isNew()) model.trigger('sync', model, resp, options);
-      };
-
-      var xhr = false;
-      if (this.isNew()) {
-        _.defer(options.success);
-      } else {
-        wrapError(this, options);
-        xhr = this.sync('delete', this, options);
-      }
-      if (!wait) destroy();
-      return xhr;
-    },
-
-    // Default URL for the model's representation on the server -- if you're
-    // using Backbone's restful methods, override this to change the endpoint
-    // that will be called.
-    url: function() {
-      var base =
-        _.result(this, 'urlRoot') ||
-        _.result(this.collection, 'url') ||
-        urlError();
-      if (this.isNew()) return base;
-      var id = this.get(this.idAttribute);
-      return base.replace(/[^\/]$/, '$&/') + encodeURIComponent(id);
-    },
-
-    // **parse** converts a response into the hash of attributes to be `set` on
-    // the model. The default implementation is just to pass the response along.
-    parse: function(resp, options) {
-      return resp;
-    },
-
-    // Create a new model with identical attributes to this one.
-    clone: function() {
-      return new this.constructor(this.attributes);
-    },
-
-    // A model is new if it has never been saved to the server, and lacks an id.
-    isNew: function() {
-      return !this.has(this.idAttribute);
-    },
-
-    // Check if the model is currently in a valid state.
-    isValid: function(options) {
-      return this._validate({}, _.extend({}, options, {validate: true}));
-    },
-
-    // Run validation against the next complete set of model attributes,
-    // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
-    _validate: function(attrs, options) {
-      if (!options.validate || !this.validate) return true;
-      attrs = _.extend({}, this.attributes, attrs);
-      var error = this.validationError = this.validate(attrs, options) || null;
-      if (!error) return true;
-      this.trigger('invalid', this, error, _.extend(options, {validationError: error}));
-      return false;
-    }
-
-  });
-
-  // Underscore methods that we want to implement on the Model, mapped to the
-  // number of arguments they take.
-  var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0,
-      omit: 0, chain: 1, isEmpty: 1};
-
-  // Mix in each Underscore method as a proxy to `Model#attributes`.
-  addUnderscoreMethods(Model, modelMethods, 'attributes');
-
-  // Backbone.Collection
-  // -------------------
-
-  // If models tend to represent a single row of data, a Backbone Collection is
-  // more analogous to a table full of data ... or a small slice or page of that
-  // table, or a collection of rows that belong together for a particular reason
-  // -- all of the messages in this particular folder, all of the documents
-  // belonging to this particular author, and so on. Collections maintain
-  // indexes of their models, both in order, and for lookup by `id`.
-
-  // Create a new **Collection**, perhaps to contain a specific type of `model`.
-  // If a `comparator` is specified, the Collection will maintain
-  // its models in sort order, as they're added and removed.
-  var Collection = Backbone.Collection = function(models, options) {
-    options || (options = {});
-    if (options.model) this.model = options.model;
-    if (options.comparator !== void 0) this.comparator = options.comparator;
-    this._reset();
-    this.initialize.apply(this, arguments);
-    if (models) this.reset(models, _.extend({silent: true}, options));
-  };
-
-  // Default options for `Collection#set`.
-  var setOptions = {add: true, remove: true, merge: true};
-  var addOptions = {add: true, remove: false};
-
-  // Splices `insert` into `array` at index `at`.
-  var splice = function(array, insert, at) {
-    at = Math.min(Math.max(at, 0), array.length);
-    var tail = Array(array.length - at);
-    var length = insert.length;
-    var i;
-    for (i = 0; i < tail.length; i++) tail[i] = array[i + at];
-    for (i = 0; i < length; i++) array[i + at] = insert[i];
-    for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];
-  };
-
-  // Define the Collection's inheritable methods.
-  _.extend(Collection.prototype, Events, {
-
-    // The default model for a collection is just a **Backbone.Model**.
-    // This should be overridden in most cases.
-    model: Model,
-
-    // Initialize is an empty function by default. Override it with your own
-    // initialization logic.
-    initialize: function(){},
-
-    // The JSON representation of a Collection is an array of the
-    // models' attributes.
-    toJSON: function(options) {
-      return this.map(function(model) { return model.toJSON(options); });
-    },
-
-    // Proxy `Backbone.sync` by default.
-    sync: function() {
-      return Backbone.sync.apply(this, arguments);
-    },
-
-    // Add a model, or list of models to the set. `models` may be Backbone
-    // Models or raw JavaScript objects to be converted to Models, or any
-    // combination of the two.
-    add: function(models, options) {
-      return this.set(models, _.extend({merge: false}, options, addOptions));
-    },
-
-    // Remove a model, or a list of models from the set.
-    remove: function(models, options) {
-      options = _.extend({}, options);
-      var singular = !_.isArray(models);
-      models = singular ? [models] : models.slice();
-      var removed = this._removeModels(models, options);
-      if (!options.silent && removed.length) {
-        options.changes = {added: [], merged: [], removed: removed};
-        this.trigger('update', this, options);
-      }
-      return singular ? removed[0] : removed;
-    },
-
-    // Update a collection by `set`-ing a new list of models, adding new ones,
-    // removing models that are no longer present, and merging models that
-    // already exist in the collection, as necessary. Similar to **Model#set**,
-    // the core operation for updating the data contained by the collection.
-    set: function(models, options) {
-      if (models == null) return;
-
-      options = _.extend({}, setOptions, options);
-      if (options.parse && !this._isModel(models)) {
-        models = this.parse(models, options) || [];
-      }
-
-      var singular = !_.isArray(models);
-      models = singular ? [models] : models.slice();
-
-      var at = options.at;
-      if (at != null) at = +at;
-      if (at > this.length) at = this.length;
-      if (at < 0) at += this.length + 1;
-
-      var set = [];
-      var toAdd = [];
-      var toMerge = [];
-      var toRemove = [];
-      var modelMap = {};
-
-      var add = options.add;
-      var merge = options.merge;
-      var remove = options.remove;
-
-      var sort = false;
-      var sortable = this.comparator && at == null && options.sort !== false;
-      var sortAttr = _.isString(this.comparator) ? this.comparator : null;
-
-      // Turn bare objects into model references, and prevent invalid models
-      // from being added.
-      var model, i;
-      for (i = 0; i < models.length; i++) {
-        model = models[i];
-
-        // If a duplicate is found, prevent it from being added and
-        // optionally merge it into the existing model.
-        var existing = this.get(model);
-        if (existing) {
-          if (merge && model !== existing) {
-            var attrs = this._isModel(model) ? model.attributes : model;
-            if (options.parse) attrs = existing.parse(attrs, options);
-            existing.set(attrs, options);
-            toMerge.push(existing);
-            if (sortable && !sort) sort = existing.hasChanged(sortAttr);
-          }
-          if (!modelMap[existing.cid]) {
-            modelMap[existing.cid] = true;
-            set.push(existing);
-          }
-          models[i] = existing;
-
-        // If this is a new, valid model, push it to the `toAdd` list.
-        } else if (add) {
-          model = models[i] = this._prepareModel(model, options);
-          if (model) {
-            toAdd.push(model);
-            this._addReference(model, options);
-            modelMap[model.cid] = true;
-            set.push(model);
-          }
-        }
-      }
-
-      // Remove stale models.
-      if (remove) {
-        for (i = 0; i < this.length; i++) {
-          model = this.models[i];
-          if (!modelMap[model.cid]) toRemove.push(model);
-        }
-        if (toRemove.length) this._removeModels(toRemove, options);
-      }
-
-      // See if sorting is needed, update `length` and splice in new models.
-      var orderChanged = false;
-      var replace = !sortable && add && remove;
-      if (set.length && replace) {
-        orderChanged = this.length !== set.length || _.some(this.models, function(m, index) {
-          return m !== set[index];
-        });
-        this.models.length = 0;
-        splice(this.models, set, 0);
-        this.length = this.models.length;
-      } else if (toAdd.length) {
-        if (sortable) sort = true;
-        splice(this.models, toAdd, at == null ? this.length : at);
-        this.length = this.models.length;
-      }
-
-      // Silently sort the collection if appropriate.
-      if (sort) this.sort({silent: true});
-
-      // Unless silenced, it's time to fire all appropriate add/sort/update events.
-      if (!options.silent) {
-        for (i = 0; i < toAdd.length; i++) {
-          if (at != null) options.index = at + i;
-          model = toAdd[i];
-          model.trigger('add', model, this, options);
-        }
-        if (sort || orderChanged) this.trigger('sort', this, options);
-        if (toAdd.length || toRemove.length || toMerge.length) {
-          options.changes = {
-            added: toAdd,
-            removed: toRemove,
-            merged: toMerge
-          };
-          this.trigger('update', this, options);
-        }
-      }
-
-      // Return the added (or merged) model (or models).
-      return singular ? models[0] : models;
-    },
-
-    // When you have more items than you want to add or remove individually,
-    // you can reset the entire set with a new list of models, without firing
-    // any granular `add` or `remove` events. Fires `reset` when finished.
-    // Useful for bulk operations and optimizations.
-    reset: function(models, options) {
-      options = options ? _.clone(options) : {};
-      for (var i = 0; i < this.models.length; i++) {
-        this._removeReference(this.models[i], options);
-      }
-      options.previousModels = this.models;
-      this._reset();
-      models = this.add(models, _.extend({silent: true}, options));
-      if (!options.silent) this.trigger('reset', this, options);
-      return models;
-    },
-
-    // Add a model to the end of the collection.
-    push: function(model, options) {
-      return this.add(model, _.extend({at: this.length}, options));
-    },
-
-    // Remove a model from the end of the collection.
-    pop: function(options) {
-      var model = this.at(this.length - 1);
-      return this.remove(model, options);
-    },
-
-    // Add a model to the beginning of the collection.
-    unshift: function(model, options) {
-      return this.add(model, _.extend({at: 0}, options));
-    },
-
-    // Remove a model from the beginning of the collection.
-    shift: function(options) {
-      var model = this.at(0);
-      return this.remove(model, options);
-    },
-
-    // Slice out a sub-array of models from the collection.
-    slice: function() {
-      return slice.apply(this.models, arguments);
-    },
-
-    // Get a model from the set by id, cid, model object with id or cid
-    // properties, or an attributes object that is transformed through modelId.
-    get: function(obj) {
-      if (obj == null) return void 0;
-      return this._byId[obj] ||
-        this._byId[this.modelId(obj.attributes || obj)] ||
-        obj.cid && this._byId[obj.cid];
-    },
-
-    // Returns `true` if the model is in the collection.
-    has: function(obj) {
-      return this.get(obj) != null;
-    },
-
-    // Get the model at the given index.
-    at: function(index) {
-      if (index < 0) index += this.length;
-      return this.models[index];
-    },
-
-    // Return models with matching attributes. Useful for simple cases of
-    // `filter`.
-    where: function(attrs, first) {
-      return this[first ? 'find' : 'filter'](attrs);
-    },
-
-    // Return the first model with matching attributes. Useful for simple cases
-    // of `find`.
-    findWhere: function(attrs) {
-      return this.where(attrs, true);
-    },
-
-    // Force the collection to re-sort itself. You don't need to call this under
-    // normal circumstances, as the set will maintain sort order as each item
-    // is added.
-    sort: function(options) {
-      var comparator = this.comparator;
-      if (!comparator) throw new Error('Cannot sort a set without a comparator');
-      options || (options = {});
-
-      var length = comparator.length;
-      if (_.isFunction(comparator)) comparator = _.bind(comparator, this);
-
-      // Run sort based on type of `comparator`.
-      if (length === 1 || _.isString(comparator)) {
-        this.models = this.sortBy(comparator);
-      } else {
-        this.models.sort(comparator);
-      }
-      if (!options.silent) this.trigger('sort', this, options);
-      return this;
-    },
-
-    // Pluck an attribute from each model in the collection.
-    pluck: function(attr) {
-      return this.map(attr + '');
-    },
-
-    // Fetch the default set of models for this collection, resetting the
-    // collection when they arrive. If `reset: true` is passed, the response
-    // data will be passed through the `reset` method instead of `set`.
-    fetch: function(options) {
-      options = _.extend({parse: true}, options);
-      var success = options.success;
-      var collection = this;
-      options.success = function(resp) {
-        var method = options.reset ? 'reset' : 'set';
-        collection[method](resp, options);
-        if (success) success.call(options.context, collection, resp, options);
-        collection.trigger('sync', collection, resp, options);
-      };
-      wrapError(this, options);
-      return this.sync('read', this, options);
-    },
-
-    // Create a new instance of a model in this collection. Add the model to the
-    // collection immediately, unless `wait: true` is passed, in which case we
-    // wait for the server to agree.
-    create: function(model, options) {
-      options = options ? _.clone(options) : {};
-      var wait = options.wait;
-      model = this._prepareModel(model, options);
-      if (!model) return false;
-      if (!wait) this.add(model, options);
-      var collection = this;
-      var success = options.success;
-      options.success = function(m, resp, callbackOpts) {
-        if (wait) collection.add(m, callbackOpts);
-        if (success) success.call(callbackOpts.context, m, resp, callbackOpts);
-      };
-      model.save(null, options);
-      return model;
-    },
-
-    // **parse** converts a response into a list of models to be added to the
-    // collection. The default implementation is just to pass it through.
-    parse: function(resp, options) {
-      return resp;
-    },
-
-    // Create a new collection with an identical list of models as this one.
-    clone: function() {
-      return new this.constructor(this.models, {
-        model: this.model,
-        comparator: this.comparator
-      });
-    },
-
-    // Define how to uniquely identify models in the collection.
-    modelId: function(attrs) {
-      return attrs[this.model.prototype.idAttribute || 'id'];
-    },
-
-    // Private method to reset all internal state. Called when the collection
-    // is first initialized or reset.
-    _reset: function() {
-      this.length = 0;
-      this.models = [];
-      this._byId  = {};
-    },
-
-    // Prepare a hash of attributes (or other model) to be added to this
-    // collection.
-    _prepareModel: function(attrs, options) {
-      if (this._isModel(attrs)) {
-        if (!attrs.collection) attrs.collection = this;
-        return attrs;
-      }
-      options = options ? _.clone(options) : {};
-      options.collection = this;
-      var model = new this.model(attrs, options);
-      if (!model.validationError) return model;
-      this.trigger('invalid', this, model.validationError, options);
-      return false;
-    },
-
-    // Internal method called by both remove and set.
-    _removeModels: function(models, options) {
-      var removed = [];
-      for (var i = 0; i < models.length; i++) {
-        var model = this.get(models[i]);
-        if (!model) continue;
-
-        var index = this.indexOf(model);
-        this.models.splice(index, 1);
-        this.length--;
-
-        // Remove references before triggering 'remove' event to prevent an
-        // infinite loop. #3693
-        delete this._byId[model.cid];
-        var id = this.modelId(model.attributes);
-        if (id != null) delete this._byId[id];
-
-        if (!options.silent) {
-          options.index = index;
-          model.trigger('remove', model, this, options);
-        }
-
-        removed.push(model);
-        this._removeReference(model, options);
-      }
-      return removed;
-    },
-
-    // Method for checking whether an object should be considered a model for
-    // the purposes of adding to the collection.
-    _isModel: function(model) {
-      return model instanceof Model;
-    },
-
-    // Internal method to create a model's ties to a collection.
-    _addReference: function(model, options) {
-      this._byId[model.cid] = model;
-      var id = this.modelId(model.attributes);
-      if (id != null) this._byId[id] = model;
-      model.on('all', this._onModelEvent, this);
-    },
-
-    // Internal method to sever a model's ties to a collection.
-    _removeReference: function(model, options) {
-      delete this._byId[model.cid];
-      var id = this.modelId(model.attributes);
-      if (id != null) delete this._byId[id];
-      if (this === model.collection) delete model.collection;
-      model.off('all', this._onModelEvent, this);
-    },
-
-    // Internal method called every time a model in the set fires an event.
-    // Sets need to update their indexes when models change ids. All other
-    // events simply proxy through. "add" and "remove" events that originate
-    // in other collections are ignored.
-    _onModelEvent: function(event, model, collection, options) {
-      if (model) {
-        if ((event === 'add' || event === 'remove') && collection !== this) return;
-        if (event === 'destroy') this.remove(model, options);
-        if (event === 'change') {
-          var prevId = this.modelId(model.previousAttributes());
-          var id = this.modelId(model.attributes);
-          if (prevId !== id) {
-            if (prevId != null) delete this._byId[prevId];
-            if (id != null) this._byId[id] = model;
-          }
-        }
-      }
-      this.trigger.apply(this, arguments);
-    }
-
-  });
-
-  // Underscore methods that we want to implement on the Collection.
-  // 90% of the core usefulness of Backbone Collections is actually implemented
-  // right here:
-  var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0,
-      foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3,
-      select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3,
-      contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3,
-      head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3,
-      without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3,
-      isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3,
-      sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3};
-
-  // Mix in each Underscore method as a proxy to `Collection#models`.
-  addUnderscoreMethods(Collection, collectionMethods, 'models');
-
-  // Backbone.View
-  // -------------
-
-  // Backbone Views are almost more convention than they are actual code. A View
-  // is simply a JavaScript object that represents a logical chunk of UI in the
-  // DOM. This might be a single item, an entire list, a sidebar or panel, or
-  // even the surrounding frame which wraps your whole app. Defining a chunk of
-  // UI as a **View** allows you to define your DOM events declaratively, without
-  // having to worry about render order ... and makes it easy for the view to
-  // react to specific changes in the state of your models.
-
-  // Creating a Backbone.View creates its initial element outside of the DOM,
-  // if an existing element is not provided...
-  var View = Backbone.View = function(options) {
-    this.cid = _.uniqueId('view');
-    _.extend(this, _.pick(options, viewOptions));
-    this._ensureElement();
-    this.initialize.apply(this, arguments);
-  };
-
-  // Cached regex to split keys for `delegate`.
-  var delegateEventSplitter = /^(\S+)\s*(.*)$/;
-
-  // List of view options to be set as properties.
-  var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
-
-  // Set up all inheritable **Backbone.View** properties and methods.
-  _.extend(View.prototype, Events, {
-
-    // The default `tagName` of a View's element is `"div"`.
-    tagName: 'div',
-
-    // jQuery delegate for element lookup, scoped to DOM elements within the
-    // current view. This should be preferred to global lookups where possible.
-    $: function(selector) {
-      return this.$el.find(selector);
-    },
-
-    // Initialize is an empty function by default. Override it with your own
-    // initialization logic.
-    initialize: function(){},
-
-    // **render** is the core function that your view should override, in order
-    // to populate its element (`this.el`), with the appropriate HTML. The
-    // convention is for **render** to always return `this`.
-    render: function() {
-      return this;
-    },
-
-    // Remove this view by taking the element out of the DOM, and removing any
-    // applicable Backbone.Events listeners.
-    remove: function() {
-      this._removeElement();
-      this.stopListening();
-      return this;
-    },
-
-    // Remove this view's element from the document and all event listeners
-    // attached to it. Exposed for subclasses using an alternative DOM
-    // manipulation API.
-    _removeElement: function() {
-      this.$el.remove();
-    },
-
-    // Change the view's element (`this.el` property) and re-delegate the
-    // view's events on the new element.
-    setElement: function(element) {
-      this.undelegateEvents();
-      this._setElement(element);
-      this.delegateEvents();
-      return this;
-    },
-
-    // Creates the `this.el` and `this.$el` references for this view using the
-    // given `el`. `el` can be a CSS selector or an HTML string, a jQuery
-    // context or an element. Subclasses can override this to utilize an
-    // alternative DOM manipulation API and are only required to set the
-    // `this.el` property.
-    _setElement: function(el) {
-      this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);
-      this.el = this.$el[0];
-    },
-
-    // Set callbacks, where `this.events` is a hash of
-    //
-    // *{"event selector": "callback"}*
-    //
-    //     {
-    //       'mousedown .title':  'edit',
-    //       'click .button':     'save',
-    //       'click .open':       function(e) { ... }
-    //     }
-    //
-    // pairs. Callbacks will be bound to the view, with `this` set properly.
-    // Uses event delegation for efficiency.
-    // Omitting the selector binds the event to `this.el`.
-    delegateEvents: function(events) {
-      events || (events = _.result(this, 'events'));
-      if (!events) return this;
-      this.undelegateEvents();
-      for (var key in events) {
-        var method = events[key];
-        if (!_.isFunction(method)) method = this[method];
-        if (!method) continue;
-        var match = key.match(delegateEventSplitter);
-        this.delegate(match[1], match[2], _.bind(method, this));
-      }
-      return this;
-    },
-
-    // Add a single event listener to the view's element (or a child element
-    // using `selector`). This only works for delegate-able events: not `focus`,
-    // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer.
-    delegate: function(eventName, selector, listener) {
-      this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener);
-      return this;
-    },
-
-    // Clears all callbacks previously bound to the view by `delegateEvents`.
-    // You usually don't need to use this, but may wish to if you have multiple
-    // Backbone views attached to the same DOM element.
-    undelegateEvents: function() {
-      if (this.$el) this.$el.off('.delegateEvents' + this.cid);
-      return this;
-    },
-
-    // A finer-grained `undelegateEvents` for removing a single delegated event.
-    // `selector` and `listener` are both optional.
-    undelegate: function(eventName, selector, listener) {
-      this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener);
-      return this;
-    },
-
-    // Produces a DOM element to be assigned to your view. Exposed for
-    // subclasses using an alternative DOM manipulation API.
-    _createElement: function(tagName) {
-      return document.createElement(tagName);
-    },
-
-    // Ensure that the View has a DOM element to render into.
-    // If `this.el` is a string, pass it through `$()`, take the first
-    // matching element, and re-assign it to `el`. Otherwise, create
-    // an element from the `id`, `className` and `tagName` properties.
-    _ensureElement: function() {
-      if (!this.el) {
-        var attrs = _.extend({}, _.result(this, 'attributes'));
-        if (this.id) attrs.id = _.result(this, 'id');
-        if (this.className) attrs['class'] = _.result(this, 'className');
-        this.setElement(this._createElement(_.result(this, 'tagName')));
-        this._setAttributes(attrs);
-      } else {
-        this.setElement(_.result(this, 'el'));
-      }
-    },
-
-    // Set attributes from a hash on this view's element.  Exposed for
-    // subclasses using an alternative DOM manipulation API.
-    _setAttributes: function(attributes) {
-      this.$el.attr(attributes);
-    }
-
-  });
-
-  // Backbone.sync
-  // -------------
-
-  // Override this function to change the manner in which Backbone persists
-  // models to the server. You will be passed the type of request, and the
-  // model in question. By default, makes a RESTful Ajax request
-  // to the model's `url()`. Some possible customizations could be:
-  //
-  // * Use `setTimeout` to batch rapid-fire updates into a single request.
-  // * Send up the models as XML instead of JSON.
-  // * Persist models via WebSockets instead of Ajax.
-  //
-  // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
-  // as `POST`, with a `_method` parameter containing the true HTTP method,
-  // as well as all requests with the body as `application/x-www-form-urlencoded`
-  // instead of `application/json` with the model in a param named `model`.
-  // Useful when interfacing with server-side languages like **PHP** that make
-  // it difficult to read the body of `PUT` requests.
-  Backbone.sync = function(method, model, options) {
-    var type = methodMap[method];
-
-    // Default options, unless specified.
-    _.defaults(options || (options = {}), {
-      emulateHTTP: Backbone.emulateHTTP,
-      emulateJSON: Backbone.emulateJSON
-    });
-
-    // Default JSON-request options.
-    var params = {type: type, dataType: 'json'};
-
-    // Ensure that we have a URL.
-    if (!options.url) {
-      params.url = _.result(model, 'url') || urlError();
-    }
-
-    // Ensure that we have the appropriate request data.
-    if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
-      params.contentType = 'application/json';
-      params.data = JSON.stringify(options.attrs || model.toJSON(options));
-    }
-
-    // For older servers, emulate JSON by encoding the request into an HTML-form.
-    if (options.emulateJSON) {
-      params.contentType = 'application/x-www-form-urlencoded';
-      params.data = params.data ? {model: params.data} : {};
-    }
-
-    // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
-    // And an `X-HTTP-Method-Override` header.
-    if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
-      params.type = 'POST';
-      if (options.emulateJSON) params.data._method = type;
-      var beforeSend = options.beforeSend;
-      options.beforeSend = function(xhr) {
-        xhr.setRequestHeader('X-HTTP-Method-Override', type);
-        if (beforeSend) return beforeSend.apply(this, arguments);
-      };
-    }
-
-    // Don't process data on a non-GET request.
-    if (params.type !== 'GET' && !options.emulateJSON) {
-      params.processData = false;
-    }
-
-    // Pass along `textStatus` and `errorThrown` from jQuery.
-    var error = options.error;
-    options.error = function(xhr, textStatus, errorThrown) {
-      options.textStatus = textStatus;
-      options.errorThrown = errorThrown;
-      if (error) error.call(options.context, xhr, textStatus, errorThrown);
-    };
-
-    // Make the request, allowing the user to override any Ajax options.
-    var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
-    model.trigger('request', model, xhr, options);
-    return xhr;
-  };
-
-  // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
-  var methodMap = {
-    'create': 'POST',
-    'update': 'PUT',
-    'patch': 'PATCH',
-    'delete': 'DELETE',
-    'read': 'GET'
-  };
-
-  // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
-  // Override this if you'd like to use a different library.
-  Backbone.ajax = function() {
-    return Backbone.$.ajax.apply(Backbone.$, arguments);
-  };
-
-  // Backbone.Router
-  // ---------------
-
-  // Routers map faux-URLs to actions, and fire events when routes are
-  // matched. Creating a new one sets its `routes` hash, if not set statically.
-  var Router = Backbone.Router = function(options) {
-    options || (options = {});
-    if (options.routes) this.routes = options.routes;
-    this._bindRoutes();
-    this.initialize.apply(this, arguments);
-  };
-
-  // Cached regular expressions for matching named param parts and splatted
-  // parts of route strings.
-  var optionalParam = /\((.*?)\)/g;
-  var namedParam    = /(\(\?)?:\w+/g;
-  var splatParam    = /\*\w+/g;
-  var escapeRegExp  = /[\-{}\[\]+?.,\\\^$|#\s]/g;
-
-  // Set up all inheritable **Backbone.Router** properties and methods.
-  _.extend(Router.prototype, Events, {
-
-    // Initialize is an empty function by default. Override it with your own
-    // initialization logic.
-    initialize: function(){},
-
-    // Manually bind a single named route to a callback. For example:
-    //
-    //     this.route('search/:query/p:num', 'search', function(query, num) {
-    //       ...
-    //     });
-    //
-    route: function(route, name, callback) {
-      if (!_.isRegExp(route)) route = this._routeToRegExp(route);
-      if (_.isFunction(name)) {
-        callback = name;
-        name = '';
-      }
-      if (!callback) callback = this[name];
-      var router = this;
-      Backbone.history.route(route, function(fragment) {
-        var args = router._extractParameters(route, fragment);
-        if (router.execute(callback, args, name) !== false) {
-          router.trigger.apply(router, ['route:' + name].concat(args));
-          router.trigger('route', name, args);
-          Backbone.history.trigger('route', router, name, args);
-        }
-      });
-      return this;
-    },
-
-    // Execute a route handler with the provided parameters.  This is an
-    // excellent place to do pre-route setup or post-route cleanup.
-    execute: function(callback, args, name) {
-      if (callback) callback.apply(this, args);
-    },
-
-    // Simple proxy to `Backbone.history` to save a fragment into the history.
-    navigate: function(fragment, options) {
-      Backbone.history.navigate(fragment, options);
-      return this;
-    },
-
-    // Bind all defined routes to `Backbone.history`. We have to reverse the
-    // order of the routes here to support behavior where the most general
-    // routes can be defined at the bottom of the route map.
-    _bindRoutes: function() {
-      if (!this.routes) return;
-      this.routes = _.result(this, 'routes');
-      var route, routes = _.keys(this.routes);
-      while ((route = routes.pop()) != null) {
-        this.route(route, this.routes[route]);
-      }
-    },
-
-    // Convert a route string into a regular expression, suitable for matching
-    // against the current location hash.
-    _routeToRegExp: function(route) {
-      route = route.replace(escapeRegExp, '\\$&')
-                   .replace(optionalParam, '(?:$1)?')
-                   .replace(namedParam, function(match, optional) {
-                     return optional ? match : '([^/?]+)';
-                   })
-                   .replace(splatParam, '([^?]*?)');
-      return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$');
-    },
-
-    // Given a route, and a URL fragment that it matches, return the array of
-    // extracted decoded parameters. Empty or unmatched parameters will be
-    // treated as `null` to normalize cross-browser behavior.
-    _extractParameters: function(route, fragment) {
-      var params = route.exec(fragment).slice(1);
-      return _.map(params, function(param, i) {
-        // Don't decode the search params.
-        if (i === params.length - 1) return param || null;
-        return param ? decodeURIComponent(param) : null;
-      });
-    }
-
-  });
-
-  // Backbone.History
-  // ----------------
-
-  // Handles cross-browser history management, based on either
-  // [pushState](http://diveintohtml5.info/history.html) and real URLs, or
-  // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
-  // and URL fragments. If the browser supports neither (old IE, natch),
-  // falls back to polling.
-  var History = Backbone.History = function() {
-    this.handlers = [];
-    this.checkUrl = _.bind(this.checkUrl, this);
-
-    // Ensure that `History` can be used outside of the browser.
-    if (typeof window !== 'undefined') {
-      this.location = window.location;
-      this.history = window.history;
-    }
-  };
-
-  // Cached regex for stripping a leading hash/slash and trailing space.
-  var routeStripper = /^[#\/]|\s+$/g;
-
-  // Cached regex for stripping leading and trailing slashes.
-  var rootStripper = /^\/+|\/+$/g;
-
-  // Cached regex for stripping urls of hash.
-  var pathStripper = /#.*$/;
-
-  // Has the history handling already been started?
-  History.started = false;
-
-  // Set up all inheritable **Backbone.History** properties and methods.
-  _.extend(History.prototype, Events, {
-
-    // The default interval to poll for hash changes, if necessary, is
-    // twenty times a second.
-    interval: 50,
-
-    // Are we at the app root?
-    atRoot: function() {
-      var path = this.location.pathname.replace(/[^\/]$/, '$&/');
-      return path === this.root && !this.getSearch();
-    },
-
-    // Does the pathname match the root?
-    matchRoot: function() {
-      var path = this.decodeFragment(this.location.pathname);
-      var rootPath = path.slice(0, this.root.length - 1) + '/';
-      return rootPath === this.root;
-    },
-
-    // Unicode characters in `location.pathname` are percent encoded so they're
-    // decoded for comparison. `%25` should not be decoded since it may be part
-    // of an encoded parameter.
-    decodeFragment: function(fragment) {
-      return decodeURI(fragment.replace(/%25/g, '%2525'));
-    },
-
-    // In IE6, the hash fragment and search params are incorrect if the
-    // fragment contains `?`.
-    getSearch: function() {
-      var match = this.location.href.replace(/#.*/, '').match(/\?.+/);
-      return match ? match[0] : '';
-    },
-
-    // Gets the true hash value. Cannot use location.hash directly due to bug
-    // in Firefox where location.hash will always be decoded.
-    getHash: function(window) {
-      var match = (window || this).location.href.match(/#(.*)$/);
-      return match ? match[1] : '';
-    },
-
-    // Get the pathname and search params, without the root.
-    getPath: function() {
-      var path = this.decodeFragment(
-        this.location.pathname + this.getSearch()
-      ).slice(this.root.length - 1);
-      return path.charAt(0) === '/' ? path.slice(1) : path;
-    },
-
-    // Get the cross-browser normalized URL fragment from the path or hash.
-    getFragment: function(fragment) {
-      if (fragment == null) {
-        if (this._usePushState || !this._wantsHashChange) {
-          fragment = this.getPath();
-        } else {
-          fragment = this.getHash();
-        }
-      }
-      return fragment.replace(routeStripper, '');
-    },
-
-    // Start the hash change handling, returning `true` if the current URL matches
-    // an existing route, and `false` otherwise.
-    start: function(options) {
-      if (History.started) throw new Error('Backbone.history has already been started');
-      History.started = true;
-
-      // Figure out the initial configuration. Do we need an iframe?
-      // Is pushState desired ... is it available?
-      this.options          = _.extend({root: '/'}, this.options, options);
-      this.root             = this.options.root;
-      this._wantsHashChange = this.options.hashChange !== false;
-      this._hasHashChange   = 'onhashchange' in window && (document.documentMode === void 0 || document.documentMode > 7);
-      this._useHashChange   = this._wantsHashChange && this._hasHashChange;
-      this._wantsPushState  = !!this.options.pushState;
-      this._hasPushState    = !!(this.history && this.history.pushState);
-      this._usePushState    = this._wantsPushState && this._hasPushState;
-      this.fragment         = this.getFragment();
-
-      // Normalize root to always include a leading and trailing slash.
-      this.root = ('/' + this.root + '/').replace(rootStripper, '/');
-
-      // Transition from hashChange to pushState or vice versa if both are
-      // requested.
-      if (this._wantsHashChange && this._wantsPushState) {
-
-        // If we've started off with a route from a `pushState`-enabled
-        // browser, but we're currently in a browser that doesn't support it...
-        if (!this._hasPushState && !this.atRoot()) {
-          var rootPath = this.root.slice(0, -1) || '/';
-          this.location.replace(rootPath + '#' + this.getPath());
-          // Return immediately as browser will do redirect to new url
-          return true;
-
-        // Or if we've started out with a hash-based route, but we're currently
-        // in a browser where it could be `pushState`-based instead...
-        } else if (this._hasPushState && this.atRoot()) {
-          this.navigate(this.getHash(), {replace: true});
-        }
-
-      }
-
-      // Proxy an iframe to handle location events if the browser doesn't
-      // support the `hashchange` event, HTML5 history, or the user wants
-      // `hashChange` but not `pushState`.
-      if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) {
-        this.iframe = document.createElement('iframe');
-        this.iframe.src = 'javascript:0';
-        this.iframe.style.display = 'none';
-        this.iframe.tabIndex = -1;
-        var body = document.body;
-        // Using `appendChild` will throw on IE < 9 if the document is not ready.
-        var iWindow = body.insertBefore(this.iframe, body.firstChild).contentWindow;
-        iWindow.document.open();
-        iWindow.document.close();
-        iWindow.location.hash = '#' + this.fragment;
-      }
-
-      // Add a cross-platform `addEventListener` shim for older browsers.
-      var addEventListener = window.addEventListener || function(eventName, listener) {
-        return attachEvent('on' + eventName, listener);
-      };
-
-      // Depending on whether we're using pushState or hashes, and whether
-      // 'onhashchange' is supported, determine how we check the URL state.
-      if (this._usePushState) {
-        addEventListener('popstate', this.checkUrl, false);
-      } else if (this._useHashChange && !this.iframe) {
-        addEventListener('hashchange', this.checkUrl, false);
-      } else if (this._wantsHashChange) {
-        this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
-      }
-
-      if (!this.options.silent) return this.loadUrl();
-    },
-
-    // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
-    // but possibly useful for unit testing Routers.
-    stop: function() {
-      // Add a cross-platform `removeEventListener` shim for older browsers.
-      var removeEventListener = window.removeEventListener || function(eventName, listener) {
-        return detachEvent('on' + eventName, listener);
-      };
-
-      // Remove window listeners.
-      if (this._usePushState) {
-        removeEventListener('popstate', this.checkUrl, false);
-      } else if (this._useHashChange && !this.iframe) {
-        removeEventListener('hashchange', this.checkUrl, false);
-      }
-
-      // Clean up the iframe if necessary.
-      if (this.iframe) {
-        document.body.removeChild(this.iframe);
-        this.iframe = null;
-      }
-
-      // Some environments will throw when clearing an undefined interval.
-      if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);
-      History.started = false;
-    },
-
-    // Add a route to be tested when the fragment changes. Routes added later
-    // may override previous routes.
-    route: function(route, callback) {
-      this.handlers.unshift({route: route, callback: callback});
-    },
-
-    // Checks the current URL to see if it has changed, and if it has,
-    // calls `loadUrl`, normalizing across the hidden iframe.
-    checkUrl: function(e) {
-      var current = this.getFragment();
-
-      // If the user pressed the back button, the iframe's hash will have
-      // changed and we should use that for comparison.
-      if (current === this.fragment && this.iframe) {
-        current = this.getHash(this.iframe.contentWindow);
-      }
-
-      if (current === this.fragment) return false;
-      if (this.iframe) this.navigate(current);
-      this.loadUrl();
-    },
-
-    // Attempt to load the current URL fragment. If a route succeeds with a
-    // match, returns `true`. If no defined routes matches the fragment,
-    // returns `false`.
-    loadUrl: function(fragment) {
-      // If the root doesn't match, no routes can match either.
-      if (!this.matchRoot()) return false;
-      fragment = this.fragment = this.getFragment(fragment);
-      return _.some(this.handlers, function(handler) {
-        if (handler.route.test(fragment)) {
-          handler.callback(fragment);
-          return true;
-        }
-      });
-    },
-
-    // Save a fragment into the hash history, or replace the URL state if the
-    // 'replace' option is passed. You are responsible for properly URL-encoding
-    // the fragment in advance.
-    //
-    // The options object can contain `trigger: true` if you wish to have the
-    // route callback be fired (not usually desirable), or `replace: true`, if
-    // you wish to modify the current URL without adding an entry to the history.
-    navigate: function(fragment, options) {
-      if (!History.started) return false;
-      if (!options || options === true) options = {trigger: !!options};
-
-      // Normalize the fragment.
-      fragment = this.getFragment(fragment || '');
-
-      // Don't include a trailing slash on the root.
-      var rootPath = this.root;
-      if (fragment === '' || fragment.charAt(0) === '?') {
-        rootPath = rootPath.slice(0, -1) || '/';
-      }
-      var url = rootPath + fragment;
-
-      // Strip the hash and decode for matching.
-      fragment = this.decodeFragment(fragment.replace(pathStripper, ''));
-
-      if (this.fragment === fragment) return;
-      this.fragment = fragment;
-
-      // If pushState is available, we use it to set the fragment as a real URL.
-      if (this._usePushState) {
-        this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
-
-      // If hash changes haven't been explicitly disabled, update the hash
-      // fragment to store history.
-      } else if (this._wantsHashChange) {
-        this._updateHash(this.location, fragment, options.replace);
-        if (this.iframe && fragment !== this.getHash(this.iframe.contentWindow)) {
-          var iWindow = this.iframe.contentWindow;
-
-          // Opening and closing the iframe tricks IE7 and earlier to push a
-          // history entry on hash-tag change.  When replace is true, we don't
-          // want this.
-          if (!options.replace) {
-            iWindow.document.open();
-            iWindow.document.close();
-          }
-
-          this._updateHash(iWindow.location, fragment, options.replace);
-        }
-
-      // If you've told us that you explicitly don't want fallback hashchange-
-      // based history, then `navigate` becomes a page refresh.
-      } else {
-        return this.location.assign(url);
-      }
-      if (options.trigger) return this.loadUrl(fragment);
-    },
-
-    // Update the hash location, either replacing the current entry, or adding
-    // a new one to the browser history.
-    _updateHash: function(location, fragment, replace) {
-      if (replace) {
-        var href = location.href.replace(/(javascript:|#).*$/, '');
-        location.replace(href + '#' + fragment);
-      } else {
-        // Some browsers require that `hash` contains a leading #.
-        location.hash = '#' + fragment;
-      }
-    }
-
-  });
-
-  // Create the default Backbone.history.
-  Backbone.history = new History;
-
-  // Helpers
-  // -------
-
-  // Helper function to correctly set up the prototype chain for subclasses.
-  // Similar to `goog.inherits`, but uses a hash of prototype properties and
-  // class properties to be extended.
-  var extend = function(protoProps, staticProps) {
-    var parent = this;
-    var child;
-
-    // The constructor function for the new subclass is either defined by you
-    // (the "constructor" property in your `extend` definition), or defaulted
-    // by us to simply call the parent constructor.
-    if (protoProps && _.has(protoProps, 'constructor')) {
-      child = protoProps.constructor;
-    } else {
-      child = function(){ return parent.apply(this, arguments); };
-    }
-
-    // Add static properties to the constructor function, if supplied.
-    _.extend(child, parent, staticProps);
-
-    // Set the prototype chain to inherit from `parent`, without calling
-    // `parent`'s constructor function and add the prototype properties.
-    child.prototype = _.create(parent.prototype, protoProps);
-    child.prototype.constructor = child;
-
-    // Set a convenience property in case the parent's prototype is needed
-    // later.
-    child.__super__ = parent.prototype;
-
-    return child;
-  };
-
-  // Set up inheritance for the model, collection, router, view and history.
-  Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
-
-  // Throw an error when a URL is needed, and none is supplied.
-  var urlError = function() {
-    throw new Error('A "url" property or function must be specified');
-  };
-
-  // Wrap an optional error callback with a fallback error event.
-  var wrapError = function(model, options) {
-    var error = options.error;
-    options.error = function(resp) {
-      if (error) error.call(options.context, model, resp, options);
-      model.trigger('error', model, resp, options);
-    };
-  };
-
-  return Backbone;
-});
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/collection.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/collection.js
deleted file mode 100644
index dd98aca..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/collection.js
+++ /dev/null
@@ -1,1998 +0,0 @@
-(function() {
-
-  var a, b, c, d, e, col, otherCol;
-
-  QUnit.module('Backbone.Collection', {
-
-    beforeEach: function(assert) {
-      a         = new Backbone.Model({id: 3, label: 'a'});
-      b         = new Backbone.Model({id: 2, label: 'b'});
-      c         = new Backbone.Model({id: 1, label: 'c'});
-      d         = new Backbone.Model({id: 0, label: 'd'});
-      e         = null;
-      col       = new Backbone.Collection([a, b, c, d]);
-      otherCol  = new Backbone.Collection();
-    }
-
-  });
-
-  QUnit.test('new and sort', function(assert) {
-    assert.expect(6);
-    var counter = 0;
-    col.on('sort', function(){ counter++; });
-    assert.deepEqual(col.pluck('label'), ['a', 'b', 'c', 'd']);
-    col.comparator = function(m1, m2) {
-      return m1.id > m2.id ? -1 : 1;
-    };
-    col.sort();
-    assert.equal(counter, 1);
-    assert.deepEqual(col.pluck('label'), ['a', 'b', 'c', 'd']);
-    col.comparator = function(model) { return model.id; };
-    col.sort();
-    assert.equal(counter, 2);
-    assert.deepEqual(col.pluck('label'), ['d', 'c', 'b', 'a']);
-    assert.equal(col.length, 4);
-  });
-
-  QUnit.test('String comparator.', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection([
-      {id: 3},
-      {id: 1},
-      {id: 2}
-    ], {comparator: 'id'});
-    assert.deepEqual(collection.pluck('id'), [1, 2, 3]);
-  });
-
-  QUnit.test('new and parse', function(assert) {
-    assert.expect(3);
-    var Collection = Backbone.Collection.extend({
-      parse: function(data) {
-        return _.filter(data, function(datum) {
-          return datum.a % 2 === 0;
-        });
-      }
-    });
-    var models = [{a: 1}, {a: 2}, {a: 3}, {a: 4}];
-    var collection = new Collection(models, {parse: true});
-    assert.strictEqual(collection.length, 2);
-    assert.strictEqual(collection.first().get('a'), 2);
-    assert.strictEqual(collection.last().get('a'), 4);
-  });
-
-  QUnit.test('clone preserves model and comparator', function(assert) {
-    assert.expect(3);
-    var Model = Backbone.Model.extend();
-    var comparator = function(model){ return model.id; };
-
-    var collection = new Backbone.Collection([{id: 1}], {
-      model: Model,
-      comparator: comparator
-    }).clone();
-    collection.add({id: 2});
-    assert.ok(collection.at(0) instanceof Model);
-    assert.ok(collection.at(1) instanceof Model);
-    assert.strictEqual(collection.comparator, comparator);
-  });
-
-  QUnit.test('get', function(assert) {
-    assert.expect(6);
-    assert.equal(col.get(0), d);
-    assert.equal(col.get(d.clone()), d);
-    assert.equal(col.get(2), b);
-    assert.equal(col.get({id: 1}), c);
-    assert.equal(col.get(c.clone()), c);
-    assert.equal(col.get(col.first().cid), col.first());
-  });
-
-  QUnit.test('get with non-default ids', function(assert) {
-    assert.expect(5);
-    var MongoModel = Backbone.Model.extend({idAttribute: '_id'});
-    var model = new MongoModel({_id: 100});
-    var collection = new Backbone.Collection([model], {model: MongoModel});
-    assert.equal(collection.get(100), model);
-    assert.equal(collection.get(model.cid), model);
-    assert.equal(collection.get(model), model);
-    assert.equal(collection.get(101), void 0);
-
-    var collection2 = new Backbone.Collection();
-    collection2.model = MongoModel;
-    collection2.add(model.attributes);
-    assert.equal(collection2.get(model.clone()), collection2.first());
-  });
-
-  QUnit.test('has', function(assert) {
-    assert.expect(15);
-    assert.ok(col.has(a));
-    assert.ok(col.has(b));
-    assert.ok(col.has(c));
-    assert.ok(col.has(d));
-    assert.ok(col.has(a.id));
-    assert.ok(col.has(b.id));
-    assert.ok(col.has(c.id));
-    assert.ok(col.has(d.id));
-    assert.ok(col.has(a.cid));
-    assert.ok(col.has(b.cid));
-    assert.ok(col.has(c.cid));
-    assert.ok(col.has(d.cid));
-    var outsider = new Backbone.Model({id: 4});
-    assert.notOk(col.has(outsider));
-    assert.notOk(col.has(outsider.id));
-    assert.notOk(col.has(outsider.cid));
-  });
-
-  QUnit.test('update index when id changes', function(assert) {
-    assert.expect(4);
-    var collection = new Backbone.Collection();
-    collection.add([
-      {id: 0, name: 'one'},
-      {id: 1, name: 'two'}
-    ]);
-    var one = collection.get(0);
-    assert.equal(one.get('name'), 'one');
-    collection.on('change:name', function(model) { assert.ok(this.get(model)); });
-    one.set({name: 'dalmatians', id: 101});
-    assert.equal(collection.get(0), null);
-    assert.equal(collection.get(101).get('name'), 'dalmatians');
-  });
-
-  QUnit.test('at', function(assert) {
-    assert.expect(2);
-    assert.equal(col.at(2), c);
-    assert.equal(col.at(-2), c);
-  });
-
-  QUnit.test('pluck', function(assert) {
-    assert.expect(1);
-    assert.equal(col.pluck('label').join(' '), 'a b c d');
-  });
-
-  QUnit.test('add', function(assert) {
-    assert.expect(14);
-    var added, opts, secondAdded;
-    added = opts = secondAdded = null;
-    e = new Backbone.Model({id: 10, label: 'e'});
-    otherCol.add(e);
-    otherCol.on('add', function() {
-      secondAdded = true;
-    });
-    col.on('add', function(model, collection, options){
-      added = model.get('label');
-      opts = options;
-    });
-    col.add(e, {amazing: true});
-    assert.equal(added, 'e');
-    assert.equal(col.length, 5);
-    assert.equal(col.last(), e);
-    assert.equal(otherCol.length, 1);
-    assert.equal(secondAdded, null);
-    assert.ok(opts.amazing);
-
-    var f = new Backbone.Model({id: 20, label: 'f'});
-    var g = new Backbone.Model({id: 21, label: 'g'});
-    var h = new Backbone.Model({id: 22, label: 'h'});
-    var atCol = new Backbone.Collection([f, g, h]);
-    assert.equal(atCol.length, 3);
-    atCol.add(e, {at: 1});
-    assert.equal(atCol.length, 4);
-    assert.equal(atCol.at(1), e);
-    assert.equal(atCol.last(), h);
-
-    var coll = new Backbone.Collection(new Array(2));
-    var addCount = 0;
-    coll.on('add', function(){
-      addCount += 1;
-    });
-    coll.add([undefined, f, g]);
-    assert.equal(coll.length, 5);
-    assert.equal(addCount, 3);
-    coll.add(new Array(4));
-    assert.equal(coll.length, 9);
-    assert.equal(addCount, 7);
-  });
-
-  QUnit.test('add multiple models', function(assert) {
-    assert.expect(6);
-    var collection = new Backbone.Collection([{at: 0}, {at: 1}, {at: 9}]);
-    collection.add([{at: 2}, {at: 3}, {at: 4}, {at: 5}, {at: 6}, {at: 7}, {at: 8}], {at: 2});
-    for (var i = 0; i <= 5; i++) {
-      assert.equal(collection.at(i).get('at'), i);
-    }
-  });
-
-  QUnit.test('add; at should have preference over comparator', function(assert) {
-    assert.expect(1);
-    var Col = Backbone.Collection.extend({
-      comparator: function(m1, m2) {
-        return m1.id > m2.id ? -1 : 1;
-      }
-    });
-
-    var collection = new Col([{id: 2}, {id: 3}]);
-    collection.add(new Backbone.Model({id: 1}), {at: 1});
-
-    assert.equal(collection.pluck('id').join(' '), '3 1 2');
-  });
-
-  QUnit.test('add; at should add to the end if the index is out of bounds', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection([{id: 2}, {id: 3}]);
-    collection.add(new Backbone.Model({id: 1}), {at: 5});
-
-    assert.equal(collection.pluck('id').join(' '), '2 3 1');
-  });
-
-  QUnit.test("can't add model to collection twice", function(assert) {
-    var collection = new Backbone.Collection([{id: 1}, {id: 2}, {id: 1}, {id: 2}, {id: 3}]);
-    assert.equal(collection.pluck('id').join(' '), '1 2 3');
-  });
-
-  QUnit.test("can't add different model with same id to collection twice", function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection;
-    collection.unshift({id: 101});
-    collection.add({id: 101});
-    assert.equal(collection.length, 1);
-  });
-
-  QUnit.test('merge in duplicate models with {merge: true}', function(assert) {
-    assert.expect(3);
-    var collection = new Backbone.Collection;
-    collection.add([{id: 1, name: 'Moe'}, {id: 2, name: 'Curly'}, {id: 3, name: 'Larry'}]);
-    collection.add({id: 1, name: 'Moses'});
-    assert.equal(collection.first().get('name'), 'Moe');
-    collection.add({id: 1, name: 'Moses'}, {merge: true});
-    assert.equal(collection.first().get('name'), 'Moses');
-    collection.add({id: 1, name: 'Tim'}, {merge: true, silent: true});
-    assert.equal(collection.first().get('name'), 'Tim');
-  });
-
-  QUnit.test('add model to multiple collections', function(assert) {
-    assert.expect(10);
-    var counter = 0;
-    var m = new Backbone.Model({id: 10, label: 'm'});
-    m.on('add', function(model, collection) {
-      counter++;
-      assert.equal(m, model);
-      if (counter > 1) {
-        assert.equal(collection, col2);
-      } else {
-        assert.equal(collection, col1);
-      }
-    });
-    var col1 = new Backbone.Collection([]);
-    col1.on('add', function(model, collection) {
-      assert.equal(m, model);
-      assert.equal(col1, collection);
-    });
-    var col2 = new Backbone.Collection([]);
-    col2.on('add', function(model, collection) {
-      assert.equal(m, model);
-      assert.equal(col2, collection);
-    });
-    col1.add(m);
-    assert.equal(m.collection, col1);
-    col2.add(m);
-    assert.equal(m.collection, col1);
-  });
-
-  QUnit.test('add model with parse', function(assert) {
-    assert.expect(1);
-    var Model = Backbone.Model.extend({
-      parse: function(obj) {
-        obj.value += 1;
-        return obj;
-      }
-    });
-
-    var Col = Backbone.Collection.extend({model: Model});
-    var collection = new Col;
-    collection.add({value: 1}, {parse: true});
-    assert.equal(collection.at(0).get('value'), 2);
-  });
-
-  QUnit.test('add with parse and merge', function(assert) {
-    var collection = new Backbone.Collection();
-    collection.parse = function(attrs) {
-      return _.map(attrs, function(model) {
-        if (model.model) return model.model;
-        return model;
-      });
-    };
-    collection.add({id: 1});
-    collection.add({model: {id: 1, name: 'Alf'}}, {parse: true, merge: true});
-    assert.equal(collection.first().get('name'), 'Alf');
-  });
-
-  QUnit.test('add model to collection with sort()-style comparator', function(assert) {
-    assert.expect(3);
-    var collection = new Backbone.Collection;
-    collection.comparator = function(m1, m2) {
-      return m1.get('name') < m2.get('name') ? -1 : 1;
-    };
-    var tom = new Backbone.Model({name: 'Tom'});
-    var rob = new Backbone.Model({name: 'Rob'});
-    var tim = new Backbone.Model({name: 'Tim'});
-    collection.add(tom);
-    collection.add(rob);
-    collection.add(tim);
-    assert.equal(collection.indexOf(rob), 0);
-    assert.equal(collection.indexOf(tim), 1);
-    assert.equal(collection.indexOf(tom), 2);
-  });
-
-  QUnit.test('comparator that depends on `this`', function(assert) {
-    assert.expect(2);
-    var collection = new Backbone.Collection;
-    collection.negative = function(num) {
-      return -num;
-    };
-    collection.comparator = function(model) {
-      return this.negative(model.id);
-    };
-    collection.add([{id: 1}, {id: 2}, {id: 3}]);
-    assert.deepEqual(collection.pluck('id'), [3, 2, 1]);
-    collection.comparator = function(m1, m2) {
-      return this.negative(m2.id) - this.negative(m1.id);
-    };
-    collection.sort();
-    assert.deepEqual(collection.pluck('id'), [1, 2, 3]);
-  });
-
-  QUnit.test('remove', function(assert) {
-    assert.expect(12);
-    var removed = null;
-    var result = null;
-    col.on('remove', function(model, collection, options) {
-      removed = model.get('label');
-      assert.equal(options.index, 3);
-      assert.equal(collection.get(model), undefined, '#3693: model cannot be fetched from collection');
-    });
-    result = col.remove(d);
-    assert.equal(removed, 'd');
-    assert.strictEqual(result, d);
-    //if we try to remove d again, it's not going to actually get removed
-    result = col.remove(d);
-    assert.strictEqual(result, undefined);
-    assert.equal(col.length, 3);
-    assert.equal(col.first(), a);
-    col.off();
-    result = col.remove([c, d]);
-    assert.equal(result.length, 1, 'only returns removed models');
-    assert.equal(result[0], c, 'only returns removed models');
-    result = col.remove([c, b]);
-    assert.equal(result.length, 1, 'only returns removed models');
-    assert.equal(result[0], b, 'only returns removed models');
-    result = col.remove([]);
-    assert.deepEqual(result, [], 'returns empty array when nothing removed');
-  });
-
-  QUnit.test('add and remove return values', function(assert) {
-    assert.expect(13);
-    var Even = Backbone.Model.extend({
-      validate: function(attrs) {
-        if (attrs.id % 2 !== 0) return 'odd';
-      }
-    });
-    var collection = new Backbone.Collection;
-    collection.model = Even;
-
-    var list = collection.add([{id: 2}, {id: 4}], {validate: true});
-    assert.equal(list.length, 2);
-    assert.ok(list[0] instanceof Backbone.Model);
-    assert.equal(list[1], collection.last());
-    assert.equal(list[1].get('id'), 4);
-
-    list = collection.add([{id: 3}, {id: 6}], {validate: true});
-    assert.equal(collection.length, 3);
-    assert.equal(list[0], false);
-    assert.equal(list[1].get('id'), 6);
-
-    var result = collection.add({id: 6});
-    assert.equal(result.cid, list[1].cid);
-
-    result = collection.remove({id: 6});
-    assert.equal(collection.length, 2);
-    assert.equal(result.id, 6);
-
-    list = collection.remove([{id: 2}, {id: 8}]);
-    assert.equal(collection.length, 1);
-    assert.equal(list[0].get('id'), 2);
-    assert.equal(list[1], null);
-  });
-
-  QUnit.test('shift and pop', function(assert) {
-    assert.expect(2);
-    var collection = new Backbone.Collection([{a: 'a'}, {b: 'b'}, {c: 'c'}]);
-    assert.equal(collection.shift().get('a'), 'a');
-    assert.equal(collection.pop().get('c'), 'c');
-  });
-
-  QUnit.test('slice', function(assert) {
-    assert.expect(2);
-    var collection = new Backbone.Collection([{a: 'a'}, {b: 'b'}, {c: 'c'}]);
-    var array = collection.slice(1, 3);
-    assert.equal(array.length, 2);
-    assert.equal(array[0].get('b'), 'b');
-  });
-
-  QUnit.test('events are unbound on remove', function(assert) {
-    assert.expect(3);
-    var counter = 0;
-    var dj = new Backbone.Model();
-    var emcees = new Backbone.Collection([dj]);
-    emcees.on('change', function(){ counter++; });
-    dj.set({name: 'Kool'});
-    assert.equal(counter, 1);
-    emcees.reset([]);
-    assert.equal(dj.collection, undefined);
-    dj.set({name: 'Shadow'});
-    assert.equal(counter, 1);
-  });
-
-  QUnit.test('remove in multiple collections', function(assert) {
-    assert.expect(7);
-    var modelData = {
-      id: 5,
-      title: 'Othello'
-    };
-    var passed = false;
-    var m1 = new Backbone.Model(modelData);
-    var m2 = new Backbone.Model(modelData);
-    m2.on('remove', function() {
-      passed = true;
-    });
-    var col1 = new Backbone.Collection([m1]);
-    var col2 = new Backbone.Collection([m2]);
-    assert.notEqual(m1, m2);
-    assert.ok(col1.length === 1);
-    assert.ok(col2.length === 1);
-    col1.remove(m1);
-    assert.equal(passed, false);
-    assert.ok(col1.length === 0);
-    col2.remove(m1);
-    assert.ok(col2.length === 0);
-    assert.equal(passed, true);
-  });
-
-  QUnit.test('remove same model in multiple collection', function(assert) {
-    assert.expect(16);
-    var counter = 0;
-    var m = new Backbone.Model({id: 5, title: 'Othello'});
-    m.on('remove', function(model, collection) {
-      counter++;
-      assert.equal(m, model);
-      if (counter > 1) {
-        assert.equal(collection, col1);
-      } else {
-        assert.equal(collection, col2);
-      }
-    });
-    var col1 = new Backbone.Collection([m]);
-    col1.on('remove', function(model, collection) {
-      assert.equal(m, model);
-      assert.equal(col1, collection);
-    });
-    var col2 = new Backbone.Collection([m]);
-    col2.on('remove', function(model, collection) {
-      assert.equal(m, model);
-      assert.equal(col2, collection);
-    });
-    assert.equal(col1, m.collection);
-    col2.remove(m);
-    assert.ok(col2.length === 0);
-    assert.ok(col1.length === 1);
-    assert.equal(counter, 1);
-    assert.equal(col1, m.collection);
-    col1.remove(m);
-    assert.equal(null, m.collection);
-    assert.ok(col1.length === 0);
-    assert.equal(counter, 2);
-  });
-
-  QUnit.test('model destroy removes from all collections', function(assert) {
-    assert.expect(3);
-    var m = new Backbone.Model({id: 5, title: 'Othello'});
-    m.sync = function(method, model, options) { options.success(); };
-    var col1 = new Backbone.Collection([m]);
-    var col2 = new Backbone.Collection([m]);
-    m.destroy();
-    assert.ok(col1.length === 0);
-    assert.ok(col2.length === 0);
-    assert.equal(undefined, m.collection);
-  });
-
-  QUnit.test('Collection: non-persisted model destroy removes from all collections', function(assert) {
-    assert.expect(3);
-    var m = new Backbone.Model({title: 'Othello'});
-    m.sync = function(method, model, options) { throw 'should not be called'; };
-    var col1 = new Backbone.Collection([m]);
-    var col2 = new Backbone.Collection([m]);
-    m.destroy();
-    assert.ok(col1.length === 0);
-    assert.ok(col2.length === 0);
-    assert.equal(undefined, m.collection);
-  });
-
-  QUnit.test('fetch', function(assert) {
-    assert.expect(4);
-    var collection = new Backbone.Collection;
-    collection.url = '/test';
-    collection.fetch();
-    assert.equal(this.syncArgs.method, 'read');
-    assert.equal(this.syncArgs.model, collection);
-    assert.equal(this.syncArgs.options.parse, true);
-
-    collection.fetch({parse: false});
-    assert.equal(this.syncArgs.options.parse, false);
-  });
-
-  QUnit.test('fetch with an error response triggers an error event', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection();
-    collection.on('error', function() {
-      assert.ok(true);
-    });
-    collection.sync = function(method, model, options) { options.error(); };
-    collection.fetch();
-  });
-
-  QUnit.test('#3283 - fetch with an error response calls error with context', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection();
-    var obj = {};
-    var options = {
-      context: obj,
-      error: function() {
-        assert.equal(this, obj);
-      }
-    };
-    collection.sync = function(method, model, opts) {
-      opts.error.call(opts.context);
-    };
-    collection.fetch(options);
-  });
-
-  QUnit.test('ensure fetch only parses once', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection;
-    var counter = 0;
-    collection.parse = function(models) {
-      counter++;
-      return models;
-    };
-    collection.url = '/test';
-    collection.fetch();
-    this.syncArgs.options.success([]);
-    assert.equal(counter, 1);
-  });
-
-  QUnit.test('create', function(assert) {
-    assert.expect(4);
-    var collection = new Backbone.Collection;
-    collection.url = '/test';
-    var model = collection.create({label: 'f'}, {wait: true});
-    assert.equal(this.syncArgs.method, 'create');
-    assert.equal(this.syncArgs.model, model);
-    assert.equal(model.get('label'), 'f');
-    assert.equal(model.collection, collection);
-  });
-
-  QUnit.test('create with validate:true enforces validation', function(assert) {
-    assert.expect(3);
-    var ValidatingModel = Backbone.Model.extend({
-      validate: function(attrs) {
-        return 'fail';
-      }
-    });
-    var ValidatingCollection = Backbone.Collection.extend({
-      model: ValidatingModel
-    });
-    var collection = new ValidatingCollection();
-    collection.on('invalid', function(coll, error, options) {
-      assert.equal(error, 'fail');
-      assert.equal(options.validationError, 'fail');
-    });
-    assert.equal(collection.create({'foo': 'bar'}, {validate: true}), false);
-  });
-
-  QUnit.test('create will pass extra options to success callback', function(assert) {
-    assert.expect(1);
-    var Model = Backbone.Model.extend({
-      sync: function(method, model, options) {
-        _.extend(options, {specialSync: true});
-        return Backbone.Model.prototype.sync.call(this, method, model, options);
-      }
-    });
-
-    var Collection = Backbone.Collection.extend({
-      model: Model,
-      url: '/test'
-    });
-
-    var collection = new Collection;
-
-    var success = function(model, response, options) {
-      assert.ok(options.specialSync, 'Options were passed correctly to callback');
-    };
-
-    collection.create({}, {success: success});
-    this.ajaxSettings.success();
-  });
-
-  QUnit.test('create with wait:true should not call collection.parse', function(assert) {
-    assert.expect(0);
-    var Collection = Backbone.Collection.extend({
-      url: '/test',
-      parse: function() {
-        assert.ok(false);
-      }
-    });
-
-    var collection = new Collection;
-
-    collection.create({}, {wait: true});
-    this.ajaxSettings.success();
-  });
-
-  QUnit.test('a failing create returns model with errors', function(assert) {
-    var ValidatingModel = Backbone.Model.extend({
-      validate: function(attrs) {
-        return 'fail';
-      }
-    });
-    var ValidatingCollection = Backbone.Collection.extend({
-      model: ValidatingModel
-    });
-    var collection = new ValidatingCollection();
-    var m = collection.create({foo: 'bar'});
-    assert.equal(m.validationError, 'fail');
-    assert.equal(collection.length, 1);
-  });
-
-  QUnit.test('initialize', function(assert) {
-    assert.expect(1);
-    var Collection = Backbone.Collection.extend({
-      initialize: function() {
-        this.one = 1;
-      }
-    });
-    var coll = new Collection;
-    assert.equal(coll.one, 1);
-  });
-
-  QUnit.test('toJSON', function(assert) {
-    assert.expect(1);
-    assert.equal(JSON.stringify(col), '[{"id":3,"label":"a"},{"id":2,"label":"b"},{"id":1,"label":"c"},{"id":0,"label":"d"}]');
-  });
-
-  QUnit.test('where and findWhere', function(assert) {
-    assert.expect(8);
-    var model = new Backbone.Model({a: 1});
-    var coll = new Backbone.Collection([
-      model,
-      {a: 1},
-      {a: 1, b: 2},
-      {a: 2, b: 2},
-      {a: 3}
-    ]);
-    assert.equal(coll.where({a: 1}).length, 3);
-    assert.equal(coll.where({a: 2}).length, 1);
-    assert.equal(coll.where({a: 3}).length, 1);
-    assert.equal(coll.where({b: 1}).length, 0);
-    assert.equal(coll.where({b: 2}).length, 2);
-    assert.equal(coll.where({a: 1, b: 2}).length, 1);
-    assert.equal(coll.findWhere({a: 1}), model);
-    assert.equal(coll.findWhere({a: 4}), void 0);
-  });
-
-  QUnit.test('Underscore methods', function(assert) {
-    assert.expect(21);
-    assert.equal(col.map(function(model){ return model.get('label'); }).join(' '), 'a b c d');
-    assert.equal(col.some(function(model){ return model.id === 100; }), false);
-    assert.equal(col.some(function(model){ return model.id === 0; }), true);
-    assert.equal(col.reduce(function(m1, m2) {return m1.id > m2.id ? m1 : m2;}).id, 3);
-    assert.equal(col.reduceRight(function(m1, m2) {return m1.id > m2.id ? m1 : m2;}).id, 3);
-    assert.equal(col.indexOf(b), 1);
-    assert.equal(col.size(), 4);
-    assert.equal(col.rest().length, 3);
-    assert.ok(!_.includes(col.rest(), a));
-    assert.ok(_.includes(col.rest(), d));
-    assert.ok(!col.isEmpty());
-    assert.ok(!_.includes(col.without(d), d));
-
-    var wrapped = col.chain();
-    assert.equal(wrapped.map('id').max().value(), 3);
-    assert.equal(wrapped.map('id').min().value(), 0);
-    assert.deepEqual(wrapped
-      .filter(function(o){ return o.id % 2 === 0; })
-      .map(function(o){ return o.id * 2; })
-      .value(),
-      [4, 0]);
-    assert.deepEqual(col.difference([c, d]), [a, b]);
-    assert.ok(col.includes(col.sample()));
-
-    var first = col.first();
-    assert.deepEqual(col.groupBy(function(model){ return model.id; })[first.id], [first]);
-    assert.deepEqual(col.countBy(function(model){ return model.id; }), {0: 1, 1: 1, 2: 1, 3: 1});
-    assert.deepEqual(col.sortBy(function(model){ return model.id; })[0], col.at(3));
-    assert.ok(col.indexBy('id')[first.id] === first);
-  });
-
-  QUnit.test('Underscore methods with object-style and property-style iteratee', function(assert) {
-    assert.expect(26);
-    var model = new Backbone.Model({a: 4, b: 1, e: 3});
-    var coll = new Backbone.Collection([
-      {a: 1, b: 1},
-      {a: 2, b: 1, c: 1},
-      {a: 3, b: 1},
-      model
-    ]);
-    assert.equal(coll.find({a: 0}), undefined);
-    assert.deepEqual(coll.find({a: 4}), model);
-    assert.equal(coll.find('d'), undefined);
-    assert.deepEqual(coll.find('e'), model);
-    assert.equal(coll.filter({a: 0}), false);
-    assert.deepEqual(coll.filter({a: 4}), [model]);
-    assert.equal(coll.some({a: 0}), false);
-    assert.equal(coll.some({a: 1}), true);
-    assert.equal(coll.reject({a: 0}).length, 4);
-    assert.deepEqual(coll.reject({a: 4}), _.without(coll.models, model));
-    assert.equal(coll.every({a: 0}), false);
-    assert.equal(coll.every({b: 1}), true);
-    assert.deepEqual(coll.partition({a: 0})[0], []);
-    assert.deepEqual(coll.partition({a: 0})[1], coll.models);
-    assert.deepEqual(coll.partition({a: 4})[0], [model]);
-    assert.deepEqual(coll.partition({a: 4})[1], _.without(coll.models, model));
-    assert.deepEqual(coll.map({a: 2}), [false, true, false, false]);
-    assert.deepEqual(coll.map('a'), [1, 2, 3, 4]);
-    assert.deepEqual(coll.sortBy('a')[3], model);
-    assert.deepEqual(coll.sortBy('e')[0], model);
-    assert.deepEqual(coll.countBy({a: 4}), {'false': 3, 'true': 1});
-    assert.deepEqual(coll.countBy('d'), {'undefined': 4});
-    assert.equal(coll.findIndex({b: 1}), 0);
-    assert.equal(coll.findIndex({b: 9}), -1);
-    assert.equal(coll.findLastIndex({b: 1}), 3);
-    assert.equal(coll.findLastIndex({b: 9}), -1);
-  });
-
-  QUnit.test('reset', function(assert) {
-    assert.expect(16);
-
-    var resetCount = 0;
-    var models = col.models;
-    col.on('reset', function() { resetCount += 1; });
-    col.reset([]);
-    assert.equal(resetCount, 1);
-    assert.equal(col.length, 0);
-    assert.equal(col.last(), null);
-    col.reset(models);
-    assert.equal(resetCount, 2);
-    assert.equal(col.length, 4);
-    assert.equal(col.last(), d);
-    col.reset(_.map(models, function(m){ return m.attributes; }));
-    assert.equal(resetCount, 3);
-    assert.equal(col.length, 4);
-    assert.ok(col.last() !== d);
-    assert.ok(_.isEqual(col.last().attributes, d.attributes));
-    col.reset();
-    assert.equal(col.length, 0);
-    assert.equal(resetCount, 4);
-
-    var f = new Backbone.Model({id: 20, label: 'f'});
-    col.reset([undefined, f]);
-    assert.equal(col.length, 2);
-    assert.equal(resetCount, 5);
-
-    col.reset(new Array(4));
-    assert.equal(col.length, 4);
-    assert.equal(resetCount, 6);
-  });
-
-  QUnit.test('reset with different values', function(assert) {
-    var collection = new Backbone.Collection({id: 1});
-    collection.reset({id: 1, a: 1});
-    assert.equal(collection.get(1).get('a'), 1);
-  });
-
-  QUnit.test('same references in reset', function(assert) {
-    var model = new Backbone.Model({id: 1});
-    var collection = new Backbone.Collection({id: 1});
-    collection.reset(model);
-    assert.equal(collection.get(1), model);
-  });
-
-  QUnit.test('reset passes caller options', function(assert) {
-    assert.expect(3);
-    var Model = Backbone.Model.extend({
-      initialize: function(attrs, options) {
-        this.modelParameter = options.modelParameter;
-      }
-    });
-    var collection = new (Backbone.Collection.extend({model: Model}))();
-    collection.reset([{astring: 'green', anumber: 1}, {astring: 'blue', anumber: 2}], {modelParameter: 'model parameter'});
-    assert.equal(collection.length, 2);
-    collection.each(function(model) {
-      assert.equal(model.modelParameter, 'model parameter');
-    });
-  });
-
-  QUnit.test('reset does not alter options by reference', function(assert) {
-    assert.expect(2);
-    var collection = new Backbone.Collection([{id: 1}]);
-    var origOpts = {};
-    collection.on('reset', function(coll, opts){
-      assert.equal(origOpts.previousModels, undefined);
-      assert.equal(opts.previousModels[0].id, 1);
-    });
-    collection.reset([], origOpts);
-  });
-
-  QUnit.test('trigger custom events on models', function(assert) {
-    assert.expect(1);
-    var fired = null;
-    a.on('custom', function() { fired = true; });
-    a.trigger('custom');
-    assert.equal(fired, true);
-  });
-
-  QUnit.test('add does not alter arguments', function(assert) {
-    assert.expect(2);
-    var attrs = {};
-    var models = [attrs];
-    new Backbone.Collection().add(models);
-    assert.equal(models.length, 1);
-    assert.ok(attrs === models[0]);
-  });
-
-  QUnit.test('#714: access `model.collection` in a brand new model.', function(assert) {
-    assert.expect(2);
-    var collection = new Backbone.Collection;
-    collection.url = '/test';
-    var Model = Backbone.Model.extend({
-      set: function(attrs) {
-        assert.equal(attrs.prop, 'value');
-        assert.equal(this.collection, collection);
-        return this;
-      }
-    });
-    collection.model = Model;
-    collection.create({prop: 'value'});
-  });
-
-  QUnit.test('#574, remove its own reference to the .models array.', function(assert) {
-    assert.expect(2);
-    var collection = new Backbone.Collection([
-      {id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}, {id: 6}
-    ]);
-    assert.equal(collection.length, 6);
-    collection.remove(collection.models);
-    assert.equal(collection.length, 0);
-  });
-
-  QUnit.test('#861, adding models to a collection which do not pass validation, with validate:true', function(assert) {
-    assert.expect(2);
-    var Model = Backbone.Model.extend({
-      validate: function(attrs) {
-        if (attrs.id === 3) return "id can't be 3";
-      }
-    });
-
-    var Collection = Backbone.Collection.extend({
-      model: Model
-    });
-
-    var collection = new Collection;
-    collection.on('invalid', function() { assert.ok(true); });
-
-    collection.add([{id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}, {id: 6}], {validate: true});
-    assert.deepEqual(collection.pluck('id'), [1, 2, 4, 5, 6]);
-  });
-
-  QUnit.test('Invalid models are discarded with validate:true.', function(assert) {
-    assert.expect(5);
-    var collection = new Backbone.Collection;
-    collection.on('test', function() { assert.ok(true); });
-    collection.model = Backbone.Model.extend({
-      validate: function(attrs){ if (!attrs.valid) return 'invalid'; }
-    });
-    var model = new collection.model({id: 1, valid: true});
-    collection.add([model, {id: 2}], {validate: true});
-    model.trigger('test');
-    assert.ok(collection.get(model.cid));
-    assert.ok(collection.get(1));
-    assert.ok(!collection.get(2));
-    assert.equal(collection.length, 1);
-  });
-
-  QUnit.test('multiple copies of the same model', function(assert) {
-    assert.expect(3);
-    var collection = new Backbone.Collection();
-    var model = new Backbone.Model();
-    collection.add([model, model]);
-    assert.equal(collection.length, 1);
-    collection.add([{id: 1}, {id: 1}]);
-    assert.equal(collection.length, 2);
-    assert.equal(collection.last().id, 1);
-  });
-
-  QUnit.test('#964 - collection.get return inconsistent', function(assert) {
-    assert.expect(2);
-    var collection = new Backbone.Collection();
-    assert.ok(collection.get(null) === undefined);
-    assert.ok(collection.get() === undefined);
-  });
-
-  QUnit.test('#1112 - passing options.model sets collection.model', function(assert) {
-    assert.expect(2);
-    var Model = Backbone.Model.extend({});
-    var collection = new Backbone.Collection([{id: 1}], {model: Model});
-    assert.ok(collection.model === Model);
-    assert.ok(collection.at(0) instanceof Model);
-  });
-
-  QUnit.test('null and undefined are invalid ids.', function(assert) {
-    assert.expect(2);
-    var model = new Backbone.Model({id: 1});
-    var collection = new Backbone.Collection([model]);
-    model.set({id: null});
-    assert.ok(!collection.get('null'));
-    model.set({id: 1});
-    model.set({id: undefined});
-    assert.ok(!collection.get('undefined'));
-  });
-
-  QUnit.test('falsy comparator', function(assert) {
-    assert.expect(4);
-    var Col = Backbone.Collection.extend({
-      comparator: function(model){ return model.id; }
-    });
-    var collection = new Col();
-    var colFalse = new Col(null, {comparator: false});
-    var colNull = new Col(null, {comparator: null});
-    var colUndefined = new Col(null, {comparator: undefined});
-    assert.ok(collection.comparator);
-    assert.ok(!colFalse.comparator);
-    assert.ok(!colNull.comparator);
-    assert.ok(colUndefined.comparator);
-  });
-
-  QUnit.test('#1355 - `options` is passed to success callbacks', function(assert) {
-    assert.expect(2);
-    var m = new Backbone.Model({x: 1});
-    var collection = new Backbone.Collection();
-    var opts = {
-      opts: true,
-      success: function(coll, resp, options) {
-        assert.ok(options.opts);
-      }
-    };
-    collection.sync = m.sync = function( method, coll, options ){
-      options.success({});
-    };
-    collection.fetch(opts);
-    collection.create(m, opts);
-  });
-
-  QUnit.test("#1412 - Trigger 'request' and 'sync' events.", function(assert) {
-    assert.expect(4);
-    var collection = new Backbone.Collection;
-    collection.url = '/test';
-    Backbone.ajax = function(settings){ settings.success(); };
-
-    collection.on('request', function(obj, xhr, options) {
-      assert.ok(obj === collection, "collection has correct 'request' event after fetching");
-    });
-    collection.on('sync', function(obj, response, options) {
-      assert.ok(obj === collection, "collection has correct 'sync' event after fetching");
-    });
-    collection.fetch();
-    collection.off();
-
-    collection.on('request', function(obj, xhr, options) {
-      assert.ok(obj === collection.get(1), "collection has correct 'request' event after one of its models save");
-    });
-    collection.on('sync', function(obj, response, options) {
-      assert.ok(obj === collection.get(1), "collection has correct 'sync' event after one of its models save");
-    });
-    collection.create({id: 1});
-    collection.off();
-  });
-
-  QUnit.test('#3283 - fetch, create calls success with context', function(assert) {
-    assert.expect(2);
-    var collection = new Backbone.Collection;
-    collection.url = '/test';
-    Backbone.ajax = function(settings) {
-      settings.success.call(settings.context);
-    };
-    var obj = {};
-    var options = {
-      context: obj,
-      success: function() {
-        assert.equal(this, obj);
-      }
-    };
-
-    collection.fetch(options);
-    collection.create({id: 1}, options);
-  });
-
-  QUnit.test('#1447 - create with wait adds model.', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection;
-    var model = new Backbone.Model;
-    model.sync = function(method, m, options){ options.success(); };
-    collection.on('add', function(){ assert.ok(true); });
-    collection.create(model, {wait: true});
-  });
-
-  QUnit.test('#1448 - add sorts collection after merge.', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection([
-      {id: 1, x: 1},
-      {id: 2, x: 2}
-    ]);
-    collection.comparator = function(model){ return model.get('x'); };
-    collection.add({id: 1, x: 3}, {merge: true});
-    assert.deepEqual(collection.pluck('id'), [2, 1]);
-  });
-
-  QUnit.test('#1655 - groupBy can be used with a string argument.', function(assert) {
-    assert.expect(3);
-    var collection = new Backbone.Collection([{x: 1}, {x: 2}]);
-    var grouped = collection.groupBy('x');
-    assert.strictEqual(_.keys(grouped).length, 2);
-    assert.strictEqual(grouped[1][0].get('x'), 1);
-    assert.strictEqual(grouped[2][0].get('x'), 2);
-  });
-
-  QUnit.test('#1655 - sortBy can be used with a string argument.', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection([{x: 3}, {x: 1}, {x: 2}]);
-    var values = _.map(collection.sortBy('x'), function(model) {
-      return model.get('x');
-    });
-    assert.deepEqual(values, [1, 2, 3]);
-  });
-
-  QUnit.test('#1604 - Removal during iteration.', function(assert) {
-    assert.expect(0);
-    var collection = new Backbone.Collection([{}, {}]);
-    collection.on('add', function() {
-      collection.at(0).destroy();
-    });
-    collection.add({}, {at: 0});
-  });
-
-  QUnit.test('#1638 - `sort` during `add` triggers correctly.', function(assert) {
-    var collection = new Backbone.Collection;
-    collection.comparator = function(model) { return model.get('x'); };
-    var added = [];
-    collection.on('add', function(model) {
-      model.set({x: 3});
-      collection.sort();
-      added.push(model.id);
-    });
-    collection.add([{id: 1, x: 1}, {id: 2, x: 2}]);
-    assert.deepEqual(added, [1, 2]);
-  });
-
-  QUnit.test('fetch parses models by default', function(assert) {
-    assert.expect(1);
-    var model = {};
-    var Collection = Backbone.Collection.extend({
-      url: 'test',
-      model: Backbone.Model.extend({
-        parse: function(resp) {
-          assert.strictEqual(resp, model);
-        }
-      })
-    });
-    new Collection().fetch();
-    this.ajaxSettings.success([model]);
-  });
-
-  QUnit.test("`sort` shouldn't always fire on `add`", function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection([{id: 1}, {id: 2}, {id: 3}], {
-      comparator: 'id'
-    });
-    collection.sort = function(){ assert.ok(true); };
-    collection.add([]);
-    collection.add({id: 1});
-    collection.add([{id: 2}, {id: 3}]);
-    collection.add({id: 4});
-  });
-
-  QUnit.test('#1407 parse option on constructor parses collection and models', function(assert) {
-    assert.expect(2);
-    var model = {
-      namespace: [{id: 1}, {id: 2}]
-    };
-    var Collection = Backbone.Collection.extend({
-      model: Backbone.Model.extend({
-        parse: function(m) {
-          m.name = 'test';
-          return m;
-        }
-      }),
-      parse: function(m) {
-        return m.namespace;
-      }
-    });
-    var collection = new Collection(model, {parse: true});
-
-    assert.equal(collection.length, 2);
-    assert.equal(collection.at(0).get('name'), 'test');
-  });
-
-  QUnit.test('#1407 parse option on reset parses collection and models', function(assert) {
-    assert.expect(2);
-    var model = {
-      namespace: [{id: 1}, {id: 2}]
-    };
-    var Collection = Backbone.Collection.extend({
-      model: Backbone.Model.extend({
-        parse: function(m) {
-          m.name = 'test';
-          return m;
-        }
-      }),
-      parse: function(m) {
-        return m.namespace;
-      }
-    });
-    var collection = new Collection();
-    collection.reset(model, {parse: true});
-
-    assert.equal(collection.length, 2);
-    assert.equal(collection.at(0).get('name'), 'test');
-  });
-
-
-  QUnit.test('Reset includes previous models in triggered event.', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    var collection = new Backbone.Collection([model]);
-    collection.on('reset', function(coll, options) {
-      assert.deepEqual(options.previousModels, [model]);
-    });
-    collection.reset([]);
-  });
-
-  QUnit.test('set', function(assert) {
-    var m1 = new Backbone.Model();
-    var m2 = new Backbone.Model({id: 2});
-    var m3 = new Backbone.Model();
-    var collection = new Backbone.Collection([m1, m2]);
-
-    // Test add/change/remove events
-    collection.on('add', function(model) {
-      assert.strictEqual(model, m3);
-    });
-    collection.on('change', function(model) {
-      assert.strictEqual(model, m2);
-    });
-    collection.on('remove', function(model) {
-      assert.strictEqual(model, m1);
-    });
-
-    // remove: false doesn't remove any models
-    collection.set([], {remove: false});
-    assert.strictEqual(collection.length, 2);
-
-    // add: false doesn't add any models
-    collection.set([m1, m2, m3], {add: false});
-    assert.strictEqual(collection.length, 2);
-
-    // merge: false doesn't change any models
-    collection.set([m1, {id: 2, a: 1}], {merge: false});
-    assert.strictEqual(m2.get('a'), void 0);
-
-    // add: false, remove: false only merges existing models
-    collection.set([m1, {id: 2, a: 0}, m3, {id: 4}], {add: false, remove: false});
-    assert.strictEqual(collection.length, 2);
-    assert.strictEqual(m2.get('a'), 0);
-
-    // default options add/remove/merge as appropriate
-    collection.set([{id: 2, a: 1}, m3]);
-    assert.strictEqual(collection.length, 2);
-    assert.strictEqual(m2.get('a'), 1);
-
-    // Test removing models not passing an argument
-    collection.off('remove').on('remove', function(model) {
-      assert.ok(model === m2 || model === m3);
-    });
-    collection.set([]);
-    assert.strictEqual(collection.length, 0);
-
-    // Test null models on set doesn't clear collection
-    collection.off();
-    collection.set([{id: 1}]);
-    collection.set();
-    assert.strictEqual(collection.length, 1);
-  });
-
-  QUnit.test('set with only cids', function(assert) {
-    assert.expect(3);
-    var m1 = new Backbone.Model;
-    var m2 = new Backbone.Model;
-    var collection = new Backbone.Collection;
-    collection.set([m1, m2]);
-    assert.equal(collection.length, 2);
-    collection.set([m1]);
-    assert.equal(collection.length, 1);
-    collection.set([m1, m1, m1, m2, m2], {remove: false});
-    assert.equal(collection.length, 2);
-  });
-
-  QUnit.test('set with only idAttribute', function(assert) {
-    assert.expect(3);
-    var m1 = {_id: 1};
-    var m2 = {_id: 2};
-    var Col = Backbone.Collection.extend({
-      model: Backbone.Model.extend({
-        idAttribute: '_id'
-      })
-    });
-    var collection = new Col;
-    collection.set([m1, m2]);
-    assert.equal(collection.length, 2);
-    collection.set([m1]);
-    assert.equal(collection.length, 1);
-    collection.set([m1, m1, m1, m2, m2], {remove: false});
-    assert.equal(collection.length, 2);
-  });
-
-  QUnit.test('set + merge with default values defined', function(assert) {
-    var Model = Backbone.Model.extend({
-      defaults: {
-        key: 'value'
-      }
-    });
-    var m = new Model({id: 1});
-    var collection = new Backbone.Collection([m], {model: Model});
-    assert.equal(collection.first().get('key'), 'value');
-
-    collection.set({id: 1, key: 'other'});
-    assert.equal(collection.first().get('key'), 'other');
-
-    collection.set({id: 1, other: 'value'});
-    assert.equal(collection.first().get('key'), 'other');
-    assert.equal(collection.length, 1);
-  });
-
-  QUnit.test('merge without mutation', function(assert) {
-    var Model = Backbone.Model.extend({
-      initialize: function(attrs, options) {
-        if (attrs.child) {
-          this.set('child', new Model(attrs.child, options), options);
-        }
-      }
-    });
-    var Collection = Backbone.Collection.extend({model: Model});
-    var data = [{id: 1, child: {id: 2}}];
-    var collection = new Collection(data);
-    assert.equal(collection.first().id, 1);
-    collection.set(data);
-    assert.equal(collection.first().id, 1);
-    collection.set([{id: 2, child: {id: 2}}].concat(data));
-    assert.deepEqual(collection.pluck('id'), [2, 1]);
-  });
-
-  QUnit.test('`set` and model level `parse`', function(assert) {
-    var Model = Backbone.Model.extend({});
-    var Collection = Backbone.Collection.extend({
-      model: Model,
-      parse: function(res) { return _.map(res.models, 'model'); }
-    });
-    var model = new Model({id: 1});
-    var collection = new Collection(model);
-    collection.set({models: [
-      {model: {id: 1}},
-      {model: {id: 2}}
-    ]}, {parse: true});
-    assert.equal(collection.first(), model);
-  });
-
-  QUnit.test('`set` data is only parsed once', function(assert) {
-    var collection = new Backbone.Collection();
-    collection.model = Backbone.Model.extend({
-      parse: function(data) {
-        assert.equal(data.parsed, void 0);
-        data.parsed = true;
-        return data;
-      }
-    });
-    collection.set({}, {parse: true});
-  });
-
-  QUnit.test('`set` matches input order in the absence of a comparator', function(assert) {
-    var one = new Backbone.Model({id: 1});
-    var two = new Backbone.Model({id: 2});
-    var three = new Backbone.Model({id: 3});
-    var collection = new Backbone.Collection([one, two, three]);
-    collection.set([{id: 3}, {id: 2}, {id: 1}]);
-    assert.deepEqual(collection.models, [three, two, one]);
-    collection.set([{id: 1}, {id: 2}]);
-    assert.deepEqual(collection.models, [one, two]);
-    collection.set([two, three, one]);
-    assert.deepEqual(collection.models, [two, three, one]);
-    collection.set([{id: 1}, {id: 2}], {remove: false});
-    assert.deepEqual(collection.models, [two, three, one]);
-    collection.set([{id: 1}, {id: 2}, {id: 3}], {merge: false});
-    assert.deepEqual(collection.models, [one, two, three]);
-    collection.set([three, two, one, {id: 4}], {add: false});
-    assert.deepEqual(collection.models, [one, two, three]);
-  });
-
-  QUnit.test('#1894 - Push should not trigger a sort', function(assert) {
-    assert.expect(0);
-    var Collection = Backbone.Collection.extend({
-      comparator: 'id',
-      sort: function() { assert.ok(false); }
-    });
-    new Collection().push({id: 1});
-  });
-
-  QUnit.test('#2428 - push duplicate models, return the correct one', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection;
-    var model1 = collection.push({id: 101});
-    var model2 = collection.push({id: 101});
-    assert.ok(model2.cid === model1.cid);
-  });
-
-  QUnit.test('`set` with non-normal id', function(assert) {
-    var Collection = Backbone.Collection.extend({
-      model: Backbone.Model.extend({idAttribute: '_id'})
-    });
-    var collection = new Collection({_id: 1});
-    collection.set([{_id: 1, a: 1}], {add: false});
-    assert.equal(collection.first().get('a'), 1);
-  });
-
-  QUnit.test('#1894 - `sort` can optionally be turned off', function(assert) {
-    assert.expect(0);
-    var Collection = Backbone.Collection.extend({
-      comparator: 'id',
-      sort: function() { assert.ok(false); }
-    });
-    new Collection().add({id: 1}, {sort: false});
-  });
-
-  QUnit.test('#1915 - `parse` data in the right order in `set`', function(assert) {
-    var collection = new (Backbone.Collection.extend({
-      parse: function(data) {
-        assert.strictEqual(data.status, 'ok');
-        return data.data;
-      }
-    }));
-    var res = {status: 'ok', data: [{id: 1}]};
-    collection.set(res, {parse: true});
-  });
-
-  QUnit.test('#1939 - `parse` is passed `options`', function(assert) {
-    var done = assert.async();
-    assert.expect(1);
-    var collection = new (Backbone.Collection.extend({
-      url: '/',
-      parse: function(data, options) {
-        assert.strictEqual(options.xhr.someHeader, 'headerValue');
-        return data;
-      }
-    }));
-    var ajax = Backbone.ajax;
-    Backbone.ajax = function(params) {
-      _.defer(params.success, []);
-      return {someHeader: 'headerValue'};
-    };
-    collection.fetch({
-      success: function() { done(); }
-    });
-    Backbone.ajax = ajax;
-  });
-
-  QUnit.test('fetch will pass extra options to success callback', function(assert) {
-    assert.expect(1);
-    var SpecialSyncCollection = Backbone.Collection.extend({
-      url: '/test',
-      sync: function(method, collection, options) {
-        _.extend(options, {specialSync: true});
-        return Backbone.Collection.prototype.sync.call(this, method, collection, options);
-      }
-    });
-
-    var collection = new SpecialSyncCollection();
-
-    var onSuccess = function(coll, resp, options) {
-      assert.ok(options.specialSync, 'Options were passed correctly to callback');
-    };
-
-    collection.fetch({success: onSuccess});
-    this.ajaxSettings.success();
-  });
-
-  QUnit.test('`add` only `sort`s when necessary', function(assert) {
-    assert.expect(2);
-    var collection = new (Backbone.Collection.extend({
-      comparator: 'a'
-    }))([{id: 1}, {id: 2}, {id: 3}]);
-    collection.on('sort', function() { assert.ok(true); });
-    collection.add({id: 4}); // do sort, new model
-    collection.add({id: 1, a: 1}, {merge: true}); // do sort, comparator change
-    collection.add({id: 1, b: 1}, {merge: true}); // don't sort, no comparator change
-    collection.add({id: 1, a: 1}, {merge: true}); // don't sort, no comparator change
-    collection.add(collection.models); // don't sort, nothing new
-    collection.add(collection.models, {merge: true}); // don't sort
-  });
-
-  QUnit.test('`add` only `sort`s when necessary with comparator function', function(assert) {
-    assert.expect(3);
-    var collection = new (Backbone.Collection.extend({
-      comparator: function(m1, m2) {
-        return m1.get('a') > m2.get('a') ? 1 : (m1.get('a') < m2.get('a') ? -1 : 0);
-      }
-    }))([{id: 1}, {id: 2}, {id: 3}]);
-    collection.on('sort', function() { assert.ok(true); });
-    collection.add({id: 4}); // do sort, new model
-    collection.add({id: 1, a: 1}, {merge: true}); // do sort, model change
-    collection.add({id: 1, b: 1}, {merge: true}); // do sort, model change
-    collection.add({id: 1, a: 1}, {merge: true}); // don't sort, no model change
-    collection.add(collection.models); // don't sort, nothing new
-    collection.add(collection.models, {merge: true}); // don't sort
-  });
-
-  QUnit.test('Attach options to collection.', function(assert) {
-    assert.expect(2);
-    var Model = Backbone.Model;
-    var comparator = function(){};
-
-    var collection = new Backbone.Collection([], {
-      model: Model,
-      comparator: comparator
-    });
-
-    assert.ok(collection.model === Model);
-    assert.ok(collection.comparator === comparator);
-  });
-
-  QUnit.test('Pass falsey for `models` for empty Col with `options`', function(assert) {
-    assert.expect(9);
-    var opts = {a: 1, b: 2};
-    _.forEach([undefined, null, false], function(falsey) {
-      var Collection = Backbone.Collection.extend({
-        initialize: function(models, options) {
-          assert.strictEqual(models, falsey);
-          assert.strictEqual(options, opts);
-        }
-      });
-
-      var collection = new Collection(falsey, opts);
-      assert.strictEqual(collection.length, 0);
-    });
-  });
-
-  QUnit.test('`add` overrides `set` flags', function(assert) {
-    var collection = new Backbone.Collection();
-    collection.once('add', function(model, coll, options) {
-      coll.add({id: 2}, options);
-    });
-    collection.set({id: 1});
-    assert.equal(collection.length, 2);
-  });
-
-  QUnit.test('#2606 - Collection#create, success arguments', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection;
-    collection.url = 'test';
-    collection.create({}, {
-      success: function(model, resp, options) {
-        assert.strictEqual(resp, 'response');
-      }
-    });
-    this.ajaxSettings.success('response');
-  });
-
-  QUnit.test('#2612 - nested `parse` works with `Collection#set`', function(assert) {
-
-    var Job = Backbone.Model.extend({
-      constructor: function() {
-        this.items = new Items();
-        Backbone.Model.apply(this, arguments);
-      },
-      parse: function(attrs) {
-        this.items.set(attrs.items, {parse: true});
-        return _.omit(attrs, 'items');
-      }
-    });
-
-    var Item = Backbone.Model.extend({
-      constructor: function() {
-        this.subItems = new Backbone.Collection();
-        Backbone.Model.apply(this, arguments);
-      },
-      parse: function(attrs) {
-        this.subItems.set(attrs.subItems, {parse: true});
-        return _.omit(attrs, 'subItems');
-      }
-    });
-
-    var Items = Backbone.Collection.extend({
-      model: Item
-    });
-
-    var data = {
-      name: 'JobName',
-      id: 1,
-      items: [{
-        id: 1,
-        name: 'Sub1',
-        subItems: [
-          {id: 1, subName: 'One'},
-          {id: 2, subName: 'Two'}
-        ]
-      }, {
-        id: 2,
-        name: 'Sub2',
-        subItems: [
-          {id: 3, subName: 'Three'},
-          {id: 4, subName: 'Four'}
-        ]
-      }]
-    };
-
-    var newData = {
-      name: 'NewJobName',
-      id: 1,
-      items: [{
-        id: 1,
-        name: 'NewSub1',
-        subItems: [
-          {id: 1, subName: 'NewOne'},
-          {id: 2, subName: 'NewTwo'}
-        ]
-      }, {
-        id: 2,
-        name: 'NewSub2',
-        subItems: [
-          {id: 3, subName: 'NewThree'},
-          {id: 4, subName: 'NewFour'}
-        ]
-      }]
-    };
-
-    var job = new Job(data, {parse: true});
-    assert.equal(job.get('name'), 'JobName');
-    assert.equal(job.items.at(0).get('name'), 'Sub1');
-    assert.equal(job.items.length, 2);
-    assert.equal(job.items.get(1).subItems.get(1).get('subName'), 'One');
-    assert.equal(job.items.get(2).subItems.get(3).get('subName'), 'Three');
-    job.set(job.parse(newData, {parse: true}));
-    assert.equal(job.get('name'), 'NewJobName');
-    assert.equal(job.items.at(0).get('name'), 'NewSub1');
-    assert.equal(job.items.length, 2);
-    assert.equal(job.items.get(1).subItems.get(1).get('subName'), 'NewOne');
-    assert.equal(job.items.get(2).subItems.get(3).get('subName'), 'NewThree');
-  });
-
-  QUnit.test('_addReference binds all collection events & adds to the lookup hashes', function(assert) {
-    assert.expect(8);
-
-    var calls = {add: 0, remove: 0};
-
-    var Collection = Backbone.Collection.extend({
-
-      _addReference: function(model) {
-        Backbone.Collection.prototype._addReference.apply(this, arguments);
-        calls.add++;
-        assert.equal(model, this._byId[model.id]);
-        assert.equal(model, this._byId[model.cid]);
-        assert.equal(model._events.all.length, 1);
-      },
-
-      _removeReference: function(model) {
-        Backbone.Collection.prototype._removeReference.apply(this, arguments);
-        calls.remove++;
-        assert.equal(this._byId[model.id], void 0);
-        assert.equal(this._byId[model.cid], void 0);
-        assert.equal(model.collection, void 0);
-      }
-
-    });
-
-    var collection = new Collection();
-    var model = collection.add({id: 1});
-    collection.remove(model);
-
-    assert.equal(calls.add, 1);
-    assert.equal(calls.remove, 1);
-  });
-
-  QUnit.test('Do not allow duplicate models to be `add`ed or `set`', function(assert) {
-    var collection = new Backbone.Collection();
-
-    collection.add([{id: 1}, {id: 1}]);
-    assert.equal(collection.length, 1);
-    assert.equal(collection.models.length, 1);
-
-    collection.set([{id: 1}, {id: 1}]);
-    assert.equal(collection.length, 1);
-    assert.equal(collection.models.length, 1);
-  });
-
-  QUnit.test('#3020: #set with {add: false} should not throw.', function(assert) {
-    assert.expect(2);
-    var collection = new Backbone.Collection;
-    collection.set([{id: 1}], {add: false});
-    assert.strictEqual(collection.length, 0);
-    assert.strictEqual(collection.models.length, 0);
-  });
-
-  QUnit.test('create with wait, model instance, #3028', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection();
-    var model = new Backbone.Model({id: 1});
-    model.sync = function(){
-      assert.equal(this.collection, collection);
-    };
-    collection.create(model, {wait: true});
-  });
-
-  QUnit.test('modelId', function(assert) {
-    var Stooge = Backbone.Model.extend();
-    var StoogeCollection = Backbone.Collection.extend({model: Stooge});
-
-    // Default to using `Collection::model::idAttribute`.
-    assert.equal(StoogeCollection.prototype.modelId({id: 1}), 1);
-    Stooge.prototype.idAttribute = '_id';
-    assert.equal(StoogeCollection.prototype.modelId({_id: 1}), 1);
-  });
-
-  QUnit.test('Polymorphic models work with "simple" constructors', function(assert) {
-    var A = Backbone.Model.extend();
-    var B = Backbone.Model.extend();
-    var C = Backbone.Collection.extend({
-      model: function(attrs) {
-        return attrs.type === 'a' ? new A(attrs) : new B(attrs);
-      }
-    });
-    var collection = new C([{id: 1, type: 'a'}, {id: 2, type: 'b'}]);
-    assert.equal(collection.length, 2);
-    assert.ok(collection.at(0) instanceof A);
-    assert.equal(collection.at(0).id, 1);
-    assert.ok(collection.at(1) instanceof B);
-    assert.equal(collection.at(1).id, 2);
-  });
-
-  QUnit.test('Polymorphic models work with "advanced" constructors', function(assert) {
-    var A = Backbone.Model.extend({idAttribute: '_id'});
-    var B = Backbone.Model.extend({idAttribute: '_id'});
-    var C = Backbone.Collection.extend({
-      model: Backbone.Model.extend({
-        constructor: function(attrs) {
-          return attrs.type === 'a' ? new A(attrs) : new B(attrs);
-        },
-
-        idAttribute: '_id'
-      })
-    });
-    var collection = new C([{_id: 1, type: 'a'}, {_id: 2, type: 'b'}]);
-    assert.equal(collection.length, 2);
-    assert.ok(collection.at(0) instanceof A);
-    assert.equal(collection.at(0), collection.get(1));
-    assert.ok(collection.at(1) instanceof B);
-    assert.equal(collection.at(1), collection.get(2));
-
-    C = Backbone.Collection.extend({
-      model: function(attrs) {
-        return attrs.type === 'a' ? new A(attrs) : new B(attrs);
-      },
-
-      modelId: function(attrs) {
-        return attrs.type + '-' + attrs.id;
-      }
-    });
-    collection = new C([{id: 1, type: 'a'}, {id: 1, type: 'b'}]);
-    assert.equal(collection.length, 2);
-    assert.ok(collection.at(0) instanceof A);
-    assert.equal(collection.at(0), collection.get('a-1'));
-    assert.ok(collection.at(1) instanceof B);
-    assert.equal(collection.at(1), collection.get('b-1'));
-  });
-
-  QUnit.test('Collection with polymorphic models receives default id from modelId', function(assert) {
-    assert.expect(6);
-    // When the polymorphic models use 'id' for the idAttribute, all is fine.
-    var C1 = Backbone.Collection.extend({
-      model: function(attrs) {
-        return new Backbone.Model(attrs);
-      }
-    });
-    var c1 = new C1({id: 1});
-    assert.equal(c1.get(1).id, 1);
-    assert.equal(c1.modelId({id: 1}), 1);
-
-    // If the polymorphic models define their own idAttribute,
-    // the modelId method should be overridden, for the reason below.
-    var M = Backbone.Model.extend({
-      idAttribute: '_id'
-    });
-    var C2 = Backbone.Collection.extend({
-      model: function(attrs) {
-        return new M(attrs);
-      }
-    });
-    var c2 = new C2({'_id': 1});
-    assert.equal(c2.get(1), void 0);
-    assert.equal(c2.modelId(c2.at(0).attributes), void 0);
-    var m = new M({'_id': 2});
-    c2.add(m);
-    assert.equal(c2.get(2), void 0);
-    assert.equal(c2.modelId(m.attributes), void 0);
-  });
-
-  QUnit.test('#3039 #3951: adding at index fires with correct at', function(assert) {
-    assert.expect(4);
-    var collection = new Backbone.Collection([{val: 0}, {val: 4}]);
-    collection.on('add', function(model, coll, options) {
-      assert.equal(model.get('val'), options.index);
-    });
-    collection.add([{val: 1}, {val: 2}, {val: 3}], {at: 1});
-    collection.add({val: 5}, {at: 10});
-  });
-
-  QUnit.test('#3039: index is not sent when at is not specified', function(assert) {
-    assert.expect(2);
-    var collection = new Backbone.Collection([{at: 0}]);
-    collection.on('add', function(model, coll, options) {
-      assert.equal(undefined, options.index);
-    });
-    collection.add([{at: 1}, {at: 2}]);
-  });
-
-  QUnit.test('#3199 - Order changing should trigger a sort', function(assert) {
-    assert.expect(1);
-    var one = new Backbone.Model({id: 1});
-    var two = new Backbone.Model({id: 2});
-    var three = new Backbone.Model({id: 3});
-    var collection = new Backbone.Collection([one, two, three]);
-    collection.on('sort', function() {
-      assert.ok(true);
-    });
-    collection.set([{id: 3}, {id: 2}, {id: 1}]);
-  });
-
-  QUnit.test('#3199 - Adding a model should trigger a sort', function(assert) {
-    assert.expect(1);
-    var one = new Backbone.Model({id: 1});
-    var two = new Backbone.Model({id: 2});
-    var three = new Backbone.Model({id: 3});
-    var collection = new Backbone.Collection([one, two, three]);
-    collection.on('sort', function() {
-      assert.ok(true);
-    });
-    collection.set([{id: 1}, {id: 2}, {id: 3}, {id: 0}]);
-  });
-
-  QUnit.test('#3199 - Order not changing should not trigger a sort', function(assert) {
-    assert.expect(0);
-    var one = new Backbone.Model({id: 1});
-    var two = new Backbone.Model({id: 2});
-    var three = new Backbone.Model({id: 3});
-    var collection = new Backbone.Collection([one, two, three]);
-    collection.on('sort', function() {
-      assert.ok(false);
-    });
-    collection.set([{id: 1}, {id: 2}, {id: 3}]);
-  });
-
-  QUnit.test('add supports negative indexes', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection([{id: 1}]);
-    collection.add([{id: 2}, {id: 3}], {at: -1});
-    collection.add([{id: 2.5}], {at: -2});
-    collection.add([{id: 0.5}], {at: -6});
-    assert.equal(collection.pluck('id').join(','), '0.5,1,2,2.5,3');
-  });
-
-  QUnit.test('#set accepts options.at as a string', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection([{id: 1}, {id: 2}]);
-    collection.add([{id: 3}], {at: '1'});
-    assert.deepEqual(collection.pluck('id'), [1, 3, 2]);
-  });
-
-  QUnit.test('adding multiple models triggers `update` event once', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection;
-    collection.on('update', function() { assert.ok(true); });
-    collection.add([{id: 1}, {id: 2}, {id: 3}]);
-  });
-
-  QUnit.test('removing models triggers `update` event once', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection([{id: 1}, {id: 2}, {id: 3}]);
-    collection.on('update', function() { assert.ok(true); });
-    collection.remove([{id: 1}, {id: 2}]);
-  });
-
-  QUnit.test('remove does not trigger `update` when nothing removed', function(assert) {
-    assert.expect(0);
-    var collection = new Backbone.Collection([{id: 1}, {id: 2}]);
-    collection.on('update', function() { assert.ok(false); });
-    collection.remove([{id: 3}]);
-  });
-
-  QUnit.test('set triggers `set` event once', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection([{id: 1}, {id: 2}]);
-    collection.on('update', function() { assert.ok(true); });
-    collection.set([{id: 1}, {id: 3}]);
-  });
-
-  QUnit.test('set does not trigger `update` event when nothing added nor removed', function(assert) {
-    var collection = new Backbone.Collection([{id: 1}, {id: 2}]);
-    collection.on('update', function(coll, options) {
-      assert.equal(options.changes.added.length, 0);
-      assert.equal(options.changes.removed.length, 0);
-      assert.equal(options.changes.merged.length, 2);
-    });
-    collection.set([{id: 1}, {id: 2}]);
-  });
-
-  QUnit.test('#3610 - invoke collects arguments', function(assert) {
-    assert.expect(3);
-    var Model = Backbone.Model.extend({
-      method: function(x, y, z) {
-        assert.equal(x, 1);
-        assert.equal(y, 2);
-        assert.equal(z, 3);
-      }
-    });
-    var Collection = Backbone.Collection.extend({
-      model: Model
-    });
-    var collection = new Collection([{id: 1}]);
-    collection.invoke('method', 1, 2, 3);
-  });
-
-  QUnit.test('#3662 - triggering change without model will not error', function(assert) {
-    assert.expect(1);
-    var collection = new Backbone.Collection([{id: 1}]);
-    var model = collection.first();
-    collection.on('change', function(m) {
-      assert.equal(m, undefined);
-    });
-    model.trigger('change');
-  });
-
-  QUnit.test('#3871 - falsy parse result creates empty collection', function(assert) {
-    var collection = new (Backbone.Collection.extend({
-      parse: function(data, options) {}
-    }));
-    collection.set('', {parse: true});
-    assert.equal(collection.length, 0);
-  });
-
-  QUnit.test("#3711 - remove's `update` event returns one removed model", function(assert) {
-    var model = new Backbone.Model({id: 1, title: 'First Post'});
-    var collection = new Backbone.Collection([model]);
-    collection.on('update', function(context, options) {
-      var changed = options.changes;
-      assert.deepEqual(changed.added, []);
-      assert.deepEqual(changed.merged, []);
-      assert.strictEqual(changed.removed[0], model);
-    });
-    collection.remove(model);
-  });
-
-  QUnit.test("#3711 - remove's `update` event returns multiple removed models", function(assert) {
-    var model = new Backbone.Model({id: 1, title: 'First Post'});
-    var model2 = new Backbone.Model({id: 2, title: 'Second Post'});
-    var collection = new Backbone.Collection([model, model2]);
-    collection.on('update', function(context, options) {
-      var changed = options.changes;
-      assert.deepEqual(changed.added, []);
-      assert.deepEqual(changed.merged, []);
-      assert.ok(changed.removed.length === 2);
-
-      assert.ok(_.indexOf(changed.removed, model) > -1 && _.indexOf(changed.removed, model2) > -1);
-    });
-    collection.remove([model, model2]);
-  });
-
-  QUnit.test("#3711 - set's `update` event returns one added model", function(assert) {
-    var model = new Backbone.Model({id: 1, title: 'First Post'});
-    var collection = new Backbone.Collection();
-    collection.on('update', function(context, options) {
-      var addedModels = options.changes.added;
-      assert.ok(addedModels.length === 1);
-      assert.strictEqual(addedModels[0], model);
-    });
-    collection.set(model);
-  });
-
-  QUnit.test("#3711 - set's `update` event returns multiple added models", function(assert) {
-    var model = new Backbone.Model({id: 1, title: 'First Post'});
-    var model2 = new Backbone.Model({id: 2, title: 'Second Post'});
-    var collection = new Backbone.Collection();
-    collection.on('update', function(context, options) {
-      var addedModels = options.changes.added;
-      assert.ok(addedModels.length === 2);
-      assert.strictEqual(addedModels[0], model);
-      assert.strictEqual(addedModels[1], model2);
-    });
-    collection.set([model, model2]);
-  });
-
-  QUnit.test("#3711 - set's `update` event returns one removed model", function(assert) {
-    var model = new Backbone.Model({id: 1, title: 'First Post'});
-    var model2 = new Backbone.Model({id: 2, title: 'Second Post'});
-    var model3 = new Backbone.Model({id: 3, title: 'My Last Post'});
-    var collection = new Backbone.Collection([model]);
-    collection.on('update', function(context, options) {
-      var changed = options.changes;
-      assert.equal(changed.added.length, 2);
-      assert.equal(changed.merged.length, 0);
-      assert.ok(changed.removed.length === 1);
-      assert.strictEqual(changed.removed[0], model);
-    });
-    collection.set([model2, model3]);
-  });
-
-  QUnit.test("#3711 - set's `update` event returns multiple removed models", function(assert) {
-    var model = new Backbone.Model({id: 1, title: 'First Post'});
-    var model2 = new Backbone.Model({id: 2, title: 'Second Post'});
-    var model3 = new Backbone.Model({id: 3, title: 'My Last Post'});
-    var collection = new Backbone.Collection([model, model2]);
-    collection.on('update', function(context, options) {
-      var removedModels = options.changes.removed;
-      assert.ok(removedModels.length === 2);
-      assert.strictEqual(removedModels[0], model);
-      assert.strictEqual(removedModels[1], model2);
-    });
-    collection.set([model3]);
-  });
-
-  QUnit.test("#3711 - set's `update` event returns one merged model", function(assert) {
-    var model = new Backbone.Model({id: 1, title: 'First Post'});
-    var model2 = new Backbone.Model({id: 2, title: 'Second Post'});
-    var model2Update = new Backbone.Model({id: 2, title: 'Second Post V2'});
-    var collection = new Backbone.Collection([model, model2]);
-    collection.on('update', function(context, options) {
-      var mergedModels = options.changes.merged;
-      assert.ok(mergedModels.length === 1);
-      assert.strictEqual(mergedModels[0].get('title'), model2Update.get('title'));
-    });
-    collection.set([model2Update]);
-  });
-
-  QUnit.test("#3711 - set's `update` event returns multiple merged models", function(assert) {
-    var model = new Backbone.Model({id: 1, title: 'First Post'});
-    var modelUpdate = new Backbone.Model({id: 1, title: 'First Post V2'});
-    var model2 = new Backbone.Model({id: 2, title: 'Second Post'});
-    var model2Update = new Backbone.Model({id: 2, title: 'Second Post V2'});
-    var collection = new Backbone.Collection([model, model2]);
-    collection.on('update', function(context, options) {
-      var mergedModels = options.changes.merged;
-      assert.ok(mergedModels.length === 2);
-      assert.strictEqual(mergedModels[0].get('title'), model2Update.get('title'));
-      assert.strictEqual(mergedModels[1].get('title'), modelUpdate.get('title'));
-    });
-    collection.set([model2Update, modelUpdate]);
-  });
-
-  QUnit.test("#3711 - set's `update` event should not be triggered adding a model which already exists exactly alike", function(assert) {
-    var fired = false;
-    var model = new Backbone.Model({id: 1, title: 'First Post'});
-    var collection = new Backbone.Collection([model]);
-    collection.on('update', function(context, options) {
-      fired = true;
-    });
-    collection.set([model]);
-    assert.equal(fired, false);
-  });
-
-})();
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/events.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/events.js
deleted file mode 100644
index 544b39a..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/events.js
+++ /dev/null
@@ -1,706 +0,0 @@
-(function() {
-
-  QUnit.module('Backbone.Events');
-
-  QUnit.test('on and trigger', function(assert) {
-    assert.expect(2);
-    var obj = {counter: 0};
-    _.extend(obj, Backbone.Events);
-    obj.on('event', function() { obj.counter += 1; });
-    obj.trigger('event');
-    assert.equal(obj.counter, 1, 'counter should be incremented.');
-    obj.trigger('event');
-    obj.trigger('event');
-    obj.trigger('event');
-    obj.trigger('event');
-    assert.equal(obj.counter, 5, 'counter should be incremented five times.');
-  });
-
-  QUnit.test('binding and triggering multiple events', function(assert) {
-    assert.expect(4);
-    var obj = {counter: 0};
-    _.extend(obj, Backbone.Events);
-
-    obj.on('a b c', function() { obj.counter += 1; });
-
-    obj.trigger('a');
-    assert.equal(obj.counter, 1);
-
-    obj.trigger('a b');
-    assert.equal(obj.counter, 3);
-
-    obj.trigger('c');
-    assert.equal(obj.counter, 4);
-
-    obj.off('a c');
-    obj.trigger('a b c');
-    assert.equal(obj.counter, 5);
-  });
-
-  QUnit.test('binding and triggering with event maps', function(assert) {
-    var obj = {counter: 0};
-    _.extend(obj, Backbone.Events);
-
-    var increment = function() {
-      this.counter += 1;
-    };
-
-    obj.on({
-      a: increment,
-      b: increment,
-      c: increment
-    }, obj);
-
-    obj.trigger('a');
-    assert.equal(obj.counter, 1);
-
-    obj.trigger('a b');
-    assert.equal(obj.counter, 3);
-
-    obj.trigger('c');
-    assert.equal(obj.counter, 4);
-
-    obj.off({
-      a: increment,
-      c: increment
-    }, obj);
-    obj.trigger('a b c');
-    assert.equal(obj.counter, 5);
-  });
-
-  QUnit.test('binding and triggering multiple event names with event maps', function(assert) {
-    var obj = {counter: 0};
-    _.extend(obj, Backbone.Events);
-
-    var increment = function() {
-      this.counter += 1;
-    };
-
-    obj.on({
-      'a b c': increment
-    });
-
-    obj.trigger('a');
-    assert.equal(obj.counter, 1);
-
-    obj.trigger('a b');
-    assert.equal(obj.counter, 3);
-
-    obj.trigger('c');
-    assert.equal(obj.counter, 4);
-
-    obj.off({
-      'a c': increment
-    });
-    obj.trigger('a b c');
-    assert.equal(obj.counter, 5);
-  });
-
-  QUnit.test('binding and trigger with event maps context', function(assert) {
-    assert.expect(2);
-    var obj = {counter: 0};
-    var context = {};
-    _.extend(obj, Backbone.Events);
-
-    obj.on({
-      a: function() {
-        assert.strictEqual(this, context, 'defaults `context` to `callback` param');
-      }
-    }, context).trigger('a');
-
-    obj.off().on({
-      a: function() {
-        assert.strictEqual(this, context, 'will not override explicit `context` param');
-      }
-    }, this, context).trigger('a');
-  });
-
-  QUnit.test('listenTo and stopListening', function(assert) {
-    assert.expect(1);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    a.listenTo(b, 'all', function(){ assert.ok(true); });
-    b.trigger('anything');
-    a.listenTo(b, 'all', function(){ assert.ok(false); });
-    a.stopListening();
-    b.trigger('anything');
-  });
-
-  QUnit.test('listenTo and stopListening with event maps', function(assert) {
-    assert.expect(4);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    var cb = function(){ assert.ok(true); };
-    a.listenTo(b, {event: cb});
-    b.trigger('event');
-    a.listenTo(b, {event2: cb});
-    b.on('event2', cb);
-    a.stopListening(b, {event2: cb});
-    b.trigger('event event2');
-    a.stopListening();
-    b.trigger('event event2');
-  });
-
-  QUnit.test('stopListening with omitted args', function(assert) {
-    assert.expect(2);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    var cb = function() { assert.ok(true); };
-    a.listenTo(b, 'event', cb);
-    b.on('event', cb);
-    a.listenTo(b, 'event2', cb);
-    a.stopListening(null, {event: cb});
-    b.trigger('event event2');
-    b.off();
-    a.listenTo(b, 'event event2', cb);
-    a.stopListening(null, 'event');
-    a.stopListening();
-    b.trigger('event2');
-  });
-
-  QUnit.test('listenToOnce', function(assert) {
-    assert.expect(2);
-    // Same as the previous test, but we use once rather than having to explicitly unbind
-    var obj = {counterA: 0, counterB: 0};
-    _.extend(obj, Backbone.Events);
-    var incrA = function(){ obj.counterA += 1; obj.trigger('event'); };
-    var incrB = function(){ obj.counterB += 1; };
-    obj.listenToOnce(obj, 'event', incrA);
-    obj.listenToOnce(obj, 'event', incrB);
-    obj.trigger('event');
-    assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
-    assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
-  });
-
-  QUnit.test('listenToOnce and stopListening', function(assert) {
-    assert.expect(1);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    a.listenToOnce(b, 'all', function() { assert.ok(true); });
-    b.trigger('anything');
-    b.trigger('anything');
-    a.listenToOnce(b, 'all', function() { assert.ok(false); });
-    a.stopListening();
-    b.trigger('anything');
-  });
-
-  QUnit.test('listenTo, listenToOnce and stopListening', function(assert) {
-    assert.expect(1);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    a.listenToOnce(b, 'all', function() { assert.ok(true); });
-    b.trigger('anything');
-    b.trigger('anything');
-    a.listenTo(b, 'all', function() { assert.ok(false); });
-    a.stopListening();
-    b.trigger('anything');
-  });
-
-  QUnit.test('listenTo and stopListening with event maps', function(assert) {
-    assert.expect(1);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    a.listenTo(b, {change: function(){ assert.ok(true); }});
-    b.trigger('change');
-    a.listenTo(b, {change: function(){ assert.ok(false); }});
-    a.stopListening();
-    b.trigger('change');
-  });
-
-  QUnit.test('listenTo yourself', function(assert) {
-    assert.expect(1);
-    var e = _.extend({}, Backbone.Events);
-    e.listenTo(e, 'foo', function(){ assert.ok(true); });
-    e.trigger('foo');
-  });
-
-  QUnit.test('listenTo yourself cleans yourself up with stopListening', function(assert) {
-    assert.expect(1);
-    var e = _.extend({}, Backbone.Events);
-    e.listenTo(e, 'foo', function(){ assert.ok(true); });
-    e.trigger('foo');
-    e.stopListening();
-    e.trigger('foo');
-  });
-
-  QUnit.test('stopListening cleans up references', function(assert) {
-    assert.expect(12);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    var fn = function() {};
-    b.on('event', fn);
-    a.listenTo(b, 'event', fn).stopListening();
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._events.event), 1);
-    assert.equal(_.size(b._listeners), 0);
-    a.listenTo(b, 'event', fn).stopListening(b);
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._events.event), 1);
-    assert.equal(_.size(b._listeners), 0);
-    a.listenTo(b, 'event', fn).stopListening(b, 'event');
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._events.event), 1);
-    assert.equal(_.size(b._listeners), 0);
-    a.listenTo(b, 'event', fn).stopListening(b, 'event', fn);
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._events.event), 1);
-    assert.equal(_.size(b._listeners), 0);
-  });
-
-  QUnit.test('stopListening cleans up references from listenToOnce', function(assert) {
-    assert.expect(12);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    var fn = function() {};
-    b.on('event', fn);
-    a.listenToOnce(b, 'event', fn).stopListening();
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._events.event), 1);
-    assert.equal(_.size(b._listeners), 0);
-    a.listenToOnce(b, 'event', fn).stopListening(b);
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._events.event), 1);
-    assert.equal(_.size(b._listeners), 0);
-    a.listenToOnce(b, 'event', fn).stopListening(b, 'event');
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._events.event), 1);
-    assert.equal(_.size(b._listeners), 0);
-    a.listenToOnce(b, 'event', fn).stopListening(b, 'event', fn);
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._events.event), 1);
-    assert.equal(_.size(b._listeners), 0);
-  });
-
-  QUnit.test('listenTo and off cleaning up references', function(assert) {
-    assert.expect(8);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    var fn = function() {};
-    a.listenTo(b, 'event', fn);
-    b.off();
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._listeners), 0);
-    a.listenTo(b, 'event', fn);
-    b.off('event');
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._listeners), 0);
-    a.listenTo(b, 'event', fn);
-    b.off(null, fn);
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._listeners), 0);
-    a.listenTo(b, 'event', fn);
-    b.off(null, null, a);
-    assert.equal(_.size(a._listeningTo), 0);
-    assert.equal(_.size(b._listeners), 0);
-  });
-
-  QUnit.test('listenTo and stopListening cleaning up references', function(assert) {
-    assert.expect(2);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    a.listenTo(b, 'all', function(){ assert.ok(true); });
-    b.trigger('anything');
-    a.listenTo(b, 'other', function(){ assert.ok(false); });
-    a.stopListening(b, 'other');
-    a.stopListening(b, 'all');
-    assert.equal(_.size(a._listeningTo), 0);
-  });
-
-  QUnit.test('listenToOnce without context cleans up references after the event has fired', function(assert) {
-    assert.expect(2);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    a.listenToOnce(b, 'all', function(){ assert.ok(true); });
-    b.trigger('anything');
-    assert.equal(_.size(a._listeningTo), 0);
-  });
-
-  QUnit.test('listenToOnce with event maps cleans up references', function(assert) {
-    assert.expect(2);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    a.listenToOnce(b, {
-      one: function() { assert.ok(true); },
-      two: function() { assert.ok(false); }
-    });
-    b.trigger('one');
-    assert.equal(_.size(a._listeningTo), 1);
-  });
-
-  QUnit.test('listenToOnce with event maps binds the correct `this`', function(assert) {
-    assert.expect(1);
-    var a = _.extend({}, Backbone.Events);
-    var b = _.extend({}, Backbone.Events);
-    a.listenToOnce(b, {
-      one: function() { assert.ok(this === a); },
-      two: function() { assert.ok(false); }
-    });
-    b.trigger('one');
-  });
-
-  QUnit.test("listenTo with empty callback doesn't throw an error", function(assert) {
-    assert.expect(1);
-    var e = _.extend({}, Backbone.Events);
-    e.listenTo(e, 'foo', null);
-    e.trigger('foo');
-    assert.ok(true);
-  });
-
-  QUnit.test('trigger all for each event', function(assert) {
-    assert.expect(3);
-    var a, b, obj = {counter: 0};
-    _.extend(obj, Backbone.Events);
-    obj.on('all', function(event) {
-      obj.counter++;
-      if (event === 'a') a = true;
-      if (event === 'b') b = true;
-    })
-    .trigger('a b');
-    assert.ok(a);
-    assert.ok(b);
-    assert.equal(obj.counter, 2);
-  });
-
-  QUnit.test('on, then unbind all functions', function(assert) {
-    assert.expect(1);
-    var obj = {counter: 0};
-    _.extend(obj, Backbone.Events);
-    var callback = function() { obj.counter += 1; };
-    obj.on('event', callback);
-    obj.trigger('event');
-    obj.off('event');
-    obj.trigger('event');
-    assert.equal(obj.counter, 1, 'counter should have only been incremented once.');
-  });
-
-  QUnit.test('bind two callbacks, unbind only one', function(assert) {
-    assert.expect(2);
-    var obj = {counterA: 0, counterB: 0};
-    _.extend(obj, Backbone.Events);
-    var callback = function() { obj.counterA += 1; };
-    obj.on('event', callback);
-    obj.on('event', function() { obj.counterB += 1; });
-    obj.trigger('event');
-    obj.off('event', callback);
-    obj.trigger('event');
-    assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
-    assert.equal(obj.counterB, 2, 'counterB should have been incremented twice.');
-  });
-
-  QUnit.test('unbind a callback in the midst of it firing', function(assert) {
-    assert.expect(1);
-    var obj = {counter: 0};
-    _.extend(obj, Backbone.Events);
-    var callback = function() {
-      obj.counter += 1;
-      obj.off('event', callback);
-    };
-    obj.on('event', callback);
-    obj.trigger('event');
-    obj.trigger('event');
-    obj.trigger('event');
-    assert.equal(obj.counter, 1, 'the callback should have been unbound.');
-  });
-
-  QUnit.test('two binds that unbind themeselves', function(assert) {
-    assert.expect(2);
-    var obj = {counterA: 0, counterB: 0};
-    _.extend(obj, Backbone.Events);
-    var incrA = function(){ obj.counterA += 1; obj.off('event', incrA); };
-    var incrB = function(){ obj.counterB += 1; obj.off('event', incrB); };
-    obj.on('event', incrA);
-    obj.on('event', incrB);
-    obj.trigger('event');
-    obj.trigger('event');
-    obj.trigger('event');
-    assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
-    assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
-  });
-
-  QUnit.test('bind a callback with a default context when none supplied', function(assert) {
-    assert.expect(1);
-    var obj = _.extend({
-      assertTrue: function() {
-        assert.equal(this, obj, '`this` was bound to the callback');
-      }
-    }, Backbone.Events);
-
-    obj.once('event', obj.assertTrue);
-    obj.trigger('event');
-  });
-
-  QUnit.test('bind a callback with a supplied context', function(assert) {
-    assert.expect(1);
-    var TestClass = function() {
-      return this;
-    };
-    TestClass.prototype.assertTrue = function() {
-      assert.ok(true, '`this` was bound to the callback');
-    };
-
-    var obj = _.extend({}, Backbone.Events);
-    obj.on('event', function() { this.assertTrue(); }, new TestClass);
-    obj.trigger('event');
-  });
-
-  QUnit.test('nested trigger with unbind', function(assert) {
-    assert.expect(1);
-    var obj = {counter: 0};
-    _.extend(obj, Backbone.Events);
-    var incr1 = function(){ obj.counter += 1; obj.off('event', incr1); obj.trigger('event'); };
-    var incr2 = function(){ obj.counter += 1; };
-    obj.on('event', incr1);
-    obj.on('event', incr2);
-    obj.trigger('event');
-    assert.equal(obj.counter, 3, 'counter should have been incremented three times');
-  });
-
-  QUnit.test('callback list is not altered during trigger', function(assert) {
-    assert.expect(2);
-    var counter = 0, obj = _.extend({}, Backbone.Events);
-    var incr = function(){ counter++; };
-    var incrOn = function(){ obj.on('event all', incr); };
-    var incrOff = function(){ obj.off('event all', incr); };
-
-    obj.on('event all', incrOn).trigger('event');
-    assert.equal(counter, 0, 'on does not alter callback list');
-
-    obj.off().on('event', incrOff).on('event all', incr).trigger('event');
-    assert.equal(counter, 2, 'off does not alter callback list');
-  });
-
-  QUnit.test("#1282 - 'all' callback list is retrieved after each event.", function(assert) {
-    assert.expect(1);
-    var counter = 0;
-    var obj = _.extend({}, Backbone.Events);
-    var incr = function(){ counter++; };
-    obj.on('x', function() {
-      obj.on('y', incr).on('all', incr);
-    })
-    .trigger('x y');
-    assert.strictEqual(counter, 2);
-  });
-
-  QUnit.test('if no callback is provided, `on` is a noop', function(assert) {
-    assert.expect(0);
-    _.extend({}, Backbone.Events).on('test').trigger('test');
-  });
-
-  QUnit.test('if callback is truthy but not a function, `on` should throw an error just like jQuery', function(assert) {
-    assert.expect(1);
-    var view = _.extend({}, Backbone.Events).on('test', 'noop');
-    assert.raises(function() {
-      view.trigger('test');
-    });
-  });
-
-  QUnit.test('remove all events for a specific context', function(assert) {
-    assert.expect(4);
-    var obj = _.extend({}, Backbone.Events);
-    obj.on('x y all', function() { assert.ok(true); });
-    obj.on('x y all', function() { assert.ok(false); }, obj);
-    obj.off(null, null, obj);
-    obj.trigger('x y');
-  });
-
-  QUnit.test('remove all events for a specific callback', function(assert) {
-    assert.expect(4);
-    var obj = _.extend({}, Backbone.Events);
-    var success = function() { assert.ok(true); };
-    var fail = function() { assert.ok(false); };
-    obj.on('x y all', success);
-    obj.on('x y all', fail);
-    obj.off(null, fail);
-    obj.trigger('x y');
-  });
-
-  QUnit.test('#1310 - off does not skip consecutive events', function(assert) {
-    assert.expect(0);
-    var obj = _.extend({}, Backbone.Events);
-    obj.on('event', function() { assert.ok(false); }, obj);
-    obj.on('event', function() { assert.ok(false); }, obj);
-    obj.off(null, null, obj);
-    obj.trigger('event');
-  });
-
-  QUnit.test('once', function(assert) {
-    assert.expect(2);
-    // Same as the previous test, but we use once rather than having to explicitly unbind
-    var obj = {counterA: 0, counterB: 0};
-    _.extend(obj, Backbone.Events);
-    var incrA = function(){ obj.counterA += 1; obj.trigger('event'); };
-    var incrB = function(){ obj.counterB += 1; };
-    obj.once('event', incrA);
-    obj.once('event', incrB);
-    obj.trigger('event');
-    assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
-    assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
-  });
-
-  QUnit.test('once variant one', function(assert) {
-    assert.expect(3);
-    var f = function(){ assert.ok(true); };
-
-    var a = _.extend({}, Backbone.Events).once('event', f);
-    var b = _.extend({}, Backbone.Events).on('event', f);
-
-    a.trigger('event');
-
-    b.trigger('event');
-    b.trigger('event');
-  });
-
-  QUnit.test('once variant two', function(assert) {
-    assert.expect(3);
-    var f = function(){ assert.ok(true); };
-    var obj = _.extend({}, Backbone.Events);
-
-    obj
-      .once('event', f)
-      .on('event', f)
-      .trigger('event')
-      .trigger('event');
-  });
-
-  QUnit.test('once with off', function(assert) {
-    assert.expect(0);
-    var f = function(){ assert.ok(true); };
-    var obj = _.extend({}, Backbone.Events);
-
-    obj.once('event', f);
-    obj.off('event', f);
-    obj.trigger('event');
-  });
-
-  QUnit.test('once with event maps', function(assert) {
-    var obj = {counter: 0};
-    _.extend(obj, Backbone.Events);
-
-    var increment = function() {
-      this.counter += 1;
-    };
-
-    obj.once({
-      a: increment,
-      b: increment,
-      c: increment
-    }, obj);
-
-    obj.trigger('a');
-    assert.equal(obj.counter, 1);
-
-    obj.trigger('a b');
-    assert.equal(obj.counter, 2);
-
-    obj.trigger('c');
-    assert.equal(obj.counter, 3);
-
-    obj.trigger('a b c');
-    assert.equal(obj.counter, 3);
-  });
-
-  QUnit.test('bind a callback with a supplied context using once with object notation', function(assert) {
-    assert.expect(1);
-    var obj = {counter: 0};
-    var context = {};
-    _.extend(obj, Backbone.Events);
-
-    obj.once({
-      a: function() {
-        assert.strictEqual(this, context, 'defaults `context` to `callback` param');
-      }
-    }, context).trigger('a');
-  });
-
-  QUnit.test('once with off only by context', function(assert) {
-    assert.expect(0);
-    var context = {};
-    var obj = _.extend({}, Backbone.Events);
-    obj.once('event', function(){ assert.ok(false); }, context);
-    obj.off(null, null, context);
-    obj.trigger('event');
-  });
-
-  QUnit.test('Backbone object inherits Events', function(assert) {
-    assert.ok(Backbone.on === Backbone.Events.on);
-  });
-
-  QUnit.test('once with asynchronous events', function(assert) {
-    var done = assert.async();
-    assert.expect(1);
-    var func = _.debounce(function() { assert.ok(true); done(); }, 50);
-    var obj = _.extend({}, Backbone.Events).once('async', func);
-
-    obj.trigger('async');
-    obj.trigger('async');
-  });
-
-  QUnit.test('once with multiple events.', function(assert) {
-    assert.expect(2);
-    var obj = _.extend({}, Backbone.Events);
-    obj.once('x y', function() { assert.ok(true); });
-    obj.trigger('x y');
-  });
-
-  QUnit.test('Off during iteration with once.', function(assert) {
-    assert.expect(2);
-    var obj = _.extend({}, Backbone.Events);
-    var f = function(){ this.off('event', f); };
-    obj.on('event', f);
-    obj.once('event', function(){});
-    obj.on('event', function(){ assert.ok(true); });
-
-    obj.trigger('event');
-    obj.trigger('event');
-  });
-
-  QUnit.test('`once` on `all` should work as expected', function(assert) {
-    assert.expect(1);
-    Backbone.once('all', function() {
-      assert.ok(true);
-      Backbone.trigger('all');
-    });
-    Backbone.trigger('all');
-  });
-
-  QUnit.test('once without a callback is a noop', function(assert) {
-    assert.expect(0);
-    _.extend({}, Backbone.Events).once('event').trigger('event');
-  });
-
-  QUnit.test('listenToOnce without a callback is a noop', function(assert) {
-    assert.expect(0);
-    var obj = _.extend({}, Backbone.Events);
-    obj.listenToOnce(obj, 'event').trigger('event');
-  });
-
-  QUnit.test('event functions are chainable', function(assert) {
-    var obj = _.extend({}, Backbone.Events);
-    var obj2 = _.extend({}, Backbone.Events);
-    var fn = function() {};
-    assert.equal(obj, obj.trigger('noeventssetyet'));
-    assert.equal(obj, obj.off('noeventssetyet'));
-    assert.equal(obj, obj.stopListening('noeventssetyet'));
-    assert.equal(obj, obj.on('a', fn));
-    assert.equal(obj, obj.once('c', fn));
-    assert.equal(obj, obj.trigger('a'));
-    assert.equal(obj, obj.listenTo(obj2, 'a', fn));
-    assert.equal(obj, obj.listenToOnce(obj2, 'b', fn));
-    assert.equal(obj, obj.off('a c'));
-    assert.equal(obj, obj.stopListening(obj2, 'a'));
-    assert.equal(obj, obj.stopListening());
-  });
-
-  QUnit.test('#3448 - listenToOnce with space-separated events', function(assert) {
-    assert.expect(2);
-    var one = _.extend({}, Backbone.Events);
-    var two = _.extend({}, Backbone.Events);
-    var count = 1;
-    one.listenToOnce(two, 'x y', function(n) { assert.ok(n === count++); });
-    two.trigger('x', 1);
-    two.trigger('x', 1);
-    two.trigger('y', 2);
-    two.trigger('y', 2);
-  });
-
-})();
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/model.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/model.js
deleted file mode 100644
index b73a1c7..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/model.js
+++ /dev/null
@@ -1,1418 +0,0 @@
-(function() {
-
-  var ProxyModel = Backbone.Model.extend();
-  var Klass = Backbone.Collection.extend({
-    url: function() { return '/collection'; }
-  });
-  var doc, collection;
-
-  QUnit.module('Backbone.Model', {
-
-    beforeEach: function(assert) {
-      doc = new ProxyModel({
-        id: '1-the-tempest',
-        title: 'The Tempest',
-        author: 'Bill Shakespeare',
-        length: 123
-      });
-      collection = new Klass();
-      collection.add(doc);
-    }
-
-  });
-
-  QUnit.test('initialize', function(assert) {
-    assert.expect(3);
-    var Model = Backbone.Model.extend({
-      initialize: function() {
-        this.one = 1;
-        assert.equal(this.collection, collection);
-      }
-    });
-    var model = new Model({}, {collection: collection});
-    assert.equal(model.one, 1);
-    assert.equal(model.collection, collection);
-  });
-
-  QUnit.test('Object.prototype properties are overridden by attributes', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model({hasOwnProperty: true});
-    assert.equal(model.get('hasOwnProperty'), true);
-  });
-
-  QUnit.test('initialize with attributes and options', function(assert) {
-    assert.expect(1);
-    var Model = Backbone.Model.extend({
-      initialize: function(attributes, options) {
-        this.one = options.one;
-      }
-    });
-    var model = new Model({}, {one: 1});
-    assert.equal(model.one, 1);
-  });
-
-  QUnit.test('initialize with parsed attributes', function(assert) {
-    assert.expect(1);
-    var Model = Backbone.Model.extend({
-      parse: function(attrs) {
-        attrs.value += 1;
-        return attrs;
-      }
-    });
-    var model = new Model({value: 1}, {parse: true});
-    assert.equal(model.get('value'), 2);
-  });
-
-  QUnit.test('parse can return null', function(assert) {
-    assert.expect(1);
-    var Model = Backbone.Model.extend({
-      parse: function(attrs) {
-        attrs.value += 1;
-        return null;
-      }
-    });
-    var model = new Model({value: 1}, {parse: true});
-    assert.equal(JSON.stringify(model.toJSON()), '{}');
-  });
-
-  QUnit.test('url', function(assert) {
-    assert.expect(3);
-    doc.urlRoot = null;
-    assert.equal(doc.url(), '/collection/1-the-tempest');
-    doc.collection.url = '/collection/';
-    assert.equal(doc.url(), '/collection/1-the-tempest');
-    doc.collection = null;
-    assert.raises(function() { doc.url(); });
-    doc.collection = collection;
-  });
-
-  QUnit.test('url when using urlRoot, and uri encoding', function(assert) {
-    assert.expect(2);
-    var Model = Backbone.Model.extend({
-      urlRoot: '/collection'
-    });
-    var model = new Model();
-    assert.equal(model.url(), '/collection');
-    model.set({id: '+1+'});
-    assert.equal(model.url(), '/collection/%2B1%2B');
-  });
-
-  QUnit.test('url when using urlRoot as a function to determine urlRoot at runtime', function(assert) {
-    assert.expect(2);
-    var Model = Backbone.Model.extend({
-      urlRoot: function() {
-        return '/nested/' + this.get('parentId') + '/collection';
-      }
-    });
-
-    var model = new Model({parentId: 1});
-    assert.equal(model.url(), '/nested/1/collection');
-    model.set({id: 2});
-    assert.equal(model.url(), '/nested/1/collection/2');
-  });
-
-  QUnit.test('underscore methods', function(assert) {
-    assert.expect(5);
-    var model = new Backbone.Model({foo: 'a', bar: 'b', baz: 'c'});
-    var model2 = model.clone();
-    assert.deepEqual(model.keys(), ['foo', 'bar', 'baz']);
-    assert.deepEqual(model.values(), ['a', 'b', 'c']);
-    assert.deepEqual(model.invert(), {a: 'foo', b: 'bar', c: 'baz'});
-    assert.deepEqual(model.pick('foo', 'baz'), {foo: 'a', baz: 'c'});
-    assert.deepEqual(model.omit('foo', 'bar'), {baz: 'c'});
-  });
-
-  QUnit.test('chain', function(assert) {
-    var model = new Backbone.Model({a: 0, b: 1, c: 2});
-    assert.deepEqual(model.chain().pick('a', 'b', 'c').values().compact().value(), [1, 2]);
-  });
-
-  QUnit.test('clone', function(assert) {
-    assert.expect(10);
-    var a = new Backbone.Model({foo: 1, bar: 2, baz: 3});
-    var b = a.clone();
-    assert.equal(a.get('foo'), 1);
-    assert.equal(a.get('bar'), 2);
-    assert.equal(a.get('baz'), 3);
-    assert.equal(b.get('foo'), a.get('foo'), 'Foo should be the same on the clone.');
-    assert.equal(b.get('bar'), a.get('bar'), 'Bar should be the same on the clone.');
-    assert.equal(b.get('baz'), a.get('baz'), 'Baz should be the same on the clone.');
-    a.set({foo: 100});
-    assert.equal(a.get('foo'), 100);
-    assert.equal(b.get('foo'), 1, 'Changing a parent attribute does not change the clone.');
-
-    var foo = new Backbone.Model({p: 1});
-    var bar = new Backbone.Model({p: 2});
-    bar.set(foo.clone().attributes, {unset: true});
-    assert.equal(foo.get('p'), 1);
-    assert.equal(bar.get('p'), undefined);
-  });
-
-  QUnit.test('isNew', function(assert) {
-    assert.expect(6);
-    var a = new Backbone.Model({foo: 1, bar: 2, baz: 3});
-    assert.ok(a.isNew(), 'it should be new');
-    a = new Backbone.Model({foo: 1, bar: 2, baz: 3, id: -5});
-    assert.ok(!a.isNew(), 'any defined ID is legal, negative or positive');
-    a = new Backbone.Model({foo: 1, bar: 2, baz: 3, id: 0});
-    assert.ok(!a.isNew(), 'any defined ID is legal, including zero');
-    assert.ok(new Backbone.Model().isNew(), 'is true when there is no id');
-    assert.ok(!new Backbone.Model({id: 2}).isNew(), 'is false for a positive integer');
-    assert.ok(!new Backbone.Model({id: -5}).isNew(), 'is false for a negative integer');
-  });
-
-  QUnit.test('get', function(assert) {
-    assert.expect(2);
-    assert.equal(doc.get('title'), 'The Tempest');
-    assert.equal(doc.get('author'), 'Bill Shakespeare');
-  });
-
-  QUnit.test('escape', function(assert) {
-    assert.expect(5);
-    assert.equal(doc.escape('title'), 'The Tempest');
-    doc.set({audience: 'Bill & Bob'});
-    assert.equal(doc.escape('audience'), 'Bill &amp; Bob');
-    doc.set({audience: 'Tim > Joan'});
-    assert.equal(doc.escape('audience'), 'Tim &gt; Joan');
-    doc.set({audience: 10101});
-    assert.equal(doc.escape('audience'), '10101');
-    doc.unset('audience');
-    assert.equal(doc.escape('audience'), '');
-  });
-
-  QUnit.test('has', function(assert) {
-    assert.expect(10);
-    var model = new Backbone.Model();
-
-    assert.strictEqual(model.has('name'), false);
-
-    model.set({
-      '0': 0,
-      '1': 1,
-      'true': true,
-      'false': false,
-      'empty': '',
-      'name': 'name',
-      'null': null,
-      'undefined': undefined
-    });
-
-    assert.strictEqual(model.has('0'), true);
-    assert.strictEqual(model.has('1'), true);
-    assert.strictEqual(model.has('true'), true);
-    assert.strictEqual(model.has('false'), true);
-    assert.strictEqual(model.has('empty'), true);
-    assert.strictEqual(model.has('name'), true);
-
-    model.unset('name');
-
-    assert.strictEqual(model.has('name'), false);
-    assert.strictEqual(model.has('null'), false);
-    assert.strictEqual(model.has('undefined'), false);
-  });
-
-  QUnit.test('matches', function(assert) {
-    assert.expect(4);
-    var model = new Backbone.Model();
-
-    assert.strictEqual(model.matches({name: 'Jonas', cool: true}), false);
-
-    model.set({name: 'Jonas', cool: true});
-
-    assert.strictEqual(model.matches({name: 'Jonas'}), true);
-    assert.strictEqual(model.matches({name: 'Jonas', cool: true}), true);
-    assert.strictEqual(model.matches({name: 'Jonas', cool: false}), false);
-  });
-
-  QUnit.test('matches with predicate', function(assert) {
-    var model = new Backbone.Model({a: 0});
-
-    assert.strictEqual(model.matches(function(attr) {
-      return attr.a > 1 && attr.b != null;
-    }), false);
-
-    model.set({a: 3, b: true});
-
-    assert.strictEqual(model.matches(function(attr) {
-      return attr.a > 1 && attr.b != null;
-    }), true);
-  });
-
-  QUnit.test('set and unset', function(assert) {
-    assert.expect(8);
-    var a = new Backbone.Model({id: 'id', foo: 1, bar: 2, baz: 3});
-    var changeCount = 0;
-    a.on('change:foo', function() { changeCount += 1; });
-    a.set({foo: 2});
-    assert.equal(a.get('foo'), 2, 'Foo should have changed.');
-    assert.equal(changeCount, 1, 'Change count should have incremented.');
-    // set with value that is not new shouldn't fire change event
-    a.set({foo: 2});
-    assert.equal(a.get('foo'), 2, 'Foo should NOT have changed, still 2');
-    assert.equal(changeCount, 1, 'Change count should NOT have incremented.');
-
-    a.validate = function(attrs) {
-      assert.equal(attrs.foo, void 0, 'validate:true passed while unsetting');
-    };
-    a.unset('foo', {validate: true});
-    assert.equal(a.get('foo'), void 0, 'Foo should have changed');
-    delete a.validate;
-    assert.equal(changeCount, 2, 'Change count should have incremented for unset.');
-
-    a.unset('id');
-    assert.equal(a.id, undefined, 'Unsetting the id should remove the id property.');
-  });
-
-  QUnit.test('#2030 - set with failed validate, followed by another set triggers change', function(assert) {
-    var attr = 0, main = 0, error = 0;
-    var Model = Backbone.Model.extend({
-      validate: function(attrs) {
-        if (attrs.x > 1) {
-          error++;
-          return 'this is an error';
-        }
-      }
-    });
-    var model = new Model({x: 0});
-    model.on('change:x', function() { attr++; });
-    model.on('change', function() { main++; });
-    model.set({x: 2}, {validate: true});
-    model.set({x: 1}, {validate: true});
-    assert.deepEqual([attr, main, error], [1, 1, 1]);
-  });
-
-  QUnit.test('set triggers changes in the correct order', function(assert) {
-    var value = null;
-    var model = new Backbone.Model;
-    model.on('last', function(){ value = 'last'; });
-    model.on('first', function(){ value = 'first'; });
-    model.trigger('first');
-    model.trigger('last');
-    assert.equal(value, 'last');
-  });
-
-  QUnit.test('set falsy values in the correct order', function(assert) {
-    assert.expect(2);
-    var model = new Backbone.Model({result: 'result'});
-    model.on('change', function() {
-      assert.equal(model.changed.result, void 0);
-      assert.equal(model.previous('result'), false);
-    });
-    model.set({result: void 0}, {silent: true});
-    model.set({result: null}, {silent: true});
-    model.set({result: false}, {silent: true});
-    model.set({result: void 0});
-  });
-
-  QUnit.test('nested set triggers with the correct options', function(assert) {
-    var model = new Backbone.Model();
-    var o1 = {};
-    var o2 = {};
-    var o3 = {};
-    model.on('change', function(__, options) {
-      switch (model.get('a')) {
-        case 1:
-          assert.equal(options, o1);
-          return model.set('a', 2, o2);
-        case 2:
-          assert.equal(options, o2);
-          return model.set('a', 3, o3);
-        case 3:
-          assert.equal(options, o3);
-      }
-    });
-    model.set('a', 1, o1);
-  });
-
-  QUnit.test('multiple unsets', function(assert) {
-    assert.expect(1);
-    var i = 0;
-    var counter = function(){ i++; };
-    var model = new Backbone.Model({a: 1});
-    model.on('change:a', counter);
-    model.set({a: 2});
-    model.unset('a');
-    model.unset('a');
-    assert.equal(i, 2, 'Unset does not fire an event for missing attributes.');
-  });
-
-  QUnit.test('unset and changedAttributes', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model({a: 1});
-    model.on('change', function() {
-      assert.ok('a' in model.changedAttributes(), 'changedAttributes should contain unset properties');
-    });
-    model.unset('a');
-  });
-
-  QUnit.test('using a non-default id attribute.', function(assert) {
-    assert.expect(5);
-    var MongoModel = Backbone.Model.extend({idAttribute: '_id'});
-    var model = new MongoModel({id: 'eye-dee', _id: 25, title: 'Model'});
-    assert.equal(model.get('id'), 'eye-dee');
-    assert.equal(model.id, 25);
-    assert.equal(model.isNew(), false);
-    model.unset('_id');
-    assert.equal(model.id, undefined);
-    assert.equal(model.isNew(), true);
-  });
-
-  QUnit.test('setting an alternative cid prefix', function(assert) {
-    assert.expect(4);
-    var Model = Backbone.Model.extend({
-      cidPrefix: 'm'
-    });
-    var model = new Model();
-
-    assert.equal(model.cid.charAt(0), 'm');
-
-    model = new Backbone.Model();
-    assert.equal(model.cid.charAt(0), 'c');
-
-    var Collection = Backbone.Collection.extend({
-      model: Model
-    });
-    var col = new Collection([{id: 'c5'}, {id: 'c6'}, {id: 'c7'}]);
-
-    assert.equal(col.get('c6').cid.charAt(0), 'm');
-    col.set([{id: 'c6', value: 'test'}], {
-      merge: true,
-      add: true,
-      remove: false
-    });
-    assert.ok(col.get('c6').has('value'));
-  });
-
-  QUnit.test('set an empty string', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model({name: 'Model'});
-    model.set({name: ''});
-    assert.equal(model.get('name'), '');
-  });
-
-  QUnit.test('setting an object', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model({
-      custom: {foo: 1}
-    });
-    model.on('change', function() {
-      assert.ok(1);
-    });
-    model.set({
-      custom: {foo: 1} // no change should be fired
-    });
-    model.set({
-      custom: {foo: 2} // change event should be fired
-    });
-  });
-
-  QUnit.test('clear', function(assert) {
-    assert.expect(3);
-    var changed;
-    var model = new Backbone.Model({id: 1, name: 'Model'});
-    model.on('change:name', function(){ changed = true; });
-    model.on('change', function() {
-      var changedAttrs = model.changedAttributes();
-      assert.ok('name' in changedAttrs);
-    });
-    model.clear();
-    assert.equal(changed, true);
-    assert.equal(model.get('name'), undefined);
-  });
-
-  QUnit.test('defaults', function(assert) {
-    assert.expect(9);
-    var Defaulted = Backbone.Model.extend({
-      defaults: {
-        one: 1,
-        two: 2
-      }
-    });
-    var model = new Defaulted({two: undefined});
-    assert.equal(model.get('one'), 1);
-    assert.equal(model.get('two'), 2);
-    model = new Defaulted({two: 3});
-    assert.equal(model.get('one'), 1);
-    assert.equal(model.get('two'), 3);
-    Defaulted = Backbone.Model.extend({
-      defaults: function() {
-        return {
-          one: 3,
-          two: 4
-        };
-      }
-    });
-    model = new Defaulted({two: undefined});
-    assert.equal(model.get('one'), 3);
-    assert.equal(model.get('two'), 4);
-    Defaulted = Backbone.Model.extend({
-      defaults: {hasOwnProperty: true}
-    });
-    model = new Defaulted();
-    assert.equal(model.get('hasOwnProperty'), true);
-    model = new Defaulted({hasOwnProperty: undefined});
-    assert.equal(model.get('hasOwnProperty'), true);
-    model = new Defaulted({hasOwnProperty: false});
-    assert.equal(model.get('hasOwnProperty'), false);
-  });
-
-  QUnit.test('change, hasChanged, changedAttributes, previous, previousAttributes', function(assert) {
-    assert.expect(9);
-    var model = new Backbone.Model({name: 'Tim', age: 10});
-    assert.deepEqual(model.changedAttributes(), false);
-    model.on('change', function() {
-      assert.ok(model.hasChanged('name'), 'name changed');
-      assert.ok(!model.hasChanged('age'), 'age did not');
-      assert.ok(_.isEqual(model.changedAttributes(), {name: 'Rob'}), 'changedAttributes returns the changed attrs');
-      assert.equal(model.previous('name'), 'Tim');
-      assert.ok(_.isEqual(model.previousAttributes(), {name: 'Tim', age: 10}), 'previousAttributes is correct');
-    });
-    assert.equal(model.hasChanged(), false);
-    assert.equal(model.hasChanged(undefined), false);
-    model.set({name: 'Rob'});
-    assert.equal(model.get('name'), 'Rob');
-  });
-
-  QUnit.test('changedAttributes', function(assert) {
-    assert.expect(3);
-    var model = new Backbone.Model({a: 'a', b: 'b'});
-    assert.deepEqual(model.changedAttributes(), false);
-    assert.equal(model.changedAttributes({a: 'a'}), false);
-    assert.equal(model.changedAttributes({a: 'b'}).a, 'b');
-  });
-
-  QUnit.test('change with options', function(assert) {
-    assert.expect(2);
-    var value;
-    var model = new Backbone.Model({name: 'Rob'});
-    model.on('change', function(m, options) {
-      value = options.prefix + m.get('name');
-    });
-    model.set({name: 'Bob'}, {prefix: 'Mr. '});
-    assert.equal(value, 'Mr. Bob');
-    model.set({name: 'Sue'}, {prefix: 'Ms. '});
-    assert.equal(value, 'Ms. Sue');
-  });
-
-  QUnit.test('change after initialize', function(assert) {
-    assert.expect(1);
-    var changed = 0;
-    var attrs = {id: 1, label: 'c'};
-    var obj = new Backbone.Model(attrs);
-    obj.on('change', function() { changed += 1; });
-    obj.set(attrs);
-    assert.equal(changed, 0);
-  });
-
-  QUnit.test('save within change event', function(assert) {
-    assert.expect(1);
-    var env = this;
-    var model = new Backbone.Model({firstName: 'Taylor', lastName: 'Swift'});
-    model.url = '/test';
-    model.on('change', function() {
-      model.save();
-      assert.ok(_.isEqual(env.syncArgs.model, model));
-    });
-    model.set({lastName: 'Hicks'});
-  });
-
-  QUnit.test('validate after save', function(assert) {
-    assert.expect(2);
-    var lastError, model = new Backbone.Model();
-    model.validate = function(attrs) {
-      if (attrs.admin) return "Can't change admin status.";
-    };
-    model.sync = function(method, m, options) {
-      options.success.call(this, {admin: true});
-    };
-    model.on('invalid', function(m, error) {
-      lastError = error;
-    });
-    model.save(null);
-
-    assert.equal(lastError, "Can't change admin status.");
-    assert.equal(model.validationError, "Can't change admin status.");
-  });
-
-  QUnit.test('save', function(assert) {
-    assert.expect(2);
-    doc.save({title: 'Henry V'});
-    assert.equal(this.syncArgs.method, 'update');
-    assert.ok(_.isEqual(this.syncArgs.model, doc));
-  });
-
-  QUnit.test('save, fetch, destroy triggers error event when an error occurs', function(assert) {
-    assert.expect(3);
-    var model = new Backbone.Model();
-    model.on('error', function() {
-      assert.ok(true);
-    });
-    model.sync = function(method, m, options) {
-      options.error();
-    };
-    model.save({data: 2, id: 1});
-    model.fetch();
-    model.destroy();
-  });
-
-  QUnit.test('#3283 - save, fetch, destroy calls success with context', function(assert) {
-    assert.expect(3);
-    var model = new Backbone.Model();
-    var obj = {};
-    var options = {
-      context: obj,
-      success: function() {
-        assert.equal(this, obj);
-      }
-    };
-    model.sync = function(method, m, opts) {
-      opts.success.call(opts.context);
-    };
-    model.save({data: 2, id: 1}, options);
-    model.fetch(options);
-    model.destroy(options);
-  });
-
-  QUnit.test('#3283 - save, fetch, destroy calls error with context', function(assert) {
-    assert.expect(3);
-    var model = new Backbone.Model();
-    var obj = {};
-    var options = {
-      context: obj,
-      error: function() {
-        assert.equal(this, obj);
-      }
-    };
-    model.sync = function(method, m, opts) {
-      opts.error.call(opts.context);
-    };
-    model.save({data: 2, id: 1}, options);
-    model.fetch(options);
-    model.destroy(options);
-  });
-
-  QUnit.test('#3470 - save and fetch with parse false', function(assert) {
-    assert.expect(2);
-    var i = 0;
-    var model = new Backbone.Model();
-    model.parse = function() {
-      assert.ok(false);
-    };
-    model.sync = function(method, m, options) {
-      options.success({i: ++i});
-    };
-    model.fetch({parse: false});
-    assert.equal(model.get('i'), i);
-    model.save(null, {parse: false});
-    assert.equal(model.get('i'), i);
-  });
-
-  QUnit.test('save with PATCH', function(assert) {
-    doc.clear().set({id: 1, a: 1, b: 2, c: 3, d: 4});
-    doc.save();
-    assert.equal(this.syncArgs.method, 'update');
-    assert.equal(this.syncArgs.options.attrs, undefined);
-
-    doc.save({b: 2, d: 4}, {patch: true});
-    assert.equal(this.syncArgs.method, 'patch');
-    assert.equal(_.size(this.syncArgs.options.attrs), 2);
-    assert.equal(this.syncArgs.options.attrs.d, 4);
-    assert.equal(this.syncArgs.options.attrs.a, undefined);
-    assert.equal(this.ajaxSettings.data, '{"b":2,"d":4}');
-  });
-
-  QUnit.test('save with PATCH and different attrs', function(assert) {
-    doc.clear().save({b: 2, d: 4}, {patch: true, attrs: {B: 1, D: 3}});
-    assert.equal(this.syncArgs.options.attrs.D, 3);
-    assert.equal(this.syncArgs.options.attrs.d, undefined);
-    assert.equal(this.ajaxSettings.data, '{"B":1,"D":3}');
-    assert.deepEqual(doc.attributes, {b: 2, d: 4});
-  });
-
-  QUnit.test('save in positional style', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    model.sync = function(method, m, options) {
-      options.success();
-    };
-    model.save('title', 'Twelfth Night');
-    assert.equal(model.get('title'), 'Twelfth Night');
-  });
-
-  QUnit.test('save with non-object success response', function(assert) {
-    assert.expect(2);
-    var model = new Backbone.Model();
-    model.sync = function(method, m, options) {
-      options.success('', options);
-      options.success(null, options);
-    };
-    model.save({testing: 'empty'}, {
-      success: function(m) {
-        assert.deepEqual(m.attributes, {testing: 'empty'});
-      }
-    });
-  });
-
-  QUnit.test('save with wait and supplied id', function(assert) {
-    var Model = Backbone.Model.extend({
-      urlRoot: '/collection'
-    });
-    var model = new Model();
-    model.save({id: 42}, {wait: true});
-    assert.equal(this.ajaxSettings.url, '/collection/42');
-  });
-
-  QUnit.test('save will pass extra options to success callback', function(assert) {
-    assert.expect(1);
-    var SpecialSyncModel = Backbone.Model.extend({
-      sync: function(method, m, options) {
-        _.extend(options, {specialSync: true});
-        return Backbone.Model.prototype.sync.call(this, method, m, options);
-      },
-      urlRoot: '/test'
-    });
-
-    var model = new SpecialSyncModel();
-
-    var onSuccess = function(m, response, options) {
-      assert.ok(options.specialSync, 'Options were passed correctly to callback');
-    };
-
-    model.save(null, {success: onSuccess});
-    this.ajaxSettings.success();
-  });
-
-  QUnit.test('fetch', function(assert) {
-    assert.expect(2);
-    doc.fetch();
-    assert.equal(this.syncArgs.method, 'read');
-    assert.ok(_.isEqual(this.syncArgs.model, doc));
-  });
-
-  QUnit.test('fetch will pass extra options to success callback', function(assert) {
-    assert.expect(1);
-    var SpecialSyncModel = Backbone.Model.extend({
-      sync: function(method, m, options) {
-        _.extend(options, {specialSync: true});
-        return Backbone.Model.prototype.sync.call(this, method, m, options);
-      },
-      urlRoot: '/test'
-    });
-
-    var model = new SpecialSyncModel();
-
-    var onSuccess = function(m, response, options) {
-      assert.ok(options.specialSync, 'Options were passed correctly to callback');
-    };
-
-    model.fetch({success: onSuccess});
-    this.ajaxSettings.success();
-  });
-
-  QUnit.test('destroy', function(assert) {
-    assert.expect(3);
-    doc.destroy();
-    assert.equal(this.syncArgs.method, 'delete');
-    assert.ok(_.isEqual(this.syncArgs.model, doc));
-
-    var newModel = new Backbone.Model;
-    assert.equal(newModel.destroy(), false);
-  });
-
-  QUnit.test('destroy will pass extra options to success callback', function(assert) {
-    assert.expect(1);
-    var SpecialSyncModel = Backbone.Model.extend({
-      sync: function(method, m, options) {
-        _.extend(options, {specialSync: true});
-        return Backbone.Model.prototype.sync.call(this, method, m, options);
-      },
-      urlRoot: '/test'
-    });
-
-    var model = new SpecialSyncModel({id: 'id'});
-
-    var onSuccess = function(m, response, options) {
-      assert.ok(options.specialSync, 'Options were passed correctly to callback');
-    };
-
-    model.destroy({success: onSuccess});
-    this.ajaxSettings.success();
-  });
-
-  QUnit.test('non-persisted destroy', function(assert) {
-    assert.expect(1);
-    var a = new Backbone.Model({foo: 1, bar: 2, baz: 3});
-    a.sync = function() { throw 'should not be called'; };
-    a.destroy();
-    assert.ok(true, 'non-persisted model should not call sync');
-  });
-
-  QUnit.test('validate', function(assert) {
-    var lastError;
-    var model = new Backbone.Model();
-    model.validate = function(attrs) {
-      if (attrs.admin !== this.get('admin')) return "Can't change admin status.";
-    };
-    model.on('invalid', function(m, error) {
-      lastError = error;
-    });
-    var result = model.set({a: 100});
-    assert.equal(result, model);
-    assert.equal(model.get('a'), 100);
-    assert.equal(lastError, undefined);
-    result = model.set({admin: true});
-    assert.equal(model.get('admin'), true);
-    result = model.set({a: 200, admin: false}, {validate: true});
-    assert.equal(lastError, "Can't change admin status.");
-    assert.equal(result, false);
-    assert.equal(model.get('a'), 100);
-  });
-
-  QUnit.test('validate on unset and clear', function(assert) {
-    assert.expect(6);
-    var error;
-    var model = new Backbone.Model({name: 'One'});
-    model.validate = function(attrs) {
-      if (!attrs.name) {
-        error = true;
-        return 'No thanks.';
-      }
-    };
-    model.set({name: 'Two'});
-    assert.equal(model.get('name'), 'Two');
-    assert.equal(error, undefined);
-    model.unset('name', {validate: true});
-    assert.equal(error, true);
-    assert.equal(model.get('name'), 'Two');
-    model.clear({validate: true});
-    assert.equal(model.get('name'), 'Two');
-    delete model.validate;
-    model.clear();
-    assert.equal(model.get('name'), undefined);
-  });
-
-  QUnit.test('validate with error callback', function(assert) {
-    assert.expect(8);
-    var lastError, boundError;
-    var model = new Backbone.Model();
-    model.validate = function(attrs) {
-      if (attrs.admin) return "Can't change admin status.";
-    };
-    model.on('invalid', function(m, error) {
-      boundError = true;
-    });
-    var result = model.set({a: 100}, {validate: true});
-    assert.equal(result, model);
-    assert.equal(model.get('a'), 100);
-    assert.equal(model.validationError, null);
-    assert.equal(boundError, undefined);
-    result = model.set({a: 200, admin: true}, {validate: true});
-    assert.equal(result, false);
-    assert.equal(model.get('a'), 100);
-    assert.equal(model.validationError, "Can't change admin status.");
-    assert.equal(boundError, true);
-  });
-
-  QUnit.test('defaults always extend attrs (#459)', function(assert) {
-    assert.expect(2);
-    var Defaulted = Backbone.Model.extend({
-      defaults: {one: 1},
-      initialize: function(attrs, opts) {
-        assert.equal(this.attributes.one, 1);
-      }
-    });
-    var providedattrs = new Defaulted({});
-    var emptyattrs = new Defaulted();
-  });
-
-  QUnit.test('Inherit class properties', function(assert) {
-    assert.expect(6);
-    var Parent = Backbone.Model.extend({
-      instancePropSame: function() {},
-      instancePropDiff: function() {}
-    }, {
-      classProp: function() {}
-    });
-    var Child = Parent.extend({
-      instancePropDiff: function() {}
-    });
-
-    var adult = new Parent;
-    var kid   = new Child;
-
-    assert.equal(Child.classProp, Parent.classProp);
-    assert.notEqual(Child.classProp, undefined);
-
-    assert.equal(kid.instancePropSame, adult.instancePropSame);
-    assert.notEqual(kid.instancePropSame, undefined);
-
-    assert.notEqual(Child.prototype.instancePropDiff, Parent.prototype.instancePropDiff);
-    assert.notEqual(Child.prototype.instancePropDiff, undefined);
-  });
-
-  QUnit.test("Nested change events don't clobber previous attributes", function(assert) {
-    assert.expect(4);
-    new Backbone.Model()
-    .on('change:state', function(m, newState) {
-      assert.equal(m.previous('state'), undefined);
-      assert.equal(newState, 'hello');
-      // Fire a nested change event.
-      m.set({other: 'whatever'});
-    })
-    .on('change:state', function(m, newState) {
-      assert.equal(m.previous('state'), undefined);
-      assert.equal(newState, 'hello');
-    })
-    .set({state: 'hello'});
-  });
-
-  QUnit.test('hasChanged/set should use same comparison', function(assert) {
-    assert.expect(2);
-    var changed = 0, model = new Backbone.Model({a: null});
-    model.on('change', function() {
-      assert.ok(this.hasChanged('a'));
-    })
-    .on('change:a', function() {
-      changed++;
-    })
-    .set({a: undefined});
-    assert.equal(changed, 1);
-  });
-
-  QUnit.test('#582, #425, change:attribute callbacks should fire after all changes have occurred', function(assert) {
-    assert.expect(9);
-    var model = new Backbone.Model;
-
-    var assertion = function() {
-      assert.equal(model.get('a'), 'a');
-      assert.equal(model.get('b'), 'b');
-      assert.equal(model.get('c'), 'c');
-    };
-
-    model.on('change:a', assertion);
-    model.on('change:b', assertion);
-    model.on('change:c', assertion);
-
-    model.set({a: 'a', b: 'b', c: 'c'});
-  });
-
-  QUnit.test('#871, set with attributes property', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    model.set({attributes: true});
-    assert.ok(model.has('attributes'));
-  });
-
-  QUnit.test('set value regardless of equality/change', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model({x: []});
-    var a = [];
-    model.set({x: a});
-    assert.ok(model.get('x') === a);
-  });
-
-  QUnit.test('set same value does not trigger change', function(assert) {
-    assert.expect(0);
-    var model = new Backbone.Model({x: 1});
-    model.on('change change:x', function() { assert.ok(false); });
-    model.set({x: 1});
-    model.set({x: 1});
-  });
-
-  QUnit.test('unset does not fire a change for undefined attributes', function(assert) {
-    assert.expect(0);
-    var model = new Backbone.Model({x: undefined});
-    model.on('change:x', function(){ assert.ok(false); });
-    model.unset('x');
-  });
-
-  QUnit.test('set: undefined values', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model({x: undefined});
-    assert.ok('x' in model.attributes);
-  });
-
-  QUnit.test('hasChanged works outside of change events, and true within', function(assert) {
-    assert.expect(6);
-    var model = new Backbone.Model({x: 1});
-    model.on('change:x', function() {
-      assert.ok(model.hasChanged('x'));
-      assert.equal(model.get('x'), 1);
-    });
-    model.set({x: 2}, {silent: true});
-    assert.ok(model.hasChanged());
-    assert.equal(model.hasChanged('x'), true);
-    model.set({x: 1});
-    assert.ok(model.hasChanged());
-    assert.equal(model.hasChanged('x'), true);
-  });
-
-  QUnit.test('hasChanged gets cleared on the following set', function(assert) {
-    assert.expect(4);
-    var model = new Backbone.Model;
-    model.set({x: 1});
-    assert.ok(model.hasChanged());
-    model.set({x: 1});
-    assert.ok(!model.hasChanged());
-    model.set({x: 2});
-    assert.ok(model.hasChanged());
-    model.set({});
-    assert.ok(!model.hasChanged());
-  });
-
-  QUnit.test('save with `wait` succeeds without `validate`', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    model.url = '/test';
-    model.save({x: 1}, {wait: true});
-    assert.ok(this.syncArgs.model === model);
-  });
-
-  QUnit.test("save without `wait` doesn't set invalid attributes", function(assert) {
-    var model = new Backbone.Model();
-    model.validate = function() { return 1; };
-    model.save({a: 1});
-    assert.equal(model.get('a'), void 0);
-  });
-
-  QUnit.test("save doesn't validate twice", function(assert) {
-    var model = new Backbone.Model();
-    var times = 0;
-    model.sync = function() {};
-    model.validate = function() { ++times; };
-    model.save({});
-    assert.equal(times, 1);
-  });
-
-  QUnit.test('`hasChanged` for falsey keys', function(assert) {
-    assert.expect(2);
-    var model = new Backbone.Model();
-    model.set({x: true}, {silent: true});
-    assert.ok(!model.hasChanged(0));
-    assert.ok(!model.hasChanged(''));
-  });
-
-  QUnit.test('`previous` for falsey keys', function(assert) {
-    assert.expect(2);
-    var model = new Backbone.Model({'0': true, '': true});
-    model.set({'0': false, '': false}, {silent: true});
-    assert.equal(model.previous(0), true);
-    assert.equal(model.previous(''), true);
-  });
-
-  QUnit.test('`save` with `wait` sends correct attributes', function(assert) {
-    assert.expect(5);
-    var changed = 0;
-    var model = new Backbone.Model({x: 1, y: 2});
-    model.url = '/test';
-    model.on('change:x', function() { changed++; });
-    model.save({x: 3}, {wait: true});
-    assert.deepEqual(JSON.parse(this.ajaxSettings.data), {x: 3, y: 2});
-    assert.equal(model.get('x'), 1);
-    assert.equal(changed, 0);
-    this.syncArgs.options.success({});
-    assert.equal(model.get('x'), 3);
-    assert.equal(changed, 1);
-  });
-
-  QUnit.test("a failed `save` with `wait` doesn't leave attributes behind", function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model;
-    model.url = '/test';
-    model.save({x: 1}, {wait: true});
-    assert.equal(model.get('x'), void 0);
-  });
-
-  QUnit.test('#1030 - `save` with `wait` results in correct attributes if success is called during sync', function(assert) {
-    assert.expect(2);
-    var model = new Backbone.Model({x: 1, y: 2});
-    model.sync = function(method, m, options) {
-      options.success();
-    };
-    model.on('change:x', function() { assert.ok(true); });
-    model.save({x: 3}, {wait: true});
-    assert.equal(model.get('x'), 3);
-  });
-
-  QUnit.test('save with wait validates attributes', function(assert) {
-    var model = new Backbone.Model();
-    model.url = '/test';
-    model.validate = function() { assert.ok(true); };
-    model.save({x: 1}, {wait: true});
-  });
-
-  QUnit.test('save turns on parse flag', function(assert) {
-    var Model = Backbone.Model.extend({
-      sync: function(method, m, options) { assert.ok(options.parse); }
-    });
-    new Model().save();
-  });
-
-  QUnit.test("nested `set` during `'change:attr'`", function(assert) {
-    assert.expect(2);
-    var events = [];
-    var model = new Backbone.Model();
-    model.on('all', function(event) { events.push(event); });
-    model.on('change', function() {
-      model.set({z: true}, {silent: true});
-    });
-    model.on('change:x', function() {
-      model.set({y: true});
-    });
-    model.set({x: true});
-    assert.deepEqual(events, ['change:y', 'change:x', 'change']);
-    events = [];
-    model.set({z: true});
-    assert.deepEqual(events, []);
-  });
-
-  QUnit.test('nested `change` only fires once', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    model.on('change', function() {
-      assert.ok(true);
-      model.set({x: true});
-    });
-    model.set({x: true});
-  });
-
-  QUnit.test("nested `set` during `'change'`", function(assert) {
-    assert.expect(6);
-    var count = 0;
-    var model = new Backbone.Model();
-    model.on('change', function() {
-      switch (count++) {
-        case 0:
-          assert.deepEqual(this.changedAttributes(), {x: true});
-          assert.equal(model.previous('x'), undefined);
-          model.set({y: true});
-          break;
-        case 1:
-          assert.deepEqual(this.changedAttributes(), {x: true, y: true});
-          assert.equal(model.previous('x'), undefined);
-          model.set({z: true});
-          break;
-        case 2:
-          assert.deepEqual(this.changedAttributes(), {x: true, y: true, z: true});
-          assert.equal(model.previous('y'), undefined);
-          break;
-        default:
-          assert.ok(false);
-      }
-    });
-    model.set({x: true});
-  });
-
-  QUnit.test('nested `change` with silent', function(assert) {
-    assert.expect(3);
-    var count = 0;
-    var model = new Backbone.Model();
-    model.on('change:y', function() { assert.ok(false); });
-    model.on('change', function() {
-      switch (count++) {
-        case 0:
-          assert.deepEqual(this.changedAttributes(), {x: true});
-          model.set({y: true}, {silent: true});
-          model.set({z: true});
-          break;
-        case 1:
-          assert.deepEqual(this.changedAttributes(), {x: true, y: true, z: true});
-          break;
-        case 2:
-          assert.deepEqual(this.changedAttributes(), {z: false});
-          break;
-        default:
-          assert.ok(false);
-      }
-    });
-    model.set({x: true});
-    model.set({z: false});
-  });
-
-  QUnit.test('nested `change:attr` with silent', function(assert) {
-    assert.expect(0);
-    var model = new Backbone.Model();
-    model.on('change:y', function(){ assert.ok(false); });
-    model.on('change', function() {
-      model.set({y: true}, {silent: true});
-      model.set({z: true});
-    });
-    model.set({x: true});
-  });
-
-  QUnit.test('multiple nested changes with silent', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    model.on('change:x', function() {
-      model.set({y: 1}, {silent: true});
-      model.set({y: 2});
-    });
-    model.on('change:y', function(m, val) {
-      assert.equal(val, 2);
-    });
-    model.set({x: true});
-  });
-
-  QUnit.test('multiple nested changes with silent', function(assert) {
-    assert.expect(1);
-    var changes = [];
-    var model = new Backbone.Model();
-    model.on('change:b', function(m, val) { changes.push(val); });
-    model.on('change', function() {
-      model.set({b: 1});
-    });
-    model.set({b: 0});
-    assert.deepEqual(changes, [0, 1]);
-  });
-
-  QUnit.test('basic silent change semantics', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model;
-    model.set({x: 1});
-    model.on('change', function(){ assert.ok(true); });
-    model.set({x: 2}, {silent: true});
-    model.set({x: 1});
-  });
-
-  QUnit.test('nested set multiple times', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    model.on('change:b', function() {
-      assert.ok(true);
-    });
-    model.on('change:a', function() {
-      model.set({b: true});
-      model.set({b: true});
-    });
-    model.set({a: true});
-  });
-
-  QUnit.test('#1122 - clear does not alter options.', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    var options = {};
-    model.clear(options);
-    assert.ok(!options.unset);
-  });
-
-  QUnit.test('#1122 - unset does not alter options.', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    var options = {};
-    model.unset('x', options);
-    assert.ok(!options.unset);
-  });
-
-  QUnit.test('#1355 - `options` is passed to success callbacks', function(assert) {
-    assert.expect(3);
-    var model = new Backbone.Model();
-    var opts = {
-      success: function( m, resp, options ) {
-        assert.ok(options);
-      }
-    };
-    model.sync = function(method, m, options) {
-      options.success();
-    };
-    model.save({id: 1}, opts);
-    model.fetch(opts);
-    model.destroy(opts);
-  });
-
-  QUnit.test("#1412 - Trigger 'sync' event.", function(assert) {
-    assert.expect(3);
-    var model = new Backbone.Model({id: 1});
-    model.sync = function(method, m, options) { options.success(); };
-    model.on('sync', function(){ assert.ok(true); });
-    model.fetch();
-    model.save();
-    model.destroy();
-  });
-
-  QUnit.test('#1365 - Destroy: New models execute success callback.', function(assert) {
-    var done = assert.async();
-    assert.expect(2);
-    new Backbone.Model()
-    .on('sync', function() { assert.ok(false); })
-    .on('destroy', function(){ assert.ok(true); })
-    .destroy({success: function(){
-      assert.ok(true);
-      done();
-    }});
-  });
-
-  QUnit.test('#1433 - Save: An invalid model cannot be persisted.', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model;
-    model.validate = function(){ return 'invalid'; };
-    model.sync = function(){ assert.ok(false); };
-    assert.strictEqual(model.save(), false);
-  });
-
-  QUnit.test("#1377 - Save without attrs triggers 'error'.", function(assert) {
-    assert.expect(1);
-    var Model = Backbone.Model.extend({
-      url: '/test/',
-      sync: function(method, m, options){ options.success(); },
-      validate: function(){ return 'invalid'; }
-    });
-    var model = new Model({id: 1});
-    model.on('invalid', function(){ assert.ok(true); });
-    model.save();
-  });
-
-  QUnit.test('#1545 - `undefined` can be passed to a model constructor without coersion', function(assert) {
-    var Model = Backbone.Model.extend({
-      defaults: {one: 1},
-      initialize: function(attrs, opts) {
-        assert.equal(attrs, undefined);
-      }
-    });
-    var emptyattrs = new Model();
-    var undefinedattrs = new Model(undefined);
-  });
-
-  QUnit.test('#1478 - Model `save` does not trigger change on unchanged attributes', function(assert) {
-    var done = assert.async();
-    assert.expect(0);
-    var Model = Backbone.Model.extend({
-      sync: function(method, m, options) {
-        setTimeout(function(){
-          options.success();
-          done();
-        }, 0);
-      }
-    });
-    new Model({x: true})
-    .on('change:x', function(){ assert.ok(false); })
-    .save(null, {wait: true});
-  });
-
-  QUnit.test('#1664 - Changing from one value, silently to another, back to original triggers a change.', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model({x: 1});
-    model.on('change:x', function() { assert.ok(true); });
-    model.set({x: 2}, {silent: true});
-    model.set({x: 3}, {silent: true});
-    model.set({x: 1});
-  });
-
-  QUnit.test('#1664 - multiple silent changes nested inside a change event', function(assert) {
-    assert.expect(2);
-    var changes = [];
-    var model = new Backbone.Model();
-    model.on('change', function() {
-      model.set({a: 'c'}, {silent: true});
-      model.set({b: 2}, {silent: true});
-      model.unset('c', {silent: true});
-    });
-    model.on('change:a change:b change:c', function(m, val) { changes.push(val); });
-    model.set({a: 'a', b: 1, c: 'item'});
-    assert.deepEqual(changes, ['a', 1, 'item']);
-    assert.deepEqual(model.attributes, {a: 'c', b: 2});
-  });
-
-  QUnit.test('#1791 - `attributes` is available for `parse`', function(assert) {
-    var Model = Backbone.Model.extend({
-      parse: function() { this.has('a'); } // shouldn't throw an error
-    });
-    var model = new Model(null, {parse: true});
-    assert.expect(0);
-  });
-
-  QUnit.test('silent changes in last `change` event back to original triggers change', function(assert) {
-    assert.expect(2);
-    var changes = [];
-    var model = new Backbone.Model();
-    model.on('change:a change:b change:c', function(m, val) { changes.push(val); });
-    model.on('change', function() {
-      model.set({a: 'c'}, {silent: true});
-    });
-    model.set({a: 'a'});
-    assert.deepEqual(changes, ['a']);
-    model.set({a: 'a'});
-    assert.deepEqual(changes, ['a', 'a']);
-  });
-
-  QUnit.test('#1943 change calculations should use _.isEqual', function(assert) {
-    var model = new Backbone.Model({a: {key: 'value'}});
-    model.set('a', {key: 'value'}, {silent: true});
-    assert.equal(model.changedAttributes(), false);
-  });
-
-  QUnit.test('#1964 - final `change` event is always fired, regardless of interim changes', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    model.on('change:property', function() {
-      model.set('property', 'bar');
-    });
-    model.on('change', function() {
-      assert.ok(true);
-    });
-    model.set('property', 'foo');
-  });
-
-  QUnit.test('isValid', function(assert) {
-    var model = new Backbone.Model({valid: true});
-    model.validate = function(attrs) {
-      if (!attrs.valid) return 'invalid';
-    };
-    assert.equal(model.isValid(), true);
-    assert.equal(model.set({valid: false}, {validate: true}), false);
-    assert.equal(model.isValid(), true);
-    model.set({valid: false});
-    assert.equal(model.isValid(), false);
-    assert.ok(!model.set('valid', false, {validate: true}));
-  });
-
-  QUnit.test('#1179 - isValid returns true in the absence of validate.', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    model.validate = null;
-    assert.ok(model.isValid());
-  });
-
-  QUnit.test('#1961 - Creating a model with {validate:true} will call validate and use the error callback', function(assert) {
-    var Model = Backbone.Model.extend({
-      validate: function(attrs) {
-        if (attrs.id === 1) return "This shouldn't happen";
-      }
-    });
-    var model = new Model({id: 1}, {validate: true});
-    assert.equal(model.validationError, "This shouldn't happen");
-  });
-
-  QUnit.test('toJSON receives attrs during save(..., {wait: true})', function(assert) {
-    assert.expect(1);
-    var Model = Backbone.Model.extend({
-      url: '/test',
-      toJSON: function() {
-        assert.strictEqual(this.attributes.x, 1);
-        return _.clone(this.attributes);
-      }
-    });
-    var model = new Model;
-    model.save({x: 1}, {wait: true});
-  });
-
-  QUnit.test('#2034 - nested set with silent only triggers one change', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model();
-    model.on('change', function() {
-      model.set({b: true}, {silent: true});
-      assert.ok(true);
-    });
-    model.set({a: true});
-  });
-
-  QUnit.test('#3778 - id will only be updated if it is set', function(assert) {
-    assert.expect(2);
-    var model = new Backbone.Model({id: 1});
-    model.id = 2;
-    model.set({foo: 'bar'});
-    assert.equal(model.id, 2);
-    model.set({id: 3});
-    assert.equal(model.id, 3);
-  });
-
-})();
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/noconflict.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/noconflict.js
deleted file mode 100644
index 9968f68..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/noconflict.js
+++ /dev/null
@@ -1,13 +0,0 @@
-(function() {
-
-  QUnit.module('Backbone.noConflict');
-
-  QUnit.test('noConflict', function(assert) {
-    assert.expect(2);
-    var noconflictBackbone = Backbone.noConflict();
-    assert.equal(window.Backbone, undefined, 'Returned window.Backbone');
-    window.Backbone = noconflictBackbone;
-    assert.equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone');
-  });
-
-})();
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/router.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/router.js
deleted file mode 100644
index 13110c4..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/router.js
+++ /dev/null
@@ -1,1062 +0,0 @@
-(function() {
-
-  var router = null;
-  var location = null;
-  var lastRoute = null;
-  var lastArgs = [];
-
-  var onRoute = function(routerParam, route, args) {
-    lastRoute = route;
-    lastArgs = args;
-  };
-
-  var Location = function(href) {
-    this.replace(href);
-  };
-
-  _.extend(Location.prototype, {
-
-    parser: document.createElement('a'),
-
-    replace: function(href) {
-      this.parser.href = href;
-      _.extend(this, _.pick(this.parser,
-        'href',
-        'hash',
-        'host',
-        'search',
-        'fragment',
-        'pathname',
-        'protocol'
-      ));
-      // In IE, anchor.pathname does not contain a leading slash though
-      // window.location.pathname does.
-      if (!/^\//.test(this.pathname)) this.pathname = '/' + this.pathname;
-    },
-
-    toString: function() {
-      return this.href;
-    }
-
-  });
-
-  QUnit.module('Backbone.Router', {
-
-    setup: function() {
-      location = new Location('http://example.com');
-      Backbone.history = _.extend(new Backbone.History, {location: location});
-      router = new Router({testing: 101});
-      Backbone.history.interval = 9;
-      Backbone.history.start({pushState: false});
-      lastRoute = null;
-      lastArgs = [];
-      Backbone.history.on('route', onRoute);
-    },
-
-    teardown: function() {
-      Backbone.history.stop();
-      Backbone.history.off('route', onRoute);
-    }
-
-  });
-
-  var ExternalObject = {
-    value: 'unset',
-
-    routingFunction: function(value) {
-      this.value = value;
-    }
-  };
-  ExternalObject.routingFunction = _.bind(ExternalObject.routingFunction, ExternalObject);
-
-  var Router = Backbone.Router.extend({
-
-    count: 0,
-
-    routes: {
-      'noCallback': 'noCallback',
-      'counter': 'counter',
-      'search/:query': 'search',
-      'search/:query/p:page': 'search',
-      'charñ': 'charUTF',
-      'char%C3%B1': 'charEscaped',
-      'contacts': 'contacts',
-      'contacts/new': 'newContact',
-      'contacts/:id': 'loadContact',
-      'route-event/:arg': 'routeEvent',
-      'optional(/:item)': 'optionalItem',
-      'named/optional/(y:z)': 'namedOptional',
-      'splat/*args/end': 'splat',
-      ':repo/compare/*from...*to': 'github',
-      'decode/:named/*splat': 'decode',
-      '*first/complex-*part/*rest': 'complex',
-      'query/:entity': 'query',
-      'function/:value': ExternalObject.routingFunction,
-      '*anything': 'anything'
-    },
-
-    initialize: function(options) {
-      this.testing = options.testing;
-      this.route('implicit', 'implicit');
-    },
-
-    counter: function() {
-      this.count++;
-    },
-
-    implicit: function() {
-      this.count++;
-    },
-
-    search: function(query, page) {
-      this.query = query;
-      this.page = page;
-    },
-
-    charUTF: function() {
-      this.charType = 'UTF';
-    },
-
-    charEscaped: function() {
-      this.charType = 'escaped';
-    },
-
-    contacts: function(){
-      this.contact = 'index';
-    },
-
-    newContact: function(){
-      this.contact = 'new';
-    },
-
-    loadContact: function(){
-      this.contact = 'load';
-    },
-
-    optionalItem: function(arg){
-      this.arg = arg !== void 0 ? arg : null;
-    },
-
-    splat: function(args) {
-      this.args = args;
-    },
-
-    github: function(repo, from, to) {
-      this.repo = repo;
-      this.from = from;
-      this.to = to;
-    },
-
-    complex: function(first, part, rest) {
-      this.first = first;
-      this.part = part;
-      this.rest = rest;
-    },
-
-    query: function(entity, args) {
-      this.entity    = entity;
-      this.queryArgs = args;
-    },
-
-    anything: function(whatever) {
-      this.anything = whatever;
-    },
-
-    namedOptional: function(z) {
-      this.z = z;
-    },
-
-    decode: function(named, path) {
-      this.named = named;
-      this.path = path;
-    },
-
-    routeEvent: function(arg) {
-    }
-
-  });
-
-  QUnit.test('initialize', function(assert) {
-    assert.expect(1);
-    assert.equal(router.testing, 101);
-  });
-
-  QUnit.test('routes (simple)', function(assert) {
-    assert.expect(4);
-    location.replace('http://example.com#search/news');
-    Backbone.history.checkUrl();
-    assert.equal(router.query, 'news');
-    assert.equal(router.page, void 0);
-    assert.equal(lastRoute, 'search');
-    assert.equal(lastArgs[0], 'news');
-  });
-
-  QUnit.test('routes (simple, but unicode)', function(assert) {
-    assert.expect(4);
-    location.replace('http://example.com#search/тест');
-    Backbone.history.checkUrl();
-    assert.equal(router.query, 'тест');
-    assert.equal(router.page, void 0);
-    assert.equal(lastRoute, 'search');
-    assert.equal(lastArgs[0], 'тест');
-  });
-
-  QUnit.test('routes (two part)', function(assert) {
-    assert.expect(2);
-    location.replace('http://example.com#search/nyc/p10');
-    Backbone.history.checkUrl();
-    assert.equal(router.query, 'nyc');
-    assert.equal(router.page, '10');
-  });
-
-  QUnit.test('routes via navigate', function(assert) {
-    assert.expect(2);
-    Backbone.history.navigate('search/manhattan/p20', {trigger: true});
-    assert.equal(router.query, 'manhattan');
-    assert.equal(router.page, '20');
-  });
-
-  QUnit.test('routes via navigate with params', function(assert) {
-    assert.expect(1);
-    Backbone.history.navigate('query/test?a=b', {trigger: true});
-    assert.equal(router.queryArgs, 'a=b');
-  });
-
-  QUnit.test('routes via navigate for backwards-compatibility', function(assert) {
-    assert.expect(2);
-    Backbone.history.navigate('search/manhattan/p20', true);
-    assert.equal(router.query, 'manhattan');
-    assert.equal(router.page, '20');
-  });
-
-  QUnit.test('reports matched route via nagivate', function(assert) {
-    assert.expect(1);
-    assert.ok(Backbone.history.navigate('search/manhattan/p20', true));
-  });
-
-  QUnit.test('route precedence via navigate', function(assert){
-    assert.expect(6);
-    // check both 0.9.x and backwards-compatibility options
-    _.each([{trigger: true}, true], function( options ){
-      Backbone.history.navigate('contacts', options);
-      assert.equal(router.contact, 'index');
-      Backbone.history.navigate('contacts/new', options);
-      assert.equal(router.contact, 'new');
-      Backbone.history.navigate('contacts/foo', options);
-      assert.equal(router.contact, 'load');
-    });
-  });
-
-  QUnit.test('loadUrl is not called for identical routes.', function(assert) {
-    assert.expect(0);
-    Backbone.history.loadUrl = function(){ assert.ok(false); };
-    location.replace('http://example.com#route');
-    Backbone.history.navigate('route');
-    Backbone.history.navigate('/route');
-    Backbone.history.navigate('/route');
-  });
-
-  QUnit.test('use implicit callback if none provided', function(assert) {
-    assert.expect(1);
-    router.count = 0;
-    router.navigate('implicit', {trigger: true});
-    assert.equal(router.count, 1);
-  });
-
-  QUnit.test('routes via navigate with {replace: true}', function(assert) {
-    assert.expect(1);
-    location.replace('http://example.com#start_here');
-    Backbone.history.checkUrl();
-    location.replace = function(href) {
-      assert.strictEqual(href, new Location('http://example.com#end_here').href);
-    };
-    Backbone.history.navigate('end_here', {replace: true});
-  });
-
-  QUnit.test('routes (splats)', function(assert) {
-    assert.expect(1);
-    location.replace('http://example.com#splat/long-list/of/splatted_99args/end');
-    Backbone.history.checkUrl();
-    assert.equal(router.args, 'long-list/of/splatted_99args');
-  });
-
-  QUnit.test('routes (github)', function(assert) {
-    assert.expect(3);
-    location.replace('http://example.com#backbone/compare/1.0...braddunbar:with/slash');
-    Backbone.history.checkUrl();
-    assert.equal(router.repo, 'backbone');
-    assert.equal(router.from, '1.0');
-    assert.equal(router.to, 'braddunbar:with/slash');
-  });
-
-  QUnit.test('routes (optional)', function(assert) {
-    assert.expect(2);
-    location.replace('http://example.com#optional');
-    Backbone.history.checkUrl();
-    assert.ok(!router.arg);
-    location.replace('http://example.com#optional/thing');
-    Backbone.history.checkUrl();
-    assert.equal(router.arg, 'thing');
-  });
-
-  QUnit.test('routes (complex)', function(assert) {
-    assert.expect(3);
-    location.replace('http://example.com#one/two/three/complex-part/four/five/six/seven');
-    Backbone.history.checkUrl();
-    assert.equal(router.first, 'one/two/three');
-    assert.equal(router.part, 'part');
-    assert.equal(router.rest, 'four/five/six/seven');
-  });
-
-  QUnit.test('routes (query)', function(assert) {
-    assert.expect(5);
-    location.replace('http://example.com#query/mandel?a=b&c=d');
-    Backbone.history.checkUrl();
-    assert.equal(router.entity, 'mandel');
-    assert.equal(router.queryArgs, 'a=b&c=d');
-    assert.equal(lastRoute, 'query');
-    assert.equal(lastArgs[0], 'mandel');
-    assert.equal(lastArgs[1], 'a=b&c=d');
-  });
-
-  QUnit.test('routes (anything)', function(assert) {
-    assert.expect(1);
-    location.replace('http://example.com#doesnt-match-a-route');
-    Backbone.history.checkUrl();
-    assert.equal(router.anything, 'doesnt-match-a-route');
-  });
-
-  QUnit.test('routes (function)', function(assert) {
-    assert.expect(3);
-    router.on('route', function(name) {
-      assert.ok(name === '');
-    });
-    assert.equal(ExternalObject.value, 'unset');
-    location.replace('http://example.com#function/set');
-    Backbone.history.checkUrl();
-    assert.equal(ExternalObject.value, 'set');
-  });
-
-  QUnit.test('Decode named parameters, not splats.', function(assert) {
-    assert.expect(2);
-    location.replace('http://example.com#decode/a%2Fb/c%2Fd/e');
-    Backbone.history.checkUrl();
-    assert.strictEqual(router.named, 'a/b');
-    assert.strictEqual(router.path, 'c/d/e');
-  });
-
-  QUnit.test("fires event when router doesn't have callback on it", function(assert) {
-    assert.expect(1);
-    router.on('route:noCallback', function(){ assert.ok(true); });
-    location.replace('http://example.com#noCallback');
-    Backbone.history.checkUrl();
-  });
-
-  QUnit.test('No events are triggered if #execute returns false.', function(assert) {
-    assert.expect(1);
-    var MyRouter = Backbone.Router.extend({
-
-      routes: {
-        foo: function() {
-          assert.ok(true);
-        }
-      },
-
-      execute: function(callback, args) {
-        callback.apply(this, args);
-        return false;
-      }
-
-    });
-
-    var myRouter = new MyRouter;
-
-    myRouter.on('route route:foo', function() {
-      assert.ok(false);
-    });
-
-    Backbone.history.on('route', function() {
-      assert.ok(false);
-    });
-
-    location.replace('http://example.com#foo');
-    Backbone.history.checkUrl();
-  });
-
-  QUnit.test('#933, #908 - leading slash', function(assert) {
-    assert.expect(2);
-    location.replace('http://example.com/root/foo');
-
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    Backbone.history.start({root: '/root', hashChange: false, silent: true});
-    assert.strictEqual(Backbone.history.getFragment(), 'foo');
-
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    Backbone.history.start({root: '/root/', hashChange: false, silent: true});
-    assert.strictEqual(Backbone.history.getFragment(), 'foo');
-  });
-
-  QUnit.test('#967 - Route callback gets passed encoded values.', function(assert) {
-    assert.expect(3);
-    var route = 'has%2Fslash/complex-has%23hash/has%20space';
-    Backbone.history.navigate(route, {trigger: true});
-    assert.strictEqual(router.first, 'has/slash');
-    assert.strictEqual(router.part, 'has#hash');
-    assert.strictEqual(router.rest, 'has space');
-  });
-
-  QUnit.test('correctly handles URLs with % (#868)', function(assert) {
-    assert.expect(3);
-    location.replace('http://example.com#search/fat%3A1.5%25');
-    Backbone.history.checkUrl();
-    location.replace('http://example.com#search/fat');
-    Backbone.history.checkUrl();
-    assert.equal(router.query, 'fat');
-    assert.equal(router.page, void 0);
-    assert.equal(lastRoute, 'search');
-  });
-
-  QUnit.test('#2666 - Hashes with UTF8 in them.', function(assert) {
-    assert.expect(2);
-    Backbone.history.navigate('charñ', {trigger: true});
-    assert.equal(router.charType, 'UTF');
-    Backbone.history.navigate('char%C3%B1', {trigger: true});
-    assert.equal(router.charType, 'UTF');
-  });
-
-  QUnit.test('#1185 - Use pathname when hashChange is not wanted.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/path/name#hash');
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    Backbone.history.start({hashChange: false});
-    var fragment = Backbone.history.getFragment();
-    assert.strictEqual(fragment, location.pathname.replace(/^\//, ''));
-  });
-
-  QUnit.test('#1206 - Strip leading slash before location.assign.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/root/');
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    Backbone.history.start({hashChange: false, root: '/root/'});
-    location.assign = function(pathname) {
-      assert.strictEqual(pathname, '/root/fragment');
-    };
-    Backbone.history.navigate('/fragment');
-  });
-
-  QUnit.test('#1387 - Root fragment without trailing slash.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/root');
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    Backbone.history.start({hashChange: false, root: '/root/', silent: true});
-    assert.strictEqual(Backbone.history.getFragment(), '');
-  });
-
-  QUnit.test('#1366 - History does not prepend root to fragment.', function(assert) {
-    assert.expect(2);
-    Backbone.history.stop();
-    location.replace('http://example.com/root/');
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(state, title, url) {
-          assert.strictEqual(url, '/root/x');
-        }
-      }
-    });
-    Backbone.history.start({
-      root: '/root/',
-      pushState: true,
-      hashChange: false
-    });
-    Backbone.history.navigate('x');
-    assert.strictEqual(Backbone.history.fragment, 'x');
-  });
-
-  QUnit.test('Normalize root.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/root');
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(state, title, url) {
-          assert.strictEqual(url, '/root/fragment');
-        }
-      }
-    });
-    Backbone.history.start({
-      pushState: true,
-      root: '/root',
-      hashChange: false
-    });
-    Backbone.history.navigate('fragment');
-  });
-
-  QUnit.test('Normalize root.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/root#fragment');
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(state, title, url) {},
-        replaceState: function(state, title, url) {
-          assert.strictEqual(url, '/root/fragment');
-        }
-      }
-    });
-    Backbone.history.start({
-      pushState: true,
-      root: '/root'
-    });
-  });
-
-  QUnit.test('Normalize root.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/root');
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    Backbone.history.loadUrl = function() { assert.ok(true); };
-    Backbone.history.start({
-      pushState: true,
-      root: '/root'
-    });
-  });
-
-  QUnit.test('Normalize root - leading slash.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/root');
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(){},
-        replaceState: function(){}
-      }
-    });
-    Backbone.history.start({root: 'root'});
-    assert.strictEqual(Backbone.history.root, '/root/');
-  });
-
-  QUnit.test('Transition from hashChange to pushState.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/root#x/y');
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(){},
-        replaceState: function(state, title, url){
-          assert.strictEqual(url, '/root/x/y');
-        }
-      }
-    });
-    Backbone.history.start({
-      root: 'root',
-      pushState: true
-    });
-  });
-
-  QUnit.test('#1619: Router: Normalize empty root', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/');
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(){},
-        replaceState: function(){}
-      }
-    });
-    Backbone.history.start({root: ''});
-    assert.strictEqual(Backbone.history.root, '/');
-  });
-
-  QUnit.test('#1619: Router: nagivate with empty root', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/');
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(state, title, url) {
-          assert.strictEqual(url, '/fragment');
-        }
-      }
-    });
-    Backbone.history.start({
-      pushState: true,
-      root: '',
-      hashChange: false
-    });
-    Backbone.history.navigate('fragment');
-  });
-
-  QUnit.test('Transition from pushState to hashChange.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/root/x/y?a=b');
-    location.replace = function(url) {
-      assert.strictEqual(url, '/root#x/y?a=b');
-    };
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: null,
-        replaceState: null
-      }
-    });
-    Backbone.history.start({
-      root: 'root',
-      pushState: true
-    });
-  });
-
-  QUnit.test('#1695 - hashChange to pushState with search.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/root#x/y?a=b');
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(){},
-        replaceState: function(state, title, url){
-          assert.strictEqual(url, '/root/x/y?a=b');
-        }
-      }
-    });
-    Backbone.history.start({
-      root: 'root',
-      pushState: true
-    });
-  });
-
-  QUnit.test('#1746 - Router allows empty route.', function(assert) {
-    assert.expect(1);
-    var MyRouter = Backbone.Router.extend({
-      routes: {'': 'empty'},
-      empty: function(){},
-      route: function(route){
-        assert.strictEqual(route, '');
-      }
-    });
-    new MyRouter;
-  });
-
-  QUnit.test('#1794 - Trailing space in fragments.', function(assert) {
-    assert.expect(1);
-    var history = new Backbone.History;
-    assert.strictEqual(history.getFragment('fragment   '), 'fragment');
-  });
-
-  QUnit.test('#1820 - Leading slash and trailing space.', 1, function(assert) {
-    var history = new Backbone.History;
-    assert.strictEqual(history.getFragment('/fragment '), 'fragment');
-  });
-
-  QUnit.test('#1980 - Optional parameters.', function(assert) {
-    assert.expect(2);
-    location.replace('http://example.com#named/optional/y');
-    Backbone.history.checkUrl();
-    assert.strictEqual(router.z, undefined);
-    location.replace('http://example.com#named/optional/y123');
-    Backbone.history.checkUrl();
-    assert.strictEqual(router.z, '123');
-  });
-
-  QUnit.test("#2062 - Trigger 'route' event on router instance.", function(assert) {
-    assert.expect(2);
-    router.on('route', function(name, args) {
-      assert.strictEqual(name, 'routeEvent');
-      assert.deepEqual(args, ['x', null]);
-    });
-    location.replace('http://example.com#route-event/x');
-    Backbone.history.checkUrl();
-  });
-
-  QUnit.test('#2255 - Extend routes by making routes a function.', function(assert) {
-    assert.expect(1);
-    var RouterBase = Backbone.Router.extend({
-      routes: function() {
-        return {
-          home: 'root',
-          index: 'index.html'
-        };
-      }
-    });
-
-    var RouterExtended = RouterBase.extend({
-      routes: function() {
-        var _super = RouterExtended.__super__.routes;
-        return _.extend(_super(), {show: 'show', search: 'search'});
-      }
-    });
-
-    var myRouter = new RouterExtended();
-    assert.deepEqual({home: 'root', index: 'index.html', show: 'show', search: 'search'}, myRouter.routes);
-  });
-
-  QUnit.test('#2538 - hashChange to pushState only if both requested.', function(assert) {
-    assert.expect(0);
-    Backbone.history.stop();
-    location.replace('http://example.com/root?a=b#x/y');
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(){},
-        replaceState: function(){ assert.ok(false); }
-      }
-    });
-    Backbone.history.start({
-      root: 'root',
-      pushState: true,
-      hashChange: false
-    });
-  });
-
-  QUnit.test('No hash fallback.', function(assert) {
-    assert.expect(0);
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(){},
-        replaceState: function(){}
-      }
-    });
-
-    var MyRouter = Backbone.Router.extend({
-      routes: {
-        hash: function() { assert.ok(false); }
-      }
-    });
-    var myRouter = new MyRouter;
-
-    location.replace('http://example.com/');
-    Backbone.history.start({
-      pushState: true,
-      hashChange: false
-    });
-    location.replace('http://example.com/nomatch#hash');
-    Backbone.history.checkUrl();
-  });
-
-  QUnit.test('#2656 - No trailing slash on root.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(state, title, url){
-          assert.strictEqual(url, '/root');
-        }
-      }
-    });
-    location.replace('http://example.com/root/path');
-    Backbone.history.start({pushState: true, hashChange: false, root: 'root'});
-    Backbone.history.navigate('');
-  });
-
-  QUnit.test('#2656 - No trailing slash on root.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(state, title, url) {
-          assert.strictEqual(url, '/');
-        }
-      }
-    });
-    location.replace('http://example.com/path');
-    Backbone.history.start({pushState: true, hashChange: false});
-    Backbone.history.navigate('');
-  });
-
-  QUnit.test('#2656 - No trailing slash on root.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(state, title, url){
-          assert.strictEqual(url, '/root?x=1');
-        }
-      }
-    });
-    location.replace('http://example.com/root/path');
-    Backbone.history.start({pushState: true, hashChange: false, root: 'root'});
-    Backbone.history.navigate('?x=1');
-  });
-
-  QUnit.test('#2765 - Fragment matching sans query/hash.', function(assert) {
-    assert.expect(2);
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(state, title, url) {
-          assert.strictEqual(url, '/path?query#hash');
-        }
-      }
-    });
-
-    var MyRouter = Backbone.Router.extend({
-      routes: {
-        path: function() { assert.ok(true); }
-      }
-    });
-    var myRouter = new MyRouter;
-
-    location.replace('http://example.com/');
-    Backbone.history.start({pushState: true, hashChange: false});
-    Backbone.history.navigate('path?query#hash', true);
-  });
-
-  QUnit.test('Do not decode the search params.', function(assert) {
-    assert.expect(1);
-    var MyRouter = Backbone.Router.extend({
-      routes: {
-        path: function(params){
-          assert.strictEqual(params, 'x=y%3Fz');
-        }
-      }
-    });
-    var myRouter = new MyRouter;
-    Backbone.history.navigate('path?x=y%3Fz', true);
-  });
-
-  QUnit.test('Navigate to a hash url.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    Backbone.history.start({pushState: true});
-    var MyRouter = Backbone.Router.extend({
-      routes: {
-        path: function(params) {
-          assert.strictEqual(params, 'x=y');
-        }
-      }
-    });
-    var myRouter = new MyRouter;
-    location.replace('http://example.com/path?x=y#hash');
-    Backbone.history.checkUrl();
-  });
-
-  QUnit.test('#navigate to a hash url.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    Backbone.history.start({pushState: true});
-    var MyRouter = Backbone.Router.extend({
-      routes: {
-        path: function(params) {
-          assert.strictEqual(params, 'x=y');
-        }
-      }
-    });
-    var myRouter = new MyRouter;
-    Backbone.history.navigate('path?x=y#hash', true);
-  });
-
-  QUnit.test('unicode pathname', function(assert) {
-    assert.expect(1);
-    location.replace('http://example.com/myyjä');
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    var MyRouter = Backbone.Router.extend({
-      routes: {
-        myyjä: function() {
-          assert.ok(true);
-        }
-      }
-    });
-    new MyRouter;
-    Backbone.history.start({pushState: true});
-  });
-
-  QUnit.test('unicode pathname with % in a parameter', function(assert) {
-    assert.expect(1);
-    location.replace('http://example.com/myyjä/foo%20%25%3F%2f%40%25%20bar');
-    location.pathname = '/myyj%C3%A4/foo%20%25%3F%2f%40%25%20bar';
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    var MyRouter = Backbone.Router.extend({
-      routes: {
-        'myyjä/:query': function(query) {
-          assert.strictEqual(query, 'foo %?/@% bar');
-        }
-      }
-    });
-    new MyRouter;
-    Backbone.history.start({pushState: true});
-  });
-
-  QUnit.test('newline in route', function(assert) {
-    assert.expect(1);
-    location.replace('http://example.com/stuff%0Anonsense?param=foo%0Abar');
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    var MyRouter = Backbone.Router.extend({
-      routes: {
-        'stuff\nnonsense': function() {
-          assert.ok(true);
-        }
-      }
-    });
-    new MyRouter;
-    Backbone.history.start({pushState: true});
-  });
-
-  QUnit.test('Router#execute receives callback, args, name.', function(assert) {
-    assert.expect(3);
-    location.replace('http://example.com#foo/123/bar?x=y');
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    var MyRouter = Backbone.Router.extend({
-      routes: {'foo/:id/bar': 'foo'},
-      foo: function(){},
-      execute: function(callback, args, name) {
-        assert.strictEqual(callback, this.foo);
-        assert.deepEqual(args, ['123', 'x=y']);
-        assert.strictEqual(name, 'foo');
-      }
-    });
-    var myRouter = new MyRouter;
-    Backbone.history.start();
-  });
-
-  QUnit.test('pushState to hashChange with only search params.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com?a=b');
-    location.replace = function(url) {
-      assert.strictEqual(url, '/#?a=b');
-    };
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: null
-    });
-    Backbone.history.start({pushState: true});
-  });
-
-  QUnit.test('#3123 - History#navigate decodes before comparison.', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/shop/search?keyword=short%20dress');
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: function(){ assert.ok(false); },
-        replaceState: function(){ assert.ok(false); }
-      }
-    });
-    Backbone.history.start({pushState: true});
-    Backbone.history.navigate('shop/search?keyword=short%20dress', true);
-    assert.strictEqual(Backbone.history.fragment, 'shop/search?keyword=short dress');
-  });
-
-  QUnit.test('#3175 - Urls in the params', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com#login?a=value&backUrl=https%3A%2F%2Fwww.msn.com%2Fidp%2Fidpdemo%3Fspid%3Dspdemo%26target%3Db');
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    var myRouter = new Backbone.Router;
-    myRouter.route('login', function(params) {
-      assert.strictEqual(params, 'a=value&backUrl=https%3A%2F%2Fwww.msn.com%2Fidp%2Fidpdemo%3Fspid%3Dspdemo%26target%3Db');
-    });
-    Backbone.history.start();
-  });
-
-  QUnit.test('#3358 - pushState to hashChange transition with search params', function(assert) {
-    assert.expect(1);
-    Backbone.history.stop();
-    location.replace('http://example.com/root?foo=bar');
-    location.replace = function(url) {
-      assert.strictEqual(url, '/root#?foo=bar');
-    };
-    Backbone.history = _.extend(new Backbone.History, {
-      location: location,
-      history: {
-        pushState: undefined,
-        replaceState: undefined
-      }
-    });
-    Backbone.history.start({root: '/root', pushState: true});
-  });
-
-  QUnit.test("Paths that don't match the root should not match no root", function(assert) {
-    assert.expect(0);
-    location.replace('http://example.com/foo');
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    var MyRouter = Backbone.Router.extend({
-      routes: {
-        foo: function(){
-          assert.ok(false, 'should not match unless root matches');
-        }
-      }
-    });
-    var myRouter = new MyRouter;
-    Backbone.history.start({root: 'root', pushState: true});
-  });
-
-  QUnit.test("Paths that don't match the root should not match roots of the same length", function(assert) {
-    assert.expect(0);
-    location.replace('http://example.com/xxxx/foo');
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    var MyRouter = Backbone.Router.extend({
-      routes: {
-        foo: function(){
-          assert.ok(false, 'should not match unless root matches');
-        }
-      }
-    });
-    var myRouter = new MyRouter;
-    Backbone.history.start({root: 'root', pushState: true});
-  });
-
-  QUnit.test('roots with regex characters', function(assert) {
-    assert.expect(1);
-    location.replace('http://example.com/x+y.z/foo');
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    var MyRouter = Backbone.Router.extend({
-      routes: {foo: function(){ assert.ok(true); }}
-    });
-    var myRouter = new MyRouter;
-    Backbone.history.start({root: 'x+y.z', pushState: true});
-  });
-
-  QUnit.test('roots with unicode characters', function(assert) {
-    assert.expect(1);
-    location.replace('http://example.com/®ooτ/foo');
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    var MyRouter = Backbone.Router.extend({
-      routes: {foo: function(){ assert.ok(true); }}
-    });
-    var myRouter = new MyRouter;
-    Backbone.history.start({root: '®ooτ', pushState: true});
-  });
-
-  QUnit.test('roots without slash', function(assert) {
-    assert.expect(1);
-    location.replace('http://example.com/®ooτ');
-    Backbone.history.stop();
-    Backbone.history = _.extend(new Backbone.History, {location: location});
-    var MyRouter = Backbone.Router.extend({
-      routes: {'': function(){ assert.ok(true); }}
-    });
-    var myRouter = new MyRouter;
-    Backbone.history.start({root: '®ooτ', pushState: true});
-  });
-
-})();
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/setup/dom-setup.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/setup/dom-setup.js
deleted file mode 100644
index f224228..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/setup/dom-setup.js
+++ /dev/null
@@ -1,4 +0,0 @@
-$('body').append(
-    '<div id="qunit"></div>' +
-    '<div id="qunit-fixture"></div>'
-);
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/setup/environment.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/setup/environment.js
deleted file mode 100644
index c2441ac..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/setup/environment.js
+++ /dev/null
@@ -1,45 +0,0 @@
-(function() {
-
-  var sync = Backbone.sync;
-  var ajax = Backbone.ajax;
-  var emulateHTTP = Backbone.emulateHTTP;
-  var emulateJSON = Backbone.emulateJSON;
-  var history = window.history;
-  var pushState = history.pushState;
-  var replaceState = history.replaceState;
-
-  QUnit.config.noglobals = true;
-
-  QUnit.testStart(function() {
-    var env = QUnit.config.current.testEnvironment;
-
-    // We never want to actually call these during tests.
-    history.pushState = history.replaceState = function(){};
-
-    // Capture ajax settings for comparison.
-    Backbone.ajax = function(settings) {
-      env.ajaxSettings = settings;
-    };
-
-    // Capture the arguments to Backbone.sync for comparison.
-    Backbone.sync = function(method, model, options) {
-      env.syncArgs = {
-        method: method,
-        model: model,
-        options: options
-      };
-      sync.apply(this, arguments);
-    };
-
-  });
-
-  QUnit.testDone(function() {
-    Backbone.sync = sync;
-    Backbone.ajax = ajax;
-    Backbone.emulateHTTP = emulateHTTP;
-    Backbone.emulateJSON = emulateJSON;
-    history.pushState = pushState;
-    history.replaceState = replaceState;
-  });
-
-})();
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/sync.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/sync.js
deleted file mode 100644
index 8813f15..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/sync.js
+++ /dev/null
@@ -1,239 +0,0 @@
-(function() {
-
-  var Library = Backbone.Collection.extend({
-    url: function() { return '/library'; }
-  });
-  var library;
-
-  var attrs = {
-    title: 'The Tempest',
-    author: 'Bill Shakespeare',
-    length: 123
-  };
-
-  QUnit.module('Backbone.sync', {
-
-    beforeEach: function(assert) {
-      library = new Library;
-      library.create(attrs, {wait: false});
-    },
-
-    afterEach: function(assert) {
-      Backbone.emulateHTTP = false;
-    }
-
-  });
-
-  QUnit.test('read', function(assert) {
-    assert.expect(4);
-    library.fetch();
-    assert.equal(this.ajaxSettings.url, '/library');
-    assert.equal(this.ajaxSettings.type, 'GET');
-    assert.equal(this.ajaxSettings.dataType, 'json');
-    assert.ok(_.isEmpty(this.ajaxSettings.data));
-  });
-
-  QUnit.test('passing data', function(assert) {
-    assert.expect(3);
-    library.fetch({data: {a: 'a', one: 1}});
-    assert.equal(this.ajaxSettings.url, '/library');
-    assert.equal(this.ajaxSettings.data.a, 'a');
-    assert.equal(this.ajaxSettings.data.one, 1);
-  });
-
-  QUnit.test('create', function(assert) {
-    assert.expect(6);
-    assert.equal(this.ajaxSettings.url, '/library');
-    assert.equal(this.ajaxSettings.type, 'POST');
-    assert.equal(this.ajaxSettings.dataType, 'json');
-    var data = JSON.parse(this.ajaxSettings.data);
-    assert.equal(data.title, 'The Tempest');
-    assert.equal(data.author, 'Bill Shakespeare');
-    assert.equal(data.length, 123);
-  });
-
-  QUnit.test('update', function(assert) {
-    assert.expect(7);
-    library.first().save({id: '1-the-tempest', author: 'William Shakespeare'});
-    assert.equal(this.ajaxSettings.url, '/library/1-the-tempest');
-    assert.equal(this.ajaxSettings.type, 'PUT');
-    assert.equal(this.ajaxSettings.dataType, 'json');
-    var data = JSON.parse(this.ajaxSettings.data);
-    assert.equal(data.id, '1-the-tempest');
-    assert.equal(data.title, 'The Tempest');
-    assert.equal(data.author, 'William Shakespeare');
-    assert.equal(data.length, 123);
-  });
-
-  QUnit.test('update with emulateHTTP and emulateJSON', function(assert) {
-    assert.expect(7);
-    library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
-      emulateHTTP: true,
-      emulateJSON: true
-    });
-    assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
-    assert.equal(this.ajaxSettings.type, 'POST');
-    assert.equal(this.ajaxSettings.dataType, 'json');
-    assert.equal(this.ajaxSettings.data._method, 'PUT');
-    var data = JSON.parse(this.ajaxSettings.data.model);
-    assert.equal(data.id, '2-the-tempest');
-    assert.equal(data.author, 'Tim Shakespeare');
-    assert.equal(data.length, 123);
-  });
-
-  QUnit.test('update with just emulateHTTP', function(assert) {
-    assert.expect(6);
-    library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
-      emulateHTTP: true
-    });
-    assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
-    assert.equal(this.ajaxSettings.type, 'POST');
-    assert.equal(this.ajaxSettings.contentType, 'application/json');
-    var data = JSON.parse(this.ajaxSettings.data);
-    assert.equal(data.id, '2-the-tempest');
-    assert.equal(data.author, 'Tim Shakespeare');
-    assert.equal(data.length, 123);
-  });
-
-  QUnit.test('update with just emulateJSON', function(assert) {
-    assert.expect(6);
-    library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
-      emulateJSON: true
-    });
-    assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
-    assert.equal(this.ajaxSettings.type, 'PUT');
-    assert.equal(this.ajaxSettings.contentType, 'application/x-www-form-urlencoded');
-    var data = JSON.parse(this.ajaxSettings.data.model);
-    assert.equal(data.id, '2-the-tempest');
-    assert.equal(data.author, 'Tim Shakespeare');
-    assert.equal(data.length, 123);
-  });
-
-  QUnit.test('read model', function(assert) {
-    assert.expect(3);
-    library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
-    library.first().fetch();
-    assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
-    assert.equal(this.ajaxSettings.type, 'GET');
-    assert.ok(_.isEmpty(this.ajaxSettings.data));
-  });
-
-  QUnit.test('destroy', function(assert) {
-    assert.expect(3);
-    library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
-    library.first().destroy({wait: true});
-    assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
-    assert.equal(this.ajaxSettings.type, 'DELETE');
-    assert.equal(this.ajaxSettings.data, null);
-  });
-
-  QUnit.test('destroy with emulateHTTP', function(assert) {
-    assert.expect(3);
-    library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
-    library.first().destroy({
-      emulateHTTP: true,
-      emulateJSON: true
-    });
-    assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
-    assert.equal(this.ajaxSettings.type, 'POST');
-    assert.equal(JSON.stringify(this.ajaxSettings.data), '{"_method":"DELETE"}');
-  });
-
-  QUnit.test('urlError', function(assert) {
-    assert.expect(2);
-    var model = new Backbone.Model();
-    assert.raises(function() {
-      model.fetch();
-    });
-    model.fetch({url: '/one/two'});
-    assert.equal(this.ajaxSettings.url, '/one/two');
-  });
-
-  QUnit.test('#1052 - `options` is optional.', function(assert) {
-    assert.expect(0);
-    var model = new Backbone.Model();
-    model.url = '/test';
-    Backbone.sync('create', model);
-  });
-
-  QUnit.test('Backbone.ajax', function(assert) {
-    assert.expect(1);
-    Backbone.ajax = function(settings){
-      assert.strictEqual(settings.url, '/test');
-    };
-    var model = new Backbone.Model();
-    model.url = '/test';
-    Backbone.sync('create', model);
-  });
-
-  QUnit.test('Call provided error callback on error.', function(assert) {
-    assert.expect(1);
-    var model = new Backbone.Model;
-    model.url = '/test';
-    Backbone.sync('read', model, {
-      error: function() { assert.ok(true); }
-    });
-    this.ajaxSettings.error();
-  });
-
-  QUnit.test('Use Backbone.emulateHTTP as default.', function(assert) {
-    assert.expect(2);
-    var model = new Backbone.Model;
-    model.url = '/test';
-
-    Backbone.emulateHTTP = true;
-    model.sync('create', model);
-    assert.strictEqual(this.ajaxSettings.emulateHTTP, true);
-
-    Backbone.emulateHTTP = false;
-    model.sync('create', model);
-    assert.strictEqual(this.ajaxSettings.emulateHTTP, false);
-  });
-
-  QUnit.test('Use Backbone.emulateJSON as default.', function(assert) {
-    assert.expect(2);
-    var model = new Backbone.Model;
-    model.url = '/test';
-
-    Backbone.emulateJSON = true;
-    model.sync('create', model);
-    assert.strictEqual(this.ajaxSettings.emulateJSON, true);
-
-    Backbone.emulateJSON = false;
-    model.sync('create', model);
-    assert.strictEqual(this.ajaxSettings.emulateJSON, false);
-  });
-
-  QUnit.test('#1756 - Call user provided beforeSend function.', function(assert) {
-    assert.expect(4);
-    Backbone.emulateHTTP = true;
-    var model = new Backbone.Model;
-    model.url = '/test';
-    var xhr = {
-      setRequestHeader: function(header, value) {
-        assert.strictEqual(header, 'X-HTTP-Method-Override');
-        assert.strictEqual(value, 'DELETE');
-      }
-    };
-    model.sync('delete', model, {
-      beforeSend: function(_xhr) {
-        assert.ok(_xhr === xhr);
-        return false;
-      }
-    });
-    assert.strictEqual(this.ajaxSettings.beforeSend(xhr), false);
-  });
-
-  QUnit.test('#2928 - Pass along `textStatus` and `errorThrown`.', function(assert) {
-    assert.expect(2);
-    var model = new Backbone.Model;
-    model.url = '/test';
-    model.on('error', function(m, xhr, options) {
-      assert.strictEqual(options.textStatus, 'textStatus');
-      assert.strictEqual(options.errorThrown, 'errorThrown');
-    });
-    model.fetch();
-    this.ajaxSettings.error({}, 'textStatus', 'errorThrown');
-  });
-
-})();
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/view.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/view.js
deleted file mode 100644
index faf3445..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/backbone/test/view.js
+++ /dev/null
@@ -1,495 +0,0 @@
-(function() {
-
-  var view;
-
-  QUnit.module('Backbone.View', {
-
-    beforeEach: function(assert) {
-      $('#qunit-fixture').append(
-        '<div id="testElement"><h1>Test</h1></div>'
-      );
-
-      view = new Backbone.View({
-        id: 'test-view',
-        className: 'test-view',
-        other: 'non-special-option'
-      });
-    },
-
-    afterEach: function() {
-      $('#testElement').remove();
-      $('#test-view').remove();
-    }
-
-  });
-
-  QUnit.test('constructor', function(assert) {
-    assert.expect(3);
-    assert.equal(view.el.id, 'test-view');
-    assert.equal(view.el.className, 'test-view');
-    assert.equal(view.el.other, void 0);
-  });
-
-  QUnit.test('$', function(assert) {
-    assert.expect(2);
-    var myView = new Backbone.View;
-    myView.setElement('<p><a><b>test</b></a></p>');
-    var result = myView.$('a b');
-
-    assert.strictEqual(result[0].innerHTML, 'test');
-    assert.ok(result.length === +result.length);
-  });
-
-  QUnit.test('$el', function(assert) {
-    assert.expect(3);
-    var myView = new Backbone.View;
-    myView.setElement('<p><a><b>test</b></a></p>');
-    assert.strictEqual(myView.el.nodeType, 1);
-
-    assert.ok(myView.$el instanceof Backbone.$);
-    assert.strictEqual(myView.$el[0], myView.el);
-  });
-
-  QUnit.test('initialize', function(assert) {
-    assert.expect(1);
-    var View = Backbone.View.extend({
-      initialize: function() {
-        this.one = 1;
-      }
-    });
-
-    assert.strictEqual(new View().one, 1);
-  });
-
-  QUnit.test('render', function(assert) {
-    assert.expect(1);
-    var myView = new Backbone.View;
-    assert.equal(myView.render(), myView, '#render returns the view instance');
-  });
-
-  QUnit.test('delegateEvents', function(assert) {
-    assert.expect(6);
-    var counter1 = 0, counter2 = 0;
-
-    var myView = new Backbone.View({el: '#testElement'});
-    myView.increment = function(){ counter1++; };
-    myView.$el.on('click', function(){ counter2++; });
-
-    var events = {'click h1': 'increment'};
-
-    myView.delegateEvents(events);
-    myView.$('h1').trigger('click');
-    assert.equal(counter1, 1);
-    assert.equal(counter2, 1);
-
-    myView.$('h1').trigger('click');
-    assert.equal(counter1, 2);
-    assert.equal(counter2, 2);
-
-    myView.delegateEvents(events);
-    myView.$('h1').trigger('click');
-    assert.equal(counter1, 3);
-    assert.equal(counter2, 3);
-  });
-
-  QUnit.test('delegate', function(assert) {
-    assert.expect(3);
-    var myView = new Backbone.View({el: '#testElement'});
-    myView.delegate('click', 'h1', function() {
-      assert.ok(true);
-    });
-    myView.delegate('click', function() {
-      assert.ok(true);
-    });
-    myView.$('h1').trigger('click');
-
-    assert.equal(myView.delegate(), myView, '#delegate returns the view instance');
-  });
-
-  QUnit.test('delegateEvents allows functions for callbacks', function(assert) {
-    assert.expect(3);
-    var myView = new Backbone.View({el: '<p></p>'});
-    myView.counter = 0;
-
-    var events = {
-      click: function() {
-        this.counter++;
-      }
-    };
-
-    myView.delegateEvents(events);
-    myView.$el.trigger('click');
-    assert.equal(myView.counter, 1);
-
-    myView.$el.trigger('click');
-    assert.equal(myView.counter, 2);
-
-    myView.delegateEvents(events);
-    myView.$el.trigger('click');
-    assert.equal(myView.counter, 3);
-  });
-
-
-  QUnit.test('delegateEvents ignore undefined methods', function(assert) {
-    assert.expect(0);
-    var myView = new Backbone.View({el: '<p></p>'});
-    myView.delegateEvents({'click': 'undefinedMethod'});
-    myView.$el.trigger('click');
-  });
-
-  QUnit.test('undelegateEvents', function(assert) {
-    assert.expect(7);
-    var counter1 = 0, counter2 = 0;
-
-    var myView = new Backbone.View({el: '#testElement'});
-    myView.increment = function(){ counter1++; };
-    myView.$el.on('click', function(){ counter2++; });
-
-    var events = {'click h1': 'increment'};
-
-    myView.delegateEvents(events);
-    myView.$('h1').trigger('click');
-    assert.equal(counter1, 1);
-    assert.equal(counter2, 1);
-
-    myView.undelegateEvents();
-    myView.$('h1').trigger('click');
-    assert.equal(counter1, 1);
-    assert.equal(counter2, 2);
-
-    myView.delegateEvents(events);
-    myView.$('h1').trigger('click');
-    assert.equal(counter1, 2);
-    assert.equal(counter2, 3);
-
-    assert.equal(myView.undelegateEvents(), myView, '#undelegateEvents returns the view instance');
-  });
-
-  QUnit.test('undelegate', function(assert) {
-    assert.expect(1);
-    var myView = new Backbone.View({el: '#testElement'});
-    myView.delegate('click', function() { assert.ok(false); });
-    myView.delegate('click', 'h1', function() { assert.ok(false); });
-
-    myView.undelegate('click');
-
-    myView.$('h1').trigger('click');
-    myView.$el.trigger('click');
-
-    assert.equal(myView.undelegate(), myView, '#undelegate returns the view instance');
-  });
-
-  QUnit.test('undelegate with passed handler', function(assert) {
-    assert.expect(1);
-    var myView = new Backbone.View({el: '#testElement'});
-    var listener = function() { assert.ok(false); };
-    myView.delegate('click', listener);
-    myView.delegate('click', function() { assert.ok(true); });
-    myView.undelegate('click', listener);
-    myView.$el.trigger('click');
-  });
-
-  QUnit.test('undelegate with selector', function(assert) {
-    assert.expect(2);
-    var myView = new Backbone.View({el: '#testElement'});
-    myView.delegate('click', function() { assert.ok(true); });
-    myView.delegate('click', 'h1', function() { assert.ok(false); });
-    myView.undelegate('click', 'h1');
-    myView.$('h1').trigger('click');
-    myView.$el.trigger('click');
-  });
-
-  QUnit.test('undelegate with handler and selector', function(assert) {
-    assert.expect(2);
-    var myView = new Backbone.View({el: '#testElement'});
-    myView.delegate('click', function() { assert.ok(true); });
-    var handler = function(){ assert.ok(false); };
-    myView.delegate('click', 'h1', handler);
-    myView.undelegate('click', 'h1', handler);
-    myView.$('h1').trigger('click');
-    myView.$el.trigger('click');
-  });
-
-  QUnit.test('tagName can be provided as a string', function(assert) {
-    assert.expect(1);
-    var View = Backbone.View.extend({
-      tagName: 'span'
-    });
-
-    assert.equal(new View().el.tagName, 'SPAN');
-  });
-
-  QUnit.test('tagName can be provided as a function', function(assert) {
-    assert.expect(1);
-    var View = Backbone.View.extend({
-      tagName: function() {
-        return 'p';
-      }
-    });
-
-    assert.ok(new View().$el.is('p'));
-  });
-
-  QUnit.test('_ensureElement with DOM node el', function(assert) {
-    assert.expect(1);
-    var View = Backbone.View.extend({
-      el: document.body
-    });
-
-    assert.equal(new View().el, document.body);
-  });
-
-  QUnit.test('_ensureElement with string el', function(assert) {
-    assert.expect(3);
-    var View = Backbone.View.extend({
-      el: 'body'
-    });
-    assert.strictEqual(new View().el, document.body);
-
-    View = Backbone.View.extend({
-      el: '#testElement > h1'
-    });
-    assert.strictEqual(new View().el, $('#testElement > h1').get(0));
-
-    View = Backbone.View.extend({
-      el: '#nonexistent'
-    });
-    assert.ok(!new View().el);
-  });
-
-  QUnit.test('with className and id functions', function(assert) {
-    assert.expect(2);
-    var View = Backbone.View.extend({
-      className: function() {
-        return 'className';
-      },
-      id: function() {
-        return 'id';
-      }
-    });
-
-    assert.strictEqual(new View().el.className, 'className');
-    assert.strictEqual(new View().el.id, 'id');
-  });
-
-  QUnit.test('with attributes', function(assert) {
-    assert.expect(2);
-    var View = Backbone.View.extend({
-      attributes: {
-        'id': 'id',
-        'class': 'class'
-      }
-    });
-
-    assert.strictEqual(new View().el.className, 'class');
-    assert.strictEqual(new View().el.id, 'id');
-  });
-
-  QUnit.test('with attributes as a function', function(assert) {
-    assert.expect(1);
-    var View = Backbone.View.extend({
-      attributes: function() {
-        return {'class': 'dynamic'};
-      }
-    });
-
-    assert.strictEqual(new View().el.className, 'dynamic');
-  });
-
-  QUnit.test('should default to className/id properties', function(assert) {
-    assert.expect(4);
-    var View = Backbone.View.extend({
-      className: 'backboneClass',
-      id: 'backboneId',
-      attributes: {
-        'class': 'attributeClass',
-        'id': 'attributeId'
-      }
-    });
-
-    var myView = new View;
-    assert.strictEqual(myView.el.className, 'backboneClass');
-    assert.strictEqual(myView.el.id, 'backboneId');
-    assert.strictEqual(myView.$el.attr('class'), 'backboneClass');
-    assert.strictEqual(myView.$el.attr('id'), 'backboneId');
-  });
-
-  QUnit.test('multiple views per element', function(assert) {
-    assert.expect(3);
-    var count = 0;
-    var $el = $('<p></p>');
-
-    var View = Backbone.View.extend({
-      el: $el,
-      events: {
-        click: function() {
-          count++;
-        }
-      }
-    });
-
-    var view1 = new View;
-    $el.trigger('click');
-    assert.equal(1, count);
-
-    var view2 = new View;
-    $el.trigger('click');
-    assert.equal(3, count);
-
-    view1.delegateEvents();
-    $el.trigger('click');
-    assert.equal(5, count);
-  });
-
-  QUnit.test('custom events', function(assert) {
-    assert.expect(2);
-    var View = Backbone.View.extend({
-      el: $('body'),
-      events: {
-        fake$event: function() { assert.ok(true); }
-      }
-    });
-
-    var myView = new View;
-    $('body').trigger('fake$event').trigger('fake$event');
-
-    $('body').off('fake$event');
-    $('body').trigger('fake$event');
-  });
-
-  QUnit.test('#1048 - setElement uses provided object.', function(assert) {
-    assert.expect(2);
-    var $el = $('body');
-
-    var myView = new Backbone.View({el: $el});
-    assert.ok(myView.$el === $el);
-
-    myView.setElement($el = $($el));
-    assert.ok(myView.$el === $el);
-  });
-
-  QUnit.test('#986 - Undelegate before changing element.', function(assert) {
-    assert.expect(1);
-    var button1 = $('<button></button>');
-    var button2 = $('<button></button>');
-
-    var View = Backbone.View.extend({
-      events: {
-        click: function(e) {
-          assert.ok(myView.el === e.target);
-        }
-      }
-    });
-
-    var myView = new View({el: button1});
-    myView.setElement(button2);
-
-    button1.trigger('click');
-    button2.trigger('click');
-  });
-
-  QUnit.test('#1172 - Clone attributes object', function(assert) {
-    assert.expect(2);
-    var View = Backbone.View.extend({
-      attributes: {foo: 'bar'}
-    });
-
-    var view1 = new View({id: 'foo'});
-    assert.strictEqual(view1.el.id, 'foo');
-
-    var view2 = new View();
-    assert.ok(!view2.el.id);
-  });
-
-  QUnit.test('views stopListening', function(assert) {
-    assert.expect(0);
-    var View = Backbone.View.extend({
-      initialize: function() {
-        this.listenTo(this.model, 'all x', function(){ assert.ok(false); });
-        this.listenTo(this.collection, 'all x', function(){ assert.ok(false); });
-      }
-    });
-
-    var myView = new View({
-      model: new Backbone.Model,
-      collection: new Backbone.Collection
-    });
-
-    myView.stopListening();
-    myView.model.trigger('x');
-    myView.collection.trigger('x');
-  });
-
-  QUnit.test('Provide function for el.', function(assert) {
-    assert.expect(2);
-    var View = Backbone.View.extend({
-      el: function() {
-        return '<p><a></a></p>';
-      }
-    });
-
-    var myView = new View;
-    assert.ok(myView.$el.is('p'));
-    assert.ok(myView.$el.has('a'));
-  });
-
-  QUnit.test('events passed in options', function(assert) {
-    assert.expect(1);
-    var counter = 0;
-
-    var View = Backbone.View.extend({
-      el: '#testElement',
-      increment: function() {
-        counter++;
-      }
-    });
-
-    var myView = new View({
-      events: {
-        'click h1': 'increment'
-      }
-    });
-
-    myView.$('h1').trigger('click').trigger('click');
-    assert.equal(counter, 2);
-  });
-
-  QUnit.test('remove', function(assert) {
-    assert.expect(2);
-    var myView = new Backbone.View;
-    document.body.appendChild(view.el);
-
-    myView.delegate('click', function() { assert.ok(false); });
-    myView.listenTo(myView, 'all x', function() { assert.ok(false); });
-
-    assert.equal(myView.remove(), myView, '#remove returns the view instance');
-    myView.$el.trigger('click');
-    myView.trigger('x');
-
-    // In IE8 and below, parentNode still exists but is not document.body.
-    assert.notEqual(myView.el.parentNode, document.body);
-  });
-
-  QUnit.test('setElement', function(assert) {
-    assert.expect(3);
-    var myView = new Backbone.View({
-      events: {
-        click: function() { assert.ok(false); }
-      }
-    });
-    myView.events = {
-      click: function() { assert.ok(true); }
-    };
-    var oldEl = myView.el;
-    var $oldEl = myView.$el;
-
-    myView.setElement(document.createElement('div'));
-
-    $oldEl.click();
-    myView.$el.click();
-
-    assert.notEqual(oldEl, myView.el);
-    assert.notEqual($oldEl, myView.$el);
-  });
-
-})();
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/license.txt b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/license.txt
deleted file mode 100644
index ba43b75..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/license.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-Software License Agreement (BSD License)
-
-Copyright (c) 2007, Parakey Inc.
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above
-  copyright notice, this list of conditions and the
-  following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-  copyright notice, this list of conditions and the
-  following disclaimer in the documentation and/or other
-  materials provided with the distribution.
-
-* Neither the name of Parakey Inc. nor the names of its
-  contributors may be used to endorse or promote products
-  derived from this software without specific prior
-  written permission of Parakey Inc.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/blank.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/blank.gif
deleted file mode 100644
index 6865c96..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/blank.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/buttonBg.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/buttonBg.png
deleted file mode 100644
index f367b42..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/buttonBg.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/buttonBgHover.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/buttonBgHover.png
deleted file mode 100644
index cd37a0d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/buttonBgHover.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/debugger.css b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/debugger.css
deleted file mode 100644
index ba55c7e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/debugger.css
+++ /dev/null
@@ -1,331 +0,0 @@
-/* See license.txt for terms of usage */
-
-.panelNode-script {
-    overflow: hidden;
-    font-family: monospace;
-}
-
-/************************************************************************************************/
-
-.scriptTooltip {
-    position: fixed;
-    z-index: 2147483647;
-    padding: 2px 3px;
-    border: 1px solid #CBE087;
-    background: LightYellow;
-    font-family: monospace;
-    color: #000000;
-}
-
-/************************************************************************************************/
-
-.sourceBox {
-    /* TODO: xxxpedro problem with sourceBox and scrolling elements */
-    /*overflow: scroll; /* see issue 1479 */
-    position: absolute;
-    left: 0;
-    top: 0;
-    width: 100%;
-    height: 100%;
-}
-
-.sourceRow {
-    white-space: nowrap;
-    -moz-user-select: text;
-}
-
-.sourceRow.hovered {
-    background-color: #EEEEEE;
-}
-
-/************************************************************************************************/
-
-.sourceLine {
-    -moz-user-select: none;
-    margin-right: 10px;
-    border-right: 1px solid #CCCCCC;
-    padding: 0px 4px 0 20px;
-    background: #EEEEEE no-repeat 2px 0px;
-    color: #888888;
-    white-space: pre;
-    font-family: monospace; /* see issue 2953 */
-}
-
-.noteInToolTip { /* below sourceLine, so it overrides it */
-    background-color: #FFD472;
-}
-
-.useA11y .sourceBox .sourceViewport:focus .sourceLine {
-    background-color: #FFFFC0;
-    color: navy;
-    border-right: 1px solid black;
-}
-
-.useA11y .sourceBox .sourceViewport:focus {
-    outline: none;
-}
-
-.a11y1emSize {
-    width: 1em;
-    height: 1em;
-    position: absolute;
-}
-
-.useA11y .panelStatusLabel:focus {
-    outline-offset: -2px !important;
- }
-
-.sourceBox > .sourceRow > .sourceLine {
-    cursor: pointer;
-}
-
-.sourceLine:hover {
-    text-decoration: none;
-}
-
-.sourceRowText {
-    white-space: pre;
-}
-
-.sourceRow[exe_line="true"] {
-    outline: 1px solid #D9D9B6;
-    margin-right: 1px;
-    background-color: lightgoldenrodyellow;
-}
-
-.sourceRow[executable="true"] > .sourceLine {
-    content: "-";
-    color: #4AA02C;  /* Spring Green */
-    font-weight: bold;
-}
-
-.sourceRow[exe_line="true"] > .sourceLine {
-    background-image: url(chrome://firebug/skin/exe.png);
-    color: #000000;
-}
-
-.sourceRow[breakpoint="true"] > .sourceLine {
-    background-image: url(chrome://firebug/skin/breakpoint.png);
-}
-
-.sourceRow[breakpoint="true"][condition="true"] > .sourceLine {
-    background-image: url(chrome://firebug/skin/breakpointCondition.png);
-}
-
-.sourceRow[breakpoint="true"][disabledBreakpoint="true"] > .sourceLine {
-    background-image: url(chrome://firebug/skin/breakpointDisabled.png);
-}
-
-.sourceRow[breakpoint="true"][exe_line="true"] > .sourceLine {
-    background-image: url(chrome://firebug/skin/breakpointExe.png);
-}
-
-.sourceRow[breakpoint="true"][exe_line="true"][disabledBreakpoint="true"] > .sourceLine {
-    background-image: url(chrome://firebug/skin/breakpointDisabledExe.png);
-}
-
-.sourceLine.editing {
-    background-image: url(chrome://firebug/skin/breakpoint.png);
-}
-
-/************************************************************************************************/
-
-.conditionEditor {
-    z-index: 2147483647;
-    position: absolute;
-    margin-top: 0;
-    left: 2px;
-    width: 90%;
-}
-
-.conditionEditorInner {
-    position: relative;
-    top: -26px;
-    height: 0;
-}
-
-.conditionCaption {
-    margin-bottom: 2px;
-    font-family: Lucida Grande, sans-serif;
-    font-weight: bold;
-    font-size: 11px;
-    color: #226679;
-}
-
-.conditionInput {
-    width: 100%;
-    border: 1px solid #0096C0;
-    font-family: monospace;
-    font-size: inherit;
-}
-
-.conditionEditorInner1 {
-    padding-left: 37px;
-    background: url(condBorders.png) repeat-y;
-}
-
-.conditionEditorInner2 {
-    padding-right: 25px;
-    background: url(condBorders.png) repeat-y 100% 0;
-}
-
-.conditionEditorTop1 {
-    background: url(condCorners.png) no-repeat 100% 0;
-    margin-left: 37px;
-    height: 35px;
-}
-
-.conditionEditorTop2 {
-    position: relative;
-    left: -37px;
-    width: 37px;
-    height: 35px;
-    background: url(condCorners.png) no-repeat;
-}
-
-.conditionEditorBottom1 {
-    background: url(condCorners.png) no-repeat 100% 100%;
-    margin-left: 37px;
-    height: 33px;
-}
-
-.conditionEditorBottom2 {
-    position: relative;    left: -37px;
-    width: 37px;
-    height: 33px;
-    background: url(condCorners.png) no-repeat 0 100%;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.upsideDown {
-    margin-top: 2px;
-}
-
-.upsideDown .conditionEditorInner {
-    top: -8px;
-}
-
-.upsideDown .conditionEditorInner1 {
-    padding-left: 33px;
-    background: url(condBordersUps.png) repeat-y;
-}
-
-.upsideDown .conditionEditorInner2 {
-    padding-right: 25px;
-    background: url(condBordersUps.png) repeat-y 100% 0;
-}
-
-.upsideDown .conditionEditorTop1 {
-    background: url(condCornersUps.png) no-repeat 100% 0;
-    margin-left: 33px;
-    height: 25px;
-}
-
-.upsideDown .conditionEditorTop2 {
-    position: relative;
-    left: -33px;
-    width: 33px;
-    height: 25px;
-    background: url(condCornersUps.png) no-repeat;
-}
-
-.upsideDown .conditionEditorBottom1 {
-    background: url(condCornersUps.png) no-repeat 100% 100%;
-    margin-left: 33px;
-    height: 43px;
-}
-
-.upsideDown .conditionEditorBottom2 {
-    position: relative;
-    left: -33px;
-    width: 33px;
-    height: 43px;
-    background: url(condCornersUps.png) no-repeat 0 100%;
-}
-
-/************************************************************************************************/
-
-.breakpointsGroupListBox {
-  overflow: hidden;
-}
-
-.breakpointBlockHead {
-    position: relative;
-    padding-top: 4px;
-}
-
-.breakpointBlockHead > .checkbox {
-    margin-right: 4px;
-}
-
-.breakpointBlockHead > .objectLink-sourceLink {
-    top: 4px;
-    right: 20px;
-    background-color: #FFFFFF; /* issue 3308 */
-}
-
-.breakpointBlockHead > .closeButton {
-    position: absolute;
-    top: 2px;
-    right: 2px;
-}
-
-.breakpointCheckbox {
-    margin-top: 0;
-    vertical-align: top;
-}
-
-.breakpointName {
-    margin-left: 4px;
-    font-weight: bold;
-}
-
-.breakpointRow[aria-checked="false"] > .breakpointBlockHead > *,
-.breakpointRow[aria-checked="false"] > .breakpointCode {
-    opacity: 0.5;
-}
-
-.breakpointRow[aria-checked="false"] .breakpointCheckbox,
-.breakpointRow[aria-checked="false"] .objectLink-sourceLink,
-.breakpointRow[aria-checked="false"] .closeButton,
-.breakpointRow[aria-checked="false"] .breakpointMutationType {
-    opacity: 1.0 !important;
-}
-
-.breakpointCode {
-    overflow: hidden;
-    white-space: nowrap;
-    padding-left: 24px;
-    padding-bottom: 2px;
-    border-bottom: 1px solid #D7D7D7;
-    font-family: monospace;
-    color: DarkGreen;
-}
-
-.breakpointCondition {
-    white-space: nowrap;
-    padding-left: 24px;
-    padding-bottom: 2px;
-    border-bottom: 1px solid #D7D7D7;
-    font-family: monospace;
-    color: Gray;
-}
-
-.breakpointBlock-breakpoints > .groupHeader {
-    display: none;
-}
-
-.breakpointBlock-monitors > .breakpointCode {
-    padding: 0;
-}
-
-.breakpointBlock-errorBreakpoints .breakpointCheckbox,
-.breakpointBlock-monitors .breakpointCheckbox {
-    display: none;
-}
-
-.breakpointHeader {
-    margin: 0 !important;
-    border-top: none !important;
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/detach.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/detach.png
deleted file mode 100644
index 0ddb9a1..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/detach.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/detachHover.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/detachHover.png
deleted file mode 100644
index e419272..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/detachHover.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disable.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disable.gif
deleted file mode 100644
index dd9eb0e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disable.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disable.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disable.png
deleted file mode 100644
index c28bcdf..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disable.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disableHover.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disableHover.gif
deleted file mode 100644
index 70565a8..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disableHover.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disableHover.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disableHover.png
deleted file mode 100644
index 26fe375..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/disableHover.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/down.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/down.png
deleted file mode 100644
index acbbd30..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/down.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/downActive.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/downActive.png
deleted file mode 100644
index f4312b2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/downActive.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/downHover.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/downHover.png
deleted file mode 100644
index 8144e63..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/downHover.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/errorIcon-sm.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/errorIcon-sm.png
deleted file mode 100644
index 0c377e3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/errorIcon-sm.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/errorIcon.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/errorIcon.gif
deleted file mode 100644
index 8ee8116..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/errorIcon.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/errorIcon.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/errorIcon.png
deleted file mode 100644
index 2d75261..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/errorIcon.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug-1.3a2.css b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug-1.3a2.css
deleted file mode 100644
index 42f9faf..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug-1.3a2.css
+++ /dev/null
@@ -1,817 +0,0 @@
-.fbBtnPressed {
-    background: #ECEBE3;
-    padding: 3px 6px 2px 7px !important;
-    margin: 1px 0 0 1px;
-    _margin: 1px -1px 0 1px;
-    border: 1px solid #ACA899 !important;
-    border-color: #ACA899 #ECEBE3 #ECEBE3 #ACA899 !important;
-}
-
-.fbToolbarButtons {
-    display: none;
-}
-
-#fbStatusBarBox {
-    display: none;
-}
-
-/************************************************************************************************
- Error Popup
-*************************************************************************************************/
-#fbErrorPopup {
-    position: absolute;
-    right: 0;
-    bottom: 0;
-    height: 19px;
-    width: 75px;
-    background: url(sprite.png) #f1f2ee 0 0;
-    z-index: 999;
-}
-
-#fbErrorPopupContent {
-    position: absolute;
-    right: 0;
-    top: 1px;
-    height: 18px;
-    width: 75px;
-    _width: 74px;
-    border-left: 1px solid #aca899;
-}
-
-#fbErrorIndicator {
-    position: absolute;
-    top: 2px;
-    right: 5px;
-}
-
-
-
-
-
-
-
-
-
-
-.fbBtnInspectActive {
-    background: #aaa;
-    color: #fff !important;
-}
-
-/************************************************************************************************
- General
-*************************************************************************************************/
-html, body {
-    margin: 0;
-    padding: 0;
-    overflow: hidden;
-}
-
-body {
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    font-size: 11px;
-    background: #fff;    
-}
-
-.clear {
-    clear: both;
-}
-
-/************************************************************************************************
- Mini Chrome
-*************************************************************************************************/
-#fbMiniChrome {
-    display: none;
-    right: 0;
-    height: 27px;
-    background: url(sprite.png) #f1f2ee 0 0;
-    margin-left: 1px;
-}
-
-#fbMiniContent {
-    display: block;
-    position: relative;
-    left: -1px;
-    right: 0;
-    top: 1px;
-    height: 25px;
-    border-left: 1px solid #aca899;
-}
-
-#fbToolbarSearch {
-    float: right;
-    border: 1px solid #ccc;
-    margin: 0 5px 0 0;
-    background: #fff url(search.png) no-repeat 4px 2px;
-    padding-left: 20px;    
-    font-size: 11px;
-}
-
-#fbToolbarErrors {
-    float: right;
-    margin: 1px 4px 0 0;
-    font-size: 11px;
-}
-
-#fbLeftToolbarErrors {
-    float: left;
-    margin: 7px 0px 0 5px;
-    font-size: 11px;
-}
-
-.fbErrors {
-    padding-left: 20px;
-    height: 14px;
-    background: url(errorIcon.png) no-repeat;
-    color: #f00;
-    font-weight: bold;    
-}
-
-#fbMiniErrors {
-    display: inline;
-    display: none;
-    float: right;
-    margin: 5px 2px 0 5px;
-}
-
-#fbMiniIcon {
-    float: right;
-    margin: 3px 4px 0;
-    height: 20px;
-    width: 20px;
-    float: right;    
-    background: url(sprite.png) 0 -135px;
-    cursor: pointer;
-}
-
-
-/************************************************************************************************
- Master Layout
-*************************************************************************************************/
-#fbChrome {
-    position: fixed;
-    overflow: hidden;
-    height: 100%;
-    width: 100%;
-    border-collapse: collapse;
-    background: #fff;
-}
-
-#fbTop {
-    height: 49px;
-}
-
-#fbToolbar {
-    position: absolute;
-    z-index: 5;
-    width: 100%;
-    top: 0;
-    background: url(sprite.png) #f1f2ee 0 0;
-    height: 27px;
-    font-size: 11px;
-    overflow: hidden;
-}
-
-#fbPanelBarBox {
-    top: 27px;
-    position: absolute;
-    z-index: 8;
-    width: 100%;
-    background: url(sprite.png) #dbd9c9 0 -27px;
-    height: 22px;
-}
-
-#fbContent {
-    height: 100%;
-    vertical-align: top;
-}
-
-#fbBottom {
-    height: 18px;
-    background: #fff;
-}
-
-/************************************************************************************************
- Sub-Layout 
-*************************************************************************************************/
-
-/* fbToolbar 
-*************************************************************************************************/
-#fbToolbarIcon {
-    float: left;
-    padding: 4px 5px 0;
-}
-
-#fbToolbarIcon a {
-    display: block;
-    height: 20px;
-    width: 20px;
-    background: url(sprite.png) 0 -135px;
-    text-decoration: none;
-    cursor: default;
-}
-
-#fbToolbarButtons {
-    float: left;
-    padding: 4px 2px 0 5px;
-}
-
-#fbToolbarButtons a {
-    text-decoration: none;
-    display: block;
-    float: left;
-    color: #000;
-    padding: 4px 8px 4px;
-    cursor: default;
-}
-
-#fbToolbarButtons a:hover {
-    color: #333;
-    padding: 3px 7px 3px;
-    border: 1px solid #fff;
-    border-bottom: 1px solid #bbb;
-    border-right: 1px solid #bbb;
-}
-
-#fbStatusBarBox {
-    position: relative;
-    top: 5px;
-    line-height: 19px;
-    cursor: default;    
-}
-
-.fbToolbarSeparator{
-    overflow: hidden;
-    border: 1px solid;
-    border-color: transparent #fff transparent #777;
-    _border-color: #eee #fff #eee #777;
-    height: 7px;
-    margin: 10px 6px 0 0;
-    float: left;
-}
-
-.fbStatusBar span {
-    color: #808080;
-    padding: 0 4px 0 0;
-}
-
-.fbStatusBar span a {
-    text-decoration: none;
-    color: black;
-}
-
-.fbStatusBar span a:hover {
-    color: blue;
-    cursor: pointer;    
-}
-
-
-#fbWindowButtons {
-    position: absolute;
-    white-space: nowrap;
-    right: 0;
-    top: 0;
-    height: 17px;
-    _width: 50px;
-    padding: 5px 0 5px 5px;
-    z-index: 6;
-    background: url(sprite.png) #f1f2ee 0 0;
-}
-
-/* fbPanelBarBox
-*************************************************************************************************/
-
-#fbPanelBar1 {
-    width: 255px; /* fixed width to avoid tabs breaking line */
-    z-index: 8;
-    left: 0;
-    white-space: nowrap;
-    background: url(sprite.png) #dbd9c9 0 -27px;
-    position: absolute;
-    left: 4px;
-}
-
-#fbPanelBar2Box {
-    background: url(sprite.png) #dbd9c9 0 -27px;
-    position: absolute;
-    height: 22px;
-    width: 300px; /* fixed width to avoid tabs breaking line */
-    z-index: 9;
-    right: 0;
-}
-
-#fbPanelBar2 {
-    position: absolute;
-    width: 290px; /* fixed width to avoid tabs breaking line */
-    height: 22px;
-    padding-left: 10px;
-}
-
-/* body 
-*************************************************************************************************/
-.fbPanel {
-    display: none;
-}
-
-#fbPanelBox1, #fbPanelBox2 {
-    max-height: inherit;
-    height: 100%;
-    font-size: 11px;
-}
-
-#fbPanelBox2 {
-    background: #fff;
-}
-
-#fbPanelBox2 {
-    width: 300px;
-    background: #fff;
-}
-
-#fbPanel2 {
-    padding-left: 6px;
-    background: #fff;
-}
-
-.hide {
-    overflow: hidden !important;
-    position: fixed !important;
-    display: none !important;
-    visibility: hidden !important;
-}
-
-/* fbBottom 
-*************************************************************************************************/
-
-#fbCommand {
-    height: 18px;
-}
-
-#fbCommandBox {
-    position: absolute;
-    width: 100%;
-    height: 18px;
-    bottom: 0;
-    overflow: hidden;
-    z-index: 9;
-    background: #fff;
-    border: 0;
-    border-top: 1px solid #ccc;
-}
-
-#fbCommandIcon {
-    position: absolute;
-    color: #00f;
-    top: 2px;
-    left: 7px;
-    display: inline;
-    font: 11px Monaco, monospace;
-    z-index: 10;
-}
-
-#fbCommandLine {
-    position: absolute;
-    width: 100%;
-    top: 0;
-    left: 0;
-    border: 0;
-    margin: 0;
-    padding: 2px 0 2px 32px;
-    font: 11px Monaco, monospace;
-    z-index: 9;
-}
-
-div.fbFitHeight {
-    overflow: auto;
-    _position: absolute;
-}
-
-
-/************************************************************************************************
- Layout Controls
-*************************************************************************************************/
-
-/* fbToolbar buttons 
-*************************************************************************************************/
-#fbWindowButtons a {
-    font-size: 1px;
-    width: 16px;
-    height: 16px;
-    display: block;
-    float: right;
-    margin-right: 4px;
-    text-decoration: none;
-    cursor: default;
-}
-
-#fbWindow_btClose {
-    background: url(sprite.png) 0 -119px;
-}
-
-#fbWindow_btClose:hover {
-    background: url(sprite.png) -16px -119px;
-}
-
-#fbWindow_btDetach {
-    background: url(sprite.png) -32px -119px;
-}
-
-#fbWindow_btDetach:hover {
-    background: url(sprite.png) -48px -119px;
-}
-
-/* fbPanelBarBox tabs 
-*************************************************************************************************/
-.fbTab {
-    text-decoration: none;
-    display: none;
-    float: left;
-    width: auto;
-    float: left;
-    cursor: default;
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    font-size: 11px;
-    font-weight: bold;
-    height: 22px;
-    color: #565656;
-}
-
-.fbPanelBar span {
-    display: block;
-    float: left;
-}
-
-.fbPanelBar .fbTabL,.fbPanelBar .fbTabR {
-    height: 22px;
-    width: 8px;
-}
-
-.fbPanelBar .fbTabText {
-    padding: 4px 1px 0;
-}
-
-a.fbTab:hover {
-    background: url(sprite.png) 0 -73px;
-}
-
-a.fbTab:hover .fbTabL {
-    background: url(sprite.png) -16px -96px;
-}
-
-a.fbTab:hover .fbTabR {
-    background: url(sprite.png) -24px -96px;
-}
-
-.fbSelectedTab {
-    background: url(sprite.png) #f1f2ee 0 -50px !important;
-    color: #000;
-}
-
-.fbSelectedTab .fbTabL {
-    background: url(sprite.png) 0 -96px !important;
-}
-
-.fbSelectedTab .fbTabR {
-    background: url(sprite.png) -8px -96px !important;
-}
-
-/* splitters 
-*************************************************************************************************/
-#fbHSplitter {
-    position: absolute;
-    left: 0;
-    top: 0;
-    width: 100%;
-    height: 5px;
-    overflow: hidden;
-    cursor: n-resize !important;
-    background: url(pixel_transparent.gif);
-    z-index: 9;
-}
-
-#fbHSplitter.fbOnMovingHSplitter {
-    height: 100%;
-    z-index: 100;
-}
-
-.fbVSplitter {
-    background: #ece9d8;
-    color: #000;
-    border: 1px solid #716f64;
-    border-width: 0 1px;
-    border-left-color: #aca899;
-    width: 4px;
-    cursor: e-resize;
-    overflow: hidden;
-    right: 294px;
-    text-decoration: none;
-    z-index: 9;
-    position: absolute;
-    height: 100%;
-    top: 27px;
-    _width: 6px;
-}
-
-/************************************************************************************************/
-div.lineNo {
-    font: 11px Monaco, monospace;
-    float: left;
-    display: inline;
-    position: relative;
-    margin: 0;
-    padding: 0 5px 0 20px;
-    background: #eee;
-    color: #888;
-    border-right: 1px solid #ccc;
-    text-align: right;
-}
-
-pre.nodeCode {
-    font: 11px Monaco, monospace;
-    margin: 0;
-    padding-left: 10px;
-    overflow: hidden;
-    /*
-    _width: 100%;
-    /**/
-}
-
-/************************************************************************************************/
-.nodeControl {
-    margin-top: 3px;
-    margin-left: -14px;
-    float: left;
-    width: 9px;
-    height: 9px;
-    overflow: hidden;
-    cursor: default;
-    background: url(tree_open.gif);
-    _float: none;
-    _display: inline;
-    _position: absolute;
-}
-
-div.nodeMaximized {
-    background: url(tree_close.gif);
-}
-
-div.objectBox-element {
-    padding: 1px 3px;
-}
-.objectBox-selector{
-    cursor: default;
-}
-
-.selectedElement{
-    background: highlight;
-    /* background: url(roundCorner.svg); Opera */
-    color: #fff !important;
-}
-.selectedElement span{
-    color: #fff !important;
-}
-
-/* Webkit CSS Hack - bug in "highlight" named color */ 
-@media screen and (-webkit-min-device-pixel-ratio:0) {
-    .selectedElement{
-      background: #316AC5;
-      color: #fff !important;
-    }
-}
-
-/************************************************************************************************/
-/************************************************************************************************/
-.logRow * {
-    font-size: 11px;
-}
-
-.logRow {
-    position: relative;
-    border-bottom: 1px solid #D7D7D7;
-    padding: 2px 4px 1px 6px;
-    background-color: #FFFFFF;
-}
-
-.logRow-command {
-    font-family: Monaco, monospace;
-    color: blue;
-}
-
-.objectBox-string,
-.objectBox-text,
-.objectBox-number,
-.objectBox-function,
-.objectLink-element,
-.objectLink-textNode,
-.objectLink-function,
-.objectBox-stackTrace,
-.objectLink-profile {
-    font-family: Monaco, monospace;
-}
-
-.objectBox-null {
-    padding: 0 2px;
-    border: 1px solid #666666;
-    background-color: #888888;
-    color: #FFFFFF;
-}
-
-.objectBox-string {
-    color: red;
-    white-space: pre;
-}
-
-.objectBox-number {
-    color: #000088;
-}
-
-.objectBox-function {
-    color: DarkGreen;
-}
-
-.objectBox-object {
-    color: DarkGreen;
-    font-weight: bold;
-    font-family: Lucida Grande, sans-serif;
-}
-
-.objectBox-array {
-    color: #000;
-}
-
-/************************************************************************************************/
-.logRow-info,.logRow-error,.logRow-warning {
-    background: #fff no-repeat 2px 2px;
-    padding-left: 20px;
-    padding-bottom: 3px;
-}
-
-.logRow-info {
-    background-image: url(infoIcon.png);
-}
-
-.logRow-warning {
-    background-color: cyan;
-    background-image: url(warningIcon.png);
-}
-
-.logRow-error {
-    background-color: LightYellow;
-    background-image: url(errorIcon.png);
-    color: #f00;
-}
-
-.errorMessage {
-    vertical-align: top;
-    color: #f00;
-}
-
-.objectBox-sourceLink {
-    position: absolute;
-    right: 4px;
-    top: 2px;
-    padding-left: 8px;
-    font-family: Lucida Grande, sans-serif;
-    font-weight: bold;
-    color: #0000FF;
-}
-
-/************************************************************************************************/
-.logRow-group {
-    background: #EEEEEE;
-    border-bottom: none;
-}
-
-.logGroup {
-    background: #EEEEEE;
-}
-
-.logGroupBox {
-    margin-left: 24px;
-    border-top: 1px solid #D7D7D7;
-    border-left: 1px solid #D7D7D7;
-}
-
-/************************************************************************************************/
-.selectorTag,.selectorId,.selectorClass {
-    font-family: Monaco, monospace;
-    font-weight: normal;
-}
-
-.selectorTag {
-    color: #0000FF;
-}
-
-.selectorId {
-    color: DarkBlue;
-}
-
-.selectorClass {
-    color: red;
-}
-
-/************************************************************************************************/
-.objectBox-element {
-    font-family: Monaco, monospace;
-    color: #000088;
-}
-
-.nodeChildren {
-    padding-left: 26px;
-}
-
-.nodeTag {
-    color: blue;
-    cursor: pointer;
-}
-
-.nodeValue {
-    color: #FF0000;
-    font-weight: normal;
-}
-
-.nodeText,.nodeComment {
-    margin: 0 2px;
-    vertical-align: top;
-}
-
-.nodeText {
-    color: #333333;
-    font-family: Monaco, monospace;
-}
-
-.nodeComment {
-    color: DarkGreen;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.nodeHidden, .nodeHidden * {
-    color: #888888;
-}
-
-.nodeHidden .nodeTag {
-    color: #5F82D9;
-}
-
-.nodeHidden .nodeValue {
-    color: #D86060;
-}
-
-.selectedElement .nodeHidden, .selectedElement .nodeHidden * {
-    color: SkyBlue !important;
-}
-
-
-/************************************************************************************************/
-.log-object {
-    /*
-    _position: relative;
-    _height: 100%;
-    /**/
-}
-
-.property {
-    position: relative;
-    clear: both;
-    height: 15px;
-}
-
-.propertyNameCell {
-    vertical-align: top;
-    float: left;
-    width: 28%;
-    position: absolute;
-    left: 0;
-    z-index: 0;
-}
-
-.propertyValueCell {
-    float: right;
-    width: 68%;
-    background: #fff;
-    position: absolute;
-    padding-left: 5px;
-    display: table-cell;
-    right: 0;
-    z-index: 1;
-    /*
-    _position: relative;
-    /**/
-}
-
-.propertyName {
-    font-weight: bold;
-}
-
-.FirebugPopup {
-    height: 100% !important;
-}
-
-.FirebugPopup #fbWindowButtons {
-    display: none !important;
-}
-
-.FirebugPopup #fbHSplitter {
-    display: none !important;
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.IE6.css b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.IE6.css
deleted file mode 100644
index 13a41d2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.IE6.css
+++ /dev/null
@@ -1,20 +0,0 @@
-/************************************************************************************************/
-#fbToolbarSearch {
-    background-image: url(search.gif) !important;
-}
-/************************************************************************************************/
-.fbErrors {
-    background-image: url(errorIcon.gif) !important;
-}
-/************************************************************************************************/
-.logRow-info {
-    background-image: url(infoIcon.gif) !important;
-}
-
-.logRow-warning {
-    background-image: url(warningIcon.gif) !important;
-}
-
-.logRow-error {
-    background-image: url(errorIcon.gif) !important;
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.css b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.css
deleted file mode 100644
index a1465ec..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.css
+++ /dev/null
@@ -1,3147 +0,0 @@
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/* Loose */
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*
-.netInfoResponseHeadersTitle, netInfoResponseHeadersBody {
-    display: none;
-}
-/**/
-
-.obscured {
-    left: -999999px !important;
-}
-
-/* IE6 need a separated rule, otherwise it will not recognize it */
-.collapsed {
-    display: none;
-}
-
-[collapsed="true"] {
-    display: none;
-}
-
-#fbCSS {
-    padding: 0 !important;
-}
-
-.cssPropDisable {
-    float: left;
-    display: block;
-    width: 2em;
-    cursor: default;
-}
-
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/* panelBase */
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-
-/************************************************************************************************/
-
-.infoTip {
-    z-index: 2147483647;
-    position: fixed;
-    padding: 2px 3px;
-    border: 1px solid #CBE087;
-    background: LightYellow;
-    font-family: Monaco, monospace;
-    color: #000000;
-    display: none;
-    white-space: nowrap;
-    pointer-events: none;
-}
-
-.infoTip[active="true"] {
-    display: block;
-}
-
-.infoTipLoading {
-    width: 16px;
-    height: 16px;
-    background: url(chrome://firebug/skin/loading_16.gif) no-repeat;
-}
-
-.infoTipImageBox {
-	font-size: 11px;
-    min-width: 100px;
-    text-align: center;
-}
-
-.infoTipCaption {
-	font-size: 11px;
-    font: Monaco, monospace;
-}
-
-.infoTipLoading > .infoTipImage,
-.infoTipLoading > .infoTipCaption {
-    display: none;
-}
-
-/************************************************************************************************/
-
-h1.groupHeader {
-    padding: 2px 4px;
-    margin: 0 0 4px 0;
-    border-top: 1px solid #CCCCCC;
-    border-bottom: 1px solid #CCCCCC;
-    background: #eee url(group.gif) repeat-x;
-    font-size: 11px;
-    font-weight: bold;
-    _position: relative;
-}
-
-/************************************************************************************************/
-
-.inlineEditor,
-.fixedWidthEditor {
-    z-index: 2147483647;
-    position: absolute;
-    display: none;
-}
-
-.inlineEditor {
-    margin-left: -6px;
-    margin-top: -3px;
-    /*
-    _margin-left: -7px;
-    _margin-top: -5px;
-    /**/
-}
-
-.textEditorInner,
-.fixedWidthEditor {
-    margin: 0 0 0 0 !important;
-    padding: 0;
-    border: none !important;
-    font: inherit;
-    text-decoration: inherit;
-    background-color: #FFFFFF;
-}
-
-.fixedWidthEditor {
-    border-top: 1px solid #888888 !important;
-    border-bottom: 1px solid #888888 !important;
-}
-
-.textEditorInner {
-    position: relative;
-    top: -7px;
-    left: -5px;
-    
-    outline: none;
-    resize: none;
-    
-    /*
-    _border: 1px solid #999 !important;
-    _padding: 1px !important;
-    _filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color="#55404040");
-    /**/
-}
-
-.textEditorInner1 {
-    padding-left: 11px;
-    background: url(textEditorBorders.png) repeat-y;
-    _background: url(textEditorBorders.gif) repeat-y;
-    _overflow: hidden;
-}
-
-.textEditorInner2 {
-    position: relative;
-    padding-right: 2px;
-    background: url(textEditorBorders.png) repeat-y 100% 0;
-    _background: url(textEditorBorders.gif) repeat-y 100% 0;
-    _position: fixed;
-}
-
-.textEditorTop1 {
-    background: url(textEditorCorners.png) no-repeat 100% 0;
-    margin-left: 11px;
-    height: 10px;
-    _background: url(textEditorCorners.gif) no-repeat 100% 0;
-    _overflow: hidden;
-}
-
-.textEditorTop2 {
-    position: relative;
-    left: -11px;
-    width: 11px;
-    height: 10px;
-    background: url(textEditorCorners.png) no-repeat;
-    _background: url(textEditorCorners.gif) no-repeat;
-}
-
-.textEditorBottom1 {
-    position: relative;
-    background: url(textEditorCorners.png) no-repeat 100% 100%;
-    margin-left: 11px;
-    height: 12px;
-    _background: url(textEditorCorners.gif) no-repeat 100% 100%;
-}
-
-.textEditorBottom2 {
-    position: relative;
-    left: -11px;
-    width: 11px;
-    height: 12px;
-    background: url(textEditorCorners.png) no-repeat 0 100%;
-    _background: url(textEditorCorners.gif) no-repeat 0 100%;
-}
-
-
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/* CSS */
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-
-/* See license.txt for terms of usage */
-
-.panelNode-css {
-    overflow-x: hidden;
-}
-
-.cssSheet > .insertBefore {
-    height: 1.5em;
-}
-
-.cssRule {
-    position: relative;
-    margin: 0;
-    padding: 1em 0 0 6px;
-    font-family: Monaco, monospace;
-    color: #000000;
-}
-
-.cssRule:first-child {
-    padding-top: 6px;
-}
-
-.cssElementRuleContainer {
-    position: relative;
-}
-
-.cssHead {
-    padding-right: 150px;
-}
-
-.cssProp {
-    /*padding-left: 2em;*/
-}
-
-.cssPropName {
-    color: DarkGreen;
-}
-
-.cssPropValue {
-    margin-left: 8px;
-    color: DarkBlue;
-}
-
-.cssOverridden span {
-    text-decoration: line-through;
-}
-
-.cssInheritedRule {
-}
-
-.cssInheritLabel {
-    margin-right: 0.5em;
-    font-weight: bold;
-}
-
-.cssRule .objectLink-sourceLink {
-    top: 0;
-}
-
-.cssProp.editGroup:hover {
-    background: url(disable.png) no-repeat 2px 1px;
-    _background: url(disable.gif) no-repeat 2px 1px;
-}
-
-.cssProp.editGroup.editing {
-    background: none;
-}
-
-.cssProp.disabledStyle {
-    background: url(disableHover.png) no-repeat 2px 1px;
-    _background: url(disableHover.gif) no-repeat 2px 1px;
-    opacity: 1;
-    color: #CCCCCC;
-}
-
-.disabledStyle .cssPropName,
-.disabledStyle .cssPropValue {
-    color: #CCCCCC;
-}
-
-.cssPropValue.editing + .cssSemi,
-.inlineExpander + .cssSemi {
-    display: none;
-}
-
-.cssPropValue.editing {
-    white-space: nowrap;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.stylePropName {
-    font-weight: bold;
-    padding: 0 4px 4px 4px;
-    width: 50%;
-}
-
-.stylePropValue {
-    width: 50%;
-}
-/*
-.useA11y .a11yCSSView .focusRow:focus {
-    outline: none;
-    background-color: transparent
- }
- 
- .useA11y .a11yCSSView .focusRow:focus .cssSelector, 
- .useA11y .a11yCSSView .focusRow:focus .cssPropName, 
- .useA11y .a11yCSSView .focusRow:focus .cssPropValue,
- .useA11y .a11yCSSView .computedStyleRow:focus, 
- .useA11y .a11yCSSView .groupHeader:focus {
-    outline: 2px solid #FF9933;
-    outline-offset: -2px;
-    background-color: #FFFFD6;
- }
- 
- .useA11y .a11yCSSView .groupHeader:focus {
-    outline-offset: -2px;
- }
-/**/
-
-
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/* Net */
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-
-/* See license.txt for terms of usage */
-
-.panelNode-net {
-    overflow-x: hidden;
-}
-
-.netTable {
-    width: 100%;
-}
-
-/************************************************************************************************/
-
-.hideCategory-undefined .category-undefined,
-.hideCategory-html .category-html,
-.hideCategory-css .category-css,
-.hideCategory-js .category-js,
-.hideCategory-image .category-image,
-.hideCategory-xhr .category-xhr,
-.hideCategory-flash .category-flash,
-.hideCategory-txt .category-txt,
-.hideCategory-bin .category-bin {
-    display: none;
-}
-
-/************************************************************************************************/
-
-.netHeadRow {
-    background: url(chrome://firebug/skin/group.gif) repeat-x #FFFFFF;
-}
-
-.netHeadCol {
-    border-bottom: 1px solid #CCCCCC;
-    padding: 2px 4px 2px 18px;
-    font-weight: bold;
-}
-
-.netHeadLabel {
-    white-space: nowrap;
-    overflow: hidden;
-}
-
-/************************************************************************************************/
-/* Header for Net panel table */
-
-.netHeaderRow {
-    height: 16px;
-}
-
-.netHeaderCell {
-    cursor: pointer;
-    -moz-user-select: none;
-    border-bottom: 1px solid #9C9C9C;
-    padding: 0 !important;
-    font-weight: bold;
-    background: #BBBBBB url(chrome://firebug/skin/tableHeader.gif) repeat-x;
-    white-space: nowrap;
-}
-
-.netHeaderRow > .netHeaderCell:first-child > .netHeaderCellBox {
-    padding: 2px 14px 2px 18px;
-}
-
-.netHeaderCellBox {
-    padding: 2px 14px 2px 10px;
-    border-left: 1px solid #D9D9D9;
-    border-right: 1px solid #9C9C9C;
-}
-
-.netHeaderCell:hover:active {
-    background: #959595 url(chrome://firebug/skin/tableHeaderActive.gif) repeat-x;
-}
-
-.netHeaderSorted {
-    background: #7D93B2 url(chrome://firebug/skin/tableHeaderSorted.gif) repeat-x;
-}
-
-.netHeaderSorted > .netHeaderCellBox {
-    border-right-color: #6B7C93;
-    background: url(chrome://firebug/skin/arrowDown.png) no-repeat right;
-}
-
-.netHeaderSorted.sortedAscending > .netHeaderCellBox {
-    background-image: url(chrome://firebug/skin/arrowUp.png);
-}
-
-.netHeaderSorted:hover:active {
-    background: #536B90 url(chrome://firebug/skin/tableHeaderSortedActive.gif) repeat-x;
-}
-
-/************************************************************************************************/
-/* Breakpoints */
-
-.panelNode-net .netRowHeader {
-    display: block;
-}
-
-.netRowHeader {
-    cursor: pointer;
-    display: none;
-    height: 15px;
-    margin-right: 0 !important;
-}
-
-/* Display brekpoint disc */
-.netRow .netRowHeader {
-    background-position: 5px 1px;
-}
-
-.netRow[breakpoint="true"] .netRowHeader {
-    background-image: url(chrome://firebug/skin/breakpoint.png);
-}
-
-.netRow[breakpoint="true"][disabledBreakpoint="true"] .netRowHeader {
-    background-image: url(chrome://firebug/skin/breakpointDisabled.png);
-}
-
-.netRow.category-xhr:hover .netRowHeader {
-    background-color: #F6F6F6;
-}
-
-#netBreakpointBar {
-    max-width: 38px;
-}
-
-#netHrefCol > .netHeaderCellBox {
-    border-left: 0px;
-}
-
-.netRow .netRowHeader {
-    width: 3px;
-}
-
-.netInfoRow .netRowHeader {
-    display: table-cell;
-}
-
-/************************************************************************************************/
-/* Column visibility */
-
-.netTable[hiddenCols~=netHrefCol] TD[id="netHrefCol"],
-.netTable[hiddenCols~=netHrefCol] TD.netHrefCol,
-.netTable[hiddenCols~=netStatusCol] TD[id="netStatusCol"],
-.netTable[hiddenCols~=netStatusCol] TD.netStatusCol,
-.netTable[hiddenCols~=netDomainCol] TD[id="netDomainCol"],
-.netTable[hiddenCols~=netDomainCol] TD.netDomainCol,
-.netTable[hiddenCols~=netSizeCol] TD[id="netSizeCol"],
-.netTable[hiddenCols~=netSizeCol] TD.netSizeCol,
-.netTable[hiddenCols~=netTimeCol] TD[id="netTimeCol"],
-.netTable[hiddenCols~=netTimeCol] TD.netTimeCol {
-    display: none;
-}
-
-/************************************************************************************************/
-
-.netRow {
-    background: LightYellow;
-}
-
-.netRow.loaded {
-    background: #FFFFFF;
-}
-
-.netRow.loaded:hover {
-    background: #EFEFEF;
-}
-
-.netCol {
-    padding: 0;
-    vertical-align: top;
-    border-bottom: 1px solid #EFEFEF;
-    white-space: nowrap;
-    height: 17px;
-}
-
-.netLabel {
-    width: 100%;
-}
-
-.netStatusCol {
-    padding-left: 10px;
-    color: rgb(128, 128, 128);
-}
-
-.responseError > .netStatusCol {
-    color: red;
-}
-
-.netDomainCol {
-    padding-left: 5px;
-}
-
-.netSizeCol {
-    text-align: right;
-    padding-right: 10px;
-}
-
-.netHrefLabel {
-    -moz-box-sizing: padding-box;
-    overflow: hidden;
-    z-index: 10;
-    position: absolute;
-    padding-left: 18px;
-    padding-top: 1px;
-    max-width: 15%;
-    font-weight: bold;
-}
-
-.netFullHrefLabel {
-    display: none;
-    -moz-user-select: none;
-    padding-right: 10px;
-    padding-bottom: 3px;
-    max-width: 100%;
-    background: #FFFFFF;
-    z-index: 200;
-}
-
-.netHrefCol:hover > .netFullHrefLabel {
-    display: block;
-}
-
-.netRow.loaded:hover .netCol > .netFullHrefLabel {
-    background-color: #EFEFEF;
-}
-
-.useA11y .a11yShowFullLabel {
-    display: block;
-    background-image: none !important;
-    border: 1px solid #CBE087;
-    background-color: LightYellow;
-    font-family: Monaco, monospace;
-    color: #000000;
-    font-size: 10px;
-    z-index: 2147483647;
-}
-
-.netSizeLabel {
-    padding-left: 6px;
-}
-
-.netStatusLabel,
-.netDomainLabel,
-.netSizeLabel,
-.netBar {
-    padding: 1px 0 2px 0 !important;
-}
-
-.responseError {
-    color: red;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.hasHeaders .netHrefLabel:hover {
-    cursor: pointer;
-    color: blue;
-    text-decoration: underline;
-}
-
-/************************************************************************************************/
-
-.netLoadingIcon {
-    position: absolute;
-    border: 0;
-    margin-left: 14px;
-    width: 16px;
-    height: 16px;
-    background: transparent no-repeat 0 0;
-    background-image: url(chrome://firebug/skin/loading_16.gif);
-    display:inline-block;
-}
-
-.loaded .netLoadingIcon {
-    display: none;
-}
-
-/************************************************************************************************/
-
-.netBar, .netSummaryBar {
-    position: relative;
-    border-right: 50px solid transparent;
-}
-
-.netResolvingBar {
-    position: absolute;
-    left: 0;
-    top: 0;
-    bottom: 0;
-    background: #FFFFFF url(chrome://firebug/skin/netBarResolving.gif) repeat-x;
-    z-index:60;
-}
-
-.netConnectingBar {
-    position: absolute;
-    left: 0;
-    top: 0;
-    bottom: 0;
-    background: #FFFFFF url(chrome://firebug/skin/netBarConnecting.gif) repeat-x;
-    z-index:50;
-}
-
-.netBlockingBar {
-    position: absolute;
-    left: 0;
-    top: 0;
-    bottom: 0;
-    background: #FFFFFF url(chrome://firebug/skin/netBarWaiting.gif) repeat-x;
-    z-index:40;
-}
-
-.netSendingBar {
-    position: absolute;
-    left: 0;
-    top: 0;
-    bottom: 0;
-    background: #FFFFFF url(chrome://firebug/skin/netBarSending.gif) repeat-x;
-    z-index:30;
-}
-
-.netWaitingBar {
-    position: absolute;
-    left: 0;
-    top: 0;
-    bottom: 0;
-    background: #FFFFFF url(chrome://firebug/skin/netBarResponded.gif) repeat-x;
-    z-index:20;
-    min-width: 1px;
-}
-
-.netReceivingBar {
-    position: absolute;
-    left: 0;
-    top: 0;
-    bottom: 0;
-    background: #38D63B url(chrome://firebug/skin/netBarLoading.gif) repeat-x;
-    z-index:10;
-}
-
-.netWindowLoadBar,
-.netContentLoadBar {
-    position: absolute;
-    left: 0;
-    top: 0;
-    bottom: 0;
-    width: 1px;
-    background-color: red;
-    z-index: 70;
-    opacity: 0.5;
-    display: none;
-    margin-bottom:-1px;
-}
-
-.netContentLoadBar {
-    background-color: Blue;
-}
-
-.netTimeLabel {
-    -moz-box-sizing: padding-box;
-    position: absolute;
-    top: 1px;
-    left: 100%;
-    padding-left: 6px;
-    color: #444444;
-    min-width: 16px;
-}
-
-/*
- * Timing info tip is reusing net timeline styles to display the same
- * colors for individual request phases. Notice that the info tip must
- * respect also loaded and fromCache styles that also modify the
- * actual color. These are used both on the same element in case
- * of the tooltip.
- */
-.loaded .netReceivingBar,
-.loaded.netReceivingBar {
-    background: #B6B6B6 url(chrome://firebug/skin/netBarLoaded.gif) repeat-x;
-    border-color: #B6B6B6;
-}
-
-.fromCache .netReceivingBar,
-.fromCache.netReceivingBar {
-    background: #D6D6D6 url(chrome://firebug/skin/netBarCached.gif) repeat-x;
-    border-color: #D6D6D6;
-}
-
-.netSummaryRow .netTimeLabel,
-.loaded .netTimeLabel {
-    background: transparent;
-}
-
-/************************************************************************************************/
-/* Time Info tip */
-
-.timeInfoTip {
-    width: 150px; 
-    height: 40px
-}
-
-.timeInfoTipBar,
-.timeInfoTipEventBar {
-    position: relative;
-    display: block;
-    margin: 0;
-    opacity: 1;
-    height: 15px;
-    width: 4px;
-}
-
-.timeInfoTipEventBar {
-    width: 1px !important;
-}
-
-.timeInfoTipCell.startTime {
-    padding-right: 8px;
-}
-
-.timeInfoTipCell.elapsedTime {
-    text-align: right;
-    padding-right: 8px;
-}
-
-/************************************************************************************************/
-/* Size Info tip */
-
-.sizeInfoLabelCol {
-    font-weight: bold;
-    padding-right: 10px;
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    font-size: 11px;
-}
-
-.sizeInfoSizeCol {
-    font-weight: bold;
-}
-
-.sizeInfoDetailCol {
-    color: gray;
-    text-align: right;
-}
-
-.sizeInfoDescCol {
-    font-style: italic;
-}
-
-/************************************************************************************************/
-/* Summary */
-
-.netSummaryRow .netReceivingBar {
-    background: #BBBBBB;
-    border: none;
-}
-
-.netSummaryLabel {
-    color: #222222;
-}
-
-.netSummaryRow {
-    background: #BBBBBB !important;
-    font-weight: bold;
-}
-
-.netSummaryRow .netBar {
-    border-right-color: #BBBBBB;
-}
-
-.netSummaryRow > .netCol {
-    border-top: 1px solid #999999;
-    border-bottom: 2px solid;
-    -moz-border-bottom-colors: #EFEFEF #999999;
-    padding-top: 1px;
-    padding-bottom: 2px;
-}
-
-.netSummaryRow > .netHrefCol:hover {
-    background: transparent !important;
-}
-
-.netCountLabel {
-    padding-left: 18px;
-}
-
-.netTotalSizeCol {
-    text-align: right;
-    padding-right: 10px;
-}
-
-.netTotalTimeCol {
-    text-align: right;
-}
-
-.netCacheSizeLabel {
-    position: absolute;
-    z-index: 1000;
-    left: 0;
-    top: 0;
-}
-
-/************************************************************************************************/
-
-.netLimitRow {
-    background: rgb(255, 255, 225) !important;
-    font-weight:normal;
-    color: black;
-    font-weight:normal;
-}
-
-.netLimitLabel {
-    padding-left: 18px;
-}
-
-.netLimitRow > .netCol {
-    border-bottom: 2px solid;
-    -moz-border-bottom-colors: #EFEFEF #999999;
-    vertical-align: middle !important;
-    padding-top: 2px;
-    padding-bottom: 2px;
-}
-
-.netLimitButton {
-    font-size: 11px;
-    padding-top: 1px;
-    padding-bottom: 1px;
-}
-
-/************************************************************************************************/
-
-.netInfoCol {
-    border-top: 1px solid #EEEEEE;
-    background: url(chrome://firebug/skin/group.gif) repeat-x #FFFFFF;
-}
-
-.netInfoBody {
-    margin: 10px 0 4px 10px;
-}
-
-.netInfoTabs {
-    position: relative;
-    padding-left: 17px;
-}
-
-.netInfoTab {
-    position: relative;
-    top: -3px;
-    margin-top: 10px;
-    padding: 4px 6px;
-    border: 1px solid transparent;
-    border-bottom: none;
-    _border: none;
-    font-weight: bold;
-    color: #565656;
-    cursor: pointer;
-}
-
-/*.netInfoTab:hover {
-    cursor: pointer;
-}*/
-
-/* replaced by .netInfoTabSelected for IE6 support
-.netInfoTab[selected="true"] {
-    cursor: default !important;
-    border: 1px solid #D7D7D7 !important;
-    border-bottom: none !important;
-    -moz-border-radius: 4px 4px 0 0;
-    background-color: #FFFFFF;
-}
-/**/
-.netInfoTabSelected {
-    cursor: default !important;
-    border: 1px solid #D7D7D7 !important;
-    border-bottom: none !important;
-    -moz-border-radius: 4px 4px 0 0;
-    -webkit-border-radius: 4px 4px 0 0;
-    border-radius: 4px 4px 0 0;
-    background-color: #FFFFFF;
-}
-
-.logRow-netInfo.error .netInfoTitle {
-    color: red;
-}
-
-.logRow-netInfo.loading .netInfoResponseText {
-    font-style: italic;
-    color: #888888;
-}
-
-.loading .netInfoResponseHeadersTitle {
-    display: none;
-}
-
-.netInfoResponseSizeLimit {
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    padding-top: 10px;
-    font-size: 11px;
-}
-
-.netInfoText {
-    display: none;
-    margin: 0;
-    border: 1px solid #D7D7D7;
-    border-right: none;
-    padding: 8px;
-    background-color: #FFFFFF;
-    font-family: Monaco, monospace;
-    white-space: pre-wrap;
-    /*overflow-x: auto; HTML is damaged in case of big (2-3MB) responses */
-}
-
-/* replaced by .netInfoTextSelected for IE6 support 
-.netInfoText[selected="true"] {
-    display: block;
-}
-/**/
-.netInfoTextSelected {
-    display: block;
-}
-
-.netInfoParamName {
-    padding-right: 10px;
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    font-weight: bold;
-    vertical-align: top;
-    text-align: right;
-    white-space: nowrap;
-}
-
-.netInfoPostText .netInfoParamName {
-    width: 1px; /* Google Chrome need this otherwise the first column of 
-                   the post variables table will be larger than expected */
-}
-
-.netInfoParamValue {
-    width: 100%;
-}
-
-.netInfoHeadersText,
-.netInfoPostText,
-.netInfoPutText {
-    padding-top: 0;
-}
-
-.netInfoHeadersGroup,
-.netInfoPostParams,
-.netInfoPostSource {
-    margin-bottom: 4px;
-    border-bottom: 1px solid #D7D7D7;
-    padding-top: 8px;
-    padding-bottom: 2px;
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    font-weight: bold;
-    color: #565656;
-}
-
-.netInfoPostParamsTable,
-.netInfoPostPartsTable,
-.netInfoPostJSONTable,
-.netInfoPostXMLTable,
-.netInfoPostSourceTable {
-    margin-bottom: 10px;
-    width: 100%;
-}
-
-.netInfoPostContentType {
-    color: #bdbdbd;
-    padding-left: 50px;
-    font-weight: normal;
-}
-
-.netInfoHtmlPreview {
-    border: 0;
-    width: 100%;
-    height:100%;
-}
-
-/************************************************************************************************/
-/* Request & Response Headers */
-
-.netHeadersViewSource {
-    color: #bdbdbd;
-    margin-left: 200px;
-    font-weight: normal;
-}
-
-.netHeadersViewSource:hover {
-    color: blue;
-    cursor: pointer;
-}
-
-/************************************************************************************************/
-
-.netActivationRow,
-.netPageSeparatorRow {
-    background: rgb(229, 229, 229) !important;
-    font-weight: normal;
-    color: black;
-}
-
-.netActivationLabel {
-    background: url(chrome://firebug/skin/infoIcon.png) no-repeat 3px 2px;
-    padding-left: 22px;
-}
-
-/************************************************************************************************/
-
-.netPageSeparatorRow {
-    height: 5px !important;
-}
-
-.netPageSeparatorLabel {
-    padding-left: 22px;
-    height: 5px !important;
-}
-
-.netPageRow {
-    background-color: rgb(255, 255, 255);
-}
-
-.netPageRow:hover {
-    background: #EFEFEF;
-}
-
-.netPageLabel {
-    padding: 1px 0 2px 18px !important;
-    font-weight: bold;
-}
-
-/************************************************************************************************/
-
-.netActivationRow > .netCol {
-    border-bottom: 2px solid;
-    -moz-border-bottom-colors: #EFEFEF #999999;
-    padding-top: 2px;
-    padding-bottom: 3px;
-}
-/*
-.useA11y .panelNode-net .a11yFocus:focus,
-.useA11y .panelNode-net .focusRow:focus {
-    outline-offset: -2px;
-    background-color: #FFFFD6 !important;
-}
-
-.useA11y .panelNode-net .netHeaderCell:focus,
-.useA11y .panelNode-net :focus .netHeaderCell,
-.useA11y .panelNode-net :focus .netReceivingBar,
-.useA11y .netSummaryRow :focus .netBar,
-.useA11y .netSummaryRow:focus .netBar {
-    background-color: #FFFFD6;
-    background-image: none;
-    border-color: #FFFFD6;
-}
-/**/
-
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/* Windows */
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-
-
-/************************************************************************************************/
-/* Twisties */
-
-.twisty,
-.logRow-errorMessage > .hasTwisty > .errorTitle,
-.logRow-log > .objectBox-array.hasTwisty,
-.logRow-spy .spyHead .spyTitle,
-.logGroup > .logRow,
-.memberRow.hasChildren > .memberLabelCell > .memberLabel,
-.hasHeaders .netHrefLabel,
-.netPageRow > .netCol > .netPageTitle {
-    background-image: url(tree_open.gif);
-    background-repeat: no-repeat;
-    background-position: 2px 2px;
-    min-height: 12px;
-}
-
-.logRow-errorMessage > .hasTwisty.opened > .errorTitle,
-.logRow-log > .objectBox-array.hasTwisty.opened,
-.logRow-spy.opened .spyHead .spyTitle,
-.logGroup.opened > .logRow,
-.memberRow.hasChildren.opened > .memberLabelCell > .memberLabel,
-.nodeBox.highlightOpen > .nodeLabel > .twisty,
-.nodeBox.open > .nodeLabel > .twisty,
-.netRow.opened > .netCol > .netHrefLabel,
-.netPageRow.opened > .netCol > .netPageTitle {
-    background-image: url(tree_close.gif);
-}
-
-.twisty {
-    background-position: 4px 4px;
-}
-
-
-
-/************************************************************************************************/
-/* Twisties IE6 */
-
-/* IE6 has problems with > operator, and multiple classes */
-
-* html .logRow-spy .spyHead .spyTitle,
-* html .logGroup .logGroupLabel,
-* html .hasChildren .memberLabelCell .memberLabel,
-* html .hasHeaders .netHrefLabel {
-    background-image: url(tree_open.gif);
-    background-repeat: no-repeat;
-    background-position: 2px 2px;
-}
-
-* html .opened .spyHead .spyTitle,
-* html .opened .logGroupLabel, 
-* html .opened .memberLabelCell .memberLabel {
-    background-image: url(tree_close.gif);
-    background-repeat: no-repeat;
-    background-position: 2px 2px;
-}
-
-
-
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/* Console */
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-
-
-/* See license.txt for terms of usage */
-
-.panelNode-console {
-    overflow-x: hidden;
-}
-
-.objectLink {
-    text-decoration: none;
-}
-
-.objectLink:hover {
-    cursor: pointer;
-    text-decoration: underline;
-}
-
-.logRow {
-    position: relative;
-    margin: 0;
-    border-bottom: 1px solid #D7D7D7;
-    padding: 2px 4px 1px 6px;
-    background-color: #FFFFFF;
-    overflow: hidden !important; /* IE need this to avoid disappearing bug with collapsed logs */
-}
-
-.useA11y .logRow:focus {
-    border-bottom: 1px solid #000000 !important;
-    outline: none !important;
-    background-color: #FFFFAD !important;
-}
-
-.useA11y .logRow:focus a.objectLink-sourceLink {
-    background-color: #FFFFAD;
-}
-
-.useA11y .a11yFocus:focus, .useA11y .objectBox:focus {
-    outline: 2px solid #FF9933;
-    background-color: #FFFFAD;
-}
-
-.useA11y .objectBox-null:focus, .useA11y .objectBox-undefined:focus{
-    background-color: #888888 !important;
-}
-
-.useA11y .logGroup.opened > .logRow {
-    border-bottom: 1px solid #ffffff;
-}
-
-.logGroup {
-    background: url(group.gif) repeat-x #FFFFFF;
-    padding: 0 !important;
-    border: none !important;
-}
-
-.logGroupBody {
-    display: none;
-    margin-left: 16px;
-    border-left: 1px solid #D7D7D7;
-    border-top: 1px solid #D7D7D7;
-    background: #FFFFFF;
-}
-
-.logGroup > .logRow {
-    background-color: transparent !important;
-    font-weight: bold;
-}
-
-.logGroup.opened > .logRow {
-    border-bottom: none;
-}
-
-.logGroup.opened > .logGroupBody {
-    display: block;
-}
-
-/*****************************************************************************************/
-
-.logRow-command > .objectBox-text {
-    font-family: Monaco, monospace;
-    color: #0000FF;
-    white-space: pre-wrap;
-}
-
-.logRow-info,
-.logRow-warn,
-.logRow-error,
-.logRow-assert,
-.logRow-warningMessage,
-.logRow-errorMessage {
-    padding-left: 22px;
-    background-repeat: no-repeat;
-    background-position: 4px 2px;
-}
-
-.logRow-assert,
-.logRow-warningMessage,
-.logRow-errorMessage {
-    padding-top: 0;
-    padding-bottom: 0;
-}
-
-.logRow-info,
-.logRow-info .objectLink-sourceLink {
-    background-color: #FFFFFF;
-}
-
-.logRow-warn,
-.logRow-warningMessage,
-.logRow-warn .objectLink-sourceLink,
-.logRow-warningMessage .objectLink-sourceLink {
-    background-color: cyan;
-}
-
-.logRow-error,
-.logRow-assert,
-.logRow-errorMessage,
-.logRow-error .objectLink-sourceLink,
-.logRow-errorMessage .objectLink-sourceLink {
-    background-color: LightYellow;
-}
-
-.logRow-error,
-.logRow-assert,
-.logRow-errorMessage {
-    color: #FF0000;
-}
-
-.logRow-info {
-    /*background-image: url(chrome://firebug/skin/infoIcon.png);*/
-}
-
-.logRow-warn,
-.logRow-warningMessage {
-    /*background-image: url(chrome://firebug/skin/warningIcon.png);*/
-}
-
-.logRow-error,
-.logRow-assert,
-.logRow-errorMessage {
-    /*background-image: url(chrome://firebug/skin/errorIcon.png);*/
-}
-
-/*****************************************************************************************/
-
-.objectBox-string,
-.objectBox-text,
-.objectBox-number,
-.objectLink-element,
-.objectLink-textNode,
-.objectLink-function,
-.objectBox-stackTrace,
-.objectLink-profile {
-    font-family: Monaco, monospace;
-}
-
-.objectBox-string,
-.objectBox-text,
-.objectLink-textNode {
-    white-space: pre-wrap;
-}
-
-.objectBox-number,
-.objectLink-styleRule,
-.objectLink-element,
-.objectLink-textNode {
-    color: #000088;
-}
-
-.objectBox-string {
-    color: #FF0000;
-}
-
-.objectLink-function,
-.objectBox-stackTrace,
-.objectLink-profile  {
-    color: DarkGreen;
-}
-
-.objectBox-null,
-.objectBox-undefined {
-    padding: 0 2px;
-    border: 1px solid #666666;
-    background-color: #888888;
-    color: #FFFFFF;
-}
-
-.objectBox-exception {
-    padding: 0 2px 0 18px;
-    /*background: url(chrome://firebug/skin/errorIcon-sm.png) no-repeat 0 0;*/
-    color: red;
-}
-
-.objectLink-sourceLink {
-    position: absolute;
-    right: 4px;
-    top: 2px;
-    padding-left: 8px;
-    font-family: Lucida Grande, sans-serif;
-    font-weight: bold;
-    color: #0000FF;
-}
-
-/************************************************************************************************/
-
-.errorTitle {
-    margin-top: 0px;
-    margin-bottom: 1px;
-    padding-top: 2px;
-    padding-bottom: 2px;
-}
-
-.errorTrace {
-    margin-left: 17px;
-}
-
-.errorSourceBox {
-    margin: 2px 0;
-}
-
-.errorSource-none {
-    display: none;
-}
-
-.errorSource-syntax > .errorBreak {
-    visibility: hidden;
-}
-
-.errorSource {
-    cursor: pointer;
-    font-family: Monaco, monospace;
-    color: DarkGreen;
-}
-
-.errorSource:hover {
-    text-decoration: underline;
-}
-
-.errorBreak {
-    cursor: pointer;
-    display: none;
-    margin: 0 6px 0 0;
-    width: 13px;
-    height: 14px;
-    vertical-align: bottom;
-    /*background: url(chrome://firebug/skin/breakpoint.png) no-repeat;*/
-    opacity: 0.1;
-}
-
-.hasBreakSwitch .errorBreak {
-    display: inline;
-}
-
-.breakForError .errorBreak {
-    opacity: 1;
-}
-
-.assertDescription {
-    margin: 0;
-}
-
-/************************************************************************************************/
-
-.logRow-profile > .logRow > .objectBox-text {
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    color: #000000;
-}
-
-.logRow-profile > .logRow > .objectBox-text:last-child {
-    color: #555555;
-    font-style: italic;
-}
-
-.logRow-profile.opened > .logRow {
-    padding-bottom: 4px;
-}
-
-.profilerRunning > .logRow {
-    /*background: transparent url(chrome://firebug/skin/loading_16.gif) no-repeat 2px 0 !important;*/
-    padding-left: 22px !important;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.profileSizer {
-    width:100%;
-    overflow-x:auto;
-    overflow-y: scroll;
-}
-
-.profileTable {
-    border-bottom: 1px solid #D7D7D7;
-    padding: 0 0 4px 0;
-}
-
-.profileTable tr[odd="1"] {
-    background-color: #F5F5F5;
-    vertical-align:middle;
-}
-
-.profileTable a {
-    vertical-align:middle;
-}
-
-.profileTable td {
-    padding: 1px 4px 0 4px;
-}
-
-.headerCell {
-    cursor: pointer;
-    -moz-user-select: none;
-    border-bottom: 1px solid #9C9C9C;
-    padding: 0 !important;
-    font-weight: bold;
-    /*background: #BBBBBB url(chrome://firebug/skin/tableHeader.gif) repeat-x;*/
-}
-
-.headerCellBox {
-    padding: 2px 4px;
-    border-left: 1px solid #D9D9D9;
-    border-right: 1px solid #9C9C9C;
-}
-
-.headerCell:hover:active {
-    /*background: #959595 url(chrome://firebug/skin/tableHeaderActive.gif) repeat-x;*/
-}
-
-.headerSorted {
-    /*background: #7D93B2 url(chrome://firebug/skin/tableHeaderSorted.gif) repeat-x;*/
-}
-
-.headerSorted > .headerCellBox {
-    border-right-color: #6B7C93;
-    /*background: url(chrome://firebug/skin/arrowDown.png) no-repeat right;*/
-}
-
-.headerSorted.sortedAscending > .headerCellBox {
-    /*background-image: url(chrome://firebug/skin/arrowUp.png);*/
-}
-
-.headerSorted:hover:active {
-    /*background: #536B90 url(chrome://firebug/skin/tableHeaderSortedActive.gif) repeat-x;*/
-}
-
-.linkCell {
-    text-align: right;
-}
-
-.linkCell > .objectLink-sourceLink {
-    position: static;
-}
-
-/*****************************************************************************************/
-
-.logRow-stackTrace {
-    padding-top: 0;
-    background: #f8f8f8;
-}
-
-.logRow-stackTrace > .objectBox-stackFrame {
-    position: relative;
-    padding-top: 2px;
-}
-
-/************************************************************************************************/
-
-.objectLink-object {
-    font-family: Lucida Grande, sans-serif;
-    font-weight: bold;
-    color: DarkGreen;
-    white-space: pre-wrap;
-}
-
-/* xxxpedro reps object representation .................................... */
-.objectProp-object {
-    color: DarkGreen;
-}
-
-.objectProps {
-    color: #000;
-    font-weight: normal;
-}
-
-.objectPropName {
-    /*font-style: italic;*/
-    color: #777;
-}
-
-/*
-.objectProps .objectProp-string,
-.objectProps .objectProp-number,
-.objectProps .objectProp-object
-{
-    font-style: italic;
-}
-/**/
-
-.objectProps .objectProp-string
-{
-    /*font-family: Monaco, monospace;*/
-    color: #f55;
-}
-.objectProps .objectProp-number
-{
-    /*font-family: Monaco, monospace;*/
-    color: #55a;
-}
-.objectProps .objectProp-object
-{
-    /*font-family: Lucida Grande,sans-serif;*/
-    color: #585;
-}
-/* xxxpedro reps object representation .................................... */
-
-/************************************************************************************************/
-
-.selectorTag,
-.selectorId,
-.selectorClass {
-    font-family: Monaco, monospace;
-    font-weight: normal;
-}
-
-.selectorTag {
-    color: #0000FF;
-}
-
-.selectorId {
-    color: DarkBlue;
-}
-
-.selectorClass {
-    color: red;
-}
-
-.selectorHidden > .selectorTag {
-    color: #5F82D9;
-}
-
-.selectorHidden > .selectorId {
-    color: #888888;
-}
-
-.selectorHidden > .selectorClass {
-    color: #D86060;
-}
-
-.selectorValue {
-    font-family: Lucida Grande, sans-serif;
-    font-style: italic;
-    color: #555555;
-}
-
-/*****************************************************************************************/
-
-.panelNode.searching .logRow {
-    display: none;
-}
-
-.logRow.matched {
-    display: block !important;
-}
-
-.logRow.matching {
-    position: absolute;
-    left: -1000px;
-    top: -1000px;
-    max-width: 0;
-    max-height: 0;
-    overflow: hidden;
-}
-
-/*****************************************************************************************/
-
-.objectLeftBrace,
-.objectRightBrace,
-.objectEqual,
-.objectComma,
-.arrayLeftBracket,
-.arrayRightBracket,
-.arrayComma {
-    font-family: Monaco, monospace;
-}
-
-.objectLeftBrace,
-.objectRightBrace,
-.arrayLeftBracket,
-.arrayRightBracket {
-    font-weight: bold;
-}
-
-.objectLeftBrace,
-.arrayLeftBracket {
-    margin-right: 4px;
-}
-
-.objectRightBrace,
-.arrayRightBracket {
-    margin-left: 4px;
-}
-
-/*****************************************************************************************/
-
-.logRow-dir {
-    padding: 0;
-}
-
-/************************************************************************************************/
-
-/*
-.logRow-errorMessage > .hasTwisty > .errorTitle,
-.logRow-spy .spyHead .spyTitle,
-.logGroup > .logRow 
-*/
-.logRow-errorMessage .hasTwisty .errorTitle,
-.logRow-spy .spyHead .spyTitle,
-.logGroup .logRow {
-    cursor: pointer;
-    padding-left: 18px;
-    background-repeat: no-repeat;
-    background-position: 3px 3px;
-}
-
-.logRow-errorMessage > .hasTwisty > .errorTitle {
-    background-position: 2px 3px;
-}
-
-.logRow-errorMessage > .hasTwisty > .errorTitle:hover,
-.logRow-spy .spyHead .spyTitle:hover,
-.logGroup > .logRow:hover {
-    text-decoration: underline;
-}
-
-/*****************************************************************************************/
-
-.logRow-spy {
-    padding: 0 !important;
-}
-
-.logRow-spy,
-.logRow-spy .objectLink-sourceLink {
-    background: url(group.gif) repeat-x #FFFFFF;
-    padding-right: 4px;
-    right: 0;
-}
-
-.logRow-spy.opened {
-    padding-bottom: 4px;
-    border-bottom: none;
-}
-
-.spyTitle {
-    color: #000000;
-    font-weight: bold;
-    -moz-box-sizing: padding-box;
-    overflow: hidden;
-    z-index: 100;
-    padding-left: 18px;
-}
-
-.spyCol {
-    padding: 0;
-    white-space: nowrap;
-    height: 16px;
-}
-
-.spyTitleCol:hover > .objectLink-sourceLink,
-.spyTitleCol:hover > .spyTime,
-.spyTitleCol:hover > .spyStatus,
-.spyTitleCol:hover > .spyTitle {
-    display: none;
-}
-
-.spyFullTitle {
-    display: none;
-    -moz-user-select: none;
-    max-width: 100%;
-    background-color: Transparent;
-}
-
-.spyTitleCol:hover > .spyFullTitle {
-    display: block;
-}
-
-.spyStatus {
-    padding-left: 10px;
-    color: rgb(128, 128, 128);
-}
-
-.spyTime {
-    margin-left:4px;
-    margin-right:4px;
-    color: rgb(128, 128, 128);
-}
-
-.spyIcon {
-    margin-right: 4px;
-    margin-left: 4px;
-    width: 16px;
-    height: 16px;
-    vertical-align: middle;
-    background: transparent no-repeat 0 0;
-    display: none;
-}
-
-.loading .spyHead .spyRow .spyIcon {
-    background-image: url(loading_16.gif);
-    display: block;
-}
-
-.logRow-spy.loaded:not(.error) .spyHead .spyRow .spyIcon {
-    width: 0;
-    margin: 0;
-}
-
-.logRow-spy.error .spyHead .spyRow .spyIcon {
-    background-image: url(errorIcon-sm.png);
-    display: block;
-    background-position: 2px 2px;
-}
-
-.logRow-spy .spyHead .netInfoBody {
-    display: none;
-}
-
-.logRow-spy.opened .spyHead .netInfoBody {
-    margin-top: 10px;
-    display: block;
-}
-
-.logRow-spy.error .spyTitle,
-.logRow-spy.error .spyStatus,
-.logRow-spy.error .spyTime {
-    color: red;
-}
-
-.logRow-spy.loading .spyResponseText {
-    font-style: italic;
-    color: #888888;
-}
-
-/************************************************************************************************/
-
-.caption {
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    font-weight: bold;
-    color:  #444444;
-}
-
-.warning {
-    padding: 10px;
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    font-weight: bold;
-    color:  #888888;
-}
-
-
-
-
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/* DOM */
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-
-
-/* See license.txt for terms of usage */
-
-.panelNode-dom {
-    overflow-x: hidden !important;
-}
-
-.domTable {
-    font-size: 1em;
-    width: 100%;
-    table-layout: fixed;
-    background: #fff;
-}
-
-.domTableIE {
-    width: auto;
-}
-
-.memberLabelCell {
-    padding: 2px 0 2px 0;
-    vertical-align: top;
-}
-
-.memberValueCell {
-    padding: 1px 0 1px 5px;
-    display: block;
-    overflow: hidden;
-}
-
-.memberLabel {
-    display: block;
-    cursor: default;
-    -moz-user-select:  none;
-    overflow: hidden;
-    /*position: absolute;*/
-    padding-left: 18px;
-    /*max-width: 30%;*/
-    /*white-space: nowrap;*/
-    background-color: #FFFFFF;
-    text-decoration: none;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.memberRow.hasChildren .memberLabelCell .memberLabel:hover {
-    cursor: pointer;
-    color: blue;
-    text-decoration: underline;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.userLabel {
-    color: #000000;
-    font-weight: bold;
-}
-
-.userClassLabel {
-    color: #E90000;
-    font-weight: bold;
-}
-
-.userFunctionLabel {
-    color: #025E2A;
-    font-weight: bold;
-}
-
-.domLabel {
-    color: #000000;
-}
-
-.domFunctionLabel {
-    color: #025E2A;
-}
-
-.ordinalLabel {
-    color: SlateBlue;
-    font-weight: bold;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-.scopesRow {
-    padding: 2px 18px;
-    background-color: LightYellow;
-    border-bottom: 5px solid #BEBEBE;
-    color: #666666;
-}
-.scopesLabel {
-    background-color:  LightYellow;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.watchEditCell {
-    padding: 2px 18px;
-    background-color: LightYellow;
-    border-bottom: 1px solid #BEBEBE;
-    color: #666666;
-}
-
-.editor-watchNewRow,
-.editor-memberRow {
-    font-family: Monaco, monospace !important;
-}
-
-.editor-memberRow {
-    padding: 1px 0 !important;
-}
-
-.editor-watchRow {
-    padding-bottom: 0 !important;
-}
-
-.watchRow > .memberLabelCell {
-    font-family: Monaco, monospace;
-    padding-top: 1px;
-    padding-bottom: 1px;
-}
-
-.watchRow > .memberLabelCell > .memberLabel {
-    background-color: transparent;
-}
-
-.watchRow > .memberValueCell {
-    padding-top: 2px;
-    padding-bottom: 2px;
-}
-
-.watchRow > .memberLabelCell,
-.watchRow > .memberValueCell {
-    background-color: #F5F5F5;
-    border-bottom: 1px solid #BEBEBE;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.watchToolbox {
-    z-index: 2147483647;
-    position: absolute;
-    right: 0;
-    padding: 1px 2px;
-}
-
-
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/*************************************************************************************************/
-/* FROM ORIGINAL FIREBUG */
-
-
-
-
-/************************************************************************************************
- CSS Not organized
-*************************************************************************************************/
-#fbConsole {
-    overflow-x: hidden !important;
-}
-
-#fbCSS {
-    font: 1em Monaco, monospace;
-    padding: 0 7px;
-}
-
-#fbstylesheetButtons select, #fbScriptButtons select {
-    font: 11px Lucida Grande, Tahoma, sans-serif;
-    margin-top: 1px;
-    padding-left: 3px;
-    background: #fafafa;
-    border: 1px inset #fff;
-    width: 220px;
-    outline: none;
-}
-
-.Selector { margin-top:10px }
-.CSSItem {margin-left: 4% }
-.CSSText { padding-left:20px; }
-.CSSProperty { color:#005500; }
-.CSSValue { padding-left:5px; color:#000088; }
-
-
-/************************************************************************************************
- Not organized
-*************************************************************************************************/
-
-#fbHTMLStatusBar {
-    display: inline;
-}
-
-.fbToolbarButtons {
-    display: none;
-}
-
-.fbStatusSeparator{
-    display: block;
-    float: left;
-    padding-top: 4px;
-}
-
-#fbStatusBarBox {
-    display: none;
-}
-
-#fbToolbarContent {
-    display: block;
-    position: absolute;
-    _position: absolute;
-    top: 0;
-    padding-top: 4px;
-    height: 23px;
-    clip: rect(0, 2048px, 27px, 0);
-}
-
-.fbTabMenuTarget {
-    display: none !important;
-    float: left;
-    width: 10px;
-    height: 10px;
-    margin-top: 6px;
-    background: url(tabMenuTarget.png);   
-}
-
-.fbTabMenuTarget:hover {
-    background: url(tabMenuTargetHover.png);   
-}
-
-.fbShadow {
-    float: left;
-    background: url(shadowAlpha.png) no-repeat bottom right !important;
-    background: url(shadow2.gif) no-repeat bottom right;
-    margin: 10px 0 0 10px !important;
-    margin: 10px 0 0 5px;
-}
-
-.fbShadowContent {
-    display: block;
-    position: relative;
-    background-color: #fff;
-    border: 1px solid #a9a9a9;
-    top: -6px;
-    left: -6px;
-}
-
-.fbMenu {
-    display: none;
-    position: absolute;
-    font-size: 11px;
-    line-height: 13px;
-    z-index: 2147483647;
-}
-
-.fbMenuContent {
-    padding: 2px;
-}
-
-.fbMenuSeparator {
-    display: block;
-    position: relative;
-    padding: 1px 18px 0;
-    text-decoration: none;
-    color: #000;
-    cursor: default;    
-    background: #ACA899;
-    margin: 4px 0;
-}
-
-.fbMenuOption
-{
-    display: block;
-    position: relative;
-    padding: 2px 18px;
-    text-decoration: none;
-    color: #000;
-    cursor: default;
-}
-
-.fbMenuOption:hover
-{
-    color: #fff;
-    background: #316AC5;
-}
-
-.fbMenuGroup {
-    background: transparent url(tabMenuPin.png) no-repeat right 0;
-}
-
-.fbMenuGroup:hover {
-    background: #316AC5 url(tabMenuPin.png) no-repeat right -17px;
-}
-
-.fbMenuGroupSelected {
-    color: #fff;
-    background: #316AC5 url(tabMenuPin.png) no-repeat right -17px;
-}
-
-.fbMenuChecked  {
-    background: transparent url(tabMenuCheckbox.png) no-repeat 4px 0;
-}
-
-.fbMenuChecked:hover {
-    background: #316AC5 url(tabMenuCheckbox.png) no-repeat 4px -17px;
-}
-
-.fbMenuRadioSelected {
-    background: transparent url(tabMenuRadio.png) no-repeat 4px 0;
-}
-
-.fbMenuRadioSelected:hover {
-    background: #316AC5 url(tabMenuRadio.png) no-repeat 4px -17px;
-}
-
-.fbMenuShortcut {
-    padding-right: 85px; 
-}
-
-.fbMenuShortcutKey {
-    position: absolute;
-    right: 0;
-    top: 2px;
-    width: 77px;
-}
-
-#fbFirebugMenu {
-    top: 22px;
-    left: 0;
-}
-
-.fbMenuDisabled {
-    color: #ACA899 !important;
-}
-
-#fbFirebugSettingsMenu {
-    left: 245px;
-    top: 99px;
-}
-
-#fbConsoleMenu {
-    top: 42px;
-    left: 48px;
-}
-
-.fbIconButton {
-    display: block;
-}
-
-.fbIconButton {
-    display: block;
-}
-
-.fbIconButton {
-    display: block;
-    float: left;
-    height: 20px;
-    width: 20px;
-    color: #000;
-    margin-right: 2px;
-    text-decoration: none;
-    cursor: default;
-}
-
-.fbIconButton:hover {
-    position: relative;
-    top: -1px;
-    left: -1px;
-    margin-right: 0;
-    _margin-right: 1px;
-    color: #333;
-    border: 1px solid #fff;
-    border-bottom: 1px solid #bbb;
-    border-right: 1px solid #bbb;
-}
-
-.fbIconPressed {
-    position: relative;
-    margin-right: 0;
-    _margin-right: 1px;
-    top: 0 !important;
-    left: 0 !important;
-    height: 19px;
-    color: #333 !important;
-    border: 1px solid #bbb !important;
-    border-bottom: 1px solid #cfcfcf !important;
-    border-right: 1px solid #ddd !important;
-}
-
-
-
-/************************************************************************************************
- Error Popup
-*************************************************************************************************/
-#fbErrorPopup {
-    position: absolute;
-    right: 0;
-    bottom: 0;
-    height: 19px;
-    width: 75px;
-    background: url(sprite.png) #f1f2ee 0 0;
-    z-index: 999;
-}
-
-#fbErrorPopupContent {
-    position: absolute;
-    right: 0;
-    top: 1px;
-    height: 18px;
-    width: 75px;
-    _width: 74px;
-    border-left: 1px solid #aca899;
-}
-
-#fbErrorIndicator {
-    position: absolute;
-    top: 2px;
-    right: 5px;
-}
-
-
-
-
-
-
-
-
-
-
-.fbBtnInspectActive {
-    background: #aaa;
-    color: #fff !important;
-}
-
-/************************************************************************************************
- General
-*************************************************************************************************/
-.fbBody {
-    margin: 0;
-    padding: 0;
-    overflow: hidden;
-    
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    font-size: 11px;
-    background: #fff;
-}
-
-.clear {
-    clear: both;
-}
-
-/************************************************************************************************
- Mini Chrome
-*************************************************************************************************/
-#fbMiniChrome {
-    display: none;
-    right: 0;
-    height: 27px;
-    background: url(sprite.png) #f1f2ee 0 0;
-    margin-left: 1px;
-}
-
-#fbMiniContent {
-    display: block;
-    position: relative;
-    left: -1px;
-    right: 0;
-    top: 1px;
-    height: 25px;
-    border-left: 1px solid #aca899;
-}
-
-#fbToolbarSearch {
-    float: right;
-    border: 1px solid #ccc;
-    margin: 0 5px 0 0;
-    background: #fff url(search.png) no-repeat 4px 2px !important;
-    background: #fff url(search.gif) no-repeat 4px 2px;
-    padding-left: 20px;    
-    font-size: 11px;
-}
-
-#fbToolbarErrors {
-    float: right;
-    margin: 1px 4px 0 0;
-    font-size: 11px;
-}
-
-#fbLeftToolbarErrors {
-    float: left;
-    margin: 7px 0px 0 5px;
-    font-size: 11px;
-}
-
-.fbErrors {
-    padding-left: 20px;
-    height: 14px;
-    background: url(errorIcon.png) no-repeat !important;
-    background: url(errorIcon.gif) no-repeat;
-    color: #f00;
-    font-weight: bold;    
-}
-
-#fbMiniErrors {
-    display: inline;
-    display: none;
-    float: right;
-    margin: 5px 2px 0 5px;
-}
-
-#fbMiniIcon {
-    float: right;
-    margin: 3px 4px 0;
-    height: 20px;
-    width: 20px;
-    float: right;    
-    background: url(sprite.png) 0 -135px;
-    cursor: pointer;
-}
-
-
-/************************************************************************************************
- Master Layout
-*************************************************************************************************/
-#fbChrome {
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    font-size: 11px;
-    position: absolute;
-    _position: static;
-    top: 0;
-    left: 0;
-    height: 100%;
-    width: 100%;
-    border-collapse: collapse;
-    border-spacing: 0;
-    background: #fff;
-    overflow: hidden;
-}
-
-#fbChrome > tbody > tr > td {
-    padding: 0;
-}
-
-#fbTop {
-    height: 49px;
-}
-
-#fbToolbar {
-    background: url(sprite.png) #f1f2ee 0 0;
-    height: 27px;
-    font-size: 11px;
-    line-height: 13px;
-}
-
-#fbPanelBarBox {
-    background: url(sprite.png) #dbd9c9 0 -27px;
-    height: 22px;
-}
-
-#fbContent {
-    height: 100%;
-    vertical-align: top;
-}
-
-#fbBottom {
-    height: 18px;
-    background: #fff;
-}
-
-/************************************************************************************************
- Sub-Layout 
-*************************************************************************************************/
-
-/* fbToolbar 
-*************************************************************************************************/
-#fbToolbarIcon {
-    float: left;
-    padding: 0 5px 0;
-}
-
-#fbToolbarIcon a {
-    background: url(sprite.png) 0 -135px;
-}
-
-#fbToolbarButtons {
-    padding: 0 2px 0 5px;
-}
-
-#fbToolbarButtons {
-    padding: 0 2px 0 5px;
-}
-/*
-#fbStatusBarBox a {
-    text-decoration: none;
-    display: block;
-    float: left;
-    color: #000;
-    padding: 4px 5px;
-    margin: 0 0 0 1px;
-    cursor: default;
-}
-
-#fbStatusBarBox a:hover {
-    color: #333;
-    padding: 3px 4px;
-    border: 1px solid #fff;
-    border-bottom: 1px solid #bbb;
-    border-right: 1px solid #bbb;
-}
-/**/
-
-.fbButton {
-    text-decoration: none;
-    display: block;
-    float: left;
-    color: #000;
-    padding: 4px 6px 4px 7px;
-    cursor: default;
-}
-
-.fbButton:hover {
-    color: #333;
-    background: #f5f5ef url(buttonBg.png);
-    padding: 3px 5px 3px 6px;
-    border: 1px solid #fff;
-    border-bottom: 1px solid #bbb;
-    border-right: 1px solid #bbb;
-}
-
-.fbBtnPressed {
-    background: #e3e3db url(buttonBgHover.png) !important;
-    padding: 3px 4px 2px 6px !important;
-    margin: 1px 0 0 1px !important;
-    border: 1px solid #ACA899 !important;
-    border-color: #ACA899 #ECEBE3 #ECEBE3 #ACA899 !important;
-}
-
-#fbStatusBarBox {
-    top: 4px;
-    cursor: default;    
-}
-
-.fbToolbarSeparator {
-    overflow: hidden;
-    border: 1px solid;
-    border-color: transparent #fff transparent #777;
-    _border-color: #eee #fff #eee #777;
-    height: 7px;
-    margin: 6px 3px;
-    float: left;
-}
-
-.fbBtnSelected {
-    font-weight: bold;
-}
-
-.fbStatusBar {
-    color: #aca899;
-}
-
-.fbStatusBar a {
-    text-decoration: none;
-    color: black;
-}
-
-.fbStatusBar a:hover {
-    color: blue;
-    cursor: pointer;    
-}
-
-
-#fbWindowButtons {
-    position: absolute;
-    white-space: nowrap;
-    right: 0;
-    top: 0;
-    height: 17px;
-    width: 48px;
-    padding: 5px;
-    z-index: 6;
-    background: url(sprite.png) #f1f2ee 0 0;
-}
-
-/* fbPanelBarBox
-*************************************************************************************************/
-
-#fbPanelBar1 {
-    width: 1024px; /* fixed width to avoid tabs breaking line */
-    z-index: 8;
-    left: 0;
-    white-space: nowrap;
-    background: url(sprite.png) #dbd9c9 0 -27px;
-    position: absolute;
-    left: 4px;
-}
-
-#fbPanelBar2Box {
-    background: url(sprite.png) #dbd9c9 0 -27px;
-    position: absolute;
-    height: 22px;
-    width: 300px; /* fixed width to avoid tabs breaking line */
-    z-index: 9;
-    right: 0;
-}
-
-#fbPanelBar2 {
-    position: absolute;
-    width: 290px; /* fixed width to avoid tabs breaking line */
-    height: 22px;
-    padding-left: 4px;
-}
-
-/* body 
-*************************************************************************************************/
-.fbPanel {
-    display: none;
-}
-
-#fbPanelBox1, #fbPanelBox2 {
-    max-height: inherit;
-    height: 100%;
-    font-size: 1em;
-}
-
-#fbPanelBox2 {
-    background: #fff;
-}
-
-#fbPanelBox2 {
-    width: 300px;
-    background: #fff;
-}
-
-#fbPanel2 {
-    margin-left: 6px;
-    background: #fff;
-}
-
-#fbLargeCommandLine {
-    display: none;
-    position: absolute;
-    z-index: 9;
-    top: 27px;
-    right: 0;
-    width: 294px;
-    height: 201px;
-    border-width: 0;
-    margin: 0;
-    padding: 2px 0 0 2px;
-    resize: none;
-    outline: none;
-    font-size: 11px;
-    overflow: auto;
-    border-top: 1px solid #B9B7AF;
-    _right: -1px;
-    _border-left: 1px solid #fff;
-}
-
-#fbLargeCommandButtons {
-    display: none;
-    background: #ECE9D8;
-    bottom: 0;
-    right: 0;
-    width: 294px;
-    height: 21px;
-    padding-top: 1px;
-    position: fixed;
-    border-top: 1px solid #ACA899;
-    z-index: 9;
-}
-
-#fbSmallCommandLineIcon {
-    background: url(down.png) no-repeat;
-    position: absolute;
-    right: 2px;
-    bottom: 3px;
-    
-    z-index: 99;
-}
-
-#fbSmallCommandLineIcon:hover {
-    background: url(downHover.png) no-repeat;
-}
-
-.hide {
-    overflow: hidden !important;
-    position: fixed !important;
-    display: none !important;
-    visibility: hidden !important;
-}
-
-/* fbBottom 
-*************************************************************************************************/
-
-#fbCommand {
-    height: 18px;
-}
-
-#fbCommandBox {
-    position: fixed;
-    _position: absolute;
-    width: 100%;
-    height: 18px;
-    bottom: 0;
-    overflow: hidden;
-    z-index: 9;
-    background: #fff;
-    border: 0;
-    border-top: 1px solid #ccc;
-}
-
-#fbCommandIcon {
-    position: absolute;
-    color: #00f;
-    top: 2px;
-    left: 6px;
-    display: inline;
-    font: 11px Monaco, monospace;
-    z-index: 10;
-}
-
-#fbCommandLine {
-    position: absolute;
-    width: 100%;
-    top: 0;
-    left: 0;
-    border: 0;
-    margin: 0;
-    padding: 2px 0 2px 32px;
-    font: 11px Monaco, monospace;
-    z-index: 9;
-    outline: none;
-}
-
-#fbLargeCommandLineIcon {
-    background: url(up.png) no-repeat;
-    position: absolute;
-    right: 1px;
-    bottom: 1px;
-    z-index: 10;
-}
-
-#fbLargeCommandLineIcon:hover {
-    background: url(upHover.png) no-repeat;
-}
-
-div.fbFitHeight {
-    overflow: auto;
-    position: relative;
-}
-
-
-/************************************************************************************************
- Layout Controls
-*************************************************************************************************/
-
-/* fbToolbar buttons 
-*************************************************************************************************/
-.fbSmallButton {
-    overflow: hidden;
-    width: 16px;
-    height: 16px;
-    display: block;
-    text-decoration: none;
-    cursor: default;
-}
-
-#fbWindowButtons .fbSmallButton {
-    float: right;
-}
-
-#fbWindow_btClose {
-    background: url(min.png);
-}
-
-#fbWindow_btClose:hover {
-    background: url(minHover.png);
-}
-
-#fbWindow_btDetach {
-    background: url(detach.png);
-}
-
-#fbWindow_btDetach:hover {
-    background: url(detachHover.png);
-}
-
-#fbWindow_btDeactivate {
-    background: url(off.png);
-}
-
-#fbWindow_btDeactivate:hover {
-    background: url(offHover.png);
-}
-
-
-/* fbPanelBarBox tabs 
-*************************************************************************************************/
-.fbTab {
-    text-decoration: none;
-    display: none;
-    float: left;
-    width: auto;
-    float: left;
-    cursor: default;
-    font-family: Lucida Grande, Tahoma, sans-serif;
-    font-size: 11px;
-    line-height: 13px;
-    font-weight: bold;
-    height: 22px;
-    color: #565656;
-}
-
-.fbPanelBar span {
-    /*display: block; TODO: safe to remove this? */
-    float: left;
-}
-
-.fbPanelBar .fbTabL,.fbPanelBar .fbTabR {
-    height: 22px;
-    width: 8px;
-}
-
-.fbPanelBar .fbTabText {
-    padding: 4px 1px 0;
-}
-
-a.fbTab:hover {
-    background: url(sprite.png) 0 -73px;
-}
-
-a.fbTab:hover .fbTabL {
-    background: url(sprite.png) -16px -96px;
-}
-
-a.fbTab:hover .fbTabR {
-    background: url(sprite.png) -24px -96px;
-}
-
-.fbSelectedTab {
-    background: url(sprite.png) #f1f2ee 0 -50px !important;
-    color: #000;
-}
-
-.fbSelectedTab .fbTabL {
-    background: url(sprite.png) 0 -96px !important;
-}
-
-.fbSelectedTab .fbTabR {
-    background: url(sprite.png) -8px -96px !important;
-}
-
-/* splitters 
-*************************************************************************************************/
-#fbHSplitter {
-    position: fixed;
-    _position: absolute;
-    left: 0;
-    top: 0;
-    width: 100%;
-    height: 5px;
-    overflow: hidden;
-    cursor: n-resize !important;
-    background: url(pixel_transparent.gif);
-    z-index: 9;
-}
-
-#fbHSplitter.fbOnMovingHSplitter {
-    height: 100%;
-    z-index: 100;
-}
-
-.fbVSplitter {
-    background: #ece9d8;
-    color: #000;
-    border: 1px solid #716f64;
-    border-width: 0 1px;
-    border-left-color: #aca899;
-    width: 4px;
-    cursor: e-resize;
-    overflow: hidden;
-    right: 294px;
-    text-decoration: none;
-    z-index: 10;
-    position: absolute;
-    height: 100%;
-    top: 27px;
-}
-
-/************************************************************************************************/
-div.lineNo {
-    font: 1em/1.4545em Monaco, monospace;
-    position: relative;
-    float: left;
-    top: 0;
-    left: 0;
-    margin: 0 5px 0 0;
-    padding: 0 5px 0 10px;
-    background: #eee;
-    color: #888;
-    border-right: 1px solid #ccc;
-    text-align: right;
-}
-
-.sourceBox {
-    position: absolute;
-}
-
-.sourceCode {
-    font: 1em Monaco, monospace;
-    overflow: hidden;
-    white-space: pre;
-    display: inline;
-}
-
-/************************************************************************************************/
-.nodeControl {
-    margin-top: 3px;
-    margin-left: -14px;
-    float: left;
-    width: 9px;
-    height: 9px;
-    overflow: hidden;
-    cursor: default;
-    background: url(tree_open.gif);
-    _float: none;
-    _display: inline;
-    _position: absolute;
-}
-
-div.nodeMaximized {
-    background: url(tree_close.gif);
-}
-
-div.objectBox-element {
-    padding: 1px 3px;
-}
-.objectBox-selector{
-    cursor: default;
-}
-
-.selectedElement{
-    background: highlight;
-    /* background: url(roundCorner.svg); Opera */
-    color: #fff !important;
-}
-.selectedElement span{
-    color: #fff !important;
-}
-
-/* IE6 need this hack */
-* html .selectedElement {
-    position: relative;
-}
-
-/* Webkit CSS Hack - bug in "highlight" named color */ 
-@media screen and (-webkit-min-device-pixel-ratio:0) {
-    .selectedElement{
-      background: #316AC5;
-      color: #fff !important;
-    }
-}
-
-/************************************************************************************************/
-/************************************************************************************************/
-.logRow * {
-    font-size: 1em;
-}
-
-/* TODO: remove this? */
-/* TODO: xxxpedro - IE need this in windowless mode (cnn.com) check if the issue is related to 
-position. if so, override it at chrome.js initialization when creating the div */
-.logRow {
-    position: relative;
-    border-bottom: 1px solid #D7D7D7;
-    padding: 2px 4px 1px 6px;
-    zbackground-color: #FFFFFF;
-}
-/**/
-
-.logRow-command {
-    font-family: Monaco, monospace;
-    color: blue;
-}
-
-.objectBox-string,
-.objectBox-text,
-.objectBox-number,
-.objectBox-function,
-.objectLink-element,
-.objectLink-textNode,
-.objectLink-function,
-.objectBox-stackTrace,
-.objectLink-profile {
-    font-family: Monaco, monospace;
-}
-
-.objectBox-null {
-    padding: 0 2px;
-    border: 1px solid #666666;
-    background-color: #888888;
-    color: #FFFFFF;
-}
-
-.objectBox-string {
-    color: red;
-    
-    /* TODO: xxxpedro make long strings break line */
-    /*white-space: pre; */ 
-}
-
-.objectBox-number {
-    color: #000088;
-}
-
-.objectBox-function {
-    color: DarkGreen;
-}
-
-.objectBox-object {
-    color: DarkGreen;
-    font-weight: bold;
-    font-family: Lucida Grande, sans-serif;
-}
-
-.objectBox-array {
-    color: #000;
-}
-
-/************************************************************************************************/
-.logRow-info,.logRow-error,.logRow-warn {
-    background: #fff no-repeat 2px 2px;
-    padding-left: 20px;
-    padding-bottom: 3px;
-}
-
-.logRow-info {
-    background-image: url(infoIcon.png) !important;
-    background-image: url(infoIcon.gif);
-}
-
-.logRow-warn {
-    background-color: cyan;
-    background-image: url(warningIcon.png) !important;
-    background-image: url(warningIcon.gif);
-}
-
-.logRow-error {
-    background-color: LightYellow;
-    background-image: url(errorIcon.png) !important;
-    background-image: url(errorIcon.gif);
-    color: #f00;
-}
-
-.errorMessage {
-    vertical-align: top;
-    color: #f00;
-}
-
-.objectBox-sourceLink {
-    position: absolute;
-    right: 4px;
-    top: 2px;
-    padding-left: 8px;
-    font-family: Lucida Grande, sans-serif;
-    font-weight: bold;
-    color: #0000FF;
-}
-
-/************************************************************************************************/
-/*
-//TODO: remove this when console2 is finished
-*/
-/*
-.logRow-group {
-    background: #EEEEEE;
-    border-bottom: none;
-}
-
-.logGroup {
-    background: #EEEEEE;
-}
-
-.logGroupBox {
-    margin-left: 24px;
-    border-top: 1px solid #D7D7D7;
-    border-left: 1px solid #D7D7D7;
-}/**/
-
-/************************************************************************************************/
-.selectorTag,.selectorId,.selectorClass {
-    font-family: Monaco, monospace;
-    font-weight: normal;
-}
-
-.selectorTag {
-    color: #0000FF;
-}
-
-.selectorId {
-    color: DarkBlue;
-}
-
-.selectorClass {
-    color: red;
-}
-
-/************************************************************************************************/
-.objectBox-element {
-    font-family: Monaco, monospace;
-    color: #000088;
-}
-
-.nodeChildren {
-    padding-left: 26px;
-}
-
-.nodeTag {
-    color: blue;
-    cursor: pointer;
-}
-
-.nodeValue {
-    color: #FF0000;
-    font-weight: normal;
-}
-
-.nodeText,.nodeComment {
-    margin: 0 2px;
-    vertical-align: top;
-}
-
-.nodeText {
-    color: #333333;
-    font-family: Monaco, monospace;
-}
-
-.nodeComment {
-    color: DarkGreen;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.nodeHidden, .nodeHidden * {
-    color: #888888;
-}
-
-.nodeHidden .nodeTag {
-    color: #5F82D9;
-}
-
-.nodeHidden .nodeValue {
-    color: #D86060;
-}
-
-.selectedElement .nodeHidden, .selectedElement .nodeHidden * {
-    color: SkyBlue !important;
-}
-
-
-/************************************************************************************************/
-.log-object {
-    /*
-    _position: relative;
-    _height: 100%;
-    /**/
-}
-
-.property {
-    position: relative;
-    clear: both;
-    height: 15px;
-}
-
-.propertyNameCell {
-    vertical-align: top;
-    float: left;
-    width: 28%;
-    position: absolute;
-    left: 0;
-    z-index: 0;
-}
-
-.propertyValueCell {
-    float: right;
-    width: 68%;
-    background: #fff;
-    position: absolute;
-    padding-left: 5px;
-    display: table-cell;
-    right: 0;
-    z-index: 1;
-    /*
-    _position: relative;
-    /**/
-}
-
-.propertyName {
-    font-weight: bold;
-}
-
-.FirebugPopup {
-    height: 100% !important;
-}
-
-.FirebugPopup #fbWindowButtons {
-    display: none !important;
-}
-
-.FirebugPopup #fbHSplitter {
-    display: none !important;
-}
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.html b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.html
deleted file mode 100644
index aa07809..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.html
+++ /dev/null
@@ -1,215 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8">
-<title>Firebug Lite</title>
-<!-- An empty script to avoid FOUC when loading the stylesheet -->
-<script type="text/javascript"></script>
-<style type="text/css" media="screen">@import "firebug.css";</style>
-<style>html,body{margin:0;padding:0;overflow:hidden;}</style>
-</head>
-<body class="fbBody">
-<table id="fbChrome" cellpadding="0" cellspacing="0" border="0">
-  <tbody>
-    <tr>
-      <!-- Interface - Top Area -->
-      <td id="fbTop" colspan="2">
-      
-        <!-- 
-        <div>
-          --><!-- <span id="fbToolbarErrors" class="fbErrors">2 errors</span> --><!-- 
-          <input type="text" id="fbToolbarSearch" />
-        </div>
-        -->
-              
-        <!-- Window Buttons -->
-        <div id="fbWindowButtons">
-          <a id="fbWindow_btDeactivate" class="fbSmallButton fbHover" title="Deactivate Firebug for this web page">&nbsp;</a>
-          <a id="fbWindow_btDetach" class="fbSmallButton fbHover" title="Open Firebug in popup window">&nbsp;</a>
-          <a id="fbWindow_btClose" class="fbSmallButton fbHover" title="Minimize Firebug">&nbsp;</a>
-        </div>
-        
-        <!-- Toolbar buttons and Status Bar -->
-        <div id="fbToolbar">
-          <div id="fbToolbarContent">
-        
-          <!-- Firebug Button -->
-          <span id="fbToolbarIcon">
-            <a id="fbFirebugButton" class="fbIconButton" class="fbHover" target="_blank">&nbsp;</a>
-          </span>
-          
-          <!-- 
-          <span id="fbLeftToolbarErrors" class="fbErrors">2 errors</span>
-           -->
-           
-          <!-- Toolbar Buttons -->
-          <span id="fbToolbarButtons">
-            <!-- Fixed Toolbar Buttons -->
-            <span id="fbFixedButtons">
-                <a id="fbChrome_btInspect" class="fbButton fbHover" title="Click an element in the page to inspect">Inspect</a>
-            </span>
-            
-            <!-- Console Panel Toolbar Buttons -->
-            <span id="fbConsoleButtons" class="fbToolbarButtons">
-              <a id="fbConsole_btClear" class="fbButton fbHover" title="Clear the console">Clear</a>
-            </span>
-            
-            <!-- HTML Panel Toolbar Buttons -->
-            <!-- 
-            <span id="fbHTMLButtons" class="fbToolbarButtons">
-              <a id="fbHTML_btEdit" class="fbHover" title="Edit this HTML">Edit</a>
-            </span>
-             -->
-          </span>
-          
-          <!-- Status Bar -->
-          <span id="fbStatusBarBox">
-            <span class="fbToolbarSeparator"></span>
-            <!-- HTML Panel Status Bar -->
-            <!-- 
-            <span id="fbHTMLStatusBar" class="fbStatusBar fbToolbarButtons">
-            </span>
-             -->
-          </span>
-          
-          </div>
-          
-        </div>
-        
-        <!-- PanelBars -->
-        <div id="fbPanelBarBox">
-        
-          <!-- Main PanelBar -->
-          <div id="fbPanelBar1" class="fbPanelBar">
-            <a id="fbConsoleTab" class="fbTab fbHover">
-                <span class="fbTabL"></span>
-                <span class="fbTabText">Console</span>
-                <span class="fbTabMenuTarget"></span>
-                <span class="fbTabR"></span>
-            </a>
-            <a id="fbHTMLTab" class="fbTab fbHover">
-                <span class="fbTabL"></span>
-                <span class="fbTabText">HTML</span>
-                <span class="fbTabR"></span>
-            </a>
-            <a class="fbTab fbHover">
-                <span class="fbTabL"></span>
-                <span class="fbTabText">CSS</span>
-                <span class="fbTabR"></span>
-            </a>
-            <a class="fbTab fbHover">
-                <span class="fbTabL"></span>
-                <span class="fbTabText">Script</span>
-                <span class="fbTabR"></span>
-            </a>
-            <a class="fbTab fbHover">
-                <span class="fbTabL"></span>
-                <span class="fbTabText">DOM</span>
-                <span class="fbTabR"></span>
-            </a>
-          </div>
-
-          <!-- Side PanelBars -->
-          <div id="fbPanelBar2Box" class="hide">
-            <div id="fbPanelBar2" class="fbPanelBar">
-            <!-- 
-              <a class="fbTab fbHover">
-                <span class="fbTabL"></span>
-                <span class="fbTabText">Style</span>
-                <span class="fbTabR"></span>
-              </a>
-              <a class="fbTab fbHover">
-                <span class="fbTabL"></span>
-                <span class="fbTabText">Layout</span>
-                <span class="fbTabR"></span>
-              </a>
-              <a class="fbTab fbHover">
-                <span class="fbTabL"></span>
-                <span class="fbTabText">DOM</span>
-                <span class="fbTabR"></span>
-              </a>
-           -->
-            </div>
-          </div>
-          
-        </div>
-        
-        <!-- Horizontal Splitter -->
-        <div id="fbHSplitter">&nbsp;</div>
-        
-      </td>
-    </tr>
-    
-    <!-- Interface - Main Area -->
-    <tr id="fbContent">
-    
-      <!-- Panels  -->
-      <td id="fbPanelBox1">
-        <div id="fbPanel1" class="fbFitHeight">
-          <div id="fbConsole" class="fbPanel"></div>
-          <div id="fbHTML" class="fbPanel"></div>
-        </div>
-      </td>
-      
-      <!-- Side Panel Box -->
-      <td id="fbPanelBox2" class="hide">
-      
-        <!-- VerticalSplitter -->
-        <div id="fbVSplitter" class="fbVSplitter">&nbsp;</div>
-        
-        <!-- Side Panels -->
-        <div id="fbPanel2" class="fbFitHeight">
-        
-          <!-- HTML Side Panels -->
-          <div id="fbHTML_Style" class="fbPanel"></div>
-          <div id="fbHTML_Layout" class="fbPanel"></div>
-          <div id="fbHTML_DOM" class="fbPanel"></div>
-          
-        </div>
-        
-        <!-- Large Command Line -->
-        <textarea id="fbLargeCommandLine" class="fbFitHeight"></textarea>
-        
-        <!-- Large Command Line Buttons -->
-        <div id="fbLargeCommandButtons">
-            <a id="fbCommand_btRun" class="fbButton fbHover">Run</a>
-            <a id="fbCommand_btClear" class="fbButton fbHover">Clear</a>
-            
-            <a id="fbSmallCommandLineIcon" class="fbSmallButton fbHover"></a>
-        </div>
-        
-      </td>
-      
-    </tr>
-    
-    <!-- Interface - Bottom Area -->
-    <tr id="fbBottom" class="hide">
-    
-      <!-- Command Line -->
-      <td id="fbCommand" colspan="2">
-        <div id="fbCommandBox">
-          <div id="fbCommandIcon">&gt;&gt;&gt;</div>
-          <input id="fbCommandLine" name="fbCommandLine" type="text" />
-          <a id="fbLargeCommandLineIcon" class="fbSmallButton fbHover"></a>
-        </div>
-      </td>
-      
-    </tr>
-    
-  </tbody>
-</table> 
-<span id="fbMiniChrome">
-  <span id="fbMiniContent">
-    <span id="fbMiniIcon" title="Open Firebug Lite"></span>
-    <span id="fbMiniErrors" class="fbErrors"><!-- 2 errors --></span>
-  </span>
-</span>
-<!-- 
-<div id="fbErrorPopup">
-  <div id="fbErrorPopupContent">
-    <div id="fbErrorIndicator" class="fbErrors">2 errors</div>
-  </div>
-</div>
- -->
-</body>
-</html>
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.png
deleted file mode 100644
index e10affe..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/firebug.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/group.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/group.gif
deleted file mode 100644
index 8db97c2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/group.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/html.css b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/html.css
deleted file mode 100644
index 5b7c5f4..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/html.css
+++ /dev/null
@@ -1,272 +0,0 @@
-/* See license.txt for terms of usage */
-
-.panelNode-html {
-    -moz-box-sizing: padding-box;
-    padding: 4px 0 0 2px;
-}
-
-.nodeBox {
-    position: relative;
-    font-family: Monaco, monospace;
-    padding-left: 13px;
-    -moz-user-select: -moz-none;
-}
-.nodeBox.search-selection {
-    -moz-user-select: text;
-}
-.twisty {
-    position: absolute;
-    left: 0px;
-    top: 0px;
-    width: 14px;
-    height: 14px;
-}
-
-.nodeChildBox {
-    margin-left: 12px;
-    display: none;
-}
-
-.nodeLabel,
-.nodeCloseLabel {
-    margin: -2px 2px 0 2px;
-    border: 2px solid transparent;
-    -moz-border-radius: 3px;
-    padding: 0 2px;
-    color: #000088;
-}
-
-.nodeCloseLabel {
-    display: none;
-}
-
-.nodeTag {
-    cursor: pointer;
-    color: blue;
-}
-
-.nodeValue {
-    color: #FF0000;
-    font-weight: normal;
-}
-
-.nodeText,
-.nodeComment {
-    margin: 0 2px;
-    vertical-align: top;
-}
-
-.nodeText {
-    color: #333333;
-}
-
-.nodeWhiteSpace {
-    border: 1px solid LightGray;
-    white-space: pre; /* otherwise the border will be collapsed around zero pixels */
-    margin-left: 1px;
-    color: gray;
-}
-
-
-.nodeWhiteSpace_Space {
-    border: 1px solid #ddd;
-}
-
-.nodeTextEntity {
-    border: 1px solid gray;
-    white-space: pre; /* otherwise the border will be collapsed around zero pixels */
-    margin-left: 1px;
-}
-
-.nodeComment {
-    color: DarkGreen;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.nodeBox.highlightOpen > .nodeLabel {
-    background-color: #EEEEEE;
-}
-
-.nodeBox.highlightOpen > .nodeCloseLabel,
-.nodeBox.highlightOpen > .nodeChildBox,
-.nodeBox.open > .nodeCloseLabel,
-.nodeBox.open > .nodeChildBox {
-    display: block;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.nodeBox.selected > .nodeLabel > .nodeLabelBox,
-.nodeBox.selected > .nodeLabel {
-    border-color: Highlight;
-    background-color: Highlight;
-    color: HighlightText !important;
-}
-
-.nodeBox.selected > .nodeLabel > .nodeLabelBox,
-.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeTag,
-.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue,
-.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeText {
-    color: inherit !important;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.nodeBox.highlighted > .nodeLabel {
-    border-color: Highlight !important;
-    background-color: cyan !important;
-    color: #000000 !important;
-}
-
-.nodeBox.highlighted > .nodeLabel > .nodeLabelBox,
-.nodeBox.highlighted > .nodeLabel > .nodeLabelBox > .nodeTag,
-.nodeBox.highlighted > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue,
-.nodeBox.highlighted > .nodeLabel > .nodeLabelBox > .nodeText {
-    color: #000000 !important;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox,
-.nodeBox.nodeHidden .nodeCloseLabel,
-.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox > .nodeText,
-.nodeBox.nodeHidden .nodeText {
-    color: #888888;
-}
-
-.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox > .nodeTag,
-.nodeBox.nodeHidden .nodeCloseLabel > .nodeCloseLabelBox > .nodeTag {
-    color: #5F82D9;
-}
-
-.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue {
-    color: #D86060;
-}
-
-.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox,
-.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox > .nodeTag,
-.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue,
-.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox > .nodeText {
-    color: SkyBlue !important;
-}
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-.nodeBox.mutated > .nodeLabel,
-.nodeAttr.mutated,
-.nodeValue.mutated,
-.nodeText.mutated,
-.nodeBox.mutated > .nodeText {
-    background-color: #EFFF79;
-    color: #FF0000 !important;
-}
-
-.nodeBox.selected.mutated > .nodeLabel,
-.nodeBox.selected.mutated > .nodeLabel > .nodeLabelBox,
-.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeAttr.mutated > .nodeValue,
-.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue.mutated,
-.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeText.mutated {
-    background-color: #EFFF79;
-    border-color: #EFFF79;
-    color: #FF0000 !important;
-}
-
-/************************************************************************************************/
-
-.logRow-dirxml {
-    padding-left: 0;
-}
-
-.soloElement > .nodeBox  {
-    padding-left: 0;
-}
-
-.useA11y .nodeLabel.focused {
-    outline: 2px solid #FF9933;
-    -moz-outline-radius: 3px;
-    outline-offset: -2px;
-}
-
-.useA11y .nodeLabelBox:focus {
-    outline: none;
-}
-
-/************************************************************************************************/
-
-.breakpointCode .twisty {
-    display: none;
-}
-
-.breakpointCode .nodeBox.containerNodeBox,
-.breakpointCode .nodeLabel {
-    padding-left: 0px;
-    margin-left: 0px;
-    font-family: Monaco, monospace !important;
-}
-
-.breakpointCode .nodeTag,
-.breakpointCode .nodeAttr,
-.breakpointCode .nodeText,
-.breakpointCode .nodeValue,
-.breakpointCode .nodeLabel {
-    color: DarkGreen !important;
-}
-
-.breakpointMutationType {
-    position: absolute;
-    top: 4px;
-    right: 20px;
-    color: gray;
-}
-
-
-
-
-
-
-/************************************************************************************************/
-/************************************************************************************************/
-/************************************************************************************************/
-/************************************************************************************************/
-/************************************************************************************************/
-/************************************************************************************************/
-/************************************************************************************************/
-/************************************************************************************************/
-/************************************************************************************************/
-/************************************************************************************************/
-
-
-
-/************************************************************************************************/
-/* Twisties */
-
-.twisty,
-.logRow-errorMessage > .hasTwisty > .errorTitle,
-.logRow-log > .objectBox-array.hasTwisty,
-.logRow-spy .spyHead .spyTitle,
-.logGroup > .logRow,
-.memberRow.hasChildren > .memberLabelCell > .memberLabel,
-.hasHeaders .netHrefLabel,
-.netPageRow > .netCol > .netPageTitle {
-    background-image: url(twistyClosed.png);
-    background-repeat: no-repeat;
-    background-position: 2px 2px;
-	min-height: 12px;
-}
-
-.logRow-errorMessage > .hasTwisty.opened > .errorTitle,
-.logRow-log > .objectBox-array.hasTwisty.opened,
-.logRow-spy.opened .spyHead .spyTitle,
-.logGroup.opened > .logRow,
-.memberRow.hasChildren.opened > .memberLabelCell > .memberLabel,
-.nodeBox.highlightOpen > .nodeLabel > .twisty,
-.nodeBox.open > .nodeLabel > .twisty,
-.netRow.opened > .netCol > .netHrefLabel,
-.netPageRow.opened > .netCol > .netPageTitle {
-    background-image: url(twistyOpen.png);
-}
-
-.twisty {
-    background-position: 4px 4px;
-}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/infoIcon.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/infoIcon.gif
deleted file mode 100644
index 0618e20..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/infoIcon.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/infoIcon.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/infoIcon.png
deleted file mode 100644
index da1e533..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/infoIcon.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/loading_16.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/loading_16.gif
deleted file mode 100644
index 085ccae..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/loading_16.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/min.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/min.png
deleted file mode 100644
index 1034d66..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/min.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/minHover.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/minHover.png
deleted file mode 100644
index b0d1e1a..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/minHover.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/off.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/off.png
deleted file mode 100644
index b70b1d2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/off.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/offHover.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/offHover.png
deleted file mode 100644
index f3670f1..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/offHover.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/pixel_transparent.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/pixel_transparent.gif
deleted file mode 100644
index 6865c96..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/pixel_transparent.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/roundCorner.svg b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/roundCorner.svg
deleted file mode 100644
index 2dfa728..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/roundCorner.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg">
-  <rect fill="white"  x="0" y="0" width="100%" height="100%" />
-  <rect fill="highlight"  x="0" y="0" width="100%" height="100%" rx="2px"/>
-</svg>
-
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/search.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/search.gif
deleted file mode 100644
index 2a62098..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/search.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/search.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/search.png
deleted file mode 100644
index fba33b8..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/search.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/shadow.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/shadow.gif
deleted file mode 100644
index af7f537..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/shadow.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/shadow2.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/shadow2.gif
deleted file mode 100644
index 099cbf3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/shadow2.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/shadowAlpha.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/shadowAlpha.png
deleted file mode 100644
index a2561df..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/shadowAlpha.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/sprite.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/sprite.png
deleted file mode 100644
index 33d2c4d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/sprite.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabHoverLeft.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabHoverLeft.png
deleted file mode 100644
index 0fb24d0..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabHoverLeft.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabHoverMid.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabHoverMid.png
deleted file mode 100644
index fbccab5..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabHoverMid.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabHoverRight.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabHoverRight.png
deleted file mode 100644
index 3db0f36..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabHoverRight.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabLeft.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabLeft.png
deleted file mode 100644
index a6cc9e9..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabLeft.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuCheckbox.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuCheckbox.png
deleted file mode 100644
index 4726e62..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuCheckbox.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuPin.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuPin.png
deleted file mode 100644
index eb4b11e..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuPin.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuRadio.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuRadio.png
deleted file mode 100644
index 55b982d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuRadio.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuTarget.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuTarget.png
deleted file mode 100644
index 957bd9f..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuTarget.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuTargetHover.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuTargetHover.png
deleted file mode 100644
index 200a370..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMenuTargetHover.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMid.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMid.png
deleted file mode 100644
index 68986c3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabMid.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabRight.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabRight.png
deleted file mode 100644
index 5011307..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tabRight.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorBorders.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorBorders.gif
deleted file mode 100644
index 0ee5497..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorBorders.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorBorders.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorBorders.png
deleted file mode 100644
index 21682c3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorBorders.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorCorners.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorCorners.gif
deleted file mode 100644
index 04f8421..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorCorners.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorCorners.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorCorners.png
deleted file mode 100644
index a0f839d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/textEditorCorners.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/titlebarMid.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/titlebarMid.png
deleted file mode 100644
index 10998ae..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/titlebarMid.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/toolbarMid.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/toolbarMid.png
deleted file mode 100644
index aa21dee..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/toolbarMid.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tree_close.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tree_close.gif
deleted file mode 100644
index e26728a..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tree_close.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tree_open.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tree_open.gif
deleted file mode 100644
index edf662f..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/tree_open.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/twistyClosed.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/twistyClosed.png
deleted file mode 100644
index f80319b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/twistyClosed.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/twistyOpen.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/twistyOpen.png
deleted file mode 100644
index 8680124..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/twistyOpen.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/up.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/up.png
deleted file mode 100644
index 2174d03..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/up.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/upActive.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/upActive.png
deleted file mode 100644
index 236cf67..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/upActive.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/upHover.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/upHover.png
deleted file mode 100644
index cd81317..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/upHover.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/warningIcon.gif b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/warningIcon.gif
deleted file mode 100644
index 8497278..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/warningIcon.gif
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/warningIcon.png b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/warningIcon.png
deleted file mode 100644
index de51084..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/skin/xp/warningIcon.png
+++ /dev/null
Binary files differ
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/src/firebug-lite-debug.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/src/firebug-lite-debug.js
deleted file mode 100644
index 40b1ae7..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/firebug-lite/src/firebug-lite-debug.js
+++ /dev/null
@@ -1,31176 +0,0 @@
-(function(){
-
-/*!*************************************************************
- *
- *    Firebug Lite 1.4.0
- *
- *      Copyright (c) 2007, Parakey Inc.
- *      Released under BSD license.
- *      More information: http://getfirebug.com/firebuglite
- *
- **************************************************************/
-
-/*!
- * CSS selectors powered by:
- *
- * Sizzle CSS Selector Engine - v1.0
- *  Copyright 2009, The Dojo Foundation
- *  Released under the MIT, BSD, and GPL Licenses.
- *  More information: http://sizzlejs.com/
- */
-
-/** @namespace describe lib */
-
-// FIXME: xxxpedro if we use "var FBL = {}" the FBL won't appear in the DOM Panel in IE
-var FBL = {};
-
-( /** @scope s_lib @this FBL */ function() {
-// ************************************************************************************************
-
-// ************************************************************************************************
-// Constants
-
-var productionDir = "http://getfirebug.com/releases/lite/";
-var bookmarkletVersion = 4;
-
-// ************************************************************************************************
-
-var reNotWhitespace = /[^\s]/;
-var reSplitFile = /:\/{1,3}(.*?)\/([^\/]*?)\/?($|\?.*)/;
-
-// Globals
-this.reJavascript = /\s*javascript:\s*(.*)/;
-this.reChrome = /chrome:\/\/([^\/]*)\//;
-this.reFile = /file:\/\/([^\/]*)\//;
-
-
-// ************************************************************************************************
-// properties
-
-var userAgent = navigator.userAgent.toLowerCase();
-this.isFirefox = /firefox/.test(userAgent);
-this.isOpera   = /opera/.test(userAgent);
-this.isSafari  = /webkit/.test(userAgent);
-this.isIE      = /msie/.test(userAgent) && !/opera/.test(userAgent);
-this.isIE6     = /msie 6/i.test(navigator.appVersion);
-this.browserVersion = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1];
-this.isIElt8   = this.isIE && (this.browserVersion-0 < 8);
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-this.NS = null;
-this.pixelsPerInch = null;
-
-
-// ************************************************************************************************
-// Namespaces
-
-var namespaces = [];
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-this.ns = function(fn)
-{
-    var ns = {};
-    namespaces.push(fn, ns);
-    return ns;
-};
-
-var FBTrace = null;
-
-this.initialize = function()
-{
-    // Firebug Lite is already running in persistent mode so we just quit
-    if (window.firebug && firebug.firebuglite || window.console && console.firebuglite)
-        return;
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // initialize environment
-
-    // point the FBTrace object to the local variable
-    if (FBL.FBTrace)
-        FBTrace = FBL.FBTrace;
-    else
-        FBTrace = FBL.FBTrace = {};
-
-    // check if the actual window is a persisted chrome context
-    var isChromeContext = window.Firebug && typeof window.Firebug.SharedEnv == "object";
-
-    // chrome context of the persistent application
-    if (isChromeContext)
-    {
-        // TODO: xxxpedro persist - make a better synchronization
-        sharedEnv = window.Firebug.SharedEnv;
-        delete window.Firebug.SharedEnv;
-
-        FBL.Env = sharedEnv;
-        FBL.Env.isChromeContext = true;
-        FBTrace.messageQueue = FBL.Env.traceMessageQueue;
-    }
-    // non-persistent application
-    else
-    {
-        FBL.NS = document.documentElement.namespaceURI;
-        FBL.Env.browser = window;
-        FBL.Env.destroy = destroyEnvironment;
-
-        if (document.documentElement.getAttribute("debug") == "true")
-            FBL.Env.Options.startOpened = true;
-
-        // find the URL location of the loaded application
-        findLocation();
-
-        // TODO: get preferences here...
-        // The problem is that we don't have the Firebug object yet, so we can't use
-        // Firebug.loadPrefs. We're using the Store module directly instead.
-        var prefs = FBL.Store.get("FirebugLite") || {};
-        FBL.Env.DefaultOptions = FBL.Env.Options;
-        FBL.Env.Options = FBL.extend(FBL.Env.Options, prefs.options || {});
-
-        if (FBL.isFirefox &&
-            typeof FBL.Env.browser.console == "object" &&
-            FBL.Env.browser.console.firebug &&
-            FBL.Env.Options.disableWhenFirebugActive)
-                return;
-    }
-
-    // exposes the FBL to the global namespace when in debug mode
-    if (FBL.Env.isDebugMode)
-    {
-        FBL.Env.browser.FBL = FBL;
-    }
-
-    // check browser compatibilities
-    this.isQuiksMode = FBL.Env.browser.document.compatMode == "BackCompat";
-    this.isIEQuiksMode = this.isIE && this.isQuiksMode;
-    this.isIEStantandMode = this.isIE && !this.isQuiksMode;
-
-    this.noFixedPosition = this.isIE6 || this.isIEQuiksMode;
-
-    // after creating/synchronizing the environment, initialize the FBTrace module
-    if (FBL.Env.Options.enableTrace) FBTrace.initialize();
-
-    if (FBTrace.DBG_INITIALIZE && isChromeContext) FBTrace.sysout("FBL.initialize - persistent application", "initialize chrome context");
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // initialize namespaces
-
-    if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("FBL.initialize", namespaces.length/2+" namespaces BEGIN");
-
-    for (var i = 0; i < namespaces.length; i += 2)
-    {
-        var fn = namespaces[i];
-        var ns = namespaces[i+1];
-        fn.apply(ns);
-    }
-
-    if (FBTrace.DBG_INITIALIZE) {
-        FBTrace.sysout("FBL.initialize", namespaces.length/2+" namespaces END");
-        FBTrace.sysout("FBL waitForDocument", "waiting document load");
-    }
-
-    FBL.Ajax.initialize();
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // finish environment initialization
-    FBL.Firebug.loadPrefs();
-
-    if (FBL.Env.Options.enablePersistent)
-    {
-        // TODO: xxxpedro persist - make a better synchronization
-        if (isChromeContext)
-        {
-            FBL.FirebugChrome.clone(FBL.Env.FirebugChrome);
-        }
-        else
-        {
-            FBL.Env.FirebugChrome = FBL.FirebugChrome;
-            FBL.Env.traceMessageQueue = FBTrace.messageQueue;
-        }
-    }
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // wait document load
-
-    waitForDocument();
-};
-
-var waitForDocument = function waitForDocument()
-{
-    // document.body not available in XML+XSL documents in Firefox
-    var doc = FBL.Env.browser.document;
-    var body = doc.getElementsByTagName("body")[0];
-
-    if (body)
-    {
-        calculatePixelsPerInch(doc, body);
-        onDocumentLoad();
-    }
-    else
-        setTimeout(waitForDocument, 50);
-};
-
-var onDocumentLoad = function onDocumentLoad()
-{
-    if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("FBL onDocumentLoad", "document loaded");
-
-    // fix IE6 problem with cache of background images, causing a lot of flickering
-    if (FBL.isIE6)
-        fixIE6BackgroundImageCache();
-
-    // chrome context of the persistent application
-    if (FBL.Env.Options.enablePersistent && FBL.Env.isChromeContext)
-    {
-        // finally, start the application in the chrome context
-        FBL.Firebug.initialize();
-
-        // if is not development mode, remove the shared environment cache object
-        // used to synchronize the both persistent contexts
-        if (!FBL.Env.isDevelopmentMode)
-        {
-            sharedEnv.destroy();
-            sharedEnv = null;
-        }
-    }
-    // non-persistent application
-    else
-    {
-        FBL.FirebugChrome.create();
-    }
-};
-
-// ************************************************************************************************
-// Env
-
-var sharedEnv;
-
-this.Env =
-{
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Env Options (will be transported to Firebug options)
-    Options:
-    {
-        saveCookies: true,
-
-        saveWindowPosition: false,
-        saveCommandLineHistory: false,
-
-        startOpened: false,
-        startInNewWindow: false,
-        showIconWhenHidden: true,
-
-        overrideConsole: true,
-        ignoreFirebugElements: true,
-        disableWhenFirebugActive: true,
-
-        disableXHRListener: false,
-        disableResourceFetching: false,
-
-        enableTrace: false,
-        enablePersistent: false
-
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Library location
-    Location:
-    {
-        sourceDir: null,
-        baseDir: null,
-        skinDir: null,
-        skin: null,
-        app: null
-    },
-
-    skin: "xp",
-    useLocalSkin: false,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Env states
-    isDevelopmentMode: false,
-    isDebugMode: false,
-    isChromeContext: false,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Env references
-    browser: null,
-    chrome: null
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var destroyEnvironment = function destroyEnvironment()
-{
-    setTimeout(function()
-    {
-        FBL = null;
-    }, 100);
-};
-
-// ************************************************************************************************
-// Library location
-
-var findLocation =  function findLocation()
-{
-    var reFirebugFile = /(firebug-lite(?:-\w+)?(?:\.js|\.jgz))(?:#(.+))?$/;
-    var reGetFirebugSite = /(?:http|https):\/\/getfirebug.com\//;
-    var isGetFirebugSite;
-
-    var rePath = /^(.*\/)/;
-    var reProtocol = /^\w+:\/\//;
-    var path = null;
-    var doc = document;
-
-    // Firebug Lite 1.3.0 bookmarklet identification
-    var script = doc.getElementById("FirebugLite");
-
-    var scriptSrc;
-    var hasSrcAttribute = true;
-
-    // If the script was loaded via bookmarklet, we already have the script tag
-    if (script)
-    {
-        scriptSrc = script.src;
-        file = reFirebugFile.exec(scriptSrc);
-
-        var version = script.getAttribute("FirebugLite");
-        var number = version ? parseInt(version) : 0;
-
-        if (!version || !number || number < bookmarkletVersion)
-        {
-            FBL.Env.bookmarkletOutdated = true;
-        }
-    }
-    // otherwise we must search for the correct script tag
-    else
-    {
-        for(var i=0, s=doc.getElementsByTagName("script"), si; si=s[i]; i++)
-        {
-            var file = null;
-            if ( si.nodeName.toLowerCase() == "script" )
-            {
-                if (file = reFirebugFile.exec(si.getAttribute("firebugSrc")))
-                {
-                    scriptSrc = si.getAttribute("firebugSrc");
-                    hasSrcAttribute = false;
-                }
-                else if (file = reFirebugFile.exec(si.src))
-                {
-                    scriptSrc = si.src;
-                }
-                else
-                    continue;
-
-                script = si;
-                break;
-            }
-        }
-    }
-
-    // mark the script tag to be ignored by Firebug Lite
-    if (script)
-        script.firebugIgnore = true;
-
-    if (file)
-    {
-        var fileName = file[1];
-        var fileOptions = file[2];
-
-        // absolute path
-        if (reProtocol.test(scriptSrc)) {
-            path = rePath.exec(scriptSrc)[1];
-
-        }
-        // relative path
-        else
-        {
-            var r = rePath.exec(scriptSrc);
-            var src = r ? r[1] : scriptSrc;
-            var backDir = /^((?:\.\.\/)+)(.*)/.exec(src);
-            var reLastDir = /^(.*\/)[^\/]+\/$/;
-            path = rePath.exec(location.href)[1];
-
-            // "../some/path"
-            if (backDir)
-            {
-                var j = backDir[1].length/3;
-                var p;
-                while (j-- > 0)
-                    path = reLastDir.exec(path)[1];
-
-                path += backDir[2];
-            }
-
-            else if(src.indexOf("/") != -1)
-            {
-                // "./some/path"
-                if(/^\.\/./.test(src))
-                {
-                    path += src.substring(2);
-                }
-                // "/some/path"
-                else if(/^\/./.test(src))
-                {
-                    var domain = /^(\w+:\/\/[^\/]+)/.exec(path);
-                    path = domain[1] + src;
-                }
-                // "some/path"
-                else
-                {
-                    path += src;
-                }
-            }
-        }
-    }
-
-    FBL.Env.isChromeExtension = script && script.getAttribute("extension") == "Chrome";
-    if (FBL.Env.isChromeExtension)
-    {
-        path = productionDir;
-        FBL.Env.bookmarkletOutdated = false;
-        script = {innerHTML: "{showIconWhenHidden:false}"};
-    }
-
-    isGetFirebugSite = reGetFirebugSite.test(path);
-
-    if (isGetFirebugSite && path.indexOf("/releases/lite/") == -1)
-    {
-        // See Issue 4587 - If we are loading the script from getfirebug.com shortcut, like
-        // https://getfirebug.com/firebug-lite.js, then we must manually add the full path,
-        // otherwise the Env.Location will hold the wrong path, which will in turn lead to
-        // undesirable effects like the problem in Issue 4587
-        path += "releases/lite/" + (fileName == "firebug-lite-beta.js" ? "beta/" : "latest/");
-    }
-
-    var m = path && path.match(/([^\/]+)\/$/) || null;
-
-    if (path && m)
-    {
-        var Env = FBL.Env;
-
-        // Always use the local skin when running in the same domain
-        // See Issue 3554: Firebug Lite should use local images when loaded locally
-        Env.useLocalSkin = path.indexOf(location.protocol + "//" + location.host + "/") == 0 &&
-                // but we cannot use the locan skin when loaded from getfirebug.com, otherwise
-                // the bookmarklet won't work when visiting getfirebug.com
-                !isGetFirebugSite;
-
-        // detecting development and debug modes via file name
-        if (fileName == "firebug-lite-dev.js")
-        {
-            Env.isDevelopmentMode = true;
-            Env.isDebugMode = true;
-        }
-        else if (fileName == "firebug-lite-debug.js")
-        {
-            Env.isDebugMode = true;
-        }
-
-        // process the <html debug="true">
-        if (Env.browser.document.documentElement.getAttribute("debug") == "true")
-        {
-            Env.Options.startOpened = true;
-        }
-
-        // process the Script URL Options
-        if (fileOptions)
-        {
-            var options = fileOptions.split(",");
-
-            for (var i = 0, length = options.length; i < length; i++)
-            {
-                var option = options[i];
-                var name, value;
-
-                if (option.indexOf("=") != -1)
-                {
-                    var parts = option.split("=");
-                    name = parts[0];
-                    value = eval(unescape(parts[1]));
-                }
-                else
-                {
-                    name = option;
-                    value = true;
-                }
-
-                if (name == "debug")
-                {
-                    Env.isDebugMode = !!value;
-                }
-                else if (name in Env.Options)
-                {
-                    Env.Options[name] = value;
-                }
-                else
-                {
-                    Env[name] = value;
-                }
-            }
-        }
-
-        // process the Script JSON Options
-        if (hasSrcAttribute)
-        {
-            var innerOptions = FBL.trim(script.innerHTML);
-            if (innerOptions)
-            {
-                var innerOptionsObject = eval("(" + innerOptions + ")");
-
-                for (var name in innerOptionsObject)
-                {
-                    var value = innerOptionsObject[name];
-
-                    if (name == "debug")
-                    {
-                        Env.isDebugMode = !!value;
-                    }
-                    else if (name in Env.Options)
-                    {
-                        Env.Options[name] = value;
-                    }
-                    else
-                    {
-                        Env[name] = value;
-                    }
-                }
-            }
-        }
-
-        if (!Env.Options.saveCookies)
-            FBL.Store.remove("FirebugLite");
-
-        // process the Debug Mode
-        if (Env.isDebugMode)
-        {
-            Env.Options.startOpened = true;
-            Env.Options.enableTrace = true;
-            Env.Options.disableWhenFirebugActive = false;
-        }
-
-        var loc = Env.Location;
-        var isProductionRelease = path.indexOf(productionDir) != -1;
-
-        loc.sourceDir = path;
-        loc.baseDir = path.substr(0, path.length - m[1].length - 1);
-        loc.skinDir = (isProductionRelease ? path : loc.baseDir) + "skin/" + Env.skin + "/";
-        loc.skin = loc.skinDir + "firebug.html";
-        loc.app = path + fileName;
-    }
-    else
-    {
-        throw new Error("Firebug Error: Library path not found");
-    }
-};
-
-// ************************************************************************************************
-// Basics
-
-this.bind = function()  // fn, thisObject, args => thisObject.fn(args, arguments);
-{
-   var args = cloneArray(arguments), fn = args.shift(), object = args.shift();
-   return function() { return fn.apply(object, arrayInsert(cloneArray(args), 0, arguments)); };
-};
-
-this.bindFixed = function() // fn, thisObject, args => thisObject.fn(args);
-{
-    var args = cloneArray(arguments), fn = args.shift(), object = args.shift();
-    return function() { return fn.apply(object, args); };
-};
-
-this.extend = function(l, r)
-{
-    var newOb = {};
-    for (var n in l)
-        newOb[n] = l[n];
-    for (var n in r)
-        newOb[n] = r[n];
-    return newOb;
-};
-
-this.descend = function(prototypeParent, childProperties)
-{
-    function protoSetter() {};
-    protoSetter.prototype = prototypeParent;
-    var newOb = new protoSetter();
-    for (var n in childProperties)
-        newOb[n] = childProperties[n];
-    return newOb;
-};
-
-this.append = function(l, r)
-{
-    for (var n in r)
-        l[n] = r[n];
-
-    return l;
-};
-
-this.keys = function(map)  // At least sometimes the keys will be on user-level window objects
-{
-    var keys = [];
-    try
-    {
-        for (var name in map)  // enumeration is safe
-            keys.push(name);   // name is string, safe
-    }
-    catch (exc)
-    {
-        // Sometimes we get exceptions trying to iterate properties
-    }
-
-    return keys;  // return is safe
-};
-
-this.values = function(map)
-{
-    var values = [];
-    try
-    {
-        for (var name in map)
-        {
-            try
-            {
-                values.push(map[name]);
-            }
-            catch (exc)
-            {
-                // Sometimes we get exceptions trying to access properties
-                if (FBTrace.DBG_ERRORS)
-                    FBTrace.sysout("lib.values FAILED ", exc);
-            }
-
-        }
-    }
-    catch (exc)
-    {
-        // Sometimes we get exceptions trying to iterate properties
-        if (FBTrace.DBG_ERRORS)
-            FBTrace.sysout("lib.values FAILED ", exc);
-    }
-
-    return values;
-};
-
-this.remove = function(list, item)
-{
-    for (var i = 0; i < list.length; ++i)
-    {
-        if (list[i] == item)
-        {
-            list.splice(i, 1);
-            break;
-        }
-    }
-};
-
-this.sliceArray = function(array, index)
-{
-    var slice = [];
-    for (var i = index; i < array.length; ++i)
-        slice.push(array[i]);
-
-    return slice;
-};
-
-function cloneArray(array, fn)
-{
-   var newArray = [];
-
-   if (fn)
-       for (var i = 0; i < array.length; ++i)
-           newArray.push(fn(array[i]));
-   else
-       for (var i = 0; i < array.length; ++i)
-           newArray.push(array[i]);
-
-   return newArray;
-}
-
-function extendArray(array, array2)
-{
-   var newArray = [];
-   newArray.push.apply(newArray, array);
-   newArray.push.apply(newArray, array2);
-   return newArray;
-}
-
-this.extendArray = extendArray;
-this.cloneArray = cloneArray;
-
-function arrayInsert(array, index, other)
-{
-   for (var i = 0; i < other.length; ++i)
-       array.splice(i+index, 0, other[i]);
-
-   return array;
-}
-
-// ************************************************************************************************
-
-this.createStyleSheet = function(doc, url)
-{
-    //TODO: xxxpedro
-    //var style = doc.createElementNS("http://www.w3.org/1999/xhtml", "style");
-    var style = this.createElement("link");
-    style.setAttribute("charset","utf-8");
-    style.firebugIgnore = true;
-    style.setAttribute("rel", "stylesheet");
-    style.setAttribute("type", "text/css");
-    style.setAttribute("href", url);
-
-    //TODO: xxxpedro
-    //style.innerHTML = this.getResource(url);
-    return style;
-};
-
-this.addStyleSheet = function(doc, style)
-{
-    var heads = doc.getElementsByTagName("head");
-    if (heads.length)
-        heads[0].appendChild(style);
-    else
-        doc.documentElement.appendChild(style);
-};
-
-this.appendStylesheet = function(doc, uri)
-{
-    // Make sure the stylesheet is not appended twice.
-    if (this.$(uri, doc))
-        return;
-
-    var styleSheet = this.createStyleSheet(doc, uri);
-    styleSheet.setAttribute("id", uri);
-    this.addStyleSheet(doc, styleSheet);
-};
-
-this.addScript = function(doc, id, src)
-{
-    var element = doc.createElementNS("http://www.w3.org/1999/xhtml", "html:script");
-    element.setAttribute("type", "text/javascript");
-    element.setAttribute("id", id);
-    if (!FBTrace.DBG_CONSOLE)
-        FBL.unwrapObject(element).firebugIgnore = true;
-
-    element.innerHTML = src;
-    if (doc.documentElement)
-        doc.documentElement.appendChild(element);
-    else
-    {
-        // See issue 1079, the svg test case gives this error
-        if (FBTrace.DBG_ERRORS)
-            FBTrace.sysout("lib.addScript doc has no documentElement:", doc);
-    }
-    return element;
-};
-
-
-// ************************************************************************************************
-
-this.getStyle = this.isIE ?
-    function(el, name)
-    {
-        return el.currentStyle[name] || el.style[name] || undefined;
-    }
-    :
-    function(el, name)
-    {
-        return el.ownerDocument.defaultView.getComputedStyle(el,null)[name]
-            || el.style[name] || undefined;
-    };
-
-
-// ************************************************************************************************
-// Whitespace and Entity conversions
-
-var entityConversionLists = this.entityConversionLists = {
-    normal : {
-        whitespace : {
-            '\t' : '\u200c\u2192',
-            '\n' : '\u200c\u00b6',
-            '\r' : '\u200c\u00ac',
-            ' '  : '\u200c\u00b7'
-        }
-    },
-    reverse : {
-        whitespace : {
-            '&Tab;' : '\t',
-            '&NewLine;' : '\n',
-            '\u200c\u2192' : '\t',
-            '\u200c\u00b6' : '\n',
-            '\u200c\u00ac' : '\r',
-            '\u200c\u00b7' : ' '
-        }
-    }
-};
-
-var normal = entityConversionLists.normal,
-    reverse = entityConversionLists.reverse;
-
-function addEntityMapToList(ccode, entity)
-{
-    var lists = Array.prototype.slice.call(arguments, 2),
-        len = lists.length,
-        ch = String.fromCharCode(ccode);
-    for (var i = 0; i < len; i++)
-    {
-        var list = lists[i];
-        normal[list]=normal[list] || {};
-        normal[list][ch] = '&' + entity + ';';
-        reverse[list]=reverse[list] || {};
-        reverse[list]['&' + entity + ';'] = ch;
-    }
-};
-
-var e = addEntityMapToList,
-    white = 'whitespace',
-    text = 'text',
-    attr = 'attributes',
-    css = 'css',
-    editor = 'editor';
-
-e(0x0022, 'quot', attr, css);
-e(0x0026, 'amp', attr, text, css);
-e(0x0027, 'apos', css);
-e(0x003c, 'lt', attr, text, css);
-e(0x003e, 'gt', attr, text, css);
-e(0xa9, 'copy', text, editor);
-e(0xae, 'reg', text, editor);
-e(0x2122, 'trade', text, editor);
-
-// See http://en.wikipedia.org/wiki/Dash
-e(0x2012, '#8210', attr, text, editor); // figure dash
-e(0x2013, 'ndash', attr, text, editor); // en dash
-e(0x2014, 'mdash', attr, text, editor); // em dash
-e(0x2015, '#8213', attr, text, editor); // horizontal bar
-
-e(0x00a0, 'nbsp', attr, text, white, editor);
-e(0x2002, 'ensp', attr, text, white, editor);
-e(0x2003, 'emsp', attr, text, white, editor);
-e(0x2009, 'thinsp', attr, text, white, editor);
-e(0x200c, 'zwnj', attr, text, white, editor);
-e(0x200d, 'zwj', attr, text, white, editor);
-e(0x200e, 'lrm', attr, text, white, editor);
-e(0x200f, 'rlm', attr, text, white, editor);
-e(0x200b, '#8203', attr, text, white, editor); // zero-width space (ZWSP)
-
-//************************************************************************************************
-// Entity escaping
-
-var entityConversionRegexes = {
-        normal : {},
-        reverse : {}
-    };
-
-var escapeEntitiesRegEx = {
-    normal : function(list)
-    {
-        var chars = [];
-        for ( var ch in list)
-        {
-            chars.push(ch);
-        }
-        return new RegExp('([' + chars.join('') + '])', 'gm');
-    },
-    reverse : function(list)
-    {
-        var chars = [];
-        for ( var ch in list)
-        {
-            chars.push(ch);
-        }
-        return new RegExp('(' + chars.join('|') + ')', 'gm');
-    }
-};
-
-function getEscapeRegexp(direction, lists)
-{
-    var name = '', re;
-    var groups = [].concat(lists);
-    for (i = 0; i < groups.length; i++)
-    {
-        name += groups[i].group;
-    }
-    re = entityConversionRegexes[direction][name];
-    if (!re)
-    {
-        var list = {};
-        if (groups.length > 1)
-        {
-            for ( var i = 0; i < groups.length; i++)
-            {
-                var aList = entityConversionLists[direction][groups[i].group];
-                for ( var item in aList)
-                    list[item] = aList[item];
-            }
-        } else if (groups.length==1)
-        {
-            list = entityConversionLists[direction][groups[0].group]; // faster for special case
-        } else {
-            list = {}; // perhaps should print out an error here?
-        }
-        re = entityConversionRegexes[direction][name] = escapeEntitiesRegEx[direction](list);
-    }
-    return re;
-};
-
-function createSimpleEscape(name, direction)
-{
-    return function(value)
-    {
-        var list = entityConversionLists[direction][name];
-        return String(value).replace(
-                getEscapeRegexp(direction, {
-                    group : name,
-                    list : list
-                }),
-                function(ch)
-                {
-                    return list[ch];
-                }
-               );
-    };
-};
-
-function escapeGroupsForEntities(str, lists)
-{
-    lists = [].concat(lists);
-    var re = getEscapeRegexp('normal', lists),
-        split = String(str).split(re),
-        len = split.length,
-        results = [],
-        cur, r, i, ri = 0, l, list, last = '';
-    if (!len)
-        return [ {
-            str : String(str),
-            group : '',
-            name : ''
-        } ];
-    for (i = 0; i < len; i++)
-    {
-        cur = split[i];
-        if (cur == '')
-            continue;
-        for (l = 0; l < lists.length; l++)
-        {
-            list = lists[l];
-            r = entityConversionLists.normal[list.group][cur];
-            // if (cur == ' ' && list.group == 'whitespace' && last == ' ') // only show for runs of more than one space
-            //     r = ' ';
-            if (r)
-            {
-                results[ri] = {
-                    'str' : r,
-                    'class' : list['class'],
-                    'extra' : list.extra[cur] ? list['class']
-                            + list.extra[cur] : ''
-                };
-                break;
-            }
-        }
-        // last=cur;
-        if (!r)
-            results[ri] = {
-                'str' : cur,
-                'class' : '',
-                'extra' : ''
-            };
-        ri++;
-    }
-    return results;
-};
-
-this.escapeGroupsForEntities = escapeGroupsForEntities;
-
-
-function unescapeEntities(str, lists)
-{
-    var re = getEscapeRegexp('reverse', lists),
-        split = String(str).split(re),
-        len = split.length,
-        results = [],
-        cur, r, i, ri = 0, l, list;
-    if (!len)
-        return str;
-    lists = [].concat(lists);
-    for (i = 0; i < len; i++)
-    {
-        cur = split[i];
-        if (cur == '')
-            continue;
-        for (l = 0; l < lists.length; l++)
-        {
-            list = lists[l];
-            r = entityConversionLists.reverse[list.group][cur];
-            if (r)
-            {
-                results[ri] = r;
-                break;
-            }
-        }
-        if (!r)
-            results[ri] = cur;
-        ri++;
-    }
-    return results.join('') || '';
-};
-
-
-// ************************************************************************************************
-// String escaping
-
-var escapeForTextNode = this.escapeForTextNode = createSimpleEscape('text', 'normal');
-var escapeForHtmlEditor = this.escapeForHtmlEditor = createSimpleEscape('editor', 'normal');
-var escapeForElementAttribute = this.escapeForElementAttribute = createSimpleEscape('attributes', 'normal');
-var escapeForCss = this.escapeForCss = createSimpleEscape('css', 'normal');
-
-// deprecated compatibility functions
-//this.deprecateEscapeHTML = createSimpleEscape('text', 'normal');
-//this.deprecatedUnescapeHTML = createSimpleEscape('text', 'reverse');
-//this.escapeHTML = deprecated("use appropriate escapeFor... function", this.deprecateEscapeHTML);
-//this.unescapeHTML = deprecated("use appropriate unescapeFor... function", this.deprecatedUnescapeHTML);
-
-var escapeForSourceLine = this.escapeForSourceLine = createSimpleEscape('text', 'normal');
-
-var unescapeWhitespace = createSimpleEscape('whitespace', 'reverse');
-
-this.unescapeForTextNode = function(str)
-{
-    if (Firebug.showTextNodesWithWhitespace)
-        str = unescapeWhitespace(str);
-    if (!Firebug.showTextNodesWithEntities)
-        str = escapeForElementAttribute(str);
-    return str;
-};
-
-this.escapeNewLines = function(value)
-{
-    return value.replace(/\r/g, "\\r").replace(/\n/g, "\\n");
-};
-
-this.stripNewLines = function(value)
-{
-    return typeof(value) == "string" ? value.replace(/[\r\n]/g, " ") : value;
-};
-
-this.escapeJS = function(value)
-{
-    return value.replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace('"', '\\"', "g");
-};
-
-function escapeHTMLAttribute(value)
-{
-    function replaceChars(ch)
-    {
-        switch (ch)
-        {
-            case "&":
-                return "&amp;";
-            case "'":
-                return apos;
-            case '"':
-                return quot;
-        }
-        return "?";
-    };
-    var apos = "&#39;", quot = "&quot;", around = '"';
-    if( value.indexOf('"') == -1 ) {
-        quot = '"';
-        apos = "'";
-    } else if( value.indexOf("'") == -1 ) {
-        quot = '"';
-        around = "'";
-    }
-    return around + (String(value).replace(/[&'"]/g, replaceChars)) + around;
-}
-
-
-function escapeHTML(value)
-{
-    function replaceChars(ch)
-    {
-        switch (ch)
-        {
-            case "<":
-                return "&lt;";
-            case ">":
-                return "&gt;";
-            case "&":
-                return "&amp;";
-            case "'":
-                return "&#39;";
-            case '"':
-                return "&quot;";
-        }
-        return "?";
-    };
-    return String(value).replace(/[<>&"']/g, replaceChars);
-}
-
-this.escapeHTML = escapeHTML;
-
-this.cropString = function(text, limit)
-{
-    text = text + "";
-
-    if (!limit)
-        var halfLimit = 50;
-    else
-        var halfLimit = limit / 2;
-
-    if (text.length > limit)
-        return this.escapeNewLines(text.substr(0, halfLimit) + "..." + text.substr(text.length-halfLimit));
-    else
-        return this.escapeNewLines(text);
-};
-
-this.isWhitespace = function(text)
-{
-    return !reNotWhitespace.exec(text);
-};
-
-this.splitLines = function(text)
-{
-    var reSplitLines2 = /.*(:?\r\n|\n|\r)?/mg;
-    var lines;
-    if (text.match)
-    {
-        lines = text.match(reSplitLines2);
-    }
-    else
-    {
-        var str = text+"";
-        lines = str.match(reSplitLines2);
-    }
-    lines.pop();
-    return lines;
-};
-
-
-// ************************************************************************************************
-
-this.safeToString = function(ob)
-{
-    if (this.isIE)
-    {
-        try
-        {
-            // FIXME: xxxpedro this is failing in IE for the global "external" object
-            return ob + "";
-        }
-        catch(E)
-        {
-            FBTrace.sysout("Lib.safeToString() failed for ", ob);
-            return "";
-        }
-    }
-
-    try
-    {
-        if (ob && "toString" in ob && typeof ob.toString == "function")
-            return ob.toString();
-    }
-    catch (exc)
-    {
-        // xxxpedro it is not safe to use ob+""?
-        return ob + "";
-        ///return "[an object with no toString() function]";
-    }
-};
-
-// ************************************************************************************************
-
-this.hasProperties = function(ob)
-{
-    try
-    {
-        for (var name in ob)
-            return true;
-    } catch (exc) {}
-    return false;
-};
-
-// ************************************************************************************************
-// String Util
-
-var reTrim = /^\s+|\s+$/g;
-this.trim = function(s)
-{
-    return s.replace(reTrim, "");
-};
-
-
-// ************************************************************************************************
-// Empty
-
-this.emptyFn = function(){};
-
-
-
-// ************************************************************************************************
-// Visibility
-
-this.isVisible = function(elt)
-{
-    /*
-    if (elt instanceof XULElement)
-    {
-        //FBTrace.sysout("isVisible elt.offsetWidth: "+elt.offsetWidth+" offsetHeight:"+ elt.offsetHeight+" localName:"+ elt.localName+" nameSpace:"+elt.nameSpaceURI+"\n");
-        return (!elt.hidden && !elt.collapsed);
-    }
-    /**/
-
-    return this.getStyle(elt, "visibility") != "hidden" &&
-        ( elt.offsetWidth > 0 || elt.offsetHeight > 0
-        || elt.tagName in invisibleTags
-        || elt.namespaceURI == "http://www.w3.org/2000/svg"
-        || elt.namespaceURI == "http://www.w3.org/1998/Math/MathML" );
-};
-
-this.collapse = function(elt, collapsed)
-{
-    // IE6 doesn't support the [collapsed] CSS selector. IE7 does support the selector,
-    // but it is causing a bug (the element disappears when you set the "collapsed"
-    // attribute, but it doesn't appear when you remove the attribute. So, for those
-    // cases, we need to use the class attribute.
-    if (this.isIElt8)
-    {
-        if (collapsed)
-            this.setClass(elt, "collapsed");
-        else
-            this.removeClass(elt, "collapsed");
-    }
-    else
-        elt.setAttribute("collapsed", collapsed ? "true" : "false");
-};
-
-this.obscure = function(elt, obscured)
-{
-    if (obscured)
-        this.setClass(elt, "obscured");
-    else
-        this.removeClass(elt, "obscured");
-};
-
-this.hide = function(elt, hidden)
-{
-    elt.style.visibility = hidden ? "hidden" : "visible";
-};
-
-this.clearNode = function(node)
-{
-    var nodeName = " " + node.nodeName.toLowerCase() + " ";
-    var ignoreTags = " table tbody thead tfoot th tr td ";
-
-    // IE can't use innerHTML of table elements
-    if (this.isIE && ignoreTags.indexOf(nodeName) != -1)
-        this.eraseNode(node);
-    else
-        node.innerHTML = "";
-};
-
-this.eraseNode = function(node)
-{
-    while (node.lastChild)
-        node.removeChild(node.lastChild);
-};
-
-// ************************************************************************************************
-// Window iteration
-
-this.iterateWindows = function(win, handler)
-{
-    if (!win || !win.document)
-        return;
-
-    handler(win);
-
-    if (win == top || !win.frames) return; // XXXjjb hack for chromeBug
-
-    for (var i = 0; i < win.frames.length; ++i)
-    {
-        var subWin = win.frames[i];
-        if (subWin != win)
-            this.iterateWindows(subWin, handler);
-    }
-};
-
-this.getRootWindow = function(win)
-{
-    for (; win; win = win.parent)
-    {
-        if (!win.parent || win == win.parent || !this.instanceOf(win.parent, "Window"))
-            return win;
-    }
-    return null;
-};
-
-// ************************************************************************************************
-// Graphics
-
-this.getClientOffset = function(elt)
-{
-    var addOffset = function addOffset(elt, coords, view)
-    {
-        var p = elt.offsetParent;
-
-        ///var style = isIE ? elt.currentStyle : view.getComputedStyle(elt, "");
-        var chrome = Firebug.chrome;
-
-        if (elt.offsetLeft)
-            ///coords.x += elt.offsetLeft + parseInt(style.borderLeftWidth);
-            coords.x += elt.offsetLeft + chrome.getMeasurementInPixels(elt, "borderLeft");
-        if (elt.offsetTop)
-            ///coords.y += elt.offsetTop + parseInt(style.borderTopWidth);
-            coords.y += elt.offsetTop + chrome.getMeasurementInPixels(elt, "borderTop");
-
-        if (p)
-        {
-            if (p.nodeType == 1)
-                addOffset(p, coords, view);
-        }
-        else
-        {
-            var otherView = isIE ? elt.ownerDocument.parentWindow : elt.ownerDocument.defaultView;
-            // IE will fail when reading the frameElement property of a popup window.
-            // We don't need it anyway once it is outside the (popup) viewport, so we're
-            // ignoring the frameElement check when the window is a popup
-            if (!otherView.opener && otherView.frameElement)
-                addOffset(otherView.frameElement, coords, otherView);
-        }
-    };
-
-    var isIE = this.isIE;
-    var coords = {x: 0, y: 0};
-    if (elt)
-    {
-        var view = isIE ? elt.ownerDocument.parentWindow : elt.ownerDocument.defaultView;
-        addOffset(elt, coords, view);
-    }
-
-    return coords;
-};
-
-this.getViewOffset = function(elt, singleFrame)
-{
-    function addOffset(elt, coords, view)
-    {
-        var p = elt.offsetParent;
-        coords.x += elt.offsetLeft - (p ? p.scrollLeft : 0);
-        coords.y += elt.offsetTop - (p ? p.scrollTop : 0);
-
-        if (p)
-        {
-            if (p.nodeType == 1)
-            {
-                var parentStyle = view.getComputedStyle(p, "");
-                if (parentStyle.position != "static")
-                {
-                    coords.x += parseInt(parentStyle.borderLeftWidth);
-                    coords.y += parseInt(parentStyle.borderTopWidth);
-
-                    if (p.localName == "TABLE")
-                    {
-                        coords.x += parseInt(parentStyle.paddingLeft);
-                        coords.y += parseInt(parentStyle.paddingTop);
-                    }
-                    else if (p.localName == "BODY")
-                    {
-                        var style = view.getComputedStyle(elt, "");
-                        coords.x += parseInt(style.marginLeft);
-                        coords.y += parseInt(style.marginTop);
-                    }
-                }
-                else if (p.localName == "BODY")
-                {
-                    coords.x += parseInt(parentStyle.borderLeftWidth);
-                    coords.y += parseInt(parentStyle.borderTopWidth);
-                }
-
-                var parent = elt.parentNode;
-                while (p != parent)
-                {
-                    coords.x -= parent.scrollLeft;
-                    coords.y -= parent.scrollTop;
-                    parent = parent.parentNode;
-                }
-                addOffset(p, coords, view);
-            }
-        }
-        else
-        {
-            if (elt.localName == "BODY")
-            {
-                var style = view.getComputedStyle(elt, "");
-                coords.x += parseInt(style.borderLeftWidth);
-                coords.y += parseInt(style.borderTopWidth);
-
-                var htmlStyle = view.getComputedStyle(elt.parentNode, "");
-                coords.x -= parseInt(htmlStyle.paddingLeft);
-                coords.y -= parseInt(htmlStyle.paddingTop);
-            }
-
-            if (elt.scrollLeft)
-                coords.x += elt.scrollLeft;
-            if (elt.scrollTop)
-                coords.y += elt.scrollTop;
-
-            var win = elt.ownerDocument.defaultView;
-            if (win && (!singleFrame && win.frameElement))
-                addOffset(win.frameElement, coords, win);
-        }
-
-    }
-
-    var coords = {x: 0, y: 0};
-    if (elt)
-        addOffset(elt, coords, elt.ownerDocument.defaultView);
-
-    return coords;
-};
-
-this.getLTRBWH = function(elt)
-{
-    var bcrect,
-        dims = {"left": 0, "top": 0, "right": 0, "bottom": 0, "width": 0, "height": 0};
-
-    if (elt)
-    {
-        bcrect = elt.getBoundingClientRect();
-        dims.left = bcrect.left;
-        dims.top = bcrect.top;
-        dims.right = bcrect.right;
-        dims.bottom = bcrect.bottom;
-
-        if(bcrect.width)
-        {
-            dims.width = bcrect.width;
-            dims.height = bcrect.height;
-        }
-        else
-        {
-            dims.width = dims.right - dims.left;
-            dims.height = dims.bottom - dims.top;
-        }
-    }
-    return dims;
-};
-
-this.applyBodyOffsets = function(elt, clientRect)
-{
-    var od = elt.ownerDocument;
-    if (!od.body)
-        return clientRect;
-
-    var style = od.defaultView.getComputedStyle(od.body, null);
-
-    var pos = style.getPropertyValue('position');
-    if(pos === 'absolute' || pos === 'relative')
-    {
-        var borderLeft = parseInt(style.getPropertyValue('border-left-width').replace('px', ''),10) || 0;
-        var borderTop = parseInt(style.getPropertyValue('border-top-width').replace('px', ''),10) || 0;
-        var paddingLeft = parseInt(style.getPropertyValue('padding-left').replace('px', ''),10) || 0;
-        var paddingTop = parseInt(style.getPropertyValue('padding-top').replace('px', ''),10) || 0;
-        var marginLeft = parseInt(style.getPropertyValue('margin-left').replace('px', ''),10) || 0;
-        var marginTop = parseInt(style.getPropertyValue('margin-top').replace('px', ''),10) || 0;
-
-        var offsetX = borderLeft + paddingLeft + marginLeft;
-        var offsetY = borderTop + paddingTop + marginTop;
-
-        clientRect.left -= offsetX;
-        clientRect.top -= offsetY;
-        clientRect.right -= offsetX;
-        clientRect.bottom -= offsetY;
-    }
-
-    return clientRect;
-};
-
-this.getOffsetSize = function(elt)
-{
-    return {width: elt.offsetWidth, height: elt.offsetHeight};
-};
-
-this.getOverflowParent = function(element)
-{
-    for (var scrollParent = element.parentNode; scrollParent; scrollParent = scrollParent.offsetParent)
-    {
-        if (scrollParent.scrollHeight > scrollParent.offsetHeight)
-            return scrollParent;
-    }
-};
-
-this.isScrolledToBottom = function(element)
-{
-    var onBottom = (element.scrollTop + element.offsetHeight) == element.scrollHeight;
-    if (FBTrace.DBG_CONSOLE)
-        FBTrace.sysout("isScrolledToBottom offsetHeight: "+element.offsetHeight +" onBottom:"+onBottom);
-    return onBottom;
-};
-
-this.scrollToBottom = function(element)
-{
-        element.scrollTop = element.scrollHeight;
-
-        if (FBTrace.DBG_CONSOLE)
-        {
-            FBTrace.sysout("scrollToBottom reset scrollTop "+element.scrollTop+" = "+element.scrollHeight);
-            if (element.scrollHeight == element.offsetHeight)
-                FBTrace.sysout("scrollToBottom attempt to scroll non-scrollable element "+element, element);
-        }
-
-        return (element.scrollTop == element.scrollHeight);
-};
-
-this.move = function(element, x, y)
-{
-    element.style.left = x + "px";
-    element.style.top = y + "px";
-};
-
-this.resize = function(element, w, h)
-{
-    element.style.width = w + "px";
-    element.style.height = h + "px";
-};
-
-this.linesIntoCenterView = function(element, scrollBox)  // {before: int, after: int}
-{
-    if (!scrollBox)
-        scrollBox = this.getOverflowParent(element);
-
-    if (!scrollBox)
-        return;
-
-    var offset = this.getClientOffset(element);
-
-    var topSpace = offset.y - scrollBox.scrollTop;
-    var bottomSpace = (scrollBox.scrollTop + scrollBox.clientHeight)
-            - (offset.y + element.offsetHeight);
-
-    if (topSpace < 0 || bottomSpace < 0)
-    {
-        var split = (scrollBox.clientHeight/2);
-        var centerY = offset.y - split;
-        scrollBox.scrollTop = centerY;
-        topSpace = split;
-        bottomSpace = split -  element.offsetHeight;
-    }
-
-    return {before: Math.round((topSpace/element.offsetHeight) + 0.5),
-            after: Math.round((bottomSpace/element.offsetHeight) + 0.5) };
-};
-
-this.scrollIntoCenterView = function(element, scrollBox, notX, notY)
-{
-    if (!element)
-        return;
-
-    if (!scrollBox)
-        scrollBox = this.getOverflowParent(element);
-
-    if (!scrollBox)
-        return;
-
-    var offset = this.getClientOffset(element);
-
-    if (!notY)
-    {
-        var topSpace = offset.y - scrollBox.scrollTop;
-        var bottomSpace = (scrollBox.scrollTop + scrollBox.clientHeight)
-            - (offset.y + element.offsetHeight);
-
-        if (topSpace < 0 || bottomSpace < 0)
-        {
-            var centerY = offset.y - (scrollBox.clientHeight/2);
-            scrollBox.scrollTop = centerY;
-        }
-    }
-
-    if (!notX)
-    {
-        var leftSpace = offset.x - scrollBox.scrollLeft;
-        var rightSpace = (scrollBox.scrollLeft + scrollBox.clientWidth)
-            - (offset.x + element.clientWidth);
-
-        if (leftSpace < 0 || rightSpace < 0)
-        {
-            var centerX = offset.x - (scrollBox.clientWidth/2);
-            scrollBox.scrollLeft = centerX;
-        }
-    }
-    if (FBTrace.DBG_SOURCEFILES)
-        FBTrace.sysout("lib.scrollIntoCenterView ","Element:"+element.innerHTML);
-};
-
-
-// ************************************************************************************************
-// CSS
-
-var cssKeywordMap = null;
-var cssPropNames = null;
-var cssColorNames = null;
-var imageRules = null;
-
-this.getCSSKeywordsByProperty = function(propName)
-{
-    if (!cssKeywordMap)
-    {
-        cssKeywordMap = {};
-
-        for (var name in this.cssInfo)
-        {
-            var list = [];
-
-            var types = this.cssInfo[name];
-            for (var i = 0; i < types.length; ++i)
-            {
-                var keywords = this.cssKeywords[types[i]];
-                if (keywords)
-                    list.push.apply(list, keywords);
-            }
-
-            cssKeywordMap[name] = list;
-        }
-    }
-
-    return propName in cssKeywordMap ? cssKeywordMap[propName] : [];
-};
-
-this.getCSSPropertyNames = function()
-{
-    if (!cssPropNames)
-    {
-        cssPropNames = [];
-
-        for (var name in this.cssInfo)
-            cssPropNames.push(name);
-    }
-
-    return cssPropNames;
-};
-
-this.isColorKeyword = function(keyword)
-{
-    if (keyword == "transparent")
-        return false;
-
-    if (!cssColorNames)
-    {
-        cssColorNames = [];
-
-        var colors = this.cssKeywords["color"];
-        for (var i = 0; i < colors.length; ++i)
-            cssColorNames.push(colors[i].toLowerCase());
-
-        var systemColors = this.cssKeywords["systemColor"];
-        for (var i = 0; i < systemColors.length; ++i)
-            cssColorNames.push(systemColors[i].toLowerCase());
-    }
-
-    return cssColorNames.indexOf ? // Array.indexOf is not available in IE
-            cssColorNames.indexOf(keyword.toLowerCase()) != -1 :
-            (" " + cssColorNames.join(" ") + " ").indexOf(" " + keyword.toLowerCase() + " ") != -1;
-};
-
-this.isImageRule = function(rule)
-{
-    if (!imageRules)
-    {
-        imageRules = [];
-
-        for (var i in this.cssInfo)
-        {
-            var r = i.toLowerCase();
-            var suffix = "image";
-            if (r.match(suffix + "$") == suffix || r == "background")
-                imageRules.push(r);
-        }
-    }
-
-    return imageRules.indexOf ? // Array.indexOf is not available in IE
-            imageRules.indexOf(rule.toLowerCase()) != -1 :
-            (" " + imageRules.join(" ") + " ").indexOf(" " + rule.toLowerCase() + " ") != -1;
-};
-
-this.copyTextStyles = function(fromNode, toNode, style)
-{
-    var view = this.isIE ?
-            fromNode.ownerDocument.parentWindow :
-            fromNode.ownerDocument.defaultView;
-
-    if (view)
-    {
-        if (!style)
-            style = this.isIE ? fromNode.currentStyle : view.getComputedStyle(fromNode, "");
-
-        toNode.style.fontFamily = style.fontFamily;
-
-        // TODO: xxxpedro need to create a FBL.getComputedStyle() because IE
-        // returns wrong computed styles for inherited properties (like font-*)
-        //
-        // Also would be good to create a FBL.getStyle()
-        toNode.style.fontSize = style.fontSize;
-        toNode.style.fontWeight = style.fontWeight;
-        toNode.style.fontStyle = style.fontStyle;
-
-        return style;
-    }
-};
-
-this.copyBoxStyles = function(fromNode, toNode, style)
-{
-    var view = this.isIE ?
-            fromNode.ownerDocument.parentWindow :
-            fromNode.ownerDocument.defaultView;
-
-    if (view)
-    {
-        if (!style)
-            style = this.isIE ? fromNode.currentStyle : view.getComputedStyle(fromNode, "");
-
-        toNode.style.marginTop = style.marginTop;
-        toNode.style.marginRight = style.marginRight;
-        toNode.style.marginBottom = style.marginBottom;
-        toNode.style.marginLeft = style.marginLeft;
-        toNode.style.borderTopWidth = style.borderTopWidth;
-        toNode.style.borderRightWidth = style.borderRightWidth;
-        toNode.style.borderBottomWidth = style.borderBottomWidth;
-        toNode.style.borderLeftWidth = style.borderLeftWidth;
-
-        return style;
-    }
-};
-
-this.readBoxStyles = function(style)
-{
-    var styleNames = {
-        "margin-top": "marginTop", "margin-right": "marginRight",
-        "margin-left": "marginLeft", "margin-bottom": "marginBottom",
-        "border-top-width": "borderTop", "border-right-width": "borderRight",
-        "border-left-width": "borderLeft", "border-bottom-width": "borderBottom",
-        "padding-top": "paddingTop", "padding-right": "paddingRight",
-        "padding-left": "paddingLeft", "padding-bottom": "paddingBottom",
-        "z-index": "zIndex"
-    };
-
-    var styles = {};
-    for (var styleName in styleNames)
-        styles[styleNames[styleName]] = parseInt(style.getPropertyCSSValue(styleName).cssText) || 0;
-    if (FBTrace.DBG_INSPECT)
-        FBTrace.sysout("readBoxStyles ", styles);
-    return styles;
-};
-
-this.getBoxFromStyles = function(style, element)
-{
-    var args = this.readBoxStyles(style);
-    args.width = element.offsetWidth
-        - (args.paddingLeft+args.paddingRight+args.borderLeft+args.borderRight);
-    args.height = element.offsetHeight
-        - (args.paddingTop+args.paddingBottom+args.borderTop+args.borderBottom);
-    return args;
-};
-
-this.getElementCSSSelector = function(element)
-{
-    var label = element.localName.toLowerCase();
-    if (element.id)
-        label += "#" + element.id;
-    if (element.hasAttribute("class"))
-        label += "." + element.getAttribute("class").split(" ")[0];
-
-    return label;
-};
-
-this.getURLForStyleSheet= function(styleSheet)
-{
-    //http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet. For inline style sheets, the value of this attribute is null.
-    return (styleSheet.href ? styleSheet.href : styleSheet.ownerNode.ownerDocument.URL);
-};
-
-this.getDocumentForStyleSheet = function(styleSheet)
-{
-    while (styleSheet.parentStyleSheet && !styleSheet.ownerNode)
-    {
-        styleSheet = styleSheet.parentStyleSheet;
-    }
-    if (styleSheet.ownerNode)
-      return styleSheet.ownerNode.ownerDocument;
-};
-
-/**
- * Retrieves the instance number for a given style sheet. The instance number
- * is sheet's index within the set of all other sheets whose URL is the same.
- */
-this.getInstanceForStyleSheet = function(styleSheet, ownerDocument)
-{
-    // System URLs are always unique (or at least we are making this assumption)
-    if (FBL.isSystemStyleSheet(styleSheet))
-        return 0;
-
-    // ownerDocument is an optional hint for performance
-    if (FBTrace.DBG_CSS) FBTrace.sysout("getInstanceForStyleSheet: " + styleSheet.href + " " + styleSheet.media.mediaText + " " + (styleSheet.ownerNode && FBL.getElementXPath(styleSheet.ownerNode)), ownerDocument);
-    ownerDocument = ownerDocument || FBL.getDocumentForStyleSheet(styleSheet);
-
-    var ret = 0,
-        styleSheets = ownerDocument.styleSheets,
-        href = styleSheet.href;
-    for (var i = 0; i < styleSheets.length; i++)
-    {
-        var curSheet = styleSheets[i];
-        if (FBTrace.DBG_CSS) FBTrace.sysout("getInstanceForStyleSheet: compare href " + i + " " + curSheet.href + " " + curSheet.media.mediaText + " " + (curSheet.ownerNode && FBL.getElementXPath(curSheet.ownerNode)));
-        if (curSheet == styleSheet)
-            break;
-        if (curSheet.href == href)
-            ret++;
-    }
-    return ret;
-};
-
-// ************************************************************************************************
-// HTML and XML Serialization
-
-
-var getElementType = this.getElementType = function(node)
-{
-    if (isElementXUL(node))
-        return 'xul';
-    else if (isElementSVG(node))
-        return 'svg';
-    else if (isElementMathML(node))
-        return 'mathml';
-    else if (isElementXHTML(node))
-        return 'xhtml';
-    else if (isElementHTML(node))
-        return 'html';
-};
-
-var getElementSimpleType = this.getElementSimpleType = function(node)
-{
-    if (isElementSVG(node))
-        return 'svg';
-    else if (isElementMathML(node))
-        return 'mathml';
-    else
-        return 'html';
-};
-
-var isElementHTML = this.isElementHTML = function(node)
-{
-    return node.nodeName == node.nodeName.toUpperCase();
-};
-
-var isElementXHTML = this.isElementXHTML = function(node)
-{
-    return node.nodeName == node.nodeName.toLowerCase();
-};
-
-var isElementMathML = this.isElementMathML = function(node)
-{
-    return node.namespaceURI == 'http://www.w3.org/1998/Math/MathML';
-};
-
-var isElementSVG = this.isElementSVG = function(node)
-{
-    return node.namespaceURI == 'http://www.w3.org/2000/svg';
-};
-
-var isElementXUL = this.isElementXUL = function(node)
-{
-    return node instanceof XULElement;
-};
-
-this.isSelfClosing = function(element)
-{
-    if (isElementSVG(element) || isElementMathML(element))
-        return true;
-    var tag = element.localName.toLowerCase();
-    return (this.selfClosingTags.hasOwnProperty(tag));
-};
-
-this.getElementHTML = function(element)
-{
-    var self=this;
-    function toHTML(elt)
-    {
-        if (elt.nodeType == Node.ELEMENT_NODE)
-        {
-            if (unwrapObject(elt).firebugIgnore)
-                return;
-
-            html.push('<', elt.nodeName.toLowerCase());
-
-            for (var i = 0; i < elt.attributes.length; ++i)
-            {
-                var attr = elt.attributes[i];
-
-                // Hide attributes set by Firebug
-                if (attr.localName.indexOf("firebug-") == 0)
-                    continue;
-
-                // MathML
-                if (attr.localName.indexOf("-moz-math") == 0)
-                {
-                    // just hide for now
-                    continue;
-                }
-
-                html.push(' ', attr.nodeName, '="', escapeForElementAttribute(attr.nodeValue),'"');
-            }
-
-            if (elt.firstChild)
-            {
-                html.push('>');
-
-                var pureText=true;
-                for (var child = element.firstChild; child; child = child.nextSibling)
-                    pureText=pureText && (child.nodeType == Node.TEXT_NODE);
-
-                if (pureText)
-                    html.push(escapeForHtmlEditor(elt.textContent));
-                else {
-                    for (var child = elt.firstChild; child; child = child.nextSibling)
-                        toHTML(child);
-                }
-
-                html.push('</', elt.nodeName.toLowerCase(), '>');
-            }
-            else if (isElementSVG(elt) || isElementMathML(elt))
-            {
-                html.push('/>');
-            }
-            else if (self.isSelfClosing(elt))
-            {
-                html.push((isElementXHTML(elt))?'/>':'>');
-            }
-            else
-            {
-                html.push('></', elt.nodeName.toLowerCase(), '>');
-            }
-        }
-        else if (elt.nodeType == Node.TEXT_NODE)
-            html.push(escapeForTextNode(elt.textContent));
-        else if (elt.nodeType == Node.CDATA_SECTION_NODE)
-            html.push('<![CDATA[', elt.nodeValue, ']]>');
-        else if (elt.nodeType == Node.COMMENT_NODE)
-            html.push('<!--', elt.nodeValue, '-->');
-    }
-
-    var html = [];
-    toHTML(element);
-    return html.join("");
-};
-
-this.getElementXML = function(element)
-{
-    function toXML(elt)
-    {
-        if (elt.nodeType == Node.ELEMENT_NODE)
-        {
-            if (unwrapObject(elt).firebugIgnore)
-                return;
-
-            xml.push('<', elt.nodeName.toLowerCase());
-
-            for (var i = 0; i < elt.attributes.length; ++i)
-            {
-                var attr = elt.attributes[i];
-
-                // Hide attributes set by Firebug
-                if (attr.localName.indexOf("firebug-") == 0)
-                    continue;
-
-                // MathML
-                if (attr.localName.indexOf("-moz-math") == 0)
-                {
-                    // just hide for now
-                    continue;
-                }
-
-                xml.push(' ', attr.nodeName, '="', escapeForElementAttribute(attr.nodeValue),'"');
-            }
-
-            if (elt.firstChild)
-            {
-                xml.push('>');
-
-                for (var child = elt.firstChild; child; child = child.nextSibling)
-                    toXML(child);
-
-                xml.push('</', elt.nodeName.toLowerCase(), '>');
-            }
-            else
-                xml.push('/>');
-        }
-        else if (elt.nodeType == Node.TEXT_NODE)
-            xml.push(elt.nodeValue);
-        else if (elt.nodeType == Node.CDATA_SECTION_NODE)
-            xml.push('<![CDATA[', elt.nodeValue, ']]>');
-        else if (elt.nodeType == Node.COMMENT_NODE)
-            xml.push('<!--', elt.nodeValue, '-->');
-    }
-
-    var xml = [];
-    toXML(element);
-    return xml.join("");
-};
-
-
-// ************************************************************************************************
-// CSS classes
-
-this.hasClass = function(node, name) // className, className, ...
-{
-    // TODO: xxxpedro when lib.hasClass is called with more than 2 arguments?
-    // this function can be optimized a lot if assumed 2 arguments only,
-    // which seems to be what happens 99% of the time
-    if (arguments.length == 2)
-        return (' '+node.className+' ').indexOf(' '+name+' ') != -1;
-
-    if (!node || node.nodeType != 1)
-        return false;
-    else
-    {
-        for (var i=1; i<arguments.length; ++i)
-        {
-            var name = arguments[i];
-            var re = new RegExp("(^|\\s)"+name+"($|\\s)");
-            if (!re.exec(node.className))
-                return false;
-        }
-
-        return true;
-    }
-};
-
-this.old_hasClass = function(node, name) // className, className, ...
-{
-    if (!node || node.nodeType != 1)
-        return false;
-    else
-    {
-        for (var i=1; i<arguments.length; ++i)
-        {
-            var name = arguments[i];
-            var re = new RegExp("(^|\\s)"+name+"($|\\s)");
-            if (!re.exec(node.className))
-                return false;
-        }
-
-        return true;
-    }
-};
-
-this.setClass = function(node, name)
-{
-    if (node && (' '+node.className+' ').indexOf(' '+name+' ') == -1)
-    ///if (node && !this.hasClass(node, name))
-        node.className += " " + name;
-};
-
-this.getClassValue = function(node, name)
-{
-    var re = new RegExp(name+"-([^ ]+)");
-    var m = re.exec(node.className);
-    return m ? m[1] : "";
-};
-
-this.removeClass = function(node, name)
-{
-    if (node && node.className)
-    {
-        var index = node.className.indexOf(name);
-        if (index >= 0)
-        {
-            var size = name.length;
-            node.className = node.className.substr(0,index-1) + node.className.substr(index+size);
-        }
-    }
-};
-
-this.toggleClass = function(elt, name)
-{
-    if ((' '+elt.className+' ').indexOf(' '+name+' ') != -1)
-    ///if (this.hasClass(elt, name))
-        this.removeClass(elt, name);
-    else
-        this.setClass(elt, name);
-};
-
-this.setClassTimed = function(elt, name, context, timeout)
-{
-    if (!timeout)
-        timeout = 1300;
-
-    if (elt.__setClassTimeout)
-        context.clearTimeout(elt.__setClassTimeout);
-    else
-        this.setClass(elt, name);
-
-    elt.__setClassTimeout = context.setTimeout(function()
-    {
-        delete elt.__setClassTimeout;
-
-        FBL.removeClass(elt, name);
-    }, timeout);
-};
-
-this.cancelClassTimed = function(elt, name, context)
-{
-    if (elt.__setClassTimeout)
-    {
-        FBL.removeClass(elt, name);
-        context.clearTimeout(elt.__setClassTimeout);
-        delete elt.__setClassTimeout;
-    }
-};
-
-
-// ************************************************************************************************
-// DOM queries
-
-this.$ = function(id, doc)
-{
-    if (doc)
-        return doc.getElementById(id);
-    else
-    {
-        return FBL.Firebug.chrome.document.getElementById(id);
-    }
-};
-
-this.$$ = function(selector, doc)
-{
-    if (doc || !FBL.Firebug.chrome)
-        return FBL.Firebug.Selector(selector, doc);
-    else
-    {
-        return FBL.Firebug.Selector(selector, FBL.Firebug.chrome.document);
-    }
-};
-
-this.getChildByClass = function(node) // ,classname, classname, classname...
-{
-    for (var i = 1; i < arguments.length; ++i)
-    {
-        var className = arguments[i];
-        var child = node.firstChild;
-        node = null;
-        for (; child; child = child.nextSibling)
-        {
-            if (this.hasClass(child, className))
-            {
-                node = child;
-                break;
-            }
-        }
-    }
-
-    return node;
-};
-
-this.getAncestorByClass = function(node, className)
-{
-    for (var parent = node; parent; parent = parent.parentNode)
-    {
-        if (this.hasClass(parent, className))
-            return parent;
-    }
-
-    return null;
-};
-
-
-this.getElementsByClass = function(node, className)
-{
-    var result = [];
-
-    for (var child = node.firstChild; child; child = child.nextSibling)
-    {
-        if (this.hasClass(child, className))
-            result.push(child);
-    }
-
-    return result;
-};
-
-this.getElementByClass = function(node, className)  // className, className, ...
-{
-    var args = cloneArray(arguments); args.splice(0, 1);
-    for (var child = node.firstChild; child; child = child.nextSibling)
-    {
-        var args1 = cloneArray(args); args1.unshift(child);
-        if (FBL.hasClass.apply(null, args1))
-            return child;
-        else
-        {
-            var found = FBL.getElementByClass.apply(null, args1);
-            if (found)
-                return found;
-        }
-    }
-
-    return null;
-};
-
-this.isAncestor = function(node, potentialAncestor)
-{
-    for (var parent = node; parent; parent = parent.parentNode)
-    {
-        if (parent == potentialAncestor)
-            return true;
-    }
-
-    return false;
-};
-
-this.getNextElement = function(node)
-{
-    while (node && node.nodeType != 1)
-        node = node.nextSibling;
-
-    return node;
-};
-
-this.getPreviousElement = function(node)
-{
-    while (node && node.nodeType != 1)
-        node = node.previousSibling;
-
-    return node;
-};
-
-this.getBody = function(doc)
-{
-    if (doc.body)
-        return doc.body;
-
-    var body = doc.getElementsByTagName("body")[0];
-    if (body)
-        return body;
-
-    return doc.firstChild;  // For non-HTML docs
-};
-
-this.findNextDown = function(node, criteria)
-{
-    if (!node)
-        return null;
-
-    for (var child = node.firstChild; child; child = child.nextSibling)
-    {
-        if (criteria(child))
-            return child;
-
-        var next = this.findNextDown(child, criteria);
-        if (next)
-            return next;
-    }
-};
-
-this.findPreviousUp = function(node, criteria)
-{
-    if (!node)
-        return null;
-
-    for (var child = node.lastChild; child; child = child.previousSibling)
-    {
-        var next = this.findPreviousUp(child, criteria);
-        if (next)
-            return next;
-
-        if (criteria(child))
-            return child;
-    }
-};
-
-this.findNext = function(node, criteria, upOnly, maxRoot)
-{
-    if (!node)
-        return null;
-
-    if (!upOnly)
-    {
-        var next = this.findNextDown(node, criteria);
-        if (next)
-            return next;
-    }
-
-    for (var sib = node.nextSibling; sib; sib = sib.nextSibling)
-    {
-        if (criteria(sib))
-            return sib;
-
-        var next = this.findNextDown(sib, criteria);
-        if (next)
-            return next;
-    }
-
-    if (node.parentNode && node.parentNode != maxRoot)
-        return this.findNext(node.parentNode, criteria, true);
-};
-
-this.findPrevious = function(node, criteria, downOnly, maxRoot)
-{
-    if (!node)
-        return null;
-
-    for (var sib = node.previousSibling; sib; sib = sib.previousSibling)
-    {
-        var prev = this.findPreviousUp(sib, criteria);
-        if (prev)
-            return prev;
-
-        if (criteria(sib))
-            return sib;
-    }
-
-    if (!downOnly)
-    {
-        var next = this.findPreviousUp(node, criteria);
-        if (next)
-            return next;
-    }
-
-    if (node.parentNode && node.parentNode != maxRoot)
-    {
-        if (criteria(node.parentNode))
-            return node.parentNode;
-
-        return this.findPrevious(node.parentNode, criteria, true);
-    }
-};
-
-this.getNextByClass = function(root, state)
-{
-    var iter = function iter(node) { return node.nodeType == 1 && FBL.hasClass(node, state); };
-    return this.findNext(root, iter);
-};
-
-this.getPreviousByClass = function(root, state)
-{
-    var iter = function iter(node) { return node.nodeType == 1 && FBL.hasClass(node, state); };
-    return this.findPrevious(root, iter);
-};
-
-this.isElement = function(o)
-{
-    try {
-        return o && this.instanceOf(o, "Element");
-    }
-    catch (ex) {
-        return false;
-    }
-};
-
-
-// ************************************************************************************************
-// DOM Modification
-
-// TODO: xxxpedro use doc fragments in Context API
-var appendFragment = null;
-
-this.appendInnerHTML = function(element, html, referenceElement)
-{
-    // if undefined, we must convert it to null otherwise it will throw an error in IE
-    // when executing element.insertBefore(firstChild, referenceElement)
-    referenceElement = referenceElement || null;
-
-    var doc = element.ownerDocument;
-
-    // doc.createRange not available in IE
-    if (doc.createRange)
-    {
-        var range = doc.createRange();  // a helper object
-        range.selectNodeContents(element); // the environment to interpret the html
-
-        var fragment = range.createContextualFragment(html);  // parse
-        var firstChild = fragment.firstChild;
-        element.insertBefore(fragment, referenceElement);
-    }
-    else
-    {
-        if (!appendFragment || appendFragment.ownerDocument != doc)
-            appendFragment = doc.createDocumentFragment();
-
-        var div = doc.createElement("div");
-        div.innerHTML = html;
-
-        var firstChild = div.firstChild;
-        while (div.firstChild)
-            appendFragment.appendChild(div.firstChild);
-
-        element.insertBefore(appendFragment, referenceElement);
-
-        div = null;
-    }
-
-    return firstChild;
-};
-
-
-// ************************************************************************************************
-// DOM creation
-
-this.createElement = function(tagName, properties)
-{
-    properties = properties || {};
-    var doc = properties.document || FBL.Firebug.chrome.document;
-
-    var element = doc.createElement(tagName);
-
-    for(var name in properties)
-    {
-        if (name != "document")
-        {
-            element[name] = properties[name];
-        }
-    }
-
-    return element;
-};
-
-this.createGlobalElement = function(tagName, properties)
-{
-    properties = properties || {};
-    var doc = FBL.Env.browser.document;
-
-    var element = this.NS && doc.createElementNS ?
-            doc.createElementNS(FBL.NS, tagName) :
-            doc.createElement(tagName);
-
-    for(var name in properties)
-    {
-        var propname = name;
-        if (FBL.isIE && name == "class") propname = "className";
-
-        if (name != "document")
-        {
-            element.setAttribute(propname, properties[name]);
-        }
-    }
-
-    return element;
-};
-
-//************************************************************************************************
-
-this.safeGetWindowLocation = function(window)
-{
-    try
-    {
-        if (window)
-        {
-            if (window.closed)
-                return "(window.closed)";
-            if ("location" in window)
-                return window.location+"";
-            else
-                return "(no window.location)";
-        }
-        else
-            return "(no context.window)";
-    }
-    catch(exc)
-    {
-        if (FBTrace.DBG_WINDOWS || FBTrace.DBG_ERRORS)
-            FBTrace.sysout("TabContext.getWindowLocation failed "+exc, exc);
-            FBTrace.sysout("TabContext.getWindowLocation failed window:", window);
-        return "(getWindowLocation: "+exc+")";
-    }
-};
-
-// ************************************************************************************************
-// Events
-
-this.isLeftClick = function(event)
-{
-    return (this.isIE && event.type != "click" && event.type != "dblclick" ?
-            event.button == 1 : // IE "click" and "dblclick" button model
-            event.button == 0) && // others
-        this.noKeyModifiers(event);
-};
-
-this.isMiddleClick = function(event)
-{
-    return (this.isIE && event.type != "click" && event.type != "dblclick" ?
-            event.button == 4 : // IE "click" and "dblclick" button model
-            event.button == 1) &&
-        this.noKeyModifiers(event);
-};
-
-this.isRightClick = function(event)
-{
-    return (this.isIE && event.type != "click" && event.type != "dblclick" ?
-            event.button == 2 : // IE "click" and "dblclick" button model
-            event.button == 2) &&
-        this.noKeyModifiers(event);
-};
-
-this.noKeyModifiers = function(event)
-{
-    return !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey;
-};
-
-this.isControlClick = function(event)
-{
-    return (this.isIE && event.type != "click" && event.type != "dblclick" ?
-            event.button == 1 : // IE "click" and "dblclick" button model
-            event.button == 0) &&
-        this.isControl(event);
-};
-
-this.isShiftClick = function(event)
-{
-    return (this.isIE && event.type != "click" && event.type != "dblclick" ?
-            event.button == 1 : // IE "click" and "dblclick" button model
-            event.button == 0) &&
-        this.isShift(event);
-};
-
-this.isControl = function(event)
-{
-    return (event.metaKey || event.ctrlKey) && !event.shiftKey && !event.altKey;
-};
-
-this.isAlt = function(event)
-{
-    return event.altKey && !event.ctrlKey && !event.shiftKey && !event.metaKey;
-};
-
-this.isAltClick = function(event)
-{
-    return (this.isIE && event.type != "click" && event.type != "dblclick" ?
-            event.button == 1 : // IE "click" and "dblclick" button model
-            event.button == 0) &&
-        this.isAlt(event);
-};
-
-this.isControlShift = function(event)
-{
-    return (event.metaKey || event.ctrlKey) && event.shiftKey && !event.altKey;
-};
-
-this.isShift = function(event)
-{
-    return event.shiftKey && !event.metaKey && !event.ctrlKey && !event.altKey;
-};
-
-this.addEvent = function(object, name, handler, useCapture)
-{
-    if (object.addEventListener)
-        object.addEventListener(name, handler, useCapture);
-    else
-        object.attachEvent("on"+name, handler);
-};
-
-this.removeEvent = function(object, name, handler, useCapture)
-{
-    try
-    {
-        if (object.removeEventListener)
-            object.removeEventListener(name, handler, useCapture);
-        else
-            object.detachEvent("on"+name, handler);
-    }
-    catch(e)
-    {
-        if (FBTrace.DBG_ERRORS)
-            FBTrace.sysout("FBL.removeEvent error: ", object, name);
-    }
-};
-
-this.cancelEvent = function(e, preventDefault)
-{
-    if (!e) return;
-
-    if (preventDefault)
-    {
-                if (e.preventDefault)
-                    e.preventDefault();
-                else
-                    e.returnValue = false;
-    }
-
-    if (e.stopPropagation)
-        e.stopPropagation();
-    else
-        e.cancelBubble = true;
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-this.addGlobalEvent = function(name, handler)
-{
-    var doc = this.Firebug.browser.document;
-    var frames = this.Firebug.browser.window.frames;
-
-    this.addEvent(doc, name, handler);
-
-    if (this.Firebug.chrome.type == "popup")
-        this.addEvent(this.Firebug.chrome.document, name, handler);
-
-    for (var i = 0, frame; frame = frames[i]; i++)
-    {
-        try
-        {
-            this.addEvent(frame.document, name, handler);
-        }
-        catch(E)
-        {
-            // Avoid acess denied
-        }
-    }
-};
-
-this.removeGlobalEvent = function(name, handler)
-{
-    var doc = this.Firebug.browser.document;
-    var frames = this.Firebug.browser.window.frames;
-
-    this.removeEvent(doc, name, handler);
-
-    if (this.Firebug.chrome.type == "popup")
-        this.removeEvent(this.Firebug.chrome.document, name, handler);
-
-    for (var i = 0, frame; frame = frames[i]; i++)
-    {
-        try
-        {
-            this.removeEvent(frame.document, name, handler);
-        }
-        catch(E)
-        {
-            // Avoid acess denied
-        }
-    }
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-this.dispatch = function(listeners, name, args)
-{
-    if (!listeners) return;
-
-    try
-    {/**/
-        if (typeof listeners.length != "undefined")
-        {
-            if (FBTrace.DBG_DISPATCH) FBTrace.sysout("FBL.dispatch", name+" to "+listeners.length+" listeners");
-
-            for (var i = 0; i < listeners.length; ++i)
-            {
-                var listener = listeners[i];
-                if ( listener[name] )
-                    listener[name].apply(listener, args);
-            }
-        }
-        else
-        {
-            if (FBTrace.DBG_DISPATCH) FBTrace.sysout("FBL.dispatch", name+" to listeners of an object");
-
-            for (var prop in listeners)
-            {
-                var listener = listeners[prop];
-                if ( listener[name] )
-                    listener[name].apply(listener, args);
-            }
-        }
-    }
-    catch (exc)
-    {
-        if (FBTrace.DBG_ERRORS)
-        {
-            FBTrace.sysout(" Exception in lib.dispatch "+ name, exc);
-            //FBTrace.dumpProperties(" Exception in lib.dispatch listener", listener);
-        }
-    }
-    /**/
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var disableTextSelectionHandler = function(event)
-{
-    FBL.cancelEvent(event, true);
-
-    return false;
-};
-
-this.disableTextSelection = function(e)
-{
-    if (typeof e.onselectstart != "undefined") // IE
-        this.addEvent(e, "selectstart", disableTextSelectionHandler);
-
-    else // others
-    {
-        e.style.cssText = "user-select: none; -khtml-user-select: none; -moz-user-select: none;";
-
-        // canceling the event in FF will prevent the menu popups to close when clicking over
-        // text-disabled elements
-        if (!this.isFirefox)
-            this.addEvent(e, "mousedown", disableTextSelectionHandler);
-    }
-
-    e.style.cursor = "default";
-};
-
-this.restoreTextSelection = function(e)
-{
-    if (typeof e.onselectstart != "undefined") // IE
-        this.removeEvent(e, "selectstart", disableTextSelectionHandler);
-
-    else // others
-    {
-        e.style.cssText = "cursor: default;";
-
-        // canceling the event in FF will prevent the menu popups to close when clicking over
-        // text-disabled elements
-        if (!this.isFirefox)
-            this.removeEvent(e, "mousedown", disableTextSelectionHandler);
-    }
-};
-
-// ************************************************************************************************
-// DOM Events
-
-var eventTypes =
-{
-    composition: [
-        "composition",
-        "compositionstart",
-        "compositionend" ],
-    contextmenu: [
-        "contextmenu" ],
-    drag: [
-        "dragenter",
-        "dragover",
-        "dragexit",
-        "dragdrop",
-        "draggesture" ],
-    focus: [
-        "focus",
-        "blur" ],
-    form: [
-        "submit",
-        "reset",
-        "change",
-        "select",
-        "input" ],
-    key: [
-        "keydown",
-        "keyup",
-        "keypress" ],
-    load: [
-        "load",
-        "beforeunload",
-        "unload",
-        "abort",
-        "error" ],
-    mouse: [
-        "mousedown",
-        "mouseup",
-        "click",
-        "dblclick",
-        "mouseover",
-        "mouseout",
-        "mousemove" ],
-    mutation: [
-        "DOMSubtreeModified",
-        "DOMNodeInserted",
-        "DOMNodeRemoved",
-        "DOMNodeRemovedFromDocument",
-        "DOMNodeInsertedIntoDocument",
-        "DOMAttrModified",
-        "DOMCharacterDataModified" ],
-    paint: [
-        "paint",
-        "resize",
-        "scroll" ],
-    scroll: [
-        "overflow",
-        "underflow",
-        "overflowchanged" ],
-    text: [
-        "text" ],
-    ui: [
-        "DOMActivate",
-        "DOMFocusIn",
-        "DOMFocusOut" ],
-    xul: [
-        "popupshowing",
-        "popupshown",
-        "popuphiding",
-        "popuphidden",
-        "close",
-        "command",
-        "broadcast",
-        "commandupdate" ]
-};
-
-this.getEventFamily = function(eventType)
-{
-    if (!this.families)
-    {
-        this.families = {};
-
-        for (var family in eventTypes)
-        {
-            var types = eventTypes[family];
-            for (var i = 0; i < types.length; ++i)
-                this.families[types[i]] = family;
-        }
-    }
-
-    return this.families[eventType];
-};
-
-
-// ************************************************************************************************
-// URLs
-
-this.getFileName = function(url)
-{
-    var split = this.splitURLBase(url);
-    return split.name;
-};
-
-this.splitURLBase = function(url)
-{
-    if (this.isDataURL(url))
-        return this.splitDataURL(url);
-    return this.splitURLTrue(url);
-};
-
-this.splitDataURL = function(url)
-{
-    var mark = url.indexOf(':', 3);
-    if (mark != 4)
-        return false;   //  the first 5 chars must be 'data:'
-
-    var point = url.indexOf(',', mark+1);
-    if (point < mark)
-        return false; // syntax error
-
-    var props = { encodedContent: url.substr(point+1) };
-
-    var metadataBuffer = url.substr(mark+1, point);
-    var metadata = metadataBuffer.split(';');
-    for (var i = 0; i < metadata.length; i++)
-    {
-        var nv = metadata[i].split('=');
-        if (nv.length == 2)
-            props[nv[0]] = nv[1];
-    }
-
-    // Additional Firebug-specific properties
-    if (props.hasOwnProperty('fileName'))
-    {
-         var caller_URL = decodeURIComponent(props['fileName']);
-         var caller_split = this.splitURLTrue(caller_URL);
-
-        if (props.hasOwnProperty('baseLineNumber'))  // this means it's probably an eval()
-        {
-            props['path'] = caller_split.path;
-            props['line'] = props['baseLineNumber'];
-            var hint = decodeURIComponent(props['encodedContent'].substr(0,200)).replace(/\s*$/, "");
-            props['name'] =  'eval->'+hint;
-        }
-        else
-        {
-            props['name'] = caller_split.name;
-            props['path'] = caller_split.path;
-        }
-    }
-    else
-    {
-        if (!props.hasOwnProperty('path'))
-            props['path'] = "data:";
-        if (!props.hasOwnProperty('name'))
-            props['name'] =  decodeURIComponent(props['encodedContent'].substr(0,200)).replace(/\s*$/, "");
-    }
-
-    return props;
-};
-
-this.splitURLTrue = function(url)
-{
-    var m = reSplitFile.exec(url);
-    if (!m)
-        return {name: url, path: url};
-    else if (!m[2])
-        return {path: m[1], name: m[1]};
-    else
-        return {path: m[1], name: m[2]+m[3]};
-};
-
-this.getFileExtension = function(url)
-{
-    if (!url)
-        return null;
-
-    // Remove query string from the URL if any.
-    var queryString = url.indexOf("?");
-    if (queryString != -1)
-        url = url.substr(0, queryString);
-
-    // Now get the file extension.
-    var lastDot = url.lastIndexOf(".");
-    return url.substr(lastDot+1);
-};
-
-this.isSystemURL = function(url)
-{
-    if (!url) return true;
-    if (url.length == 0) return true;
-    if (url[0] == 'h') return false;
-    if (url.substr(0, 9) == "resource:")
-        return true;
-    else if (url.substr(0, 16) == "chrome://firebug")
-        return true;
-    else if (url  == "XPCSafeJSObjectWrapper.cpp")
-        return true;
-    else if (url.substr(0, 6) == "about:")
-        return true;
-    else if (url.indexOf("firebug-service.js") != -1)
-        return true;
-    else
-        return false;
-};
-
-this.isSystemPage = function(win)
-{
-    try
-    {
-        var doc = win.document;
-        if (!doc)
-            return false;
-
-        // Detect pages for pretty printed XML
-        if ((doc.styleSheets.length && doc.styleSheets[0].href
-                == "chrome://global/content/xml/XMLPrettyPrint.css")
-            || (doc.styleSheets.length > 1 && doc.styleSheets[1].href
-                == "chrome://browser/skin/feeds/subscribe.css"))
-            return true;
-
-        return FBL.isSystemURL(win.location.href);
-    }
-    catch (exc)
-    {
-        // Sometimes documents just aren't ready to be manipulated here, but don't let that
-        // gum up the works
-        ERROR("tabWatcher.isSystemPage document not ready:"+ exc);
-        return false;
-    }
-};
-
-this.isSystemStyleSheet = function(sheet)
-{
-    var href = sheet && sheet.href;
-    return href && FBL.isSystemURL(href);
-};
-
-this.getURIHost = function(uri)
-{
-    try
-    {
-        if (uri)
-            return uri.host;
-        else
-            return "";
-    }
-    catch (exc)
-    {
-        return "";
-    }
-};
-
-this.isLocalURL = function(url)
-{
-    if (url.substr(0, 5) == "file:")
-        return true;
-    else if (url.substr(0, 8) == "wyciwyg:")
-        return true;
-    else
-        return false;
-};
-
-this.isDataURL = function(url)
-{
-    return (url && url.substr(0,5) == "data:");
-};
-
-this.getLocalPath = function(url)
-{
-    if (this.isLocalURL(url))
-    {
-        var fileHandler = ioService.getProtocolHandler("file").QueryInterface(Ci.nsIFileProtocolHandler);
-        var file = fileHandler.getFileFromURLSpec(url);
-        return file.path;
-    }
-};
-
-this.getURLFromLocalFile = function(file)
-{
-    var fileHandler = ioService.getProtocolHandler("file").QueryInterface(Ci.nsIFileProtocolHandler);
-    var URL = fileHandler.getURLSpecFromFile(file);
-    return URL;
-};
-
-this.getDataURLForContent = function(content, url)
-{
-    // data:text/javascript;fileName=x%2Cy.js;baseLineNumber=10,<the-url-encoded-data>
-    var uri = "data:text/html;";
-    uri += "fileName="+encodeURIComponent(url)+ ",";
-    uri += encodeURIComponent(content);
-    return uri;
-},
-
-this.getDomain = function(url)
-{
-    var m = /[^:]+:\/{1,3}([^\/]+)/.exec(url);
-    return m ? m[1] : "";
-};
-
-this.getURLPath = function(url)
-{
-    var m = /[^:]+:\/{1,3}[^\/]+(\/.*?)$/.exec(url);
-    return m ? m[1] : "";
-};
-
-this.getPrettyDomain = function(url)
-{
-    var m = /[^:]+:\/{1,3}(www\.)?([^\/]+)/.exec(url);
-    return m ? m[2] : "";
-};
-
-this.absoluteURL = function(url, baseURL)
-{
-    return this.absoluteURLWithDots(url, baseURL).replace("/./", "/", "g");
-};
-
-this.absoluteURLWithDots = function(url, baseURL)
-{
-    if (url[0] == "?")
-        return baseURL + url;
-
-    var reURL = /(([^:]+:)\/{1,2}[^\/]*)(.*?)$/;
-    var m = reURL.exec(url);
-    if (m)
-        return url;
-
-    var m = reURL.exec(baseURL);
-    if (!m)
-        return "";
-
-    var head = m[1];
-    var tail = m[3];
-    if (url.substr(0, 2) == "//")
-        return m[2] + url;
-    else if (url[0] == "/")
-    {
-        return head + url;
-    }
-    else if (tail[tail.length-1] == "/")
-        return baseURL + url;
-    else
-    {
-        var parts = tail.split("/");
-        return head + parts.slice(0, parts.length-1).join("/") + "/" + url;
-    }
-};
-
-this.normalizeURL = function(url)  // this gets called a lot, any performance improvement welcome
-{
-    if (!url)
-        return "";
-    // Replace one or more characters that are not forward-slash followed by /.., by space.
-    if (url.length < 255) // guard against monsters.
-    {
-        // Replace one or more characters that are not forward-slash followed by /.., by space.
-        url = url.replace(/[^\/]+\/\.\.\//, "", "g");
-        // Issue 1496, avoid #
-        url = url.replace(/#.*/,"");
-        // For some reason, JSDS reports file URLs like "file:/" instead of "file:///", so they
-        // don't match up with the URLs we get back from the DOM
-        url = url.replace(/file:\/([^\/])/g, "file:///$1");
-        if (url.indexOf('chrome:')==0)
-        {
-            var m = reChromeCase.exec(url);  // 1 is package name, 2 is path
-            if (m)
-            {
-                url = "chrome://"+m[1].toLowerCase()+"/"+m[2];
-            }
-        }
-    }
-    return url;
-};
-
-this.denormalizeURL = function(url)
-{
-    return url.replace(/file:\/\/\//g, "file:/");
-};
-
-this.parseURLParams = function(url)
-{
-    var q = url ? url.indexOf("?") : -1;
-    if (q == -1)
-        return [];
-
-    var search = url.substr(q+1);
-    var h = search.lastIndexOf("#");
-    if (h != -1)
-        search = search.substr(0, h);
-
-    if (!search)
-        return [];
-
-    return this.parseURLEncodedText(search);
-};
-
-this.parseURLEncodedText = function(text)
-{
-    var maxValueLength = 25000;
-
-    var params = [];
-
-    // Unescape '+' characters that are used to encode a space.
-    // See section 2.2.in RFC 3986: http://www.ietf.org/rfc/rfc3986.txt
-    text = text.replace(/\+/g, " ");
-
-    var args = text.split("&");
-    for (var i = 0; i < args.length; ++i)
-    {
-        try {
-            var parts = args[i].split("=");
-            if (parts.length == 2)
-            {
-                if (parts[1].length > maxValueLength)
-                    parts[1] = this.$STR("LargeData");
-
-                params.push({name: decodeURIComponent(parts[0]), value: decodeURIComponent(parts[1])});
-            }
-            else
-                params.push({name: decodeURIComponent(parts[0]), value: ""});
-        }
-        catch (e)
-        {
-            if (FBTrace.DBG_ERRORS)
-            {
-                FBTrace.sysout("parseURLEncodedText EXCEPTION ", e);
-                FBTrace.sysout("parseURLEncodedText EXCEPTION URI", args[i]);
-            }
-        }
-    }
-
-    params.sort(function(a, b) { return a.name <= b.name ? -1 : 1; });
-
-    return params;
-};
-
-// TODO: xxxpedro lib. why loops in domplate are requiring array in parameters
-// as in response/request headers and get/post parameters in Net module?
-this.parseURLParamsArray = function(url)
-{
-    var q = url ? url.indexOf("?") : -1;
-    if (q == -1)
-        return [];
-
-    var search = url.substr(q+1);
-    var h = search.lastIndexOf("#");
-    if (h != -1)
-        search = search.substr(0, h);
-
-    if (!search)
-        return [];
-
-    return this.parseURLEncodedTextArray(search);
-};
-
-this.parseURLEncodedTextArray = function(text)
-{
-    var maxValueLength = 25000;
-
-    var params = [];
-
-    // Unescape '+' characters that are used to encode a space.
-    // See section 2.2.in RFC 3986: http://www.ietf.org/rfc/rfc3986.txt
-    text = text.replace(/\+/g, " ");
-
-    var args = text.split("&");
-    for (var i = 0; i < args.length; ++i)
-    {
-        try {
-            var parts = args[i].split("=");
-            if (parts.length == 2)
-            {
-                if (parts[1].length > maxValueLength)
-                    parts[1] = this.$STR("LargeData");
-
-                params.push({name: decodeURIComponent(parts[0]), value: [decodeURIComponent(parts[1])]});
-            }
-            else
-                params.push({name: decodeURIComponent(parts[0]), value: [""]});
-        }
-        catch (e)
-        {
-            if (FBTrace.DBG_ERRORS)
-            {
-                FBTrace.sysout("parseURLEncodedText EXCEPTION ", e);
-                FBTrace.sysout("parseURLEncodedText EXCEPTION URI", args[i]);
-            }
-        }
-    }
-
-    params.sort(function(a, b) { return a.name <= b.name ? -1 : 1; });
-
-    return params;
-};
-
-this.reEncodeURL = function(file, text)
-{
-    var lines = text.split("\n");
-    var params = this.parseURLEncodedText(lines[lines.length-1]);
-
-    var args = [];
-    for (var i = 0; i < params.length; ++i)
-        args.push(encodeURIComponent(params[i].name)+"="+encodeURIComponent(params[i].value));
-
-    var url = file.href;
-    url += (url.indexOf("?") == -1 ? "?" : "&") + args.join("&");
-
-    return url;
-};
-
-this.getResource = function(aURL)
-{
-    try
-    {
-        var channel=ioService.newChannel(aURL,null,null);
-        var input=channel.open();
-        return FBL.readFromStream(input);
-    }
-    catch (e)
-    {
-        if (FBTrace.DBG_ERRORS)
-            FBTrace.sysout("lib.getResource FAILS for "+aURL, e);
-    }
-};
-
-this.parseJSONString = function(jsonString, originURL)
-{
-    // See if this is a Prototype style *-secure request.
-    var regex = new RegExp(/^\/\*-secure-([\s\S]*)\*\/\s*$/);
-    var matches = regex.exec(jsonString);
-
-    if (matches)
-    {
-        jsonString = matches[1];
-
-        if (jsonString[0] == "\\" && jsonString[1] == "n")
-            jsonString = jsonString.substr(2);
-
-        if (jsonString[jsonString.length-2] == "\\" && jsonString[jsonString.length-1] == "n")
-            jsonString = jsonString.substr(0, jsonString.length-2);
-    }
-
-    if (jsonString.indexOf("&&&START&&&"))
-    {
-        regex = new RegExp(/&&&START&&& (.+) &&&END&&&/);
-        matches = regex.exec(jsonString);
-        if (matches)
-            jsonString = matches[1];
-    }
-
-    // throw on the extra parentheses
-    jsonString = "(" + jsonString + ")";
-
-    ///var s = Components.utils.Sandbox(originURL);
-    var jsonObject = null;
-
-    try
-    {
-        ///jsonObject = Components.utils.evalInSandbox(jsonString, s);
-
-        //jsonObject = Firebug.context.eval(jsonString);
-        jsonObject = Firebug.context.evaluate(jsonString, null, null, function(){return null;});
-    }
-    catch(e)
-    {
-        /***
-        if (e.message.indexOf("is not defined"))
-        {
-            var parts = e.message.split(" ");
-            s[parts[0]] = function(str){ return str; };
-            try {
-                jsonObject = Components.utils.evalInSandbox(jsonString, s);
-            } catch(ex) {
-                if (FBTrace.DBG_ERRORS || FBTrace.DBG_JSONVIEWER)
-                    FBTrace.sysout("jsonviewer.parseJSON EXCEPTION", e);
-                return null;
-            }
-        }
-        else
-        {/**/
-            if (FBTrace.DBG_ERRORS || FBTrace.DBG_JSONVIEWER)
-                FBTrace.sysout("jsonviewer.parseJSON EXCEPTION", e);
-            return null;
-        ///}
-    }
-
-    return jsonObject;
-};
-
-// ************************************************************************************************
-
-this.objectToString = function(object)
-{
-    try
-    {
-        return object+"";
-    }
-    catch (exc)
-    {
-        return null;
-    }
-};
-
-// ************************************************************************************************
-// Input Caret Position
-
-this.setSelectionRange = function(input, start, length)
-{
-    if (input.createTextRange)
-    {
-        var range = input.createTextRange();
-        range.moveStart("character", start);
-        range.moveEnd("character", length - input.value.length);
-        range.select();
-    }
-    else if (input.setSelectionRange)
-    {
-        input.setSelectionRange(start, length);
-        input.focus();
-    }
-};
-
-// ************************************************************************************************
-// Input Selection Start / Caret Position
-
-this.getInputSelectionStart = function(input)
-{
-    if (document.selection)
-    {
-        var range = input.ownerDocument.selection.createRange();
-        var text = range.text;
-
-        //console.log("range", range.text);
-
-        // if there is a selection, find the start position
-        if (text)
-        {
-            return input.value.indexOf(text);
-        }
-        // if there is no selection, find the caret position
-        else
-        {
-            range.moveStart("character", -input.value.length);
-
-            return range.text.length;
-        }
-    }
-    else if (typeof input.selectionStart != "undefined")
-        return input.selectionStart;
-
-    return 0;
-};
-
-// ************************************************************************************************
-// Opera Tab Fix
-
-function onOperaTabBlur(e)
-{
-    if (this.lastKey == 9)
-      this.focus();
-};
-
-function onOperaTabKeyDown(e)
-{
-    this.lastKey = e.keyCode;
-};
-
-function onOperaTabFocus(e)
-{
-    this.lastKey = null;
-};
-
-this.fixOperaTabKey = function(el)
-{
-    el.onfocus = onOperaTabFocus;
-    el.onblur = onOperaTabBlur;
-    el.onkeydown = onOperaTabKeyDown;
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-this.Property = function(object, name)
-{
-    this.object = object;
-    this.name = name;
-
-    this.getObject = function()
-    {
-        return object[name];
-    };
-};
-
-this.ErrorCopy = function(message)
-{
-    this.message = message;
-};
-
-function EventCopy(event)
-{
-    // Because event objects are destroyed arbitrarily by Gecko, we must make a copy of them to
-    // represent them long term in the inspector.
-    for (var name in event)
-    {
-        try {
-            this[name] = event[name];
-        } catch (exc) { }
-    }
-}
-
-this.EventCopy = EventCopy;
-
-
-// ************************************************************************************************
-// Type Checking
-
-var toString = Object.prototype.toString;
-var reFunction = /^\s*function(\s+[\w_$][\w\d_$]*)?\s*\(/;
-
-this.isArray = function(object) {
-    return toString.call(object) === '[object Array]';
-};
-
-this.isFunction = function(object) {
-    if (!object) return false;
-
-    try
-    {
-        // FIXME: xxxpedro this is failing in IE for the global "external" object
-        return toString.call(object) === "[object Function]" ||
-                this.isIE && typeof object != "string" && reFunction.test(""+object);
-    }
-    catch (E)
-    {
-        FBTrace.sysout("Lib.isFunction() failed for ", object);
-        return false;
-    }
-};
-
-
-// ************************************************************************************************
-// Instance Checking
-
-this.instanceOf = function(object, className)
-{
-    if (!object || typeof object != "object")
-        return false;
-
-    // Try to use the native instanceof operator. We can only use it when we know
-    // exactly the window where the object is located at
-    if (object.ownerDocument)
-    {
-        // find the correct window of the object
-        var win = object.ownerDocument.defaultView || object.ownerDocument.parentWindow;
-
-        // if the class is accessible in the window, uses the native instanceof operator
-        // if the instanceof evaluates to "true" we can assume it is a instance, but if it
-        // evaluates to "false" we must continue with the duck type detection below because
-        // the native object may be extended, thus breaking the instanceof result
-        // See Issue 3524: Firebug Lite Style Panel doesn't work if the native Element is extended
-        if (className in win && object instanceof win[className])
-            return true;
-    }
-    // If the object doesn't have the ownerDocument property, we'll try to look at
-    // the current context's window
-    else
-    {
-        // TODO: xxxpedro context
-        // Since we're not using yet a Firebug.context, we'll just use the top window
-        // (browser) as a reference
-        var win = Firebug.browser.window;
-        if (className in win)
-            return object instanceof win[className];
-    }
-
-    // get the duck type model from the cache
-    var cache = instanceCheckMap[className];
-    if (!cache)
-        return false;
-
-    // starts the hacky duck type detection
-    for(var n in cache)
-    {
-        var obj = cache[n];
-        var type = typeof obj;
-        obj = type == "object" ? obj : [obj];
-
-        for(var name in obj)
-        {
-            // avoid problems with extended native objects
-            // See Issue 3524: Firebug Lite Style Panel doesn't work if the native Element is extended
-            if (!obj.hasOwnProperty(name))
-                continue;
-
-            var value = obj[name];
-
-            if( n == "property" && !(value in object) ||
-                n == "method" && !this.isFunction(object[value]) ||
-                n == "value" && (""+object[name]).toLowerCase() != (""+value).toLowerCase() )
-                    return false;
-        }
-    }
-
-    return true;
-};
-
-var instanceCheckMap =
-{
-    // DuckTypeCheck:
-    // {
-    //     property: ["window", "document"],
-    //     method: "setTimeout",
-    //     value: {nodeType: 1}
-    // },
-
-    Window:
-    {
-        property: ["window", "document"],
-        method: "setTimeout"
-    },
-
-    Document:
-    {
-        property: ["body", "cookie"],
-        method: "getElementById"
-    },
-
-    Node:
-    {
-        property: "ownerDocument",
-        method: "appendChild"
-    },
-
-    Element:
-    {
-        property: "tagName",
-        value: {nodeType: 1}
-    },
-
-    Location:
-    {
-        property: ["hostname", "protocol"],
-        method: "assign"
-    },
-
-    HTMLImageElement:
-    {
-        property: "useMap",
-        value:
-        {
-            nodeType: 1,
-            tagName: "img"
-        }
-    },
-
-    HTMLAnchorElement:
-    {
-        property: "hreflang",
-        value:
-        {
-            nodeType: 1,
-            tagName: "a"
-        }
-    },
-
-    HTMLInputElement:
-    {
-        property: "form",
-        value:
-        {
-            nodeType: 1,
-            tagName: "input"
-        }
-    },
-
-    HTMLButtonElement:
-    {
-        // ?
-    },
-
-    HTMLFormElement:
-    {
-        method: "submit",
-        value:
-        {
-            nodeType: 1,
-            tagName: "form"
-        }
-    },
-
-    HTMLBodyElement:
-    {
-
-    },
-
-    HTMLHtmlElement:
-    {
-
-    },
-
-    CSSStyleRule:
-    {
-        property: ["selectorText", "style"]
-    }
-
-};
-
-
-// ************************************************************************************************
-// DOM Constants
-
-/*
-
-Problems:
-
-  - IE does not have window.Node, window.Element, etc
-  - for (var name in Node.prototype) return nothing on FF
-
-*/
-
-
-var domMemberMap2 = {};
-
-var domMemberMap2Sandbox = null;
-
-var getDomMemberMap2 = function(name)
-{
-    if (!domMemberMap2Sandbox)
-    {
-        var doc = Firebug.chrome.document;
-        var frame = doc.createElement("iframe");
-
-        frame.id = "FirebugSandbox";
-        frame.style.display = "none";
-        frame.src = "about:blank";
-
-        doc.body.appendChild(frame);
-
-        domMemberMap2Sandbox = frame.window || frame.contentWindow;
-    }
-
-    var props = [];
-
-    //var object = domMemberMap2Sandbox[name];
-    //object = object.prototype || object;
-
-    var object = null;
-
-    if (name == "Window")
-        object = domMemberMap2Sandbox.window;
-
-    else if (name == "Document")
-        object = domMemberMap2Sandbox.document;
-
-    else if (name == "HTMLScriptElement")
-        object = domMemberMap2Sandbox.document.createElement("script");
-
-    else if (name == "HTMLAnchorElement")
-        object = domMemberMap2Sandbox.document.createElement("a");
-
-    else if (name.indexOf("Element") != -1)
-    {
-        object = domMemberMap2Sandbox.document.createElement("div");
-    }
-
-    if (object)
-    {
-        //object = object.prototype || object;
-
-        //props  = 'addEventListener,document,location,navigator,window'.split(',');
-
-        for (var n in object)
-          props.push(n);
-    }
-    /**/
-
-    return props;
-    return extendArray(props, domMemberMap[name]);
-};
-
-// xxxpedro experimental get DOM members
-this.getDOMMembers = function(object)
-{
-    if (!domMemberCache)
-    {
-        FBL.domMemberCache = domMemberCache = {};
-
-        for (var name in domMemberMap)
-        {
-            var builtins = getDomMemberMap2(name);
-            var cache = domMemberCache[name] = {};
-
-            /*
-            if (name.indexOf("Element") != -1)
-            {
-                this.append(cache, this.getDOMMembers("Node"));
-                this.append(cache, this.getDOMMembers("Element"));
-            }
-            /**/
-
-            for (var i = 0; i < builtins.length; ++i)
-                cache[builtins[i]] = i;
-        }
-    }
-
-    try
-    {
-        if (this.instanceOf(object, "Window"))
-            { return domMemberCache.Window; }
-        else if (this.instanceOf(object, "Document") || this.instanceOf(object, "XMLDocument"))
-            { return domMemberCache.Document; }
-        else if (this.instanceOf(object, "Location"))
-            { return domMemberCache.Location; }
-        else if (this.instanceOf(object, "HTMLImageElement"))
-            { return domMemberCache.HTMLImageElement; }
-        else if (this.instanceOf(object, "HTMLAnchorElement"))
-            { return domMemberCache.HTMLAnchorElement; }
-        else if (this.instanceOf(object, "HTMLInputElement"))
-            { return domMemberCache.HTMLInputElement; }
-        else if (this.instanceOf(object, "HTMLButtonElement"))
-            { return domMemberCache.HTMLButtonElement; }
-        else if (this.instanceOf(object, "HTMLFormElement"))
-            { return domMemberCache.HTMLFormElement; }
-        else if (this.instanceOf(object, "HTMLBodyElement"))
-            { return domMemberCache.HTMLBodyElement; }
-        else if (this.instanceOf(object, "HTMLHtmlElement"))
-            { return domMemberCache.HTMLHtmlElement; }
-        else if (this.instanceOf(object, "HTMLScriptElement"))
-            { return domMemberCache.HTMLScriptElement; }
-        else if (this.instanceOf(object, "HTMLTableElement"))
-            { return domMemberCache.HTMLTableElement; }
-        else if (this.instanceOf(object, "HTMLTableRowElement"))
-            { return domMemberCache.HTMLTableRowElement; }
-        else if (this.instanceOf(object, "HTMLTableCellElement"))
-            { return domMemberCache.HTMLTableCellElement; }
-        else if (this.instanceOf(object, "HTMLIFrameElement"))
-            { return domMemberCache.HTMLIFrameElement; }
-        else if (this.instanceOf(object, "SVGSVGElement"))
-            { return domMemberCache.SVGSVGElement; }
-        else if (this.instanceOf(object, "SVGElement"))
-            { return domMemberCache.SVGElement; }
-        else if (this.instanceOf(object, "Element"))
-            { return domMemberCache.Element; }
-        else if (this.instanceOf(object, "Text") || this.instanceOf(object, "CDATASection"))
-            { return domMemberCache.Text; }
-        else if (this.instanceOf(object, "Attr"))
-            { return domMemberCache.Attr; }
-        else if (this.instanceOf(object, "Node"))
-            { return domMemberCache.Node; }
-        else if (this.instanceOf(object, "Event") || this.instanceOf(object, "EventCopy"))
-            { return domMemberCache.Event; }
-        else
-            return {};
-    }
-    catch(E)
-    {
-        if (FBTrace.DBG_ERRORS)
-            FBTrace.sysout("lib.getDOMMembers FAILED ", E);
-
-        return {};
-    }
-};
-
-
-/*
-this.getDOMMembers = function(object)
-{
-    if (!domMemberCache)
-    {
-        domMemberCache = {};
-
-        for (var name in domMemberMap)
-        {
-            var builtins = domMemberMap[name];
-            var cache = domMemberCache[name] = {};
-
-            for (var i = 0; i < builtins.length; ++i)
-                cache[builtins[i]] = i;
-        }
-    }
-
-    try
-    {
-        if (this.instanceOf(object, "Window"))
-            { return domMemberCache.Window; }
-        else if (object instanceof Document || object instanceof XMLDocument)
-            { return domMemberCache.Document; }
-        else if (object instanceof Location)
-            { return domMemberCache.Location; }
-        else if (object instanceof HTMLImageElement)
-            { return domMemberCache.HTMLImageElement; }
-        else if (object instanceof HTMLAnchorElement)
-            { return domMemberCache.HTMLAnchorElement; }
-        else if (object instanceof HTMLInputElement)
-            { return domMemberCache.HTMLInputElement; }
-        else if (object instanceof HTMLButtonElement)
-            { return domMemberCache.HTMLButtonElement; }
-        else if (object instanceof HTMLFormElement)
-            { return domMemberCache.HTMLFormElement; }
-        else if (object instanceof HTMLBodyElement)
-            { return domMemberCache.HTMLBodyElement; }
-        else if (object instanceof HTMLHtmlElement)
-            { return domMemberCache.HTMLHtmlElement; }
-        else if (object instanceof HTMLScriptElement)
-            { return domMemberCache.HTMLScriptElement; }
-        else if (object instanceof HTMLTableElement)
-            { return domMemberCache.HTMLTableElement; }
-        else if (object instanceof HTMLTableRowElement)
-            { return domMemberCache.HTMLTableRowElement; }
-        else if (object instanceof HTMLTableCellElement)
-            { return domMemberCache.HTMLTableCellElement; }
-        else if (object instanceof HTMLIFrameElement)
-            { return domMemberCache.HTMLIFrameElement; }
-        else if (object instanceof SVGSVGElement)
-            { return domMemberCache.SVGSVGElement; }
-        else if (object instanceof SVGElement)
-            { return domMemberCache.SVGElement; }
-        else if (object instanceof Element)
-            { return domMemberCache.Element; }
-        else if (object instanceof Text || object instanceof CDATASection)
-            { return domMemberCache.Text; }
-        else if (object instanceof Attr)
-            { return domMemberCache.Attr; }
-        else if (object instanceof Node)
-            { return domMemberCache.Node; }
-        else if (object instanceof Event || object instanceof EventCopy)
-            { return domMemberCache.Event; }
-        else
-            return {};
-    }
-    catch(E)
-    {
-        return {};
-    }
-};
-/**/
-
-this.isDOMMember = function(object, propName)
-{
-    var members = this.getDOMMembers(object);
-    return members && propName in members;
-};
-
-var domMemberCache = null;
-var domMemberMap = {};
-
-domMemberMap.Window =
-[
-    "document",
-    "frameElement",
-
-    "innerWidth",
-    "innerHeight",
-    "outerWidth",
-    "outerHeight",
-    "screenX",
-    "screenY",
-    "pageXOffset",
-    "pageYOffset",
-    "scrollX",
-    "scrollY",
-    "scrollMaxX",
-    "scrollMaxY",
-
-    "status",
-    "defaultStatus",
-
-    "parent",
-    "opener",
-    "top",
-    "window",
-    "content",
-    "self",
-
-    "location",
-    "history",
-    "frames",
-    "navigator",
-    "screen",
-    "menubar",
-    "toolbar",
-    "locationbar",
-    "personalbar",
-    "statusbar",
-    "directories",
-    "scrollbars",
-    "fullScreen",
-    "netscape",
-    "java",
-    "console",
-    "Components",
-    "controllers",
-    "closed",
-    "crypto",
-    "pkcs11",
-
-    "name",
-    "property",
-    "length",
-
-    "sessionStorage",
-    "globalStorage",
-
-    "setTimeout",
-    "setInterval",
-    "clearTimeout",
-    "clearInterval",
-    "addEventListener",
-    "removeEventListener",
-    "dispatchEvent",
-    "getComputedStyle",
-    "captureEvents",
-    "releaseEvents",
-    "routeEvent",
-    "enableExternalCapture",
-    "disableExternalCapture",
-    "moveTo",
-    "moveBy",
-    "resizeTo",
-    "resizeBy",
-    "scroll",
-    "scrollTo",
-    "scrollBy",
-    "scrollByLines",
-    "scrollByPages",
-    "sizeToContent",
-    "setResizable",
-    "getSelection",
-    "open",
-    "openDialog",
-    "close",
-    "alert",
-    "confirm",
-    "prompt",
-    "dump",
-    "focus",
-    "blur",
-    "find",
-    "back",
-    "forward",
-    "home",
-    "stop",
-    "print",
-    "atob",
-    "btoa",
-    "updateCommands",
-    "XPCNativeWrapper",
-    "GeckoActiveXObject",
-    "applicationCache"      // FF3
-];
-
-domMemberMap.Location =
-[
-    "href",
-    "protocol",
-    "host",
-    "hostname",
-    "port",
-    "pathname",
-    "search",
-    "hash",
-
-    "assign",
-    "reload",
-    "replace"
-];
-
-domMemberMap.Node =
-[
-    "id",
-    "className",
-
-    "nodeType",
-    "tagName",
-    "nodeName",
-    "localName",
-    "prefix",
-    "namespaceURI",
-    "nodeValue",
-
-    "ownerDocument",
-    "parentNode",
-    "offsetParent",
-    "nextSibling",
-    "previousSibling",
-    "firstChild",
-    "lastChild",
-    "childNodes",
-    "attributes",
-
-    "dir",
-    "baseURI",
-    "textContent",
-    "innerHTML",
-
-    "addEventListener",
-    "removeEventListener",
-    "dispatchEvent",
-    "cloneNode",
-    "appendChild",
-    "insertBefore",
-    "replaceChild",
-    "removeChild",
-    "compareDocumentPosition",
-    "hasAttributes",
-    "hasChildNodes",
-    "lookupNamespaceURI",
-    "lookupPrefix",
-    "normalize",
-    "isDefaultNamespace",
-    "isEqualNode",
-    "isSameNode",
-    "isSupported",
-    "getFeature",
-    "getUserData",
-    "setUserData"
-];
-
-domMemberMap.Document = extendArray(domMemberMap.Node,
-[
-    "documentElement",
-    "body",
-    "title",
-    "location",
-    "referrer",
-    "cookie",
-    "contentType",
-    "lastModified",
-    "characterSet",
-    "inputEncoding",
-    "xmlEncoding",
-    "xmlStandalone",
-    "xmlVersion",
-    "strictErrorChecking",
-    "documentURI",
-    "URL",
-
-    "defaultView",
-    "doctype",
-    "implementation",
-    "styleSheets",
-    "images",
-    "links",
-    "forms",
-    "anchors",
-    "embeds",
-    "plugins",
-    "applets",
-
-    "width",
-    "height",
-
-    "designMode",
-    "compatMode",
-    "async",
-    "preferredStylesheetSet",
-
-    "alinkColor",
-    "linkColor",
-    "vlinkColor",
-    "bgColor",
-    "fgColor",
-    "domain",
-
-    "addEventListener",
-    "removeEventListener",
-    "dispatchEvent",
-    "captureEvents",
-    "releaseEvents",
-    "routeEvent",
-    "clear",
-    "open",
-    "close",
-    "execCommand",
-    "execCommandShowHelp",
-    "getElementsByName",
-    "getSelection",
-    "queryCommandEnabled",
-    "queryCommandIndeterm",
-    "queryCommandState",
-    "queryCommandSupported",
-    "queryCommandText",
-    "queryCommandValue",
-    "write",
-    "writeln",
-    "adoptNode",
-    "appendChild",
-    "removeChild",
-    "renameNode",
-    "cloneNode",
-    "compareDocumentPosition",
-    "createAttribute",
-    "createAttributeNS",
-    "createCDATASection",
-    "createComment",
-    "createDocumentFragment",
-    "createElement",
-    "createElementNS",
-    "createEntityReference",
-    "createEvent",
-    "createExpression",
-    "createNSResolver",
-    "createNodeIterator",
-    "createProcessingInstruction",
-    "createRange",
-    "createTextNode",
-    "createTreeWalker",
-    "domConfig",
-    "evaluate",
-    "evaluateFIXptr",
-    "evaluateXPointer",
-    "getAnonymousElementByAttribute",
-    "getAnonymousNodes",
-    "addBinding",
-    "removeBinding",
-    "getBindingParent",
-    "getBoxObjectFor",
-    "setBoxObjectFor",
-    "getElementById",
-    "getElementsByTagName",
-    "getElementsByTagNameNS",
-    "hasAttributes",
-    "hasChildNodes",
-    "importNode",
-    "insertBefore",
-    "isDefaultNamespace",
-    "isEqualNode",
-    "isSameNode",
-    "isSupported",
-    "load",
-    "loadBindingDocument",
-    "lookupNamespaceURI",
-    "lookupPrefix",
-    "normalize",
-    "normalizeDocument",
-    "getFeature",
-    "getUserData",
-    "setUserData"
-]);
-
-domMemberMap.Element = extendArray(domMemberMap.Node,
-[
-    "clientWidth",
-    "clientHeight",
-    "offsetLeft",
-    "offsetTop",
-    "offsetWidth",
-    "offsetHeight",
-    "scrollLeft",
-    "scrollTop",
-    "scrollWidth",
-    "scrollHeight",
-
-    "style",
-
-    "tabIndex",
-    "title",
-    "lang",
-    "align",
-    "spellcheck",
-
-    "addEventListener",
-    "removeEventListener",
-    "dispatchEvent",
-    "focus",
-    "blur",
-    "cloneNode",
-    "appendChild",
-    "insertBefore",
-    "replaceChild",
-    "removeChild",
-    "compareDocumentPosition",
-    "getElementsByTagName",
-    "getElementsByTagNameNS",
-    "getAttribute",
-    "getAttributeNS",
-    "getAttributeNode",
-    "getAttributeNodeNS",
-    "setAttribute",
-    "setAttributeNS",
-    "setAttributeNode",
-    "setAttributeNodeNS",
-    "removeAttribute",
-    "removeAttributeNS",
-    "removeAttributeNode",
-    "hasAttribute",
-    "hasAttributeNS",
-    "hasAttributes",
-    "hasChildNodes",
-    "lookupNamespaceURI",
-    "lookupPrefix",
-    "normalize",
-    "isDefaultNamespace",
-    "isEqualNode",
-    "isSameNode",
-    "isSupported",
-    "getFeature",
-    "getUserData",
-    "setUserData"
-]);
-
-domMemberMap.SVGElement = extendArray(domMemberMap.Element,
-[
-    "x",
-    "y",
-    "width",
-    "height",
-    "rx",
-    "ry",
-    "transform",
-    "href",
-
-    "ownerSVGElement",
-    "viewportElement",
-    "farthestViewportElement",
-    "nearestViewportElement",
-
-    "getBBox",
-    "getCTM",
-    "getScreenCTM",
-    "getTransformToElement",
-    "getPresentationAttribute",
-    "preserveAspectRatio"
-]);
-
-domMemberMap.SVGSVGElement = extendArray(domMemberMap.Element,
-[
-    "x",
-    "y",
-    "width",
-    "height",
-    "rx",
-    "ry",
-    "transform",
-
-    "viewBox",
-    "viewport",
-    "currentView",
-    "useCurrentView",
-    "pixelUnitToMillimeterX",
-    "pixelUnitToMillimeterY",
-    "screenPixelToMillimeterX",
-    "screenPixelToMillimeterY",
-    "currentScale",
-    "currentTranslate",
-    "zoomAndPan",
-
-    "ownerSVGElement",
-    "viewportElement",
-    "farthestViewportElement",
-    "nearestViewportElement",
-    "contentScriptType",
-    "contentStyleType",
-
-    "getBBox",
-    "getCTM",
-    "getScreenCTM",
-    "getTransformToElement",
-    "getEnclosureList",
-    "getIntersectionList",
-    "getViewboxToViewportTransform",
-    "getPresentationAttribute",
-    "getElementById",
-    "checkEnclosure",
-    "checkIntersection",
-    "createSVGAngle",
-    "createSVGLength",
-    "createSVGMatrix",
-    "createSVGNumber",
-    "createSVGPoint",
-    "createSVGRect",
-    "createSVGString",
-    "createSVGTransform",
-    "createSVGTransformFromMatrix",
-    "deSelectAll",
-    "preserveAspectRatio",
-    "forceRedraw",
-    "suspendRedraw",
-    "unsuspendRedraw",
-    "unsuspendRedrawAll",
-    "getCurrentTime",
-    "setCurrentTime",
-    "animationsPaused",
-    "pauseAnimations",
-    "unpauseAnimations"
-]);
-
-domMemberMap.HTMLImageElement = extendArray(domMemberMap.Element,
-[
-    "src",
-    "naturalWidth",
-    "naturalHeight",
-    "width",
-    "height",
-    "x",
-    "y",
-    "name",
-    "alt",
-    "longDesc",
-    "lowsrc",
-    "border",
-    "complete",
-    "hspace",
-    "vspace",
-    "isMap",
-    "useMap"
-]);
-
-domMemberMap.HTMLAnchorElement = extendArray(domMemberMap.Element,
-[
-    "name",
-    "target",
-    "accessKey",
-    "href",
-    "protocol",
-    "host",
-    "hostname",
-    "port",
-    "pathname",
-    "search",
-    "hash",
-    "hreflang",
-    "coords",
-    "shape",
-    "text",
-    "type",
-    "rel",
-    "rev",
-    "charset"
-]);
-
-domMemberMap.HTMLIFrameElement = extendArray(domMemberMap.Element,
-[
-    "contentDocument",
-    "contentWindow",
-    "frameBorder",
-    "height",
-    "longDesc",
-    "marginHeight",
-    "marginWidth",
-    "name",
-    "scrolling",
-    "src",
-    "width"
-]);
-
-domMemberMap.HTMLTableElement = extendArray(domMemberMap.Element,
-[
-    "bgColor",
-    "border",
-    "caption",
-    "cellPadding",
-    "cellSpacing",
-    "frame",
-    "rows",
-    "rules",
-    "summary",
-    "tBodies",
-    "tFoot",
-    "tHead",
-    "width",
-
-    "createCaption",
-    "createTFoot",
-    "createTHead",
-    "deleteCaption",
-    "deleteRow",
-    "deleteTFoot",
-    "deleteTHead",
-    "insertRow"
-]);
-
-domMemberMap.HTMLTableRowElement = extendArray(domMemberMap.Element,
-[
-    "bgColor",
-    "cells",
-    "ch",
-    "chOff",
-    "rowIndex",
-    "sectionRowIndex",
-    "vAlign",
-
-    "deleteCell",
-    "insertCell"
-]);
-
-domMemberMap.HTMLTableCellElement = extendArray(domMemberMap.Element,
-[
-    "abbr",
-    "axis",
-    "bgColor",
-    "cellIndex",
-    "ch",
-    "chOff",
-    "colSpan",
-    "headers",
-    "height",
-    "noWrap",
-    "rowSpan",
-    "scope",
-    "vAlign",
-    "width"
-
-]);
-
-domMemberMap.HTMLScriptElement = extendArray(domMemberMap.Element,
-[
-    "src"
-]);
-
-domMemberMap.HTMLButtonElement = extendArray(domMemberMap.Element,
-[
-    "accessKey",
-    "disabled",
-    "form",
-    "name",
-    "type",
-    "value",
-
-    "click"
-]);
-
-domMemberMap.HTMLInputElement = extendArray(domMemberMap.Element,
-[
-    "type",
-    "value",
-    "checked",
-    "accept",
-    "accessKey",
-    "alt",
-    "controllers",
-    "defaultChecked",
-    "defaultValue",
-    "disabled",
-    "form",
-    "maxLength",
-    "name",
-    "readOnly",
-    "selectionEnd",
-    "selectionStart",
-    "size",
-    "src",
-    "textLength",
-    "useMap",
-
-    "click",
-    "select",
-    "setSelectionRange"
-]);
-
-domMemberMap.HTMLFormElement = extendArray(domMemberMap.Element,
-[
-    "acceptCharset",
-    "action",
-    "author",
-    "elements",
-    "encoding",
-    "enctype",
-    "entry_id",
-    "length",
-    "method",
-    "name",
-    "post",
-    "target",
-    "text",
-    "url",
-
-    "reset",
-    "submit"
-]);
-
-domMemberMap.HTMLBodyElement = extendArray(domMemberMap.Element,
-[
-    "aLink",
-    "background",
-    "bgColor",
-    "link",
-    "text",
-    "vLink"
-]);
-
-domMemberMap.HTMLHtmlElement = extendArray(domMemberMap.Element,
-[
-    "version"
-]);
-
-domMemberMap.Text = extendArray(domMemberMap.Node,
-[
-    "data",
-    "length",
-
-    "appendData",
-    "deleteData",
-    "insertData",
-    "replaceData",
-    "splitText",
-    "substringData"
-]);
-
-domMemberMap.Attr = extendArray(domMemberMap.Node,
-[
-    "name",
-    "value",
-    "specified",
-    "ownerElement"
-]);
-
-domMemberMap.Event =
-[
-    "type",
-    "target",
-    "currentTarget",
-    "originalTarget",
-    "explicitOriginalTarget",
-    "relatedTarget",
-    "rangeParent",
-    "rangeOffset",
-    "view",
-
-    "keyCode",
-    "charCode",
-    "screenX",
-    "screenY",
-    "clientX",
-    "clientY",
-    "layerX",
-    "layerY",
-    "pageX",
-    "pageY",
-
-    "detail",
-    "button",
-    "which",
-    "ctrlKey",
-    "shiftKey",
-    "altKey",
-    "metaKey",
-
-    "eventPhase",
-    "timeStamp",
-    "bubbles",
-    "cancelable",
-    "cancelBubble",
-
-    "isTrusted",
-    "isChar",
-
-    "getPreventDefault",
-    "initEvent",
-    "initMouseEvent",
-    "initKeyEvent",
-    "initUIEvent",
-    "preventBubble",
-    "preventCapture",
-    "preventDefault",
-    "stopPropagation"
-];
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-this.domConstantMap =
-{
-    "ELEMENT_NODE": 1,
-    "ATTRIBUTE_NODE": 1,
-    "TEXT_NODE": 1,
-    "CDATA_SECTION_NODE": 1,
-    "ENTITY_REFERENCE_NODE": 1,
-    "ENTITY_NODE": 1,
-    "PROCESSING_INSTRUCTION_NODE": 1,
-    "COMMENT_NODE": 1,
-    "DOCUMENT_NODE": 1,
-    "DOCUMENT_TYPE_NODE": 1,
-    "DOCUMENT_FRAGMENT_NODE": 1,
-    "NOTATION_NODE": 1,
-
-    "DOCUMENT_POSITION_DISCONNECTED": 1,
-    "DOCUMENT_POSITION_PRECEDING": 1,
-    "DOCUMENT_POSITION_FOLLOWING": 1,
-    "DOCUMENT_POSITION_CONTAINS": 1,
-    "DOCUMENT_POSITION_CONTAINED_BY": 1,
-    "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC": 1,
-
-    "UNKNOWN_RULE": 1,
-    "STYLE_RULE": 1,
-    "CHARSET_RULE": 1,
-    "IMPORT_RULE": 1,
-    "MEDIA_RULE": 1,
-    "FONT_FACE_RULE": 1,
-    "PAGE_RULE": 1,
-
-    "CAPTURING_PHASE": 1,
-    "AT_TARGET": 1,
-    "BUBBLING_PHASE": 1,
-
-    "SCROLL_PAGE_UP": 1,
-    "SCROLL_PAGE_DOWN": 1,
-
-    "MOUSEUP": 1,
-    "MOUSEDOWN": 1,
-    "MOUSEOVER": 1,
-    "MOUSEOUT": 1,
-    "MOUSEMOVE": 1,
-    "MOUSEDRAG": 1,
-    "CLICK": 1,
-    "DBLCLICK": 1,
-    "KEYDOWN": 1,
-    "KEYUP": 1,
-    "KEYPRESS": 1,
-    "DRAGDROP": 1,
-    "FOCUS": 1,
-    "BLUR": 1,
-    "SELECT": 1,
-    "CHANGE": 1,
-    "RESET": 1,
-    "SUBMIT": 1,
-    "SCROLL": 1,
-    "LOAD": 1,
-    "UNLOAD": 1,
-    "XFER_DONE": 1,
-    "ABORT": 1,
-    "ERROR": 1,
-    "LOCATE": 1,
-    "MOVE": 1,
-    "RESIZE": 1,
-    "FORWARD": 1,
-    "HELP": 1,
-    "BACK": 1,
-    "TEXT": 1,
-
-    "ALT_MASK": 1,
-    "CONTROL_MASK": 1,
-    "SHIFT_MASK": 1,
-    "META_MASK": 1,
-
-    "DOM_VK_TAB": 1,
-    "DOM_VK_PAGE_UP": 1,
-    "DOM_VK_PAGE_DOWN": 1,
-    "DOM_VK_UP": 1,
-    "DOM_VK_DOWN": 1,
-    "DOM_VK_LEFT": 1,
-    "DOM_VK_RIGHT": 1,
-    "DOM_VK_CANCEL": 1,
-    "DOM_VK_HELP": 1,
-    "DOM_VK_BACK_SPACE": 1,
-    "DOM_VK_CLEAR": 1,
-    "DOM_VK_RETURN": 1,
-    "DOM_VK_ENTER": 1,
-    "DOM_VK_SHIFT": 1,
-    "DOM_VK_CONTROL": 1,
-    "DOM_VK_ALT": 1,
-    "DOM_VK_PAUSE": 1,
-    "DOM_VK_CAPS_LOCK": 1,
-    "DOM_VK_ESCAPE": 1,
-    "DOM_VK_SPACE": 1,
-    "DOM_VK_END": 1,
-    "DOM_VK_HOME": 1,
-    "DOM_VK_PRINTSCREEN": 1,
-    "DOM_VK_INSERT": 1,
-    "DOM_VK_DELETE": 1,
-    "DOM_VK_0": 1,
-    "DOM_VK_1": 1,
-    "DOM_VK_2": 1,
-    "DOM_VK_3": 1,
-    "DOM_VK_4": 1,
-    "DOM_VK_5": 1,
-    "DOM_VK_6": 1,
-    "DOM_VK_7": 1,
-    "DOM_VK_8": 1,
-    "DOM_VK_9": 1,
-    "DOM_VK_SEMICOLON": 1,
-    "DOM_VK_EQUALS": 1,
-    "DOM_VK_A": 1,
-    "DOM_VK_B": 1,
-    "DOM_VK_C": 1,
-    "DOM_VK_D": 1,
-    "DOM_VK_E": 1,
-    "DOM_VK_F": 1,
-    "DOM_VK_G": 1,
-    "DOM_VK_H": 1,
-    "DOM_VK_I": 1,
-    "DOM_VK_J": 1,
-    "DOM_VK_K": 1,
-    "DOM_VK_L": 1,
-    "DOM_VK_M": 1,
-    "DOM_VK_N": 1,
-    "DOM_VK_O": 1,
-    "DOM_VK_P": 1,
-    "DOM_VK_Q": 1,
-    "DOM_VK_R": 1,
-    "DOM_VK_S": 1,
-    "DOM_VK_T": 1,
-    "DOM_VK_U": 1,
-    "DOM_VK_V": 1,
-    "DOM_VK_W": 1,
-    "DOM_VK_X": 1,
-    "DOM_VK_Y": 1,
-    "DOM_VK_Z": 1,
-    "DOM_VK_CONTEXT_MENU": 1,
-    "DOM_VK_NUMPAD0": 1,
-    "DOM_VK_NUMPAD1": 1,
-    "DOM_VK_NUMPAD2": 1,
-    "DOM_VK_NUMPAD3": 1,
-    "DOM_VK_NUMPAD4": 1,
-    "DOM_VK_NUMPAD5": 1,
-    "DOM_VK_NUMPAD6": 1,
-    "DOM_VK_NUMPAD7": 1,
-    "DOM_VK_NUMPAD8": 1,
-    "DOM_VK_NUMPAD9": 1,
-    "DOM_VK_MULTIPLY": 1,
-    "DOM_VK_ADD": 1,
-    "DOM_VK_SEPARATOR": 1,
-    "DOM_VK_SUBTRACT": 1,
-    "DOM_VK_DECIMAL": 1,
-    "DOM_VK_DIVIDE": 1,
-    "DOM_VK_F1": 1,
-    "DOM_VK_F2": 1,
-    "DOM_VK_F3": 1,
-    "DOM_VK_F4": 1,
-    "DOM_VK_F5": 1,
-    "DOM_VK_F6": 1,
-    "DOM_VK_F7": 1,
-    "DOM_VK_F8": 1,
-    "DOM_VK_F9": 1,
-    "DOM_VK_F10": 1,
-    "DOM_VK_F11": 1,
-    "DOM_VK_F12": 1,
-    "DOM_VK_F13": 1,
-    "DOM_VK_F14": 1,
-    "DOM_VK_F15": 1,
-    "DOM_VK_F16": 1,
-    "DOM_VK_F17": 1,
-    "DOM_VK_F18": 1,
-    "DOM_VK_F19": 1,
-    "DOM_VK_F20": 1,
-    "DOM_VK_F21": 1,
-    "DOM_VK_F22": 1,
-    "DOM_VK_F23": 1,
-    "DOM_VK_F24": 1,
-    "DOM_VK_NUM_LOCK": 1,
-    "DOM_VK_SCROLL_LOCK": 1,
-    "DOM_VK_COMMA": 1,
-    "DOM_VK_PERIOD": 1,
-    "DOM_VK_SLASH": 1,
-    "DOM_VK_BACK_QUOTE": 1,
-    "DOM_VK_OPEN_BRACKET": 1,
-    "DOM_VK_BACK_SLASH": 1,
-    "DOM_VK_CLOSE_BRACKET": 1,
-    "DOM_VK_QUOTE": 1,
-    "DOM_VK_META": 1,
-
-    "SVG_ZOOMANDPAN_DISABLE": 1,
-    "SVG_ZOOMANDPAN_MAGNIFY": 1,
-    "SVG_ZOOMANDPAN_UNKNOWN": 1
-};
-
-this.cssInfo =
-{
-    "background": ["bgRepeat", "bgAttachment", "bgPosition", "color", "systemColor", "none"],
-    "background-attachment": ["bgAttachment"],
-    "background-color": ["color", "systemColor"],
-    "background-image": ["none"],
-    "background-position": ["bgPosition"],
-    "background-repeat": ["bgRepeat"],
-
-    "border": ["borderStyle", "thickness", "color", "systemColor", "none"],
-    "border-top": ["borderStyle", "borderCollapse", "color", "systemColor", "none"],
-    "border-right": ["borderStyle", "borderCollapse", "color", "systemColor", "none"],
-    "border-bottom": ["borderStyle", "borderCollapse", "color", "systemColor", "none"],
-    "border-left": ["borderStyle", "borderCollapse", "color", "systemColor", "none"],
-    "border-collapse": ["borderCollapse"],
-    "border-color": ["color", "systemColor"],
-    "border-top-color": ["color", "systemColor"],
-    "border-right-color": ["color", "systemColor"],
-    "border-bottom-color": ["color", "systemColor"],
-    "border-left-color": ["color", "systemColor"],
-    "border-spacing": [],
-    "border-style": ["borderStyle"],
-    "border-top-style": ["borderStyle"],
-    "border-right-style": ["borderStyle"],
-    "border-bottom-style": ["borderStyle"],
-    "border-left-style": ["borderStyle"],
-    "border-width": ["thickness"],
-    "border-top-width": ["thickness"],
-    "border-right-width": ["thickness"],
-    "border-bottom-width": ["thickness"],
-    "border-left-width": ["thickness"],
-
-    "bottom": ["auto"],
-    "caption-side": ["captionSide"],
-    "clear": ["clear", "none"],
-    "clip": ["auto"],
-    "color": ["color", "systemColor"],
-    "content": ["content"],
-    "counter-increment": ["none"],
-    "counter-reset": ["none"],
-    "cursor": ["cursor", "none"],
-    "direction": ["direction"],
-    "display": ["display", "none"],
-    "empty-cells": [],
-    "float": ["float", "none"],
-    "font": ["fontStyle", "fontVariant", "fontWeight", "fontFamily"],
-
-    "font-family": ["fontFamily"],
-    "font-size": ["fontSize"],
-    "font-size-adjust": [],
-    "font-stretch": [],
-    "font-style": ["fontStyle"],
-    "font-variant": ["fontVariant"],
-    "font-weight": ["fontWeight"],
-
-    "height": ["auto"],
-    "left": ["auto"],
-    "letter-spacing": [],
-    "line-height": [],
-
-    "list-style": ["listStyleType", "listStylePosition", "none"],
-    "list-style-image": ["none"],
-    "list-style-position": ["listStylePosition"],
-    "list-style-type": ["listStyleType", "none"],
-
-    "margin": [],
-    "margin-top": [],
-    "margin-right": [],
-    "margin-bottom": [],
-    "margin-left": [],
-
-    "marker-offset": ["auto"],
-    "min-height": ["none"],
-    "max-height": ["none"],
-    "min-width": ["none"],
-    "max-width": ["none"],
-
-    "outline": ["borderStyle", "color", "systemColor", "none"],
-    "outline-color": ["color", "systemColor"],
-    "outline-style": ["borderStyle"],
-    "outline-width": [],
-
-    "overflow": ["overflow", "auto"],
-    "overflow-x": ["overflow", "auto"],
-    "overflow-y": ["overflow", "auto"],
-
-    "padding": [],
-    "padding-top": [],
-    "padding-right": [],
-    "padding-bottom": [],
-    "padding-left": [],
-
-    "position": ["position"],
-    "quotes": ["none"],
-    "right": ["auto"],
-    "table-layout": ["tableLayout", "auto"],
-    "text-align": ["textAlign"],
-    "text-decoration": ["textDecoration", "none"],
-    "text-indent": [],
-    "text-shadow": [],
-    "text-transform": ["textTransform", "none"],
-    "top": ["auto"],
-    "unicode-bidi": [],
-    "vertical-align": ["verticalAlign"],
-    "white-space": ["whiteSpace"],
-    "width": ["auto"],
-    "word-spacing": [],
-    "z-index": [],
-
-    "-moz-appearance": ["mozAppearance"],
-    "-moz-border-radius": [],
-    "-moz-border-radius-bottomleft": [],
-    "-moz-border-radius-bottomright": [],
-    "-moz-border-radius-topleft": [],
-    "-moz-border-radius-topright": [],
-    "-moz-border-top-colors": ["color", "systemColor"],
-    "-moz-border-right-colors": ["color", "systemColor"],
-    "-moz-border-bottom-colors": ["color", "systemColor"],
-    "-moz-border-left-colors": ["color", "systemColor"],
-    "-moz-box-align": ["mozBoxAlign"],
-    "-moz-box-direction": ["mozBoxDirection"],
-    "-moz-box-flex": [],
-    "-moz-box-ordinal-group": [],
-    "-moz-box-orient": ["mozBoxOrient"],
-    "-moz-box-pack": ["mozBoxPack"],
-    "-moz-box-sizing": ["mozBoxSizing"],
-    "-moz-opacity": [],
-    "-moz-user-focus": ["userFocus", "none"],
-    "-moz-user-input": ["userInput"],
-    "-moz-user-modify": [],
-    "-moz-user-select": ["userSelect", "none"],
-    "-moz-background-clip": [],
-    "-moz-background-inline-policy": [],
-    "-moz-background-origin": [],
-    "-moz-binding": [],
-    "-moz-column-count": [],
-    "-moz-column-gap": [],
-    "-moz-column-width": [],
-    "-moz-image-region": []
-};
-
-this.inheritedStyleNames =
-{
-    "border-collapse": 1,
-    "border-spacing": 1,
-    "border-style": 1,
-    "caption-side": 1,
-    "color": 1,
-    "cursor": 1,
-    "direction": 1,
-    "empty-cells": 1,
-    "font": 1,
-    "font-family": 1,
-    "font-size-adjust": 1,
-    "font-size": 1,
-    "font-style": 1,
-    "font-variant": 1,
-    "font-weight": 1,
-    "letter-spacing": 1,
-    "line-height": 1,
-    "list-style": 1,
-    "list-style-image": 1,
-    "list-style-position": 1,
-    "list-style-type": 1,
-    "quotes": 1,
-    "text-align": 1,
-    "text-decoration": 1,
-    "text-indent": 1,
-    "text-shadow": 1,
-    "text-transform": 1,
-    "white-space": 1,
-    "word-spacing": 1
-};
-
-this.cssKeywords =
-{
-    "appearance":
-    [
-        "button",
-        "button-small",
-        "checkbox",
-        "checkbox-container",
-        "checkbox-small",
-        "dialog",
-        "listbox",
-        "menuitem",
-        "menulist",
-        "menulist-button",
-        "menulist-textfield",
-        "menupopup",
-        "progressbar",
-        "radio",
-        "radio-container",
-        "radio-small",
-        "resizer",
-        "scrollbar",
-        "scrollbarbutton-down",
-        "scrollbarbutton-left",
-        "scrollbarbutton-right",
-        "scrollbarbutton-up",
-        "scrollbartrack-horizontal",
-        "scrollbartrack-vertical",
-        "separator",
-        "statusbar",
-        "tab",
-        "tab-left-edge",
-        "tabpanels",
-        "textfield",
-        "toolbar",
-        "toolbarbutton",
-        "toolbox",
-        "tooltip",
-        "treeheadercell",
-        "treeheadersortarrow",
-        "treeitem",
-        "treetwisty",
-        "treetwistyopen",
-        "treeview",
-        "window"
-    ],
-
-    "systemColor":
-    [
-        "ActiveBorder",
-        "ActiveCaption",
-        "AppWorkspace",
-        "Background",
-        "ButtonFace",
-        "ButtonHighlight",
-        "ButtonShadow",
-        "ButtonText",
-        "CaptionText",
-        "GrayText",
-        "Highlight",
-        "HighlightText",
-        "InactiveBorder",
-        "InactiveCaption",
-        "InactiveCaptionText",
-        "InfoBackground",
-        "InfoText",
-        "Menu",
-        "MenuText",
-        "Scrollbar",
-        "ThreeDDarkShadow",
-        "ThreeDFace",
-        "ThreeDHighlight",
-        "ThreeDLightShadow",
-        "ThreeDShadow",
-        "Window",
-        "WindowFrame",
-        "WindowText",
-        "-moz-field",
-        "-moz-fieldtext",
-        "-moz-workspace",
-        "-moz-visitedhyperlinktext",
-        "-moz-use-text-color"
-    ],
-
-    "color":
-    [
-        "AliceBlue",
-        "AntiqueWhite",
-        "Aqua",
-        "Aquamarine",
-        "Azure",
-        "Beige",
-        "Bisque",
-        "Black",
-        "BlanchedAlmond",
-        "Blue",
-        "BlueViolet",
-        "Brown",
-        "BurlyWood",
-        "CadetBlue",
-        "Chartreuse",
-        "Chocolate",
-        "Coral",
-        "CornflowerBlue",
-        "Cornsilk",
-        "Crimson",
-        "Cyan",
-        "DarkBlue",
-        "DarkCyan",
-        "DarkGoldenRod",
-        "DarkGray",
-        "DarkGreen",
-        "DarkKhaki",
-        "DarkMagenta",
-        "DarkOliveGreen",
-        "DarkOrange",
-        "DarkOrchid",
-        "DarkRed",
-        "DarkSalmon",
-        "DarkSeaGreen",
-        "DarkSlateBlue",
-        "DarkSlateGray",
-        "DarkTurquoise",
-        "DarkViolet",
-        "DeepPink",
-        "DarkSkyBlue",
-        "DimGray",
-        "DodgerBlue",
-        "Feldspar",
-        "FireBrick",
-        "FloralWhite",
-        "ForestGreen",
-        "Fuchsia",
-        "Gainsboro",
-        "GhostWhite",
-        "Gold",
-        "GoldenRod",
-        "Gray",
-        "Green",
-        "GreenYellow",
-        "HoneyDew",
-        "HotPink",
-        "IndianRed",
-        "Indigo",
-        "Ivory",
-        "Khaki",
-        "Lavender",
-        "LavenderBlush",
-        "LawnGreen",
-        "LemonChiffon",
-        "LightBlue",
-        "LightCoral",
-        "LightCyan",
-        "LightGoldenRodYellow",
-        "LightGrey",
-        "LightGreen",
-        "LightPink",
-        "LightSalmon",
-        "LightSeaGreen",
-        "LightSkyBlue",
-        "LightSlateBlue",
-        "LightSlateGray",
-        "LightSteelBlue",
-        "LightYellow",
-        "Lime",
-        "LimeGreen",
-        "Linen",
-        "Magenta",
-        "Maroon",
-        "MediumAquaMarine",
-        "MediumBlue",
-        "MediumOrchid",
-        "MediumPurple",
-        "MediumSeaGreen",
-        "MediumSlateBlue",
-        "MediumSpringGreen",
-        "MediumTurquoise",
-        "MediumVioletRed",
-        "MidnightBlue",
-        "MintCream",
-        "MistyRose",
-        "Moccasin",
-        "NavajoWhite",
-        "Navy",
-        "OldLace",
-        "Olive",
-        "OliveDrab",
-        "Orange",
-        "OrangeRed",
-        "Orchid",
-        "PaleGoldenRod",
-        "PaleGreen",
-        "PaleTurquoise",
-        "PaleVioletRed",
-        "PapayaWhip",
-        "PeachPuff",
-        "Peru",
-        "Pink",
-        "Plum",
-        "PowderBlue",
-        "Purple",
-        "Red",
-        "RosyBrown",
-        "RoyalBlue",
-        "SaddleBrown",
-        "Salmon",
-        "SandyBrown",
-        "SeaGreen",
-        "SeaShell",
-        "Sienna",
-        "Silver",
-        "SkyBlue",
-        "SlateBlue",
-        "SlateGray",
-        "Snow",
-        "SpringGreen",
-        "SteelBlue",
-        "Tan",
-        "Teal",
-        "Thistle",
-        "Tomato",
-        "Turquoise",
-        "Violet",
-        "VioletRed",
-        "Wheat",
-        "White",
-        "WhiteSmoke",
-        "Yellow",
-        "YellowGreen",
-        "transparent",
-        "invert"
-    ],
-
-    "auto":
-    [
-        "auto"
-    ],
-
-    "none":
-    [
-        "none"
-    ],
-
-    "captionSide":
-    [
-        "top",
-        "bottom",
-        "left",
-        "right"
-    ],
-
-    "clear":
-    [
-        "left",
-        "right",
-        "both"
-    ],
-
-    "cursor":
-    [
-        "auto",
-        "cell",
-        "context-menu",
-        "crosshair",
-        "default",
-        "help",
-        "pointer",
-        "progress",
-        "move",
-        "e-resize",
-        "all-scroll",
-        "ne-resize",
-        "nw-resize",
-        "n-resize",
-        "se-resize",
-        "sw-resize",
-        "s-resize",
-        "w-resize",
-        "ew-resize",
-        "ns-resize",
-        "nesw-resize",
-        "nwse-resize",
-        "col-resize",
-        "row-resize",
-        "text",
-        "vertical-text",
-        "wait",
-        "alias",
-        "copy",
-        "move",
-        "no-drop",
-        "not-allowed",
-        "-moz-alias",
-        "-moz-cell",
-        "-moz-copy",
-        "-moz-grab",
-        "-moz-grabbing",
-        "-moz-contextmenu",
-        "-moz-zoom-in",
-        "-moz-zoom-out",
-        "-moz-spinning"
-    ],
-
-    "direction":
-    [
-        "ltr",
-        "rtl"
-    ],
-
-    "bgAttachment":
-    [
-        "scroll",
-        "fixed"
-    ],
-
-    "bgPosition":
-    [
-        "top",
-        "center",
-        "bottom",
-        "left",
-        "right"
-    ],
-
-    "bgRepeat":
-    [
-        "repeat",
-        "repeat-x",
-        "repeat-y",
-        "no-repeat"
-    ],
-
-    "borderStyle":
-    [
-        "hidden",
-        "dotted",
-        "dashed",
-        "solid",
-        "double",
-        "groove",
-        "ridge",
-        "inset",
-        "outset",
-        "-moz-bg-inset",
-        "-moz-bg-outset",
-        "-moz-bg-solid"
-    ],
-
-    "borderCollapse":
-    [
-        "collapse",
-        "separate"
-    ],
-
-    "overflow":
-    [
-        "visible",
-        "hidden",
-        "scroll",
-        "-moz-scrollbars-horizontal",
-        "-moz-scrollbars-none",
-        "-moz-scrollbars-vertical"
-    ],
-
-    "listStyleType":
-    [
-        "disc",
-        "circle",
-        "square",
-        "decimal",
-        "decimal-leading-zero",
-        "lower-roman",
-        "upper-roman",
-        "lower-greek",
-        "lower-alpha",
-        "lower-latin",
-        "upper-alpha",
-        "upper-latin",
-        "hebrew",
-        "armenian",
-        "georgian",
-        "cjk-ideographic",
-        "hiragana",
-        "katakana",
-        "hiragana-iroha",
-        "katakana-iroha",
-        "inherit"
-    ],
-
-    "listStylePosition":
-    [
-        "inside",
-        "outside"
-    ],
-
-    "content":
-    [
-        "open-quote",
-        "close-quote",
-        "no-open-quote",
-        "no-close-quote",
-        "inherit"
-    ],
-
-    "fontStyle":
-    [
-        "normal",
-        "italic",
-        "oblique",
-        "inherit"
-    ],
-
-    "fontVariant":
-    [
-        "normal",
-        "small-caps",
-        "inherit"
-    ],
-
-    "fontWeight":
-    [
-        "normal",
-        "bold",
-        "bolder",
-        "lighter",
-        "inherit"
-    ],
-
-    "fontSize":
-    [
-        "xx-small",
-        "x-small",
-        "small",
-        "medium",
-        "large",
-        "x-large",
-        "xx-large",
-        "smaller",
-        "larger"
-    ],
-
-    "fontFamily":
-    [
-        "Arial",
-        "Comic Sans MS",
-        "Georgia",
-        "Tahoma",
-        "Verdana",
-        "Times New Roman",
-        "Trebuchet MS",
-        "Lucida Grande",
-        "Helvetica",
-        "serif",
-        "sans-serif",
-        "cursive",
-        "fantasy",
-        "monospace",
-        "caption",
-        "icon",
-        "menu",
-        "message-box",
-        "small-caption",
-        "status-bar",
-        "inherit"
-    ],
-
-    "display":
-    [
-        "block",
-        "inline",
-        "inline-block",
-        "list-item",
-        "marker",
-        "run-in",
-        "compact",
-        "table",
-        "inline-table",
-        "table-row-group",
-        "table-column",
-        "table-column-group",
-        "table-header-group",
-        "table-footer-group",
-        "table-row",
-        "table-cell",
-        "table-caption",
-        "-moz-box",
-        "-moz-compact",
-        "-moz-deck",
-        "-moz-grid",
-        "-moz-grid-group",
-        "-moz-grid-line",
-        "-moz-groupbox",
-        "-moz-inline-block",
-        "-moz-inline-box",
-        "-moz-inline-grid",
-        "-moz-inline-stack",
-        "-moz-inline-table",
-        "-moz-marker",
-        "-moz-popup",
-        "-moz-runin",
-        "-moz-stack"
-    ],
-
-    "position":
-    [
-        "static",
-        "relative",
-        "absolute",
-        "fixed",
-        "inherit"
-    ],
-
-    "float":
-    [
-        "left",
-        "right"
-    ],
-
-    "textAlign":
-    [
-        "left",
-        "right",
-        "center",
-        "justify"
-    ],
-
-    "tableLayout":
-    [
-        "fixed"
-    ],
-
-    "textDecoration":
-    [
-        "underline",
-        "overline",
-        "line-through",
-        "blink"
-    ],
-
-    "textTransform":
-    [
-        "capitalize",
-        "lowercase",
-        "uppercase",
-        "inherit"
-    ],
-
-    "unicodeBidi":
-    [
-        "normal",
-        "embed",
-        "bidi-override"
-    ],
-
-    "whiteSpace":
-    [
-        "normal",
-        "pre",
-        "nowrap"
-    ],
-
-    "verticalAlign":
-    [
-        "baseline",
-        "sub",
-        "super",
-        "top",
-        "text-top",
-        "middle",
-        "bottom",
-        "text-bottom",
-        "inherit"
-    ],
-
-    "thickness":
-    [
-        "thin",
-        "medium",
-        "thick"
-    ],
-
-    "userFocus":
-    [
-        "ignore",
-        "normal"
-    ],
-
-    "userInput":
-    [
-        "disabled",
-        "enabled"
-    ],
-
-    "userSelect":
-    [
-        "normal"
-    ],
-
-    "mozBoxSizing":
-    [
-        "content-box",
-        "padding-box",
-        "border-box"
-    ],
-
-    "mozBoxAlign":
-    [
-        "start",
-        "center",
-        "end",
-        "baseline",
-        "stretch"
-    ],
-
-    "mozBoxDirection":
-    [
-        "normal",
-        "reverse"
-    ],
-
-    "mozBoxOrient":
-    [
-        "horizontal",
-        "vertical"
-    ],
-
-    "mozBoxPack":
-    [
-        "start",
-        "center",
-        "end"
-    ]
-};
-
-this.nonEditableTags =
-{
-    "HTML": 1,
-    "HEAD": 1,
-    "html": 1,
-    "head": 1
-};
-
-this.innerEditableTags =
-{
-    "BODY": 1,
-    "body": 1
-};
-
-this.selfClosingTags =
-{ // End tags for void elements are forbidden http://wiki.whatwg.org/wiki/HTML_vs._XHTML
-    "meta": 1,
-    "link": 1,
-    "area": 1,
-    "base": 1,
-    "col": 1,
-    "input": 1,
-    "img": 1,
-    "br": 1,
-    "hr": 1,
-    "param":1,
-    "embed":1
-};
-
-var invisibleTags = this.invisibleTags =
-{
-    "HTML": 1,
-    "HEAD": 1,
-    "TITLE": 1,
-    "META": 1,
-    "LINK": 1,
-    "STYLE": 1,
-    "SCRIPT": 1,
-    "NOSCRIPT": 1,
-    "BR": 1,
-    "PARAM": 1,
-    "COL": 1,
-
-    "html": 1,
-    "head": 1,
-    "title": 1,
-    "meta": 1,
-    "link": 1,
-    "style": 1,
-    "script": 1,
-    "noscript": 1,
-    "br": 1,
-    "param": 1,
-    "col": 1
-    /*
-    "window": 1,
-    "browser": 1,
-    "frame": 1,
-    "tabbrowser": 1,
-    "WINDOW": 1,
-    "BROWSER": 1,
-    "FRAME": 1,
-    "TABBROWSER": 1,
-    */
-};
-
-
-if (typeof KeyEvent == "undefined") {
-    this.KeyEvent = {
-        DOM_VK_CANCEL: 3,
-        DOM_VK_HELP: 6,
-        DOM_VK_BACK_SPACE: 8,
-        DOM_VK_TAB: 9,
-        DOM_VK_CLEAR: 12,
-        DOM_VK_RETURN: 13,
-        DOM_VK_ENTER: 14,
-        DOM_VK_SHIFT: 16,
-        DOM_VK_CONTROL: 17,
-        DOM_VK_ALT: 18,
-        DOM_VK_PAUSE: 19,
-        DOM_VK_CAPS_LOCK: 20,
-        DOM_VK_ESCAPE: 27,
-        DOM_VK_SPACE: 32,
-        DOM_VK_PAGE_UP: 33,
-        DOM_VK_PAGE_DOWN: 34,
-        DOM_VK_END: 35,
-        DOM_VK_HOME: 36,
-        DOM_VK_LEFT: 37,
-        DOM_VK_UP: 38,
-        DOM_VK_RIGHT: 39,
-        DOM_VK_DOWN: 40,
-        DOM_VK_PRINTSCREEN: 44,
-        DOM_VK_INSERT: 45,
-        DOM_VK_DELETE: 46,
-        DOM_VK_0: 48,
-        DOM_VK_1: 49,
-        DOM_VK_2: 50,
-        DOM_VK_3: 51,
-        DOM_VK_4: 52,
-        DOM_VK_5: 53,
-        DOM_VK_6: 54,
-        DOM_VK_7: 55,
-        DOM_VK_8: 56,
-        DOM_VK_9: 57,
-        DOM_VK_SEMICOLON: 59,
-        DOM_VK_EQUALS: 61,
-        DOM_VK_A: 65,
-        DOM_VK_B: 66,
-        DOM_VK_C: 67,
-        DOM_VK_D: 68,
-        DOM_VK_E: 69,
-        DOM_VK_F: 70,
-        DOM_VK_G: 71,
-        DOM_VK_H: 72,
-        DOM_VK_I: 73,
-        DOM_VK_J: 74,
-        DOM_VK_K: 75,
-        DOM_VK_L: 76,
-        DOM_VK_M: 77,
-        DOM_VK_N: 78,
-        DOM_VK_O: 79,
-        DOM_VK_P: 80,
-        DOM_VK_Q: 81,
-        DOM_VK_R: 82,
-        DOM_VK_S: 83,
-        DOM_VK_T: 84,
-        DOM_VK_U: 85,
-        DOM_VK_V: 86,
-        DOM_VK_W: 87,
-        DOM_VK_X: 88,
-        DOM_VK_Y: 89,
-        DOM_VK_Z: 90,
-        DOM_VK_CONTEXT_MENU: 93,
-        DOM_VK_NUMPAD0: 96,
-        DOM_VK_NUMPAD1: 97,
-        DOM_VK_NUMPAD2: 98,
-        DOM_VK_NUMPAD3: 99,
-        DOM_VK_NUMPAD4: 100,
-        DOM_VK_NUMPAD5: 101,
-        DOM_VK_NUMPAD6: 102,
-        DOM_VK_NUMPAD7: 103,
-        DOM_VK_NUMPAD8: 104,
-        DOM_VK_NUMPAD9: 105,
-        DOM_VK_MULTIPLY: 106,
-        DOM_VK_ADD: 107,
-        DOM_VK_SEPARATOR: 108,
-        DOM_VK_SUBTRACT: 109,
-        DOM_VK_DECIMAL: 110,
-        DOM_VK_DIVIDE: 111,
-        DOM_VK_F1: 112,
-        DOM_VK_F2: 113,
-        DOM_VK_F3: 114,
-        DOM_VK_F4: 115,
-        DOM_VK_F5: 116,
-        DOM_VK_F6: 117,
-        DOM_VK_F7: 118,
-        DOM_VK_F8: 119,
-        DOM_VK_F9: 120,
-        DOM_VK_F10: 121,
-        DOM_VK_F11: 122,
-        DOM_VK_F12: 123,
-        DOM_VK_F13: 124,
-        DOM_VK_F14: 125,
-        DOM_VK_F15: 126,
-        DOM_VK_F16: 127,
-        DOM_VK_F17: 128,
-        DOM_VK_F18: 129,
-        DOM_VK_F19: 130,
-        DOM_VK_F20: 131,
-        DOM_VK_F21: 132,
-        DOM_VK_F22: 133,
-        DOM_VK_F23: 134,
-        DOM_VK_F24: 135,
-        DOM_VK_NUM_LOCK: 144,
-        DOM_VK_SCROLL_LOCK: 145,
-        DOM_VK_COMMA: 188,
-        DOM_VK_PERIOD: 190,
-        DOM_VK_SLASH: 191,
-        DOM_VK_BACK_QUOTE: 192,
-        DOM_VK_OPEN_BRACKET: 219,
-        DOM_VK_BACK_SLASH: 220,
-        DOM_VK_CLOSE_BRACKET: 221,
-        DOM_VK_QUOTE: 222,
-        DOM_VK_META: 224
-    };
-}
-
-
-// ************************************************************************************************
-// Ajax
-
-/**
- * @namespace
- */
-this.Ajax =
-{
-
-    requests: [],
-    transport: null,
-    states: ["Uninitialized","Loading","Loaded","Interactive","Complete"],
-
-    initialize: function()
-    {
-        this.transport = FBL.getNativeXHRObject();
-    },
-
-    getXHRObject: function()
-    {
-        var xhrObj = false;
-        try
-        {
-            xhrObj = new XMLHttpRequest();
-        }
-        catch(e)
-        {
-            var progid = [
-                    "MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0",
-                    "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"
-                ];
-
-            for ( var i=0; i < progid.length; ++i ) {
-                try
-                {
-                    xhrObj = new ActiveXObject(progid[i]);
-                }
-                catch(e)
-                {
-                    continue;
-                }
-                break;
-            }
-        }
-        finally
-        {
-            return xhrObj;
-        }
-    },
-
-
-    /**
-     * Create a AJAX request.
-     *
-     * @name request
-     * @param {Object}   options               request options
-     * @param {String}   options.url           URL to be requested
-     * @param {String}   options.type          Request type ("get" ou "post"). Default is "get".
-     * @param {Boolean}  options.async         Asynchronous flag. Default is "true".
-     * @param {String}   options.dataType      Data type ("text", "html", "xml" or "json"). Default is "text".
-     * @param {String}   options.contentType   Content-type of the data being sent. Default is "application/x-www-form-urlencoded".
-     * @param {Function} options.onLoading     onLoading callback
-     * @param {Function} options.onLoaded      onLoaded callback
-     * @param {Function} options.onInteractive onInteractive callback
-     * @param {Function} options.onComplete    onComplete callback
-     * @param {Function} options.onUpdate      onUpdate callback
-     * @param {Function} options.onSuccess     onSuccess callback
-     * @param {Function} options.onFailure     onFailure callback
-     */
-    request: function(options)
-    {
-        // process options
-        var o = FBL.extend(
-                {
-                    // default values
-                    type: "get",
-                    async: true,
-                    dataType: "text",
-                    contentType: "application/x-www-form-urlencoded"
-                },
-                options || {}
-            );
-
-        this.requests.push(o);
-
-        var s = this.getState();
-        if (s == "Uninitialized" || s == "Complete" || s == "Loaded")
-            this.sendRequest();
-    },
-
-    serialize: function(data)
-    {
-        var r = [""], rl = 0;
-        if (data) {
-            if (typeof data == "string")  r[rl++] = data;
-
-            else if (data.innerHTML && data.elements) {
-                for (var i=0,el,l=(el=data.elements).length; i < l; i++)
-                    if (el[i].name) {
-                        r[rl++] = encodeURIComponent(el[i].name);
-                        r[rl++] = "=";
-                        r[rl++] = encodeURIComponent(el[i].value);
-                        r[rl++] = "&";
-                    }
-
-            } else
-                for(var param in data) {
-                    r[rl++] = encodeURIComponent(param);
-                    r[rl++] = "=";
-                    r[rl++] = encodeURIComponent(data[param]);
-                    r[rl++] = "&";
-                }
-        }
-        return r.join("").replace(/&$/, "");
-    },
-
-    sendRequest: function()
-    {
-        var t = FBL.Ajax.transport, r = FBL.Ajax.requests.shift(), data;
-
-        // open XHR object
-        t.open(r.type, r.url, r.async);
-
-        //setRequestHeaders();
-
-        // indicates that it is a XHR request to the server
-        t.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-
-        // if data is being sent, sets the appropriate content-type
-        if (data = FBL.Ajax.serialize(r.data))
-            t.setRequestHeader("Content-Type", r.contentType);
-
-        /** @ignore */
-        // onreadystatechange handler
-        t.onreadystatechange = function()
-        {
-            FBL.Ajax.onStateChange(r);
-        };
-
-        // send the request
-        t.send(data);
-    },
-
-    /**
-     * Handles the state change
-     */
-    onStateChange: function(options)
-    {
-        var fn, o = options, t = this.transport;
-        var state = this.getState(t);
-
-        if (fn = o["on" + state]) fn(this.getResponse(o), o);
-
-        if (state == "Complete")
-        {
-            var success = t.status == 200, response = this.getResponse(o);
-
-            if (fn = o["onUpdate"])
-              fn(response, o);
-
-            if (fn = o["on" + (success ? "Success" : "Failure")])
-              fn(response, o);
-
-            t.onreadystatechange = FBL.emptyFn;
-
-            if (this.requests.length > 0)
-                setTimeout(this.sendRequest, 10);
-        }
-    },
-
-    /**
-     * gets the appropriate response value according the type
-     */
-    getResponse: function(options)
-    {
-        var t = this.transport, type = options.dataType;
-
-        if      (t.status != 200) return t.statusText;
-        else if (type == "text")  return t.responseText;
-        else if (type == "html")  return t.responseText;
-        else if (type == "xml")   return t.responseXML;
-        else if (type == "json")  return eval("(" + t.responseText + ")");
-    },
-
-    /**
-     * returns the current state of the XHR object
-     */
-    getState: function()
-    {
-        return this.states[this.transport.readyState];
-    }
-
-};
-
-
-// ************************************************************************************************
-// Cookie, from http://www.quirksmode.org/js/cookies.html
-
-this.createCookie = function(name,value,days)
-{
-    if ('cookie' in document)
-    {
-        if (days)
-        {
-            var date = new Date();
-            date.setTime(date.getTime()+(days*24*60*60*1000));
-            var expires = "; expires="+date.toGMTString();
-        }
-        else
-            var expires = "";
-
-        document.cookie = name+"="+value+expires+"; path=/";
-    }
-};
-
-this.readCookie = function (name)
-{
-    if ('cookie' in document)
-    {
-        var nameEQ = name + "=";
-        var ca = document.cookie.split(';');
-
-        for(var i=0; i < ca.length; i++)
-        {
-            var c = ca[i];
-            while (c.charAt(0)==' ') c = c.substring(1,c.length);
-            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
-        }
-    }
-
-    return null;
-};
-
-this.removeCookie = function(name)
-{
-    this.createCookie(name, "", -1);
-};
-
-
-// ************************************************************************************************
-// http://www.mister-pixel.com/#Content__state=is_that_simple
-var fixIE6BackgroundImageCache = function(doc)
-{
-    doc = doc || document;
-    try
-    {
-        doc.execCommand("BackgroundImageCache", false, true);
-    }
-    catch(E)
-    {
-
-    }
-};
-
-// ************************************************************************************************
-// calculatePixelsPerInch
-
-var resetStyle = "margin:0; padding:0; border:0; position:absolute; overflow:hidden; display:block;";
-
-var calculatePixelsPerInch = function calculatePixelsPerInch(doc, body)
-{
-    var inch = FBL.createGlobalElement("div");
-    inch.style.cssText = resetStyle + "width:1in; height:1in; position:absolute; top:-1234px; left:-1234px;";
-    body.appendChild(inch);
-
-    FBL.pixelsPerInch = {
-        x: inch.offsetWidth,
-        y: inch.offsetHeight
-    };
-
-    body.removeChild(inch);
-};
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-this.SourceLink = function(url, line, type, object, instance)
-{
-    this.href = url;
-    this.instance = instance;
-    this.line = line;
-    this.type = type;
-    this.object = object;
-};
-
-this.SourceLink.prototype =
-{
-    toString: function()
-    {
-        return this.href;
-    },
-    toJSON: function() // until 3.1...
-    {
-        return "{\"href\":\""+this.href+"\", "+
-            (this.line?("\"line\":"+this.line+","):"")+
-            (this.type?(" \"type\":\""+this.type+"\","):"")+
-                    "}";
-    }
-
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-this.SourceText = function(lines, owner)
-{
-    this.lines = lines;
-    this.owner = owner;
-};
-
-this.SourceText.getLineAsHTML = function(lineNo)
-{
-    return escapeForSourceLine(this.lines[lineNo-1]);
-};
-
-
-// ************************************************************************************************
-}).apply(FBL);
-
-/* See license.txt for terms of usage */
-
-FBL.ns( /** @scope s_i18n */ function() { with (FBL) {
-// ************************************************************************************************
-
-// TODO: xxxpedro localization
-var oSTR =
-{
-    "NoMembersWarning": "There are no properties to show for this object.",
-
-    "EmptyStyleSheet": "There are no rules in this stylesheet.",
-    "EmptyElementCSS": "This element has no style rules.",
-    "AccessRestricted": "Access to restricted URI denied.",
-
-    "net.label.Parameters": "Parameters",
-    "net.label.Source": "Source",
-    "URLParameters": "Params",
-
-    "EditStyle": "Edit Element Style...",
-    "NewRule": "New Rule...",
-
-    "NewProp": "New Property...",
-    "EditProp": 'Edit "%s"',
-    "DeleteProp": 'Delete "%s"',
-    "DisableProp": 'Disable "%s"'
-};
-
-// ************************************************************************************************
-
-FBL.$STR = function(name)
-{
-    return oSTR.hasOwnProperty(name) ? oSTR[name] : name;
-};
-
-FBL.$STRF = function(name, args)
-{
-    if (!oSTR.hasOwnProperty(name)) return name;
-
-    var format = oSTR[name];
-    var objIndex = 0;
-
-    var parts = parseFormat(format);
-    var trialIndex = objIndex;
-    var objects = args;
-
-    for (var i= 0; i < parts.length; i++)
-    {
-        var part = parts[i];
-        if (part && typeof(part) == "object")
-        {
-            if (++trialIndex > objects.length)  // then too few parameters for format, assume unformatted.
-            {
-                format = "";
-                objIndex = -1;
-                parts.length = 0;
-                break;
-            }
-        }
-
-    }
-
-    var result = [];
-    for (var i = 0; i < parts.length; ++i)
-    {
-        var part = parts[i];
-        if (part && typeof(part) == "object")
-        {
-            result.push(""+args.shift());
-        }
-        else
-            result.push(part);
-    }
-
-    return result.join("");
-};
-
-// ************************************************************************************************
-
-var parseFormat = function parseFormat(format)
-{
-    var parts = [];
-    if (format.length <= 0)
-        return parts;
-
-    var reg = /((^%|.%)(\d+)?(\.)([a-zA-Z]))|((^%|.%)([a-zA-Z]))/;
-    for (var m = reg.exec(format); m; m = reg.exec(format))
-    {
-        if (m[0].substr(0, 2) == "%%")
-        {
-            parts.push(format.substr(0, m.index));
-            parts.push(m[0].substr(1));
-        }
-        else
-        {
-            var type = m[8] ? m[8] : m[5];
-            var precision = m[3] ? parseInt(m[3]) : (m[4] == "." ? -1 : 0);
-
-            var rep = null;
-            switch (type)
-            {
-                case "s":
-                    rep = FirebugReps.Text;
-                    break;
-                case "f":
-                case "i":
-                case "d":
-                    rep = FirebugReps.Number;
-                    break;
-                case "o":
-                    rep = null;
-                    break;
-            }
-
-            parts.push(format.substr(0, m[0][0] == "%" ? m.index : m.index+1));
-            parts.push({rep: rep, precision: precision, type: ("%" + type)});
-        }
-
-        format = format.substr(m.index+m[0].length);
-    }
-
-    parts.push(format);
-    return parts;
-};
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-FBL.ns( /** @scope s_firebug */ function() { with (FBL) {
-// ************************************************************************************************
-
-// ************************************************************************************************
-// Globals
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// Internals
-
-var modules = [];
-var panelTypes = [];
-var panelTypeMap = {};
-var reps = [];
-
-var parentPanelMap = {};
-
-
-// ************************************************************************************************
-// Firebug
-
-/**
- * @namespace describe Firebug
- * @exports FBL.Firebug as Firebug
- */
-FBL.Firebug =
-{
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    version:  "Firebug Lite 1.4.0",
-    revision: "$Revision$",
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    modules: modules,
-    panelTypes: panelTypes,
-    panelTypeMap: panelTypeMap,
-    reps: reps,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Initialization
-
-    initialize: function()
-    {
-        if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("Firebug.initialize", "initializing application");
-
-        Firebug.browser = new Context(Env.browser);
-        Firebug.context = Firebug.browser;
-
-        Firebug.loadPrefs();
-        Firebug.context.persistedState.isOpen = false;
-
-        // Document must be cached before chrome initialization
-        cacheDocument();
-
-        if (Firebug.Inspector && Firebug.Inspector.create)
-            Firebug.Inspector.create();
-
-        if (FBL.CssAnalyzer && FBL.CssAnalyzer.processAllStyleSheets)
-            FBL.CssAnalyzer.processAllStyleSheets(Firebug.browser.document);
-
-        FirebugChrome.initialize();
-
-        dispatch(modules, "initialize", []);
-
-        if (Firebug.disableResourceFetching)
-            Firebug.Console.logFormatted(["Some Firebug Lite features are not working because " +
-            		"resource fetching is disabled. To enabled it set the Firebug Lite option " +
-            		"\"disableResourceFetching\" to \"false\". More info at " +
-            		"http://getfirebug.com/firebuglite#Options"],
-            		Firebug.context, "warn");
-
-        if (Env.onLoad)
-        {
-            var onLoad = Env.onLoad;
-            delete Env.onLoad;
-
-            setTimeout(onLoad, 200);
-        }
-    },
-
-    shutdown: function()
-    {
-        if (Firebug.saveCookies)
-            Firebug.savePrefs();
-
-        if (Firebug.Inspector)
-            Firebug.Inspector.destroy();
-
-        dispatch(modules, "shutdown", []);
-
-        var chromeMap = FirebugChrome.chromeMap;
-
-        for (var name in chromeMap)
-        {
-            if (chromeMap.hasOwnProperty(name))
-            {
-                try
-                {
-                    chromeMap[name].destroy();
-                }
-                catch(E)
-                {
-                    if (FBTrace.DBG_ERRORS) FBTrace.sysout("chrome.destroy() failed to: " + name);
-                }
-            }
-        }
-
-        Firebug.Lite.Cache.Element.clear();
-        Firebug.Lite.Cache.StyleSheet.clear();
-
-        Firebug.browser = null;
-        Firebug.context = null;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Registration
-
-    registerModule: function()
-    {
-        modules.push.apply(modules, arguments);
-
-        if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("Firebug.registerModule");
-    },
-
-    registerPanel: function()
-    {
-        panelTypes.push.apply(panelTypes, arguments);
-
-        for (var i = 0, panelType; panelType = arguments[i]; ++i)
-        {
-            panelTypeMap[panelType.prototype.name] = arguments[i];
-
-            if (panelType.prototype.parentPanel)
-                parentPanelMap[panelType.prototype.parentPanel] = 1;
-        }
-
-        if (FBTrace.DBG_INITIALIZE)
-            for (var i = 0; i < arguments.length; ++i)
-                FBTrace.sysout("Firebug.registerPanel", arguments[i].prototype.name);
-    },
-
-    registerRep: function()
-    {
-        reps.push.apply(reps, arguments);
-    },
-
-    unregisterRep: function()
-    {
-        for (var i = 0; i < arguments.length; ++i)
-            remove(reps, arguments[i]);
-    },
-
-    setDefaultReps: function(funcRep, rep)
-    {
-        FBL.defaultRep = rep;
-        FBL.defaultFuncRep = funcRep;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Reps
-
-    getRep: function(object)
-    {
-        var type = typeof object;
-        if (isIE && isFunction(object))
-            type = "function";
-
-        for (var i = 0; i < reps.length; ++i)
-        {
-            var rep = reps[i];
-            try
-            {
-                if (rep.supportsObject(object, type))
-                {
-                    if (FBTrace.DBG_DOM)
-                        FBTrace.sysout("getRep type: "+type+" object: "+object, rep);
-                    return rep;
-                }
-            }
-            catch (exc)
-            {
-                if (FBTrace.DBG_ERRORS)
-                {
-                    FBTrace.sysout("firebug.getRep FAILS: ", exc.message || exc);
-                    FBTrace.sysout("firebug.getRep reps["+i+"/"+reps.length+"]: Rep="+reps[i].className);
-                    // TODO: xxxpedro add trace to FBTrace logs like in Firebug
-                    //firebug.trace();
-                }
-            }
-        }
-
-        return (type == 'function') ? defaultFuncRep : defaultRep;
-    },
-
-    getRepObject: function(node)
-    {
-        var target = null;
-        for (var child = node; child; child = child.parentNode)
-        {
-            if (hasClass(child, "repTarget"))
-                target = child;
-
-            if (child.repObject)
-            {
-                if (!target && hasClass(child, "repIgnore"))
-                    break;
-                else
-                    return child.repObject;
-            }
-        }
-    },
-
-    getRepNode: function(node)
-    {
-        for (var child = node; child; child = child.parentNode)
-        {
-            if (child.repObject)
-                return child;
-        }
-    },
-
-    getElementByRepObject: function(element, object)
-    {
-        for (var child = element.firstChild; child; child = child.nextSibling)
-        {
-            if (child.repObject == object)
-                return child;
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Preferences
-
-    getPref: function(name)
-    {
-        return Firebug[name];
-    },
-
-    setPref: function(name, value)
-    {
-        Firebug[name] = value;
-
-        Firebug.savePrefs();
-    },
-
-    setPrefs: function(prefs)
-    {
-        for (var name in prefs)
-        {
-            if (prefs.hasOwnProperty(name))
-                Firebug[name] = prefs[name];
-        }
-
-        Firebug.savePrefs();
-    },
-
-    restorePrefs: function()
-    {
-        var Options = Env.DefaultOptions;
-
-        for (var name in Options)
-        {
-            Firebug[name] = Options[name];
-        }
-    },
-
-    loadPrefs: function()
-    {
-        this.restorePrefs();
-
-        var prefs = Store.get("FirebugLite") || {};
-        var options = prefs.options;
-        var persistedState = prefs.persistedState || FBL.defaultPersistedState;
-
-        for (var name in options)
-        {
-            if (options.hasOwnProperty(name))
-                Firebug[name] = options[name];
-        }
-
-        if (Firebug.context && persistedState)
-            Firebug.context.persistedState = persistedState;
-    },
-
-    savePrefs: function()
-    {
-        var prefs = {
-            options: {}
-        };
-
-        var EnvOptions = Env.Options;
-        var options = prefs.options;
-        for (var name in EnvOptions)
-        {
-            if (EnvOptions.hasOwnProperty(name))
-            {
-                options[name] = Firebug[name];
-            }
-        }
-
-        var persistedState = Firebug.context.persistedState;
-        if (!persistedState)
-        {
-            persistedState = Firebug.context.persistedState = FBL.defaultPersistedState;
-        }
-
-        prefs.persistedState = persistedState;
-
-        Store.set("FirebugLite", prefs);
-    },
-
-    erasePrefs: function()
-    {
-        Store.remove("FirebugLite");
-        this.restorePrefs();
-    }
-};
-
-Firebug.restorePrefs();
-
-// xxxpedro should we remove this?
-window.Firebug = FBL.Firebug;
-
-if (!Env.Options.enablePersistent ||
-     Env.Options.enablePersistent && Env.isChromeContext ||
-     Env.isDebugMode)
-        Env.browser.window.Firebug = FBL.Firebug;
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// Other methods
-
-FBL.cacheDocument = function cacheDocument()
-{
-    var ElementCache = Firebug.Lite.Cache.Element;
-    var els = Firebug.browser.document.getElementsByTagName("*");
-    for (var i=0, l=els.length, el; i<l; i++)
-    {
-        el = els[i];
-        ElementCache(el);
-    }
-};
-
-// ************************************************************************************************
-
-/**
- * @class
- *
- * Support for listeners registration. This object also extended by Firebug.Module so,
- * all modules supports listening automatically. Notice that array of listeners
- * is created for each intance of a module within initialize method. Thus all derived
- * module classes must ensure that Firebug.Module.initialize method is called for the
- * super class.
- */
-Firebug.Listener = function()
-{
-    // The array is created when the first listeners is added.
-    // It can't be created here since derived objects would share
-    // the same array.
-    this.fbListeners = null;
-};
-
-Firebug.Listener.prototype =
-{
-    addListener: function(listener)
-    {
-        if (!this.fbListeners)
-            this.fbListeners = []; // delay the creation until the objects are created so 'this' causes new array for each module
-
-        this.fbListeners.push(listener);
-    },
-
-    removeListener: function(listener)
-    {
-        remove(this.fbListeners, listener);  // if this.fbListeners is null, remove is being called with no add
-    }
-};
-
-// ************************************************************************************************
-
-
-// ************************************************************************************************
-// Module
-
-/**
- * @module Base class for all modules. Every derived module object must be registered using
- * <code>Firebug.registerModule</code> method. There is always one instance of a module object
- * per browser window.
- * @extends Firebug.Listener
- */
-Firebug.Module = extend(new Firebug.Listener(),
-/** @extend Firebug.Module */
-{
-    /**
-     * Called when the window is opened.
-     */
-    initialize: function()
-    {
-    },
-
-    /**
-     * Called when the window is closed.
-     */
-    shutdown: function()
-    {
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    /**
-     * Called when a new context is created but before the page is loaded.
-     */
-    initContext: function(context)
-    {
-    },
-
-    /**
-     * Called after a context is detached to a separate window;
-     */
-    reattachContext: function(browser, context)
-    {
-    },
-
-    /**
-     * Called when a context is destroyed. Module may store info on persistedState for reloaded pages.
-     */
-    destroyContext: function(context, persistedState)
-    {
-    },
-
-    // Called when a FF tab is create or activated (user changes FF tab)
-    // Called after context is created or with context == null (to abort?)
-    showContext: function(browser, context)
-    {
-    },
-
-    /**
-     * Called after a context's page gets DOMContentLoaded
-     */
-    loadedContext: function(context)
-    {
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    showPanel: function(browser, panel)
-    {
-    },
-
-    showSidePanel: function(browser, panel)
-    {
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    updateOption: function(name, value)
-    {
-    },
-
-    getObjectByURL: function(context, url)
-    {
-    }
-});
-
-// ************************************************************************************************
-// Panel
-
-/**
- * @panel Base class for all panels. Every derived panel must define a constructor and
- * register with "Firebug.registerPanel" method. An instance of the panel
- * object is created by the framework for each browser tab where Firebug is activated.
- */
-Firebug.Panel =
-{
-    name: "HelloWorld",
-    title: "Hello World!",
-
-    parentPanel: null,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    options: {
-        hasCommandLine: false,
-        hasStatusBar: false,
-        hasToolButtons: false,
-
-        // Pre-rendered panels are those included in the skin file (firebug.html)
-        isPreRendered: false,
-        innerHTMLSync: false
-
-        /*
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // To be used by external extensions
-        panelHTML: "",
-        panelCSS: "",
-
-        toolButtonsHTML: ""
-        /**/
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    tabNode: null,
-    panelNode: null,
-    sidePanelNode: null,
-    statusBarNode: null,
-    toolButtonsNode: null,
-
-    panelBarNode: null,
-
-    sidePanelBarBoxNode: null,
-    sidePanelBarNode: null,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    sidePanelBar: null,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    searchable: false,
-    editable: true,
-    order: 2147483647,
-    statusSeparator: "<",
-
-    create: function(context, doc)
-    {
-        this.hasSidePanel = parentPanelMap.hasOwnProperty(this.name);
-
-        this.panelBarNode = $("fbPanelBar1");
-        this.sidePanelBarBoxNode = $("fbPanelBar2");
-
-        if (this.hasSidePanel)
-        {
-            this.sidePanelBar = extend({}, PanelBar);
-            this.sidePanelBar.create(this);
-        }
-
-        var options = this.options = extend(Firebug.Panel.options, this.options);
-        var panelId = "fb" + this.name;
-
-        if (options.isPreRendered)
-        {
-            this.panelNode = $(panelId);
-
-            this.tabNode = $(panelId + "Tab");
-            this.tabNode.style.display = "block";
-
-            if (options.hasToolButtons)
-            {
-                this.toolButtonsNode = $(panelId + "Buttons");
-            }
-
-            if (options.hasStatusBar)
-            {
-                this.statusBarBox = $("fbStatusBarBox");
-                this.statusBarNode = $(panelId + "StatusBar");
-            }
-        }
-        else
-        {
-            var containerSufix = this.parentPanel ? "2" : "1";
-
-            // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-            // Create Panel
-            var panelNode = this.panelNode = createElement("div", {
-                id: panelId,
-                className: "fbPanel"
-            });
-
-            $("fbPanel" + containerSufix).appendChild(panelNode);
-
-            // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-            // Create Panel Tab
-            var tabHTML = '<span class="fbTabL"></span><span class="fbTabText">' +
-                    this.title + '</span><span class="fbTabR"></span>';
-
-            var tabNode = this.tabNode = createElement("a", {
-                id: panelId + "Tab",
-                className: "fbTab fbHover",
-                innerHTML: tabHTML
-            });
-
-            if (isIE6)
-            {
-                tabNode.href = "javascript:void(0)";
-            }
-
-            var panelBarNode = this.parentPanel ?
-                    Firebug.chrome.getPanel(this.parentPanel).sidePanelBarNode :
-                    this.panelBarNode;
-
-            panelBarNode.appendChild(tabNode);
-            tabNode.style.display = "block";
-
-            // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-            // create ToolButtons
-            if (options.hasToolButtons)
-            {
-                this.toolButtonsNode = createElement("span", {
-                    id: panelId + "Buttons",
-                    className: "fbToolbarButtons"
-                });
-
-                $("fbToolbarButtons").appendChild(this.toolButtonsNode);
-            }
-
-            // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-            // create StatusBar
-            if (options.hasStatusBar)
-            {
-                this.statusBarBox = $("fbStatusBarBox");
-
-                this.statusBarNode = createElement("span", {
-                    id: panelId + "StatusBar",
-                    className: "fbToolbarButtons fbStatusBar"
-                });
-
-                this.statusBarBox.appendChild(this.statusBarNode);
-            }
-
-            // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-            // create SidePanel
-        }
-
-        this.containerNode = this.panelNode.parentNode;
-
-        if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("Firebug.Panel.create", this.name);
-
-        // xxxpedro contextMenu
-        this.onContextMenu = bind(this.onContextMenu, this);
-
-        /*
-        this.context = context;
-        this.document = doc;
-
-        this.panelNode = doc.createElement("div");
-        this.panelNode.ownerPanel = this;
-
-        setClass(this.panelNode, "panelNode panelNode-"+this.name+" contextUID="+context.uid);
-        doc.body.appendChild(this.panelNode);
-
-        if (FBTrace.DBG_INITIALIZE)
-            FBTrace.sysout("firebug.initialize panelNode for "+this.name+"\n");
-
-        this.initializeNode(this.panelNode);
-        /**/
-    },
-
-    destroy: function(state) // Panel may store info on state
-    {
-        if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("Firebug.Panel.destroy", this.name);
-
-        if (this.hasSidePanel)
-        {
-            this.sidePanelBar.destroy();
-            this.sidePanelBar = null;
-        }
-
-        this.options = null;
-        this.name = null;
-        this.parentPanel = null;
-
-        this.tabNode = null;
-        this.panelNode = null;
-        this.containerNode = null;
-
-        this.toolButtonsNode = null;
-        this.statusBarBox = null;
-        this.statusBarNode = null;
-
-        //if (this.panelNode)
-        //    delete this.panelNode.ownerPanel;
-
-        //this.destroyNode();
-    },
-
-    initialize: function()
-    {
-        if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("Firebug.Panel.initialize", this.name);
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        if (this.hasSidePanel)
-        {
-            this.sidePanelBar.initialize();
-        }
-
-        var options = this.options = extend(Firebug.Panel.options, this.options);
-        var panelId = "fb" + this.name;
-
-        this.panelNode = $(panelId);
-
-        this.tabNode = $(panelId + "Tab");
-        this.tabNode.style.display = "block";
-
-        if (options.hasStatusBar)
-        {
-            this.statusBarBox = $("fbStatusBarBox");
-            this.statusBarNode = $(panelId + "StatusBar");
-        }
-
-        if (options.hasToolButtons)
-        {
-            this.toolButtonsNode = $(panelId + "Buttons");
-        }
-
-        this.containerNode = this.panelNode.parentNode;
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // restore persistent state
-        this.containerNode.scrollTop = this.lastScrollTop;
-
-        // xxxpedro contextMenu
-        addEvent(this.containerNode, "contextmenu", this.onContextMenu);
-
-
-        /// TODO: xxxpedro infoTip Hack
-        Firebug.chrome.currentPanel =
-                Firebug.chrome.selectedPanel && Firebug.chrome.selectedPanel.sidePanelBar ?
-                Firebug.chrome.selectedPanel.sidePanelBar.selectedPanel :
-                Firebug.chrome.selectedPanel;
-
-        Firebug.showInfoTips = true;
-        if (Firebug.InfoTip)
-            Firebug.InfoTip.initializeBrowser(Firebug.chrome);
-    },
-
-    shutdown: function()
-    {
-        if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("Firebug.Panel.shutdown", this.name);
-
-        /// TODO: xxxpedro infoTip Hack
-        if (Firebug.InfoTip)
-            Firebug.InfoTip.uninitializeBrowser(Firebug.chrome);
-
-        if (Firebug.chrome.largeCommandLineVisible)
-            Firebug.chrome.hideLargeCommandLine();
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        if (this.hasSidePanel)
-        {
-            // TODO: xxxpedro firebug1.3a6
-            // new PanelBar mechanism will need to call shutdown to hide the panels (so it
-            // doesn't appears in other panel's sidePanelBar. Therefore, we need to implement
-            // a "remember selected panel" feature in the sidePanelBar
-            //this.sidePanelBar.shutdown();
-        }
-
-        // store persistent state
-        this.lastScrollTop = this.containerNode.scrollTop;
-
-        // xxxpedro contextMenu
-        removeEvent(this.containerNode, "contextmenu", this.onContextMenu);
-    },
-
-    detach: function(oldChrome, newChrome)
-    {
-        if (oldChrome && oldChrome.selectedPanel && oldChrome.selectedPanel.name == this.name)
-            this.lastScrollTop = oldChrome.selectedPanel.containerNode.scrollTop;
-    },
-
-    reattach: function(doc)
-    {
-        if (this.options.innerHTMLSync)
-            this.synchronizeUI();
-    },
-
-    synchronizeUI: function()
-    {
-        this.containerNode.scrollTop = this.lastScrollTop || 0;
-    },
-
-    show: function(state)
-    {
-        var options = this.options;
-
-        if (options.hasStatusBar)
-        {
-            this.statusBarBox.style.display = "inline";
-            this.statusBarNode.style.display = "inline";
-        }
-
-        if (options.hasToolButtons)
-        {
-            this.toolButtonsNode.style.display = "inline";
-        }
-
-        this.panelNode.style.display = "block";
-
-        this.visible = true;
-
-        if (!this.parentPanel)
-            Firebug.chrome.layout(this);
-    },
-
-    hide: function(state)
-    {
-        var options = this.options;
-
-        if (options.hasStatusBar)
-        {
-            this.statusBarBox.style.display = "none";
-            this.statusBarNode.style.display = "none";
-        }
-
-        if (options.hasToolButtons)
-        {
-            this.toolButtonsNode.style.display = "none";
-        }
-
-        this.panelNode.style.display = "none";
-
-        this.visible = false;
-    },
-
-    watchWindow: function(win)
-    {
-    },
-
-    unwatchWindow: function(win)
-    {
-    },
-
-    updateOption: function(name, value)
-    {
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    /**
-     * Toolbar helpers
-     */
-    showToolbarButtons: function(buttonsId, show)
-    {
-        try
-        {
-            if (!this.context.browser) // XXXjjb this is bug. Somehow the panel context is not FirebugContext.
-            {
-                if (FBTrace.DBG_ERRORS)
-                    FBTrace.sysout("firebug.Panel showToolbarButtons this.context has no browser, this:", this);
-
-                return;
-            }
-            var buttons = this.context.browser.chrome.$(buttonsId);
-            if (buttons)
-                collapse(buttons, show ? "false" : "true");
-        }
-        catch (exc)
-        {
-            if (FBTrace.DBG_ERRORS)
-            {
-                FBTrace.dumpProperties("firebug.Panel showToolbarButtons FAILS", exc);
-                if (!this.context.browser)FBTrace.dumpStack("firebug.Panel showToolbarButtons no browser");
-            }
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    /**
-     * Returns a number indicating the view's ability to inspect the object.
-     *
-     * Zero means not supported, and higher numbers indicate specificity.
-     */
-    supportsObject: function(object)
-    {
-        return 0;
-    },
-
-    hasObject: function(object)  // beyond type testing, is this object selectable?
-    {
-        return false;
-    },
-
-    select: function(object, forceUpdate)
-    {
-        if (!object)
-            object = this.getDefaultSelection(this.context);
-
-        if(FBTrace.DBG_PANELS)
-            FBTrace.sysout("firebug.select "+this.name+" forceUpdate: "+forceUpdate+" "+object+((object==this.selection)?"==":"!=")+this.selection);
-
-        if (forceUpdate || object != this.selection)
-        {
-            this.selection = object;
-            this.updateSelection(object);
-
-            // TODO: xxxpedro
-            // XXXjoe This is kind of cheating, but, feh.
-            //Firebug.chrome.onPanelSelect(object, this);
-            //if (uiListeners.length > 0)
-            //    dispatch(uiListeners, "onPanelSelect", [object, this]);  // TODO: make Firebug.chrome a uiListener
-        }
-    },
-
-    updateSelection: function(object)
-    {
-    },
-
-    markChange: function(skipSelf)
-    {
-        if (this.dependents)
-        {
-            if (skipSelf)
-            {
-                for (var i = 0; i < this.dependents.length; ++i)
-                {
-                    var panelName = this.dependents[i];
-                    if (panelName != this.name)
-                        this.context.invalidatePanels(panelName);
-                }
-            }
-            else
-                this.context.invalidatePanels.apply(this.context, this.dependents);
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    startInspecting: function()
-    {
-    },
-
-    stopInspecting: function(object, cancelled)
-    {
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    search: function(text, reverse)
-    {
-    },
-
-    /**
-     * Retrieves the search options that this modules supports.
-     * This is used by the search UI to present the proper options.
-     */
-    getSearchOptionsMenuItems: function()
-    {
-        return [
-            Firebug.Search.searchOptionMenu("search.Case Sensitive", "searchCaseSensitive")
-        ];
-    },
-
-    /**
-     * Navigates to the next document whose match parameter returns true.
-     */
-    navigateToNextDocument: function(match, reverse)
-    {
-        // This is an approximation of the UI that is displayed by the location
-        // selector. This should be close enough, although it may be better
-        // to simply generate the sorted list within the module, rather than
-        // sorting within the UI.
-        var self = this;
-        function compare(a, b) {
-            var locA = self.getObjectDescription(a);
-            var locB = self.getObjectDescription(b);
-            if(locA.path > locB.path)
-                return 1;
-            if(locA.path < locB.path)
-                return -1;
-            if(locA.name > locB.name)
-                return 1;
-            if(locA.name < locB.name)
-                return -1;
-            return 0;
-        }
-        var allLocs = this.getLocationList().sort(compare);
-        for (var curPos = 0; curPos < allLocs.length && allLocs[curPos] != this.location; curPos++);
-
-        function transformIndex(index) {
-            if (reverse) {
-                // For the reverse case we need to implement wrap around.
-                var intermediate = curPos - index - 1;
-                return (intermediate < 0 ? allLocs.length : 0) + intermediate;
-            } else {
-                return (curPos + index + 1) % allLocs.length;
-            }
-        };
-
-        for (var next = 0; next < allLocs.length - 1; next++)
-        {
-            var object = allLocs[transformIndex(next)];
-
-            if (match(object))
-            {
-                this.navigate(object);
-                return object;
-            }
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    // Called when "Options" clicked. Return array of
-    // {label: 'name', nol10n: true,  type: "checkbox", checked: <value>, command:function to set <value>}
-    getOptionsMenuItems: function()
-    {
-        return null;
-    },
-
-    /*
-     * Called by chrome.onContextMenu to build the context menu when this panel has focus.
-     * See also FirebugRep for a similar function also called by onContextMenu
-     * Extensions may monkey patch and chain off this call
-     * @param object: the 'realObject', a model value, eg a DOM property
-     * @param target: the HTML element clicked on.
-     * @return an array of menu items.
-     */
-    getContextMenuItems: function(object, target)
-    {
-        return [];
-    },
-
-    getBreakOnMenuItems: function()
-    {
-        return [];
-    },
-
-    getEditor: function(target, value)
-    {
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    getDefaultSelection: function()
-    {
-        return null;
-    },
-
-    browseObject: function(object)
-    {
-    },
-
-    getPopupObject: function(target)
-    {
-        return Firebug.getRepObject(target);
-    },
-
-    getTooltipObject: function(target)
-    {
-        return Firebug.getRepObject(target);
-    },
-
-    showInfoTip: function(infoTip, x, y)
-    {
-
-    },
-
-    getObjectPath: function(object)
-    {
-        return null;
-    },
-
-    // An array of objects that can be passed to getObjectLocation.
-    // The list of things a panel can show, eg sourceFiles.
-    // Only shown if panel.location defined and supportsObject true
-    getLocationList: function()
-    {
-        return null;
-    },
-
-    getDefaultLocation: function()
-    {
-        return null;
-    },
-
-    getObjectLocation: function(object)
-    {
-        return "";
-    },
-
-    // Text for the location list menu eg script panel source file list
-    // return.path: group/category label, return.name: item label
-    getObjectDescription: function(object)
-    {
-        var url = this.getObjectLocation(object);
-        return FBL.splitURLBase(url);
-    },
-
-    /*
-     *  UI signal that a tab needs attention, eg Script panel is currently stopped on a breakpoint
-     *  @param: show boolean, true turns on.
-     */
-    highlight: function(show)
-    {
-        var tab = this.getTab();
-        if (!tab)
-            return;
-
-        if (show)
-            tab.setAttribute("highlight", "true");
-        else
-            tab.removeAttribute("highlight");
-    },
-
-    getTab: function()
-    {
-        var chrome = Firebug.chrome;
-
-        var tab = chrome.$("fbPanelBar2").getTab(this.name);
-        if (!tab)
-            tab = chrome.$("fbPanelBar1").getTab(this.name);
-        return tab;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Support for Break On Next
-
-    /**
-     * Called by the framework when the user clicks on the Break On Next button.
-     * @param {Boolean} armed Set to true if the Break On Next feature is
-     * to be armed for action and set to false if the Break On Next should be disarmed.
-     * If 'armed' is true, then the next call to shouldBreakOnNext should be |true|.
-     */
-    breakOnNext: function(armed)
-    {
-    },
-
-    /**
-     * Called when a panel is selected/displayed. The method should return true
-     * if the Break On Next feature is currently armed for this panel.
-     */
-    shouldBreakOnNext: function()
-    {
-        return false;
-    },
-
-    /**
-     * Returns labels for Break On Next tooltip (one for enabled and one for disabled state).
-     * @param {Boolean} enabled Set to true if the Break On Next feature is
-     * currently activated for this panel.
-     */
-    getBreakOnNextTooltip: function(enabled)
-    {
-        return null;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    // xxxpedro contextMenu
-    onContextMenu: function(event)
-    {
-        if (!this.getContextMenuItems)
-            return;
-
-        cancelEvent(event, true);
-
-        var target = event.target || event.srcElement;
-
-        var menu = this.getContextMenuItems(this.selection, target);
-        if (!menu)
-            return;
-
-        var contextMenu = new Menu(
-        {
-            id: "fbPanelContextMenu",
-
-            items: menu
-        });
-
-        contextMenu.show(event.clientX, event.clientY);
-
-        return true;
-
-        /*
-        // TODO: xxxpedro move code to somewhere. code to get cross-browser
-        // window to screen coordinates
-        var box = Firebug.browser.getElementPosition(Firebug.chrome.node);
-
-        var screenY = 0;
-
-        // Firefox
-        if (typeof window.mozInnerScreenY != "undefined")
-        {
-            screenY = window.mozInnerScreenY;
-        }
-        // Chrome
-        else if (typeof window.innerHeight != "undefined")
-        {
-            screenY = window.outerHeight - window.innerHeight;
-        }
-        // IE
-        else if (typeof window.screenTop != "undefined")
-        {
-            screenY = window.screenTop;
-        }
-
-        contextMenu.show(event.screenX-box.left, event.screenY-screenY-box.top);
-        /**/
-    }
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-};
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-/**
- * MeasureBox
- * To get pixels size.width and size.height:
- * <ul><li>     this.startMeasuring(view); </li>
- *     <li>     var size = this.measureText(lineNoCharsSpacer); </li>
- *     <li>     this.stopMeasuring(); </li>
- * </ul>
- *
- * @namespace
- */
-Firebug.MeasureBox =
-{
-    startMeasuring: function(target)
-    {
-        if (!this.measureBox)
-        {
-            this.measureBox = target.ownerDocument.createElement("span");
-            this.measureBox.className = "measureBox";
-        }
-
-        copyTextStyles(target, this.measureBox);
-        target.ownerDocument.body.appendChild(this.measureBox);
-    },
-
-    getMeasuringElement: function()
-    {
-        return this.measureBox;
-    },
-
-    measureText: function(value)
-    {
-        this.measureBox.innerHTML = value ? escapeForSourceLine(value) : "m";
-        return {width: this.measureBox.offsetWidth, height: this.measureBox.offsetHeight-1};
-    },
-
-    measureInputText: function(value)
-    {
-        value = value ? escapeForTextNode(value) : "m";
-        if (!Firebug.showTextNodesWithWhitespace)
-            value = value.replace(/\t/g,'mmmmmm').replace(/\ /g,'m');
-        this.measureBox.innerHTML = value;
-        return {width: this.measureBox.offsetWidth, height: this.measureBox.offsetHeight-1};
-    },
-
-    getBox: function(target)
-    {
-        var style = this.measureBox.ownerDocument.defaultView.getComputedStyle(this.measureBox, "");
-        var box = getBoxFromStyles(style, this.measureBox);
-        return box;
-    },
-
-    stopMeasuring: function()
-    {
-        this.measureBox.parentNode.removeChild(this.measureBox);
-    }
-};
-
-
-// ************************************************************************************************
-if (FBL.domplate) Firebug.Rep = domplate(
-{
-    className: "",
-    inspectable: true,
-
-    supportsObject: function(object, type)
-    {
-        return false;
-    },
-
-    inspectObject: function(object, context)
-    {
-        Firebug.chrome.select(object);
-    },
-
-    browseObject: function(object, context)
-    {
-    },
-
-    persistObject: function(object, context)
-    {
-    },
-
-    getRealObject: function(object, context)
-    {
-        return object;
-    },
-
-    getTitle: function(object)
-    {
-        var label = safeToString(object);
-
-        var re = /\[object (.*?)\]/;
-        var m = re.exec(label);
-
-        ///return m ? m[1] : label;
-
-        // if the label is in the "[object TYPE]" format return its type
-        if (m)
-        {
-            return m[1];
-        }
-        // if it is IE we need to handle some special cases
-        else if (
-                // safeToString() fails to recognize some objects in IE
-                isIE &&
-                // safeToString() returns "[object]" for some objects like window.Image
-                (label == "[object]" ||
-                // safeToString() returns undefined for some objects like window.clientInformation
-                typeof object == "object" && typeof label == "undefined")
-            )
-        {
-            return "Object";
-        }
-        else
-        {
-            return label;
-        }
-    },
-
-    getTooltip: function(object)
-    {
-        return null;
-    },
-
-    getContextMenuItems: function(object, target, context)
-    {
-        return [];
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Convenience for domplates
-
-    STR: function(name)
-    {
-        return $STR(name);
-    },
-
-    cropString: function(text)
-    {
-        return cropString(text);
-    },
-
-    cropMultipleLines: function(text, limit)
-    {
-        return cropMultipleLines(text, limit);
-    },
-
-    toLowerCase: function(text)
-    {
-        return text ? text.toLowerCase() : text;
-    },
-
-    plural: function(n)
-    {
-        return n == 1 ? "" : "s";
-    }
-});
-
-// ************************************************************************************************
-
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-FBL.ns( /** @scope s_gui */ function() { with (FBL) {
-// ************************************************************************************************
-
-// ************************************************************************************************
-// Controller
-
-/**@namespace*/
-FBL.Controller = {
-
-    controllers: null,
-    controllerContext: null,
-
-    initialize: function(context)
-    {
-        this.controllers = [];
-        this.controllerContext = context || Firebug.chrome;
-    },
-
-    shutdown: function()
-    {
-        this.removeControllers();
-
-        //this.controllers = null;
-        //this.controllerContext = null;
-    },
-
-    addController: function()
-    {
-        for (var i=0, arg; arg=arguments[i]; i++)
-        {
-            // If the first argument is a string, make a selector query
-            // within the controller node context
-            if (typeof arg[0] == "string")
-            {
-                arg[0] = $$(arg[0], this.controllerContext);
-            }
-
-            // bind the handler to the proper context
-            var handler = arg[2];
-            arg[2] = bind(handler, this);
-            // save the original handler as an extra-argument, so we can
-            // look for it later, when removing a particular controller
-            arg[3] = handler;
-
-            this.controllers.push(arg);
-            addEvent.apply(this, arg);
-        }
-    },
-
-    removeController: function()
-    {
-        for (var i=0, arg; arg=arguments[i]; i++)
-        {
-            for (var j=0, c; c=this.controllers[j]; j++)
-            {
-                if (arg[0] == c[0] && arg[1] == c[1] && arg[2] == c[3])
-                    removeEvent.apply(this, c);
-            }
-        }
-    },
-
-    removeControllers: function()
-    {
-        for (var i=0, c; c=this.controllers[i]; i++)
-        {
-            removeEvent.apply(this, c);
-        }
-    }
-};
-
-
-// ************************************************************************************************
-// PanelBar
-
-/**@namespace*/
-FBL.PanelBar =
-{
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    panelMap: null,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    selectedPanel: null,
-    parentPanelName: null,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    create: function(ownerPanel)
-    {
-        this.panelMap = {};
-        this.ownerPanel = ownerPanel;
-
-        if (ownerPanel)
-        {
-            ownerPanel.sidePanelBarNode = createElement("span");
-            ownerPanel.sidePanelBarNode.style.display = "none";
-            ownerPanel.sidePanelBarBoxNode.appendChild(ownerPanel.sidePanelBarNode);
-        }
-
-        var panels = Firebug.panelTypes;
-        for (var i=0, p; p=panels[i]; i++)
-        {
-            if ( // normal Panel  of the Chrome's PanelBar
-                !ownerPanel && !p.prototype.parentPanel ||
-                // Child Panel of the current Panel's SidePanelBar
-                ownerPanel && p.prototype.parentPanel &&
-                ownerPanel.name == p.prototype.parentPanel)
-            {
-                this.addPanel(p.prototype.name);
-            }
-        }
-    },
-
-    destroy: function()
-    {
-        PanelBar.shutdown.call(this);
-
-        for (var name in this.panelMap)
-        {
-            this.removePanel(name);
-
-            var panel = this.panelMap[name];
-            panel.destroy();
-
-            this.panelMap[name] = null;
-            delete this.panelMap[name];
-        }
-
-        this.panelMap = null;
-        this.ownerPanel = null;
-    },
-
-    initialize: function()
-    {
-        if (this.ownerPanel)
-            this.ownerPanel.sidePanelBarNode.style.display = "inline";
-
-        for(var name in this.panelMap)
-        {
-            (function(self, name){
-
-                // tab click handler
-                var onTabClick = function onTabClick()
-                {
-                    self.selectPanel(name);
-                    return false;
-                };
-
-                Firebug.chrome.addController([self.panelMap[name].tabNode, "mousedown", onTabClick]);
-
-            })(this, name);
-        }
-    },
-
-    shutdown: function()
-    {
-        var selectedPanel = this.selectedPanel;
-
-        if (selectedPanel)
-        {
-            removeClass(selectedPanel.tabNode, "fbSelectedTab");
-            selectedPanel.hide();
-            selectedPanel.shutdown();
-        }
-
-        if (this.ownerPanel)
-            this.ownerPanel.sidePanelBarNode.style.display = "none";
-
-        this.selectedPanel = null;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    addPanel: function(panelName, parentPanel)
-    {
-        var PanelType = Firebug.panelTypeMap[panelName];
-        var panel = this.panelMap[panelName] = new PanelType();
-
-        panel.create();
-    },
-
-    removePanel: function(panelName)
-    {
-        var panel = this.panelMap[panelName];
-        if (panel.hasOwnProperty(panelName))
-            panel.destroy();
-    },
-
-    selectPanel: function(panelName)
-    {
-        var selectedPanel = this.selectedPanel;
-        var panel = this.panelMap[panelName];
-
-        if (panel && selectedPanel != panel)
-        {
-            if (selectedPanel)
-            {
-                removeClass(selectedPanel.tabNode, "fbSelectedTab");
-                selectedPanel.shutdown();
-                selectedPanel.hide();
-            }
-
-            if (!panel.parentPanel)
-                Firebug.context.persistedState.selectedPanelName = panelName;
-
-            this.selectedPanel = panel;
-
-            setClass(panel.tabNode, "fbSelectedTab");
-            panel.show();
-            panel.initialize();
-        }
-    },
-
-    getPanel: function(panelName)
-    {
-        var panel = this.panelMap[panelName];
-
-        return panel;
-    }
-
-};
-
-//************************************************************************************************
-// Button
-
-/**
- * options.element
- * options.caption
- * options.title
- *
- * options.owner
- * options.className
- * options.pressedClassName
- *
- * options.onPress
- * options.onUnpress
- * options.onClick
- *
- * @class
- * @extends FBL.Controller
- *
- */
-
-FBL.Button = function(options)
-{
-    options = options || {};
-
-    append(this, options);
-
-    this.state = "unpressed";
-    this.display = "unpressed";
-
-    if (this.element)
-    {
-        this.container = this.element.parentNode;
-    }
-    else
-    {
-        this.shouldDestroy = true;
-
-        this.container = this.owner.getPanel().toolButtonsNode;
-
-        this.element = createElement("a", {
-            className: this.baseClassName + " " + this.className + " fbHover",
-            innerHTML: this.caption
-        });
-
-        if (this.title)
-            this.element.title = this.title;
-
-        this.container.appendChild(this.element);
-    }
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-Button.prototype = extend(Controller,
-/**@extend FBL.Button.prototype*/
-{
-    type: "normal",
-    caption: "caption",
-    title: null,
-
-    className: "", // custom class
-    baseClassName: "fbButton", // control class
-    pressedClassName: "fbBtnPressed", // control pressed class
-
-    element: null,
-    container: null,
-    owner: null,
-
-    state: null,
-    display: null,
-
-    destroy: function()
-    {
-        this.shutdown();
-
-        // only remove if it is a dynamically generated button (not pre-rendered)
-        if (this.shouldDestroy)
-            this.container.removeChild(this.element);
-
-        this.element = null;
-        this.container = null;
-        this.owner = null;
-    },
-
-    initialize: function()
-    {
-        Controller.initialize.apply(this);
-
-        var element = this.element;
-
-        this.addController([element, "mousedown", this.handlePress]);
-
-        if (this.type == "normal")
-            this.addController(
-                [element, "mouseup", this.handleUnpress],
-                [element, "mouseout", this.handleUnpress],
-                [element, "click", this.handleClick]
-            );
-    },
-
-    shutdown: function()
-    {
-        Controller.shutdown.apply(this);
-    },
-
-    restore: function()
-    {
-        this.changeState("unpressed");
-    },
-
-    changeState: function(state)
-    {
-        this.state = state;
-        this.changeDisplay(state);
-    },
-
-    changeDisplay: function(display)
-    {
-        if (display != this.display)
-        {
-            if (display == "pressed")
-            {
-                setClass(this.element, this.pressedClassName);
-            }
-            else if (display == "unpressed")
-            {
-                removeClass(this.element, this.pressedClassName);
-            }
-            this.display = display;
-        }
-    },
-
-    handlePress: function(event)
-    {
-        cancelEvent(event, true);
-
-        if (this.type == "normal")
-        {
-            this.changeDisplay("pressed");
-            this.beforeClick = true;
-        }
-        else if (this.type == "toggle")
-        {
-            if (this.state == "pressed")
-            {
-                this.changeState("unpressed");
-
-                if (this.onUnpress)
-                    this.onUnpress.apply(this.owner, arguments);
-            }
-            else
-            {
-                this.changeState("pressed");
-
-                if (this.onPress)
-                    this.onPress.apply(this.owner, arguments);
-            }
-
-            if (this.onClick)
-                this.onClick.apply(this.owner, arguments);
-        }
-
-        return false;
-    },
-
-    handleUnpress: function(event)
-    {
-        cancelEvent(event, true);
-
-        if (this.beforeClick)
-            this.changeDisplay("unpressed");
-
-        return false;
-    },
-
-    handleClick: function(event)
-    {
-        cancelEvent(event, true);
-
-        if (this.type == "normal")
-        {
-            if (this.onClick)
-                this.onClick.apply(this.owner);
-
-            this.changeState("unpressed");
-        }
-
-        this.beforeClick = false;
-
-        return false;
-    }
-});
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-/**
- * @class
- * @extends FBL.Button
- */
-FBL.IconButton = function()
-{
-    Button.apply(this, arguments);
-};
-
-IconButton.prototype = extend(Button.prototype,
-/**@extend FBL.IconButton.prototype*/
-{
-    baseClassName: "fbIconButton",
-    pressedClassName: "fbIconPressed"
-});
-
-
-//************************************************************************************************
-// Menu
-
-var menuItemProps = {"class": "$item.className", type: "$item.type", value: "$item.value",
-        _command: "$item.command"};
-
-if (isIE6)
-    menuItemProps.href = "javascript:void(0)";
-
-// Allow GUI to be loaded even when Domplate module is not installed.
-if (FBL.domplate)
-var MenuPlate = domplate(Firebug.Rep,
-{
-    tag:
-        DIV({"class": "fbMenu fbShadow"},
-            DIV({"class": "fbMenuContent fbShadowContent"},
-                FOR("item", "$object.items|memberIterator",
-                    TAG("$item.tag", {item: "$item"})
-                )
-            )
-        ),
-
-    itemTag:
-        A(menuItemProps,
-            "$item.label"
-        ),
-
-    checkBoxTag:
-        A(extend(menuItemProps, {checked : "$item.checked"}),
-
-            "$item.label"
-        ),
-
-    radioButtonTag:
-        A(extend(menuItemProps, {selected : "$item.selected"}),
-
-            "$item.label"
-        ),
-
-    groupTag:
-        A(extend(menuItemProps, {child: "$item.child"}),
-            "$item.label"
-        ),
-
-    shortcutTag:
-        A(menuItemProps,
-            "$item.label",
-            SPAN({"class": "fbMenuShortcutKey"},
-                "$item.key"
-            )
-        ),
-
-    separatorTag:
-        SPAN({"class": "fbMenuSeparator"}),
-
-    memberIterator: function(items)
-    {
-        var result = [];
-
-        for (var i=0, length=items.length; i<length; i++)
-        {
-            var item = items[i];
-
-            // separator representation
-            if (typeof item == "string" && item.indexOf("-") == 0)
-            {
-                result.push({tag: this.separatorTag});
-                continue;
-            }
-
-            item = extend(item, {});
-
-            item.type = item.type || "";
-            item.value = item.value || "";
-
-            var type = item.type;
-
-            // default item representation
-            item.tag = this.itemTag;
-
-            var className = item.className || "";
-
-            className += "fbMenuOption fbHover ";
-
-            // specific representations
-            if (type == "checkbox")
-            {
-                className += "fbMenuCheckBox ";
-                item.tag = this.checkBoxTag;
-            }
-            else if (type == "radiobutton")
-            {
-                className += "fbMenuRadioButton ";
-                item.tag = this.radioButtonTag;
-            }
-            else if (type == "group")
-            {
-                className += "fbMenuGroup ";
-                item.tag = this.groupTag;
-            }
-            else if (type == "shortcut")
-            {
-                className += "fbMenuShortcut ";
-                item.tag = this.shortcutTag;
-            }
-
-            if (item.checked)
-                className += "fbMenuChecked ";
-            else if (item.selected)
-                className += "fbMenuRadioSelected ";
-
-            if (item.disabled)
-                className += "fbMenuDisabled ";
-
-            item.className = className;
-
-            item.label = $STR(item.label);
-
-            result.push(item);
-        }
-
-        return result;
-    }
-});
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-/**
- * options
- * options.element
- * options.id
- * options.items
- *
- * item.label
- * item.className
- * item.type
- * item.value
- * item.disabled
- * item.checked
- * item.selected
- * item.command
- * item.child
- *
- *
- * @class
- * @extends FBL.Controller
- *
- */
-FBL.Menu = function(options)
-{
-    // if element is not pre-rendered, we must render it now
-    if (!options.element)
-    {
-        if (options.getItems)
-            options.items = options.getItems();
-
-        options.element = MenuPlate.tag.append(
-                {object: options},
-                getElementByClass(Firebug.chrome.document, "fbBody"),
-                MenuPlate
-            );
-    }
-
-    // extend itself with the provided options
-    append(this, options);
-
-    if (typeof this.element == "string")
-    {
-        this.id = this.element;
-        this.element = $(this.id);
-    }
-    else if (this.id)
-    {
-        this.element.id = this.id;
-    }
-
-    this.element.firebugIgnore = true;
-    this.elementStyle = this.element.style;
-
-    this.isVisible = false;
-
-    this.handleMouseDown = bind(this.handleMouseDown, this);
-    this.handleMouseOver = bind(this.handleMouseOver, this);
-    this.handleMouseOut = bind(this.handleMouseOut, this);
-
-    this.handleWindowMouseDown = bind(this.handleWindowMouseDown, this);
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var menuMap = {};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-Menu.prototype =  extend(Controller,
-/**@extend FBL.Menu.prototype*/
-{
-    destroy: function()
-    {
-        //if (this.element) console.log("destroy", this.element.id);
-
-        this.hide();
-
-        // if it is a childMenu, remove its reference from the parentMenu
-        if (this.parentMenu)
-            this.parentMenu.childMenu = null;
-
-        // remove the element from the document
-        this.element.parentNode.removeChild(this.element);
-
-        // clear references
-        this.element = null;
-        this.elementStyle = null;
-        this.parentMenu = null;
-        this.parentTarget = null;
-    },
-
-    initialize: function()
-    {
-        Controller.initialize.call(this);
-
-        this.addController(
-                [this.element, "mousedown", this.handleMouseDown],
-                [this.element, "mouseover", this.handleMouseOver]
-             );
-    },
-
-    shutdown: function()
-    {
-        Controller.shutdown.call(this);
-    },
-
-    show: function(x, y)
-    {
-        this.initialize();
-
-        if (this.isVisible) return;
-
-        //console.log("show", this.element.id);
-
-        x = x || 0;
-        y = y || 0;
-
-        if (this.parentMenu)
-        {
-            var oldChildMenu = this.parentMenu.childMenu;
-            if (oldChildMenu && oldChildMenu != this)
-            {
-                oldChildMenu.destroy();
-            }
-
-            this.parentMenu.childMenu = this;
-        }
-        else
-            addEvent(Firebug.chrome.document, "mousedown", this.handleWindowMouseDown);
-
-        this.elementStyle.display = "block";
-        this.elementStyle.visibility = "hidden";
-
-        var size = Firebug.chrome.getSize();
-
-        x = Math.min(x, size.width - this.element.clientWidth - 10);
-        x = Math.max(x, 0);
-
-        y = Math.min(y, size.height - this.element.clientHeight - 10);
-        y = Math.max(y, 0);
-
-        this.elementStyle.left = x + "px";
-        this.elementStyle.top = y + "px";
-
-        this.elementStyle.visibility = "visible";
-
-        this.isVisible = true;
-
-        if (isFunction(this.onShow))
-            this.onShow.apply(this, arguments);
-    },
-
-    hide: function()
-    {
-        this.clearHideTimeout();
-        this.clearShowChildTimeout();
-
-        if (!this.isVisible) return;
-
-        //console.log("hide", this.element.id);
-
-        this.elementStyle.display = "none";
-
-        if(this.childMenu)
-        {
-            this.childMenu.destroy();
-            this.childMenu = null;
-        }
-
-        if(this.parentTarget)
-            removeClass(this.parentTarget, "fbMenuGroupSelected");
-
-        this.isVisible = false;
-
-        this.shutdown();
-
-        if (isFunction(this.onHide))
-            this.onHide.apply(this, arguments);
-    },
-
-    showChildMenu: function(target)
-    {
-        var id = target.getAttribute("child");
-
-        var parent = this;
-        var target = target;
-
-        this.showChildTimeout = Firebug.chrome.window.setTimeout(function(){
-
-            //if (!parent.isVisible) return;
-
-            var box = Firebug.chrome.getElementBox(target);
-
-            var childMenuObject = menuMap.hasOwnProperty(id) ?
-                    menuMap[id] : {element: $(id)};
-
-            var childMenu = new Menu(extend(childMenuObject,
-                {
-                    parentMenu: parent,
-                    parentTarget: target
-                }));
-
-            var offsetLeft = isIE6 ? -1 : -6; // IE6 problem with fixed position
-            childMenu.show(box.left + box.width + offsetLeft, box.top -6);
-            setClass(target, "fbMenuGroupSelected");
-
-        },350);
-    },
-
-    clearHideTimeout: function()
-    {
-        if (this.hideTimeout)
-        {
-            Firebug.chrome.window.clearTimeout(this.hideTimeout);
-            delete this.hideTimeout;
-        }
-    },
-
-    clearShowChildTimeout: function()
-    {
-        if(this.showChildTimeout)
-        {
-            Firebug.chrome.window.clearTimeout(this.showChildTimeout);
-            this.showChildTimeout = null;
-        }
-    },
-
-    handleMouseDown: function(event)
-    {
-        cancelEvent(event, true);
-
-        var topParent = this;
-        while (topParent.parentMenu)
-            topParent = topParent.parentMenu;
-
-        var target = event.target || event.srcElement;
-
-        target = getAncestorByClass(target, "fbMenuOption");
-
-        if(!target || hasClass(target, "fbMenuGroup"))
-            return false;
-
-        if (target && !hasClass(target, "fbMenuDisabled"))
-        {
-            var type = target.getAttribute("type");
-
-            if (type == "checkbox")
-            {
-                var checked = target.getAttribute("checked");
-                var value = target.getAttribute("value");
-                var wasChecked = hasClass(target, "fbMenuChecked");
-
-                if (wasChecked)
-                {
-                    removeClass(target, "fbMenuChecked");
-                    target.setAttribute("checked", "");
-                }
-                else
-                {
-                    setClass(target, "fbMenuChecked");
-                    target.setAttribute("checked", "true");
-                }
-
-                if (isFunction(this.onCheck))
-                    this.onCheck.call(this, target, value, !wasChecked);
-            }
-
-            if (type == "radiobutton")
-            {
-                var selectedRadios = getElementsByClass(target.parentNode, "fbMenuRadioSelected");
-
-                var group = target.getAttribute("group");
-
-                for (var i = 0, length = selectedRadios.length; i < length; i++)
-                {
-                    radio = selectedRadios[i];
-
-                    if (radio.getAttribute("group") == group)
-                    {
-                        removeClass(radio, "fbMenuRadioSelected");
-                        radio.setAttribute("selected", "");
-                    }
-                }
-
-                setClass(target, "fbMenuRadioSelected");
-                target.setAttribute("selected", "true");
-            }
-
-            var handler = null;
-
-            // target.command can be a function or a string.
-            var cmd = target.command;
-
-            // If it is a function it will be used as the handler
-            if (isFunction(cmd))
-                handler = cmd;
-            // If it is a string it the property of the current menu object
-            // will be used as the handler
-            else if (typeof cmd == "string")
-                handler = this[cmd];
-
-            var closeMenu = true;
-
-            if (handler)
-                closeMenu = handler.call(this, target) !== false;
-
-            if (closeMenu)
-                topParent.hide();
-        }
-
-        return false;
-    },
-
-    handleWindowMouseDown: function(event)
-    {
-        //console.log("handleWindowMouseDown");
-
-        var target = event.target || event.srcElement;
-
-        target = getAncestorByClass(target, "fbMenu");
-
-        if (!target)
-        {
-            removeEvent(Firebug.chrome.document, "mousedown", this.handleWindowMouseDown);
-            this.hide();
-        }
-    },
-
-    handleMouseOver: function(event)
-    {
-        //console.log("handleMouseOver", this.element.id);
-
-        this.clearHideTimeout();
-        this.clearShowChildTimeout();
-
-        var target = event.target || event.srcElement;
-
-        target = getAncestorByClass(target, "fbMenuOption");
-
-        if(!target)
-            return;
-
-        var childMenu = this.childMenu;
-        if(childMenu)
-        {
-            removeClass(childMenu.parentTarget, "fbMenuGroupSelected");
-
-            if (childMenu.parentTarget != target && childMenu.isVisible)
-            {
-                childMenu.clearHideTimeout();
-                childMenu.hideTimeout = Firebug.chrome.window.setTimeout(function(){
-                    childMenu.destroy();
-                },300);
-            }
-        }
-
-        if(hasClass(target, "fbMenuGroup"))
-        {
-            this.showChildMenu(target);
-        }
-    }
-});
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-append(Menu,
-/**@extend FBL.Menu*/
-{
-    register: function(object)
-    {
-        menuMap[object.id] = object;
-    },
-
-    check: function(element)
-    {
-        setClass(element, "fbMenuChecked");
-        element.setAttribute("checked", "true");
-    },
-
-    uncheck: function(element)
-    {
-        removeClass(element, "fbMenuChecked");
-        element.setAttribute("checked", "");
-    },
-
-    disable: function(element)
-    {
-        setClass(element, "fbMenuDisabled");
-    },
-
-    enable: function(element)
-    {
-        removeClass(element, "fbMenuDisabled");
-    }
-});
-
-
-//************************************************************************************************
-// Status Bar
-
-/**@class*/
-function StatusBar(){};
-
-StatusBar.prototype = extend(Controller, {
-
-});
-
-// ************************************************************************************************
-
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-FBL.ns( /**@scope s_context*/ function() { with (FBL) {
-// ************************************************************************************************
-
-// ************************************************************************************************
-// Globals
-
-var refreshDelay = 300;
-
-// Opera and some versions of webkit returns the wrong value of document.elementFromPoint()
-// function, without taking into account the scroll position. Safari 4 (webkit/531.21.8)
-// still have this issue. Google Chrome 4 (webkit/532.5) does not. So, we're assuming this
-// issue was fixed in the 532 version
-var shouldFixElementFromPoint = isOpera || isSafari && browserVersion < "532";
-
-var evalError = "___firebug_evaluation_error___";
-var pixelsPerInch;
-
-var resetStyle = "margin:0; padding:0; border:0; position:absolute; overflow:hidden; display:block;";
-var offscreenStyle = resetStyle + "top:-1234px; left:-1234px;";
-
-
-// ************************************************************************************************
-// Context
-
-/** @class */
-FBL.Context = function(win)
-{
-    this.window = win.window;
-    this.document = win.document;
-
-    this.browser = Env.browser;
-
-    // Some windows in IE, like iframe, doesn't have the eval() method
-    if (isIE && !this.window.eval)
-    {
-        // But after executing the following line the method magically appears!
-        this.window.execScript("null");
-        // Just to make sure the "magic" really happened
-        if (!this.window.eval)
-            throw new Error("Firebug Error: eval() method not found in this window");
-    }
-
-    // Create a new "black-box" eval() method that runs in the global namespace
-    // of the context window, without exposing the local variables declared
-    // by the function that calls it
-    this.eval = this.window.eval("new Function('" +
-            "try{ return window.eval.apply(window,arguments) }catch(E){ E."+evalError+"=true; return E }" +
-        "')");
-};
-
-FBL.Context.prototype =
-{
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // partial-port of Firebug tabContext.js
-
-    browser: null,
-    loaded: true,
-
-    setTimeout: function(fn, delay)
-    {
-        var win = this.window;
-
-        if (win.setTimeout == this.setTimeout)
-            throw new Error("setTimeout recursion");
-
-        var timeout = win.setTimeout.apply ? // IE doesn't have apply method on setTimeout
-                win.setTimeout.apply(win, arguments) :
-                win.setTimeout(fn, delay);
-
-        if (!this.timeouts)
-            this.timeouts = {};
-
-        this.timeouts[timeout] = 1;
-
-        return timeout;
-    },
-
-    clearTimeout: function(timeout)
-    {
-        clearTimeout(timeout);
-
-        if (this.timeouts)
-            delete this.timeouts[timeout];
-    },
-
-    setInterval: function(fn, delay)
-    {
-        var win = this.window;
-
-        var timeout = win.setInterval.apply ? // IE doesn't have apply method on setTimeout
-                win.setInterval.apply(win, arguments) :
-                win.setInterval(fn, delay);
-
-        if (!this.intervals)
-            this.intervals = {};
-
-        this.intervals[timeout] = 1;
-
-        return timeout;
-    },
-
-    clearInterval: function(timeout)
-    {
-        clearInterval(timeout);
-
-        if (this.intervals)
-            delete this.intervals[timeout];
-    },
-
-    invalidatePanels: function()
-    {
-        if (!this.invalidPanels)
-            this.invalidPanels = {};
-
-        for (var i = 0; i < arguments.length; ++i)
-        {
-            var panelName = arguments[i];
-
-            // avoid error. need to create a better getPanel() function as explained below
-            if (!Firebug.chrome || !Firebug.chrome.selectedPanel)
-                return;
-
-            //var panel = this.getPanel(panelName, true);
-            //TODO: xxxpedro context how to get all panels using a single function?
-            // the current workaround to make the invalidation works is invalidating
-            // only sidePanels. There's also a problem with panel name (LowerCase in Firebug Lite)
-            var panel = Firebug.chrome.selectedPanel.sidePanelBar ?
-                    Firebug.chrome.selectedPanel.sidePanelBar.getPanel(panelName, true) :
-                    null;
-
-            if (panel && !panel.noRefresh)
-                this.invalidPanels[panelName] = 1;
-        }
-
-        if (this.refreshTimeout)
-        {
-            this.clearTimeout(this.refreshTimeout);
-            delete this.refreshTimeout;
-        }
-
-        this.refreshTimeout = this.setTimeout(bindFixed(function()
-        {
-            var invalids = [];
-
-            for (var panelName in this.invalidPanels)
-            {
-                //var panel = this.getPanel(panelName, true);
-                //TODO: xxxpedro context how to get all panels using a single function?
-                // the current workaround to make the invalidation works is invalidating
-                // only sidePanels. There's also a problem with panel name (LowerCase in Firebug Lite)
-                var panel = Firebug.chrome.selectedPanel.sidePanelBar ?
-                        Firebug.chrome.selectedPanel.sidePanelBar.getPanel(panelName, true) :
-                        null;
-
-                if (panel)
-                {
-                    if (panel.visible && !panel.editing)
-                        panel.refresh();
-                    else
-                        panel.needsRefresh = true;
-
-                    // If the panel is being edited, we'll keep trying to
-                    // refresh it until editing is done
-                    if (panel.editing)
-                        invalids.push(panelName);
-                }
-            }
-
-            delete this.invalidPanels;
-            delete this.refreshTimeout;
-
-            // Keep looping until every tab is valid
-            if (invalids.length)
-                this.invalidatePanels.apply(this, invalids);
-        }, this), refreshDelay);
-    },
-
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Evalutation Method
-
-    /**
-     * Evaluates an expression in the current context window.
-     *
-     * @param {String}   expr           expression to be evaluated
-     *
-     * @param {String}   context        string indicating the global location
-     *                                  of the object that will be used as the
-     *                                  context. The context is referred in
-     *                                  the expression as the "this" keyword.
-     *                                  If no context is informed, the "window"
-     *                                  context is used.
-     *
-     * @param {String}   api            string indicating the global location
-     *                                  of the object that will be used as the
-     *                                  api of the evaluation.
-     *
-     * @param {Function} errorHandler(message) error handler to be called
-     *                                         if the evaluation fails.
-     */
-    evaluate: function(expr, context, api, errorHandler)
-    {
-        // the default context is the "window" object. It can be any string that represents
-        // a global accessible element as: "my.namespaced.object"
-        context = context || "window";
-
-        var isObjectLiteral = trim(expr).indexOf("{") == 0,
-            cmd,
-            result;
-
-        // if the context is the "window" object, we don't need a closure
-        if (context == "window")
-        {
-            // If it is an object literal, then wrap the expression with parenthesis so we can
-            // capture the return value
-            if (isObjectLiteral)
-            {
-                cmd = api ?
-                    "with("+api+"){ ("+expr+") }" :
-                    "(" + expr + ")";
-            }
-            else
-            {
-                cmd = api ?
-                    "with("+api+"){ "+expr+" }" :
-                    expr;
-            }
-        }
-        else
-        {
-            cmd = api ?
-                // with API and context, no return value
-                "(function(arguments){ with(" + api + "){ " +
-                    expr +
-                " } }).call(" + context + ",undefined)"
-                :
-                // with context only, no return value
-                "(function(arguments){ " +
-                    expr +
-                " }).call(" + context + ",undefined)";
-        }
-
-        result = this.eval(cmd);
-
-        if (result && result[evalError])
-        {
-            var msg = result.name ? (result.name + ": ") : "";
-            msg += result.message || result;
-
-            if (errorHandler)
-                result = errorHandler(msg);
-            else
-                result = msg;
-        }
-
-        return result;
-    },
-
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Window Methods
-
-    getWindowSize: function()
-    {
-        var width=0, height=0, el;
-
-        if (typeof this.window.innerWidth == "number")
-        {
-            width = this.window.innerWidth;
-            height = this.window.innerHeight;
-        }
-        else if ((el=this.document.documentElement) && (el.clientHeight || el.clientWidth))
-        {
-            width = el.clientWidth;
-            height = el.clientHeight;
-        }
-        else if ((el=this.document.body) && (el.clientHeight || el.clientWidth))
-        {
-            width = el.clientWidth;
-            height = el.clientHeight;
-        }
-
-        return {width: width, height: height};
-    },
-
-    getWindowScrollSize: function()
-    {
-        var width=0, height=0, el;
-
-        // first try the document.documentElement scroll size
-        if (!isIEQuiksMode && (el=this.document.documentElement) &&
-           (el.scrollHeight || el.scrollWidth))
-        {
-            width = el.scrollWidth;
-            height = el.scrollHeight;
-        }
-
-        // then we need to check if document.body has a bigger scroll size value
-        // because sometimes depending on the browser and the page, the document.body
-        // scroll size returns a smaller (and wrong) measure
-        if ((el=this.document.body) && (el.scrollHeight || el.scrollWidth) &&
-            (el.scrollWidth > width || el.scrollHeight > height))
-        {
-            width = el.scrollWidth;
-            height = el.scrollHeight;
-        }
-
-        return {width: width, height: height};
-    },
-
-    getWindowScrollPosition: function()
-    {
-        var top=0, left=0, el;
-
-        if(typeof this.window.pageYOffset == "number")
-        {
-            top = this.window.pageYOffset;
-            left = this.window.pageXOffset;
-        }
-        else if((el=this.document.body) && (el.scrollTop || el.scrollLeft))
-        {
-            top = el.scrollTop;
-            left = el.scrollLeft;
-        }
-        else if((el=this.document.documentElement) && (el.scrollTop || el.scrollLeft))
-        {
-            top = el.scrollTop;
-            left = el.scrollLeft;
-        }
-
-        return {top:top, left:left};
-    },
-
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Element Methods
-
-    getElementFromPoint: function(x, y)
-    {
-        if (shouldFixElementFromPoint)
-        {
-            var scroll = this.getWindowScrollPosition();
-            return this.document.elementFromPoint(x + scroll.left, y + scroll.top);
-        }
-        else
-            return this.document.elementFromPoint(x, y);
-    },
-
-    getElementPosition: function(el)
-    {
-        var left = 0;
-        var top = 0;
-
-        do
-        {
-            left += el.offsetLeft;
-            top += el.offsetTop;
-        }
-        while (el = el.offsetParent);
-
-        return {left:left, top:top};
-    },
-
-    getElementBox: function(el)
-    {
-        var result = {};
-
-        if (el.getBoundingClientRect)
-        {
-            var rect = el.getBoundingClientRect();
-
-            // fix IE problem with offset when not in fullscreen mode
-            var offset = isIE ? this.document.body.clientTop || this.document.documentElement.clientTop: 0;
-
-            var scroll = this.getWindowScrollPosition();
-
-            result.top = Math.round(rect.top - offset + scroll.top);
-            result.left = Math.round(rect.left - offset + scroll.left);
-            result.height = Math.round(rect.bottom - rect.top);
-            result.width = Math.round(rect.right - rect.left);
-        }
-        else
-        {
-            var position = this.getElementPosition(el);
-
-            result.top = position.top;
-            result.left = position.left;
-            result.height = el.offsetHeight;
-            result.width = el.offsetWidth;
-        }
-
-        return result;
-    },
-
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Measurement Methods
-
-    getMeasurement: function(el, name)
-    {
-        var result = {value: 0, unit: "px"};
-
-        var cssValue = this.getStyle(el, name);
-
-        if (!cssValue) return result;
-        if (cssValue.toLowerCase() == "auto") return result;
-
-        var reMeasure = /(\d+\.?\d*)(.*)/;
-        var m = cssValue.match(reMeasure);
-
-        if (m)
-        {
-            result.value = m[1]-0;
-            result.unit = m[2].toLowerCase();
-        }
-
-        return result;
-    },
-
-    getMeasurementInPixels: function(el, name)
-    {
-        if (!el) return null;
-
-        var m = this.getMeasurement(el, name);
-        var value = m.value;
-        var unit = m.unit;
-
-        if (unit == "px")
-            return value;
-
-        else if (unit == "pt")
-            return this.pointsToPixels(name, value);
-
-        else if (unit == "em")
-            return this.emToPixels(el, value);
-
-        else if (unit == "%")
-            return this.percentToPixels(el, value);
-
-        else if (unit == "ex")
-            return this.exToPixels(el, value);
-
-        // TODO: add other units. Maybe create a better general way
-        // to calculate measurements in different units.
-    },
-
-    getMeasurementBox1: function(el, name)
-    {
-        var sufixes = ["Top", "Left", "Bottom", "Right"];
-        var result = [];
-
-        for(var i=0, sufix; sufix=sufixes[i]; i++)
-            result[i] = Math.round(this.getMeasurementInPixels(el, name + sufix));
-
-        return {top:result[0], left:result[1], bottom:result[2], right:result[3]};
-    },
-
-    getMeasurementBox: function(el, name)
-    {
-        var result = [];
-        var sufixes = name == "border" ?
-                ["TopWidth", "LeftWidth", "BottomWidth", "RightWidth"] :
-                ["Top", "Left", "Bottom", "Right"];
-
-        if (isIE)
-        {
-            var propName, cssValue;
-            var autoMargin = null;
-
-            for(var i=0, sufix; sufix=sufixes[i]; i++)
-            {
-                propName = name + sufix;
-
-                cssValue = el.currentStyle[propName] || el.style[propName];
-
-                if (cssValue == "auto")
-                {
-                    if (!autoMargin)
-                        autoMargin = this.getCSSAutoMarginBox(el);
-
-                    result[i] = autoMargin[sufix.toLowerCase()];
-                }
-                else
-                    result[i] = this.getMeasurementInPixels(el, propName);
-
-            }
-
-        }
-        else
-        {
-            for(var i=0, sufix; sufix=sufixes[i]; i++)
-                result[i] = this.getMeasurementInPixels(el, name + sufix);
-        }
-
-        return {top:result[0], left:result[1], bottom:result[2], right:result[3]};
-    },
-
-    getCSSAutoMarginBox: function(el)
-    {
-        if (isIE && " meta title input script link a ".indexOf(" "+el.nodeName.toLowerCase()+" ") != -1)
-            return {top:0, left:0, bottom:0, right:0};
-            /**/
-
-        if (isIE && " h1 h2 h3 h4 h5 h6 h7 ul p ".indexOf(" "+el.nodeName.toLowerCase()+" ") == -1)
-            return {top:0, left:0, bottom:0, right:0};
-            /**/
-
-        var offsetTop = 0;
-        if (false && isIEStantandMode)
-        {
-            var scrollSize = Firebug.browser.getWindowScrollSize();
-            offsetTop = scrollSize.height;
-        }
-
-        var box = this.document.createElement("div");
-        //box.style.cssText = "margin:0; padding:1px; border: 0; position:static; overflow:hidden; visibility: hidden;";
-        box.style.cssText = "margin:0; padding:1px; border: 0; visibility: hidden;";
-
-        var clone = el.cloneNode(false);
-        var text = this.document.createTextNode("&nbsp;");
-        clone.appendChild(text);
-
-        box.appendChild(clone);
-
-        this.document.body.appendChild(box);
-
-        var marginTop = clone.offsetTop - box.offsetTop - 1;
-        var marginBottom = box.offsetHeight - clone.offsetHeight - 2 - marginTop;
-
-        var marginLeft = clone.offsetLeft - box.offsetLeft - 1;
-        var marginRight = box.offsetWidth - clone.offsetWidth - 2 - marginLeft;
-
-        this.document.body.removeChild(box);
-
-        return {top:marginTop+offsetTop, left:marginLeft, bottom:marginBottom-offsetTop, right:marginRight};
-    },
-
-    getFontSizeInPixels: function(el)
-    {
-        var size = this.getMeasurement(el, "fontSize");
-
-        if (size.unit == "px") return size.value;
-
-        // get font size, the dirty way
-        var computeDirtyFontSize = function(el, calibration)
-        {
-            var div = this.document.createElement("div");
-            var divStyle = offscreenStyle;
-
-            if (calibration)
-                divStyle +=  " font-size:"+calibration+"px;";
-
-            div.style.cssText = divStyle;
-            div.innerHTML = "A";
-            el.appendChild(div);
-
-            var value = div.offsetHeight;
-            el.removeChild(div);
-            return value;
-        };
-
-        /*
-        var calibrationBase = 200;
-        var calibrationValue = computeDirtyFontSize(el, calibrationBase);
-        var rate = calibrationBase / calibrationValue;
-        /**/
-
-        // the "dirty technique" fails in some environments, so we're using a static value
-        // based in some tests.
-        var rate = 200 / 225;
-
-        var value = computeDirtyFontSize(el);
-
-        return value * rate;
-    },
-
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Unit Funtions
-
-    pointsToPixels: function(name, value, returnFloat)
-    {
-        var axis = /Top$|Bottom$/.test(name) ? "y" : "x";
-
-        var result = value * pixelsPerInch[axis] / 72;
-
-        return returnFloat ? result : Math.round(result);
-    },
-
-    emToPixels: function(el, value)
-    {
-        if (!el) return null;
-
-        var fontSize = this.getFontSizeInPixels(el);
-
-        return Math.round(value * fontSize);
-    },
-
-    exToPixels: function(el, value)
-    {
-        if (!el) return null;
-
-        // get ex value, the dirty way
-        var div = this.document.createElement("div");
-        div.style.cssText = offscreenStyle + "width:"+value + "ex;";
-
-        el.appendChild(div);
-        var value = div.offsetWidth;
-        el.removeChild(div);
-
-        return value;
-    },
-
-    percentToPixels: function(el, value)
-    {
-        if (!el) return null;
-
-        // get % value, the dirty way
-        var div = this.document.createElement("div");
-        div.style.cssText = offscreenStyle + "width:"+value + "%;";
-
-        el.appendChild(div);
-        var value = div.offsetWidth;
-        el.removeChild(div);
-
-        return value;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    getStyle: isIE ? function(el, name)
-    {
-        return el.currentStyle[name] || el.style[name] || undefined;
-    }
-    : function(el, name)
-    {
-        return this.document.defaultView.getComputedStyle(el,null)[name]
-            || el.style[name] || undefined;
-    }
-
-};
-
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-FBL.ns( /**@scope ns-chrome*/ function() { with (FBL) {
-// ************************************************************************************************
-
-// ************************************************************************************************
-// Globals
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// Window Options
-
-var WindowDefaultOptions =
-    {
-        type: "frame",
-        id: "FirebugUI"
-        //height: 350 // obsolete
-    },
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// Instantiated objects
-
-    commandLine,
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// Interface Elements Cache
-
-    fbTop,
-    fbContent,
-    fbContentStyle,
-    fbBottom,
-    fbBtnInspect,
-
-    fbToolbar,
-
-    fbPanelBox1,
-    fbPanelBox1Style,
-    fbPanelBox2,
-    fbPanelBox2Style,
-    fbPanelBar2Box,
-    fbPanelBar2BoxStyle,
-
-    fbHSplitter,
-    fbVSplitter,
-    fbVSplitterStyle,
-
-    fbPanel1,
-    fbPanel1Style,
-    fbPanel2,
-    fbPanel2Style,
-
-    fbConsole,
-    fbConsoleStyle,
-    fbHTML,
-
-    fbCommandLine,
-    fbLargeCommandLine,
-    fbLargeCommandButtons,
-
-//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// Cached size values
-
-    topHeight,
-    topPartialHeight,
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    chromeRedrawSkipRate = isIE ? 75 : isOpera ? 80 : 75,
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    lastSelectedPanelName,
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    focusCommandLineState = 0,
-    lastFocusedPanelName,
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    lastHSplitterMouseMove = 0,
-    onHSplitterMouseMoveBuffer = null,
-    onHSplitterMouseMoveTimer = null,
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    lastVSplitterMouseMove = 0;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-
-// ************************************************************************************************
-// FirebugChrome
-
-FBL.defaultPersistedState =
-{
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    isOpen: false,
-    height: 300,
-    sidePanelWidth: 350,
-
-    selectedPanelName: "Console",
-    selectedHTMLElementId: null,
-
-    htmlSelectionStack: []
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-};
-
-/**@namespace*/
-FBL.FirebugChrome =
-{
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    //isOpen: false,
-    //height: 300,
-    //sidePanelWidth: 350,
-
-    //selectedPanelName: "Console",
-    //selectedHTMLElementId: null,
-
-    chromeMap: {},
-
-    htmlSelectionStack: [],
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    create: function()
-    {
-        if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("FirebugChrome.create", "creating chrome window");
-
-        createChromeWindow();
-    },
-
-    initialize: function()
-    {
-        if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("FirebugChrome.initialize", "initializing chrome window");
-
-        if (Env.chrome.type == "frame" || Env.chrome.type == "div")
-            ChromeMini.create(Env.chrome);
-
-        var chrome = Firebug.chrome = new Chrome(Env.chrome);
-        FirebugChrome.chromeMap[chrome.type] = chrome;
-
-        addGlobalEvent("keydown", onGlobalKeyDown);
-
-        if (Env.Options.enablePersistent && chrome.type == "popup")
-        {
-            // TODO: xxxpedro persist - revise chrome synchronization when in persistent mode
-            var frame = FirebugChrome.chromeMap.frame;
-            if (frame)
-                frame.close();
-
-            //chrome.reattach(frame, chrome);
-            //TODO: xxxpedro persist synchronize?
-            chrome.initialize();
-        }
-    },
-
-    clone: function(FBChrome)
-    {
-        for (var name in FBChrome)
-        {
-            var prop = FBChrome[name];
-            if (FBChrome.hasOwnProperty(name) && !isFunction(prop))
-            {
-                this[name] = prop;
-            }
-        }
-    }
-};
-
-
-
-// ************************************************************************************************
-// Chrome Window Creation
-
-var createChromeWindow = function(options)
-{
-    options = extend(WindowDefaultOptions, options || {});
-
-    //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Locals
-
-    var browserWin = Env.browser.window;
-    var browserContext = new Context(browserWin);
-    var prefs = Store.get("FirebugLite");
-    var persistedState = prefs && prefs.persistedState || defaultPersistedState;
-
-    var chrome = {},
-
-        context = options.context || Env.browser,
-
-        type = chrome.type = Env.Options.enablePersistent ?
-                "popup" :
-                options.type,
-
-        isChromeFrame = type == "frame",
-
-        useLocalSkin = Env.useLocalSkin,
-
-        url = useLocalSkin ?
-                Env.Location.skin :
-                "about:blank",
-
-        // document.body not available in XML+XSL documents in Firefox
-        body = context.document.getElementsByTagName("body")[0],
-
-        formatNode = function(node)
-        {
-            if (!Env.isDebugMode)
-            {
-                node.firebugIgnore = true;
-            }
-
-            var browserWinSize = browserContext.getWindowSize();
-            var height = persistedState.height || 300;
-
-            height = Math.min(browserWinSize.height, height);
-            height = Math.max(200, height);
-
-            node.style.border = "0";
-            node.style.visibility = "hidden";
-            node.style.zIndex = "2147483647"; // MAX z-index = 2147483647
-            node.style.position = noFixedPosition ? "absolute" : "fixed";
-            node.style.width = "100%"; // "102%"; IE auto margin bug
-            node.style.left = "0";
-            node.style.bottom = noFixedPosition ? "-1px" : "0";
-            node.style.height = height + "px";
-
-            // avoid flickering during chrome rendering
-            //if (isFirefox)
-            //    node.style.display = "none";
-        },
-
-        createChromeDiv = function()
-        {
-            //Firebug.Console.warn("Firebug Lite GUI is working in 'windowless mode'. It may behave slower and receive interferences from the page in which it is installed.");
-
-            var node = chrome.node = createGlobalElement("div"),
-                style = createGlobalElement("style"),
-
-                css = FirebugChrome.Skin.CSS
-                        /*
-                        .replace(/;/g, " !important;")
-                        .replace(/!important\s!important/g, "!important")
-                        .replace(/display\s*:\s*(\w+)\s*!important;/g, "display:$1;")*/,
-
-                        // reset some styles to minimize interference from the main page's style
-                rules = ".fbBody *{margin:0;padding:0;font-size:11px;line-height:13px;color:inherit;}" +
-                        // load the chrome styles
-                        css +
-                        // adjust some remaining styles
-                        ".fbBody #fbHSplitter{position:absolute !important;} .fbBody #fbHTML span{line-height:14px;} .fbBody .lineNo div{line-height:inherit !important;}";
-            /*
-            if (isIE)
-            {
-                // IE7 CSS bug (FbChrome table bigger than its parent div)
-                rules += ".fbBody table.fbChrome{position: static !important;}";
-            }/**/
-
-            style.type = "text/css";
-
-            if (style.styleSheet)
-                style.styleSheet.cssText = rules;
-            else
-                style.appendChild(context.document.createTextNode(rules));
-
-            document.getElementsByTagName("head")[0].appendChild(style);
-
-            node.className = "fbBody";
-            node.style.overflow = "hidden";
-            node.innerHTML = getChromeDivTemplate();
-
-            if (isIE)
-            {
-                // IE7 CSS bug (FbChrome table bigger than its parent div)
-                setTimeout(function(){
-                node.firstChild.style.height = "1px";
-                node.firstChild.style.position = "static";
-                },0);
-                /**/
-            }
-
-            formatNode(node);
-
-            body.appendChild(node);
-
-            chrome.window = window;
-            chrome.document = document;
-            onChromeLoad(chrome);
-        };
-
-    //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    try
-    {
-        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // create the Chrome as a "div" (windowless mode)
-        if (type == "div")
-        {
-            createChromeDiv();
-            return;
-        }
-
-        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // cretate the Chrome as an "iframe"
-        else if (isChromeFrame)
-        {
-            // Create the Chrome Frame
-            var node = chrome.node = createGlobalElement("iframe");
-            node.setAttribute("src", url);
-            node.setAttribute("frameBorder", "0");
-
-            formatNode(node);
-
-            body.appendChild(node);
-
-            // must set the id after appending to the document, otherwise will cause an
-            // strange error in IE, making the iframe load the page in which the bookmarklet
-            // was created (like getfirebug.com), before loading the injected UI HTML,
-            // generating an "Access Denied" error.
-            node.id = options.id;
-        }
-
-        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // create the Chrome as a "popup"
-        else
-        {
-            var height = persistedState.popupHeight || 300;
-            var browserWinSize = browserContext.getWindowSize();
-
-            var browserWinLeft = typeof browserWin.screenX == "number" ?
-                    browserWin.screenX : browserWin.screenLeft;
-
-            var popupLeft = typeof persistedState.popupLeft == "number" ?
-                    persistedState.popupLeft : browserWinLeft;
-
-            var browserWinTop = typeof browserWin.screenY == "number" ?
-                    browserWin.screenY : browserWin.screenTop;
-
-            var popupTop = typeof persistedState.popupTop == "number" ?
-                    persistedState.popupTop :
-                    Math.max(
-                            0,
-                            Math.min(
-                                    browserWinTop + browserWinSize.height - height,
-                                    // Google Chrome bug
-                                    screen.availHeight - height - 61
-                                )
-                            );
-
-            var popupWidth = typeof persistedState.popupWidth == "number" ?
-                    persistedState.popupWidth :
-                    Math.max(
-                            0,
-                            Math.min(
-                                    browserWinSize.width,
-                                    // Opera opens popup in a new tab if it's too big!
-                                    screen.availWidth-10
-                                )
-                            );
-
-            var popupHeight = typeof persistedState.popupHeight == "number" ?
-                    persistedState.popupHeight : 300;
-
-            var options = [
-                    "true,top=", popupTop,
-                    ",left=", popupLeft,
-                    ",height=", popupHeight,
-                    ",width=", popupWidth,
-                    ",resizable"
-                ].join(""),
-
-                node = chrome.node = context.window.open(
-                    url,
-                    "popup",
-                    options
-                );
-
-            if (node)
-            {
-                try
-                {
-                    node.focus();
-                }
-                catch(E)
-                {
-                    alert("Firebug Error: Firebug popup was blocked.");
-                    return;
-                }
-            }
-            else
-            {
-                alert("Firebug Error: Firebug popup was blocked.");
-                return;
-            }
-        }
-
-        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // Inject the interface HTML if it is not using the local skin
-
-        if (!useLocalSkin)
-        {
-            var tpl = getChromeTemplate(!isChromeFrame),
-                doc = isChromeFrame ? node.contentWindow.document : node.document;
-
-            doc.write(tpl);
-            doc.close();
-        }
-
-        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // Wait the Window to be loaded
-
-        var win,
-
-            waitDelay = useLocalSkin ? isChromeFrame ? 200 : 300 : 100,
-
-            waitForWindow = function()
-            {
-                if ( // Frame loaded... OR
-                     isChromeFrame && (win=node.contentWindow) &&
-                     node.contentWindow.document.getElementById("fbCommandLine") ||
-
-                     // Popup loaded
-                     !isChromeFrame && (win=node.window) && node.document &&
-                     node.document.getElementById("fbCommandLine") )
-                {
-                    chrome.window = win.window;
-                    chrome.document = win.document;
-
-                    // Prevent getting the wrong chrome height in FF when opening a popup
-                    setTimeout(function(){
-                        onChromeLoad(chrome);
-                    }, useLocalSkin ? 200 : 0);
-                }
-                else
-                    setTimeout(waitForWindow, waitDelay);
-            };
-
-        waitForWindow();
-    }
-    catch(e)
-    {
-        var msg = e.message || e;
-
-        if (/access/i.test(msg))
-        {
-            // Firebug Lite could not create a window for its Graphical User Interface due to
-            // a access restriction. This happens in some pages, when loading via bookmarklet.
-            // In such cases, the only way is to load the GUI in a "windowless mode".
-
-            if (isChromeFrame)
-                body.removeChild(node);
-            else if(type == "popup")
-                node.close();
-
-            // Load the GUI in a "windowless mode"
-            createChromeDiv();
-        }
-        else
-        {
-            alert("Firebug Error: Firebug GUI could not be created.");
-        }
-    }
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var onChromeLoad = function onChromeLoad(chrome)
-{
-    Env.chrome = chrome;
-
-    if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("Chrome onChromeLoad", "chrome window loaded");
-
-    if (Env.Options.enablePersistent)
-    {
-        // TODO: xxxpedro persist - make better chrome synchronization when in persistent mode
-        Env.FirebugChrome = FirebugChrome;
-
-        chrome.window.Firebug = chrome.window.Firebug || {};
-        chrome.window.Firebug.SharedEnv = Env;
-
-        if (Env.isDevelopmentMode)
-        {
-            Env.browser.window.FBDev.loadChromeApplication(chrome);
-        }
-        else
-        {
-            var doc = chrome.document;
-            var script = doc.createElement("script");
-            script.src = Env.Location.app + "#remote,persist";
-            doc.getElementsByTagName("head")[0].appendChild(script);
-        }
-    }
-    else
-    {
-        if (chrome.type == "frame" || chrome.type == "div")
-        {
-            // initialize the chrome application
-            setTimeout(function(){
-                FBL.Firebug.initialize();
-            },0);
-        }
-        else if (chrome.type == "popup")
-        {
-            var oldChrome = FirebugChrome.chromeMap.frame;
-
-            var newChrome = new Chrome(chrome);
-
-            // TODO: xxxpedro sync detach reattach attach
-            dispatch(newChrome.panelMap, "detach", [oldChrome, newChrome]);
-
-            newChrome.reattach(oldChrome, newChrome);
-        }
-    }
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var getChromeDivTemplate = function()
-{
-    return FirebugChrome.Skin.HTML;
-};
-
-var getChromeTemplate = function(isPopup)
-{
-    var tpl = FirebugChrome.Skin;
-    var r = [], i = -1;
-
-    r[++i] = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">';
-    r[++i] = '<html><head><title>';
-    r[++i] = Firebug.version;
-
-    /*
-    r[++i] = '</title><link href="';
-    r[++i] = Env.Location.skinDir + 'firebug.css';
-    r[++i] = '" rel="stylesheet" type="text/css" />';
-    /**/
-
-    r[++i] = '</title><style>html,body{margin:0;padding:0;overflow:hidden;}';
-    r[++i] = tpl.CSS;
-    r[++i] = '</style>';
-    /**/
-
-    r[++i] = '</head><body class="fbBody' + (isPopup ? ' FirebugPopup' : '') + '">';
-    r[++i] = tpl.HTML;
-    r[++i] = '</body></html>';
-
-    return r.join("");
-};
-
-
-// ************************************************************************************************
-// Chrome Class
-
-/**@class*/
-var Chrome = function Chrome(chrome)
-{
-    var type = chrome.type;
-    var Base = type == "frame" || type == "div" ? ChromeFrameBase : ChromePopupBase;
-
-    append(this, Base);   // inherit from base class (ChromeFrameBase or ChromePopupBase)
-    append(this, chrome); // inherit chrome window properties
-    append(this, new Context(chrome.window)); // inherit from Context class
-
-    FirebugChrome.chromeMap[type] = this;
-    Firebug.chrome = this;
-    Env.chrome = chrome.window;
-
-    this.commandLineVisible = false;
-    this.sidePanelVisible = false;
-
-    this.create();
-
-    return this;
-};
-
-// ************************************************************************************************
-// ChromeBase
-
-/**
- * @namespace
- * @extends FBL.Controller
- * @extends FBL.PanelBar
- **/
-var ChromeBase = {};
-append(ChromeBase, Controller);
-append(ChromeBase, PanelBar);
-append(ChromeBase,
-/**@extend ns-chrome-ChromeBase*/
-{
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // inherited properties
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // inherited from createChrome function
-
-    node: null,
-    type: null,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // inherited from Context.prototype
-
-    document: null,
-    window: null,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // value properties
-
-    sidePanelVisible: false,
-    commandLineVisible: false,
-    largeCommandLineVisible: false,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // object properties
-
-    inspectButton: null,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    create: function()
-    {
-        PanelBar.create.call(this);
-
-        if (Firebug.Inspector)
-            this.inspectButton = new Button({
-                type: "toggle",
-                element: $("fbChrome_btInspect"),
-                owner: Firebug.Inspector,
-
-                onPress: Firebug.Inspector.startInspecting,
-                onUnpress: Firebug.Inspector.stopInspecting
-            });
-    },
-
-    destroy: function()
-    {
-        if(Firebug.Inspector)
-            this.inspectButton.destroy();
-
-        PanelBar.destroy.call(this);
-
-        this.shutdown();
-    },
-
-    testMenu: function()
-    {
-        var firebugMenu = new Menu(
-        {
-            id: "fbFirebugMenu",
-
-            items:
-            [
-                {
-                    label: "Open Firebug",
-                    type: "shortcut",
-                    key: isFirefox ? "Shift+F12" : "F12",
-                    checked: true,
-                    command: "toggleChrome"
-                },
-                {
-                    label: "Open Firebug in New Window",
-                    type: "shortcut",
-                    key: isFirefox ? "Ctrl+Shift+F12" : "Ctrl+F12",
-                    command: "openPopup"
-                },
-                {
-                    label: "Inspect Element",
-                    type: "shortcut",
-                    key: "Ctrl+Shift+C",
-                    command: "toggleInspect"
-                },
-                {
-                    label: "Command Line",
-                    type: "shortcut",
-                    key: "Ctrl+Shift+L",
-                    command: "focusCommandLine"
-                },
-                "-",
-                {
-                    label: "Options",
-                    type: "group",
-                    child: "fbFirebugOptionsMenu"
-                },
-                "-",
-                {
-                    label: "Firebug Lite Website...",
-                    command: "visitWebsite"
-                },
-                {
-                    label: "Discussion Group...",
-                    command: "visitDiscussionGroup"
-                },
-                {
-                    label: "Issue Tracker...",
-                    command: "visitIssueTracker"
-                }
-            ],
-
-            onHide: function()
-            {
-                iconButton.restore();
-            },
-
-            toggleChrome: function()
-            {
-                Firebug.chrome.toggle();
-            },
-
-            openPopup: function()
-            {
-                Firebug.chrome.toggle(true, true);
-            },
-
-            toggleInspect: function()
-            {
-                Firebug.Inspector.toggleInspect();
-            },
-
-            focusCommandLine: function()
-            {
-                Firebug.chrome.focusCommandLine();
-            },
-
-            visitWebsite: function()
-            {
-                this.visit("http://getfirebug.com/lite.html");
-            },
-
-            visitDiscussionGroup: function()
-            {
-                this.visit("http://groups.google.com/group/firebug");
-            },
-
-            visitIssueTracker: function()
-            {
-                this.visit("http://code.google.com/p/fbug/issues/list");
-            },
-
-            visit: function(url)
-            {
-                window.open(url);
-            }
-
-        });
-
-        /**@private*/
-        var firebugOptionsMenu =
-        {
-            id: "fbFirebugOptionsMenu",
-
-            getItems: function()
-            {
-                var cookiesDisabled = !Firebug.saveCookies;
-
-                return [
-                    {
-                        label: "Start Opened",
-                        type: "checkbox",
-                        value: "startOpened",
-                        checked: Firebug.startOpened,
-                        disabled: cookiesDisabled
-                    },
-                    {
-                        label: "Start in New Window",
-                        type: "checkbox",
-                        value: "startInNewWindow",
-                        checked: Firebug.startInNewWindow,
-                        disabled: cookiesDisabled
-                    },
-                    {
-                        label: "Show Icon When Hidden",
-                        type: "checkbox",
-                        value: "showIconWhenHidden",
-                        checked: Firebug.showIconWhenHidden,
-                        disabled: cookiesDisabled
-                    },
-                    {
-                        label: "Override Console Object",
-                        type: "checkbox",
-                        value: "overrideConsole",
-                        checked: Firebug.overrideConsole,
-                        disabled: cookiesDisabled
-                    },
-                    {
-                        label: "Ignore Firebug Elements",
-                        type: "checkbox",
-                        value: "ignoreFirebugElements",
-                        checked: Firebug.ignoreFirebugElements,
-                        disabled: cookiesDisabled
-                    },
-                    {
-                        label: "Disable When Firebug Active",
-                        type: "checkbox",
-                        value: "disableWhenFirebugActive",
-                        checked: Firebug.disableWhenFirebugActive,
-                        disabled: cookiesDisabled
-                    },
-                    {
-                        label: "Disable XHR Listener",
-                        type: "checkbox",
-                        value: "disableXHRListener",
-                        checked: Firebug.disableXHRListener,
-                        disabled: cookiesDisabled
-                    },
-                    {
-                        label: "Disable Resource Fetching",
-                        type: "checkbox",
-                        value: "disableResourceFetching",
-                        checked: Firebug.disableResourceFetching,
-                        disabled: cookiesDisabled
-                    },
-                    {
-                        label: "Enable Trace Mode",
-                        type: "checkbox",
-                        value: "enableTrace",
-                        checked: Firebug.enableTrace,
-                        disabled: cookiesDisabled
-                    },
-                    {
-                        label: "Enable Persistent Mode (experimental)",
-                        type: "checkbox",
-                        value: "enablePersistent",
-                        checked: Firebug.enablePersistent,
-                        disabled: cookiesDisabled
-                    },
-                    "-",
-                    {
-                        label: "Reset All Firebug Options",
-                        command: "restorePrefs",
-                        disabled: cookiesDisabled
-                    }
-                ];
-            },
-
-            onCheck: function(target, value, checked)
-            {
-                Firebug.setPref(value, checked);
-            },
-
-            restorePrefs: function(target)
-            {
-                Firebug.erasePrefs();
-
-                if (target)
-                    this.updateMenu(target);
-            },
-
-            updateMenu: function(target)
-            {
-                var options = getElementsByClass(target.parentNode, "fbMenuOption");
-
-                var firstOption = options[0];
-                var enabled = Firebug.saveCookies;
-                if (enabled)
-                    Menu.check(firstOption);
-                else
-                    Menu.uncheck(firstOption);
-
-                if (enabled)
-                    Menu.check(options[0]);
-                else
-                    Menu.uncheck(options[0]);
-
-                for (var i = 1, length = options.length; i < length; i++)
-                {
-                    var option = options[i];
-
-                    var value = option.getAttribute("value");
-                    var pref = Firebug[value];
-
-                    if (pref)
-                        Menu.check(option);
-                    else
-                        Menu.uncheck(option);
-
-                    if (enabled)
-                        Menu.enable(option);
-                    else
-                        Menu.disable(option);
-                }
-            }
-        };
-
-        Menu.register(firebugOptionsMenu);
-
-        var menu = firebugMenu;
-
-        var testMenuClick = function(event)
-        {
-            //console.log("testMenuClick");
-            cancelEvent(event, true);
-
-            var target = event.target || event.srcElement;
-
-            if (menu.isVisible)
-                menu.hide();
-            else
-            {
-                var offsetLeft = isIE6 ? 1 : -4,  // IE6 problem with fixed position
-
-                    chrome = Firebug.chrome,
-
-                    box = chrome.getElementBox(target),
-
-                    offset = chrome.type == "div" ?
-                            chrome.getElementPosition(chrome.node) :
-                            {top: 0, left: 0};
-
-                menu.show(
-                            box.left + offsetLeft - offset.left,
-                            box.top + box.height -5 - offset.top
-                        );
-            }
-
-            return false;
-        };
-
-        var iconButton = new IconButton({
-            type: "toggle",
-            element: $("fbFirebugButton"),
-
-            onClick: testMenuClick
-        });
-
-        iconButton.initialize();
-
-        //addEvent($("fbToolbarIcon"), "click", testMenuClick);
-    },
-
-    initialize: function()
-    {
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        if (Env.bookmarkletOutdated)
-            Firebug.Console.logFormatted([
-                  "A new bookmarklet version is available. " +
-                  "Please visit http://getfirebug.com/firebuglite#Install and update it."
-                ], Firebug.context, "warn");
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        if (Firebug.Console)
-            Firebug.Console.flush();
-
-        if (Firebug.Trace)
-            FBTrace.flush(Firebug.Trace);
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("Firebug.chrome.initialize", "initializing chrome application");
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // initialize inherited classes
-        Controller.initialize.call(this);
-        PanelBar.initialize.call(this);
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // create the interface elements cache
-
-        fbTop = $("fbTop");
-        fbContent = $("fbContent");
-        fbContentStyle = fbContent.style;
-        fbBottom = $("fbBottom");
-        fbBtnInspect = $("fbBtnInspect");
-
-        fbToolbar = $("fbToolbar");
-
-        fbPanelBox1 = $("fbPanelBox1");
-        fbPanelBox1Style = fbPanelBox1.style;
-        fbPanelBox2 = $("fbPanelBox2");
-        fbPanelBox2Style = fbPanelBox2.style;
-        fbPanelBar2Box = $("fbPanelBar2Box");
-        fbPanelBar2BoxStyle = fbPanelBar2Box.style;
-
-        fbHSplitter = $("fbHSplitter");
-        fbVSplitter = $("fbVSplitter");
-        fbVSplitterStyle = fbVSplitter.style;
-
-        fbPanel1 = $("fbPanel1");
-        fbPanel1Style = fbPanel1.style;
-        fbPanel2 = $("fbPanel2");
-        fbPanel2Style = fbPanel2.style;
-
-        fbConsole = $("fbConsole");
-        fbConsoleStyle = fbConsole.style;
-        fbHTML = $("fbHTML");
-
-        fbCommandLine = $("fbCommandLine");
-        fbLargeCommandLine = $("fbLargeCommandLine");
-        fbLargeCommandButtons = $("fbLargeCommandButtons");
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // static values cache
-        topHeight = fbTop.offsetHeight;
-        topPartialHeight = fbToolbar.offsetHeight;
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-        disableTextSelection($("fbToolbar"));
-        disableTextSelection($("fbPanelBarBox"));
-        disableTextSelection($("fbPanelBar1"));
-        disableTextSelection($("fbPanelBar2"));
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // Add the "javascript:void(0)" href attributes used to make the hover effect in IE6
-        if (isIE6 && Firebug.Selector)
-        {
-            // TODO: xxxpedro change to getElementsByClass
-            var as = $$(".fbHover");
-            for (var i=0, a; a=as[i]; i++)
-            {
-                a.setAttribute("href", "javascript:void(0)");
-            }
-        }
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // initialize all panels
-        /*
-        var panelMap = Firebug.panelTypes;
-        for (var i=0, p; p=panelMap[i]; i++)
-        {
-            if (!p.parentPanel)
-            {
-                this.addPanel(p.prototype.name);
-            }
-        }
-        /**/
-
-        // ************************************************************************************************
-        // ************************************************************************************************
-        // ************************************************************************************************
-        // ************************************************************************************************
-
-        if(Firebug.Inspector)
-            this.inspectButton.initialize();
-
-        // ************************************************************************************************
-        // ************************************************************************************************
-        // ************************************************************************************************
-        // ************************************************************************************************
-
-        this.addController(
-            [$("fbLargeCommandLineIcon"), "click", this.showLargeCommandLine]
-        );
-
-        // ************************************************************************************************
-
-        // Select the first registered panel
-        // TODO: BUG IE7
-        var self = this;
-        setTimeout(function(){
-            self.selectPanel(Firebug.context.persistedState.selectedPanelName);
-
-            if (Firebug.context.persistedState.selectedPanelName == "Console" && Firebug.CommandLine)
-                Firebug.chrome.focusCommandLine();
-        },0);
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        //this.draw();
-
-
-
-
-
-
-
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-        var onPanelMouseDown = function onPanelMouseDown(event)
-        {
-            //console.log("onPanelMouseDown", event.target || event.srcElement, event);
-
-            var target = event.target || event.srcElement;
-
-            if (FBL.isLeftClick(event))
-            {
-                var editable = FBL.getAncestorByClass(target, "editable");
-
-                // if an editable element has been clicked then start editing
-                if (editable)
-                {
-                    Firebug.Editor.startEditing(editable);
-                    FBL.cancelEvent(event);
-                }
-                // if any other element has been clicked then stop editing
-                else
-                {
-                    if (!hasClass(target, "textEditorInner"))
-                        Firebug.Editor.stopEditing();
-                }
-            }
-            else if (FBL.isMiddleClick(event) && Firebug.getRepNode(target))
-            {
-                // Prevent auto-scroll when middle-clicking a rep object
-                FBL.cancelEvent(event);
-            }
-        };
-
-        Firebug.getElementPanel = function(element)
-        {
-            var panelNode = getAncestorByClass(element, "fbPanel");
-            var id = panelNode.id.substr(2);
-
-            var panel = Firebug.chrome.panelMap[id];
-
-            if (!panel)
-            {
-                if (Firebug.chrome.selectedPanel.sidePanelBar)
-                    panel = Firebug.chrome.selectedPanel.sidePanelBar.panelMap[id];
-            }
-
-            return panel;
-        };
-
-
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-        // TODO: xxxpedro port to Firebug
-
-        // Improved window key code event listener. Only one "keydown" event will be attached
-        // to the window, and the onKeyCodeListen() function will delegate which listeners
-        // should be called according to the event.keyCode fired.
-        var onKeyCodeListenersMap = [];
-        var onKeyCodeListen = function(event)
-        {
-            for (var keyCode in onKeyCodeListenersMap)
-            {
-                var listeners = onKeyCodeListenersMap[keyCode];
-
-                for (var i = 0, listener; listener = listeners[i]; i++)
-                {
-                    var filter = listener.filter || FBL.noKeyModifiers;
-
-                    if (event.keyCode == keyCode && (!filter || filter(event)))
-                    {
-                        listener.listener();
-                        FBL.cancelEvent(event, true);
-                        return false;
-                    }
-                }
-            }
-        };
-
-        addEvent(Firebug.chrome.document, "keydown", onKeyCodeListen);
-
-        /**
-         * @name keyCodeListen
-         * @memberOf FBL.FirebugChrome
-         */
-        Firebug.chrome.keyCodeListen = function(key, filter, listener, capture)
-        {
-            var keyCode = KeyEvent["DOM_VK_"+key];
-
-            if (!onKeyCodeListenersMap[keyCode])
-                onKeyCodeListenersMap[keyCode] = [];
-
-            onKeyCodeListenersMap[keyCode].push({
-                filter: filter,
-                listener: listener
-            });
-
-            return keyCode;
-        };
-
-        /**
-         * @name keyIgnore
-         * @memberOf FBL.FirebugChrome
-         */
-        Firebug.chrome.keyIgnore = function(keyCode)
-        {
-            onKeyCodeListenersMap[keyCode] = null;
-            delete onKeyCodeListenersMap[keyCode];
-        };
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-        /**/
-        // move to shutdown
-        //removeEvent(Firebug.chrome.document, "keydown", listener[0]);
-
-
-        /*
-        Firebug.chrome.keyCodeListen = function(key, filter, listener, capture)
-        {
-            if (!filter)
-                filter = FBL.noKeyModifiers;
-
-            var keyCode = KeyEvent["DOM_VK_"+key];
-
-            var fn = function fn(event)
-            {
-                if (event.keyCode == keyCode && (!filter || filter(event)))
-                {
-                    listener();
-                    FBL.cancelEvent(event, true);
-                    return false;
-                }
-            }
-
-            addEvent(Firebug.chrome.document, "keydown", fn);
-
-            return [fn, capture];
-        };
-
-        Firebug.chrome.keyIgnore = function(listener)
-        {
-            removeEvent(Firebug.chrome.document, "keydown", listener[0]);
-        };
-        /**/
-
-
-        this.addController(
-                [fbPanel1, "mousedown", onPanelMouseDown],
-                [fbPanel2, "mousedown", onPanelMouseDown]
-             );
-/**/
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-
-        // menus can be used without domplate
-        if (FBL.domplate)
-            this.testMenu();
-        /**/
-
-        //test XHR
-        /*
-        setTimeout(function(){
-
-        FBL.Ajax.request({url: "../content/firebug/boot.js"});
-        FBL.Ajax.request({url: "../content/firebug/boot.js.invalid"});
-
-        },1000);
-        /**/
-    },
-
-    shutdown: function()
-    {
-        // ************************************************************************************************
-        // ************************************************************************************************
-        // ************************************************************************************************
-        // ************************************************************************************************
-
-        if(Firebug.Inspector)
-            this.inspectButton.shutdown();
-
-        // ************************************************************************************************
-        // ************************************************************************************************
-        // ************************************************************************************************
-        // ************************************************************************************************
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-        // remove disableTextSelection event handlers
-        restoreTextSelection($("fbToolbar"));
-        restoreTextSelection($("fbPanelBarBox"));
-        restoreTextSelection($("fbPanelBar1"));
-        restoreTextSelection($("fbPanelBar2"));
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // shutdown inherited classes
-        Controller.shutdown.call(this);
-        PanelBar.shutdown.call(this);
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // Remove the interface elements cache (this must happen after calling
-        // the shutdown method of all dependent components to avoid errors)
-
-        fbTop = null;
-        fbContent = null;
-        fbContentStyle = null;
-        fbBottom = null;
-        fbBtnInspect = null;
-
-        fbToolbar = null;
-
-        fbPanelBox1 = null;
-        fbPanelBox1Style = null;
-        fbPanelBox2 = null;
-        fbPanelBox2Style = null;
-        fbPanelBar2Box = null;
-        fbPanelBar2BoxStyle = null;
-
-        fbHSplitter = null;
-        fbVSplitter = null;
-        fbVSplitterStyle = null;
-
-        fbPanel1 = null;
-        fbPanel1Style = null;
-        fbPanel2 = null;
-
-        fbConsole = null;
-        fbConsoleStyle = null;
-        fbHTML = null;
-
-        fbCommandLine = null;
-        fbLargeCommandLine = null;
-        fbLargeCommandButtons = null;
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // static values cache
-
-        topHeight = null;
-        topPartialHeight = null;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    toggle: function(forceOpen, popup)
-    {
-        if(popup)
-        {
-            this.detach();
-        }
-        else
-        {
-            if (isOpera && Firebug.chrome.type == "popup" && Firebug.chrome.node.closed)
-            {
-                var frame = FirebugChrome.chromeMap.frame;
-                frame.reattach();
-
-                FirebugChrome.chromeMap.popup = null;
-
-                frame.open();
-
-                return;
-            }
-
-            // If the context is a popup, ignores the toggle process
-            if (Firebug.chrome.type == "popup") return;
-
-            var shouldOpen = forceOpen || !Firebug.context.persistedState.isOpen;
-
-            if(shouldOpen)
-               this.open();
-            else
-               this.close();
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    detach: function()
-    {
-        if(!FirebugChrome.chromeMap.popup)
-        {
-            this.close();
-            createChromeWindow({type: "popup"});
-        }
-    },
-
-    reattach: function(oldChrome, newChrome)
-    {
-        Firebug.browser.window.Firebug = Firebug;
-
-        // chrome synchronization
-        var newPanelMap = newChrome.panelMap;
-        var oldPanelMap = oldChrome.panelMap;
-
-        var panel;
-        for(var name in newPanelMap)
-        {
-            // TODO: xxxpedro innerHTML
-            panel = newPanelMap[name];
-            if (panel.options.innerHTMLSync)
-                panel.panelNode.innerHTML = oldPanelMap[name].panelNode.innerHTML;
-        }
-
-        Firebug.chrome = newChrome;
-
-        // TODO: xxxpedro sync detach reattach attach
-        //dispatch(Firebug.chrome.panelMap, "detach", [oldChrome, newChrome]);
-
-        if (newChrome.type == "popup")
-        {
-            newChrome.initialize();
-            //dispatch(Firebug.modules, "initialize", []);
-        }
-        else
-        {
-            // TODO: xxxpedro only needed in persistent
-            // should use FirebugChrome.clone, but popup FBChrome
-            // isn't acessible
-            Firebug.context.persistedState.selectedPanelName = oldChrome.selectedPanel.name;
-        }
-
-        dispatch(newPanelMap, "reattach", [oldChrome, newChrome]);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    draw: function()
-    {
-        var size = this.getSize();
-
-        // Height related values
-        var commandLineHeight = Firebug.chrome.commandLineVisible ? fbCommandLine.offsetHeight : 0,
-
-            y = Math.max(size.height /* chrome height */, topHeight),
-
-            heightValue = Math.max(y - topHeight - commandLineHeight /* fixed height */, 0),
-
-            height = heightValue + "px",
-
-            // Width related values
-            sideWidthValue = Firebug.chrome.sidePanelVisible ? Firebug.context.persistedState.sidePanelWidth : 0,
-
-            width = Math.max(size.width /* chrome width */ - sideWidthValue, 0) + "px";
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // Height related rendering
-        fbPanelBox1Style.height = height;
-        fbPanel1Style.height = height;
-
-        if (isIE || isOpera)
-        {
-            // Fix IE and Opera problems with auto resizing the verticall splitter
-            fbVSplitterStyle.height = Math.max(y - topPartialHeight - commandLineHeight, 0) + "px";
-        }
-        //xxxpedro FF2 only?
-        /*
-        else if (isFirefox)
-        {
-            // Fix Firefox problem with table rows with 100% height (fit height)
-            fbContentStyle.maxHeight = Math.max(y - fixedHeight, 0)+ "px";
-        }/**/
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // Width related rendering
-        fbPanelBox1Style.width = width;
-        fbPanel1Style.width = width;
-
-        // SidePanel rendering
-        if (Firebug.chrome.sidePanelVisible)
-        {
-            sideWidthValue = Math.max(sideWidthValue - 6, 0);
-
-            var sideWidth = sideWidthValue + "px";
-
-            fbPanelBox2Style.width = sideWidth;
-
-            fbVSplitterStyle.right = sideWidth;
-
-            if (Firebug.chrome.largeCommandLineVisible)
-            {
-                fbLargeCommandLine = $("fbLargeCommandLine");
-
-                fbLargeCommandLine.style.height = heightValue - 4 + "px";
-                fbLargeCommandLine.style.width = sideWidthValue - 2 + "px";
-
-                fbLargeCommandButtons = $("fbLargeCommandButtons");
-                fbLargeCommandButtons.style.width = sideWidth;
-            }
-            else
-            {
-                fbPanel2Style.height = height;
-                fbPanel2Style.width = sideWidth;
-
-                fbPanelBar2BoxStyle.width = sideWidth;
-            }
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    getSize: function()
-    {
-        return this.type == "div" ?
-            {
-                height: this.node.offsetHeight,
-                width: this.node.offsetWidth
-            }
-            :
-            this.getWindowSize();
-    },
-
-    resize: function()
-    {
-        var self = this;
-
-        // avoid partial resize when maximizing window
-        setTimeout(function(){
-            self.draw();
-
-            if (noFixedPosition && (self.type == "frame" || self.type == "div"))
-                self.fixIEPosition();
-        }, 0);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    layout: function(panel)
-    {
-        if (FBTrace.DBG_CHROME) FBTrace.sysout("Chrome.layout", "");
-
-        var options = panel.options;
-
-        changeCommandLineVisibility(options.hasCommandLine);
-        changeSidePanelVisibility(panel.hasSidePanel);
-
-        Firebug.chrome.draw();
-    },
-
-    showLargeCommandLine: function(hideToggleIcon)
-    {
-        var chrome = Firebug.chrome;
-
-        if (!chrome.largeCommandLineVisible)
-        {
-            chrome.largeCommandLineVisible = true;
-
-            if (chrome.selectedPanel.options.hasCommandLine)
-            {
-                if (Firebug.CommandLine)
-                    Firebug.CommandLine.blur();
-
-                changeCommandLineVisibility(false);
-            }
-
-            changeSidePanelVisibility(true);
-
-            fbLargeCommandLine.style.display = "block";
-            fbLargeCommandButtons.style.display = "block";
-
-            fbPanel2Style.display = "none";
-            fbPanelBar2BoxStyle.display = "none";
-
-            chrome.draw();
-
-            fbLargeCommandLine.focus();
-
-            if (Firebug.CommandLine)
-                Firebug.CommandLine.setMultiLine(true);
-        }
-    },
-
-    hideLargeCommandLine: function()
-    {
-        if (Firebug.chrome.largeCommandLineVisible)
-        {
-            Firebug.chrome.largeCommandLineVisible = false;
-
-            if (Firebug.CommandLine)
-                Firebug.CommandLine.setMultiLine(false);
-
-            fbLargeCommandLine.blur();
-
-            fbPanel2Style.display = "block";
-            fbPanelBar2BoxStyle.display = "block";
-
-            fbLargeCommandLine.style.display = "none";
-            fbLargeCommandButtons.style.display = "none";
-
-            changeSidePanelVisibility(false);
-
-            if (Firebug.chrome.selectedPanel.options.hasCommandLine)
-                changeCommandLineVisibility(true);
-
-            Firebug.chrome.draw();
-
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    focusCommandLine: function()
-    {
-        var selectedPanelName = this.selectedPanel.name, panelToSelect;
-
-        if (focusCommandLineState == 0 || selectedPanelName != "Console")
-        {
-            focusCommandLineState = 0;
-            lastFocusedPanelName = selectedPanelName;
-
-            panelToSelect = "Console";
-        }
-        if (focusCommandLineState == 1)
-        {
-            panelToSelect = lastFocusedPanelName;
-        }
-
-        this.selectPanel(panelToSelect);
-
-        try
-        {
-            if (Firebug.CommandLine)
-            {
-                if (panelToSelect == "Console")
-                    Firebug.CommandLine.focus();
-                else
-                    Firebug.CommandLine.blur();
-            }
-        }
-        catch(e)
-        {
-            //TODO: xxxpedro trace error
-        }
-
-        focusCommandLineState = ++focusCommandLineState % 2;
-    }
-
-});
-
-// ************************************************************************************************
-// ChromeFrameBase
-
-/**
- * @namespace
- * @extends ns-chrome-ChromeBase
- */
-var ChromeFrameBase = extend(ChromeBase,
-/**@extend ns-chrome-ChromeFrameBase*/
-{
-    create: function()
-    {
-        ChromeBase.create.call(this);
-
-        // restore display for the anti-flicker trick
-        if (isFirefox)
-            this.node.style.display = "block";
-
-        if (Env.Options.startInNewWindow)
-        {
-            this.close();
-            this.toggle(true, true);
-            return;
-        }
-
-        if (Env.Options.startOpened)
-            this.open();
-        else
-            this.close();
-    },
-
-    destroy: function()
-    {
-        var size = Firebug.chrome.getWindowSize();
-
-        Firebug.context.persistedState.height = size.height;
-
-        if (Firebug.saveCookies)
-            Firebug.savePrefs();
-
-        removeGlobalEvent("keydown", onGlobalKeyDown);
-
-        ChromeBase.destroy.call(this);
-
-        this.document = null;
-        delete this.document;
-
-        this.window = null;
-        delete this.window;
-
-        this.node.parentNode.removeChild(this.node);
-        this.node = null;
-        delete this.node;
-    },
-
-    initialize: function()
-    {
-        //FBTrace.sysout("Frame", "initialize();")
-        ChromeBase.initialize.call(this);
-
-        this.addController(
-            [Firebug.browser.window, "resize", this.resize],
-            [$("fbWindow_btClose"), "click", this.close],
-            [$("fbWindow_btDetach"), "click", this.detach],
-            [$("fbWindow_btDeactivate"), "click", this.deactivate]
-        );
-
-        if (!Env.Options.enablePersistent)
-            this.addController([Firebug.browser.window, "unload", Firebug.shutdown]);
-
-        if (noFixedPosition)
-        {
-            this.addController(
-                [Firebug.browser.window, "scroll", this.fixIEPosition]
-            );
-        }
-
-        fbVSplitter.onmousedown = onVSplitterMouseDown;
-        fbHSplitter.onmousedown = onHSplitterMouseDown;
-
-        this.isInitialized = true;
-    },
-
-    shutdown: function()
-    {
-        fbVSplitter.onmousedown = null;
-        fbHSplitter.onmousedown = null;
-
-        ChromeBase.shutdown.apply(this);
-
-        this.isInitialized = false;
-    },
-
-    reattach: function()
-    {
-        var frame = FirebugChrome.chromeMap.frame;
-
-        ChromeBase.reattach(FirebugChrome.chromeMap.popup, this);
-    },
-
-    open: function()
-    {
-        if (!Firebug.context.persistedState.isOpen)
-        {
-            Firebug.context.persistedState.isOpen = true;
-
-            if (Env.isChromeExtension)
-                localStorage.setItem("Firebug", "1,1");
-
-            var node = this.node;
-
-            node.style.visibility = "hidden"; // Avoid flickering
-
-            if (Firebug.showIconWhenHidden)
-            {
-                if (ChromeMini.isInitialized)
-                {
-                    ChromeMini.shutdown();
-                }
-
-            }
-            else
-                node.style.display = "block";
-
-            var main = $("fbChrome");
-
-            // IE6 throws an error when setting this property! why?
-            //main.style.display = "table";
-            main.style.display = "";
-
-            var self = this;
-                /// TODO: xxxpedro FOUC
-                node.style.visibility = "visible";
-            setTimeout(function(){
-                ///node.style.visibility = "visible";
-
-                //dispatch(Firebug.modules, "initialize", []);
-                self.initialize();
-
-                if (noFixedPosition)
-                    self.fixIEPosition();
-
-                self.draw();
-
-            }, 10);
-        }
-    },
-
-    close: function()
-    {
-        if (Firebug.context.persistedState.isOpen)
-        {
-            if (this.isInitialized)
-            {
-                //dispatch(Firebug.modules, "shutdown", []);
-                this.shutdown();
-            }
-
-            Firebug.context.persistedState.isOpen = false;
-
-            if (Env.isChromeExtension)
-                localStorage.setItem("Firebug", "1,0");
-
-            var node = this.node;
-
-            if (Firebug.showIconWhenHidden)
-            {
-                node.style.visibility = "hidden"; // Avoid flickering
-
-                // TODO: xxxpedro - persist IE fixed?
-                var main = $("fbChrome", FirebugChrome.chromeMap.frame.document);
-                main.style.display = "none";
-
-                ChromeMini.initialize();
-
-                node.style.visibility = "visible";
-            }
-            else
-                node.style.display = "none";
-        }
-    },
-
-    deactivate: function()
-    {
-        // if it is running as a Chrome extension, dispatch a message to the extension signaling
-        // that Firebug should be deactivated for the current tab
-        if (Env.isChromeExtension)
-        {
-            localStorage.removeItem("Firebug");
-            Firebug.GoogleChrome.dispatch("FB_deactivate");
-
-            // xxxpedro problem here regarding Chrome extension. We can't deactivate the whole
-            // app, otherwise it won't be able to be reactivated without reloading the page.
-            // but we need to stop listening global keys, otherwise the key activation won't work.
-            Firebug.chrome.close();
-        }
-        else
-        {
-            Firebug.shutdown();
-        }
-    },
-
-    fixIEPosition: function()
-    {
-        // fix IE problem with offset when not in fullscreen mode
-        var doc = this.document;
-        var offset = isIE ? doc.body.clientTop || doc.documentElement.clientTop: 0;
-
-        var size = Firebug.browser.getWindowSize();
-        var scroll = Firebug.browser.getWindowScrollPosition();
-        var maxHeight = size.height;
-        var height = this.node.offsetHeight;
-
-        var bodyStyle = doc.body.currentStyle;
-
-        this.node.style.top = maxHeight - height + scroll.top + "px";
-
-        if ((this.type == "frame" || this.type == "div") &&
-            (bodyStyle.marginLeft || bodyStyle.marginRight))
-        {
-            this.node.style.width = size.width + "px";
-        }
-
-        if (fbVSplitterStyle)
-            fbVSplitterStyle.right = Firebug.context.persistedState.sidePanelWidth + "px";
-
-        this.draw();
-    }
-
-});
-
-
-// ************************************************************************************************
-// ChromeMini
-
-/**
- * @namespace
- * @extends FBL.Controller
- */
-var ChromeMini = extend(Controller,
-/**@extend ns-chrome-ChromeMini*/
-{
-    create: function(chrome)
-    {
-        append(this, chrome);
-        this.type = "mini";
-    },
-
-    initialize: function()
-    {
-        Controller.initialize.apply(this);
-
-        var doc = FirebugChrome.chromeMap.frame.document;
-
-        var mini = $("fbMiniChrome", doc);
-        mini.style.display = "block";
-
-        var miniIcon = $("fbMiniIcon", doc);
-        var width = miniIcon.offsetWidth + 10;
-        miniIcon.title = "Open " + Firebug.version;
-
-        var errors = $("fbMiniErrors", doc);
-        if (errors.offsetWidth)
-            width += errors.offsetWidth + 10;
-
-        var node = this.node;
-        node.style.height = "27px";
-        node.style.width = width + "px";
-        node.style.left = "";
-        node.style.right = 0;
-
-        if (this.node.nodeName.toLowerCase() == "iframe")
-        {
-            node.setAttribute("allowTransparency", "true");
-            this.document.body.style.backgroundColor = "transparent";
-        }
-        else
-            node.style.background = "transparent";
-
-        if (noFixedPosition)
-            this.fixIEPosition();
-
-        this.addController(
-            [$("fbMiniIcon", doc), "click", onMiniIconClick]
-        );
-
-        if (noFixedPosition)
-        {
-            this.addController(
-                [Firebug.browser.window, "scroll", this.fixIEPosition]
-            );
-        }
-
-        this.isInitialized = true;
-    },
-
-    shutdown: function()
-    {
-        var node = this.node;
-        node.style.height = Firebug.context.persistedState.height + "px";
-        node.style.width = "100%";
-        node.style.left = 0;
-        node.style.right = "";
-
-        if (this.node.nodeName.toLowerCase() == "iframe")
-        {
-            node.setAttribute("allowTransparency", "false");
-            this.document.body.style.backgroundColor = "#fff";
-        }
-        else
-            node.style.background = "#fff";
-
-        if (noFixedPosition)
-            this.fixIEPosition();
-
-        var doc = FirebugChrome.chromeMap.frame.document;
-
-        var mini = $("fbMiniChrome", doc);
-        mini.style.display = "none";
-
-        Controller.shutdown.apply(this);
-
-        this.isInitialized = false;
-    },
-
-    draw: function()
-    {
-
-    },
-
-    fixIEPosition: ChromeFrameBase.fixIEPosition
-
-});
-
-
-// ************************************************************************************************
-// ChromePopupBase
-
-/**
- * @namespace
- * @extends ns-chrome-ChromeBase
- */
-var ChromePopupBase = extend(ChromeBase,
-/**@extend ns-chrome-ChromePopupBase*/
-{
-
-    initialize: function()
-    {
-        setClass(this.document.body, "FirebugPopup");
-
-        ChromeBase.initialize.call(this);
-
-        this.addController(
-            [Firebug.chrome.window, "resize", this.resize],
-            [Firebug.chrome.window, "unload", this.destroy]
-            //[Firebug.chrome.window, "beforeunload", this.destroy]
-        );
-
-        if (Env.Options.enablePersistent)
-        {
-            this.persist = bind(this.persist, this);
-            addEvent(Firebug.browser.window, "unload", this.persist);
-        }
-        else
-            this.addController(
-                [Firebug.browser.window, "unload", this.close]
-            );
-
-        fbVSplitter.onmousedown = onVSplitterMouseDown;
-    },
-
-    destroy: function()
-    {
-        var chromeWin = Firebug.chrome.window;
-        var left = chromeWin.screenX || chromeWin.screenLeft;
-        var top = chromeWin.screenY || chromeWin.screenTop;
-        var size = Firebug.chrome.getWindowSize();
-
-        Firebug.context.persistedState.popupTop = top;
-        Firebug.context.persistedState.popupLeft = left;
-        Firebug.context.persistedState.popupWidth = size.width;
-        Firebug.context.persistedState.popupHeight = size.height;
-
-        if (Firebug.saveCookies)
-            Firebug.savePrefs();
-
-        // TODO: xxxpedro sync detach reattach attach
-        var frame = FirebugChrome.chromeMap.frame;
-
-        if(frame)
-        {
-            dispatch(frame.panelMap, "detach", [this, frame]);
-
-            frame.reattach(this, frame);
-        }
-
-        if (Env.Options.enablePersistent)
-        {
-            removeEvent(Firebug.browser.window, "unload", this.persist);
-        }
-
-        ChromeBase.destroy.apply(this);
-
-        FirebugChrome.chromeMap.popup = null;
-
-        this.node.close();
-    },
-
-    persist: function()
-    {
-        persistTimeStart = new Date().getTime();
-
-        removeEvent(Firebug.browser.window, "unload", this.persist);
-
-        Firebug.Inspector.destroy();
-        Firebug.browser.window.FirebugOldBrowser = true;
-
-        var persistTimeStart = new Date().getTime();
-
-        var waitMainWindow = function()
-        {
-            var doc, head;
-
-            try
-            {
-                if (window.opener && !window.opener.FirebugOldBrowser && (doc = window.opener.document)/* &&
-                    doc.documentElement && (head = doc.documentElement.firstChild)*/)
-                {
-
-                    try
-                    {
-                        // exposes the FBL to the global namespace when in debug mode
-                        if (Env.isDebugMode)
-                        {
-                            window.FBL = FBL;
-                        }
-
-                        window.Firebug = Firebug;
-                        window.opener.Firebug = Firebug;
-
-                        Env.browser = window.opener;
-                        Firebug.browser = Firebug.context = new Context(Env.browser);
-                        Firebug.loadPrefs();
-
-                        registerConsole();
-
-                        // the delay time should be calculated right after registering the
-                        // console, once right after the console registration, call log messages
-                        // will be properly handled
-                        var persistDelay = new Date().getTime() - persistTimeStart;
-
-                        var chrome = Firebug.chrome;
-                        addEvent(Firebug.browser.window, "unload", chrome.persist);
-
-                        FBL.cacheDocument();
-                        Firebug.Inspector.create();
-
-                        Firebug.Console.logFormatted(
-                            ["Firebug could not capture console calls during " +
-                            persistDelay + "ms"],
-                            Firebug.context,
-                            "info"
-                        );
-
-                        setTimeout(function(){
-                            var htmlPanel = chrome.getPanel("HTML");
-                            htmlPanel.createUI();
-                        },50);
-
-                    }
-                    catch(pE)
-                    {
-                        alert("persist error: " + (pE.message || pE));
-                    }
-
-                }
-                else
-                {
-                    window.setTimeout(waitMainWindow, 0);
-                }
-
-            } catch (E) {
-                window.close();
-            }
-        };
-
-        waitMainWindow();
-    },
-
-    close: function()
-    {
-        this.destroy();
-    }
-
-});
-
-
-//************************************************************************************************
-// UI helpers
-
-var changeCommandLineVisibility = function changeCommandLineVisibility(visibility)
-{
-    var last = Firebug.chrome.commandLineVisible;
-    var visible = Firebug.chrome.commandLineVisible =
-        typeof visibility == "boolean" ? visibility : !Firebug.chrome.commandLineVisible;
-
-    if (visible != last)
-    {
-        if (visible)
-        {
-            fbBottom.className = "";
-
-            if (Firebug.CommandLine)
-                Firebug.CommandLine.activate();
-        }
-        else
-        {
-            if (Firebug.CommandLine)
-                Firebug.CommandLine.deactivate();
-
-            fbBottom.className = "hide";
-        }
-    }
-};
-
-var changeSidePanelVisibility = function changeSidePanelVisibility(visibility)
-{
-    var last = Firebug.chrome.sidePanelVisible;
-    Firebug.chrome.sidePanelVisible =
-        typeof visibility == "boolean" ? visibility : !Firebug.chrome.sidePanelVisible;
-
-    if (Firebug.chrome.sidePanelVisible != last)
-    {
-        fbPanelBox2.className = Firebug.chrome.sidePanelVisible ? "" : "hide";
-        fbPanelBar2Box.className = Firebug.chrome.sidePanelVisible ? "" : "hide";
-    }
-};
-
-
-// ************************************************************************************************
-// F12 Handler
-
-var onGlobalKeyDown = function onGlobalKeyDown(event)
-{
-    var keyCode = event.keyCode;
-    var shiftKey = event.shiftKey;
-    var ctrlKey = event.ctrlKey;
-
-    if (keyCode == 123 /* F12 */ && (!isFirefox && !shiftKey || shiftKey && isFirefox))
-    {
-        Firebug.chrome.toggle(false, ctrlKey);
-        cancelEvent(event, true);
-
-        // TODO: xxxpedro replace with a better solution. we're doing this
-        // to allow reactivating with the F12 key after being deactivated
-        if (Env.isChromeExtension)
-        {
-            Firebug.GoogleChrome.dispatch("FB_enableIcon");
-        }
-    }
-    else if (keyCode == 67 /* C */ && ctrlKey && shiftKey)
-    {
-        Firebug.Inspector.toggleInspect();
-        cancelEvent(event, true);
-    }
-    else if (keyCode == 76 /* L */ && ctrlKey && shiftKey)
-    {
-        Firebug.chrome.focusCommandLine();
-        cancelEvent(event, true);
-    }
-};
-
-var onMiniIconClick = function onMiniIconClick(event)
-{
-    Firebug.chrome.toggle(false, event.ctrlKey);
-    cancelEvent(event, true);
-};
-
-
-// ************************************************************************************************
-// Horizontal Splitter Handling
-
-var onHSplitterMouseDown = function onHSplitterMouseDown(event)
-{
-    addGlobalEvent("mousemove", onHSplitterMouseMove);
-    addGlobalEvent("mouseup", onHSplitterMouseUp);
-
-    if (isIE)
-        addEvent(Firebug.browser.document.documentElement, "mouseleave", onHSplitterMouseUp);
-
-    fbHSplitter.className = "fbOnMovingHSplitter";
-
-    return false;
-};
-
-var onHSplitterMouseMove = function onHSplitterMouseMove(event)
-{
-    cancelEvent(event, true);
-
-    var clientY = event.clientY;
-    var win = isIE
-        ? event.srcElement.ownerDocument.parentWindow
-        : event.target.defaultView || event.target.ownerDocument && event.target.ownerDocument.defaultView;
-
-    if (!win)
-        return;
-
-    if (win != win.parent)
-    {
-        var frameElement = win.frameElement;
-        if (frameElement)
-        {
-            var framePos = Firebug.browser.getElementPosition(frameElement).top;
-            clientY += framePos;
-
-            if (frameElement.style.position != "fixed")
-                clientY -= Firebug.browser.getWindowScrollPosition().top;
-        }
-    }
-
-    if (isOpera && isQuiksMode && win.frameElement.id == "FirebugUI")
-    {
-        clientY = Firebug.browser.getWindowSize().height - win.frameElement.offsetHeight + clientY;
-    }
-
-    /*
-    console.log(
-            typeof win.FBL != "undefined" ? "no-Chrome" : "Chrome",
-            //win.frameElement.id,
-            event.target,
-            clientY
-        );/**/
-
-    onHSplitterMouseMoveBuffer = clientY; // buffer
-
-    if (new Date().getTime() - lastHSplitterMouseMove > chromeRedrawSkipRate) // frame skipping
-    {
-        lastHSplitterMouseMove = new Date().getTime();
-        handleHSplitterMouseMove();
-    }
-    else
-        if (!onHSplitterMouseMoveTimer)
-            onHSplitterMouseMoveTimer = setTimeout(handleHSplitterMouseMove, chromeRedrawSkipRate);
-
-    // improving the resizing performance by canceling the mouse event.
-    // canceling events will prevent the page to receive such events, which would imply
-    // in more processing being expended.
-    cancelEvent(event, true);
-    return false;
-};
-
-var handleHSplitterMouseMove = function()
-{
-    if (onHSplitterMouseMoveTimer)
-    {
-        clearTimeout(onHSplitterMouseMoveTimer);
-        onHSplitterMouseMoveTimer = null;
-    }
-
-    var clientY = onHSplitterMouseMoveBuffer;
-
-    var windowSize = Firebug.browser.getWindowSize();
-    var scrollSize = Firebug.browser.getWindowScrollSize();
-
-    // compute chrome fixed size (top bar and command line)
-    var commandLineHeight = Firebug.chrome.commandLineVisible ? fbCommandLine.offsetHeight : 0;
-    var fixedHeight = topHeight + commandLineHeight;
-    var chromeNode = Firebug.chrome.node;
-
-    var scrollbarSize = !isIE && (scrollSize.width > windowSize.width) ? 17 : 0;
-
-    //var height = !isOpera ? chromeNode.offsetTop + chromeNode.clientHeight : windowSize.height;
-    var height =  windowSize.height;
-
-    // compute the min and max size of the chrome
-    var chromeHeight = Math.max(height - clientY + 5 - scrollbarSize, fixedHeight);
-        chromeHeight = Math.min(chromeHeight, windowSize.height - scrollbarSize);
-
-    Firebug.context.persistedState.height = chromeHeight;
-    chromeNode.style.height = chromeHeight + "px";
-
-    if (noFixedPosition)
-        Firebug.chrome.fixIEPosition();
-
-    Firebug.chrome.draw();
-};
-
-var onHSplitterMouseUp = function onHSplitterMouseUp(event)
-{
-    removeGlobalEvent("mousemove", onHSplitterMouseMove);
-    removeGlobalEvent("mouseup", onHSplitterMouseUp);
-
-    if (isIE)
-        removeEvent(Firebug.browser.document.documentElement, "mouseleave", onHSplitterMouseUp);
-
-    fbHSplitter.className = "";
-
-    Firebug.chrome.draw();
-
-    // avoid text selection in IE when returning to the document
-    // after the mouse leaves the document during the resizing
-    return false;
-};
-
-
-// ************************************************************************************************
-// Vertical Splitter Handling
-
-var onVSplitterMouseDown = function onVSplitterMouseDown(event)
-{
-    addGlobalEvent("mousemove", onVSplitterMouseMove);
-    addGlobalEvent("mouseup", onVSplitterMouseUp);
-
-    return false;
-};
-
-var onVSplitterMouseMove = function onVSplitterMouseMove(event)
-{
-    if (new Date().getTime() - lastVSplitterMouseMove > chromeRedrawSkipRate) // frame skipping
-    {
-        var target = event.target || event.srcElement;
-        if (target && target.ownerDocument) // avoid error when cursor reaches out of the chrome
-        {
-            var clientX = event.clientX;
-            var win = document.all
-                ? event.srcElement.ownerDocument.parentWindow
-                : event.target.ownerDocument.defaultView;
-
-            if (win != win.parent)
-                clientX += win.frameElement ? win.frameElement.offsetLeft : 0;
-
-            var size = Firebug.chrome.getSize();
-            var x = Math.max(size.width - clientX + 3, 6);
-
-            Firebug.context.persistedState.sidePanelWidth = x;
-            Firebug.chrome.draw();
-        }
-
-        lastVSplitterMouseMove = new Date().getTime();
-    }
-
-    cancelEvent(event, true);
-    return false;
-};
-
-var onVSplitterMouseUp = function onVSplitterMouseUp(event)
-{
-    removeGlobalEvent("mousemove", onVSplitterMouseMove);
-    removeGlobalEvent("mouseup", onVSplitterMouseUp);
-
-    Firebug.chrome.draw();
-};
-
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-Firebug.Lite =
-{
-};
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-Firebug.Lite.Cache =
-{
-    ID: "firebug-" + new Date().getTime()
-};
-
-// ************************************************************************************************
-
-/**
- * TODO: if a cached element is cloned, the expando property will be cloned too in IE
- * which will result in a bug. Firebug Lite will think the new cloned node is the old
- * one.
- *
- * TODO: Investigate a possibility of cache validation, to be customized by each
- * kind of cache. For ElementCache it should validate if the element still is
- * inserted at the DOM.
- */
-var cacheUID = 0;
-var createCache = function()
-{
-    var map = {};
-    var data = {};
-
-    var CID = Firebug.Lite.Cache.ID;
-
-    // better detection
-    var supportsDeleteExpando = !document.all;
-
-    var cacheFunction = function(element)
-    {
-        return cacheAPI.set(element);
-    };
-
-    var cacheAPI =
-    {
-        get: function(key)
-        {
-            return map.hasOwnProperty(key) ?
-                    map[key] :
-                    null;
-        },
-
-        set: function(element)
-        {
-            var id = getValidatedKey(element);
-
-            if (!id)
-            {
-                id = ++cacheUID;
-                element[CID] = id;
-            }
-
-            if (!map.hasOwnProperty(id))
-            {
-                map[id] = element;
-                data[id] = {};
-            }
-
-            return id;
-        },
-
-        unset: function(element)
-        {
-            var id = getValidatedKey(element);
-
-            if (!id) return;
-
-            if (supportsDeleteExpando)
-            {
-                delete element[CID];
-            }
-            else if (element.removeAttribute)
-            {
-                element.removeAttribute(CID);
-            }
-
-            delete map[id];
-            delete data[id];
-
-        },
-
-        key: function(element)
-        {
-            return getValidatedKey(element);
-        },
-
-        has: function(element)
-        {
-            var id = getValidatedKey(element);
-            return id && map.hasOwnProperty(id);
-        },
-
-        each: function(callback)
-        {
-            for (var key in map)
-            {
-                if (map.hasOwnProperty(key))
-                {
-                    callback(key, map[key]);
-                }
-            }
-        },
-
-        data: function(element, name, value)
-        {
-            // set data
-            if (value)
-            {
-                if (!name) return null;
-
-                var id = cacheAPI.set(element);
-
-                return data[id][name] = value;
-            }
-            // get data
-            else
-            {
-                var id = cacheAPI.key(element);
-
-                return data.hasOwnProperty(id) && data[id].hasOwnProperty(name) ?
-                        data[id][name] :
-                        null;
-            }
-        },
-
-        clear: function()
-        {
-            for (var id in map)
-            {
-                var element = map[id];
-                cacheAPI.unset(element);
-            }
-        }
-    };
-
-    var getValidatedKey = function(element)
-    {
-        var id = element[CID];
-
-        // If a cached element is cloned in IE, the expando property CID will be also
-        // cloned (differently than other browsers) resulting in a bug: Firebug Lite
-        // will think the new cloned node is the old one. To prevent this problem we're
-        // checking if the cached element matches the given element.
-        if (
-            !supportsDeleteExpando &&   // the problem happens when supportsDeleteExpando is false
-            id &&                       // the element has the expando property
-            map.hasOwnProperty(id) &&   // there is a cached element with the same id
-            map[id] != element          // but it is a different element than the current one
-            )
-        {
-            // remove the problematic property
-            element.removeAttribute(CID);
-
-            id = null;
-        }
-
-        return id;
-    };
-
-    FBL.append(cacheFunction, cacheAPI);
-
-    return cacheFunction;
-};
-
-// ************************************************************************************************
-
-// TODO: xxxpedro : check if we need really this on FBL scope
-Firebug.Lite.Cache.StyleSheet = createCache();
-Firebug.Lite.Cache.Element = createCache();
-
-// TODO: xxxpedro
-Firebug.Lite.Cache.Event = createCache();
-
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-// ************************************************************************************************
-var sourceMap = {};
-
-// ************************************************************************************************
-Firebug.Lite.Proxy =
-{
-    // jsonp callbacks
-    _callbacks: {},
-
-    /**
-     * Load a resource, either locally (directly) or externally (via proxy) using
-     * synchronous XHR calls. Loading external resources requires the proxy plugin to
-     * be installed and configured (see /plugin/proxy/proxy.php).
-     */
-    load: function(url)
-    {
-        var resourceDomain = getDomain(url);
-        var isLocalResource =
-            // empty domain means local URL
-            !resourceDomain ||
-            // same domain means local too
-            resourceDomain ==  Firebug.context.window.location.host; // TODO: xxxpedro context
-
-        return isLocalResource ? fetchResource(url) : fetchProxyResource(url);
-    },
-
-    /**
-     * Load a resource using JSONP technique.
-     */
-    loadJSONP: function(url, callback)
-    {
-        var script = createGlobalElement("script"),
-            doc = Firebug.context.document,
-
-            uid = "" + new Date().getTime(),
-            callbackName = "callback=Firebug.Lite.Proxy._callbacks." + uid,
-
-            jsonpURL = url.indexOf("?") != -1 ?
-                    url + "&" + callbackName :
-                    url + "?" + callbackName;
-
-        Firebug.Lite.Proxy._callbacks[uid] = function(data)
-        {
-            if (callback)
-                callback(data);
-
-            script.parentNode.removeChild(script);
-            delete Firebug.Lite.Proxy._callbacks[uid];
-        };
-
-        script.src = jsonpURL;
-
-        if (doc.documentElement)
-            doc.documentElement.appendChild(script);
-    },
-
-    /**
-     * Load a resource using YQL (not reliable).
-     */
-    YQL: function(url, callback)
-    {
-        var yql = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22" +
-                encodeURIComponent(url) + "%22&format=xml";
-
-        this.loadJSONP(yql, function(data)
-        {
-            var source = data.results[0];
-
-            // clean up YQL bogus elements
-            var match = /<body>\s+<p>([\s\S]+)<\/p>\s+<\/body>$/.exec(source);
-            if (match)
-                source = match[1];
-
-            console.log(source);
-        });
-    }
-};
-
-// ************************************************************************************************
-
-Firebug.Lite.Proxy.fetchResourceDisabledMessage =
-    "/* Firebug Lite resource fetching is disabled.\n" +
-    "To enabled it set the Firebug Lite option \"disableResourceFetching\" to \"false\".\n" +
-    "More info at http://getfirebug.com/firebuglite#Options */";
-
-var fetchResource = function(url)
-{
-    if (Firebug.disableResourceFetching)
-    {
-        var source = sourceMap[url] = Firebug.Lite.Proxy.fetchResourceDisabledMessage;
-        return source;
-    }
-
-    if (sourceMap.hasOwnProperty(url))
-        return sourceMap[url];
-
-    // Getting the native XHR object so our calls won't be logged in the Console Panel
-    var xhr = FBL.getNativeXHRObject();
-    xhr.open("get", url, false);
-    xhr.send();
-
-    var source = sourceMap[url] = xhr.responseText;
-    return source;
-};
-
-var fetchProxyResource = function(url)
-{
-    if (sourceMap.hasOwnProperty(url))
-        return sourceMap[url];
-
-    var proxyURL = Env.Location.baseDir + "plugin/proxy/proxy.php?url=" + encodeURIComponent(url);
-    var response = fetchResource(proxyURL);
-
-    try
-    {
-        var data = eval("(" + response + ")");
-    }
-    catch(E)
-    {
-        return "ERROR: Firebug Lite Proxy plugin returned an invalid response.";
-    }
-
-    var source = data ? data.contents : "";
-    return source;
-};
-
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-Firebug.Lite.Style =
-{
-};
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-Firebug.Lite.Script = function(window)
-{
-    this.fileName = null;
-    this.isValid = null;
-    this.baseLineNumber = null;
-    this.lineExtent = null;
-    this.tag = null;
-
-    this.functionName = null;
-    this.functionSource = null;
-};
-
-Firebug.Lite.Script.prototype =
-{
-    isLineExecutable: function(){},
-    pcToLine: function(){},
-    lineToPc: function(){},
-
-    toString: function()
-    {
-        return "Firebug.Lite.Script";
-    }
-};
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-
-Firebug.Lite.Browser = function(window)
-{
-    this.contentWindow = window;
-    this.contentDocument = window.document;
-    this.currentURI =
-    {
-        spec: window.location.href
-    };
-};
-
-Firebug.Lite.Browser.prototype =
-{
-    toString: function()
-    {
-        return "Firebug.Lite.Browser";
-    }
-};
-
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-/*
-    http://www.JSON.org/json2.js
-    2010-03-20
-
-    Public Domain.
-
-    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
-    See http://www.JSON.org/js.html
-
-
-    This code should be minified before deployment.
-    See http://javascript.crockford.com/jsmin.html
-
-    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
-    NOT CONTROL.
-
-
-    This file creates a global JSON object containing two methods: stringify
-    and parse.
-
-        JSON.stringify(value, replacer, space)
-            value       any JavaScript value, usually an object or array.
-
-            replacer    an optional parameter that determines how object
-                        values are stringified for objects. It can be a
-                        function or an array of strings.
-
-            space       an optional parameter that specifies the indentation
-                        of nested structures. If it is omitted, the text will
-                        be packed without extra whitespace. If it is a number,
-                        it will specify the number of spaces to indent at each
-                        level. If it is a string (such as '\t' or '&nbsp;'),
-                        it contains the characters used to indent at each level.
-
-            This method produces a JSON text from a JavaScript value.
-
-            When an object value is found, if the object contains a toJSON
-            method, its toJSON method will be called and the result will be
-            stringified. A toJSON method does not serialize: it returns the
-            value represented by the name/value pair that should be serialized,
-            or undefined if nothing should be serialized. The toJSON method
-            will be passed the key associated with the value, and this will be
-            bound to the value
-
-            For example, this would serialize Dates as ISO strings.
-
-                Date.prototype.toJSON = function (key) {
-                    function f(n) {
-                        // Format integers to have at least two digits.
-                        return n < 10 ? '0' + n : n;
-                    }
-
-                    return this.getUTCFullYear()   + '-' +
-                         f(this.getUTCMonth() + 1) + '-' +
-                         f(this.getUTCDate())      + 'T' +
-                         f(this.getUTCHours())     + ':' +
-                         f(this.getUTCMinutes())   + ':' +
-                         f(this.getUTCSeconds())   + 'Z';
-                };
-
-            You can provide an optional replacer method. It will be passed the
-            key and value of each member, with this bound to the containing
-            object. The value that is returned from your method will be
-            serialized. If your method returns undefined, then the member will
-            be excluded from the serialization.
-
-            If the replacer parameter is an array of strings, then it will be
-            used to select the members to be serialized. It filters the results
-            such that only members with keys listed in the replacer array are
-            stringified.
-
-            Values that do not have JSON representations, such as undefined or
-            functions, will not be serialized. Such values in objects will be
-            dropped; in arrays they will be replaced with null. You can use
-            a replacer function to replace those with JSON values.
-            JSON.stringify(undefined) returns undefined.
-
-            The optional space parameter produces a stringification of the
-            value that is filled with line breaks and indentation to make it
-            easier to read.
-
-            If the space parameter is a non-empty string, then that string will
-            be used for indentation. If the space parameter is a number, then
-            the indentation will be that many spaces.
-
-            Example:
-
-            text = JSON.stringify(['e', {pluribus: 'unum'}]);
-            // text is '["e",{"pluribus":"unum"}]'
-
-
-            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
-            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
-
-            text = JSON.stringify([new Date()], function (key, value) {
-                return this[key] instanceof Date ?
-                    'Date(' + this[key] + ')' : value;
-            });
-            // text is '["Date(---current time---)"]'
-
-
-        JSON.parse(text, reviver)
-            This method parses a JSON text to produce an object or array.
-            It can throw a SyntaxError exception.
-
-            The optional reviver parameter is a function that can filter and
-            transform the results. It receives each of the keys and values,
-            and its return value is used instead of the original value.
-            If it returns what it received, then the structure is not modified.
-            If it returns undefined then the member is deleted.
-
-            Example:
-
-            // Parse the text. Values that look like ISO date strings will
-            // be converted to Date objects.
-
-            myData = JSON.parse(text, function (key, value) {
-                var a;
-                if (typeof value === 'string') {
-                    a =
-/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
-                    if (a) {
-                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
-                            +a[5], +a[6]));
-                    }
-                }
-                return value;
-            });
-
-            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
-                var d;
-                if (typeof value === 'string' &&
-                        value.slice(0, 5) === 'Date(' &&
-                        value.slice(-1) === ')') {
-                    d = new Date(value.slice(5, -1));
-                    if (d) {
-                        return d;
-                    }
-                }
-                return value;
-            });
-
-
-    This is a reference implementation. You are free to copy, modify, or
-    redistribute.
-*/
-
-/*jslint evil: true, strict: false */
-
-/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
-    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
-    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
-    lastIndex, length, parse, prototype, push, replace, slice, stringify,
-    test, toJSON, toString, valueOf
-*/
-
-
-// Create a JSON object only if one does not already exist. We create the
-// methods in a closure to avoid creating global variables.
-
-// ************************************************************************************************
-
-var JSON = window.JSON || {};
-
-// ************************************************************************************************
-
-(function () {
-
-    function f(n) {
-        // Format integers to have at least two digits.
-        return n < 10 ? '0' + n : n;
-    }
-
-    if (typeof Date.prototype.toJSON !== 'function') {
-
-        Date.prototype.toJSON = function (key) {
-
-            return isFinite(this.valueOf()) ?
-                   this.getUTCFullYear()   + '-' +
-                 f(this.getUTCMonth() + 1) + '-' +
-                 f(this.getUTCDate())      + 'T' +
-                 f(this.getUTCHours())     + ':' +
-                 f(this.getUTCMinutes())   + ':' +
-                 f(this.getUTCSeconds())   + 'Z' : null;
-        };
-
-        String.prototype.toJSON =
-        Number.prototype.toJSON =
-        Boolean.prototype.toJSON = function (key) {
-            return this.valueOf();
-        };
-    }
-
-    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-        gap,
-        indent,
-        meta = {    // table of character substitutions
-            '\b': '\\b',
-            '\t': '\\t',
-            '\n': '\\n',
-            '\f': '\\f',
-            '\r': '\\r',
-            '"' : '\\"',
-            '\\': '\\\\'
-        },
-        rep;
-
-
-    function quote(string) {
-
-// If the string contains no control characters, no quote characters, and no
-// backslash characters, then we can safely slap some quotes around it.
-// Otherwise we must also replace the offending characters with safe escape
-// sequences.
-
-        escapable.lastIndex = 0;
-        return escapable.test(string) ?
-            '"' + string.replace(escapable, function (a) {
-                var c = meta[a];
-                return typeof c === 'string' ? c :
-                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
-            }) + '"' :
-            '"' + string + '"';
-    }
-
-
-    function str(key, holder) {
-
-// Produce a string from holder[key].
-
-        var i,          // The loop counter.
-            k,          // The member key.
-            v,          // The member value.
-            length,
-            mind = gap,
-            partial,
-            value = holder[key];
-
-// If the value has a toJSON method, call it to obtain a replacement value.
-
-        if (value && typeof value === 'object' &&
-                typeof value.toJSON === 'function') {
-            value = value.toJSON(key);
-        }
-
-// If we were called with a replacer function, then call the replacer to
-// obtain a replacement value.
-
-        if (typeof rep === 'function') {
-            value = rep.call(holder, key, value);
-        }
-
-// What happens next depends on the value's type.
-
-        switch (typeof value) {
-        case 'string':
-            return quote(value);
-
-        case 'number':
-
-// JSON numbers must be finite. Encode non-finite numbers as null.
-
-            return isFinite(value) ? String(value) : 'null';
-
-        case 'boolean':
-        case 'null':
-
-// If the value is a boolean or null, convert it to a string. Note:
-// typeof null does not produce 'null'. The case is included here in
-// the remote chance that this gets fixed someday.
-
-            return String(value);
-
-// If the type is 'object', we might be dealing with an object or an array or
-// null.
-
-        case 'object':
-
-// Due to a specification blunder in ECMAScript, typeof null is 'object',
-// so watch out for that case.
-
-            if (!value) {
-                return 'null';
-            }
-
-// Make an array to hold the partial results of stringifying this object value.
-
-            gap += indent;
-            partial = [];
-
-// Is the value an array?
-
-            if (Object.prototype.toString.apply(value) === '[object Array]') {
-
-// The value is an array. Stringify every element. Use null as a placeholder
-// for non-JSON values.
-
-                length = value.length;
-                for (i = 0; i < length; i += 1) {
-                    partial[i] = str(i, value) || 'null';
-                }
-
-// Join all of the elements together, separated with commas, and wrap them in
-// brackets.
-
-                v = partial.length === 0 ? '[]' :
-                    gap ? '[\n' + gap +
-                            partial.join(',\n' + gap) + '\n' +
-                                mind + ']' :
-                          '[' + partial.join(',') + ']';
-                gap = mind;
-                return v;
-            }
-
-// If the replacer is an array, use it to select the members to be stringified.
-
-            if (rep && typeof rep === 'object') {
-                length = rep.length;
-                for (i = 0; i < length; i += 1) {
-                    k = rep[i];
-                    if (typeof k === 'string') {
-                        v = str(k, value);
-                        if (v) {
-                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
-                        }
-                    }
-                }
-            } else {
-
-// Otherwise, iterate through all of the keys in the object.
-
-                for (k in value) {
-                    if (Object.hasOwnProperty.call(value, k)) {
-                        v = str(k, value);
-                        if (v) {
-                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
-                        }
-                    }
-                }
-            }
-
-// Join all of the member texts together, separated with commas,
-// and wrap them in braces.
-
-            v = partial.length === 0 ? '{}' :
-                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
-                        mind + '}' : '{' + partial.join(',') + '}';
-            gap = mind;
-            return v;
-        }
-    }
-
-// If the JSON object does not yet have a stringify method, give it one.
-
-    if (typeof JSON.stringify !== 'function') {
-        JSON.stringify = function (value, replacer, space) {
-
-// The stringify method takes a value and an optional replacer, and an optional
-// space parameter, and returns a JSON text. The replacer can be a function
-// that can replace values, or an array of strings that will select the keys.
-// A default replacer method can be provided. Use of the space parameter can
-// produce text that is more easily readable.
-
-            var i;
-            gap = '';
-            indent = '';
-
-// If the space parameter is a number, make an indent string containing that
-// many spaces.
-
-            if (typeof space === 'number') {
-                for (i = 0; i < space; i += 1) {
-                    indent += ' ';
-                }
-
-// If the space parameter is a string, it will be used as the indent string.
-
-            } else if (typeof space === 'string') {
-                indent = space;
-            }
-
-// If there is a replacer, it must be a function or an array.
-// Otherwise, throw an error.
-
-            rep = replacer;
-            if (replacer && typeof replacer !== 'function' &&
-                    (typeof replacer !== 'object' ||
-                     typeof replacer.length !== 'number')) {
-                throw new Error('JSON.stringify');
-            }
-
-// Make a fake root object containing our value under the key of ''.
-// Return the result of stringifying the value.
-
-            return str('', {'': value});
-        };
-    }
-
-
-// If the JSON object does not yet have a parse method, give it one.
-
-    if (typeof JSON.parse !== 'function') {
-        JSON.parse = function (text, reviver) {
-
-// The parse method takes a text and an optional reviver function, and returns
-// a JavaScript value if the text is a valid JSON text.
-
-            var j;
-
-            function walk(holder, key) {
-
-// The walk method is used to recursively walk the resulting structure so
-// that modifications can be made.
-
-                var k, v, value = holder[key];
-                if (value && typeof value === 'object') {
-                    for (k in value) {
-                        if (Object.hasOwnProperty.call(value, k)) {
-                            v = walk(value, k);
-                            if (v !== undefined) {
-                                value[k] = v;
-                            } else {
-                                delete value[k];
-                            }
-                        }
-                    }
-                }
-                return reviver.call(holder, key, value);
-            }
-
-
-// Parsing happens in four stages. In the first stage, we replace certain
-// Unicode characters with escape sequences. JavaScript handles many characters
-// incorrectly, either silently deleting them, or treating them as line endings.
-
-            text = String(text);
-            cx.lastIndex = 0;
-            if (cx.test(text)) {
-                text = text.replace(cx, function (a) {
-                    return '\\u' +
-                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
-                });
-            }
-
-// In the second stage, we run the text against regular expressions that look
-// for non-JSON patterns. We are especially concerned with '()' and 'new'
-// because they can cause invocation, and '=' because it can cause mutation.
-// But just to be safe, we want to reject all unexpected forms.
-
-// We split the second stage into 4 regexp operations in order to work around
-// crippling inefficiencies in IE's and Safari's regexp engines. First we
-// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
-// replace all simple value tokens with ']' characters. Third, we delete all
-// open brackets that follow a colon or comma or that begin the text. Finally,
-// we look to see that the remaining characters are only whitespace or ']' or
-// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
-
-            if (/^[\],:{}\s]*$/.
-test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
-replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
-replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
-
-// In the third stage we use the eval function to compile the text into a
-// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
-// in JavaScript: it can begin a block or an object literal. We wrap the text
-// in parens to eliminate the ambiguity.
-
-                j = eval('(' + text + ')');
-
-// In the optional fourth stage, we recursively walk the new structure, passing
-// each name/value pair to a reviver function for possible transformation.
-
-                return typeof reviver === 'function' ?
-                    walk({'': j}, '') : j;
-            }
-
-// If the text is not JSON parseable, then a SyntaxError is thrown.
-
-            throw new SyntaxError('JSON.parse');
-        };
-    }
-
-// ************************************************************************************************
-// registration
-
-FBL.JSON = JSON;
-
-// ************************************************************************************************
-}());
-
-/* See license.txt for terms of usage */
-
-(function(){
-// ************************************************************************************************
-
-/* Copyright (c) 2010-2011 Marcus Westin
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-var store = (function(){
-	var api = {},
-		win = window,
-		doc = win.document,
-		localStorageName = 'localStorage',
-		globalStorageName = 'globalStorage',
-		namespace = '__firebug__storejs__',
-		storage
-
-	api.disabled = false
-	api.set = function(key, value) {}
-	api.get = function(key) {}
-	api.remove = function(key) {}
-	api.clear = function() {}
-	api.transact = function(key, transactionFn) {
-		var val = api.get(key)
-		if (typeof val == 'undefined') { val = {} }
-		transactionFn(val)
-		api.set(key, val)
-	}
-
-	api.serialize = function(value) {
-		return JSON.stringify(value)
-	}
-	api.deserialize = function(value) {
-		if (typeof value != 'string') { return undefined }
-		return JSON.parse(value)
-	}
-
-	// Functions to encapsulate questionable FireFox 3.6.13 behavior
-	// when about.config::dom.storage.enabled === false
-	// See https://github.com/marcuswestin/store.js/issues#issue/13
-	function isLocalStorageNameSupported() {
-		try { return (localStorageName in win && win[localStorageName]) }
-		catch(err) { return false }
-	}
-
-	function isGlobalStorageNameSupported() {
-		try { return (globalStorageName in win && win[globalStorageName] && win[globalStorageName][win.location.hostname]) }
-		catch(err) { return false }
-	}
-
-	if (isLocalStorageNameSupported()) {
-		storage = win[localStorageName]
-		api.set = function(key, val) { storage.setItem(key, api.serialize(val)) }
-		api.get = function(key) { return api.deserialize(storage.getItem(key)) }
-		api.remove = function(key) { storage.removeItem(key) }
-		api.clear = function() { storage.clear() }
-
-	} else if (isGlobalStorageNameSupported()) {
-		storage = win[globalStorageName][win.location.hostname]
-		api.set = function(key, val) { storage[key] = api.serialize(val) }
-		api.get = function(key) { return api.deserialize(storage[key] && storage[key].value) }
-		api.remove = function(key) { delete storage[key] }
-		api.clear = function() { for (var key in storage ) { delete storage[key] } }
-
-	} else if (doc.documentElement.addBehavior) {
-		var storage = doc.createElement('div')
-		function withIEStorage(storeFunction) {
-			return function() {
-				var args = Array.prototype.slice.call(arguments, 0)
-				args.unshift(storage)
-				// See http://msdn.microsoft.com/en-us/library/ms531081(v=VS.85).aspx
-				// and http://msdn.microsoft.com/en-us/library/ms531424(v=VS.85).aspx
-				// TODO: xxxpedro doc.body is not always available so we must use doc.documentElement.
-				// We need to make sure this change won't affect the behavior of this library.
-				doc.documentElement.appendChild(storage)
-				storage.addBehavior('#default#userData')
-				storage.load(localStorageName)
-				var result = storeFunction.apply(api, args)
-				doc.documentElement.removeChild(storage)
-				return result
-			}
-		}
-		api.set = withIEStorage(function(storage, key, val) {
-			storage.setAttribute(key, api.serialize(val))
-			storage.save(localStorageName)
-		})
-		api.get = withIEStorage(function(storage, key) {
-			return api.deserialize(storage.getAttribute(key))
-		})
-		api.remove = withIEStorage(function(storage, key) {
-			storage.removeAttribute(key)
-			storage.save(localStorageName)
-		})
-		api.clear = withIEStorage(function(storage) {
-			var attributes = storage.XMLDocument.documentElement.attributes
-			storage.load(localStorageName)
-			for (var i=0, attr; attr = attributes[i]; i++) {
-				storage.removeAttribute(attr.name)
-			}
-			storage.save(localStorageName)
-		})
-	}
-
-	try {
-		api.set(namespace, namespace)
-		if (api.get(namespace) != namespace) { api.disabled = true }
-		api.remove(namespace)
-	} catch(e) {
-		api.disabled = true
-	}
-
-	return api
-})();
-
-if (typeof module != 'undefined') { module.exports = store }
-
-
-// ************************************************************************************************
-// registration
-
-FBL.Store = store;
-
-// ************************************************************************************************
-})();
-
-/* See license.txt for terms of usage */
-
-FBL.ns( /**@scope s_selector*/ function() { with (FBL) {
-// ************************************************************************************************
-
-/*
- * Sizzle CSS Selector Engine - v1.0
- *  Copyright 2009, The Dojo Foundation
- *  Released under the MIT, BSD, and GPL Licenses.
- *  More information: http://sizzlejs.com/
- */
-
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
-    done = 0,
-    toString = Object.prototype.toString,
-    hasDuplicate = false,
-    baseHasDuplicate = true;
-
-// Here we check if the JavaScript engine is using some sort of
-// optimization where it does not always call our comparision
-// function. If that is the case, discard the hasDuplicate value.
-//   Thus far that includes Google Chrome.
-[0, 0].sort(function(){
-    baseHasDuplicate = false;
-    return 0;
-});
-
-/**
- * @name Firebug.Selector
- * @namespace
- */
-
-/**
- * @exports Sizzle as Firebug.Selector
- */
-var Sizzle = function(selector, context, results, seed) {
-    results = results || [];
-    var origContext = context = context || document;
-
-    if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
-        return [];
-    }
-
-    if ( !selector || typeof selector !== "string" ) {
-        return results;
-    }
-
-    var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context),
-        soFar = selector;
-
-    // Reset the position of the chunker regexp (start from head)
-    while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
-        soFar = m[3];
-
-        parts.push( m[1] );
-
-        if ( m[2] ) {
-            extra = m[3];
-            break;
-        }
-    }
-
-    if ( parts.length > 1 && origPOS.exec( selector ) ) {
-        if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
-            set = posProcess( parts[0] + parts[1], context );
-        } else {
-            set = Expr.relative[ parts[0] ] ?
-                [ context ] :
-                Sizzle( parts.shift(), context );
-
-            while ( parts.length ) {
-                selector = parts.shift();
-
-                if ( Expr.relative[ selector ] )
-                    selector += parts.shift();
-
-                set = posProcess( selector, set );
-            }
-        }
-    } else {
-        // Take a shortcut and set the context if the root selector is an ID
-        // (but not if it'll be faster if the inner selector is an ID)
-        if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
-                Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
-            var ret = Sizzle.find( parts.shift(), context, contextXML );
-            context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
-        }
-
-        if ( context ) {
-            var ret = seed ?
-                { expr: parts.pop(), set: makeArray(seed) } :
-                Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
-            set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
-
-            if ( parts.length > 0 ) {
-                checkSet = makeArray(set);
-            } else {
-                prune = false;
-            }
-
-            while ( parts.length ) {
-                var cur = parts.pop(), pop = cur;
-
-                if ( !Expr.relative[ cur ] ) {
-                    cur = "";
-                } else {
-                    pop = parts.pop();
-                }
-
-                if ( pop == null ) {
-                    pop = context;
-                }
-
-                Expr.relative[ cur ]( checkSet, pop, contextXML );
-            }
-        } else {
-            checkSet = parts = [];
-        }
-    }
-
-    if ( !checkSet ) {
-        checkSet = set;
-    }
-
-    if ( !checkSet ) {
-        throw "Syntax error, unrecognized expression: " + (cur || selector);
-    }
-
-    if ( toString.call(checkSet) === "[object Array]" ) {
-        if ( !prune ) {
-            results.push.apply( results, checkSet );
-        } else if ( context && context.nodeType === 1 ) {
-            for ( var i = 0; checkSet[i] != null; i++ ) {
-                if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
-                    results.push( set[i] );
-                }
-            }
-        } else {
-            for ( var i = 0; checkSet[i] != null; i++ ) {
-                if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
-                    results.push( set[i] );
-                }
-            }
-        }
-    } else {
-        makeArray( checkSet, results );
-    }
-
-    if ( extra ) {
-        Sizzle( extra, origContext, results, seed );
-        Sizzle.uniqueSort( results );
-    }
-
-    return results;
-};
-
-Sizzle.uniqueSort = function(results){
-    if ( sortOrder ) {
-        hasDuplicate = baseHasDuplicate;
-        results.sort(sortOrder);
-
-        if ( hasDuplicate ) {
-            for ( var i = 1; i < results.length; i++ ) {
-                if ( results[i] === results[i-1] ) {
-                    results.splice(i--, 1);
-                }
-            }
-        }
-    }
-
-    return results;
-};
-
-Sizzle.matches = function(expr, set){
-    return Sizzle(expr, null, null, set);
-};
-
-Sizzle.find = function(expr, context, isXML){
-    var set, match;
-
-    if ( !expr ) {
-        return [];
-    }
-
-    for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
-        var type = Expr.order[i], match;
-
-        if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
-            var left = match[1];
-            match.splice(1,1);
-
-            if ( left.substr( left.length - 1 ) !== "\\" ) {
-                match[1] = (match[1] || "").replace(/\\/g, "");
-                set = Expr.find[ type ]( match, context, isXML );
-                if ( set != null ) {
-                    expr = expr.replace( Expr.match[ type ], "" );
-                    break;
-                }
-            }
-        }
-    }
-
-    if ( !set ) {
-        set = context.getElementsByTagName("*");
-    }
-
-    return {set: set, expr: expr};
-};
-
-Sizzle.filter = function(expr, set, inplace, not){
-    var old = expr, result = [], curLoop = set, match, anyFound,
-        isXMLFilter = set && set[0] && isXML(set[0]);
-
-    while ( expr && set.length ) {
-        for ( var type in Expr.filter ) {
-            if ( (match = Expr.match[ type ].exec( expr )) != null ) {
-                var filter = Expr.filter[ type ], found, item;
-                anyFound = false;
-
-                if ( curLoop == result ) {
-                    result = [];
-                }
-
-                if ( Expr.preFilter[ type ] ) {
-                    match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
-                    if ( !match ) {
-                        anyFound = found = true;
-                    } else if ( match === true ) {
-                        continue;
-                    }
-                }
-
-                if ( match ) {
-                    for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
-                        if ( item ) {
-                            found = filter( item, match, i, curLoop );
-                            var pass = not ^ !!found;
-
-                            if ( inplace && found != null ) {
-                                if ( pass ) {
-                                    anyFound = true;
-                                } else {
-                                    curLoop[i] = false;
-                                }
-                            } else if ( pass ) {
-                                result.push( item );
-                                anyFound = true;
-                            }
-                        }
-                    }
-                }
-
-                if ( found !== undefined ) {
-                    if ( !inplace ) {
-                        curLoop = result;
-                    }
-
-                    expr = expr.replace( Expr.match[ type ], "" );
-
-                    if ( !anyFound ) {
-                        return [];
-                    }
-
-                    break;
-                }
-            }
-        }
-
-        // Improper expression
-        if ( expr == old ) {
-            if ( anyFound == null ) {
-                throw "Syntax error, unrecognized expression: " + expr;
-            } else {
-                break;
-            }
-        }
-
-        old = expr;
-    }
-
-    return curLoop;
-};
-
-/**#@+ @ignore */
-var Expr = Sizzle.selectors = {
-    order: [ "ID", "NAME", "TAG" ],
-    match: {
-        ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
-        CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
-        NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
-        ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
-        TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
-        CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
-        POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
-        PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
-    },
-    leftMatch: {},
-    attrMap: {
-        "class": "className",
-        "for": "htmlFor"
-    },
-    attrHandle: {
-        href: function(elem){
-            return elem.getAttribute("href");
-        }
-    },
-    relative: {
-        "+": function(checkSet, part, isXML){
-            var isPartStr = typeof part === "string",
-                isTag = isPartStr && !/\W/.test(part),
-                isPartStrNotTag = isPartStr && !isTag;
-
-            if ( isTag && !isXML ) {
-                part = part.toUpperCase();
-            }
-
-            for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
-                if ( (elem = checkSet[i]) ) {
-                    while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
-
-                    checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
-                        elem || false :
-                        elem === part;
-                }
-            }
-
-            if ( isPartStrNotTag ) {
-                Sizzle.filter( part, checkSet, true );
-            }
-        },
-        ">": function(checkSet, part, isXML){
-            var isPartStr = typeof part === "string";
-
-            if ( isPartStr && !/\W/.test(part) ) {
-                part = isXML ? part : part.toUpperCase();
-
-                for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-                    var elem = checkSet[i];
-                    if ( elem ) {
-                        var parent = elem.parentNode;
-                        checkSet[i] = parent.nodeName === part ? parent : false;
-                    }
-                }
-            } else {
-                for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-                    var elem = checkSet[i];
-                    if ( elem ) {
-                        checkSet[i] = isPartStr ?
-                            elem.parentNode :
-                            elem.parentNode === part;
-                    }
-                }
-
-                if ( isPartStr ) {
-                    Sizzle.filter( part, checkSet, true );
-                }
-            }
-        },
-        "": function(checkSet, part, isXML){
-            var doneName = done++, checkFn = dirCheck;
-
-            if ( !/\W/.test(part) ) {
-                var nodeCheck = part = isXML ? part : part.toUpperCase();
-                checkFn = dirNodeCheck;
-            }
-
-            checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
-        },
-        "~": function(checkSet, part, isXML){
-            var doneName = done++, checkFn = dirCheck;
-
-            if ( typeof part === "string" && !/\W/.test(part) ) {
-                var nodeCheck = part = isXML ? part : part.toUpperCase();
-                checkFn = dirNodeCheck;
-            }
-
-            checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
-        }
-    },
-    find: {
-        ID: function(match, context, isXML){
-            if ( typeof context.getElementById !== "undefined" && !isXML ) {
-                var m = context.getElementById(match[1]);
-                return m ? [m] : [];
-            }
-        },
-        NAME: function(match, context, isXML){
-            if ( typeof context.getElementsByName !== "undefined" ) {
-                var ret = [], results = context.getElementsByName(match[1]);
-
-                for ( var i = 0, l = results.length; i < l; i++ ) {
-                    if ( results[i].getAttribute("name") === match[1] ) {
-                        ret.push( results[i] );
-                    }
-                }
-
-                return ret.length === 0 ? null : ret;
-            }
-        },
-        TAG: function(match, context){
-            return context.getElementsByTagName(match[1]);
-        }
-    },
-    preFilter: {
-        CLASS: function(match, curLoop, inplace, result, not, isXML){
-            match = " " + match[1].replace(/\\/g, "") + " ";
-
-            if ( isXML ) {
-                return match;
-            }
-
-            for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
-                if ( elem ) {
-                    if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
-                        if ( !inplace )
-                            result.push( elem );
-                    } else if ( inplace ) {
-                        curLoop[i] = false;
-                    }
-                }
-            }
-
-            return false;
-        },
-        ID: function(match){
-            return match[1].replace(/\\/g, "");
-        },
-        TAG: function(match, curLoop){
-            for ( var i = 0; curLoop[i] === false; i++ ){}
-            return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
-        },
-        CHILD: function(match){
-            if ( match[1] == "nth" ) {
-                // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
-                var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
-                    match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
-                    !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
-                // calculate the numbers (first)n+(last) including if they are negative
-                match[2] = (test[1] + (test[2] || 1)) - 0;
-                match[3] = test[3] - 0;
-            }
-
-            // TODO: Move to normal caching system
-            match[0] = done++;
-
-            return match;
-        },
-        ATTR: function(match, curLoop, inplace, result, not, isXML){
-            var name = match[1].replace(/\\/g, "");
-
-            if ( !isXML && Expr.attrMap[name] ) {
-                match[1] = Expr.attrMap[name];
-            }
-
-            if ( match[2] === "~=" ) {
-                match[4] = " " + match[4] + " ";
-            }
-
-            return match;
-        },
-        PSEUDO: function(match, curLoop, inplace, result, not){
-            if ( match[1] === "not" ) {
-                // If we're dealing with a complex expression, or a simple one
-                if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
-                    match[3] = Sizzle(match[3], null, null, curLoop);
-                } else {
-                    var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-                    if ( !inplace ) {
-                        result.push.apply( result, ret );
-                    }
-                    return false;
-                }
-            } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
-                return true;
-            }
-
-            return match;
-        },
-        POS: function(match){
-            match.unshift( true );
-            return match;
-        }
-    },
-    filters: {
-        enabled: function(elem){
-            return elem.disabled === false && elem.type !== "hidden";
-        },
-        disabled: function(elem){
-            return elem.disabled === true;
-        },
-        checked: function(elem){
-            return elem.checked === true;
-        },
-        selected: function(elem){
-            // Accessing this property makes selected-by-default
-            // options in Safari work properly
-            elem.parentNode.selectedIndex;
-            return elem.selected === true;
-        },
-        parent: function(elem){
-            return !!elem.firstChild;
-        },
-        empty: function(elem){
-            return !elem.firstChild;
-        },
-        has: function(elem, i, match){
-            return !!Sizzle( match[3], elem ).length;
-        },
-        header: function(elem){
-            return /h\d/i.test( elem.nodeName );
-        },
-        text: function(elem){
-            return "text" === elem.type;
-        },
-        radio: function(elem){
-            return "radio" === elem.type;
-        },
-        checkbox: function(elem){
-            return "checkbox" === elem.type;
-        },
-        file: function(elem){
-            return "file" === elem.type;
-        },
-        password: function(elem){
-            return "password" === elem.type;
-        },
-        submit: function(elem){
-            return "submit" === elem.type;
-        },
-        image: function(elem){
-            return "image" === elem.type;
-        },
-        reset: function(elem){
-            return "reset" === elem.type;
-        },
-        button: function(elem){
-            return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
-        },
-        input: function(elem){
-            return /input|select|textarea|button/i.test(elem.nodeName);
-        }
-    },
-    setFilters: {
-        first: function(elem, i){
-            return i === 0;
-        },
-        last: function(elem, i, match, array){
-            return i === array.length - 1;
-        },
-        even: function(elem, i){
-            return i % 2 === 0;
-        },
-        odd: function(elem, i){
-            return i % 2 === 1;
-        },
-        lt: function(elem, i, match){
-            return i < match[3] - 0;
-        },
-        gt: function(elem, i, match){
-            return i > match[3] - 0;
-        },
-        nth: function(elem, i, match){
-            return match[3] - 0 == i;
-        },
-        eq: function(elem, i, match){
-            return match[3] - 0 == i;
-        }
-    },
-    filter: {
-        PSEUDO: function(elem, match, i, array){
-            var name = match[1], filter = Expr.filters[ name ];
-
-            if ( filter ) {
-                return filter( elem, i, match, array );
-            } else if ( name === "contains" ) {
-                return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
-            } else if ( name === "not" ) {
-                var not = match[3];
-
-                for ( var i = 0, l = not.length; i < l; i++ ) {
-                    if ( not[i] === elem ) {
-                        return false;
-                    }
-                }
-
-                return true;
-            }
-        },
-        CHILD: function(elem, match){
-            var type = match[1], node = elem;
-            switch (type) {
-                case 'only':
-                case 'first':
-                    while ( (node = node.previousSibling) )  {
-                        if ( node.nodeType === 1 ) return false;
-                    }
-                    if ( type == 'first') return true;
-                    node = elem;
-                case 'last':
-                    while ( (node = node.nextSibling) )  {
-                        if ( node.nodeType === 1 ) return false;
-                    }
-                    return true;
-                case 'nth':
-                    var first = match[2], last = match[3];
-
-                    if ( first == 1 && last == 0 ) {
-                        return true;
-                    }
-
-                    var doneName = match[0],
-                        parent = elem.parentNode;
-
-                    if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
-                        var count = 0;
-                        for ( node = parent.firstChild; node; node = node.nextSibling ) {
-                            if ( node.nodeType === 1 ) {
-                                node.nodeIndex = ++count;
-                            }
-                        }
-                        parent.sizcache = doneName;
-                    }
-
-                    var diff = elem.nodeIndex - last;
-                    if ( first == 0 ) {
-                        return diff == 0;
-                    } else {
-                        return ( diff % first == 0 && diff / first >= 0 );
-                    }
-            }
-        },
-        ID: function(elem, match){
-            return elem.nodeType === 1 && elem.getAttribute("id") === match;
-        },
-        TAG: function(elem, match){
-            return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
-        },
-        CLASS: function(elem, match){
-            return (" " + (elem.className || elem.getAttribute("class")) + " ")
-                .indexOf( match ) > -1;
-        },
-        ATTR: function(elem, match){
-            var name = match[1],
-                result = Expr.attrHandle[ name ] ?
-                    Expr.attrHandle[ name ]( elem ) :
-                    elem[ name ] != null ?
-                        elem[ name ] :
-                        elem.getAttribute( name ),
-                value = result + "",
-                type = match[2],
-                check = match[4];
-
-            return result == null ?
-                type === "!=" :
-                type === "=" ?
-                value === check :
-                type === "*=" ?
-                value.indexOf(check) >= 0 :
-                type === "~=" ?
-                (" " + value + " ").indexOf(check) >= 0 :
-                !check ?
-                value && result !== false :
-                type === "!=" ?
-                value != check :
-                type === "^=" ?
-                value.indexOf(check) === 0 :
-                type === "$=" ?
-                value.substr(value.length - check.length) === check :
-                type === "|=" ?
-                value === check || value.substr(0, check.length + 1) === check + "-" :
-                false;
-        },
-        POS: function(elem, match, i, array){
-            var name = match[2], filter = Expr.setFilters[ name ];
-
-            if ( filter ) {
-                return filter( elem, i, match, array );
-            }
-        }
-    }
-};
-
-var origPOS = Expr.match.POS;
-
-for ( var type in Expr.match ) {
-    Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
-    Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source );
-}
-
-var makeArray = function(array, results) {
-    array = Array.prototype.slice.call( array, 0 );
-
-    if ( results ) {
-        results.push.apply( results, array );
-        return results;
-    }
-
-    return array;
-};
-
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-try {
-    Array.prototype.slice.call( document.documentElement.childNodes, 0 );
-
-// Provide a fallback method if it does not work
-} catch(e){
-    makeArray = function(array, results) {
-        var ret = results || [];
-
-        if ( toString.call(array) === "[object Array]" ) {
-            Array.prototype.push.apply( ret, array );
-        } else {
-            if ( typeof array.length === "number" ) {
-                for ( var i = 0, l = array.length; i < l; i++ ) {
-                    ret.push( array[i] );
-                }
-            } else {
-                for ( var i = 0; array[i]; i++ ) {
-                    ret.push( array[i] );
-                }
-            }
-        }
-
-        return ret;
-    };
-}
-
-var sortOrder;
-
-if ( document.documentElement.compareDocumentPosition ) {
-    sortOrder = function( a, b ) {
-        if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
-            if ( a == b ) {
-                hasDuplicate = true;
-            }
-            return 0;
-        }
-
-        var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
-        if ( ret === 0 ) {
-            hasDuplicate = true;
-        }
-        return ret;
-    };
-} else if ( "sourceIndex" in document.documentElement ) {
-    sortOrder = function( a, b ) {
-        if ( !a.sourceIndex || !b.sourceIndex ) {
-            if ( a == b ) {
-                hasDuplicate = true;
-            }
-            return 0;
-        }
-
-        var ret = a.sourceIndex - b.sourceIndex;
-        if ( ret === 0 ) {
-            hasDuplicate = true;
-        }
-        return ret;
-    };
-} else if ( document.createRange ) {
-    sortOrder = function( a, b ) {
-        if ( !a.ownerDocument || !b.ownerDocument ) {
-            if ( a == b ) {
-                hasDuplicate = true;
-            }
-            return 0;
-        }
-
-        var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
-        aRange.setStart(a, 0);
-        aRange.setEnd(a, 0);
-        bRange.setStart(b, 0);
-        bRange.setEnd(b, 0);
-        var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
-        if ( ret === 0 ) {
-            hasDuplicate = true;
-        }
-        return ret;
-    };
-}
-
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
-    // We're going to inject a fake input element with a specified name
-    var form = document.createElement("div"),
-        id = "script" + (new Date).getTime();
-    form.innerHTML = "<a name='" + id + "'/>";
-
-    // Inject it into the root element, check its status, and remove it quickly
-    var root = document.documentElement;
-    root.insertBefore( form, root.firstChild );
-
-    // The workaround has to do additional checks after a getElementById
-    // Which slows things down for other browsers (hence the branching)
-    if ( !!document.getElementById( id ) ) {
-        Expr.find.ID = function(match, context, isXML){
-            if ( typeof context.getElementById !== "undefined" && !isXML ) {
-                var m = context.getElementById(match[1]);
-                return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
-            }
-        };
-
-        Expr.filter.ID = function(elem, match){
-            var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-            return elem.nodeType === 1 && node && node.nodeValue === match;
-        };
-    }
-
-    root.removeChild( form );
-    root = form = null; // release memory in IE
-})();
-
-(function(){
-    // Check to see if the browser returns only elements
-    // when doing getElementsByTagName("*")
-
-    // Create a fake element
-    var div = document.createElement("div");
-    div.appendChild( document.createComment("") );
-
-    // Make sure no comments are found
-    if ( div.getElementsByTagName("*").length > 0 ) {
-        Expr.find.TAG = function(match, context){
-            var results = context.getElementsByTagName(match[1]);
-
-            // Filter out possible comments
-            if ( match[1] === "*" ) {
-                var tmp = [];
-
-                for ( var i = 0; results[i]; i++ ) {
-                    if ( results[i].nodeType === 1 ) {
-                        tmp.push( results[i] );
-                    }
-                }
-
-                results = tmp;
-            }
-
-            return results;
-        };
-    }
-
-    // Check to see if an attribute returns normalized href attributes
-    div.innerHTML = "<a href='#'></a>";
-    if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
-            div.firstChild.getAttribute("href") !== "#" ) {
-        Expr.attrHandle.href = function(elem){
-            return elem.getAttribute("href", 2);
-        };
-    }
-
-    div = null; // release memory in IE
-})();
-
-if ( document.querySelectorAll ) (function(){
-    var oldSizzle = Sizzle, div = document.createElement("div");
-    div.innerHTML = "<p class='TEST'></p>";
-
-    // Safari can't handle uppercase or unicode characters when
-    // in quirks mode.
-    if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
-        return;
-    }
-
-    Sizzle = function(query, context, extra, seed){
-        context = context || document;
-
-        // Only use querySelectorAll on non-XML documents
-        // (ID selectors don't work in non-HTML documents)
-        if ( !seed && context.nodeType === 9 && !isXML(context) ) {
-            try {
-                return makeArray( context.querySelectorAll(query), extra );
-            } catch(e){}
-        }
-
-        return oldSizzle(query, context, extra, seed);
-    };
-
-    for ( var prop in oldSizzle ) {
-        Sizzle[ prop ] = oldSizzle[ prop ];
-    }
-
-    div = null; // release memory in IE
-})();
-
-if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
-    var div = document.createElement("div");
-    div.innerHTML = "<div class='test e'></div><div class='test'></div>";
-
-    // Opera can't find a second classname (in 9.6)
-    if ( div.getElementsByClassName("e").length === 0 )
-        return;
-
-    // Safari caches class attributes, doesn't catch changes (in 3.2)
-    div.lastChild.className = "e";
-
-    if ( div.getElementsByClassName("e").length === 1 )
-        return;
-
-    Expr.order.splice(1, 0, "CLASS");
-    Expr.find.CLASS = function(match, context, isXML) {
-        if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
-            return context.getElementsByClassName(match[1]);
-        }
-    };
-
-    div = null; // release memory in IE
-})();
-
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-    var sibDir = dir == "previousSibling" && !isXML;
-    for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-        var elem = checkSet[i];
-        if ( elem ) {
-            if ( sibDir && elem.nodeType === 1 ){
-                elem.sizcache = doneName;
-                elem.sizset = i;
-            }
-            elem = elem[dir];
-            var match = false;
-
-            while ( elem ) {
-                if ( elem.sizcache === doneName ) {
-                    match = checkSet[elem.sizset];
-                    break;
-                }
-
-                if ( elem.nodeType === 1 && !isXML ){
-                    elem.sizcache = doneName;
-                    elem.sizset = i;
-                }
-
-                if ( elem.nodeName === cur ) {
-                    match = elem;
-                    break;
-                }
-
-                elem = elem[dir];
-            }
-
-            checkSet[i] = match;
-        }
-    }
-}
-
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-    var sibDir = dir == "previousSibling" && !isXML;
-    for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-        var elem = checkSet[i];
-        if ( elem ) {
-            if ( sibDir && elem.nodeType === 1 ) {
-                elem.sizcache = doneName;
-                elem.sizset = i;
-            }
-            elem = elem[dir];
-            var match = false;
-
-            while ( elem ) {
-                if ( elem.sizcache === doneName ) {
-                    match = checkSet[elem.sizset];
-                    break;
-                }
-
-                if ( elem.nodeType === 1 ) {
-                    if ( !isXML ) {
-                        elem.sizcache = doneName;
-                        elem.sizset = i;
-                    }
-                    if ( typeof cur !== "string" ) {
-                        if ( elem === cur ) {
-                            match = true;
-                            break;
-                        }
-
-                    } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
-                        match = elem;
-                        break;
-                    }
-                }
-
-                elem = elem[dir];
-            }
-
-            checkSet[i] = match;
-        }
-    }
-}
-
-var contains = document.compareDocumentPosition ?  function(a, b){
-    return a.compareDocumentPosition(b) & 16;
-} : function(a, b){
-    return a !== b && (a.contains ? a.contains(b) : true);
-};
-
-var isXML = function(elem){
-    return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
-        !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
-};
-
-var posProcess = function(selector, context){
-    var tmpSet = [], later = "", match,
-        root = context.nodeType ? [context] : context;
-
-    // Position selectors must be done after the filter
-    // And so must :not(positional) so we move all PSEUDOs to the end
-    while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
-        later += match[0];
-        selector = selector.replace( Expr.match.PSEUDO, "" );
-    }
-
-    selector = Expr.relative[selector] ? selector + "*" : selector;
-
-    for ( var i = 0, l = root.length; i < l; i++ ) {
-        Sizzle( selector, root[i], tmpSet );
-    }
-
-    return Sizzle.filter( later, tmpSet );
-};
-
-// EXPOSE
-
-Firebug.Selector = Sizzle;
-
-/**#@-*/
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-// ************************************************************************************************
-// Inspector Module
-
-var ElementCache = Firebug.Lite.Cache.Element;
-
-var inspectorTS, inspectorTimer, isInspecting;
-
-Firebug.Inspector =
-{
-    create: function()
-    {
-        offlineFragment = Env.browser.document.createDocumentFragment();
-
-        createBoxModelInspector();
-        createOutlineInspector();
-    },
-
-    destroy: function()
-    {
-        destroyBoxModelInspector();
-        destroyOutlineInspector();
-
-        offlineFragment = null;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Inspect functions
-
-    toggleInspect: function()
-    {
-        if (isInspecting)
-        {
-            this.stopInspecting();
-        }
-        else
-        {
-            Firebug.chrome.inspectButton.changeState("pressed");
-            this.startInspecting();
-        }
-    },
-
-    startInspecting: function()
-    {
-        isInspecting = true;
-
-        Firebug.chrome.selectPanel("HTML");
-
-        createInspectorFrame();
-
-        var size = Firebug.browser.getWindowScrollSize();
-
-        fbInspectFrame.style.width = size.width + "px";
-        fbInspectFrame.style.height = size.height + "px";
-
-        //addEvent(Firebug.browser.document.documentElement, "mousemove", Firebug.Inspector.onInspectingBody);
-
-        addEvent(fbInspectFrame, "mousemove", Firebug.Inspector.onInspecting);
-        addEvent(fbInspectFrame, "mousedown", Firebug.Inspector.onInspectingClick);
-    },
-
-    stopInspecting: function()
-    {
-        isInspecting = false;
-
-        if (outlineVisible) this.hideOutline();
-        removeEvent(fbInspectFrame, "mousemove", Firebug.Inspector.onInspecting);
-        removeEvent(fbInspectFrame, "mousedown", Firebug.Inspector.onInspectingClick);
-
-        destroyInspectorFrame();
-
-        Firebug.chrome.inspectButton.restore();
-
-        if (Firebug.chrome.type == "popup")
-            Firebug.chrome.node.focus();
-    },
-
-    onInspectingClick: function(e)
-    {
-        fbInspectFrame.style.display = "none";
-        var targ = Firebug.browser.getElementFromPoint(e.clientX, e.clientY);
-        fbInspectFrame.style.display = "block";
-
-        // Avoid inspecting the outline, and the FirebugUI
-        var id = targ.id;
-        if (id && /^fbOutline\w$/.test(id)) return;
-        if (id == "FirebugUI") return;
-
-        // Avoid looking at text nodes in Opera
-        while (targ.nodeType != 1) targ = targ.parentNode;
-
-        //Firebug.Console.log(targ);
-        Firebug.Inspector.stopInspecting();
-    },
-
-    onInspecting: function(e)
-    {
-        if (new Date().getTime() - lastInspecting > 30)
-        {
-            fbInspectFrame.style.display = "none";
-            var targ = Firebug.browser.getElementFromPoint(e.clientX, e.clientY);
-            fbInspectFrame.style.display = "block";
-
-            // Avoid inspecting the outline, and the FirebugUI
-            var id = targ.id;
-            if (id && /^fbOutline\w$/.test(id)) return;
-            if (id == "FirebugUI") return;
-
-            // Avoid looking at text nodes in Opera
-            while (targ.nodeType != 1) targ = targ.parentNode;
-
-            if (targ.nodeName.toLowerCase() == "body") return;
-
-            //Firebug.Console.log(e.clientX, e.clientY, targ);
-            Firebug.Inspector.drawOutline(targ);
-
-            if (ElementCache(targ))
-            {
-                var target = ""+ElementCache.key(targ);
-                var lazySelect = function()
-                {
-                    inspectorTS = new Date().getTime();
-
-                    if (Firebug.HTML)
-                        Firebug.HTML.selectTreeNode(""+ElementCache.key(targ));
-                };
-
-                if (inspectorTimer)
-                {
-                    clearTimeout(inspectorTimer);
-                    inspectorTimer = null;
-                }
-
-                if (new Date().getTime() - inspectorTS > 200)
-                    setTimeout(lazySelect, 0);
-                else
-                    inspectorTimer = setTimeout(lazySelect, 300);
-            }
-
-            lastInspecting = new Date().getTime();
-        }
-    },
-
-    // TODO: xxxpedro remove this?
-    onInspectingBody: function(e)
-    {
-        if (new Date().getTime() - lastInspecting > 30)
-        {
-            var targ = e.target;
-
-            // Avoid inspecting the outline, and the FirebugUI
-            var id = targ.id;
-            if (id && /^fbOutline\w$/.test(id)) return;
-            if (id == "FirebugUI") return;
-
-            // Avoid looking at text nodes in Opera
-            while (targ.nodeType != 1) targ = targ.parentNode;
-
-            if (targ.nodeName.toLowerCase() == "body") return;
-
-            //Firebug.Console.log(e.clientX, e.clientY, targ);
-            Firebug.Inspector.drawOutline(targ);
-
-            if (ElementCache.has(targ))
-                FBL.Firebug.HTML.selectTreeNode(""+ElementCache.key(targ));
-
-            lastInspecting = new Date().getTime();
-        }
-    },
-
-    /**
-     *
-     *   llttttttrr
-     *   llttttttrr
-     *   ll      rr
-     *   ll      rr
-     *   llbbbbbbrr
-     *   llbbbbbbrr
-     */
-    drawOutline: function(el)
-    {
-        var border = 2;
-        var scrollbarSize = 17;
-
-        var windowSize = Firebug.browser.getWindowSize();
-        var scrollSize = Firebug.browser.getWindowScrollSize();
-        var scrollPosition = Firebug.browser.getWindowScrollPosition();
-
-        var box = Firebug.browser.getElementBox(el);
-
-        var top = box.top;
-        var left = box.left;
-        var height = box.height;
-        var width = box.width;
-
-        var freeHorizontalSpace = scrollPosition.left + windowSize.width - left - width -
-                (!isIE && scrollSize.height > windowSize.height ? // is *vertical* scrollbar visible
-                 scrollbarSize : 0);
-
-        var freeVerticalSpace = scrollPosition.top + windowSize.height - top - height -
-                (!isIE && scrollSize.width > windowSize.width ? // is *horizontal* scrollbar visible
-                scrollbarSize : 0);
-
-        var numVerticalBorders = freeVerticalSpace > 0 ? 2 : 1;
-
-        var o = outlineElements;
-        var style;
-
-        style = o.fbOutlineT.style;
-        style.top = top-border + "px";
-        style.left = left + "px";
-        style.height = border + "px";  // TODO: on initialize()
-        style.width = width + "px";
-
-        style = o.fbOutlineL.style;
-        style.top = top-border + "px";
-        style.left = left-border + "px";
-        style.height = height+ numVerticalBorders*border + "px";
-        style.width = border + "px";  // TODO: on initialize()
-
-        style = o.fbOutlineB.style;
-        if (freeVerticalSpace > 0)
-        {
-            style.top = top+height + "px";
-            style.left = left + "px";
-            style.width = width + "px";
-            //style.height = border + "px"; // TODO: on initialize() or worst case?
-        }
-        else
-        {
-            style.top = -2*border + "px";
-            style.left = -2*border + "px";
-            style.width = border + "px";
-            //style.height = border + "px";
-        }
-
-        style = o.fbOutlineR.style;
-        if (freeHorizontalSpace > 0)
-        {
-            style.top = top-border + "px";
-            style.left = left+width + "px";
-            style.height = height + numVerticalBorders*border + "px";
-            style.width = (freeHorizontalSpace < border ? freeHorizontalSpace : border) + "px";
-        }
-        else
-        {
-            style.top = -2*border + "px";
-            style.left = -2*border + "px";
-            style.height = border + "px";
-            style.width = border + "px";
-        }
-
-        if (!outlineVisible) this.showOutline();
-    },
-
-    hideOutline: function()
-    {
-        if (!outlineVisible) return;
-
-        for (var name in outline)
-            offlineFragment.appendChild(outlineElements[name]);
-
-        outlineVisible = false;
-    },
-
-    showOutline: function()
-    {
-        if (outlineVisible) return;
-
-        if (boxModelVisible) this.hideBoxModel();
-
-        for (var name in outline)
-            Firebug.browser.document.getElementsByTagName("body")[0].appendChild(outlineElements[name]);
-
-        outlineVisible = true;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Box Model
-
-    drawBoxModel: function(el)
-    {
-        // avoid error when the element is not attached a document
-        if (!el || !el.parentNode)
-            return;
-
-        var box = Firebug.browser.getElementBox(el);
-
-        var windowSize = Firebug.browser.getWindowSize();
-        var scrollPosition = Firebug.browser.getWindowScrollPosition();
-
-        // element may be occluded by the chrome, when in frame mode
-        var offsetHeight = Firebug.chrome.type == "frame" ? Firebug.context.persistedState.height : 0;
-
-        // if element box is not inside the viewport, don't draw the box model
-        if (box.top > scrollPosition.top + windowSize.height - offsetHeight ||
-            box.left > scrollPosition.left + windowSize.width ||
-            scrollPosition.top > box.top + box.height ||
-            scrollPosition.left > box.left + box.width )
-            return;
-
-        var top = box.top;
-        var left = box.left;
-        var height = box.height;
-        var width = box.width;
-
-        var margin = Firebug.browser.getMeasurementBox(el, "margin");
-        var padding = Firebug.browser.getMeasurementBox(el, "padding");
-        var border = Firebug.browser.getMeasurementBox(el, "border");
-
-        boxModelStyle.top = top - margin.top + "px";
-        boxModelStyle.left = left - margin.left + "px";
-        boxModelStyle.height = height + margin.top + margin.bottom + "px";
-        boxModelStyle.width = width + margin.left + margin.right + "px";
-
-        boxBorderStyle.top = margin.top + "px";
-        boxBorderStyle.left = margin.left + "px";
-        boxBorderStyle.height = height + "px";
-        boxBorderStyle.width = width + "px";
-
-        boxPaddingStyle.top = margin.top + border.top + "px";
-        boxPaddingStyle.left = margin.left + border.left + "px";
-        boxPaddingStyle.height = height - border.top - border.bottom + "px";
-        boxPaddingStyle.width = width - border.left - border.right + "px";
-
-        boxContentStyle.top = margin.top + border.top + padding.top + "px";
-        boxContentStyle.left = margin.left + border.left + padding.left + "px";
-        boxContentStyle.height = height - border.top - padding.top - padding.bottom - border.bottom + "px";
-        boxContentStyle.width = width - border.left - padding.left - padding.right - border.right + "px";
-
-        if (!boxModelVisible) this.showBoxModel();
-    },
-
-    hideBoxModel: function()
-    {
-        if (!boxModelVisible) return;
-
-        offlineFragment.appendChild(boxModel);
-        boxModelVisible = false;
-    },
-
-    showBoxModel: function()
-    {
-        if (boxModelVisible) return;
-
-        if (outlineVisible) this.hideOutline();
-
-        Firebug.browser.document.getElementsByTagName("body")[0].appendChild(boxModel);
-        boxModelVisible = true;
-    }
-
-};
-
-// ************************************************************************************************
-// Inspector Internals
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// Shared variables
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// Internal variables
-
-var offlineFragment = null;
-
-var boxModelVisible = false;
-
-var boxModel, boxModelStyle,
-    boxMargin, boxMarginStyle,
-    boxBorder, boxBorderStyle,
-    boxPadding, boxPaddingStyle,
-    boxContent, boxContentStyle;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var resetStyle = "margin:0; padding:0; border:0; position:absolute; overflow:hidden; display:block;";
-var offscreenStyle = resetStyle + "top:-1234px; left:-1234px;";
-
-var inspectStyle = resetStyle + "z-index: 2147483500;";
-var inspectFrameStyle = resetStyle + "z-index: 2147483550; top:0; left:0; background:url(" +
-                        Env.Location.skinDir + "pixel_transparent.gif);";
-
-//if (Env.Options.enableTrace) inspectFrameStyle = resetStyle + "z-index: 2147483550; top: 0; left: 0; background: #ff0; opacity: 0.05; _filter: alpha(opacity=5);";
-
-var inspectModelOpacity = isIE ? "filter:alpha(opacity=80);" : "opacity:0.8;";
-var inspectModelStyle = inspectStyle + inspectModelOpacity;
-var inspectMarginStyle = inspectStyle + "background: #EDFF64; height:100%; width:100%;";
-var inspectBorderStyle = inspectStyle + "background: #666;";
-var inspectPaddingStyle = inspectStyle + "background: SlateBlue;";
-var inspectContentStyle = inspectStyle + "background: SkyBlue;";
-
-
-var outlineStyle = {
-    fbHorizontalLine: "background: #3875D7;height: 2px;",
-    fbVerticalLine: "background: #3875D7;width: 2px;"
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var lastInspecting = 0;
-var fbInspectFrame = null;
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var outlineVisible = false;
-var outlineElements = {};
-var outline = {
-  "fbOutlineT": "fbHorizontalLine",
-  "fbOutlineL": "fbVerticalLine",
-  "fbOutlineB": "fbHorizontalLine",
-  "fbOutlineR": "fbVerticalLine"
-};
-
-
-var getInspectingTarget = function()
-{
-
-};
-
-// ************************************************************************************************
-// Section
-
-var createInspectorFrame = function createInspectorFrame()
-{
-    fbInspectFrame = createGlobalElement("div");
-    fbInspectFrame.id = "fbInspectFrame";
-    fbInspectFrame.firebugIgnore = true;
-    fbInspectFrame.style.cssText = inspectFrameStyle;
-    Firebug.browser.document.getElementsByTagName("body")[0].appendChild(fbInspectFrame);
-};
-
-var destroyInspectorFrame = function destroyInspectorFrame()
-{
-    if (fbInspectFrame)
-    {
-        Firebug.browser.document.getElementsByTagName("body")[0].removeChild(fbInspectFrame);
-        fbInspectFrame = null;
-    }
-};
-
-var createOutlineInspector = function createOutlineInspector()
-{
-    for (var name in outline)
-    {
-        var el = outlineElements[name] = createGlobalElement("div");
-        el.id = name;
-        el.firebugIgnore = true;
-        el.style.cssText = inspectStyle + outlineStyle[outline[name]];
-        offlineFragment.appendChild(el);
-    }
-};
-
-var destroyOutlineInspector = function destroyOutlineInspector()
-{
-    for (var name in outline)
-    {
-        var el = outlineElements[name];
-        el.parentNode.removeChild(el);
-    }
-};
-
-var createBoxModelInspector = function createBoxModelInspector()
-{
-    boxModel = createGlobalElement("div");
-    boxModel.id = "fbBoxModel";
-    boxModel.firebugIgnore = true;
-    boxModelStyle = boxModel.style;
-    boxModelStyle.cssText = inspectModelStyle;
-
-    boxMargin = createGlobalElement("div");
-    boxMargin.id = "fbBoxMargin";
-    boxMarginStyle = boxMargin.style;
-    boxMarginStyle.cssText = inspectMarginStyle;
-    boxModel.appendChild(boxMargin);
-
-    boxBorder = createGlobalElement("div");
-    boxBorder.id = "fbBoxBorder";
-    boxBorderStyle = boxBorder.style;
-    boxBorderStyle.cssText = inspectBorderStyle;
-    boxModel.appendChild(boxBorder);
-
-    boxPadding = createGlobalElement("div");
-    boxPadding.id = "fbBoxPadding";
-    boxPaddingStyle = boxPadding.style;
-    boxPaddingStyle.cssText = inspectPaddingStyle;
-    boxModel.appendChild(boxPadding);
-
-    boxContent = createGlobalElement("div");
-    boxContent.id = "fbBoxContent";
-    boxContentStyle = boxContent.style;
-    boxContentStyle.cssText = inspectContentStyle;
-    boxModel.appendChild(boxContent);
-
-    offlineFragment.appendChild(boxModel);
-};
-
-var destroyBoxModelInspector = function destroyBoxModelInspector()
-{
-    boxModel.parentNode.removeChild(boxModel);
-};
-
-// ************************************************************************************************
-// Section
-
-
-
-
-// ************************************************************************************************
-}});
-
-// Problems in IE
-// FIXED - eval return
-// FIXED - addEventListener problem in IE
-// FIXED doc.createRange?
-//
-// class reserved word
-// test all honza examples in IE6 and IE7
-
-
-/* See license.txt for terms of usage */
-
-( /** @scope s_domplate */ function() {
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-/** @class */
-FBL.DomplateTag = function DomplateTag(tagName)
-{
-    this.tagName = tagName;
-};
-
-/**
- * @class
- * @extends FBL.DomplateTag
- */
-FBL.DomplateEmbed = function DomplateEmbed()
-{
-};
-
-/**
- * @class
- * @extends FBL.DomplateTag
- */
-FBL.DomplateLoop = function DomplateLoop()
-{
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var DomplateTag = FBL.DomplateTag;
-var DomplateEmbed = FBL.DomplateEmbed;
-var DomplateLoop = FBL.DomplateLoop;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var womb = null;
-
-FBL.domplate = function()
-{
-    var lastSubject;
-    for (var i = 0; i < arguments.length; ++i)
-        lastSubject = lastSubject ? copyObject(lastSubject, arguments[i]) : arguments[i];
-
-    for (var name in lastSubject)
-    {
-        var val = lastSubject[name];
-        if (isTag(val))
-            val.tag.subject = lastSubject;
-    }
-
-    return lastSubject;
-};
-
-var domplate = FBL.domplate;
-
-FBL.domplate.context = function(context, fn)
-{
-    var lastContext = domplate.lastContext;
-    domplate.topContext = context;
-    fn.apply(context);
-    domplate.topContext = lastContext;
-};
-
-FBL.TAG = function()
-{
-    var embed = new DomplateEmbed();
-    return embed.merge(arguments);
-};
-
-FBL.FOR = function()
-{
-    var loop = new DomplateLoop();
-    return loop.merge(arguments);
-};
-
-FBL.DomplateTag.prototype =
-{
-    merge: function(args, oldTag)
-    {
-        if (oldTag)
-            this.tagName = oldTag.tagName;
-
-        this.context = oldTag ? oldTag.context : null;
-        this.subject = oldTag ? oldTag.subject : null;
-        this.attrs = oldTag ? copyObject(oldTag.attrs) : {};
-        this.classes = oldTag ? copyObject(oldTag.classes) : {};
-        this.props = oldTag ? copyObject(oldTag.props) : null;
-        this.listeners = oldTag ? copyArray(oldTag.listeners) : null;
-        this.children = oldTag ? copyArray(oldTag.children) : [];
-        this.vars = oldTag ? copyArray(oldTag.vars) : [];
-
-        var attrs = args.length ? args[0] : null;
-        var hasAttrs = typeof(attrs) == "object" && !isTag(attrs);
-
-        this.children = [];
-
-        if (domplate.topContext)
-            this.context = domplate.topContext;
-
-        if (args.length)
-            parseChildren(args, hasAttrs ? 1 : 0, this.vars, this.children);
-
-        if (hasAttrs)
-            this.parseAttrs(attrs);
-
-        return creator(this, DomplateTag);
-    },
-
-    parseAttrs: function(args)
-    {
-        for (var name in args)
-        {
-            var val = parseValue(args[name]);
-            readPartNames(val, this.vars);
-
-            if (name.indexOf("on") == 0)
-            {
-                var eventName = name.substr(2);
-                if (!this.listeners)
-                    this.listeners = [];
-                this.listeners.push(eventName, val);
-            }
-            else if (name.indexOf("_") == 0)
-            {
-                var propName = name.substr(1);
-                if (!this.props)
-                    this.props = {};
-                this.props[propName] = val;
-            }
-            else if (name.indexOf("$") == 0)
-            {
-                var className = name.substr(1);
-                if (!this.classes)
-                    this.classes = {};
-                this.classes[className] = val;
-            }
-            else
-            {
-                if (name == "class" && this.attrs.hasOwnProperty(name) )
-                    this.attrs[name] += " " + val;
-                else
-                    this.attrs[name] = val;
-            }
-        }
-    },
-
-    compile: function()
-    {
-        if (this.renderMarkup)
-            return;
-
-        this.compileMarkup();
-        this.compileDOM();
-
-        //if (FBTrace.DBG_DOM) FBTrace.sysout("domplate renderMarkup: ", this.renderMarkup);
-        //if (FBTrace.DBG_DOM) FBTrace.sysout("domplate renderDOM:", this.renderDOM);
-        //if (FBTrace.DBG_DOM) FBTrace.sysout("domplate domArgs:", this.domArgs);
-    },
-
-    compileMarkup: function()
-    {
-        this.markupArgs = [];
-        var topBlock = [], topOuts = [], blocks = [], info = {args: this.markupArgs, argIndex: 0};
-
-        this.generateMarkup(topBlock, topOuts, blocks, info);
-        this.addCode(topBlock, topOuts, blocks);
-
-        var fnBlock = ['r=(function (__code__, __context__, __in__, __out__'];
-        for (var i = 0; i < info.argIndex; ++i)
-            fnBlock.push(', s', i);
-        fnBlock.push(') {');
-
-        if (this.subject)
-            fnBlock.push('with (this) {');
-        if (this.context)
-            fnBlock.push('with (__context__) {');
-        fnBlock.push('with (__in__) {');
-
-        fnBlock.push.apply(fnBlock, blocks);
-
-        if (this.subject)
-            fnBlock.push('}');
-        if (this.context)
-            fnBlock.push('}');
-
-        fnBlock.push('}})');
-
-        function __link__(tag, code, outputs, args)
-        {
-            if (!tag || !tag.tag)
-                return;
-
-            tag.tag.compile();
-
-            var tagOutputs = [];
-            var markupArgs = [code, tag.tag.context, args, tagOutputs];
-            markupArgs.push.apply(markupArgs, tag.tag.markupArgs);
-            tag.tag.renderMarkup.apply(tag.tag.subject, markupArgs);
-
-            outputs.push(tag);
-            outputs.push(tagOutputs);
-        }
-
-        function __escape__(value)
-        {
-            function replaceChars(ch)
-            {
-                switch (ch)
-                {
-                    case "<":
-                        return "&lt;";
-                    case ">":
-                        return "&gt;";
-                    case "&":
-                        return "&amp;";
-                    case "'":
-                        return "&#39;";
-                    case '"':
-                        return "&quot;";
-                }
-                return "?";
-            };
-            return String(value).replace(/[<>&"']/g, replaceChars);
-        }
-
-        function __loop__(iter, outputs, fn)
-        {
-            var iterOuts = [];
-            outputs.push(iterOuts);
-
-            if (iter instanceof Array)
-                iter = new ArrayIterator(iter);
-
-            try
-            {
-                while (1)
-                {
-                    var value = iter.next();
-                    var itemOuts = [0,0];
-                    iterOuts.push(itemOuts);
-                    fn.apply(this, [value, itemOuts]);
-                }
-            }
-            catch (exc)
-            {
-                if (exc != StopIteration)
-                    throw exc;
-            }
-        }
-
-        var js = fnBlock.join("");
-        var r = null;
-        eval(js);
-        this.renderMarkup = r;
-    },
-
-    getVarNames: function(args)
-    {
-        if (this.vars)
-            args.push.apply(args, this.vars);
-
-        for (var i = 0; i < this.children.length; ++i)
-        {
-            var child = this.children[i];
-            if (isTag(child))
-                child.tag.getVarNames(args);
-            else if (child instanceof Parts)
-            {
-                for (var i = 0; i < child.parts.length; ++i)
-                {
-                    if (child.parts[i] instanceof Variable)
-                    {
-                        var name = child.parts[i].name;
-                        var names = name.split(".");
-                        args.push(names[0]);
-                    }
-                }
-            }
-        }
-    },
-
-    generateMarkup: function(topBlock, topOuts, blocks, info)
-    {
-        topBlock.push(',"<', this.tagName, '"');
-
-        for (var name in this.attrs)
-        {
-            if (name != "class")
-            {
-                var val = this.attrs[name];
-                topBlock.push(', " ', name, '=\\""');
-                addParts(val, ',', topBlock, info, true);
-                topBlock.push(', "\\""');
-            }
-        }
-
-        if (this.listeners)
-        {
-            for (var i = 0; i < this.listeners.length; i += 2)
-                readPartNames(this.listeners[i+1], topOuts);
-        }
-
-        if (this.props)
-        {
-            for (var name in this.props)
-                readPartNames(this.props[name], topOuts);
-        }
-
-        if ( this.attrs.hasOwnProperty("class") || this.classes)
-        {
-            topBlock.push(', " class=\\""');
-            if (this.attrs.hasOwnProperty("class"))
-                addParts(this.attrs["class"], ',', topBlock, info, true);
-              topBlock.push(', " "');
-            for (var name in this.classes)
-            {
-                topBlock.push(', (');
-                addParts(this.classes[name], '', topBlock, info);
-                topBlock.push(' ? "', name, '" + " " : "")');
-            }
-            topBlock.push(', "\\""');
-        }
-        topBlock.push(',">"');
-
-        this.generateChildMarkup(topBlock, topOuts, blocks, info);
-        topBlock.push(',"</', this.tagName, '>"');
-    },
-
-    generateChildMarkup: function(topBlock, topOuts, blocks, info)
-    {
-        for (var i = 0; i < this.children.length; ++i)
-        {
-            var child = this.children[i];
-            if (isTag(child))
-                child.tag.generateMarkup(topBlock, topOuts, blocks, info);
-            else
-                addParts(child, ',', topBlock, info, true);
-        }
-    },
-
-    addCode: function(topBlock, topOuts, blocks)
-    {
-        if (topBlock.length)
-            blocks.push('__code__.push(""', topBlock.join(""), ');');
-        if (topOuts.length)
-            blocks.push('__out__.push(', topOuts.join(","), ');');
-        topBlock.splice(0, topBlock.length);
-        topOuts.splice(0, topOuts.length);
-    },
-
-    addLocals: function(blocks)
-    {
-        var varNames = [];
-        this.getVarNames(varNames);
-
-        var map = {};
-        for (var i = 0; i < varNames.length; ++i)
-        {
-            var name = varNames[i];
-            if ( map.hasOwnProperty(name) )
-                continue;
-
-            map[name] = 1;
-            var names = name.split(".");
-            blocks.push('var ', names[0] + ' = ' + '__in__.' + names[0] + ';');
-        }
-    },
-
-    compileDOM: function()
-    {
-        var path = [];
-        var blocks = [];
-        this.domArgs = [];
-        path.embedIndex = 0;
-        path.loopIndex = 0;
-        path.staticIndex = 0;
-        path.renderIndex = 0;
-        var nodeCount = this.generateDOM(path, blocks, this.domArgs);
-
-        var fnBlock = ['r=(function (root, context, o'];
-
-        for (var i = 0; i < path.staticIndex; ++i)
-            fnBlock.push(', ', 's'+i);
-
-        for (var i = 0; i < path.renderIndex; ++i)
-            fnBlock.push(', ', 'd'+i);
-
-        fnBlock.push(') {');
-        for (var i = 0; i < path.loopIndex; ++i)
-            fnBlock.push('var l', i, ' = 0;');
-        for (var i = 0; i < path.embedIndex; ++i)
-            fnBlock.push('var e', i, ' = 0;');
-
-        if (this.subject)
-            fnBlock.push('with (this) {');
-        if (this.context)
-            fnBlock.push('with (context) {');
-
-        fnBlock.push(blocks.join(""));
-
-        if (this.subject)
-            fnBlock.push('}');
-        if (this.context)
-            fnBlock.push('}');
-
-        fnBlock.push('return ', nodeCount, ';');
-        fnBlock.push('})');
-
-        function __bind__(object, fn)
-        {
-            return function(event) { return fn.apply(object, [event]); };
-        }
-
-        function __link__(node, tag, args)
-        {
-            if (!tag || !tag.tag)
-                return;
-
-            tag.tag.compile();
-
-            var domArgs = [node, tag.tag.context, 0];
-            domArgs.push.apply(domArgs, tag.tag.domArgs);
-            domArgs.push.apply(domArgs, args);
-            //if (FBTrace.DBG_DOM) FBTrace.dumpProperties("domplate__link__ domArgs:", domArgs);
-            return tag.tag.renderDOM.apply(tag.tag.subject, domArgs);
-        }
-
-        var self = this;
-        function __loop__(iter, fn)
-        {
-            var nodeCount = 0;
-            for (var i = 0; i < iter.length; ++i)
-            {
-                iter[i][0] = i;
-                iter[i][1] = nodeCount;
-                nodeCount += fn.apply(this, iter[i]);
-                //if (FBTrace.DBG_DOM) FBTrace.sysout("nodeCount", nodeCount);
-            }
-            return nodeCount;
-        }
-
-        function __path__(parent, offset)
-        {
-            //if (FBTrace.DBG_DOM) FBTrace.sysout("domplate __path__ offset: "+ offset+"\n");
-            var root = parent;
-
-            for (var i = 2; i < arguments.length; ++i)
-            {
-                var index = arguments[i];
-                if (i == 3)
-                    index += offset;
-
-                if (index == -1)
-                    parent = parent.parentNode;
-                else
-                    parent = parent.childNodes[index];
-            }
-
-            //if (FBTrace.DBG_DOM) FBTrace.sysout("domplate: "+arguments[2]+", root: "+ root+", parent: "+ parent+"\n");
-            return parent;
-        }
-
-        var js = fnBlock.join("");
-        //if (FBTrace.DBG_DOM) FBTrace.sysout(js.replace(/(\;|\{)/g, "$1\n"));
-        var r = null;
-        eval(js);
-        this.renderDOM = r;
-    },
-
-    generateDOM: function(path, blocks, args)
-    {
-        if (this.listeners || this.props)
-            this.generateNodePath(path, blocks);
-
-        if (this.listeners)
-        {
-            for (var i = 0; i < this.listeners.length; i += 2)
-            {
-                var val = this.listeners[i+1];
-                var arg = generateArg(val, path, args);
-                //blocks.push('node.addEventListener("', this.listeners[i], '", __bind__(this, ', arg, '), false);');
-                blocks.push('addEvent(node, "', this.listeners[i], '", __bind__(this, ', arg, '), false);');
-            }
-        }
-
-        if (this.props)
-        {
-            for (var name in this.props)
-            {
-                var val = this.props[name];
-                var arg = generateArg(val, path, args);
-                blocks.push('node.', name, ' = ', arg, ';');
-            }
-        }
-
-        this.generateChildDOM(path, blocks, args);
-        return 1;
-    },
-
-    generateNodePath: function(path, blocks)
-    {
-        blocks.push("var node = __path__(root, o");
-        for (var i = 0; i < path.length; ++i)
-            blocks.push(",", path[i]);
-        blocks.push(");");
-    },
-
-    generateChildDOM: function(path, blocks, args)
-    {
-        path.push(0);
-        for (var i = 0; i < this.children.length; ++i)
-        {
-            var child = this.children[i];
-            if (isTag(child))
-                path[path.length-1] += '+' + child.tag.generateDOM(path, blocks, args);
-            else
-                path[path.length-1] += '+1';
-        }
-        path.pop();
-    }
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-FBL.DomplateEmbed.prototype = copyObject(FBL.DomplateTag.prototype,
-/** @lends FBL.DomplateEmbed.prototype */
-{
-    merge: function(args, oldTag)
-    {
-        this.value = oldTag ? oldTag.value : parseValue(args[0]);
-        this.attrs = oldTag ? oldTag.attrs : {};
-        this.vars = oldTag ? copyArray(oldTag.vars) : [];
-
-        var attrs = args[1];
-        for (var name in attrs)
-        {
-            var val = parseValue(attrs[name]);
-            this.attrs[name] = val;
-            readPartNames(val, this.vars);
-        }
-
-        return creator(this, DomplateEmbed);
-    },
-
-    getVarNames: function(names)
-    {
-        if (this.value instanceof Parts)
-            names.push(this.value.parts[0].name);
-
-        if (this.vars)
-            names.push.apply(names, this.vars);
-    },
-
-    generateMarkup: function(topBlock, topOuts, blocks, info)
-    {
-        this.addCode(topBlock, topOuts, blocks);
-
-        blocks.push('__link__(');
-        addParts(this.value, '', blocks, info);
-        blocks.push(', __code__, __out__, {');
-
-        var lastName = null;
-        for (var name in this.attrs)
-        {
-            if (lastName)
-                blocks.push(',');
-            lastName = name;
-
-            var val = this.attrs[name];
-            blocks.push('"', name, '":');
-            addParts(val, '', blocks, info);
-        }
-
-        blocks.push('});');
-        //this.generateChildMarkup(topBlock, topOuts, blocks, info);
-    },
-
-    generateDOM: function(path, blocks, args)
-    {
-        var embedName = 'e'+path.embedIndex++;
-
-        this.generateNodePath(path, blocks);
-
-        var valueName = 'd' + path.renderIndex++;
-        var argsName = 'd' + path.renderIndex++;
-        blocks.push(embedName + ' = __link__(node, ', valueName, ', ', argsName, ');');
-
-        return embedName;
-    }
-});
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-FBL.DomplateLoop.prototype = copyObject(FBL.DomplateTag.prototype,
-/** @lends FBL.DomplateLoop.prototype */
-{
-    merge: function(args, oldTag)
-    {
-        this.varName = oldTag ? oldTag.varName : args[0];
-        this.iter = oldTag ? oldTag.iter : parseValue(args[1]);
-        this.vars = [];
-
-        this.children = oldTag ? copyArray(oldTag.children) : [];
-
-        var offset = Math.min(args.length, 2);
-        parseChildren(args, offset, this.vars, this.children);
-
-        return creator(this, DomplateLoop);
-    },
-
-    getVarNames: function(names)
-    {
-        if (this.iter instanceof Parts)
-            names.push(this.iter.parts[0].name);
-
-        DomplateTag.prototype.getVarNames.apply(this, [names]);
-    },
-
-    generateMarkup: function(topBlock, topOuts, blocks, info)
-    {
-        this.addCode(topBlock, topOuts, blocks);
-
-        var iterName;
-        if (this.iter instanceof Parts)
-        {
-            var part = this.iter.parts[0];
-            iterName = part.name;
-
-            if (part.format)
-            {
-                for (var i = 0; i < part.format.length; ++i)
-                    iterName = part.format[i] + "(" + iterName + ")";
-            }
-        }
-        else
-            iterName = this.iter;
-
-        blocks.push('__loop__.apply(this, [', iterName, ', __out__, function(', this.varName, ', __out__) {');
-        this.generateChildMarkup(topBlock, topOuts, blocks, info);
-        this.addCode(topBlock, topOuts, blocks);
-        blocks.push('}]);');
-    },
-
-    generateDOM: function(path, blocks, args)
-    {
-        var iterName = 'd'+path.renderIndex++;
-        var counterName = 'i'+path.loopIndex;
-        var loopName = 'l'+path.loopIndex++;
-
-        if (!path.length)
-            path.push(-1, 0);
-
-        var preIndex = path.renderIndex;
-        path.renderIndex = 0;
-
-        var nodeCount = 0;
-
-        var subBlocks = [];
-        var basePath = path[path.length-1];
-        for (var i = 0; i < this.children.length; ++i)
-        {
-            path[path.length-1] = basePath+'+'+loopName+'+'+nodeCount;
-
-            var child = this.children[i];
-            if (isTag(child))
-                nodeCount += '+' + child.tag.generateDOM(path, subBlocks, args);
-            else
-                nodeCount += '+1';
-        }
-
-        path[path.length-1] = basePath+'+'+loopName;
-
-        blocks.push(loopName,' = __loop__.apply(this, [', iterName, ', function(', counterName,',',loopName);
-        for (var i = 0; i < path.renderIndex; ++i)
-            blocks.push(',d'+i);
-        blocks.push(') {');
-        blocks.push(subBlocks.join(""));
-        blocks.push('return ', nodeCount, ';');
-        blocks.push('}]);');
-
-        path.renderIndex = preIndex;
-
-        return loopName;
-    }
-});
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-/** @class */
-function Variable(name, format)
-{
-    this.name = name;
-    this.format = format;
-}
-
-/** @class */
-function Parts(parts)
-{
-    this.parts = parts;
-}
-
-// ************************************************************************************************
-
-function parseParts(str)
-{
-    var re = /\$([_A-Za-z][_A-Za-z0-9.|]*)/g;
-    var index = 0;
-    var parts = [];
-
-    var m;
-    while (m = re.exec(str))
-    {
-        var pre = str.substr(index, (re.lastIndex-m[0].length)-index);
-        if (pre)
-            parts.push(pre);
-
-        var expr = m[1].split("|");
-        parts.push(new Variable(expr[0], expr.slice(1)));
-        index = re.lastIndex;
-    }
-
-    if (!index)
-        return str;
-
-    var post = str.substr(index);
-    if (post)
-        parts.push(post);
-
-    return new Parts(parts);
-}
-
-function parseValue(val)
-{
-    return typeof(val) == 'string' ? parseParts(val) : val;
-}
-
-function parseChildren(args, offset, vars, children)
-{
-    for (var i = offset; i < args.length; ++i)
-    {
-        var val = parseValue(args[i]);
-        children.push(val);
-        readPartNames(val, vars);
-    }
-}
-
-function readPartNames(val, vars)
-{
-    if (val instanceof Parts)
-    {
-        for (var i = 0; i < val.parts.length; ++i)
-        {
-            var part = val.parts[i];
-            if (part instanceof Variable)
-                vars.push(part.name);
-        }
-    }
-}
-
-function generateArg(val, path, args)
-{
-    if (val instanceof Parts)
-    {
-        var vals = [];
-        for (var i = 0; i < val.parts.length; ++i)
-        {
-            var part = val.parts[i];
-            if (part instanceof Variable)
-            {
-                var varName = 'd'+path.renderIndex++;
-                if (part.format)
-                {
-                    for (var j = 0; j < part.format.length; ++j)
-                        varName = part.format[j] + '(' + varName + ')';
-                }
-
-                vals.push(varName);
-            }
-            else
-                vals.push('"'+part.replace(/"/g, '\\"')+'"');
-        }
-
-        return vals.join('+');
-    }
-    else
-    {
-        args.push(val);
-        return 's' + path.staticIndex++;
-    }
-}
-
-function addParts(val, delim, block, info, escapeIt)
-{
-    var vals = [];
-    if (val instanceof Parts)
-    {
-        for (var i = 0; i < val.parts.length; ++i)
-        {
-            var part = val.parts[i];
-            if (part instanceof Variable)
-            {
-                var partName = part.name;
-                if (part.format)
-                {
-                    for (var j = 0; j < part.format.length; ++j)
-                        partName = part.format[j] + "(" + partName + ")";
-                }
-
-                if (escapeIt)
-                    vals.push("__escape__(" + partName + ")");
-                else
-                    vals.push(partName);
-            }
-            else
-                vals.push('"'+ part + '"');
-        }
-    }
-    else if (isTag(val))
-    {
-        info.args.push(val);
-        vals.push('s'+info.argIndex++);
-    }
-    else
-        vals.push('"'+ val + '"');
-
-    var parts = vals.join(delim);
-    if (parts)
-        block.push(delim, parts);
-}
-
-function isTag(obj)
-{
-    return (typeof(obj) == "function" || obj instanceof Function) && !!obj.tag;
-}
-
-function creator(tag, cons)
-{
-    var fn = new Function(
-        "var tag = arguments.callee.tag;" +
-        "var cons = arguments.callee.cons;" +
-        "var newTag = new cons();" +
-        "return newTag.merge(arguments, tag);");
-
-    fn.tag = tag;
-    fn.cons = cons;
-    extend(fn, Renderer);
-
-    return fn;
-}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-function copyArray(oldArray)
-{
-    var ary = [];
-    if (oldArray)
-        for (var i = 0; i < oldArray.length; ++i)
-            ary.push(oldArray[i]);
-   return ary;
-}
-
-function copyObject(l, r)
-{
-    var m = {};
-    extend(m, l);
-    extend(m, r);
-    return m;
-}
-
-function extend(l, r)
-{
-    for (var n in r)
-        l[n] = r[n];
-}
-
-function addEvent(object, name, handler)
-{
-    if (document.all)
-        object.attachEvent("on"+name, handler);
-    else
-        object.addEventListener(name, handler, false);
-}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-/** @class */
-function ArrayIterator(array)
-{
-    var index = -1;
-
-    this.next = function()
-    {
-        if (++index >= array.length)
-            throw StopIteration;
-
-        return array[index];
-    };
-}
-
-/** @class */
-function StopIteration() {}
-
-FBL.$break = function()
-{
-    throw StopIteration;
-};
-
-// ************************************************************************************************
-
-/** @namespace */
-var Renderer =
-{
-    renderHTML: function(args, outputs, self)
-    {
-        var code = [];
-        var markupArgs = [code, this.tag.context, args, outputs];
-        markupArgs.push.apply(markupArgs, this.tag.markupArgs);
-        this.tag.renderMarkup.apply(self ? self : this.tag.subject, markupArgs);
-        return code.join("");
-    },
-
-    insertRows: function(args, before, self)
-    {
-        this.tag.compile();
-
-        var outputs = [];
-        var html = this.renderHTML(args, outputs, self);
-
-        var doc = before.ownerDocument;
-        var div = doc.createElement("div");
-        div.innerHTML = "<table><tbody>"+html+"</tbody></table>";
-
-        var tbody = div.firstChild.firstChild;
-        var parent = before.tagName == "TR" ? before.parentNode : before;
-        var after = before.tagName == "TR" ? before.nextSibling : null;
-
-        var firstRow = tbody.firstChild, lastRow;
-        while (tbody.firstChild)
-        {
-            lastRow = tbody.firstChild;
-            if (after)
-                parent.insertBefore(lastRow, after);
-            else
-                parent.appendChild(lastRow);
-        }
-
-        var offset = 0;
-        if (before.tagName == "TR")
-        {
-            var node = firstRow.parentNode.firstChild;
-            for (; node && node != firstRow; node = node.nextSibling)
-                ++offset;
-        }
-
-        var domArgs = [firstRow, this.tag.context, offset];
-        domArgs.push.apply(domArgs, this.tag.domArgs);
-        domArgs.push.apply(domArgs, outputs);
-
-        this.tag.renderDOM.apply(self ? self : this.tag.subject, domArgs);
-        return [firstRow, lastRow];
-    },
-
-    insertBefore: function(args, before, self)
-    {
-        return this.insertNode(args, before.ownerDocument, before, false, self);
-    },
-
-    insertAfter: function(args, after, self)
-    {
-        return this.insertNode(args, after.ownerDocument, after, true, self);
-    },
-
-    insertNode: function(args, doc, element, isAfter, self)
-    {
-        if (!args)
-            args = {};
-
-        this.tag.compile();
-
-        var outputs = [];
-        var html = this.renderHTML(args, outputs, self);
-
-        //if (FBTrace.DBG_DOM)
-        //    FBTrace.sysout("domplate.insertNode html: "+html+"\n");
-
-        var doc = element.ownerDocument;
-        if (!womb || womb.ownerDocument != doc)
-            womb = doc.createElement("div");
-
-        womb.innerHTML = html;
-
-        var root = womb.firstChild;
-        if (isAfter)
-        {
-            while (womb.firstChild)
-                if (element.nextSibling)
-                    element.parentNode.insertBefore(womb.firstChild, element.nextSibling);
-                else
-                    element.parentNode.appendChild(womb.firstChild);
-        }
-        else
-        {
-            while (womb.lastChild)
-                element.parentNode.insertBefore(womb.lastChild, element);
-        }
-
-        var domArgs = [root, this.tag.context, 0];
-        domArgs.push.apply(domArgs, this.tag.domArgs);
-        domArgs.push.apply(domArgs, outputs);
-
-        //if (FBTrace.DBG_DOM)
-        //    FBTrace.sysout("domplate.insertNode domArgs:", domArgs);
-        this.tag.renderDOM.apply(self ? self : this.tag.subject, domArgs);
-
-        return root;
-    },
-    /**/
-
-    /*
-    insertAfter: function(args, before, self)
-    {
-        this.tag.compile();
-
-        var outputs = [];
-        var html = this.renderHTML(args, outputs, self);
-
-        var doc = before.ownerDocument;
-        if (!womb || womb.ownerDocument != doc)
-            womb = doc.createElement("div");
-
-        womb.innerHTML = html;
-
-        var root = womb.firstChild;
-        while (womb.firstChild)
-            if (before.nextSibling)
-                before.parentNode.insertBefore(womb.firstChild, before.nextSibling);
-            else
-                before.parentNode.appendChild(womb.firstChild);
-
-        var domArgs = [root, this.tag.context, 0];
-        domArgs.push.apply(domArgs, this.tag.domArgs);
-        domArgs.push.apply(domArgs, outputs);
-
-        this.tag.renderDOM.apply(self ? self : (this.tag.subject ? this.tag.subject : null),
-            domArgs);
-
-        return root;
-    },
-    /**/
-
-    replace: function(args, parent, self)
-    {
-        this.tag.compile();
-
-        var outputs = [];
-        var html = this.renderHTML(args, outputs, self);
-
-        var root;
-        if (parent.nodeType == 1)
-        {
-            parent.innerHTML = html;
-            root = parent.firstChild;
-        }
-        else
-        {
-            if (!parent || parent.nodeType != 9)
-                parent = document;
-
-            if (!womb || womb.ownerDocument != parent)
-                womb = parent.createElement("div");
-            womb.innerHTML = html;
-
-            root = womb.firstChild;
-            //womb.removeChild(root);
-        }
-
-        var domArgs = [root, this.tag.context, 0];
-        domArgs.push.apply(domArgs, this.tag.domArgs);
-        domArgs.push.apply(domArgs, outputs);
-        this.tag.renderDOM.apply(self ? self : this.tag.subject, domArgs);
-
-        return root;
-    },
-
-    append: function(args, parent, self)
-    {
-        this.tag.compile();
-
-        var outputs = [];
-        var html = this.renderHTML(args, outputs, self);
-        //if (FBTrace.DBG_DOM) FBTrace.sysout("domplate.append html: "+html+"\n");
-
-        if (!womb || womb.ownerDocument != parent.ownerDocument)
-            womb = parent.ownerDocument.createElement("div");
-        womb.innerHTML = html;
-
-        // TODO: xxxpedro domplate port to Firebug
-        var root = womb.firstChild;
-        while (womb.firstChild)
-            parent.appendChild(womb.firstChild);
-
-        // clearing element reference to avoid reference error in IE8 when switching contexts
-        womb = null;
-
-        var domArgs = [root, this.tag.context, 0];
-        domArgs.push.apply(domArgs, this.tag.domArgs);
-        domArgs.push.apply(domArgs, outputs);
-
-        //if (FBTrace.DBG_DOM) FBTrace.dumpProperties("domplate append domArgs:", domArgs);
-        this.tag.renderDOM.apply(self ? self : this.tag.subject, domArgs);
-
-        return root;
-    }
-};
-
-// ************************************************************************************************
-
-function defineTags()
-{
-    for (var i = 0; i < arguments.length; ++i)
-    {
-        var tagName = arguments[i];
-        var fn = new Function("var newTag = new arguments.callee.DomplateTag('"+tagName+"'); return newTag.merge(arguments);");
-        fn.DomplateTag = DomplateTag;
-
-        var fnName = tagName.toUpperCase();
-        FBL[fnName] = fn;
-    }
-}
-
-defineTags(
-    "a", "button", "br", "canvas", "code", "col", "colgroup", "div", "fieldset", "form", "h1", "h2", "h3", "hr",
-     "img", "input", "label", "legend", "li", "ol", "optgroup", "option", "p", "pre", "select",
-    "span", "strong", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "tr", "tt", "ul", "iframe"
-);
-
-})();
-
-
-/* See license.txt for terms of usage */
-
-var FirebugReps = FBL.ns(function() { with (FBL) {
-
-
-// ************************************************************************************************
-// Common Tags
-
-var OBJECTBOX = this.OBJECTBOX =
-    SPAN({"class": "objectBox objectBox-$className"});
-
-var OBJECTBLOCK = this.OBJECTBLOCK =
-    DIV({"class": "objectBox objectBox-$className"});
-
-var OBJECTLINK = this.OBJECTLINK = isIE6 ? // IE6 object link representation
-    A({
-        "class": "objectLink objectLink-$className a11yFocus",
-        href: "javascript:void(0)",
-        // workaround to show XPath (a better approach would use the tooltip on mouseover,
-        // so the XPath information would be calculated dynamically, but we need to create
-        // a tooltip class/wrapper around Menu or InfoTip)
-        title: "$object|FBL.getElementXPath",
-        _repObject: "$object"
-    })
-    : // Other browsers
-    A({
-        "class": "objectLink objectLink-$className a11yFocus",
-        // workaround to show XPath (a better approach would use the tooltip on mouseover,
-        // so the XPath information would be calculated dynamically, but we need to create
-        // a tooltip class/wrapper around Menu or InfoTip)
-        title: "$object|FBL.getElementXPath",
-        _repObject: "$object"
-    });
-
-
-// ************************************************************************************************
-
-this.Undefined = domplate(Firebug.Rep,
-{
-    tag: OBJECTBOX("undefined"),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "undefined",
-
-    supportsObject: function(object, type)
-    {
-        return type == "undefined";
-    }
-});
-
-// ************************************************************************************************
-
-this.Null = domplate(Firebug.Rep,
-{
-    tag: OBJECTBOX("null"),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "null",
-
-    supportsObject: function(object, type)
-    {
-        return object == null;
-    }
-});
-
-// ************************************************************************************************
-
-this.Nada = domplate(Firebug.Rep,
-{
-    tag: SPAN(""),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "nada"
-});
-
-// ************************************************************************************************
-
-this.Number = domplate(Firebug.Rep,
-{
-    tag: OBJECTBOX("$object"),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "number",
-
-    supportsObject: function(object, type)
-    {
-        return type == "boolean" || type == "number";
-    }
-});
-
-// ************************************************************************************************
-
-this.String = domplate(Firebug.Rep,
-{
-    tag: OBJECTBOX("&quot;$object&quot;"),
-
-    shortTag: OBJECTBOX("&quot;$object|cropString&quot;"),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "string",
-
-    supportsObject: function(object, type)
-    {
-        return type == "string";
-    }
-});
-
-// ************************************************************************************************
-
-this.Text = domplate(Firebug.Rep,
-{
-    tag: OBJECTBOX("$object"),
-
-    shortTag: OBJECTBOX("$object|cropString"),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "text"
-});
-
-// ************************************************************************************************
-
-this.Caption = domplate(Firebug.Rep,
-{
-    tag: SPAN({"class": "caption"}, "$object")
-});
-
-// ************************************************************************************************
-
-this.Warning = domplate(Firebug.Rep,
-{
-    tag: DIV({"class": "warning focusRow", role : 'listitem'}, "$object|STR")
-});
-
-// ************************************************************************************************
-
-this.Func = domplate(Firebug.Rep,
-{
-    tag:
-        OBJECTLINK("$object|summarizeFunction"),
-
-    summarizeFunction: function(fn)
-    {
-        var fnRegex = /function ([^(]+\([^)]*\)) \{/;
-        var fnText = safeToString(fn);
-
-        var m = fnRegex.exec(fnText);
-        return m ? m[1] : "function()";
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    copySource: function(fn)
-    {
-        copyToClipboard(safeToString(fn));
-    },
-
-    monitor: function(fn, script, monitored)
-    {
-        if (monitored)
-            Firebug.Debugger.unmonitorScript(fn, script, "monitor");
-        else
-            Firebug.Debugger.monitorScript(fn, script, "monitor");
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "function",
-
-    supportsObject: function(object, type)
-    {
-        return isFunction(object);
-    },
-
-    inspectObject: function(fn, context)
-    {
-        var sourceLink = findSourceForFunction(fn, context);
-        if (sourceLink)
-            Firebug.chrome.select(sourceLink);
-        if (FBTrace.DBG_FUNCTION_NAME)
-            FBTrace.sysout("reps.function.inspectObject selected sourceLink is ", sourceLink);
-    },
-
-    getTooltip: function(fn, context)
-    {
-        var script = findScriptForFunctionInContext(context, fn);
-        if (script)
-            return $STRF("Line", [normalizeURL(script.fileName), script.baseLineNumber]);
-        else
-            if (fn.toString)
-                return fn.toString();
-    },
-
-    getTitle: function(fn, context)
-    {
-        var name = fn.name ? fn.name : "function";
-        return name + "()";
-    },
-
-    getContextMenuItems: function(fn, target, context, script)
-    {
-        if (!script)
-            script = findScriptForFunctionInContext(context, fn);
-        if (!script)
-            return;
-
-        var scriptInfo = getSourceFileAndLineByScript(context, script);
-        var monitored = scriptInfo ? fbs.isMonitored(scriptInfo.sourceFile.href, scriptInfo.lineNo) : false;
-
-        var name = script ? getFunctionName(script, context) : fn.name;
-        return [
-            {label: "CopySource", command: bindFixed(this.copySource, this, fn) },
-            "-",
-            {label: $STRF("ShowCallsInConsole", [name]), nol10n: true,
-             type: "checkbox", checked: monitored,
-             command: bindFixed(this.monitor, this, fn, script, monitored) }
-        ];
-    }
-});
-
-// ************************************************************************************************
-/*
-this.jsdScript = domplate(Firebug.Rep,
-{
-    copySource: function(script)
-    {
-        var fn = script.functionObject.getWrappedValue();
-        return FirebugReps.Func.copySource(fn);
-    },
-
-    monitor: function(fn, script, monitored)
-    {
-        fn = script.functionObject.getWrappedValue();
-        return FirebugReps.Func.monitor(fn, script, monitored);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "jsdScript",
-    inspectable: false,
-
-    supportsObject: function(object, type)
-    {
-        return object instanceof jsdIScript;
-    },
-
-    inspectObject: function(script, context)
-    {
-        var sourceLink = getSourceLinkForScript(script, context);
-        if (sourceLink)
-            Firebug.chrome.select(sourceLink);
-    },
-
-    getRealObject: function(script, context)
-    {
-        return script;
-    },
-
-    getTooltip: function(script)
-    {
-        return $STRF("jsdIScript", [script.tag]);
-    },
-
-    getTitle: function(script, context)
-    {
-        var fn = script.functionObject.getWrappedValue();
-        return FirebugReps.Func.getTitle(fn, context);
-    },
-
-    getContextMenuItems: function(script, target, context)
-    {
-        var fn = script.functionObject.getWrappedValue();
-
-        var scriptInfo = getSourceFileAndLineByScript(context, script);
-           var monitored = scriptInfo ? fbs.isMonitored(scriptInfo.sourceFile.href, scriptInfo.lineNo) : false;
-
-        var name = getFunctionName(script, context);
-
-        return [
-            {label: "CopySource", command: bindFixed(this.copySource, this, script) },
-            "-",
-            {label: $STRF("ShowCallsInConsole", [name]), nol10n: true,
-             type: "checkbox", checked: monitored,
-             command: bindFixed(this.monitor, this, fn, script, monitored) }
-        ];
-    }
-});
-/**/
-//************************************************************************************************
-
-this.Obj = domplate(Firebug.Rep,
-{
-    tag:
-        OBJECTLINK(
-            SPAN({"class": "objectTitle"}, "$object|getTitle "),
-
-            SPAN({"class": "objectProps"},
-                SPAN({"class": "objectLeftBrace", role: "presentation"}, "{"),
-                FOR("prop", "$object|propIterator",
-                    SPAN({"class": "objectPropName", role: "presentation"}, "$prop.name"),
-                    SPAN({"class": "objectEqual", role: "presentation"}, "$prop.equal"),
-                    TAG("$prop.tag", {object: "$prop.object"}),
-                    SPAN({"class": "objectComma", role: "presentation"}, "$prop.delim")
-                ),
-                SPAN({"class": "objectRightBrace"}, "}")
-            )
-        ),
-
-    propNumberTag:
-        SPAN({"class": "objectProp-number"}, "$object"),
-
-    propStringTag:
-        SPAN({"class": "objectProp-string"}, "&quot;$object&quot;"),
-
-    propObjectTag:
-        SPAN({"class": "objectProp-object"}, "$object"),
-
-    propIterator: function (object)
-    {
-        ///Firebug.ObjectShortIteratorMax;
-        var maxLength = 55; // default max length for long representation
-
-        if (!object)
-            return [];
-
-        var props = [];
-        var length = 0;
-
-        var numProperties = 0;
-        var numPropertiesShown = 0;
-        var maxLengthReached = false;
-
-        var lib = this;
-
-        var propRepsMap =
-        {
-            "boolean": this.propNumberTag,
-            "number": this.propNumberTag,
-            "string": this.propStringTag,
-            "object": this.propObjectTag
-        };
-
-        try
-        {
-            var title = Firebug.Rep.getTitle(object);
-            length += title.length;
-
-            for (var name in object)
-            {
-                var value;
-                try
-                {
-                    value = object[name];
-                }
-                catch (exc)
-                {
-                    continue;
-                }
-
-                var type = typeof(value);
-                if (type == "boolean" ||
-                    type == "number" ||
-                    (type == "string" && value) ||
-                    (type == "object" && value && value.toString))
-                {
-                    var tag = propRepsMap[type];
-
-                    var value = (type == "object") ?
-                        Firebug.getRep(value).getTitle(value) :
-                        value + "";
-
-                    length += name.length + value.length + 4;
-
-                    if (length <= maxLength)
-                    {
-                        props.push({
-                            tag: tag,
-                            name: name,
-                            object: value,
-                            equal: "=",
-                            delim: ", "
-                        });
-
-                        numPropertiesShown++;
-                    }
-                    else
-                        maxLengthReached = true;
-
-                }
-
-                numProperties++;
-
-                if (maxLengthReached && numProperties > numPropertiesShown)
-                    break;
-            }
-
-            if (numProperties > numPropertiesShown)
-            {
-                props.push({
-                    object: "...", //xxxHonza localization
-                    tag: FirebugReps.Caption.tag,
-                    name: "",
-                    equal:"",
-                    delim:""
-                });
-            }
-            else if (props.length > 0)
-            {
-                props[props.length-1].delim = '';
-            }
-        }
-        catch (exc)
-        {
-            // Sometimes we get exceptions when trying to read from certain objects, like
-            // StorageList, but don't let that gum up the works
-            // XXXjjb also History.previous fails because object is a web-page object which does not have
-            // permission to read the history
-        }
-        return props;
-    },
-
-    fb_1_6_propIterator: function (object, max)
-    {
-        max = max || 3;
-        if (!object)
-            return [];
-
-        var props = [];
-        var len = 0, count = 0;
-
-        try
-        {
-            for (var name in object)
-            {
-                var value;
-                try
-                {
-                    value = object[name];
-                }
-                catch (exc)
-                {
-                    continue;
-                }
-
-                var t = typeof(value);
-                if (t == "boolean" || t == "number" || (t == "string" && value)
-                    || (t == "object" && value && value.toString))
-                {
-                    var rep = Firebug.getRep(value);
-                    var tag = rep.shortTag || rep.tag;
-                    if (t == "object")
-                    {
-                        value = rep.getTitle(value);
-                        tag = rep.titleTag;
-                    }
-                    count++;
-                    if (count <= max)
-                        props.push({tag: tag, name: name, object: value, equal: "=", delim: ", "});
-                    else
-                        break;
-                }
-            }
-            if (count > max)
-            {
-                props[Math.max(1,max-1)] = {
-                    object: "more...", //xxxHonza localization
-                    tag: FirebugReps.Caption.tag,
-                    name: "",
-                    equal:"",
-                    delim:""
-                };
-            }
-            else if (props.length > 0)
-            {
-                props[props.length-1].delim = '';
-            }
-        }
-        catch (exc)
-        {
-            // Sometimes we get exceptions when trying to read from certain objects, like
-            // StorageList, but don't let that gum up the works
-            // XXXjjb also History.previous fails because object is a web-page object which does not have
-            // permission to read the history
-        }
-        return props;
-    },
-
-    /*
-    propIterator: function (object)
-    {
-        if (!object)
-            return [];
-
-        var props = [];
-        var len = 0;
-
-        try
-        {
-            for (var name in object)
-            {
-                var val;
-                try
-                {
-                    val = object[name];
-                }
-                catch (exc)
-                {
-                    continue;
-                }
-
-                var t = typeof val;
-                if (t == "boolean" || t == "number" || (t == "string" && val)
-                    || (t == "object" && !isFunction(val) && val && val.toString))
-                {
-                    var title = (t == "object")
-                        ? Firebug.getRep(val).getTitle(val)
-                        : val+"";
-
-                    len += name.length + title.length + 1;
-                    if (len < 50)
-                        props.push({name: name, value: title});
-                    else
-                        break;
-                }
-            }
-        }
-        catch (exc)
-        {
-            // Sometimes we get exceptions when trying to read from certain objects, like
-            // StorageList, but don't let that gum up the works
-            // XXXjjb also History.previous fails because object is a web-page object which does not have
-            // permission to read the history
-        }
-
-        return props;
-    },
-    /**/
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "object",
-
-    supportsObject: function(object, type)
-    {
-        return true;
-    }
-});
-
-
-// ************************************************************************************************
-
-this.Arr = domplate(Firebug.Rep,
-{
-    tag:
-        OBJECTBOX({_repObject: "$object"},
-            SPAN({"class": "arrayLeftBracket", role : "presentation"}, "["),
-            FOR("item", "$object|arrayIterator",
-                TAG("$item.tag", {object: "$item.object"}),
-                SPAN({"class": "arrayComma", role : "presentation"}, "$item.delim")
-            ),
-            SPAN({"class": "arrayRightBracket", role : "presentation"}, "]")
-        ),
-
-    shortTag:
-        OBJECTBOX({_repObject: "$object"},
-            SPAN({"class": "arrayLeftBracket", role : "presentation"}, "["),
-            FOR("item", "$object|shortArrayIterator",
-                TAG("$item.tag", {object: "$item.object"}),
-                SPAN({"class": "arrayComma", role : "presentation"}, "$item.delim")
-            ),
-            // TODO: xxxpedro - confirm this on Firebug
-            //FOR("prop", "$object|shortPropIterator",
-            //        " $prop.name=",
-            //        SPAN({"class": "objectPropValue"}, "$prop.value|cropString")
-            //),
-            SPAN({"class": "arrayRightBracket"}, "]")
-        ),
-
-    arrayIterator: function(array)
-    {
-        var items = [];
-        for (var i = 0; i < array.length; ++i)
-        {
-            var value = array[i];
-            var rep = Firebug.getRep(value);
-            var tag = rep.shortTag ? rep.shortTag : rep.tag;
-            var delim = (i == array.length-1 ? "" : ", ");
-
-            items.push({object: value, tag: tag, delim: delim});
-        }
-
-        return items;
-    },
-
-    shortArrayIterator: function(array)
-    {
-        var items = [];
-        for (var i = 0; i < array.length && i < 3; ++i)
-        {
-            var value = array[i];
-            var rep = Firebug.getRep(value);
-            var tag = rep.shortTag ? rep.shortTag : rep.tag;
-            var delim = (i == array.length-1 ? "" : ", ");
-
-            items.push({object: value, tag: tag, delim: delim});
-        }
-
-        if (array.length > 3)
-            items.push({object: (array.length-3) + " more...", tag: FirebugReps.Caption.tag, delim: ""});
-
-        return items;
-    },
-
-    shortPropIterator:    this.Obj.propIterator,
-
-    getItemIndex: function(child)
-    {
-        var arrayIndex = 0;
-        for (child = child.previousSibling; child; child = child.previousSibling)
-        {
-            if (child.repObject)
-                ++arrayIndex;
-        }
-        return arrayIndex;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "array",
-
-    supportsObject: function(object)
-    {
-        return this.isArray(object);
-    },
-
-    // http://code.google.com/p/fbug/issues/detail?id=874
-    // BEGIN Yahoo BSD Source (modified here)  YAHOO.lang.isArray, YUI 2.2.2 June 2007
-    isArray: function(obj) {
-        try {
-            if (!obj)
-                return false;
-            else if (isIE && !isFunction(obj) && typeof obj == "object" && isFinite(obj.length) && obj.nodeType != 8)
-                return true;
-            else if (isFinite(obj.length) && isFunction(obj.splice))
-                return true;
-            else if (isFinite(obj.length) && isFunction(obj.callee)) // arguments
-                return true;
-            else if (instanceOf(obj, "HTMLCollection"))
-                return true;
-            else if (instanceOf(obj, "NodeList"))
-                return true;
-            else
-                return false;
-        }
-        catch(exc)
-        {
-            if (FBTrace.DBG_ERRORS)
-            {
-                FBTrace.sysout("isArray FAILS:", exc);  /* Something weird: without the try/catch, OOM, with no exception?? */
-                FBTrace.sysout("isArray Fails on obj", obj);
-            }
-        }
-
-        return false;
-    },
-    // END Yahoo BSD SOURCE See license below.
-
-    getTitle: function(object, context)
-    {
-        return "[" + object.length + "]";
-    }
-});
-
-// ************************************************************************************************
-
-this.Property = domplate(Firebug.Rep,
-{
-    supportsObject: function(object)
-    {
-        return object instanceof Property;
-    },
-
-    getRealObject: function(prop, context)
-    {
-        return prop.object[prop.name];
-    },
-
-    getTitle: function(prop, context)
-    {
-        return prop.name;
-    }
-});
-
-// ************************************************************************************************
-
-this.NetFile = domplate(this.Obj,
-{
-    supportsObject: function(object)
-    {
-        return object instanceof Firebug.NetFile;
-    },
-
-    browseObject: function(file, context)
-    {
-        openNewTab(file.href);
-        return true;
-    },
-
-    getRealObject: function(file, context)
-    {
-        return null;
-    }
-});
-
-// ************************************************************************************************
-
-this.Except = domplate(Firebug.Rep,
-{
-    tag:
-        OBJECTBOX({_repObject: "$object"}, "$object.message"),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "exception",
-
-    supportsObject: function(object)
-    {
-        return object instanceof ErrorCopy;
-    }
-});
-
-
-// ************************************************************************************************
-
-this.Element = domplate(Firebug.Rep,
-{
-    tag:
-        OBJECTLINK(
-            "&lt;",
-            SPAN({"class": "nodeTag"}, "$object.nodeName|toLowerCase"),
-            FOR("attr", "$object|attrIterator",
-                "&nbsp;$attr.nodeName=&quot;", SPAN({"class": "nodeValue"}, "$attr.nodeValue"), "&quot;"
-            ),
-            "&gt;"
-         ),
-
-    shortTag:
-        OBJECTLINK(
-            SPAN({"class": "$object|getVisible"},
-                SPAN({"class": "selectorTag"}, "$object|getSelectorTag"),
-                SPAN({"class": "selectorId"}, "$object|getSelectorId"),
-                SPAN({"class": "selectorClass"}, "$object|getSelectorClass"),
-                SPAN({"class": "selectorValue"}, "$object|getValue")
-            )
-         ),
-
-     getVisible: function(elt)
-     {
-         return isVisible(elt) ? "" : "selectorHidden";
-     },
-
-     getSelectorTag: function(elt)
-     {
-         return elt.nodeName.toLowerCase();
-     },
-
-     getSelectorId: function(elt)
-     {
-         return elt.id ? "#" + elt.id : "";
-     },
-
-     getSelectorClass: function(elt)
-     {
-         return elt.className ? "." + elt.className.split(" ")[0] : "";
-     },
-
-     getValue: function(elt)
-     {
-         // TODO: xxxpedro
-         return "";
-         var value;
-         if (elt instanceof HTMLImageElement)
-             value = getFileName(elt.src);
-         else if (elt instanceof HTMLAnchorElement)
-             value = getFileName(elt.href);
-         else if (elt instanceof HTMLInputElement)
-             value = elt.value;
-         else if (elt instanceof HTMLFormElement)
-             value = getFileName(elt.action);
-         else if (elt instanceof HTMLScriptElement)
-             value = getFileName(elt.src);
-
-         return value ? " " + cropString(value, 20) : "";
-     },
-
-     attrIterator: function(elt)
-     {
-         var attrs = [];
-         var idAttr, classAttr;
-         if (elt.attributes)
-         {
-             for (var i = 0; i < elt.attributes.length; ++i)
-             {
-                 var attr = elt.attributes[i];
-
-                 // we must check if the attribute is specified otherwise IE will show them
-                 if (!attr.specified || attr.nodeName && attr.nodeName.indexOf("firebug-") != -1)
-                    continue;
-                 else if (attr.nodeName == "id")
-                    idAttr = attr;
-                 else if (attr.nodeName == "class")
-                    classAttr = attr;
-                 else if (attr.nodeName == "style")
-                    attrs.push({
-                        nodeName: attr.nodeName,
-                        nodeValue: attr.nodeValue ||
-                        // IE won't recognize the attr.nodeValue of <style> nodes ...
-                        // and will return CSS property names in upper case, so we need to convert them
-                        elt.style.cssText.replace(/([^\s]+)\s*:/g,
-                                function(m,g){return g.toLowerCase()+":"})
-                    });
-                 else
-                    attrs.push(attr);
-             }
-         }
-         if (classAttr)
-            attrs.splice(0, 0, classAttr);
-         if (idAttr)
-            attrs.splice(0, 0, idAttr);
-
-         return attrs;
-     },
-
-     shortAttrIterator: function(elt)
-     {
-         var attrs = [];
-         if (elt.attributes)
-         {
-             for (var i = 0; i < elt.attributes.length; ++i)
-             {
-                 var attr = elt.attributes[i];
-                 if (attr.nodeName == "id" || attr.nodeName == "class")
-                     attrs.push(attr);
-             }
-         }
-
-         return attrs;
-     },
-
-     getHidden: function(elt)
-     {
-         return isVisible(elt) ? "" : "nodeHidden";
-     },
-
-     getXPath: function(elt)
-     {
-         return getElementTreeXPath(elt);
-     },
-
-     // TODO: xxxpedro remove this?
-     getNodeText: function(element)
-     {
-         var text = element.textContent;
-         if (Firebug.showFullTextNodes)
-            return text;
-        else
-            return cropString(text, 50);
-     },
-     /**/
-
-     getNodeTextGroups: function(element)
-     {
-         var text =  element.textContent;
-         if (!Firebug.showFullTextNodes)
-         {
-             text=cropString(text,50);
-         }
-
-         var escapeGroups=[];
-
-         if (Firebug.showTextNodesWithWhitespace)
-             escapeGroups.push({
-                'group': 'whitespace',
-                'class': 'nodeWhiteSpace',
-                'extra': {
-                    '\t': '_Tab',
-                    '\n': '_Para',
-                    ' ' : '_Space'
-                }
-             });
-         if (Firebug.showTextNodesWithEntities)
-             escapeGroups.push({
-                 'group':'text',
-                 'class':'nodeTextEntity',
-                 'extra':{}
-             });
-
-         if (escapeGroups.length)
-             return escapeGroupsForEntities(text, escapeGroups);
-         else
-             return [{str:text,'class':'',extra:''}];
-     },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    copyHTML: function(elt)
-    {
-        var html = getElementXML(elt);
-        copyToClipboard(html);
-    },
-
-    copyInnerHTML: function(elt)
-    {
-        copyToClipboard(elt.innerHTML);
-    },
-
-    copyXPath: function(elt)
-    {
-        var xpath = getElementXPath(elt);
-        copyToClipboard(xpath);
-    },
-
-    persistor: function(context, xpath)
-    {
-        var elts = xpath
-            ? getElementsByXPath(context.window.document, xpath)
-            : null;
-
-        return elts && elts.length ? elts[0] : null;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "element",
-
-    supportsObject: function(object)
-    {
-        //return object instanceof Element || object.nodeType == 1 && typeof object.nodeName == "string";
-        return instanceOf(object, "Element");
-    },
-
-    browseObject: function(elt, context)
-    {
-        var tag = elt.nodeName.toLowerCase();
-        if (tag == "script")
-            openNewTab(elt.src);
-        else if (tag == "link")
-            openNewTab(elt.href);
-        else if (tag == "a")
-            openNewTab(elt.href);
-        else if (tag == "img")
-            openNewTab(elt.src);
-
-        return true;
-    },
-
-    persistObject: function(elt, context)
-    {
-        var xpath = getElementXPath(elt);
-
-        return bind(this.persistor, top, xpath);
-    },
-
-    getTitle: function(element, context)
-    {
-        return getElementCSSSelector(element);
-    },
-
-    getTooltip: function(elt)
-    {
-        return this.getXPath(elt);
-    },
-
-    getContextMenuItems: function(elt, target, context)
-    {
-        var monitored = areEventsMonitored(elt, null, context);
-
-        return [
-            {label: "CopyHTML", command: bindFixed(this.copyHTML, this, elt) },
-            {label: "CopyInnerHTML", command: bindFixed(this.copyInnerHTML, this, elt) },
-            {label: "CopyXPath", command: bindFixed(this.copyXPath, this, elt) },
-            "-",
-            {label: "ShowEventsInConsole", type: "checkbox", checked: monitored,
-             command: bindFixed(toggleMonitorEvents, FBL, elt, null, monitored, context) },
-            "-",
-            {label: "ScrollIntoView", command: bindFixed(elt.scrollIntoView, elt) }
-        ];
-    }
-});
-
-// ************************************************************************************************
-
-this.TextNode = domplate(Firebug.Rep,
-{
-    tag:
-        OBJECTLINK(
-            "&lt;",
-            SPAN({"class": "nodeTag"}, "TextNode"),
-            "&nbsp;textContent=&quot;", SPAN({"class": "nodeValue"}, "$object.textContent|cropString"), "&quot;",
-            "&gt;"
-            ),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "textNode",
-
-    supportsObject: function(object)
-    {
-        return object instanceof Text;
-    }
-});
-
-// ************************************************************************************************
-
-this.Document = domplate(Firebug.Rep,
-{
-    tag:
-        OBJECTLINK("Document ", SPAN({"class": "objectPropValue"}, "$object|getLocation")),
-
-    getLocation: function(doc)
-    {
-        return doc.location ? getFileName(doc.location.href) : "";
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "object",
-
-    supportsObject: function(object)
-    {
-        //return object instanceof Document || object instanceof XMLDocument;
-        return instanceOf(object, "Document");
-    },
-
-    browseObject: function(doc, context)
-    {
-        openNewTab(doc.location.href);
-        return true;
-    },
-
-    persistObject: function(doc, context)
-    {
-        return this.persistor;
-    },
-
-    persistor: function(context)
-    {
-        return context.window.document;
-    },
-
-    getTitle: function(win, context)
-    {
-        return "document";
-    },
-
-    getTooltip: function(doc)
-    {
-        return doc.location.href;
-    }
-});
-
-// ************************************************************************************************
-
-this.StyleSheet = domplate(Firebug.Rep,
-{
-    tag:
-        OBJECTLINK("StyleSheet ", SPAN({"class": "objectPropValue"}, "$object|getLocation")),
-
-    getLocation: function(styleSheet)
-    {
-        return getFileName(styleSheet.href);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    copyURL: function(styleSheet)
-    {
-        copyToClipboard(styleSheet.href);
-    },
-
-    openInTab: function(styleSheet)
-    {
-        openNewTab(styleSheet.href);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "object",
-
-    supportsObject: function(object)
-    {
-        //return object instanceof CSSStyleSheet;
-        return instanceOf(object, "CSSStyleSheet");
-    },
-
-    browseObject: function(styleSheet, context)
-    {
-        openNewTab(styleSheet.href);
-        return true;
-    },
-
-    persistObject: function(styleSheet, context)
-    {
-        return bind(this.persistor, top, styleSheet.href);
-    },
-
-    getTooltip: function(styleSheet)
-    {
-        return styleSheet.href;
-    },
-
-    getContextMenuItems: function(styleSheet, target, context)
-    {
-        return [
-            {label: "CopyLocation", command: bindFixed(this.copyURL, this, styleSheet) },
-            "-",
-            {label: "OpenInTab", command: bindFixed(this.openInTab, this, styleSheet) }
-        ];
-    },
-
-    persistor: function(context, href)
-    {
-        return getStyleSheetByHref(href, context);
-    }
-});
-
-// ************************************************************************************************
-
-this.Window = domplate(Firebug.Rep,
-{
-    tag:
-        OBJECTLINK("Window ", SPAN({"class": "objectPropValue"}, "$object|getLocation")),
-
-    getLocation: function(win)
-    {
-        try
-        {
-            return (win && win.location && !win.closed) ? getFileName(win.location.href) : "";
-        }
-        catch (exc)
-        {
-            if (FBTrace.DBG_ERRORS)
-                FBTrace.sysout("reps.Window window closed?");
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "object",
-
-    supportsObject: function(object)
-    {
-        return instanceOf(object, "Window");
-    },
-
-    browseObject: function(win, context)
-    {
-        openNewTab(win.location.href);
-        return true;
-    },
-
-    persistObject: function(win, context)
-    {
-        return this.persistor;
-    },
-
-    persistor: function(context)
-    {
-        return context.window;
-    },
-
-    getTitle: function(win, context)
-    {
-        return "window";
-    },
-
-    getTooltip: function(win)
-    {
-        if (win && !win.closed)
-            return win.location.href;
-    }
-});
-
-// ************************************************************************************************
-
-this.Event = domplate(Firebug.Rep,
-{
-    tag: TAG("$copyEventTag", {object: "$object|copyEvent"}),
-
-    copyEventTag:
-        OBJECTLINK("$object|summarizeEvent"),
-
-    summarizeEvent: function(event)
-    {
-        var info = [event.type, ' '];
-
-        var eventFamily = getEventFamily(event.type);
-        if (eventFamily == "mouse")
-            info.push("clientX=", event.clientX, ", clientY=", event.clientY);
-        else if (eventFamily == "key")
-            info.push("charCode=", event.charCode, ", keyCode=", event.keyCode);
-
-        return info.join("");
-    },
-
-    copyEvent: function(event)
-    {
-        return new EventCopy(event);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "object",
-
-    supportsObject: function(object)
-    {
-        //return object instanceof Event || object instanceof EventCopy;
-        return instanceOf(object, "Event") || instanceOf(object, "EventCopy");
-    },
-
-    getTitle: function(event, context)
-    {
-        return "Event " + event.type;
-    }
-});
-
-// ************************************************************************************************
-
-this.SourceLink = domplate(Firebug.Rep,
-{
-    tag:
-        OBJECTLINK({$collapsed: "$object|hideSourceLink"}, "$object|getSourceLinkTitle"),
-
-    hideSourceLink: function(sourceLink)
-    {
-        return sourceLink ? sourceLink.href.indexOf("XPCSafeJSObjectWrapper") != -1 : true;
-    },
-
-    getSourceLinkTitle: function(sourceLink)
-    {
-        if (!sourceLink)
-            return "";
-
-        try
-        {
-            var fileName = getFileName(sourceLink.href);
-            fileName = decodeURIComponent(fileName);
-            fileName = cropString(fileName, 17);
-        }
-        catch(exc)
-        {
-            if (FBTrace.DBG_ERRORS)
-                FBTrace.sysout("reps.getSourceLinkTitle decodeURIComponent fails for \'"+fileName+"\': "+exc, exc);
-        }
-
-        return typeof sourceLink.line == "number" ?
-                fileName + " (line " + sourceLink.line + ")" :
-                fileName;
-
-        // TODO: xxxpedro
-        //return $STRF("Line", [fileName, sourceLink.line]);
-    },
-
-    copyLink: function(sourceLink)
-    {
-        copyToClipboard(sourceLink.href);
-    },
-
-    openInTab: function(sourceLink)
-    {
-        openNewTab(sourceLink.href);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "sourceLink",
-
-    supportsObject: function(object)
-    {
-        return object instanceof SourceLink;
-    },
-
-    getTooltip: function(sourceLink)
-    {
-        return decodeURI(sourceLink.href);
-    },
-
-    inspectObject: function(sourceLink, context)
-    {
-        if (sourceLink.type == "js")
-        {
-            var scriptFile = getSourceFileByHref(sourceLink.href, context);
-            if (scriptFile)
-                return Firebug.chrome.select(sourceLink);
-        }
-        else if (sourceLink.type == "css")
-        {
-            // If an object is defined, treat it as the highest priority for
-            // inspect actions
-            if (sourceLink.object) {
-                Firebug.chrome.select(sourceLink.object);
-                return;
-            }
-
-            var stylesheet = getStyleSheetByHref(sourceLink.href, context);
-            if (stylesheet)
-            {
-                var ownerNode = stylesheet.ownerNode;
-                if (ownerNode)
-                {
-                    Firebug.chrome.select(sourceLink, "html");
-                    return;
-                }
-
-                var panel = context.getPanel("stylesheet");
-                if (panel && panel.getRuleByLine(stylesheet, sourceLink.line))
-                    return Firebug.chrome.select(sourceLink);
-            }
-        }
-
-        // Fallback is to just open the view-source window on the file
-        viewSource(sourceLink.href, sourceLink.line);
-    },
-
-    browseObject: function(sourceLink, context)
-    {
-        openNewTab(sourceLink.href);
-        return true;
-    },
-
-    getContextMenuItems: function(sourceLink, target, context)
-    {
-        return [
-            {label: "CopyLocation", command: bindFixed(this.copyLink, this, sourceLink) },
-            "-",
-            {label: "OpenInTab", command: bindFixed(this.openInTab, this, sourceLink) }
-        ];
-    }
-});
-
-// ************************************************************************************************
-
-this.SourceFile = domplate(this.SourceLink,
-{
-    tag:
-        OBJECTLINK({$collapsed: "$object|hideSourceLink"}, "$object|getSourceLinkTitle"),
-
-    persistor: function(context, href)
-    {
-        return getSourceFileByHref(href, context);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "sourceFile",
-
-    supportsObject: function(object)
-    {
-        return object instanceof SourceFile;
-    },
-
-    persistObject: function(sourceFile)
-    {
-        return bind(this.persistor, top, sourceFile.href);
-    },
-
-    browseObject: function(sourceLink, context)
-    {
-    },
-
-    getTooltip: function(sourceFile)
-    {
-        return sourceFile.href;
-    }
-});
-
-// ************************************************************************************************
-
-this.StackFrame = domplate(Firebug.Rep,  // XXXjjb Since the repObject is fn the stack does not have correct line numbers
-{
-    tag:
-        OBJECTBLOCK(
-            A({"class": "objectLink objectLink-function focusRow a11yFocus", _repObject: "$object.fn"}, "$object|getCallName"),
-            " ( ",
-            FOR("arg", "$object|argIterator",
-                TAG("$arg.tag", {object: "$arg.value"}),
-                SPAN({"class": "arrayComma"}, "$arg.delim")
-            ),
-            " )",
-            SPAN({"class": "objectLink-sourceLink objectLink"}, "$object|getSourceLinkTitle")
-        ),
-
-    getCallName: function(frame)
-    {
-        //TODO: xxxpedro reps StackFrame
-        return frame.name || "anonymous";
-
-        //return getFunctionName(frame.script, frame.context);
-    },
-
-    getSourceLinkTitle: function(frame)
-    {
-        //TODO: xxxpedro reps StackFrame
-        var fileName = cropString(getFileName(frame.href), 20);
-        return fileName + (frame.lineNo ? " (line " + frame.lineNo + ")" : "");
-
-        var fileName = cropString(getFileName(frame.href), 17);
-        return $STRF("Line", [fileName, frame.lineNo]);
-    },
-
-    argIterator: function(frame)
-    {
-        if (!frame.args)
-            return [];
-
-        var items = [];
-
-        for (var i = 0; i < frame.args.length; ++i)
-        {
-            var arg = frame.args[i];
-
-            if (!arg)
-                break;
-
-            var rep = Firebug.getRep(arg.value);
-            var tag = rep.shortTag ? rep.shortTag : rep.tag;
-
-            var delim = (i == frame.args.length-1 ? "" : ", ");
-
-            items.push({name: arg.name, value: arg.value, tag: tag, delim: delim});
-        }
-
-        return items;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "stackFrame",
-
-    supportsObject: function(object)
-    {
-        return object instanceof StackFrame;
-    },
-
-    inspectObject: function(stackFrame, context)
-    {
-        var sourceLink = new SourceLink(stackFrame.href, stackFrame.lineNo, "js");
-        Firebug.chrome.select(sourceLink);
-    },
-
-    getTooltip: function(stackFrame, context)
-    {
-        return $STRF("Line", [stackFrame.href, stackFrame.lineNo]);
-    }
-
-});
-
-// ************************************************************************************************
-
-this.StackTrace = domplate(Firebug.Rep,
-{
-    tag:
-        FOR("frame", "$object.frames focusRow",
-            TAG(this.StackFrame.tag, {object: "$frame"})
-        ),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "stackTrace",
-
-    supportsObject: function(object)
-    {
-        return object instanceof StackTrace;
-    }
-});
-
-// ************************************************************************************************
-
-this.jsdStackFrame = domplate(Firebug.Rep,
-{
-    inspectable: false,
-
-    supportsObject: function(object)
-    {
-        return (object instanceof jsdIStackFrame) && (object.isValid);
-    },
-
-    getTitle: function(frame, context)
-    {
-        if (!frame.isValid) return "(invalid frame)"; // XXXjjb avoid frame.script == null
-        return getFunctionName(frame.script, context);
-    },
-
-    getTooltip: function(frame, context)
-    {
-        if (!frame.isValid) return "(invalid frame)";  // XXXjjb avoid frame.script == null
-        var sourceInfo = FBL.getSourceFileAndLineByScript(context, frame.script, frame);
-        if (sourceInfo)
-            return $STRF("Line", [sourceInfo.sourceFile.href, sourceInfo.lineNo]);
-        else
-            return $STRF("Line", [frame.script.fileName, frame.line]);
-    },
-
-    getContextMenuItems: function(frame, target, context)
-    {
-        var fn = frame.script.functionObject.getWrappedValue();
-        return FirebugReps.Func.getContextMenuItems(fn, target, context, frame.script);
-    }
-});
-
-// ************************************************************************************************
-
-this.ErrorMessage = domplate(Firebug.Rep,
-{
-    tag:
-        OBJECTBOX({
-                $hasTwisty: "$object|hasStackTrace",
-                $hasBreakSwitch: "$object|hasBreakSwitch",
-                $breakForError: "$object|hasErrorBreak",
-                _repObject: "$object",
-                _stackTrace: "$object|getLastErrorStackTrace",
-                onclick: "$onToggleError"},
-
-            DIV({"class": "errorTitle a11yFocus", role : 'checkbox', 'aria-checked' : 'false'},
-                "$object.message|getMessage"
-            ),
-            DIV({"class": "errorTrace"}),
-            DIV({"class": "errorSourceBox errorSource-$object|getSourceType"},
-                IMG({"class": "errorBreak a11yFocus", src:"blank.gif", role : 'checkbox', 'aria-checked':'false', title: "Break on this error"}),
-                A({"class": "errorSource a11yFocus"}, "$object|getLine")
-            ),
-            TAG(this.SourceLink.tag, {object: "$object|getSourceLink"})
-        ),
-
-    getLastErrorStackTrace: function(error)
-    {
-        return error.trace;
-    },
-
-    hasStackTrace: function(error)
-    {
-        var url = error.href.toString();
-        var fromCommandLine = (url.indexOf("XPCSafeJSObjectWrapper") != -1);
-        return !fromCommandLine && error.trace;
-    },
-
-    hasBreakSwitch: function(error)
-    {
-        return error.href && error.lineNo > 0;
-    },
-
-    hasErrorBreak: function(error)
-    {
-        return fbs.hasErrorBreakpoint(error.href, error.lineNo);
-    },
-
-    getMessage: function(message)
-    {
-        var re = /\[Exception... "(.*?)" nsresult:/;
-        var m = re.exec(message);
-        return m ? m[1] : message;
-    },
-
-    getLine: function(error)
-    {
-        if (error.category == "js")
-        {
-            if (error.source)
-                return cropString(error.source, 80);
-            else if (error.href && error.href.indexOf("XPCSafeJSObjectWrapper") == -1)
-                return cropString(error.getSourceLine(), 80);
-        }
-    },
-
-    getSourceLink: function(error)
-    {
-        var ext = error.category == "css" ? "css" : "js";
-        return error.lineNo ? new SourceLink(error.href, error.lineNo, ext) : null;
-    },
-
-    getSourceType: function(error)
-    {
-        // Errors occurring inside of HTML event handlers look like "foo.html (line 1)"
-        // so let's try to skip those
-        if (error.source)
-            return "syntax";
-        else if (error.lineNo == 1 && getFileExtension(error.href) != "js")
-            return "none";
-        else if (error.category == "css")
-            return "none";
-        else if (!error.href || !error.lineNo)
-            return "none";
-        else
-            return "exec";
-    },
-
-    onToggleError: function(event)
-    {
-        var target = event.currentTarget;
-        if (hasClass(event.target, "errorBreak"))
-        {
-            this.breakOnThisError(target.repObject);
-        }
-        else if (hasClass(event.target, "errorSource"))
-        {
-            var panel = Firebug.getElementPanel(event.target);
-            this.inspectObject(target.repObject, panel.context);
-        }
-        else if (hasClass(event.target, "errorTitle"))
-        {
-            var traceBox = target.childNodes[1];
-            toggleClass(target, "opened");
-            event.target.setAttribute('aria-checked', hasClass(target, "opened"));
-            if (hasClass(target, "opened"))
-            {
-                if (target.stackTrace)
-                    var node = FirebugReps.StackTrace.tag.append({object: target.stackTrace}, traceBox);
-                if (Firebug.A11yModel.enabled)
-                {
-                    var panel = Firebug.getElementPanel(event.target);
-                    dispatch([Firebug.A11yModel], "onLogRowContentCreated", [panel , traceBox]);
-                }
-            }
-            else
-                clearNode(traceBox);
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    copyError: function(error)
-    {
-        var message = [
-            this.getMessage(error.message),
-            error.href,
-            "Line " +  error.lineNo
-        ];
-        copyToClipboard(message.join("\n"));
-    },
-
-    breakOnThisError: function(error)
-    {
-        if (this.hasErrorBreak(error))
-            Firebug.Debugger.clearErrorBreakpoint(error.href, error.lineNo);
-        else
-            Firebug.Debugger.setErrorBreakpoint(error.href, error.lineNo);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "errorMessage",
-    inspectable: false,
-
-    supportsObject: function(object)
-    {
-        return object instanceof ErrorMessage;
-    },
-
-    inspectObject: function(error, context)
-    {
-        var sourceLink = this.getSourceLink(error);
-        FirebugReps.SourceLink.inspectObject(sourceLink, context);
-    },
-
-    getContextMenuItems: function(error, target, context)
-    {
-        var breakOnThisError = this.hasErrorBreak(error);
-
-        var items = [
-            {label: "CopyError", command: bindFixed(this.copyError, this, error) }
-        ];
-
-        if (error.category == "css")
-        {
-            items.push(
-                "-",
-                {label: "BreakOnThisError", type: "checkbox", checked: breakOnThisError,
-                 command: bindFixed(this.breakOnThisError, this, error) },
-
-                optionMenu("BreakOnAllErrors", "breakOnErrors")
-            );
-        }
-
-        return items;
-    }
-});
-
-// ************************************************************************************************
-
-this.Assert = domplate(Firebug.Rep,
-{
-    tag:
-        DIV(
-            DIV({"class": "errorTitle"}),
-            DIV({"class": "assertDescription"})
-        ),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "assert",
-
-    inspectObject: function(error, context)
-    {
-        var sourceLink = this.getSourceLink(error);
-        Firebug.chrome.select(sourceLink);
-    },
-
-    getContextMenuItems: function(error, target, context)
-    {
-        var breakOnThisError = this.hasErrorBreak(error);
-
-        return [
-            {label: "CopyError", command: bindFixed(this.copyError, this, error) },
-            "-",
-            {label: "BreakOnThisError", type: "checkbox", checked: breakOnThisError,
-             command: bindFixed(this.breakOnThisError, this, error) },
-            {label: "BreakOnAllErrors", type: "checkbox", checked: Firebug.breakOnErrors,
-             command: bindFixed(this.breakOnAllErrors, this, error) }
-        ];
-    }
-});
-
-// ************************************************************************************************
-
-this.SourceText = domplate(Firebug.Rep,
-{
-    tag:
-        DIV(
-            FOR("line", "$object|lineIterator",
-                DIV({"class": "sourceRow", role : "presentation"},
-                    SPAN({"class": "sourceLine", role : "presentation"}, "$line.lineNo"),
-                    SPAN({"class": "sourceRowText", role : "presentation"}, "$line.text")
-                )
-            )
-        ),
-
-    lineIterator: function(sourceText)
-    {
-        var maxLineNoChars = (sourceText.lines.length + "").length;
-        var list = [];
-
-        for (var i = 0; i < sourceText.lines.length; ++i)
-        {
-            // Make sure all line numbers are the same width (with a fixed-width font)
-            var lineNo = (i+1) + "";
-            while (lineNo.length < maxLineNoChars)
-                lineNo = " " + lineNo;
-
-            list.push({lineNo: lineNo, text: sourceText.lines[i]});
-        }
-
-        return list;
-    },
-
-    getHTML: function(sourceText)
-    {
-        return getSourceLineRange(sourceText, 1, sourceText.lines.length);
-    }
-});
-
-//************************************************************************************************
-this.nsIDOMHistory = domplate(Firebug.Rep,
-{
-    tag:OBJECTBOX({onclick: "$showHistory"},
-            OBJECTLINK("$object|summarizeHistory")
-        ),
-
-    className: "nsIDOMHistory",
-
-    summarizeHistory: function(history)
-    {
-        try
-        {
-            var items = history.length;
-            return items + " history entries";
-        }
-        catch(exc)
-        {
-            return "object does not support history (nsIDOMHistory)";
-        }
-    },
-
-    showHistory: function(history)
-    {
-        try
-        {
-            var items = history.length;  // if this throws, then unsupported
-            Firebug.chrome.select(history);
-        }
-        catch (exc)
-        {
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    supportsObject: function(object, type)
-    {
-        return (object instanceof Ci.nsIDOMHistory);
-    }
-});
-
-// ************************************************************************************************
-this.ApplicationCache = domplate(Firebug.Rep,
-{
-    tag:OBJECTBOX({onclick: "$showApplicationCache"},
-            OBJECTLINK("$object|summarizeCache")
-        ),
-
-    summarizeCache: function(applicationCache)
-    {
-        try
-        {
-            return applicationCache.length + " items in offline cache";
-        }
-        catch(exc)
-        {
-            return "https://bugzilla.mozilla.org/show_bug.cgi?id=422264";
-        }
-    },
-
-    showApplicationCache: function(event)
-    {
-        openNewTab("https://bugzilla.mozilla.org/show_bug.cgi?id=422264");
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "applicationCache",
-
-    supportsObject: function(object, type)
-    {
-        if (Ci.nsIDOMOfflineResourceList)
-            return (object instanceof Ci.nsIDOMOfflineResourceList);
-    }
-
-});
-
-this.Storage = domplate(Firebug.Rep,
-{
-    tag: OBJECTBOX({onclick: "$show"}, OBJECTLINK("$object|summarize")),
-
-    summarize: function(storage)
-    {
-        return storage.length +" items in Storage";
-    },
-    show: function(storage)
-    {
-        openNewTab("http://dev.w3.org/html5/webstorage/#storage-0");
-    },
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    className: "Storage",
-
-    supportsObject: function(object, type)
-    {
-        return (object instanceof Storage);
-    }
-
-});
-
-// ************************************************************************************************
-Firebug.registerRep(
-    //this.nsIDOMHistory, // make this early to avoid exceptions
-    this.Undefined,
-    this.Null,
-    this.Number,
-    this.String,
-    this.Window,
-    //this.ApplicationCache, // must come before Arr (array) else exceptions.
-    //this.ErrorMessage,
-    this.Element,
-    //this.TextNode,
-    this.Document,
-    this.StyleSheet,
-    this.Event,
-    //this.SourceLink,
-    //this.SourceFile,
-    //this.StackTrace,
-    //this.StackFrame,
-    //this.jsdStackFrame,
-    //this.jsdScript,
-    //this.NetFile,
-    this.Property,
-    this.Except,
-    this.Arr
-);
-
-Firebug.setDefaultReps(this.Func, this.Obj);
-
-}});
-
-// ************************************************************************************************
-/*
- * The following is http://developer.yahoo.com/yui/license.txt and applies to only code labeled "Yahoo BSD Source"
- * in only this file reps.js.  John J. Barton June 2007.
- *
-Software License Agreement (BSD License)
-
-Copyright (c) 2006, Yahoo! Inc.
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms, with or without modification, are
-permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above
-  copyright notice, this list of conditions and the
-  following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-  copyright notice, this list of conditions and the
-  following disclaimer in the documentation and/or other
-  materials provided with the distribution.
-
-* Neither the name of Yahoo! Inc. nor the names of its
-  contributors may be used to endorse or promote products
-  derived from this software without specific prior
-  written permission of Yahoo! Inc.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
-TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * /
- */
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-
-// ************************************************************************************************
-// Constants
-
-var saveTimeout = 400;
-var pageAmount = 10;
-
-// ************************************************************************************************
-// Globals
-
-var currentTarget = null;
-var currentGroup = null;
-var currentPanel = null;
-var currentEditor = null;
-
-var defaultEditor = null;
-
-var originalClassName = null;
-
-var originalValue = null;
-var defaultValue = null;
-var previousValue = null;
-
-var invalidEditor = false;
-var ignoreNextInput = false;
-
-// ************************************************************************************************
-
-Firebug.Editor = extend(Firebug.Module,
-{
-    supportsStopEvent: true,
-
-    dispatchName: "editor",
-    tabCharacter: "    ",
-
-    startEditing: function(target, value, editor)
-    {
-        this.stopEditing();
-
-        if (hasClass(target, "insertBefore") || hasClass(target, "insertAfter"))
-            return;
-
-        var panel = Firebug.getElementPanel(target);
-        if (!panel.editable)
-            return;
-
-        if (FBTrace.DBG_EDITOR)
-            FBTrace.sysout("editor.startEditing " + value, target);
-
-        defaultValue = target.getAttribute("defaultValue");
-        if (value == undefined)
-        {
-            var textContent = isIE ? "innerText" : "textContent";
-            value = target[textContent];
-            if (value == defaultValue)
-                value = "";
-        }
-
-        originalValue = previousValue = value;
-
-        invalidEditor = false;
-        currentTarget = target;
-        currentPanel = panel;
-        currentGroup = getAncestorByClass(target, "editGroup");
-
-        currentPanel.editing = true;
-
-        var panelEditor = currentPanel.getEditor(target, value);
-        currentEditor = editor ? editor : panelEditor;
-        if (!currentEditor)
-            currentEditor = getDefaultEditor(currentPanel);
-
-        var inlineParent = getInlineParent(target);
-        var targetSize = getOffsetSize(inlineParent);
-
-        setClass(panel.panelNode, "editing");
-        setClass(target, "editing");
-        if (currentGroup)
-            setClass(currentGroup, "editing");
-
-        currentEditor.show(target, currentPanel, value, targetSize);
-        //dispatch(this.fbListeners, "onBeginEditing", [currentPanel, currentEditor, target, value]);
-        currentEditor.beginEditing(target, value);
-        if (FBTrace.DBG_EDITOR)
-            FBTrace.sysout("Editor start panel "+currentPanel.name);
-        this.attachListeners(currentEditor, panel.context);
-    },
-
-    stopEditing: function(cancel)
-    {
-        if (!currentTarget)
-            return;
-
-        if (FBTrace.DBG_EDITOR)
-            FBTrace.sysout("editor.stopEditing cancel:" + cancel+" saveTimeout: "+this.saveTimeout);
-
-        clearTimeout(this.saveTimeout);
-        delete this.saveTimeout;
-
-        this.detachListeners(currentEditor, currentPanel.context);
-
-        removeClass(currentPanel.panelNode, "editing");
-        removeClass(currentTarget, "editing");
-        if (currentGroup)
-            removeClass(currentGroup, "editing");
-
-        var value = currentEditor.getValue();
-        if (value == defaultValue)
-            value = "";
-
-        var removeGroup = currentEditor.endEditing(currentTarget, value, cancel);
-
-        try
-        {
-            if (cancel)
-            {
-                //dispatch([Firebug.A11yModel], 'onInlineEditorClose', [currentPanel, currentTarget, removeGroup && !originalValue]);
-                if (value != originalValue)
-                    this.saveEditAndNotifyListeners(currentTarget, originalValue, previousValue);
-
-                if (removeGroup && !originalValue && currentGroup)
-                    currentGroup.parentNode.removeChild(currentGroup);
-            }
-            else if (!value)
-            {
-                this.saveEditAndNotifyListeners(currentTarget, null, previousValue);
-
-                if (removeGroup && currentGroup)
-                    currentGroup.parentNode.removeChild(currentGroup);
-            }
-            else
-                this.save(value);
-        }
-        catch (exc)
-        {
-            //throw exc.message;
-            //ERROR(exc);
-        }
-
-        currentEditor.hide();
-        currentPanel.editing = false;
-
-        //dispatch(this.fbListeners, "onStopEdit", [currentPanel, currentEditor, currentTarget]);
-        //if (FBTrace.DBG_EDITOR)
-        //    FBTrace.sysout("Editor stop panel "+currentPanel.name);
-
-        currentTarget = null;
-        currentGroup = null;
-        currentPanel = null;
-        currentEditor = null;
-        originalValue = null;
-        invalidEditor = false;
-
-        return value;
-    },
-
-    cancelEditing: function()
-    {
-        return this.stopEditing(true);
-    },
-
-    update: function(saveNow)
-    {
-        if (this.saveTimeout)
-            clearTimeout(this.saveTimeout);
-
-        invalidEditor = true;
-
-        currentEditor.layout();
-
-        if (saveNow)
-            this.save();
-        else
-        {
-            var context = currentPanel.context;
-            this.saveTimeout = context.setTimeout(bindFixed(this.save, this), saveTimeout);
-            if (FBTrace.DBG_EDITOR)
-                FBTrace.sysout("editor.update saveTimeout: "+this.saveTimeout);
-        }
-    },
-
-    save: function(value)
-    {
-        if (!invalidEditor)
-            return;
-
-        if (value == undefined)
-            value = currentEditor.getValue();
-        if (FBTrace.DBG_EDITOR)
-            FBTrace.sysout("editor.save saveTimeout: "+this.saveTimeout+" currentPanel: "+(currentPanel?currentPanel.name:"null"));
-        try
-        {
-            this.saveEditAndNotifyListeners(currentTarget, value, previousValue);
-
-            previousValue = value;
-            invalidEditor = false;
-        }
-        catch (exc)
-        {
-            if (FBTrace.DBG_ERRORS)
-                FBTrace.sysout("editor.save FAILS "+exc, exc);
-        }
-    },
-
-    saveEditAndNotifyListeners: function(currentTarget, value, previousValue)
-    {
-        currentEditor.saveEdit(currentTarget, value, previousValue);
-        //dispatch(this.fbListeners, "onSaveEdit", [currentPanel, currentEditor, currentTarget, value, previousValue]);
-    },
-
-    setEditTarget: function(element)
-    {
-        if (!element)
-        {
-            dispatch([Firebug.A11yModel], 'onInlineEditorClose', [currentPanel, currentTarget, true]);
-            this.stopEditing();
-        }
-        else if (hasClass(element, "insertBefore"))
-            this.insertRow(element, "before");
-        else if (hasClass(element, "insertAfter"))
-            this.insertRow(element, "after");
-        else
-            this.startEditing(element);
-    },
-
-    tabNextEditor: function()
-    {
-        if (!currentTarget)
-            return;
-
-        var value = currentEditor.getValue();
-        var nextEditable = currentTarget;
-        do
-        {
-            nextEditable = !value && currentGroup
-                ? getNextOutsider(nextEditable, currentGroup)
-                : getNextByClass(nextEditable, "editable");
-        }
-        while (nextEditable && !nextEditable.offsetHeight);
-
-        this.setEditTarget(nextEditable);
-    },
-
-    tabPreviousEditor: function()
-    {
-        if (!currentTarget)
-            return;
-
-        var value = currentEditor.getValue();
-        var prevEditable = currentTarget;
-        do
-        {
-            prevEditable = !value && currentGroup
-                ? getPreviousOutsider(prevEditable, currentGroup)
-                : getPreviousByClass(prevEditable, "editable");
-        }
-        while (prevEditable && !prevEditable.offsetHeight);
-
-        this.setEditTarget(prevEditable);
-    },
-
-    insertRow: function(relative, insertWhere)
-    {
-        var group =
-            relative || getAncestorByClass(currentTarget, "editGroup") || currentTarget;
-        var value = this.stopEditing();
-
-        currentPanel = Firebug.getElementPanel(group);
-
-        currentEditor = currentPanel.getEditor(group, value);
-        if (!currentEditor)
-            currentEditor = getDefaultEditor(currentPanel);
-
-        currentGroup = currentEditor.insertNewRow(group, insertWhere);
-        if (!currentGroup)
-            return;
-
-        var editable = hasClass(currentGroup, "editable")
-            ? currentGroup
-            : getNextByClass(currentGroup, "editable");
-
-        if (editable)
-            this.setEditTarget(editable);
-    },
-
-    insertRowForObject: function(relative)
-    {
-        var container = getAncestorByClass(relative, "insertInto");
-        if (container)
-        {
-            relative = getChildByClass(container, "insertBefore");
-            if (relative)
-                this.insertRow(relative, "before");
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    attachListeners: function(editor, context)
-    {
-        var win = isIE ?
-                currentTarget.ownerDocument.parentWindow :
-                currentTarget.ownerDocument.defaultView;
-
-        addEvent(win, "resize", this.onResize);
-        addEvent(win, "blur", this.onBlur);
-
-        var chrome = Firebug.chrome;
-
-        this.listeners = [
-            chrome.keyCodeListen("ESCAPE", null, bind(this.cancelEditing, this))
-        ];
-
-        if (editor.arrowCompletion)
-        {
-            this.listeners.push(
-                chrome.keyCodeListen("UP", null, bindFixed(editor.completeValue, editor, -1)),
-                chrome.keyCodeListen("DOWN", null, bindFixed(editor.completeValue, editor, 1)),
-                chrome.keyCodeListen("PAGE_UP", null, bindFixed(editor.completeValue, editor, -pageAmount)),
-                chrome.keyCodeListen("PAGE_DOWN", null, bindFixed(editor.completeValue, editor, pageAmount))
-            );
-        }
-
-        if (currentEditor.tabNavigation)
-        {
-            this.listeners.push(
-                chrome.keyCodeListen("RETURN", null, bind(this.tabNextEditor, this)),
-                chrome.keyCodeListen("RETURN", isControl, bind(this.insertRow, this, null, "after")),
-                chrome.keyCodeListen("TAB", null, bind(this.tabNextEditor, this)),
-                chrome.keyCodeListen("TAB", isShift, bind(this.tabPreviousEditor, this))
-            );
-        }
-        else if (currentEditor.multiLine)
-        {
-            this.listeners.push(
-                chrome.keyCodeListen("TAB", null, insertTab)
-            );
-        }
-        else
-        {
-            this.listeners.push(
-                chrome.keyCodeListen("RETURN", null, bindFixed(this.stopEditing, this))
-            );
-
-            if (currentEditor.tabCompletion)
-            {
-                this.listeners.push(
-                    chrome.keyCodeListen("TAB", null, bind(editor.completeValue, editor, 1)),
-                    chrome.keyCodeListen("TAB", isShift, bind(editor.completeValue, editor, -1))
-                );
-            }
-        }
-    },
-
-    detachListeners: function(editor, context)
-    {
-        if (!this.listeners)
-            return;
-
-        var win = isIE ?
-                currentTarget.ownerDocument.parentWindow :
-                currentTarget.ownerDocument.defaultView;
-
-        removeEvent(win, "resize", this.onResize);
-        removeEvent(win, "blur", this.onBlur);
-
-        var chrome = Firebug.chrome;
-        if (chrome)
-        {
-            for (var i = 0; i < this.listeners.length; ++i)
-                chrome.keyIgnore(this.listeners[i]);
-        }
-
-        delete this.listeners;
-    },
-
-    onResize: function(event)
-    {
-        currentEditor.layout(true);
-    },
-
-    onBlur: function(event)
-    {
-        if (currentEditor.enterOnBlur && isAncestor(event.target, currentEditor.box))
-            this.stopEditing();
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends Module
-
-    initialize: function()
-    {
-        Firebug.Module.initialize.apply(this, arguments);
-
-        this.onResize = bindFixed(this.onResize, this);
-        this.onBlur = bind(this.onBlur, this);
-    },
-
-    disable: function()
-    {
-        this.stopEditing();
-    },
-
-    showContext: function(browser, context)
-    {
-        this.stopEditing();
-    },
-
-    showPanel: function(browser, panel)
-    {
-        this.stopEditing();
-    }
-});
-
-// ************************************************************************************************
-// BaseEditor
-
-Firebug.BaseEditor = extend(Firebug.MeasureBox,
-{
-    getValue: function()
-    {
-    },
-
-    setValue: function(value)
-    {
-    },
-
-    show: function(target, panel, value, textSize, targetSize)
-    {
-    },
-
-    hide: function()
-    {
-    },
-
-    layout: function(forceAll)
-    {
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Support for context menus within inline editors.
-
-    getContextMenuItems: function(target)
-    {
-        var items = [];
-        items.push({label: "Cut", commandID: "cmd_cut"});
-        items.push({label: "Copy", commandID: "cmd_copy"});
-        items.push({label: "Paste", commandID: "cmd_paste"});
-        return items;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Editor Module listeners will get "onBeginEditing" just before this call
-
-    beginEditing: function(target, value)
-    {
-    },
-
-    // Editor Module listeners will get "onSaveEdit" just after this call
-    saveEdit: function(target, value, previousValue)
-    {
-    },
-
-    endEditing: function(target, value, cancel)
-    {
-        // Remove empty groups by default
-        return true;
-    },
-
-    insertNewRow: function(target, insertWhere)
-    {
-    }
-});
-
-// ************************************************************************************************
-// InlineEditor
-
-// basic inline editor attributes
-var inlineEditorAttributes = {
-    "class": "textEditorInner",
-
-    type: "text",
-    spellcheck: "false",
-
-    onkeypress: "$onKeyPress",
-
-    onoverflow: "$onOverflow",
-    oncontextmenu: "$onContextMenu"
-};
-
-// IE does not support the oninput event, so we're using the onkeydown to signalize
-// the relevant keyboard events, and the onpropertychange to actually handle the
-// input event, which should happen after the onkeydown event is fired and after the
-// value of the input is updated, but before the onkeyup and before the input (with the
-// new value) is rendered
-if (isIE)
-{
-    inlineEditorAttributes.onpropertychange = "$onInput";
-    inlineEditorAttributes.onkeydown = "$onKeyDown";
-}
-// for other browsers we use the oninput event
-else
-{
-    inlineEditorAttributes.oninput = "$onInput";
-}
-
-Firebug.InlineEditor = function(doc)
-{
-    this.initializeInline(doc);
-};
-
-Firebug.InlineEditor.prototype = domplate(Firebug.BaseEditor,
-{
-    enterOnBlur: true,
-    outerMargin: 8,
-    shadowExpand: 7,
-
-    tag:
-        DIV({"class": "inlineEditor"},
-            DIV({"class": "textEditorTop1"},
-                DIV({"class": "textEditorTop2"})
-            ),
-            DIV({"class": "textEditorInner1"},
-                DIV({"class": "textEditorInner2"},
-                    INPUT(
-                        inlineEditorAttributes
-                    )
-                )
-            ),
-            DIV({"class": "textEditorBottom1"},
-                DIV({"class": "textEditorBottom2"})
-            )
-        ),
-
-    inputTag :
-        INPUT({"class": "textEditorInner", type: "text",
-            /*oninput: "$onInput",*/ onkeypress: "$onKeyPress", onoverflow: "$onOverflow"}
-        ),
-
-    expanderTag:
-        IMG({"class": "inlineExpander", src: "blank.gif"}),
-
-    initialize: function()
-    {
-        this.fixedWidth = false;
-        this.completeAsYouType = true;
-        this.tabNavigation = true;
-        this.multiLine = false;
-        this.tabCompletion = false;
-        this.arrowCompletion = true;
-        this.noWrap = true;
-        this.numeric = false;
-    },
-
-    destroy: function()
-    {
-        this.destroyInput();
-    },
-
-    initializeInline: function(doc)
-    {
-        if (FBTrace.DBG_EDITOR)
-            FBTrace.sysout("Firebug.InlineEditor initializeInline()");
-
-        //this.box = this.tag.replace({}, doc, this);
-        this.box = this.tag.append({}, doc.body, this);
-
-        //this.input = this.box.childNodes[1].firstChild.firstChild;  // XXXjjb childNode[1] required
-        this.input = this.box.getElementsByTagName("input")[0];
-
-        if (isIElt8)
-        {
-            this.input.style.top = "-8px";
-        }
-
-        this.expander = this.expanderTag.replace({}, doc, this);
-        this.initialize();
-    },
-
-    destroyInput: function()
-    {
-        // XXXjoe Need to remove input/keypress handlers to avoid leaks
-    },
-
-    getValue: function()
-    {
-        return this.input.value;
-    },
-
-    setValue: function(value)
-    {
-        // It's only a one-line editor, so new lines shouldn't be allowed
-        return this.input.value = stripNewLines(value);
-    },
-
-    show: function(target, panel, value, targetSize)
-    {
-        //dispatch([Firebug.A11yModel], "onInlineEditorShow", [panel, this]);
-        this.target = target;
-        this.panel = panel;
-
-        this.targetSize = targetSize;
-
-        // TODO: xxxpedro editor
-        //this.targetOffset = getClientOffset(target);
-
-        // Some browsers (IE, Google Chrome and Safari) will have problem trying to get the
-        // offset values of invisible elements, or empty elements. So, in order to get the
-        // correct values, we temporary inject a character in the innerHTML of the empty element,
-        // then we get the offset values, and next, we restore the original innerHTML value.
-        var innerHTML = target.innerHTML;
-        var isEmptyElement = !innerHTML;
-        if (isEmptyElement)
-            target.innerHTML = ".";
-
-        // Get the position of the target element (that is about to be edited)
-        this.targetOffset =
-        {
-            x: target.offsetLeft,
-            y: target.offsetTop
-        };
-
-        // Restore the original innerHTML value of the empty element
-        if (isEmptyElement)
-            target.innerHTML = innerHTML;
-
-        this.originalClassName = this.box.className;
-
-        var classNames = target.className.split(" ");
-        for (var i = 0; i < classNames.length; ++i)
-            setClass(this.box, "editor-" + classNames[i]);
-
-        // Make the editor match the target's font style
-        copyTextStyles(target, this.box);
-
-        this.setValue(value);
-
-        if (this.fixedWidth)
-            this.updateLayout(true);
-        else
-        {
-            this.startMeasuring(target);
-            this.textSize = this.measureInputText(value);
-
-            // Correct the height of the box to make the funky CSS drop-shadow line up
-            var parent = this.input.parentNode;
-            if (hasClass(parent, "textEditorInner2"))
-            {
-                var yDiff = this.textSize.height - this.shadowExpand;
-
-                // IE6 height offset
-                if (isIE6)
-                    yDiff -= 2;
-
-                parent.style.height = yDiff + "px";
-                parent.parentNode.style.height = yDiff + "px";
-            }
-
-            this.updateLayout(true);
-        }
-
-        this.getAutoCompleter().reset();
-
-        if (isIElt8)
-            panel.panelNode.appendChild(this.box);
-        else
-            target.offsetParent.appendChild(this.box);
-
-        //console.log(target);
-        //this.input.select(); // it's called bellow, with setTimeout
-
-        if (isIE)
-        {
-            // reset input style
-            this.input.style.fontFamily = "Monospace";
-            this.input.style.fontSize = "11px";
-        }
-
-        // Insert the "expander" to cover the target element with white space
-        if (!this.fixedWidth)
-        {
-            copyBoxStyles(target, this.expander);
-
-            target.parentNode.replaceChild(this.expander, target);
-            collapse(target, true);
-            this.expander.parentNode.insertBefore(target, this.expander);
-        }
-
-        //TODO: xxxpedro
-        //scrollIntoCenterView(this.box, null, true);
-
-        // Display the editor after change its size and position to avoid flickering
-        this.box.style.display = "block";
-
-        // we need to call input.focus() and input.select() with a timeout,
-        // otherwise it won't work on all browsers due to timing issues
-        var self = this;
-        setTimeout(function(){
-            self.input.focus();
-            self.input.select();
-        },0);
-    },
-
-    hide: function()
-    {
-        this.box.className = this.originalClassName;
-
-        if (!this.fixedWidth)
-        {
-            this.stopMeasuring();
-
-            collapse(this.target, false);
-
-            if (this.expander.parentNode)
-                this.expander.parentNode.removeChild(this.expander);
-        }
-
-        if (this.box.parentNode)
-        {
-            ///setSelectionRange(this.input, 0, 0);
-            this.input.blur();
-
-            this.box.parentNode.removeChild(this.box);
-        }
-
-        delete this.target;
-        delete this.panel;
-    },
-
-    layout: function(forceAll)
-    {
-        if (!this.fixedWidth)
-            this.textSize = this.measureInputText(this.input.value);
-
-        if (forceAll)
-            this.targetOffset = getClientOffset(this.expander);
-
-        this.updateLayout(false, forceAll);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    beginEditing: function(target, value)
-    {
-    },
-
-    saveEdit: function(target, value, previousValue)
-    {
-    },
-
-    endEditing: function(target, value, cancel)
-    {
-        // Remove empty groups by default
-        return true;
-    },
-
-    insertNewRow: function(target, insertWhere)
-    {
-    },
-
-    advanceToNext: function(target, charCode)
-    {
-        return false;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    getAutoCompleteRange: function(value, offset)
-    {
-    },
-
-    getAutoCompleteList: function(preExpr, expr, postExpr)
-    {
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    getAutoCompleter: function()
-    {
-        if (!this.autoCompleter)
-        {
-            this.autoCompleter = new Firebug.AutoCompleter(null,
-                bind(this.getAutoCompleteRange, this), bind(this.getAutoCompleteList, this),
-                true, false);
-        }
-
-        return this.autoCompleter;
-    },
-
-    completeValue: function(amt)
-    {
-        //console.log("completeValue");
-
-        var selectRangeCallback = this.getAutoCompleter().complete(currentPanel.context, this.input, true, amt < 0);
-
-        if (selectRangeCallback)
-        {
-            Firebug.Editor.update(true);
-
-            // We need to select the editor text after calling update in Safari/Chrome,
-            // otherwise the text won't be selected
-            if (isSafari)
-                setTimeout(selectRangeCallback,0);
-            else
-                selectRangeCallback();
-        }
-        else
-            this.incrementValue(amt);
-    },
-
-    incrementValue: function(amt)
-    {
-        var value = this.input.value;
-
-        // TODO: xxxpedro editor
-        if (isIE)
-            var start = getInputSelectionStart(this.input), end = start;
-        else
-            var start = this.input.selectionStart, end = this.input.selectionEnd;
-
-        //debugger;
-        var range = this.getAutoCompleteRange(value, start);
-        if (!range || range.type != "int")
-            range = {start: 0, end: value.length-1};
-
-        var expr = value.substr(range.start, range.end-range.start+1);
-        preExpr = value.substr(0, range.start);
-        postExpr = value.substr(range.end+1);
-
-        // See if the value is an integer, and if so increment it
-        var intValue = parseInt(expr);
-        if (!!intValue || intValue == 0)
-        {
-            var m = /\d+/.exec(expr);
-            var digitPost = expr.substr(m.index+m[0].length);
-
-            var completion = intValue-amt;
-            this.input.value = preExpr + completion + digitPost + postExpr;
-
-            setSelectionRange(this.input, start, end);
-
-            Firebug.Editor.update(true);
-
-            return true;
-        }
-        else
-            return false;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    onKeyPress: function(event)
-    {
-        //console.log("onKeyPress", event);
-        if (event.keyCode == 27 && !this.completeAsYouType)
-        {
-            var reverted = this.getAutoCompleter().revert(this.input);
-            if (reverted)
-                cancelEvent(event);
-        }
-        else if (event.charCode && this.advanceToNext(this.target, event.charCode))
-        {
-            Firebug.Editor.tabNextEditor();
-            cancelEvent(event);
-        }
-        else
-        {
-            if (this.numeric && event.charCode && (event.charCode < 48 || event.charCode > 57)
-                && event.charCode != 45 && event.charCode != 46)
-                FBL.cancelEvent(event);
-            else
-            {
-                // If the user backspaces, don't autocomplete after the upcoming input event
-                this.ignoreNextInput = event.keyCode == 8;
-            }
-        }
-    },
-
-    onOverflow: function()
-    {
-        this.updateLayout(false, false, 3);
-    },
-
-    onKeyDown: function(event)
-    {
-        //console.log("onKeyDown", event.keyCode);
-        if (event.keyCode > 46 || event.keyCode == 32 || event.keyCode == 8)
-        {
-            this.keyDownPressed = true;
-        }
-    },
-
-    onInput: function(event)
-    {
-        //debugger;
-
-        // skip not relevant onpropertychange calls on IE
-        if (isIE)
-        {
-            if (event.propertyName != "value" || !isVisible(this.input) || !this.keyDownPressed)
-                return;
-
-            this.keyDownPressed = false;
-        }
-
-        //console.log("onInput", event);
-        //console.trace();
-
-        var selectRangeCallback;
-
-        if (this.ignoreNextInput)
-        {
-            this.ignoreNextInput = false;
-            this.getAutoCompleter().reset();
-        }
-        else if (this.completeAsYouType)
-            selectRangeCallback = this.getAutoCompleter().complete(currentPanel.context, this.input, false);
-        else
-            this.getAutoCompleter().reset();
-
-        Firebug.Editor.update();
-
-        if (selectRangeCallback)
-        {
-            // We need to select the editor text after calling update in Safari/Chrome,
-            // otherwise the text won't be selected
-            if (isSafari)
-                setTimeout(selectRangeCallback,0);
-            else
-                selectRangeCallback();
-        }
-    },
-
-    onContextMenu: function(event)
-    {
-        cancelEvent(event);
-
-        var popup = $("fbInlineEditorPopup");
-        FBL.eraseNode(popup);
-
-        var target = event.target || event.srcElement;
-        var menu = this.getContextMenuItems(target);
-        if (menu)
-        {
-            for (var i = 0; i < menu.length; ++i)
-                FBL.createMenuItem(popup, menu[i]);
-        }
-
-        if (!popup.firstChild)
-            return false;
-
-        popup.openPopupAtScreen(event.screenX, event.screenY, true);
-        return true;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    updateLayout: function(initial, forceAll, extraWidth)
-    {
-        if (this.fixedWidth)
-        {
-            this.box.style.left = (this.targetOffset.x) + "px";
-            this.box.style.top = (this.targetOffset.y) + "px";
-
-            var w = this.target.offsetWidth;
-            var h = this.target.offsetHeight;
-            this.input.style.width = w + "px";
-            this.input.style.height = (h-3) + "px";
-        }
-        else
-        {
-            if (initial || forceAll)
-            {
-                this.box.style.left = this.targetOffset.x + "px";
-                this.box.style.top = this.targetOffset.y + "px";
-            }
-
-            var approxTextWidth = this.textSize.width;
-            var maxWidth = (currentPanel.panelNode.scrollWidth - this.targetOffset.x)
-                - this.outerMargin;
-
-            var wrapped = initial
-                ? this.noWrap && this.targetSize.height > this.textSize.height+3
-                : this.noWrap && approxTextWidth > maxWidth;
-
-            if (wrapped)
-            {
-                var style = isIE ?
-                        this.target.currentStyle :
-                        this.target.ownerDocument.defaultView.getComputedStyle(this.target, "");
-
-                targetMargin = parseInt(style.marginLeft) + parseInt(style.marginRight);
-
-                // Make the width fit the remaining x-space from the offset to the far right
-                approxTextWidth = maxWidth - targetMargin;
-
-                this.input.style.width = "100%";
-                this.box.style.width = approxTextWidth + "px";
-            }
-            else
-            {
-                // Make the input one character wider than the text value so that
-                // typing does not ever cause the textbox to scroll
-                var charWidth = this.measureInputText('m').width;
-
-                // Sometimes we need to make the editor a little wider, specifically when
-                // an overflow happens, otherwise it will scroll off some text on the left
-                if (extraWidth)
-                    charWidth *= extraWidth;
-
-                var inputWidth = approxTextWidth + charWidth;
-
-                if (initial)
-                {
-                    if (isIE)
-                    {
-                        // TODO: xxxpedro
-                        var xDiff = 13;
-                        this.box.style.width = (inputWidth + xDiff) + "px";
-                    }
-                    else
-                        this.box.style.width = "auto";
-                }
-                else
-                {
-                    // TODO: xxxpedro
-                    var xDiff = isIE ? 13: this.box.scrollWidth - this.input.offsetWidth;
-                    this.box.style.width = (inputWidth + xDiff) + "px";
-                }
-
-                this.input.style.width = inputWidth + "px";
-            }
-
-            this.expander.style.width = approxTextWidth + "px";
-            this.expander.style.height = Math.max(this.textSize.height-3,0) + "px";
-        }
-
-        if (forceAll)
-            scrollIntoCenterView(this.box, null, true);
-    }
-});
-
-// ************************************************************************************************
-// Autocompletion
-
-Firebug.AutoCompleter = function(getExprOffset, getRange, evaluator, selectMode, caseSensitive)
-{
-    var candidates = null;
-    var originalValue = null;
-    var originalOffset = -1;
-    var lastExpr = null;
-    var lastOffset = -1;
-    var exprOffset = 0;
-    var lastIndex = 0;
-    var preParsed = null;
-    var preExpr = null;
-    var postExpr = null;
-
-    this.revert = function(textBox)
-    {
-        if (originalOffset != -1)
-        {
-            textBox.value = originalValue;
-
-            setSelectionRange(textBox, originalOffset, originalOffset);
-
-            this.reset();
-            return true;
-        }
-        else
-        {
-            this.reset();
-            return false;
-        }
-    };
-
-    this.reset = function()
-    {
-        candidates = null;
-        originalValue = null;
-        originalOffset = -1;
-        lastExpr = null;
-        lastOffset = 0;
-        exprOffset = 0;
-    };
-
-    this.complete = function(context, textBox, cycle, reverse)
-    {
-        //console.log("complete", context, textBox, cycle, reverse);
-        // TODO: xxxpedro important port to firebug (variable leak)
-        //var value = lastValue = textBox.value;
-        var value = textBox.value;
-
-        //var offset = textBox.selectionStart;
-        var offset = getInputSelectionStart(textBox);
-
-        // The result of selectionStart() in Safari/Chrome is 1 unit less than the result
-        // in Firefox. Therefore, we need to manually adjust the value here.
-        if (isSafari && !cycle && offset >= 0) offset++;
-
-        if (!selectMode && originalOffset != -1)
-            offset = originalOffset;
-
-        if (!candidates || !cycle || offset != lastOffset)
-        {
-            originalOffset = offset;
-            originalValue = value;
-
-            // Find the part of the string that will be parsed
-            var parseStart = getExprOffset ? getExprOffset(value, offset, context) : 0;
-            preParsed = value.substr(0, parseStart);
-            var parsed = value.substr(parseStart);
-
-            // Find the part of the string that is being completed
-            var range = getRange ? getRange(parsed, offset-parseStart, context) : null;
-            if (!range)
-                range = {start: 0, end: parsed.length-1 };
-
-            var expr = parsed.substr(range.start, range.end-range.start+1);
-            preExpr = parsed.substr(0, range.start);
-            postExpr = parsed.substr(range.end+1);
-            exprOffset = parseStart + range.start;
-
-            if (!cycle)
-            {
-                if (!expr)
-                    return;
-                else if (lastExpr && lastExpr.indexOf(expr) != 0)
-                {
-                    candidates = null;
-                }
-                else if (lastExpr && lastExpr.length >= expr.length)
-                {
-                    candidates = null;
-                    lastExpr = expr;
-                    return;
-                }
-            }
-
-            lastExpr = expr;
-            lastOffset = offset;
-
-            var searchExpr;
-
-            // Check if the cursor is at the very right edge of the expression, or
-            // somewhere in the middle of it
-            if (expr && offset != parseStart+range.end+1)
-            {
-                if (cycle)
-                {
-                    // We are in the middle of the expression, but we can
-                    // complete by cycling to the next item in the values
-                    // list after the expression
-                    offset = range.start;
-                    searchExpr = expr;
-                    expr = "";
-                }
-                else
-                {
-                    // We can't complete unless we are at the ridge edge
-                    return;
-                }
-            }
-
-            var values = evaluator(preExpr, expr, postExpr, context);
-            if (!values)
-                return;
-
-            if (expr)
-            {
-                // Filter the list of values to those which begin with expr. We
-                // will then go on to complete the first value in the resulting list
-                candidates = [];
-
-                if (caseSensitive)
-                {
-                    for (var i = 0; i < values.length; ++i)
-                    {
-                        var name = values[i];
-                        if (name.indexOf && name.indexOf(expr) == 0)
-                            candidates.push(name);
-                    }
-                }
-                else
-                {
-                    var lowerExpr = caseSensitive ? expr : expr.toLowerCase();
-                    for (var i = 0; i < values.length; ++i)
-                    {
-                        var name = values[i];
-                        if (name.indexOf && name.toLowerCase().indexOf(lowerExpr) == 0)
-                            candidates.push(name);
-                    }
-                }
-
-                lastIndex = reverse ? candidates.length-1 : 0;
-            }
-            else if (searchExpr)
-            {
-                var searchIndex = -1;
-
-                // Find the first instance of searchExpr in the values list. We
-                // will then complete the string that is found
-                if (caseSensitive)
-                {
-                    searchIndex = values.indexOf(expr);
-                }
-                else
-                {
-                    var lowerExpr = searchExpr.toLowerCase();
-                    for (var i = 0; i < values.length; ++i)
-                    {
-                        var name = values[i];
-                        if (name && name.toLowerCase().indexOf(lowerExpr) == 0)
-                        {
-                            searchIndex = i;
-                            break;
-                        }
-                    }
-                }
-
-                // Nothing found, so there's nothing to complete to
-                if (searchIndex == -1)
-                    return this.reset();
-
-                expr = searchExpr;
-                candidates = cloneArray(values);
-                lastIndex = searchIndex;
-            }
-            else
-            {
-                expr = "";
-                candidates = [];
-                for (var i = 0; i < values.length; ++i)
-                {
-                    if (values[i].substr)
-                        candidates.push(values[i]);
-                }
-                lastIndex = -1;
-            }
-        }
-
-        if (cycle)
-        {
-            expr = lastExpr;
-            lastIndex += reverse ? -1 : 1;
-        }
-
-        if (!candidates.length)
-            return;
-
-        if (lastIndex >= candidates.length)
-            lastIndex = 0;
-        else if (lastIndex < 0)
-            lastIndex = candidates.length-1;
-
-        var completion = candidates[lastIndex];
-        var preCompletion = expr.substr(0, offset-exprOffset);
-        var postCompletion = completion.substr(offset-exprOffset);
-
-        textBox.value = preParsed + preExpr + preCompletion + postCompletion + postExpr;
-        var offsetEnd = preParsed.length + preExpr.length + completion.length;
-
-        // TODO: xxxpedro remove the following commented code, if the lib.setSelectionRange()
-        // is working well.
-        /*
-        if (textBox.setSelectionRange)
-        {
-            // we must select the range with a timeout, otherwise the text won't
-            // be properly selected (because after this function executes, the editor's
-            // input will be resized to fit the whole text)
-            setTimeout(function(){
-                if (selectMode)
-                    textBox.setSelectionRange(offset, offsetEnd);
-                else
-                    textBox.setSelectionRange(offsetEnd, offsetEnd);
-            },0);
-        }
-        /**/
-
-        // we must select the range with a timeout, otherwise the text won't
-        // be properly selected (because after this function executes, the editor's
-        // input will be resized to fit the whole text)
-        /*
-        setTimeout(function(){
-            if (selectMode)
-                setSelectionRange(textBox, offset, offsetEnd);
-            else
-                setSelectionRange(textBox, offsetEnd, offsetEnd);
-        },0);
-
-        return true;
-        /**/
-
-        // The editor text should be selected only after calling the editor.update()
-        // in Safari/Chrome, otherwise the text won't be selected. So, we're returning
-        // a function to be called later (in the proper time for all browsers).
-        //
-        // TODO: xxxpedro see if we can move the editor.update() calls to here, and avoid
-        // returning a closure. the complete() function seems to be called only twice in
-        // editor.js. See if this function is called anywhere else (like css.js for example).
-        return function(){
-            //console.log("autocomplete ", textBox, offset, offsetEnd);
-
-            if (selectMode)
-                setSelectionRange(textBox, offset, offsetEnd);
-            else
-                setSelectionRange(textBox, offsetEnd, offsetEnd);
-        };
-        /**/
-    };
-};
-
-// ************************************************************************************************
-// Local Helpers
-
-var getDefaultEditor = function getDefaultEditor(panel)
-{
-    if (!defaultEditor)
-    {
-        var doc = panel.document;
-        defaultEditor = new Firebug.InlineEditor(doc);
-    }
-
-    return defaultEditor;
-}
-
-/**
- * An outsider is the first element matching the stepper element that
- * is not an child of group. Elements tagged with insertBefore or insertAfter
- * classes are also excluded from these results unless they are the sibling
- * of group, relative to group's parent editGroup. This allows for the proper insertion
- * rows when groups are nested.
- */
-var getOutsider = function getOutsider(element, group, stepper)
-{
-    var parentGroup = getAncestorByClass(group.parentNode, "editGroup");
-    var next;
-    do
-    {
-        next = stepper(next || element);
-    }
-    while (isAncestor(next, group) || isGroupInsert(next, parentGroup));
-
-    return next;
-}
-
-var isGroupInsert = function isGroupInsert(next, group)
-{
-    return (!group || isAncestor(next, group))
-        && (hasClass(next, "insertBefore") || hasClass(next, "insertAfter"));
-}
-
-var getNextOutsider = function getNextOutsider(element, group)
-{
-    return getOutsider(element, group, bind(getNextByClass, FBL, "editable"));
-}
-
-var getPreviousOutsider = function getPreviousOutsider(element, group)
-{
-    return getOutsider(element, group, bind(getPreviousByClass, FBL, "editable"));
-}
-
-var getInlineParent = function getInlineParent(element)
-{
-    var lastInline = element;
-    for (; element; element = element.parentNode)
-    {
-        //var s = element.ownerDocument.defaultView.getComputedStyle(element, "");
-        var s = isIE ?
-                element.currentStyle :
-                element.ownerDocument.defaultView.getComputedStyle(element, "");
-
-        if (s.display != "inline")
-            return lastInline;
-        else
-            lastInline = element;
-    }
-    return null;
-}
-
-var insertTab = function insertTab()
-{
-    insertTextIntoElement(currentEditor.input, Firebug.Editor.tabCharacter);
-}
-
-// ************************************************************************************************
-
-Firebug.registerModule(Firebug.Editor);
-
-// ************************************************************************************************
-
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-if (Env.Options.disableXHRListener)
-    return;
-
-// ************************************************************************************************
-// XHRSpy
-
-var XHRSpy = function()
-{
-    this.requestHeaders = [];
-    this.responseHeaders = [];
-};
-
-XHRSpy.prototype =
-{
-    method: null,
-    url: null,
-    async: null,
-
-    xhrRequest: null,
-
-    href: null,
-
-    loaded: false,
-
-    logRow: null,
-
-    responseText: null,
-
-    requestHeaders: null,
-    responseHeaders: null,
-
-    sourceLink: null, // {href:"file.html", line: 22}
-
-    getURL: function()
-    {
-        return this.href;
-    }
-};
-
-// ************************************************************************************************
-// XMLHttpRequestWrapper
-
-var XMLHttpRequestWrapper = function(activeXObject)
-{
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // XMLHttpRequestWrapper internal variables
-
-    var xhrRequest = typeof activeXObject != "undefined" ?
-                activeXObject :
-                new _XMLHttpRequest(),
-
-        spy = new XHRSpy(),
-
-        self = this,
-
-        reqType,
-        reqUrl,
-        reqStartTS;
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // XMLHttpRequestWrapper internal methods
-
-    var updateSelfPropertiesIgnore = {
-        abort: 1,
-        channel: 1,
-        getAllResponseHeaders: 1,
-        getInterface: 1,
-        getResponseHeader: 1,
-        mozBackgroundRequest: 1,
-        multipart: 1,
-        onreadystatechange: 1,
-        open: 1,
-        send: 1,
-        setRequestHeader: 1
-    };
-
-    var updateSelfProperties = function()
-    {
-        if (supportsXHRIterator)
-        {
-            for (var propName in xhrRequest)
-            {
-                if (propName in updateSelfPropertiesIgnore)
-                    continue;
-
-                try
-                {
-                    var propValue = xhrRequest[propName];
-
-                    if (propValue && !isFunction(propValue))
-                        self[propName] = propValue;
-                }
-                catch(E)
-                {
-                    //console.log(propName, E.message);
-                }
-            }
-        }
-        else
-        {
-            // will fail to read these xhrRequest properties if the request is not completed
-            if (xhrRequest.readyState == 4)
-            {
-                self.status = xhrRequest.status;
-                self.statusText = xhrRequest.statusText;
-                self.responseText = xhrRequest.responseText;
-                self.responseXML = xhrRequest.responseXML;
-            }
-        }
-    };
-
-    var updateXHRPropertiesIgnore = {
-        channel: 1,
-        onreadystatechange: 1,
-        readyState: 1,
-        responseBody: 1,
-        responseText: 1,
-        responseXML: 1,
-        status: 1,
-        statusText: 1,
-        upload: 1
-    };
-
-    var updateXHRProperties = function()
-    {
-        for (var propName in self)
-        {
-            if (propName in updateXHRPropertiesIgnore)
-                continue;
-
-            try
-            {
-                var propValue = self[propName];
-
-                if (propValue && !xhrRequest[propName])
-                {
-                    xhrRequest[propName] = propValue;
-                }
-            }
-            catch(E)
-            {
-                //console.log(propName, E.message);
-            }
-        }
-    };
-
-    var logXHR = function()
-    {
-        var row = Firebug.Console.log(spy, null, "spy", Firebug.Spy.XHR);
-
-        if (row)
-        {
-            setClass(row, "loading");
-            spy.logRow = row;
-        }
-    };
-
-    var finishXHR = function()
-    {
-        var duration = new Date().getTime() - reqStartTS;
-        var success = xhrRequest.status == 200;
-
-        var responseHeadersText = xhrRequest.getAllResponseHeaders();
-        var responses = responseHeadersText ? responseHeadersText.split(/[\n\r]/) : [];
-        var reHeader = /^(\S+):\s*(.*)/;
-
-        for (var i=0, l=responses.length; i<l; i++)
-        {
-            var text = responses[i];
-            var match = text.match(reHeader);
-
-            if (match)
-            {
-                var name = match[1];
-                var value = match[2];
-
-                // update the spy mimeType property so we can detect when to show
-                // custom response viewers (such as HTML, XML or JSON viewer)
-                if (name == "Content-Type")
-                    spy.mimeType = value;
-
-                /*
-                if (name == "Last Modified")
-                {
-                    if (!spy.cacheEntry)
-                        spy.cacheEntry = [];
-
-                    spy.cacheEntry.push({
-                       name: [name],
-                       value: [value]
-                    });
-                }
-                /**/
-
-                spy.responseHeaders.push({
-                   name: [name],
-                   value: [value]
-                });
-            }
-        }
-
-        with({
-            row: spy.logRow,
-            status: xhrRequest.status == 0 ?
-                        // if xhrRequest.status == 0 then accessing xhrRequest.statusText
-                        // will cause an error, so we must handle this case (Issue 3504)
-                        "" : xhrRequest.status + " " + xhrRequest.statusText,
-            time: duration,
-            success: success
-        })
-        {
-            setTimeout(function(){
-
-                spy.responseText = xhrRequest.responseText;
-
-                // update row information to avoid "ethernal spinning gif" bug in IE
-                row = row || spy.logRow;
-
-                // if chrome document is not loaded, there will be no row yet, so just ignore
-                if (!row) return;
-
-                // update the XHR representation data
-                handleRequestStatus(success, status, time);
-
-            },200);
-        }
-
-        spy.loaded = true;
-        /*
-        // commented because they are being updated by the updateSelfProperties() function
-        self.status = xhrRequest.status;
-        self.statusText = xhrRequest.statusText;
-        self.responseText = xhrRequest.responseText;
-        self.responseXML = xhrRequest.responseXML;
-        /**/
-        updateSelfProperties();
-    };
-
-    var handleStateChange = function()
-    {
-        //Firebug.Console.log(["onreadystatechange", xhrRequest.readyState, xhrRequest.readyState == 4 && xhrRequest.status]);
-
-        self.readyState = xhrRequest.readyState;
-
-        if (xhrRequest.readyState == 4)
-        {
-            finishXHR();
-
-            xhrRequest.onreadystatechange = function(){};
-        }
-
-        //Firebug.Console.log(spy.url + ": " + xhrRequest.readyState);
-
-        self.onreadystatechange();
-    };
-
-    // update the XHR representation data
-    var handleRequestStatus = function(success, status, time)
-    {
-        var row = spy.logRow;
-        FBL.removeClass(row, "loading");
-
-        if (!success)
-            FBL.setClass(row, "error");
-
-        var item = FBL.$$(".spyStatus", row)[0];
-        item.innerHTML = status;
-
-        if (time)
-        {
-            var item = FBL.$$(".spyTime", row)[0];
-            item.innerHTML = time + "ms";
-        }
-    };
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // XMLHttpRequestWrapper public properties and handlers
-
-    this.readyState = 0;
-
-    this.onreadystatechange = function(){};
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // XMLHttpRequestWrapper public methods
-
-    this.open = function(method, url, async, user, password)
-    {
-        //Firebug.Console.log("xhrRequest open");
-
-        updateSelfProperties();
-
-        if (spy.loaded)
-            spy = new XHRSpy();
-
-        spy.method = method;
-        spy.url = url;
-        spy.async = async;
-        spy.href = url;
-        spy.xhrRequest = xhrRequest;
-        spy.urlParams = parseURLParamsArray(url);
-
-        try
-        {
-            // xhrRequest.open.apply may not be available in IE
-            if (supportsApply)
-                xhrRequest.open.apply(xhrRequest, arguments);
-            else
-                xhrRequest.open(method, url, async, user, password);
-        }
-        catch(e)
-        {
-        }
-
-        xhrRequest.onreadystatechange = handleStateChange;
-
-    };
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    this.send = function(data)
-    {
-        //Firebug.Console.log("xhrRequest send");
-        spy.data = data;
-
-        reqStartTS = new Date().getTime();
-
-        updateXHRProperties();
-
-        try
-        {
-            xhrRequest.send(data);
-        }
-        catch(e)
-        {
-            // TODO: xxxpedro XHR throws or not?
-            //throw e;
-        }
-        finally
-        {
-            logXHR();
-
-            if (!spy.async)
-            {
-                self.readyState = xhrRequest.readyState;
-
-                // sometimes an error happens when calling finishXHR()
-                // Issue 3422: Firebug Lite breaks Google Instant Search
-                try
-                {
-                    finishXHR();
-                }
-                catch(E)
-                {
-                }
-            }
-        }
-    };
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    this.setRequestHeader = function(header, value)
-    {
-        spy.requestHeaders.push({name: [header], value: [value]});
-        return xhrRequest.setRequestHeader(header, value);
-    };
-
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    this.abort = function()
-    {
-        xhrRequest.abort();
-        updateSelfProperties();
-        handleRequestStatus(false, "Aborted");
-    };
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    this.getResponseHeader = function(header)
-    {
-        return xhrRequest.getResponseHeader(header);
-    };
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    this.getAllResponseHeaders = function()
-    {
-        return xhrRequest.getAllResponseHeaders();
-    };
-
-    /**/
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Clone XHR object
-
-    // xhrRequest.open.apply not available in IE and will throw an error in
-    // IE6 by simply reading xhrRequest.open so we must sniff it
-    var supportsApply = !isIE6 &&
-            xhrRequest &&
-            xhrRequest.open &&
-            typeof xhrRequest.open.apply != "undefined";
-
-    var numberOfXHRProperties = 0;
-    for (var propName in xhrRequest)
-    {
-        numberOfXHRProperties++;
-
-        if (propName in updateSelfPropertiesIgnore)
-            continue;
-
-        try
-        {
-            var propValue = xhrRequest[propName];
-
-            if (isFunction(propValue))
-            {
-                if (typeof self[propName] == "undefined")
-                {
-                    this[propName] = (function(name, xhr){
-
-                        return supportsApply ?
-                            // if the browser supports apply
-                            function()
-                            {
-                                return xhr[name].apply(xhr, arguments);
-                            }
-                            :
-                            function(a,b,c,d,e)
-                            {
-                                return xhr[name](a,b,c,d,e);
-                            };
-
-                    })(propName, xhrRequest);
-                }
-            }
-            else
-                this[propName] = propValue;
-        }
-        catch(E)
-        {
-            //console.log(propName, E.message);
-        }
-    }
-
-    // IE6 does not support for (var prop in XHR)
-    var supportsXHRIterator = numberOfXHRProperties > 0;
-
-    /**/
-
-    return this;
-};
-
-// ************************************************************************************************
-// ActiveXObject Wrapper (IE6 only)
-
-var _ActiveXObject;
-var isIE6 =  /msie 6/i.test(navigator.appVersion);
-
-if (isIE6)
-{
-    _ActiveXObject = window.ActiveXObject;
-
-    var xhrObjects = " MSXML2.XMLHTTP.5.0 MSXML2.XMLHTTP.4.0 MSXML2.XMLHTTP.3.0 MSXML2.XMLHTTP Microsoft.XMLHTTP ";
-
-    window.ActiveXObject = function(name)
-    {
-        var error = null;
-
-        try
-        {
-            var activeXObject = new _ActiveXObject(name);
-        }
-        catch(e)
-        {
-            error = e;
-        }
-        finally
-        {
-            if (!error)
-            {
-                if (xhrObjects.indexOf(" " + name + " ") != -1)
-                    return new XMLHttpRequestWrapper(activeXObject);
-                else
-                    return activeXObject;
-            }
-            else
-                throw error.message;
-        }
-    };
-}
-
-// ************************************************************************************************
-
-// Register the XMLHttpRequestWrapper for non-IE6 browsers
-if (!isIE6)
-{
-    var _XMLHttpRequest = XMLHttpRequest;
-    window.XMLHttpRequest = function()
-    {
-        return new XMLHttpRequestWrapper();
-    };
-}
-
-//************************************************************************************************
-
-FBL.getNativeXHRObject = function()
-{
-    var xhrObj = false;
-    try
-    {
-        xhrObj = new _XMLHttpRequest();
-    }
-    catch(e)
-    {
-        var progid = [
-                "MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0",
-                "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"
-            ];
-
-        for ( var i=0; i < progid.length; ++i ) {
-            try
-            {
-                xhrObj = new _ActiveXObject(progid[i]);
-            }
-            catch(e)
-            {
-                continue;
-            }
-            break;
-        }
-    }
-    finally
-    {
-        return xhrObj;
-    }
-};
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var reIgnore = /about:|javascript:|resource:|chrome:|jar:/;
-var layoutInterval = 300;
-var indentWidth = 18;
-
-var cacheSession = null;
-var contexts = new Array();
-var panelName = "net";
-var maxQueueRequests = 500;
-//var panelBar1 = $("fbPanelBar1"); // chrome not available at startup
-var activeRequests = [];
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var mimeExtensionMap =
-{
-    "txt": "text/plain",
-    "html": "text/html",
-    "htm": "text/html",
-    "xhtml": "text/html",
-    "xml": "text/xml",
-    "css": "text/css",
-    "js": "application/x-javascript",
-    "jss": "application/x-javascript",
-    "jpg": "image/jpg",
-    "jpeg": "image/jpeg",
-    "gif": "image/gif",
-    "png": "image/png",
-    "bmp": "image/bmp",
-    "swf": "application/x-shockwave-flash",
-    "flv": "video/x-flv"
-};
-
-var fileCategories =
-{
-    "undefined": 1,
-    "html": 1,
-    "css": 1,
-    "js": 1,
-    "xhr": 1,
-    "image": 1,
-    "flash": 1,
-    "txt": 1,
-    "bin": 1
-};
-
-var textFileCategories =
-{
-    "txt": 1,
-    "html": 1,
-    "xhr": 1,
-    "css": 1,
-    "js": 1
-};
-
-var binaryFileCategories =
-{
-    "bin": 1,
-    "flash": 1
-};
-
-var mimeCategoryMap =
-{
-    "text/plain": "txt",
-    "application/octet-stream": "bin",
-    "text/html": "html",
-    "text/xml": "html",
-    "text/css": "css",
-    "application/x-javascript": "js",
-    "text/javascript": "js",
-    "application/javascript" : "js",
-    "image/jpeg": "image",
-    "image/jpg": "image",
-    "image/gif": "image",
-    "image/png": "image",
-    "image/bmp": "image",
-    "application/x-shockwave-flash": "flash",
-    "video/x-flv": "flash"
-};
-
-var binaryCategoryMap =
-{
-    "image": 1,
-    "flash" : 1
-};
-
-// ************************************************************************************************
-
-/**
- * @module Represents a module object for the Net panel. This object is derived
- * from <code>Firebug.ActivableModule</code> in order to support activation (enable/disable).
- * This allows to avoid (performance) expensive features if the functionality is not necessary
- * for the user.
- */
-Firebug.NetMonitor = extend(Firebug.ActivableModule,
-{
-    dispatchName: "netMonitor",
-
-    clear: function(context)
-    {
-        // The user pressed a Clear button so, remove content of the panel...
-        var panel = context.getPanel(panelName, true);
-        if (panel)
-            panel.clear();
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends Module
-
-    initialize: function()
-    {
-        return;
-
-        this.panelName = panelName;
-
-        Firebug.ActivableModule.initialize.apply(this, arguments);
-
-        if (Firebug.TraceModule)
-            Firebug.TraceModule.addListener(this.TraceListener);
-
-        // HTTP observer must be registered now (and not in monitorContext, since if a
-        // page is opened in a new tab the top document request would be missed otherwise.
-        NetHttpObserver.registerObserver();
-        NetHttpActivityObserver.registerObserver();
-
-        Firebug.Debugger.addListener(this.DebuggerListener);
-    },
-
-    shutdown: function()
-    {
-        return;
-
-        prefs.removeObserver(Firebug.prefDomain, this, false);
-        if (Firebug.TraceModule)
-            Firebug.TraceModule.removeListener(this.TraceListener);
-
-        NetHttpObserver.unregisterObserver();
-        NetHttpActivityObserver.unregisterObserver();
-
-        Firebug.Debugger.removeListener(this.DebuggerListener);
-    }
-});
-
-
-/**
- * @domplate Represents a template that is used to reneder detailed info about a request.
- * This template is rendered when a request is expanded.
- */
-Firebug.NetMonitor.NetInfoBody = domplate(Firebug.Rep, new Firebug.Listener(),
-{
-    tag:
-        DIV({"class": "netInfoBody", _repObject: "$file"},
-            TAG("$infoTabs", {file: "$file"}),
-            TAG("$infoBodies", {file: "$file"})
-        ),
-
-    infoTabs:
-        DIV({"class": "netInfoTabs focusRow subFocusRow", "role": "tablist"},
-            A({"class": "netInfoParamsTab netInfoTab a11yFocus", onclick: "$onClickTab", "role": "tab",
-                view: "Params",
-                $collapsed: "$file|hideParams"},
-                $STR("URLParameters")
-            ),
-            A({"class": "netInfoHeadersTab netInfoTab a11yFocus", onclick: "$onClickTab", "role": "tab",
-                view: "Headers"},
-                $STR("Headers")
-            ),
-            A({"class": "netInfoPostTab netInfoTab a11yFocus", onclick: "$onClickTab", "role": "tab",
-                view: "Post",
-                $collapsed: "$file|hidePost"},
-                $STR("Post")
-            ),
-            A({"class": "netInfoPutTab netInfoTab a11yFocus", onclick: "$onClickTab", "role": "tab",
-                view: "Put",
-                $collapsed: "$file|hidePut"},
-                $STR("Put")
-            ),
-            A({"class": "netInfoResponseTab netInfoTab a11yFocus", onclick: "$onClickTab", "role": "tab",
-                view: "Response",
-                $collapsed: "$file|hideResponse"},
-                $STR("Response")
-            ),
-            A({"class": "netInfoCacheTab netInfoTab a11yFocus", onclick: "$onClickTab", "role": "tab",
-               view: "Cache",
-               $collapsed: "$file|hideCache"},
-               $STR("Cache")
-            ),
-            A({"class": "netInfoHtmlTab netInfoTab a11yFocus", onclick: "$onClickTab", "role": "tab",
-               view: "Html",
-               $collapsed: "$file|hideHtml"},
-               $STR("HTML")
-            )
-        ),
-
-    infoBodies:
-        DIV({"class": "netInfoBodies outerFocusRow"},
-            TABLE({"class": "netInfoParamsText netInfoText netInfoParamsTable", "role": "tabpanel",
-                    cellpadding: 0, cellspacing: 0}, TBODY()),
-            DIV({"class": "netInfoHeadersText netInfoText", "role": "tabpanel"}),
-            DIV({"class": "netInfoPostText netInfoText", "role": "tabpanel"}),
-            DIV({"class": "netInfoPutText netInfoText", "role": "tabpanel"}),
-            PRE({"class": "netInfoResponseText netInfoText", "role": "tabpanel"}),
-            DIV({"class": "netInfoCacheText netInfoText", "role": "tabpanel"},
-                TABLE({"class": "netInfoCacheTable", cellpadding: 0, cellspacing: 0, "role": "presentation"},
-                    TBODY({"role": "list", "aria-label": $STR("Cache")})
-                )
-            ),
-            DIV({"class": "netInfoHtmlText netInfoText", "role": "tabpanel"},
-                IFRAME({"class": "netInfoHtmlPreview", "role": "document"})
-            )
-        ),
-
-    headerDataTag:
-        FOR("param", "$headers",
-            TR({"role": "listitem"},
-                TD({"class": "netInfoParamName", "role": "presentation"},
-                    TAG("$param|getNameTag", {param: "$param"})
-                ),
-                TD({"class": "netInfoParamValue", "role": "list", "aria-label": "$param.name"},
-                    FOR("line", "$param|getParamValueIterator",
-                        CODE({"class": "focusRow subFocusRow", "role": "listitem"}, "$line")
-                    )
-                )
-            )
-        ),
-
-    customTab:
-        A({"class": "netInfo$tabId\\Tab netInfoTab", onclick: "$onClickTab", view: "$tabId", "role": "tab"},
-            "$tabTitle"
-        ),
-
-    customBody:
-        DIV({"class": "netInfo$tabId\\Text netInfoText", "role": "tabpanel"}),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    nameTag:
-        SPAN("$param|getParamName"),
-
-    nameWithTooltipTag:
-        SPAN({title: "$param.name"}, "$param|getParamName"),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    getNameTag: function(param)
-    {
-        return (this.getParamName(param) == param.name) ? this.nameTag : this.nameWithTooltipTag;
-    },
-
-    getParamName: function(param)
-    {
-        var limit = 25;
-        var name = param.name;
-        if (name.length > limit)
-            name = name.substr(0, limit) + "...";
-        return name;
-    },
-
-    getParamTitle: function(param)
-    {
-        var limit = 25;
-        var name = param.name;
-        if (name.length > limit)
-            return name;
-        return "";
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    hideParams: function(file)
-    {
-        return !file.urlParams || !file.urlParams.length;
-    },
-
-    hidePost: function(file)
-    {
-        return file.method.toUpperCase() != "POST";
-    },
-
-    hidePut: function(file)
-    {
-        return file.method.toUpperCase() != "PUT";
-    },
-
-    hideResponse: function(file)
-    {
-        return false;
-        //return file.category in binaryFileCategories;
-    },
-
-    hideCache: function(file)
-    {
-        return true;
-        //xxxHonza: I don't see any reason why not to display the cache also info for images.
-        return !file.cacheEntry; // || file.category=="image";
-    },
-
-    hideHtml: function(file)
-    {
-        return (file.mimeType != "text/html") && (file.mimeType != "application/xhtml+xml");
-    },
-
-    onClickTab: function(event)
-    {
-        this.selectTab(event.currentTarget || event.srcElement);
-    },
-
-    getParamValueIterator: function(param)
-    {
-        // TODO: xxxpedro console2
-        return param.value;
-
-        // This value is inserted into CODE element and so, make sure the HTML isn't escaped (1210).
-        // This is why the second parameter is true.
-        // The CODE (with style white-space:pre) element preserves whitespaces so they are
-        // displayed the same, as they come from the server (1194).
-        // In case of a long header values of post parameters the value must be wrapped (2105).
-        return wrapText(param.value, true);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    appendTab: function(netInfoBox, tabId, tabTitle)
-    {
-        // Create new tab and body.
-        var args = {tabId: tabId, tabTitle: tabTitle};
-        ///this.customTab.append(args, netInfoBox.getElementsByClassName("netInfoTabs").item(0));
-        ///this.customBody.append(args, netInfoBox.getElementsByClassName("netInfoBodies").item(0));
-        this.customTab.append(args, $$(".netInfoTabs", netInfoBox)[0]);
-        this.customBody.append(args, $$(".netInfoBodies", netInfoBox)[0]);
-    },
-
-    selectTabByName: function(netInfoBox, tabName)
-    {
-        var tab = getChildByClass(netInfoBox, "netInfoTabs", "netInfo"+tabName+"Tab");
-        if (tab)
-            this.selectTab(tab);
-    },
-
-    selectTab: function(tab)
-    {
-        var view = tab.getAttribute("view");
-
-        var netInfoBox = getAncestorByClass(tab, "netInfoBody");
-
-        var selectedTab = netInfoBox.selectedTab;
-
-        if (selectedTab)
-        {
-            //netInfoBox.selectedText.removeAttribute("selected");
-            removeClass(netInfoBox.selectedText, "netInfoTextSelected");
-
-            removeClass(selectedTab, "netInfoTabSelected");
-            //selectedTab.removeAttribute("selected");
-            selectedTab.setAttribute("aria-selected", "false");
-        }
-
-        var textBodyName = "netInfo" + view + "Text";
-
-        selectedTab = netInfoBox.selectedTab = tab;
-
-        netInfoBox.selectedText = $$("."+textBodyName, netInfoBox)[0];
-        //netInfoBox.selectedText = netInfoBox.getElementsByClassName(textBodyName).item(0);
-
-        //netInfoBox.selectedText.setAttribute("selected", "true");
-        setClass(netInfoBox.selectedText, "netInfoTextSelected");
-
-        setClass(selectedTab, "netInfoTabSelected");
-        selectedTab.setAttribute("selected", "true");
-        selectedTab.setAttribute("aria-selected", "true");
-
-        var file = Firebug.getRepObject(netInfoBox);
-
-        //var context = Firebug.getElementPanel(netInfoBox).context;
-        var context = Firebug.chrome;
-
-        this.updateInfo(netInfoBox, file, context);
-    },
-
-    updateInfo: function(netInfoBox, file, context)
-    {
-        if (FBTrace.DBG_NET)
-            FBTrace.sysout("net.updateInfo; file", file);
-
-        if (!netInfoBox)
-        {
-            if (FBTrace.DBG_NET || FBTrace.DBG_ERRORS)
-                FBTrace.sysout("net.updateInfo; ERROR netInfo == null " + file.href, file);
-            return;
-        }
-
-        var tab = netInfoBox.selectedTab;
-
-        if (hasClass(tab, "netInfoParamsTab"))
-        {
-            if (file.urlParams && !netInfoBox.urlParamsPresented)
-            {
-                netInfoBox.urlParamsPresented = true;
-                this.insertHeaderRows(netInfoBox, file.urlParams, "Params");
-            }
-        }
-
-        else if (hasClass(tab, "netInfoHeadersTab"))
-        {
-            var headersText = $$(".netInfoHeadersText", netInfoBox)[0];
-            //var headersText = netInfoBox.getElementsByClassName("netInfoHeadersText").item(0);
-
-            if (file.responseHeaders && !netInfoBox.responseHeadersPresented)
-            {
-                netInfoBox.responseHeadersPresented = true;
-                NetInfoHeaders.renderHeaders(headersText, file.responseHeaders, "ResponseHeaders");
-            }
-
-            if (file.requestHeaders && !netInfoBox.requestHeadersPresented)
-            {
-                netInfoBox.requestHeadersPresented = true;
-                NetInfoHeaders.renderHeaders(headersText, file.requestHeaders, "RequestHeaders");
-            }
-        }
-
-        else if (hasClass(tab, "netInfoPostTab"))
-        {
-            if (!netInfoBox.postPresented)
-            {
-                netInfoBox.postPresented  = true;
-                //var postText = netInfoBox.getElementsByClassName("netInfoPostText").item(0);
-                var postText = $$(".netInfoPostText", netInfoBox)[0];
-                NetInfoPostData.render(context, postText, file);
-            }
-        }
-
-        else if (hasClass(tab, "netInfoPutTab"))
-        {
-            if (!netInfoBox.putPresented)
-            {
-                netInfoBox.putPresented  = true;
-                //var putText = netInfoBox.getElementsByClassName("netInfoPutText").item(0);
-                var putText = $$(".netInfoPutText", netInfoBox)[0];
-                NetInfoPostData.render(context, putText, file);
-            }
-        }
-
-        else if (hasClass(tab, "netInfoResponseTab") && file.loaded && !netInfoBox.responsePresented)
-        {
-            ///var responseTextBox = netInfoBox.getElementsByClassName("netInfoResponseText").item(0);
-            var responseTextBox = $$(".netInfoResponseText", netInfoBox)[0];
-            if (file.category == "image")
-            {
-                netInfoBox.responsePresented = true;
-
-                var responseImage = netInfoBox.ownerDocument.createElement("img");
-                responseImage.src = file.href;
-
-                clearNode(responseTextBox);
-                responseTextBox.appendChild(responseImage, responseTextBox);
-            }
-            else ///if (!(binaryCategoryMap.hasOwnProperty(file.category)))
-            {
-                this.setResponseText(file, netInfoBox, responseTextBox, context);
-            }
-        }
-
-        else if (hasClass(tab, "netInfoCacheTab") && file.loaded && !netInfoBox.cachePresented)
-        {
-            var responseTextBox = netInfoBox.getElementsByClassName("netInfoCacheText").item(0);
-            if (file.cacheEntry) {
-                netInfoBox.cachePresented = true;
-                this.insertHeaderRows(netInfoBox, file.cacheEntry, "Cache");
-            }
-        }
-
-        else if (hasClass(tab, "netInfoHtmlTab") && file.loaded && !netInfoBox.htmlPresented)
-        {
-            netInfoBox.htmlPresented = true;
-
-            var text = Utils.getResponseText(file, context);
-
-            ///var iframe = netInfoBox.getElementsByClassName("netInfoHtmlPreview").item(0);
-            var iframe = $$(".netInfoHtmlPreview", netInfoBox)[0];
-
-            ///iframe.contentWindow.document.body.innerHTML = text;
-
-            // TODO: xxxpedro net - remove scripts
-            var reScript = /<script(.|\s)*?\/script>/gi;
-
-            text = text.replace(reScript, "");
-
-            iframe.contentWindow.document.write(text);
-            iframe.contentWindow.document.close();
-        }
-
-        // Notify listeners about update so, content of custom tabs can be updated.
-        dispatch(NetInfoBody.fbListeners, "updateTabBody", [netInfoBox, file, context]);
-    },
-
-    setResponseText: function(file, netInfoBox, responseTextBox, context)
-    {
-        //**********************************************
-        //**********************************************
-        //**********************************************
-        netInfoBox.responsePresented = true;
-        // line breaks somehow are different in IE
-        // make this only once in the initialization? we don't have net panels and modules yet.
-        if (isIE)
-            responseTextBox.style.whiteSpace = "nowrap";
-
-        responseTextBox[
-                typeof responseTextBox.textContent != "undefined" ?
-                        "textContent" :
-                        "innerText"
-            ] = file.responseText;
-
-        return;
-        //**********************************************
-        //**********************************************
-        //**********************************************
-
-        // Get response text and make sure it doesn't exceed the max limit.
-        var text = Utils.getResponseText(file, context);
-        var limit = Firebug.netDisplayedResponseLimit + 15;
-        var limitReached = text ? (text.length > limit) : false;
-        if (limitReached)
-            text = text.substr(0, limit) + "...";
-
-        // Insert the response into the UI.
-        if (text)
-            insertWrappedText(text, responseTextBox);
-        else
-            insertWrappedText("", responseTextBox);
-
-        // Append a message informing the user that the response isn't fully displayed.
-        if (limitReached)
-        {
-            var object = {
-                text: $STR("net.responseSizeLimitMessage"),
-                onClickLink: function() {
-                    var panel = context.getPanel("net", true);
-                    panel.openResponseInTab(file);
-                }
-            };
-            Firebug.NetMonitor.ResponseSizeLimit.append(object, responseTextBox);
-        }
-
-        netInfoBox.responsePresented = true;
-
-        if (FBTrace.DBG_NET)
-            FBTrace.sysout("net.setResponseText; response text updated");
-    },
-
-    insertHeaderRows: function(netInfoBox, headers, tableName, rowName)
-    {
-        if (!headers.length)
-            return;
-
-        var headersTable = $$(".netInfo"+tableName+"Table", netInfoBox)[0];
-        //var headersTable = netInfoBox.getElementsByClassName("netInfo"+tableName+"Table").item(0);
-        var tbody = getChildByClass(headersTable, "netInfo" + rowName + "Body");
-        if (!tbody)
-            tbody = headersTable.firstChild;
-        var titleRow = getChildByClass(tbody, "netInfo" + rowName + "Title");
-
-        this.headerDataTag.insertRows({headers: headers}, titleRow ? titleRow : tbody);
-        removeClass(titleRow, "collapsed");
-    }
-});
-
-var NetInfoBody = Firebug.NetMonitor.NetInfoBody;
-
-// ************************************************************************************************
-
-/**
- * @domplate Used within the Net panel to display raw source of request and response headers
- * as well as pretty-formatted summary of these headers.
- */
-Firebug.NetMonitor.NetInfoHeaders = domplate(Firebug.Rep, //new Firebug.Listener(),
-{
-    tag:
-        DIV({"class": "netInfoHeadersTable", "role": "tabpanel"},
-            DIV({"class": "netInfoHeadersGroup netInfoResponseHeadersTitle"},
-                SPAN($STR("ResponseHeaders")),
-                SPAN({"class": "netHeadersViewSource response collapsed", onclick: "$onViewSource",
-                    _sourceDisplayed: false, _rowName: "ResponseHeaders"},
-                    $STR("net.headers.view source")
-                )
-            ),
-            TABLE({cellpadding: 0, cellspacing: 0},
-                TBODY({"class": "netInfoResponseHeadersBody", "role": "list",
-                    "aria-label": $STR("ResponseHeaders")})
-            ),
-            DIV({"class": "netInfoHeadersGroup netInfoRequestHeadersTitle"},
-                SPAN($STR("RequestHeaders")),
-                SPAN({"class": "netHeadersViewSource request collapsed", onclick: "$onViewSource",
-                    _sourceDisplayed: false, _rowName: "RequestHeaders"},
-                    $STR("net.headers.view source")
-                )
-            ),
-            TABLE({cellpadding: 0, cellspacing: 0},
-                TBODY({"class": "netInfoRequestHeadersBody", "role": "list",
-                    "aria-label": $STR("RequestHeaders")})
-            )
-        ),
-
-    sourceTag:
-        TR({"role": "presentation"},
-            TD({colspan: 2, "role": "presentation"},
-                PRE({"class": "source"})
-            )
-        ),
-
-    onViewSource: function(event)
-    {
-        var target = event.target;
-        var requestHeaders = (target.rowName == "RequestHeaders");
-
-        var netInfoBox = getAncestorByClass(target, "netInfoBody");
-        var file = netInfoBox.repObject;
-
-        if (target.sourceDisplayed)
-        {
-            var headers = requestHeaders ? file.requestHeaders : file.responseHeaders;
-            this.insertHeaderRows(netInfoBox, headers, target.rowName);
-            target.innerHTML = $STR("net.headers.view source");
-        }
-        else
-        {
-            var source = requestHeaders ? file.requestHeadersText : file.responseHeadersText;
-            this.insertSource(netInfoBox, source, target.rowName);
-            target.innerHTML = $STR("net.headers.pretty print");
-        }
-
-        target.sourceDisplayed = !target.sourceDisplayed;
-
-        cancelEvent(event);
-    },
-
-    insertSource: function(netInfoBox, source, rowName)
-    {
-        // This breaks copy to clipboard.
-        //if (source)
-        //    source = source.replace(/\r\n/gm, "<span style='color:lightgray'>\\r\\n</span>\r\n");
-
-        ///var tbody = netInfoBox.getElementsByClassName("netInfo" + rowName + "Body").item(0);
-        var tbody = $$(".netInfo" + rowName + "Body", netInfoBox)[0];
-        var node = this.sourceTag.replace({}, tbody);
-        ///var sourceNode = node.getElementsByClassName("source").item(0);
-        var sourceNode = $$(".source", node)[0];
-        sourceNode.innerHTML = source;
-    },
-
-    insertHeaderRows: function(netInfoBox, headers, rowName)
-    {
-        var headersTable = $$(".netInfoHeadersTable", netInfoBox)[0];
-        var tbody = $$(".netInfo" + rowName + "Body", headersTable)[0];
-
-        //var headersTable = netInfoBox.getElementsByClassName("netInfoHeadersTable").item(0);
-        //var tbody = headersTable.getElementsByClassName("netInfo" + rowName + "Body").item(0);
-
-        clearNode(tbody);
-
-        if (!headers.length)
-            return;
-
-        NetInfoBody.headerDataTag.insertRows({headers: headers}, tbody);
-
-        var titleRow = getChildByClass(headersTable, "netInfo" + rowName + "Title");
-        removeClass(titleRow, "collapsed");
-    },
-
-    init: function(parent)
-    {
-        var rootNode = this.tag.append({}, parent);
-
-        var netInfoBox = getAncestorByClass(parent, "netInfoBody");
-        var file = netInfoBox.repObject;
-
-        var viewSource;
-
-        viewSource = $$(".request", rootNode)[0];
-        //viewSource = rootNode.getElementsByClassName("netHeadersViewSource request").item(0);
-        if (file.requestHeadersText)
-            removeClass(viewSource, "collapsed");
-
-        viewSource = $$(".response", rootNode)[0];
-        //viewSource = rootNode.getElementsByClassName("netHeadersViewSource response").item(0);
-        if (file.responseHeadersText)
-            removeClass(viewSource, "collapsed");
-    },
-
-    renderHeaders: function(parent, headers, rowName)
-    {
-        if (!parent.firstChild)
-            this.init(parent);
-
-        this.insertHeaderRows(parent, headers, rowName);
-    }
-});
-
-var NetInfoHeaders = Firebug.NetMonitor.NetInfoHeaders;
-
-// ************************************************************************************************
-
-/**
- * @domplate Represents posted data within request info (the info, which is visible when
- * a request entry is expanded. This template renders content of the Post tab.
- */
-Firebug.NetMonitor.NetInfoPostData = domplate(Firebug.Rep, /*new Firebug.Listener(),*/
-{
-    // application/x-www-form-urlencoded
-    paramsTable:
-        TABLE({"class": "netInfoPostParamsTable", cellpadding: 0, cellspacing: 0, "role": "presentation"},
-            TBODY({"role": "list", "aria-label": $STR("net.label.Parameters")},
-                TR({"class": "netInfoPostParamsTitle", "role": "presentation"},
-                    TD({colspan: 3, "role": "presentation"},
-                        DIV({"class": "netInfoPostParams"},
-                            $STR("net.label.Parameters"),
-                            SPAN({"class": "netInfoPostContentType"},
-                                "application/x-www-form-urlencoded"
-                            )
-                        )
-                    )
-                )
-            )
-        ),
-
-    // multipart/form-data
-    partsTable:
-        TABLE({"class": "netInfoPostPartsTable", cellpadding: 0, cellspacing: 0, "role": "presentation"},
-            TBODY({"role": "list", "aria-label": $STR("net.label.Parts")},
-                TR({"class": "netInfoPostPartsTitle", "role": "presentation"},
-                    TD({colspan: 2, "role":"presentation" },
-                        DIV({"class": "netInfoPostParams"},
-                            $STR("net.label.Parts"),
-                            SPAN({"class": "netInfoPostContentType"},
-                                "multipart/form-data"
-                            )
-                        )
-                    )
-                )
-            )
-        ),
-
-    // application/json
-    jsonTable:
-        TABLE({"class": "netInfoPostJSONTable", cellpadding: 0, cellspacing: 0, "role": "presentation"},
-            ///TBODY({"role": "list", "aria-label": $STR("jsonviewer.tab.JSON")},
-            TBODY({"role": "list", "aria-label": $STR("JSON")},
-                TR({"class": "netInfoPostJSONTitle", "role": "presentation"},
-                    TD({"role": "presentation" },
-                        DIV({"class": "netInfoPostParams"},
-                            ///$STR("jsonviewer.tab.JSON")
-                            $STR("JSON")
-                        )
-                    )
-                ),
-                TR(
-                    TD({"class": "netInfoPostJSONBody"})
-                )
-            )
-        ),
-
-    // application/xml
-    xmlTable:
-        TABLE({"class": "netInfoPostXMLTable", cellpadding: 0, cellspacing: 0, "role": "presentation"},
-            TBODY({"role": "list", "aria-label": $STR("xmlviewer.tab.XML")},
-                TR({"class": "netInfoPostXMLTitle", "role": "presentation"},
-                    TD({"role": "presentation" },
-                        DIV({"class": "netInfoPostParams"},
-                            $STR("xmlviewer.tab.XML")
-                        )
-                    )
-                ),
-                TR(
-                    TD({"class": "netInfoPostXMLBody"})
-                )
-            )
-        ),
-
-    sourceTable:
-        TABLE({"class": "netInfoPostSourceTable", cellpadding: 0, cellspacing: 0, "role": "presentation"},
-            TBODY({"role": "list", "aria-label": $STR("net.label.Source")},
-                TR({"class": "netInfoPostSourceTitle", "role": "presentation"},
-                    TD({colspan: 2, "role": "presentation"},
-                        DIV({"class": "netInfoPostSource"},
-                            $STR("net.label.Source")
-                        )
-                    )
-                )
-            )
-        ),
-
-    sourceBodyTag:
-        TR({"role": "presentation"},
-            TD({colspan: 2, "role": "presentation"},
-                FOR("line", "$param|getParamValueIterator",
-                    CODE({"class":"focusRow subFocusRow" , "role": "listitem"},"$line")
-                )
-            )
-        ),
-
-    getParamValueIterator: function(param)
-    {
-        return NetInfoBody.getParamValueIterator(param);
-    },
-
-    render: function(context, parentNode, file)
-    {
-        //debugger;
-        var spy = getAncestorByClass(parentNode, "spyHead");
-        var spyObject = spy.repObject;
-        var data = spyObject.data;
-
-        ///var contentType = Utils.findHeader(file.requestHeaders, "content-type");
-        var contentType = file.mimeType;
-
-        ///var text = Utils.getPostText(file, context, true);
-        ///if (text == undefined)
-        ///    return;
-
-        ///if (Utils.isURLEncodedRequest(file, context))
-        // fake Utils.isURLEncodedRequest identification
-        if (contentType && contentType == "application/x-www-form-urlencoded" ||
-            data && data.indexOf("=") != -1)
-        {
-            ///var lines = text.split("\n");
-            ///var params = parseURLEncodedText(lines[lines.length-1]);
-            var params = parseURLEncodedTextArray(data);
-            if (params)
-                this.insertParameters(parentNode, params);
-        }
-
-        ///if (Utils.isMultiPartRequest(file, context))
-        ///{
-        ///    var data = this.parseMultiPartText(file, context);
-        ///    if (data)
-        ///        this.insertParts(parentNode, data);
-        ///}
-
-        // moved to the top
-        ///var contentType = Utils.findHeader(file.requestHeaders, "content-type");
-
-        ///if (Firebug.JSONViewerModel.isJSON(contentType))
-        var jsonData = {
-            responseText: data
-        };
-
-        if (Firebug.JSONViewerModel.isJSON(contentType, data))
-            ///this.insertJSON(parentNode, file, context);
-            this.insertJSON(parentNode, jsonData, context);
-
-        ///if (Firebug.XMLViewerModel.isXML(contentType))
-        ///    this.insertXML(parentNode, file, context);
-
-        ///var postText = Utils.getPostText(file, context);
-        ///postText = Utils.formatPostText(postText);
-        var postText = data;
-        if (postText)
-            this.insertSource(parentNode, postText);
-    },
-
-    insertParameters: function(parentNode, params)
-    {
-        if (!params || !params.length)
-            return;
-
-        var paramTable = this.paramsTable.append({object:{}}, parentNode);
-        var row = $$(".netInfoPostParamsTitle", paramTable)[0];
-        //var paramTable = this.paramsTable.append(null, parentNode);
-        //var row = paramTable.getElementsByClassName("netInfoPostParamsTitle").item(0);
-
-        var tbody = paramTable.getElementsByTagName("tbody")[0];
-
-        NetInfoBody.headerDataTag.insertRows({headers: params}, row);
-    },
-
-    insertParts: function(parentNode, data)
-    {
-        if (!data.params || !data.params.length)
-            return;
-
-        var partsTable = this.partsTable.append({object:{}}, parentNode);
-        var row = $$(".netInfoPostPartsTitle", paramTable)[0];
-        //var partsTable = this.partsTable.append(null, parentNode);
-        //var row = partsTable.getElementsByClassName("netInfoPostPartsTitle").item(0);
-
-        NetInfoBody.headerDataTag.insertRows({headers: data.params}, row);
-    },
-
-    insertJSON: function(parentNode, file, context)
-    {
-        ///var text = Utils.getPostText(file, context);
-        var text = file.responseText;
-        ///var data = parseJSONString(text, "http://" + file.request.originalURI.host);
-        var data = parseJSONString(text);
-        if (!data)
-            return;
-
-        ///var jsonTable = this.jsonTable.append(null, parentNode);
-        var jsonTable = this.jsonTable.append({}, parentNode);
-        ///var jsonBody = jsonTable.getElementsByClassName("netInfoPostJSONBody").item(0);
-        var jsonBody = $$(".netInfoPostJSONBody", jsonTable)[0];
-
-        if (!this.toggles)
-            this.toggles = {};
-
-        Firebug.DOMPanel.DirTable.tag.replace(
-            {object: data, toggles: this.toggles}, jsonBody);
-    },
-
-    insertXML: function(parentNode, file, context)
-    {
-        var text = Utils.getPostText(file, context);
-
-        var jsonTable = this.xmlTable.append(null, parentNode);
-        ///var jsonBody = jsonTable.getElementsByClassName("netInfoPostXMLBody").item(0);
-        var jsonBody = $$(".netInfoPostXMLBody", jsonTable)[0];
-
-        Firebug.XMLViewerModel.insertXML(jsonBody, text);
-    },
-
-    insertSource: function(parentNode, text)
-    {
-        var sourceTable = this.sourceTable.append({object:{}}, parentNode);
-        var row = $$(".netInfoPostSourceTitle", sourceTable)[0];
-        //var sourceTable = this.sourceTable.append(null, parentNode);
-        //var row = sourceTable.getElementsByClassName("netInfoPostSourceTitle").item(0);
-
-        var param = {value: [text]};
-        this.sourceBodyTag.insertRows({param: param}, row);
-    },
-
-    parseMultiPartText: function(file, context)
-    {
-        var text = Utils.getPostText(file, context);
-        if (text == undefined)
-            return null;
-
-        FBTrace.sysout("net.parseMultiPartText; boundary: ", text);
-
-        var boundary = text.match(/\s*boundary=\s*(.*)/)[1];
-
-        var divider = "\r\n\r\n";
-        var bodyStart = text.indexOf(divider);
-        var body = text.substr(bodyStart + divider.length);
-
-        var postData = {};
-        postData.mimeType = "multipart/form-data";
-        postData.params = [];
-
-        var parts = body.split("--" + boundary);
-        for (var i=0; i<parts.length; i++)
-        {
-            var part = parts[i].split(divider);
-            if (part.length != 2)
-                continue;
-
-            var m = part[0].match(/\s*name=\"(.*)\"(;|$)/);
-            postData.params.push({
-                name: (m && m.length > 1) ? m[1] : "",
-                value: trim(part[1])
-            });
-        }
-
-        return postData;
-    }
-});
-
-var NetInfoPostData = Firebug.NetMonitor.NetInfoPostData;
-
-// ************************************************************************************************
-
-
-// TODO: xxxpedro net i18n
-var $STRP = function(a){return a;};
-
-Firebug.NetMonitor.NetLimit = domplate(Firebug.Rep,
-{
-    collapsed: true,
-
-    tableTag:
-        DIV(
-            TABLE({width: "100%", cellpadding: 0, cellspacing: 0},
-                TBODY()
-            )
-        ),
-
-    limitTag:
-        TR({"class": "netRow netLimitRow", $collapsed: "$isCollapsed"},
-            TD({"class": "netCol netLimitCol", colspan: 6},
-                TABLE({cellpadding: 0, cellspacing: 0},
-                    TBODY(
-                        TR(
-                            TD(
-                                SPAN({"class": "netLimitLabel"},
-                                    $STRP("plural.Limit_Exceeded", [0])
-                                )
-                            ),
-                            TD({style: "width:100%"}),
-                            TD(
-                                BUTTON({"class": "netLimitButton", title: "$limitPrefsTitle",
-                                    onclick: "$onPreferences"},
-                                  $STR("LimitPrefs")
-                                )
-                            ),
-                            TD("&nbsp;")
-                        )
-                    )
-                )
-            )
-        ),
-
-    isCollapsed: function()
-    {
-        return this.collapsed;
-    },
-
-    onPreferences: function(event)
-    {
-        openNewTab("about:config");
-    },
-
-    updateCounter: function(row)
-    {
-        removeClass(row, "collapsed");
-
-        // Update info within the limit row.
-        var limitLabel = row.getElementsByClassName("netLimitLabel").item(0);
-        limitLabel.firstChild.nodeValue = $STRP("plural.Limit_Exceeded", [row.limitInfo.totalCount]);
-    },
-
-    createTable: function(parent, limitInfo)
-    {
-        var table = this.tableTag.replace({}, parent);
-        var row = this.createRow(table.firstChild.firstChild, limitInfo);
-        return [table, row];
-    },
-
-    createRow: function(parent, limitInfo)
-    {
-        var row = this.limitTag.insertRows(limitInfo, parent, this)[0];
-        row.limitInfo = limitInfo;
-        return row;
-    },
-
-    // nsIPrefObserver
-    observe: function(subject, topic, data)
-    {
-        // We're observing preferences only.
-        if (topic != "nsPref:changed")
-          return;
-
-        if (data.indexOf("net.logLimit") != -1)
-            this.updateMaxLimit();
-    },
-
-    updateMaxLimit: function()
-    {
-        var value = Firebug.getPref(Firebug.prefDomain, "net.logLimit");
-        maxQueueRequests = value ? value : maxQueueRequests;
-    }
-});
-
-var NetLimit = Firebug.NetMonitor.NetLimit;
-
-// ************************************************************************************************
-
-Firebug.NetMonitor.ResponseSizeLimit = domplate(Firebug.Rep,
-{
-    tag:
-        DIV({"class": "netInfoResponseSizeLimit"},
-            SPAN("$object.beforeLink"),
-            A({"class": "objectLink", onclick: "$onClickLink"},
-                "$object.linkText"
-            ),
-            SPAN("$object.afterLink")
-        ),
-
-    reLink: /^(.*)<a>(.*)<\/a>(.*$)/,
-    append: function(obj, parent)
-    {
-        var m = obj.text.match(this.reLink);
-        return this.tag.append({onClickLink: obj.onClickLink,
-            object: {
-            beforeLink: m[1],
-            linkText: m[2],
-            afterLink: m[3]
-        }}, parent, this);
-    }
-});
-
-// ************************************************************************************************
-// ************************************************************************************************
-
-Firebug.NetMonitor.Utils =
-{
-    findHeader: function(headers, name)
-    {
-        if (!headers)
-            return null;
-
-        name = name.toLowerCase();
-        for (var i = 0; i < headers.length; ++i)
-        {
-            var headerName = headers[i].name.toLowerCase();
-            if (headerName == name)
-                return headers[i].value;
-        }
-    },
-
-    formatPostText: function(text)
-    {
-        if (text instanceof XMLDocument)
-            return getElementXML(text.documentElement);
-        else
-            return text;
-    },
-
-    getPostText: function(file, context, noLimit)
-    {
-        if (!file.postText)
-        {
-            file.postText = readPostTextFromRequest(file.request, context);
-
-            if (!file.postText && context)
-                file.postText = readPostTextFromPage(file.href, context);
-        }
-
-        if (!file.postText)
-            return file.postText;
-
-        var limit = Firebug.netDisplayedPostBodyLimit;
-        if (file.postText.length > limit && !noLimit)
-        {
-            return cropString(file.postText, limit,
-                "\n\n... " + $STR("net.postDataSizeLimitMessage") + " ...\n\n");
-        }
-
-        return file.postText;
-    },
-
-    getResponseText: function(file, context)
-    {
-        // The response can be also empty string so, check agains "undefined".
-        return (typeof(file.responseText) != "undefined")? file.responseText :
-            context.sourceCache.loadText(file.href, file.method, file);
-    },
-
-    isURLEncodedRequest: function(file, context)
-    {
-        var text = Utils.getPostText(file, context);
-        if (text && text.toLowerCase().indexOf("content-type: application/x-www-form-urlencoded") == 0)
-            return true;
-
-        // The header value doesn't have to be always exactly "application/x-www-form-urlencoded",
-        // there can be even charset specified. So, use indexOf rather than just "==".
-        var headerValue = Utils.findHeader(file.requestHeaders, "content-type");
-        if (headerValue && headerValue.indexOf("application/x-www-form-urlencoded") == 0)
-            return true;
-
-        return false;
-    },
-
-    isMultiPartRequest: function(file, context)
-    {
-        var text = Utils.getPostText(file, context);
-        if (text && text.toLowerCase().indexOf("content-type: multipart/form-data") == 0)
-            return true;
-        return false;
-    },
-
-    getMimeType: function(mimeType, uri)
-    {
-        if (!mimeType || !(mimeCategoryMap.hasOwnProperty(mimeType)))
-        {
-            var ext = getFileExtension(uri);
-            if (!ext)
-                return mimeType;
-            else
-            {
-                var extMimeType = mimeExtensionMap[ext.toLowerCase()];
-                return extMimeType ? extMimeType : mimeType;
-            }
-        }
-        else
-            return mimeType;
-    },
-
-    getDateFromSeconds: function(s)
-    {
-        var d = new Date();
-        d.setTime(s*1000);
-        return d;
-    },
-
-    getHttpHeaders: function(request, file)
-    {
-        try
-        {
-            var http = QI(request, Ci.nsIHttpChannel);
-            file.status = request.responseStatus;
-
-            // xxxHonza: is there any problem to do this in requestedFile method?
-            file.method = http.requestMethod;
-            file.urlParams = parseURLParams(file.href);
-            file.mimeType = Utils.getMimeType(request.contentType, request.name);
-
-            if (!file.responseHeaders && Firebug.collectHttpHeaders)
-            {
-                var requestHeaders = [], responseHeaders = [];
-
-                http.visitRequestHeaders({
-                    visitHeader: function(name, value)
-                    {
-                        requestHeaders.push({name: name, value: value});
-                    }
-                });
-                http.visitResponseHeaders({
-                    visitHeader: function(name, value)
-                    {
-                        responseHeaders.push({name: name, value: value});
-                    }
-                });
-
-                file.requestHeaders = requestHeaders;
-                file.responseHeaders = responseHeaders;
-            }
-        }
-        catch (exc)
-        {
-            // An exception can be throwed e.g. when the request is aborted and
-            // request.responseStatus is accessed.
-            if (FBTrace.DBG_ERRORS)
-                FBTrace.sysout("net.getHttpHeaders FAILS " + file.href, exc);
-        }
-    },
-
-    isXHR: function(request)
-    {
-        try
-        {
-            var callbacks = request.notificationCallbacks;
-            var xhrRequest = callbacks ? callbacks.getInterface(Ci.nsIXMLHttpRequest) : null;
-            if (FBTrace.DBG_NET)
-                FBTrace.sysout("net.isXHR; " + (xhrRequest != null) + ", " + safeGetName(request));
-
-            return (xhrRequest != null);
-        }
-        catch (exc)
-        {
-        }
-
-       return false;
-    },
-
-    getFileCategory: function(file)
-    {
-        if (file.category)
-        {
-            if (FBTrace.DBG_NET)
-                FBTrace.sysout("net.getFileCategory; current: " + file.category + " for: " + file.href, file);
-            return file.category;
-        }
-
-        if (file.isXHR)
-        {
-            if (FBTrace.DBG_NET)
-                FBTrace.sysout("net.getFileCategory; XHR for: " + file.href, file);
-            return file.category = "xhr";
-        }
-
-        if (!file.mimeType)
-        {
-            var ext = getFileExtension(file.href);
-            if (ext)
-                file.mimeType = mimeExtensionMap[ext.toLowerCase()];
-        }
-
-        /*if (FBTrace.DBG_NET)
-            FBTrace.sysout("net.getFileCategory; " + mimeCategoryMap[file.mimeType] +
-                ", mimeType: " + file.mimeType + " for: " + file.href, file);*/
-
-        if (!file.mimeType)
-            return "";
-
-        // Solve cases when charset is also specified, eg "text/html; charset=UTF-8".
-        var mimeType = file.mimeType;
-        if (mimeType)
-            mimeType = mimeType.split(";")[0];
-
-        return (file.category = mimeCategoryMap[mimeType]);
-    }
-};
-
-var Utils = Firebug.NetMonitor.Utils;
-
-// ************************************************************************************************
-
-//Firebug.registerRep(Firebug.NetMonitor.NetRequestTable);
-//Firebug.registerActivableModule(Firebug.NetMonitor);
-//Firebug.registerPanel(NetPanel);
-
-Firebug.registerModule(Firebug.NetMonitor);
-//Firebug.registerRep(Firebug.NetMonitor.BreakpointRep);
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-
-// ************************************************************************************************
-// Constants
-
-//const Cc = Components.classes;
-//const Ci = Components.interfaces;
-
-// List of contexts with XHR spy attached.
-var contexts = [];
-
-// ************************************************************************************************
-// Spy Module
-
-/**
- * @module Represents a XHR Spy module. The main purpose of the XHR Spy feature is to monitor
- * XHR activity of the current page and create appropriate log into the Console panel.
- * This feature can be controlled by an option <i>Show XMLHttpRequests</i> (from within the
- * console panel).
- *
- * The module is responsible for attaching/detaching a HTTP Observers when Firebug is
- * activated/deactivated for a site.
- */
-Firebug.Spy = extend(Firebug.Module,
-/** @lends Firebug.Spy */
-{
-    dispatchName: "spy",
-
-    initialize: function()
-    {
-        if (Firebug.TraceModule)
-            Firebug.TraceModule.addListener(this.TraceListener);
-
-        Firebug.Module.initialize.apply(this, arguments);
-    },
-
-    shutdown: function()
-    {
-        Firebug.Module.shutdown.apply(this, arguments);
-
-        if (Firebug.TraceModule)
-            Firebug.TraceModule.removeListener(this.TraceListener);
-    },
-
-    initContext: function(context)
-    {
-        context.spies = [];
-
-        if (Firebug.showXMLHttpRequests && Firebug.Console.isAlwaysEnabled())
-            this.attachObserver(context, context.window);
-
-        if (FBTrace.DBG_SPY)
-            FBTrace.sysout("spy.initContext " + contexts.length + " ", context.getName());
-    },
-
-    destroyContext: function(context)
-    {
-        // For any spies that are in progress, remove our listeners so that they don't leak
-        this.detachObserver(context, null);
-
-        if (FBTrace.DBG_SPY && context.spies.length)
-            FBTrace.sysout("spy.destroyContext; ERROR There are leaking Spies ("
-                + context.spies.length + ") " + context.getName());
-
-        delete context.spies;
-
-        if (FBTrace.DBG_SPY)
-            FBTrace.sysout("spy.destroyContext " + contexts.length + " ", context.getName());
-    },
-
-    watchWindow: function(context, win)
-    {
-        if (Firebug.showXMLHttpRequests && Firebug.Console.isAlwaysEnabled())
-            this.attachObserver(context, win);
-    },
-
-    unwatchWindow: function(context, win)
-    {
-        try
-        {
-            // This make sure that the existing context is properly removed from "contexts" array.
-            this.detachObserver(context, win);
-        }
-        catch (ex)
-        {
-            // Get exceptions here sometimes, so let's just ignore them
-            // since the window is going away anyhow
-            ERROR(ex);
-        }
-    },
-
-    updateOption: function(name, value)
-    {
-        // XXXjjb Honza, if Console.isEnabled(context) false, then this can't be called,
-        // but somehow seems not correct
-        if (name == "showXMLHttpRequests")
-        {
-            var tach = value ? this.attachObserver : this.detachObserver;
-            for (var i = 0; i < TabWatcher.contexts.length; ++i)
-            {
-                var context = TabWatcher.contexts[i];
-                iterateWindows(context.window, function(win)
-                {
-                    tach.apply(this, [context, win]);
-                });
-            }
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Attaching Spy to XHR requests.
-
-    /**
-     * Returns false if Spy should not be attached to XHRs executed by the specified window.
-     */
-    skipSpy: function(win)
-    {
-        if (!win)
-            return true;
-
-        // Don't attach spy to chrome.
-        var uri = safeGetWindowLocation(win);
-        if (uri && (uri.indexOf("about:") == 0 || uri.indexOf("chrome:") == 0))
-            return true;
-    },
-
-    attachObserver: function(context, win)
-    {
-        if (Firebug.Spy.skipSpy(win))
-            return;
-
-        for (var i=0; i<contexts.length; ++i)
-        {
-            if ((contexts[i].context == context) && (contexts[i].win == win))
-                return;
-        }
-
-        // Register HTTP observers only once.
-        if (contexts.length == 0)
-        {
-            httpObserver.addObserver(SpyHttpObserver, "firebug-http-event", false);
-            SpyHttpActivityObserver.registerObserver();
-        }
-
-        contexts.push({context: context, win: win});
-
-        if (FBTrace.DBG_SPY)
-            FBTrace.sysout("spy.attachObserver (HTTP) " + contexts.length + " ", context.getName());
-    },
-
-    detachObserver: function(context, win)
-    {
-        for (var i=0; i<contexts.length; ++i)
-        {
-            if (contexts[i].context == context)
-            {
-                if (win && (contexts[i].win != win))
-                    continue;
-
-                contexts.splice(i, 1);
-
-                // If no context is using spy, remvove the (only one) HTTP observer.
-                if (contexts.length == 0)
-                {
-                    httpObserver.removeObserver(SpyHttpObserver, "firebug-http-event");
-                    SpyHttpActivityObserver.unregisterObserver();
-                }
-
-                if (FBTrace.DBG_SPY)
-                    FBTrace.sysout("spy.detachObserver (HTTP) " + contexts.length + " ",
-                        context.getName());
-                return;
-            }
-        }
-    },
-
-    /**
-     * Return XHR object that is associated with specified request <i>nsIHttpChannel</i>.
-     * Returns null if the request doesn't represent XHR.
-     */
-    getXHR: function(request)
-    {
-        // Does also query-interface for nsIHttpChannel.
-        if (!(request instanceof Ci.nsIHttpChannel))
-            return null;
-
-        try
-        {
-            var callbacks = request.notificationCallbacks;
-            return (callbacks ? callbacks.getInterface(Ci.nsIXMLHttpRequest) : null);
-        }
-        catch (exc)
-        {
-            if (exc.name == "NS_NOINTERFACE")
-            {
-                if (FBTrace.DBG_SPY)
-                    FBTrace.sysout("spy.getXHR; Request is not nsIXMLHttpRequest: " +
-                        safeGetRequestName(request));
-            }
-        }
-
-       return null;
-    }
-});
-
-
-
-
-
-// ************************************************************************************************
-
-/*
-function getSpyForXHR(request, xhrRequest, context, noCreate)
-{
-    var spy = null;
-
-    // Iterate all existing spy objects in this context and look for one that is
-    // already created for this request.
-    var length = context.spies.length;
-    for (var i=0; i<length; i++)
-    {
-        spy = context.spies[i];
-        if (spy.request == request)
-            return spy;
-    }
-
-    if (noCreate)
-        return null;
-
-    spy = new Firebug.Spy.XMLHttpRequestSpy(request, xhrRequest, context);
-    context.spies.push(spy);
-
-    var name = request.URI.asciiSpec;
-    var origName = request.originalURI.asciiSpec;
-
-    // Attach spy only to the original request. Notice that there can be more network requests
-    // made by the same XHR if redirects are involved.
-    if (name == origName)
-        spy.attach();
-
-    if (FBTrace.DBG_SPY)
-        FBTrace.sysout("spy.getSpyForXHR; New spy object created (" +
-            (name == origName ? "new XHR" : "redirected XHR") + ") for: " + name, spy);
-
-    return spy;
-}
-/**/
-
-// ************************************************************************************************
-
-/**
- * @class This class represents a Spy object that is attached to XHR. This object
- * registers various listeners into the XHR in order to monitor various events fired
- * during the request process (onLoad, onAbort, etc.)
- */
-/*
-Firebug.Spy.XMLHttpRequestSpy = function(request, xhrRequest, context)
-{
-    this.request = request;
-    this.xhrRequest = xhrRequest;
-    this.context = context;
-    this.responseText = "";
-
-    // For compatibility with the Net templates.
-    this.isXHR = true;
-
-    // Support for activity-observer
-    this.transactionStarted = false;
-    this.transactionClosed = false;
-};
-/**/
-
-//Firebug.Spy.XMLHttpRequestSpy.prototype =
-/** @lends Firebug.Spy.XMLHttpRequestSpy */
-/*
-{
-    attach: function()
-    {
-        var spy = this;
-        this.onReadyStateChange = function(event) { onHTTPSpyReadyStateChange(spy, event); };
-        this.onLoad = function() { onHTTPSpyLoad(spy); };
-        this.onError = function() { onHTTPSpyError(spy); };
-        this.onAbort = function() { onHTTPSpyAbort(spy); };
-
-        // xxxHonza: #502959 is still failing on Fx 3.5
-        // Use activity distributor to identify 3.6
-        if (SpyHttpActivityObserver.getActivityDistributor())
-        {
-            this.onreadystatechange = this.xhrRequest.onreadystatechange;
-            this.xhrRequest.onreadystatechange = this.onReadyStateChange;
-        }
-
-        this.xhrRequest.addEventListener("load", this.onLoad, false);
-        this.xhrRequest.addEventListener("error", this.onError, false);
-        this.xhrRequest.addEventListener("abort", this.onAbort, false);
-
-        // xxxHonza: should be removed from FB 3.6
-        if (!SpyHttpActivityObserver.getActivityDistributor())
-            this.context.sourceCache.addListener(this);
-    },
-
-    detach: function()
-    {
-        // Bubble out if already detached.
-        if (!this.onLoad)
-            return;
-
-        // If the activity distributor is available, let's detach it when the XHR
-        // transaction is closed. Since, in case of multipart XHRs the onLoad method
-        // (readyState == 4) can be called mutliple times.
-        // Keep in mind:
-        // 1) It can happen that that the TRANSACTION_CLOSE event comes before
-        // the onLoad (if the XHR is made as part of the page load) so, detach if
-        // it's already closed.
-        // 2) In case of immediate cache responses, the transaction doesn't have to
-        // be started at all (or the activity observer is no available in Firefox 3.5).
-        // So, also detach in this case.
-        if (this.transactionStarted && !this.transactionClosed)
-            return;
-
-        if (FBTrace.DBG_SPY)
-            FBTrace.sysout("spy.detach; " + this.href);
-
-        // Remove itself from the list of active spies.
-        remove(this.context.spies, this);
-
-        if (this.onreadystatechange)
-            this.xhrRequest.onreadystatechange = this.onreadystatechange;
-
-        try { this.xhrRequest.removeEventListener("load", this.onLoad, false); } catch (e) {}
-        try { this.xhrRequest.removeEventListener("error", this.onError, false); } catch (e) {}
-        try { this.xhrRequest.removeEventListener("abort", this.onAbort, false); } catch (e) {}
-
-        this.onreadystatechange = null;
-        this.onLoad = null;
-        this.onError = null;
-        this.onAbort = null;
-
-        // xxxHonza: shouuld be removed from FB 1.6
-        if (!SpyHttpActivityObserver.getActivityDistributor())
-            this.context.sourceCache.removeListener(this);
-    },
-
-    getURL: function()
-    {
-        return this.xhrRequest.channel ? this.xhrRequest.channel.name : this.href;
-    },
-
-    // Cache listener
-    onStopRequest: function(context, request, responseText)
-    {
-        if (!responseText)
-            return;
-
-        if (request == this.request)
-            this.responseText = responseText;
-    },
-};
-/**/
-// ************************************************************************************************
-/*
-function onHTTPSpyReadyStateChange(spy, event)
-{
-    if (FBTrace.DBG_SPY)
-        FBTrace.sysout("spy.onHTTPSpyReadyStateChange " + spy.xhrRequest.readyState +
-            " (multipart: " + spy.xhrRequest.multipart + ")");
-
-    // Remember just in case spy is detached (readyState == 4).
-    var originalHandler = spy.onreadystatechange;
-
-    // Force response text to be updated in the UI (in case the console entry
-    // has been already expanded and the response tab selected).
-    if (spy.logRow && spy.xhrRequest.readyState >= 3)
-    {
-        var netInfoBox = getChildByClass(spy.logRow, "spyHead", "netInfoBody");
-        if (netInfoBox)
-        {
-            netInfoBox.htmlPresented = false;
-            netInfoBox.responsePresented = false;
-        }
-    }
-
-    // If the request is loading update the end time.
-    if (spy.xhrRequest.readyState == 3)
-    {
-        spy.responseTime = spy.endTime - spy.sendTime;
-        updateTime(spy);
-    }
-
-    // Request loaded. Get all the info from the request now, just in case the
-    // XHR would be aborted in the original onReadyStateChange handler.
-    if (spy.xhrRequest.readyState == 4)
-    {
-        // Cumulate response so, multipart response content is properly displayed.
-        if (SpyHttpActivityObserver.getActivityDistributor())
-            spy.responseText += spy.xhrRequest.responseText;
-        else
-        {
-            // xxxHonza: remove from FB 1.6
-            if (!spy.responseText)
-                spy.responseText = spy.xhrRequest.responseText;
-        }
-
-        // The XHR is loaded now (used also by the activity observer).
-        spy.loaded = true;
-
-        // Update UI.
-        updateHttpSpyInfo(spy);
-
-        // Notify Net pane about a request beeing loaded.
-        // xxxHonza: I don't think this is necessary.
-        var netProgress = spy.context.netProgress;
-        if (netProgress)
-            netProgress.post(netProgress.stopFile, [spy.request, spy.endTime, spy.postText, spy.responseText]);
-
-        // Notify registered listeners about finish of the XHR.
-        dispatch(Firebug.Spy.fbListeners, "onLoad", [spy.context, spy]);
-    }
-
-    // Pass the event to the original page handler.
-    callPageHandler(spy, event, originalHandler);
-}
-
-function onHTTPSpyLoad(spy)
-{
-    if (FBTrace.DBG_SPY)
-        FBTrace.sysout("spy.onHTTPSpyLoad: " + spy.href, spy);
-
-    // Detach must be done in onLoad (not in onreadystatechange) otherwise
-    // onAbort would not be handled.
-    spy.detach();
-
-    // xxxHonza: Still needed for Fx 3.5 (#502959)
-    if (!SpyHttpActivityObserver.getActivityDistributor())
-        onHTTPSpyReadyStateChange(spy, null);
-}
-
-function onHTTPSpyError(spy)
-{
-    if (FBTrace.DBG_SPY)
-        FBTrace.sysout("spy.onHTTPSpyError; " + spy.href, spy);
-
-    spy.detach();
-    spy.loaded = true;
-
-    if (spy.logRow)
-    {
-        removeClass(spy.logRow, "loading");
-        setClass(spy.logRow, "error");
-    }
-}
-
-function onHTTPSpyAbort(spy)
-{
-    if (FBTrace.DBG_SPY)
-        FBTrace.sysout("spy.onHTTPSpyAbort: " + spy.href, spy);
-
-    spy.detach();
-    spy.loaded = true;
-
-    if (spy.logRow)
-    {
-        removeClass(spy.logRow, "loading");
-        setClass(spy.logRow, "error");
-    }
-
-    spy.statusText = "Aborted";
-    updateLogRow(spy);
-
-    // Notify Net pane about a request beeing aborted.
-    // xxxHonza: the net panel shoud find out this itself.
-    var netProgress = spy.context.netProgress;
-    if (netProgress)
-        netProgress.post(netProgress.abortFile, [spy.request, spy.endTime, spy.postText, spy.responseText]);
-}
-/**/
-
-// ************************************************************************************************
-
-/**
- * @domplate Represents a template for XHRs logged in the Console panel. The body of the
- * log (displayed when expanded) is rendered using {@link Firebug.NetMonitor.NetInfoBody}.
- */
-
-Firebug.Spy.XHR = domplate(Firebug.Rep,
-/** @lends Firebug.Spy.XHR */
-
-{
-    tag:
-        DIV({"class": "spyHead", _repObject: "$object"},
-            TABLE({"class": "spyHeadTable focusRow outerFocusRow", cellpadding: 0, cellspacing: 0,
-                "role": "listitem", "aria-expanded": "false"},
-                TBODY({"role": "presentation"},
-                    TR({"class": "spyRow"},
-                        TD({"class": "spyTitleCol spyCol", onclick: "$onToggleBody"},
-                            DIV({"class": "spyTitle"},
-                                "$object|getCaption"
-                            ),
-                            DIV({"class": "spyFullTitle spyTitle"},
-                                "$object|getFullUri"
-                            )
-                        ),
-                        TD({"class": "spyCol"},
-                            DIV({"class": "spyStatus"}, "$object|getStatus")
-                        ),
-                        TD({"class": "spyCol"},
-                            SPAN({"class": "spyIcon"})
-                        ),
-                        TD({"class": "spyCol"},
-                            SPAN({"class": "spyTime"})
-                        ),
-                        TD({"class": "spyCol"},
-                            TAG(FirebugReps.SourceLink.tag, {object: "$object.sourceLink"})
-                        )
-                    )
-                )
-            )
-        ),
-
-    getCaption: function(spy)
-    {
-        return spy.method.toUpperCase() + " " + cropString(spy.getURL(), 100);
-    },
-
-    getFullUri: function(spy)
-    {
-        return spy.method.toUpperCase() + " " + spy.getURL();
-    },
-
-    getStatus: function(spy)
-    {
-        var text = "";
-        if (spy.statusCode)
-            text += spy.statusCode + " ";
-
-        if (spy.statusText)
-            return text += spy.statusText;
-
-        return text;
-    },
-
-    onToggleBody: function(event)
-    {
-        var target = event.currentTarget || event.srcElement;
-        var logRow = getAncestorByClass(target, "logRow-spy");
-
-        if (isLeftClick(event))
-        {
-            toggleClass(logRow, "opened");
-
-            var spy = getChildByClass(logRow, "spyHead").repObject;
-            var spyHeadTable = getAncestorByClass(target, "spyHeadTable");
-
-            if (hasClass(logRow, "opened"))
-            {
-                updateHttpSpyInfo(spy, logRow);
-                if (spyHeadTable)
-                    spyHeadTable.setAttribute('aria-expanded', 'true');
-            }
-            else
-            {
-                //var netInfoBox = getChildByClass(spy.logRow, "spyHead", "netInfoBody");
-                //dispatch(Firebug.NetMonitor.NetInfoBody.fbListeners, "destroyTabBody", [netInfoBox, spy]);
-                //if (spyHeadTable)
-                //    spyHeadTable.setAttribute('aria-expanded', 'false');
-            }
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    copyURL: function(spy)
-    {
-        copyToClipboard(spy.getURL());
-    },
-
-    copyParams: function(spy)
-    {
-        var text = spy.postText;
-        if (!text)
-            return;
-
-        var url = reEncodeURL(spy, text, true);
-        copyToClipboard(url);
-    },
-
-    copyResponse: function(spy)
-    {
-        copyToClipboard(spy.responseText);
-    },
-
-    openInTab: function(spy)
-    {
-        openNewTab(spy.getURL(), spy.postText);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    supportsObject: function(object)
-    {
-        // TODO: xxxpedro spy xhr
-        return false;
-
-        return object instanceof Firebug.Spy.XMLHttpRequestSpy;
-    },
-
-    browseObject: function(spy, context)
-    {
-        var url = spy.getURL();
-        openNewTab(url);
-        return true;
-    },
-
-    getRealObject: function(spy, context)
-    {
-        return spy.xhrRequest;
-    },
-
-    getContextMenuItems: function(spy)
-    {
-        var items = [
-            {label: "CopyLocation", command: bindFixed(this.copyURL, this, spy) }
-        ];
-
-        if (spy.postText)
-        {
-            items.push(
-                {label: "CopyLocationParameters", command: bindFixed(this.copyParams, this, spy) }
-            );
-        }
-
-        items.push(
-            {label: "CopyResponse", command: bindFixed(this.copyResponse, this, spy) },
-            "-",
-            {label: "OpenInTab", command: bindFixed(this.openInTab, this, spy) }
-        );
-
-        return items;
-    }
-});
-
-// ************************************************************************************************
-
-function updateTime(spy)
-{
-    var timeBox = spy.logRow.getElementsByClassName("spyTime").item(0);
-    if (spy.responseTime)
-        timeBox.textContent = " " + formatTime(spy.responseTime);
-}
-
-function updateLogRow(spy)
-{
-    updateTime(spy);
-
-    var statusBox = spy.logRow.getElementsByClassName("spyStatus").item(0);
-    statusBox.textContent = Firebug.Spy.XHR.getStatus(spy);
-
-    removeClass(spy.logRow, "loading");
-    setClass(spy.logRow, "loaded");
-
-    try
-    {
-        var errorRange = Math.floor(spy.xhrRequest.status/100);
-        if (errorRange == 4 || errorRange == 5)
-            setClass(spy.logRow, "error");
-    }
-    catch (exc)
-    {
-    }
-}
-
-var updateHttpSpyInfo = function updateHttpSpyInfo(spy, logRow)
-{
-    if (!spy.logRow && logRow)
-        spy.logRow = logRow;
-
-    if (!spy.logRow || !hasClass(spy.logRow, "opened"))
-        return;
-
-    if (!spy.params)
-        //spy.params = parseURLParams(spy.href+"");
-        spy.params = parseURLParams(spy.href+"");
-
-    if (!spy.requestHeaders)
-        spy.requestHeaders = getRequestHeaders(spy);
-
-    if (!spy.responseHeaders && spy.loaded)
-        spy.responseHeaders = getResponseHeaders(spy);
-
-    var template = Firebug.NetMonitor.NetInfoBody;
-    var netInfoBox = getChildByClass(spy.logRow, "spyHead", "netInfoBody");
-    if (!netInfoBox)
-    {
-        var head = getChildByClass(spy.logRow, "spyHead");
-        netInfoBox = template.tag.append({"file": spy}, head);
-        dispatch(template.fbListeners, "initTabBody", [netInfoBox, spy]);
-        template.selectTabByName(netInfoBox, "Response");
-    }
-    else
-    {
-        template.updateInfo(netInfoBox, spy, spy.context);
-    }
-};
-
-
-
-// ************************************************************************************************
-
-function getRequestHeaders(spy)
-{
-    var headers = [];
-
-    var channel = spy.xhrRequest.channel;
-    if (channel instanceof Ci.nsIHttpChannel)
-    {
-        channel.visitRequestHeaders({
-            visitHeader: function(name, value)
-            {
-                headers.push({name: name, value: value});
-            }
-        });
-    }
-
-    return headers;
-}
-
-function getResponseHeaders(spy)
-{
-    var headers = [];
-
-    try
-    {
-        var channel = spy.xhrRequest.channel;
-        if (channel instanceof Ci.nsIHttpChannel)
-        {
-            channel.visitResponseHeaders({
-                visitHeader: function(name, value)
-                {
-                    headers.push({name: name, value: value});
-                }
-            });
-        }
-    }
-    catch (exc)
-    {
-        if (FBTrace.DBG_SPY || FBTrace.DBG_ERRORS)
-            FBTrace.sysout("spy.getResponseHeaders; EXCEPTION " +
-                safeGetRequestName(spy.request), exc);
-    }
-
-    return headers;
-}
-
-// ************************************************************************************************
-// Registration
-
-Firebug.registerModule(Firebug.Spy);
-//Firebug.registerRep(Firebug.Spy.XHR);
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-
-// ************************************************************************************************
-
-// List of JSON content types.
-var contentTypes =
-{
-    // TODO: create issue: jsonViewer will not try to evaluate the contents of the requested file
-    // if the content-type is set to "text/plain"
-    //"text/plain": 1,
-    "text/javascript": 1,
-    "text/x-javascript": 1,
-    "text/json": 1,
-    "text/x-json": 1,
-    "application/json": 1,
-    "application/x-json": 1,
-    "application/javascript": 1,
-    "application/x-javascript": 1,
-    "application/json-rpc": 1
-};
-
-// ************************************************************************************************
-// Model implementation
-
-Firebug.JSONViewerModel = extend(Firebug.Module,
-{
-    dispatchName: "jsonViewer",
-    initialize: function()
-    {
-        Firebug.NetMonitor.NetInfoBody.addListener(this);
-
-        // Used by Firebug.DOMPanel.DirTable domplate.
-        this.toggles = {};
-    },
-
-    shutdown: function()
-    {
-        Firebug.NetMonitor.NetInfoBody.removeListener(this);
-    },
-
-    initTabBody: function(infoBox, file)
-    {
-        if (FBTrace.DBG_JSONVIEWER)
-            FBTrace.sysout("jsonviewer.initTabBody", infoBox);
-
-        // Let listeners to parse the JSON.
-        dispatch(this.fbListeners, "onParseJSON", [file]);
-
-        // The JSON is still no there, try to parse most common cases.
-        if (!file.jsonObject)
-        {
-            ///if (this.isJSON(safeGetContentType(file.request), file.responseText))
-            if (this.isJSON(file.mimeType, file.responseText))
-                file.jsonObject = this.parseJSON(file);
-        }
-
-        // The jsonObject is created so, the JSON tab can be displayed.
-        if (file.jsonObject && hasProperties(file.jsonObject))
-        {
-            Firebug.NetMonitor.NetInfoBody.appendTab(infoBox, "JSON",
-                ///$STR("jsonviewer.tab.JSON"));
-                $STR("JSON"));
-
-            if (FBTrace.DBG_JSONVIEWER)
-                FBTrace.sysout("jsonviewer.initTabBody; JSON object available " +
-                    (typeof(file.jsonObject) != "undefined"), file.jsonObject);
-        }
-    },
-
-    isJSON: function(contentType, data)
-    {
-        // Workaround for JSON responses without proper content type
-        // Let's consider all responses starting with "{" as JSON. In the worst
-        // case there will be an exception when parsing. This means that no-JSON
-        // responses (and post data) (with "{") can be parsed unnecessarily,
-        // which represents a little overhead, but this happens only if the request
-        // is actually expanded by the user in the UI (Net & Console panels).
-
-        ///var responseText = data ? trimLeft(data) : null;
-        ///if (responseText && responseText.indexOf("{") == 0)
-        ///    return true;
-        var responseText = data ? trim(data) : null;
-        if (responseText && responseText.indexOf("{") == 0)
-            return true;
-
-        if (!contentType)
-            return false;
-
-        contentType = contentType.split(";")[0];
-        contentType = trim(contentType);
-        return contentTypes[contentType];
-    },
-
-    // Update listener for TabView
-    updateTabBody: function(infoBox, file, context)
-    {
-        var tab = infoBox.selectedTab;
-        ///var tabBody = infoBox.getElementsByClassName("netInfoJSONText").item(0);
-        var tabBody = $$(".netInfoJSONText", infoBox)[0];
-        if (!hasClass(tab, "netInfoJSONTab") || tabBody.updated)
-            return;
-
-        tabBody.updated = true;
-
-        if (file.jsonObject) {
-            Firebug.DOMPanel.DirTable.tag.replace(
-                 {object: file.jsonObject, toggles: this.toggles}, tabBody);
-        }
-    },
-
-    parseJSON: function(file)
-    {
-        var jsonString = new String(file.responseText);
-        ///return parseJSONString(jsonString, "http://" + file.request.originalURI.host);
-        return parseJSONString(jsonString);
-    }
-});
-
-// ************************************************************************************************
-// Registration
-
-Firebug.registerModule(Firebug.JSONViewerModel);
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-
-// ************************************************************************************************
-// Constants
-
-// List of XML related content types.
-var xmlContentTypes =
-[
-    "text/xml",
-    "application/xml",
-    "application/xhtml+xml",
-    "application/rss+xml",
-    "application/atom+xml",,
-    "application/vnd.mozilla.maybe.feed",
-    "application/rdf+xml",
-    "application/vnd.mozilla.xul+xml"
-];
-
-// ************************************************************************************************
-// Model implementation
-
-/**
- * @module Implements viewer for XML based network responses. In order to create a new
- * tab wihin network request detail, a listener is registered into
- * <code>Firebug.NetMonitor.NetInfoBody</code> object.
- */
-Firebug.XMLViewerModel = extend(Firebug.Module,
-{
-    dispatchName: "xmlViewer",
-
-    initialize: function()
-    {
-        ///Firebug.ActivableModule.initialize.apply(this, arguments);
-        Firebug.Module.initialize.apply(this, arguments);
-        Firebug.NetMonitor.NetInfoBody.addListener(this);
-    },
-
-    shutdown: function()
-    {
-        ///Firebug.ActivableModule.shutdown.apply(this, arguments);
-        Firebug.Module.shutdown.apply(this, arguments);
-        Firebug.NetMonitor.NetInfoBody.removeListener(this);
-    },
-
-    /**
-     * Check response's content-type and if it's a XML, create a new tab with XML preview.
-     */
-    initTabBody: function(infoBox, file)
-    {
-        if (FBTrace.DBG_XMLVIEWER)
-            FBTrace.sysout("xmlviewer.initTabBody", infoBox);
-
-        // If the response is XML let's display a pretty preview.
-        ///if (this.isXML(safeGetContentType(file.request)))
-        if (this.isXML(file.mimeType, file.responseText))
-        {
-            Firebug.NetMonitor.NetInfoBody.appendTab(infoBox, "XML",
-                ///$STR("xmlviewer.tab.XML"));
-                $STR("XML"));
-
-            if (FBTrace.DBG_XMLVIEWER)
-                FBTrace.sysout("xmlviewer.initTabBody; XML response available");
-        }
-    },
-
-    isXML: function(contentType)
-    {
-        if (!contentType)
-            return false;
-
-        // Look if the response is XML based.
-        for (var i=0; i<xmlContentTypes.length; i++)
-        {
-            if (contentType.indexOf(xmlContentTypes[i]) == 0)
-                return true;
-        }
-
-        return false;
-    },
-
-    /**
-     * Parse XML response and render pretty printed preview.
-     */
-    updateTabBody: function(infoBox, file, context)
-    {
-        var tab = infoBox.selectedTab;
-        ///var tabBody = infoBox.getElementsByClassName("netInfoXMLText").item(0);
-        var tabBody = $$(".netInfoXMLText", infoBox)[0];
-        if (!hasClass(tab, "netInfoXMLTab") || tabBody.updated)
-            return;
-
-        tabBody.updated = true;
-
-        this.insertXML(tabBody, Firebug.NetMonitor.Utils.getResponseText(file, context));
-    },
-
-    insertXML: function(parentNode, text)
-    {
-        var xmlText = text.replace(/^\s*<?.+?>\s*/, "");
-
-        var div = parentNode.ownerDocument.createElement("div");
-        div.innerHTML = xmlText;
-
-        var root = div.getElementsByTagName("*")[0];
-
-        /***
-        var parser = CCIN("@mozilla.org/xmlextras/domparser;1", "nsIDOMParser");
-        var doc = parser.parseFromString(text, "text/xml");
-        var root = doc.documentElement;
-
-        // Error handling
-        var nsURI = "http://www.mozilla.org/newlayout/xml/parsererror.xml";
-        if (root.namespaceURI == nsURI && root.nodeName == "parsererror")
-        {
-            this.ParseError.tag.replace({error: {
-                message: root.firstChild.nodeValue,
-                source: root.lastChild.textContent
-            }}, parentNode);
-            return;
-        }
-        /**/
-
-        if (FBTrace.DBG_XMLVIEWER)
-            FBTrace.sysout("xmlviewer.updateTabBody; XML response parsed", doc);
-
-        // Override getHidden in these templates. The parsed XML documen is
-        // hidden, but we want to display it using 'visible' styling.
-        /*
-        var templates = [
-            Firebug.HTMLPanel.CompleteElement,
-            Firebug.HTMLPanel.Element,
-            Firebug.HTMLPanel.TextElement,
-            Firebug.HTMLPanel.EmptyElement,
-            Firebug.HTMLPanel.XEmptyElement,
-        ];
-
-        var originals = [];
-        for (var i=0; i<templates.length; i++)
-        {
-            originals[i] = templates[i].getHidden;
-            templates[i].getHidden = function() {
-                return "";
-            }
-        }
-        /**/
-
-        // Generate XML preview.
-        ///Firebug.HTMLPanel.CompleteElement.tag.replace({object: doc.documentElement}, parentNode);
-
-        // TODO: xxxpedro html3
-        ///Firebug.HTMLPanel.CompleteElement.tag.replace({object: root}, parentNode);
-        var html = [];
-        Firebug.Reps.appendNode(root, html);
-        parentNode.innerHTML = html.join("");
-
-
-        /*
-        for (var i=0; i<originals.length; i++)
-            templates[i].getHidden = originals[i];/**/
-    }
-});
-
-// ************************************************************************************************
-// Domplate
-
-/**
- * @domplate Represents a template for displaying XML parser errors. Used by
- * <code>Firebug.XMLViewerModel</code>.
- */
-Firebug.XMLViewerModel.ParseError = domplate(Firebug.Rep,
-{
-    tag:
-        DIV({"class": "xmlInfoError"},
-            DIV({"class": "xmlInfoErrorMsg"}, "$error.message"),
-            PRE({"class": "xmlInfoErrorSource"}, "$error|getSource")
-        ),
-
-    getSource: function(error)
-    {
-        var parts = error.source.split("\n");
-        if (parts.length != 2)
-            return error.source;
-
-        var limit = 50;
-        var column = parts[1].length;
-        if (column >= limit) {
-            parts[0] = "..." + parts[0].substr(column - limit);
-            parts[1] = "..." + parts[1].substr(column - limit);
-        }
-
-        if (parts[0].length > 80)
-            parts[0] = parts[0].substr(0, 80) + "...";
-
-        return parts.join("\n");
-    }
-});
-
-// ************************************************************************************************
-// Registration
-
-Firebug.registerModule(Firebug.XMLViewerModel);
-
-}});
-
-
-/* See license.txt for terms of usage */
-
-// next-generation Console Panel (will override consoje.js)
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-// ************************************************************************************************
-// Constants
-
-/*
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const nsIPrefBranch2 = Ci.nsIPrefBranch2;
-const PrefService = Cc["@mozilla.org/preferences-service;1"];
-const prefs = PrefService.getService(nsIPrefBranch2);
-/**/
-/*
-
-// new offline message handler
-o = {x:1,y:2};
-
-r = Firebug.getRep(o);
-
-r.tag.tag.compile();
-
-outputs = [];
-html = r.tag.renderHTML({object:o}, outputs);
-
-
-// finish rendering the template (the DOM part)
-target = $("build");
-target.innerHTML = html;
-root = target.firstChild;
-
-domArgs = [root, r.tag.context, 0];
-domArgs.push.apply(domArgs, r.tag.domArgs);
-domArgs.push.apply(domArgs, outputs);
-r.tag.tag.renderDOM.apply(self ? self : r.tag.subject, domArgs);
-
-
- */
-var consoleQueue = [];
-var lastHighlightedObject;
-var FirebugContext = Env.browser;
-
-// ************************************************************************************************
-
-var maxQueueRequests = 500;
-
-// ************************************************************************************************
-
-Firebug.ConsoleBase =
-{
-    log: function(object, context, className, rep, noThrottle, sourceLink)
-    {
-        //dispatch(this.fbListeners,"log",[context, object, className, sourceLink]);
-        return this.logRow(appendObject, object, context, className, rep, sourceLink, noThrottle);
-    },
-
-    logFormatted: function(objects, context, className, noThrottle, sourceLink)
-    {
-        //dispatch(this.fbListeners,"logFormatted",[context, objects, className, sourceLink]);
-        return this.logRow(appendFormatted, objects, context, className, null, sourceLink, noThrottle);
-    },
-
-    openGroup: function(objects, context, className, rep, noThrottle, sourceLink, noPush)
-    {
-        return this.logRow(appendOpenGroup, objects, context, className, rep, sourceLink, noThrottle);
-    },
-
-    closeGroup: function(context, noThrottle)
-    {
-        return this.logRow(appendCloseGroup, null, context, null, null, null, noThrottle, true);
-    },
-
-    logRow: function(appender, objects, context, className, rep, sourceLink, noThrottle, noRow)
-    {
-        // TODO: xxxpedro console console2
-        noThrottle = true; // xxxpedro forced because there is no TabContext yet
-
-        if (!context)
-            context = FirebugContext;
-
-        if (FBTrace.DBG_ERRORS && !context)
-            FBTrace.sysout("Console.logRow has no context, skipping objects", objects);
-
-        if (!context)
-            return;
-
-        if (noThrottle || !context)
-        {
-            var panel = this.getPanel(context);
-            if (panel)
-            {
-                var row = panel.append(appender, objects, className, rep, sourceLink, noRow);
-                var container = panel.panelNode;
-
-                // TODO: xxxpedro what is this? console console2
-                /*
-                var template = Firebug.NetMonitor.NetLimit;
-
-                while (container.childNodes.length > maxQueueRequests + 1)
-                {
-                    clearDomplate(container.firstChild.nextSibling);
-                    container.removeChild(container.firstChild.nextSibling);
-                    panel.limit.limitInfo.totalCount++;
-                    template.updateCounter(panel.limit);
-                }
-                dispatch([Firebug.A11yModel], "onLogRowCreated", [panel , row]);
-                /**/
-                return row;
-            }
-            else
-            {
-                consoleQueue.push([appender, objects, context, className, rep, sourceLink, noThrottle, noRow]);
-            }
-        }
-        else
-        {
-            if (!context.throttle)
-            {
-                //FBTrace.sysout("console.logRow has not context.throttle! ");
-                return;
-            }
-            var args = [appender, objects, context, className, rep, sourceLink, true, noRow];
-            context.throttle(this.logRow, this, args);
-        }
-    },
-
-    appendFormatted: function(args, row, context)
-    {
-        if (!context)
-            context = FirebugContext;
-
-        var panel = this.getPanel(context);
-        panel.appendFormatted(args, row);
-    },
-
-    clear: function(context)
-    {
-        if (!context)
-            //context = FirebugContext;
-            context = Firebug.context;
-
-        /*
-        if (context)
-            Firebug.Errors.clear(context);
-        /**/
-
-        var panel = this.getPanel(context, true);
-        if (panel)
-        {
-            panel.clear();
-        }
-    },
-
-    // Override to direct output to your panel
-    getPanel: function(context, noCreate)
-    {
-        //return context.getPanel("console", noCreate);
-        // TODO: xxxpedro console console2
-        return Firebug.chrome ? Firebug.chrome.getPanel("Console") : null;
-    }
-
-};
-
-// ************************************************************************************************
-
-//TODO: xxxpedro
-//var ActivableConsole = extend(Firebug.ActivableModule, Firebug.ConsoleBase);
-var ActivableConsole = extend(Firebug.ConsoleBase,
-{
-    isAlwaysEnabled: function()
-    {
-        return true;
-    }
-});
-
-Firebug.Console = Firebug.Console = extend(ActivableConsole,
-//Firebug.Console = extend(ActivableConsole,
-{
-    dispatchName: "console",
-
-    error: function()
-    {
-        Firebug.Console.logFormatted(arguments, Firebug.browser, "error");
-    },
-
-    flush: function()
-    {
-        dispatch(this.fbListeners,"flush",[]);
-
-        for (var i=0, length=consoleQueue.length; i<length; i++)
-        {
-            var args = consoleQueue[i];
-            this.logRow.apply(this, args);
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends Module
-
-    showPanel: function(browser, panel)
-    {
-    },
-
-    getFirebugConsoleElement: function(context, win)
-    {
-        var element = win.document.getElementById("_firebugConsole");
-        if (!element)
-        {
-            if (FBTrace.DBG_CONSOLE)
-                FBTrace.sysout("getFirebugConsoleElement forcing element");
-            var elementForcer = "(function(){var r=null; try { r = window._getFirebugConsoleElement();}catch(exc){r=exc;} return r;})();";  // we could just add the elements here
-
-            if (context.stopped)
-                Firebug.Console.injector.evaluateConsoleScript(context);  // todo evaluate consoleForcer on stack
-            else
-                var r = Firebug.CommandLine.evaluateInWebPage(elementForcer, context, win);
-
-            if (FBTrace.DBG_CONSOLE)
-                FBTrace.sysout("getFirebugConsoleElement forcing element result "+r, r);
-
-            var element = win.document.getElementById("_firebugConsole");
-            if (!element) // elementForce fails
-            {
-                if (FBTrace.DBG_ERRORS) FBTrace.sysout("console.getFirebugConsoleElement: no _firebugConsole in win:", win);
-                Firebug.Console.logFormatted(["Firebug cannot find _firebugConsole element", r, win], context, "error", true);
-            }
-        }
-
-        return element;
-    },
-
-    isReadyElsePreparing: function(context, win) // this is the only code that should call injector.attachIfNeeded
-    {
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("console.isReadyElsePreparing, win is " +
-                (win?"an argument: ":"null, context.window: ") +
-                (win?win.location:context.window.location), (win?win:context.window));
-
-        if (win)
-            return this.injector.attachIfNeeded(context, win);
-        else
-        {
-            var attached = true;
-            for (var i = 0; i < context.windows.length; i++)
-                attached = attached && this.injector.attachIfNeeded(context, context.windows[i]);
-            // already in the list above attached = attached && this.injector.attachIfNeeded(context, context.window);
-            if (context.windows.indexOf(context.window) == -1)
-                FBTrace.sysout("isReadyElsePreparing ***************** context.window not in context.windows");
-            if (FBTrace.DBG_CONSOLE)
-                FBTrace.sysout("console.isReadyElsePreparing attached to "+context.windows.length+" and returns "+attached);
-            return attached;
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends ActivableModule
-
-    initialize: function()
-    {
-        this.panelName = "console";
-
-        //TODO: xxxpedro
-        //Firebug.ActivableModule.initialize.apply(this, arguments);
-        //Firebug.Debugger.addListener(this);
-    },
-
-    enable: function()
-    {
-        if (Firebug.Console.isAlwaysEnabled())
-            this.watchForErrors();
-    },
-
-    disable: function()
-    {
-        if (Firebug.Console.isAlwaysEnabled())
-            this.unwatchForErrors();
-    },
-
-    initContext: function(context, persistedState)
-    {
-        Firebug.ActivableModule.initContext.apply(this, arguments);
-        context.consoleReloadWarning = true;  // mark as need to warn.
-    },
-
-    loadedContext: function(context)
-    {
-        for (var url in context.sourceFileMap)
-            return;  // if there are any sourceFiles, then do nothing
-
-        // else we saw no JS, so the reload warning it not needed.
-        this.clearReloadWarning(context);
-    },
-
-    clearReloadWarning: function(context) // remove the warning about reloading.
-    {
-         if (context.consoleReloadWarning)
-         {
-             var panel = context.getPanel(this.panelName);
-             panel.clearReloadWarning();
-             delete context.consoleReloadWarning;
-         }
-    },
-
-    togglePersist: function(context)
-    {
-        var panel = context.getPanel(this.panelName);
-        panel.persistContent = panel.persistContent ? false : true;
-        Firebug.chrome.setGlobalAttribute("cmd_togglePersistConsole", "checked", panel.persistContent);
-    },
-
-    showContext: function(browser, context)
-    {
-        Firebug.chrome.setGlobalAttribute("cmd_clearConsole", "disabled", !context);
-
-        Firebug.ActivableModule.showContext.apply(this, arguments);
-    },
-
-    destroyContext: function(context, persistedState)
-    {
-        Firebug.Console.injector.detachConsole(context, context.window);  // TODO iterate windows?
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    onPanelEnable: function(panelName)
-    {
-        if (panelName != this.panelName)  // we don't care about other panels
-            return;
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("console.onPanelEnable**************");
-
-        this.watchForErrors();
-        Firebug.Debugger.addDependentModule(this); // we inject the console during JS compiles so we need jsd
-    },
-
-    onPanelDisable: function(panelName)
-    {
-        if (panelName != this.panelName)  // we don't care about other panels
-            return;
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("console.onPanelDisable**************");
-
-        Firebug.Debugger.removeDependentModule(this); // we inject the console during JS compiles so we need jsd
-        this.unwatchForErrors();
-
-        // Make sure possible errors coming from the page and displayed in the Firefox
-        // status bar are removed.
-        this.clear();
-    },
-
-    onSuspendFirebug: function()
-    {
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("console.onSuspendFirebug\n");
-        if (Firebug.Console.isAlwaysEnabled())
-            this.unwatchForErrors();
-    },
-
-    onResumeFirebug: function()
-    {
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("console.onResumeFirebug\n");
-        if (Firebug.Console.isAlwaysEnabled())
-            this.watchForErrors();
-    },
-
-    watchForErrors: function()
-    {
-        Firebug.Errors.checkEnabled();
-        $('fbStatusIcon').setAttribute("console", "on");
-    },
-
-    unwatchForErrors: function()
-    {
-        Firebug.Errors.checkEnabled();
-        $('fbStatusIcon').removeAttribute("console");
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Firebug.Debugger listener
-
-    onMonitorScript: function(context, frame)
-    {
-        Firebug.Console.log(frame, context);
-    },
-
-    onFunctionCall: function(context, frame, depth, calling)
-    {
-        if (calling)
-            Firebug.Console.openGroup([frame, "depth:"+depth], context);
-        else
-            Firebug.Console.closeGroup(context);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    logRow: function(appender, objects, context, className, rep, sourceLink, noThrottle, noRow)
-    {
-        if (!context)
-            context = FirebugContext;
-
-        if (FBTrace.DBG_WINDOWS && !context) FBTrace.sysout("Console.logRow: no context \n");
-
-        if (this.isAlwaysEnabled())
-            return Firebug.ConsoleBase.logRow.apply(this, arguments);
-    }
-});
-
-Firebug.ConsoleListener =
-{
-    log: function(context, object, className, sourceLink)
-    {
-    },
-
-    logFormatted: function(context, objects, className, sourceLink)
-    {
-    }
-};
-
-// ************************************************************************************************
-
-Firebug.ConsolePanel = function () {} // XXjjb attach Firebug so this panel can be extended.
-
-//TODO: xxxpedro
-//Firebug.ConsolePanel.prototype = extend(Firebug.ActivablePanel,
-Firebug.ConsolePanel.prototype = extend(Firebug.Panel,
-{
-    wasScrolledToBottom: false,
-    messageCount: 0,
-    lastLogTime: 0,
-    groups: null,
-    limit: null,
-
-    append: function(appender, objects, className, rep, sourceLink, noRow)
-    {
-        var container = this.getTopContainer();
-
-        if (noRow)
-        {
-            appender.apply(this, [objects]);
-        }
-        else
-        {
-            // xxxHonza: Don't update the this.wasScrolledToBottom flag now.
-            // At the beginning (when the first log is created) the isScrolledToBottom
-            // always returns true.
-            //if (this.panelNode.offsetHeight)
-            //    this.wasScrolledToBottom = isScrolledToBottom(this.panelNode);
-
-            var row = this.createRow("logRow", className);
-            appender.apply(this, [objects, row, rep]);
-
-            if (sourceLink)
-                FirebugReps.SourceLink.tag.append({object: sourceLink}, row);
-
-            container.appendChild(row);
-
-            this.filterLogRow(row, this.wasScrolledToBottom);
-
-            if (this.wasScrolledToBottom)
-                scrollToBottom(this.panelNode);
-
-            return row;
-        }
-    },
-
-    clear: function()
-    {
-        if (this.panelNode)
-        {
-            if (FBTrace.DBG_CONSOLE)
-                FBTrace.sysout("ConsolePanel.clear");
-            clearNode(this.panelNode);
-            this.insertLogLimit(this.context);
-        }
-    },
-
-    insertLogLimit: function()
-    {
-        // Create limit row. This row is the first in the list of entries
-        // and initially hidden. It's displayed as soon as the number of
-        // entries reaches the limit.
-        var row = this.createRow("limitRow");
-
-        var limitInfo = {
-            totalCount: 0,
-            limitPrefsTitle: $STRF("LimitPrefsTitle", [Firebug.prefDomain+".console.logLimit"])
-        };
-
-        //TODO: xxxpedro console net limit!?
-        return;
-        var netLimitRep = Firebug.NetMonitor.NetLimit;
-        var nodes = netLimitRep.createTable(row, limitInfo);
-
-        this.limit = nodes[1];
-
-        var container = this.panelNode;
-        container.insertBefore(nodes[0], container.firstChild);
-    },
-
-    insertReloadWarning: function()
-    {
-        // put the message in, we will clear if the window console is injected.
-        this.warningRow = this.append(appendObject, $STR("message.Reload to activate window console"), "info");
-    },
-
-    clearReloadWarning: function()
-    {
-        if (this.warningRow)
-        {
-            this.warningRow.parentNode.removeChild(this.warningRow);
-            delete this.warningRow;
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    appendObject: function(object, row, rep)
-    {
-        if (!rep)
-            rep = Firebug.getRep(object);
-        return rep.tag.append({object: object}, row);
-    },
-
-    appendFormatted: function(objects, row, rep)
-    {
-        if (!objects || !objects.length)
-            return;
-
-        function logText(text, row)
-        {
-            var node = row.ownerDocument.createTextNode(text);
-            row.appendChild(node);
-        }
-
-        var format = objects[0];
-        var objIndex = 0;
-
-        if (typeof(format) != "string")
-        {
-            format = "";
-            objIndex = -1;
-        }
-        else  // a string
-        {
-            if (objects.length === 1) // then we have only a string...
-            {
-                if (format.length < 1) { // ...and it has no characters.
-                    logText("(an empty string)", row);
-                    return;
-                }
-            }
-        }
-
-        var parts = parseFormat(format);
-        var trialIndex = objIndex;
-        for (var i= 0; i < parts.length; i++)
-        {
-            var part = parts[i];
-            if (part && typeof(part) == "object")
-            {
-                if (++trialIndex > objects.length)  // then too few parameters for format, assume unformatted.
-                {
-                    format = "";
-                    objIndex = -1;
-                    parts.length = 0;
-                    break;
-                }
-            }
-
-        }
-        for (var i = 0; i < parts.length; ++i)
-        {
-            var part = parts[i];
-            if (part && typeof(part) == "object")
-            {
-                var object = objects[++objIndex];
-                if (typeof(object) != "undefined")
-                    this.appendObject(object, row, part.rep);
-                else
-                    this.appendObject(part.type, row, FirebugReps.Text);
-            }
-            else
-                FirebugReps.Text.tag.append({object: part}, row);
-        }
-
-        for (var i = objIndex+1; i < objects.length; ++i)
-        {
-            logText(" ", row);
-            var object = objects[i];
-            if (typeof(object) == "string")
-                FirebugReps.Text.tag.append({object: object}, row);
-            else
-                this.appendObject(object, row);
-        }
-    },
-
-    appendOpenGroup: function(objects, row, rep)
-    {
-        if (!this.groups)
-            this.groups = [];
-
-        setClass(row, "logGroup");
-        setClass(row, "opened");
-
-        var innerRow = this.createRow("logRow");
-        setClass(innerRow, "logGroupLabel");
-        if (rep)
-            rep.tag.replace({"objects": objects}, innerRow);
-        else
-            this.appendFormatted(objects, innerRow, rep);
-        row.appendChild(innerRow);
-        //dispatch([Firebug.A11yModel], 'onLogRowCreated', [this, innerRow]);
-        var groupBody = this.createRow("logGroupBody");
-        row.appendChild(groupBody);
-        groupBody.setAttribute('role', 'group');
-        this.groups.push(groupBody);
-
-        addEvent(innerRow, "mousedown", function(event)
-        {
-            if (isLeftClick(event))
-            {
-                //console.log(event.currentTarget == event.target);
-
-                var target = event.target || event.srcElement;
-
-                target = getAncestorByClass(target, "logGroupLabel");
-
-                var groupRow = target.parentNode;
-
-                if (hasClass(groupRow, "opened"))
-                {
-                    removeClass(groupRow, "opened");
-                    target.setAttribute('aria-expanded', 'false');
-                }
-                else
-                {
-                    setClass(groupRow, "opened");
-                    target.setAttribute('aria-expanded', 'true');
-                }
-            }
-        });
-    },
-
-    appendCloseGroup: function(object, row, rep)
-    {
-        if (this.groups)
-            this.groups.pop();
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // TODO: xxxpedro console2
-    onMouseMove: function(event)
-    {
-        if (!Firebug.Inspector) return;
-
-        var target = event.srcElement || event.target;
-
-        var object = getAncestorByClass(target, "objectLink-element");
-        object = object ? object.repObject : null;
-
-        if(object && instanceOf(object, "Element") && object.nodeType == 1)
-        {
-            if(object != lastHighlightedObject)
-            {
-                Firebug.Inspector.drawBoxModel(object);
-                object = lastHighlightedObject;
-            }
-        }
-        else
-            Firebug.Inspector.hideBoxModel();
-
-    },
-
-    onMouseDown: function(event)
-    {
-        var target = event.srcElement || event.target;
-
-        var object = getAncestorByClass(target, "objectLink");
-        var repObject = object ? object.repObject : null;
-
-        if (!repObject)
-        {
-            return;
-        }
-
-        if (hasClass(object, "objectLink-object"))
-        {
-            Firebug.chrome.selectPanel("DOM");
-            Firebug.chrome.getPanel("DOM").select(repObject, true);
-        }
-        else if (hasClass(object, "objectLink-element"))
-        {
-            Firebug.chrome.selectPanel("HTML");
-            Firebug.chrome.getPanel("HTML").select(repObject, true);
-        }
-
-        /*
-        if(object && instanceOf(object, "Element") && object.nodeType == 1)
-        {
-            if(object != lastHighlightedObject)
-            {
-                Firebug.Inspector.drawBoxModel(object);
-                object = lastHighlightedObject;
-            }
-        }
-        else
-            Firebug.Inspector.hideBoxModel();
-        /**/
-
-    },
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends Panel
-
-    name: "Console",
-    title: "Console",
-    //searchable: true,
-    //breakable: true,
-    //editable: false,
-
-    options:
-    {
-        hasCommandLine: true,
-        hasToolButtons: true,
-        isPreRendered: true
-    },
-
-    create: function()
-    {
-        Firebug.Panel.create.apply(this, arguments);
-
-        this.context = Firebug.browser.window;
-        this.document = Firebug.chrome.document;
-        this.onMouseMove = bind(this.onMouseMove, this);
-        this.onMouseDown = bind(this.onMouseDown, this);
-
-        this.clearButton = new Button({
-            element: $("fbConsole_btClear"),
-            owner: Firebug.Console,
-            onClick: Firebug.Console.clear
-        });
-    },
-
-    initialize: function()
-    {
-        Firebug.Panel.initialize.apply(this, arguments);  // loads persisted content
-        //Firebug.ActivablePanel.initialize.apply(this, arguments);  // loads persisted content
-
-        if (!this.persistedContent && Firebug.Console.isAlwaysEnabled())
-        {
-            this.insertLogLimit(this.context);
-
-            // Initialize log limit and listen for changes.
-            this.updateMaxLimit();
-
-            if (this.context.consoleReloadWarning)  // we have not yet injected the console
-                this.insertReloadWarning();
-        }
-
-        //Firebug.Console.injector.install(Firebug.browser.window);
-
-        addEvent(this.panelNode, "mouseover", this.onMouseMove);
-        addEvent(this.panelNode, "mousedown", this.onMouseDown);
-
-        this.clearButton.initialize();
-
-        //consolex.trace();
-        //TODO: xxxpedro remove this
-        /*
-        Firebug.Console.openGroup(["asd"], null, "group", null, false);
-        Firebug.Console.log("asd");
-        Firebug.Console.log("asd");
-        Firebug.Console.log("asd");
-        /**/
-
-        //TODO: xxxpedro preferences prefs
-        //prefs.addObserver(Firebug.prefDomain, this, false);
-    },
-
-    initializeNode : function()
-    {
-        //dispatch([Firebug.A11yModel], 'onInitializeNode', [this]);
-        if (FBTrace.DBG_CONSOLE)
-        {
-            this.onScroller = bind(this.onScroll, this);
-            addEvent(this.panelNode, "scroll", this.onScroller);
-        }
-
-        this.onResizer = bind(this.onResize, this);
-        this.resizeEventTarget = Firebug.chrome.$('fbContentBox');
-        addEvent(this.resizeEventTarget, "resize", this.onResizer);
-    },
-
-    destroyNode : function()
-    {
-        //dispatch([Firebug.A11yModel], 'onDestroyNode', [this]);
-        if (this.onScroller)
-            removeEvent(this.panelNode, "scroll", this.onScroller);
-
-        //removeEvent(this.resizeEventTarget, "resize", this.onResizer);
-    },
-
-    shutdown: function()
-    {
-        //TODO: xxxpedro console console2
-        this.clearButton.shutdown();
-
-        removeEvent(this.panelNode, "mousemove", this.onMouseMove);
-        removeEvent(this.panelNode, "mousedown", this.onMouseDown);
-
-        this.destroyNode();
-
-        Firebug.Panel.shutdown.apply(this, arguments);
-
-        //TODO: xxxpedro preferences prefs
-        //prefs.removeObserver(Firebug.prefDomain, this, false);
-    },
-
-    ishow: function(state)
-    {
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("Console.panel show; " + this.context.getName(), state);
-
-        var enabled = Firebug.Console.isAlwaysEnabled();
-        if (enabled)
-        {
-             Firebug.Console.disabledPanelPage.hide(this);
-             this.showCommandLine(true);
-             this.showToolbarButtons("fbConsoleButtons", true);
-             Firebug.chrome.setGlobalAttribute("cmd_togglePersistConsole", "checked", this.persistContent);
-
-             if (state && state.wasScrolledToBottom)
-             {
-                 this.wasScrolledToBottom = state.wasScrolledToBottom;
-                 delete state.wasScrolledToBottom;
-             }
-
-             if (this.wasScrolledToBottom)
-                 scrollToBottom(this.panelNode);
-
-             if (FBTrace.DBG_CONSOLE)
-                 FBTrace.sysout("console.show ------------------ wasScrolledToBottom: " +
-                    this.wasScrolledToBottom + ", " + this.context.getName());
-        }
-        else
-        {
-            this.hide(state);
-            Firebug.Console.disabledPanelPage.show(this);
-        }
-    },
-
-    ihide: function(state)
-    {
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("Console.panel hide; " + this.context.getName(), state);
-
-        this.showToolbarButtons("fbConsoleButtons", false);
-        this.showCommandLine(false);
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("console.hide ------------------ wasScrolledToBottom: " +
-                this.wasScrolledToBottom + ", " + this.context.getName());
-    },
-
-    destroy: function(state)
-    {
-        if (this.panelNode.offsetHeight)
-            this.wasScrolledToBottom = isScrolledToBottom(this.panelNode);
-
-        if (state)
-            state.wasScrolledToBottom = this.wasScrolledToBottom;
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("console.destroy ------------------ wasScrolledToBottom: " +
-                this.wasScrolledToBottom + ", " + this.context.getName());
-    },
-
-    shouldBreakOnNext: function()
-    {
-        // xxxHonza: shouldn't the breakOnErrors be context related?
-        // xxxJJB, yes, but we can't support it because we can't yet tell
-        // which window the error is on.
-        return Firebug.getPref(Firebug.servicePrefDomain, "breakOnErrors");
-    },
-
-    getBreakOnNextTooltip: function(enabled)
-    {
-        return (enabled ? $STR("console.Disable Break On All Errors") :
-            $STR("console.Break On All Errors"));
-    },
-
-    enablePanel: function(module)
-    {
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("console.ConsolePanel.enablePanel; " + this.context.getName());
-
-        Firebug.ActivablePanel.enablePanel.apply(this, arguments);
-
-        this.showCommandLine(true);
-
-        if (this.wasScrolledToBottom)
-            scrollToBottom(this.panelNode);
-    },
-
-    disablePanel: function(module)
-    {
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("console.ConsolePanel.disablePanel; " + this.context.getName());
-
-        Firebug.ActivablePanel.disablePanel.apply(this, arguments);
-
-        this.showCommandLine(false);
-    },
-
-    getOptionsMenuItems: function()
-    {
-        return [
-            optionMenu("ShowJavaScriptErrors", "showJSErrors"),
-            optionMenu("ShowJavaScriptWarnings", "showJSWarnings"),
-            optionMenu("ShowCSSErrors", "showCSSErrors"),
-            optionMenu("ShowXMLErrors", "showXMLErrors"),
-            optionMenu("ShowXMLHttpRequests", "showXMLHttpRequests"),
-            optionMenu("ShowChromeErrors", "showChromeErrors"),
-            optionMenu("ShowChromeMessages", "showChromeMessages"),
-            optionMenu("ShowExternalErrors", "showExternalErrors"),
-            optionMenu("ShowNetworkErrors", "showNetworkErrors"),
-            this.getShowStackTraceMenuItem(),
-            this.getStrictOptionMenuItem(),
-            "-",
-            optionMenu("LargeCommandLine", "largeCommandLine")
-        ];
-    },
-
-    getShowStackTraceMenuItem: function()
-    {
-        var menuItem = serviceOptionMenu("ShowStackTrace", "showStackTrace");
-        if (FirebugContext && !Firebug.Debugger.isAlwaysEnabled())
-            menuItem.disabled = true;
-        return menuItem;
-    },
-
-    getStrictOptionMenuItem: function()
-    {
-        var strictDomain = "javascript.options";
-        var strictName = "strict";
-        var strictValue = prefs.getBoolPref(strictDomain+"."+strictName);
-        return {label: "JavascriptOptionsStrict", type: "checkbox", checked: strictValue,
-            command: bindFixed(Firebug.setPref, Firebug, strictDomain, strictName, !strictValue) };
-    },
-
-    getBreakOnMenuItems: function()
-    {
-        //xxxHonza: no BON options for now.
-        /*return [
-            optionMenu("console.option.Persist Break On Error", "persistBreakOnError")
-        ];*/
-       return [];
-    },
-
-    search: function(text)
-    {
-        if (!text)
-            return;
-
-        // Make previously visible nodes invisible again
-        if (this.matchSet)
-        {
-            for (var i in this.matchSet)
-                removeClass(this.matchSet[i], "matched");
-        }
-
-        this.matchSet = [];
-
-        function findRow(node) { return getAncestorByClass(node, "logRow"); }
-        var search = new TextSearch(this.panelNode, findRow);
-
-        var logRow = search.find(text);
-        if (!logRow)
-        {
-            dispatch([Firebug.A11yModel], 'onConsoleSearchMatchFound', [this, text, []]);
-            return false;
-        }
-        for (; logRow; logRow = search.findNext())
-        {
-            setClass(logRow, "matched");
-            this.matchSet.push(logRow);
-        }
-        dispatch([Firebug.A11yModel], 'onConsoleSearchMatchFound', [this, text, this.matchSet]);
-        return true;
-    },
-
-    breakOnNext: function(breaking)
-    {
-        Firebug.setPref(Firebug.servicePrefDomain, "breakOnErrors", breaking);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // private
-
-    createRow: function(rowName, className)
-    {
-        var elt = this.document.createElement("div");
-        elt.className = rowName + (className ? " " + rowName + "-" + className : "");
-        return elt;
-    },
-
-    getTopContainer: function()
-    {
-        if (this.groups && this.groups.length)
-            return this.groups[this.groups.length-1];
-        else
-            return this.panelNode;
-    },
-
-    filterLogRow: function(logRow, scrolledToBottom)
-    {
-        if (this.searchText)
-        {
-            setClass(logRow, "matching");
-            setClass(logRow, "matched");
-
-            // Search after a delay because we must wait for a frame to be created for
-            // the new logRow so that the finder will be able to locate it
-            setTimeout(bindFixed(function()
-            {
-                if (this.searchFilter(this.searchText, logRow))
-                    this.matchSet.push(logRow);
-                else
-                    removeClass(logRow, "matched");
-
-                removeClass(logRow, "matching");
-
-                if (scrolledToBottom)
-                    scrollToBottom(this.panelNode);
-            }, this), 100);
-        }
-    },
-
-    searchFilter: function(text, logRow)
-    {
-        var count = this.panelNode.childNodes.length;
-        var searchRange = this.document.createRange();
-        searchRange.setStart(this.panelNode, 0);
-        searchRange.setEnd(this.panelNode, count);
-
-        var startPt = this.document.createRange();
-        startPt.setStartBefore(logRow);
-
-        var endPt = this.document.createRange();
-        endPt.setStartAfter(logRow);
-
-        return finder.Find(text, searchRange, startPt, endPt) != null;
-    },
-
-    // nsIPrefObserver
-    observe: function(subject, topic, data)
-    {
-        // We're observing preferences only.
-        if (topic != "nsPref:changed")
-          return;
-
-        // xxxHonza check this out.
-        var prefDomain = "Firebug.extension.";
-        var prefName = data.substr(prefDomain.length);
-        if (prefName == "console.logLimit")
-            this.updateMaxLimit();
-    },
-
-    updateMaxLimit: function()
-    {
-        var value = 1000;
-        //TODO: xxxpedro preferences log limit?
-        //var value = Firebug.getPref(Firebug.prefDomain, "console.logLimit");
-        maxQueueRequests =  value ? value : maxQueueRequests;
-    },
-
-    showCommandLine: function(shouldShow)
-    {
-        //TODO: xxxpedro show command line important
-        return;
-
-        if (shouldShow)
-        {
-            collapse(Firebug.chrome.$("fbCommandBox"), false);
-            Firebug.CommandLine.setMultiLine(Firebug.largeCommandLine, Firebug.chrome);
-        }
-        else
-        {
-            // Make sure that entire content of the Console panel is hidden when
-            // the panel is disabled.
-            Firebug.CommandLine.setMultiLine(false, Firebug.chrome, Firebug.largeCommandLine);
-            collapse(Firebug.chrome.$("fbCommandBox"), true);
-        }
-    },
-
-    onScroll: function(event)
-    {
-        // Update the scroll position flag if the position changes.
-        this.wasScrolledToBottom = FBL.isScrolledToBottom(this.panelNode);
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("console.onScroll ------------------ wasScrolledToBottom: " +
-                this.wasScrolledToBottom + ", wasScrolledToBottom: " +
-                this.context.getName(), event);
-    },
-
-    onResize: function(event)
-    {
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("console.onResize ------------------ wasScrolledToBottom: " +
-                this.wasScrolledToBottom + ", offsetHeight: " + this.panelNode.offsetHeight +
-                ", scrollTop: " + this.panelNode.scrollTop + ", scrollHeight: " +
-                this.panelNode.scrollHeight + ", " + this.context.getName(), event);
-
-        if (this.wasScrolledToBottom)
-            scrollToBottom(this.panelNode);
-    }
-});
-
-// ************************************************************************************************
-
-function parseFormat(format)
-{
-    var parts = [];
-    if (format.length <= 0)
-        return parts;
-
-    var reg = /((^%|.%)(\d+)?(\.)([a-zA-Z]))|((^%|.%)([a-zA-Z]))/;
-    for (var m = reg.exec(format); m; m = reg.exec(format))
-    {
-        if (m[0].substr(0, 2) == "%%")
-        {
-            parts.push(format.substr(0, m.index));
-            parts.push(m[0].substr(1));
-        }
-        else
-        {
-            var type = m[8] ? m[8] : m[5];
-            var precision = m[3] ? parseInt(m[3]) : (m[4] == "." ? -1 : 0);
-
-            var rep = null;
-            switch (type)
-            {
-                case "s":
-                    rep = FirebugReps.Text;
-                    break;
-                case "f":
-                case "i":
-                case "d":
-                    rep = FirebugReps.Number;
-                    break;
-                case "o":
-                    rep = null;
-                    break;
-            }
-
-            parts.push(format.substr(0, m[0][0] == "%" ? m.index : m.index+1));
-            parts.push({rep: rep, precision: precision, type: ("%" + type)});
-        }
-
-        format = format.substr(m.index+m[0].length);
-    }
-
-    parts.push(format);
-    return parts;
-}
-
-// ************************************************************************************************
-
-var appendObject = Firebug.ConsolePanel.prototype.appendObject;
-var appendFormatted = Firebug.ConsolePanel.prototype.appendFormatted;
-var appendOpenGroup = Firebug.ConsolePanel.prototype.appendOpenGroup;
-var appendCloseGroup = Firebug.ConsolePanel.prototype.appendCloseGroup;
-
-// ************************************************************************************************
-
-//Firebug.registerActivableModule(Firebug.Console);
-Firebug.registerModule(Firebug.Console);
-Firebug.registerPanel(Firebug.ConsolePanel);
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-
-// ************************************************************************************************
-// Constants
-
-//const Cc = Components.classes;
-//const Ci = Components.interfaces;
-
-var frameCounters = {};
-var traceRecursion = 0;
-
-Firebug.Console.injector =
-{
-    install: function(context)
-    {
-        var win = context.window;
-
-        var consoleHandler = new FirebugConsoleHandler(context, win);
-
-        var properties =
-        [
-            "log",
-            "debug",
-            "info",
-            "warn",
-            "error",
-            "assert",
-            "dir",
-            "dirxml",
-            "group",
-            "groupCollapsed",
-            "groupEnd",
-            "time",
-            "timeEnd",
-            "count",
-            "trace",
-            "profile",
-            "profileEnd",
-            "clear",
-            "open",
-            "close"
-        ];
-
-        var Handler = function(name)
-        {
-            var c = consoleHandler;
-            var f = consoleHandler[name];
-            return function(){return f.apply(c,arguments);};
-        };
-
-        var installer = function(c)
-        {
-            for (var i=0, l=properties.length; i<l; i++)
-            {
-                var name = properties[i];
-                c[name] = new Handler(name);
-                c.firebuglite = Firebug.version;
-            }
-        };
-
-        var sandbox;
-
-        if (win.console)
-        {
-            if (Env.Options.overrideConsole)
-                sandbox = new win.Function("arguments.callee.install(window.console={})");
-            else
-                // if there's a console object and overrideConsole is false we should just quit
-                return;
-        }
-        else
-        {
-            try
-            {
-                // try overriding the console object
-                sandbox = new win.Function("arguments.callee.install(window.console={})");
-            }
-            catch(E)
-            {
-                // if something goes wrong create the firebug object instead
-                sandbox = new win.Function("arguments.callee.install(window.firebug={})");
-            }
-        }
-
-        sandbox.install = installer;
-        sandbox();
-    },
-
-    isAttached: function(context, win)
-    {
-        if (win.wrappedJSObject)
-        {
-            var attached = (win.wrappedJSObject._getFirebugConsoleElement ? true : false);
-            if (FBTrace.DBG_CONSOLE)
-                FBTrace.sysout("Console.isAttached:"+attached+" to win.wrappedJSObject "+safeGetWindowLocation(win.wrappedJSObject));
-
-            return attached;
-        }
-        else
-        {
-            if (FBTrace.DBG_CONSOLE)
-                FBTrace.sysout("Console.isAttached? to win "+win.location+" fnc:"+win._getFirebugConsoleElement);
-            return (win._getFirebugConsoleElement ? true : false);
-        }
-    },
-
-    attachIfNeeded: function(context, win)
-    {
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("Console.attachIfNeeded has win "+(win? ((win.wrappedJSObject?"YES":"NO")+" wrappedJSObject"):"null") );
-
-        if (this.isAttached(context, win))
-            return true;
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("Console.attachIfNeeded found isAttached false ");
-
-        this.attachConsoleInjector(context, win);
-        this.addConsoleListener(context, win);
-
-        Firebug.Console.clearReloadWarning(context);
-
-        var attached =  this.isAttached(context, win);
-        if (attached)
-            dispatch(Firebug.Console.fbListeners, "onConsoleInjected", [context, win]);
-
-        return attached;
-    },
-
-    attachConsoleInjector: function(context, win)
-    {
-        var consoleInjection = this.getConsoleInjectionScript();  // Do it all here.
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("attachConsoleInjector evaluating in "+win.location, consoleInjection);
-
-        Firebug.CommandLine.evaluateInWebPage(consoleInjection, context, win);
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("attachConsoleInjector evaluation completed for "+win.location);
-    },
-
-    getConsoleInjectionScript: function() {
-        if (!this.consoleInjectionScript)
-        {
-            var script = "";
-            script += "window.__defineGetter__('console', function() {\n";
-            script += " return (window._firebug ? window._firebug : window.loadFirebugConsole()); })\n\n";
-
-            script += "window.loadFirebugConsole = function() {\n";
-            script += "window._firebug =  new _FirebugConsole();";
-
-            if (FBTrace.DBG_CONSOLE)
-                script += " window.dump('loadFirebugConsole '+window.location+'\\n');\n";
-
-            script += " return window._firebug };\n";
-
-            var theFirebugConsoleScript = getResource("chrome://firebug/content/consoleInjected.js");
-            script += theFirebugConsoleScript;
-
-
-            this.consoleInjectionScript = script;
-        }
-        return this.consoleInjectionScript;
-    },
-
-    forceConsoleCompilationInPage: function(context, win)
-    {
-        if (!win)
-        {
-            if (FBTrace.DBG_CONSOLE)
-                FBTrace.sysout("no win in forceConsoleCompilationInPage!");
-            return;
-        }
-
-        var consoleForcer = "window.loadFirebugConsole();";
-
-        if (context.stopped)
-            Firebug.Console.injector.evaluateConsoleScript(context);  // todo evaluate consoleForcer on stack
-        else
-            Firebug.CommandLine.evaluateInWebPage(consoleForcer, context, win);
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("forceConsoleCompilationInPage "+win.location, consoleForcer);
-    },
-
-    evaluateConsoleScript: function(context)
-    {
-        var scriptSource = this.getConsoleInjectionScript(); // TODO XXXjjb this should be getConsoleInjectionScript
-        Firebug.Debugger.evaluate(scriptSource, context);
-    },
-
-    addConsoleListener: function(context, win)
-    {
-        if (!context.activeConsoleHandlers)  // then we have not been this way before
-            context.activeConsoleHandlers = [];
-        else
-        {   // we've been this way before...
-            for (var i=0; i<context.activeConsoleHandlers.length; i++)
-            {
-                if (context.activeConsoleHandlers[i].window == win)
-                {
-                    context.activeConsoleHandlers[i].detach();
-                    if (FBTrace.DBG_CONSOLE)
-                        FBTrace.sysout("consoleInjector addConsoleListener removed handler("+context.activeConsoleHandlers[i].handler_name+") from _firebugConsole in : "+win.location+"\n");
-                    context.activeConsoleHandlers.splice(i,1);
-                }
-            }
-        }
-
-        // We need the element to attach our event listener.
-        var element = Firebug.Console.getFirebugConsoleElement(context, win);
-        if (element)
-            element.setAttribute("FirebugVersion", Firebug.version); // Initialize Firebug version.
-        else
-            return false;
-
-        var handler = new FirebugConsoleHandler(context, win);
-        handler.attachTo(element);
-
-        context.activeConsoleHandlers.push(handler);
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("consoleInjector addConsoleListener attached handler("+handler.handler_name+") to _firebugConsole in : "+win.location+"\n");
-        return true;
-    },
-
-    detachConsole: function(context, win)
-    {
-        if (win && win.document)
-        {
-            var element = win.document.getElementById("_firebugConsole");
-            if (element)
-                element.parentNode.removeChild(element);
-        }
-    }
-};
-
-var total_handlers = 0;
-var FirebugConsoleHandler = function FirebugConsoleHandler(context, win)
-{
-    this.window = win;
-
-    this.attachTo = function(element)
-    {
-        this.element = element;
-        // When raised on our injected element, callback to Firebug and append to console
-        this.boundHandler = bind(this.handleEvent, this);
-        this.element.addEventListener('firebugAppendConsole', this.boundHandler, true); // capturing
-    };
-
-    this.detach = function()
-    {
-        this.element.removeEventListener('firebugAppendConsole', this.boundHandler, true);
-    };
-
-    this.handler_name = ++total_handlers;
-    this.handleEvent = function(event)
-    {
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("FirebugConsoleHandler("+this.handler_name+") "+event.target.getAttribute("methodName")+", event", event);
-        if (!Firebug.CommandLine.CommandHandler.handle(event, this, win))
-        {
-            if (FBTrace.DBG_CONSOLE)
-                FBTrace.sysout("FirebugConsoleHandler", this);
-
-            var methodName = event.target.getAttribute("methodName");
-            Firebug.Console.log($STRF("console.MethodNotSupported", [methodName]));
-        }
-    };
-
-    this.firebuglite = Firebug.version;
-
-    this.init = function()
-    {
-        var consoleElement = win.document.getElementById('_firebugConsole');
-        consoleElement.setAttribute("FirebugVersion", Firebug.version);
-    };
-
-    this.log = function()
-    {
-        logFormatted(arguments, "log");
-    };
-
-    this.debug = function()
-    {
-        logFormatted(arguments, "debug", true);
-    };
-
-    this.info = function()
-    {
-        logFormatted(arguments, "info", true);
-    };
-
-    this.warn = function()
-    {
-        logFormatted(arguments, "warn", true);
-    };
-
-    this.error = function()
-    {
-        //TODO: xxxpedro console error
-        //if (arguments.length == 1)
-        //{
-        //    logAssert("error", arguments);  // add more info based on stack trace
-        //}
-        //else
-        //{
-            //Firebug.Errors.increaseCount(context);
-            logFormatted(arguments, "error", true);  // user already added info
-        //}
-    };
-
-    this.exception = function()
-    {
-        logAssert("error", arguments);
-    };
-
-    this.assert = function(x)
-    {
-        if (!x)
-        {
-            var rest = [];
-            for (var i = 1; i < arguments.length; i++)
-                rest.push(arguments[i]);
-            logAssert("assert", rest);
-        }
-    };
-
-    this.dir = function(o)
-    {
-        Firebug.Console.log(o, context, "dir", Firebug.DOMPanel.DirTable);
-    };
-
-    this.dirxml = function(o)
-    {
-        ///if (o instanceof Window)
-        if (instanceOf(o, "Window"))
-            o = o.document.documentElement;
-        ///else if (o instanceof Document)
-        else if (instanceOf(o, "Document"))
-            o = o.documentElement;
-
-        Firebug.Console.log(o, context, "dirxml", Firebug.HTMLPanel.SoloElement);
-    };
-
-    this.group = function()
-    {
-        //TODO: xxxpedro;
-        //var sourceLink = getStackLink();
-        var sourceLink = null;
-        Firebug.Console.openGroup(arguments, null, "group", null, false, sourceLink);
-    };
-
-    this.groupEnd = function()
-    {
-        Firebug.Console.closeGroup(context);
-    };
-
-    this.groupCollapsed = function()
-    {
-        var sourceLink = getStackLink();
-        // noThrottle true is probably ok, openGroups will likely be short strings.
-        var row = Firebug.Console.openGroup(arguments, null, "group", null, true, sourceLink);
-        removeClass(row, "opened");
-    };
-
-    this.profile = function(title)
-    {
-        logFormatted(["console.profile() not supported."], "warn", true);
-
-        //Firebug.Profiler.startProfiling(context, title);
-    };
-
-    this.profileEnd = function()
-    {
-        logFormatted(["console.profile() not supported."], "warn", true);
-
-        //Firebug.Profiler.stopProfiling(context);
-    };
-
-    this.count = function(key)
-    {
-        // TODO: xxxpedro console2: is there a better way to find a unique ID for the coun() call?
-        var frameId = "0";
-        //var frameId = FBL.getStackFrameId();
-        if (frameId)
-        {
-            if (!frameCounters)
-                frameCounters = {};
-
-            if (key != undefined)
-                frameId += key;
-
-            var frameCounter = frameCounters[frameId];
-            if (!frameCounter)
-            {
-                var logRow = logFormatted(["0"], null, true, true);
-
-                frameCounter = {logRow: logRow, count: 1};
-                frameCounters[frameId] = frameCounter;
-            }
-            else
-                ++frameCounter.count;
-
-            var label = key == undefined
-                ? frameCounter.count
-                : key + " " + frameCounter.count;
-
-            frameCounter.logRow.firstChild.firstChild.nodeValue = label;
-        }
-    };
-
-    this.trace = function()
-    {
-        var getFuncName = function getFuncName (f)
-        {
-            if (f.getName instanceof Function)
-            {
-                return f.getName();
-            }
-            if (f.name) // in FireFox, Function objects have a name property...
-            {
-                return f.name;
-            }
-
-            var name = f.toString().match(/function\s*([_$\w\d]*)/)[1];
-            return name || "anonymous";
-        };
-
-        var wasVisited = function(fn)
-        {
-            for (var i=0, l=frames.length; i<l; i++)
-            {
-                if (frames[i].fn == fn)
-                {
-                    return true;
-                }
-            }
-
-            return false;
-        };
-
-        traceRecursion++;
-
-        if (traceRecursion > 1)
-        {
-            traceRecursion--;
-            return;
-        }
-
-        var frames = [];
-
-        for (var fn = arguments.callee.caller.caller; fn; fn = fn.caller)
-        {
-            if (wasVisited(fn)) break;
-
-            var args = [];
-
-            for (var i = 0, l = fn.arguments.length; i < l; ++i)
-            {
-                args.push({value: fn.arguments[i]});
-            }
-
-            frames.push({fn: fn, name: getFuncName(fn), args: args});
-        }
-
-
-        // ****************************************************************************************
-
-        try
-        {
-            (0)();
-        }
-        catch(e)
-        {
-            var result = e;
-
-            var stack =
-                result.stack || // Firefox / Google Chrome
-                result.stacktrace || // Opera
-                "";
-
-            stack = stack.replace(/\n\r|\r\n/g, "\n"); // normalize line breaks
-            var items = stack.split(/[\n\r]/);
-
-            // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-            // Google Chrome
-            if (FBL.isSafari)
-            {
-                //var reChromeStackItem = /^\s+at\s+([^\(]+)\s\((.*)\)$/;
-                //var reChromeStackItem = /^\s+at\s+(.*)((?:http|https|ftp|file):\/\/.*)$/;
-                var reChromeStackItem = /^\s+at\s+(.*)((?:http|https|ftp|file):\/\/.*)$/;
-
-                var reChromeStackItemName = /\s*\($/;
-                var reChromeStackItemValue = /^(.+)\:(\d+\:\d+)\)?$/;
-
-                var framePos = 0;
-                for (var i=4, length=items.length; i<length; i++, framePos++)
-                {
-                    var frame = frames[framePos];
-                    var item = items[i];
-                    var match = item.match(reChromeStackItem);
-
-                    //Firebug.Console.log("["+ framePos +"]--------------------------");
-                    //Firebug.Console.log(item);
-                    //Firebug.Console.log("................");
-
-                    if (match)
-                    {
-                        var name = match[1];
-                        if (name)
-                        {
-                            name = name.replace(reChromeStackItemName, "");
-                            frame.name = name;
-                        }
-
-                        //Firebug.Console.log("name: "+name);
-
-                        var value = match[2].match(reChromeStackItemValue);
-                        if (value)
-                        {
-                            frame.href = value[1];
-                            frame.lineNo = value[2];
-
-                            //Firebug.Console.log("url: "+value[1]);
-                            //Firebug.Console.log("line: "+value[2]);
-                        }
-                        //else
-                        //    Firebug.Console.log(match[2]);
-
-                    }
-                }
-            }
-            /**/
-
-            // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-            else if (FBL.isFirefox)
-            {
-                // Firefox
-                var reFirefoxStackItem = /^(.*)@(.*)$/;
-                var reFirefoxStackItemValue = /^(.+)\:(\d+)$/;
-
-                var framePos = 0;
-                for (var i=2, length=items.length; i<length; i++, framePos++)
-                {
-                    var frame = frames[framePos] || {};
-                    var item = items[i];
-                    var match = item.match(reFirefoxStackItem);
-
-                    if (match)
-                    {
-                        var name = match[1];
-
-                        //Firebug.Console.logFormatted("name: "+name);
-
-                        var value = match[2].match(reFirefoxStackItemValue);
-                        if (value)
-                        {
-                            frame.href = value[1];
-                            frame.lineNo = value[2];
-
-                            //Firebug.Console.log("href: "+ value[1]);
-                            //Firebug.Console.log("line: " + value[2]);
-                        }
-                        //else
-                        //    Firebug.Console.logFormatted([match[2]]);
-                    }
-                }
-            }
-            /**/
-
-            // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-            /*
-            else if (FBL.isOpera)
-            {
-                // Opera
-                var reOperaStackItem = /^\s\s(?:\.\.\.\s\s)?Line\s(\d+)\sof\s(.+)$/;
-                var reOperaStackItemValue = /^linked\sscript\s(.+)$/;
-
-                for (var i=0, length=items.length; i<length; i+=2)
-                {
-                    var item = items[i];
-
-                    var match = item.match(reOperaStackItem);
-
-                    if (match)
-                    {
-                        //Firebug.Console.log(match[1]);
-
-                        var value = match[2].match(reOperaStackItemValue);
-
-                        if (value)
-                        {
-                            //Firebug.Console.log(value[1]);
-                        }
-                        //else
-                        //    Firebug.Console.log(match[2]);
-
-                        //Firebug.Console.log("--------------------------");
-                    }
-                }
-            }
-            /**/
-        }
-
-        //console.log(stack);
-        //console.dir(frames);
-        Firebug.Console.log({frames: frames}, context, "stackTrace", FirebugReps.StackTrace);
-
-        traceRecursion--;
-    };
-
-    this.trace_ok = function()
-    {
-        var getFuncName = function getFuncName (f)
-        {
-            if (f.getName instanceof Function)
-                return f.getName();
-            if (f.name) // in FireFox, Function objects have a name property...
-                return f.name;
-
-            var name = f.toString().match(/function\s*([_$\w\d]*)/)[1];
-            return name || "anonymous";
-        };
-
-        var wasVisited = function(fn)
-        {
-            for (var i=0, l=frames.length; i<l; i++)
-            {
-                if (frames[i].fn == fn)
-                    return true;
-            }
-
-            return false;
-        };
-
-        var frames = [];
-
-        for (var fn = arguments.callee.caller; fn; fn = fn.caller)
-        {
-            if (wasVisited(fn)) break;
-
-            var args = [];
-
-            for (var i = 0, l = fn.arguments.length; i < l; ++i)
-            {
-                args.push({value: fn.arguments[i]});
-            }
-
-            frames.push({fn: fn, name: getFuncName(fn), args: args});
-        }
-
-        Firebug.Console.log({frames: frames}, context, "stackTrace", FirebugReps.StackTrace);
-    };
-
-    this.clear = function()
-    {
-        Firebug.Console.clear(context);
-    };
-
-    this.time = function(name, reset)
-    {
-        if (!name)
-            return;
-
-        var time = new Date().getTime();
-
-        if (!this.timeCounters)
-            this.timeCounters = {};
-
-        var key = "KEY"+name.toString();
-
-        if (!reset && this.timeCounters[key])
-            return;
-
-        this.timeCounters[key] = time;
-    };
-
-    this.timeEnd = function(name)
-    {
-        var time = new Date().getTime();
-
-        if (!this.timeCounters)
-            return;
-
-        var key = "KEY"+name.toString();
-
-        var timeCounter = this.timeCounters[key];
-        if (timeCounter)
-        {
-            var diff = time - timeCounter;
-            var label = name + ": " + diff + "ms";
-
-            this.info(label);
-
-            delete this.timeCounters[key];
-        }
-        return diff;
-    };
-
-    // These functions are over-ridden by commandLine
-    this.evaluated = function(result, context)
-    {
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("consoleInjector.FirebugConsoleHandler evalutated default called", result);
-
-        Firebug.Console.log(result, context);
-    };
-    this.evaluateError = function(result, context)
-    {
-        Firebug.Console.log(result, context, "errorMessage");
-    };
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    function logFormatted(args, className, linkToSource, noThrottle)
-    {
-        var sourceLink = linkToSource ? getStackLink() : null;
-        return Firebug.Console.logFormatted(args, context, className, noThrottle, sourceLink);
-    }
-
-    function logAssert(category, args)
-    {
-        Firebug.Errors.increaseCount(context);
-
-        if (!args || !args.length || args.length == 0)
-            var msg = [FBL.$STR("Assertion")];
-        else
-            var msg = args[0];
-
-        if (Firebug.errorStackTrace)
-        {
-            var trace = Firebug.errorStackTrace;
-            delete Firebug.errorStackTrace;
-            if (FBTrace.DBG_CONSOLE)
-                FBTrace.sysout("logAssert trace from errorStackTrace", trace);
-        }
-        else if (msg.stack)
-        {
-            var trace = parseToStackTrace(msg.stack);
-            if (FBTrace.DBG_CONSOLE)
-                FBTrace.sysout("logAssert trace from msg.stack", trace);
-        }
-        else
-        {
-            var trace = getJSDUserStack();
-            if (FBTrace.DBG_CONSOLE)
-                FBTrace.sysout("logAssert trace from getJSDUserStack", trace);
-        }
-
-        var errorObject = new FBL.ErrorMessage(msg, (msg.fileName?msg.fileName:win.location), (msg.lineNumber?msg.lineNumber:0), "", category, context, trace);
-
-
-        if (trace && trace.frames && trace.frames[0])
-           errorObject.correctWithStackTrace(trace);
-
-        errorObject.resetSource();
-
-        var objects = errorObject;
-        if (args.length > 1)
-        {
-            objects = [errorObject];
-            for (var i = 1; i < args.length; i++)
-                objects.push(args[i]);
-        }
-
-        var row = Firebug.Console.log(objects, context, "errorMessage", null, true); // noThrottle
-        row.scrollIntoView();
-    }
-
-    function getComponentsStackDump()
-    {
-        // Starting with our stack, walk back to the user-level code
-        var frame = Components.stack;
-        var userURL = win.location.href.toString();
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("consoleInjector.getComponentsStackDump initial stack for userURL "+userURL, frame);
-
-        // Drop frames until we get into user code.
-        while (frame && FBL.isSystemURL(frame.filename) )
-            frame = frame.caller;
-
-        // Drop two more frames, the injected console function and firebugAppendConsole()
-        if (frame)
-            frame = frame.caller;
-        if (frame)
-            frame = frame.caller;
-
-        if (FBTrace.DBG_CONSOLE)
-            FBTrace.sysout("consoleInjector.getComponentsStackDump final stack for userURL "+userURL, frame);
-
-        return frame;
-    }
-
-    function getStackLink()
-    {
-        // TODO: xxxpedro console2
-        return;
-        //return FBL.getFrameSourceLink(getComponentsStackDump());
-    }
-
-    function getJSDUserStack()
-    {
-        var trace = FBL.getCurrentStackTrace(context);
-
-        var frames = trace ? trace.frames : null;
-        if (frames && (frames.length > 0) )
-        {
-            var oldest = frames.length - 1;  // 6 - 1 = 5
-            for (var i = 0; i < frames.length; i++)
-            {
-                if (frames[oldest - i].href.indexOf("chrome:") == 0) break;
-                var fn = frames[oldest - i].fn + "";
-                if (fn && (fn.indexOf("_firebugEvalEvent") != -1) ) break;  // command line
-            }
-            FBTrace.sysout("consoleInjector getJSDUserStack: "+frames.length+" oldest: "+oldest+" i: "+i+" i - oldest + 2: "+(i - oldest + 2), trace);
-            trace.frames = trace.frames.slice(2 - i);  // take the oldest frames, leave 2 behind they are injection code
-
-            return trace;
-        }
-        else
-            return "Firebug failed to get stack trace with any frames";
-    }
-};
-
-// ************************************************************************************************
-// Register console namespace
-
-FBL.registerConsole = function()
-{
-    var win = Env.browser.window;
-    Firebug.Console.injector.install(win);
-};
-
-registerConsole();
-
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-
-// ************************************************************************************************
-// Globals
-
-var commandPrefix = ">>>";
-var reOpenBracket = /[\[\(\{]/;
-var reCloseBracket = /[\]\)\}]/;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var commandHistory = [];
-var commandPointer = -1;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var isAutoCompleting = null;
-var autoCompletePrefix = null;
-var autoCompleteExpr = null;
-var autoCompleteBuffer = null;
-var autoCompletePosition = null;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var fbCommandLine = null;
-var fbLargeCommandLine = null;
-var fbLargeCommandButtons = null;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var _completion =
-{
-    window:
-    [
-        "console"
-    ],
-
-    document:
-    [
-        "getElementById",
-        "getElementsByTagName"
-    ]
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var _stack = function(command)
-{
-    Firebug.context.persistedState.commandHistory.push(command);
-    Firebug.context.persistedState.commandPointer =
-        Firebug.context.persistedState.commandHistory.length;
-};
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-// ************************************************************************************************
-// CommandLine
-
-Firebug.CommandLine = extend(Firebug.Module,
-{
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    element: null,
-    isMultiLine: false,
-    isActive: false,
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    initialize: function(doc)
-    {
-        this.clear = bind(this.clear, this);
-        this.enter = bind(this.enter, this);
-
-        this.onError = bind(this.onError, this);
-        this.onKeyDown = bind(this.onKeyDown, this);
-        this.onMultiLineKeyDown = bind(this.onMultiLineKeyDown, this);
-
-        addEvent(Firebug.browser.window, "error", this.onError);
-        addEvent(Firebug.chrome.window, "error", this.onError);
-    },
-
-    shutdown: function(doc)
-    {
-        this.deactivate();
-
-        removeEvent(Firebug.browser.window, "error", this.onError);
-        removeEvent(Firebug.chrome.window, "error", this.onError);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    activate: function(multiLine, hideToggleIcon, onRun)
-    {
-        defineCommandLineAPI();
-
-         Firebug.context.persistedState.commandHistory =
-             Firebug.context.persistedState.commandHistory || [];
-
-         Firebug.context.persistedState.commandPointer =
-             Firebug.context.persistedState.commandPointer || -1;
-
-        if (this.isActive)
-        {
-            if (this.isMultiLine == multiLine) return;
-
-            this.deactivate();
-        }
-
-        fbCommandLine = $("fbCommandLine");
-        fbLargeCommandLine = $("fbLargeCommandLine");
-        fbLargeCommandButtons = $("fbLargeCommandButtons");
-
-        if (multiLine)
-        {
-            onRun = onRun || this.enter;
-
-            this.isMultiLine = true;
-
-            this.element = fbLargeCommandLine;
-
-            addEvent(this.element, "keydown", this.onMultiLineKeyDown);
-
-            addEvent($("fbSmallCommandLineIcon"), "click", Firebug.chrome.hideLargeCommandLine);
-
-            this.runButton = new Button({
-                element: $("fbCommand_btRun"),
-                owner: Firebug.CommandLine,
-                onClick: onRun
-            });
-
-            this.runButton.initialize();
-
-            this.clearButton = new Button({
-                element: $("fbCommand_btClear"),
-                owner: Firebug.CommandLine,
-                onClick: this.clear
-            });
-
-            this.clearButton.initialize();
-        }
-        else
-        {
-            this.isMultiLine = false;
-            this.element = fbCommandLine;
-
-            if (!fbCommandLine)
-                return;
-
-            addEvent(this.element, "keydown", this.onKeyDown);
-        }
-
-        //Firebug.Console.log("activate", this.element);
-
-        if (isOpera)
-          fixOperaTabKey(this.element);
-
-        if(this.lastValue)
-            this.element.value = this.lastValue;
-
-        this.isActive = true;
-    },
-
-    deactivate: function()
-    {
-        if (!this.isActive) return;
-
-        //Firebug.Console.log("deactivate", this.element);
-
-        this.isActive = false;
-
-        this.lastValue = this.element.value;
-
-        if (this.isMultiLine)
-        {
-            removeEvent(this.element, "keydown", this.onMultiLineKeyDown);
-
-            removeEvent($("fbSmallCommandLineIcon"), "click", Firebug.chrome.hideLargeCommandLine);
-
-            this.runButton.destroy();
-            this.clearButton.destroy();
-        }
-        else
-        {
-            removeEvent(this.element, "keydown", this.onKeyDown);
-        }
-
-        this.element = null;
-        delete this.element;
-
-        fbCommandLine = null;
-        fbLargeCommandLine = null;
-        fbLargeCommandButtons = null;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    focus: function()
-    {
-        this.element.focus();
-    },
-
-    blur: function()
-    {
-        this.element.blur();
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    clear: function()
-    {
-        this.element.value = "";
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    evaluate: function(expr)
-    {
-        // TODO: need to register the API in console.firebug.commandLineAPI
-        var api = "Firebug.CommandLine.API";
-
-        var result = Firebug.context.evaluate(expr, "window", api, Firebug.Console.error);
-
-        return result;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    enter: function()
-    {
-        var command = this.element.value;
-
-        if (!command) return;
-
-        _stack(command);
-
-        Firebug.Console.log(commandPrefix + " " + stripNewLines(command),
-                Firebug.browser, "command", FirebugReps.Text);
-
-        var result = this.evaluate(command);
-
-        Firebug.Console.log(result);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    prevCommand: function()
-    {
-        if (Firebug.context.persistedState.commandPointer > 0 &&
-            Firebug.context.persistedState.commandHistory.length > 0)
-        {
-            this.element.value = Firebug.context.persistedState.commandHistory
-                                    [--Firebug.context.persistedState.commandPointer];
-        }
-    },
-
-    nextCommand: function()
-    {
-        var element = this.element;
-
-        var limit = Firebug.context.persistedState.commandHistory.length -1;
-        var i = Firebug.context.persistedState.commandPointer;
-
-        if (i < limit)
-          element.value = Firebug.context.persistedState.commandHistory
-                              [++Firebug.context.persistedState.commandPointer];
-
-        else if (i == limit)
-        {
-            ++Firebug.context.persistedState.commandPointer;
-            element.value = "";
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    autocomplete: function(reverse)
-    {
-        var element = this.element;
-
-        var command = element.value;
-        var offset = getExpressionOffset(command);
-
-        var valBegin = offset ? command.substr(0, offset) : "";
-        var val = command.substr(offset);
-
-        var buffer, obj, objName, commandBegin, result, prefix;
-
-        // if it is the beginning of the completion
-        if(!isAutoCompleting)
-        {
-
-            // group1 - command begin
-            // group2 - base object
-            // group3 - property prefix
-            var reObj = /(.*[^_$\w\d\.])?((?:[_$\w][_$\w\d]*\.)*)([_$\w][_$\w\d]*)?$/;
-            var r = reObj.exec(val);
-
-            // parse command
-            if (r[1] || r[2] || r[3])
-            {
-                commandBegin = r[1] || "";
-                objName = r[2] || "";
-                prefix = r[3] || "";
-            }
-            else if (val == "")
-            {
-                commandBegin = objName = prefix = "";
-            } else
-                return;
-
-            isAutoCompleting = true;
-
-            // find base object
-            if(objName == "")
-                obj = window;
-
-            else
-            {
-                objName = objName.replace(/\.$/, "");
-
-                var n = objName.split(".");
-                var target = window, o;
-
-                for (var i=0, ni; ni = n[i]; i++)
-                {
-                    if (o = target[ni])
-                      target = o;
-
-                    else
-                    {
-                        target = null;
-                        break;
-                    }
-                }
-                obj = target;
-            }
-
-            // map base object
-            if(obj)
-            {
-                autoCompletePrefix = prefix;
-                autoCompleteExpr = valBegin + commandBegin + (objName ? objName + "." : "");
-                autoCompletePosition = -1;
-
-                buffer = autoCompleteBuffer = isIE ?
-                    _completion[objName || "window"] || [] : [];
-
-                for(var p in obj)
-                    buffer.push(p);
-            }
-
-        // if it is the continuation of the last completion
-        } else
-          buffer = autoCompleteBuffer;
-
-        if (buffer)
-        {
-            prefix = autoCompletePrefix;
-
-            var diff = reverse ? -1 : 1;
-
-            for(var i=autoCompletePosition+diff, l=buffer.length, bi; i>=0 && i<l; i+=diff)
-            {
-                bi = buffer[i];
-
-                if (bi.indexOf(prefix) == 0)
-                {
-                    autoCompletePosition = i;
-                    result = bi;
-                    break;
-                }
-            }
-        }
-
-        if (result)
-            element.value = autoCompleteExpr + result;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    setMultiLine: function(multiLine)
-    {
-        if (multiLine == this.isMultiLine) return;
-
-        this.activate(multiLine);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    onError: function(msg, href, lineNo)
-    {
-        href = href || "";
-
-        var lastSlash = href.lastIndexOf("/");
-        var fileName = lastSlash == -1 ? href : href.substr(lastSlash+1);
-        var html = [
-            '<span class="errorMessage">', msg, '</span>',
-            '<div class="objectBox-sourceLink">', fileName, ' (line ', lineNo, ')</div>'
-          ];
-
-        // TODO: xxxpedro ajust to Console2
-        //Firebug.Console.writeRow(html, "error");
-    },
-
-    onKeyDown: function(e)
-    {
-        e = e || event;
-
-        var code = e.keyCode;
-
-        /*tab, shift, control, alt*/
-        if (code != 9 && code != 16 && code != 17 && code != 18)
-        {
-            isAutoCompleting = false;
-        }
-
-        if (code == 13 /* enter */)
-        {
-            this.enter();
-            this.clear();
-        }
-        else if (code == 27 /* ESC */)
-        {
-            setTimeout(this.clear, 0);
-        }
-        else if (code == 38 /* up */)
-        {
-            this.prevCommand();
-        }
-        else if (code == 40 /* down */)
-        {
-            this.nextCommand();
-        }
-        else if (code == 9 /* tab */)
-        {
-            this.autocomplete(e.shiftKey);
-        }
-        else
-            return;
-
-        cancelEvent(e, true);
-        return false;
-    },
-
-    onMultiLineKeyDown: function(e)
-    {
-        e = e || event;
-
-        var code = e.keyCode;
-
-        if (code == 13 /* enter */ && e.ctrlKey)
-        {
-            this.enter();
-        }
-    }
-});
-
-Firebug.registerModule(Firebug.CommandLine);
-
-
-// ************************************************************************************************
-//
-
-function getExpressionOffset(command)
-{
-    // XXXjoe This is kind of a poor-man's JavaScript parser - trying
-    // to find the start of the expression that the cursor is inside.
-    // Not 100% fool proof, but hey...
-
-    var bracketCount = 0;
-
-    var start = command.length-1;
-    for (; start >= 0; --start)
-    {
-        var c = command[start];
-        if ((c == "," || c == ";" || c == " ") && !bracketCount)
-            break;
-        if (reOpenBracket.test(c))
-        {
-            if (bracketCount)
-                --bracketCount;
-            else
-                break;
-        }
-        else if (reCloseBracket.test(c))
-            ++bracketCount;
-    }
-
-    return start + 1;
-}
-
-// ************************************************************************************************
-// CommandLine API
-
-var CommandLineAPI =
-{
-    $: function(id)
-    {
-        return Firebug.browser.document.getElementById(id);
-    },
-
-    $$: function(selector, context)
-    {
-        context = context || Firebug.browser.document;
-        return Firebug.Selector ?
-                Firebug.Selector(selector, context) :
-                Firebug.Console.error("Firebug.Selector module not loaded.");
-    },
-
-    $0: null,
-
-    $1: null,
-
-    dir: function(o)
-    {
-        Firebug.Console.log(o, Firebug.context, "dir", Firebug.DOMPanel.DirTable);
-    },
-
-    dirxml: function(o)
-    {
-        ///if (o instanceof Window)
-        if (instanceOf(o, "Window"))
-            o = o.document.documentElement;
-        ///else if (o instanceof Document)
-        else if (instanceOf(o, "Document"))
-            o = o.documentElement;
-
-        Firebug.Console.log(o, Firebug.context, "dirxml", Firebug.HTMLPanel.SoloElement);
-    }
-};
-
-// ************************************************************************************************
-
-var defineCommandLineAPI = function defineCommandLineAPI()
-{
-    Firebug.CommandLine.API = {};
-    for (var m in CommandLineAPI)
-        if (!Env.browser.window[m])
-            Firebug.CommandLine.API[m] = CommandLineAPI[m];
-
-    var stack = FirebugChrome.htmlSelectionStack;
-    if (stack)
-    {
-        Firebug.CommandLine.API.$0 = stack[0];
-        Firebug.CommandLine.API.$1 = stack[1];
-    }
-};
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-// ************************************************************************************************
-// Globals
-
-var ElementCache = Firebug.Lite.Cache.Element;
-var cacheID = Firebug.Lite.Cache.ID;
-
-var ignoreHTMLProps =
-{
-    // ignores the attributes injected by Sizzle, otherwise it will
-    // be visible on IE (when enumerating element.attributes)
-    sizcache: 1,
-    sizset: 1
-};
-
-if (Firebug.ignoreFirebugElements)
-    // ignores also the cache property injected by firebug
-    ignoreHTMLProps[cacheID] = 1;
-
-
-// ************************************************************************************************
-// HTML Module
-
-Firebug.HTML = extend(Firebug.Module,
-{
-    appendTreeNode: function(nodeArray, html)
-    {
-        var reTrim = /^\s+|\s+$/g;
-
-        if (!nodeArray.length) nodeArray = [nodeArray];
-
-        for (var n=0, node; node=nodeArray[n]; n++)
-        {
-            if (node.nodeType == 1)
-            {
-                if (Firebug.ignoreFirebugElements && node.firebugIgnore) continue;
-
-                var uid = ElementCache(node);
-                var child = node.childNodes;
-                var childLength = child.length;
-
-                var nodeName = node.nodeName.toLowerCase();
-
-                var nodeVisible = isVisible(node);
-
-                var hasSingleTextChild = childLength == 1 && node.firstChild.nodeType == 3 &&
-                        nodeName != "script" && nodeName != "style";
-
-                var nodeControl = !hasSingleTextChild && childLength > 0 ?
-                    ('<div class="nodeControl"></div>') : '';
-
-                // FIXME xxxpedro remove this
-                //var isIE = false;
-
-                if(isIE && nodeControl)
-                    html.push(nodeControl);
-
-                if (typeof uid != 'undefined')
-                    html.push(
-                        '<div class="objectBox-element" ',
-                        'id="', uid,
-                        '">',
-                        !isIE && nodeControl ? nodeControl: "",
-                        '<span ',
-                        cacheID,
-                        '="', uid,
-                        '"  class="nodeBox',
-                        nodeVisible ? "" : " nodeHidden",
-                        '">&lt;<span class="nodeTag">', nodeName, '</span>'
-                    );
-                else
-                    html.push(
-                        '<div class="objectBox-element"><span class="nodeBox',
-                        nodeVisible ? "" : " nodeHidden",
-                        '">&lt;<span class="nodeTag">',
-                        nodeName, '</span>'
-                    );
-
-                for (var i = 0; i < node.attributes.length; ++i)
-                {
-                    var attr = node.attributes[i];
-                    if (!attr.specified ||
-                        // Issue 4432:  Firebug Lite: HTML is mixed-up with functions
-                        // The problem here is that expando properties added to DOM elements in
-                        // IE < 9 will behave like DOM attributes and so they'll show up when
-                        // looking at element.attributes list.
-                        isIE && (browserVersion-0<9) && typeof attr.nodeValue != "string" ||
-                        Firebug.ignoreFirebugElements && ignoreHTMLProps.hasOwnProperty(attr.nodeName))
-                            continue;
-
-                    var name = attr.nodeName.toLowerCase();
-                    var value = name == "style" ? formatStyles(node.style.cssText) : attr.nodeValue;
-
-                    html.push('&nbsp;<span class="nodeName">', name,
-                        '</span>=&quot;<span class="nodeValue">', escapeHTML(value),
-                        '</span>&quot;');
-                }
-
-                /*
-                // source code nodes
-                if (nodeName == 'script' || nodeName == 'style')
-                {
-
-                    if(document.all){
-                        var src = node.innerHTML+'\n';
-
-                    }else {
-                        var src = '\n'+node.innerHTML+'\n';
-                    }
-
-                    var match = src.match(/\n/g);
-                    var num = match ? match.length : 0;
-                    var s = [], sl = 0;
-
-                    for(var c=1; c<num; c++){
-                        s[sl++] = '<div line="'+c+'">' + c + '</div>';
-                    }
-
-                    html.push('&gt;</div><div class="nodeGroup"><div class="nodeChildren"><div class="lineNo">',
-                            s.join(''),
-                            '</div><pre class="nodeCode">',
-                            escapeHTML(src),
-                            '</pre>',
-                            '</div><div class="objectBox-element">&lt;/<span class="nodeTag">',
-                            nodeName,
-                            '</span>&gt;</div>',
-                            '</div>'
-                        );
-
-
-                }/**/
-
-                // Just a single text node child
-                if (hasSingleTextChild)
-                {
-                    var value = child[0].nodeValue.replace(reTrim, '');
-                    if(value)
-                    {
-                        html.push(
-                                '&gt;<span class="nodeText">',
-                                escapeHTML(value),
-                                '</span>&lt;/<span class="nodeTag">',
-                                nodeName,
-                                '</span>&gt;</span></div>'
-                            );
-                    }
-                    else
-                      html.push('/&gt;</span></div>'); // blank text, print as childless node
-
-                }
-                else if (childLength > 0)
-                {
-                    html.push('&gt;</span></div>');
-                }
-                else
-                    html.push('/&gt;</span></div>');
-
-            }
-            else if (node.nodeType == 3)
-            {
-                if ( node.parentNode && ( node.parentNode.nodeName.toLowerCase() == "script" ||
-                     node.parentNode.nodeName.toLowerCase() == "style" ) )
-                {
-                    var value = node.nodeValue.replace(reTrim, '');
-
-                    if(isIE){
-                        var src = value+'\n';
-
-                    }else {
-                        var src = '\n'+value+'\n';
-                    }
-
-                    var match = src.match(/\n/g);
-                    var num = match ? match.length : 0;
-                    var s = [], sl = 0;
-
-                    for(var c=1; c<num; c++){
-                        s[sl++] = '<div line="'+c+'">' + c + '</div>';
-                    }
-
-                    html.push('<div class="lineNo">',
-                            s.join(''),
-                            '</div><pre class="sourceCode">',
-                            escapeHTML(src),
-                            '</pre>'
-                        );
-
-                }
-                else
-                {
-                    var value = node.nodeValue.replace(reTrim, '');
-                    if (value)
-                        html.push('<div class="nodeText">', escapeHTML(value),'</div>');
-                }
-            }
-        }
-    },
-
-    appendTreeChildren: function(treeNode)
-    {
-        var doc = Firebug.chrome.document;
-        var uid = treeNode.id;
-        var parentNode = ElementCache.get(uid);
-
-        if (parentNode.childNodes.length == 0) return;
-
-        var treeNext = treeNode.nextSibling;
-        var treeParent = treeNode.parentNode;
-
-        // FIXME xxxpedro remove this
-        //var isIE = false;
-        var control = isIE ? treeNode.previousSibling : treeNode.firstChild;
-        control.className = 'nodeControl nodeMaximized';
-
-        var html = [];
-        var children = doc.createElement("div");
-        children.className = "nodeChildren";
-        this.appendTreeNode(parentNode.childNodes, html);
-        children.innerHTML = html.join("");
-
-        treeParent.insertBefore(children, treeNext);
-
-        var closeElement = doc.createElement("div");
-        closeElement.className = "objectBox-element";
-        closeElement.innerHTML = '&lt;/<span class="nodeTag">' +
-            parentNode.nodeName.toLowerCase() + '&gt;</span>';
-
-        treeParent.insertBefore(closeElement, treeNext);
-
-    },
-
-    removeTreeChildren: function(treeNode)
-    {
-        var children = treeNode.nextSibling;
-        var closeTag = children.nextSibling;
-
-        // FIXME xxxpedro remove this
-        //var isIE = false;
-        var control = isIE ? treeNode.previousSibling : treeNode.firstChild;
-        control.className = 'nodeControl';
-
-        children.parentNode.removeChild(children);
-        closeTag.parentNode.removeChild(closeTag);
-    },
-
-    isTreeNodeVisible: function(id)
-    {
-        return $(id);
-    },
-
-    select: function(el)
-    {
-        var id = el && ElementCache(el);
-        if (id)
-            this.selectTreeNode(id);
-    },
-
-    selectTreeNode: function(id)
-    {
-        id = ""+id;
-        var node, stack = [];
-        while(id && !this.isTreeNodeVisible(id))
-        {
-            stack.push(id);
-
-            var node = ElementCache.get(id).parentNode;
-
-            if (node)
-                id = ElementCache(node);
-            else
-                break;
-        }
-
-        stack.push(id);
-
-        while(stack.length > 0)
-        {
-            id = stack.pop();
-            node = $(id);
-
-            if (stack.length > 0 && ElementCache.get(id).childNodes.length > 0)
-              this.appendTreeChildren(node);
-        }
-
-        selectElement(node);
-
-        // TODO: xxxpedro
-        if (fbPanel1)
-            fbPanel1.scrollTop = Math.round(node.offsetTop - fbPanel1.clientHeight/2);
-    }
-
-});
-
-Firebug.registerModule(Firebug.HTML);
-
-// ************************************************************************************************
-// HTML Panel
-
-function HTMLPanel(){};
-
-HTMLPanel.prototype = extend(Firebug.Panel,
-{
-    name: "HTML",
-    title: "HTML",
-
-    options: {
-        hasSidePanel: true,
-        //hasToolButtons: true,
-        isPreRendered: !Firebug.flexChromeEnabled /* FIXME xxxpedro chromenew */,
-        innerHTMLSync: true
-    },
-
-    create: function(){
-        Firebug.Panel.create.apply(this, arguments);
-
-        this.panelNode.style.padding = "4px 3px 1px 15px";
-        this.panelNode.style.minWidth = "500px";
-
-        if (Env.Options.enablePersistent || Firebug.chrome.type != "popup")
-            this.createUI();
-
-        if(this.sidePanelBar && !this.sidePanelBar.selectedPanel)
-        {
-            this.sidePanelBar.selectPanel("css");
-        }
-    },
-
-    destroy: function()
-    {
-        selectedElement = null;
-        fbPanel1 = null;
-
-        selectedSidePanelTS = null;
-        selectedSidePanelTimer = null;
-
-        Firebug.Panel.destroy.apply(this, arguments);
-    },
-
-    createUI: function()
-    {
-        var rootNode = Firebug.browser.document.documentElement;
-        var html = [];
-        Firebug.HTML.appendTreeNode(rootNode, html);
-
-        this.panelNode.innerHTML = html.join("");
-    },
-
-    initialize: function()
-    {
-        Firebug.Panel.initialize.apply(this, arguments);
-        addEvent(this.panelNode, 'click', Firebug.HTML.onTreeClick);
-
-        fbPanel1 = $("fbPanel1");
-
-        if(!selectedElement)
-        {
-            Firebug.context.persistedState.selectedHTMLElementId =
-                Firebug.context.persistedState.selectedHTMLElementId &&
-                ElementCache.get(Firebug.context.persistedState.selectedHTMLElementId) ?
-                Firebug.context.persistedState.selectedHTMLElementId :
-                ElementCache(Firebug.browser.document.body);
-
-            Firebug.HTML.selectTreeNode(Firebug.context.persistedState.selectedHTMLElementId);
-        }
-
-        // TODO: xxxpedro
-        addEvent(fbPanel1, 'mousemove', Firebug.HTML.onListMouseMove);
-        addEvent($("fbContent"), 'mouseout', Firebug.HTML.onListMouseMove);
-        addEvent(Firebug.chrome.node, 'mouseout', Firebug.HTML.onListMouseMove);
-    },
-
-    shutdown: function()
-    {
-        // TODO: xxxpedro
-        removeEvent(fbPanel1, 'mousemove', Firebug.HTML.onListMouseMove);
-        removeEvent($("fbContent"), 'mouseout', Firebug.HTML.onListMouseMove);
-        removeEvent(Firebug.chrome.node, 'mouseout', Firebug.HTML.onListMouseMove);
-
-        removeEvent(this.panelNode, 'click', Firebug.HTML.onTreeClick);
-
-        fbPanel1 = null;
-
-        Firebug.Panel.shutdown.apply(this, arguments);
-    },
-
-    reattach: function()
-    {
-        // TODO: panel reattach
-        if(Firebug.context.persistedState.selectedHTMLElementId)
-            Firebug.HTML.selectTreeNode(Firebug.context.persistedState.selectedHTMLElementId);
-    },
-
-    updateSelection: function(object)
-    {
-        var id = ElementCache(object);
-
-        if (id)
-        {
-            Firebug.HTML.selectTreeNode(id);
-        }
-    }
-});
-
-Firebug.registerPanel(HTMLPanel);
-
-// ************************************************************************************************
-
-var formatStyles = function(styles)
-{
-    return isIE ?
-        // IE return CSS property names in upper case, so we need to convert them
-        styles.replace(/([^\s]+)\s*:/g, function(m,g){return g.toLowerCase()+":";}) :
-        // other browsers are just fine
-        styles;
-};
-
-// ************************************************************************************************
-
-var selectedElement = null;
-var fbPanel1 = null;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-var selectedSidePanelTS, selectedSidePanelTimer;
-
-var selectElement= function selectElement(e)
-{
-    if (e != selectedElement)
-    {
-        if (selectedElement)
-            selectedElement.className = "objectBox-element";
-
-        e.className = e.className + " selectedElement";
-
-        if (FBL.isFirefox)
-            e.style.MozBorderRadius = "2px";
-
-        else if (FBL.isSafari)
-            e.style.WebkitBorderRadius = "2px";
-
-        e.style.borderRadius = "2px";
-
-        selectedElement = e;
-
-        Firebug.context.persistedState.selectedHTMLElementId = e.id;
-
-        var target = ElementCache.get(e.id);
-        var sidePanelBar = Firebug.chrome.getPanel("HTML").sidePanelBar;
-        var selectedSidePanel = sidePanelBar ? sidePanelBar.selectedPanel : null;
-
-        var stack = FirebugChrome.htmlSelectionStack;
-
-        stack.unshift(target);
-
-        if (stack.length > 2)
-            stack.pop();
-
-        var lazySelect = function()
-        {
-            selectedSidePanelTS = new Date().getTime();
-
-            if (selectedSidePanel)
-                selectedSidePanel.select(target, true);
-        };
-
-        if (selectedSidePanelTimer)
-        {
-            clearTimeout(selectedSidePanelTimer);
-            selectedSidePanelTimer = null;
-        }
-
-        if (new Date().getTime() - selectedSidePanelTS > 100)
-            setTimeout(lazySelect, 0);
-        else
-            selectedSidePanelTimer = setTimeout(lazySelect, 150);
-    }
-};
-
-
-// ************************************************************************************************
-// ***  TODO:  REFACTOR  **************************************************************************
-// ************************************************************************************************
-Firebug.HTML.onTreeClick = function (e)
-{
-    e = e || event;
-    var targ;
-
-    if (e.target) targ = e.target;
-    else if (e.srcElement) targ = e.srcElement;
-    if (targ.nodeType == 3) // defeat Safari bug
-        targ = targ.parentNode;
-
-
-    if (targ.className.indexOf('nodeControl') != -1 || targ.className == 'nodeTag')
-    {
-        // FIXME xxxpedro remove this
-        //var isIE = false;
-
-        if(targ.className == 'nodeTag')
-        {
-            var control = isIE ? (targ.parentNode.previousSibling || targ) :
-                          (targ.parentNode.previousSibling || targ);
-
-            selectElement(targ.parentNode.parentNode);
-
-            if (control.className.indexOf('nodeControl') == -1)
-                return;
-
-        } else
-            control = targ;
-
-        FBL.cancelEvent(e);
-
-        var treeNode = isIE ? control.nextSibling : control.parentNode;
-
-        //FBL.Firebug.Console.log(treeNode);
-
-        if (control.className.indexOf(' nodeMaximized') != -1) {
-            FBL.Firebug.HTML.removeTreeChildren(treeNode);
-        } else {
-            FBL.Firebug.HTML.appendTreeChildren(treeNode);
-        }
-    }
-    else if (targ.className == 'nodeValue' || targ.className == 'nodeName')
-    {
-        /*
-        var input = FBL.Firebug.chrome.document.getElementById('treeInput');
-
-        input.style.display = "block";
-        input.style.left = targ.offsetLeft + 'px';
-        input.style.top = FBL.topHeight + targ.offsetTop - FBL.fbPanel1.scrollTop + 'px';
-        input.style.width = targ.offsetWidth + 6 + 'px';
-        input.value = targ.textContent || targ.innerText;
-        input.focus();
-        /**/
-    }
-};
-
-function onListMouseOut(e)
-{
-    e = e || event || window;
-    var targ;
-
-    if (e.target) targ = e.target;
-    else if (e.srcElement) targ = e.srcElement;
-    if (targ.nodeType == 3) // defeat Safari bug
-      targ = targ.parentNode;
-
-      if (hasClass(targ, "fbPanel")) {
-          FBL.Firebug.Inspector.hideBoxModel();
-          hoverElement = null;
-      }
-};
-
-var hoverElement = null;
-var hoverElementTS = 0;
-
-Firebug.HTML.onListMouseMove = function onListMouseMove(e)
-{
-    try
-    {
-        e = e || event || window;
-        var targ;
-
-        if (e.target) targ = e.target;
-        else if (e.srcElement) targ = e.srcElement;
-        if (targ.nodeType == 3) // defeat Safari bug
-            targ = targ.parentNode;
-
-        var found = false;
-        while (targ && !found) {
-            if (!/\snodeBox\s|\sobjectBox-selector\s/.test(" " + targ.className + " "))
-                targ = targ.parentNode;
-            else
-                found = true;
-        }
-
-        if (!targ)
-        {
-            FBL.Firebug.Inspector.hideBoxModel();
-            hoverElement = null;
-            return;
-        }
-
-        /*
-        if (typeof targ.attributes[cacheID] == 'undefined') return;
-
-        var uid = targ.attributes[cacheID];
-        if (!uid) return;
-        /**/
-
-        if (typeof targ.attributes[cacheID] == 'undefined') return;
-
-        var uid = targ.attributes[cacheID];
-        if (!uid) return;
-
-        var el = ElementCache.get(uid.value);
-
-        var nodeName = el.nodeName.toLowerCase();
-
-        if (FBL.isIE && " meta title script link ".indexOf(" "+nodeName+" ") != -1)
-            return;
-
-        if (!/\snodeBox\s|\sobjectBox-selector\s/.test(" " + targ.className + " ")) return;
-
-        if (el.id == "FirebugUI" || " html head body br script link iframe ".indexOf(" "+nodeName+" ") != -1) {
-            FBL.Firebug.Inspector.hideBoxModel();
-            hoverElement = null;
-            return;
-        }
-
-        if ((new Date().getTime() - hoverElementTS > 40) && hoverElement != el) {
-            hoverElementTS = new Date().getTime();
-            hoverElement = el;
-            FBL.Firebug.Inspector.drawBoxModel(el);
-        }
-    }
-    catch(E)
-    {
-    }
-};
-
-
-// ************************************************************************************************
-
-Firebug.Reps = {
-
-    appendText: function(object, html)
-    {
-        html.push(escapeHTML(objectToString(object)));
-    },
-
-    appendNull: function(object, html)
-    {
-        html.push('<span class="objectBox-null">', escapeHTML(objectToString(object)), '</span>');
-    },
-
-    appendString: function(object, html)
-    {
-        html.push('<span class="objectBox-string">&quot;', escapeHTML(objectToString(object)),
-            '&quot;</span>');
-    },
-
-    appendInteger: function(object, html)
-    {
-        html.push('<span class="objectBox-number">', escapeHTML(objectToString(object)), '</span>');
-    },
-
-    appendFloat: function(object, html)
-    {
-        html.push('<span class="objectBox-number">', escapeHTML(objectToString(object)), '</span>');
-    },
-
-    appendFunction: function(object, html)
-    {
-        var reName = /function ?(.*?)\(/;
-        var m = reName.exec(objectToString(object));
-        var name = m && m[1] ? m[1] : "function";
-        html.push('<span class="objectBox-function">', escapeHTML(name), '()</span>');
-    },
-
-    appendObject: function(object, html)
-    {
-        /*
-        var rep = Firebug.getRep(object);
-        var outputs = [];
-
-        rep.tag.tag.compile();
-
-        var str = rep.tag.renderHTML({object: object}, outputs);
-        html.push(str);
-        /**/
-
-        try
-        {
-            if (object == undefined)
-                this.appendNull("undefined", html);
-            else if (object == null)
-                this.appendNull("null", html);
-            else if (typeof object == "string")
-                this.appendString(object, html);
-            else if (typeof object == "number")
-                this.appendInteger(object, html);
-            else if (typeof object == "boolean")
-                this.appendInteger(object, html);
-            else if (typeof object == "function")
-                this.appendFunction(object, html);
-            else if (object.nodeType == 1)
-                this.appendSelector(object, html);
-            else if (typeof object == "object")
-            {
-                if (typeof object.length != "undefined")
-                    this.appendArray(object, html);
-                else
-                    this.appendObjectFormatted(object, html);
-            }
-            else
-                this.appendText(object, html);
-        }
-        catch (exc)
-        {
-        }
-        /**/
-    },
-
-    appendObjectFormatted: function(object, html)
-    {
-        var text = objectToString(object);
-        var reObject = /\[object (.*?)\]/;
-
-        var m = reObject.exec(text);
-        html.push('<span class="objectBox-object">', m ? m[1] : text, '</span>');
-    },
-
-    appendSelector: function(object, html)
-    {
-        var uid = ElementCache(object);
-        var uidString = uid ? [cacheID, '="', uid, '"'].join("") : "";
-
-        html.push('<span class="objectBox-selector"', uidString, '>');
-
-        html.push('<span class="selectorTag">', escapeHTML(object.nodeName.toLowerCase()), '</span>');
-        if (object.id)
-            html.push('<span class="selectorId">#', escapeHTML(object.id), '</span>');
-        if (object.className)
-            html.push('<span class="selectorClass">.', escapeHTML(object.className), '</span>');
-
-        html.push('</span>');
-    },
-
-    appendNode: function(node, html)
-    {
-        if (node.nodeType == 1)
-        {
-            var uid = ElementCache(node);
-            var uidString = uid ? [cacheID, '="', uid, '"'].join("") : "";
-
-            html.push(
-                '<div class="objectBox-element"', uidString, '">',
-                '<span ', cacheID, '="', uid, '" class="nodeBox">',
-                '&lt;<span class="nodeTag">', node.nodeName.toLowerCase(), '</span>');
-
-            for (var i = 0; i < node.attributes.length; ++i)
-            {
-                var attr = node.attributes[i];
-                if (!attr.specified || attr.nodeName == cacheID)
-                    continue;
-
-                var name = attr.nodeName.toLowerCase();
-                var value = name == "style" ? node.style.cssText : attr.nodeValue;
-
-                html.push('&nbsp;<span class="nodeName">', name,
-                    '</span>=&quot;<span class="nodeValue">', escapeHTML(value),
-                    '</span>&quot;');
-            }
-
-            if (node.firstChild)
-            {
-                html.push('&gt;</div><div class="nodeChildren">');
-
-                for (var child = node.firstChild; child; child = child.nextSibling)
-                    this.appendNode(child, html);
-
-                html.push('</div><div class="objectBox-element">&lt;/<span class="nodeTag">',
-                    node.nodeName.toLowerCase(), '&gt;</span></span></div>');
-            }
-            else
-                html.push('/&gt;</span></div>');
-        }
-        else if (node.nodeType == 3)
-        {
-            var value = trim(node.nodeValue);
-            if (value)
-                html.push('<div class="nodeText">', escapeHTML(value),'</div>');
-        }
-    },
-
-    appendArray: function(object, html)
-    {
-        html.push('<span class="objectBox-array"><b>[</b> ');
-
-        for (var i = 0, l = object.length, obj; i < l; ++i)
-        {
-            this.appendObject(object[i], html);
-
-            if (i < l-1)
-            html.push(', ');
-        }
-
-        html.push(' <b>]</b></span>');
-    }
-
-};
-
-
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-/*
-
-Hack:
-Firebug.chrome.currentPanel = Firebug.chrome.selectedPanel;
-Firebug.showInfoTips = true;
-Firebug.InfoTip.initializeBrowser(Firebug.chrome);
-
-/**/
-
-FBL.ns(function() { with (FBL) {
-
-// ************************************************************************************************
-// Constants
-
-var maxWidth = 100, maxHeight = 80;
-var infoTipMargin = 10;
-var infoTipWindowPadding = 25;
-
-// ************************************************************************************************
-
-Firebug.InfoTip = extend(Firebug.Module,
-{
-    dispatchName: "infoTip",
-    tags: domplate(
-    {
-        infoTipTag: DIV({"class": "infoTip"}),
-
-        colorTag:
-            DIV({style: "background: $rgbValue; width: 100px; height: 40px"}, "&nbsp;"),
-
-        imgTag:
-            DIV({"class": "infoTipImageBox infoTipLoading"},
-                IMG({"class": "infoTipImage", src: "$urlValue", repeat: "$repeat",
-                    onload: "$onLoadImage"}),
-                IMG({"class": "infoTipBgImage", collapsed: true, src: "blank.gif"}),
-                DIV({"class": "infoTipCaption"})
-            ),
-
-        onLoadImage: function(event)
-        {
-            var img = event.currentTarget || event.srcElement;
-            ///var bgImg = img.nextSibling;
-            ///if (!bgImg)
-            ///    return; // Sometimes gets called after element is dead
-
-            ///var caption = bgImg.nextSibling;
-            var innerBox = img.parentNode;
-
-            /// TODO: xxxpedro infoTip hack
-            var caption = getElementByClass(innerBox, "infoTipCaption");
-            var bgImg = getElementByClass(innerBox, "infoTipBgImage");
-            if (!bgImg)
-                return; // Sometimes gets called after element is dead
-
-            // TODO: xxxpedro infoTip IE and timing issue
-            // TODO: use offline document to avoid flickering
-            if (isIE)
-                removeClass(innerBox, "infoTipLoading");
-
-            var updateInfoTip = function(){
-
-            var w = img.naturalWidth || img.width || 10,
-                h = img.naturalHeight || img.height || 10;
-
-            var repeat = img.getAttribute("repeat");
-
-            if (repeat == "repeat-x" || (w == 1 && h > 1))
-            {
-                collapse(img, true);
-                collapse(bgImg, false);
-                bgImg.style.background = "url(" + img.src + ") repeat-x";
-                bgImg.style.width = maxWidth + "px";
-                if (h > maxHeight)
-                    bgImg.style.height = maxHeight + "px";
-                else
-                    bgImg.style.height = h + "px";
-            }
-            else if (repeat == "repeat-y" || (h == 1 && w > 1))
-            {
-                collapse(img, true);
-                collapse(bgImg, false);
-                bgImg.style.background = "url(" + img.src + ") repeat-y";
-                bgImg.style.height = maxHeight + "px";
-                if (w > maxWidth)
-                    bgImg.style.width = maxWidth + "px";
-                else
-                    bgImg.style.width = w + "px";
-            }
-            else if (repeat == "repeat" || (w == 1 && h == 1))
-            {
-                collapse(img, true);
-                collapse(bgImg, false);
-                bgImg.style.background = "url(" + img.src + ") repeat";
-                bgImg.style.width = maxWidth + "px";
-                bgImg.style.height = maxHeight + "px";
-            }
-            else
-            {
-                if (w > maxWidth || h > maxHeight)
-                {
-                    if (w > h)
-                    {
-                        img.style.width = maxWidth + "px";
-                        img.style.height = Math.round((h / w) * maxWidth) + "px";
-                    }
-                    else
-                    {
-                        img.style.width = Math.round((w / h) * maxHeight) + "px";
-                        img.style.height = maxHeight + "px";
-                    }
-                }
-            }
-
-            //caption.innerHTML = $STRF("Dimensions", [w, h]);
-            caption.innerHTML = $STRF(w + " x " + h);
-
-
-            };
-
-            if (isIE)
-                setTimeout(updateInfoTip, 0);
-            else
-            {
-                updateInfoTip();
-                removeClass(innerBox, "infoTipLoading");
-            }
-
-            ///
-        }
-
-        /*
-        /// onLoadImage original
-        onLoadImage: function(event)
-        {
-            var img = event.currentTarget;
-            var bgImg = img.nextSibling;
-            if (!bgImg)
-                return; // Sometimes gets called after element is dead
-
-            var caption = bgImg.nextSibling;
-            var innerBox = img.parentNode;
-
-            var w = img.naturalWidth, h = img.naturalHeight;
-            var repeat = img.getAttribute("repeat");
-
-            if (repeat == "repeat-x" || (w == 1 && h > 1))
-            {
-                collapse(img, true);
-                collapse(bgImg, false);
-                bgImg.style.background = "url(" + img.src + ") repeat-x";
-                bgImg.style.width = maxWidth + "px";
-                if (h > maxHeight)
-                    bgImg.style.height = maxHeight + "px";
-                else
-                    bgImg.style.height = h + "px";
-            }
-            else if (repeat == "repeat-y" || (h == 1 && w > 1))
-            {
-                collapse(img, true);
-                collapse(bgImg, false);
-                bgImg.style.background = "url(" + img.src + ") repeat-y";
-                bgImg.style.height = maxHeight + "px";
-                if (w > maxWidth)
-                    bgImg.style.width = maxWidth + "px";
-                else
-                    bgImg.style.width = w + "px";
-            }
-            else if (repeat == "repeat" || (w == 1 && h == 1))
-            {
-                collapse(img, true);
-                collapse(bgImg, false);
-                bgImg.style.background = "url(" + img.src + ") repeat";
-                bgImg.style.width = maxWidth + "px";
-                bgImg.style.height = maxHeight + "px";
-            }
-            else
-            {
-                if (w > maxWidth || h > maxHeight)
-                {
-                    if (w > h)
-                    {
-                        img.style.width = maxWidth + "px";
-                        img.style.height = Math.round((h / w) * maxWidth) + "px";
-                    }
-                    else
-                    {
-                        img.style.width = Math.round((w / h) * maxHeight) + "px";
-                        img.style.height = maxHeight + "px";
-                    }
-                }
-            }
-
-            caption.innerHTML = $STRF("Dimensions", [w, h]);
-
-            removeClass(innerBox, "infoTipLoading");
-        }
-        /**/
-
-    }),
-
-    initializeBrowser: function(browser)
-    {
-        browser.onInfoTipMouseOut = bind(this.onMouseOut, this, browser);
-        browser.onInfoTipMouseMove = bind(this.onMouseMove, this, browser);
-
-        ///var doc = browser.contentDocument;
-        var doc = browser.document;
-        if (!doc)
-            return;
-
-        ///doc.addEventListener("mouseover", browser.onInfoTipMouseMove, true);
-        ///doc.addEventListener("mouseout", browser.onInfoTipMouseOut, true);
-        ///doc.addEventListener("mousemove", browser.onInfoTipMouseMove, true);
-        addEvent(doc, "mouseover", browser.onInfoTipMouseMove);
-        addEvent(doc, "mouseout", browser.onInfoTipMouseOut);
-        addEvent(doc, "mousemove", browser.onInfoTipMouseMove);
-
-        return browser.infoTip = this.tags.infoTipTag.append({}, getBody(doc));
-    },
-
-    uninitializeBrowser: function(browser)
-    {
-        if (browser.infoTip)
-        {
-            ///var doc = browser.contentDocument;
-            var doc = browser.document;
-            ///doc.removeEventListener("mouseover", browser.onInfoTipMouseMove, true);
-            ///doc.removeEventListener("mouseout", browser.onInfoTipMouseOut, true);
-            ///doc.removeEventListener("mousemove", browser.onInfoTipMouseMove, true);
-            removeEvent(doc, "mouseover", browser.onInfoTipMouseMove);
-            removeEvent(doc, "mouseout", browser.onInfoTipMouseOut);
-            removeEvent(doc, "mousemove", browser.onInfoTipMouseMove);
-
-            browser.infoTip.parentNode.removeChild(browser.infoTip);
-            delete browser.infoTip;
-            delete browser.onInfoTipMouseMove;
-        }
-    },
-
-    showInfoTip: function(infoTip, panel, target, x, y, rangeParent, rangeOffset)
-    {
-        if (!Firebug.showInfoTips)
-            return;
-
-        var scrollParent = getOverflowParent(target);
-        var scrollX = x + (scrollParent ? scrollParent.scrollLeft : 0);
-
-        if (panel.showInfoTip(infoTip, target, scrollX, y, rangeParent, rangeOffset))
-        {
-            var htmlElt = infoTip.ownerDocument.documentElement;
-            var panelWidth = htmlElt.clientWidth;
-            var panelHeight = htmlElt.clientHeight;
-
-            if (x+infoTip.offsetWidth+infoTipMargin > panelWidth)
-            {
-                infoTip.style.left = Math.max(0, panelWidth-(infoTip.offsetWidth+infoTipMargin)) + "px";
-                infoTip.style.right = "auto";
-            }
-            else
-            {
-                infoTip.style.left = (x+infoTipMargin) + "px";
-                infoTip.style.right = "auto";
-            }
-
-            if (y+infoTip.offsetHeight+infoTipMargin > panelHeight)
-            {
-                infoTip.style.top = Math.max(0, panelHeight-(infoTip.offsetHeight+infoTipMargin)) + "px";
-                infoTip.style.bottom = "auto";
-            }
-            else
-            {
-                infoTip.style.top = (y+infoTipMargin) + "px";
-                infoTip.style.bottom = "auto";
-            }
-
-            if (FBTrace.DBG_INFOTIP)
-                FBTrace.sysout("infotip.showInfoTip; top: " + infoTip.style.top +
-                    ", left: " + infoTip.style.left + ", bottom: " + infoTip.style.bottom +
-                    ", right:" + infoTip.style.right + ", offsetHeight: " + infoTip.offsetHeight +
-                    ", offsetWidth: " + infoTip.offsetWidth +
-                    ", x: " + x + ", panelWidth: " + panelWidth +
-                    ", y: " + y + ", panelHeight: " + panelHeight);
-
-            infoTip.setAttribute("active", "true");
-        }
-        else
-            this.hideInfoTip(infoTip);
-    },
-
-    hideInfoTip: function(infoTip)
-    {
-        if (infoTip)
-            infoTip.removeAttribute("active");
-    },
-
-    onMouseOut: function(event, browser)
-    {
-        if (!event.relatedTarget)
-            this.hideInfoTip(browser.infoTip);
-    },
-
-    onMouseMove: function(event, browser)
-    {
-        // Ignore if the mouse is moving over the existing info tip.
-        if (getAncestorByClass(event.target, "infoTip"))
-            return;
-
-        if (browser.currentPanel)
-        {
-            var x = event.clientX, y = event.clientY, target = event.target || event.srcElement;
-            this.showInfoTip(browser.infoTip, browser.currentPanel, target, x, y, event.rangeParent, event.rangeOffset);
-        }
-        else
-            this.hideInfoTip(browser.infoTip);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    populateColorInfoTip: function(infoTip, color)
-    {
-        this.tags.colorTag.replace({rgbValue: color}, infoTip);
-        return true;
-    },
-
-    populateImageInfoTip: function(infoTip, url, repeat)
-    {
-        if (!repeat)
-            repeat = "no-repeat";
-
-        this.tags.imgTag.replace({urlValue: url, repeat: repeat}, infoTip);
-
-        return true;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends Module
-
-    disable: function()
-    {
-        // XXXjoe For each browser, call uninitializeBrowser
-    },
-
-    showPanel: function(browser, panel)
-    {
-        if (panel)
-        {
-            var infoTip = panel.panelBrowser.infoTip;
-            if (!infoTip)
-                infoTip = this.initializeBrowser(panel.panelBrowser);
-            this.hideInfoTip(infoTip);
-        }
-
-    },
-
-    showSidePanel: function(browser, panel)
-    {
-        this.showPanel(browser, panel);
-    }
-});
-
-// ************************************************************************************************
-
-Firebug.registerModule(Firebug.InfoTip);
-
-// ************************************************************************************************
-
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-var CssParser = null;
-
-// ************************************************************************************************
-
-// Simple CSS stylesheet parser from:
-// https://github.com/sergeche/webkit-css
-
-/**
- * Simple CSS stylesheet parser that remembers rule's lines in file
- * @author Sergey Chikuyonok (serge.che@gmail.com)
- * @link http://chikuyonok.ru
- */
-CssParser = (function(){
-    /**
-     * Returns rule object
-     * @param {Number} start Character index where CSS rule definition starts
-     * @param {Number} body_start Character index where CSS rule's body starts
-     * @param {Number} end Character index where CSS rule definition ends
-     */
-    function rule(start, body_start, end) {
-        return {
-            start: start || 0,
-            body_start: body_start || 0,
-            end: end || 0,
-            line: -1,
-            selector: null,
-            parent: null,
-
-            /** @type {rule[]} */
-            children: [],
-
-            addChild: function(start, body_start, end) {
-                var r = rule(start, body_start, end);
-                r.parent = this;
-                this.children.push(r);
-                return r;
-            },
-            /**
-             * Returns last child element
-             * @return {rule}
-             */
-            lastChild: function() {
-                return this.children[this.children.length - 1];
-            }
-        };
-    }
-
-    /**
-     * Replaces all occurances of substring defined by regexp
-     * @param {String} str
-     * @return {RegExp} re
-     * @return {String}
-     */
-    function removeAll(str, re) {
-        var m;
-        while (m = str.match(re)) {
-            str = str.substring(m[0].length);
-        }
-
-        return str;
-    }
-
-    /**
-     * Trims whitespace from the beginning and the end of string
-     * @param {String} str
-     * @return {String}
-     */
-    function trim(str) {
-        return str.replace(/^\s+|\s+$/g, '');
-    }
-
-    /**
-     * Normalizes CSS rules selector
-     * @param {String} selector
-     */
-    function normalizeSelector(selector) {
-        // remove newlines
-        selector = selector.replace(/[\n\r]/g, ' ');
-
-        selector = trim(selector);
-
-        // remove spaces after commas
-        selector = selector.replace(/\s*,\s*/g, ',');
-
-        return selector;
-    }
-
-    /**
-     * Preprocesses parsed rules: adjusts char indexes, skipping whitespace and
-     * newlines, saves rule selector, removes comments, etc.
-     * @param {String} text CSS stylesheet
-     * @param {rule} rule_node CSS rule node
-     * @return {rule[]}
-     */
-    function preprocessRules(text, rule_node) {
-        for (var i = 0, il = rule_node.children.length; i < il; i++) {
-            var r = rule_node.children[i],
-                rule_start = text.substring(r.start, r.body_start),
-                cur_len = rule_start.length;
-
-            // remove newlines for better regexp matching
-            rule_start = rule_start.replace(/[\n\r]/g, ' ');
-
-            // remove @import rules
-//            rule_start = removeAll(rule_start, /^\s*@import\s*url\((['"])?.+?\1?\)\;?/g);
-
-            // remove comments
-            rule_start = removeAll(rule_start, /^\s*\/\*.*?\*\/[\s\t]*/);
-
-            // remove whitespace
-            rule_start = rule_start.replace(/^[\s\t]+/, '');
-
-            r.start += (cur_len - rule_start.length);
-            r.selector = normalizeSelector(rule_start);
-        }
-
-        return rule_node;
-    }
-
-    /**
-     * Saves all lise starting indexes for faster search
-     * @param {String} text CSS stylesheet
-     * @return {Number[]}
-     */
-    function saveLineIndexes(text) {
-        var result = [0],
-            i = 0,
-            il = text.length,
-            ch, ch2;
-
-        while (i < il) {
-            ch = text.charAt(i);
-
-            if (ch == '\n' || ch == '\r') {
-                if (ch == '\r' && i < il - 1 && text.charAt(i + 1) == '\n') {
-                    // windows line ending: CRLF. Skip next character
-                    i++;
-                }
-
-                result.push(i + 1);
-            }
-
-            i++;
-        }
-
-        return result;
-    }
-
-    /**
-     * Saves line number for parsed rules
-     * @param {String} text CSS stylesheet
-     * @param {rule} rule_node Rule node
-     * @return {rule[]}
-     */
-    function saveLineNumbers(text, rule_node, line_indexes, startLine) {
-        preprocessRules(text, rule_node);
-
-        startLine = startLine || 0;
-
-        // remember lines start indexes, preserving line ending characters
-        if (!line_indexes)
-            var line_indexes = saveLineIndexes(text);
-
-        // now find each rule's line
-        for (var i = 0, il = rule_node.children.length; i < il; i++) {
-            var r = rule_node.children[i];
-            r.line = line_indexes.length + startLine;
-            for (var j = 0, jl = line_indexes.length - 1; j < jl; j++) {
-                var line_ix = line_indexes[j];
-                if (r.start >=  line_indexes[j] && r.start <  line_indexes[j + 1]) {
-                    r.line = j + 1 + startLine;
-                    break;
-                }
-            }
-
-            saveLineNumbers(text, r, line_indexes);
-        }
-
-        return rule_node;
-    }
-
-    return {
-        /**
-         * Parses text as CSS stylesheet, remembring each rule position inside
-         * text
-         * @param {String} text CSS stylesheet to parse
-         */
-        read: function(text, startLine) {
-            var rule_start = [],
-                rule_body_start = [],
-                rules = [],
-                in_comment = 0,
-                root = rule(),
-                cur_parent = root,
-                last_rule = null,
-                stack = [],
-                ch, ch2;
-
-            stack.last = function() {
-                return this[this.length - 1];
-            };
-
-            function hasStr(pos, substr) {
-                return text.substr(pos, substr.length) == substr;
-            }
-
-            for (var i = 0, il = text.length; i < il; i++) {
-                ch = text.charAt(i);
-                ch2 = i < il - 1 ? text.charAt(i + 1) : '';
-
-                if (!rule_start.length)
-                    rule_start.push(i);
-
-                switch (ch) {
-                    case '@':
-                        if (!in_comment) {
-                            if (hasStr(i, '@import')) {
-                                var m = text.substr(i).match(/^@import\s*url\((['"])?.+?\1?\)\;?/);
-                                if (m) {
-                                    cur_parent.addChild(i, i + 7, i + m[0].length);
-                                    i += m[0].length;
-                                    rule_start.pop();
-                                }
-                                break;
-                            }
-                        }
-                    case '/':
-                        // xxxpedro allowing comment inside comment
-                        if (!in_comment && ch2 == '*') { // comment start
-                            in_comment++;
-                        }
-                        break;
-
-                    case '*':
-                        if (ch2 == '/') { // comment end
-                            in_comment--;
-                        }
-                        break;
-
-                    case '{':
-                        if (!in_comment) {
-                            rule_body_start.push(i);
-
-                            cur_parent = cur_parent.addChild(rule_start.pop());
-                            stack.push(cur_parent);
-                        }
-                        break;
-
-                    case '}':
-                        // found the end of the rule
-                        if (!in_comment) {
-                            /** @type {rule} */
-                            var last_rule = stack.pop();
-                            rule_start.pop();
-                            last_rule.body_start = rule_body_start.pop();
-                            last_rule.end = i;
-                            cur_parent = last_rule.parent || root;
-                        }
-                        break;
-                }
-
-            }
-
-            return saveLineNumbers(text, root, null, startLine);
-        },
-
-        normalizeSelector: normalizeSelector,
-
-        /**
-         * Find matched rule by selector.
-         * @param {rule} rule_node Parsed rule node
-         * @param {String} selector CSS selector
-         * @param {String} source CSS stylesheet source code
-         *
-         * @return {rule[]|null} Array of matched rules, sorted by priority (most
-         * recent on top)
-         */
-        findBySelector: function(rule_node, selector, source) {
-            var selector = normalizeSelector(selector),
-                result = [];
-
-            if (rule_node) {
-                for (var i = 0, il = rule_node.children.length; i < il; i++) {
-                    /** @type {rule} */
-                    var r = rule_node.children[i];
-                    if (r.selector == selector) {
-                        result.push(r);
-                    }
-                }
-            }
-
-            if (result.length) {
-                return result;
-            } else {
-                return null;
-            }
-        }
-    };
-})();
-
-
-// ************************************************************************************************
-
-FBL.CssParser = CssParser;
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-
-// ************************************************************************************************
-// StyleSheet Parser
-
-var CssAnalyzer = {};
-
-// ************************************************************************************************
-// Locals
-
-var CSSRuleMap = {};
-var ElementCSSRulesMap = {};
-
-var internalStyleSheetIndex = -1;
-
-var reSelectorTag = /(^|\s)(?:\w+)/g;
-var reSelectorClass = /\.[\w\d_-]+/g;
-var reSelectorId = /#[\w\d_-]+/g;
-
-var globalCSSRuleIndex;
-
-var processAllStyleSheetsTimeout = null;
-
-var externalStyleSheetURLs = [];
-
-var ElementCache = Firebug.Lite.Cache.Element;
-var StyleSheetCache = Firebug.Lite.Cache.StyleSheet;
-
-//************************************************************************************************
-// CSS Analyzer templates
-
-CssAnalyzer.externalStyleSheetWarning = domplate(Firebug.Rep,
-{
-    tag:
-        DIV({"class": "warning focusRow", style: "font-weight:normal;", role: 'listitem'},
-            SPAN("$object|STR"),
-            A({"href": "$href", target:"_blank"}, "$link|STR")
-        )
-});
-
-// ************************************************************************************************
-// CSS Analyzer methods
-
-CssAnalyzer.processAllStyleSheets = function(doc, styleSheetIterator)
-{
-    try
-    {
-        processAllStyleSheets(doc, styleSheetIterator);
-    }
-    catch(e)
-    {
-        // TODO: FBTrace condition
-        FBTrace.sysout("CssAnalyzer.processAllStyleSheets fails: ", e);
-    }
-};
-
-/**
- *
- * @param element
- * @returns {String[]} Array of IDs of CSS Rules
- */
-CssAnalyzer.getElementCSSRules = function(element)
-{
-    try
-    {
-        return getElementCSSRules(element);
-    }
-    catch(e)
-    {
-        // TODO: FBTrace condition
-        FBTrace.sysout("CssAnalyzer.getElementCSSRules fails: ", e);
-    }
-};
-
-CssAnalyzer.getRuleData = function(ruleId)
-{
-    return CSSRuleMap[ruleId];
-};
-
-// TODO: do we need this?
-CssAnalyzer.getRuleLine = function()
-{
-};
-
-CssAnalyzer.hasExternalStyleSheet = function()
-{
-    return externalStyleSheetURLs.length > 0;
-};
-
-CssAnalyzer.parseStyleSheet = function(href)
-{
-    var sourceData = extractSourceData(href);
-    var parsedObj = CssParser.read(sourceData.source, sourceData.startLine);
-    var parsedRules = parsedObj.children;
-
-    // See: Issue 4776: [Firebug lite] CSS Media Types
-    //
-    // Ignore all special selectors like @media and @page
-    for(var i=0; i < parsedRules.length; )
-    {
-        if (parsedRules[i].selector.indexOf("@") != -1)
-        {
-            parsedRules.splice(i, 1);
-        }
-        else
-            i++;
-    }
-
-    return parsedRules;
-};
-
-//************************************************************************************************
-// Internals
-//************************************************************************************************
-
-// ************************************************************************************************
-// StyleSheet processing
-
-var processAllStyleSheets = function(doc, styleSheetIterator)
-{
-    styleSheetIterator = styleSheetIterator || processStyleSheet;
-
-    globalCSSRuleIndex = -1;
-
-    var styleSheets = doc.styleSheets;
-    var importedStyleSheets = [];
-
-    if (FBTrace.DBG_CSS)
-        var start = new Date().getTime();
-
-    for(var i=0, length=styleSheets.length; i<length; i++)
-    {
-        try
-        {
-            var styleSheet = styleSheets[i];
-
-            if ("firebugIgnore" in styleSheet) continue;
-
-            // we must read the length to make sure we have permission to read
-            // the stylesheet's content. If an error occurs here, we cannot
-            // read the stylesheet due to access restriction policy
-            var rules = isIE ? styleSheet.rules : styleSheet.cssRules;
-            rules.length;
-        }
-        catch(e)
-        {
-            externalStyleSheetURLs.push(styleSheet.href);
-            styleSheet.restricted = true;
-            var ssid = StyleSheetCache(styleSheet);
-
-            /// TODO: xxxpedro external css
-            //loadExternalStylesheet(doc, styleSheetIterator, styleSheet);
-        }
-
-        // process internal and external styleSheets
-        styleSheetIterator(doc, styleSheet);
-
-        var importedStyleSheet, importedRules;
-
-        // process imported styleSheets in IE
-        if (isIE)
-        {
-            var imports = styleSheet.imports;
-
-            for(var j=0, importsLength=imports.length; j<importsLength; j++)
-            {
-                try
-                {
-                    importedStyleSheet = imports[j];
-                    // we must read the length to make sure we have permission
-                    // to read the imported stylesheet's content.
-                    importedRules = importedStyleSheet.rules;
-                    importedRules.length;
-                }
-                catch(e)
-                {
-                    externalStyleSheetURLs.push(styleSheet.href);
-                    importedStyleSheet.restricted = true;
-                    var ssid = StyleSheetCache(importedStyleSheet);
-                }
-
-                styleSheetIterator(doc, importedStyleSheet);
-            }
-        }
-        // process imported styleSheets in other browsers
-        else if (rules)
-        {
-            for(var j=0, rulesLength=rules.length; j<rulesLength; j++)
-            {
-                try
-                {
-                    var rule = rules[j];
-
-                    importedStyleSheet = rule.styleSheet;
-
-                    if (importedStyleSheet)
-                    {
-                        // we must read the length to make sure we have permission
-                        // to read the imported stylesheet's content.
-                        importedRules = importedStyleSheet.cssRules;
-                        importedRules.length;
-                    }
-                    else
-                        break;
-                }
-                catch(e)
-                {
-                    externalStyleSheetURLs.push(styleSheet.href);
-                    importedStyleSheet.restricted = true;
-                    var ssid = StyleSheetCache(importedStyleSheet);
-                }
-
-                styleSheetIterator(doc, importedStyleSheet);
-            }
-        }
-    };
-
-    if (FBTrace.DBG_CSS)
-    {
-        FBTrace.sysout("FBL.processAllStyleSheets", "all stylesheet rules processed in " + (new Date().getTime() - start) + "ms");
-    }
-};
-
-// ************************************************************************************************
-
-var processStyleSheet = function(doc, styleSheet)
-{
-    if (styleSheet.restricted)
-        return;
-
-    var rules = isIE ? styleSheet.rules : styleSheet.cssRules;
-
-    var ssid = StyleSheetCache(styleSheet);
-
-    var href = styleSheet.href;
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // CSS Parser
-    var shouldParseCSS = typeof CssParser != "undefined" && !Firebug.disableResourceFetching;
-    if (shouldParseCSS)
-    {
-        try
-        {
-            var parsedRules = CssAnalyzer.parseStyleSheet(href);
-        }
-        catch(e)
-        {
-            if (FBTrace.DBG_ERRORS) FBTrace.sysout("processStyleSheet FAILS", e.message || e);
-            shouldParseCSS = false;
-        }
-        finally
-        {
-            var parsedRulesIndex = 0;
-
-            var dontSupportGroupedRules = isIE && browserVersion < 9;
-            var group = [];
-            var groupItem;
-        }
-    }
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    for (var i=0, length=rules.length; i<length; i++)
-    {
-        // TODO: xxxpedro is there a better way to cache CSS Rules? The problem is that
-        // we cannot add expando properties in the rule object in IE
-        var rid = ssid + ":" + i;
-        var rule = rules[i];
-        var selector = rule.selectorText || "";
-        var lineNo = null;
-
-        // See: Issue 4776: [Firebug lite] CSS Media Types
-        //
-        // Ignore all special selectors like @media and @page
-        if (!selector || selector.indexOf("@") != -1)
-            continue;
-
-        if (isIE)
-            selector = selector.replace(reSelectorTag, function(s){return s.toLowerCase();});
-
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-        // CSS Parser
-        if (shouldParseCSS)
-        {
-            var parsedRule = parsedRules[parsedRulesIndex];
-            var parsedSelector = parsedRule.selector;
-
-            if (dontSupportGroupedRules && parsedSelector.indexOf(",") != -1 && group.length == 0)
-                group = parsedSelector.split(",");
-
-            if (dontSupportGroupedRules && group.length > 0)
-            {
-                groupItem = group.shift();
-
-                if (CssParser.normalizeSelector(selector) == groupItem)
-                    lineNo = parsedRule.line;
-
-                if (group.length == 0)
-                    parsedRulesIndex++;
-            }
-            else if (CssParser.normalizeSelector(selector) == parsedRule.selector)
-            {
-                lineNo = parsedRule.line;
-                parsedRulesIndex++;
-            }
-        }
-        // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-        CSSRuleMap[rid] =
-        {
-            styleSheetId: ssid,
-            styleSheetIndex: i,
-            order: ++globalCSSRuleIndex,
-            specificity:
-                // See: Issue 4777: [Firebug lite] Specificity of CSS Rules
-                //
-                // if it is a normal selector then calculate the specificity
-                selector && selector.indexOf(",") == -1 ?
-                getCSSRuleSpecificity(selector) :
-                // See: Issue 3262: [Firebug lite] Specificity of grouped CSS Rules
-                //
-                // if it is a grouped selector, do not calculate the specificity
-                // because the correct value will depend of the matched element.
-                // The proper specificity value for grouped selectors are calculated
-                // via getElementCSSRules(element)
-                0,
-
-            rule: rule,
-            lineNo: lineNo,
-            selector: selector,
-            cssText: rule.style ? rule.style.cssText : rule.cssText ? rule.cssText : ""
-        };
-
-        // TODO: what happens with elements added after this? Need to create a test case.
-        // Maybe we should place this at getElementCSSRules() but it will make the function
-        // a lot more expensive.
-        //
-        // Maybe add a "refresh" button?
-        var elements = Firebug.Selector(selector, doc);
-
-        for (var j=0, elementsLength=elements.length; j<elementsLength; j++)
-        {
-            var element = elements[j];
-            var eid = ElementCache(element);
-
-            if (!ElementCSSRulesMap[eid])
-                ElementCSSRulesMap[eid] = [];
-
-            ElementCSSRulesMap[eid].push(rid);
-        }
-
-        //console.log(selector, elements);
-    }
-};
-
-// ************************************************************************************************
-// External StyleSheet Loader
-
-var loadExternalStylesheet = function(doc, styleSheetIterator, styleSheet)
-{
-    var url = styleSheet.href;
-    styleSheet.firebugIgnore = true;
-
-    var source = Firebug.Lite.Proxy.load(url);
-
-    // TODO: check for null and error responses
-
-    // remove comments
-    //var reMultiComment = /(\/\*([^\*]|\*(?!\/))*\*\/)/g;
-    //source = source.replace(reMultiComment, "");
-
-    // convert relative addresses to absolute ones
-    source = source.replace(/url\(([^\)]+)\)/g, function(a,name){
-
-        var hasDomain = /\w+:\/\/./.test(name);
-
-        if (!hasDomain)
-        {
-            name = name.replace(/^(["'])(.+)\1$/, "$2");
-            var first = name.charAt(0);
-
-            // relative path, based on root
-            if (first == "/")
-            {
-                // TODO: xxxpedro move to lib or Firebug.Lite.something
-                // getURLRoot
-                var m = /^([^:]+:\/{1,3}[^\/]+)/.exec(url);
-
-                return m ?
-                    "url(" + m[1] + name + ")" :
-                    "url(" + name + ")";
-            }
-            // relative path, based on current location
-            else
-            {
-                // TODO: xxxpedro move to lib or Firebug.Lite.something
-                // getURLPath
-                var path = url.replace(/[^\/]+\.[\w\d]+(\?.+|#.+)?$/g, "");
-
-                path = path + name;
-
-                var reBack = /[^\/]+\/\.\.\//;
-                while(reBack.test(path))
-                {
-                    path = path.replace(reBack, "");
-                }
-
-                //console.log("url(" + path + ")");
-
-                return "url(" + path + ")";
-            }
-        }
-
-        // if it is an absolute path, there is nothing to do
-        return a;
-    });
-
-    var oldStyle = styleSheet.ownerNode;
-
-    if (!oldStyle) return;
-
-    if (!oldStyle.parentNode) return;
-
-    var style = createGlobalElement("style");
-    style.setAttribute("charset","utf-8");
-    style.setAttribute("type", "text/css");
-    style.innerHTML = source;
-
-    //debugger;
-    oldStyle.parentNode.insertBefore(style, oldStyle.nextSibling);
-    oldStyle.parentNode.removeChild(oldStyle);
-
-    doc.styleSheets[doc.styleSheets.length-1].externalURL = url;
-
-    console.log(url, "call " + externalStyleSheetURLs.length, source);
-
-    externalStyleSheetURLs.pop();
-
-    if (processAllStyleSheetsTimeout)
-    {
-        clearTimeout(processAllStyleSheetsTimeout);
-    }
-
-    processAllStyleSheetsTimeout = setTimeout(function(){
-        console.log("processing");
-        FBL.processAllStyleSheets(doc, styleSheetIterator);
-        processAllStyleSheetsTimeout = null;
-    },200);
-
-};
-
-//************************************************************************************************
-// getElementCSSRules
-
-var getElementCSSRules = function(element)
-{
-    var eid = ElementCache(element);
-    var rules = ElementCSSRulesMap[eid];
-
-    if (!rules) return;
-
-    var arr = [element];
-    var Selector = Firebug.Selector;
-    var ruleId, rule;
-
-    // for the case of grouped selectors, we need to calculate the highest
-    // specificity within the selectors of the group that matches the element,
-    // so we can sort the rules properly without over estimating the specificity
-    // of grouped selectors
-    for (var i = 0, length = rules.length; i < length; i++)
-    {
-        ruleId = rules[i];
-        rule = CSSRuleMap[ruleId];
-
-        // check if it is a grouped selector
-        if (rule.selector.indexOf(",") != -1)
-        {
-            var selectors = rule.selector.split(",");
-            var maxSpecificity = -1;
-            var sel, spec, mostSpecificSelector;
-
-            // loop over all selectors in the group
-            for (var j, len = selectors.length; j < len; j++)
-            {
-                sel = selectors[j];
-
-                // find if the selector matches the element
-                if (Selector.matches(sel, arr).length == 1)
-                {
-                    spec = getCSSRuleSpecificity(sel);
-
-                    // find the most specific selector that macthes the element
-                    if (spec > maxSpecificity)
-                    {
-                        maxSpecificity = spec;
-                        mostSpecificSelector = sel;
-                    }
-                }
-            }
-
-            rule.specificity = maxSpecificity;
-        }
-    }
-
-    rules.sort(sortElementRules);
-    //rules.sort(solveRulesTied);
-
-    return rules;
-};
-
-// ************************************************************************************************
-// Rule Specificity
-
-var sortElementRules = function(a, b)
-{
-    var ruleA = CSSRuleMap[a];
-    var ruleB = CSSRuleMap[b];
-
-    var specificityA = ruleA.specificity;
-    var specificityB = ruleB.specificity;
-
-    if (specificityA > specificityB)
-        return 1;
-
-    else if (specificityA < specificityB)
-        return -1;
-
-    else
-        return ruleA.order > ruleB.order ? 1 : -1;
-};
-
-var solveRulesTied = function(a, b)
-{
-    var ruleA = CSSRuleMap[a];
-    var ruleB = CSSRuleMap[b];
-
-    if (ruleA.specificity == ruleB.specificity)
-        return ruleA.order > ruleB.order ? 1 : -1;
-
-    return null;
-};
-
-var getCSSRuleSpecificity = function(selector)
-{
-    var match = selector.match(reSelectorTag);
-    var tagCount = match ? match.length : 0;
-
-    match = selector.match(reSelectorClass);
-    var classCount = match ? match.length : 0;
-
-    match = selector.match(reSelectorId);
-    var idCount = match ? match.length : 0;
-
-    return tagCount + 10*classCount + 100*idCount;
-};
-
-// ************************************************************************************************
-// StyleSheet data
-
-var extractSourceData = function(href)
-{
-    var sourceData =
-    {
-        source: null,
-        startLine: 0
-    };
-
-    if (href)
-    {
-        sourceData.source = Firebug.Lite.Proxy.load(href);
-    }
-    else
-    {
-        // TODO: create extractInternalSourceData(index)
-        // TODO: pre process the position of the inline styles so this will happen only once
-        // in case of having multiple inline styles
-        var index = 0;
-        var ssIndex = ++internalStyleSheetIndex;
-        var reStyleTag = /\<\s*style.*\>/gi;
-        var reEndStyleTag = /\<\/\s*style.*\>/gi;
-
-        var source = Firebug.Lite.Proxy.load(Env.browser.location.href);
-        source = source.replace(/\n\r|\r\n/g, "\n"); // normalize line breaks
-
-        var startLine = 0;
-
-        do
-        {
-            var matchStyleTag = source.match(reStyleTag);
-            var i0 = source.indexOf(matchStyleTag[0]) + matchStyleTag[0].length;
-
-            for (var i=0; i < i0; i++)
-            {
-                if (source.charAt(i) == "\n")
-                    startLine++;
-            }
-
-            source = source.substr(i0);
-
-            index++;
-        }
-        while (index <= ssIndex);
-
-        var matchEndStyleTag = source.match(reEndStyleTag);
-        var i1 = source.indexOf(matchEndStyleTag[0]);
-
-        var extractedSource = source.substr(0, i1);
-
-        sourceData.source = extractedSource;
-        sourceData.startLine = startLine;
-    }
-
-    return sourceData;
-};
-
-// ************************************************************************************************
-// Registration
-
-FBL.CssAnalyzer = CssAnalyzer;
-
-// ************************************************************************************************
-}});
-
-
-/* See license.txt for terms of usage */
-
-// move to FBL
-(function() {
-
-// ************************************************************************************************
-// XPath
-
-/**
- * Gets an XPath for an element which describes its hierarchical location.
- */
-this.getElementXPath = function(element)
-{
-    try
-    {
-        if (element && element.id)
-            return '//*[@id="' + element.id + '"]';
-        else
-            return this.getElementTreeXPath(element);
-    }
-    catch(E)
-    {
-        // xxxpedro: trying to detect the mysterious error:
-        // Security error" code: "1000
-        //debugger;
-    }
-};
-
-this.getElementTreeXPath = function(element)
-{
-    var paths = [];
-
-    for (; element && element.nodeType == 1; element = element.parentNode)
-    {
-        var index = 0;
-        var nodeName = element.nodeName;
-
-        for (var sibling = element.previousSibling; sibling; sibling = sibling.previousSibling)
-        {
-            if (sibling.nodeType != 1) continue;
-
-            if (sibling.nodeName == nodeName)
-                ++index;
-        }
-
-        var tagName = element.nodeName.toLowerCase();
-        var pathIndex = (index ? "[" + (index+1) + "]" : "");
-        paths.splice(0, 0, tagName + pathIndex);
-    }
-
-    return paths.length ? "/" + paths.join("/") : null;
-};
-
-this.getElementsByXPath = function(doc, xpath)
-{
-    var nodes = [];
-
-    try {
-        var result = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null);
-        for (var item = result.iterateNext(); item; item = result.iterateNext())
-            nodes.push(item);
-    }
-    catch (exc)
-    {
-        // Invalid xpath expressions make their way here sometimes.  If that happens,
-        // we still want to return an empty set without an exception.
-    }
-
-    return nodes;
-};
-
-this.getRuleMatchingElements = function(rule, doc)
-{
-    var css = rule.selectorText;
-    var xpath = this.cssToXPath(css);
-    return this.getElementsByXPath(doc, xpath);
-};
-
-
-}).call(FBL);
-
-
-
-
-FBL.ns(function() { with (FBL) {
-
-// ************************************************************************************************
-// ************************************************************************************************
-// ************************************************************************************************
-// ************************************************************************************************
-// ************************************************************************************************
-
-var toCamelCase = function toCamelCase(s)
-{
-    return s.replace(reSelectorCase, toCamelCaseReplaceFn);
-};
-
-var toSelectorCase = function toSelectorCase(s)
-{
-  return s.replace(reCamelCase, "-$1").toLowerCase();
-
-};
-
-var reCamelCase = /([A-Z])/g;
-var reSelectorCase = /\-(.)/g;
-var toCamelCaseReplaceFn = function toCamelCaseReplaceFn(m,g)
-{
-    return g.toUpperCase();
-};
-
-// ************************************************************************************************
-
-var ElementCache = Firebug.Lite.Cache.Element;
-var StyleSheetCache = Firebug.Lite.Cache.StyleSheet;
-
-// ************************************************************************************************
-// ************************************************************************************************
-// ************************************************************************************************
-// ************************************************************************************************
-// ************************************************************************************************
-// ************************************************************************************************
-
-
-// ************************************************************************************************
-// Constants
-
-//const Cc = Components.classes;
-//const Ci = Components.interfaces;
-//const nsIDOMCSSStyleRule = Ci.nsIDOMCSSStyleRule;
-//const nsIInterfaceRequestor = Ci.nsIInterfaceRequestor;
-//const nsISelectionDisplay = Ci.nsISelectionDisplay;
-//const nsISelectionController = Ci.nsISelectionController;
-
-// See: http://mxr.mozilla.org/mozilla1.9.2/source/content/events/public/nsIEventStateManager.h#153
-//const STATE_ACTIVE  = 0x01;
-//const STATE_FOCUS   = 0x02;
-//const STATE_HOVER   = 0x04;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-Firebug.SourceBoxPanel = Firebug.Panel;
-
-var reSelectorTag = /(^|\s)(?:\w+)/g;
-
-var domUtils = null;
-
-var textContent = isIE ? "innerText" : "textContent";
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var CSSDomplateBase = {
-    isEditable: function(rule)
-    {
-        return !rule.isSystemSheet;
-    },
-    isSelectorEditable: function(rule)
-    {
-        return rule.isSelectorEditable && this.isEditable(rule);
-    }
-};
-
-var CSSPropTag = domplate(CSSDomplateBase, {
-    tag: DIV({"class": "cssProp focusRow", $disabledStyle: "$prop.disabled",
-          $editGroup: "$rule|isEditable",
-          $cssOverridden: "$prop.overridden", role : "option"},
-        A({"class": "cssPropDisable"}, "&nbsp;&nbsp;"),
-        SPAN({"class": "cssPropName", $editable: "$rule|isEditable"}, "$prop.name"),
-        SPAN({"class": "cssColon"}, ":"),
-        SPAN({"class": "cssPropValue", $editable: "$rule|isEditable"}, "$prop.value$prop.important"),
-        SPAN({"class": "cssSemi"}, ";")
-    )
-});
-
-var CSSRuleTag =
-    TAG("$rule.tag", {rule: "$rule"});
-
-var CSSImportRuleTag = domplate({
-    tag: DIV({"class": "cssRule insertInto focusRow importRule", _repObject: "$rule.rule"},
-        "@import &quot;",
-        A({"class": "objectLink", _repObject: "$rule.rule.styleSheet"}, "$rule.rule.href"),
-        "&quot;;"
-    )
-});
-
-var CSSStyleRuleTag = domplate(CSSDomplateBase, {
-    tag: DIV({"class": "cssRule insertInto",
-            $cssEditableRule: "$rule|isEditable",
-            $editGroup: "$rule|isSelectorEditable",
-            _repObject: "$rule.rule",
-            "ruleId": "$rule.id", role : 'presentation'},
-        DIV({"class": "cssHead focusRow", role : 'listitem'},
-            SPAN({"class": "cssSelector", $editable: "$rule|isSelectorEditable"}, "$rule.selector"), " {"
-        ),
-        DIV({role : 'group'},
-            DIV({"class": "cssPropertyListBox", role : 'listbox'},
-                FOR("prop", "$rule.props",
-                    TAG(CSSPropTag.tag, {rule: "$rule", prop: "$prop"})
-                )
-            )
-        ),
-        DIV({"class": "editable insertBefore", role:"presentation"}, "}")
-    )
-});
-
-var reSplitCSS =  /(url\("?[^"\)]+?"?\))|(rgb\(.*?\))|(#[\dA-Fa-f]+)|(-?\d+(\.\d+)?(%|[a-z]{1,2})?)|([^,\s]+)|"(.*?)"/;
-
-var reURL = /url\("?([^"\)]+)?"?\)/;
-
-var reRepeat = /no-repeat|repeat-x|repeat-y|repeat/;
-
-//const sothinkInstalled = !!$("swfcatcherKey_sidebar");
-var sothinkInstalled = false;
-var styleGroups =
-{
-    text: [
-        "font-family",
-        "font-size",
-        "font-weight",
-        "font-style",
-        "color",
-        "text-transform",
-        "text-decoration",
-        "letter-spacing",
-        "word-spacing",
-        "line-height",
-        "text-align",
-        "vertical-align",
-        "direction",
-        "column-count",
-        "column-gap",
-        "column-width"
-    ],
-
-    background: [
-        "background-color",
-        "background-image",
-        "background-repeat",
-        "background-position",
-        "background-attachment",
-        "opacity"
-    ],
-
-    box: [
-        "width",
-        "height",
-        "top",
-        "right",
-        "bottom",
-        "left",
-        "margin-top",
-        "margin-right",
-        "margin-bottom",
-        "margin-left",
-        "padding-top",
-        "padding-right",
-        "padding-bottom",
-        "padding-left",
-        "border-top-width",
-        "border-right-width",
-        "border-bottom-width",
-        "border-left-width",
-        "border-top-color",
-        "border-right-color",
-        "border-bottom-color",
-        "border-left-color",
-        "border-top-style",
-        "border-right-style",
-        "border-bottom-style",
-        "border-left-style",
-        "-moz-border-top-radius",
-        "-moz-border-right-radius",
-        "-moz-border-bottom-radius",
-        "-moz-border-left-radius",
-        "outline-top-width",
-        "outline-right-width",
-        "outline-bottom-width",
-        "outline-left-width",
-        "outline-top-color",
-        "outline-right-color",
-        "outline-bottom-color",
-        "outline-left-color",
-        "outline-top-style",
-        "outline-right-style",
-        "outline-bottom-style",
-        "outline-left-style"
-    ],
-
-    layout: [
-        "position",
-        "display",
-        "visibility",
-        "z-index",
-        "overflow-x",  // http://www.w3.org/TR/2002/WD-css3-box-20021024/#overflow
-        "overflow-y",
-        "overflow-clip",
-        "white-space",
-        "clip",
-        "float",
-        "clear",
-        "-moz-box-sizing"
-    ],
-
-    other: [
-        "cursor",
-        "list-style-image",
-        "list-style-position",
-        "list-style-type",
-        "marker-offset",
-        "user-focus",
-        "user-select",
-        "user-modify",
-        "user-input"
-    ]
-};
-
-var styleGroupTitles =
-{
-    text: "Text",
-    background: "Background",
-    box: "Box Model",
-    layout: "Layout",
-    other: "Other"
-};
-
-Firebug.CSSModule = extend(Firebug.Module,
-{
-    freeEdit: function(styleSheet, value)
-    {
-        if (!styleSheet.editStyleSheet)
-        {
-            var ownerNode = getStyleSheetOwnerNode(styleSheet);
-            styleSheet.disabled = true;
-
-            var url = CCSV("@mozilla.org/network/standard-url;1", Components.interfaces.nsIURL);
-            url.spec = styleSheet.href;
-
-            var editStyleSheet = ownerNode.ownerDocument.createElementNS(
-                "http://www.w3.org/1999/xhtml",
-                "style");
-            unwrapObject(editStyleSheet).firebugIgnore = true;
-            editStyleSheet.setAttribute("type", "text/css");
-            editStyleSheet.setAttributeNS(
-                "http://www.w3.org/XML/1998/namespace",
-                "base",
-                url.directory);
-            if (ownerNode.hasAttribute("media"))
-            {
-              editStyleSheet.setAttribute("media", ownerNode.getAttribute("media"));
-            }
-
-            // Insert the edited stylesheet directly after the old one to ensure the styles
-            // cascade properly.
-            ownerNode.parentNode.insertBefore(editStyleSheet, ownerNode.nextSibling);
-
-            styleSheet.editStyleSheet = editStyleSheet;
-        }
-
-        styleSheet.editStyleSheet.innerHTML = value;
-        if (FBTrace.DBG_CSS)
-            FBTrace.sysout("css.saveEdit styleSheet.href:"+styleSheet.href+" got innerHTML:"+value+"\n");
-
-        dispatch(this.fbListeners, "onCSSFreeEdit", [styleSheet, value]);
-    },
-
-    insertRule: function(styleSheet, cssText, ruleIndex)
-    {
-        if (FBTrace.DBG_CSS) FBTrace.sysout("Insert: " + ruleIndex + " " + cssText);
-        var insertIndex = styleSheet.insertRule(cssText, ruleIndex);
-
-        dispatch(this.fbListeners, "onCSSInsertRule", [styleSheet, cssText, ruleIndex]);
-
-        return insertIndex;
-    },
-
-    deleteRule: function(styleSheet, ruleIndex)
-    {
-        if (FBTrace.DBG_CSS) FBTrace.sysout("deleteRule: " + ruleIndex + " " + styleSheet.cssRules.length, styleSheet.cssRules);
-        dispatch(this.fbListeners, "onCSSDeleteRule", [styleSheet, ruleIndex]);
-
-        styleSheet.deleteRule(ruleIndex);
-    },
-
-    setProperty: function(rule, propName, propValue, propPriority)
-    {
-        var style = rule.style || rule;
-
-        // Record the original CSS text for the inline case so we can reconstruct at a later
-        // point for diffing purposes
-        var baseText = style.cssText;
-
-        // good browsers
-        if (style.getPropertyValue)
-        {
-            var prevValue = style.getPropertyValue(propName);
-            var prevPriority = style.getPropertyPriority(propName);
-
-            // XXXjoe Gecko bug workaround: Just changing priority doesn't have any effect
-            // unless we remove the property first
-            style.removeProperty(propName);
-
-            style.setProperty(propName, propValue, propPriority);
-        }
-        // sad browsers
-        else
-        {
-            // TODO: xxxpedro parse CSS rule to find property priority in IE?
-            //console.log(propName, propValue);
-            style[toCamelCase(propName)] = propValue;
-        }
-
-        if (propName) {
-            dispatch(this.fbListeners, "onCSSSetProperty", [style, propName, propValue, propPriority, prevValue, prevPriority, rule, baseText]);
-        }
-    },
-
-    removeProperty: function(rule, propName, parent)
-    {
-        var style = rule.style || rule;
-
-        // Record the original CSS text for the inline case so we can reconstruct at a later
-        // point for diffing purposes
-        var baseText = style.cssText;
-
-        if (style.getPropertyValue)
-        {
-
-            var prevValue = style.getPropertyValue(propName);
-            var prevPriority = style.getPropertyPriority(propName);
-
-            style.removeProperty(propName);
-        }
-        else
-        {
-            style[toCamelCase(propName)] = "";
-        }
-
-        if (propName) {
-            dispatch(this.fbListeners, "onCSSRemoveProperty", [style, propName, prevValue, prevPriority, rule, baseText]);
-        }
-    }/*,
-
-    cleanupSheets: function(doc, context)
-    {
-        // Due to the manner in which the layout engine handles multiple
-        // references to the same sheet we need to kick it a little bit.
-        // The injecting a simple stylesheet then removing it will force
-        // Firefox to regenerate it's CSS hierarchy.
-        //
-        // WARN: This behavior was determined anecdotally.
-        // See http://code.google.com/p/fbug/issues/detail?id=2440
-        var style = doc.createElementNS("http://www.w3.org/1999/xhtml", "style");
-        style.setAttribute("charset","utf-8");
-        unwrapObject(style).firebugIgnore = true;
-        style.setAttribute("type", "text/css");
-        style.innerHTML = "#fbIgnoreStyleDO_NOT_USE {}";
-        addStyleSheet(doc, style);
-        style.parentNode.removeChild(style);
-
-        // https://bugzilla.mozilla.org/show_bug.cgi?id=500365
-        // This voodoo touches each style sheet to force some Firefox internal change to allow edits.
-        var styleSheets = getAllStyleSheets(context);
-        for(var i = 0; i < styleSheets.length; i++)
-        {
-            try
-            {
-                var rules = styleSheets[i].cssRules;
-                if (rules.length > 0)
-                    var touch = rules[0];
-                if (FBTrace.DBG_CSS && touch)
-                    FBTrace.sysout("css.show() touch "+typeof(touch)+" in "+(styleSheets[i].href?styleSheets[i].href:context.getName()));
-            }
-            catch(e)
-            {
-                if (FBTrace.DBG_ERRORS)
-                    FBTrace.sysout("css.show: sheet.cssRules FAILS for "+(styleSheets[i]?styleSheets[i].href:"null sheet")+e, e);
-            }
-        }
-    },
-    cleanupSheetHandler: function(event, context)
-    {
-        var target = event.target || event.srcElement,
-            tagName = (target.tagName || "").toLowerCase();
-        if (tagName == "link")
-        {
-            this.cleanupSheets(target.ownerDocument, context);
-        }
-    },
-    watchWindow: function(context, win)
-    {
-        var cleanupSheets = bind(this.cleanupSheets, this),
-            cleanupSheetHandler = bind(this.cleanupSheetHandler, this, context),
-            doc = win.document;
-
-        //doc.addEventListener("DOMAttrModified", cleanupSheetHandler, false);
-        //doc.addEventListener("DOMNodeInserted", cleanupSheetHandler, false);
-    },
-    loadedContext: function(context)
-    {
-        var self = this;
-        iterateWindows(context.browser.contentWindow, function(subwin)
-        {
-            self.cleanupSheets(subwin.document, context);
-        });
-    }
-    /**/
-});
-
-// ************************************************************************************************
-
-Firebug.CSSStyleSheetPanel = function() {};
-
-Firebug.CSSStyleSheetPanel.prototype = extend(Firebug.SourceBoxPanel,
-{
-    template: domplate(
-    {
-        tag:
-            DIV({"class": "cssSheet insertInto a11yCSSView"},
-                FOR("rule", "$rules",
-                    CSSRuleTag
-                ),
-                DIV({"class": "cssSheet editable insertBefore"}, "")
-                )
-    }),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    refresh: function()
-    {
-        if (this.location)
-            this.updateLocation(this.location);
-        else if (this.selection)
-            this.updateSelection(this.selection);
-    },
-
-    toggleEditing: function()
-    {
-        if (!this.stylesheetEditor)
-            this.stylesheetEditor = new StyleSheetEditor(this.document);
-
-        if (this.editing)
-            Firebug.Editor.stopEditing();
-        else
-        {
-            if (!this.location)
-                return;
-
-            var styleSheet = this.location.editStyleSheet
-                ? this.location.editStyleSheet.sheet
-                : this.location;
-
-            var css = getStyleSheetCSS(styleSheet, this.context);
-            //var topmost = getTopmostRuleLine(this.panelNode);
-
-            this.stylesheetEditor.styleSheet = this.location;
-            Firebug.Editor.startEditing(this.panelNode, css, this.stylesheetEditor);
-            //this.stylesheetEditor.scrollToLine(topmost.line, topmost.offset);
-        }
-    },
-
-    getStylesheetURL: function(rule)
-    {
-        if (this.location.href)
-            return this.location.href;
-        else
-            return this.context.window.location.href;
-    },
-
-    getRuleByLine: function(styleSheet, line)
-    {
-        if (!domUtils)
-            return null;
-
-        var cssRules = styleSheet.cssRules;
-        for (var i = 0; i < cssRules.length; ++i)
-        {
-            var rule = cssRules[i];
-            if (rule instanceof CSSStyleRule)
-            {
-                var ruleLine = domUtils.getRuleLine(rule);
-                if (ruleLine >= line)
-                    return rule;
-            }
-        }
-    },
-
-    highlightRule: function(rule)
-    {
-        var ruleElement = Firebug.getElementByRepObject(this.panelNode.firstChild, rule);
-        if (ruleElement)
-        {
-            scrollIntoCenterView(ruleElement, this.panelNode);
-            setClassTimed(ruleElement, "jumpHighlight", this.context);
-        }
-    },
-
-    getStyleSheetRules: function(context, styleSheet)
-    {
-        var isSystemSheet = isSystemStyleSheet(styleSheet);
-
-        function appendRules(cssRules)
-        {
-            for (var i = 0; i < cssRules.length; ++i)
-            {
-                var rule = cssRules[i];
-
-                // TODO: xxxpedro opera instanceof stylesheet remove the following comments when
-                // the issue with opera and style sheet Classes has been solved.
-
-                //if (rule instanceof CSSStyleRule)
-                if (instanceOf(rule, "CSSStyleRule"))
-                {
-                    var props = this.getRuleProperties(context, rule);
-                    //var line = domUtils.getRuleLine(rule);
-                    var line = null;
-
-                    var selector = rule.selectorText;
-
-                    if (isIE)
-                    {
-                        selector = selector.replace(reSelectorTag,
-                                function(s){return s.toLowerCase();});
-                    }
-
-                    var ruleId = rule.selectorText+"/"+line;
-                    rules.push({tag: CSSStyleRuleTag.tag, rule: rule, id: ruleId,
-                                selector: selector, props: props,
-                                isSystemSheet: isSystemSheet,
-                                isSelectorEditable: true});
-                }
-                //else if (rule instanceof CSSImportRule)
-                else if (instanceOf(rule, "CSSImportRule"))
-                    rules.push({tag: CSSImportRuleTag.tag, rule: rule});
-                //else if (rule instanceof CSSMediaRule)
-                else if (instanceOf(rule, "CSSMediaRule"))
-                    appendRules.apply(this, [rule.cssRules]);
-                else
-                {
-                    if (FBTrace.DBG_ERRORS || FBTrace.DBG_CSS)
-                        FBTrace.sysout("css getStyleSheetRules failed to classify a rule ", rule);
-                }
-            }
-        }
-
-        var rules = [];
-        appendRules.apply(this, [styleSheet.cssRules || styleSheet.rules]);
-        return rules;
-    },
-
-    parseCSSProps: function(style, inheritMode)
-    {
-        var props = [];
-
-        if (Firebug.expandShorthandProps)
-        {
-            var count = style.length-1,
-                index = style.length;
-            while (index--)
-            {
-                var propName = style.item(count - index);
-                this.addProperty(propName, style.getPropertyValue(propName), !!style.getPropertyPriority(propName), false, inheritMode, props);
-            }
-        }
-        else
-        {
-            var lines = style.cssText.match(/(?:[^;\(]*(?:\([^\)]*?\))?[^;\(]*)*;?/g);
-            var propRE = /\s*([^:\s]*)\s*:\s*(.*?)\s*(! important)?;?$/;
-            var line,i=0;
-            // TODO: xxxpedro port to firebug: variable leaked into global namespace
-            var m;
-
-            while(line=lines[i++]){
-                m = propRE.exec(line);
-                if(!m)
-                    continue;
-                //var name = m[1], value = m[2], important = !!m[3];
-                if (m[2])
-                    this.addProperty(m[1], m[2], !!m[3], false, inheritMode, props);
-            };
-        }
-
-        return props;
-    },
-
-    getRuleProperties: function(context, rule, inheritMode)
-    {
-        var props = this.parseCSSProps(rule.style, inheritMode);
-
-        // TODO: xxxpedro port to firebug: variable leaked into global namespace
-        //var line = domUtils.getRuleLine(rule);
-        var line;
-        var ruleId = rule.selectorText+"/"+line;
-        this.addOldProperties(context, ruleId, inheritMode, props);
-        sortProperties(props);
-
-        return props;
-    },
-
-    addOldProperties: function(context, ruleId, inheritMode, props)
-    {
-        if (context.selectorMap && context.selectorMap.hasOwnProperty(ruleId) )
-        {
-            var moreProps = context.selectorMap[ruleId];
-            for (var i = 0; i < moreProps.length; ++i)
-            {
-                var prop = moreProps[i];
-                this.addProperty(prop.name, prop.value, prop.important, true, inheritMode, props);
-            }
-        }
-    },
-
-    addProperty: function(name, value, important, disabled, inheritMode, props)
-    {
-        name = name.toLowerCase();
-
-        if (inheritMode && !inheritedStyleNames[name])
-            return;
-
-        name = this.translateName(name, value);
-        if (name)
-        {
-            value = stripUnits(rgbToHex(value));
-            important = important ? " !important" : "";
-
-            var prop = {name: name, value: value, important: important, disabled: disabled};
-            props.push(prop);
-        }
-    },
-
-    translateName: function(name, value)
-    {
-        // Don't show these proprietary Mozilla properties
-        if ((value == "-moz-initial"
-            && (name == "-moz-background-clip" || name == "-moz-background-origin"
-                || name == "-moz-background-inline-policy"))
-        || (value == "physical"
-            && (name == "margin-left-ltr-source" || name == "margin-left-rtl-source"
-                || name == "margin-right-ltr-source" || name == "margin-right-rtl-source"))
-        || (value == "physical"
-            && (name == "padding-left-ltr-source" || name == "padding-left-rtl-source"
-                || name == "padding-right-ltr-source" || name == "padding-right-rtl-source")))
-            return null;
-
-        // Translate these back to the form the user probably expects
-        if (name == "margin-left-value")
-            return "margin-left";
-        else if (name == "margin-right-value")
-            return "margin-right";
-        else if (name == "margin-top-value")
-            return "margin-top";
-        else if (name == "margin-bottom-value")
-            return "margin-bottom";
-        else if (name == "padding-left-value")
-            return "padding-left";
-        else if (name == "padding-right-value")
-            return "padding-right";
-        else if (name == "padding-top-value")
-            return "padding-top";
-        else if (name == "padding-bottom-value")
-            return "padding-bottom";
-        // XXXjoe What about border!
-        else
-            return name;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    editElementStyle: function()
-    {
-        ///var rulesBox = this.panelNode.getElementsByClassName("cssElementRuleContainer")[0];
-        var rulesBox = $$(".cssElementRuleContainer", this.panelNode)[0];
-        var styleRuleBox = rulesBox && Firebug.getElementByRepObject(rulesBox, this.selection);
-        if (!styleRuleBox)
-        {
-            var rule = {rule: this.selection, inherited: false, selector: "element.style", props: []};
-            if (!rulesBox)
-            {
-                // The element did not have any displayed styles. We need to create the whole tree and remove
-                // the no styles message
-                styleRuleBox = this.template.cascadedTag.replace({
-                    rules: [rule], inherited: [], inheritLabel: "Inherited from" // $STR("InheritedFrom")
-                }, this.panelNode);
-
-                ///styleRuleBox = styleRuleBox.getElementsByClassName("cssElementRuleContainer")[0];
-                styleRuleBox = $$(".cssElementRuleContainer", styleRuleBox)[0];
-            }
-            else
-                styleRuleBox = this.template.ruleTag.insertBefore({rule: rule}, rulesBox);
-
-            ///styleRuleBox = styleRuleBox.getElementsByClassName("insertInto")[0];
-            styleRuleBox = $$(".insertInto", styleRuleBox)[0];
-        }
-
-        Firebug.Editor.insertRowForObject(styleRuleBox);
-    },
-
-    insertPropertyRow: function(row)
-    {
-        Firebug.Editor.insertRowForObject(row);
-    },
-
-    insertRule: function(row)
-    {
-        var location = getAncestorByClass(row, "cssRule");
-        if (!location)
-        {
-            location = getChildByClass(this.panelNode, "cssSheet");
-            Firebug.Editor.insertRowForObject(location);
-        }
-        else
-        {
-            Firebug.Editor.insertRow(location, "before");
-        }
-    },
-
-    editPropertyRow: function(row)
-    {
-        var propValueBox = getChildByClass(row, "cssPropValue");
-        Firebug.Editor.startEditing(propValueBox);
-    },
-
-    deletePropertyRow: function(row)
-    {
-        var rule = Firebug.getRepObject(row);
-        var propName = getChildByClass(row, "cssPropName")[textContent];
-        Firebug.CSSModule.removeProperty(rule, propName);
-
-        // Remove the property from the selector map, if it was disabled
-        var ruleId = Firebug.getRepNode(row).getAttribute("ruleId");
-        if ( this.context.selectorMap && this.context.selectorMap.hasOwnProperty(ruleId) )
-        {
-            var map = this.context.selectorMap[ruleId];
-            for (var i = 0; i < map.length; ++i)
-            {
-                if (map[i].name == propName)
-                {
-                    map.splice(i, 1);
-                    break;
-                }
-            }
-        }
-        if (this.name == "stylesheet")
-            dispatch([Firebug.A11yModel], 'onInlineEditorClose', [this, row.firstChild, true]);
-        row.parentNode.removeChild(row);
-
-        this.markChange(this.name == "stylesheet");
-    },
-
-    disablePropertyRow: function(row)
-    {
-        toggleClass(row, "disabledStyle");
-
-        var rule = Firebug.getRepObject(row);
-        var propName = getChildByClass(row, "cssPropName")[textContent];
-
-        if (!this.context.selectorMap)
-            this.context.selectorMap = {};
-
-        // XXXjoe Generate unique key for elements too
-        var ruleId = Firebug.getRepNode(row).getAttribute("ruleId");
-        if (!(this.context.selectorMap.hasOwnProperty(ruleId)))
-            this.context.selectorMap[ruleId] = [];
-
-        var map = this.context.selectorMap[ruleId];
-        var propValue = getChildByClass(row, "cssPropValue")[textContent];
-        var parsedValue = parsePriority(propValue);
-        if (hasClass(row, "disabledStyle"))
-        {
-            Firebug.CSSModule.removeProperty(rule, propName);
-
-            map.push({"name": propName, "value": parsedValue.value,
-                "important": parsedValue.priority});
-        }
-        else
-        {
-            Firebug.CSSModule.setProperty(rule, propName, parsedValue.value, parsedValue.priority);
-
-            var index = findPropByName(map, propName);
-            map.splice(index, 1);
-        }
-
-        this.markChange(this.name == "stylesheet");
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    onMouseDown: function(event)
-    {
-        //console.log("onMouseDown", event.target || event.srcElement, event);
-
-        // xxxpedro adjusting coordinates because the panel isn't a window yet
-        var offset = event.clientX - this.panelNode.parentNode.offsetLeft;
-
-        // XXjoe Hack to only allow clicking on the checkbox
-        if (!isLeftClick(event) || offset > 20)
-            return;
-
-        var target = event.target || event.srcElement;
-        if (hasClass(target, "textEditor"))
-            return;
-
-        var row = getAncestorByClass(target, "cssProp");
-        if (row && hasClass(row, "editGroup"))
-        {
-            this.disablePropertyRow(row);
-            cancelEvent(event);
-        }
-    },
-
-    onDoubleClick: function(event)
-    {
-        //console.log("onDoubleClick", event.target || event.srcElement, event);
-
-        // xxxpedro adjusting coordinates because the panel isn't a window yet
-        var offset = event.clientX - this.panelNode.parentNode.offsetLeft;
-
-        if (!isLeftClick(event) || offset <= 20)
-            return;
-
-        var target = event.target || event.srcElement;
-
-        //console.log("ok", target, hasClass(target, "textEditorInner"), !isLeftClick(event), offset <= 20);
-
-        // if the inline editor was clicked, don't insert a new rule
-        if (hasClass(target, "textEditorInner"))
-            return;
-
-        var row = getAncestorByClass(target, "cssRule");
-        if (row && !getAncestorByClass(target, "cssPropName")
-            && !getAncestorByClass(target, "cssPropValue"))
-        {
-            this.insertPropertyRow(row);
-            cancelEvent(event);
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends Panel
-
-    name: "stylesheet",
-    title: "CSS",
-    parentPanel: null,
-    searchable: true,
-    dependents: ["css", "stylesheet", "dom", "domSide", "layout"],
-
-    options:
-    {
-        hasToolButtons: true
-    },
-
-    create: function()
-    {
-        Firebug.Panel.create.apply(this, arguments);
-
-        this.onMouseDown = bind(this.onMouseDown, this);
-        this.onDoubleClick = bind(this.onDoubleClick, this);
-
-        if (this.name == "stylesheet")
-        {
-            this.onChangeSelect = bind(this.onChangeSelect, this);
-
-            var doc = Firebug.browser.document;
-            var selectNode = this.selectNode = createElement("select");
-
-            CssAnalyzer.processAllStyleSheets(doc, function(doc, styleSheet)
-            {
-                var key = StyleSheetCache.key(styleSheet);
-                var fileName = getFileName(styleSheet.href) || getFileName(doc.location.href);
-                var option = createElement("option", {value: key});
-
-                option.appendChild(Firebug.chrome.document.createTextNode(fileName));
-                selectNode.appendChild(option);
-            });
-
-            this.toolButtonsNode.appendChild(selectNode);
-        }
-        /**/
-    },
-
-    onChangeSelect: function(event)
-    {
-        event = event || window.event;
-        var target = event.srcElement || event.currentTarget;
-        var key = target.value;
-        var styleSheet = StyleSheetCache.get(key);
-
-        this.updateLocation(styleSheet);
-    },
-
-    initialize: function()
-    {
-        Firebug.Panel.initialize.apply(this, arguments);
-
-        //if (!domUtils)
-        //{
-        //    try {
-        //        domUtils = CCSV("@mozilla.org/inspector/dom-utils;1", "inIDOMUtils");
-        //    } catch (exc) {
-        //        if (FBTrace.DBG_ERRORS)
-        //            FBTrace.sysout("@mozilla.org/inspector/dom-utils;1 FAILED to load: "+exc, exc);
-        //    }
-        //}
-
-        //TODO: xxxpedro
-        this.context = Firebug.chrome; // TODO: xxxpedro css2
-        this.document = Firebug.chrome.document; // TODO: xxxpedro css2
-
-        this.initializeNode();
-
-        if (this.name == "stylesheet")
-        {
-            var styleSheets = Firebug.browser.document.styleSheets;
-
-            if (styleSheets.length > 0)
-            {
-                addEvent(this.selectNode, "change", this.onChangeSelect);
-
-                this.updateLocation(styleSheets[0]);
-            }
-        }
-
-        //Firebug.SourceBoxPanel.initialize.apply(this, arguments);
-    },
-
-    shutdown: function()
-    {
-        // must destroy the editor when we leave the panel to avoid problems (Issue 2981)
-        Firebug.Editor.stopEditing();
-
-        if (this.name == "stylesheet")
-        {
-            removeEvent(this.selectNode, "change", this.onChangeSelect);
-        }
-
-        this.destroyNode();
-
-        Firebug.Panel.shutdown.apply(this, arguments);
-    },
-
-    destroy: function(state)
-    {
-        //state.scrollTop = this.panelNode.scrollTop ? this.panelNode.scrollTop : this.lastScrollTop;
-
-        //persistObjects(this, state);
-
-        // xxxpedro we are stopping the editor in the shutdown method already
-        //Firebug.Editor.stopEditing();
-        Firebug.Panel.destroy.apply(this, arguments);
-    },
-
-    initializeNode: function(oldPanelNode)
-    {
-        addEvent(this.panelNode, "mousedown", this.onMouseDown);
-        addEvent(this.panelNode, "dblclick", this.onDoubleClick);
-        //Firebug.SourceBoxPanel.initializeNode.apply(this, arguments);
-        //dispatch([Firebug.A11yModel], 'onInitializeNode', [this, 'css']);
-    },
-
-    destroyNode: function()
-    {
-        removeEvent(this.panelNode, "mousedown", this.onMouseDown);
-        removeEvent(this.panelNode, "dblclick", this.onDoubleClick);
-        //Firebug.SourceBoxPanel.destroyNode.apply(this, arguments);
-        //dispatch([Firebug.A11yModel], 'onDestroyNode', [this, 'css']);
-    },
-
-    ishow: function(state)
-    {
-        Firebug.Inspector.stopInspecting(true);
-
-        this.showToolbarButtons("fbCSSButtons", true);
-
-        if (this.context.loaded && !this.location) // wait for loadedContext to restore the panel
-        {
-            restoreObjects(this, state);
-
-            if (!this.location)
-                this.location = this.getDefaultLocation();
-
-            if (state && state.scrollTop)
-                this.panelNode.scrollTop = state.scrollTop;
-        }
-    },
-
-    ihide: function()
-    {
-        this.showToolbarButtons("fbCSSButtons", false);
-
-        this.lastScrollTop = this.panelNode.scrollTop;
-    },
-
-    supportsObject: function(object)
-    {
-        if (object instanceof CSSStyleSheet)
-            return 1;
-        else if (object instanceof CSSStyleRule)
-            return 2;
-        else if (object instanceof CSSStyleDeclaration)
-            return 2;
-        else if (object instanceof SourceLink && object.type == "css" && reCSS.test(object.href))
-            return 2;
-        else
-            return 0;
-    },
-
-    updateLocation: function(styleSheet)
-    {
-        if (!styleSheet)
-            return;
-        if (styleSheet.editStyleSheet)
-            styleSheet = styleSheet.editStyleSheet.sheet;
-
-        // if it is a restricted stylesheet, show the warning message and abort the update process
-        if (styleSheet.restricted)
-        {
-            FirebugReps.Warning.tag.replace({object: "AccessRestricted"}, this.panelNode);
-
-            // TODO: xxxpedro remove when there the external resource problem is fixed
-            CssAnalyzer.externalStyleSheetWarning.tag.append({
-                object: "The stylesheet could not be loaded due to access restrictions. ",
-                link: "more...",
-                href: "http://getfirebug.com/wiki/index.php/Firebug_Lite_FAQ#I_keep_seeing_.22Access_to_restricted_URI_denied.22"
-            }, this.panelNode);
-
-            return;
-        }
-
-        var rules = this.getStyleSheetRules(this.context, styleSheet);
-
-        var result;
-        if (rules.length)
-            // FIXME xxxpedro chromenew this is making iPad's Safari to crash
-            result = this.template.tag.replace({rules: rules}, this.panelNode);
-        else
-            result = FirebugReps.Warning.tag.replace({object: "EmptyStyleSheet"}, this.panelNode);
-
-        // TODO: xxxpedro need to fix showToolbarButtons function
-        //this.showToolbarButtons("fbCSSButtons", !isSystemStyleSheet(this.location));
-
-        //dispatch([Firebug.A11yModel], 'onCSSRulesAdded', [this, this.panelNode]);
-    },
-
-    updateSelection: function(object)
-    {
-        this.selection = null;
-
-        if (object instanceof CSSStyleDeclaration) {
-            object = object.parentRule;
-        }
-
-        if (object instanceof CSSStyleRule)
-        {
-            this.navigate(object.parentStyleSheet);
-            this.highlightRule(object);
-        }
-        else if (object instanceof CSSStyleSheet)
-        {
-            this.navigate(object);
-        }
-        else if (object instanceof SourceLink)
-        {
-            try
-            {
-                var sourceLink = object;
-
-                var sourceFile = getSourceFileByHref(sourceLink.href, this.context);
-                if (sourceFile)
-                {
-                    clearNode(this.panelNode);  // replace rendered stylesheets
-                    this.showSourceFile(sourceFile);
-
-                    var lineNo = object.line;
-                    if (lineNo)
-                        this.scrollToLine(lineNo, this.jumpHighlightFactory(lineNo, this.context));
-                }
-                else // XXXjjb we should not be taking this path
-                {
-                    var stylesheet = getStyleSheetByHref(sourceLink.href, this.context);
-                    if (stylesheet)
-                        this.navigate(stylesheet);
-                    else
-                    {
-                        if (FBTrace.DBG_CSS)
-                            FBTrace.sysout("css.updateSelection no sourceFile for "+sourceLink.href, sourceLink);
-                    }
-                }
-            }
-            catch(exc) {
-                if (FBTrace.DBG_CSS)
-                    FBTrace.sysout("css.upDateSelection FAILS "+exc, exc);
-            }
-        }
-    },
-
-    updateOption: function(name, value)
-    {
-        if (name == "expandShorthandProps")
-            this.refresh();
-    },
-
-    getLocationList: function()
-    {
-        var styleSheets = getAllStyleSheets(this.context);
-        return styleSheets;
-    },
-
-    getOptionsMenuItems: function()
-    {
-        return [
-            {label: "Expand Shorthand Properties", type: "checkbox", checked: Firebug.expandShorthandProps,
-                    command: bindFixed(Firebug.togglePref, Firebug, "expandShorthandProps") },
-            "-",
-            {label: "Refresh", command: bind(this.refresh, this) }
-        ];
-    },
-
-    getContextMenuItems: function(style, target)
-    {
-        var items = [];
-
-        if (this.infoTipType == "color")
-        {
-            items.push(
-                {label: "CopyColor",
-                    command: bindFixed(copyToClipboard, FBL, this.infoTipObject) }
-            );
-        }
-        else if (this.infoTipType == "image")
-        {
-            items.push(
-                {label: "CopyImageLocation",
-                    command: bindFixed(copyToClipboard, FBL, this.infoTipObject) },
-                {label: "OpenImageInNewTab",
-                    command: bindFixed(openNewTab, FBL, this.infoTipObject) }
-            );
-        }
-
-        ///if (this.selection instanceof Element)
-        if (isElement(this.selection))
-        {
-            items.push(
-                //"-",
-                {label: "EditStyle",
-                    command: bindFixed(this.editElementStyle, this) }
-            );
-        }
-        else if (!isSystemStyleSheet(this.selection))
-        {
-            items.push(
-                    //"-",
-                    {label: "NewRule",
-                        command: bindFixed(this.insertRule, this, target) }
-                );
-        }
-
-        var cssRule = getAncestorByClass(target, "cssRule");
-        if (cssRule && hasClass(cssRule, "cssEditableRule"))
-        {
-            items.push(
-                "-",
-                {label: "NewProp",
-                    command: bindFixed(this.insertPropertyRow, this, target) }
-            );
-
-            var propRow = getAncestorByClass(target, "cssProp");
-            if (propRow)
-            {
-                var propName = getChildByClass(propRow, "cssPropName")[textContent];
-                var isDisabled = hasClass(propRow, "disabledStyle");
-
-                items.push(
-                    {label: $STRF("EditProp", [propName]), nol10n: true,
-                        command: bindFixed(this.editPropertyRow, this, propRow) },
-                    {label: $STRF("DeleteProp", [propName]), nol10n: true,
-                        command: bindFixed(this.deletePropertyRow, this, propRow) },
-                    {label: $STRF("DisableProp", [propName]), nol10n: true,
-                        type: "checkbox", checked: isDisabled,
-                        command: bindFixed(this.disablePropertyRow, this, propRow) }
-                );
-            }
-        }
-
-        items.push(
-            "-",
-            {label: "Refresh", command: bind(this.refresh, this) }
-        );
-
-        return items;
-    },
-
-    browseObject: function(object)
-    {
-        if (this.infoTipType == "image")
-        {
-            openNewTab(this.infoTipObject);
-            return true;
-        }
-    },
-
-    showInfoTip: function(infoTip, target, x, y)
-    {
-        var propValue = getAncestorByClass(target, "cssPropValue");
-        if (propValue)
-        {
-            var offset = getClientOffset(propValue);
-            var offsetX = x-offset.x;
-
-            var text = propValue[textContent];
-            var charWidth = propValue.offsetWidth/text.length;
-            var charOffset = Math.floor(offsetX/charWidth);
-
-            var cssValue = parseCSSValue(text, charOffset);
-            if (cssValue)
-            {
-                if (cssValue.value == this.infoTipValue)
-                    return true;
-
-                this.infoTipValue = cssValue.value;
-
-                if (cssValue.type == "rgb" || (!cssValue.type && isColorKeyword(cssValue.value)))
-                {
-                    this.infoTipType = "color";
-                    this.infoTipObject = cssValue.value;
-
-                    return Firebug.InfoTip.populateColorInfoTip(infoTip, cssValue.value);
-                }
-                else if (cssValue.type == "url")
-                {
-                    ///var propNameNode = target.parentNode.getElementsByClassName("cssPropName").item(0);
-                    var propNameNode = getElementByClass(target.parentNode, "cssPropName");
-                    if (propNameNode && isImageRule(propNameNode[textContent]))
-                    {
-                        var rule = Firebug.getRepObject(target);
-                        var baseURL = this.getStylesheetURL(rule);
-                        var relURL = parseURLValue(cssValue.value);
-                        var absURL = isDataURL(relURL) ? relURL:absoluteURL(relURL, baseURL);
-                        var repeat = parseRepeatValue(text);
-
-                        this.infoTipType = "image";
-                        this.infoTipObject = absURL;
-
-                        return Firebug.InfoTip.populateImageInfoTip(infoTip, absURL, repeat);
-                    }
-                }
-            }
-        }
-
-        delete this.infoTipType;
-        delete this.infoTipValue;
-        delete this.infoTipObject;
-    },
-
-    getEditor: function(target, value)
-    {
-        if (target == this.panelNode
-            || hasClass(target, "cssSelector") || hasClass(target, "cssRule")
-            || hasClass(target, "cssSheet"))
-        {
-            if (!this.ruleEditor)
-                this.ruleEditor = new CSSRuleEditor(this.document);
-
-            return this.ruleEditor;
-        }
-        else
-        {
-            if (!this.editor)
-                this.editor = new CSSEditor(this.document);
-
-            return this.editor;
-        }
-    },
-
-    getDefaultLocation: function()
-    {
-        try
-        {
-            var styleSheets = this.context.window.document.styleSheets;
-            if (styleSheets.length)
-            {
-                var sheet = styleSheets[0];
-                return (Firebug.filterSystemURLs && isSystemURL(getURLForStyleSheet(sheet))) ? null : sheet;
-            }
-        }
-        catch (exc)
-        {
-            if (FBTrace.DBG_LOCATIONS)
-                FBTrace.sysout("css.getDefaultLocation FAILS "+exc, exc);
-        }
-    },
-
-    getObjectDescription: function(styleSheet)
-    {
-        var url = getURLForStyleSheet(styleSheet);
-        var instance = getInstanceForStyleSheet(styleSheet);
-
-        var baseDescription = splitURLBase(url);
-        if (instance) {
-          baseDescription.name = baseDescription.name + " #" + (instance + 1);
-        }
-        return baseDescription;
-    },
-
-    search: function(text, reverse)
-    {
-        var curDoc = this.searchCurrentDoc(!Firebug.searchGlobal, text, reverse);
-        if (!curDoc && Firebug.searchGlobal)
-        {
-            return this.searchOtherDocs(text, reverse);
-        }
-        return curDoc;
-    },
-
-    searchOtherDocs: function(text, reverse)
-    {
-        var scanRE = Firebug.Search.getTestingRegex(text);
-        function scanDoc(styleSheet) {
-            // we don't care about reverse here as we are just looking for existence,
-            // if we do have a result we will handle the reverse logic on display
-            for (var i = 0; i < styleSheet.cssRules.length; i++)
-            {
-                if (scanRE.test(styleSheet.cssRules[i].cssText))
-                {
-                    return true;
-                }
-            }
-        }
-
-        if (this.navigateToNextDocument(scanDoc, reverse))
-        {
-            return this.searchCurrentDoc(true, text, reverse);
-        }
-    },
-
-    searchCurrentDoc: function(wrapSearch, text, reverse)
-    {
-        if (!text)
-        {
-            delete this.currentSearch;
-            return false;
-        }
-
-        var row;
-        if (this.currentSearch && text == this.currentSearch.text)
-        {
-            row = this.currentSearch.findNext(wrapSearch, false, reverse, Firebug.Search.isCaseSensitive(text));
-        }
-        else
-        {
-            if (this.editing)
-            {
-                this.currentSearch = new TextSearch(this.stylesheetEditor.box);
-                row = this.currentSearch.find(text, reverse, Firebug.Search.isCaseSensitive(text));
-
-                if (row)
-                {
-                    var sel = this.document.defaultView.getSelection();
-                    sel.removeAllRanges();
-                    sel.addRange(this.currentSearch.range);
-                    scrollSelectionIntoView(this);
-                    return true;
-                }
-                else
-                    return false;
-            }
-            else
-            {
-                function findRow(node) { return node.nodeType == 1 ? node : node.parentNode; }
-                this.currentSearch = new TextSearch(this.panelNode, findRow);
-                row = this.currentSearch.find(text, reverse, Firebug.Search.isCaseSensitive(text));
-            }
-        }
-
-        if (row)
-        {
-            this.document.defaultView.getSelection().selectAllChildren(row);
-            scrollIntoCenterView(row, this.panelNode);
-            dispatch([Firebug.A11yModel], 'onCSSSearchMatchFound', [this, text, row]);
-            return true;
-        }
-        else
-        {
-            dispatch([Firebug.A11yModel], 'onCSSSearchMatchFound', [this, text, null]);
-            return false;
-        }
-    },
-
-    getSearchOptionsMenuItems: function()
-    {
-        return [
-            Firebug.Search.searchOptionMenu("search.Case_Sensitive", "searchCaseSensitive"),
-            Firebug.Search.searchOptionMenu("search.Multiple_Files", "searchGlobal")
-        ];
-    }
-});
-/**/
-// ************************************************************************************************
-
-function CSSElementPanel() {}
-
-CSSElementPanel.prototype = extend(Firebug.CSSStyleSheetPanel.prototype,
-{
-    template: domplate(
-    {
-        cascadedTag:
-            DIV({"class": "a11yCSSView",  role : 'presentation'},
-                DIV({role : 'list', 'aria-label' : $STR('aria.labels.style rules') },
-                    FOR("rule", "$rules",
-                        TAG("$ruleTag", {rule: "$rule"})
-                    )
-                ),
-                DIV({role : "list", 'aria-label' :$STR('aria.labels.inherited style rules')},
-                    FOR("section", "$inherited",
-                        H1({"class": "cssInheritHeader groupHeader focusRow", role : 'listitem' },
-                            SPAN({"class": "cssInheritLabel"}, "$inheritLabel"),
-                            TAG(FirebugReps.Element.shortTag, {object: "$section.element"})
-                        ),
-                        DIV({role : 'group'},
-                            FOR("rule", "$section.rules",
-                                TAG("$ruleTag", {rule: "$rule"})
-                            )
-                        )
-                    )
-                 )
-            ),
-
-        ruleTag:
-            isIE ?
-            // IE needs the sourceLink first, otherwise it will be rendered outside the panel
-            DIV({"class": "cssElementRuleContainer"},
-                TAG(FirebugReps.SourceLink.tag, {object: "$rule.sourceLink"}),
-                TAG(CSSStyleRuleTag.tag, {rule: "$rule"})
-            )
-            :
-            // other browsers need the sourceLink last, otherwise it will cause an extra space
-            // before the rule representation
-            DIV({"class": "cssElementRuleContainer"},
-                TAG(CSSStyleRuleTag.tag, {rule: "$rule"}),
-                TAG(FirebugReps.SourceLink.tag, {object: "$rule.sourceLink"})
-            )
-    }),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    updateCascadeView: function(element)
-    {
-        //dispatch([Firebug.A11yModel], 'onBeforeCSSRulesAdded', [this]);
-        var rules = [], sections = [], usedProps = {};
-        this.getInheritedRules(element, sections, usedProps);
-        this.getElementRules(element, rules, usedProps);
-
-        if (rules.length || sections.length)
-        {
-            var inheritLabel = "Inherited from"; // $STR("InheritedFrom");
-            var result = this.template.cascadedTag.replace({rules: rules, inherited: sections,
-                inheritLabel: inheritLabel}, this.panelNode);
-            //dispatch([Firebug.A11yModel], 'onCSSRulesAdded', [this, result]);
-        }
-        else
-        {
-            var result = FirebugReps.Warning.tag.replace({object: "EmptyElementCSS"}, this.panelNode);
-            //dispatch([Firebug.A11yModel], 'onCSSRulesAdded', [this, result]);
-        }
-
-        // TODO: xxxpedro remove when there the external resource problem is fixed
-        if (CssAnalyzer.hasExternalStyleSheet())
-            CssAnalyzer.externalStyleSheetWarning.tag.append({
-                object: "The results here may be inaccurate because some " +
-                        "stylesheets could not be loaded due to access restrictions. ",
-                link: "more...",
-                href: "http://getfirebug.com/wiki/index.php/Firebug_Lite_FAQ#I_keep_seeing_.22This_element_has_no_style_rules.22"
-            }, this.panelNode);
-    },
-
-    getStylesheetURL: function(rule)
-    {
-        // if the parentStyleSheet.href is null, CSS std says its inline style.
-        // TODO: xxxpedro IE doesn't have rule.parentStyleSheet so we must fall back to the doc.location
-        if (rule && rule.parentStyleSheet && rule.parentStyleSheet.href)
-            return rule.parentStyleSheet.href;
-        else
-            return this.selection.ownerDocument.location.href;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    getInheritedRules: function(element, sections, usedProps)
-    {
-        var parent = element.parentNode;
-        if (parent && parent.nodeType == 1)
-        {
-            this.getInheritedRules(parent, sections, usedProps);
-
-            var rules = [];
-            this.getElementRules(parent, rules, usedProps, true);
-
-            if (rules.length)
-                sections.splice(0, 0, {element: parent, rules: rules});
-        }
-    },
-
-    getElementRules: function(element, rules, usedProps, inheritMode)
-    {
-        var inspectedRules, displayedRules = {};
-
-        inspectedRules = CssAnalyzer.getElementCSSRules(element);
-
-        if (inspectedRules)
-        {
-            for (var i = 0, length=inspectedRules.length; i < length; ++i)
-            {
-                var ruleId = inspectedRules[i];
-                var ruleData = CssAnalyzer.getRuleData(ruleId);
-                var rule = ruleData.rule;
-
-                var ssid = ruleData.styleSheetId;
-                var parentStyleSheet = StyleSheetCache.get(ssid);
-
-                var href = parentStyleSheet.externalURL ? parentStyleSheet.externalURL : parentStyleSheet.href;  // Null means inline
-
-                var instance = null;
-                //var instance = getInstanceForStyleSheet(rule.parentStyleSheet, element.ownerDocument);
-
-                var isSystemSheet = false;
-                //var isSystemSheet = isSystemStyleSheet(rule.parentStyleSheet);
-
-                if (!Firebug.showUserAgentCSS && isSystemSheet) // This removes user agent rules
-                    continue;
-
-                if (!href)
-                    href = element.ownerDocument.location.href; // http://code.google.com/p/fbug/issues/detail?id=452
-
-                var props = this.getRuleProperties(this.context, rule, inheritMode);
-                if (inheritMode && !props.length)
-                    continue;
-
-                //
-                //var line = domUtils.getRuleLine(rule);
-                // TODO: xxxpedro CSS line number
-                var line = ruleData.lineNo;
-
-                var ruleId = rule.selectorText+"/"+line;
-                var sourceLink = new SourceLink(href, line, "css", rule, instance);
-
-                this.markOverridenProps(props, usedProps, inheritMode);
-
-                rules.splice(0, 0, {rule: rule, id: ruleId,
-                        selector: ruleData.selector, sourceLink: sourceLink,
-                        props: props, inherited: inheritMode,
-                        isSystemSheet: isSystemSheet});
-            }
-        }
-
-        if (element.style)
-            this.getStyleProperties(element, rules, usedProps, inheritMode);
-
-        if (FBTrace.DBG_CSS)
-            FBTrace.sysout("getElementRules "+rules.length+" rules for "+getElementXPath(element), rules);
-    },
-    /*
-    getElementRules: function(element, rules, usedProps, inheritMode)
-    {
-        var inspectedRules, displayedRules = {};
-        try
-        {
-            inspectedRules = domUtils ? domUtils.getCSSStyleRules(element) : null;
-        } catch (exc) {}
-
-        if (inspectedRules)
-        {
-            for (var i = 0; i < inspectedRules.Count(); ++i)
-            {
-                var rule = QI(inspectedRules.GetElementAt(i), nsIDOMCSSStyleRule);
-
-                var href = rule.parentStyleSheet.href;  // Null means inline
-
-                var instance = getInstanceForStyleSheet(rule.parentStyleSheet, element.ownerDocument);
-
-                var isSystemSheet = isSystemStyleSheet(rule.parentStyleSheet);
-                if (!Firebug.showUserAgentCSS && isSystemSheet) // This removes user agent rules
-                    continue;
-                if (!href)
-                    href = element.ownerDocument.location.href; // http://code.google.com/p/fbug/issues/detail?id=452
-
-                var props = this.getRuleProperties(this.context, rule, inheritMode);
-                if (inheritMode && !props.length)
-                    continue;
-
-                var line = domUtils.getRuleLine(rule);
-                var ruleId = rule.selectorText+"/"+line;
-                var sourceLink = new SourceLink(href, line, "css", rule, instance);
-
-                this.markOverridenProps(props, usedProps, inheritMode);
-
-                rules.splice(0, 0, {rule: rule, id: ruleId,
-                        selector: rule.selectorText, sourceLink: sourceLink,
-                        props: props, inherited: inheritMode,
-                        isSystemSheet: isSystemSheet});
-            }
-        }
-
-        if (element.style)
-            this.getStyleProperties(element, rules, usedProps, inheritMode);
-
-        if (FBTrace.DBG_CSS)
-            FBTrace.sysout("getElementRules "+rules.length+" rules for "+getElementXPath(element), rules);
-    },
-    /**/
-    markOverridenProps: function(props, usedProps, inheritMode)
-    {
-        for (var i = 0; i < props.length; ++i)
-        {
-            var prop = props[i];
-            if ( usedProps.hasOwnProperty(prop.name) )
-            {
-                var deadProps = usedProps[prop.name]; // all previous occurrences of this property
-                for (var j = 0; j < deadProps.length; ++j)
-                {
-                    var deadProp = deadProps[j];
-                    if (!deadProp.disabled && !deadProp.wasInherited && deadProp.important && !prop.important)
-                        prop.overridden = true;  // new occurrence overridden
-                    else if (!prop.disabled)
-                        deadProp.overridden = true;  // previous occurrences overridden
-                }
-            }
-            else
-                usedProps[prop.name] = [];
-
-            prop.wasInherited = inheritMode ? true : false;
-            usedProps[prop.name].push(prop);  // all occurrences of a property seen so far, by name
-        }
-    },
-
-    getStyleProperties: function(element, rules, usedProps, inheritMode)
-    {
-        var props = this.parseCSSProps(element.style, inheritMode);
-        this.addOldProperties(this.context, getElementXPath(element), inheritMode, props);
-
-        sortProperties(props);
-        this.markOverridenProps(props, usedProps, inheritMode);
-
-        if (props.length)
-            rules.splice(0, 0,
-                    {rule: element, id: getElementXPath(element),
-                        selector: "element.style", props: props, inherited: inheritMode});
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends Panel
-
-    name: "css",
-    title: "Style",
-    parentPanel: "HTML",
-    order: 0,
-
-    initialize: function()
-    {
-        this.context = Firebug.chrome; // TODO: xxxpedro css2
-        this.document = Firebug.chrome.document; // TODO: xxxpedro css2
-
-        Firebug.CSSStyleSheetPanel.prototype.initialize.apply(this, arguments);
-
-        // TODO: xxxpedro css2
-        var selection = ElementCache.get(Firebug.context.persistedState.selectedHTMLElementId);
-        if (selection)
-            this.select(selection, true);
-
-        //this.updateCascadeView(document.getElementsByTagName("h1")[0]);
-        //this.updateCascadeView(document.getElementById("build"));
-
-        /*
-        this.onStateChange = bindFixed(this.contentStateCheck, this);
-        this.onHoverChange = bindFixed(this.contentStateCheck, this, STATE_HOVER);
-        this.onActiveChange = bindFixed(this.contentStateCheck, this, STATE_ACTIVE);
-        /**/
-    },
-
-    ishow: function(state)
-    {
-    },
-
-    watchWindow: function(win)
-    {
-        if (domUtils)
-        {
-            // Normally these would not be required, but in order to update after the state is set
-            // using the options menu we need to monitor these global events as well
-            var doc = win.document;
-            ///addEvent(doc, "mouseover", this.onHoverChange);
-            ///addEvent(doc, "mousedown", this.onActiveChange);
-        }
-    },
-    unwatchWindow: function(win)
-    {
-        var doc = win.document;
-        ///removeEvent(doc, "mouseover", this.onHoverChange);
-        ///removeEvent(doc, "mousedown", this.onActiveChange);
-
-        if (isAncestor(this.stateChangeEl, doc))
-        {
-            this.removeStateChangeHandlers();
-        }
-    },
-
-    supportsObject: function(object)
-    {
-        return object instanceof Element ? 1 : 0;
-    },
-
-    updateView: function(element)
-    {
-        this.updateCascadeView(element);
-        if (domUtils)
-        {
-            this.contentState = safeGetContentState(element);
-            this.addStateChangeHandlers(element);
-        }
-    },
-
-    updateSelection: function(element)
-    {
-        if ( !instanceOf(element , "Element") ) // html supports SourceLink
-            return;
-
-        if (sothinkInstalled)
-        {
-            FirebugReps.Warning.tag.replace({object: "SothinkWarning"}, this.panelNode);
-            return;
-        }
-
-        /*
-        if (!domUtils)
-        {
-            FirebugReps.Warning.tag.replace({object: "DOMInspectorWarning"}, this.panelNode);
-            return;
-        }
-        /**/
-
-        if (!element)
-            return;
-
-        this.updateView(element);
-    },
-
-    updateOption: function(name, value)
-    {
-        if (name == "showUserAgentCSS" || name == "expandShorthandProps")
-            this.refresh();
-    },
-
-    getOptionsMenuItems: function()
-    {
-        var ret = [
-            {label: "Show User Agent CSS", type: "checkbox", checked: Firebug.showUserAgentCSS,
-                    command: bindFixed(Firebug.togglePref, Firebug, "showUserAgentCSS") },
-            {label: "Expand Shorthand Properties", type: "checkbox", checked: Firebug.expandShorthandProps,
-                    command: bindFixed(Firebug.togglePref, Firebug, "expandShorthandProps") }
-        ];
-        if (domUtils && this.selection)
-        {
-            var state = safeGetContentState(this.selection);
-
-            ret.push("-");
-            ret.push({label: ":active", type: "checkbox", checked: state & STATE_ACTIVE,
-              command: bindFixed(this.updateContentState, this, STATE_ACTIVE, state & STATE_ACTIVE)});
-            ret.push({label: ":hover", type: "checkbox", checked: state & STATE_HOVER,
-              command: bindFixed(this.updateContentState, this, STATE_HOVER, state & STATE_HOVER)});
-        }
-        return ret;
-    },
-
-    updateContentState: function(state, remove)
-    {
-        domUtils.setContentState(remove ? this.selection.ownerDocument.documentElement : this.selection, state);
-        this.refresh();
-    },
-
-    addStateChangeHandlers: function(el)
-    {
-      this.removeStateChangeHandlers();
-
-      /*
-      addEvent(el, "focus", this.onStateChange);
-      addEvent(el, "blur", this.onStateChange);
-      addEvent(el, "mouseup", this.onStateChange);
-      addEvent(el, "mousedown", this.onStateChange);
-      addEvent(el, "mouseover", this.onStateChange);
-      addEvent(el, "mouseout", this.onStateChange);
-      /**/
-
-      this.stateChangeEl = el;
-    },
-
-    removeStateChangeHandlers: function()
-    {
-        var sel = this.stateChangeEl;
-        if (sel)
-        {
-            /*
-            removeEvent(sel, "focus", this.onStateChange);
-            removeEvent(sel, "blur", this.onStateChange);
-            removeEvent(sel, "mouseup", this.onStateChange);
-            removeEvent(sel, "mousedown", this.onStateChange);
-            removeEvent(sel, "mouseover", this.onStateChange);
-            removeEvent(sel, "mouseout", this.onStateChange);
-            /**/
-        }
-    },
-
-    contentStateCheck: function(state)
-    {
-        if (!state || this.contentState & state)
-        {
-            var timeoutRunner = bindFixed(function()
-            {
-                var newState = safeGetContentState(this.selection);
-                if (newState != this.contentState)
-                {
-                    this.context.invalidatePanels(this.name);
-                }
-            }, this);
-
-            // Delay exec until after the event has processed and the state has been updated
-            setTimeout(timeoutRunner, 0);
-        }
-    }
-});
-
-function safeGetContentState(selection)
-{
-    try
-    {
-        return domUtils.getContentState(selection);
-    }
-    catch (e)
-    {
-        if (FBTrace.DBG_ERRORS)
-            FBTrace.sysout("css.safeGetContentState; EXCEPTION", e);
-    }
-}
-
-// ************************************************************************************************
-
-function CSSComputedElementPanel() {}
-
-CSSComputedElementPanel.prototype = extend(CSSElementPanel.prototype,
-{
-    template: domplate(
-    {
-        computedTag:
-            DIV({"class": "a11yCSSView", role : "list", "aria-label" : $STR('aria.labels.computed styles')},
-                FOR("group", "$groups",
-                    H1({"class": "cssInheritHeader groupHeader focusRow", role : "listitem"},
-                        SPAN({"class": "cssInheritLabel"}, "$group.title")
-                    ),
-                    TABLE({width: "100%", role : 'group'},
-                        TBODY({role : 'presentation'},
-                            FOR("prop", "$group.props",
-                                TR({"class": 'focusRow computedStyleRow', role : 'listitem'},
-                                    TD({"class": "stylePropName", role : 'presentation'}, "$prop.name"),
-                                    TD({"class": "stylePropValue", role : 'presentation'}, "$prop.value")
-                                )
-                            )
-                        )
-                    )
-                )
-            )
-    }),
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    updateComputedView: function(element)
-    {
-        var win = isIE ?
-                element.ownerDocument.parentWindow :
-                element.ownerDocument.defaultView;
-
-        var style = isIE ?
-                element.currentStyle :
-                win.getComputedStyle(element, "");
-
-        var groups = [];
-
-        for (var groupName in styleGroups)
-        {
-            // TODO: xxxpedro i18n $STR
-            //var title = $STR("StyleGroup-" + groupName);
-            var title = styleGroupTitles[groupName];
-            var group = {title: title, props: []};
-            groups.push(group);
-
-            var props = styleGroups[groupName];
-            for (var i = 0; i < props.length; ++i)
-            {
-                var propName = props[i];
-                var propValue = style.getPropertyValue ?
-                        style.getPropertyValue(propName) :
-                        ""+style[toCamelCase(propName)];
-
-                if (propValue === undefined || propValue === null)
-                    continue;
-
-                propValue = stripUnits(rgbToHex(propValue));
-                if (propValue)
-                    group.props.push({name: propName, value: propValue});
-            }
-        }
-
-        var result = this.template.computedTag.replace({groups: groups}, this.panelNode);
-        //dispatch([Firebug.A11yModel], 'onCSSRulesAdded', [this, result]);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends Panel
-
-    name: "computed",
-    title: "Computed",
-    parentPanel: "HTML",
-    order: 1,
-
-    updateView: function(element)
-    {
-        this.updateComputedView(element);
-    },
-
-    getOptionsMenuItems: function()
-    {
-        return [
-            {label: "Refresh", command: bind(this.refresh, this) }
-        ];
-    }
-});
-
-// ************************************************************************************************
-// CSSEditor
-
-function CSSEditor(doc)
-{
-    this.initializeInline(doc);
-}
-
-CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
-{
-    insertNewRow: function(target, insertWhere)
-    {
-        var rule = Firebug.getRepObject(target);
-        var emptyProp =
-        {
-            // TODO: xxxpedro - uses charCode(255) to force the element being rendered,
-            // allowing webkit to get the correct position of the property name "span",
-            // when inserting a new CSS rule?
-            name: "",
-            value: "",
-            important: ""
-        };
-
-        if (insertWhere == "before")
-            return CSSPropTag.tag.insertBefore({prop: emptyProp, rule: rule}, target);
-        else
-            return CSSPropTag.tag.insertAfter({prop: emptyProp, rule: rule}, target);
-    },
-
-    saveEdit: function(target, value, previousValue)
-    {
-        // We need to check the value first in order to avoid a problem in IE8
-        // See Issue 3038: Empty (null) styles when adding CSS styles in Firebug Lite
-        if (!value) return;
-
-        target.innerHTML = escapeForCss(value);
-
-        var row = getAncestorByClass(target, "cssProp");
-        if (hasClass(row, "disabledStyle"))
-            toggleClass(row, "disabledStyle");
-
-        var rule = Firebug.getRepObject(target);
-
-        if (hasClass(target, "cssPropName"))
-        {
-            if (value && previousValue != value)  // name of property has changed.
-            {
-                var propValue = getChildByClass(row, "cssPropValue")[textContent];
-                var parsedValue = parsePriority(propValue);
-
-                if (propValue && propValue != "undefined") {
-                    if (FBTrace.DBG_CSS)
-                        FBTrace.sysout("CSSEditor.saveEdit : "+previousValue+"->"+value+" = "+propValue+"\n");
-                    if (previousValue)
-                        Firebug.CSSModule.removeProperty(rule, previousValue);
-                    Firebug.CSSModule.setProperty(rule, value, parsedValue.value, parsedValue.priority);
-                }
-            }
-            else if (!value) // name of the property has been deleted, so remove the property.
-                Firebug.CSSModule.removeProperty(rule, previousValue);
-        }
-        else if (getAncestorByClass(target, "cssPropValue"))
-        {
-            var propName = getChildByClass(row, "cssPropName")[textContent];
-            var propValue = getChildByClass(row, "cssPropValue")[textContent];
-
-            if (FBTrace.DBG_CSS)
-            {
-                FBTrace.sysout("CSSEditor.saveEdit propName=propValue: "+propName +" = "+propValue+"\n");
-               // FBTrace.sysout("CSSEditor.saveEdit BEFORE style:",style);
-            }
-
-            if (value && value != "null")
-            {
-                var parsedValue = parsePriority(value);
-                Firebug.CSSModule.setProperty(rule, propName, parsedValue.value, parsedValue.priority);
-            }
-            else if (previousValue && previousValue != "null")
-                Firebug.CSSModule.removeProperty(rule, propName);
-        }
-
-        this.panel.markChange(this.panel.name == "stylesheet");
-    },
-
-    advanceToNext: function(target, charCode)
-    {
-        if (charCode == 58 /*":"*/ && hasClass(target, "cssPropName"))
-            return true;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    getAutoCompleteRange: function(value, offset)
-    {
-        if (hasClass(this.target, "cssPropName"))
-            return {start: 0, end: value.length-1};
-        else
-            return parseCSSValue(value, offset);
-    },
-
-    getAutoCompleteList: function(preExpr, expr, postExpr)
-    {
-        if (hasClass(this.target, "cssPropName"))
-        {
-            return getCSSPropertyNames();
-        }
-        else
-        {
-            var row = getAncestorByClass(this.target, "cssProp");
-            var propName = getChildByClass(row, "cssPropName")[textContent];
-            return getCSSKeywordsByProperty(propName);
-        }
-    }
-});
-
-//************************************************************************************************
-//CSSRuleEditor
-
-function CSSRuleEditor(doc)
-{
-    this.initializeInline(doc);
-    this.completeAsYouType = false;
-}
-CSSRuleEditor.uniquifier = 0;
-CSSRuleEditor.prototype = domplate(Firebug.InlineEditor.prototype,
-{
-    insertNewRow: function(target, insertWhere)
-    {
-         var emptyRule = {
-                 selector: "",
-                 id: "",
-                 props: [],
-                 isSelectorEditable: true
-         };
-
-         if (insertWhere == "before")
-             return CSSStyleRuleTag.tag.insertBefore({rule: emptyRule}, target);
-         else
-             return CSSStyleRuleTag.tag.insertAfter({rule: emptyRule}, target);
-    },
-
-    saveEdit: function(target, value, previousValue)
-    {
-        if (FBTrace.DBG_CSS)
-            FBTrace.sysout("CSSRuleEditor.saveEdit: '" + value + "'  '" + previousValue + "'", target);
-
-        target.innerHTML = escapeForCss(value);
-
-        if (value === previousValue)     return;
-
-        var row = getAncestorByClass(target, "cssRule");
-        var styleSheet = this.panel.location;
-        styleSheet = styleSheet.editStyleSheet ? styleSheet.editStyleSheet.sheet : styleSheet;
-
-        var cssRules = styleSheet.cssRules;
-        var rule = Firebug.getRepObject(target), oldRule = rule;
-        var ruleIndex = cssRules.length;
-        if (rule || Firebug.getRepObject(row.nextSibling))
-        {
-            var searchRule = rule || Firebug.getRepObject(row.nextSibling);
-            for (ruleIndex=0; ruleIndex<cssRules.length && searchRule!=cssRules[ruleIndex]; ruleIndex++) {}
-        }
-
-        // Delete in all cases except for new add
-        // We want to do this before the insert to ease change tracking
-        if (oldRule)
-        {
-            Firebug.CSSModule.deleteRule(styleSheet, ruleIndex);
-        }
-
-        // Firefox does not follow the spec for the update selector text case.
-        // When attempting to update the value, firefox will silently fail.
-        // See https://bugzilla.mozilla.org/show_bug.cgi?id=37468 for the quite
-        // old discussion of this bug.
-        // As a result we need to recreate the style every time the selector
-        // changes.
-        if (value)
-        {
-            var cssText = [ value, "{" ];
-            var props = row.getElementsByClassName("cssProp");
-            for (var i = 0; i < props.length; i++) {
-                var propEl = props[i];
-                if (!hasClass(propEl, "disabledStyle")) {
-                    cssText.push(getChildByClass(propEl, "cssPropName")[textContent]);
-                    cssText.push(":");
-                    cssText.push(getChildByClass(propEl, "cssPropValue")[textContent]);
-                    cssText.push(";");
-                }
-            }
-            cssText.push("}");
-            cssText = cssText.join("");
-
-            try
-            {
-                var insertLoc = Firebug.CSSModule.insertRule(styleSheet, cssText, ruleIndex);
-                rule = cssRules[insertLoc];
-                ruleIndex++;
-            }
-            catch (err)
-            {
-                if (FBTrace.DBG_CSS || FBTrace.DBG_ERRORS)
-                    FBTrace.sysout("CSS Insert Error: "+err, err);
-
-                target.innerHTML = escapeForCss(previousValue);
-                row.repObject = undefined;
-                return;
-            }
-        } else {
-            rule = undefined;
-        }
-
-        // Update the rep object
-        row.repObject = rule;
-        if (!oldRule)
-        {
-            // Who knows what the domutils will return for rule line
-            // for a recently created rule. To be safe we just generate
-            // a unique value as this is only used as an internal key.
-            var ruleId = "new/"+value+"/"+(++CSSRuleEditor.uniquifier);
-            row.setAttribute("ruleId", ruleId);
-        }
-
-        this.panel.markChange(this.panel.name == "stylesheet");
-    }
-});
-
-// ************************************************************************************************
-// StyleSheetEditor
-
-function StyleSheetEditor(doc)
-{
-    this.box = this.tag.replace({}, doc, this);
-    this.input = this.box.firstChild;
-}
-
-StyleSheetEditor.prototype = domplate(Firebug.BaseEditor,
-{
-    multiLine: true,
-
-    tag: DIV(
-        TEXTAREA({"class": "styleSheetEditor fullPanelEditor", oninput: "$onInput"})
-    ),
-
-    getValue: function()
-    {
-        return this.input.value;
-    },
-
-    setValue: function(value)
-    {
-        return this.input.value = value;
-    },
-
-    show: function(target, panel, value, textSize, targetSize)
-    {
-        this.target = target;
-        this.panel = panel;
-
-        this.panel.panelNode.appendChild(this.box);
-
-        this.input.value = value;
-        this.input.focus();
-
-        var command = Firebug.chrome.$("cmd_toggleCSSEditing");
-        command.setAttribute("checked", true);
-    },
-
-    hide: function()
-    {
-        var command = Firebug.chrome.$("cmd_toggleCSSEditing");
-        command.setAttribute("checked", false);
-
-        if (this.box.parentNode == this.panel.panelNode)
-            this.panel.panelNode.removeChild(this.box);
-
-        delete this.target;
-        delete this.panel;
-        delete this.styleSheet;
-    },
-
-    saveEdit: function(target, value, previousValue)
-    {
-        Firebug.CSSModule.freeEdit(this.styleSheet, value);
-    },
-
-    endEditing: function()
-    {
-        this.panel.refresh();
-        return true;
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    onInput: function()
-    {
-        Firebug.Editor.update();
-    },
-
-    scrollToLine: function(line, offset)
-    {
-        this.startMeasuring(this.input);
-        var lineHeight = this.measureText().height;
-        this.stopMeasuring();
-
-        this.input.scrollTop = (line * lineHeight) + offset;
-    }
-});
-
-// ************************************************************************************************
-// Local Helpers
-
-var rgbToHex = function rgbToHex(value)
-{
-    return value.replace(/\brgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)/gi, rgbToHexReplacer);
-};
-
-var rgbToHexReplacer = function(_, r, g, b) {
-    return '#' + ((1 << 24) + (r << 16) + (g << 8) + (b << 0)).toString(16).substr(-6).toUpperCase();
-};
-
-var stripUnits = function stripUnits(value)
-{
-    // remove units from '0px', '0em' etc. leave non-zero units in-tact.
-    return value.replace(/(url\(.*?\)|[^0]\S*\s*)|0(%|em|ex|px|in|cm|mm|pt|pc)(\s|$)/gi, stripUnitsReplacer);
-};
-
-var stripUnitsReplacer = function(_, skip, remove, whitespace) {
-    return skip || ('0' + whitespace);
-};
-
-function parsePriority(value)
-{
-    var rePriority = /(.*?)\s*(!important)?$/;
-    var m = rePriority.exec(value);
-    var propValue = m ? m[1] : "";
-    var priority = m && m[2] ? "important" : "";
-    return {value: propValue, priority: priority};
-}
-
-function parseURLValue(value)
-{
-    var m = reURL.exec(value);
-    return m ? m[1] : "";
-}
-
-function parseRepeatValue(value)
-{
-    var m = reRepeat.exec(value);
-    return m ? m[0] : "";
-}
-
-function parseCSSValue(value, offset)
-{
-    var start = 0;
-    var m;
-    while (1)
-    {
-        m = reSplitCSS.exec(value);
-        if (m && m.index+m[0].length < offset)
-        {
-            value = value.substr(m.index+m[0].length);
-            start += m.index+m[0].length;
-            offset -= m.index+m[0].length;
-        }
-        else
-            break;
-    }
-
-    if (m)
-    {
-        var type;
-        if (m[1])
-            type = "url";
-        else if (m[2] || m[3])
-            type = "rgb";
-        else if (m[4])
-            type = "int";
-
-        return {value: m[0], start: start+m.index, end: start+m.index+(m[0].length-1), type: type};
-    }
-}
-
-function findPropByName(props, name)
-{
-    for (var i = 0; i < props.length; ++i)
-    {
-        if (props[i].name == name)
-            return i;
-    }
-}
-
-function sortProperties(props)
-{
-    props.sort(function(a, b)
-    {
-        return a.name > b.name ? 1 : -1;
-    });
-}
-
-function getTopmostRuleLine(panelNode)
-{
-    for (var child = panelNode.firstChild; child; child = child.nextSibling)
-    {
-        if (child.offsetTop+child.offsetHeight > panelNode.scrollTop)
-        {
-            var rule = child.repObject;
-            if (rule)
-                return {
-                    line: domUtils.getRuleLine(rule),
-                    offset: panelNode.scrollTop-child.offsetTop
-                };
-        }
-    }
-    return 0;
-}
-
-function getStyleSheetCSS(sheet, context)
-{
-    if (sheet.ownerNode instanceof HTMLStyleElement)
-        return sheet.ownerNode.innerHTML;
-    else
-        return context.sourceCache.load(sheet.href).join("");
-}
-
-function getStyleSheetOwnerNode(sheet) {
-    for (; sheet && !sheet.ownerNode; sheet = sheet.parentStyleSheet);
-
-    return sheet.ownerNode;
-}
-
-function scrollSelectionIntoView(panel)
-{
-    var selCon = getSelectionController(panel);
-    selCon.scrollSelectionIntoView(
-            nsISelectionController.SELECTION_NORMAL,
-            nsISelectionController.SELECTION_FOCUS_REGION, true);
-}
-
-function getSelectionController(panel)
-{
-    var browser = Firebug.chrome.getPanelBrowser(panel);
-    return browser.docShell.QueryInterface(nsIInterfaceRequestor)
-        .getInterface(nsISelectionDisplay)
-        .QueryInterface(nsISelectionController);
-}
-
-// ************************************************************************************************
-
-Firebug.registerModule(Firebug.CSSModule);
-Firebug.registerPanel(Firebug.CSSStyleSheetPanel);
-Firebug.registerPanel(CSSElementPanel);
-Firebug.registerPanel(CSSComputedElementPanel);
-
-// ************************************************************************************************
-
-}});
-
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-// ************************************************************************************************
-// Script Module
-
-Firebug.Script = extend(Firebug.Module,
-{
-    getPanel: function()
-    {
-        return Firebug.chrome ? Firebug.chrome.getPanel("Script") : null;
-    },
-
-    selectSourceCode: function(index)
-    {
-        this.getPanel().selectSourceCode(index);
-    }
-});
-
-Firebug.registerModule(Firebug.Script);
-
-
-// ************************************************************************************************
-// Script Panel
-
-function ScriptPanel(){};
-
-ScriptPanel.prototype = extend(Firebug.Panel,
-{
-    name: "Script",
-    title: "Script",
-
-    selectIndex: 0, // index of the current selectNode's option
-    sourceIndex: -1, // index of the script node, based in doc.getElementsByTagName("script")
-
-    options: {
-        hasToolButtons: true
-    },
-
-    create: function()
-    {
-        Firebug.Panel.create.apply(this, arguments);
-
-        this.onChangeSelect = bind(this.onChangeSelect, this);
-
-        var doc = Firebug.browser.document;
-        var scripts = doc.getElementsByTagName("script");
-        var selectNode = this.selectNode = createElement("select");
-
-        for(var i=0, script; script=scripts[i]; i++)
-        {
-            // Don't show Firebug Lite source code in the list of options
-            if (Firebug.ignoreFirebugElements && script.getAttribute("firebugIgnore"))
-                continue;
-
-            var fileName = getFileName(script.src) || getFileName(doc.location.href);
-            var option = createElement("option", {value:i});
-
-            option.appendChild(Firebug.chrome.document.createTextNode(fileName));
-            selectNode.appendChild(option);
-        };
-
-        this.toolButtonsNode.appendChild(selectNode);
-    },
-
-    initialize: function()
-    {
-        // we must render the code first, so the persistent state can be restore
-        this.selectSourceCode(this.selectIndex);
-
-        Firebug.Panel.initialize.apply(this, arguments);
-
-        addEvent(this.selectNode, "change", this.onChangeSelect);
-    },
-
-    shutdown: function()
-    {
-        removeEvent(this.selectNode, "change", this.onChangeSelect);
-
-        Firebug.Panel.shutdown.apply(this, arguments);
-    },
-
-    detach: function(oldChrome, newChrome)
-    {
-        Firebug.Panel.detach.apply(this, arguments);
-
-        var oldPanel = oldChrome.getPanel("Script");
-        var index = oldPanel.selectIndex;
-
-        this.selectNode.selectedIndex = index;
-        this.selectIndex = index;
-        this.sourceIndex = -1;
-    },
-
-    onChangeSelect: function(event)
-    {
-        var select = this.selectNode;
-
-        this.selectIndex = select.selectedIndex;
-
-        var option = select.options[select.selectedIndex];
-        if (!option)
-            return;
-
-        var selectedSourceIndex = parseInt(option.value);
-
-        this.renderSourceCode(selectedSourceIndex);
-    },
-
-    selectSourceCode: function(index)
-    {
-        var select = this.selectNode;
-        select.selectedIndex = index;
-
-        var option = select.options[index];
-        if (!option)
-            return;
-
-        var selectedSourceIndex = parseInt(option.value);
-
-        this.renderSourceCode(selectedSourceIndex);
-    },
-
-    renderSourceCode: function(index)
-    {
-        if (this.sourceIndex != index)
-        {
-            var renderProcess = function renderProcess(src)
-            {
-                var html = [],
-                    hl = 0;
-
-                src = isIE && !isExternal ?
-                        src+'\n' :  // IE put an extra line when reading source of local resources
-                        '\n'+src;
-
-                // find the number of lines of code
-                src = src.replace(/\n\r|\r\n/g, "\n");
-                var match = src.match(/[\n]/g);
-                var lines=match ? match.length : 0;
-
-                // render the full source code + line numbers html
-                html[hl++] = '<div><div class="sourceBox" style="left:';
-                html[hl++] = 35 + 7*(lines+'').length;
-                html[hl++] = 'px;"><pre class="sourceCode">';
-                html[hl++] = escapeHTML(src);
-                html[hl++] = '</pre></div><div class="lineNo">';
-
-                // render the line number divs
-                for(var l=1, lines; l<=lines; l++)
-                {
-                    html[hl++] = '<div line="';
-                    html[hl++] = l;
-                    html[hl++] = '">';
-                    html[hl++] = l;
-                    html[hl++] = '</div>';
-                }
-
-                html[hl++] = '</div></div>';
-
-                updatePanel(html);
-            };
-
-            var updatePanel = function(html)
-            {
-                self.panelNode.innerHTML = html.join("");
-
-                // IE needs this timeout, otherwise the panel won't scroll
-                setTimeout(function(){
-                    self.synchronizeUI();
-                },0);
-            };
-
-            var onFailure = function()
-            {
-                FirebugReps.Warning.tag.replace({object: "AccessRestricted"}, self.panelNode);
-            };
-
-            var self = this;
-
-            var doc = Firebug.browser.document;
-            var script = doc.getElementsByTagName("script")[index];
-            var url = getScriptURL(script);
-            var isExternal = url && url != doc.location.href;
-
-            try
-            {
-                if (Firebug.disableResourceFetching)
-                {
-                    renderProcess(Firebug.Lite.Proxy.fetchResourceDisabledMessage);
-                }
-                else if (isExternal)
-                {
-                    Ajax.request({url: url, onSuccess: renderProcess, onFailure: onFailure});
-                }
-                else
-                {
-                    var src = script.innerHTML;
-                    renderProcess(src);
-                }
-            }
-            catch(e)
-            {
-                onFailure();
-            }
-
-            this.sourceIndex = index;
-        }
-    }
-});
-
-Firebug.registerPanel(ScriptPanel);
-
-
-// ************************************************************************************************
-
-
-var getScriptURL = function getScriptURL(script)
-{
-    var reFile = /([^\/\?#]+)(#.+)?$/;
-    var rePath = /^(.*\/)/;
-    var reProtocol = /^\w+:\/\//;
-    var path = null;
-    var doc = Firebug.browser.document;
-
-    var file = reFile.exec(script.src);
-
-    if (file)
-    {
-        var fileName = file[1];
-        var fileOptions = file[2];
-
-        // absolute path
-        if (reProtocol.test(script.src)) {
-            path = rePath.exec(script.src)[1];
-
-        }
-        // relative path
-        else
-        {
-            var r = rePath.exec(script.src);
-            var src = r ? r[1] : script.src;
-            var backDir = /^((?:\.\.\/)+)(.*)/.exec(src);
-            var reLastDir = /^(.*\/)[^\/]+\/$/;
-            path = rePath.exec(doc.location.href)[1];
-
-            // "../some/path"
-            if (backDir)
-            {
-                var j = backDir[1].length/3;
-                var p;
-                while (j-- > 0)
-                    path = reLastDir.exec(path)[1];
-
-                path += backDir[2];
-            }
-
-            else if(src.indexOf("/") != -1)
-            {
-                // "./some/path"
-                if(/^\.\/./.test(src))
-                {
-                    path += src.substring(2);
-                }
-                // "/some/path"
-                else if(/^\/./.test(src))
-                {
-                    var domain = /^(\w+:\/\/[^\/]+)/.exec(path);
-                    path = domain[1] + src;
-                }
-                // "some/path"
-                else
-                {
-                    path += src;
-                }
-            }
-        }
-    }
-
-    var m = path && path.match(/([^\/]+)\/$/) || null;
-
-    if (path && m)
-    {
-        return path + fileName;
-    }
-};
-
-var getFileName = function getFileName(path)
-{
-    if (!path) return "";
-
-    var match = path && path.match(/[^\/]+(\?.*)?(#.*)?$/);
-
-    return match && match[0] || path;
-};
-
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var ElementCache = Firebug.Lite.Cache.Element;
-
-var insertSliceSize = 18;
-var insertInterval = 40;
-
-var ignoreVars =
-{
-    "__firebug__": 1,
-    "eval": 1,
-
-    // We are forced to ignore Java-related variables, because
-    // trying to access them causes browser freeze
-    "java": 1,
-    "sun": 1,
-    "Packages": 1,
-    "JavaArray": 1,
-    "JavaMember": 1,
-    "JavaObject": 1,
-    "JavaClass": 1,
-    "JavaPackage": 1,
-    "_firebug": 1,
-    "_FirebugConsole": 1,
-    "_FirebugCommandLine": 1
-};
-
-if (Firebug.ignoreFirebugElements)
-    ignoreVars[Firebug.Lite.Cache.ID] = 1;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-var memberPanelRep =
-    isIE6 ?
-    {"class": "memberLabel $member.type\\Label", href: "javacript:void(0)"}
-    :
-    {"class": "memberLabel $member.type\\Label"};
-
-var RowTag =
-    TR({"class": "memberRow $member.open $member.type\\Row", $hasChildren: "$member.hasChildren", role : 'presentation',
-        level: "$member.level"},
-        TD({"class": "memberLabelCell", style: "padding-left: $member.indent\\px", role : 'presentation'},
-            A(memberPanelRep,
-                SPAN({}, "$member.name")
-            )
-        ),
-        TD({"class": "memberValueCell", role : 'presentation'},
-            TAG("$member.tag", {object: "$member.value"})
-        )
-    );
-
-var WatchRowTag =
-    TR({"class": "watchNewRow", level: 0},
-        TD({"class": "watchEditCell", colspan: 2},
-            DIV({"class": "watchEditBox a11yFocusNoTab", role: "button", 'tabindex' : '0',
-                'aria-label' : $STR('press enter to add new watch expression')},
-                    $STR("NewWatch")
-            )
-        )
-    );
-
-var SizerRow =
-    TR({role : 'presentation'},
-        TD({width: "30%"}),
-        TD({width: "70%"})
-    );
-
-var domTableClass = isIElt8 ? "domTable domTableIE" : "domTable";
-var DirTablePlate = domplate(Firebug.Rep,
-{
-    tag:
-        TABLE({"class": domTableClass, cellpadding: 0, cellspacing: 0, onclick: "$onClick", role :"tree"},
-            TBODY({role: 'presentation'},
-                SizerRow,
-                FOR("member", "$object|memberIterator", RowTag)
-            )
-        ),
-
-    watchTag:
-        TABLE({"class": domTableClass, cellpadding: 0, cellspacing: 0,
-               _toggles: "$toggles", _domPanel: "$domPanel", onclick: "$onClick", role : 'tree'},
-            TBODY({role : 'presentation'},
-                SizerRow,
-                WatchRowTag
-            )
-        ),
-
-    tableTag:
-        TABLE({"class": domTableClass, cellpadding: 0, cellspacing: 0,
-            _toggles: "$toggles", _domPanel: "$domPanel", onclick: "$onClick", role : 'tree'},
-            TBODY({role : 'presentation'},
-                SizerRow
-            )
-        ),
-
-    rowTag:
-        FOR("member", "$members", RowTag),
-
-    memberIterator: function(object, level)
-    {
-        return getMembers(object, level);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    onClick: function(event)
-    {
-        if (!isLeftClick(event))
-            return;
-
-        var target = event.target || event.srcElement;
-
-        var row = getAncestorByClass(target, "memberRow");
-        var label = getAncestorByClass(target, "memberLabel");
-        if (label && hasClass(row, "hasChildren"))
-        {
-            var row = label.parentNode.parentNode;
-            this.toggleRow(row);
-        }
-        else
-        {
-            var object = Firebug.getRepObject(target);
-            if (typeof(object) == "function")
-            {
-                Firebug.chrome.select(object, "script");
-                cancelEvent(event);
-            }
-            else if (event.detail == 2 && !object)
-            {
-                var panel = row.parentNode.parentNode.domPanel;
-                if (panel)
-                {
-                    var rowValue = panel.getRowPropertyValue(row);
-                    if (typeof(rowValue) == "boolean")
-                        panel.setPropertyValue(row, !rowValue);
-                    else
-                        panel.editProperty(row);
-
-                    cancelEvent(event);
-                }
-            }
-        }
-
-        return false;
-    },
-
-    toggleRow: function(row)
-    {
-        var level = parseInt(row.getAttribute("level"));
-        var toggles = row.parentNode.parentNode.toggles;
-
-        if (hasClass(row, "opened"))
-        {
-            removeClass(row, "opened");
-
-            if (toggles)
-            {
-                var path = getPath(row);
-
-                // Remove the path from the toggle tree
-                for (var i = 0; i < path.length; ++i)
-                {
-                    if (i == path.length-1)
-                        delete toggles[path[i]];
-                    else
-                        toggles = toggles[path[i]];
-                }
-            }
-
-            var rowTag = this.rowTag;
-            var tbody = row.parentNode;
-
-            setTimeout(function()
-            {
-                for (var firstRow = row.nextSibling; firstRow; firstRow = row.nextSibling)
-                {
-                    if (parseInt(firstRow.getAttribute("level")) <= level)
-                        break;
-
-                    tbody.removeChild(firstRow);
-                }
-            }, row.insertTimeout ? row.insertTimeout : 0);
-        }
-        else
-        {
-            setClass(row, "opened");
-
-            if (toggles)
-            {
-                var path = getPath(row);
-
-                // Mark the path in the toggle tree
-                for (var i = 0; i < path.length; ++i)
-                {
-                    var name = path[i];
-                    if (toggles.hasOwnProperty(name))
-                        toggles = toggles[name];
-                    else
-                        toggles = toggles[name] = {};
-                }
-            }
-
-            var value = row.lastChild.firstChild.repObject;
-            var members = getMembers(value, level+1);
-
-            var rowTag = this.rowTag;
-            var lastRow = row;
-
-            var delay = 0;
-            //var setSize = members.length;
-            //var rowCount = 1;
-            while (members.length)
-            {
-                with({slice: members.splice(0, insertSliceSize), isLast: !members.length})
-                {
-                    setTimeout(function()
-                    {
-                        if (lastRow.parentNode)
-                        {
-                            var result = rowTag.insertRows({members: slice}, lastRow);
-                            lastRow = result[1];
-                            //dispatch([Firebug.A11yModel], 'onMemberRowSliceAdded', [null, result, rowCount, setSize]);
-                            //rowCount += insertSliceSize;
-                        }
-                        if (isLast)
-                            row.removeAttribute("insertTimeout");
-                    }, delay);
-                }
-
-                delay += insertInterval;
-            }
-
-            row.insertTimeout = delay;
-        }
-    }
-});
-
-
-
-// ************************************************************************************************
-
-Firebug.DOMBasePanel = function() {};
-
-Firebug.DOMBasePanel.prototype = extend(Firebug.Panel,
-{
-    tag: DirTablePlate.tableTag,
-
-    getRealObject: function(object)
-    {
-        // TODO: Move this to some global location
-        // TODO: Unwrapping should be centralized rather than sprinkling it around ad hoc.
-        // TODO: We might be able to make this check more authoritative with QueryInterface.
-        if (!object) return object;
-        if (object.wrappedJSObject) return object.wrappedJSObject;
-        return object;
-    },
-
-    rebuild: function(update, scrollTop)
-    {
-        //dispatch([Firebug.A11yModel], 'onBeforeDomUpdateSelection', [this]);
-        var members = getMembers(this.selection);
-        expandMembers(members, this.toggles, 0, 0);
-
-        this.showMembers(members, update, scrollTop);
-
-        //TODO: xxxpedro statusbar
-        if (!this.parentPanel)
-            updateStatusBar(this);
-    },
-
-    showMembers: function(members, update, scrollTop)
-    {
-        // If we are still in the midst of inserting rows, cancel all pending
-        // insertions here - this is a big speedup when stepping in the debugger
-        if (this.timeouts)
-        {
-            for (var i = 0; i < this.timeouts.length; ++i)
-                this.context.clearTimeout(this.timeouts[i]);
-            delete this.timeouts;
-        }
-
-        if (!members.length)
-            return this.showEmptyMembers();
-
-        var panelNode = this.panelNode;
-        var priorScrollTop = scrollTop == undefined ? panelNode.scrollTop : scrollTop;
-
-        // If we are asked to "update" the current view, then build the new table
-        // offscreen and swap it in when it's done
-        var offscreen = update && panelNode.firstChild;
-        var dest = offscreen ? panelNode.ownerDocument : panelNode;
-
-        var table = this.tag.replace({domPanel: this, toggles: this.toggles}, dest);
-        var tbody = table.lastChild;
-        var rowTag = DirTablePlate.rowTag;
-
-        // Insert the first slice immediately
-        //var slice = members.splice(0, insertSliceSize);
-        //var result = rowTag.insertRows({members: slice}, tbody.lastChild);
-
-        //var setSize = members.length;
-        //var rowCount = 1;
-
-        var panel = this;
-        var result;
-
-        //dispatch([Firebug.A11yModel], 'onMemberRowSliceAdded', [panel, result, rowCount, setSize]);
-        var timeouts = [];
-
-        var delay = 0;
-
-        // enable to measure rendering performance
-        var renderStart = new Date().getTime();
-        while (members.length)
-        {
-            with({slice: members.splice(0, insertSliceSize), isLast: !members.length})
-            {
-                timeouts.push(this.context.setTimeout(function()
-                {
-                    // TODO: xxxpedro can this be a timing error related to the
-                    // "iteration number" approach insted of "duration time"?
-                    // avoid error in IE8
-                    if (!tbody.lastChild) return;
-
-                    result = rowTag.insertRows({members: slice}, tbody.lastChild);
-
-                    //rowCount += insertSliceSize;
-                    //dispatch([Firebug.A11yModel], 'onMemberRowSliceAdded', [panel, result, rowCount, setSize]);
-
-                    if ((panelNode.scrollHeight+panelNode.offsetHeight) >= priorScrollTop)
-                        panelNode.scrollTop = priorScrollTop;
-
-
-                    // enable to measure rendering performance
-                    //if (isLast) alert(new Date().getTime() - renderStart + "ms");
-
-
-                }, delay));
-
-                delay += insertInterval;
-            }
-        }
-
-        if (offscreen)
-        {
-            timeouts.push(this.context.setTimeout(function()
-            {
-                if (panelNode.firstChild)
-                    panelNode.replaceChild(table, panelNode.firstChild);
-                else
-                    panelNode.appendChild(table);
-
-                // Scroll back to where we were before
-                panelNode.scrollTop = priorScrollTop;
-            }, delay));
-        }
-        else
-        {
-            timeouts.push(this.context.setTimeout(function()
-            {
-                panelNode.scrollTop = scrollTop == undefined ? 0 : scrollTop;
-            }, delay));
-        }
-        this.timeouts = timeouts;
-    },
-
-    /*
-    // new
-    showMembers: function(members, update, scrollTop)
-    {
-        // If we are still in the midst of inserting rows, cancel all pending
-        // insertions here - this is a big speedup when stepping in the debugger
-        if (this.timeouts)
-        {
-            for (var i = 0; i < this.timeouts.length; ++i)
-                this.context.clearTimeout(this.timeouts[i]);
-            delete this.timeouts;
-        }
-
-        if (!members.length)
-            return this.showEmptyMembers();
-
-        var panelNode = this.panelNode;
-        var priorScrollTop = scrollTop == undefined ? panelNode.scrollTop : scrollTop;
-
-        // If we are asked to "update" the current view, then build the new table
-        // offscreen and swap it in when it's done
-        var offscreen = update && panelNode.firstChild;
-        var dest = offscreen ? panelNode.ownerDocument : panelNode;
-
-        var table = this.tag.replace({domPanel: this, toggles: this.toggles}, dest);
-        var tbody = table.lastChild;
-        var rowTag = DirTablePlate.rowTag;
-
-        // Insert the first slice immediately
-        //var slice = members.splice(0, insertSliceSize);
-        //var result = rowTag.insertRows({members: slice}, tbody.lastChild);
-
-        //var setSize = members.length;
-        //var rowCount = 1;
-
-        var panel = this;
-        var result;
-
-        //dispatch([Firebug.A11yModel], 'onMemberRowSliceAdded', [panel, result, rowCount, setSize]);
-        var timeouts = [];
-
-        var delay = 0;
-        var _insertSliceSize = insertSliceSize;
-        var _insertInterval = insertInterval;
-
-        // enable to measure rendering performance
-        var renderStart = new Date().getTime();
-        var lastSkip = renderStart, now;
-
-        while (members.length)
-        {
-            with({slice: members.splice(0, _insertSliceSize), isLast: !members.length})
-            {
-                var _tbody = tbody;
-                var _rowTag = rowTag;
-                var _panelNode = panelNode;
-                var _priorScrollTop = priorScrollTop;
-
-                timeouts.push(this.context.setTimeout(function()
-                {
-                    // TODO: xxxpedro can this be a timing error related to the
-                    // "iteration number" approach insted of "duration time"?
-                    // avoid error in IE8
-                    if (!_tbody.lastChild) return;
-
-                    result = _rowTag.insertRows({members: slice}, _tbody.lastChild);
-
-                    //rowCount += _insertSliceSize;
-                    //dispatch([Firebug.A11yModel], 'onMemberRowSliceAdded', [panel, result, rowCount, setSize]);
-
-                    if ((_panelNode.scrollHeight + _panelNode.offsetHeight) >= _priorScrollTop)
-                        _panelNode.scrollTop = _priorScrollTop;
-
-
-                    // enable to measure rendering performance
-                    //alert("gap: " + (new Date().getTime() - lastSkip));
-                    //lastSkip = new Date().getTime();
-
-                    //if (isLast) alert("new: " + (new Date().getTime() - renderStart) + "ms");
-
-                }, delay));
-
-                delay += _insertInterval;
-            }
-        }
-
-        if (offscreen)
-        {
-            timeouts.push(this.context.setTimeout(function()
-            {
-                if (panelNode.firstChild)
-                    panelNode.replaceChild(table, panelNode.firstChild);
-                else
-                    panelNode.appendChild(table);
-
-                // Scroll back to where we were before
-                panelNode.scrollTop = priorScrollTop;
-            }, delay));
-        }
-        else
-        {
-            timeouts.push(this.context.setTimeout(function()
-            {
-                panelNode.scrollTop = scrollTop == undefined ? 0 : scrollTop;
-            }, delay));
-        }
-        this.timeouts = timeouts;
-    },
-    /**/
-
-    showEmptyMembers: function()
-    {
-        FirebugReps.Warning.tag.replace({object: "NoMembersWarning"}, this.panelNode);
-    },
-
-    findPathObject: function(object)
-    {
-        var pathIndex = -1;
-        for (var i = 0; i < this.objectPath.length; ++i)
-        {
-            // IE needs === instead of == or otherwise some objects will
-            // be considered equal to different objects, returning the
-            // wrong index of the objectPath array
-            if (this.getPathObject(i) === object)
-                return i;
-        }
-
-        return -1;
-    },
-
-    getPathObject: function(index)
-    {
-        var object = this.objectPath[index];
-
-        if (object instanceof Property)
-            return object.getObject();
-        else
-            return object;
-    },
-
-    getRowObject: function(row)
-    {
-        var object = getRowOwnerObject(row);
-        return object ? object : this.selection;
-    },
-
-    getRowPropertyValue: function(row)
-    {
-        var object = this.getRowObject(row);
-        object = this.getRealObject(object);
-        if (object)
-        {
-            var propName = getRowName(row);
-
-            if (object instanceof jsdIStackFrame)
-                return Firebug.Debugger.evaluate(propName, this.context);
-            else
-                return object[propName];
-        }
-    },
-    /*
-    copyProperty: function(row)
-    {
-        var value = this.getRowPropertyValue(row);
-        copyToClipboard(value);
-    },
-
-    editProperty: function(row, editValue)
-    {
-        if (hasClass(row, "watchNewRow"))
-        {
-            if (this.context.stopped)
-                Firebug.Editor.startEditing(row, "");
-            else if (Firebug.Console.isAlwaysEnabled())  // not stopped in debugger, need command line
-            {
-                if (Firebug.CommandLine.onCommandLineFocus())
-                    Firebug.Editor.startEditing(row, "");
-                else
-                    row.innerHTML = $STR("warning.Command line blocked?");
-            }
-            else
-                row.innerHTML = $STR("warning.Console must be enabled");
-        }
-        else if (hasClass(row, "watchRow"))
-            Firebug.Editor.startEditing(row, getRowName(row));
-        else
-        {
-            var object = this.getRowObject(row);
-            this.context.thisValue = object;
-
-            if (!editValue)
-            {
-                var propValue = this.getRowPropertyValue(row);
-
-                var type = typeof(propValue);
-                if (type == "undefined" || type == "number" || type == "boolean")
-                    editValue = propValue;
-                else if (type == "string")
-                    editValue = "\"" + escapeJS(propValue) + "\"";
-                else if (propValue == null)
-                    editValue = "null";
-                else if (object instanceof Window || object instanceof jsdIStackFrame)
-                    editValue = getRowName(row);
-                else
-                    editValue = "this." + getRowName(row);
-            }
-
-
-            Firebug.Editor.startEditing(row, editValue);
-        }
-    },
-
-    deleteProperty: function(row)
-    {
-        if (hasClass(row, "watchRow"))
-            this.deleteWatch(row);
-        else
-        {
-            var object = getRowOwnerObject(row);
-            if (!object)
-                object = this.selection;
-            object = this.getRealObject(object);
-
-            if (object)
-            {
-                var name = getRowName(row);
-                try
-                {
-                    delete object[name];
-                }
-                catch (exc)
-                {
-                    return;
-                }
-
-                this.rebuild(true);
-                this.markChange();
-            }
-        }
-    },
-
-    setPropertyValue: function(row, value)  // value must be string
-    {
-        if(FBTrace.DBG_DOM)
-        {
-            FBTrace.sysout("row: "+row);
-            FBTrace.sysout("value: "+value+" type "+typeof(value), value);
-        }
-
-        var name = getRowName(row);
-        if (name == "this")
-            return;
-
-        var object = this.getRowObject(row);
-        object = this.getRealObject(object);
-        if (object && !(object instanceof jsdIStackFrame))
-        {
-             // unwrappedJSObject.property = unwrappedJSObject
-             Firebug.CommandLine.evaluate(value, this.context, object, this.context.getGlobalScope(),
-                 function success(result, context)
-                 {
-                     if (FBTrace.DBG_DOM)
-                         FBTrace.sysout("setPropertyValue evaluate success object["+name+"]="+result+" type "+typeof(result), result);
-                     object[name] = result;
-                 },
-                 function failed(exc, context)
-                 {
-                     try
-                     {
-                         if (FBTrace.DBG_DOM)
-                              FBTrace.sysout("setPropertyValue evaluate failed with exc:"+exc+" object["+name+"]="+value+" type "+typeof(value), exc);
-                         // If the value doesn't parse, then just store it as a string.  Some users will
-                         // not realize they're supposed to enter a JavaScript expression and just type
-                         // literal text
-                         object[name] = String(value);  // unwrappedJSobject.property = string
-                     }
-                     catch (exc)
-                     {
-                         return;
-                     }
-                  }
-             );
-        }
-        else if (this.context.stopped)
-        {
-            try
-            {
-                Firebug.CommandLine.evaluate(name+"="+value, this.context);
-            }
-            catch (exc)
-            {
-                try
-                {
-                    // See catch block above...
-                    object[name] = String(value); // unwrappedJSobject.property = string
-                }
-                catch (exc)
-                {
-                    return;
-                }
-            }
-        }
-
-        this.rebuild(true);
-        this.markChange();
-    },
-
-    highlightRow: function(row)
-    {
-        if (this.highlightedRow)
-            cancelClassTimed(this.highlightedRow, "jumpHighlight", this.context);
-
-        this.highlightedRow = row;
-
-        if (row)
-            setClassTimed(row, "jumpHighlight", this.context);
-    },/**/
-
-    onMouseMove: function(event)
-    {
-        var target = event.srcElement || event.target;
-
-        var object = getAncestorByClass(target, "objectLink-element");
-        object = object ? object.repObject : null;
-
-        if(object && instanceOf(object, "Element") && object.nodeType == 1)
-        {
-            if(object != lastHighlightedObject)
-            {
-                Firebug.Inspector.drawBoxModel(object);
-                object = lastHighlightedObject;
-            }
-        }
-        else
-            Firebug.Inspector.hideBoxModel();
-
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends Panel
-
-    create: function()
-    {
-        // TODO: xxxpedro
-        this.context = Firebug.browser;
-
-        this.objectPath = [];
-        this.propertyPath = [];
-        this.viewPath = [];
-        this.pathIndex = -1;
-        this.toggles = {};
-
-        Firebug.Panel.create.apply(this, arguments);
-
-        this.panelNode.style.padding = "0 1px";
-    },
-
-    initialize: function(){
-        Firebug.Panel.initialize.apply(this, arguments);
-
-        addEvent(this.panelNode, "mousemove", this.onMouseMove);
-    },
-
-    shutdown: function()
-    {
-        removeEvent(this.panelNode, "mousemove", this.onMouseMove);
-
-        Firebug.Panel.shutdown.apply(this, arguments);
-    },
-
-    /*
-    destroy: function(state)
-    {
-        var view = this.viewPath[this.pathIndex];
-        if (view && this.panelNode.scrollTop)
-            view.scrollTop = this.panelNode.scrollTop;
-
-        if (this.pathIndex)
-            state.pathIndex = this.pathIndex;
-        if (this.viewPath)
-            state.viewPath = this.viewPath;
-        if (this.propertyPath)
-            state.propertyPath = this.propertyPath;
-
-        if (this.propertyPath.length > 0 && !this.propertyPath[1])
-            state.firstSelection = persistObject(this.getPathObject(1), this.context);
-
-        Firebug.Panel.destroy.apply(this, arguments);
-    },
-    /**/
-
-    ishow: function(state)
-    {
-        if (this.context.loaded && !this.selection)
-        {
-            if (!state)
-            {
-                this.select(null);
-                return;
-            }
-            if (state.viewPath)
-                this.viewPath = state.viewPath;
-            if (state.propertyPath)
-                this.propertyPath = state.propertyPath;
-
-            var defaultObject = this.getDefaultSelection(this.context);
-            var selectObject = defaultObject;
-
-            if (state.firstSelection)
-            {
-                var restored = state.firstSelection(this.context);
-                if (restored)
-                {
-                    selectObject = restored;
-                    this.objectPath = [defaultObject, restored];
-                }
-                else
-                    this.objectPath = [defaultObject];
-            }
-            else
-                this.objectPath = [defaultObject];
-
-            if (this.propertyPath.length > 1)
-            {
-                for (var i = 1; i < this.propertyPath.length; ++i)
-                {
-                    var name = this.propertyPath[i];
-                    if (!name)
-                        continue;
-
-                    var object = selectObject;
-                    try
-                    {
-                        selectObject = object[name];
-                    }
-                    catch (exc)
-                    {
-                        selectObject = null;
-                    }
-
-                    if (selectObject)
-                    {
-                        this.objectPath.push(new Property(object, name));
-                    }
-                    else
-                    {
-                        // If we can't access a property, just stop
-                        this.viewPath.splice(i);
-                        this.propertyPath.splice(i);
-                        this.objectPath.splice(i);
-                        selectObject = this.getPathObject(this.objectPath.length-1);
-                        break;
-                    }
-                }
-            }
-
-            var selection = state.pathIndex <= this.objectPath.length-1
-                ? this.getPathObject(state.pathIndex)
-                : this.getPathObject(this.objectPath.length-1);
-
-            this.select(selection);
-        }
-    },
-    /*
-    hide: function()
-    {
-        var view = this.viewPath[this.pathIndex];
-        if (view && this.panelNode.scrollTop)
-            view.scrollTop = this.panelNode.scrollTop;
-    },
-    /**/
-
-    supportsObject: function(object)
-    {
-        if (object == null)
-            return 1000;
-
-        if (typeof(object) == "undefined")
-            return 1000;
-        else if (object instanceof SourceLink)
-            return 0;
-        else
-            return 1; // just agree to support everything but not agressively.
-    },
-
-    refresh: function()
-    {
-        this.rebuild(true);
-    },
-
-    updateSelection: function(object)
-    {
-        var previousIndex = this.pathIndex;
-        var previousView = previousIndex == -1 ? null : this.viewPath[previousIndex];
-
-        var newPath = this.pathToAppend;
-        delete this.pathToAppend;
-
-        var pathIndex = this.findPathObject(object);
-        if (newPath || pathIndex == -1)
-        {
-            this.toggles = {};
-
-            if (newPath)
-            {
-                // Remove everything after the point where we are inserting, so we
-                // essentially replace it with the new path
-                if (previousView)
-                {
-                    if (this.panelNode.scrollTop)
-                        previousView.scrollTop = this.panelNode.scrollTop;
-
-                    var start = previousIndex + 1,
-                        // Opera needs the length argument in splice(), otherwise
-                        // it will consider that only one element should be removed
-                        length = this.objectPath.length - start;
-
-                    this.objectPath.splice(start, length);
-                    this.propertyPath.splice(start, length);
-                    this.viewPath.splice(start, length);
-                }
-
-                var value = this.getPathObject(previousIndex);
-                if (!value)
-                {
-                    if (FBTrace.DBG_ERRORS)
-                        FBTrace.sysout("dom.updateSelection no pathObject for "+previousIndex+"\n");
-                    return;
-                }
-
-                for (var i = 0, length = newPath.length; i < length; ++i)
-                {
-                    var name = newPath[i];
-                    var object = value;
-                    try
-                    {
-                        value = value[name];
-                    }
-                    catch(exc)
-                    {
-                        if (FBTrace.DBG_ERRORS)
-                                FBTrace.sysout("dom.updateSelection FAILS at path_i="+i+" for name:"+name+"\n");
-                        return;
-                    }
-
-                    ++this.pathIndex;
-                    this.objectPath.push(new Property(object, name));
-                    this.propertyPath.push(name);
-                    this.viewPath.push({toggles: this.toggles, scrollTop: 0});
-                }
-            }
-            else
-            {
-                this.toggles = {};
-
-                var win = Firebug.browser.window;
-                //var win = this.context.getGlobalScope();
-                if (object === win)
-                {
-                    this.pathIndex = 0;
-                    this.objectPath = [win];
-                    this.propertyPath = [null];
-                    this.viewPath = [{toggles: this.toggles, scrollTop: 0}];
-                }
-                else
-                {
-                    this.pathIndex = 1;
-                    this.objectPath = [win, object];
-                    this.propertyPath = [null, null];
-                    this.viewPath = [
-                        {toggles: {}, scrollTop: 0},
-                        {toggles: this.toggles, scrollTop: 0}
-                    ];
-                }
-            }
-
-            this.panelNode.scrollTop = 0;
-            this.rebuild();
-        }
-        else
-        {
-            this.pathIndex = pathIndex;
-
-            var view = this.viewPath[pathIndex];
-            this.toggles = view.toggles;
-
-            // Persist the current scroll location
-            if (previousView && this.panelNode.scrollTop)
-                previousView.scrollTop = this.panelNode.scrollTop;
-
-            this.rebuild(false, view.scrollTop);
-        }
-    },
-
-    getObjectPath: function(object)
-    {
-        return this.objectPath;
-    },
-
-    getDefaultSelection: function()
-    {
-        return Firebug.browser.window;
-        //return this.context.getGlobalScope();
-    }/*,
-
-    updateOption: function(name, value)
-    {
-        const optionMap = {showUserProps: 1, showUserFuncs: 1, showDOMProps: 1,
-            showDOMFuncs: 1, showDOMConstants: 1};
-        if ( optionMap.hasOwnProperty(name) )
-            this.rebuild(true);
-    },
-
-    getOptionsMenuItems: function()
-    {
-        return [
-            optionMenu("ShowUserProps", "showUserProps"),
-            optionMenu("ShowUserFuncs", "showUserFuncs"),
-            optionMenu("ShowDOMProps", "showDOMProps"),
-            optionMenu("ShowDOMFuncs", "showDOMFuncs"),
-            optionMenu("ShowDOMConstants", "showDOMConstants"),
-            "-",
-            {label: "Refresh", command: bindFixed(this.rebuild, this, true) }
-        ];
-    },
-
-    getContextMenuItems: function(object, target)
-    {
-        var row = getAncestorByClass(target, "memberRow");
-
-        var items = [];
-
-        if (row)
-        {
-            var rowName = getRowName(row);
-            var rowObject = this.getRowObject(row);
-            var rowValue = this.getRowPropertyValue(row);
-
-            var isWatch = hasClass(row, "watchRow");
-            var isStackFrame = rowObject instanceof jsdIStackFrame;
-
-            if (typeof(rowValue) == "string" || typeof(rowValue) == "number")
-            {
-                // Functions already have a copy item in their context menu
-                items.push(
-                    "-",
-                    {label: "CopyValue",
-                        command: bindFixed(this.copyProperty, this, row) }
-                );
-            }
-
-            items.push(
-                "-",
-                {label: isWatch ? "EditWatch" : (isStackFrame ? "EditVariable" : "EditProperty"),
-                    command: bindFixed(this.editProperty, this, row) }
-            );
-
-            if (isWatch || (!isStackFrame && !isDOMMember(rowObject, rowName)))
-            {
-                items.push(
-                    {label: isWatch ? "DeleteWatch" : "DeleteProperty",
-                        command: bindFixed(this.deleteProperty, this, row) }
-                );
-            }
-        }
-
-        items.push(
-            "-",
-            {label: "Refresh", command: bindFixed(this.rebuild, this, true) }
-        );
-
-        return items;
-    },
-
-    getEditor: function(target, value)
-    {
-        if (!this.editor)
-            this.editor = new DOMEditor(this.document);
-
-        return this.editor;
-    }/**/
-});
-
-// ************************************************************************************************
-
-// TODO: xxxpedro statusbar
-var updateStatusBar = function(panel)
-{
-    var path = panel.propertyPath;
-    var index = panel.pathIndex;
-
-    var r = [];
-
-    for (var i=0, l=path.length; i<l; i++)
-    {
-        r.push(i==index ? '<a class="fbHover fbButton fbBtnSelected" ' : '<a class="fbHover fbButton" ');
-        r.push('pathIndex=');
-        r.push(i);
-
-        if(isIE6)
-            r.push(' href="javascript:void(0)"');
-
-        r.push('>');
-        r.push(i==0 ? "window" : path[i] || "Object");
-        r.push('</a>');
-
-        if(i < l-1)
-            r.push('<span class="fbStatusSeparator">&gt;</span>');
-    }
-    panel.statusBarNode.innerHTML = r.join("");
-};
-
-
-var DOMMainPanel = Firebug.DOMPanel = function () {};
-
-Firebug.DOMPanel.DirTable = DirTablePlate;
-
-DOMMainPanel.prototype = extend(Firebug.DOMBasePanel.prototype,
-{
-    onClickStatusBar: function(event)
-    {
-        var target = event.srcElement || event.target;
-        var element = getAncestorByClass(target, "fbHover");
-
-        if(element)
-        {
-            var pathIndex = element.getAttribute("pathIndex");
-
-            if(pathIndex)
-            {
-                this.select(this.getPathObject(pathIndex));
-            }
-        }
-    },
-
-    selectRow: function(row, target)
-    {
-        if (!target)
-            target = row.lastChild.firstChild;
-
-        if (!target || !target.repObject)
-            return;
-
-        this.pathToAppend = getPath(row);
-
-        // If the object is inside an array, look up its index
-        var valueBox = row.lastChild.firstChild;
-        if (hasClass(valueBox, "objectBox-array"))
-        {
-            var arrayIndex = FirebugReps.Arr.getItemIndex(target);
-            this.pathToAppend.push(arrayIndex);
-        }
-
-        // Make sure we get a fresh status path for the object, since otherwise
-        // it might find the object in the existing path and not refresh it
-        //Firebug.chrome.clearStatusPath();
-
-        this.select(target.repObject, true);
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    onClick: function(event)
-    {
-        var target = event.srcElement || event.target;
-        var repNode = Firebug.getRepNode(target);
-        if (repNode)
-        {
-            var row = getAncestorByClass(target, "memberRow");
-            if (row)
-            {
-                this.selectRow(row, repNode);
-                cancelEvent(event);
-            }
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends Panel
-
-    name: "DOM",
-    title: "DOM",
-    searchable: true,
-    statusSeparator: ">",
-
-    options: {
-        hasToolButtons: true,
-        hasStatusBar: true
-    },
-
-    create: function()
-    {
-        Firebug.DOMBasePanel.prototype.create.apply(this, arguments);
-
-        this.onClick = bind(this.onClick, this);
-
-        //TODO: xxxpedro
-        this.onClickStatusBar = bind(this.onClickStatusBar, this);
-
-        this.panelNode.style.padding = "0 1px";
-    },
-
-    initialize: function(oldPanelNode)
-    {
-        //this.panelNode.addEventListener("click", this.onClick, false);
-        //dispatch([Firebug.A11yModel], 'onInitializeNode', [this, 'console']);
-
-        Firebug.DOMBasePanel.prototype.initialize.apply(this, arguments);
-
-        addEvent(this.panelNode, "click", this.onClick);
-
-        // TODO: xxxpedro dom
-        this.ishow();
-
-        //TODO: xxxpedro
-        addEvent(this.statusBarNode, "click", this.onClickStatusBar);
-    },
-
-    shutdown: function()
-    {
-        //this.panelNode.removeEventListener("click", this.onClick, false);
-        //dispatch([Firebug.A11yModel], 'onDestroyNode', [this, 'console']);
-
-        removeEvent(this.panelNode, "click", this.onClick);
-
-        Firebug.DOMBasePanel.prototype.shutdown.apply(this, arguments);
-    }/*,
-
-    search: function(text, reverse)
-    {
-        if (!text)
-        {
-            delete this.currentSearch;
-            this.highlightRow(null);
-            return false;
-        }
-
-        var row;
-        if (this.currentSearch && text == this.currentSearch.text)
-            row = this.currentSearch.findNext(true, undefined, reverse, Firebug.searchCaseSensitive);
-        else
-        {
-            function findRow(node) { return getAncestorByClass(node, "memberRow"); }
-            this.currentSearch = new TextSearch(this.panelNode, findRow);
-            row = this.currentSearch.find(text, reverse, Firebug.searchCaseSensitive);
-        }
-
-        if (row)
-        {
-            var sel = this.document.defaultView.getSelection();
-            sel.removeAllRanges();
-            sel.addRange(this.currentSearch.range);
-
-            scrollIntoCenterView(row, this.panelNode);
-
-            this.highlightRow(row);
-            dispatch([Firebug.A11yModel], 'onDomSearchMatchFound', [this, text, row]);
-            return true;
-        }
-        else
-        {
-            dispatch([Firebug.A11yModel], 'onDomSearchMatchFound', [this, text, null]);
-            return false;
-        }
-    }/**/
-});
-
-Firebug.registerPanel(DOMMainPanel);
-
-
-// ************************************************************************************************
-
-
-
-// ************************************************************************************************
-// Local Helpers
-
-var getMembers = function getMembers(object, level)  // we expect object to be user-level object wrapped in security blanket
-{
-    if (!level)
-        level = 0;
-
-    var ordinals = [], userProps = [], userClasses = [], userFuncs = [],
-        domProps = [], domFuncs = [], domConstants = [];
-
-    try
-    {
-        var domMembers = getDOMMembers(object);
-        //var domMembers = {}; // TODO: xxxpedro
-        //var domConstantMap = {};  // TODO: xxxpedro
-
-        if (object.wrappedJSObject)
-            var insecureObject = object.wrappedJSObject;
-        else
-            var insecureObject = object;
-
-        // IE function prototype is not listed in (for..in)
-        if (isIE && isFunction(object))
-            addMember("user", userProps, "prototype", object.prototype, level);
-
-        for (var name in insecureObject)  // enumeration is safe
-        {
-            if (ignoreVars[name] == 1)  // javascript.options.strict says ignoreVars is undefined.
-                continue;
-
-            var val;
-            try
-            {
-                val = insecureObject[name];  // getter is safe
-            }
-            catch (exc)
-            {
-                // Sometimes we get exceptions trying to access certain members
-                if (FBTrace.DBG_ERRORS && FBTrace.DBG_DOM)
-                    FBTrace.sysout("dom.getMembers cannot access "+name, exc);
-            }
-
-            var ordinal = parseInt(name);
-            if (ordinal || ordinal == 0)
-            {
-                addMember("ordinal", ordinals, name, val, level);
-            }
-            else if (isFunction(val))
-            {
-                if (isClassFunction(val) && !(name in domMembers))
-                    addMember("userClass", userClasses, name, val, level);
-                else if (name in domMembers)
-                    addMember("domFunction", domFuncs, name, val, level, domMembers[name]);
-                else
-                    addMember("userFunction", userFuncs, name, val, level);
-            }
-            else
-            {
-                //TODO: xxxpedro
-                /*
-                var getterFunction = insecureObject.__lookupGetter__(name),
-                    setterFunction = insecureObject.__lookupSetter__(name),
-                    prefix = "";
-
-                if(getterFunction && !setterFunction)
-                    prefix = "get ";
-                /**/
-
-                var prefix = "";
-
-                if (name in domMembers && !(name in domConstantMap))
-                    addMember("dom", domProps, (prefix+name), val, level, domMembers[name]);
-                else if (name in domConstantMap)
-                    addMember("dom", domConstants, (prefix+name), val, level);
-                else
-                    addMember("user", userProps, (prefix+name), val, level);
-            }
-        }
-    }
-    catch (exc)
-    {
-        // Sometimes we get exceptions just from trying to iterate the members
-        // of certain objects, like StorageList, but don't let that gum up the works
-        throw exc;
-        if (FBTrace.DBG_ERRORS && FBTrace.DBG_DOM)
-            FBTrace.sysout("dom.getMembers FAILS: ", exc);
-        //throw exc;
-    }
-
-    function sortName(a, b) { return a.name > b.name ? 1 : -1; }
-    function sortOrder(a, b) { return a.order > b.order ? 1 : -1; }
-
-    var members = [];
-
-    members.push.apply(members, ordinals);
-
-    Firebug.showUserProps = true; // TODO: xxxpedro
-    Firebug.showUserFuncs = true; // TODO: xxxpedro
-    Firebug.showDOMProps = true;
-    Firebug.showDOMFuncs = true;
-    Firebug.showDOMConstants = true;
-
-    if (Firebug.showUserProps)
-    {
-        userProps.sort(sortName);
-        members.push.apply(members, userProps);
-    }
-
-    if (Firebug.showUserFuncs)
-    {
-        userClasses.sort(sortName);
-        members.push.apply(members, userClasses);
-
-        userFuncs.sort(sortName);
-        members.push.apply(members, userFuncs);
-    }
-
-    if (Firebug.showDOMProps)
-    {
-        domProps.sort(sortName);
-        members.push.apply(members, domProps);
-    }
-
-    if (Firebug.showDOMFuncs)
-    {
-        domFuncs.sort(sortName);
-        members.push.apply(members, domFuncs);
-    }
-
-    if (Firebug.showDOMConstants)
-        members.push.apply(members, domConstants);
-
-    return members;
-};
-
-function expandMembers(members, toggles, offset, level)  // recursion starts with offset=0, level=0
-{
-    var expanded = 0;
-    for (var i = offset; i < members.length; ++i)
-    {
-        var member = members[i];
-        if (member.level > level)
-            break;
-
-        if ( toggles.hasOwnProperty(member.name) )
-        {
-            member.open = "opened";  // member.level <= level && member.name in toggles.
-
-            var newMembers = getMembers(member.value, level+1);  // sets newMembers.level to level+1
-
-            var args = [i+1, 0];
-            args.push.apply(args, newMembers);
-            members.splice.apply(members, args);
-
-            /*
-            if (FBTrace.DBG_DOM)
-            {
-                FBTrace.sysout("expandMembers member.name", member.name);
-                FBTrace.sysout("expandMembers toggles", toggles);
-                FBTrace.sysout("expandMembers toggles[member.name]", toggles[member.name]);
-                FBTrace.sysout("dom.expandedMembers level: "+level+" member", member);
-            }
-            /**/
-
-            expanded += newMembers.length;
-            i += newMembers.length + expandMembers(members, toggles[member.name], i+1, level+1);
-        }
-    }
-
-    return expanded;
-}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-
-function isClassFunction(fn)
-{
-    try
-    {
-        for (var name in fn.prototype)
-            return true;
-    } catch (exc) {}
-    return false;
-}
-
-// FIXME: xxxpedro This function is already defined in Lib. If we keep this definition here, it
-// will crash IE9 when not running the IE Developer Tool with JavaScript Debugging enabled!!!
-// Check if this function is in fact defined in Firebug for Firefox. If so, we should remove
-// this from here. The only difference of this function is the IE hack to show up the prototype
-// of functions, but Firebug no longer shows the prototype for simple functions.
-//var hasProperties = function hasProperties(ob)
-//{
-//    try
-//    {
-//        for (var name in ob)
-//            return true;
-//    } catch (exc) {}
-//
-//    // IE function prototype is not listed in (for..in)
-//    if (isFunction(ob)) return true;
-//
-//    return false;
-//};
-
-FBL.ErrorCopy = function(message)
-{
-    this.message = message;
-};
-
-var addMember = function addMember(type, props, name, value, level, order)
-{
-    var rep = Firebug.getRep(value);    // do this first in case a call to instanceof reveals contents
-    var tag = rep.shortTag ? rep.shortTag : rep.tag;
-
-    var ErrorCopy = function(){}; //TODO: xxxpedro
-
-    var valueType = typeof(value);
-    var hasChildren = hasProperties(value) && !(value instanceof ErrorCopy) &&
-        (isFunction(value) || (valueType == "object" && value != null)
-        || (valueType == "string" && value.length > Firebug.stringCropLength));
-
-    props.push({
-        name: name,
-        value: value,
-        type: type,
-        rowClass: "memberRow-"+type,
-        open: "",
-        order: order,
-        level: level,
-        indent: level*16,
-        hasChildren: hasChildren,
-        tag: tag
-    });
-};
-
-var getWatchRowIndex = function getWatchRowIndex(row)
-{
-    var index = -1;
-    for (; row && hasClass(row, "watchRow"); row = row.previousSibling)
-        ++index;
-    return index;
-};
-
-var getRowName = function getRowName(row)
-{
-    var node = row.firstChild;
-    return node.textContent ? node.textContent : node.innerText;
-};
-
-var getRowValue = function getRowValue(row)
-{
-    return row.lastChild.firstChild.repObject;
-};
-
-var getRowOwnerObject = function getRowOwnerObject(row)
-{
-    var parentRow = getParentRow(row);
-    if (parentRow)
-        return getRowValue(parentRow);
-};
-
-var getParentRow = function getParentRow(row)
-{
-    var level = parseInt(row.getAttribute("level"))-1;
-    for (row = row.previousSibling; row; row = row.previousSibling)
-    {
-        if (parseInt(row.getAttribute("level")) == level)
-            return row;
-    }
-};
-
-var getPath = function getPath(row)
-{
-    var name = getRowName(row);
-    var path = [name];
-
-    var level = parseInt(row.getAttribute("level"))-1;
-    for (row = row.previousSibling; row; row = row.previousSibling)
-    {
-        if (parseInt(row.getAttribute("level")) == level)
-        {
-            var name = getRowName(row);
-            path.splice(0, 0, name);
-
-            --level;
-        }
-    }
-
-    return path;
-};
-
-// ************************************************************************************************
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-
-// ************************************************************************************************
-// DOM Module
-
-Firebug.DOM = extend(Firebug.Module,
-{
-    getPanel: function()
-    {
-        return Firebug.chrome ? Firebug.chrome.getPanel("DOM") : null;
-    }
-});
-
-Firebug.registerModule(Firebug.DOM);
-
-
-// ************************************************************************************************
-// DOM Panel
-
-var lastHighlightedObject;
-
-function DOMSidePanel(){};
-
-DOMSidePanel.prototype = extend(Firebug.DOMBasePanel.prototype,
-{
-    selectRow: function(row, target)
-    {
-        if (!target)
-            target = row.lastChild.firstChild;
-
-        if (!target || !target.repObject)
-            return;
-
-        this.pathToAppend = getPath(row);
-
-        // If the object is inside an array, look up its index
-        var valueBox = row.lastChild.firstChild;
-        if (hasClass(valueBox, "objectBox-array"))
-        {
-            var arrayIndex = FirebugReps.Arr.getItemIndex(target);
-            this.pathToAppend.push(arrayIndex);
-        }
-
-        // Make sure we get a fresh status path for the object, since otherwise
-        // it might find the object in the existing path and not refresh it
-        //Firebug.chrome.clearStatusPath();
-
-        var object = target.repObject;
-
-        if (instanceOf(object, "Element"))
-        {
-            Firebug.HTML.selectTreeNode(ElementCache(object));
-        }
-        else
-        {
-            Firebug.chrome.selectPanel("DOM");
-            Firebug.chrome.getPanel("DOM").select(object, true);
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-
-    onClick: function(event)
-    {
-        /*
-        var target = event.srcElement || event.target;
-
-        var object = getAncestorByClass(target, "objectLink");
-        object = object ? object.repObject : null;
-
-        if(!object) return;
-
-        if (instanceOf(object, "Element"))
-        {
-            Firebug.HTML.selectTreeNode(ElementCache(object));
-        }
-        else
-        {
-            Firebug.chrome.selectPanel("DOM");
-            Firebug.chrome.getPanel("DOM").select(object, true);
-        }
-        /**/
-
-
-        var target = event.srcElement || event.target;
-        var repNode = Firebug.getRepNode(target);
-        if (repNode)
-        {
-            var row = getAncestorByClass(target, "memberRow");
-            if (row)
-            {
-                this.selectRow(row, repNode);
-                cancelEvent(event);
-            }
-        }
-        /**/
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // extends Panel
-
-    name: "DOMSidePanel",
-    parentPanel: "HTML",
-    title: "DOM",
-
-    options: {
-        hasToolButtons: true
-    },
-
-    isInitialized: false,
-
-    create: function()
-    {
-        Firebug.DOMBasePanel.prototype.create.apply(this, arguments);
-
-        this.onClick = bind(this.onClick, this);
-    },
-
-    initialize: function(){
-        Firebug.DOMBasePanel.prototype.initialize.apply(this, arguments);
-
-        addEvent(this.panelNode, "click", this.onClick);
-
-        // TODO: xxxpedro css2
-        var selection = ElementCache.get(Firebug.context.persistedState.selectedHTMLElementId);
-        if (selection)
-            this.select(selection, true);
-    },
-
-    shutdown: function()
-    {
-        removeEvent(this.panelNode, "click", this.onClick);
-
-        Firebug.DOMBasePanel.prototype.shutdown.apply(this, arguments);
-    },
-
-    reattach: function(oldChrome)
-    {
-        //this.isInitialized = oldChrome.getPanel("DOM").isInitialized;
-        this.toggles = oldChrome.getPanel("DOMSidePanel").toggles;
-    }
-
-});
-
-Firebug.registerPanel(DOMSidePanel);
-
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-FBL.FBTrace = {};
-
-(function() {
-// ************************************************************************************************
-
-var traceOptions = {
-    DBG_TIMESTAMP: 1,
-    DBG_INITIALIZE: 1,
-    DBG_CHROME: 1,
-    DBG_ERRORS: 1,
-    DBG_DISPATCH: 1,
-    DBG_CSS: 1
-};
-
-this.module = null;
-
-this.initialize = function()
-{
-    if (!this.messageQueue)
-        this.messageQueue = [];
-
-    for (var name in traceOptions)
-        this[name] = traceOptions[name];
-};
-
-// ************************************************************************************************
-// FBTrace API
-
-this.sysout = function()
-{
-    return this.logFormatted(arguments, "");
-};
-
-this.dumpProperties = function(title, object)
-{
-    return this.logFormatted("dumpProperties() not supported.", "warning");
-};
-
-this.dumpStack = function()
-{
-    return this.logFormatted("dumpStack() not supported.", "warning");
-};
-
-this.flush = function(module)
-{
-    this.module = module;
-
-    var queue = this.messageQueue;
-    this.messageQueue = [];
-
-    for (var i = 0; i < queue.length; ++i)
-        this.writeMessage(queue[i][0], queue[i][1], queue[i][2]);
-};
-
-this.getPanel = function()
-{
-    return this.module ? this.module.getPanel() : null;
-};
-
-//*************************************************************************************************
-
-this.logFormatted = function(objects, className)
-{
-    var html = this.DBG_TIMESTAMP ? [getTimestamp(), " | "] : [];
-    var length = objects.length;
-
-    for (var i = 0; i < length; ++i)
-    {
-        appendText(" ", html);
-
-        var object = objects[i];
-
-        if (i == 0)
-        {
-            html.push("<b>");
-            appendText(object, html);
-            html.push("</b>");
-        }
-        else
-            appendText(object, html);
-    }
-
-    return this.logRow(html, className);
-};
-
-this.logRow = function(message, className)
-{
-    var panel = this.getPanel();
-
-    if (panel && panel.panelNode)
-        this.writeMessage(message, className);
-    else
-    {
-        this.messageQueue.push([message, className]);
-    }
-
-    return this.LOG_COMMAND;
-};
-
-this.writeMessage = function(message, className)
-{
-    var container = this.getPanel().containerNode;
-    var isScrolledToBottom =
-        container.scrollTop + container.offsetHeight >= container.scrollHeight;
-
-    this.writeRow.call(this, message, className);
-
-    if (isScrolledToBottom)
-        container.scrollTop = container.scrollHeight - container.offsetHeight;
-};
-
-this.appendRow = function(row)
-{
-    var container = this.getPanel().panelNode;
-    container.appendChild(row);
-};
-
-this.writeRow = function(message, className)
-{
-    var row = this.getPanel().panelNode.ownerDocument.createElement("div");
-    row.className = "logRow" + (className ? " logRow-"+className : "");
-    row.innerHTML = message.join("");
-    this.appendRow(row);
-};
-
-//*************************************************************************************************
-
-function appendText(object, html)
-{
-    html.push(escapeHTML(objectToString(object)));
-};
-
-function getTimestamp()
-{
-    var now = new Date();
-    var ms = "" + (now.getMilliseconds() / 1000).toFixed(3);
-    ms = ms.substr(2);
-
-    return now.toLocaleTimeString() + "." + ms;
-};
-
-//*************************************************************************************************
-
-var HTMLtoEntity =
-{
-    "<": "&lt;",
-    ">": "&gt;",
-    "&": "&amp;",
-    "'": "&#39;",
-    '"': "&quot;"
-};
-
-function replaceChars(ch)
-{
-    return HTMLtoEntity[ch];
-};
-
-function escapeHTML(value)
-{
-    return (value+"").replace(/[<>&"']/g, replaceChars);
-};
-
-//*************************************************************************************************
-
-function objectToString(object)
-{
-    try
-    {
-        return object+"";
-    }
-    catch (exc)
-    {
-        return null;
-    }
-};
-
-// ************************************************************************************************
-}).apply(FBL.FBTrace);
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-// If application isn't in trace mode, the FBTrace panel won't be loaded
-if (!Env.Options.enableTrace) return;
-
-// ************************************************************************************************
-// FBTrace Module
-
-Firebug.Trace = extend(Firebug.Module,
-{
-    getPanel: function()
-    {
-        return Firebug.chrome ? Firebug.chrome.getPanel("Trace") : null;
-    },
-
-    clear: function()
-    {
-        this.getPanel().panelNode.innerHTML = "";
-    }
-});
-
-Firebug.registerModule(Firebug.Trace);
-
-
-// ************************************************************************************************
-// FBTrace Panel
-
-function TracePanel(){};
-
-TracePanel.prototype = extend(Firebug.Panel,
-{
-    name: "Trace",
-    title: "Trace",
-
-    options: {
-        hasToolButtons: true,
-        innerHTMLSync: true
-    },
-
-    create: function(){
-        Firebug.Panel.create.apply(this, arguments);
-
-        this.clearButton = new Button({
-            caption: "Clear",
-            title: "Clear FBTrace logs",
-            owner: Firebug.Trace,
-            onClick: Firebug.Trace.clear
-        });
-    },
-
-    initialize: function(){
-        Firebug.Panel.initialize.apply(this, arguments);
-
-        this.clearButton.initialize();
-    },
-
-    shutdown: function()
-    {
-        this.clearButton.shutdown();
-
-        Firebug.Panel.shutdown.apply(this, arguments);
-    }
-
-});
-
-Firebug.registerPanel(TracePanel);
-
-// ************************************************************************************************
-}});
-
-/* See license.txt for terms of usage */
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-// ************************************************************************************************
-// Globals
-
-var modules = [];
-var panelTypes = [];
-var panelTypeMap = {};
-
-var parentPanelMap = {};
-
-
-var registerModule = Firebug.registerModule;
-var registerPanel = Firebug.registerPanel;
-
-// ************************************************************************************************
-append(Firebug,
-{
-    extend: function(fn)
-    {
-        if (Firebug.chrome && Firebug.chrome.addPanel)
-        {
-            var namespace = ns(fn);
-            fn.call(namespace, FBL);
-        }
-        else
-        {
-            setTimeout(function(){Firebug.extend(fn);},100);
-        }
-    },
-
-    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-    // Registration
-
-    registerModule: function()
-    {
-        registerModule.apply(Firebug, arguments);
-
-        modules.push.apply(modules, arguments);
-
-        dispatch(modules, "initialize", []);
-
-        if (FBTrace.DBG_INITIALIZE) FBTrace.sysout("Firebug.registerModule");
-    },
-
-    registerPanel: function()
-    {
-        registerPanel.apply(Firebug, arguments);
-
-        panelTypes.push.apply(panelTypes, arguments);
-
-        for (var i = 0, panelType; panelType = arguments[i]; ++i)
-        {
-            // TODO: xxxpedro investigate why Dev Panel throws an error
-            if (panelType.prototype.name == "Dev") continue;
-
-            panelTypeMap[panelType.prototype.name] = arguments[i];
-
-            var parentPanelName = panelType.prototype.parentPanel;
-            if (parentPanelName)
-            {
-                parentPanelMap[parentPanelName] = 1;
-            }
-            else
-            {
-                var panelName = panelType.prototype.name;
-                var chrome = Firebug.chrome;
-                chrome.addPanel(panelName);
-
-                // tab click handler
-                var onTabClick = function onTabClick()
-                {
-                    chrome.selectPanel(panelName);
-                    return false;
-                };
-
-                chrome.addController([chrome.panelMap[panelName].tabNode, "mousedown", onTabClick]);
-            }
-        }
-
-        if (FBTrace.DBG_INITIALIZE)
-            for (var i = 0; i < arguments.length; ++i)
-                FBTrace.sysout("Firebug.registerPanel", arguments[i].prototype.name);
-    }
-
-});
-
-
-
-
-// ************************************************************************************************
-}});
-
-FBL.ns(function() { with (FBL) {
-// ************************************************************************************************
-
-FirebugChrome.Skin =
-{
-    CSS: '.obscured{left:-999999px !important;}.collapsed{display:none;}[collapsed="true"]{display:none;}#fbCSS{padding:0 !important;}.cssPropDisable{float:left;display:block;width:2em;cursor:default;}.infoTip{z-index:2147483647;position:fixed;padding:2px 3px;border:1px solid #CBE087;background:LightYellow;font-family:Monaco,monospace;color:#000000;display:none;white-space:nowrap;pointer-events:none;}.infoTip[active="true"]{display:block;}.infoTipLoading{width:16px;height:16px;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/loading_16.gif) no-repeat;}.infoTipImageBox{font-size:11px;min-width:100px;text-align:center;}.infoTipCaption{font-size:11px;font:Monaco,monospace;}.infoTipLoading > .infoTipImage,.infoTipLoading > .infoTipCaption{display:none;}h1.groupHeader{padding:2px 4px;margin:0 0 4px 0;border-top:1px solid #CCCCCC;border-bottom:1px solid #CCCCCC;background:#eee url(https://getfirebug.com/releases/lite/latest/skin/xp/group.gif) repeat-x;font-size:11px;font-weight:bold;_position:relative;}.inlineEditor,.fixedWidthEditor{z-index:2147483647;position:absolute;display:none;}.inlineEditor{margin-left:-6px;margin-top:-3px;}.textEditorInner,.fixedWidthEditor{margin:0 0 0 0 !important;padding:0;border:none !important;font:inherit;text-decoration:inherit;background-color:#FFFFFF;}.fixedWidthEditor{border-top:1px solid #888888 !important;border-bottom:1px solid #888888 !important;}.textEditorInner{position:relative;top:-7px;left:-5px;outline:none;resize:none;}.textEditorInner1{padding-left:11px;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorBorders.png) repeat-y;_background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorBorders.gif) repeat-y;_overflow:hidden;}.textEditorInner2{position:relative;padding-right:2px;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorBorders.png) repeat-y 100% 0;_background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorBorders.gif) repeat-y 100% 0;_position:fixed;}.textEditorTop1{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorCorners.png) no-repeat 100% 0;margin-left:11px;height:10px;_background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorCorners.gif) no-repeat 100% 0;_overflow:hidden;}.textEditorTop2{position:relative;left:-11px;width:11px;height:10px;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorCorners.png) no-repeat;_background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorCorners.gif) no-repeat;}.textEditorBottom1{position:relative;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorCorners.png) no-repeat 100% 100%;margin-left:11px;height:12px;_background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorCorners.gif) no-repeat 100% 100%;}.textEditorBottom2{position:relative;left:-11px;width:11px;height:12px;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorCorners.png) no-repeat 0 100%;_background:url(https://getfirebug.com/releases/lite/latest/skin/xp/textEditorCorners.gif) no-repeat 0 100%;}.panelNode-css{overflow-x:hidden;}.cssSheet > .insertBefore{height:1.5em;}.cssRule{position:relative;margin:0;padding:1em 0 0 6px;font-family:Monaco,monospace;color:#000000;}.cssRule:first-child{padding-top:6px;}.cssElementRuleContainer{position:relative;}.cssHead{padding-right:150px;}.cssProp{}.cssPropName{color:DarkGreen;}.cssPropValue{margin-left:8px;color:DarkBlue;}.cssOverridden span{text-decoration:line-through;}.cssInheritedRule{}.cssInheritLabel{margin-right:0.5em;font-weight:bold;}.cssRule .objectLink-sourceLink{top:0;}.cssProp.editGroup:hover{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/disable.png) no-repeat 2px 1px;_background:url(https://getfirebug.com/releases/lite/latest/skin/xp/disable.gif) no-repeat 2px 1px;}.cssProp.editGroup.editing{background:none;}.cssProp.disabledStyle{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/disableHover.png) no-repeat 2px 1px;_background:url(https://getfirebug.com/releases/lite/latest/skin/xp/disableHover.gif) no-repeat 2px 1px;opacity:1;color:#CCCCCC;}.disabledStyle .cssPropName,.disabledStyle .cssPropValue{color:#CCCCCC;}.cssPropValue.editing + .cssSemi,.inlineExpander + .cssSemi{display:none;}.cssPropValue.editing{white-space:nowrap;}.stylePropName{font-weight:bold;padding:0 4px 4px 4px;width:50%;}.stylePropValue{width:50%;}.panelNode-net{overflow-x:hidden;}.netTable{width:100%;}.hideCategory-undefined .category-undefined,.hideCategory-html .category-html,.hideCategory-css .category-css,.hideCategory-js .category-js,.hideCategory-image .category-image,.hideCategory-xhr .category-xhr,.hideCategory-flash .category-flash,.hideCategory-txt .category-txt,.hideCategory-bin .category-bin{display:none;}.netHeadRow{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/group.gif) repeat-x #FFFFFF;}.netHeadCol{border-bottom:1px solid #CCCCCC;padding:2px 4px 2px 18px;font-weight:bold;}.netHeadLabel{white-space:nowrap;overflow:hidden;}.netHeaderRow{height:16px;}.netHeaderCell{cursor:pointer;-moz-user-select:none;border-bottom:1px solid #9C9C9C;padding:0 !important;font-weight:bold;background:#BBBBBB url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/tableHeader.gif) repeat-x;white-space:nowrap;}.netHeaderRow > .netHeaderCell:first-child > .netHeaderCellBox{padding:2px 14px 2px 18px;}.netHeaderCellBox{padding:2px 14px 2px 10px;border-left:1px solid #D9D9D9;border-right:1px solid #9C9C9C;}.netHeaderCell:hover:active{background:#959595 url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/tableHeaderActive.gif) repeat-x;}.netHeaderSorted{background:#7D93B2 url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/tableHeaderSorted.gif) repeat-x;}.netHeaderSorted > .netHeaderCellBox{border-right-color:#6B7C93;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/arrowDown.png) no-repeat right;}.netHeaderSorted.sortedAscending > .netHeaderCellBox{background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/arrowUp.png);}.netHeaderSorted:hover:active{background:#536B90 url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/tableHeaderSortedActive.gif) repeat-x;}.panelNode-net .netRowHeader{display:block;}.netRowHeader{cursor:pointer;display:none;height:15px;margin-right:0 !important;}.netRow .netRowHeader{background-position:5px 1px;}.netRow[breakpoint="true"] .netRowHeader{background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/breakpoint.png);}.netRow[breakpoint="true"][disabledBreakpoint="true"] .netRowHeader{background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/breakpointDisabled.png);}.netRow.category-xhr:hover .netRowHeader{background-color:#F6F6F6;}#netBreakpointBar{max-width:38px;}#netHrefCol > .netHeaderCellBox{border-left:0px;}.netRow .netRowHeader{width:3px;}.netInfoRow .netRowHeader{display:table-cell;}.netTable[hiddenCols~=netHrefCol] TD[id="netHrefCol"],.netTable[hiddenCols~=netHrefCol] TD.netHrefCol,.netTable[hiddenCols~=netStatusCol] TD[id="netStatusCol"],.netTable[hiddenCols~=netStatusCol] TD.netStatusCol,.netTable[hiddenCols~=netDomainCol] TD[id="netDomainCol"],.netTable[hiddenCols~=netDomainCol] TD.netDomainCol,.netTable[hiddenCols~=netSizeCol] TD[id="netSizeCol"],.netTable[hiddenCols~=netSizeCol] TD.netSizeCol,.netTable[hiddenCols~=netTimeCol] TD[id="netTimeCol"],.netTable[hiddenCols~=netTimeCol] TD.netTimeCol{display:none;}.netRow{background:LightYellow;}.netRow.loaded{background:#FFFFFF;}.netRow.loaded:hover{background:#EFEFEF;}.netCol{padding:0;vertical-align:top;border-bottom:1px solid #EFEFEF;white-space:nowrap;height:17px;}.netLabel{width:100%;}.netStatusCol{padding-left:10px;color:rgb(128,128,128);}.responseError > .netStatusCol{color:red;}.netDomainCol{padding-left:5px;}.netSizeCol{text-align:right;padding-right:10px;}.netHrefLabel{-moz-box-sizing:padding-box;overflow:hidden;z-index:10;position:absolute;padding-left:18px;padding-top:1px;max-width:15%;font-weight:bold;}.netFullHrefLabel{display:none;-moz-user-select:none;padding-right:10px;padding-bottom:3px;max-width:100%;background:#FFFFFF;z-index:200;}.netHrefCol:hover > .netFullHrefLabel{display:block;}.netRow.loaded:hover .netCol > .netFullHrefLabel{background-color:#EFEFEF;}.useA11y .a11yShowFullLabel{display:block;background-image:none !important;border:1px solid #CBE087;background-color:LightYellow;font-family:Monaco,monospace;color:#000000;font-size:10px;z-index:2147483647;}.netSizeLabel{padding-left:6px;}.netStatusLabel,.netDomainLabel,.netSizeLabel,.netBar{padding:1px 0 2px 0 !important;}.responseError{color:red;}.hasHeaders .netHrefLabel:hover{cursor:pointer;color:blue;text-decoration:underline;}.netLoadingIcon{position:absolute;border:0;margin-left:14px;width:16px;height:16px;background:transparent no-repeat 0 0;background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/loading_16.gif);display:inline-block;}.loaded .netLoadingIcon{display:none;}.netBar,.netSummaryBar{position:relative;border-right:50px solid transparent;}.netResolvingBar{position:absolute;left:0;top:0;bottom:0;background:#FFFFFF url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/netBarResolving.gif) repeat-x;z-index:60;}.netConnectingBar{position:absolute;left:0;top:0;bottom:0;background:#FFFFFF url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/netBarConnecting.gif) repeat-x;z-index:50;}.netBlockingBar{position:absolute;left:0;top:0;bottom:0;background:#FFFFFF url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/netBarWaiting.gif) repeat-x;z-index:40;}.netSendingBar{position:absolute;left:0;top:0;bottom:0;background:#FFFFFF url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/netBarSending.gif) repeat-x;z-index:30;}.netWaitingBar{position:absolute;left:0;top:0;bottom:0;background:#FFFFFF url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/netBarResponded.gif) repeat-x;z-index:20;min-width:1px;}.netReceivingBar{position:absolute;left:0;top:0;bottom:0;background:#38D63B url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/netBarLoading.gif) repeat-x;z-index:10;}.netWindowLoadBar,.netContentLoadBar{position:absolute;left:0;top:0;bottom:0;width:1px;background-color:red;z-index:70;opacity:0.5;display:none;margin-bottom:-1px;}.netContentLoadBar{background-color:Blue;}.netTimeLabel{-moz-box-sizing:padding-box;position:absolute;top:1px;left:100%;padding-left:6px;color:#444444;min-width:16px;}.loaded .netReceivingBar,.loaded.netReceivingBar{background:#B6B6B6 url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/netBarLoaded.gif) repeat-x;border-color:#B6B6B6;}.fromCache .netReceivingBar,.fromCache.netReceivingBar{background:#D6D6D6 url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/netBarCached.gif) repeat-x;border-color:#D6D6D6;}.netSummaryRow .netTimeLabel,.loaded .netTimeLabel{background:transparent;}.timeInfoTip{width:150px; height:40px}.timeInfoTipBar,.timeInfoTipEventBar{position:relative;display:block;margin:0;opacity:1;height:15px;width:4px;}.timeInfoTipEventBar{width:1px !important;}.timeInfoTipCell.startTime{padding-right:8px;}.timeInfoTipCell.elapsedTime{text-align:right;padding-right:8px;}.sizeInfoLabelCol{font-weight:bold;padding-right:10px;font-family:Lucida Grande,Tahoma,sans-serif;font-size:11px;}.sizeInfoSizeCol{font-weight:bold;}.sizeInfoDetailCol{color:gray;text-align:right;}.sizeInfoDescCol{font-style:italic;}.netSummaryRow .netReceivingBar{background:#BBBBBB;border:none;}.netSummaryLabel{color:#222222;}.netSummaryRow{background:#BBBBBB !important;font-weight:bold;}.netSummaryRow .netBar{border-right-color:#BBBBBB;}.netSummaryRow > .netCol{border-top:1px solid #999999;border-bottom:2px solid;-moz-border-bottom-colors:#EFEFEF #999999;padding-top:1px;padding-bottom:2px;}.netSummaryRow > .netHrefCol:hover{background:transparent !important;}.netCountLabel{padding-left:18px;}.netTotalSizeCol{text-align:right;padding-right:10px;}.netTotalTimeCol{text-align:right;}.netCacheSizeLabel{position:absolute;z-index:1000;left:0;top:0;}.netLimitRow{background:rgb(255,255,225) !important;font-weight:normal;color:black;font-weight:normal;}.netLimitLabel{padding-left:18px;}.netLimitRow > .netCol{border-bottom:2px solid;-moz-border-bottom-colors:#EFEFEF #999999;vertical-align:middle !important;padding-top:2px;padding-bottom:2px;}.netLimitButton{font-size:11px;padding-top:1px;padding-bottom:1px;}.netInfoCol{border-top:1px solid #EEEEEE;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/group.gif) repeat-x #FFFFFF;}.netInfoBody{margin:10px 0 4px 10px;}.netInfoTabs{position:relative;padding-left:17px;}.netInfoTab{position:relative;top:-3px;margin-top:10px;padding:4px 6px;border:1px solid transparent;border-bottom:none;_border:none;font-weight:bold;color:#565656;cursor:pointer;}.netInfoTabSelected{cursor:default !important;border:1px solid #D7D7D7 !important;border-bottom:none !important;-moz-border-radius:4px 4px 0 0;-webkit-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;background-color:#FFFFFF;}.logRow-netInfo.error .netInfoTitle{color:red;}.logRow-netInfo.loading .netInfoResponseText{font-style:italic;color:#888888;}.loading .netInfoResponseHeadersTitle{display:none;}.netInfoResponseSizeLimit{font-family:Lucida Grande,Tahoma,sans-serif;padding-top:10px;font-size:11px;}.netInfoText{display:none;margin:0;border:1px solid #D7D7D7;border-right:none;padding:8px;background-color:#FFFFFF;font-family:Monaco,monospace;white-space:pre-wrap;}.netInfoTextSelected{display:block;}.netInfoParamName{padding-right:10px;font-family:Lucida Grande,Tahoma,sans-serif;font-weight:bold;vertical-align:top;text-align:right;white-space:nowrap;}.netInfoPostText .netInfoParamName{width:1px;}.netInfoParamValue{width:100%;}.netInfoHeadersText,.netInfoPostText,.netInfoPutText{padding-top:0;}.netInfoHeadersGroup,.netInfoPostParams,.netInfoPostSource{margin-bottom:4px;border-bottom:1px solid #D7D7D7;padding-top:8px;padding-bottom:2px;font-family:Lucida Grande,Tahoma,sans-serif;font-weight:bold;color:#565656;}.netInfoPostParamsTable,.netInfoPostPartsTable,.netInfoPostJSONTable,.netInfoPostXMLTable,.netInfoPostSourceTable{margin-bottom:10px;width:100%;}.netInfoPostContentType{color:#bdbdbd;padding-left:50px;font-weight:normal;}.netInfoHtmlPreview{border:0;width:100%;height:100%;}.netHeadersViewSource{color:#bdbdbd;margin-left:200px;font-weight:normal;}.netHeadersViewSource:hover{color:blue;cursor:pointer;}.netActivationRow,.netPageSeparatorRow{background:rgb(229,229,229) !important;font-weight:normal;color:black;}.netActivationLabel{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/chrome://firebug/skin/infoIcon.png) no-repeat 3px 2px;padding-left:22px;}.netPageSeparatorRow{height:5px !important;}.netPageSeparatorLabel{padding-left:22px;height:5px !important;}.netPageRow{background-color:rgb(255,255,255);}.netPageRow:hover{background:#EFEFEF;}.netPageLabel{padding:1px 0 2px 18px !important;font-weight:bold;}.netActivationRow > .netCol{border-bottom:2px solid;-moz-border-bottom-colors:#EFEFEF #999999;padding-top:2px;padding-bottom:3px;}.twisty,.logRow-errorMessage > .hasTwisty > .errorTitle,.logRow-log > .objectBox-array.hasTwisty,.logRow-spy .spyHead .spyTitle,.logGroup > .logRow,.memberRow.hasChildren > .memberLabelCell > .memberLabel,.hasHeaders .netHrefLabel,.netPageRow > .netCol > .netPageTitle{background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/tree_open.gif);background-repeat:no-repeat;background-position:2px 2px;min-height:12px;}.logRow-errorMessage > .hasTwisty.opened > .errorTitle,.logRow-log > .objectBox-array.hasTwisty.opened,.logRow-spy.opened .spyHead .spyTitle,.logGroup.opened > .logRow,.memberRow.hasChildren.opened > .memberLabelCell > .memberLabel,.nodeBox.highlightOpen > .nodeLabel > .twisty,.nodeBox.open > .nodeLabel > .twisty,.netRow.opened > .netCol > .netHrefLabel,.netPageRow.opened > .netCol > .netPageTitle{background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/tree_close.gif);}.twisty{background-position:4px 4px;}* html .logRow-spy .spyHead .spyTitle,* html .logGroup .logGroupLabel,* html .hasChildren .memberLabelCell .memberLabel,* html .hasHeaders .netHrefLabel{background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/tree_open.gif);background-repeat:no-repeat;background-position:2px 2px;}* html .opened .spyHead .spyTitle,* html .opened .logGroupLabel,* html .opened .memberLabelCell .memberLabel{background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/tree_close.gif);background-repeat:no-repeat;background-position:2px 2px;}.panelNode-console{overflow-x:hidden;}.objectLink{text-decoration:none;}.objectLink:hover{cursor:pointer;text-decoration:underline;}.logRow{position:relative;margin:0;border-bottom:1px solid #D7D7D7;padding:2px 4px 1px 6px;background-color:#FFFFFF;overflow:hidden !important;}.useA11y .logRow:focus{border-bottom:1px solid #000000 !important;outline:none !important;background-color:#FFFFAD !important;}.useA11y .logRow:focus a.objectLink-sourceLink{background-color:#FFFFAD;}.useA11y .a11yFocus:focus,.useA11y .objectBox:focus{outline:2px solid #FF9933;background-color:#FFFFAD;}.useA11y .objectBox-null:focus,.useA11y .objectBox-undefined:focus{background-color:#888888 !important;}.useA11y .logGroup.opened > .logRow{border-bottom:1px solid #ffffff;}.logGroup{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/group.gif) repeat-x #FFFFFF;padding:0 !important;border:none !important;}.logGroupBody{display:none;margin-left:16px;border-left:1px solid #D7D7D7;border-top:1px solid #D7D7D7;background:#FFFFFF;}.logGroup > .logRow{background-color:transparent !important;font-weight:bold;}.logGroup.opened > .logRow{border-bottom:none;}.logGroup.opened > .logGroupBody{display:block;}.logRow-command > .objectBox-text{font-family:Monaco,monospace;color:#0000FF;white-space:pre-wrap;}.logRow-info,.logRow-warn,.logRow-error,.logRow-assert,.logRow-warningMessage,.logRow-errorMessage{padding-left:22px;background-repeat:no-repeat;background-position:4px 2px;}.logRow-assert,.logRow-warningMessage,.logRow-errorMessage{padding-top:0;padding-bottom:0;}.logRow-info,.logRow-info .objectLink-sourceLink{background-color:#FFFFFF;}.logRow-warn,.logRow-warningMessage,.logRow-warn .objectLink-sourceLink,.logRow-warningMessage .objectLink-sourceLink{background-color:cyan;}.logRow-error,.logRow-assert,.logRow-errorMessage,.logRow-error .objectLink-sourceLink,.logRow-errorMessage .objectLink-sourceLink{background-color:LightYellow;}.logRow-error,.logRow-assert,.logRow-errorMessage{color:#FF0000;}.logRow-info{}.logRow-warn,.logRow-warningMessage{}.logRow-error,.logRow-assert,.logRow-errorMessage{}.objectBox-string,.objectBox-text,.objectBox-number,.objectLink-element,.objectLink-textNode,.objectLink-function,.objectBox-stackTrace,.objectLink-profile{font-family:Monaco,monospace;}.objectBox-string,.objectBox-text,.objectLink-textNode{white-space:pre-wrap;}.objectBox-number,.objectLink-styleRule,.objectLink-element,.objectLink-textNode{color:#000088;}.objectBox-string{color:#FF0000;}.objectLink-function,.objectBox-stackTrace,.objectLink-profile{color:DarkGreen;}.objectBox-null,.objectBox-undefined{padding:0 2px;border:1px solid #666666;background-color:#888888;color:#FFFFFF;}.objectBox-exception{padding:0 2px 0 18px;color:red;}.objectLink-sourceLink{position:absolute;right:4px;top:2px;padding-left:8px;font-family:Lucida Grande,sans-serif;font-weight:bold;color:#0000FF;}.errorTitle{margin-top:0px;margin-bottom:1px;padding-top:2px;padding-bottom:2px;}.errorTrace{margin-left:17px;}.errorSourceBox{margin:2px 0;}.errorSource-none{display:none;}.errorSource-syntax > .errorBreak{visibility:hidden;}.errorSource{cursor:pointer;font-family:Monaco,monospace;color:DarkGreen;}.errorSource:hover{text-decoration:underline;}.errorBreak{cursor:pointer;display:none;margin:0 6px 0 0;width:13px;height:14px;vertical-align:bottom;opacity:0.1;}.hasBreakSwitch .errorBreak{display:inline;}.breakForError .errorBreak{opacity:1;}.assertDescription{margin:0;}.logRow-profile > .logRow > .objectBox-text{font-family:Lucida Grande,Tahoma,sans-serif;color:#000000;}.logRow-profile > .logRow > .objectBox-text:last-child{color:#555555;font-style:italic;}.logRow-profile.opened > .logRow{padding-bottom:4px;}.profilerRunning > .logRow{padding-left:22px !important;}.profileSizer{width:100%;overflow-x:auto;overflow-y:scroll;}.profileTable{border-bottom:1px solid #D7D7D7;padding:0 0 4px 0;}.profileTable tr[odd="1"]{background-color:#F5F5F5;vertical-align:middle;}.profileTable a{vertical-align:middle;}.profileTable td{padding:1px 4px 0 4px;}.headerCell{cursor:pointer;-moz-user-select:none;border-bottom:1px solid #9C9C9C;padding:0 !important;font-weight:bold;}.headerCellBox{padding:2px 4px;border-left:1px solid #D9D9D9;border-right:1px solid #9C9C9C;}.headerCell:hover:active{}.headerSorted{}.headerSorted > .headerCellBox{border-right-color:#6B7C93;}.headerSorted.sortedAscending > .headerCellBox{}.headerSorted:hover:active{}.linkCell{text-align:right;}.linkCell > .objectLink-sourceLink{position:static;}.logRow-stackTrace{padding-top:0;background:#f8f8f8;}.logRow-stackTrace > .objectBox-stackFrame{position:relative;padding-top:2px;}.objectLink-object{font-family:Lucida Grande,sans-serif;font-weight:bold;color:DarkGreen;white-space:pre-wrap;}.objectProp-object{color:DarkGreen;}.objectProps{color:#000;font-weight:normal;}.objectPropName{color:#777;}.objectProps .objectProp-string{color:#f55;}.objectProps .objectProp-number{color:#55a;}.objectProps .objectProp-object{color:#585;}.selectorTag,.selectorId,.selectorClass{font-family:Monaco,monospace;font-weight:normal;}.selectorTag{color:#0000FF;}.selectorId{color:DarkBlue;}.selectorClass{color:red;}.selectorHidden > .selectorTag{color:#5F82D9;}.selectorHidden > .selectorId{color:#888888;}.selectorHidden > .selectorClass{color:#D86060;}.selectorValue{font-family:Lucida Grande,sans-serif;font-style:italic;color:#555555;}.panelNode.searching .logRow{display:none;}.logRow.matched{display:block !important;}.logRow.matching{position:absolute;left:-1000px;top:-1000px;max-width:0;max-height:0;overflow:hidden;}.objectLeftBrace,.objectRightBrace,.objectEqual,.objectComma,.arrayLeftBracket,.arrayRightBracket,.arrayComma{font-family:Monaco,monospace;}.objectLeftBrace,.objectRightBrace,.arrayLeftBracket,.arrayRightBracket{font-weight:bold;}.objectLeftBrace,.arrayLeftBracket{margin-right:4px;}.objectRightBrace,.arrayRightBracket{margin-left:4px;}.logRow-dir{padding:0;}.logRow-errorMessage .hasTwisty .errorTitle,.logRow-spy .spyHead .spyTitle,.logGroup .logRow{cursor:pointer;padding-left:18px;background-repeat:no-repeat;background-position:3px 3px;}.logRow-errorMessage > .hasTwisty > .errorTitle{background-position:2px 3px;}.logRow-errorMessage > .hasTwisty > .errorTitle:hover,.logRow-spy .spyHead .spyTitle:hover,.logGroup > .logRow:hover{text-decoration:underline;}.logRow-spy{padding:0 !important;}.logRow-spy,.logRow-spy .objectLink-sourceLink{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/group.gif) repeat-x #FFFFFF;padding-right:4px;right:0;}.logRow-spy.opened{padding-bottom:4px;border-bottom:none;}.spyTitle{color:#000000;font-weight:bold;-moz-box-sizing:padding-box;overflow:hidden;z-index:100;padding-left:18px;}.spyCol{padding:0;white-space:nowrap;height:16px;}.spyTitleCol:hover > .objectLink-sourceLink,.spyTitleCol:hover > .spyTime,.spyTitleCol:hover > .spyStatus,.spyTitleCol:hover > .spyTitle{display:none;}.spyFullTitle{display:none;-moz-user-select:none;max-width:100%;background-color:Transparent;}.spyTitleCol:hover > .spyFullTitle{display:block;}.spyStatus{padding-left:10px;color:rgb(128,128,128);}.spyTime{margin-left:4px;margin-right:4px;color:rgb(128,128,128);}.spyIcon{margin-right:4px;margin-left:4px;width:16px;height:16px;vertical-align:middle;background:transparent no-repeat 0 0;display:none;}.loading .spyHead .spyRow .spyIcon{background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/loading_16.gif);display:block;}.logRow-spy.loaded:not(.error) .spyHead .spyRow .spyIcon{width:0;margin:0;}.logRow-spy.error .spyHead .spyRow .spyIcon{background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/errorIcon-sm.png);display:block;background-position:2px 2px;}.logRow-spy .spyHead .netInfoBody{display:none;}.logRow-spy.opened .spyHead .netInfoBody{margin-top:10px;display:block;}.logRow-spy.error .spyTitle,.logRow-spy.error .spyStatus,.logRow-spy.error .spyTime{color:red;}.logRow-spy.loading .spyResponseText{font-style:italic;color:#888888;}.caption{font-family:Lucida Grande,Tahoma,sans-serif;font-weight:bold;color:#444444;}.warning{padding:10px;font-family:Lucida Grande,Tahoma,sans-serif;font-weight:bold;color:#888888;}.panelNode-dom{overflow-x:hidden !important;}.domTable{font-size:1em;width:100%;table-layout:fixed;background:#fff;}.domTableIE{width:auto;}.memberLabelCell{padding:2px 0 2px 0;vertical-align:top;}.memberValueCell{padding:1px 0 1px 5px;display:block;overflow:hidden;}.memberLabel{display:block;cursor:default;-moz-user-select:none;overflow:hidden;padding-left:18px;background-color:#FFFFFF;text-decoration:none;}.memberRow.hasChildren .memberLabelCell .memberLabel:hover{cursor:pointer;color:blue;text-decoration:underline;}.userLabel{color:#000000;font-weight:bold;}.userClassLabel{color:#E90000;font-weight:bold;}.userFunctionLabel{color:#025E2A;font-weight:bold;}.domLabel{color:#000000;}.domFunctionLabel{color:#025E2A;}.ordinalLabel{color:SlateBlue;font-weight:bold;}.scopesRow{padding:2px 18px;background-color:LightYellow;border-bottom:5px solid #BEBEBE;color:#666666;}.scopesLabel{background-color:LightYellow;}.watchEditCell{padding:2px 18px;background-color:LightYellow;border-bottom:1px solid #BEBEBE;color:#666666;}.editor-watchNewRow,.editor-memberRow{font-family:Monaco,monospace !important;}.editor-memberRow{padding:1px 0 !important;}.editor-watchRow{padding-bottom:0 !important;}.watchRow > .memberLabelCell{font-family:Monaco,monospace;padding-top:1px;padding-bottom:1px;}.watchRow > .memberLabelCell > .memberLabel{background-color:transparent;}.watchRow > .memberValueCell{padding-top:2px;padding-bottom:2px;}.watchRow > .memberLabelCell,.watchRow > .memberValueCell{background-color:#F5F5F5;border-bottom:1px solid #BEBEBE;}.watchToolbox{z-index:2147483647;position:absolute;right:0;padding:1px 2px;}#fbConsole{overflow-x:hidden !important;}#fbCSS{font:1em Monaco,monospace;padding:0 7px;}#fbstylesheetButtons select,#fbScriptButtons select{font:11px Lucida Grande,Tahoma,sans-serif;margin-top:1px;padding-left:3px;background:#fafafa;border:1px inset #fff;width:220px;outline:none;}.Selector{margin-top:10px}.CSSItem{margin-left:4%}.CSSText{padding-left:20px;}.CSSProperty{color:#005500;}.CSSValue{padding-left:5px; color:#000088;}#fbHTMLStatusBar{display:inline;}.fbToolbarButtons{display:none;}.fbStatusSeparator{display:block;float:left;padding-top:4px;}#fbStatusBarBox{display:none;}#fbToolbarContent{display:block;position:absolute;_position:absolute;top:0;padding-top:4px;height:23px;clip:rect(0,2048px,27px,0);}.fbTabMenuTarget{display:none !important;float:left;width:10px;height:10px;margin-top:6px;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/tabMenuTarget.png);}.fbTabMenuTarget:hover{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/tabMenuTargetHover.png);}.fbShadow{float:left;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/shadowAlpha.png) no-repeat bottom right !important;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/shadow2.gif) no-repeat bottom right;margin:10px 0 0 10px !important;margin:10px 0 0 5px;}.fbShadowContent{display:block;position:relative;background-color:#fff;border:1px solid #a9a9a9;top:-6px;left:-6px;}.fbMenu{display:none;position:absolute;font-size:11px;line-height:13px;z-index:2147483647;}.fbMenuContent{padding:2px;}.fbMenuSeparator{display:block;position:relative;padding:1px 18px 0;text-decoration:none;color:#000;cursor:default;background:#ACA899;margin:4px 0;}.fbMenuOption{display:block;position:relative;padding:2px 18px;text-decoration:none;color:#000;cursor:default;}.fbMenuOption:hover{color:#fff;background:#316AC5;}.fbMenuGroup{background:transparent url(https://getfirebug.com/releases/lite/latest/skin/xp/tabMenuPin.png) no-repeat right 0;}.fbMenuGroup:hover{background:#316AC5 url(https://getfirebug.com/releases/lite/latest/skin/xp/tabMenuPin.png) no-repeat right -17px;}.fbMenuGroupSelected{color:#fff;background:#316AC5 url(https://getfirebug.com/releases/lite/latest/skin/xp/tabMenuPin.png) no-repeat right -17px;}.fbMenuChecked{background:transparent url(https://getfirebug.com/releases/lite/latest/skin/xp/tabMenuCheckbox.png) no-repeat 4px 0;}.fbMenuChecked:hover{background:#316AC5 url(https://getfirebug.com/releases/lite/latest/skin/xp/tabMenuCheckbox.png) no-repeat 4px -17px;}.fbMenuRadioSelected{background:transparent url(https://getfirebug.com/releases/lite/latest/skin/xp/tabMenuRadio.png) no-repeat 4px 0;}.fbMenuRadioSelected:hover{background:#316AC5 url(https://getfirebug.com/releases/lite/latest/skin/xp/tabMenuRadio.png) no-repeat 4px -17px;}.fbMenuShortcut{padding-right:85px;}.fbMenuShortcutKey{position:absolute;right:0;top:2px;width:77px;}#fbFirebugMenu{top:22px;left:0;}.fbMenuDisabled{color:#ACA899 !important;}#fbFirebugSettingsMenu{left:245px;top:99px;}#fbConsoleMenu{top:42px;left:48px;}.fbIconButton{display:block;}.fbIconButton{display:block;}.fbIconButton{display:block;float:left;height:20px;width:20px;color:#000;margin-right:2px;text-decoration:none;cursor:default;}.fbIconButton:hover{position:relative;top:-1px;left:-1px;margin-right:0;_margin-right:1px;color:#333;border:1px solid #fff;border-bottom:1px solid #bbb;border-right:1px solid #bbb;}.fbIconPressed{position:relative;margin-right:0;_margin-right:1px;top:0 !important;left:0 !important;height:19px;color:#333 !important;border:1px solid #bbb !important;border-bottom:1px solid #cfcfcf !important;border-right:1px solid #ddd !important;}#fbErrorPopup{position:absolute;right:0;bottom:0;height:19px;width:75px;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) #f1f2ee 0 0;z-index:999;}#fbErrorPopupContent{position:absolute;right:0;top:1px;height:18px;width:75px;_width:74px;border-left:1px solid #aca899;}#fbErrorIndicator{position:absolute;top:2px;right:5px;}.fbBtnInspectActive{background:#aaa;color:#fff !important;}.fbBody{margin:0;padding:0;overflow:hidden;font-family:Lucida Grande,Tahoma,sans-serif;font-size:11px;background:#fff;}.clear{clear:both;}#fbMiniChrome{display:none;right:0;height:27px;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) #f1f2ee 0 0;margin-left:1px;}#fbMiniContent{display:block;position:relative;left:-1px;right:0;top:1px;height:25px;border-left:1px solid #aca899;}#fbToolbarSearch{float:right;border:1px solid #ccc;margin:0 5px 0 0;background:#fff url(https://getfirebug.com/releases/lite/latest/skin/xp/search.png) no-repeat 4px 2px !important;background:#fff url(https://getfirebug.com/releases/lite/latest/skin/xp/search.gif) no-repeat 4px 2px;padding-left:20px;font-size:11px;}#fbToolbarErrors{float:right;margin:1px 4px 0 0;font-size:11px;}#fbLeftToolbarErrors{float:left;margin:7px 0px 0 5px;font-size:11px;}.fbErrors{padding-left:20px;height:14px;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/errorIcon.png) no-repeat !important;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/errorIcon.gif) no-repeat;color:#f00;font-weight:bold;}#fbMiniErrors{display:inline;display:none;float:right;margin:5px 2px 0 5px;}#fbMiniIcon{float:right;margin:3px 4px 0;height:20px;width:20px;float:right;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) 0 -135px;cursor:pointer;}#fbChrome{font-family:Lucida Grande,Tahoma,sans-serif;font-size:11px;position:absolute;_position:static;top:0;left:0;height:100%;width:100%;border-collapse:collapse;border-spacing:0;background:#fff;overflow:hidden;}#fbChrome > tbody > tr > td{padding:0;}#fbTop{height:49px;}#fbToolbar{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) #f1f2ee 0 0;height:27px;font-size:11px;line-height:13px;}#fbPanelBarBox{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) #dbd9c9 0 -27px;height:22px;}#fbContent{height:100%;vertical-align:top;}#fbBottom{height:18px;background:#fff;}#fbToolbarIcon{float:left;padding:0 5px 0;}#fbToolbarIcon a{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) 0 -135px;}#fbToolbarButtons{padding:0 2px 0 5px;}#fbToolbarButtons{padding:0 2px 0 5px;}.fbButton{text-decoration:none;display:block;float:left;color:#000;padding:4px 6px 4px 7px;cursor:default;}.fbButton:hover{color:#333;background:#f5f5ef url(https://getfirebug.com/releases/lite/latest/skin/xp/buttonBg.png);padding:3px 5px 3px 6px;border:1px solid #fff;border-bottom:1px solid #bbb;border-right:1px solid #bbb;}.fbBtnPressed{background:#e3e3db url(https://getfirebug.com/releases/lite/latest/skin/xp/buttonBgHover.png) !important;padding:3px 4px 2px 6px !important;margin:1px 0 0 1px !important;border:1px solid #ACA899 !important;border-color:#ACA899 #ECEBE3 #ECEBE3 #ACA899 !important;}#fbStatusBarBox{top:4px;cursor:default;}.fbToolbarSeparator{overflow:hidden;border:1px solid;border-color:transparent #fff transparent #777;_border-color:#eee #fff #eee #777;height:7px;margin:6px 3px;float:left;}.fbBtnSelected{font-weight:bold;}.fbStatusBar{color:#aca899;}.fbStatusBar a{text-decoration:none;color:black;}.fbStatusBar a:hover{color:blue;cursor:pointer;}#fbWindowButtons{position:absolute;white-space:nowrap;right:0;top:0;height:17px;width:48px;padding:5px;z-index:6;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) #f1f2ee 0 0;}#fbPanelBar1{width:1024px; z-index:8;left:0;white-space:nowrap;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) #dbd9c9 0 -27px;position:absolute;left:4px;}#fbPanelBar2Box{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) #dbd9c9 0 -27px;position:absolute;height:22px;width:300px; z-index:9;right:0;}#fbPanelBar2{position:absolute;width:290px; height:22px;padding-left:4px;}.fbPanel{display:none;}#fbPanelBox1,#fbPanelBox2{max-height:inherit;height:100%;font-size:1em;}#fbPanelBox2{background:#fff;}#fbPanelBox2{width:300px;background:#fff;}#fbPanel2{margin-left:6px;background:#fff;}#fbLargeCommandLine{display:none;position:absolute;z-index:9;top:27px;right:0;width:294px;height:201px;border-width:0;margin:0;padding:2px 0 0 2px;resize:none;outline:none;font-size:11px;overflow:auto;border-top:1px solid #B9B7AF;_right:-1px;_border-left:1px solid #fff;}#fbLargeCommandButtons{display:none;background:#ECE9D8;bottom:0;right:0;width:294px;height:21px;padding-top:1px;position:fixed;border-top:1px solid #ACA899;z-index:9;}#fbSmallCommandLineIcon{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/down.png) no-repeat;position:absolute;right:2px;bottom:3px;z-index:99;}#fbSmallCommandLineIcon:hover{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/downHover.png) no-repeat;}.hide{overflow:hidden !important;position:fixed !important;display:none !important;visibility:hidden !important;}#fbCommand{height:18px;}#fbCommandBox{position:fixed;_position:absolute;width:100%;height:18px;bottom:0;overflow:hidden;z-index:9;background:#fff;border:0;border-top:1px solid #ccc;}#fbCommandIcon{position:absolute;color:#00f;top:2px;left:6px;display:inline;font:11px Monaco,monospace;z-index:10;}#fbCommandLine{position:absolute;width:100%;top:0;left:0;border:0;margin:0;padding:2px 0 2px 32px;font:11px Monaco,monospace;z-index:9;outline:none;}#fbLargeCommandLineIcon{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/up.png) no-repeat;position:absolute;right:1px;bottom:1px;z-index:10;}#fbLargeCommandLineIcon:hover{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/upHover.png) no-repeat;}div.fbFitHeight{overflow:auto;position:relative;}.fbSmallButton{overflow:hidden;width:16px;height:16px;display:block;text-decoration:none;cursor:default;}#fbWindowButtons .fbSmallButton{float:right;}#fbWindow_btClose{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/min.png);}#fbWindow_btClose:hover{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/minHover.png);}#fbWindow_btDetach{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/detach.png);}#fbWindow_btDetach:hover{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/detachHover.png);}#fbWindow_btDeactivate{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/off.png);}#fbWindow_btDeactivate:hover{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/offHover.png);}.fbTab{text-decoration:none;display:none;float:left;width:auto;float:left;cursor:default;font-family:Lucida Grande,Tahoma,sans-serif;font-size:11px;line-height:13px;font-weight:bold;height:22px;color:#565656;}.fbPanelBar span{float:left;}.fbPanelBar .fbTabL,.fbPanelBar .fbTabR{height:22px;width:8px;}.fbPanelBar .fbTabText{padding:4px 1px 0;}a.fbTab:hover{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) 0 -73px;}a.fbTab:hover .fbTabL{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) -16px -96px;}a.fbTab:hover .fbTabR{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) -24px -96px;}.fbSelectedTab{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) #f1f2ee 0 -50px !important;color:#000;}.fbSelectedTab .fbTabL{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) 0 -96px !important;}.fbSelectedTab .fbTabR{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/sprite.png) -8px -96px !important;}#fbHSplitter{position:fixed;_position:absolute;left:0;top:0;width:100%;height:5px;overflow:hidden;cursor:n-resize !important;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/pixel_transparent.gif);z-index:9;}#fbHSplitter.fbOnMovingHSplitter{height:100%;z-index:100;}.fbVSplitter{background:#ece9d8;color:#000;border:1px solid #716f64;border-width:0 1px;border-left-color:#aca899;width:4px;cursor:e-resize;overflow:hidden;right:294px;text-decoration:none;z-index:10;position:absolute;height:100%;top:27px;}div.lineNo{font:1em/1.4545em Monaco,monospace;position:relative;float:left;top:0;left:0;margin:0 5px 0 0;padding:0 5px 0 10px;background:#eee;color:#888;border-right:1px solid #ccc;text-align:right;}.sourceBox{position:absolute;}.sourceCode{font:1em Monaco,monospace;overflow:hidden;white-space:pre;display:inline;}.nodeControl{margin-top:3px;margin-left:-14px;float:left;width:9px;height:9px;overflow:hidden;cursor:default;background:url(https://getfirebug.com/releases/lite/latest/skin/xp/tree_open.gif);_float:none;_display:inline;_position:absolute;}div.nodeMaximized{background:url(https://getfirebug.com/releases/lite/latest/skin/xp/tree_close.gif);}div.objectBox-element{padding:1px 3px;}.objectBox-selector{cursor:default;}.selectedElement{background:highlight;color:#fff !important;}.selectedElement span{color:#fff !important;}* html .selectedElement{position:relative;}@media screen and (-webkit-min-device-pixel-ratio:0){.selectedElement{background:#316AC5;color:#fff !important;}}.logRow *{font-size:1em;}.logRow{position:relative;border-bottom:1px solid #D7D7D7;padding:2px 4px 1px 6px;zbackground-color:#FFFFFF;}.logRow-command{font-family:Monaco,monospace;color:blue;}.objectBox-string,.objectBox-text,.objectBox-number,.objectBox-function,.objectLink-element,.objectLink-textNode,.objectLink-function,.objectBox-stackTrace,.objectLink-profile{font-family:Monaco,monospace;}.objectBox-null{padding:0 2px;border:1px solid #666666;background-color:#888888;color:#FFFFFF;}.objectBox-string{color:red;}.objectBox-number{color:#000088;}.objectBox-function{color:DarkGreen;}.objectBox-object{color:DarkGreen;font-weight:bold;font-family:Lucida Grande,sans-serif;}.objectBox-array{color:#000;}.logRow-info,.logRow-error,.logRow-warn{background:#fff no-repeat 2px 2px;padding-left:20px;padding-bottom:3px;}.logRow-info{background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/infoIcon.png) !important;background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/infoIcon.gif);}.logRow-warn{background-color:cyan;background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/warningIcon.png) !important;background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/warningIcon.gif);}.logRow-error{background-color:LightYellow;background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/errorIcon.png) !important;background-image:url(https://getfirebug.com/releases/lite/latest/skin/xp/errorIcon.gif);color:#f00;}.errorMessage{vertical-align:top;color:#f00;}.objectBox-sourceLink{position:absolute;right:4px;top:2px;padding-left:8px;font-family:Lucida Grande,sans-serif;font-weight:bold;color:#0000FF;}.selectorTag,.selectorId,.selectorClass{font-family:Monaco,monospace;font-weight:normal;}.selectorTag{color:#0000FF;}.selectorId{color:DarkBlue;}.selectorClass{color:red;}.objectBox-element{font-family:Monaco,monospace;color:#000088;}.nodeChildren{padding-left:26px;}.nodeTag{color:blue;cursor:pointer;}.nodeValue{color:#FF0000;font-weight:normal;}.nodeText,.nodeComment{margin:0 2px;vertical-align:top;}.nodeText{color:#333333;font-family:Monaco,monospace;}.nodeComment{color:DarkGreen;}.nodeHidden,.nodeHidden *{color:#888888;}.nodeHidden .nodeTag{color:#5F82D9;}.nodeHidden .nodeValue{color:#D86060;}.selectedElement .nodeHidden,.selectedElement .nodeHidden *{color:SkyBlue !important;}.log-object{}.property{position:relative;clear:both;height:15px;}.propertyNameCell{vertical-align:top;float:left;width:28%;position:absolute;left:0;z-index:0;}.propertyValueCell{float:right;width:68%;background:#fff;position:absolute;padding-left:5px;display:table-cell;right:0;z-index:1;}.propertyName{font-weight:bold;}.FirebugPopup{height:100% !important;}.FirebugPopup #fbWindowButtons{display:none !important;}.FirebugPopup #fbHSplitter{display:none !important;}',
-    HTML: '<table id="fbChrome" cellpadding="0" cellspacing="0" border="0"><tbody><tr><td id="fbTop" colspan="2"><div id="fbWindowButtons"><a id="fbWindow_btDeactivate" class="fbSmallButton fbHover" title="Deactivate Firebug for this web page">&nbsp;</a><a id="fbWindow_btDetach" class="fbSmallButton fbHover" title="Open Firebug in popup window">&nbsp;</a><a id="fbWindow_btClose" class="fbSmallButton fbHover" title="Minimize Firebug">&nbsp;</a></div><div id="fbToolbar"><div id="fbToolbarContent"><span id="fbToolbarIcon"><a id="fbFirebugButton" class="fbIconButton" class="fbHover" target="_blank">&nbsp;</a></span><span id="fbToolbarButtons"><span id="fbFixedButtons"><a id="fbChrome_btInspect" class="fbButton fbHover" title="Click an element in the page to inspect">Inspect</a></span><span id="fbConsoleButtons" class="fbToolbarButtons"><a id="fbConsole_btClear" class="fbButton fbHover" title="Clear the console">Clear</a></span></span><span id="fbStatusBarBox"><span class="fbToolbarSeparator"></span></span></div></div><div id="fbPanelBarBox"><div id="fbPanelBar1" class="fbPanelBar"><a id="fbConsoleTab" class="fbTab fbHover"><span class="fbTabL"></span><span class="fbTabText">Console</span><span class="fbTabMenuTarget"></span><span class="fbTabR"></span></a><a id="fbHTMLTab" class="fbTab fbHover"><span class="fbTabL"></span><span class="fbTabText">HTML</span><span class="fbTabR"></span></a><a class="fbTab fbHover"><span class="fbTabL"></span><span class="fbTabText">CSS</span><span class="fbTabR"></span></a><a class="fbTab fbHover"><span class="fbTabL"></span><span class="fbTabText">Script</span><span class="fbTabR"></span></a><a class="fbTab fbHover"><span class="fbTabL"></span><span class="fbTabText">DOM</span><span class="fbTabR"></span></a></div><div id="fbPanelBar2Box" class="hide"><div id="fbPanelBar2" class="fbPanelBar"></div></div></div><div id="fbHSplitter">&nbsp;</div></td></tr><tr id="fbContent"><td id="fbPanelBox1"><div id="fbPanel1" class="fbFitHeight"><div id="fbConsole" class="fbPanel"></div><div id="fbHTML" class="fbPanel"></div></div></td><td id="fbPanelBox2" class="hide"><div id="fbVSplitter" class="fbVSplitter">&nbsp;</div><div id="fbPanel2" class="fbFitHeight"><div id="fbHTML_Style" class="fbPanel"></div><div id="fbHTML_Layout" class="fbPanel"></div><div id="fbHTML_DOM" class="fbPanel"></div></div><textarea id="fbLargeCommandLine" class="fbFitHeight"></textarea><div id="fbLargeCommandButtons"><a id="fbCommand_btRun" class="fbButton fbHover">Run</a><a id="fbCommand_btClear" class="fbButton fbHover">Clear</a><a id="fbSmallCommandLineIcon" class="fbSmallButton fbHover"></a></div></td></tr><tr id="fbBottom" class="hide"><td id="fbCommand" colspan="2"><div id="fbCommandBox"><div id="fbCommandIcon">&gt;&gt;&gt;</div><input id="fbCommandLine" name="fbCommandLine" type="text"/><a id="fbLargeCommandLineIcon" class="fbSmallButton fbHover"></a></div></td></tr></tbody></table><span id="fbMiniChrome"><span id="fbMiniContent"><span id="fbMiniIcon" title="Open Firebug Lite"></span><span id="fbMiniErrors" class="fbErrors"></span></span></span>'
-};
-
-// ************************************************************************************************
-}});
-
-// ************************************************************************************************
-FBL.initialize();
-// ************************************************************************************************
-
-})();
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/json-js/json2.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/json-js/json2.js
deleted file mode 100644
index 5838457..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/json-js/json2.js
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
-    json2.js
-    2015-05-03
-
-    Public Domain.
-
-    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
-    See http://www.JSON.org/js.html
-
-
-    This code should be minified before deployment.
-    See http://javascript.crockford.com/jsmin.html
-
-    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
-    NOT CONTROL.
-
-
-    This file creates a global JSON object containing two methods: stringify
-    and parse. This file is provides the ES5 JSON capability to ES3 systems.
-    If a project might run on IE8 or earlier, then this file should be included.
-    This file does nothing on ES5 systems.
-
-        JSON.stringify(value, replacer, space)
-            value       any JavaScript value, usually an object or array.
-
-            replacer    an optional parameter that determines how object
-                        values are stringified for objects. It can be a
-                        function or an array of strings.
-
-            space       an optional parameter that specifies the indentation
-                        of nested structures. If it is omitted, the text will
-                        be packed without extra whitespace. If it is a number,
-                        it will specify the number of spaces to indent at each
-                        level. If it is a string (such as '\t' or '&nbsp;'),
-                        it contains the characters used to indent at each level.
-
-            This method produces a JSON text from a JavaScript value.
-
-            When an object value is found, if the object contains a toJSON
-            method, its toJSON method will be called and the result will be
-            stringified. A toJSON method does not serialize: it returns the
-            value represented by the name/value pair that should be serialized,
-            or undefined if nothing should be serialized. The toJSON method
-            will be passed the key associated with the value, and this will be
-            bound to the value
-
-            For example, this would serialize Dates as ISO strings.
-
-                Date.prototype.toJSON = function (key) {
-                    function f(n) {
-                        // Format integers to have at least two digits.
-                        return n < 10 
-                            ? '0' + n 
-                            : n;
-                    }
-
-                    return this.getUTCFullYear()   + '-' +
-                         f(this.getUTCMonth() + 1) + '-' +
-                         f(this.getUTCDate())      + 'T' +
-                         f(this.getUTCHours())     + ':' +
-                         f(this.getUTCMinutes())   + ':' +
-                         f(this.getUTCSeconds())   + 'Z';
-                };
-
-            You can provide an optional replacer method. It will be passed the
-            key and value of each member, with this bound to the containing
-            object. The value that is returned from your method will be
-            serialized. If your method returns undefined, then the member will
-            be excluded from the serialization.
-
-            If the replacer parameter is an array of strings, then it will be
-            used to select the members to be serialized. It filters the results
-            such that only members with keys listed in the replacer array are
-            stringified.
-
-            Values that do not have JSON representations, such as undefined or
-            functions, will not be serialized. Such values in objects will be
-            dropped; in arrays they will be replaced with null. You can use
-            a replacer function to replace those with JSON values.
-            JSON.stringify(undefined) returns undefined.
-
-            The optional space parameter produces a stringification of the
-            value that is filled with line breaks and indentation to make it
-            easier to read.
-
-            If the space parameter is a non-empty string, then that string will
-            be used for indentation. If the space parameter is a number, then
-            the indentation will be that many spaces.
-
-            Example:
-
-            text = JSON.stringify(['e', {pluribus: 'unum'}]);
-            // text is '["e",{"pluribus":"unum"}]'
-
-
-            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
-            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
-
-            text = JSON.stringify([new Date()], function (key, value) {
-                return this[key] instanceof Date 
-                    ? 'Date(' + this[key] + ')' 
-                    : value;
-            });
-            // text is '["Date(---current time---)"]'
-
-
-        JSON.parse(text, reviver)
-            This method parses a JSON text to produce an object or array.
-            It can throw a SyntaxError exception.
-
-            The optional reviver parameter is a function that can filter and
-            transform the results. It receives each of the keys and values,
-            and its return value is used instead of the original value.
-            If it returns what it received, then the structure is not modified.
-            If it returns undefined then the member is deleted.
-
-            Example:
-
-            // Parse the text. Values that look like ISO date strings will
-            // be converted to Date objects.
-
-            myData = JSON.parse(text, function (key, value) {
-                var a;
-                if (typeof value === 'string') {
-                    a =
-/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
-                    if (a) {
-                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
-                            +a[5], +a[6]));
-                    }
-                }
-                return value;
-            });
-
-            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
-                var d;
-                if (typeof value === 'string' &&
-                        value.slice(0, 5) === 'Date(' &&
-                        value.slice(-1) === ')') {
-                    d = new Date(value.slice(5, -1));
-                    if (d) {
-                        return d;
-                    }
-                }
-                return value;
-            });
-
-
-    This is a reference implementation. You are free to copy, modify, or
-    redistribute.
-*/
-
-/*jslint 
-    eval, for, this 
-*/
-
-/*property
-    JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
-    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
-    lastIndex, length, parse, prototype, push, replace, slice, stringify,
-    test, toJSON, toString, valueOf
-*/
-
-
-// Create a JSON object only if one does not already exist. We create the
-// methods in a closure to avoid creating global variables.
-
-if (typeof JSON !== 'object') {
-    JSON = {};
-}
-
-(function () {
-    'use strict';
-    
-    var rx_one = /^[\],:{}\s]*$/,
-        rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
-        rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
-        rx_four = /(?:^|:|,)(?:\s*\[)+/g,
-        rx_escapable = /[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-        rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
-
-    function f(n) {
-        // Format integers to have at least two digits.
-        return n < 10 
-            ? '0' + n 
-            : n;
-    }
-    
-    function this_value() {
-        return this.valueOf();
-    }
-
-    if (typeof Date.prototype.toJSON !== 'function') {
-
-        Date.prototype.toJSON = function () {
-
-            return isFinite(this.valueOf())
-                ? this.getUTCFullYear() + '-' +
-                        f(this.getUTCMonth() + 1) + '-' +
-                        f(this.getUTCDate()) + 'T' +
-                        f(this.getUTCHours()) + ':' +
-                        f(this.getUTCMinutes()) + ':' +
-                        f(this.getUTCSeconds()) + 'Z'
-                : null;
-        };
-
-        Boolean.prototype.toJSON = this_value;
-        Number.prototype.toJSON = this_value;
-        String.prototype.toJSON = this_value;
-    }
-
-    var gap,
-        indent,
-        meta,
-        rep;
-
-
-    function quote(string) {
-
-// If the string contains no control characters, no quote characters, and no
-// backslash characters, then we can safely slap some quotes around it.
-// Otherwise we must also replace the offending characters with safe escape
-// sequences.
-
-        rx_escapable.lastIndex = 0;
-        return rx_escapable.test(string) 
-            ? '"' + string.replace(rx_escapable, function (a) {
-                var c = meta[a];
-                return typeof c === 'string'
-                    ? c
-                    : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
-            }) + '"' 
-            : '"' + string + '"';
-    }
-
-
-    function str(key, holder) {
-
-// Produce a string from holder[key].
-
-        var i,          // The loop counter.
-            k,          // The member key.
-            v,          // The member value.
-            length,
-            mind = gap,
-            partial,
-            value = holder[key];
-
-// If the value has a toJSON method, call it to obtain a replacement value.
-
-        if (value && typeof value === 'object' &&
-                typeof value.toJSON === 'function') {
-            value = value.toJSON(key);
-        }
-
-// If we were called with a replacer function, then call the replacer to
-// obtain a replacement value.
-
-        if (typeof rep === 'function') {
-            value = rep.call(holder, key, value);
-        }
-
-// What happens next depends on the value's type.
-
-        switch (typeof value) {
-        case 'string':
-            return quote(value);
-
-        case 'number':
-
-// JSON numbers must be finite. Encode non-finite numbers as null.
-
-            return isFinite(value) 
-                ? String(value) 
-                : 'null';
-
-        case 'boolean':
-        case 'null':
-
-// If the value is a boolean or null, convert it to a string. Note:
-// typeof null does not produce 'null'. The case is included here in
-// the remote chance that this gets fixed someday.
-
-            return String(value);
-
-// If the type is 'object', we might be dealing with an object or an array or
-// null.
-
-        case 'object':
-
-// Due to a specification blunder in ECMAScript, typeof null is 'object',
-// so watch out for that case.
-
-            if (!value) {
-                return 'null';
-            }
-
-// Make an array to hold the partial results of stringifying this object value.
-
-            gap += indent;
-            partial = [];
-
-// Is the value an array?
-
-            if (Object.prototype.toString.apply(value) === '[object Array]') {
-
-// The value is an array. Stringify every element. Use null as a placeholder
-// for non-JSON values.
-
-                length = value.length;
-                for (i = 0; i < length; i += 1) {
-                    partial[i] = str(i, value) || 'null';
-                }
-
-// Join all of the elements together, separated with commas, and wrap them in
-// brackets.
-
-                v = partial.length === 0
-                    ? '[]'
-                    : gap
-                        ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
-                        : '[' + partial.join(',') + ']';
-                gap = mind;
-                return v;
-            }
-
-// If the replacer is an array, use it to select the members to be stringified.
-
-            if (rep && typeof rep === 'object') {
-                length = rep.length;
-                for (i = 0; i < length; i += 1) {
-                    if (typeof rep[i] === 'string') {
-                        k = rep[i];
-                        v = str(k, value);
-                        if (v) {
-                            partial.push(quote(k) + (
-                                gap 
-                                    ? ': ' 
-                                    : ':'
-                            ) + v);
-                        }
-                    }
-                }
-            } else {
-
-// Otherwise, iterate through all of the keys in the object.
-
-                for (k in value) {
-                    if (Object.prototype.hasOwnProperty.call(value, k)) {
-                        v = str(k, value);
-                        if (v) {
-                            partial.push(quote(k) + (
-                                gap 
-                                    ? ': ' 
-                                    : ':'
-                            ) + v);
-                        }
-                    }
-                }
-            }
-
-// Join all of the member texts together, separated with commas,
-// and wrap them in braces.
-
-            v = partial.length === 0
-                ? '{}'
-                : gap
-                    ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
-                    : '{' + partial.join(',') + '}';
-            gap = mind;
-            return v;
-        }
-    }
-
-// If the JSON object does not yet have a stringify method, give it one.
-
-    if (typeof JSON.stringify !== 'function') {
-        meta = {    // table of character substitutions
-            '\b': '\\b',
-            '\t': '\\t',
-            '\n': '\\n',
-            '\f': '\\f',
-            '\r': '\\r',
-            '"': '\\"',
-            '\\': '\\\\'
-        };
-        JSON.stringify = function (value, replacer, space) {
-
-// The stringify method takes a value and an optional replacer, and an optional
-// space parameter, and returns a JSON text. The replacer can be a function
-// that can replace values, or an array of strings that will select the keys.
-// A default replacer method can be provided. Use of the space parameter can
-// produce text that is more easily readable.
-
-            var i;
-            gap = '';
-            indent = '';
-
-// If the space parameter is a number, make an indent string containing that
-// many spaces.
-
-            if (typeof space === 'number') {
-                for (i = 0; i < space; i += 1) {
-                    indent += ' ';
-                }
-
-// If the space parameter is a string, it will be used as the indent string.
-
-            } else if (typeof space === 'string') {
-                indent = space;
-            }
-
-// If there is a replacer, it must be a function or an array.
-// Otherwise, throw an error.
-
-            rep = replacer;
-            if (replacer && typeof replacer !== 'function' &&
-                    (typeof replacer !== 'object' ||
-                    typeof replacer.length !== 'number')) {
-                throw new Error('JSON.stringify');
-            }
-
-// Make a fake root object containing our value under the key of ''.
-// Return the result of stringifying the value.
-
-            return str('', {'': value});
-        };
-    }
-
-
-// If the JSON object does not yet have a parse method, give it one.
-
-    if (typeof JSON.parse !== 'function') {
-        JSON.parse = function (text, reviver) {
-
-// The parse method takes a text and an optional reviver function, and returns
-// a JavaScript value if the text is a valid JSON text.
-
-            var j;
-
-            function walk(holder, key) {
-
-// The walk method is used to recursively walk the resulting structure so
-// that modifications can be made.
-
-                var k, v, value = holder[key];
-                if (value && typeof value === 'object') {
-                    for (k in value) {
-                        if (Object.prototype.hasOwnProperty.call(value, k)) {
-                            v = walk(value, k);
-                            if (v !== undefined) {
-                                value[k] = v;
-                            } else {
-                                delete value[k];
-                            }
-                        }
-                    }
-                }
-                return reviver.call(holder, key, value);
-            }
-
-
-// Parsing happens in four stages. In the first stage, we replace certain
-// Unicode characters with escape sequences. JavaScript handles many characters
-// incorrectly, either silently deleting them, or treating them as line endings.
-
-            text = String(text);
-            rx_dangerous.lastIndex = 0;
-            if (rx_dangerous.test(text)) {
-                text = text.replace(rx_dangerous, function (a) {
-                    return '\\u' +
-                            ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
-                });
-            }
-
-// In the second stage, we run the text against regular expressions that look
-// for non-JSON patterns. We are especially concerned with '()' and 'new'
-// because they can cause invocation, and '=' because it can cause mutation.
-// But just to be safe, we want to reject all unexpected forms.
-
-// We split the second stage into 4 regexp operations in order to work around
-// crippling inefficiencies in IE's and Safari's regexp engines. First we
-// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
-// replace all simple value tokens with ']' characters. Third, we delete all
-// open brackets that follow a colon or comma or that begin the text. Finally,
-// we look to see that the remaining characters are only whitespace or ']' or
-// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
-
-            if (
-                rx_one.test(
-                    text
-                        .replace(rx_two, '@')
-                        .replace(rx_three, ']')
-                        .replace(rx_four, '')
-                )
-            ) {
-
-// In the third stage we use the eval function to compile the text into a
-// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
-// in JavaScript: it can begin a block or an object literal. We wrap the text
-// in parens to eliminate the ambiguity.
-
-                j = eval('(' + text + ')');
-
-// In the optional fourth stage, we recursively walk the new structure, passing
-// each name/value pair to a reviver function for possible transformation.
-
-                return typeof reviver === 'function'
-                    ? walk({'': j}, '')
-                    : j;
-            }
-
-// If the text is not JSON parseable, then a SyntaxError is thrown.
-
-            throw new SyntaxError('JSON.parse');
-        };
-    }
-}());
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/LICENSE b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/LICENSE
deleted file mode 100644
index 447239f..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright (c) 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative
-Reporters & Editors
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/arrays.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/arrays.js
deleted file mode 100644
index 748edea..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/arrays.js
+++ /dev/null
@@ -1,555 +0,0 @@
-(function() {
-  var _ = typeof require == 'function' ? require('..') : window._;
-
-  QUnit.module('Arrays');
-
-  QUnit.test('first', function(assert) {
-    assert.equal(_.first([1, 2, 3]), 1, 'can pull out the first element of an array');
-    assert.equal(_([1, 2, 3]).first(), 1, 'can perform OO-style "first()"');
-    assert.deepEqual(_.first([1, 2, 3], 0), [], 'returns an empty array when n <= 0 (0 case)');
-    assert.deepEqual(_.first([1, 2, 3], -1), [], 'returns an empty array when n <= 0 (negative case)');
-    assert.deepEqual(_.first([1, 2, 3], 2), [1, 2], 'can fetch the first n elements');
-    assert.deepEqual(_.first([1, 2, 3], 5), [1, 2, 3], 'returns the whole array if n > length');
-    var result = (function(){ return _.first(arguments); }(4, 3, 2, 1));
-    assert.equal(result, 4, 'works on an arguments object');
-    result = _.map([[1, 2, 3], [1, 2, 3]], _.first);
-    assert.deepEqual(result, [1, 1], 'works well with _.map');
-    assert.equal(_.first(null), void 0, 'returns undefined when called on null');
-  });
-
-  QUnit.test('head', function(assert) {
-    assert.strictEqual(_.head, _.first, 'is an alias for first');
-  });
-
-  QUnit.test('take', function(assert) {
-    assert.strictEqual(_.take, _.first, 'is an alias for first');
-  });
-
-  QUnit.test('rest', function(assert) {
-    var numbers = [1, 2, 3, 4];
-    assert.deepEqual(_.rest(numbers), [2, 3, 4], 'fetches all but the first element');
-    assert.deepEqual(_.rest(numbers, 0), [1, 2, 3, 4], 'returns the whole array when index is 0');
-    assert.deepEqual(_.rest(numbers, 2), [3, 4], 'returns elements starting at the given index');
-    var result = (function(){ return _(arguments).rest(); }(1, 2, 3, 4));
-    assert.deepEqual(result, [2, 3, 4], 'works on an arguments object');
-    result = _.map([[1, 2, 3], [1, 2, 3]], _.rest);
-    assert.deepEqual(_.flatten(result), [2, 3, 2, 3], 'works well with _.map');
-  });
-
-  QUnit.test('tail', function(assert) {
-    assert.strictEqual(_.tail, _.rest, 'is an alias for rest');
-  });
-
-  QUnit.test('drop', function(assert) {
-    assert.strictEqual(_.drop, _.rest, 'is an alias for rest');
-  });
-
-  QUnit.test('initial', function(assert) {
-    assert.deepEqual(_.initial([1, 2, 3, 4, 5]), [1, 2, 3, 4], 'returns all but the last element');
-    assert.deepEqual(_.initial([1, 2, 3, 4], 2), [1, 2], 'returns all but the last n elements');
-    assert.deepEqual(_.initial([1, 2, 3, 4], 6), [], 'returns an empty array when n > length');
-    var result = (function(){ return _(arguments).initial(); }(1, 2, 3, 4));
-    assert.deepEqual(result, [1, 2, 3], 'works on an arguments object');
-    result = _.map([[1, 2, 3], [1, 2, 3]], _.initial);
-    assert.deepEqual(_.flatten(result), [1, 2, 1, 2], 'works well with _.map');
-  });
-
-  QUnit.test('last', function(assert) {
-    assert.equal(_.last([1, 2, 3]), 3, 'can pull out the last element of an array');
-    assert.equal(_([1, 2, 3]).last(), 3, 'can perform OO-style "last()"');
-    assert.deepEqual(_.last([1, 2, 3], 0), [], 'returns an empty array when n <= 0 (0 case)');
-    assert.deepEqual(_.last([1, 2, 3], -1), [], 'returns an empty array when n <= 0 (negative case)');
-    assert.deepEqual(_.last([1, 2, 3], 2), [2, 3], 'can fetch the last n elements');
-    assert.deepEqual(_.last([1, 2, 3], 5), [1, 2, 3], 'returns the whole array if n > length');
-    var result = (function(){ return _(arguments).last(); }(1, 2, 3, 4));
-    assert.equal(result, 4, 'works on an arguments object');
-    result = _.map([[1, 2, 3], [1, 2, 3]], _.last);
-    assert.deepEqual(result, [3, 3], 'works well with _.map');
-    assert.equal(_.last(null), void 0, 'returns undefined when called on null');
-  });
-
-  QUnit.test('compact', function(assert) {
-    assert.deepEqual(_.compact([1, false, null, 0, '', void 0, NaN, 2]), [1, 2], 'removes all falsy values');
-    var result = (function(){ return _.compact(arguments); }(0, 1, false, 2, false, 3));
-    assert.deepEqual(result, [1, 2, 3], 'works on an arguments object');
-    result = _.map([[1, false, false], [false, false, 3]], _.compact);
-    assert.deepEqual(result, [[1], [3]], 'works well with _.map');
-  });
-
-  QUnit.test('flatten', function(assert) {
-    assert.deepEqual(_.flatten(null), [], 'supports null');
-    assert.deepEqual(_.flatten(void 0), [], 'supports undefined');
-
-    assert.deepEqual(_.flatten([[], [[]], []]), [], 'supports empty arrays');
-    assert.deepEqual(_.flatten([[], [[]], []], true), [[]], 'can shallowly flatten empty arrays');
-
-    var list = [1, [2], [3, [[[4]]]]];
-    assert.deepEqual(_.flatten(list), [1, 2, 3, 4], 'can flatten nested arrays');
-    assert.deepEqual(_.flatten(list, true), [1, 2, 3, [[[4]]]], 'can shallowly flatten nested arrays');
-    var result = (function(){ return _.flatten(arguments); }(1, [2], [3, [[[4]]]]));
-    assert.deepEqual(result, [1, 2, 3, 4], 'works on an arguments object');
-    list = [[1], [2], [3], [[4]]];
-    assert.deepEqual(_.flatten(list, true), [1, 2, 3, [4]], 'can shallowly flatten arrays containing only other arrays');
-
-    assert.equal(_.flatten([_.range(10), _.range(10), 5, 1, 3], true).length, 23, 'can flatten medium length arrays');
-    assert.equal(_.flatten([_.range(10), _.range(10), 5, 1, 3]).length, 23, 'can shallowly flatten medium length arrays');
-    assert.equal(_.flatten([new Array(1000000), _.range(56000), 5, 1, 3]).length, 1056003, 'can handle massive arrays');
-    assert.equal(_.flatten([new Array(1000000), _.range(56000), 5, 1, 3], true).length, 1056003, 'can handle massive arrays in shallow mode');
-
-    var x = _.range(100000);
-    for (var i = 0; i < 1000; i++) x = [x];
-    assert.deepEqual(_.flatten(x), _.range(100000), 'can handle very deep arrays');
-    assert.deepEqual(_.flatten(x, true), x[0], 'can handle very deep arrays in shallow mode');
-  });
-
-  QUnit.test('without', function(assert) {
-    var list = [1, 2, 1, 0, 3, 1, 4];
-    assert.deepEqual(_.without(list, 0, 1), [2, 3, 4], 'removes all instances of the given values');
-    var result = (function(){ return _.without(arguments, 0, 1); }(1, 2, 1, 0, 3, 1, 4));
-    assert.deepEqual(result, [2, 3, 4], 'works on an arguments object');
-
-    list = [{one: 1}, {two: 2}];
-    assert.deepEqual(_.without(list, {one: 1}), list, 'compares objects by reference (value case)');
-    assert.deepEqual(_.without(list, list[0]), [{two: 2}], 'compares objects by reference (reference case)');
-  });
-
-  QUnit.test('sortedIndex', function(assert) {
-    var numbers = [10, 20, 30, 40, 50];
-    var indexFor35 = _.sortedIndex(numbers, 35);
-    assert.equal(indexFor35, 3, 'finds the index at which a value should be inserted to retain order');
-    var indexFor30 = _.sortedIndex(numbers, 30);
-    assert.equal(indexFor30, 2, 'finds the smallest index at which a value could be inserted to retain order');
-
-    var objects = [{x: 10}, {x: 20}, {x: 30}, {x: 40}];
-    var iterator = function(obj){ return obj.x; };
-    assert.strictEqual(_.sortedIndex(objects, {x: 25}, iterator), 2, 'uses the result of `iterator` for order comparisons');
-    assert.strictEqual(_.sortedIndex(objects, {x: 35}, 'x'), 3, 'when `iterator` is a string, uses that key for order comparisons');
-
-    var context = {1: 2, 2: 3, 3: 4};
-    iterator = function(obj){ return this[obj]; };
-    assert.strictEqual(_.sortedIndex([1, 3], 2, iterator, context), 1, 'can execute its iterator in the given context');
-
-    var values = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287,
-        1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647];
-    var largeArray = Array(Math.pow(2, 32) - 1);
-    var length = values.length;
-    // Sparsely populate `array`
-    while (length--) {
-      largeArray[values[length]] = values[length];
-    }
-    assert.equal(_.sortedIndex(largeArray, 2147483648), 2147483648, 'works with large indexes');
-  });
-
-  QUnit.test('uniq', function(assert) {
-    var list = [1, 2, 1, 3, 1, 4];
-    assert.deepEqual(_.uniq(list), [1, 2, 3, 4], 'can find the unique values of an unsorted array');
-    list = [1, 1, 1, 2, 2, 3];
-    assert.deepEqual(_.uniq(list, true), [1, 2, 3], 'can find the unique values of a sorted array faster');
-
-    list = [{name: 'Moe'}, {name: 'Curly'}, {name: 'Larry'}, {name: 'Curly'}];
-    var expected = [{name: 'Moe'}, {name: 'Curly'}, {name: 'Larry'}];
-    var iterator = function(stooge) { return stooge.name; };
-    assert.deepEqual(_.uniq(list, false, iterator), expected, 'uses the result of `iterator` for uniqueness comparisons (unsorted case)');
-    assert.deepEqual(_.uniq(list, iterator), expected, '`sorted` argument defaults to false when omitted');
-    assert.deepEqual(_.uniq(list, 'name'), expected, 'when `iterator` is a string, uses that key for comparisons (unsorted case)');
-
-    list = [{score: 8}, {score: 10}, {score: 10}];
-    expected = [{score: 8}, {score: 10}];
-    iterator = function(item) { return item.score; };
-    assert.deepEqual(_.uniq(list, true, iterator), expected, 'uses the result of `iterator` for uniqueness comparisons (sorted case)');
-    assert.deepEqual(_.uniq(list, true, 'score'), expected, 'when `iterator` is a string, uses that key for comparisons (sorted case)');
-
-    assert.deepEqual(_.uniq([{0: 1}, {0: 1}, {0: 1}, {0: 2}], 0), [{0: 1}, {0: 2}], 'can use falsey pluck like iterator');
-
-    var result = (function(){ return _.uniq(arguments); }(1, 2, 1, 3, 1, 4));
-    assert.deepEqual(result, [1, 2, 3, 4], 'works on an arguments object');
-
-    var a = {}, b = {}, c = {};
-    assert.deepEqual(_.uniq([a, b, a, b, c]), [a, b, c], 'works on values that can be tested for equivalency but not ordered');
-
-    assert.deepEqual(_.uniq(null), [], 'returns an empty array when `array` is not iterable');
-
-    var context = {};
-    list = [3];
-    _.uniq(list, function(value, index, array) {
-      assert.strictEqual(this, context, 'executes its iterator in the given context');
-      assert.strictEqual(value, 3, 'passes its iterator the value');
-      assert.strictEqual(index, 0, 'passes its iterator the index');
-      assert.strictEqual(array, list, 'passes its iterator the entire array');
-    }, context);
-
-  });
-
-  QUnit.test('unique', function(assert) {
-    assert.strictEqual(_.unique, _.uniq, 'is an alias for uniq');
-  });
-
-  QUnit.test('intersection', function(assert) {
-    var stooges = ['moe', 'curly', 'larry'], leaders = ['moe', 'groucho'];
-    assert.deepEqual(_.intersection(stooges, leaders), ['moe'], 'can find the set intersection of two arrays');
-    assert.deepEqual(_(stooges).intersection(leaders), ['moe'], 'can perform an OO-style intersection');
-    var result = (function(){ return _.intersection(arguments, leaders); }('moe', 'curly', 'larry'));
-    assert.deepEqual(result, ['moe'], 'works on an arguments object');
-    var theSixStooges = ['moe', 'moe', 'curly', 'curly', 'larry', 'larry'];
-    assert.deepEqual(_.intersection(theSixStooges, leaders), ['moe'], 'returns a duplicate-free array');
-    result = _.intersection([2, 4, 3, 1], [1, 2, 3]);
-    assert.deepEqual(result, [2, 3, 1], 'preserves the order of the first array');
-    result = _.intersection(null, [1, 2, 3]);
-    assert.deepEqual(result, [], 'returns an empty array when passed null as the first argument');
-    result = _.intersection([1, 2, 3], null);
-    assert.deepEqual(result, [], 'returns an empty array when passed null as an argument beyond the first');
-  });
-
-  QUnit.test('union', function(assert) {
-    var result = _.union([1, 2, 3], [2, 30, 1], [1, 40]);
-    assert.deepEqual(result, [1, 2, 3, 30, 40], 'can find the union of a list of arrays');
-
-    result = _([1, 2, 3]).union([2, 30, 1], [1, 40]);
-    assert.deepEqual(result, [1, 2, 3, 30, 40], 'can perform an OO-style union');
-
-    result = _.union([1, 2, 3], [2, 30, 1], [1, 40, [1]]);
-    assert.deepEqual(result, [1, 2, 3, 30, 40, [1]], 'can find the union of a list of nested arrays');
-
-    result = _.union([10, 20], [1, 30, 10], [0, 40]);
-    assert.deepEqual(result, [10, 20, 1, 30, 0, 40], 'orders values by their first encounter');
-
-    result = (function(){ return _.union(arguments, [2, 30, 1], [1, 40]); }(1, 2, 3));
-    assert.deepEqual(result, [1, 2, 3, 30, 40], 'works on an arguments object');
-
-    assert.deepEqual(_.union([1, 2, 3], 4), [1, 2, 3], 'restricts the union to arrays only');
-  });
-
-  QUnit.test('difference', function(assert) {
-    var result = _.difference([1, 2, 3], [2, 30, 40]);
-    assert.deepEqual(result, [1, 3], 'can find the difference of two arrays');
-
-    result = _([1, 2, 3]).difference([2, 30, 40]);
-    assert.deepEqual(result, [1, 3], 'can perform an OO-style difference');
-
-    result = _.difference([1, 2, 3, 4], [2, 30, 40], [1, 11, 111]);
-    assert.deepEqual(result, [3, 4], 'can find the difference of three arrays');
-
-    result = _.difference([8, 9, 3, 1], [3, 8]);
-    assert.deepEqual(result, [9, 1], 'preserves the order of the first array');
-
-    result = (function(){ return _.difference(arguments, [2, 30, 40]); }(1, 2, 3));
-    assert.deepEqual(result, [1, 3], 'works on an arguments object');
-
-    result = _.difference([1, 2, 3], 1);
-    assert.deepEqual(result, [1, 2, 3], 'restrict the difference to arrays only');
-  });
-
-  QUnit.test('zip', function(assert) {
-    var names = ['moe', 'larry', 'curly'], ages = [30, 40, 50], leaders = [true];
-    assert.deepEqual(_.zip(names, ages, leaders), [
-      ['moe', 30, true],
-      ['larry', 40, void 0],
-      ['curly', 50, void 0]
-    ], 'zipped together arrays of different lengths');
-
-    var stooges = _.zip(['moe', 30, 'stooge 1'], ['larry', 40, 'stooge 2'], ['curly', 50, 'stooge 3']);
-    assert.deepEqual(stooges, [['moe', 'larry', 'curly'], [30, 40, 50], ['stooge 1', 'stooge 2', 'stooge 3']], 'zipped pairs');
-
-    // In the case of different lengths of the tuples, undefined values
-    // should be used as placeholder
-    stooges = _.zip(['moe', 30], ['larry', 40], ['curly', 50, 'extra data']);
-    assert.deepEqual(stooges, [['moe', 'larry', 'curly'], [30, 40, 50], [void 0, void 0, 'extra data']], 'zipped pairs with empties');
-
-    var empty = _.zip([]);
-    assert.deepEqual(empty, [], 'unzipped empty');
-
-    assert.deepEqual(_.zip(null), [], 'handles null');
-    assert.deepEqual(_.zip(), [], '_.zip() returns []');
-  });
-
-  QUnit.test('unzip', function(assert) {
-    assert.deepEqual(_.unzip(null), [], 'handles null');
-
-    assert.deepEqual(_.unzip([['a', 'b'], [1, 2]]), [['a', 1], ['b', 2]]);
-
-    // complements zip
-    var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
-    assert.deepEqual(_.unzip(zipped), [['fred', 'barney'], [30, 40], [true, false]]);
-
-    zipped = _.zip(['moe', 30], ['larry', 40], ['curly', 50, 'extra data']);
-    assert.deepEqual(_.unzip(zipped), [['moe', 30, void 0], ['larry', 40, void 0], ['curly', 50, 'extra data']], 'Uses length of largest array');
-  });
-
-  QUnit.test('object', function(assert) {
-    var result = _.object(['moe', 'larry', 'curly'], [30, 40, 50]);
-    var shouldBe = {moe: 30, larry: 40, curly: 50};
-    assert.deepEqual(result, shouldBe, 'two arrays zipped together into an object');
-
-    result = _.object([['one', 1], ['two', 2], ['three', 3]]);
-    shouldBe = {one: 1, two: 2, three: 3};
-    assert.deepEqual(result, shouldBe, 'an array of pairs zipped together into an object');
-
-    var stooges = {moe: 30, larry: 40, curly: 50};
-    assert.deepEqual(_.object(_.pairs(stooges)), stooges, 'an object converted to pairs and back to an object');
-
-    assert.deepEqual(_.object(null), {}, 'handles nulls');
-  });
-
-  QUnit.test('indexOf', function(assert) {
-    var numbers = [1, 2, 3];
-    assert.equal(_.indexOf(numbers, 2), 1, 'can compute indexOf');
-    var result = (function(){ return _.indexOf(arguments, 2); }(1, 2, 3));
-    assert.equal(result, 1, 'works on an arguments object');
-
-    _.each([null, void 0, [], false], function(val) {
-      var msg = 'Handles: ' + (_.isArray(val) ? '[]' : val);
-      assert.equal(_.indexOf(val, 2), -1, msg);
-      assert.equal(_.indexOf(val, 2, -1), -1, msg);
-      assert.equal(_.indexOf(val, 2, -20), -1, msg);
-      assert.equal(_.indexOf(val, 2, 15), -1, msg);
-    });
-
-    var num = 35;
-    numbers = [10, 20, 30, 40, 50];
-    var index = _.indexOf(numbers, num, true);
-    assert.equal(index, -1, '35 is not in the list');
-
-    numbers = [10, 20, 30, 40, 50]; num = 40;
-    index = _.indexOf(numbers, num, true);
-    assert.equal(index, 3, '40 is in the list');
-
-    numbers = [1, 40, 40, 40, 40, 40, 40, 40, 50, 60, 70]; num = 40;
-    assert.equal(_.indexOf(numbers, num, true), 1, '40 is in the list');
-    assert.equal(_.indexOf(numbers, 6, true), -1, '6 isnt in the list');
-    assert.equal(_.indexOf([1, 2, 5, 4, 6, 7], 5, true), -1, 'sorted indexOf doesn\'t uses binary search');
-    assert.ok(_.every(['1', [], {}, null], function() {
-      return _.indexOf(numbers, num, {}) === 1;
-    }), 'non-nums as fromIndex make indexOf assume sorted');
-
-    numbers = [1, 2, 3, 1, 2, 3, 1, 2, 3];
-    index = _.indexOf(numbers, 2, 5);
-    assert.equal(index, 7, 'supports the fromIndex argument');
-
-    index = _.indexOf([,,, 0], void 0);
-    assert.equal(index, 0, 'treats sparse arrays as if they were dense');
-
-    var array = [1, 2, 3, 1, 2, 3];
-    assert.strictEqual(_.indexOf(array, 1, -3), 3, 'neg `fromIndex` starts at the right index');
-    assert.strictEqual(_.indexOf(array, 1, -2), -1, 'neg `fromIndex` starts at the right index');
-    assert.strictEqual(_.indexOf(array, 2, -3), 4);
-    _.each([-6, -8, -Infinity], function(fromIndex) {
-      assert.strictEqual(_.indexOf(array, 1, fromIndex), 0);
-    });
-    assert.strictEqual(_.indexOf([1, 2, 3], 1, true), 0);
-
-    index = _.indexOf([], void 0, true);
-    assert.equal(index, -1, 'empty array with truthy `isSorted` returns -1');
-  });
-
-  QUnit.test('indexOf with NaN', function(assert) {
-    assert.strictEqual(_.indexOf([1, 2, NaN, NaN], NaN), 2, 'Expected [1, 2, NaN] to contain NaN');
-    assert.strictEqual(_.indexOf([1, 2, Infinity], NaN), -1, 'Expected [1, 2, NaN] to contain NaN');
-
-    assert.strictEqual(_.indexOf([1, 2, NaN, NaN], NaN, 1), 2, 'startIndex does not affect result');
-    assert.strictEqual(_.indexOf([1, 2, NaN, NaN], NaN, -2), 2, 'startIndex does not affect result');
-
-    (function() {
-      assert.strictEqual(_.indexOf(arguments, NaN), 2, 'Expected arguments [1, 2, NaN] to contain NaN');
-    }(1, 2, NaN, NaN));
-  });
-
-  QUnit.test('indexOf with +- 0', function(assert) {
-    _.each([-0, +0], function(val) {
-      assert.strictEqual(_.indexOf([1, 2, val, val], val), 2);
-      assert.strictEqual(_.indexOf([1, 2, val, val], -val), 2);
-    });
-  });
-
-  QUnit.test('lastIndexOf', function(assert) {
-    var numbers = [1, 0, 1];
-    var falsey = [void 0, '', 0, false, NaN, null, void 0];
-    assert.equal(_.lastIndexOf(numbers, 1), 2);
-
-    numbers = [1, 0, 1, 0, 0, 1, 0, 0, 0];
-    numbers.lastIndexOf = null;
-    assert.equal(_.lastIndexOf(numbers, 1), 5, 'can compute lastIndexOf, even without the native function');
-    assert.equal(_.lastIndexOf(numbers, 0), 8, 'lastIndexOf the other element');
-    var result = (function(){ return _.lastIndexOf(arguments, 1); }(1, 0, 1, 0, 0, 1, 0, 0, 0));
-    assert.equal(result, 5, 'works on an arguments object');
-
-    _.each([null, void 0, [], false], function(val) {
-      var msg = 'Handles: ' + (_.isArray(val) ? '[]' : val);
-      assert.equal(_.lastIndexOf(val, 2), -1, msg);
-      assert.equal(_.lastIndexOf(val, 2, -1), -1, msg);
-      assert.equal(_.lastIndexOf(val, 2, -20), -1, msg);
-      assert.equal(_.lastIndexOf(val, 2, 15), -1, msg);
-    });
-
-    numbers = [1, 2, 3, 1, 2, 3, 1, 2, 3];
-    var index = _.lastIndexOf(numbers, 2, 2);
-    assert.equal(index, 1, 'supports the fromIndex argument');
-
-    var array = [1, 2, 3, 1, 2, 3];
-
-    assert.strictEqual(_.lastIndexOf(array, 1, 0), 0, 'starts at the correct from idx');
-    assert.strictEqual(_.lastIndexOf(array, 3), 5, 'should return the index of the last matched value');
-    assert.strictEqual(_.lastIndexOf(array, 4), -1, 'should return `-1` for an unmatched value');
-
-    assert.strictEqual(_.lastIndexOf(array, 1, 2), 0, 'should work with a positive `fromIndex`');
-
-    _.each([6, 8, Math.pow(2, 32), Infinity], function(fromIndex) {
-      assert.strictEqual(_.lastIndexOf(array, void 0, fromIndex), -1);
-      assert.strictEqual(_.lastIndexOf(array, 1, fromIndex), 3);
-      assert.strictEqual(_.lastIndexOf(array, '', fromIndex), -1);
-    });
-
-    var expected = _.map(falsey, function(value) {
-      return typeof value == 'number' ? -1 : 5;
-    });
-
-    var actual = _.map(falsey, function(fromIndex) {
-      return _.lastIndexOf(array, 3, fromIndex);
-    });
-
-    assert.deepEqual(actual, expected, 'should treat falsey `fromIndex` values, except `0` and `NaN`, as `array.length`');
-    assert.strictEqual(_.lastIndexOf(array, 3, '1'), 5, 'should treat non-number `fromIndex` values as `array.length`');
-    assert.strictEqual(_.lastIndexOf(array, 3, true), 5, 'should treat non-number `fromIndex` values as `array.length`');
-
-    assert.strictEqual(_.lastIndexOf(array, 2, -3), 1, 'should work with a negative `fromIndex`');
-    assert.strictEqual(_.lastIndexOf(array, 1, -3), 3, 'neg `fromIndex` starts at the right index');
-
-    assert.deepEqual(_.map([-6, -8, -Infinity], function(fromIndex) {
-      return _.lastIndexOf(array, 1, fromIndex);
-    }), [0, -1, -1]);
-  });
-
-  QUnit.test('lastIndexOf with NaN', function(assert) {
-    assert.strictEqual(_.lastIndexOf([1, 2, NaN, NaN], NaN), 3, 'Expected [1, 2, NaN] to contain NaN');
-    assert.strictEqual(_.lastIndexOf([1, 2, Infinity], NaN), -1, 'Expected [1, 2, NaN] to contain NaN');
-
-    assert.strictEqual(_.lastIndexOf([1, 2, NaN, NaN], NaN, 2), 2, 'fromIndex does not affect result');
-    assert.strictEqual(_.lastIndexOf([1, 2, NaN, NaN], NaN, -2), 2, 'fromIndex does not affect result');
-
-    (function() {
-      assert.strictEqual(_.lastIndexOf(arguments, NaN), 3, 'Expected arguments [1, 2, NaN] to contain NaN');
-    }(1, 2, NaN, NaN));
-  });
-
-  QUnit.test('lastIndexOf with +- 0', function(assert) {
-    _.each([-0, +0], function(val) {
-      assert.strictEqual(_.lastIndexOf([1, 2, val, val], val), 3);
-      assert.strictEqual(_.lastIndexOf([1, 2, val, val], -val), 3);
-      assert.strictEqual(_.lastIndexOf([-1, 1, 2], -val), -1);
-    });
-  });
-
-  QUnit.test('findIndex', function(assert) {
-    var objects = [
-      {a: 0, b: 0},
-      {a: 1, b: 1},
-      {a: 2, b: 2},
-      {a: 0, b: 0}
-    ];
-
-    assert.equal(_.findIndex(objects, function(obj) {
-      return obj.a === 0;
-    }), 0);
-
-    assert.equal(_.findIndex(objects, function(obj) {
-      return obj.b * obj.a === 4;
-    }), 2);
-
-    assert.equal(_.findIndex(objects, 'a'), 1, 'Uses lookupIterator');
-
-    assert.equal(_.findIndex(objects, function(obj) {
-      return obj.b * obj.a === 5;
-    }), -1);
-
-    assert.equal(_.findIndex(null, _.noop), -1);
-    assert.strictEqual(_.findIndex(objects, function(a) {
-      return a.foo === null;
-    }), -1);
-    _.findIndex([{a: 1}], function(a, key, obj) {
-      assert.equal(key, 0);
-      assert.deepEqual(obj, [{a: 1}]);
-      assert.strictEqual(this, objects, 'called with context');
-    }, objects);
-
-    var sparse = [];
-    sparse[20] = {a: 2, b: 2};
-    assert.equal(_.findIndex(sparse, function(obj) {
-      return obj && obj.b * obj.a === 4;
-    }), 20, 'Works with sparse arrays');
-
-    var array = [1, 2, 3, 4];
-    array.match = 55;
-    assert.strictEqual(_.findIndex(array, function(x) { return x === 55; }), -1, 'doesn\'t match array-likes keys');
-  });
-
-  QUnit.test('findLastIndex', function(assert) {
-    var objects = [
-      {a: 0, b: 0},
-      {a: 1, b: 1},
-      {a: 2, b: 2},
-      {a: 0, b: 0}
-    ];
-
-    assert.equal(_.findLastIndex(objects, function(obj) {
-      return obj.a === 0;
-    }), 3);
-
-    assert.equal(_.findLastIndex(objects, function(obj) {
-      return obj.b * obj.a === 4;
-    }), 2);
-
-    assert.equal(_.findLastIndex(objects, 'a'), 2, 'Uses lookupIterator');
-
-    assert.equal(_.findLastIndex(objects, function(obj) {
-      return obj.b * obj.a === 5;
-    }), -1);
-
-    assert.equal(_.findLastIndex(null, _.noop), -1);
-    assert.strictEqual(_.findLastIndex(objects, function(a) {
-      return a.foo === null;
-    }), -1);
-    _.findLastIndex([{a: 1}], function(a, key, obj) {
-      assert.equal(key, 0);
-      assert.deepEqual(obj, [{a: 1}]);
-      assert.strictEqual(this, objects, 'called with context');
-    }, objects);
-
-    var sparse = [];
-    sparse[20] = {a: 2, b: 2};
-    assert.equal(_.findLastIndex(sparse, function(obj) {
-      return obj && obj.b * obj.a === 4;
-    }), 20, 'Works with sparse arrays');
-
-    var array = [1, 2, 3, 4];
-    array.match = 55;
-    assert.strictEqual(_.findLastIndex(array, function(x) { return x === 55; }), -1, 'doesn\'t match array-likes keys');
-  });
-
-  QUnit.test('range', function(assert) {
-    assert.deepEqual(_.range(0), [], 'range with 0 as a first argument generates an empty array');
-    assert.deepEqual(_.range(4), [0, 1, 2, 3], 'range with a single positive argument generates an array of elements 0,1,2,...,n-1');
-    assert.deepEqual(_.range(5, 8), [5, 6, 7], 'range with two arguments a &amp; b, a&lt;b generates an array of elements a,a+1,a+2,...,b-2,b-1');
-    assert.deepEqual(_.range(3, 10, 3), [3, 6, 9], 'range with three arguments a &amp; b &amp; c, c &lt; b-a, a &lt; b generates an array of elements a,a+c,a+2c,...,b - (multiplier of a) &lt; c');
-    assert.deepEqual(_.range(3, 10, 15), [3], 'range with three arguments a &amp; b &amp; c, c &gt; b-a, a &lt; b generates an array with a single element, equal to a');
-    assert.deepEqual(_.range(12, 7, -2), [12, 10, 8], 'range with three arguments a &amp; b &amp; c, a &gt; b, c &lt; 0 generates an array of elements a,a-c,a-2c and ends with the number not less than b');
-    assert.deepEqual(_.range(0, -10, -1), [0, -1, -2, -3, -4, -5, -6, -7, -8, -9], 'final example in the Python docs');
-    assert.strictEqual(1 / _.range(-0, 1)[0], -Infinity, 'should preserve -0');
-    assert.deepEqual(_.range(8, 5), [8, 7, 6], 'negative range generates descending array');
-    assert.deepEqual(_.range(-3), [0, -1, -2], 'negative range generates descending array');
-  });
-
-  QUnit.test('chunk', function(assert) {
-    assert.deepEqual(_.chunk([], 2), [], 'chunk for empty array returns an empty array');
-
-    assert.deepEqual(_.chunk([1, 2, 3], 0), [], 'chunk into parts of 0 elements returns empty array');
-    assert.deepEqual(_.chunk([1, 2, 3], -1), [], 'chunk into parts of negative amount of elements returns an empty array');
-    assert.deepEqual(_.chunk([1, 2, 3]), [], 'defaults to empty array (chunk size 0)');
-
-    assert.deepEqual(_.chunk([1, 2, 3], 1), [[1], [2], [3]], 'chunk into parts of 1 elements returns original array');
-
-    assert.deepEqual(_.chunk([1, 2, 3], 3), [[1, 2, 3]], 'chunk into parts of current array length elements returns the original array');
-    assert.deepEqual(_.chunk([1, 2, 3], 5), [[1, 2, 3]], 'chunk into parts of more then current array length elements returns the original array');
-
-    assert.deepEqual(_.chunk([10, 20, 30, 40, 50, 60, 70], 2), [[10, 20], [30, 40], [50, 60], [70]], 'chunk into parts of less then current array length elements');
-    assert.deepEqual(_.chunk([10, 20, 30, 40, 50, 60, 70], 3), [[10, 20, 30], [40, 50, 60], [70]], 'chunk into parts of less then current array length elements');
-  });
-}());
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/chaining.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/chaining.js
deleted file mode 100644
index 6ad21dc..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/chaining.js
+++ /dev/null
@@ -1,99 +0,0 @@
-(function() {
-  var _ = typeof require == 'function' ? require('..') : window._;
-
-  QUnit.module('Chaining');
-
-  QUnit.test('map/flatten/reduce', function(assert) {
-    var lyrics = [
-      'I\'m a lumberjack and I\'m okay',
-      'I sleep all night and I work all day',
-      'He\'s a lumberjack and he\'s okay',
-      'He sleeps all night and he works all day'
-    ];
-    var counts = _(lyrics).chain()
-      .map(function(line) { return line.split(''); })
-      .flatten()
-      .reduce(function(hash, l) {
-        hash[l] = hash[l] || 0;
-        hash[l]++;
-        return hash;
-      }, {})
-      .value();
-    assert.equal(counts.a, 16, 'counted all the letters in the song');
-    assert.equal(counts.e, 10, 'counted all the letters in the song');
-  });
-
-  QUnit.test('select/reject/sortBy', function(assert) {
-    var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
-    numbers = _(numbers).chain().select(function(n) {
-      return n % 2 === 0;
-    }).reject(function(n) {
-      return n % 4 === 0;
-    }).sortBy(function(n) {
-      return -n;
-    }).value();
-    assert.deepEqual(numbers, [10, 6, 2], 'filtered and reversed the numbers');
-  });
-
-  QUnit.test('select/reject/sortBy in functional style', function(assert) {
-    var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
-    numbers = _.chain(numbers).select(function(n) {
-      return n % 2 === 0;
-    }).reject(function(n) {
-      return n % 4 === 0;
-    }).sortBy(function(n) {
-      return -n;
-    }).value();
-    assert.deepEqual(numbers, [10, 6, 2], 'filtered and reversed the numbers');
-  });
-
-  QUnit.test('reverse/concat/unshift/pop/map', function(assert) {
-    var numbers = [1, 2, 3, 4, 5];
-    numbers = _(numbers).chain()
-      .reverse()
-      .concat([5, 5, 5])
-      .unshift(17)
-      .pop()
-      .map(function(n){ return n * 2; })
-      .value();
-    assert.deepEqual(numbers, [34, 10, 8, 6, 4, 2, 10, 10], 'can chain together array functions.');
-  });
-
-  QUnit.test('splice', function(assert) {
-    var instance = _([1, 2, 3, 4, 5]).chain();
-    assert.deepEqual(instance.splice(1, 3).value(), [1, 5]);
-    assert.deepEqual(instance.splice(1, 0).value(), [1, 5]);
-    assert.deepEqual(instance.splice(1, 1).value(), [1]);
-    assert.deepEqual(instance.splice(0, 1).value(), [], '#397 Can create empty array');
-  });
-
-  QUnit.test('shift', function(assert) {
-    var instance = _([1, 2, 3]).chain();
-    assert.deepEqual(instance.shift().value(), [2, 3]);
-    assert.deepEqual(instance.shift().value(), [3]);
-    assert.deepEqual(instance.shift().value(), [], '#397 Can create empty array');
-  });
-
-  QUnit.test('pop', function(assert) {
-    var instance = _([1, 2, 3]).chain();
-    assert.deepEqual(instance.pop().value(), [1, 2]);
-    assert.deepEqual(instance.pop().value(), [1]);
-    assert.deepEqual(instance.pop().value(), [], '#397 Can create empty array');
-  });
-
-  QUnit.test('chaining works in small stages', function(assert) {
-    var o = _([1, 2, 3, 4]).chain();
-    assert.deepEqual(o.filter(function(i) { return i < 3; }).value(), [1, 2]);
-    assert.deepEqual(o.filter(function(i) { return i > 2; }).value(), [3, 4]);
-  });
-
-  QUnit.test('#1562: Engine proxies for chained functions', function(assert) {
-    var wrapped = _(512);
-    assert.strictEqual(wrapped.toJSON(), 512);
-    assert.strictEqual(wrapped.valueOf(), 512);
-    assert.strictEqual(+wrapped, 512);
-    assert.strictEqual(wrapped.toString(), '512');
-    assert.strictEqual('' + wrapped, '512');
-  });
-
-}());
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/collections.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/collections.js
deleted file mode 100644
index 182f7a2..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/collections.js
+++ /dev/null
@@ -1,896 +0,0 @@
-(function() {
-  var _ = typeof require == 'function' ? require('..') : window._;
-
-  QUnit.module('Collections');
-
-  QUnit.test('each', function(assert) {
-    _.each([1, 2, 3], function(num, i) {
-      assert.equal(num, i + 1, 'each iterators provide value and iteration count');
-    });
-
-    var answers = [];
-    _.each([1, 2, 3], function(num){ answers.push(num * this.multiplier); }, {multiplier: 5});
-    assert.deepEqual(answers, [5, 10, 15], 'context object property accessed');
-
-    answers = [];
-    _.each([1, 2, 3], function(num){ answers.push(num); });
-    assert.deepEqual(answers, [1, 2, 3], 'can iterate a simple array');
-
-    answers = [];
-    var obj = {one: 1, two: 2, three: 3};
-    obj.constructor.prototype.four = 4;
-    _.each(obj, function(value, key){ answers.push(key); });
-    assert.deepEqual(answers, ['one', 'two', 'three'], 'iterating over objects works, and ignores the object prototype.');
-    delete obj.constructor.prototype.four;
-
-    // ensure the each function is JITed
-    _(1000).times(function() { _.each([], function(){}); });
-    var count = 0;
-    obj = {1: 'foo', 2: 'bar', 3: 'baz'};
-    _.each(obj, function(){ count++; });
-    assert.equal(count, 3, 'the fun should be called only 3 times');
-
-    var answer = null;
-    _.each([1, 2, 3], function(num, index, arr){ if (_.include(arr, num)) answer = true; });
-    assert.ok(answer, 'can reference the original collection from inside the iterator');
-
-    answers = 0;
-    _.each(null, function(){ ++answers; });
-    assert.equal(answers, 0, 'handles a null properly');
-
-    _.each(false, function(){});
-
-    var a = [1, 2, 3];
-    assert.strictEqual(_.each(a, function(){}), a);
-    assert.strictEqual(_.each(null, function(){}), null);
-  });
-
-  QUnit.test('forEach', function(assert) {
-    assert.strictEqual(_.forEach, _.each, 'is an alias for each');
-  });
-
-  QUnit.test('lookupIterator with contexts', function(assert) {
-    _.each([true, false, 'yes', '', 0, 1, {}], function(context) {
-      _.each([1], function() {
-        assert.equal(this, context);
-      }, context);
-    });
-  });
-
-  QUnit.test('Iterating objects with sketchy length properties', function(assert) {
-    var functions = [
-      'each', 'map', 'filter', 'find',
-      'some', 'every', 'max', 'min',
-      'groupBy', 'countBy', 'partition', 'indexBy'
-    ];
-    var reducers = ['reduce', 'reduceRight'];
-
-    var tricks = [
-      {length: '5'},
-      {length: {valueOf: _.constant(5)}},
-      {length: Math.pow(2, 53) + 1},
-      {length: Math.pow(2, 53)},
-      {length: null},
-      {length: -2},
-      {length: new Number(15)}
-    ];
-
-    assert.expect(tricks.length * (functions.length + reducers.length + 4));
-
-    _.each(tricks, function(trick) {
-      var length = trick.length;
-      assert.strictEqual(_.size(trick), 1, 'size on obj with length: ' + length);
-      assert.deepEqual(_.toArray(trick), [length], 'toArray on obj with length: ' + length);
-      assert.deepEqual(_.shuffle(trick), [length], 'shuffle on obj with length: ' + length);
-      assert.deepEqual(_.sample(trick), length, 'sample on obj with length: ' + length);
-
-
-      _.each(functions, function(method) {
-        _[method](trick, function(val, key) {
-          assert.strictEqual(key, 'length', method + ': ran with length = ' + val);
-        });
-      });
-
-      _.each(reducers, function(method) {
-        assert.strictEqual(_[method](trick), trick.length, method);
-      });
-    });
-  });
-
-  QUnit.test('Resistant to collection length and properties changing while iterating', function(assert) {
-
-    var collection = [
-      'each', 'map', 'filter', 'find',
-      'some', 'every', 'max', 'min', 'reject',
-      'groupBy', 'countBy', 'partition', 'indexBy',
-      'reduce', 'reduceRight'
-    ];
-    var array = [
-      'findIndex', 'findLastIndex'
-    ];
-    var object = [
-      'mapObject', 'findKey', 'pick', 'omit'
-    ];
-
-    _.each(collection.concat(array), function(method) {
-      var sparseArray = [1, 2, 3];
-      sparseArray.length = 100;
-      var answers = 0;
-      _[method](sparseArray, function(){
-        ++answers;
-        return method === 'every' ? true : null;
-      }, {});
-      assert.equal(answers, 100, method + ' enumerates [0, length)');
-
-      var growingCollection = [1, 2, 3], count = 0;
-      _[method](growingCollection, function() {
-        if (count < 10) growingCollection.push(count++);
-        return method === 'every' ? true : null;
-      }, {});
-      assert.equal(count, 3, method + ' is resistant to length changes');
-    });
-
-    _.each(collection.concat(object), function(method) {
-      var changingObject = {0: 0, 1: 1}, count = 0;
-      _[method](changingObject, function(val) {
-        if (count < 10) changingObject[++count] = val + 1;
-        return method === 'every' ? true : null;
-      }, {});
-
-      assert.equal(count, 2, method + ' is resistant to property changes');
-    });
-  });
-
-  QUnit.test('map', function(assert) {
-    var doubled = _.map([1, 2, 3], function(num){ return num * 2; });
-    assert.deepEqual(doubled, [2, 4, 6], 'doubled numbers');
-
-    var tripled = _.map([1, 2, 3], function(num){ return num * this.multiplier; }, {multiplier: 3});
-    assert.deepEqual(tripled, [3, 6, 9], 'tripled numbers with context');
-
-    doubled = _([1, 2, 3]).map(function(num){ return num * 2; });
-    assert.deepEqual(doubled, [2, 4, 6], 'OO-style doubled numbers');
-
-    var ids = _.map({length: 2, 0: {id: '1'}, 1: {id: '2'}}, function(n){
-      return n.id;
-    });
-    assert.deepEqual(ids, ['1', '2'], 'Can use collection methods on Array-likes.');
-
-    assert.deepEqual(_.map(null, _.noop), [], 'handles a null properly');
-
-    assert.deepEqual(_.map([1], function() {
-      return this.length;
-    }, [5]), [1], 'called with context');
-
-    // Passing a property name like _.pluck.
-    var people = [{name: 'moe', age: 30}, {name: 'curly', age: 50}];
-    assert.deepEqual(_.map(people, 'name'), ['moe', 'curly'], 'predicate string map to object properties');
-  });
-
-  QUnit.test('collect', function(assert) {
-    assert.strictEqual(_.collect, _.map, 'is an alias for map');
-  });
-
-  QUnit.test('reduce', function(assert) {
-    var sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num; }, 0);
-    assert.equal(sum, 6, 'can sum up an array');
-
-    var context = {multiplier: 3};
-    sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num * this.multiplier; }, 0, context);
-    assert.equal(sum, 18, 'can reduce with a context object');
-
-    sum = _([1, 2, 3]).reduce(function(memo, num){ return memo + num; }, 0);
-    assert.equal(sum, 6, 'OO-style reduce');
-
-    sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num; });
-    assert.equal(sum, 6, 'default initial value');
-
-    var prod = _.reduce([1, 2, 3, 4], function(memo, num){ return memo * num; });
-    assert.equal(prod, 24, 'can reduce via multiplication');
-
-    assert.ok(_.reduce(null, _.noop, 138) === 138, 'handles a null (with initial value) properly');
-    assert.equal(_.reduce([], _.noop, void 0), void 0, 'undefined can be passed as a special case');
-    assert.equal(_.reduce([_], _.noop), _, 'collection of length one with no initial value returns the first item');
-    assert.equal(_.reduce([], _.noop), void 0, 'returns undefined when collection is empty and no initial value');
-  });
-
-  QUnit.test('foldl', function(assert) {
-    assert.strictEqual(_.foldl, _.reduce, 'is an alias for reduce');
-  });
-
-  QUnit.test('inject', function(assert) {
-    assert.strictEqual(_.inject, _.reduce, 'is an alias for reduce');
-  });
-
-  QUnit.test('reduceRight', function(assert) {
-    var list = _.reduceRight(['foo', 'bar', 'baz'], function(memo, str){ return memo + str; }, '');
-    assert.equal(list, 'bazbarfoo', 'can perform right folds');
-
-    list = _.reduceRight(['foo', 'bar', 'baz'], function(memo, str){ return memo + str; });
-    assert.equal(list, 'bazbarfoo', 'default initial value');
-
-    var sum = _.reduceRight({a: 1, b: 2, c: 3}, function(memo, num){ return memo + num; });
-    assert.equal(sum, 6, 'default initial value on object');
-
-    assert.ok(_.reduceRight(null, _.noop, 138) === 138, 'handles a null (with initial value) properly');
-    assert.equal(_.reduceRight([_], _.noop), _, 'collection of length one with no initial value returns the first item');
-
-    assert.equal(_.reduceRight([], _.noop, void 0), void 0, 'undefined can be passed as a special case');
-    assert.equal(_.reduceRight([], _.noop), void 0, 'returns undefined when collection is empty and no initial value');
-
-    // Assert that the correct arguments are being passed.
-
-    var args,
-        init = {},
-        object = {a: 1, b: 2},
-        lastKey = _.keys(object).pop();
-
-    var expected = lastKey === 'a'
-      ? [init, 1, 'a', object]
-      : [init, 2, 'b', object];
-
-    _.reduceRight(object, function() {
-      if (!args) args = _.toArray(arguments);
-    }, init);
-
-    assert.deepEqual(args, expected);
-
-    // And again, with numeric keys.
-
-    object = {2: 'a', 1: 'b'};
-    lastKey = _.keys(object).pop();
-    args = null;
-
-    expected = lastKey === '2'
-      ? [init, 'a', '2', object]
-      : [init, 'b', '1', object];
-
-    _.reduceRight(object, function() {
-      if (!args) args = _.toArray(arguments);
-    }, init);
-
-    assert.deepEqual(args, expected);
-  });
-
-  QUnit.test('foldr', function(assert) {
-    assert.strictEqual(_.foldr, _.reduceRight, 'is an alias for reduceRight');
-  });
-
-  QUnit.test('find', function(assert) {
-    var array = [1, 2, 3, 4];
-    assert.strictEqual(_.find(array, function(n) { return n > 2; }), 3, 'should return first found `value`');
-    assert.strictEqual(_.find(array, function() { return false; }), void 0, 'should return `undefined` if `value` is not found');
-
-    array.dontmatch = 55;
-    assert.strictEqual(_.find(array, function(x) { return x === 55; }), void 0, 'iterates array-likes correctly');
-
-    // Matching an object like _.findWhere.
-    var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}, {a: 2, b: 4}];
-    assert.deepEqual(_.find(list, {a: 1}), {a: 1, b: 2}, 'can be used as findWhere');
-    assert.deepEqual(_.find(list, {b: 4}), {a: 1, b: 4});
-    assert.ok(!_.find(list, {c: 1}), 'undefined when not found');
-    assert.ok(!_.find([], {c: 1}), 'undefined when searching empty list');
-
-    var result = _.find([1, 2, 3], function(num){ return num * 2 === 4; });
-    assert.equal(result, 2, 'found the first "2" and broke the loop');
-
-    var obj = {
-      a: {x: 1, z: 3},
-      b: {x: 2, z: 2},
-      c: {x: 3, z: 4},
-      d: {x: 4, z: 1}
-    };
-
-    assert.deepEqual(_.find(obj, {x: 2}), {x: 2, z: 2}, 'works on objects');
-    assert.deepEqual(_.find(obj, {x: 2, z: 1}), void 0);
-    assert.deepEqual(_.find(obj, function(x) {
-      return x.x === 4;
-    }), {x: 4, z: 1});
-
-    _.findIndex([{a: 1}], function(a, key, o) {
-      assert.equal(key, 0);
-      assert.deepEqual(o, [{a: 1}]);
-      assert.strictEqual(this, _, 'called with context');
-    }, _);
-  });
-
-  QUnit.test('detect', function(assert) {
-    assert.strictEqual(_.detect, _.find, 'is an alias for find');
-  });
-
-  QUnit.test('filter', function(assert) {
-    var evenArray = [1, 2, 3, 4, 5, 6];
-    var evenObject = {one: 1, two: 2, three: 3};
-    var isEven = function(num){ return num % 2 === 0; };
-
-    assert.deepEqual(_.filter(evenArray, isEven), [2, 4, 6]);
-    assert.deepEqual(_.filter(evenObject, isEven), [2], 'can filter objects');
-    assert.deepEqual(_.filter([{}, evenObject, []], 'two'), [evenObject], 'predicate string map to object properties');
-
-    _.filter([1], function() {
-      assert.equal(this, evenObject, 'given context');
-    }, evenObject);
-
-    // Can be used like _.where.
-    var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}];
-    assert.deepEqual(_.filter(list, {a: 1}), [{a: 1, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}]);
-    assert.deepEqual(_.filter(list, {b: 2}), [{a: 1, b: 2}, {a: 2, b: 2}]);
-    assert.deepEqual(_.filter(list, {}), list, 'Empty object accepts all items');
-    assert.deepEqual(_(list).filter({}), list, 'OO-filter');
-  });
-
-  QUnit.test('select', function(assert) {
-    assert.strictEqual(_.select, _.filter, 'is an alias for filter');
-  });
-
-  QUnit.test('reject', function(assert) {
-    var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 === 0; });
-    assert.deepEqual(odds, [1, 3, 5], 'rejected each even number');
-
-    var context = 'obj';
-
-    var evens = _.reject([1, 2, 3, 4, 5, 6], function(num){
-      assert.equal(context, 'obj');
-      return num % 2 !== 0;
-    }, context);
-    assert.deepEqual(evens, [2, 4, 6], 'rejected each odd number');
-
-    assert.deepEqual(_.reject([odds, {one: 1, two: 2, three: 3}], 'two'), [odds], 'predicate string map to object properties');
-
-    // Can be used like _.where.
-    var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}];
-    assert.deepEqual(_.reject(list, {a: 1}), [{a: 2, b: 2}]);
-    assert.deepEqual(_.reject(list, {b: 2}), [{a: 1, b: 3}, {a: 1, b: 4}]);
-    assert.deepEqual(_.reject(list, {}), [], 'Returns empty list given empty object');
-    assert.deepEqual(_.reject(list, []), [], 'Returns empty list given empty array');
-  });
-
-  QUnit.test('every', function(assert) {
-    assert.ok(_.every([], _.identity), 'the empty set');
-    assert.ok(_.every([true, true, true], _.identity), 'every true values');
-    assert.ok(!_.every([true, false, true], _.identity), 'one false value');
-    assert.ok(_.every([0, 10, 28], function(num){ return num % 2 === 0; }), 'even numbers');
-    assert.ok(!_.every([0, 11, 28], function(num){ return num % 2 === 0; }), 'an odd number');
-    assert.ok(_.every([1], _.identity) === true, 'cast to boolean - true');
-    assert.ok(_.every([0], _.identity) === false, 'cast to boolean - false');
-    assert.ok(!_.every([void 0, void 0, void 0], _.identity), 'works with arrays of undefined');
-
-    var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}];
-    assert.ok(!_.every(list, {a: 1, b: 2}), 'Can be called with object');
-    assert.ok(_.every(list, 'a'), 'String mapped to object property');
-
-    list = [{a: 1, b: 2}, {a: 2, b: 2, c: true}];
-    assert.ok(_.every(list, {b: 2}), 'Can be called with object');
-    assert.ok(!_.every(list, 'c'), 'String mapped to object property');
-
-    assert.ok(_.every({a: 1, b: 2, c: 3, d: 4}, _.isNumber), 'takes objects');
-    assert.ok(!_.every({a: 1, b: 2, c: 3, d: 4}, _.isObject), 'takes objects');
-    assert.ok(_.every(['a', 'b', 'c', 'd'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works');
-    assert.ok(!_.every(['a', 'b', 'c', 'd', 'f'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works');
-  });
-
-  QUnit.test('all', function(assert) {
-    assert.strictEqual(_.all, _.every, 'is an alias for every');
-  });
-
-  QUnit.test('some', function(assert) {
-    assert.ok(!_.some([]), 'the empty set');
-    assert.ok(!_.some([false, false, false]), 'all false values');
-    assert.ok(_.some([false, false, true]), 'one true value');
-    assert.ok(_.some([null, 0, 'yes', false]), 'a string');
-    assert.ok(!_.some([null, 0, '', false]), 'falsy values');
-    assert.ok(!_.some([1, 11, 29], function(num){ return num % 2 === 0; }), 'all odd numbers');
-    assert.ok(_.some([1, 10, 29], function(num){ return num % 2 === 0; }), 'an even number');
-    assert.ok(_.some([1], _.identity) === true, 'cast to boolean - true');
-    assert.ok(_.some([0], _.identity) === false, 'cast to boolean - false');
-    assert.ok(_.some([false, false, true]));
-
-    var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}];
-    assert.ok(!_.some(list, {a: 5, b: 2}), 'Can be called with object');
-    assert.ok(_.some(list, 'a'), 'String mapped to object property');
-
-    list = [{a: 1, b: 2}, {a: 2, b: 2, c: true}];
-    assert.ok(_.some(list, {b: 2}), 'Can be called with object');
-    assert.ok(!_.some(list, 'd'), 'String mapped to object property');
-
-    assert.ok(_.some({a: '1', b: '2', c: '3', d: '4', e: 6}, _.isNumber), 'takes objects');
-    assert.ok(!_.some({a: 1, b: 2, c: 3, d: 4}, _.isObject), 'takes objects');
-    assert.ok(_.some(['a', 'b', 'c', 'd'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works');
-    assert.ok(!_.some(['x', 'y', 'z'], _.hasOwnProperty, {a: 1, b: 2, c: 3, d: 4}), 'context works');
-  });
-
-  QUnit.test('any', function(assert) {
-    assert.strictEqual(_.any, _.some, 'is an alias for some');
-  });
-
-  QUnit.test('includes', function(assert) {
-    _.each([null, void 0, 0, 1, NaN, {}, []], function(val) {
-      assert.strictEqual(_.includes(val, 'hasOwnProperty'), false);
-    });
-    assert.strictEqual(_.includes([1, 2, 3], 2), true, 'two is in the array');
-    assert.ok(!_.includes([1, 3, 9], 2), 'two is not in the array');
-
-    assert.strictEqual(_.includes([5, 4, 3, 2, 1], 5, true), true, 'doesn\'t delegate to binary search');
-
-    assert.ok(_.includes({moe: 1, larry: 3, curly: 9}, 3) === true, '_.includes on objects checks their values');
-    assert.ok(_([1, 2, 3]).includes(2), 'OO-style includes');
-
-    var numbers = [1, 2, 3, 1, 2, 3, 1, 2, 3];
-    assert.strictEqual(_.includes(numbers, 1, 1), true, 'takes a fromIndex');
-    assert.strictEqual(_.includes(numbers, 1, -1), false, 'takes a fromIndex');
-    assert.strictEqual(_.includes(numbers, 1, -2), false, 'takes a fromIndex');
-    assert.strictEqual(_.includes(numbers, 1, -3), true, 'takes a fromIndex');
-    assert.strictEqual(_.includes(numbers, 1, 6), true, 'takes a fromIndex');
-    assert.strictEqual(_.includes(numbers, 1, 7), false, 'takes a fromIndex');
-
-    assert.ok(_.every([1, 2, 3], _.partial(_.includes, numbers)), 'fromIndex is guarded');
-  });
-
-  QUnit.test('include', function(assert) {
-    assert.strictEqual(_.include, _.includes, 'is an alias for includes');
-  });
-
-  QUnit.test('contains', function(assert) {
-    assert.strictEqual(_.contains, _.includes, 'is an alias for includes');
-
-  });
-
-  QUnit.test('includes with NaN', function(assert) {
-    assert.strictEqual(_.includes([1, 2, NaN, NaN], NaN), true, 'Expected [1, 2, NaN] to contain NaN');
-    assert.strictEqual(_.includes([1, 2, Infinity], NaN), false, 'Expected [1, 2, NaN] to contain NaN');
-  });
-
-  QUnit.test('includes with +- 0', function(assert) {
-    _.each([-0, +0], function(val) {
-      assert.strictEqual(_.includes([1, 2, val, val], val), true);
-      assert.strictEqual(_.includes([1, 2, val, val], -val), true);
-      assert.strictEqual(_.includes([-1, 1, 2], -val), false);
-    });
-  });
-
-
-  QUnit.test('invoke', function(assert) {
-    assert.expect(5);
-    var list = [[5, 1, 7], [3, 2, 1]];
-    var result = _.invoke(list, 'sort');
-    assert.deepEqual(result[0], [1, 5, 7], 'first array sorted');
-    assert.deepEqual(result[1], [1, 2, 3], 'second array sorted');
-
-    _.invoke([{
-      method: function() {
-        assert.deepEqual(_.toArray(arguments), [1, 2, 3], 'called with arguments');
-      }
-    }], 'method', 1, 2, 3);
-
-    assert.deepEqual(_.invoke([{a: null}, {}, {a: _.constant(1)}], 'a'), [null, void 0, 1], 'handles null & undefined');
-
-    assert.raises(function() {
-      _.invoke([{a: 1}], 'a');
-    }, TypeError, 'throws for non-functions');
-  });
-
-  QUnit.test('invoke w/ function reference', function(assert) {
-    var list = [[5, 1, 7], [3, 2, 1]];
-    var result = _.invoke(list, Array.prototype.sort);
-    assert.deepEqual(result[0], [1, 5, 7], 'first array sorted');
-    assert.deepEqual(result[1], [1, 2, 3], 'second array sorted');
-
-    assert.deepEqual(_.invoke([1, 2, 3], function(a) {
-      return a + this;
-    }, 5), [6, 7, 8], 'receives params from invoke');
-  });
-
-  // Relevant when using ClojureScript
-  QUnit.test('invoke when strings have a call method', function(assert) {
-    String.prototype.call = function() {
-      return 42;
-    };
-    var list = [[5, 1, 7], [3, 2, 1]];
-    var s = 'foo';
-    assert.equal(s.call(), 42, 'call function exists');
-    var result = _.invoke(list, 'sort');
-    assert.deepEqual(result[0], [1, 5, 7], 'first array sorted');
-    assert.deepEqual(result[1], [1, 2, 3], 'second array sorted');
-    delete String.prototype.call;
-    assert.equal(s.call, void 0, 'call function removed');
-  });
-
-  QUnit.test('pluck', function(assert) {
-    var people = [{name: 'moe', age: 30}, {name: 'curly', age: 50}];
-    assert.deepEqual(_.pluck(people, 'name'), ['moe', 'curly'], 'pulls names out of objects');
-    assert.deepEqual(_.pluck(people, 'address'), [void 0, void 0], 'missing properties are returned as undefined');
-    //compat: most flexible handling of edge cases
-    assert.deepEqual(_.pluck([{'[object Object]': 1}], {}), [1]);
-  });
-
-  QUnit.test('where', function(assert) {
-    var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}];
-    var result = _.where(list, {a: 1});
-    assert.equal(result.length, 3);
-    assert.equal(result[result.length - 1].b, 4);
-    result = _.where(list, {b: 2});
-    assert.equal(result.length, 2);
-    assert.equal(result[0].a, 1);
-    result = _.where(list, {});
-    assert.equal(result.length, list.length);
-
-    function test() {}
-    test.map = _.map;
-    assert.deepEqual(_.where([_, {a: 1, b: 2}, _], test), [_, _], 'checks properties given function');
-  });
-
-  QUnit.test('findWhere', function(assert) {
-    var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}, {a: 2, b: 4}];
-    var result = _.findWhere(list, {a: 1});
-    assert.deepEqual(result, {a: 1, b: 2});
-    result = _.findWhere(list, {b: 4});
-    assert.deepEqual(result, {a: 1, b: 4});
-
-    result = _.findWhere(list, {c: 1});
-    assert.ok(_.isUndefined(result), 'undefined when not found');
-
-    result = _.findWhere([], {c: 1});
-    assert.ok(_.isUndefined(result), 'undefined when searching empty list');
-
-    function test() {}
-    test.map = _.map;
-    assert.equal(_.findWhere([_, {a: 1, b: 2}, _], test), _, 'checks properties given function');
-
-    function TestClass() {
-      this.y = 5;
-      this.x = 'foo';
-    }
-    var expect = {c: 1, x: 'foo', y: 5};
-    assert.deepEqual(_.findWhere([{y: 5, b: 6}, expect], new TestClass()), expect, 'uses class instance properties');
-  });
-
-  QUnit.test('max', function(assert) {
-    assert.equal(-Infinity, _.max(null), 'can handle null/undefined');
-    assert.equal(-Infinity, _.max(void 0), 'can handle null/undefined');
-    assert.equal(-Infinity, _.max(null, _.identity), 'can handle null/undefined');
-
-    assert.equal(3, _.max([1, 2, 3]), 'can perform a regular Math.max');
-
-    var neg = _.max([1, 2, 3], function(num){ return -num; });
-    assert.equal(neg, 1, 'can perform a computation-based max');
-
-    assert.equal(-Infinity, _.max({}), 'Maximum value of an empty object');
-    assert.equal(-Infinity, _.max([]), 'Maximum value of an empty array');
-    assert.equal(_.max({a: 'a'}), -Infinity, 'Maximum value of a non-numeric collection');
-
-    assert.equal(299999, _.max(_.range(1, 300000)), 'Maximum value of a too-big array');
-
-    assert.equal(3, _.max([1, 2, 3, 'test']), 'Finds correct max in array starting with num and containing a NaN');
-    assert.equal(3, _.max(['test', 1, 2, 3]), 'Finds correct max in array starting with NaN');
-
-    assert.equal(3, _.max([1, 2, 3, null]), 'Finds correct max in array starting with num and containing a `null`');
-    assert.equal(3, _.max([null, 1, 2, 3]), 'Finds correct max in array starting with a `null`');
-
-    assert.equal(3, _.max([1, 2, 3, '']), 'Finds correct max in array starting with num and containing an empty string');
-    assert.equal(3, _.max(['', 1, 2, 3]), 'Finds correct max in array starting with an empty string');
-
-    assert.equal(3, _.max([1, 2, 3, false]), 'Finds correct max in array starting with num and containing a false');
-    assert.equal(3, _.max([false, 1, 2, 3]), 'Finds correct max in array starting with a false');
-
-    assert.equal(4, _.max([0, 1, 2, 3, 4]), 'Finds correct max in array containing a zero');
-    assert.equal(0, _.max([-3, -2, -1, 0]), 'Finds correct max in array containing negative numbers');
-
-    assert.deepEqual([3, 6], _.map([[1, 2, 3], [4, 5, 6]], _.max), 'Finds correct max in array when mapping through multiple arrays');
-
-    var a = {x: -Infinity};
-    var b = {x: -Infinity};
-    var iterator = function(o){ return o.x; };
-    assert.equal(_.max([a, b], iterator), a, 'Respects iterator return value of -Infinity');
-
-    assert.deepEqual(_.max([{a: 1}, {a: 0, b: 3}, {a: 4}, {a: 2}], 'a'), {a: 4}, 'String keys use property iterator');
-
-    assert.deepEqual(_.max([0, 2], function(c){ return c * this.x; }, {x: 1}), 2, 'Iterator context');
-    assert.deepEqual(_.max([[1], [2, 3], [-1, 4], [5]], 0), [5], 'Lookup falsy iterator');
-    assert.deepEqual(_.max([{0: 1}, {0: 2}, {0: -1}, {a: 1}], 0), {0: 2}, 'Lookup falsy iterator');
-  });
-
-  QUnit.test('min', function(assert) {
-    assert.equal(Infinity, _.min(null), 'can handle null/undefined');
-    assert.equal(Infinity, _.min(void 0), 'can handle null/undefined');
-    assert.equal(Infinity, _.min(null, _.identity), 'can handle null/undefined');
-
-    assert.equal(1, _.min([1, 2, 3]), 'can perform a regular Math.min');
-
-    var neg = _.min([1, 2, 3], function(num){ return -num; });
-    assert.equal(neg, 3, 'can perform a computation-based min');
-
-    assert.equal(Infinity, _.min({}), 'Minimum value of an empty object');
-    assert.equal(Infinity, _.min([]), 'Minimum value of an empty array');
-    assert.equal(_.min({a: 'a'}), Infinity, 'Minimum value of a non-numeric collection');
-
-    assert.deepEqual([1, 4], _.map([[1, 2, 3], [4, 5, 6]], _.min), 'Finds correct min in array when mapping through multiple arrays');
-
-    var now = new Date(9999999999);
-    var then = new Date(0);
-    assert.equal(_.min([now, then]), then);
-
-    assert.equal(1, _.min(_.range(1, 300000)), 'Minimum value of a too-big array');
-
-    assert.equal(1, _.min([1, 2, 3, 'test']), 'Finds correct min in array starting with num and containing a NaN');
-    assert.equal(1, _.min(['test', 1, 2, 3]), 'Finds correct min in array starting with NaN');
-
-    assert.equal(1, _.min([1, 2, 3, null]), 'Finds correct min in array starting with num and containing a `null`');
-    assert.equal(1, _.min([null, 1, 2, 3]), 'Finds correct min in array starting with a `null`');
-
-    assert.equal(0, _.min([0, 1, 2, 3, 4]), 'Finds correct min in array containing a zero');
-    assert.equal(-3, _.min([-3, -2, -1, 0]), 'Finds correct min in array containing negative numbers');
-
-    var a = {x: Infinity};
-    var b = {x: Infinity};
-    var iterator = function(o){ return o.x; };
-    assert.equal(_.min([a, b], iterator), a, 'Respects iterator return value of Infinity');
-
-    assert.deepEqual(_.min([{a: 1}, {a: 0, b: 3}, {a: 4}, {a: 2}], 'a'), {a: 0, b: 3}, 'String keys use property iterator');
-
-    assert.deepEqual(_.min([0, 2], function(c){ return c * this.x; }, {x: -1}), 2, 'Iterator context');
-    assert.deepEqual(_.min([[1], [2, 3], [-1, 4], [5]], 0), [-1, 4], 'Lookup falsy iterator');
-    assert.deepEqual(_.min([{0: 1}, {0: 2}, {0: -1}, {a: 1}], 0), {0: -1}, 'Lookup falsy iterator');
-  });
-
-  QUnit.test('sortBy', function(assert) {
-    var people = [{name: 'curly', age: 50}, {name: 'moe', age: 30}];
-    people = _.sortBy(people, function(person){ return person.age; });
-    assert.deepEqual(_.pluck(people, 'name'), ['moe', 'curly'], 'stooges sorted by age');
-
-    var list = [void 0, 4, 1, void 0, 3, 2];
-    assert.deepEqual(_.sortBy(list, _.identity), [1, 2, 3, 4, void 0, void 0], 'sortBy with undefined values');
-
-    list = ['one', 'two', 'three', 'four', 'five'];
-    var sorted = _.sortBy(list, 'length');
-    assert.deepEqual(sorted, ['one', 'two', 'four', 'five', 'three'], 'sorted by length');
-
-    function Pair(x, y) {
-      this.x = x;
-      this.y = y;
-    }
-
-    var stableArray = [
-      new Pair(1, 1), new Pair(1, 2),
-      new Pair(1, 3), new Pair(1, 4),
-      new Pair(1, 5), new Pair(1, 6),
-      new Pair(2, 1), new Pair(2, 2),
-      new Pair(2, 3), new Pair(2, 4),
-      new Pair(2, 5), new Pair(2, 6),
-      new Pair(void 0, 1), new Pair(void 0, 2),
-      new Pair(void 0, 3), new Pair(void 0, 4),
-      new Pair(void 0, 5), new Pair(void 0, 6)
-    ];
-
-    var stableObject = _.object('abcdefghijklmnopqr'.split(''), stableArray);
-
-    var actual = _.sortBy(stableArray, function(pair) {
-      return pair.x;
-    });
-
-    assert.deepEqual(actual, stableArray, 'sortBy should be stable for arrays');
-    assert.deepEqual(_.sortBy(stableArray, 'x'), stableArray, 'sortBy accepts property string');
-
-    actual = _.sortBy(stableObject, function(pair) {
-      return pair.x;
-    });
-
-    assert.deepEqual(actual, stableArray, 'sortBy should be stable for objects');
-
-    list = ['q', 'w', 'e', 'r', 't', 'y'];
-    assert.deepEqual(_.sortBy(list), ['e', 'q', 'r', 't', 'w', 'y'], 'uses _.identity if iterator is not specified');
-  });
-
-  QUnit.test('groupBy', function(assert) {
-    var parity = _.groupBy([1, 2, 3, 4, 5, 6], function(num){ return num % 2; });
-    assert.ok('0' in parity && '1' in parity, 'created a group for each value');
-    assert.deepEqual(parity[0], [2, 4, 6], 'put each even number in the right group');
-
-    var list = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'];
-    var grouped = _.groupBy(list, 'length');
-    assert.deepEqual(grouped['3'], ['one', 'two', 'six', 'ten']);
-    assert.deepEqual(grouped['4'], ['four', 'five', 'nine']);
-    assert.deepEqual(grouped['5'], ['three', 'seven', 'eight']);
-
-    var context = {};
-    _.groupBy([{}], function(){ assert.ok(this === context); }, context);
-
-    grouped = _.groupBy([4.2, 6.1, 6.4], function(num) {
-      return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor';
-    });
-    assert.equal(grouped.constructor.length, 1);
-    assert.equal(grouped.hasOwnProperty.length, 2);
-
-    var array = [{}];
-    _.groupBy(array, function(value, index, obj){ assert.ok(obj === array); });
-
-    array = [1, 2, 1, 2, 3];
-    grouped = _.groupBy(array);
-    assert.equal(grouped['1'].length, 2);
-    assert.equal(grouped['3'].length, 1);
-
-    var matrix = [
-      [1, 2],
-      [1, 3],
-      [2, 3]
-    ];
-    assert.deepEqual(_.groupBy(matrix, 0), {1: [[1, 2], [1, 3]], 2: [[2, 3]]});
-    assert.deepEqual(_.groupBy(matrix, 1), {2: [[1, 2]], 3: [[1, 3], [2, 3]]});
-  });
-
-  QUnit.test('indexBy', function(assert) {
-    var parity = _.indexBy([1, 2, 3, 4, 5], function(num){ return num % 2 === 0; });
-    assert.equal(parity['true'], 4);
-    assert.equal(parity['false'], 5);
-
-    var list = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'];
-    var grouped = _.indexBy(list, 'length');
-    assert.equal(grouped['3'], 'ten');
-    assert.equal(grouped['4'], 'nine');
-    assert.equal(grouped['5'], 'eight');
-
-    var array = [1, 2, 1, 2, 3];
-    grouped = _.indexBy(array);
-    assert.equal(grouped['1'], 1);
-    assert.equal(grouped['2'], 2);
-    assert.equal(grouped['3'], 3);
-  });
-
-  QUnit.test('countBy', function(assert) {
-    var parity = _.countBy([1, 2, 3, 4, 5], function(num){ return num % 2 === 0; });
-    assert.equal(parity['true'], 2);
-    assert.equal(parity['false'], 3);
-
-    var list = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'];
-    var grouped = _.countBy(list, 'length');
-    assert.equal(grouped['3'], 4);
-    assert.equal(grouped['4'], 3);
-    assert.equal(grouped['5'], 3);
-
-    var context = {};
-    _.countBy([{}], function(){ assert.ok(this === context); }, context);
-
-    grouped = _.countBy([4.2, 6.1, 6.4], function(num) {
-      return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor';
-    });
-    assert.equal(grouped.constructor, 1);
-    assert.equal(grouped.hasOwnProperty, 2);
-
-    var array = [{}];
-    _.countBy(array, function(value, index, obj){ assert.ok(obj === array); });
-
-    array = [1, 2, 1, 2, 3];
-    grouped = _.countBy(array);
-    assert.equal(grouped['1'], 2);
-    assert.equal(grouped['3'], 1);
-  });
-
-  QUnit.test('shuffle', function(assert) {
-    assert.deepEqual(_.shuffle([1]), [1], 'behaves correctly on size 1 arrays');
-    var numbers = _.range(20);
-    var shuffled = _.shuffle(numbers);
-    assert.notDeepEqual(numbers, shuffled, 'does change the order'); // Chance of false negative: 1 in ~2.4*10^18
-    assert.notStrictEqual(numbers, shuffled, 'original object is unmodified');
-    assert.deepEqual(numbers, _.sortBy(shuffled), 'contains the same members before and after shuffle');
-
-    shuffled = _.shuffle({a: 1, b: 2, c: 3, d: 4});
-    assert.equal(shuffled.length, 4);
-    assert.deepEqual(shuffled.sort(), [1, 2, 3, 4], 'works on objects');
-  });
-
-  QUnit.test('sample', function(assert) {
-    assert.strictEqual(_.sample([1]), 1, 'behaves correctly when no second parameter is given');
-    assert.deepEqual(_.sample([1, 2, 3], -2), [], 'behaves correctly on negative n');
-    var numbers = _.range(10);
-    var allSampled = _.sample(numbers, 10).sort();
-    assert.deepEqual(allSampled, numbers, 'contains the same members before and after sample');
-    allSampled = _.sample(numbers, 20).sort();
-    assert.deepEqual(allSampled, numbers, 'also works when sampling more objects than are present');
-    assert.ok(_.contains(numbers, _.sample(numbers)), 'sampling a single element returns something from the array');
-    assert.strictEqual(_.sample([]), void 0, 'sampling empty array with no number returns undefined');
-    assert.notStrictEqual(_.sample([], 5), [], 'sampling empty array with a number returns an empty array');
-    assert.notStrictEqual(_.sample([1, 2, 3], 0), [], 'sampling an array with 0 picks returns an empty array');
-    assert.deepEqual(_.sample([1, 2], -1), [], 'sampling a negative number of picks returns an empty array');
-    assert.ok(_.contains([1, 2, 3], _.sample({a: 1, b: 2, c: 3})), 'sample one value from an object');
-    var partialSample = _.sample(_.range(1000), 10);
-    var partialSampleSorted = partialSample.sort();
-    assert.notDeepEqual(partialSampleSorted, _.range(10), 'samples from the whole array, not just the beginning');
-  });
-
-  QUnit.test('toArray', function(assert) {
-    assert.ok(!_.isArray(arguments), 'arguments object is not an array');
-    assert.ok(_.isArray(_.toArray(arguments)), 'arguments object converted into array');
-    var a = [1, 2, 3];
-    assert.ok(_.toArray(a) !== a, 'array is cloned');
-    assert.deepEqual(_.toArray(a), [1, 2, 3], 'cloned array contains same elements');
-
-    var numbers = _.toArray({one: 1, two: 2, three: 3});
-    assert.deepEqual(numbers, [1, 2, 3], 'object flattened into array');
-
-    var hearts = '\uD83D\uDC95';
-    var pair = hearts.split('');
-    var expected = [pair[0], hearts, '&', hearts, pair[1]];
-    assert.deepEqual(_.toArray(expected.join('')), expected, 'maintains astral characters');
-    assert.deepEqual(_.toArray(''), [], 'empty string into empty array');
-
-    if (typeof document != 'undefined') {
-      // test in IE < 9
-      var actual;
-      try {
-        actual = _.toArray(document.childNodes);
-      } catch (e) { /* ignored */ }
-      assert.deepEqual(actual, _.map(document.childNodes, _.identity), 'works on NodeList');
-    }
-  });
-
-  QUnit.test('size', function(assert) {
-    assert.equal(_.size({one: 1, two: 2, three: 3}), 3, 'can compute the size of an object');
-    assert.equal(_.size([1, 2, 3]), 3, 'can compute the size of an array');
-    assert.equal(_.size({length: 3, 0: 0, 1: 0, 2: 0}), 3, 'can compute the size of Array-likes');
-
-    var func = function() {
-      return _.size(arguments);
-    };
-
-    assert.equal(func(1, 2, 3, 4), 4, 'can test the size of the arguments object');
-
-    assert.equal(_.size('hello'), 5, 'can compute the size of a string literal');
-    assert.equal(_.size(new String('hello')), 5, 'can compute the size of string object');
-
-    assert.equal(_.size(null), 0, 'handles nulls');
-    assert.equal(_.size(0), 0, 'handles numbers');
-  });
-
-  QUnit.test('partition', function(assert) {
-    var list = [0, 1, 2, 3, 4, 5];
-    assert.deepEqual(_.partition(list, function(x) { return x < 4; }), [[0, 1, 2, 3], [4, 5]], 'handles bool return values');
-    assert.deepEqual(_.partition(list, function(x) { return x & 1; }), [[1, 3, 5], [0, 2, 4]], 'handles 0 and 1 return values');
-    assert.deepEqual(_.partition(list, function(x) { return x - 3; }), [[0, 1, 2, 4, 5], [3]], 'handles other numeric return values');
-    assert.deepEqual(_.partition(list, function(x) { return x > 1 ? null : true; }), [[0, 1], [2, 3, 4, 5]], 'handles null return values');
-    assert.deepEqual(_.partition(list, function(x) { if (x < 2) return true; }), [[0, 1], [2, 3, 4, 5]], 'handles undefined return values');
-    assert.deepEqual(_.partition({a: 1, b: 2, c: 3}, function(x) { return x > 1; }), [[2, 3], [1]], 'handles objects');
-
-    assert.deepEqual(_.partition(list, function(x, index) { return index % 2; }), [[1, 3, 5], [0, 2, 4]], 'can reference the array index');
-    assert.deepEqual(_.partition(list, function(x, index, arr) { return x === arr.length - 1; }), [[5], [0, 1, 2, 3, 4]], 'can reference the collection');
-
-    // Default iterator
-    assert.deepEqual(_.partition([1, false, true, '']), [[1, true], [false, '']], 'Default iterator');
-    assert.deepEqual(_.partition([{x: 1}, {x: 0}, {x: 1}], 'x'), [[{x: 1}, {x: 1}], [{x: 0}]], 'Takes a string');
-
-    // Context
-    var predicate = function(x){ return x === this.x; };
-    assert.deepEqual(_.partition([1, 2, 3], predicate, {x: 2}), [[2], [1, 3]], 'partition takes a context argument');
-
-    assert.deepEqual(_.partition([{a: 1}, {b: 2}, {a: 1, b: 2}], {a: 1}), [[{a: 1}, {a: 1, b: 2}], [{b: 2}]], 'predicate can be object');
-
-    var object = {a: 1};
-    _.partition(object, function(val, key, obj) {
-      assert.equal(val, 1);
-      assert.equal(key, 'a');
-      assert.equal(obj, object);
-      assert.equal(this, predicate);
-    }, predicate);
-  });
-
-  if (typeof document != 'undefined') {
-    QUnit.test('Can use various collection methods on NodeLists', function(assert) {
-      var parent = document.createElement('div');
-      parent.innerHTML = '<span id=id1></span>textnode<span id=id2></span>';
-
-      var elementChildren = _.filter(parent.childNodes, _.isElement);
-      assert.equal(elementChildren.length, 2);
-
-      assert.deepEqual(_.map(elementChildren, 'id'), ['id1', 'id2']);
-      assert.deepEqual(_.map(parent.childNodes, 'nodeType'), [1, 3, 1]);
-
-      assert.ok(!_.every(parent.childNodes, _.isElement));
-      assert.ok(_.some(parent.childNodes, _.isElement));
-
-      function compareNode(node) {
-        return _.isElement(node) ? node.id.charAt(2) : void 0;
-      }
-      assert.equal(_.max(parent.childNodes, compareNode), _.last(parent.childNodes));
-      assert.equal(_.min(parent.childNodes, compareNode), _.first(parent.childNodes));
-    });
-  }
-
-}());
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/cross-document.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/cross-document.js
deleted file mode 100644
index cb68a3d..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/cross-document.js
+++ /dev/null
@@ -1,141 +0,0 @@
-(function() {
-  if (typeof document == 'undefined') return;
-
-  var _ = typeof require == 'function' ? require('..') : window._;
-
-  QUnit.module('Cross Document');
-  /* global iObject, iElement, iArguments, iFunction, iArray, iError, iString, iNumber, iBoolean, iDate, iRegExp, iNaN, iNull, iUndefined, ActiveXObject */
-
-  // Setup remote variables for iFrame tests.
-  var iframe = document.createElement('iframe');
-  iframe.frameBorder = iframe.height = iframe.width = 0;
-  document.body.appendChild(iframe);
-  var iDoc = (iDoc = iframe.contentDocument || iframe.contentWindow).document || iDoc;
-  iDoc.write(
-    [
-      '<script>',
-      'parent.iElement = document.createElement("div");',
-      'parent.iArguments = (function(){ return arguments; })(1, 2, 3);',
-      'parent.iArray = [1, 2, 3];',
-      'parent.iString = new String("hello");',
-      'parent.iNumber = new Number(100);',
-      'parent.iFunction = (function(){});',
-      'parent.iDate = new Date();',
-      'parent.iRegExp = /hi/;',
-      'parent.iNaN = NaN;',
-      'parent.iNull = null;',
-      'parent.iBoolean = new Boolean(false);',
-      'parent.iUndefined = undefined;',
-      'parent.iObject = {};',
-      'parent.iError = new Error();',
-      '</script>'
-    ].join('\n')
-  );
-  iDoc.close();
-
-  QUnit.test('isEqual', function(assert) {
-
-    assert.ok(!_.isEqual(iNumber, 101));
-    assert.ok(_.isEqual(iNumber, 100));
-
-    // Objects from another frame.
-    assert.ok(_.isEqual({}, iObject), 'Objects with equivalent members created in different documents are equal');
-
-    // Array from another frame.
-    assert.ok(_.isEqual([1, 2, 3], iArray), 'Arrays with equivalent elements created in different documents are equal');
-  });
-
-  QUnit.test('isEmpty', function(assert) {
-    assert.ok(!_([iNumber]).isEmpty(), '[1] is not empty');
-    assert.ok(!_.isEmpty(iArray), '[] is empty');
-    assert.ok(_.isEmpty(iObject), '{} is empty');
-  });
-
-  QUnit.test('isElement', function(assert) {
-    assert.ok(!_.isElement('div'), 'strings are not dom elements');
-    assert.ok(_.isElement(document.body), 'the body tag is a DOM element');
-    assert.ok(_.isElement(iElement), 'even from another frame');
-  });
-
-  QUnit.test('isArguments', function(assert) {
-    assert.ok(_.isArguments(iArguments), 'even from another frame');
-  });
-
-  QUnit.test('isObject', function(assert) {
-    assert.ok(_.isObject(iElement), 'even from another frame');
-    assert.ok(_.isObject(iFunction), 'even from another frame');
-  });
-
-  QUnit.test('isArray', function(assert) {
-    assert.ok(_.isArray(iArray), 'even from another frame');
-  });
-
-  QUnit.test('isString', function(assert) {
-    assert.ok(_.isString(iString), 'even from another frame');
-  });
-
-  QUnit.test('isNumber', function(assert) {
-    assert.ok(_.isNumber(iNumber), 'even from another frame');
-  });
-
-  QUnit.test('isBoolean', function(assert) {
-    assert.ok(_.isBoolean(iBoolean), 'even from another frame');
-  });
-
-  QUnit.test('isFunction', function(assert) {
-    assert.ok(_.isFunction(iFunction), 'even from another frame');
-  });
-
-  QUnit.test('isDate', function(assert) {
-    assert.ok(_.isDate(iDate), 'even from another frame');
-  });
-
-  QUnit.test('isRegExp', function(assert) {
-    assert.ok(_.isRegExp(iRegExp), 'even from another frame');
-  });
-
-  QUnit.test('isNaN', function(assert) {
-    assert.ok(_.isNaN(iNaN), 'even from another frame');
-  });
-
-  QUnit.test('isNull', function(assert) {
-    assert.ok(_.isNull(iNull), 'even from another frame');
-  });
-
-  QUnit.test('isUndefined', function(assert) {
-    assert.ok(_.isUndefined(iUndefined), 'even from another frame');
-  });
-
-  QUnit.test('isError', function(assert) {
-    assert.ok(_.isError(iError), 'even from another frame');
-  });
-
-  if (typeof ActiveXObject != 'undefined') {
-    QUnit.test('IE host objects', function(assert) {
-      var xml = new ActiveXObject('Msxml2.DOMDocument.3.0');
-      assert.ok(!_.isNumber(xml));
-      assert.ok(!_.isBoolean(xml));
-      assert.ok(!_.isNaN(xml));
-      assert.ok(!_.isFunction(xml));
-      assert.ok(!_.isNull(xml));
-      assert.ok(!_.isUndefined(xml));
-    });
-
-    QUnit.test('#1621 IE 11 compat mode DOM elements are not functions', function(assert) {
-      var fn = function() {};
-      var xml = new ActiveXObject('Msxml2.DOMDocument.3.0');
-      var div = document.createElement('div');
-
-      // JIT the function
-      var count = 200;
-      while (count--) {
-        _.isFunction(fn);
-      }
-
-      assert.equal(_.isFunction(xml), false);
-      assert.equal(_.isFunction(div), false);
-      assert.equal(_.isFunction(fn), true);
-    });
-  }
-
-}());
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/functions.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/functions.js
deleted file mode 100644
index f696bd6..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/functions.js
+++ /dev/null
@@ -1,728 +0,0 @@
-(function() {
-  var _ = typeof require == 'function' ? require('..') : window._;
-
-  QUnit.module('Functions');
-  QUnit.config.asyncRetries = 3;
-
-  QUnit.test('bind', function(assert) {
-    var context = {name: 'moe'};
-    var func = function(arg) { return 'name: ' + (this.name || arg); };
-    var bound = _.bind(func, context);
-    assert.equal(bound(), 'name: moe', 'can bind a function to a context');
-
-    bound = _(func).bind(context);
-    assert.equal(bound(), 'name: moe', 'can do OO-style binding');
-
-    bound = _.bind(func, null, 'curly');
-    var result = bound();
-    // Work around a PhantomJS bug when applying a function with null|undefined.
-    assert.ok(result === 'name: curly' || result === 'name: ' + window.name, 'can bind without specifying a context');
-
-    func = function(salutation, name) { return salutation + ': ' + name; };
-    func = _.bind(func, this, 'hello');
-    assert.equal(func('moe'), 'hello: moe', 'the function was partially applied in advance');
-
-    func = _.bind(func, this, 'curly');
-    assert.equal(func(), 'hello: curly', 'the function was completely applied in advance');
-
-    func = function(salutation, firstname, lastname) { return salutation + ': ' + firstname + ' ' + lastname; };
-    func = _.bind(func, this, 'hello', 'moe', 'curly');
-    assert.equal(func(), 'hello: moe curly', 'the function was partially applied in advance and can accept multiple arguments');
-
-    func = function(ctx, message) { assert.equal(this, ctx, message); };
-    _.bind(func, 0, 0, 'can bind a function to `0`')();
-    _.bind(func, '', '', 'can bind a function to an empty string')();
-    _.bind(func, false, false, 'can bind a function to `false`')();
-
-    // These tests are only meaningful when using a browser without a native bind function
-    // To test this with a modern browser, set underscore's nativeBind to undefined
-    var F = function() { return this; };
-    var boundf = _.bind(F, {hello: 'moe curly'});
-    var Boundf = boundf; // make eslint happy.
-    var newBoundf = new Boundf();
-    assert.equal(newBoundf.hello, void 0, 'function should not be bound to the context, to comply with ECMAScript 5');
-    assert.equal(boundf().hello, 'moe curly', "When called without the new operator, it's OK to be bound to the context");
-    assert.ok(newBoundf instanceof F, 'a bound instance is an instance of the original function');
-
-    assert.raises(function() { _.bind('notafunction'); }, TypeError, 'throws an error when binding to a non-function');
-  });
-
-  QUnit.test('partial', function(assert) {
-    var obj = {name: 'moe'};
-    var func = function() { return this.name + ' ' + _.toArray(arguments).join(' '); };
-
-    obj.func = _.partial(func, 'a', 'b');
-    assert.equal(obj.func('c', 'd'), 'moe a b c d', 'can partially apply');
-
-    obj.func = _.partial(func, _, 'b', _, 'd');
-    assert.equal(obj.func('a', 'c'), 'moe a b c d', 'can partially apply with placeholders');
-
-    func = _.partial(function() { return arguments.length; }, _, 'b', _, 'd');
-    assert.equal(func('a', 'c', 'e'), 5, 'accepts more arguments than the number of placeholders');
-    assert.equal(func('a'), 4, 'accepts fewer arguments than the number of placeholders');
-
-    func = _.partial(function() { return typeof arguments[2]; }, _, 'b', _, 'd');
-    assert.equal(func('a'), 'undefined', 'unfilled placeholders are undefined');
-
-    // passes context
-    function MyWidget(name, options) {
-      this.name = name;
-      this.options = options;
-    }
-    MyWidget.prototype.get = function() {
-      return this.name;
-    };
-    var MyWidgetWithCoolOpts = _.partial(MyWidget, _, {a: 1});
-    var widget = new MyWidgetWithCoolOpts('foo');
-    assert.ok(widget instanceof MyWidget, 'Can partially bind a constructor');
-    assert.equal(widget.get(), 'foo', 'keeps prototype');
-    assert.deepEqual(widget.options, {a: 1});
-
-    _.partial.placeholder = obj;
-    func = _.partial(function() { return arguments.length; }, obj, 'b', obj, 'd');
-    assert.equal(func('a'), 4, 'allows the placeholder to be swapped out');
-
-    _.partial.placeholder = {};
-    func = _.partial(function() { return arguments.length; }, obj, 'b', obj, 'd');
-    assert.equal(func('a'), 5, 'swapping the placeholder preserves previously bound arguments');
-
-    _.partial.placeholder = _;
-  });
-
-  QUnit.test('bindAll', function(assert) {
-    var curly = {name: 'curly'};
-    var moe = {
-      name: 'moe',
-      getName: function() { return 'name: ' + this.name; },
-      sayHi: function() { return 'hi: ' + this.name; }
-    };
-    curly.getName = moe.getName;
-    _.bindAll(moe, 'getName', 'sayHi');
-    curly.sayHi = moe.sayHi;
-    assert.equal(curly.getName(), 'name: curly', 'unbound function is bound to current object');
-    assert.equal(curly.sayHi(), 'hi: moe', 'bound function is still bound to original object');
-
-    curly = {name: 'curly'};
-    moe = {
-      name: 'moe',
-      getName: function() { return 'name: ' + this.name; },
-      sayHi: function() { return 'hi: ' + this.name; },
-      sayLast: function() { return this.sayHi(_.last(arguments)); }
-    };
-
-    assert.raises(function() { _.bindAll(moe); }, Error, 'throws an error for bindAll with no functions named');
-    assert.raises(function() { _.bindAll(moe, 'sayBye'); }, TypeError, 'throws an error for bindAll if the given key is undefined');
-    assert.raises(function() { _.bindAll(moe, 'name'); }, TypeError, 'throws an error for bindAll if the given key is not a function');
-
-    _.bindAll(moe, 'sayHi', 'sayLast');
-    curly.sayHi = moe.sayHi;
-    assert.equal(curly.sayHi(), 'hi: moe');
-
-    var sayLast = moe.sayLast;
-    assert.equal(sayLast(1, 2, 3, 4, 5, 6, 7, 'Tom'), 'hi: moe', 'createCallback works with any number of arguments');
-
-    _.bindAll(moe, ['getName']);
-    var getName = moe.getName;
-    assert.equal(getName(), 'name: moe', 'flattens arguments into a single list');
-  });
-
-  QUnit.test('memoize', function(assert) {
-    var fib = function(n) {
-      return n < 2 ? n : fib(n - 1) + fib(n - 2);
-    };
-    assert.equal(fib(10), 55, 'a memoized version of fibonacci produces identical results');
-    fib = _.memoize(fib); // Redefine `fib` for memoization
-    assert.equal(fib(10), 55, 'a memoized version of fibonacci produces identical results');
-
-    var o = function(str) {
-      return str;
-    };
-    var fastO = _.memoize(o);
-    assert.equal(o('toString'), 'toString', 'checks hasOwnProperty');
-    assert.equal(fastO('toString'), 'toString', 'checks hasOwnProperty');
-
-    // Expose the cache.
-    var upper = _.memoize(function(s) {
-      return s.toUpperCase();
-    });
-    assert.equal(upper('foo'), 'FOO');
-    assert.equal(upper('bar'), 'BAR');
-    assert.deepEqual(upper.cache, {foo: 'FOO', bar: 'BAR'});
-    upper.cache = {foo: 'BAR', bar: 'FOO'};
-    assert.equal(upper('foo'), 'BAR');
-    assert.equal(upper('bar'), 'FOO');
-
-    var hashed = _.memoize(function(key) {
-      //https://github.com/jashkenas/underscore/pull/1679#discussion_r13736209
-      assert.ok(/[a-z]+/.test(key), 'hasher doesn\'t change keys');
-      return key;
-    }, function(key) {
-      return key.toUpperCase();
-    });
-    hashed('yep');
-    assert.deepEqual(hashed.cache, {YEP: 'yep'}, 'takes a hasher');
-
-    // Test that the hash function can be used to swizzle the key.
-    var objCacher = _.memoize(function(value, key) {
-      return {key: key, value: value};
-    }, function(value, key) {
-      return key;
-    });
-    var myObj = objCacher('a', 'alpha');
-    var myObjAlias = objCacher('b', 'alpha');
-    assert.notStrictEqual(myObj, void 0, 'object is created if second argument used as key');
-    assert.strictEqual(myObj, myObjAlias, 'object is cached if second argument used as key');
-    assert.strictEqual(myObj.value, 'a', 'object is not modified if second argument used as key');
-  });
-
-  QUnit.test('delay', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var delayed = false;
-    _.delay(function(){ delayed = true; }, 100);
-    setTimeout(function(){ assert.ok(!delayed, "didn't delay the function quite yet"); }, 50);
-    setTimeout(function(){ assert.ok(delayed, 'delayed the function'); done(); }, 150);
-  });
-
-  QUnit.test('defer', function(assert) {
-    assert.expect(1);
-    var done = assert.async();
-    var deferred = false;
-    _.defer(function(bool){ deferred = bool; }, true);
-    _.delay(function(){ assert.ok(deferred, 'deferred the function'); done(); }, 50);
-  });
-
-  QUnit.test('throttle', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var throttledIncr = _.throttle(incr, 32);
-    throttledIncr(); throttledIncr();
-
-    assert.equal(counter, 1, 'incr was called immediately');
-    _.delay(function(){ assert.equal(counter, 2, 'incr was throttled'); done(); }, 64);
-  });
-
-  QUnit.test('throttle arguments', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var value = 0;
-    var update = function(val){ value = val; };
-    var throttledUpdate = _.throttle(update, 32);
-    throttledUpdate(1); throttledUpdate(2);
-    _.delay(function(){ throttledUpdate(3); }, 64);
-    assert.equal(value, 1, 'updated to latest value');
-    _.delay(function(){ assert.equal(value, 3, 'updated to latest value'); done(); }, 96);
-  });
-
-  QUnit.test('throttle once', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ return ++counter; };
-    var throttledIncr = _.throttle(incr, 32);
-    var result = throttledIncr();
-    _.delay(function(){
-      assert.equal(result, 1, 'throttled functions return their value');
-      assert.equal(counter, 1, 'incr was called once'); done();
-    }, 64);
-  });
-
-  QUnit.test('throttle twice', function(assert) {
-    assert.expect(1);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var throttledIncr = _.throttle(incr, 32);
-    throttledIncr(); throttledIncr();
-    _.delay(function(){ assert.equal(counter, 2, 'incr was called twice'); done(); }, 64);
-  });
-
-  QUnit.test('more throttling', function(assert) {
-    assert.expect(3);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var throttledIncr = _.throttle(incr, 30);
-    throttledIncr(); throttledIncr();
-    assert.equal(counter, 1);
-    _.delay(function(){
-      assert.equal(counter, 2);
-      throttledIncr();
-      assert.equal(counter, 3);
-      done();
-    }, 85);
-  });
-
-  QUnit.test('throttle repeatedly with results', function(assert) {
-    assert.expect(6);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ return ++counter; };
-    var throttledIncr = _.throttle(incr, 100);
-    var results = [];
-    var saveResult = function() { results.push(throttledIncr()); };
-    saveResult(); saveResult();
-    _.delay(saveResult, 50);
-    _.delay(saveResult, 150);
-    _.delay(saveResult, 160);
-    _.delay(saveResult, 230);
-    _.delay(function() {
-      assert.equal(results[0], 1, 'incr was called once');
-      assert.equal(results[1], 1, 'incr was throttled');
-      assert.equal(results[2], 1, 'incr was throttled');
-      assert.equal(results[3], 2, 'incr was called twice');
-      assert.equal(results[4], 2, 'incr was throttled');
-      assert.equal(results[5], 3, 'incr was called trailing');
-      done();
-    }, 300);
-  });
-
-  QUnit.test('throttle triggers trailing call when invoked repeatedly', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var counter = 0;
-    var limit = 48;
-    var incr = function(){ counter++; };
-    var throttledIncr = _.throttle(incr, 32);
-
-    var stamp = new Date;
-    while (new Date - stamp < limit) {
-      throttledIncr();
-    }
-    var lastCount = counter;
-    assert.ok(counter > 1);
-
-    _.delay(function() {
-      assert.ok(counter > lastCount);
-      done();
-    }, 96);
-  });
-
-  QUnit.test('throttle does not trigger leading call when leading is set to false', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var throttledIncr = _.throttle(incr, 60, {leading: false});
-
-    throttledIncr(); throttledIncr();
-    assert.equal(counter, 0);
-
-    _.delay(function() {
-      assert.equal(counter, 1);
-      done();
-    }, 96);
-  });
-
-  QUnit.test('more throttle does not trigger leading call when leading is set to false', function(assert) {
-    assert.expect(3);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var throttledIncr = _.throttle(incr, 100, {leading: false});
-
-    throttledIncr();
-    _.delay(throttledIncr, 50);
-    _.delay(throttledIncr, 60);
-    _.delay(throttledIncr, 200);
-    assert.equal(counter, 0);
-
-    _.delay(function() {
-      assert.equal(counter, 1);
-    }, 250);
-
-    _.delay(function() {
-      assert.equal(counter, 2);
-      done();
-    }, 350);
-  });
-
-  QUnit.test('one more throttle with leading: false test', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var throttledIncr = _.throttle(incr, 100, {leading: false});
-
-    var time = new Date;
-    while (new Date - time < 350) throttledIncr();
-    assert.ok(counter <= 3);
-
-    _.delay(function() {
-      assert.ok(counter <= 4);
-      done();
-    }, 200);
-  });
-
-  QUnit.test('throttle does not trigger trailing call when trailing is set to false', function(assert) {
-    assert.expect(4);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var throttledIncr = _.throttle(incr, 60, {trailing: false});
-
-    throttledIncr(); throttledIncr(); throttledIncr();
-    assert.equal(counter, 1);
-
-    _.delay(function() {
-      assert.equal(counter, 1);
-
-      throttledIncr(); throttledIncr();
-      assert.equal(counter, 2);
-
-      _.delay(function() {
-        assert.equal(counter, 2);
-        done();
-      }, 96);
-    }, 96);
-  });
-
-  QUnit.test('throttle continues to function after system time is set backwards', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var throttledIncr = _.throttle(incr, 100);
-    var origNowFunc = _.now;
-
-    throttledIncr();
-    assert.equal(counter, 1);
-    _.now = function() {
-      return new Date(2013, 0, 1, 1, 1, 1);
-    };
-
-    _.delay(function() {
-      throttledIncr();
-      assert.equal(counter, 2);
-      done();
-      _.now = origNowFunc;
-    }, 200);
-  });
-
-  QUnit.test('throttle re-entrant', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var sequence = [
-      ['b1', 'b2'],
-      ['c1', 'c2']
-    ];
-    var value = '';
-    var throttledAppend;
-    var append = function(arg){
-      value += this + arg;
-      var args = sequence.pop();
-      if (args) {
-        throttledAppend.call(args[0], args[1]);
-      }
-    };
-    throttledAppend = _.throttle(append, 32);
-    throttledAppend.call('a1', 'a2');
-    assert.equal(value, 'a1a2');
-    _.delay(function(){
-      assert.equal(value, 'a1a2c1c2b1b2', 'append was throttled successfully');
-      done();
-    }, 100);
-  });
-
-  QUnit.test('throttle cancel', function(assert) {
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var throttledIncr = _.throttle(incr, 32);
-    throttledIncr();
-    throttledIncr.cancel();
-    throttledIncr();
-    throttledIncr();
-
-    assert.equal(counter, 2, 'incr was called immediately');
-    _.delay(function(){ assert.equal(counter, 3, 'incr was throttled'); done(); }, 64);
-  });
-
-  QUnit.test('throttle cancel with leading: false', function(assert) {
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var throttledIncr = _.throttle(incr, 32, {leading: false});
-    throttledIncr();
-    throttledIncr.cancel();
-
-    assert.equal(counter, 0, 'incr was throttled');
-    _.delay(function(){ assert.equal(counter, 0, 'incr was throttled'); done(); }, 64);
-  });
-
-  QUnit.test('debounce', function(assert) {
-    assert.expect(1);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var debouncedIncr = _.debounce(incr, 32);
-    debouncedIncr(); debouncedIncr();
-    _.delay(debouncedIncr, 16);
-    _.delay(function(){ assert.equal(counter, 1, 'incr was debounced'); done(); }, 96);
-  });
-
-  QUnit.test('debounce cancel', function(assert) {
-    assert.expect(1);
-    var done = assert.async();
-    var counter = 0;
-    var incr = function(){ counter++; };
-    var debouncedIncr = _.debounce(incr, 32);
-    debouncedIncr();
-    debouncedIncr.cancel();
-    _.delay(function(){ assert.equal(counter, 0, 'incr was not called'); done(); }, 96);
-  });
-
-  QUnit.test('debounce asap', function(assert) {
-    assert.expect(6);
-    var done = assert.async();
-    var a, b, c;
-    var counter = 0;
-    var incr = function(){ return ++counter; };
-    var debouncedIncr = _.debounce(incr, 64, true);
-    a = debouncedIncr();
-    b = debouncedIncr();
-    assert.equal(a, 1);
-    assert.equal(b, 1);
-    assert.equal(counter, 1, 'incr was called immediately');
-    _.delay(debouncedIncr, 16);
-    _.delay(debouncedIncr, 32);
-    _.delay(debouncedIncr, 48);
-    _.delay(function(){
-      assert.equal(counter, 1, 'incr was debounced');
-      c = debouncedIncr();
-      assert.equal(c, 2);
-      assert.equal(counter, 2, 'incr was called again');
-      done();
-    }, 128);
-  });
-
-  QUnit.test('debounce asap cancel', function(assert) {
-    assert.expect(4);
-    var done = assert.async();
-    var a, b;
-    var counter = 0;
-    var incr = function(){ return ++counter; };
-    var debouncedIncr = _.debounce(incr, 64, true);
-    a = debouncedIncr();
-    debouncedIncr.cancel();
-    b = debouncedIncr();
-    assert.equal(a, 1);
-    assert.equal(b, 2);
-    assert.equal(counter, 2, 'incr was called immediately');
-    _.delay(debouncedIncr, 16);
-    _.delay(debouncedIncr, 32);
-    _.delay(debouncedIncr, 48);
-    _.delay(function(){ assert.equal(counter, 2, 'incr was debounced'); done(); }, 128);
-  });
-
-  QUnit.test('debounce asap recursively', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var counter = 0;
-    var debouncedIncr = _.debounce(function(){
-      counter++;
-      if (counter < 10) debouncedIncr();
-    }, 32, true);
-    debouncedIncr();
-    assert.equal(counter, 1, 'incr was called immediately');
-    _.delay(function(){ assert.equal(counter, 1, 'incr was debounced'); done(); }, 96);
-  });
-
-  QUnit.test('debounce after system time is set backwards', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var counter = 0;
-    var origNowFunc = _.now;
-    var debouncedIncr = _.debounce(function(){
-      counter++;
-    }, 100, true);
-
-    debouncedIncr();
-    assert.equal(counter, 1, 'incr was called immediately');
-
-    _.now = function() {
-      return new Date(2013, 0, 1, 1, 1, 1);
-    };
-
-    _.delay(function() {
-      debouncedIncr();
-      assert.equal(counter, 2, 'incr was debounced successfully');
-      done();
-      _.now = origNowFunc;
-    }, 200);
-  });
-
-  QUnit.test('debounce re-entrant', function(assert) {
-    assert.expect(2);
-    var done = assert.async();
-    var sequence = [
-      ['b1', 'b2']
-    ];
-    var value = '';
-    var debouncedAppend;
-    var append = function(arg){
-      value += this + arg;
-      var args = sequence.pop();
-      if (args) {
-        debouncedAppend.call(args[0], args[1]);
-      }
-    };
-    debouncedAppend = _.debounce(append, 32);
-    debouncedAppend.call('a1', 'a2');
-    assert.equal(value, '');
-    _.delay(function(){
-      assert.equal(value, 'a1a2b1b2', 'append was debounced successfully');
-      done();
-    }, 100);
-  });
-
-  QUnit.test('once', function(assert) {
-    var num = 0;
-    var increment = _.once(function(){ return ++num; });
-    increment();
-    increment();
-    assert.equal(num, 1);
-
-    assert.equal(increment(), 1, 'stores a memo to the last value');
-  });
-
-  QUnit.test('Recursive onced function.', function(assert) {
-    assert.expect(1);
-    var f = _.once(function(){
-      assert.ok(true);
-      f();
-    });
-    f();
-  });
-
-  QUnit.test('wrap', function(assert) {
-    var greet = function(name){ return 'hi: ' + name; };
-    var backwards = _.wrap(greet, function(func, name){ return func(name) + ' ' + name.split('').reverse().join(''); });
-    assert.equal(backwards('moe'), 'hi: moe eom', 'wrapped the salutation function');
-
-    var inner = function(){ return 'Hello '; };
-    var obj = {name: 'Moe'};
-    obj.hi = _.wrap(inner, function(fn){ return fn() + this.name; });
-    assert.equal(obj.hi(), 'Hello Moe');
-
-    var noop = function(){};
-    var wrapped = _.wrap(noop, function(){ return Array.prototype.slice.call(arguments, 0); });
-    var ret = wrapped(['whats', 'your'], 'vector', 'victor');
-    assert.deepEqual(ret, [noop, ['whats', 'your'], 'vector', 'victor']);
-  });
-
-  QUnit.test('negate', function(assert) {
-    var isOdd = function(n){ return n & 1; };
-    assert.equal(_.negate(isOdd)(2), true, 'should return the complement of the given function');
-    assert.equal(_.negate(isOdd)(3), false, 'should return the complement of the given function');
-  });
-
-  QUnit.test('compose', function(assert) {
-    var greet = function(name){ return 'hi: ' + name; };
-    var exclaim = function(sentence){ return sentence + '!'; };
-    var composed = _.compose(exclaim, greet);
-    assert.equal(composed('moe'), 'hi: moe!', 'can compose a function that takes another');
-
-    composed = _.compose(greet, exclaim);
-    assert.equal(composed('moe'), 'hi: moe!', 'in this case, the functions are also commutative');
-
-    // f(g(h(x, y, z)))
-    function h(x, y, z) {
-      assert.equal(arguments.length, 3, 'First function called with multiple args');
-      return z * y;
-    }
-    function g(x) {
-      assert.equal(arguments.length, 1, 'Composed function is called with 1 argument');
-      return x;
-    }
-    function f(x) {
-      assert.equal(arguments.length, 1, 'Composed function is called with 1 argument');
-      return x * 2;
-    }
-    composed = _.compose(f, g, h);
-    assert.equal(composed(1, 2, 3), 12);
-  });
-
-  QUnit.test('after', function(assert) {
-    var testAfter = function(afterAmount, timesCalled) {
-      var afterCalled = 0;
-      var after = _.after(afterAmount, function() {
-        afterCalled++;
-      });
-      while (timesCalled--) after();
-      return afterCalled;
-    };
-
-    assert.equal(testAfter(5, 5), 1, 'after(N) should fire after being called N times');
-    assert.equal(testAfter(5, 4), 0, 'after(N) should not fire unless called N times');
-    assert.equal(testAfter(0, 0), 0, 'after(0) should not fire immediately');
-    assert.equal(testAfter(0, 1), 1, 'after(0) should fire when first invoked');
-  });
-
-  QUnit.test('before', function(assert) {
-    var testBefore = function(beforeAmount, timesCalled) {
-      var beforeCalled = 0;
-      var before = _.before(beforeAmount, function() { beforeCalled++; });
-      while (timesCalled--) before();
-      return beforeCalled;
-    };
-
-    assert.equal(testBefore(5, 5), 4, 'before(N) should not fire after being called N times');
-    assert.equal(testBefore(5, 4), 4, 'before(N) should fire before being called N times');
-    assert.equal(testBefore(0, 0), 0, 'before(0) should not fire immediately');
-    assert.equal(testBefore(0, 1), 0, 'before(0) should not fire when first invoked');
-
-    var context = {num: 0};
-    var increment = _.before(3, function(){ return ++this.num; });
-    _.times(10, increment, context);
-    assert.equal(increment(), 2, 'stores a memo to the last value');
-    assert.equal(context.num, 2, 'provides context');
-  });
-
-  QUnit.test('iteratee', function(assert) {
-    var identity = _.iteratee();
-    assert.equal(identity, _.identity, '_.iteratee is exposed as an external function.');
-
-    function fn() {
-      return arguments;
-    }
-    _.each([_.iteratee(fn), _.iteratee(fn, {})], function(cb) {
-      assert.equal(cb().length, 0);
-      assert.deepEqual(_.toArray(cb(1, 2, 3)), _.range(1, 4));
-      assert.deepEqual(_.toArray(cb(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), _.range(1, 11));
-    });
-
-  });
-
-  QUnit.test('restArgs', function(assert) {
-    assert.expect(10);
-    _.restArgs(function(a, args) {
-      assert.strictEqual(a, 1);
-      assert.deepEqual(args, [2, 3], 'collects rest arguments into an array');
-    })(1, 2, 3);
-
-    _.restArgs(function(a, args) {
-      assert.strictEqual(a, void 0);
-      assert.deepEqual(args, [], 'passes empty array if there are not enough arguments');
-    })();
-
-    _.restArgs(function(a, b, c, args) {
-      assert.strictEqual(arguments.length, 4);
-      assert.deepEqual(args, [4, 5], 'works on functions with many named parameters');
-    })(1, 2, 3, 4, 5);
-
-    var obj = {};
-    _.restArgs(function() {
-      assert.strictEqual(this, obj, 'invokes function with this context');
-    }).call(obj);
-
-    _.restArgs(function(array, iteratee, context) {
-      assert.deepEqual(array, [1, 2, 3, 4], 'startIndex can be used manually specify index of rest parameter');
-      assert.strictEqual(iteratee, void 0);
-      assert.strictEqual(context, void 0);
-    }, 0)(1, 2, 3, 4);
-  });
-
-}());
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/objects.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/objects.js
deleted file mode 100644
index fa1d9e3..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/objects.js
+++ /dev/null
@@ -1,1102 +0,0 @@
-(function() {
-  var _ = typeof require == 'function' ? require('..') : window._;
-
-  QUnit.module('Objects');
-
-  var testElement = typeof document === 'object' ? document.createElement('div') : void 0;
-
-  QUnit.test('keys', function(assert) {
-    assert.deepEqual(_.keys({one: 1, two: 2}), ['one', 'two'], 'can extract the keys from an object');
-    // the test above is not safe because it relies on for-in enumeration order
-    var a = []; a[1] = 0;
-    assert.deepEqual(_.keys(a), ['1'], 'is not fooled by sparse arrays; see issue #95');
-    assert.deepEqual(_.keys(null), []);
-    assert.deepEqual(_.keys(void 0), []);
-    assert.deepEqual(_.keys(1), []);
-    assert.deepEqual(_.keys('a'), []);
-    assert.deepEqual(_.keys(true), []);
-
-    // keys that may be missed if the implementation isn't careful
-    var trouble = {
-      constructor: Object,
-      valueOf: _.noop,
-      hasOwnProperty: null,
-      toString: 5,
-      toLocaleString: void 0,
-      propertyIsEnumerable: /a/,
-      isPrototypeOf: this,
-      __defineGetter__: Boolean,
-      __defineSetter__: {},
-      __lookupSetter__: false,
-      __lookupGetter__: []
-    };
-    var troubleKeys = ['constructor', 'valueOf', 'hasOwnProperty', 'toString', 'toLocaleString', 'propertyIsEnumerable',
-                  'isPrototypeOf', '__defineGetter__', '__defineSetter__', '__lookupSetter__', '__lookupGetter__'].sort();
-    assert.deepEqual(_.keys(trouble).sort(), troubleKeys, 'matches non-enumerable properties');
-  });
-
-  QUnit.test('allKeys', function(assert) {
-    assert.deepEqual(_.allKeys({one: 1, two: 2}), ['one', 'two'], 'can extract the allKeys from an object');
-    // the test above is not safe because it relies on for-in enumeration order
-    var a = []; a[1] = 0;
-    assert.deepEqual(_.allKeys(a), ['1'], 'is not fooled by sparse arrays; see issue #95');
-
-    a.a = a;
-    assert.deepEqual(_.allKeys(a), ['1', 'a'], 'is not fooled by sparse arrays with additional properties');
-
-    _.each([null, void 0, 1, 'a', true, NaN, {}, [], new Number(5), new Date(0)], function(val) {
-      assert.deepEqual(_.allKeys(val), []);
-    });
-
-    // allKeys that may be missed if the implementation isn't careful
-    var trouble = {
-      constructor: Object,
-      valueOf: _.noop,
-      hasOwnProperty: null,
-      toString: 5,
-      toLocaleString: void 0,
-      propertyIsEnumerable: /a/,
-      isPrototypeOf: this
-    };
-    var troubleKeys = ['constructor', 'valueOf', 'hasOwnProperty', 'toString', 'toLocaleString', 'propertyIsEnumerable',
-                  'isPrototypeOf'].sort();
-    assert.deepEqual(_.allKeys(trouble).sort(), troubleKeys, 'matches non-enumerable properties');
-
-    function A() {}
-    A.prototype.foo = 'foo';
-    var b = new A();
-    b.bar = 'bar';
-    assert.deepEqual(_.allKeys(b).sort(), ['bar', 'foo'], 'should include inherited keys');
-
-    function y() {}
-    y.x = 'z';
-    assert.deepEqual(_.allKeys(y), ['x'], 'should get keys from constructor');
-  });
-
-  QUnit.test('values', function(assert) {
-    assert.deepEqual(_.values({one: 1, two: 2}), [1, 2], 'can extract the values from an object');
-    assert.deepEqual(_.values({one: 1, two: 2, length: 3}), [1, 2, 3], '... even when one of them is "length"');
-  });
-
-  QUnit.test('pairs', function(assert) {
-    assert.deepEqual(_.pairs({one: 1, two: 2}), [['one', 1], ['two', 2]], 'can convert an object into pairs');
-    assert.deepEqual(_.pairs({one: 1, two: 2, length: 3}), [['one', 1], ['two', 2], ['length', 3]], '... even when one of them is "length"');
-  });
-
-  QUnit.test('invert', function(assert) {
-    var obj = {first: 'Moe', second: 'Larry', third: 'Curly'};
-    assert.deepEqual(_.keys(_.invert(obj)), ['Moe', 'Larry', 'Curly'], 'can invert an object');
-    assert.deepEqual(_.invert(_.invert(obj)), obj, 'two inverts gets you back where you started');
-
-    obj = {length: 3};
-    assert.equal(_.invert(obj)['3'], 'length', 'can invert an object with "length"');
-  });
-
-  QUnit.test('functions', function(assert) {
-    var obj = {a: 'dash', b: _.map, c: /yo/, d: _.reduce};
-    assert.deepEqual(['b', 'd'], _.functions(obj), 'can grab the function names of any passed-in object');
-
-    var Animal = function(){};
-    Animal.prototype.run = function(){};
-    assert.deepEqual(_.functions(new Animal), ['run'], 'also looks up functions on the prototype');
-  });
-
-  QUnit.test('methods', function(assert) {
-    assert.strictEqual(_.methods, _.functions, 'is an alias for functions');
-  });
-
-  QUnit.test('extend', function(assert) {
-    var result;
-    assert.equal(_.extend({}, {a: 'b'}).a, 'b', 'can extend an object with the attributes of another');
-    assert.equal(_.extend({a: 'x'}, {a: 'b'}).a, 'b', 'properties in source override destination');
-    assert.equal(_.extend({x: 'x'}, {a: 'b'}).x, 'x', "properties not in source don't get overriden");
-    result = _.extend({x: 'x'}, {a: 'a'}, {b: 'b'});
-    assert.deepEqual(result, {x: 'x', a: 'a', b: 'b'}, 'can extend from multiple source objects');
-    result = _.extend({x: 'x'}, {a: 'a', x: 2}, {a: 'b'});
-    assert.deepEqual(result, {x: 2, a: 'b'}, 'extending from multiple source objects last property trumps');
-    result = _.extend({}, {a: void 0, b: null});
-    assert.deepEqual(_.keys(result), ['a', 'b'], 'extend copies undefined values');
-
-    var F = function() {};
-    F.prototype = {a: 'b'};
-    var subObj = new F();
-    subObj.c = 'd';
-    assert.deepEqual(_.extend({}, subObj), {a: 'b', c: 'd'}, 'extend copies all properties from source');
-    _.extend(subObj, {});
-    assert.ok(!subObj.hasOwnProperty('a'), "extend does not convert destination object's 'in' properties to 'own' properties");
-
-    try {
-      result = {};
-      _.extend(result, null, void 0, {a: 1});
-    } catch (e) { /* ignored */ }
-
-    assert.equal(result.a, 1, 'should not error on `null` or `undefined` sources');
-
-    assert.strictEqual(_.extend(null, {a: 1}), null, 'extending null results in null');
-    assert.strictEqual(_.extend(void 0, {a: 1}), void 0, 'extending undefined results in undefined');
-  });
-
-  QUnit.test('extendOwn', function(assert) {
-    var result;
-    assert.equal(_.extendOwn({}, {a: 'b'}).a, 'b', 'can extend an object with the attributes of another');
-    assert.equal(_.extendOwn({a: 'x'}, {a: 'b'}).a, 'b', 'properties in source override destination');
-    assert.equal(_.extendOwn({x: 'x'}, {a: 'b'}).x, 'x', "properties not in source don't get overriden");
-    result = _.extendOwn({x: 'x'}, {a: 'a'}, {b: 'b'});
-    assert.deepEqual(result, {x: 'x', a: 'a', b: 'b'}, 'can extend from multiple source objects');
-    result = _.extendOwn({x: 'x'}, {a: 'a', x: 2}, {a: 'b'});
-    assert.deepEqual(result, {x: 2, a: 'b'}, 'extending from multiple source objects last property trumps');
-    assert.deepEqual(_.extendOwn({}, {a: void 0, b: null}), {a: void 0, b: null}, 'copies undefined values');
-
-    var F = function() {};
-    F.prototype = {a: 'b'};
-    var subObj = new F();
-    subObj.c = 'd';
-    assert.deepEqual(_.extendOwn({}, subObj), {c: 'd'}, 'copies own properties from source');
-
-    result = {};
-    assert.deepEqual(_.extendOwn(result, null, void 0, {a: 1}), {a: 1}, 'should not error on `null` or `undefined` sources');
-
-    _.each(['a', 5, null, false], function(val) {
-      assert.strictEqual(_.extendOwn(val, {a: 1}), val, 'extending non-objects results in returning the non-object value');
-    });
-
-    assert.strictEqual(_.extendOwn(void 0, {a: 1}), void 0, 'extending undefined results in undefined');
-
-    result = _.extendOwn({a: 1, 0: 2, 1: '5', length: 6}, {0: 1, 1: 2, length: 2});
-    assert.deepEqual(result, {a: 1, 0: 1, 1: 2, length: 2}, 'should treat array-like objects like normal objects');
-  });
-
-  QUnit.test('assign', function(assert) {
-    assert.strictEqual(_.assign, _.extendOwn, 'is an alias for extendOwn');
-  });
-
-  QUnit.test('pick', function(assert) {
-    var result;
-    result = _.pick({a: 1, b: 2, c: 3}, 'a', 'c');
-    assert.deepEqual(result, {a: 1, c: 3}, 'can restrict properties to those named');
-    result = _.pick({a: 1, b: 2, c: 3}, ['b', 'c']);
-    assert.deepEqual(result, {b: 2, c: 3}, 'can restrict properties to those named in an array');
-    result = _.pick({a: 1, b: 2, c: 3}, ['a'], 'b');
-    assert.deepEqual(result, {a: 1, b: 2}, 'can restrict properties to those named in mixed args');
-    result = _.pick(['a', 'b'], 1);
-    assert.deepEqual(result, {1: 'b'}, 'can pick numeric properties');
-
-    _.each([null, void 0], function(val) {
-      assert.deepEqual(_.pick(val, 'hasOwnProperty'), {}, 'Called with null/undefined');
-      assert.deepEqual(_.pick(val, _.constant(true)), {});
-    });
-    assert.deepEqual(_.pick(5, 'toString', 'b'), {toString: Number.prototype.toString}, 'can iterate primitives');
-
-    var data = {a: 1, b: 2, c: 3};
-    var callback = function(value, key, object) {
-      assert.strictEqual(key, {1: 'a', 2: 'b', 3: 'c'}[value]);
-      assert.strictEqual(object, data);
-      return value !== this.value;
-    };
-    result = _.pick(data, callback, {value: 2});
-    assert.deepEqual(result, {a: 1, c: 3}, 'can accept a predicate and context');
-
-    var Obj = function(){};
-    Obj.prototype = {a: 1, b: 2, c: 3};
-    var instance = new Obj();
-    assert.deepEqual(_.pick(instance, 'a', 'c'), {a: 1, c: 3}, 'include prototype props');
-
-    assert.deepEqual(_.pick(data, function(val, key) {
-      return this[key] === 3 && this === instance;
-    }, instance), {c: 3}, 'function is given context');
-
-    assert.ok(!_.has(_.pick({}, 'foo'), 'foo'), 'does not set own property if property not in object');
-    _.pick(data, function(value, key, obj) {
-      assert.equal(obj, data, 'passes same object as third parameter of iteratee');
-    });
-  });
-
-  QUnit.test('omit', function(assert) {
-    var result;
-    result = _.omit({a: 1, b: 2, c: 3}, 'b');
-    assert.deepEqual(result, {a: 1, c: 3}, 'can omit a single named property');
-    result = _.omit({a: 1, b: 2, c: 3}, 'a', 'c');
-    assert.deepEqual(result, {b: 2}, 'can omit several named properties');
-    result = _.omit({a: 1, b: 2, c: 3}, ['b', 'c']);
-    assert.deepEqual(result, {a: 1}, 'can omit properties named in an array');
-    result = _.omit(['a', 'b'], 0);
-    assert.deepEqual(result, {1: 'b'}, 'can omit numeric properties');
-
-    assert.deepEqual(_.omit(null, 'a', 'b'), {}, 'non objects return empty object');
-    assert.deepEqual(_.omit(void 0, 'toString'), {}, 'null/undefined return empty object');
-    assert.deepEqual(_.omit(5, 'toString', 'b'), {}, 'returns empty object for primitives');
-
-    var data = {a: 1, b: 2, c: 3};
-    var callback = function(value, key, object) {
-      assert.strictEqual(key, {1: 'a', 2: 'b', 3: 'c'}[value]);
-      assert.strictEqual(object, data);
-      return value !== this.value;
-    };
-    result = _.omit(data, callback, {value: 2});
-    assert.deepEqual(result, {b: 2}, 'can accept a predicate');
-
-    var Obj = function(){};
-    Obj.prototype = {a: 1, b: 2, c: 3};
-    var instance = new Obj();
-    assert.deepEqual(_.omit(instance, 'b'), {a: 1, c: 3}, 'include prototype props');
-
-    assert.deepEqual(_.omit(data, function(val, key) {
-      return this[key] === 3 && this === instance;
-    }, instance), {a: 1, b: 2}, 'function is given context');
-  });
-
-  QUnit.test('defaults', function(assert) {
-    var options = {zero: 0, one: 1, empty: '', nan: NaN, nothing: null};
-
-    _.defaults(options, {zero: 1, one: 10, twenty: 20, nothing: 'str'});
-    assert.equal(options.zero, 0, 'value exists');
-    assert.equal(options.one, 1, 'value exists');
-    assert.equal(options.twenty, 20, 'default applied');
-    assert.equal(options.nothing, null, "null isn't overridden");
-
-    _.defaults(options, {empty: 'full'}, {nan: 'nan'}, {word: 'word'}, {word: 'dog'});
-    assert.equal(options.empty, '', 'value exists');
-    assert.ok(_.isNaN(options.nan), "NaN isn't overridden");
-    assert.equal(options.word, 'word', 'new value is added, first one wins');
-
-    try {
-      options = {};
-      _.defaults(options, null, void 0, {a: 1});
-    } catch (e) { /* ignored */ }
-
-    assert.equal(options.a, 1, 'should not error on `null` or `undefined` sources');
-
-    assert.deepEqual(_.defaults(null, {a: 1}), {a: 1}, 'defaults skips nulls');
-    assert.deepEqual(_.defaults(void 0, {a: 1}), {a: 1}, 'defaults skips undefined');
-  });
-
-  QUnit.test('clone', function(assert) {
-    var moe = {name: 'moe', lucky: [13, 27, 34]};
-    var clone = _.clone(moe);
-    assert.equal(clone.name, 'moe', 'the clone as the attributes of the original');
-
-    clone.name = 'curly';
-    assert.ok(clone.name === 'curly' && moe.name === 'moe', 'clones can change shallow attributes without affecting the original');
-
-    clone.lucky.push(101);
-    assert.equal(_.last(moe.lucky), 101, 'changes to deep attributes are shared with the original');
-
-    assert.equal(_.clone(void 0), void 0, 'non objects should not be changed by clone');
-    assert.equal(_.clone(1), 1, 'non objects should not be changed by clone');
-    assert.equal(_.clone(null), null, 'non objects should not be changed by clone');
-  });
-
-  QUnit.test('create', function(assert) {
-    var Parent = function() {};
-    Parent.prototype = {foo: function() {}, bar: 2};
-
-    _.each(['foo', null, void 0, 1], function(val) {
-      assert.deepEqual(_.create(val), {}, 'should return empty object when a non-object is provided');
-    });
-
-    assert.ok(_.create([]) instanceof Array, 'should return new instance of array when array is provided');
-
-    var Child = function() {};
-    Child.prototype = _.create(Parent.prototype);
-    assert.ok(new Child instanceof Parent, 'object should inherit prototype');
-
-    var func = function() {};
-    Child.prototype = _.create(Parent.prototype, {func: func});
-    assert.strictEqual(Child.prototype.func, func, 'properties should be added to object');
-
-    Child.prototype = _.create(Parent.prototype, {constructor: Child});
-    assert.strictEqual(Child.prototype.constructor, Child);
-
-    Child.prototype.foo = 'foo';
-    var created = _.create(Child.prototype, new Child);
-    assert.ok(!created.hasOwnProperty('foo'), 'should only add own properties');
-  });
-
-  QUnit.test('isEqual', function(assert) {
-    function First() {
-      this.value = 1;
-    }
-    First.prototype.value = 1;
-    function Second() {
-      this.value = 1;
-    }
-    Second.prototype.value = 2;
-
-    // Basic equality and identity comparisons.
-    assert.ok(_.isEqual(null, null), '`null` is equal to `null`');
-    assert.ok(_.isEqual(), '`undefined` is equal to `undefined`');
-
-    assert.ok(!_.isEqual(0, -0), '`0` is not equal to `-0`');
-    assert.ok(!_.isEqual(-0, 0), 'Commutative equality is implemented for `0` and `-0`');
-    assert.ok(!_.isEqual(null, void 0), '`null` is not equal to `undefined`');
-    assert.ok(!_.isEqual(void 0, null), 'Commutative equality is implemented for `null` and `undefined`');
-
-    // String object and primitive comparisons.
-    assert.ok(_.isEqual('Curly', 'Curly'), 'Identical string primitives are equal');
-    assert.ok(_.isEqual(new String('Curly'), new String('Curly')), 'String objects with identical primitive values are equal');
-    assert.ok(_.isEqual(new String('Curly'), 'Curly'), 'String primitives and their corresponding object wrappers are equal');
-    assert.ok(_.isEqual('Curly', new String('Curly')), 'Commutative equality is implemented for string objects and primitives');
-
-    assert.ok(!_.isEqual('Curly', 'Larry'), 'String primitives with different values are not equal');
-    assert.ok(!_.isEqual(new String('Curly'), new String('Larry')), 'String objects with different primitive values are not equal');
-    assert.ok(!_.isEqual(new String('Curly'), {toString: function(){ return 'Curly'; }}), 'String objects and objects with a custom `toString` method are not equal');
-
-    // Number object and primitive comparisons.
-    assert.ok(_.isEqual(75, 75), 'Identical number primitives are equal');
-    assert.ok(_.isEqual(new Number(75), new Number(75)), 'Number objects with identical primitive values are equal');
-    assert.ok(_.isEqual(75, new Number(75)), 'Number primitives and their corresponding object wrappers are equal');
-    assert.ok(_.isEqual(new Number(75), 75), 'Commutative equality is implemented for number objects and primitives');
-    assert.ok(!_.isEqual(new Number(0), -0), '`new Number(0)` and `-0` are not equal');
-    assert.ok(!_.isEqual(0, new Number(-0)), 'Commutative equality is implemented for `new Number(0)` and `-0`');
-
-    assert.ok(!_.isEqual(new Number(75), new Number(63)), 'Number objects with different primitive values are not equal');
-    assert.ok(!_.isEqual(new Number(63), {valueOf: function(){ return 63; }}), 'Number objects and objects with a `valueOf` method are not equal');
-
-    // Comparisons involving `NaN`.
-    assert.ok(_.isEqual(NaN, NaN), '`NaN` is equal to `NaN`');
-    assert.ok(_.isEqual(new Number(NaN), NaN), 'Object(`NaN`) is equal to `NaN`');
-    assert.ok(!_.isEqual(61, NaN), 'A number primitive is not equal to `NaN`');
-    assert.ok(!_.isEqual(new Number(79), NaN), 'A number object is not equal to `NaN`');
-    assert.ok(!_.isEqual(Infinity, NaN), '`Infinity` is not equal to `NaN`');
-
-    // Boolean object and primitive comparisons.
-    assert.ok(_.isEqual(true, true), 'Identical boolean primitives are equal');
-    assert.ok(_.isEqual(new Boolean, new Boolean), 'Boolean objects with identical primitive values are equal');
-    assert.ok(_.isEqual(true, new Boolean(true)), 'Boolean primitives and their corresponding object wrappers are equal');
-    assert.ok(_.isEqual(new Boolean(true), true), 'Commutative equality is implemented for booleans');
-    assert.ok(!_.isEqual(new Boolean(true), new Boolean), 'Boolean objects with different primitive values are not equal');
-
-    // Common type coercions.
-    assert.ok(!_.isEqual(new Boolean(false), true), '`new Boolean(false)` is not equal to `true`');
-    assert.ok(!_.isEqual('75', 75), 'String and number primitives with like values are not equal');
-    assert.ok(!_.isEqual(new Number(63), new String(63)), 'String and number objects with like values are not equal');
-    assert.ok(!_.isEqual(75, '75'), 'Commutative equality is implemented for like string and number values');
-    assert.ok(!_.isEqual(0, ''), 'Number and string primitives with like values are not equal');
-    assert.ok(!_.isEqual(1, true), 'Number and boolean primitives with like values are not equal');
-    assert.ok(!_.isEqual(new Boolean(false), new Number(0)), 'Boolean and number objects with like values are not equal');
-    assert.ok(!_.isEqual(false, new String('')), 'Boolean primitives and string objects with like values are not equal');
-    assert.ok(!_.isEqual(12564504e5, new Date(2009, 9, 25)), 'Dates and their corresponding numeric primitive values are not equal');
-
-    // Dates.
-    assert.ok(_.isEqual(new Date(2009, 9, 25), new Date(2009, 9, 25)), 'Date objects referencing identical times are equal');
-    assert.ok(!_.isEqual(new Date(2009, 9, 25), new Date(2009, 11, 13)), 'Date objects referencing different times are not equal');
-    assert.ok(!_.isEqual(new Date(2009, 11, 13), {
-      getTime: function(){
-        return 12606876e5;
-      }
-    }), 'Date objects and objects with a `getTime` method are not equal');
-    assert.ok(!_.isEqual(new Date('Curly'), new Date('Curly')), 'Invalid dates are not equal');
-
-    // Functions.
-    assert.ok(!_.isEqual(First, Second), 'Different functions with identical bodies and source code representations are not equal');
-
-    // RegExps.
-    assert.ok(_.isEqual(/(?:)/gim, /(?:)/gim), 'RegExps with equivalent patterns and flags are equal');
-    assert.ok(_.isEqual(/(?:)/gi, /(?:)/ig), 'Flag order is not significant');
-    assert.ok(!_.isEqual(/(?:)/g, /(?:)/gi), 'RegExps with equivalent patterns and different flags are not equal');
-    assert.ok(!_.isEqual(/Moe/gim, /Curly/gim), 'RegExps with different patterns and equivalent flags are not equal');
-    assert.ok(!_.isEqual(/(?:)/gi, /(?:)/g), 'Commutative equality is implemented for RegExps');
-    assert.ok(!_.isEqual(/Curly/g, {source: 'Larry', global: true, ignoreCase: false, multiline: false}), 'RegExps and RegExp-like objects are not equal');
-
-    // Empty arrays, array-like objects, and object literals.
-    assert.ok(_.isEqual({}, {}), 'Empty object literals are equal');
-    assert.ok(_.isEqual([], []), 'Empty array literals are equal');
-    assert.ok(_.isEqual([{}], [{}]), 'Empty nested arrays and objects are equal');
-    assert.ok(!_.isEqual({length: 0}, []), 'Array-like objects and arrays are not equal.');
-    assert.ok(!_.isEqual([], {length: 0}), 'Commutative equality is implemented for array-like objects');
-
-    assert.ok(!_.isEqual({}, []), 'Object literals and array literals are not equal');
-    assert.ok(!_.isEqual([], {}), 'Commutative equality is implemented for objects and arrays');
-
-    // Arrays with primitive and object values.
-    assert.ok(_.isEqual([1, 'Larry', true], [1, 'Larry', true]), 'Arrays containing identical primitives are equal');
-    assert.ok(_.isEqual([/Moe/g, new Date(2009, 9, 25)], [/Moe/g, new Date(2009, 9, 25)]), 'Arrays containing equivalent elements are equal');
-
-    // Multi-dimensional arrays.
-    var a = [new Number(47), false, 'Larry', /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}];
-    var b = [new Number(47), false, 'Larry', /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}];
-    assert.ok(_.isEqual(a, b), 'Arrays containing nested arrays and objects are recursively compared');
-
-    // Overwrite the methods defined in ES 5.1 section 15.4.4.
-    a.forEach = a.map = a.filter = a.every = a.indexOf = a.lastIndexOf = a.some = a.reduce = a.reduceRight = null;
-    b.join = b.pop = b.reverse = b.shift = b.slice = b.splice = b.concat = b.sort = b.unshift = null;
-
-    // Array elements and properties.
-    assert.ok(_.isEqual(a, b), 'Arrays containing equivalent elements and different non-numeric properties are equal');
-    a.push('White Rocks');
-    assert.ok(!_.isEqual(a, b), 'Arrays of different lengths are not equal');
-    a.push('East Boulder');
-    b.push('Gunbarrel Ranch', 'Teller Farm');
-    assert.ok(!_.isEqual(a, b), 'Arrays of identical lengths containing different elements are not equal');
-
-    // Sparse arrays.
-    assert.ok(_.isEqual(Array(3), Array(3)), 'Sparse arrays of identical lengths are equal');
-    assert.ok(!_.isEqual(Array(3), Array(6)), 'Sparse arrays of different lengths are not equal when both are empty');
-
-    var sparse = [];
-    sparse[1] = 5;
-    assert.ok(_.isEqual(sparse, [void 0, 5]), 'Handles sparse arrays as dense');
-
-    // Simple objects.
-    assert.ok(_.isEqual({a: 'Curly', b: 1, c: true}, {a: 'Curly', b: 1, c: true}), 'Objects containing identical primitives are equal');
-    assert.ok(_.isEqual({a: /Curly/g, b: new Date(2009, 11, 13)}, {a: /Curly/g, b: new Date(2009, 11, 13)}), 'Objects containing equivalent members are equal');
-    assert.ok(!_.isEqual({a: 63, b: 75}, {a: 61, b: 55}), 'Objects of identical sizes with different values are not equal');
-    assert.ok(!_.isEqual({a: 63, b: 75}, {a: 61, c: 55}), 'Objects of identical sizes with different property names are not equal');
-    assert.ok(!_.isEqual({a: 1, b: 2}, {a: 1}), 'Objects of different sizes are not equal');
-    assert.ok(!_.isEqual({a: 1}, {a: 1, b: 2}), 'Commutative equality is implemented for objects');
-    assert.ok(!_.isEqual({x: 1, y: void 0}, {x: 1, z: 2}), 'Objects with identical keys and different values are not equivalent');
-
-    // `A` contains nested objects and arrays.
-    a = {
-      name: new String('Moe Howard'),
-      age: new Number(77),
-      stooge: true,
-      hobbies: ['acting'],
-      film: {
-        name: 'Sing a Song of Six Pants',
-        release: new Date(1947, 9, 30),
-        stars: [new String('Larry Fine'), 'Shemp Howard'],
-        minutes: new Number(16),
-        seconds: 54
-      }
-    };
-
-    // `B` contains equivalent nested objects and arrays.
-    b = {
-      name: new String('Moe Howard'),
-      age: new Number(77),
-      stooge: true,
-      hobbies: ['acting'],
-      film: {
-        name: 'Sing a Song of Six Pants',
-        release: new Date(1947, 9, 30),
-        stars: [new String('Larry Fine'), 'Shemp Howard'],
-        minutes: new Number(16),
-        seconds: 54
-      }
-    };
-    assert.ok(_.isEqual(a, b), 'Objects with nested equivalent members are recursively compared');
-
-    // Instances.
-    assert.ok(_.isEqual(new First, new First), 'Object instances are equal');
-    assert.ok(!_.isEqual(new First, new Second), 'Objects with different constructors and identical own properties are not equal');
-    assert.ok(!_.isEqual({value: 1}, new First), 'Object instances and objects sharing equivalent properties are not equal');
-    assert.ok(!_.isEqual({value: 2}, new Second), 'The prototype chain of objects should not be examined');
-
-    // Circular Arrays.
-    (a = []).push(a);
-    (b = []).push(b);
-    assert.ok(_.isEqual(a, b), 'Arrays containing circular references are equal');
-    a.push(new String('Larry'));
-    b.push(new String('Larry'));
-    assert.ok(_.isEqual(a, b), 'Arrays containing circular references and equivalent properties are equal');
-    a.push('Shemp');
-    b.push('Curly');
-    assert.ok(!_.isEqual(a, b), 'Arrays containing circular references and different properties are not equal');
-
-    // More circular arrays #767.
-    a = ['everything is checked but', 'this', 'is not'];
-    a[1] = a;
-    b = ['everything is checked but', ['this', 'array'], 'is not'];
-    assert.ok(!_.isEqual(a, b), 'Comparison of circular references with non-circular references are not equal');
-
-    // Circular Objects.
-    a = {abc: null};
-    b = {abc: null};
-    a.abc = a;
-    b.abc = b;
-    assert.ok(_.isEqual(a, b), 'Objects containing circular references are equal');
-    a.def = 75;
-    b.def = 75;
-    assert.ok(_.isEqual(a, b), 'Objects containing circular references and equivalent properties are equal');
-    a.def = new Number(75);
-    b.def = new Number(63);
-    assert.ok(!_.isEqual(a, b), 'Objects containing circular references and different properties are not equal');
-
-    // More circular objects #767.
-    a = {everything: 'is checked', but: 'this', is: 'not'};
-    a.but = a;
-    b = {everything: 'is checked', but: {that: 'object'}, is: 'not'};
-    assert.ok(!_.isEqual(a, b), 'Comparison of circular references with non-circular object references are not equal');
-
-    // Cyclic Structures.
-    a = [{abc: null}];
-    b = [{abc: null}];
-    (a[0].abc = a).push(a);
-    (b[0].abc = b).push(b);
-    assert.ok(_.isEqual(a, b), 'Cyclic structures are equal');
-    a[0].def = 'Larry';
-    b[0].def = 'Larry';
-    assert.ok(_.isEqual(a, b), 'Cyclic structures containing equivalent properties are equal');
-    a[0].def = new String('Larry');
-    b[0].def = new String('Curly');
-    assert.ok(!_.isEqual(a, b), 'Cyclic structures containing different properties are not equal');
-
-    // Complex Circular References.
-    a = {foo: {b: {foo: {c: {foo: null}}}}};
-    b = {foo: {b: {foo: {c: {foo: null}}}}};
-    a.foo.b.foo.c.foo = a;
-    b.foo.b.foo.c.foo = b;
-    assert.ok(_.isEqual(a, b), 'Cyclic structures with nested and identically-named properties are equal');
-
-    // Chaining.
-    assert.ok(!_.isEqual(_({x: 1, y: void 0}).chain(), _({x: 1, z: 2}).chain()), 'Chained objects containing different values are not equal');
-
-    a = _({x: 1, y: 2}).chain();
-    b = _({x: 1, y: 2}).chain();
-    assert.equal(_.isEqual(a.isEqual(b), _(true)), true, '`isEqual` can be chained');
-
-    // Objects without a `constructor` property
-    if (Object.create) {
-      a = Object.create(null, {x: {value: 1, enumerable: true}});
-      b = {x: 1};
-      assert.ok(_.isEqual(a, b), 'Handles objects without a constructor (e.g. from Object.create');
-    }
-
-    function Foo() { this.a = 1; }
-    Foo.prototype.constructor = null;
-
-    var other = {a: 1};
-    assert.strictEqual(_.isEqual(new Foo, other), false, 'Objects from different constructors are not equal');
-
-
-    // Tricky object cases val comparisions
-    assert.equal(_.isEqual([0], [-0]), false);
-    assert.equal(_.isEqual({a: 0}, {a: -0}), false);
-    assert.equal(_.isEqual([NaN], [NaN]), true);
-    assert.equal(_.isEqual({a: NaN}, {a: NaN}), true);
-
-    if (typeof Symbol !== 'undefined') {
-      var symbol = Symbol('x');
-      assert.strictEqual(_.isEqual(symbol, symbol), true, 'A symbol is equal to itself');
-      assert.strictEqual(_.isEqual(symbol, Object(symbol)), true, 'Even when wrapped in Object()');
-      assert.strictEqual(_.isEqual(symbol, null), false, 'Different types are not equal');
-    }
-
-  });
-
-  QUnit.test('isEmpty', function(assert) {
-    assert.ok(!_([1]).isEmpty(), '[1] is not empty');
-    assert.ok(_.isEmpty([]), '[] is empty');
-    assert.ok(!_.isEmpty({one: 1}), '{one: 1} is not empty');
-    assert.ok(_.isEmpty({}), '{} is empty');
-    assert.ok(_.isEmpty(new RegExp('')), 'objects with prototype properties are empty');
-    assert.ok(_.isEmpty(null), 'null is empty');
-    assert.ok(_.isEmpty(), 'undefined is empty');
-    assert.ok(_.isEmpty(''), 'the empty string is empty');
-    assert.ok(!_.isEmpty('moe'), 'but other strings are not');
-
-    var obj = {one: 1};
-    delete obj.one;
-    assert.ok(_.isEmpty(obj), 'deleting all the keys from an object empties it');
-
-    var args = function(){ return arguments; };
-    assert.ok(_.isEmpty(args()), 'empty arguments object is empty');
-    assert.ok(!_.isEmpty(args('')), 'non-empty arguments object is not empty');
-
-    // covers collecting non-enumerable properties in IE < 9
-    var nonEnumProp = {toString: 5};
-    assert.ok(!_.isEmpty(nonEnumProp), 'non-enumerable property is not empty');
-  });
-
-  if (typeof document === 'object') {
-    QUnit.test('isElement', function(assert) {
-      assert.ok(!_.isElement('div'), 'strings are not dom elements');
-      assert.ok(_.isElement(testElement), 'an element is a DOM element');
-    });
-  }
-
-  QUnit.test('isArguments', function(assert) {
-    var args = (function(){ return arguments; }(1, 2, 3));
-    assert.ok(!_.isArguments('string'), 'a string is not an arguments object');
-    assert.ok(!_.isArguments(_.isArguments), 'a function is not an arguments object');
-    assert.ok(_.isArguments(args), 'but the arguments object is an arguments object');
-    assert.ok(!_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array');
-    assert.ok(!_.isArguments([1, 2, 3]), 'and not vanilla arrays.');
-  });
-
-  QUnit.test('isObject', function(assert) {
-    assert.ok(_.isObject(arguments), 'the arguments object is object');
-    assert.ok(_.isObject([1, 2, 3]), 'and arrays');
-    if (testElement) {
-      assert.ok(_.isObject(testElement), 'and DOM element');
-    }
-    assert.ok(_.isObject(function() {}), 'and functions');
-    assert.ok(!_.isObject(null), 'but not null');
-    assert.ok(!_.isObject(void 0), 'and not undefined');
-    assert.ok(!_.isObject('string'), 'and not string');
-    assert.ok(!_.isObject(12), 'and not number');
-    assert.ok(!_.isObject(true), 'and not boolean');
-    assert.ok(_.isObject(new String('string')), 'but new String()');
-  });
-
-  QUnit.test('isArray', function(assert) {
-    assert.ok(!_.isArray(void 0), 'undefined vars are not arrays');
-    assert.ok(!_.isArray(arguments), 'the arguments object is not an array');
-    assert.ok(_.isArray([1, 2, 3]), 'but arrays are');
-  });
-
-  QUnit.test('isString', function(assert) {
-    var obj = new String('I am a string object');
-    if (testElement) {
-      assert.ok(!_.isString(testElement), 'an element is not a string');
-    }
-    assert.ok(_.isString([1, 2, 3].join(', ')), 'but strings are');
-    assert.strictEqual(_.isString('I am a string literal'), true, 'string literals are');
-    assert.ok(_.isString(obj), 'so are String objects');
-    assert.strictEqual(_.isString(1), false);
-  });
-
-  QUnit.test('isSymbol', function(assert) {
-    assert.ok(!_.isSymbol(0), 'numbers are not symbols');
-    assert.ok(!_.isSymbol(''), 'strings are not symbols');
-    assert.ok(!_.isSymbol(_.isSymbol), 'functions are not symbols');
-    if (typeof Symbol === 'function') {
-      assert.ok(_.isSymbol(Symbol()), 'symbols are symbols');
-      assert.ok(_.isSymbol(Symbol('description')), 'described symbols are symbols');
-      assert.ok(_.isSymbol(Object(Symbol())), 'boxed symbols are symbols');
-    }
-  });
-
-  QUnit.test('isNumber', function(assert) {
-    assert.ok(!_.isNumber('string'), 'a string is not a number');
-    assert.ok(!_.isNumber(arguments), 'the arguments object is not a number');
-    assert.ok(!_.isNumber(void 0), 'undefined is not a number');
-    assert.ok(_.isNumber(3 * 4 - 7 / 10), 'but numbers are');
-    assert.ok(_.isNumber(NaN), 'NaN *is* a number');
-    assert.ok(_.isNumber(Infinity), 'Infinity is a number');
-    assert.ok(!_.isNumber('1'), 'numeric strings are not numbers');
-  });
-
-  QUnit.test('isBoolean', function(assert) {
-    assert.ok(!_.isBoolean(2), 'a number is not a boolean');
-    assert.ok(!_.isBoolean('string'), 'a string is not a boolean');
-    assert.ok(!_.isBoolean('false'), 'the string "false" is not a boolean');
-    assert.ok(!_.isBoolean('true'), 'the string "true" is not a boolean');
-    assert.ok(!_.isBoolean(arguments), 'the arguments object is not a boolean');
-    assert.ok(!_.isBoolean(void 0), 'undefined is not a boolean');
-    assert.ok(!_.isBoolean(NaN), 'NaN is not a boolean');
-    assert.ok(!_.isBoolean(null), 'null is not a boolean');
-    assert.ok(_.isBoolean(true), 'but true is');
-    assert.ok(_.isBoolean(false), 'and so is false');
-  });
-
-  QUnit.test('isMap', function(assert) {
-    assert.ok(!_.isMap('string'), 'a string is not a map');
-    assert.ok(!_.isMap(2), 'a number is not a map');
-    assert.ok(!_.isMap({}), 'an object is not a map');
-    assert.ok(!_.isMap(false), 'a boolean is not a map');
-    assert.ok(!_.isMap(void 0), 'undefined is not a map');
-    assert.ok(!_.isMap([1, 2, 3]), 'an array is not a map');
-    if (typeof Set === 'function') {
-      assert.ok(!_.isMap(new Set()), 'a set is not a map');
-    }
-    if (typeof WeakSet === 'function') {
-      assert.ok(!_.isMap(new WeakSet()), 'a weakset is not a map');
-    }
-    if (typeof WeakMap === 'function') {
-      assert.ok(!_.isMap(new WeakMap()), 'a weakmap is not a map');
-    }
-    if (typeof Map === 'function') {
-      var keyString = 'a string';
-      var obj = new Map();
-      obj.set(keyString, 'value');
-      assert.ok(_.isMap(obj), 'but a map is');
-    }
-  });
-
-  QUnit.test('isWeakMap', function(assert) {
-    assert.ok(!_.isWeakMap('string'), 'a string is not a weakmap');
-    assert.ok(!_.isWeakMap(2), 'a number is not a weakmap');
-    assert.ok(!_.isWeakMap({}), 'an object is not a weakmap');
-    assert.ok(!_.isWeakMap(false), 'a boolean is not a weakmap');
-    assert.ok(!_.isWeakMap(void 0), 'undefined is not a weakmap');
-    assert.ok(!_.isWeakMap([1, 2, 3]), 'an array is not a weakmap');
-    if (typeof Set === 'function') {
-      assert.ok(!_.isWeakMap(new Set()), 'a set is not a weakmap');
-    }
-    if (typeof WeakSet === 'function') {
-      assert.ok(!_.isWeakMap(new WeakSet()), 'a weakset is not a weakmap');
-    }
-    if (typeof Map === 'function') {
-      assert.ok(!_.isWeakMap(new Map()), 'a map is not a weakmap');
-    }
-    if (typeof WeakMap === 'function') {
-      var keyObj = {}, obj = new WeakMap();
-      obj.set(keyObj, 'value');
-      assert.ok(_.isWeakMap(obj), 'but a weakmap is');
-    }
-  });
-
-  QUnit.test('isSet', function(assert) {
-    assert.ok(!_.isSet('string'), 'a string is not a set');
-    assert.ok(!_.isSet(2), 'a number is not a set');
-    assert.ok(!_.isSet({}), 'an object is not a set');
-    assert.ok(!_.isSet(false), 'a boolean is not a set');
-    assert.ok(!_.isSet(void 0), 'undefined is not a set');
-    assert.ok(!_.isSet([1, 2, 3]), 'an array is not a set');
-    if (typeof Map === 'function') {
-      assert.ok(!_.isSet(new Map()), 'a map is not a set');
-    }
-    if (typeof WeakMap === 'function') {
-      assert.ok(!_.isSet(new WeakMap()), 'a weakmap is not a set');
-    }
-    if (typeof WeakSet === 'function') {
-      assert.ok(!_.isSet(new WeakSet()), 'a weakset is not a set');
-    }
-    if (typeof Set === 'function') {
-      var obj = new Set();
-      obj.add(1).add('string').add(false).add({});
-      assert.ok(_.isSet(obj), 'but a set is');
-    }
-  });
-
-  QUnit.test('isWeakSet', function(assert) {
-
-    assert.ok(!_.isWeakSet('string'), 'a string is not a weakset');
-    assert.ok(!_.isWeakSet(2), 'a number is not a weakset');
-    assert.ok(!_.isWeakSet({}), 'an object is not a weakset');
-    assert.ok(!_.isWeakSet(false), 'a boolean is not a weakset');
-    assert.ok(!_.isWeakSet(void 0), 'undefined is not a weakset');
-    assert.ok(!_.isWeakSet([1, 2, 3]), 'an array is not a weakset');
-    if (typeof Map === 'function') {
-      assert.ok(!_.isWeakSet(new Map()), 'a map is not a weakset');
-    }
-    if (typeof WeakMap === 'function') {
-      assert.ok(!_.isWeakSet(new WeakMap()), 'a weakmap is not a weakset');
-    }
-    if (typeof Set === 'function') {
-      assert.ok(!_.isWeakSet(new Set()), 'a set is not a weakset');
-    }
-    if (typeof WeakSet === 'function') {
-      var obj = new WeakSet();
-      obj.add({x: 1}, {y: 'string'}).add({y: 'string'}).add({z: [1, 2, 3]});
-      assert.ok(_.isWeakSet(obj), 'but a weakset is');
-    }
-  });
-
-  QUnit.test('isFunction', function(assert) {
-    assert.ok(!_.isFunction(void 0), 'undefined vars are not functions');
-    assert.ok(!_.isFunction([1, 2, 3]), 'arrays are not functions');
-    assert.ok(!_.isFunction('moe'), 'strings are not functions');
-    assert.ok(_.isFunction(_.isFunction), 'but functions are');
-    assert.ok(_.isFunction(function(){}), 'even anonymous ones');
-
-    if (testElement) {
-      assert.ok(!_.isFunction(testElement), 'elements are not functions');
-    }
-
-    var nodelist = typeof document != 'undefined' && document.childNodes;
-    if (nodelist) {
-      assert.ok(!_.isFunction(nodelist));
-    }
-  });
-
-  if (typeof Int8Array !== 'undefined') {
-    QUnit.test('#1929 Typed Array constructors are functions', function(assert) {
-      _.chain(['Float32Array', 'Float64Array', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array'])
-      .map(_.propertyOf(typeof GLOBAL != 'undefined' ? GLOBAL : window))
-      .compact()
-      .each(function(TypedArray) {
-        // PhantomJS reports `typeof UInt8Array == 'object'` and doesn't report toString TypeArray
-        // as a function
-        assert.strictEqual(_.isFunction(TypedArray), Object.prototype.toString.call(TypedArray) === '[object Function]');
-      });
-    });
-  }
-
-  QUnit.test('isDate', function(assert) {
-    assert.ok(!_.isDate(100), 'numbers are not dates');
-    assert.ok(!_.isDate({}), 'objects are not dates');
-    assert.ok(_.isDate(new Date()), 'but dates are');
-  });
-
-  QUnit.test('isRegExp', function(assert) {
-    assert.ok(!_.isRegExp(_.identity), 'functions are not RegExps');
-    assert.ok(_.isRegExp(/identity/), 'but RegExps are');
-  });
-
-  QUnit.test('isFinite', function(assert) {
-    assert.ok(!_.isFinite(void 0), 'undefined is not finite');
-    assert.ok(!_.isFinite(null), 'null is not finite');
-    assert.ok(!_.isFinite(NaN), 'NaN is not finite');
-    assert.ok(!_.isFinite(Infinity), 'Infinity is not finite');
-    assert.ok(!_.isFinite(-Infinity), '-Infinity is not finite');
-    assert.ok(_.isFinite('12'), 'Numeric strings are numbers');
-    assert.ok(!_.isFinite('1a'), 'Non numeric strings are not numbers');
-    assert.ok(!_.isFinite(''), 'Empty strings are not numbers');
-    var obj = new Number(5);
-    assert.ok(_.isFinite(obj), 'Number instances can be finite');
-    assert.ok(_.isFinite(0), '0 is finite');
-    assert.ok(_.isFinite(123), 'Ints are finite');
-    assert.ok(_.isFinite(-12.44), 'Floats are finite');
-    if (typeof Symbol === 'function') {
-      assert.ok(!_.isFinite(Symbol()), 'symbols are not numbers');
-      assert.ok(!_.isFinite(Symbol('description')), 'described symbols are not numbers');
-      assert.ok(!_.isFinite(Object(Symbol())), 'boxed symbols are not numbers');
-    }
-  });
-
-  QUnit.test('isNaN', function(assert) {
-    assert.ok(!_.isNaN(void 0), 'undefined is not NaN');
-    assert.ok(!_.isNaN(null), 'null is not NaN');
-    assert.ok(!_.isNaN(0), '0 is not NaN');
-    assert.ok(!_.isNaN(new Number(0)), 'wrapped 0 is not NaN');
-    assert.ok(_.isNaN(NaN), 'but NaN is');
-    assert.ok(_.isNaN(new Number(NaN)), 'wrapped NaN is still NaN');
-  });
-
-  QUnit.test('isNull', function(assert) {
-    assert.ok(!_.isNull(void 0), 'undefined is not null');
-    assert.ok(!_.isNull(NaN), 'NaN is not null');
-    assert.ok(_.isNull(null), 'but null is');
-  });
-
-  QUnit.test('isUndefined', function(assert) {
-    assert.ok(!_.isUndefined(1), 'numbers are defined');
-    assert.ok(!_.isUndefined(null), 'null is defined');
-    assert.ok(!_.isUndefined(false), 'false is defined');
-    assert.ok(!_.isUndefined(NaN), 'NaN is defined');
-    assert.ok(_.isUndefined(), 'nothing is undefined');
-    assert.ok(_.isUndefined(void 0), 'undefined is undefined');
-  });
-
-  QUnit.test('isError', function(assert) {
-    assert.ok(!_.isError(1), 'numbers are not Errors');
-    assert.ok(!_.isError(null), 'null is not an Error');
-    assert.ok(!_.isError(Error), 'functions are not Errors');
-    assert.ok(_.isError(new Error()), 'Errors are Errors');
-    assert.ok(_.isError(new EvalError()), 'EvalErrors are Errors');
-    assert.ok(_.isError(new RangeError()), 'RangeErrors are Errors');
-    assert.ok(_.isError(new ReferenceError()), 'ReferenceErrors are Errors');
-    assert.ok(_.isError(new SyntaxError()), 'SyntaxErrors are Errors');
-    assert.ok(_.isError(new TypeError()), 'TypeErrors are Errors');
-    assert.ok(_.isError(new URIError()), 'URIErrors are Errors');
-  });
-
-  QUnit.test('tap', function(assert) {
-    var intercepted = null;
-    var interceptor = function(obj) { intercepted = obj; };
-    var returned = _.tap(1, interceptor);
-    assert.equal(intercepted, 1, 'passes tapped object to interceptor');
-    assert.equal(returned, 1, 'returns tapped object');
-
-    returned = _([1, 2, 3]).chain().
-      map(function(n){ return n * 2; }).
-      max().
-      tap(interceptor).
-      value();
-    assert.equal(returned, 6, 'can use tapped objects in a chain');
-    assert.equal(intercepted, returned, 'can use tapped objects in a chain');
-  });
-
-  QUnit.test('has', function(assert) {
-    var obj = {foo: 'bar', func: function(){}};
-    assert.ok(_.has(obj, 'foo'), 'has() checks that the object has a property.');
-    assert.ok(!_.has(obj, 'baz'), "has() returns false if the object doesn't have the property.");
-    assert.ok(_.has(obj, 'func'), 'has() works for functions too.');
-    obj.hasOwnProperty = null;
-    assert.ok(_.has(obj, 'foo'), 'has() works even when the hasOwnProperty method is deleted.');
-    var child = {};
-    child.prototype = obj;
-    assert.ok(!_.has(child, 'foo'), 'has() does not check the prototype chain for a property.');
-    assert.strictEqual(_.has(null, 'foo'), false, 'has() returns false for null');
-    assert.strictEqual(_.has(void 0, 'foo'), false, 'has() returns false for undefined');
-  });
-
-  QUnit.test('isMatch', function(assert) {
-    var moe = {name: 'Moe Howard', hair: true};
-    var curly = {name: 'Curly Howard', hair: false};
-
-    assert.equal(_.isMatch(moe, {hair: true}), true, 'Returns a boolean');
-    assert.equal(_.isMatch(curly, {hair: true}), false, 'Returns a boolean');
-
-    assert.equal(_.isMatch(5, {__x__: void 0}), false, 'can match undefined props on primitives');
-    assert.equal(_.isMatch({__x__: void 0}, {__x__: void 0}), true, 'can match undefined props');
-
-    assert.equal(_.isMatch(null, {}), true, 'Empty spec called with null object returns true');
-    assert.equal(_.isMatch(null, {a: 1}), false, 'Non-empty spec called with null object returns false');
-
-    _.each([null, void 0], function(item) { assert.strictEqual(_.isMatch(item, null), true, 'null matches null'); });
-    _.each([null, void 0], function(item) { assert.strictEqual(_.isMatch(item, null), true, 'null matches {}'); });
-    assert.strictEqual(_.isMatch({b: 1}, {a: void 0}), false, 'handles undefined values (1683)');
-
-    _.each([true, 5, NaN, null, void 0], function(item) {
-      assert.strictEqual(_.isMatch({a: 1}, item), true, 'treats primitives as empty');
-    });
-
-    function Prototest() {}
-    Prototest.prototype.x = 1;
-    var specObj = new Prototest;
-    assert.equal(_.isMatch({x: 2}, specObj), true, 'spec is restricted to own properties');
-
-    specObj.y = 5;
-    assert.equal(_.isMatch({x: 1, y: 5}, specObj), true);
-    assert.equal(_.isMatch({x: 1, y: 4}, specObj), false);
-
-    assert.ok(_.isMatch(specObj, {x: 1, y: 5}), 'inherited and own properties are checked on the test object');
-
-    Prototest.x = 5;
-    assert.ok(_.isMatch({x: 5, y: 1}, Prototest), 'spec can be a function');
-
-    //null edge cases
-    var oCon = {constructor: Object};
-    assert.deepEqual(_.map([null, void 0, 5, {}], _.partial(_.isMatch, _, oCon)), [false, false, false, true], 'doesnt falsey match constructor on undefined/null');
-  });
-
-  QUnit.test('matcher', function(assert) {
-    var moe = {name: 'Moe Howard', hair: true};
-    var curly = {name: 'Curly Howard', hair: false};
-    var stooges = [moe, curly];
-
-    assert.equal(_.matcher({hair: true})(moe), true, 'Returns a boolean');
-    assert.equal(_.matcher({hair: true})(curly), false, 'Returns a boolean');
-
-    assert.equal(_.matcher({__x__: void 0})(5), false, 'can match undefined props on primitives');
-    assert.equal(_.matcher({__x__: void 0})({__x__: void 0}), true, 'can match undefined props');
-
-    assert.equal(_.matcher({})(null), true, 'Empty spec called with null object returns true');
-    assert.equal(_.matcher({a: 1})(null), false, 'Non-empty spec called with null object returns false');
-
-    assert.ok(_.find(stooges, _.matcher({hair: false})) === curly, 'returns a predicate that can be used by finding functions.');
-    assert.ok(_.find(stooges, _.matcher(moe)) === moe, 'can be used to locate an object exists in a collection.');
-    assert.deepEqual(_.filter([null, void 0], _.matcher({a: 1})), [], 'Do not throw on null values.');
-
-    assert.deepEqual(_.filter([null, void 0], _.matcher(null)), [null, void 0], 'null matches null');
-    assert.deepEqual(_.filter([null, void 0], _.matcher({})), [null, void 0], 'null matches {}');
-    assert.deepEqual(_.filter([{b: 1}], _.matcher({a: void 0})), [], 'handles undefined values (1683)');
-
-    _.each([true, 5, NaN, null, void 0], function(item) {
-      assert.equal(_.matcher(item)({a: 1}), true, 'treats primitives as empty');
-    });
-
-    function Prototest() {}
-    Prototest.prototype.x = 1;
-    var specObj = new Prototest;
-    var protospec = _.matcher(specObj);
-    assert.equal(protospec({x: 2}), true, 'spec is restricted to own properties');
-
-    specObj.y = 5;
-    protospec = _.matcher(specObj);
-    assert.equal(protospec({x: 1, y: 5}), true);
-    assert.equal(protospec({x: 1, y: 4}), false);
-
-    assert.ok(_.matcher({x: 1, y: 5})(specObj), 'inherited and own properties are checked on the test object');
-
-    Prototest.x = 5;
-    assert.ok(_.matcher(Prototest)({x: 5, y: 1}), 'spec can be a function');
-
-    // #1729
-    var o = {b: 1};
-    var m = _.matcher(o);
-
-    assert.equal(m({b: 1}), true);
-    o.b = 2;
-    o.a = 1;
-    assert.equal(m({b: 1}), true, 'changing spec object doesnt change matches result');
-
-
-    //null edge cases
-    var oCon = _.matcher({constructor: Object});
-    assert.deepEqual(_.map([null, void 0, 5, {}], oCon), [false, false, false, true], 'doesnt falsey match constructor on undefined/null');
-  });
-
-  QUnit.test('matches', function(assert) {
-    assert.strictEqual(_.matches, _.matcher, 'is an alias for matcher');
-  });
-
-  QUnit.test('findKey', function(assert) {
-    var objects = {
-      a: {a: 0, b: 0},
-      b: {a: 1, b: 1},
-      c: {a: 2, b: 2}
-    };
-
-    assert.equal(_.findKey(objects, function(obj) {
-      return obj.a === 0;
-    }), 'a');
-
-    assert.equal(_.findKey(objects, function(obj) {
-      return obj.b * obj.a === 4;
-    }), 'c');
-
-    assert.equal(_.findKey(objects, 'a'), 'b', 'Uses lookupIterator');
-
-    assert.equal(_.findKey(objects, function(obj) {
-      return obj.b * obj.a === 5;
-    }), void 0);
-
-    assert.strictEqual(_.findKey([1, 2, 3, 4, 5, 6], function(obj) {
-      return obj === 3;
-    }), '2', 'Keys are strings');
-
-    assert.strictEqual(_.findKey(objects, function(a) {
-      return a.foo === null;
-    }), void 0);
-
-    _.findKey({a: {a: 1}}, function(a, key, obj) {
-      assert.equal(key, 'a');
-      assert.deepEqual(obj, {a: {a: 1}});
-      assert.strictEqual(this, objects, 'called with context');
-    }, objects);
-
-    var array = [1, 2, 3, 4];
-    array.match = 55;
-    assert.strictEqual(_.findKey(array, function(x) { return x === 55; }), 'match', 'matches array-likes keys');
-  });
-
-
-  QUnit.test('mapObject', function(assert) {
-    var obj = {a: 1, b: 2};
-    var objects = {
-      a: {a: 0, b: 0},
-      b: {a: 1, b: 1},
-      c: {a: 2, b: 2}
-    };
-
-    assert.deepEqual(_.mapObject(obj, function(val) {
-      return val * 2;
-    }), {a: 2, b: 4}, 'simple objects');
-
-    assert.deepEqual(_.mapObject(objects, function(val) {
-      return _.reduce(val, function(memo, v){
-        return memo + v;
-      }, 0);
-    }), {a: 0, b: 2, c: 4}, 'nested objects');
-
-    assert.deepEqual(_.mapObject(obj, function(val, key, o) {
-      return o[key] * 2;
-    }), {a: 2, b: 4}, 'correct keys');
-
-    assert.deepEqual(_.mapObject([1, 2], function(val) {
-      return val * 2;
-    }), {0: 2, 1: 4}, 'check behavior for arrays');
-
-    assert.deepEqual(_.mapObject(obj, function(val) {
-      return val * this.multiplier;
-    }, {multiplier: 3}), {a: 3, b: 6}, 'keep context');
-
-    assert.deepEqual(_.mapObject({a: 1}, function() {
-      return this.length;
-    }, [1, 2]), {a: 2}, 'called with context');
-
-    var ids = _.mapObject({length: 2, 0: {id: '1'}, 1: {id: '2'}}, function(n){
-      return n.id;
-    });
-    assert.deepEqual(ids, {length: void 0, 0: '1', 1: '2'}, 'Check with array-like objects');
-
-    // Passing a property name like _.pluck.
-    var people = {a: {name: 'moe', age: 30}, b: {name: 'curly', age: 50}};
-    assert.deepEqual(_.mapObject(people, 'name'), {a: 'moe', b: 'curly'}, 'predicate string map to object properties');
-
-    _.each([null, void 0, 1, 'abc', [], {}, void 0], function(val){
-      assert.deepEqual(_.mapObject(val, _.identity), {}, 'mapValue identity');
-    });
-
-    var Proto = function(){ this.a = 1; };
-    Proto.prototype.b = 1;
-    var protoObj = new Proto();
-    assert.deepEqual(_.mapObject(protoObj, _.identity), {a: 1}, 'ignore inherited values from prototypes');
-
-  });
-}());
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/utility.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/utility.js
deleted file mode 100644
index fbd54df..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/test/utility.js
+++ /dev/null
@@ -1,420 +0,0 @@
-(function() {
-  var _ = typeof require == 'function' ? require('..') : window._;
-  var templateSettings;
-
-  QUnit.module('Utility', {
-
-    beforeEach: function() {
-      templateSettings = _.clone(_.templateSettings);
-    },
-
-    afterEach: function() {
-      _.templateSettings = templateSettings;
-    }
-
-  });
-
-  if (typeof this == 'object') {
-    QUnit.test('noConflict', function(assert) {
-      var underscore = _.noConflict();
-      assert.equal(underscore.identity(1), 1);
-      if (typeof require != 'function') {
-        assert.equal(this._, void 0, 'global underscore is removed');
-        this._ = underscore;
-      } else if (typeof global !== 'undefined') {
-        delete global._;
-      }
-    });
-  }
-
-  if (typeof require == 'function') {
-    QUnit.test('noConflict (node vm)', function(assert) {
-      assert.expect(2);
-      var done = assert.async();
-      var fs = require('fs');
-      var vm = require('vm');
-      var filename = __dirname + '/../underscore.js';
-      fs.readFile(filename, function(err, content){
-        var sandbox = vm.createScript(
-          content + 'this.underscore = this._.noConflict();',
-          filename
-        );
-        var context = {_: 'oldvalue'};
-        sandbox.runInNewContext(context);
-        assert.equal(context._, 'oldvalue');
-        assert.equal(context.underscore.VERSION, _.VERSION);
-
-        done();
-      });
-    });
-  }
-
-  QUnit.test('#750 - Return _ instance.', function(assert) {
-    assert.expect(2);
-    var instance = _([]);
-    assert.ok(_(instance) === instance);
-    assert.ok(new _(instance) === instance);
-  });
-
-  QUnit.test('identity', function(assert) {
-    var stooge = {name: 'moe'};
-    assert.equal(_.identity(stooge), stooge, 'stooge is the same as his identity');
-  });
-
-  QUnit.test('constant', function(assert) {
-    var stooge = {name: 'moe'};
-    assert.equal(_.constant(stooge)(), stooge, 'should create a function that returns stooge');
-  });
-
-  QUnit.test('noop', function(assert) {
-    assert.strictEqual(_.noop('curly', 'larry', 'moe'), void 0, 'should always return undefined');
-  });
-
-  QUnit.test('property', function(assert) {
-    var stooge = {name: 'moe'};
-    assert.equal(_.property('name')(stooge), 'moe', 'should return the property with the given name');
-    assert.equal(_.property('name')(null), void 0, 'should return undefined for null values');
-    assert.equal(_.property('name')(void 0), void 0, 'should return undefined for undefined values');
-  });
-
-  QUnit.test('propertyOf', function(assert) {
-    var stoogeRanks = _.propertyOf({curly: 2, moe: 1, larry: 3});
-    assert.equal(stoogeRanks('curly'), 2, 'should return the property with the given name');
-    assert.equal(stoogeRanks(null), void 0, 'should return undefined for null values');
-    assert.equal(stoogeRanks(void 0), void 0, 'should return undefined for undefined values');
-
-    function MoreStooges() { this.shemp = 87; }
-    MoreStooges.prototype = {curly: 2, moe: 1, larry: 3};
-    var moreStoogeRanks = _.propertyOf(new MoreStooges());
-    assert.equal(moreStoogeRanks('curly'), 2, 'should return properties from further up the prototype chain');
-
-    var nullPropertyOf = _.propertyOf(null);
-    assert.equal(nullPropertyOf('curly'), void 0, 'should return undefined when obj is null');
-
-    var undefPropertyOf = _.propertyOf(void 0);
-    assert.equal(undefPropertyOf('curly'), void 0, 'should return undefined when obj is undefined');
-  });
-
-  QUnit.test('random', function(assert) {
-    var array = _.range(1000);
-    var min = Math.pow(2, 31);
-    var max = Math.pow(2, 62);
-
-    assert.ok(_.every(array, function() {
-      return _.random(min, max) >= min;
-    }), 'should produce a random number greater than or equal to the minimum number');
-
-    assert.ok(_.some(array, function() {
-      return _.random(Number.MAX_VALUE) > 0;
-    }), 'should produce a random number when passed `Number.MAX_VALUE`');
-  });
-
-  QUnit.test('now', function(assert) {
-    var diff = _.now() - new Date().getTime();
-    assert.ok(diff <= 0 && diff > -5, 'Produces the correct time in milliseconds');//within 5ms
-  });
-
-  QUnit.test('uniqueId', function(assert) {
-    var ids = [], i = 0;
-    while (i++ < 100) ids.push(_.uniqueId());
-    assert.equal(_.uniq(ids).length, ids.length, 'can generate a globally-unique stream of ids');
-  });
-
-  QUnit.test('times', function(assert) {
-    var vals = [];
-    _.times(3, function(i) { vals.push(i); });
-    assert.deepEqual(vals, [0, 1, 2], 'is 0 indexed');
-    //
-    vals = [];
-    _(3).times(function(i) { vals.push(i); });
-    assert.deepEqual(vals, [0, 1, 2], 'works as a wrapper');
-    // collects return values
-    assert.deepEqual([0, 1, 2], _.times(3, function(i) { return i; }), 'collects return values');
-
-    assert.deepEqual(_.times(0, _.identity), []);
-    assert.deepEqual(_.times(-1, _.identity), []);
-    assert.deepEqual(_.times(parseFloat('-Infinity'), _.identity), []);
-  });
-
-  QUnit.test('mixin', function(assert) {
-    _.mixin({
-      myReverse: function(string) {
-        return string.split('').reverse().join('');
-      }
-    });
-    assert.equal(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _');
-    assert.equal(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper');
-  });
-
-  QUnit.test('_.escape', function(assert) {
-    assert.equal(_.escape(null), '');
-  });
-
-  QUnit.test('_.unescape', function(assert) {
-    var string = 'Curly & Moe';
-    assert.equal(_.unescape(null), '');
-    assert.equal(_.unescape(_.escape(string)), string);
-    assert.equal(_.unescape(string), string, 'don\'t unescape unnecessarily');
-  });
-
-  // Don't care what they escape them to just that they're escaped and can be unescaped
-  QUnit.test('_.escape & unescape', function(assert) {
-    // test & (&amp;) seperately obviously
-    var escapeCharacters = ['<', '>', '"', '\'', '`'];
-
-    _.each(escapeCharacters, function(escapeChar) {
-      var s = 'a ' + escapeChar + ' string escaped';
-      var e = _.escape(s);
-      assert.notEqual(s, e, escapeChar + ' is escaped');
-      assert.equal(s, _.unescape(e), escapeChar + ' can be unescaped');
-
-      s = 'a ' + escapeChar + escapeChar + escapeChar + 'some more string' + escapeChar;
-      e = _.escape(s);
-
-      assert.equal(e.indexOf(escapeChar), -1, 'can escape multiple occurances of ' + escapeChar);
-      assert.equal(_.unescape(e), s, 'multiple occurrences of ' + escapeChar + ' can be unescaped');
-    });
-
-    // handles multiple escape characters at once
-    var joiner = ' other stuff ';
-    var allEscaped = escapeCharacters.join(joiner);
-    allEscaped += allEscaped;
-    assert.ok(_.every(escapeCharacters, function(escapeChar) {
-      return allEscaped.indexOf(escapeChar) !== -1;
-    }), 'handles multiple characters');
-    assert.ok(allEscaped.indexOf(joiner) >= 0, 'can escape multiple escape characters at the same time');
-
-    // test & -> &amp;
-    var str = 'some string & another string & yet another';
-    var escaped = _.escape(str);
-
-    assert.ok(escaped.indexOf('&') !== -1, 'handles & aka &amp;');
-    assert.equal(_.unescape(str), str, 'can unescape &amp;');
-  });
-
-  QUnit.test('template', function(assert) {
-    var basicTemplate = _.template("<%= thing %> is gettin' on my noives!");
-    var result = basicTemplate({thing: 'This'});
-    assert.equal(result, "This is gettin' on my noives!", 'can do basic attribute interpolation');
-
-    var sansSemicolonTemplate = _.template('A <% this %> B');
-    assert.equal(sansSemicolonTemplate(), 'A  B');
-
-    var backslashTemplate = _.template('<%= thing %> is \\ridanculous');
-    assert.equal(backslashTemplate({thing: 'This'}), 'This is \\ridanculous');
-
-    var escapeTemplate = _.template('<%= a ? "checked=\\"checked\\"" : "" %>');
-    assert.equal(escapeTemplate({a: true}), 'checked="checked"', 'can handle slash escapes in interpolations.');
-
-    var fancyTemplate = _.template('<ul><% ' +
-    '  for (var key in people) { ' +
-    '%><li><%= people[key] %></li><% } %></ul>');
-    result = fancyTemplate({people: {moe: 'Moe', larry: 'Larry', curly: 'Curly'}});
-    assert.equal(result, '<ul><li>Moe</li><li>Larry</li><li>Curly</li></ul>', 'can run arbitrary javascript in templates');
-
-    var escapedCharsInJavascriptTemplate = _.template('<ul><% _.each(numbers.split("\\n"), function(item) { %><li><%= item %></li><% }) %></ul>');
-    result = escapedCharsInJavascriptTemplate({numbers: 'one\ntwo\nthree\nfour'});
-    assert.equal(result, '<ul><li>one</li><li>two</li><li>three</li><li>four</li></ul>', 'Can use escaped characters (e.g. \\n) in JavaScript');
-
-    var namespaceCollisionTemplate = _.template('<%= pageCount %> <%= thumbnails[pageCount] %> <% _.each(thumbnails, function(p) { %><div class="thumbnail" rel="<%= p %>"></div><% }); %>');
-    result = namespaceCollisionTemplate({
-      pageCount: 3,
-      thumbnails: {
-        1: 'p1-thumbnail.gif',
-        2: 'p2-thumbnail.gif',
-        3: 'p3-thumbnail.gif'
-      }
-    });
-    assert.equal(result, '3 p3-thumbnail.gif <div class="thumbnail" rel="p1-thumbnail.gif"></div><div class="thumbnail" rel="p2-thumbnail.gif"></div><div class="thumbnail" rel="p3-thumbnail.gif"></div>');
-
-    var noInterpolateTemplate = _.template('<div><p>Just some text. Hey, I know this is silly but it aids consistency.</p></div>');
-    result = noInterpolateTemplate();
-    assert.equal(result, '<div><p>Just some text. Hey, I know this is silly but it aids consistency.</p></div>');
-
-    var quoteTemplate = _.template("It's its, not it's");
-    assert.equal(quoteTemplate({}), "It's its, not it's");
-
-    var quoteInStatementAndBody = _.template('<% ' +
-    "  if(foo == 'bar'){ " +
-    "%>Statement quotes and 'quotes'.<% } %>");
-    assert.equal(quoteInStatementAndBody({foo: 'bar'}), "Statement quotes and 'quotes'.");
-
-    var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.');
-    assert.equal(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.');
-
-    var template = _.template('<i><%- value %></i>');
-    result = template({value: '<script>'});
-    assert.equal(result, '<i>&lt;script&gt;</i>');
-
-    var stooge = {
-      name: 'Moe',
-      template: _.template("I'm <%= this.name %>")
-    };
-    assert.equal(stooge.template(), "I'm Moe");
-
-    template = _.template('\n ' +
-    '  <%\n ' +
-    '  // a comment\n ' +
-    '  if (data) { data += 12345; }; %>\n ' +
-    '  <li><%= data %></li>\n '
-    );
-    assert.equal(template({data: 12345}).replace(/\s/g, ''), '<li>24690</li>');
-
-    _.templateSettings = {
-      evaluate: /\{\{([\s\S]+?)\}\}/g,
-      interpolate: /\{\{=([\s\S]+?)\}\}/g
-    };
-
-    var custom = _.template('<ul>{{ for (var key in people) { }}<li>{{= people[key] }}</li>{{ } }}</ul>');
-    result = custom({people: {moe: 'Moe', larry: 'Larry', curly: 'Curly'}});
-    assert.equal(result, '<ul><li>Moe</li><li>Larry</li><li>Curly</li></ul>', 'can run arbitrary javascript in templates');
-
-    var customQuote = _.template("It's its, not it's");
-    assert.equal(customQuote({}), "It's its, not it's");
-
-    quoteInStatementAndBody = _.template("{{ if(foo == 'bar'){ }}Statement quotes and 'quotes'.{{ } }}");
-    assert.equal(quoteInStatementAndBody({foo: 'bar'}), "Statement quotes and 'quotes'.");
-
-    _.templateSettings = {
-      evaluate: /<\?([\s\S]+?)\?>/g,
-      interpolate: /<\?=([\s\S]+?)\?>/g
-    };
-
-    var customWithSpecialChars = _.template('<ul><? for (var key in people) { ?><li><?= people[key] ?></li><? } ?></ul>');
-    result = customWithSpecialChars({people: {moe: 'Moe', larry: 'Larry', curly: 'Curly'}});
-    assert.equal(result, '<ul><li>Moe</li><li>Larry</li><li>Curly</li></ul>', 'can run arbitrary javascript in templates');
-
-    var customWithSpecialCharsQuote = _.template("It's its, not it's");
-    assert.equal(customWithSpecialCharsQuote({}), "It's its, not it's");
-
-    quoteInStatementAndBody = _.template("<? if(foo == 'bar'){ ?>Statement quotes and 'quotes'.<? } ?>");
-    assert.equal(quoteInStatementAndBody({foo: 'bar'}), "Statement quotes and 'quotes'.");
-
-    _.templateSettings = {
-      interpolate: /\{\{(.+?)\}\}/g
-    };
-
-    var mustache = _.template('Hello {{planet}}!');
-    assert.equal(mustache({planet: 'World'}), 'Hello World!', 'can mimic mustache.js');
-
-    var templateWithNull = _.template('a null undefined {{planet}}');
-    assert.equal(templateWithNull({planet: 'world'}), 'a null undefined world', 'can handle missing escape and evaluate settings');
-  });
-
-  QUnit.test('_.template provides the generated function source, when a SyntaxError occurs', function(assert) {
-    var source;
-    try {
-      _.template('<b><%= if x %></b>');
-    } catch (ex) {
-      source = ex.source;
-    }
-    assert.ok(/__p/.test(source));
-  });
-
-  QUnit.test('_.template handles \\u2028 & \\u2029', function(assert) {
-    var tmpl = _.template('<p>\u2028<%= "\\u2028\\u2029" %>\u2029</p>');
-    assert.strictEqual(tmpl(), '<p>\u2028\u2028\u2029\u2029</p>');
-  });
-
-  QUnit.test('result calls functions and returns primitives', function(assert) {
-    var obj = {w: '', x: 'x', y: function(){ return this.x; }};
-    assert.strictEqual(_.result(obj, 'w'), '');
-    assert.strictEqual(_.result(obj, 'x'), 'x');
-    assert.strictEqual(_.result(obj, 'y'), 'x');
-    assert.strictEqual(_.result(obj, 'z'), void 0);
-    assert.strictEqual(_.result(null, 'x'), void 0);
-  });
-
-  QUnit.test('result returns a default value if object is null or undefined', function(assert) {
-    assert.strictEqual(_.result(null, 'b', 'default'), 'default');
-    assert.strictEqual(_.result(void 0, 'c', 'default'), 'default');
-    assert.strictEqual(_.result(''.match('missing'), 1, 'default'), 'default');
-  });
-
-  QUnit.test('result returns a default value if property of object is missing', function(assert) {
-    assert.strictEqual(_.result({d: null}, 'd', 'default'), null);
-    assert.strictEqual(_.result({e: false}, 'e', 'default'), false);
-  });
-
-  QUnit.test('result only returns the default value if the object does not have the property or is undefined', function(assert) {
-    assert.strictEqual(_.result({}, 'b', 'default'), 'default');
-    assert.strictEqual(_.result({d: void 0}, 'd', 'default'), 'default');
-  });
-
-  QUnit.test('result does not return the default if the property of an object is found in the prototype', function(assert) {
-    var Foo = function(){};
-    Foo.prototype.bar = 1;
-    assert.strictEqual(_.result(new Foo, 'bar', 2), 1);
-  });
-
-  QUnit.test('result does use the fallback when the result of invoking the property is undefined', function(assert) {
-    var obj = {a: function() {}};
-    assert.strictEqual(_.result(obj, 'a', 'failed'), void 0);
-  });
-
-  QUnit.test('result fallback can use a function', function(assert) {
-    var obj = {a: [1, 2, 3]};
-    assert.strictEqual(_.result(obj, 'b', _.constant(5)), 5);
-    assert.strictEqual(_.result(obj, 'b', function() {
-      return this.a;
-    }), obj.a, 'called with context');
-  });
-
-  QUnit.test('_.templateSettings.variable', function(assert) {
-    var s = '<%=data.x%>';
-    var data = {x: 'x'};
-    var tmp = _.template(s, {variable: 'data'});
-    assert.strictEqual(tmp(data), 'x');
-    _.templateSettings.variable = 'data';
-    assert.strictEqual(_.template(s)(data), 'x');
-  });
-
-  QUnit.test('#547 - _.templateSettings is unchanged by custom settings.', function(assert) {
-    assert.ok(!_.templateSettings.variable);
-    _.template('', {}, {variable: 'x'});
-    assert.ok(!_.templateSettings.variable);
-  });
-
-  QUnit.test('#556 - undefined template variables.', function(assert) {
-    var template = _.template('<%=x%>');
-    assert.strictEqual(template({x: null}), '');
-    assert.strictEqual(template({x: void 0}), '');
-
-    var templateEscaped = _.template('<%-x%>');
-    assert.strictEqual(templateEscaped({x: null}), '');
-    assert.strictEqual(templateEscaped({x: void 0}), '');
-
-    var templateWithProperty = _.template('<%=x.foo%>');
-    assert.strictEqual(templateWithProperty({x: {}}), '');
-    assert.strictEqual(templateWithProperty({x: {}}), '');
-
-    var templateWithPropertyEscaped = _.template('<%-x.foo%>');
-    assert.strictEqual(templateWithPropertyEscaped({x: {}}), '');
-    assert.strictEqual(templateWithPropertyEscaped({x: {}}), '');
-  });
-
-  QUnit.test('interpolate evaluates code only once.', function(assert) {
-    assert.expect(2);
-    var count = 0;
-    var template = _.template('<%= f() %>');
-    template({f: function(){ assert.ok(!count++); }});
-
-    var countEscaped = 0;
-    var templateEscaped = _.template('<%- f() %>');
-    templateEscaped({f: function(){ assert.ok(!countEscaped++); }});
-  });
-
-  QUnit.test('#746 - _.template settings are not modified.', function(assert) {
-    assert.expect(1);
-    var settings = {};
-    _.template('', null, settings);
-    assert.deepEqual(settings, {});
-  });
-
-  QUnit.test('#779 - delimeters are applied to unescaped text.', function(assert) {
-    assert.expect(1);
-    var template = _.template('<<\nx\n>>', null, {evaluate: /<<(.*?)>>/g});
-    assert.strictEqual(template(), '<<\nx\n>>');
-  });
-
-}());
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/underscore-min.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/underscore-min.js
deleted file mode 100644
index f01025b..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/underscore-min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-//     Underscore.js 1.8.3
-//     http://underscorejs.org
-//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-//     Underscore may be freely distributed under the MIT license.
-(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);if("number"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m,m.VERSION="1.8.3";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){return null==t?void 0:t[n]}},A=Math.pow(2,53)-1,O=w("length"),k=function(n){var t=O(n);return"number"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)},m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),("number"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=k(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(k(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=x(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=x(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=F(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=F(function(n,t,r){n[r]=t}),m.countBy=F(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):k(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:k(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=x(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var S=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=O(n);a>o;o++){var c=n[o];if(k(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=S(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return S(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=x(r,e));for(var u=[],i=[],o=0,a=O(n);a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(S(arguments,!0,!0))},m.intersection=function(n){for(var t=[],r=arguments.length,e=0,u=O(n);u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=S(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,O).length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=O(n);u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=x(r,e,1);for(var u=r(t),i=0,o=O(n);o>i;){var a=Math.floor((i+o)/2);r(n[a])<u?i=a+1:o=a}return i},m.indexOf=r(1,m.findIndex,m.sortedIndex),m.lastIndexOf=r(-1,m.findLastIndex),m.range=function(n,t,r){null==t&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var E=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=j(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(g&&n.bind===g)return g.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return E(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e<arguments.length;)i.push(arguments[e++]);return E(n,r,this,this,i)};return r},m.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(v)return v(n);var t=[];for(var r in n)m.has(n,r)&&t.push(r);return M&&e(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var r in n)t.push(r);return M&&e(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=_(m.allKeys),m.extendOwn=m.assign=_(m.keys),m.findKey=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=b(t,r)):(u=S(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(S(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=_(m.allKeys,!0),m.create=function(n,t){var r=j(n);return t&&m.extendOwn(r,t),r},m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var N=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=s.call(n);if(u!==s.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!N(n[c],t[c],r,e))return!1}else{var f,l=m.keys(n);if(c=l.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=l[c],!m.has(t,f)||!N(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return N(n,t)},m.isEmpty=function(n){return null==n?!0:k(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=h||function(n){return"[object Array]"===s.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return s.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===s.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&p.call(n,t)},m.noConflict=function(){return u._=i,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=w,m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=b(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},T=m.invert(B),R=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=R(B),m.unescape=R(T),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var q=0;m.uniqueId=function(n){var t=++q+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var P=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return f.apply(n,arguments),P(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=o[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],P(this,r)}}),m.each(["concat","join","slice"],function(n){var t=o[n];m.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this);
-//# sourceMappingURL=underscore-min.map
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/underscore.js b/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/underscore.js
deleted file mode 100644
index bddfdc9..0000000
--- a/views/ngXosViews/serviceGrid/src/vendor/lodash/vendor/underscore/underscore.js
+++ /dev/null
@@ -1,1620 +0,0 @@
-//     Underscore.js 1.8.3
-//     http://underscorejs.org
-//     (c) 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-//     Underscore may be freely distributed under the MIT license.
-
-(function() {
-
-  // Baseline setup
-  // --------------
-
-  // Establish the root object, `window` (`self`) in the browser, `global`
-  // on the server, or `this` in some virtual machines. We use `self`
-  // instead of `window` for `WebWorker` support.
-  var root = typeof self == 'object' && self.self === self && self ||
-            typeof global == 'object' && global.global === global && global ||
-            this;
-
-  // Save the previous value of the `_` variable.
-  var previousUnderscore = root._;
-
-  // Save bytes in the minified (but not gzipped) version:
-  var ArrayProto = Array.prototype, ObjProto = Object.prototype;
-  var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
-
-  // Create quick reference variables for speed access to core prototypes.
-  var push = ArrayProto.push,
-      slice = ArrayProto.slice,
-      toString = ObjProto.toString,
-      hasOwnProperty = ObjProto.hasOwnProperty;
-
-  // All **ECMAScript 5** native function implementations that we hope to use
-  // are declared here.
-  var nativeIsArray = Array.isArray,
-      nativeKeys = Object.keys,
-      nativeCreate = Object.create;
-
-  // Naked function reference for surrogate-prototype-swapping.
-  var Ctor = function(){};
-
-  // Create a safe reference to the Underscore object for use below.
-  var _ = function(obj) {
-    if (obj instanceof _) return obj;
-    if (!(this instanceof _)) return new _(obj);
-    this._wrapped = obj;
-  };
-
-  // Export the Underscore object for **Node.js**, with
-  // backwards-compatibility for their old module API. If we're in
-  // the browser, add `_` as a global object.
-  // (`nodeType` is checked to ensure that `module`
-  // and `exports` are not HTML elements.)
-  if (typeof exports != 'undefined' && !exports.nodeType) {
-    if (typeof module != 'undefined' && !module.nodeType && module.exports) {
-      exports = module.exports = _;
-    }
-    exports._ = _;
-  } else {
-    root._ = _;
-  }
-
-  // Current version.
-  _.VERSION = '1.8.3';
-
-  // Internal function that returns an efficient (for current engines) version
-  // of the passed-in callback, to be repeatedly applied in other Underscore
-  // functions.
-  var optimizeCb = function(func, context, argCount) {
-    if (context === void 0) return func;
-    switch (argCount == null ? 3 : argCount) {
-      case 1: return function(value) {
-        return func.call(context, value);
-      };
-      // The 2-parameter case has been omitted only because no current consumers
-      // made use of it.
-      case 3: return function(value, index, collection) {
-        return func.call(context, value, index, collection);
-      };
-      case 4: return function(accumulator, value, index, collection) {
-        return func.call(context, accumulator, value, index, collection);
-      };
-    }
-    return function() {
-      return func.apply(context, arguments);
-    };
-  };
-
-  // An internal function to generate callbacks that can be applied to each
-  // element in a collection, returning the desired result — either `identity`,
-  // an arbitrary callback, a property matcher, or a property accessor.
-  var cb = function(value, context, argCount) {
-    if (value == null) return _.identity;
-    if (_.isFunction(value)) return optimizeCb(value, context, argCount);
-    if (_.isObject(value)) return _.matcher(value);
-    return _.property(value);
-  };
-
-  // An external wrapper for the internal callback generator.
-  _.iteratee = function(value, context) {
-    return cb(value, context, Infinity);
-  };
-
-  // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
-  // This accumulates the arguments passed into an array, after a given index.
-  var restArgs = function(func, startIndex) {
-    startIndex = startIndex == null ? func.length - 1 : +startIndex;
-    return function() {
-      var length = Math.max(arguments.length - startIndex, 0);
-      var rest = Array(length);
-      for (var index = 0; index < length; index++) {
-        rest[index] = arguments[index + startIndex];
-      }
-      switch (startIndex) {
-        case 0: return func.call(this, rest);
-        case 1: return func.call(this, arguments[0], rest);
-        case 2: return func.call(this, arguments[0], arguments[1], rest);
-      }
-      var args = Array(startIndex + 1);
-      for (index = 0; index < startIndex; index++) {
-        args[index] = arguments[index];
-      }
-      args[startIndex] = rest;
-      return func.apply(this, args);
-    };
-  };
-
-  // An internal function for creating a new object that inherits from another.
-  var baseCreate = function(prototype) {
-    if (!_.isObject(prototype)) return {};
-    if (nativeCreate) return nativeCreate(prototype);
-    Ctor.prototype = prototype;
-    var result = new Ctor;
-    Ctor.prototype = null;
-    return result;
-  };
-
-  var property = function(key) {
-    return function(obj) {
-      return obj == null ? void 0 : obj[key];
-    };
-  };
-
-  // Helper for collection methods to determine whether a collection
-  // should be iterated as an array or as an object.
-  // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
-  // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
-  var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
-  var getLength = property('length');
-  var isArrayLike = function(collection) {
-    var length = getLength(collection);
-    return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
-  };
-
-  // Collection Functions
-  // --------------------
-
-  // The cornerstone, an `each` implementation, aka `forEach`.
-  // Handles raw objects in addition to array-likes. Treats all
-  // sparse array-likes as if they were dense.
-  _.each = _.forEach = function(obj, iteratee, context) {
-    iteratee = optimizeCb(iteratee, context);
-    var i, length;
-    if (isArrayLike(obj)) {
-      for (i = 0, length = obj.length; i < length; i++) {
-        iteratee(obj[i], i, obj);
-      }
-    } else {
-      var keys = _.keys(obj);
-      for (i = 0, length = keys.length; i < length; i++) {
-        iteratee(obj[keys[i]], keys[i], obj);
-      }
-    }
-    return obj;
-  };
-
-  // Return the results of applying the iteratee to each element.
-  _.map = _.collect = function(obj, iteratee, context) {
-    iteratee = cb(iteratee, context);
-    var keys = !isArrayLike(obj) && _.keys(obj),
-        length = (keys || obj).length,
-        results = Array(length);
-    for (var index = 0; index < length; index++) {
-      var currentKey = keys ? keys[index] : index;
-      results[index] = iteratee(obj[currentKey], currentKey, obj);
-    }
-    return results;
-  };
-
-  // Create a reducing function iterating left or right.
-  var createReduce = function(dir) {
-    // Wrap code that reassigns argument variables in a separate function than
-    // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
-    var reducer = function(obj, iteratee, memo, initial) {
-      var keys = !isArrayLike(obj) && _.keys(obj),
-          length = (keys || obj).length,
-          index = dir > 0 ? 0 : length - 1;
-      if (!initial) {
-        memo = obj[keys ? keys[index] : index];
-        index += dir;
-      }
-      for (; index >= 0 && index < length; index += dir) {
-        var currentKey = keys ? keys[index] : index;
-        memo = iteratee(memo, obj[currentKey], currentKey, obj);
-      }
-      return memo;
-    };
-
-    return function(obj, iteratee, memo, context) {
-      var initial = arguments.length >= 3;
-      return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);
-    };
-  };
-
-  // **Reduce** builds up a single result from a list of values, aka `inject`,
-  // or `foldl`.
-  _.reduce = _.foldl = _.inject = createReduce(1);
-
-  // The right-associative version of reduce, also known as `foldr`.
-  _.reduceRight = _.foldr = createReduce(-1);
-
-  // Return the first value which passes a truth test. Aliased as `detect`.
-  _.find = _.detect = function(obj, predicate, context) {
-    var keyFinder = isArrayLike(obj) ? _.findIndex : _.findKey;
-    var key = keyFinder(obj, predicate, context);
-    if (key !== void 0 && key !== -1) return obj[key];
-  };
-
-  // Return all the elements that pass a truth test.
-  // Aliased as `select`.
-  _.filter = _.select = function(obj, predicate, context) {
-    var results = [];
-    predicate = cb(predicate, context);
-    _.each(obj, function(value, index, list) {
-      if (predicate(value, index, list)) results.push(value);
-    });
-    return results;
-  };
-
-  // Return all the elements for which a truth test fails.
-  _.reject = function(obj, predicate, context) {
-    return _.filter(obj, _.negate(cb(predicate)), context);
-  };
-
-  // Determine whether all of the elements match a truth test.
-  // Aliased as `all`.
-  _.every = _.all = function(obj, predicate, context) {
-    predicate = cb(predicate, context);
-    var keys = !isArrayLike(obj) && _.keys(obj),
-        length = (keys || obj).length;
-    for (var index = 0; index < length; index++) {
-      var currentKey = keys ? keys[index] : index;
-      if (!predicate(obj[currentKey], currentKey, obj)) return false;
-    }
-    return true;
-  };
-
-  // Determine if at least one element in the object matches a truth test.
-  // Aliased as `any`.
-  _.some = _.any = function(obj, predicate, context) {
-    predicate = cb(predicate, context);
-    var keys = !isArrayLike(obj) && _.keys(obj),
-        length = (keys || obj).length;
-    for (var index = 0; index < length; index++) {
-      var currentKey = keys ? keys[index] : index;
-      if (predicate(obj[currentKey], currentKey, obj)) return true;
-    }
-    return false;
-  };
-
-  // Determine if the array or object contains a given item (using `===`).
-  // Aliased as `includes` and `include`.
-  _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {
-    if (!isArrayLike(obj)) obj = _.values(obj);
-    if (typeof fromIndex != 'number' || guard) fromIndex = 0;
-    return _.indexOf(obj, item, fromIndex) >= 0;
-  };
-
-  // Invoke a method (with arguments) on every item in a collection.
-  _.invoke = restArgs(function(obj, method, args) {
-    var isFunc = _.isFunction(method);
-    return _.map(obj, function(value) {
-      var func = isFunc ? method : value[method];
-      return func == null ? func : func.apply(value, args);
-    });
-  });
-
-  // Convenience version of a common use case of `map`: fetching a property.
-  _.pluck = function(obj, key) {
-    return _.map(obj, _.property(key));
-  };
-
-  // Convenience version of a common use case of `filter`: selecting only objects
-  // containing specific `key:value` pairs.
-  _.where = function(obj, attrs) {
-    return _.filter(obj, _.matcher(attrs));
-  };
-
-  // Convenience version of a common use case of `find`: getting the first object
-  // containing specific `key:value` pairs.
-  _.findWhere = function(obj, attrs) {
-    return _.find(obj, _.matcher(attrs));
-  };
-
-  // Return the maximum element (or element-based computation).
-  _.max = function(obj, iteratee, context) {
-    var result = -Infinity, lastComputed = -Infinity,
-        value, computed;
-    if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object') && obj != null) {
-      obj = isArrayLike(obj) ? obj : _.values(obj);
-      for (var i = 0, length = obj.length; i < length; i++) {
-        value = obj[i];
-        if (value != null && value > result) {
-          result = value;
-        }
-      }
-    } else {
-      iteratee = cb(iteratee, context);
-      _.each(obj, function(v, index, list) {
-        computed = iteratee(v, index, list);
-        if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
-          result = v;
-          lastComputed = computed;
-        }
-      });
-    }
-    return result;
-  };
-
-  // Return the minimum element (or element-based computation).
-  _.min = function(obj, iteratee, context) {
-    var result = Infinity, lastComputed = Infinity,
-        value, computed;
-    if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object') && obj != null) {
-      obj = isArrayLike(obj) ? obj : _.values(obj);
-      for (var i = 0, length = obj.length; i < length; i++) {
-        value = obj[i];
-        if (value != null && value < result) {
-          result = value;
-        }
-      }
-    } else {
-      iteratee = cb(iteratee, context);
-      _.each(obj, function(v, index, list) {
-        computed = iteratee(v, index, list);
-        if (computed < lastComputed || computed === Infinity && result === Infinity) {
-          result = v;
-          lastComputed = computed;
-        }
-      });
-    }
-    return result;
-  };
-
-  // Shuffle a collection.
-  _.shuffle = function(obj) {
-    return _.sample(obj, Infinity);
-  };
-
-  // Sample **n** random values from a collection using the modern version of the
-  // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
-  // If **n** is not specified, returns a single random element.
-  // The internal `guard` argument allows it to work with `map`.
-  _.sample = function(obj, n, guard) {
-    if (n == null || guard) {
-      if (!isArrayLike(obj)) obj = _.values(obj);
-      return obj[_.random(obj.length - 1)];
-    }
-    var sample = isArrayLike(obj) ? _.clone(obj) : _.values(obj);
-    var length = getLength(sample);
-    n = Math.max(Math.min(n, length), 0);
-    var last = length - 1;
-    for (var index = 0; index < n; index++) {
-      var rand = _.random(index, last);
-      var temp = sample[index];
-      sample[index] = sample[rand];
-      sample[rand] = temp;
-    }
-    return sample.slice(0, n);
-  };
-
-  // Sort the object's values by a criterion produced by an iteratee.
-  _.sortBy = function(obj, iteratee, context) {
-    var index = 0;
-    iteratee = cb(iteratee, context);
-    return _.pluck(_.map(obj, function(value, key, list) {
-      return {
-        value: value,
-        index: index++,
-        criteria: iteratee(value, key, list)
-      };
-    }).sort(function(left, right) {
-      var a = left.criteria;
-      var b = right.criteria;
-      if (a !== b) {
-        if (a > b || a === void 0) return 1;
-        if (a < b || b === void 0) return -1;
-      }
-      return left.index - right.index;
-    }), 'value');
-  };
-
-  // An internal function used for aggregate "group by" operations.
-  var group = function(behavior, partition) {
-    return function(obj, iteratee, context) {
-      var result = partition ? [[], []] : {};
-      iteratee = cb(iteratee, context);
-      _.each(obj, function(value, index) {
-        var key = iteratee(value, index, obj);
-        behavior(result, value, key);
-      });
-      return result;
-    };
-  };
-
-  // Groups the object's values by a criterion. Pass either a string attribute
-  // to group by, or a function that returns the criterion.
-  _.groupBy = group(function(result, value, key) {
-    if (_.has(result, key)) result[key].push(value); else result[key] = [value];
-  });
-
-  // Indexes the object's values by a criterion, similar to `groupBy`, but for
-  // when you know that your index values will be unique.
-  _.indexBy = group(function(result, value, key) {
-    result[key] = value;
-  });
-
-  // Counts instances of an object that group by a certain criterion. Pass
-  // either a string attribute to count by, or a function that returns the
-  // criterion.
-  _.countBy = group(function(result, value, key) {
-    if (_.has(result, key)) result[key]++; else result[key] = 1;
-  });
-
-  var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
-  // Safely create a real, live array from anything iterable.
-  _.toArray = function(obj) {
-    if (!obj) return [];
-    if (_.isArray(obj)) return slice.call(obj);
-    if (_.isString(obj)) {
-      // Keep surrogate pair characters together
-      return obj.match(reStrSymbol);
-    }
-    if (isArrayLike(obj)) return _.map(obj);
-    return _.values(obj);
-  };
-
-  // Return the number of elements in an object.
-  _.size = function(obj) {
-    if (obj == null) return 0;
-    return isArrayLike(obj) ? obj.length : _.keys(obj).length;
-  };
-
-  // Split a collection into two arrays: one whose elements all satisfy the given
-  // predicate, and one whose elements all do not satisfy the predicate.
-  _.partition = group(function(result, value, pass) {
-    result[pass ? 0 : 1].push(value);
-  }, true);
-
-  // Array Functions
-  // ---------------
-
-  // Get the first element of an array. Passing **n** will return the first N
-  // values in the array. Aliased as `head` and `take`. The **guard** check
-  // allows it to work with `_.map`.
-  _.first = _.head = _.take = function(array, n, guard) {
-    if (array == null) return void 0;
-    if (n == null || guard) return array[0];
-    return _.initial(array, array.length - n);
-  };
-
-  // Returns everything but the last entry of the array. Especially useful on
-  // the arguments object. Passing **n** will return all the values in
-  // the array, excluding the last N.
-  _.initial = function(array, n, guard) {
-    return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
-  };
-
-  // Get the last element of an array. Passing **n** will return the last N
-  // values in the array.
-  _.last = function(array, n, guard) {
-    if (array == null) return void 0;
-    if (n == null || guard) return array[array.length - 1];
-    return _.rest(array, Math.max(0, array.length - n));
-  };
-
-  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
-  // Especially useful on the arguments object. Passing an **n** will return
-  // the rest N values in the array.
-  _.rest = _.tail = _.drop = function(array, n, guard) {
-    return slice.call(array, n == null || guard ? 1 : n);
-  };
-
-  // Trim out all falsy values from an array.
-  _.compact = function(array) {
-    return _.filter(array);
-  };
-
-  // Internal implementation of a recursive `flatten` function.
-  var flatten = function(input, shallow, strict, output) {
-    output = output || [];
-    var idx = output.length;
-    for (var i = 0, length = getLength(input); i < length; i++) {
-      var value = input[i];
-      if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
-        // Flatten current level of array or arguments object.
-        if (shallow) {
-          var j = 0, len = value.length;
-          while (j < len) output[idx++] = value[j++];
-        } else {
-          flatten(value, shallow, strict, output);
-          idx = output.length;
-        }
-      } else if (!strict) {
-        output[idx++] = value;
-      }
-    }
-    return output;
-  };
-
-  // Flatten out an array, either recursively (by default), or just one level.
-  _.flatten = function(array, shallow) {
-    return flatten(array, shallow, false);
-  };
-
-  // Return a version of the array that does not contain the specified value(s).
-  _.without = restArgs(function(array, otherArrays) {
-    return _.difference(array, otherArrays);
-  });
-
-  // Produce a duplicate-free version of the array. If the array has already
-  // been sorted, you have the option of using a faster algorithm.
-  // Aliased as `unique`.
-  _.uniq = _.unique = function(array, isSorted, iteratee, context) {
-    if (!_.isBoolean(isSorted)) {
-      context = iteratee;
-      iteratee = isSorted;
-      isSorted = false;
-    }
-    if (iteratee != null) iteratee = cb(iteratee, context);
-    var result = [];
-    var seen = [];
-    for (var i = 0, length = getLength(array); i < length; i++) {
-      var value = array[i],
-          computed = iteratee ? iteratee(value, i, array) : value;
-      if (isSorted) {
-        if (!i || seen !== computed) result.push(value);
-        seen = computed;
-      } else if (iteratee) {
-        if (!_.contains(seen, computed)) {
-          seen.push(computed);
-          result.push(value);
-        }
-      } else if (!_.contains(result, value)) {
-        result.push(value);
-      }
-    }
-    return result;
-  };
-
-  // Produce an array that contains the union: each distinct element from all of
-  // the passed-in arrays.
-  _.union = restArgs(function(arrays) {
-    return _.uniq(flatten(arrays, true, true));
-  });
-
-  // Produce an array that contains every item shared between all the
-  // passed-in arrays.
-  _.intersection = function(array) {
-    var result = [];
-    var argsLength = arguments.length;
-    for (var i = 0, length = getLength(array); i < length; i++) {
-      var item = array[i];
-      if (_.contains(result, item)) continue;
-      var j;
-      for (j = 1; j < argsLength; j++) {
-        if (!_.contains(arguments[j], item)) break;
-      }
-      if (j === argsLength) result.push(item);
-    }
-    return result;
-  };
-
-  // Take the difference between one array and a number of other arrays.
-  // Only the elements present in just the first array will remain.
-  _.difference = restArgs(function(array, rest) {
-    rest = flatten(rest, true, true);
-    return _.filter(array, function(value){
-      return !_.contains(rest, value);
-    });
-  });
-
-  // Complement of _.zip. Unzip accepts an array of arrays and groups
-  // each array's elements on shared indices.
-  _.unzip = function(array) {
-    var length = array && _.max(array, getLength).length || 0;
-    var result = Array(length);
-
-    for (var index = 0; index < length; index++) {
-      result[index] = _.pluck(array, index);
-    }
-    return result;
-  };
-
-  // Zip together multiple lists into a single array -- elements that share
-  // an index go together.
-  _.zip = restArgs(_.unzip);
-
-  // Converts lists into objects. Pass either a single array of `[key, value]`
-  // pairs, or two parallel arrays of the same length -- one of keys, and one of
-  // the corresponding values.
-  _.object = function(list, values) {
-    var result = {};
-    for (var i = 0, length = getLength(list); i < length; i++) {
-      if (values) {
-        result[list[i]] = values[i];
-      } else {
-        result[list[i][0]] = list[i][1];
-      }
-    }
-    return result;
-  };
-
-  // Generator function to create the findIndex and findLastIndex functions.
-  var createPredicateIndexFinder = function(dir) {
-    return function(array, predicate, context) {
-      predicate = cb(predicate, context);
-      var length = getLength(array);
-      var index = dir > 0 ? 0 : length - 1;
-      for (; index >= 0 && index < length; index += dir) {
-        if (predicate(array[index], index, array)) return index;
-      }
-      return -1;
-    };
-  };
-
-  // Returns the first index on an array-like that passes a predicate test.
-  _.findIndex = createPredicateIndexFinder(1);
-  _.findLastIndex = createPredicateIndexFinder(-1);
-
-  // Use a comparator function to figure out the smallest index at which
-  // an object should be inserted so as to maintain order. Uses binary search.
-  _.sortedIndex = function(array, obj, iteratee, context) {
-    iteratee = cb(iteratee, context, 1);
-    var value = iteratee(obj);
-    var low = 0, high = getLength(array);
-    while (low < high) {
-      var mid = Math.floor((low + high) / 2);
-      if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
-    }
-    return low;
-  };
-
-  // Generator function to create the indexOf and lastIndexOf functions.
-  var createIndexFinder = function(dir, predicateFind, sortedIndex) {
-    return function(array, item, idx) {
-      var i = 0, length = getLength(array);
-      if (typeof idx == 'number') {
-        if (dir > 0) {
-          i = idx >= 0 ? idx : Math.max(idx + length, i);
-        } else {
-          length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
-        }
-      } else if (sortedIndex && idx && length) {
-        idx = sortedIndex(array, item);
-        return array[idx] === item ? idx : -1;
-      }
-      if (item !== item) {
-        idx = predicateFind(slice.call(array, i, length), _.isNaN);
-        return idx >= 0 ? idx + i : -1;
-      }
-      for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
-        if (array[idx] === item) return idx;
-      }
-      return -1;
-    };
-  };
-
-  // Return the position of the first occurrence of an item in an array,
-  // or -1 if the item is not included in the array.
-  // If the array is large and already in sort order, pass `true`
-  // for **isSorted** to use binary search.
-  _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);
-  _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);
-
-  // Generate an integer Array containing an arithmetic progression. A port of
-  // the native Python `range()` function. See
-  // [the Python documentation](http://docs.python.org/library/functions.html#range).
-  _.range = function(start, stop, step) {
-    if (stop == null) {
-      stop = start || 0;
-      start = 0;
-    }
-    if (!step) {
-      step = stop < start ? -1 : 1;
-    }
-
-    var length = Math.max(Math.ceil((stop - start) / step), 0);
-    var range = Array(length);
-
-    for (var idx = 0; idx < length; idx++, start += step) {
-      range[idx] = start;
-    }
-
-    return range;
-  };
-
-  // Split an **array** into several arrays containing **count** or less elements
-  // of initial array.
-  _.chunk = function(array, count) {
-    if (count == null || count < 1) return [];
-
-    var result = [];
-    var i = 0, length = array.length;
-    while (i < length) {
-      result.push(slice.call(array, i, i += count));
-    }
-    return result;
-  };
-
-  // Function (ahem) Functions
-  // ------------------
-
-  // Determines whether to execute a function as a constructor
-  // or a normal function with the provided arguments.
-  var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
-    if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
-    var self = baseCreate(sourceFunc.prototype);
-    var result = sourceFunc.apply(self, args);
-    if (_.isObject(result)) return result;
-    return self;
-  };
-
-  // Create a function bound to a given object (assigning `this`, and arguments,
-  // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
-  // available.
-  _.bind = restArgs(function(func, context, args) {
-    if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
-    var bound = restArgs(function(callArgs) {
-      return executeBound(func, bound, context, this, args.concat(callArgs));
-    });
-    return bound;
-  });
-
-  // Partially apply a function by creating a version that has had some of its
-  // arguments pre-filled, without changing its dynamic `this` context. _ acts
-  // as a placeholder by default, allowing any combination of arguments to be
-  // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
-  _.partial = restArgs(function(func, boundArgs) {
-    var placeholder = _.partial.placeholder;
-    var bound = function() {
-      var position = 0, length = boundArgs.length;
-      var args = Array(length);
-      for (var i = 0; i < length; i++) {
-        args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
-      }
-      while (position < arguments.length) args.push(arguments[position++]);
-      return executeBound(func, bound, this, this, args);
-    };
-    return bound;
-  });
-
-  _.partial.placeholder = _;
-
-  // Bind a number of an object's methods to that object. Remaining arguments
-  // are the method names to be bound. Useful for ensuring that all callbacks
-  // defined on an object belong to it.
-  _.bindAll = restArgs(function(obj, keys) {
-    keys = flatten(keys, false, false);
-    var index = keys.length;
-    if (index < 1) throw new Error('bindAll must be passed function names');
-    while (index--) {
-      var key = keys[index];
-      obj[key] = _.bind(obj[key], obj);
-    }
-  });
-
-  // Memoize an expensive function by storing its results.
-  _.memoize = function(func, hasher) {
-    var memoize = function(key) {
-      var cache = memoize.cache;
-      var address = '' + (hasher ? hasher.apply(this, arguments) : key);
-      if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
-      return cache[address];
-    };
-    memoize.cache = {};
-    return memoize;
-  };
-
-  // Delays a function for the given number of milliseconds, and then calls
-  // it with the arguments supplied.
-  _.delay = restArgs(function(func, wait, args) {
-    return setTimeout(function() {
-      return func.apply(null, args);
-    }, wait);
-  });
-
-  // Defers a function, scheduling it to run after the current call stack has
-  // cleared.
-  _.defer = _.partial(_.delay, _, 1);
-
-  // Returns a function, that, when invoked, will only be triggered at most once
-  // during a given window of time. Normally, the throttled function will run
-  // as much as it can, without ever going more than once per `wait` duration;
-  // but if you'd like to disable the execution on the leading edge, pass
-  // `{leading: false}`. To disable execution on the trailing edge, ditto.
-  _.throttle = function(func, wait, options) {
-    var timeout, context, args, result;
-    var previous = 0;
-    if (!options) options = {};
-
-    var later = function() {
-      previous = options.leading === false ? 0 : _.now();
-      timeout = null;
-      result = func.apply(context, args);
-      if (!timeout) context = args = null;
-    };
-
-    var throttled = function() {
-      var now = _.now();
-      if (!previous && options.leading === false) previous = now;
-      var remaining = wait - (now - previous);
-      context = this;
-      args = arguments;
-      if (remaining <= 0 || remaining > wait) {
-        if (timeout) {
-          clearTimeout(timeout);
-          timeout = null;
-        }
-        previous = now;
-        result = func.apply(context, args);
-        if (!timeout) context = args = null;
-      } else if (!timeout && options.trailing !== false) {
-        timeout = setTimeout(later, remaining);
-      }
-      return result;
-    };
-
-    throttled.cancel = function() {
-      clearTimeout(timeout);
-      previous = 0;
-      timeout = context = args = null;
-    };
-
-    return throttled;
-  };
-
-  // Returns a function, that, as long as it continues to be invoked, will not
-  // be triggered. The function will be called after it stops being called for
-  // N milliseconds. If `immediate` is passed, trigger the function on the
-  // leading edge, instead of the trailing.
-  _.debounce = function(func, wait, immediate) {
-    var timeout, result;
-
-    var later = function(context, args) {
-      timeout = null;
-      if (args) result = func.apply(context, args);
-    };
-
-    var debounced = restArgs(function(args) {
-      if (timeout) clearTimeout(timeout);
-      if (immediate) {
-        var callNow = !timeout;
-        timeout = setTimeout(later, wait);
-        if (callNow) result = func.apply(this, args);
-      } else {
-        timeout = _.delay(later, wait, this, args);
-      }
-
-      return result;
-    });
-
-    debounced.cancel = function() {
-      clearTimeout(timeout);
-      timeout = null;
-    };
-
-    return debounced;
-  };
-
-  // Returns the first function passed as an argument to the second,
-  // allowing you to adjust arguments, run code before and after, and
-  // conditionally execute the original function.
-  _.wrap = function(func, wrapper) {
-    return _.partial(wrapper, func);
-  };
-
-  // Returns a negated version of the passed-in predicate.
-  _.negate = function(predicate) {
-    return function() {
-      return !predicate.apply(this, arguments);
-    };
-  };
-
-  // Returns a function that is the composition of a list of functions, each
-  // consuming the return value of the function that follows.
-  _.compose = function() {
-    var args = arguments;
-    var start = args.length - 1;
-    return function() {
-      var i = start;
-      var result = args[start].apply(this, arguments);
-      while (i--) result = args[i].call(this, result);
-      return result;
-    };
-  };
-
-  // Returns a function that will only be executed on and after the Nth call.
-  _.after = function(times, func) {
-    return function() {
-      if (--times < 1) {
-        return func.apply(this, arguments);
-      }
-    };
-  };
-
-  // Returns a function that will only be executed up to (but not including) the Nth call.
-  _.before = function(times, func) {
-    var memo;
-    return function() {
-      if (--times > 0) {
-        memo = func.apply(this, arguments);
-      }
-      if (times <= 1) func = null;
-      return memo;
-    };
-  };
-
-  // Returns a function that will be executed at most one time, no matter how
-  // often you call it. Useful for lazy initialization.
-  _.once = _.partial(_.before, 2);
-
-  _.restArgs = restArgs;
-
-  // Object Functions
-  // ----------------
-
-  // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
-  var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
-  var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
-                      'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
-
-  var collectNonEnumProps = function(obj, keys) {
-    var nonEnumIdx = nonEnumerableProps.length;
-    var constructor = obj.constructor;
-    var proto = _.isFunction(constructor) && constructor.prototype || ObjProto;
-
-    // Constructor is a special case.
-    var prop = 'constructor';
-    if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);
-
-    while (nonEnumIdx--) {
-      prop = nonEnumerableProps[nonEnumIdx];
-      if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {
-        keys.push(prop);
-      }
-    }
-  };
-
-  // Retrieve the names of an object's own properties.
-  // Delegates to **ECMAScript 5**'s native `Object.keys`.
-  _.keys = function(obj) {
-    if (!_.isObject(obj)) return [];
-    if (nativeKeys) return nativeKeys(obj);
-    var keys = [];
-    for (var key in obj) if (_.has(obj, key)) keys.push(key);
-    // Ahem, IE < 9.
-    if (hasEnumBug) collectNonEnumProps(obj, keys);
-    return keys;
-  };
-
-  // Retrieve all the property names of an object.
-  _.allKeys = function(obj) {
-    if (!_.isObject(obj)) return [];
-    var keys = [];
-    for (var key in obj) keys.push(key);
-    // Ahem, IE < 9.
-    if (hasEnumBug) collectNonEnumProps(obj, keys);
-    return keys;
-  };
-
-  // Retrieve the values of an object's properties.
-  _.values = function(obj) {
-    var keys = _.keys(obj);
-    var length = keys.length;
-    var values = Array(length);
-    for (var i = 0; i < length; i++) {
-      values[i] = obj[keys[i]];
-    }
-    return values;
-  };
-
-  // Returns the results of applying the iteratee to each element of the object.
-  // In contrast to _.map it returns an object.
-  _.mapObject = function(obj, iteratee, context) {
-    iteratee = cb(iteratee, context);
-    var keys = _.keys(obj),
-        length = keys.length,
-        results = {};
-    for (var index = 0; index < length; index++) {
-      var currentKey = keys[index];
-      results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
-    }
-    return results;
-  };
-
-  // Convert an object into a list of `[key, value]` pairs.
-  _.pairs = function(obj) {
-    var keys = _.keys(obj);
-    var length = keys.length;
-    var pairs = Array(length);
-    for (var i = 0; i < length; i++) {
-      pairs[i] = [keys[i], obj[keys[i]]];
-    }
-    return pairs;
-  };
-
-  // Invert the keys and values of an object. The values must be serializable.
-  _.invert = function(obj) {
-    var result = {};
-    var keys = _.keys(obj);
-    for (var i = 0, length = keys.length; i < length; i++) {
-      result[obj[keys[i]]] = keys[i];
-    }
-    return result;
-  };
-
-  // Return a sorted list of the function names available on the object.
-  // Aliased as `methods`.
-  _.functions = _.methods = function(obj) {
-    var names = [];
-    for (var key in obj) {
-      if (_.isFunction(obj[key])) names.push(key);
-    }
-    return names.sort();
-  };
-
-  // An internal function for creating assigner functions.
-  var createAssigner = function(keysFunc, defaults) {
-    return function(obj) {
-      var length = arguments.length;
-      if (defaults) obj = Object(obj);
-      if (length < 2 || obj == null) return obj;
-      for (var index = 1; index < length; index++) {
-        var source = arguments[index],
-            keys = keysFunc(source),
-            l = keys.length;
-        for (var i = 0; i < l; i++) {
-          var key = keys[i];
-          if (!defaults || obj[key] === void 0) obj[key] = source[key];
-        }
-      }
-      return obj;
-    };
-  };
-
-  // Extend a given object with all the properties in passed-in object(s).
-  _.extend = createAssigner(_.allKeys);
-
-  // Assigns a given object with all the own properties in the passed-in object(s).
-  // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
-  _.extendOwn = _.assign = createAssigner(_.keys);
-
-  // Returns the first key on an object that passes a predicate test.
-  _.findKey = function(obj, predicate, context) {
-    predicate = cb(predicate, context);
-    var keys = _.keys(obj), key;
-    for (var i = 0, length = keys.length; i < length; i++) {
-      key = keys[i];
-      if (predicate(obj[key], key, obj)) return key;
-    }
-  };
-
-  // Internal pick helper function to determine if `obj` has key `key`.
-  var keyInObj = function(value, key, obj) {
-    return key in obj;
-  };
-
-  // Return a copy of the object only containing the whitelisted properties.
-  _.pick = restArgs(function(obj, keys) {
-    var result = {}, iteratee = keys[0];
-    if (obj == null) return result;
-    if (_.isFunction(iteratee)) {
-      if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);
-      keys = _.allKeys(obj);
-    } else {
-      iteratee = keyInObj;
-      keys = flatten(keys, false, false);
-      obj = Object(obj);
-    }
-    for (var i = 0, length = keys.length; i < length; i++) {
-      var key = keys[i];
-      var value = obj[key];
-      if (iteratee(value, key, obj)) result[key] = value;
-    }
-    return result;
-  });
-
-   // Return a copy of the object without the blacklisted properties.
-  _.omit = restArgs(function(obj, keys) {
-    var iteratee = keys[0], context;
-    if (_.isFunction(iteratee)) {
-      iteratee = _.negate(iteratee);
-      if (keys.length > 1) context = keys[1];
-    } else {
-      keys = _.map(flatten(keys, false, false), String);
-      iteratee = function(value, key) {
-        return !_.contains(keys, key);
-      };
-    }
-    return _.pick(obj, iteratee, context);
-  });
-
-  // Fill in a given object with default properties.
-  _.defaults = createAssigner(_.allKeys, true);
-
-  // Creates an object that inherits from the given prototype object.
-  // If additional properties are provided then they will be added to the
-  // created object.
-  _.create = function(prototype, props) {
-    var result = baseCreate(prototype);
-    if (props) _.extendOwn(result, props);
-    return result;
-  };
-
-  // Create a (shallow-cloned) duplicate of an object.
-  _.clone = function(obj) {
-    if (!_.isObject(obj)) return obj;
-    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
-  };
-
-  // Invokes interceptor with the obj, and then returns obj.
-  // The primary purpose of this method is to "tap into" a method chain, in
-  // order to perform operations on intermediate results within the chain.
-  _.tap = function(obj, interceptor) {
-    interceptor(obj);
-    return obj;
-  };
-
-  // Returns whether an object has a given set of `key:value` pairs.
-  _.isMatch = function(object, attrs) {
-    var keys = _.keys(attrs), length = keys.length;
-    if (object == null) return !length;
-    var obj = Object(object);
-    for (var i = 0; i < length; i++) {
-      var key = keys[i];
-      if (attrs[key] !== obj[key] || !(key in obj)) return false;
-    }
-    return true;
-  };
-
-
-  // Internal recursive comparison function for `isEqual`.
-  var eq, deepEq;
-  eq = function(a, b, aStack, bStack) {
-    // Identical objects are equal. `0 === -0`, but they aren't identical.
-    // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
-    if (a === b) return a !== 0 || 1 / a === 1 / b;
-    // A strict comparison is necessary because `null == undefined`.
-    if (a == null || b == null) return a === b;
-    // `NaN`s are equivalent, but non-reflexive.
-    if (a !== a) return b !== b;
-    // Exhaust primitive checks
-    var type = typeof a;
-    if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
-    return deepEq(a, b, aStack, bStack);
-  };
-
-  // Internal recursive comparison function for `isEqual`.
-  deepEq = function(a, b, aStack, bStack) {
-    // Unwrap any wrapped objects.
-    if (a instanceof _) a = a._wrapped;
-    if (b instanceof _) b = b._wrapped;
-    // Compare `[[Class]]` names.
-    var className = toString.call(a);
-    if (className !== toString.call(b)) return false;
-    switch (className) {
-      // Strings, numbers, regular expressions, dates, and booleans are compared by value.
-      case '[object RegExp]':
-      // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
-      case '[object String]':
-        // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
-        // equivalent to `new String("5")`.
-        return '' + a === '' + b;
-      case '[object Number]':
-        // `NaN`s are equivalent, but non-reflexive.
-        // Object(NaN) is equivalent to NaN.
-        if (+a !== +a) return +b !== +b;
-        // An `egal` comparison is performed for other numeric values.
-        return +a === 0 ? 1 / +a === 1 / b : +a === +b;
-      case '[object Date]':
-      case '[object Boolean]':
-        // Coerce dates and booleans to numeric primitive values. Dates are compared by their
-        // millisecond representations. Note that invalid dates with millisecond representations
-        // of `NaN` are not equivalent.
-        return +a === +b;
-      case '[object Symbol]':
-        return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);
-    }
-
-    var areArrays = className === '[object Array]';
-    if (!areArrays) {
-      if (typeof a != 'object' || typeof b != 'object') return false;
-
-      // Objects with different constructors are not equivalent, but `Object`s or `Array`s
-      // from different frames are.
-      var aCtor = a.constructor, bCtor = b.constructor;
-      if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
-                               _.isFunction(bCtor) && bCtor instanceof bCtor)
-                          && ('constructor' in a && 'constructor' in b)) {
-        return false;
-      }
-    }
-    // Assume equality for cyclic structures. The algorithm for detecting cyclic
-    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
-
-    // Initializing stack of traversed objects.
-    // It's done here since we only need them for objects and arrays comparison.
-    aStack = aStack || [];
-    bStack = bStack || [];
-    var length = aStack.length;
-    while (length--) {
-      // Linear search. Performance is inversely proportional to the number of
-      // unique nested structures.
-      if (aStack[length] === a) return bStack[length] === b;
-    }
-
-    // Add the first object to the stack of traversed objects.
-    aStack.push(a);
-    bStack.push(b);
-
-    // Recursively compare objects and arrays.
-    if (areArrays) {
-      // Compare array lengths to determine if a deep comparison is necessary.
-      length = a.length;
-      if (length !== b.length) return false;
-      // Deep compare the contents, ignoring non-numeric properties.
-      while (length--) {
-        if (!eq(a[length], b[length], aStack, bStack)) return false;
-      }
-    } else {
-      // Deep compare objects.
-      var keys = _.keys(a), key;
-      length = keys.length;
-      // Ensure that both objects contain the same number of properties before comparing deep equality.
-      if (_.keys(b).length !== length) return false;
-      while (length--) {
-        // Deep compare each member
-        key = keys[length];
-        if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
-      }
-    }
-    // Remove the first object from the stack of traversed objects.
-    aStack.pop();
-    bStack.pop();
-    return true;
-  };
-
-  // Perform a deep comparison to check if two objects are equal.
-  _.isEqual = function(a, b) {
-    return eq(a, b);
-  };
-
-  // Is a given array, string, or object empty?
-  // An "empty" object has no enumerable own-properties.
-  _.isEmpty = function(obj) {
-    if (obj == null) return true;
-    if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;
-    return _.keys(obj).length === 0;
-  };
-
-  // Is a given value a DOM element?
-  _.isElement = function(obj) {
-    return !!(obj && obj.nodeType === 1);
-  };
-
-  // Is a given value an array?
-  // Delegates to ECMA5's native Array.isArray
-  _.isArray = nativeIsArray || function(obj) {
-    return toString.call(obj) === '[object Array]';
-  };
-
-  // Is a given variable an object?
-  _.isObject = function(obj) {
-    var type = typeof obj;
-    return type === 'function' || type === 'object' && !!obj;
-  };
-
-  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError, isMap, isWeakMap, isSet, isWeakSet.
-  _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error', 'Symbol', 'Map', 'WeakMap', 'Set', 'WeakSet'], function(name) {
-    _['is' + name] = function(obj) {
-      return toString.call(obj) === '[object ' + name + ']';
-    };
-  });
-
-  // Define a fallback version of the method in browsers (ahem, IE < 9), where
-  // there isn't any inspectable "Arguments" type.
-  if (!_.isArguments(arguments)) {
-    _.isArguments = function(obj) {
-      return _.has(obj, 'callee');
-    };
-  }
-
-  // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,
-  // IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
-  var nodelist = root.document && root.document.childNodes;
-  if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
-    _.isFunction = function(obj) {
-      return typeof obj == 'function' || false;
-    };
-  }
-
-  // Is a given object a finite number?
-  _.isFinite = function(obj) {
-    return !_.isSymbol(obj) && isFinite(obj) && !isNaN(parseFloat(obj));
-  };
-
-  // Is the given value `NaN`?
-  _.isNaN = function(obj) {
-    return _.isNumber(obj) && isNaN(obj);
-  };
-
-  // Is a given value a boolean?
-  _.isBoolean = function(obj) {
-    return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
-  };
-
-  // Is a given value equal to null?
-  _.isNull = function(obj) {
-    return obj === null;
-  };
-
-  // Is a given variable undefined?
-  _.isUndefined = function(obj) {
-    return obj === void 0;
-  };
-
-  // Shortcut function for checking if an object has a given property directly
-  // on itself (in other words, not on a prototype).
-  _.has = function(obj, key) {
-    return obj != null && hasOwnProperty.call(obj, key);
-  };
-
-  // Utility Functions
-  // -----------------
-
-  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
-  // previous owner. Returns a reference to the Underscore object.
-  _.noConflict = function() {
-    root._ = previousUnderscore;
-    return this;
-  };
-
-  // Keep the identity function around for default iteratees.
-  _.identity = function(value) {
-    return value;
-  };
-
-  // Predicate-generating functions. Often useful outside of Underscore.
-  _.constant = function(value) {
-    return function() {
-      return value;
-    };
-  };
-
-  _.noop = function(){};
-
-  _.property = property;
-
-  // Generates a function for a given object that returns a given property.
-  _.propertyOf = function(obj) {
-    return obj == null ? function(){} : function(key) {
-      return obj[key];
-    };
-  };
-
-  // Returns a predicate for checking whether an object has a given set of
-  // `key:value` pairs.
-  _.matcher = _.matches = function(attrs) {
-    attrs = _.extendOwn({}, attrs);
-    return function(obj) {
-      return _.isMatch(obj, attrs);
-    };
-  };
-
-  // Run a function **n** times.
-  _.times = function(n, iteratee, context) {
-    var accum = Array(Math.max(0, n));
-    iteratee = optimizeCb(iteratee, context, 1);
-    for (var i = 0; i < n; i++) accum[i] = iteratee(i);
-    return accum;
-  };
-
-  // Return a random integer between min and max (inclusive).
-  _.random = function(min, max) {
-    if (max == null) {
-      max = min;
-      min = 0;
-    }
-    return min + Math.floor(Math.random() * (max - min + 1));
-  };
-
-  // A (possibly faster) way to get the current timestamp as an integer.
-  _.now = Date.now || function() {
-    return new Date().getTime();
-  };
-
-   // List of HTML entities for escaping.
-  var escapeMap = {
-    '&': '&amp;',
-    '<': '&lt;',
-    '>': '&gt;',
-    '"': '&quot;',
-    "'": '&#x27;',
-    '`': '&#x60;'
-  };
-  var unescapeMap = _.invert(escapeMap);
-
-  // Functions for escaping and unescaping strings to/from HTML interpolation.
-  var createEscaper = function(map) {
-    var escaper = function(match) {
-      return map[match];
-    };
-    // Regexes for identifying a key that needs to be escaped.
-    var source = '(?:' + _.keys(map).join('|') + ')';
-    var testRegexp = RegExp(source);
-    var replaceRegexp = RegExp(source, 'g');
-    return function(string) {
-      string = string == null ? '' : '' + string;
-      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
-    };
-  };
-  _.escape = createEscaper(escapeMap);
-  _.unescape = createEscaper(unescapeMap);
-
-  // If the value of the named `property` is a function then invoke it with the
-  // `object` as context; otherwise, return it.
-  _.result = function(object, prop, fallback) {
-    var value = object == null ? void 0 : object[prop];
-    if (value === void 0) {
-      value = fallback;
-    }
-    return _.isFunction(value) ? value.call(object) : value;
-  };
-
-  // Generate a unique integer id (unique within the entire client session).
-  // Useful for temporary DOM ids.
-  var idCounter = 0;
-  _.uniqueId = function(prefix) {
-    var id = ++idCounter + '';
-    return prefix ? prefix + id : id;
-  };
-
-  // By default, Underscore uses ERB-style template delimiters, change the
-  // following template settings to use alternative delimiters.
-  _.templateSettings = {
-    evaluate: /<%([\s\S]+?)%>/g,
-    interpolate: /<%=([\s\S]+?)%>/g,
-    escape: /<%-([\s\S]+?)%>/g
-  };
-
-  // When customizing `templateSettings`, if you don't want to define an
-  // interpolation, evaluation or escaping regex, we need one that is
-  // guaranteed not to match.
-  var noMatch = /(.)^/;
-
-  // Certain characters need to be escaped so that they can be put into a
-  // string literal.
-  var escapes = {
-    "'": "'",
-    '\\': '\\',
-    '\r': 'r',
-    '\n': 'n',
-    '\u2028': 'u2028',
-    '\u2029': 'u2029'
-  };
-
-  var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
-
-  var escapeChar = function(match) {
-    return '\\' + escapes[match];
-  };
-
-  // JavaScript micro-templating, similar to John Resig's implementation.
-  // Underscore templating handles arbitrary delimiters, preserves whitespace,
-  // and correctly escapes quotes within interpolated code.
-  // NB: `oldSettings` only exists for backwards compatibility.
-  _.template = function(text, settings, oldSettings) {
-    if (!settings && oldSettings) settings = oldSettings;
-    settings = _.defaults({}, settings, _.templateSettings);
-
-    // Combine delimiters into one regular expression via alternation.
-    var matcher = RegExp([
-      (settings.escape || noMatch).source,
-      (settings.interpolate || noMatch).source,
-      (settings.evaluate || noMatch).source
-    ].join('|') + '|$', 'g');
-
-    // Compile the template source, escaping string literals appropriately.
-    var index = 0;
-    var source = "__p+='";
-    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
-      source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
-      index = offset + match.length;
-
-      if (escape) {
-        source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
-      } else if (interpolate) {
-        source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
-      } else if (evaluate) {
-        source += "';\n" + evaluate + "\n__p+='";
-      }
-
-      // Adobe VMs need the match returned to produce the correct offset.
-      return match;
-    });
-    source += "';\n";
-
-    // If a variable is not specified, place data values in local scope.
-    if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
-
-    source = "var __t,__p='',__j=Array.prototype.join," +
-      "print=function(){__p+=__j.call(arguments,'');};\n" +
-      source + 'return __p;\n';
-
-    var render;
-    try {
-      render = new Function(settings.variable || 'obj', '_', source);
-    } catch (e) {
-      e.source = source;
-      throw e;
-    }
-
-    var template = function(data) {
-      return render.call(this, data, _);
-    };
-
-    // Provide the compiled source as a convenience for precompilation.
-    var argument = settings.variable || 'obj';
-    template.source = 'function(' + argument + '){\n' + source + '}';
-
-    return template;
-  };
-
-  // Add a "chain" function. Start chaining a wrapped Underscore object.
-  _.chain = function(obj) {
-    var instance = _(obj);
-    instance._chain = true;
-    return instance;
-  };
-
-  // OOP
-  // ---------------
-  // If Underscore is called as a function, it returns a wrapped object that
-  // can be used OO-style. This wrapper holds altered versions of all the
-  // underscore functions. Wrapped objects may be chained.
-
-  // Helper function to continue chaining intermediate results.
-  var chainResult = function(instance, obj) {
-    return instance._chain ? _(obj).chain() : obj;
-  };
-
-  // Add your own custom functions to the Underscore object.
-  _.mixin = function(obj) {
-    _.each(_.functions(obj), function(name) {
-      var func = _[name] = obj[name];
-      _.prototype[name] = function() {
-        var args = [this._wrapped];
-        push.apply(args, arguments);
-        return chainResult(this, func.apply(_, args));
-      };
-    });
-  };
-
-  // Add all of the Underscore functions to the wrapper object.
-  _.mixin(_);
-
-  // Add all mutator Array functions to the wrapper.
-  _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
-    var method = ArrayProto[name];
-    _.prototype[name] = function() {
-      var obj = this._wrapped;
-      method.apply(obj, arguments);
-      if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
-      return chainResult(this, obj);
-    };
-  });
-
-  // Add all accessor Array functions to the wrapper.
-  _.each(['concat', 'join', 'slice'], function(name) {
-    var method = ArrayProto[name];
-    _.prototype[name] = function() {
-      return chainResult(this, method.apply(this._wrapped, arguments));
-    };
-  });
-
-  // Extracts the result from a wrapped and chained object.
-  _.prototype.value = function() {
-    return this._wrapped;
-  };
-
-  // Provide unwrapping proxy for some methods used in engine operations
-  // such as arithmetic and JSON stringification.
-  _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
-
-  _.prototype.toString = function() {
-    return '' + this._wrapped;
-  };
-
-  // AMD registration happens at the end for compatibility with AMD loaders
-  // that may not enforce next-turn semantics on modules. Even though general
-  // practice for AMD registration is to be anonymous, underscore registers
-  // as a named module because, like jQuery, it is a base library that is
-  // popular enough to be bundled in a third party lib, but not be part of
-  // an AMD load request. Those cases could generate an error when an
-  // anonymous define() is called outside of a loader request.
-  if (typeof define == 'function' && define.amd) {
-    define('underscore', [], function() {
-      return _;
-    });
-  }
-}());
diff --git a/views/ngXosViews/subscribers/.bowerrc b/views/ngXosViews/subscribers/.bowerrc
new file mode 100644
index 0000000..e491038
--- /dev/null
+++ b/views/ngXosViews/subscribers/.bowerrc
@@ -0,0 +1,3 @@
+{
+  "directory": "src/vendor/"
+}
\ No newline at end of file
diff --git a/views/ngXosViews/subscribers/.eslintrc b/views/ngXosViews/subscribers/.eslintrc
new file mode 100644
index 0000000..c852748
--- /dev/null
+++ b/views/ngXosViews/subscribers/.eslintrc
@@ -0,0 +1,42 @@
+{
+    "ecmaFeatures": {
+        "blockBindings": true,
+        "forOf": true,
+        "destructuring": true,
+        "arrowFunctions": true,
+        "templateStrings": true
+    },
+    "env": { 
+        "browser": true,
+        "node": true,
+        "es6": true
+    },
+    "plugins": [
+        //"angular"
+    ],
+    "rules": {
+        "quotes": [2, "single"],
+        "camelcase": [1, {"properties": "always"}],
+        "no-underscore-dangle": 1,
+        "eqeqeq": [2, "smart"],
+        "no-alert": 1,
+        "key-spacing": [1, { "beforeColon": false, "afterColon": true }],
+        "indent": [2, 2],
+        "no-irregular-whitespace": 1,
+        "eol-last": 0,
+        "max-nested-callbacks": [2, 4],
+        "comma-spacing": [1, {"before": false, "after": true}],
+        "no-trailing-spaces": [1, { skipBlankLines: true }],
+        "no-unused-vars": [1, {"vars": "all", "args": "after-used"}],
+        "new-cap": 0,
+
+        //"angular/ng_module_name": [2, '/^xos\.*[a-z]*$/'],
+        //"angular/ng_controller_name": [2, '/^[a-z].*Ctrl$/'],
+        //"angular/ng_service_name": [2, '/^[A-Z].*Service$/'],
+        //"angular/ng_directive_name": [2, '/^[a-z]+[[A-Z].*]*$/'],
+        //"angular/ng_di": [0, "function or array"]
+    },
+    "globals" :{
+        "angular": true
+    } 
+}
\ No newline at end of file
diff --git a/views/ngXosViews/subscribers/.gitignore b/views/ngXosViews/subscribers/.gitignore
new file mode 100644
index 0000000..567aee4
--- /dev/null
+++ b/views/ngXosViews/subscribers/.gitignore
@@ -0,0 +1,6 @@
+dist/
+src/vendor
+.tmp
+node_modules
+npm-debug.log
+dist/
\ No newline at end of file
diff --git a/views/ngXosViews/subscribers/bower.json b/views/ngXosViews/subscribers/bower.json
new file mode 100644
index 0000000..2fb2dab
--- /dev/null
+++ b/views/ngXosViews/subscribers/bower.json
@@ -0,0 +1,32 @@
+{
+  "name": "xos-subscribers",
+  "version": "0.0.0",
+  "authors": [
+    "Matteo Scandolo <matteo.scandolo@gmail.com>"
+  ],
+  "description": "The subscribers view",
+  "license": "MIT",
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "bower_components",
+    "static/js/vendor/",
+    "test",
+    "tests"
+  ],
+  "dependencies": {},
+  "devDependencies": {
+    "jquery": "2.1.4",
+    "angular-mocks": "1.4.7",
+    "angular": "1.4.7",
+    "angular-ui-router": "0.2.15",
+    "angular-cookies": "1.4.7",
+    "angular-animate": "1.4.7",
+    "angular-resource": "1.4.7",
+    "lodash": "~4.11.1",
+    "bootstrap-css": "3.3.6",
+    "angular-chart.js": "~0.10.2",
+    "d3": "~3.5.17",
+    "angular-recursion": "~1.0.5"
+  }
+}
diff --git a/views/ngXosViews/subscribers/gulp/build.js b/views/ngXosViews/subscribers/gulp/build.js
new file mode 100644
index 0000000..7f446ed
--- /dev/null
+++ b/views/ngXosViews/subscribers/gulp/build.js
@@ -0,0 +1,164 @@
+'use strict';
+
+// BUILD
+//
+// The only purpose of this gulpfile is to build a XOS view and copy the correct files into
+// .html => dashboards
+// .js (minified and concat) => static/js
+//
+// The template are parsed and added to js with angular $templateCache
+
+var gulp = require('gulp');
+var ngAnnotate = require('gulp-ng-annotate');
+var uglify = require('gulp-uglify');
+var templateCache = require('gulp-angular-templatecache');
+var runSequence = require('run-sequence');
+var concat = require('gulp-concat-util');
+var del = require('del');
+var wiredep = require('wiredep');
+var angularFilesort = require('gulp-angular-filesort');
+var _ = require('lodash');
+var eslint = require('gulp-eslint');
+var inject = require('gulp-inject');
+var rename = require('gulp-rename');
+var replace = require('gulp-replace');
+var postcss = require('gulp-postcss');
+var autoprefixer = require('autoprefixer');
+var mqpacker = require('css-mqpacker');
+var csswring = require('csswring');
+
+const TEMPLATE_FOOTER = `
+angular.module('xos.subscribers')
+.run(['$location', function(a){
+  a.path('/');
+}])
+`
+
+module.exports = function(options){
+  
+  // delete previous builded file
+  gulp.task('clean', function(){
+    return del(
+      [
+        options.dashboards + 'xosSubscribers.html',
+        options.static + 'css/xosSubscribers.css'
+      ],
+      {force: true}
+    );
+  });
+
+  // minify css
+  gulp.task('css', function () {
+    var processors = [
+      autoprefixer({browsers: ['last 1 version']}),
+      mqpacker,
+      csswring
+    ];
+
+    gulp.src([
+      `${options.css}**/*.css`,
+      `!${options.css}dev.css`
+    ])
+    .pipe(postcss(processors))
+    .pipe(gulp.dest(options.tmp + '/css/'));
+  });
+
+  // copy css in correct folder
+  gulp.task('copyCss', ['wait'], function(){
+    return gulp.src([`${options.tmp}/css/*.css`])
+    .pipe(concat('xosSubscribers.css'))
+    .pipe(gulp.dest(options.static + 'css/'))
+  });
+
+  // compile and minify scripts
+  gulp.task('scripts', function() {
+    return gulp.src([
+      options.tmp + '**/*.js'
+    ])
+    .pipe(ngAnnotate())
+    .pipe(angularFilesort())
+    .pipe(concat('xosSubscribers.js'))
+    .pipe(concat.header('//Autogenerated, do not edit!!!\n'))
+    .pipe(concat.footer(TEMPLATE_FOOTER))
+    .pipe(uglify())
+    .pipe(gulp.dest(options.static + 'js/'));
+  });
+
+  // set templates in cache
+  gulp.task('templates', function(){
+    return gulp.src('./src/templates/*.html')
+      .pipe(templateCache({
+        module: 'xos.subscribers',
+        root: 'templates/'
+      }))
+      .pipe(gulp.dest(options.tmp));
+  });
+
+  // copy html index to Django Folder
+  gulp.task('copyHtml', function(){
+    return gulp.src(options.src + 'index.html')
+      // remove dev dependencies from html
+      .pipe(replace(/<!-- bower:css -->(\n^<link.*)*\n<!-- endbower -->/gmi, ''))
+      .pipe(replace(/<!-- bower:js -->(\n^<script.*)*\n<!-- endbower -->/gmi, ''))
+      // injecting minified files
+      .pipe(
+        inject(
+          gulp.src([
+            options.static + 'js/vendor/xosSubscribersVendor.js',
+            options.static + 'js/xosSubscribers.js',
+            options.static + 'css/xosSubscribers.css'
+          ]),
+          {ignorePath: '/../../../xos/core/xoslib'}
+        )
+      )
+      .pipe(rename('xosSubscribers.html'))
+      .pipe(gulp.dest(options.dashboards));
+  });
+
+  // minify vendor js files
+  gulp.task('wiredep', function(){
+    var bowerDeps = wiredep().js;
+    if(!bowerDeps){
+      return;
+    }
+
+    // remove angular (it's already loaded)
+    _.remove(bowerDeps, function(dep){
+      return dep.indexOf('angular/angular.js') !== -1;
+    });
+
+    return gulp.src(bowerDeps)
+      .pipe(concat('xosSubscribersVendor.js'))
+      .pipe(uglify())
+      .pipe(gulp.dest(options.static + 'js/vendor/'));
+  });
+
+  gulp.task('lint', function () {
+    return gulp.src(['src/js/**/*.js'])
+      .pipe(eslint())
+      .pipe(eslint.format())
+      .pipe(eslint.failAfterError());
+  });
+
+  gulp.task('wait', function (cb) {
+    // setTimeout could be any async task
+    setTimeout(function () {
+      cb();
+    }, 1000);
+  });
+
+  gulp.task('build', function() {
+    runSequence(
+      'clean',
+      'sass',
+      'templates',
+      'babel',
+      'scripts',
+      'wiredep',
+      'css',
+      'copyCss',
+      'copyHtml',
+      'cleanTmp'
+    );
+  });
+};
\ No newline at end of file
diff --git a/views/ngXosViews/subscribers/gulp/server.js b/views/ngXosViews/subscribers/gulp/server.js
new file mode 100644
index 0000000..1e40a34
--- /dev/null
+++ b/views/ngXosViews/subscribers/gulp/server.js
@@ -0,0 +1,170 @@
+'use strict';
+
+var gulp = require('gulp');
+var browserSync = require('browser-sync').create();
+var inject = require('gulp-inject');
+var runSequence = require('run-sequence');
+var angularFilesort = require('gulp-angular-filesort');
+var babel = require('gulp-babel');
+var wiredep = require('wiredep').stream;
+var httpProxy = require('http-proxy');
+var del = require('del');
+var sass = require('gulp-sass');
+var fs = require('fs');
+var path = require('path');
+
+const environment = process.env.NODE_ENV;
+
+if(!fs.existsSync(path.join(__dirname, `../../../env/${environment || 'default'}.js`))){
+  if(!environment){
+    throw new Error('You should define a default.js config in /views/env folder.');
+  }
+  else{
+    throw new Error(`Since you are loading a custom environment, you should define a ${environment}.js config in /views/env folder.`);
+  }
+}
+
+var conf = require(path.join(__dirname, `../../../env/${environment || 'default'}.js`));
+
+var proxy = httpProxy.createProxyServer({
+  target: conf.host
+});
+
+
+proxy.on('error', function(error, req, res) {
+  res.writeHead(500, {
+    'Content-Type': 'text/plain'
+  });
+
+  console.error('[Proxy]', error);
+});
+
+module.exports = function(options){
+
+  gulp.task('browser', function() {
+    browserSync.init({
+      startPath: '#/',
+      snippetOptions: {
+        rule: {
+          match: /<!-- browserSync -->/i
+        }
+      },
+      server: {
+        baseDir: options.src,
+        routes: {
+          '/xos/core/xoslib/static/js/vendor': options.helpers,
+          '/xos/core/static': options.static + '../../static/'
+        },
+        middleware: function(req, res, next){
+          if(
+            req.url.indexOf('/api/') !== -1
+          ){
+            if(conf.xoscsrftoken && conf.xossessionid){
+              req.headers.cookie = `xoscsrftoken=${conf.xoscsrftoken}; xossessionid=${conf.xossessionid}`;
+              req.headers['x-csrftoken'] = conf.xoscsrftoken;
+            }
+            proxy.web(req, res);
+          }
+          else{
+            next();
+          }
+        }
+      }
+    });
+
+    gulp.watch(options.src + 'js/**/*.js', ['js-watch']);
+    gulp.watch(options.src + 'vendor/**/*.js', ['bower'], function(){
+      browserSync.reload();
+    });
+    gulp.watch(options.src + '**/*.html', function(){
+      browserSync.reload();
+    });
+    gulp.watch(options.css + '**/*.css', function(){
+      browserSync.reload();
+    });
+    gulp.watch(`${options.sass}/**/*.scss`, ['sass'], function(){
+      browserSync.reload();
+    });
+
+    gulp.watch([
+      options.helpers + 'ngXosHelpers.js',
+      options.static + '../../static/xosNgLib.css'
+    ], function(){
+      browserSync.reload();
+    });
+  });
+
+  // compile sass
+  gulp.task('sass', function () {
+    return gulp.src(`${options.sass}/**/*.scss`)
+      .pipe(sass().on('error', sass.logError))
+      .pipe(gulp.dest(options.css));
+  });
+
+  // transpile js with sourceMaps
+  gulp.task('babel', function(){
+    return gulp.src(options.scripts + '**/*.js')
+      .pipe(babel({sourceMaps: true}))
+      .pipe(gulp.dest(options.tmp));
+  });
+
+  // inject scripts
+  gulp.task('injectScript', ['cleanTmp', 'babel'], function(){
+    return gulp.src(options.src + 'index.html')
+      .pipe(
+        inject(
+          gulp.src([
+            options.tmp + '**/*.js',
+            options.helpers + 'ngXosHelpers.js'
+          ])
+          .pipe(angularFilesort()),
+          {
+            ignorePath: [options.src, '/../../ngXosLib']
+          }
+        )
+      )
+      .pipe(gulp.dest(options.src));
+  });
+
+  // inject CSS
+  gulp.task('injectCss', function(){
+    return gulp.src(options.src + 'index.html')
+      .pipe(
+        inject(
+          gulp.src([
+            options.src + 'css/*.css',
+            options.static + '../../static/xosNgLib.css'
+          ]),
+          {
+            ignorePath: [options.src]
+          }
+          )
+        )
+      .pipe(gulp.dest(options.src));
+  });
+
+  // inject bower dependencies with wiredep
+  gulp.task('bower', function () {
+    return gulp.src(options.src + 'index.html')
+    .pipe(wiredep({devDependencies: true}))
+    .pipe(gulp.dest(options.src));
+  });
+
+  gulp.task('js-watch', ['injectScript'], function(){
+    browserSync.reload();
+  });
+
+  gulp.task('cleanTmp', function(){
+    return del([options.tmp + '**/*']);
+  });
+
+  gulp.task('serve', function() {
+    runSequence(
+      'sass',
+      'bower',
+      'injectScript',
+      'injectCss',
+      ['browser']
+    );
+  });
+};
diff --git a/views/ngXosViews/subscribers/gulpfile.js b/views/ngXosViews/subscribers/gulpfile.js
new file mode 100644
index 0000000..08df554
--- /dev/null
+++ b/views/ngXosViews/subscribers/gulpfile.js
@@ -0,0 +1,26 @@
+'use strict';
+
+var gulp = require('gulp');
+var wrench = require('wrench');
+
+var options = {
+  src: 'src/',
+  css: 'src/css/',
+  sass: 'src/sass/',
+  scripts: 'src/js/',
+  tmp: 'src/.tmp',
+  dist: 'dist/',
+  api: '../../ngXosLib/api/',
+  helpers: '../../../xos/core/xoslib/static/js/vendor/',
+  static: '../../../xos/core/xoslib/static/', // this is the django static folder
+  dashboards: '../../../xos/core/xoslib/dashboards/' // this is the django html folder
+};
+
+wrench.readdirSyncRecursive('./gulp')
+.map(function(file) {
+  require('./gulp/' + file)(options);
+});
+
+gulp.task('default', function () {
+  gulp.start('build');
+});
diff --git a/views/ngXosViews/subscribers/karma.conf.js b/views/ngXosViews/subscribers/karma.conf.js
new file mode 100644
index 0000000..0e9c4d8
--- /dev/null
+++ b/views/ngXosViews/subscribers/karma.conf.js
@@ -0,0 +1,92 @@
+// Karma configuration
+// Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC)
+
+/* eslint indent: [2,2], quotes: [2, "single"]*/
+
+/*eslint-disable*/
+var wiredep = require('wiredep');
+var path = require('path');
+
+var bowerComponents = wiredep( {devDependencies: true} )[ 'js' ].map(function( file ){
+  return path.relative(process.cwd(), file);
+});
+
+module.exports = function(config) {
+/*eslint-enable*/
+  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: bowerComponents.concat([
+      'node_modules/babel-polyfill/dist/polyfill.js',
+      '../../../xos/core/xoslib/static/js/vendor/ngXosVendor.js',
+      '../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js',
+      'src/js/**/*.js',
+      'spec/**/*.mock.js',
+      'spec/**/*.test.js',
+      'src/**/*.html'
+    ]),
+
+
+    // 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: {
+      'src/js/**/*.js': ['babel'],
+      'spec/**/*.test.js': ['babel'],
+      'src/**/*.html': ['ng-html2js']
+    },
+
+    ngHtml2JsPreprocessor: {
+      stripPrefix: 'src/', //strip the src path from template url (http://stackoverflow.com/questions/22869668/karma-unexpected-request-when-testing-angular-directive-even-with-ng-html2js)
+      moduleName: 'templates' // define the template module name
+    },
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    reporters: ['mocha'],
+
+
+    // 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: [
+      'PhantomJS',
+      'Chrome'
+    ],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false
+  });
+};
diff --git a/views/ngXosViews/subscribers/package.json b/views/ngXosViews/subscribers/package.json
new file mode 100644
index 0000000..96a2326
--- /dev/null
+++ b/views/ngXosViews/subscribers/package.json
@@ -0,0 +1,65 @@
+{
+  "name": "xos-subscribers",
+  "version": "1.0.0",
+  "description": "Angular Application for XOS, created with generator-xos",
+  "scripts": {
+    "prestart": "npm install && bower install",
+    "start": "gulp serve",
+    "prebuild": "npm install && bower install",
+    "build": "gulp",
+    "test": "karma start",
+    "test:ci": "karma start --single-run",
+    "lint": "eslint src/js/"
+  },
+  "keywords": [
+    "XOS",
+    "Angular",
+    "XOSlib"
+  ],
+  "author": "Matteo Scandolo",
+  "license": "MIT",
+  "dependencies": {},
+  "devDependencies": {
+    "autoprefixer": "^6.3.3",
+    "babel-polyfill": "^6.9.0",
+    "browser-sync": "^2.9.11",
+    "css-mqpacker": "^4.0.0",
+    "csswring": "^4.2.1",
+    "del": "^2.0.2",
+    "easy-mocker": "^1.2.0",
+    "eslint": "^1.8.0",
+    "eslint-plugin-angular": "linkmesrl/eslint-plugin-angular",
+    "gulp": "^3.9.0",
+    "gulp-angular-filesort": "^1.1.1",
+    "gulp-angular-templatecache": "^1.8.0",
+    "gulp-babel": "^5.3.0",
+    "gulp-concat": "^2.6.0",
+    "gulp-concat-util": "^0.5.5",
+    "gulp-eslint": "^1.0.0",
+    "gulp-inject": "^3.0.0",
+    "gulp-minify-html": "^1.0.4",
+    "gulp-ng-annotate": "^1.1.0",
+    "gulp-postcss": "^6.0.1",
+    "gulp-rename": "^1.2.2",
+    "gulp-replace": "^0.5.4",
+    "gulp-sass": "^2.2.0",
+    "gulp-uglify": "^1.4.2",
+    "http-proxy": "^1.12.0",
+    "ink-docstrap": "^0.5.2",
+    "jasmine-core": "~2.3.4",
+    "karma": "^0.13.14",
+    "karma-babel-preprocessor": "~5.2.2",
+    "karma-chrome-launcher": "^1.0.1",
+    "karma-coverage": "^0.5.3",
+    "karma-jasmine": "~0.3.6",
+    "karma-mocha-reporter": "~1.1.1",
+    "karma-ng-html2js-preprocessor": "^0.2.0",
+    "karma-phantomjs-launcher": "~0.2.1",
+    "lodash": "^3.10.1",
+    "phantomjs": "^1.9.19",
+    "proxy-middleware": "^0.15.0",
+    "run-sequence": "^1.1.4",
+    "wiredep": "^3.0.0-beta",
+    "wrench": "^1.5.8"
+  }
+}
diff --git a/views/ngXosViews/subscribers/spec/sample.test.js b/views/ngXosViews/subscribers/spec/sample.test.js
new file mode 100644
index 0000000..1b7796c
--- /dev/null
+++ b/views/ngXosViews/subscribers/spec/sample.test.js
@@ -0,0 +1,53 @@
+'use strict';
+
+describe('The Subscriber View', () => {
+  
+  const subscribersList = [
+    {
+      humanReadableName: 'cordSubscriber-1',
+      features: {cdn: false, uplink_speed: 1000000000, downlink_speed: 1000000000, uverse: true, status: 'enabled'},
+      id: 1,
+      identity: {account_num: '123', name: 'Stanford'},
+      related: {}
+    }
+  ];
+
+  var scope, element, isolatedScope, httpBackend;
+
+  beforeEach(module('xos.subscribers'));
+  beforeEach(module('templates'));
+
+  beforeEach(inject(function($httpBackend, $compile, $rootScope){
+    
+    httpBackend = $httpBackend;
+    
+    httpBackend.whenGET('/api/tenant/cord/subscriber/?no_hyperlinks=1').respond(subscribersList);
+  
+    scope = $rootScope.$new();
+    element = angular.element('<subscribers-list></subscribers-list>');
+    $compile(element)(scope);
+    scope.$digest();
+    isolatedScope = element.isolateScope().vm;
+  }));
+
+  it('should load 1 subscriber', () => {
+    // this
+    httpBackend.flush();
+    scope.$digest();
+    let table = $(element).find('table');
+    let tr = table.find('tbody:last-child tr');
+    // let tds = $(tr[1]).find('td');
+    // console.log(tr);
+    expect(tr.length).toBe(1);
+    // expect($(tds[0]).html()).toBe('cordSubscriber-1')
+  });
+
+  it('should configure xos-smart-table', () => {
+    expect(isolatedScope.smartTableConfig).toEqual({resource: 'Subscribers'});
+  });
+
+  it('should render xos-smart-table', () => {
+    expect($(element).find('xos-smart-table').length).toBe(1);
+  });
+
+});
\ No newline at end of file
diff --git a/views/ngXosViews/subscribers/src/css/main.css b/views/ngXosViews/subscribers/src/css/main.css
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/views/ngXosViews/subscribers/src/css/main.css
diff --git a/views/ngXosViews/subscribers/src/index.html b/views/ngXosViews/subscribers/src/index.html
new file mode 100644
index 0000000..71cbddc
--- /dev/null
+++ b/views/ngXosViews/subscribers/src/index.html
@@ -0,0 +1,35 @@
+<!-- browserSync -->
+<!-- bower:css -->
+<link rel="stylesheet" href="vendor/bootstrap-css/css/bootstrap.min.css" />
+<link rel="stylesheet" href="vendor/angular-chart.js/dist/angular-chart.css" />
+<!-- endbower -->
+<!-- endcss -->
+<!-- inject:css -->
+<link rel="stylesheet" href="/css/main.css">
+<link rel="stylesheet" href="/../../../xos/core/static/xosNgLib.css">
+<!-- endinject -->
+
+<div ng-app="xos.subscribers" id="xosSubscribers" class="container-fluid">
+  <div ui-view></div>
+</div>
+
+<!-- bower:js -->
+<script src="vendor/jquery/dist/jquery.js"></script>
+<script src="vendor/angular/angular.js"></script>
+<script src="vendor/angular-mocks/angular-mocks.js"></script>
+<script src="vendor/angular-ui-router/release/angular-ui-router.js"></script>
+<script src="vendor/angular-cookies/angular-cookies.js"></script>
+<script src="vendor/angular-animate/angular-animate.js"></script>
+<script src="vendor/angular-resource/angular-resource.js"></script>
+<script src="vendor/lodash/lodash.js"></script>
+<script src="vendor/bootstrap-css/js/bootstrap.min.js"></script>
+<script src="vendor/Chart.js/Chart.js"></script>
+<script src="vendor/angular-chart.js/dist/angular-chart.js"></script>
+<script src="vendor/d3/d3.js"></script>
+<script src="vendor/angular-recursion/angular-recursion.js"></script>
+<!-- endbower -->
+<!-- endjs -->
+<!-- inject:js -->
+<script src="/../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js"></script>
+<script src="/.tmp/main.js"></script>
+<!-- endinject -->
\ No newline at end of file
diff --git a/views/ngXosViews/subscribers/src/js/main.js b/views/ngXosViews/subscribers/src/js/main.js
new file mode 100644
index 0000000..203e9ff
--- /dev/null
+++ b/views/ngXosViews/subscribers/src/js/main.js
@@ -0,0 +1,33 @@
+'use strict';
+
+angular.module('xos.subscribers', [
+  'ngResource',
+  'ngCookies',
+  'ui.router',
+  'xos.helpers'
+])
+.config(($stateProvider) => {
+  $stateProvider
+  .state('user-list', {
+    url: '/',
+    template: '<subscribers-list></subscribers-list>'
+  });
+})
+.config(function($httpProvider){
+  $httpProvider.interceptors.push('NoHyperlinks');
+})
+.directive('subscribersList', function(){
+  return {
+    restrict: 'E',
+    scope: {},
+    bindToController: true,
+    controllerAs: 'vm',
+    templateUrl: 'templates/subscribers-list.tpl.html',
+    controller: function(){
+
+      this.smartTableConfig = {
+        resource: 'Subscribers'
+      };
+    }
+  };
+});
\ No newline at end of file
diff --git a/views/ngXosViews/subscribers/src/sass/main.scss b/views/ngXosViews/subscribers/src/sass/main.scss
new file mode 100644
index 0000000..5f68212
--- /dev/null
+++ b/views/ngXosViews/subscribers/src/sass/main.scss
@@ -0,0 +1,5 @@
+@import '../../../../style/sass/lib/_variables.scss';
+
+#xosSubscribers {
+  
+}
\ No newline at end of file
diff --git a/views/ngXosViews/subscribers/src/templates/subscribers-list.tpl.html b/views/ngXosViews/subscribers/src/templates/subscribers-list.tpl.html
new file mode 100644
index 0000000..d6e755b
--- /dev/null
+++ b/views/ngXosViews/subscribers/src/templates/subscribers-list.tpl.html
@@ -0,0 +1 @@
+<xos-smart-table config="vm.smartTableConfig"></xos-smart-table>
\ No newline at end of file
diff --git a/views/ngXosViews/synchronizerNotifier/spec/sample.test.js b/views/ngXosViews/synchronizerNotifier/spec/sample.test.js
index 1226431..0e61572 100644
--- a/views/ngXosViews/synchronizerNotifier/spec/sample.test.js
+++ b/views/ngXosViews/synchronizerNotifier/spec/sample.test.js
@@ -26,7 +26,7 @@
     isolatedScope = element.isolateScope().vm;
   }));
 
-  it('should load 1 users', () => {
+  xit('should load 1 users', () => {
     httpBackend.flush();
     expect(isolatedScope.users.length).toBe(1);
     expect(isolatedScope.users[0].email).toEqual('matteo.scandolo@gmail.com');
diff --git a/views/ngXosViews/synchronizerNotifier/src/css/main.css b/views/ngXosViews/synchronizerNotifier/src/css/main.css
index 94e3701..b95bde2 100644
--- a/views/ngXosViews/synchronizerNotifier/src/css/main.css
+++ b/views/ngXosViews/synchronizerNotifier/src/css/main.css
@@ -9,5 +9,5 @@
     width: 200px; }
   #xosSynchronizerNotifier sync-status .badge.success {
     background-color: #5cb85c; }
-  #xosSynchronizerNotifier sync-status .badge.danger {
-    background-color: #d9534f; }
+  #xosSynchronizerNotifier sync-status .badge.warning {
+    background-color: #f0ad4e; }
diff --git a/views/ngXosViews/synchronizerNotifier/src/js/main.js b/views/ngXosViews/synchronizerNotifier/src/js/main.js
index 93b8191..301345c 100644
--- a/views/ngXosViews/synchronizerNotifier/src/js/main.js
+++ b/views/ngXosViews/synchronizerNotifier/src/js/main.js
@@ -6,29 +6,6 @@
   'ui.router',
   'xos.helpers'
 ])
-.config(function($provide) {
-  $provide.decorator('$rootScope', function($delegate) {
-    var Scope = $delegate.constructor;
-    // var origBroadcast = Scope.prototype.$broadcast;
-    // var origEmit = Scope.prototype.$emit;
-    var origOn = Scope.prototype.$on;
-
-    // Scope.prototype.$broadcast = function() {
-    //   // console.log("$broadcast was called on $scope " + $scope.$id + " with arguments:", arguments);
-    //   return origBroadcast.apply(this, arguments);
-    // };
-    // Scope.prototype.$emit = function() {
-    //   // console.log("$emit was called on $scope " + $scope.$id + " with arguments:", arguments);
-    //   return origEmit.apply(this, arguments);
-    // };
-
-    Scope.prototype.$on = function(){
-      // console.log('$on', arguments, arguments[1].toString());
-      return origOn.apply(this, arguments);
-    }
-    return $delegate;
-  });
-})
 .service('Diag', function($rootScope, $http, $q, $interval){
 
   let isRunning = false;
@@ -50,6 +27,9 @@
     diags.forEach(d => {
       let status = JSON.parse(d.backend_register);
       status.last_run = new Date(status.last_run * 1000);
+      status.last_duration = status.last_duration * 1000;
+      status.last_synchronizer_start = new Date(status.last_synchronizer_start * 1000);
+      status.last_syncrecord_start = status.last_syncrecord_start ? new Date(status.last_syncrecord_start * 1000) : null;
       $rootScope.$broadcast(`diag`, {
         name: d.name,
         updated: d.updated,
@@ -75,13 +55,21 @@
 
   this.getSyncStatus = (status) => {
 
-    let gap = 5 * 60 * 1000; /* ms */
-    // let gap = 2;
-
-    if (((new Date()) - status.last_run) > gap){
+    const now = new Date();
+    // let gap = 15 * 60 * 1000; /* ms */
+    const gap = 1 * 60 * 1000;
+    // if all of this values are older than 15 min,
+    // probably something is wrong
+    if (
+      (now - status.last_synchronizer_start) > gap &&
+      (now - status.last_syncrecord_start) > gap &&
+      (now - status.last_run) > gap
+    ){
       return false;
     }
-    return true;
+    else{
+      return true;
+    }
   }
 
   $interval(() => {
@@ -91,10 +79,7 @@
         this.sendEvents(diags);
       });
     }
-  }, 25000);
-})
-.run(function($log){
-  $log.info('Listening for Syncronizers Events!');
+  }, 10000);
 })
 .directive('syncStatus', function() {
   return {
@@ -103,16 +88,34 @@
     bindToController: true,
     controllerAs: 'vm',
     templateUrl: 'templates/sync-status.tpl.html',
-    controller: function($log, $rootScope, Diag){
+    controller: function($log, $rootScope, Diag, xosNotification){
       Diag.start();
-      // this.showNotificationPanel = true;
+      this.showNotificationPanel = true;
       this.synchronizers = {};
 
+      const notified = {};
+
       this.showNoSync = true;
 
       $rootScope.$on('diag', (e, d) => {
-        // $log.info('Received event: ', d);
         this.synchronizers[d.name] = d;
+
+        // if errored
+        if(!d.status){
+          // and not already notified
+          if(!notified[d.name]){
+            xosNotification.notify('CORD Synchronizer Error', {
+              icon: '/xos/core/static/cord-logo.png',
+              body: `The ${d.name} synchronizer has stopped.`
+            });
+          }
+          notified[d.name] = true;
+        }
+        else {
+          notified[d.name] = false;
+        }
+
+        // hide list if empty
         this.showNoSync = false;
         if(Object.keys(this.synchronizers).length === 0){
           this.showNoSync = true;
diff --git a/views/ngXosViews/synchronizerNotifier/src/sass/main.scss b/views/ngXosViews/synchronizerNotifier/src/sass/main.scss
index 1f39483..273131a 100644
--- a/views/ngXosViews/synchronizerNotifier/src/sass/main.scss
+++ b/views/ngXosViews/synchronizerNotifier/src/sass/main.scss
@@ -23,8 +23,8 @@
         background-color: $brand-success;
       }
 
-      &.danger {
-        background-color: $brand-danger;
+      &.warning {
+        background-color: $brand-warning;
       }
     }
   }
diff --git a/views/ngXosViews/synchronizerNotifier/src/templates/sync-status.tpl.html b/views/ngXosViews/synchronizerNotifier/src/templates/sync-status.tpl.html
index 58524e7..cbd794e 100644
--- a/views/ngXosViews/synchronizerNotifier/src/templates/sync-status.tpl.html
+++ b/views/ngXosViews/synchronizerNotifier/src/templates/sync-status.tpl.html
@@ -3,11 +3,11 @@
     <i class="glyphicon glyphicon-inbox"></i>
   </div>
   <div class="notification-panel panel panel-default" ng-show="vm.showNotificationPanel">
-    <ul class="list-group" ng-show="vm.showNoSync">
+    <ul class="list-group" ng-show="!vm.showNoSync">
       <li class="list-group-item" ng-repeat="(syncName, syncStatus) in vm.synchronizers">
-        <span class="badge" ng-class="{success: syncStatus.status, danger: !syncStatus.status}">
+        <span class="badge" ng-class="{success: syncStatus.status, warning: !syncStatus.status}">
           <span ng-show="syncStatus.status"><i class="glyphicon glyphicon-ok"></i></span>
-          <span ng-hide="syncStatus.status"><i class="glyphicon glyphicon-remove"></i></span>
+          <span ng-hide="syncStatus.status"><i class="glyphicon glyphicon-time"></i></span>
         </span>
         <b>{{syncName}}</b>
         <br/>
diff --git a/xos/configurations/cord-pod/Makefile b/xos/configurations/cord-pod/Makefile
index 1b42f68..878797c 100644
--- a/xos/configurations/cord-pod/Makefile
+++ b/xos/configurations/cord-pod/Makefile
@@ -10,7 +10,6 @@
 	sudo docker-compose run xos python /opt/xos/tosca/run.py none /opt/xos/configurations/common/mydeployment.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/setup.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/nodes.yaml
-	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/nodes.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/images.yaml
 
 vtn: vtn-external.yaml
@@ -54,13 +53,30 @@
 	./cleanup.sh
 	bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
 
-ceilometer_custom_images:
-	bash -c "source ./admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || ! mkdir -p ./images || ! wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P ./images || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file ./images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare"
+ceilometer_custom_images: images/ceilometer-trusty-server-multi-nic.img
+	bash -c "source ./admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file ./images/ceilometer-trusty-server-multi-nic.img --container-format bare"
 
-vsg_custom_images:
-	bash -c "source ./admin-openrc.sh; glance image-show vsg || ! mkdir -p ./glance-images || ! wget http://www.vicci.org/cord/vsg-1.0.img -P ./glance-images || glance image-create --name vsg-1.0 --disk-format qcow2 --file ./glance-images/vsg-1.0.img --container-format bare"
+vsg_custom_images: images/vsg-1.0.img
+	bash -c "source ./admin-openrc.sh; glance image-show vsg-1.0 || glance image-create --name vsg-1.0 --disk-format qcow2 --file ./images/vsg-1.0.img --container-format bare"
+
+images/ceilometer-trusty-server-multi-nic.img: images
+	wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P ./images
+	mv ./images/ceilometer-trusty-server-multi-nic.compressed.qcow2 ./images/ceilometer-trusty-server-multi-nic.img
+
+images/vsg-1.0.img: images
+	wget http://www.vicci.org/cord/vsg-1.0.img -P ./images
+
+images:
+	mkdir -p ./images
 
 .PHONY: local_containers
 local_containers:
+	echo "" > ../../../containers/xos/local_certs.crt
+	for CRT in /usr/local/share/ca-certificates/* ; do \
+		echo Adding Certificate: $$CRT ;\
+		cat $$CRT >> ../../../containers/xos/local_certs.crt ;\
+		echo "" >> ../../../containers/xos/local_certs.crt ;\
+	done
 	cd ../../../containers/xos; make devel
 	cd ../../../containers/synchronizer; make
+
diff --git a/xos/configurations/cord-pod/docker-compose.yml b/xos/configurations/cord-pod/docker-compose.yml
index e2a5768..fa8660a 100644
--- a/xos/configurations/cord-pod/docker-compose.yml
+++ b/xos/configurations/cord-pod/docker-compose.yml
@@ -17,6 +17,10 @@
         - .:/root/setup:ro
         - ../vtn/files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro
         - ./images:/opt/xos/images:ro
+    log_driver: "json-file"
+    log_opt:
+            max-size: "100k"
+            max-file: "5"
 
 xos_synchronizer_onos:
     image: xosproject/xos-synchronizer-openstack
@@ -29,6 +33,10 @@
     volumes:
         - .:/root/setup:ro
         - ./id_rsa:/opt/xos/synchronizers/onos/onos_key:ro  # private key
+    log_driver: "json-file"
+    log_opt:
+            max-size: "100k"
+            max-file: "5"
 
 xos_synchronizer_vcpe:
     image: xosproject/xos-synchronizer-openstack
@@ -41,6 +49,10 @@
     volumes:
         - .:/root/setup:ro
         - ./id_rsa:/opt/xos/synchronizers/vcpe/vcpe_private_key:ro  # private key
+    log_driver: "json-file"
+    log_opt:
+            max-size: "100k"
+            max-file: "5"
 
 xos_synchronizer_vtn:
     image: xosproject/xos-synchronizer-openstack
@@ -52,15 +64,10 @@
         - xos_db
     volumes:
         - .:/root/setup:ro
-
-#xos_synchronizer_vbng:
-#    image: xosproject/xos-synchronizer-openstack
-#    command: bash -c "sleep 120; python /opt/xos/synchronizers/vbng/vbng-synchronizer.py -C /opt/xos/synchronizers/vbng/vbng_synchronizer_config"
-#    labels:
-#        org.xosproject.kind: synchronizer
-#        org.xosproject.target: vbng
-#    links:
-#        - xos_db
+    log_driver: "json-file"
+    log_opt:
+            max-size: "100k"
+            max-file: "5"
 
 xos_synchronizer_monitoring_channel:
     image: xosproject/xos-synchronizer-openstack
@@ -73,6 +80,10 @@
     volumes:
         - .:/root/setup:ro
         - ./id_rsa:/opt/xos/synchronizers/monitoring_channel/monitoring_channel_private_key:ro  # private key
+    log_driver: "json-file"
+    log_opt:
+            max-size: "100k"
+            max-file: "5"
 
 xos_synchronizer_vtr:
     image: xosproject/xos-synchronizer-openstack
@@ -85,6 +96,10 @@
     volumes:
         - .:/root/setup:ro
         - ./id_rsa:/opt/xos/synchronizers/vtr/vcpe_private_key:ro  # private key
+    log_driver: "json-file"
+    log_opt:
+            max-size: "100k"
+            max-file: "5"
 
 xos:
     command: python /opt/xos/manage.py runserver 0.0.0.0:80 --insecure --makemigrations
@@ -101,3 +116,8 @@
         - ./id_rsa.pub:/opt/xos/synchronizers/onos/onos_key.pub:ro
         - ./id_rsa.pub:/opt/xos/synchronizers/vcpe/vcpe_public_key:ro
         - ./id_rsa.pub:/opt/xos/synchronizers/monitoring_channel/monitoring_channel_public_key:ro
+    log_driver: "json-file"
+    log_opt:
+            max-size: "100k"
+            max-file: "5"
+
diff --git a/xos/configurations/cord-pod/make-vtn-external-yaml.sh b/xos/configurations/cord-pod/make-vtn-external-yaml.sh
index 8d0885d..a7f04c1 100644
--- a/xos/configurations/cord-pod/make-vtn-external-yaml.sh
+++ b/xos/configurations/cord-pod/make-vtn-external-yaml.sh
@@ -106,4 +106,4 @@
       properties:
           dependencies: org.onosproject.drivers, org.onosproject.drivers.ovsdb, org.onosproject.openflow-base, org.onosproject.ovsdb-base, org.onosproject.dhcp, org.onosproject.cordvtn, org.onosproject.olt, org.onosproject.igmp, org.onosproject.cordmcast
           autogenerate: vtn-network-cfg
-EOF
\ No newline at end of file
+EOF
diff --git a/xos/configurations/frontend/Makefile b/xos/configurations/frontend/Makefile
index 87f4bd8..9e18aec 100644
--- a/xos/configurations/frontend/Makefile
+++ b/xos/configurations/frontend/Makefile
@@ -29,10 +29,22 @@
 django-restart:
 	sudo docker exec frontend_xos_1 touch /opt/xos/xos/settings.py
 
+clean-config-folder:
+	sudo docker exec frontend_xos_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
+	sudo docker exec frontend_xos_1 rm -f /opt/xos/xos_configuration/xos_cord_config
+
 mock-cord-pod:
-	echo "make sure to add '../vtn/files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro' to volumes section of docker-compose.yml"
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/fixtures.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/cord-pod/mgmt-net.yaml
-	sudo docker-compose run xos bash -c "echo somekey > /opt/xos/synchronizers/vcpe/vcpe_public_key; python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/cord-pod/cord-vtn-vsg.yaml"
 	sudo docker exec frontend_xos_1 cp /opt/xos/configurations/cord-pod/xos_cord_config /opt/xos/xos_configuration/
 	sudo docker exec frontend_xos_1 touch /opt/xos/xos/settings.py
+
+
+
+mock-mcord:
+	# check this
+	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/fixtures.yaml
+	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/cord-pod/mgmt-net.yaml
+	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/frontend/mocks/mcord.yaml
+	sudo docker exec frontend_xos_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/
+	sudo docker exec frontend_xos_1 touch /opt/xos/xos/settings.py
diff --git a/xos/configurations/frontend/README.md b/xos/configurations/frontend/README.md
index c8f4097..b1a689c 100644
--- a/xos/configurations/frontend/README.md
+++ b/xos/configurations/frontend/README.md
@@ -42,6 +42,7 @@
 Sometimes while developing the GUI is usefull to have control over the DataModel. Sample `tosca` recipes for different configuration are defined in the `mocks` folder, and corresponding `make` commands are provided.
 
 - Bring up the **CORD** data model: `make mock-cord`
+- - Bring up the **M-CORD** data model: `make mock-mcord`
 
 ## JS Styleguide
 
diff --git a/xos/configurations/frontend/docker-compose.yml b/xos/configurations/frontend/docker-compose.yml
index 722ef96..835eb83 100644
--- a/xos/configurations/frontend/docker-compose.yml
+++ b/xos/configurations/frontend/docker-compose.yml
@@ -20,7 +20,7 @@
         - xos_db
     volumes:
       - ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config
-      - ../vtn/files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro
+      - ../../tosca:/opt/xos/tosca
       - ../../core/xoslib:/opt/xos/core/xoslib
       - ../../core/static:/opt/xos/core/static
       - ../../core/dashboard:/opt/xos/core/dashboard
@@ -30,3 +30,5 @@
       - ../../configurations:/opt/xos/configurations
       - ../../xos:/opt/xos/xos
       - ../../api:/opt/xos/api
+      - ../../services:/opt/xos/services
+
diff --git a/xos/configurations/frontend/mocks/MCORDServiceN.yaml b/xos/configurations/frontend/mocks/MCORDServiceN.yaml
new file mode 100644
index 0000000..bef7bb3
--- /dev/null
+++ b/xos/configurations/frontend/mocks/MCORDServiceN.yaml
@@ -0,0 +1,89 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Setup MCORD-related services.
+
+imports:
+   - custom_types/xos.yaml
+
+node_types:
+    tosca.nodes.MCORDComponent:
+        derived_from: tosca.nodes.Root
+        description: >
+            CORD: A Service Component of MCORD Service.
+        properties:
+            kind:
+                type: string
+                default: generic
+                description: Kind of component
+
+topology_template:
+  node_templates:
+    service_mcord:
+      type: tosca.nodes.Service
+      requirements:
+      properties:
+          kind: mcordservice
+
+
+    Private:
+      type: tosca.nodes.NetworkTemplate
+
+    mcord_network:
+      type: tosca.nodes.network.Network.XOS
+      properties:
+          ip_version: 4
+          labels: mcord_service_internal_net
+          cidr: 172.16.16.0/24
+          start_ip: 172.16.16.1
+          end_ip: 172.16.16.5
+          gateway_ip: 172.16.16.1
+
+      requirements:
+          - network_template:
+              node: Private
+              relationship: tosca.relationships.UsesNetworkTemplate
+          - owner:
+              node: mysite_mcord_slice1
+              relationship: tosca.relationships.MemberOfSlice
+          - connection:
+              node: mysite_mcord_slice1
+              relationship: tosca.relationships.ConnectsToSlice
+
+    mysite:
+      type: tosca.nodes.Site
+
+
+    ubuntu-14.04-server-cloudimg-amd64-disk1:
+      type: tosca.nodes.Image
+
+    trusty-server-multi-nic:
+      type: tosca.nodes.Image
+
+    mysite_mcord_slice1:
+      description: MCORD Service Slice 1
+      type: tosca.nodes.Slice
+      requirements:
+          - mcord_service:
+              node: service_mcord
+              relationship: tosca.relationships.MemberOfService
+          - site:
+              node: mysite
+              relationship: tosca.relationships.MemberOfSite
+          - default_image:
+                node: ubuntu-14.04-server-cloudimg-amd64-disk1 
+#                node: mcord-server-image-s1
+                relationship: tosca.relationships.DefaultImage
+      properties:
+          default_flavor: m1.medium
+          default_node: compute9 
+
+    my_service_mcord_component1:
+      description: MCORD Service default Component
+      type: tosca.nodes.MCORDComponent
+      requirements:
+          - provider_service:
+              node: service_mcord
+              relationship: tosca.relationships.MemberOfService
+          - mcord_slice:
+              node: mysite_mcord_slice1
+              relationship: tosca.relationships.MemberOfSlice
diff --git a/xos/configurations/frontend/mocks/MCORDServiceN.yml b/xos/configurations/frontend/mocks/MCORDServiceN.yml
new file mode 100644
index 0000000..8f764d0
--- /dev/null
+++ b/xos/configurations/frontend/mocks/MCORDServiceN.yml
@@ -0,0 +1,106 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Setup MCORD-related services.
+
+imports:
+   - custom_types/xos.yaml
+
+node_types:
+    tosca.nodes.MCORDComponent:
+        derived_from: tosca.nodes.Root
+        description: >
+            CORD: A Service Component of MCORD Service.
+        properties:
+            kind:
+                type: string
+                default: generic
+                description: Kind of component
+
+topology_template:
+  node_templates:
+    service_mcord:
+      type: tosca.nodes.Service
+      requirements:
+      properties:
+          kind: mcordservice
+
+
+    Private:
+      type: tosca.nodes.NetworkTemplate
+
+    mcord_network:
+      type: tosca.nodes.network.Network.XOS
+      properties:
+          ip_version: 4
+          labels: mcord_service_internal_net
+          cidr: 172.16.16.0/24
+          start_ip: 172.16.16.1
+          end_ip: 172.16.16.5
+          gateway_ip: 172.16.16.1
+
+      requirements:
+          - network_template:
+              node: Private
+              relationship: tosca.relationships.UsesNetworkTemplate
+          - owner:
+              node: mysite_mcord_slice1
+              relationship: tosca.relationships.MemberOfSlice
+          - connection:
+              node: mysite_mcord_slice1
+              relationship: tosca.relationships.ConnectsToSlice
+
+    mysite:
+      type: tosca.nodes.Site
+
+
+    mcord-server-image-s1:
+      type: tosca.nodes.Image
+
+    trusty-server-multi-nic:
+      type: tosca.nodes.Image
+
+    mysite_mcord_slice1:
+      description: MCORD Service Slice 1
+      type: tosca.nodes.Slice
+      requirements:
+          - mcord_service:
+              node: service_mcord
+              relationship: tosca.relationships.MemberOfService
+          - site:
+              node: mysite
+              relationship: tosca.relationships.MemberOfSite
+          - default_image:
+                node: trusty-server-multi-nic
+#                node: mcord-server-image-s1
+                relationship: tosca.relationships.DefaultImage
+      properties:
+          default_flavor: m1.medium
+          default_node: ip-10-0-10-125
+
+    my_service_mcord_component1:
+      description: MCORD Service default Component
+      type: tosca.nodes.MCORDComponent
+      # properties:
+      #     view_url: /mcord/?service=vBBU
+      #     kind: RAN
+      requirements:
+          - provider_service:
+              node: service_mcord
+              relationship: tosca.relationships.MemberOfService
+          - mcord_slice:
+              node: mysite_mcord_slice1
+              relationship: tosca.relationships.MemberOfSlice
+
+    # Nodes
+    compute9:
+      type: tosca.nodes.Node
+      properties:
+          view_url: /mcord/?service=vBBU
+          kind: RAN
+      requirements:
+        - site:
+            node: mysite
+            relationship: tosca.relationships.MemberOfSite
+        - deployment:
+            node: MyDeployment
+            relationship: tosca.relationships.MemberOfDeployment
diff --git a/xos/configurations/frontend/mocks/cord.yaml b/xos/configurations/frontend/mocks/cord.yaml
index 9ec0ae2..9d5aeaa 100644
--- a/xos/configurations/frontend/mocks/cord.yaml
+++ b/xos/configurations/frontend/mocks/cord.yaml
@@ -23,12 +23,6 @@
           gateway_mac: 02:42:0a:a8:00:01
     
     # CORD Services
-    service_vtr:
-      type: tosca.nodes.Service
-      properties:
-          view_url: /admin/vtr/vtrservice/$id$/
-          kind: vTR
-
     service_volt:
       type: tosca.nodes.Service
       requirements:
@@ -565,20 +559,3 @@
             - subscriber:
                 node: My House
                 relationship: tosca.relationships.BelongsToSubscriber
-
-    # DASHBOARDS
-    Customer Care:
-      type: tosca.nodes.DashboardView
-      properties:
-          url: template:xosDiagnostic
-
-    padmin@vicci.org:
-      type: tosca.nodes.User
-      properties:
-          firstname: XOS
-          lastname: admin
-          is_admin: true
-      requirements:
-          - customer_care_dashboard:
-              node: Customer Care
-              relationship: tosca.relationships.UsesDashboard
diff --git a/xos/configurations/frontend/mocks/mcord.yaml b/xos/configurations/frontend/mocks/mcord.yaml
new file mode 100644
index 0000000..6c10ad3
--- /dev/null
+++ b/xos/configurations/frontend/mocks/mcord.yaml
@@ -0,0 +1,319 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Setup CORD-related services
+
+imports:
+   - custom_types/xos.yaml
+
+topology_template:
+  node_templates:
+    # M-CORD Services
+    
+    # RAN
+    vBBU:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=vBBU
+          kind: RAN
+
+    eSON:
+      type: tosca.nodes.Service
+      properties:
+          view_url: http://www.google.com
+          kind: RAN
+
+    # EPC
+    vMME:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=vMME
+          kind: EPC
+
+    vSGW:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=vSGW
+          kind: EPC
+
+    vPGW:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=vPGW
+          kind: EPC
+
+    # EDGE
+    Cache:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=Cache
+          icon_url: /static/mCordServices/service_cache.png
+          kind: EDGE
+
+    Firewall:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=Firewall
+          icon_url: /static/mCordServices/service_firewall.png
+          kind: EDGE
+
+    Video Optimization:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=Video%20Optimization
+          icon_url: /static/mCordServices/service_video.png
+          kind: EDGE
+          
+    # Images
+    trusty-server-multi-nic:
+      type: tosca.nodes.Image
+      properties:
+         disk_format: QCOW2
+         container_format: BARE
+
+    # Deployments
+    StanfordDeployment:
+      type: tosca.nodes.Deployment
+      properties:
+          flavors: m1.large, m1.medium, m1.small
+      requirements:
+          - image:
+              node: trusty-server-multi-nic
+              relationship: tosca.relationships.SupportsImage
+
+    # Site
+    stanford:
+      type: tosca.nodes.Site
+      properties:
+          display_name: Stanford University
+          site_url: https://www.stanford.edu/
+      requirements:
+          - deployment:
+               node: StanfordDeployment
+               relationship: tosca.relationships.SiteDeployment
+               requirements:
+                   - controller:
+                       node: CloudLab
+                       relationship: tosca.relationships.UsesController
+
+
+    # Nodes
+    node1.stanford.edu:
+      type: tosca.nodes.Node
+      requirements:
+        - site:
+            node: stanford
+            relationship: tosca.relationships.MemberOfSite
+        - deployment:
+            node: StanfordDeployment
+            relationship: tosca.relationships.MemberOfDeployment
+
+    # Slices
+    stanford_slice:
+      description: Slice that contains sample instances
+      type: tosca.nodes.Slice
+      requirements:
+          - site:
+              node: stanford
+              relationship: tosca.relationships.MemberOfSite
+
+    # Instances
+    BBU_service_instance1:
+      type: tosca.nodes.Compute
+      capabilities:
+        # Host container properties
+        host:
+         properties:
+           num_cpus: 1
+           disk_size: 10 GB
+           mem_size: 4 MB
+        # Guest Operating System properties
+        os:
+          properties:
+            # host Operating System image properties
+            architecture: x86_64
+            type: linux
+            distribution: ubuntu
+            version: 14.04
+      requirements:
+          - slice:
+                node: stanford_slice
+                relationship: tosca.relationships.MemberOfSlice
+
+    BBU_service_instance2:
+      type: tosca.nodes.Compute
+      capabilities:
+        # Host container properties
+        host:
+         properties:
+           num_cpus: 1
+           disk_size: 10 GB
+           mem_size: 4 MB
+        # Guest Operating System properties
+        os:
+          properties:
+            # host Operating System image properties
+            architecture: x86_64
+            type: linux
+            distribution: ubuntu
+            version: 14.04
+      requirements:
+          - slice:
+                node: stanford_slice
+                relationship: tosca.relationships.MemberOfSlice
+
+    MME_service_instance1:
+      type: tosca.nodes.Compute
+      capabilities:
+        # Host container properties
+        host:
+         properties:
+           num_cpus: 1
+           disk_size: 10 GB
+           mem_size: 4 MB
+        # Guest Operating System properties
+        os:
+          properties:
+            # host Operating System image properties
+            architecture: x86_64
+            type: linux
+            distribution: ubuntu
+            version: 14.04
+      requirements:
+          - slice:
+                node: stanford_slice
+                relationship: tosca.relationships.MemberOfSlice
+
+    SGW_service_instance1:
+      type: tosca.nodes.Compute
+      capabilities:
+        # Host container properties
+        host:
+         properties:
+           num_cpus: 1
+           disk_size: 10 GB
+           mem_size: 4 MB
+        # Guest Operating System properties
+        os:
+          properties:
+            # host Operating System image properties
+            architecture: x86_64
+            type: linux
+            distribution: ubuntu
+            version: 14.04
+      requirements:
+          - slice:
+                node: stanford_slice
+                relationship: tosca.relationships.MemberOfSlice
+
+    PGW_service_instance1:
+      type: tosca.nodes.Compute
+      capabilities:
+        # Host container properties
+        host:
+         properties:
+           num_cpus: 1
+           disk_size: 10 GB
+           mem_size: 4 MB
+        # Guest Operating System properties
+        os:
+          properties:
+            # host Operating System image properties
+            architecture: x86_64
+            type: linux
+            distribution: ubuntu
+            version: 14.04
+      requirements:
+          - slice:
+                node: stanford_slice
+                relationship: tosca.relationships.MemberOfSlice
+
+    # Let's add a user who can be administrator of the household
+    johndoe@stanford.us:
+      type: tosca.nodes.User
+      properties:
+          password: letmein
+          firstname: john
+          lastname: doe
+      requirements:
+          - site:
+              node: stanford
+              relationship: tosca.relationships.MemberOfSite
+
+    # A subscriber
+    Stanford:
+       type: tosca.nodes.CORDSubscriber
+       properties:
+           service_specific_id: 123
+           firewall_enable: false
+           cdn_enable: false
+           url_filter_enable: false
+           url_filter_level: R
+       requirements:
+          - house_admin:
+              node: johndoe@stanford.us
+              relationship: tosca.relationships.AdminPrivilege
+
+    Barbera Lapinski:
+       type: tosca.nodes.CORDUser
+       properties:
+           mac: 01:02:03:04:05:06
+           level: PG_13
+       requirements:
+           - household:
+               node: Stanford
+               relationship: tosca.relationships.SubscriberDevice
+
+    Norbert Shumway:
+       type: tosca.nodes.CORDUser
+       properties:
+           mac: 90:E2:BA:82:F9:75
+           level: PG_13
+       requirements:
+           - household:
+               node: Stanford
+               relationship: tosca.relationships.SubscriberDevice
+
+    Fay Muldoon:
+       type: tosca.nodes.CORDUser
+       properties:
+           mac: 68:5B:35:9D:91:D5
+           level: PG_13
+       requirements:
+           - household:
+               node: Stanford
+               relationship: tosca.relationships.SubscriberDevice
+
+    Janene Earnest:
+       type: tosca.nodes.CORDUser
+       properties:
+           mac: 34:36:3B:C9:B6:A6
+           level: PG_13
+       requirements:
+           - household:
+               node: Stanford
+               relationship: tosca.relationships.SubscriberDevice
+
+
+    Topology:
+      type: tosca.nodes.DashboardView
+      properties:
+          url: template:xosMcordTopology
+
+    Ceilometer:
+      type: tosca.nodes.DashboardView
+      properties:
+          url: template:xosCeilometerDashboard
+
+    padmin@vicci.org:
+      type: tosca.nodes.User
+      properties:
+          firstname: XOS
+          lastname: admin
+          is_admin: true
+      requirements:
+          - mcord_dashboard:
+              node: Topology
+              relationship: tosca.relationships.UsesDashboard
+          - ceilometer_dashboard:
+              node: Ceilometer
+              relationship: tosca.relationships.UsesDashboard
diff --git a/xos/configurations/mcord/Makefile b/xos/configurations/mcord/Makefile
new file mode 100644
index 0000000..7f4d9a5
--- /dev/null
+++ b/xos/configurations/mcord/Makefile
@@ -0,0 +1,48 @@
+.PHONY: xos
+xos: nodes.yaml images.yaml
+	sudo docker-compose up -d
+	../common/wait_for_xos_port.sh 8000
+	sudo docker-compose run xos python /opt/xos/tosca/run.py none /opt/xos/configurations/common/fixtures.yaml
+	sudo docker-compose run xos python /opt/xos/tosca/run.py none /opt/xos/configurations/common/mydeployment.yaml
+	sudo docker-compose run xos python /opt/xos/tosca/run.py none /root/setup/setup.yaml
+	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/nodes.yaml
+	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/images.yaml
+	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/mgmt-net.yaml
+	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/mcord.yaml
+	sudo docker exec mcord_xos_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/
+	sudo docker exec mcord_xos_1 touch /opt/xos/xos/settings.py
+
+nodes.yaml:
+	export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
+
+images.yaml:
+	export SETUPDIR=.; bash ../common/make-images-yaml.sh
+
+.PHONY: local_containers
+local_containers:
+	cd ../../../containers/xos; make devel
+	cd ../../../containers/synchronizer; make
+enter-xos:
+	sudo docker exec -it mcord_xos_1 bash
+
+enter-os:
+	sudo docker exec -it mcord_xos_synchronizer_openstack_1 bash
+
+enter-vbbu:
+	sudo docker exec -it mcord_xos_synchronizer_vbbu_1 bash
+
+upgrade_pkgs:
+	sudo pip install httpie --upgrade
+
+rebuild_xos:
+	make -C ../../../containers/xos devel
+
+rebuild_synchronizer:
+	make -C ../../../containers/synchronizer
+
+stop:
+	docker-compose stop
+
+rm:
+	docker-compose stop; docker-compose rm
+
diff --git a/xos/configurations/mcord/docker-compose.yml b/xos/configurations/mcord/docker-compose.yml
new file mode 100644
index 0000000..8598396
--- /dev/null
+++ b/xos/configurations/mcord/docker-compose.yml
@@ -0,0 +1,59 @@
+xos_db:
+    image: xosproject/xos-postgres
+    expose:
+        - "5432"
+
+xos_synchronizer_openstack:
+    command: bash -c "sleep 120; python /opt/xos/synchronizers/openstack/xos-synchronizer.py"
+    image: xosproject/xos-synchronizer-openstack
+    labels:
+        org.xosproject.kind: synchronizer
+        org.xosproject.target: openstack
+    links:
+        - xos_db
+    volumes:
+        - .:/root/setup:ro
+        - ../setup/id_rsa:/opt/xos/configurations/mcord/mcord_private_key:ro  # private key
+    extra_hosts:
+        - "controller:10.102.81.3"
+        - "computeBBU1:10.102.81.6"
+        - "computeBBU2:10.102.81.7"
+        - "compute9:10.102.81.9"
+        - "compute10:10.102.81.10"
+
+xos_synchronizer_vbbu:
+    image: xosproject/xos-synchronizer-openstack
+    command: bash -c "sleep 120; python /opt/xos/synchronizers/vbbu/vbbu-synchronizer.py -C /opt/xos/synchronizers/vbbu/vbbu_config"
+    labels:
+        org.xosproject.kind: synchronizer
+        org.xosproject.target: vbbu 
+    links:
+        - xos_db
+    volumes:
+        - ../setup/id_rsa_mcord:/opt/xos/configurations/mcord/mcord_private_key:ro  # private key
+        - ../setup/id_rsa_mcord.pub:/opt/xos/configurations/mcord/mcord_public_key:ro  # public key
+        - ../setup:/root/setup:ro
+    extra_hosts:
+        - "controller:10.102.81.3"
+        - "computeBBU1:10.102.81.6"
+        - "computeBBU2:10.102.81.7"
+        - "compute9:10.102.81.9"
+        - "compute10:10.102.81.10"
+
+# FUTURE
+#xos_swarm_synchronizer:
+#    image: xosproject/xos-swarm-synchronizer
+#    labels:
+#        org.xosproject.kind: synchronizer
+#        org.xosproject.target: swarm
+
+xos:
+    command: python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
+    image: xosproject/xos
+    links:
+        - xos_db
+    ports:
+        - "8000:8000"
+    volumes:
+        - .:/root/setup:ro
+        - ../setup/id_rsa.pub:/opt/xos/configurations/mcord/mcord_public_key:ro  # private key
diff --git a/xos/configurations/mcord/images.yaml b/xos/configurations/mcord/images.yaml
new file mode 100644
index 0000000..2b62235
--- /dev/null
+++ b/xos/configurations/mcord/images.yaml
@@ -0,0 +1,18 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+imports:
+   - custom_types/xos.yaml
+
+description: autogenerated nodes file
+
+topology_template:
+  node_templates:
+    mysite:
+        type: tosca.nodes.Site
+
+    MyDeployment:
+      type: tosca.nodes.Deployment
+      properties:
+          flavors: m1.large, m1.medium, m1.small
+      requirements:
+
diff --git a/xos/configurations/mcord/mcord.yaml b/xos/configurations/mcord/mcord.yaml
new file mode 100644
index 0000000..42241f0
--- /dev/null
+++ b/xos/configurations/mcord/mcord.yaml
@@ -0,0 +1,241 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Setup MCORD-related services.
+
+imports:
+   - custom_types/xos.yaml
+
+node_types:
+
+    tosca.nodes.MCORDService:
+        derived_from: tosca.nodes.Root
+        description: >
+            An XOS Service object. Services may be listed in the Service
+            directory and may be linked together via Tenancy Relationships.
+        capabilities:
+            scalable:
+                type: tosca.capabilities.Scalable
+            service:
+                type: tosca.capabilities.xos.Service
+        properties:
+            no-delete:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to delete this object
+            no-create:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to create this object
+            no-update:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to update this object
+            kind:
+                type: string
+                default: RAN
+                description: Type of service.
+            view_url:
+                type: string
+                required: false
+                description: URL to follow when icon is clicked in the Service Directory.
+            icon_url:
+                type: string
+                required: false
+                description: ICON to display in the Service Directory.
+            enabled:
+                type: boolean
+                default: true
+            published:
+                type: boolean
+                default: true
+                description: If True then display this Service in the Service Directory.
+            public_key:
+                type: string
+                required: false
+                description: Public key to install into Instances to allows Services to SSH into them.
+            private_key_fn:
+                type: string
+                required: false
+                description: Location of private key file
+            versionNumber:
+                type: string
+                required: false
+                description: Version number of Service.
+
+    tosca.nodes.VBBUComponent:
+        derived_from: tosca.nodes.Root
+        description: >
+            CORD: vBBU Component of MCORD Service.
+        properties:
+            kind:
+                type: string
+                default: RAN 
+                description: Kind of component
+            s1u_tag:
+                type: string
+                required: false
+                default: 901
+                description: VTN stag port-name
+            s1mme_tag:
+                type: string
+                required: false
+                default: 900
+                description: VTN stag port-name
+            rru_tag:
+                type: string
+                required: false
+                default: 999 
+                description: VTN stag port-name
+            display_message:
+                type: string
+                required: false
+                default: New vBBU Component 
+                description: Just a message 
+                
+
+topology_template:
+  node_templates:
+    vBBU:
+      type: tosca.nodes.MCORDService
+      requirements:
+      properties:
+          kind: RAN
+          icon_url: /static/mCordServices/service_server.png
+          view_url: /admin/mcord/vbbucomponent
+          public_key: { get_artifact: [ SELF, pubkey, LOCAL_FILE] }
+          private_key_fn: /opt/xos/configurations/mcord/mcord_private_key
+      artifacts:
+          pubkey: /opt/xos/configurations/mcord/mcord_public_key
+
+    m1.xlarge:
+      type: tosca.nodes.Flavor
+
+    Private:
+      type: tosca.nodes.NetworkTemplate
+
+    External:
+      type: tosca.nodes.NetworkTemplate
+
+    management_template:
+      type: tosca.nodes.NetworkTemplate
+      properties:
+          visibility: private
+          translation: none
+
+    management:
+      type: tosca.nodes.network.Network.XOS
+#      properties:
+#          no-create: true
+#          no-delete: true
+#          no-update: true
+
+    lan_3gpp_s1mme_network:
+      type: tosca.nodes.network.Network.XOS
+      properties:
+          ip_version: 4
+          labels: lan_3gpp_s1uc_net
+          cidr: 172.16.1.0/24
+          start_ip: 172.16.1.3
+          end_ip: 172.16.1.12
+          gateway_ip: 172.16.1.1
+      requirements:
+          - network_template:
+              node: External
+              relationship: tosca.relationships.UsesNetworkTemplate
+          - owner:
+              node: mysite_mobile_net
+              relationship: tosca.relationships.MemberOfSlice
+          - connection:
+              node: mysite_vbbu_slice1
+              relationship: tosca.relationships.ConnectsToSlice
+
+    lan_3gpp_s1u_network:
+      type: tosca.nodes.network.Network.XOS
+      properties:
+          ip_version: 4
+          labels: lan_3gpp_s1u_net
+          cidr: 172.16.2.0/24
+          start_ip: 172.16.2.3
+          end_ip: 172.16.2.12
+          gateway_ip: 172.16.16.1
+      requirements:
+          - network_template:
+              node: External
+              relationship: tosca.relationships.UsesNetworkTemplate
+          - owner:
+              node: mysite_mobile_net
+              relationship: tosca.relationships.MemberOfSlice
+          - connection:
+              node: mysite_vbbu_slice1
+              relationship: tosca.relationships.ConnectsToSlice
+
+    lan_rru_network:
+      type: tosca.nodes.network.Network.XOS
+      properties:
+          ip_version: 4
+          labels: lan_rru_net
+          cidr: 172.16.0.0/24
+          start_ip: 172.16.0.3
+          end_ip: 172.16.0.12
+          gateway_ip: 172.16.0.1
+      requirements:
+          - network_template:
+              node: External
+              relationship: tosca.relationships.UsesNetworkTemplate
+          - owner:
+              node: mysite_mobile_net
+              relationship: tosca.relationships.MemberOfSlice
+          - connection:
+              node: mysite_vbbu_slice1
+              relationship: tosca.relationships.ConnectsToSlice
+
+    mysite:
+      type: tosca.nodes.Site
+
+    mcord-bbu-multi-nic:
+      type: tosca.nodes.Image
+
+    mysite_management:
+      description: This slice exists solely to own the management network
+      type: tosca.nodes.Slice
+      properties:
+          network: noauto
+      requirements:
+          - site:
+              node: mysite
+              relationship: tosca.relationships.MemberOfSite
+
+    mysite_mobile_net:
+      description: This slice exists solely to own the mobile network
+      type: tosca.nodes.Slice
+      properties:
+          network: noauto
+      requirements:
+          - site:
+              node: mysite
+              relationship: tosca.relationships.MemberOfSite
+
+    mysite_vbbu_slice1:
+      description: vBBU Service Slice 1
+      type: tosca.nodes.Slice
+      requirements:
+          - vBBU:
+              node: vBBU
+              relationship: tosca.relationships.MemberOfService
+          - site:
+              node: mysite
+              relationship: tosca.relationships.MemberOfSite
+          - default_image:
+                node: mcord-bbu-multi-nic 
+                relationship: tosca.relationships.DefaultImage
+          - default_flavor:
+                node: m1.xlarge
+                relationship: tosca.relationships.DefaultFlavor
+          - management:
+              node: management
+              relationship: tosca.relationships.ConnectsToNetwork
+      properties:
+          network: noauto
+#          default_flavor: m1.xlarge
+          default_node: computeBBU2 
+    
diff --git a/xos/configurations/mcord/mgmt-net.yaml b/xos/configurations/mcord/mgmt-net.yaml
new file mode 100644
index 0000000..ac8ad7e
--- /dev/null
+++ b/xos/configurations/mcord/mgmt-net.yaml
@@ -0,0 +1,40 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Set up management network for CORD POD
+imports:
+   - custom_types/xos.yaml
+
+topology_template:
+  node_templates:
+
+    management_template:
+      type: tosca.nodes.NetworkTemplate
+      properties:
+          visibility: private
+          translation: none
+
+    management:
+      type: tosca.nodes.network.Network
+      properties:
+          ip_version: 4
+          cidr: 10.102.83.0/24
+      requirements:
+          - network_template:
+              node: management_template
+              relationship: tosca.relationships.UsesNetworkTemplate
+          - owner:
+              node: mysite_management
+              relationship: tosca.relationships.MemberOfSlice
+
+    mysite:
+      type: tosca.nodes.Site
+
+    mysite_management:
+      description: This slice exists solely to own the management network
+      type: tosca.nodes.Slice
+      properties:
+          network: noauto
+      requirements:
+          - site:
+              node: mysite
+              relationship: tosca.relationships.MemberOfSite
diff --git a/xos/configurations/mcord/migrations/0001_initial.py b/xos/configurations/mcord/migrations/0001_initial.py
new file mode 100644
index 0000000..c53e548
--- /dev/null
+++ b/xos/configurations/mcord/migrations/0001_initial.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='MCORDService',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'MCORD Service',
+                'proxy': True,
+            },
+            bases=('core.service',),
+        ),
+        migrations.CreateModel(
+            name='VBBUComponent',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'VBBU MCORD Service Component',
+                'proxy': True,
+            },
+            bases=('core.tenantwithcontainer',),
+        ),
+    ]
diff --git a/xos/configurations/mcord/migrations/__init__.py b/xos/configurations/mcord/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/configurations/mcord/migrations/__init__.py
diff --git a/xos/configurations/mcord/nodes.yaml b/xos/configurations/mcord/nodes.yaml
new file mode 100644
index 0000000..ae22112
--- /dev/null
+++ b/xos/configurations/mcord/nodes.yaml
@@ -0,0 +1,24 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+imports:
+   - custom_types/xos.yaml
+
+description: autogenerated nodes file
+
+topology_template:
+  node_templates:
+    MyDeployment:
+        type: tosca.nodes.Deployment
+    mysite:
+        type: tosca.nodes.Site
+
+    computeBBU2:
+        type: tosca.nodes.Node
+        requirements:
+          - site:
+              node: mysite 
+              relationship: tosca.relationships.MemberOfSite
+          - deployment:
+              node: MyDeployment
+              relationship: tosca.relationships.MemberOfDeployment
+
diff --git a/xos/configurations/mcord/postgresql/Dockerfile b/xos/configurations/mcord/postgresql/Dockerfile
new file mode 100644
index 0000000..4d4ebfd
--- /dev/null
+++ b/xos/configurations/mcord/postgresql/Dockerfile
@@ -0,0 +1,35 @@
+FROM ubuntu
+
+RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
+
+RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --force-yes\
+    python-software-properties \
+    software-properties-common \
+    postgresql-9.3 \
+    postgresql-client-9.3 \
+    postgresql-contrib-9.3
+
+# Workaround for AUFS issue
+# https://github.com/docker/docker/issues/783#issuecomment-56013588
+RUN mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private
+
+USER postgres
+
+RUN /etc/init.d/postgresql start && \
+    psql --command "ALTER USER postgres WITH SUPERUSER PASSWORD 'password' " && \
+    psql --command "CREATE DATABASE xos"
+
+# Allow remote connections. 
+RUN echo "host all  all    0.0.0.0/0  md5" >> /etc/postgresql/9.3/main/pg_hba.conf
+RUN echo "host all  all    0.0.0.0/0  password" >> /etc/postgresql/9.3/main/pg_hba.conf
+
+RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
+
+# Expose the PostgreSQL port
+EXPOSE 5432
+
+VOLUME  ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
+
+CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"]
diff --git a/xos/configurations/mcord/postgresql/Makefile b/xos/configurations/mcord/postgresql/Makefile
new file mode 100644
index 0000000..c50923e
--- /dev/null
+++ b/xos/configurations/mcord/postgresql/Makefile
@@ -0,0 +1,25 @@
+IMAGE_NAME:=xosproject/xos-postgres
+CONTAINER_NAME:=xos-db-postgres
+NO_DOCKER_CACHE?=false
+
+.PHONY: build
+build: ; docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} .
+
+.PHONY: run
+run: ; docker run -d -p 5432:5432 --name ${CONTAINER_NAME} ${IMAGE_NAME}
+
+.PHONY: stop
+stop: ; docker stop ${CONTAINER_NAME}
+
+.PHONY: rm
+rm: ; docker rm ${CONTAINER_NAME}
+
+.PHONE: rmi
+rmi: ; docker rmi ${IMAGE_NAME}
+
+.PHONY: backup
+backupvol: ; docker run --volumes-from ${CONTAINER_NAME} -v /backup:/backup postgres tar cvf /backup/backup-postgres.tar /var/lib/postgresql
+
+.PHONY: restore
+restorevol: ; docker run --volumes-from ${CONTAINER_NAME} -v /backup:/backup postgres cd /var/lib/postgresql && tar xvf /backup/backup-postgres.tar
+
diff --git a/xos/configurations/mcord/setup.yaml b/xos/configurations/mcord/setup.yaml
new file mode 100644
index 0000000..0dd2769
--- /dev/null
+++ b/xos/configurations/mcord/setup.yaml
@@ -0,0 +1,254 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: >
+    * Adds OpenCloud Sites, Deployments, and Controllers.
+
+imports:
+   - custom_types/xos.yaml
+
+topology_template:
+  node_templates:
+
+    MyDeployment:
+      type: tosca.nodes.Deployment
+      properties:
+          flavors: m1.xlarge, m1.large, m1.medium, m1.small
+
+    m1.xlarge:
+      type: tosca.nodes.Flavor
+
+
+    MyOpenStack:
+      type: tosca.nodes.Controller
+      requirements:
+          - deployment:
+              node: MyDeployment
+              relationship: tosca.relationships.ControllerDeployment
+      properties:
+          backend_type: OpenStack
+          version: Kilo
+          auth_url: { get_script_env: [ SELF, adminrc, OS_AUTH_URL, LOCAL_FILE] }
+          admin_user: { get_script_env: [ SELF, adminrc, OS_USERNAME, LOCAL_FILE] }
+          admin_password: { get_script_env: [ SELF, adminrc, OS_PASSWORD, LOCAL_FILE] }
+          admin_tenant: { get_script_env: [ SELF, adminrc, OS_TENANT_NAME, LOCAL_FILE] }
+          domain: Default
+      artifacts:
+          adminrc: /root/setup/admin-openrc.sh
+
+    mysite:
+      type: tosca.nodes.Site
+      properties:
+          display_name: MySite
+          site_url: http://xosproject.org/
+      requirements:
+          - deployment:
+               node: MyDeployment
+               relationship: tosca.relationships.SiteDeployment
+               requirements:
+                   - controller:
+                       node: MyOpenStack
+                       relationship: tosca.relationships.UsesController
+    Topology:
+      type: tosca.nodes.DashboardView
+      properties:
+          url: template:xosMcordTopology
+
+    # This user already exists in XOS with this password
+    # It's an example of how to create new users
+    padmin@vicci.org:
+      type: tosca.nodes.User
+      properties:
+          is_admin: true
+          is_active: true
+          firstname: XOS
+          lastname: admin
+          password: letmein
+      requirements:
+          - site:
+              node: mysite
+              relationship: tosca.relationships.MemberOfSite
+          - mcord_dashboard:
+              node: Topology
+              relationship: tosca.relationships.UsesDashboard
+
+    johndoe@stanford.us:
+      type: tosca.nodes.User
+      properties:
+          is_active: true
+          password: letmein
+          firstname: john
+          lastname: doe
+      requirements:
+          - site:
+              node: mysite
+              relationship: tosca.relationships.MemberOfSite
+    
+    # A subscriber
+    Stanford:
+       type: tosca.nodes.CORDSubscriber
+       properties:
+           service_specific_id: 123
+           firewall_enable: false
+           cdn_enable: false
+           url_filter_enable: false
+           url_filter_level: R
+       requirements:
+          - house_admin:
+              node: johndoe@stanford.us
+              relationship: tosca.relationships.AdminPrivilege
+
+    Barbera Lapinski:
+       type: tosca.nodes.CORDUser
+       properties:
+           mac: 01:02:03:04:05:06
+           level: PG_13
+       requirements:
+           - household:
+               node: Stanford
+               relationship: tosca.relationships.SubscriberDevice
+
+    Norbert Shumway:
+       type: tosca.nodes.CORDUser
+       properties:
+           mac: 90:E2:BA:82:F9:75
+           level: PG_13
+       requirements:
+           - household:
+               node: Stanford
+               relationship: tosca.relationships.SubscriberDevice
+
+    Fay Muldoon:
+       type: tosca.nodes.CORDUser
+       properties:
+           mac: 68:5B:35:9D:91:D5
+           level: PG_13
+       requirements:
+           - household:
+               node: Stanford
+               relationship: tosca.relationships.SubscriberDevice
+
+    Janene Earnest:
+       type: tosca.nodes.CORDUser
+       properties:
+           mac: 34:36:3B:C9:B6:A6
+           level: PG_13
+       requirements:
+           - household:
+               node: Stanford
+               relationship: tosca.relationships.SubscriberDevice
+
+    RRU:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=vBBU
+          icon_url: /static/mCordServices/service_rru.png
+          kind: RAN
+
+    eSON:
+      type: tosca.nodes.Service
+      properties:
+          icon_url: /static/mCordServices/service_server.png
+          view_url: http://www.google.com
+          kind: RAN
+
+    # EPC
+    vMME:
+      type: tosca.nodes.Service
+      properties:
+          icon_url: /static/mCordServices/service_server.png
+          view_url: /mcord/?service=vMME
+          kind: vEPC
+
+    vSGW:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=vSGW
+          icon_url: /static/mCordServices/service_server.png
+          kind: vEPC
+
+    vPGW:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=vPGW
+          icon_url: /static/mCordServices/service_server.png
+          kind: vEPC
+
+    # EDGE
+    Cache:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=Cache
+          icon_url: /static/mCordServices/service_cache.png
+          kind: EDGE
+
+    Firewall:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=Firewall
+          icon_url: /static/mCordServices/service_firewall.png
+          kind: EDGE
+
+    Video Optimization:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=Video%20Optimization
+          icon_url: /static/mCordServices/service_video.png
+          kind: EDGE
+
+    RRU:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=vBBU
+          icon_url: /static/mCordServices/service_rru.png
+          kind: RAN
+    eSON:
+      type: tosca.nodes.Service
+      properties:
+          icon_url: /static/mCordServices/service_server.png
+          view_url: http://www.google.com
+          kind: RAN
+
+    # EPC
+    vMME:
+      type: tosca.nodes.Service
+      properties:
+          icon_url: /static/mCordServices/service_server.png
+          view_url: /mcord/?service=vMME
+          kind: vEPC
+
+    vSGW:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=vSGW
+          icon_url: /static/mCordServices/service_server.png
+          kind: vEPC
+
+    vPGW:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=vPGW
+          icon_url: /static/mCordServices/service_server.png
+          kind: vEPC
+
+    # EDGE
+    Cache:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=Cache
+          icon_url: /static/mCordServices/service_cache.png
+          kind: EDGE
+
+    Firewall:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=Firewall
+          icon_url: /static/mCordServices/service_firewall.png
+          kind: EDGE
+
+    Video Optimization:
+      type: tosca.nodes.Service
+      properties:
+          view_url: /mcord/?service=Video%20Optimization
+          icon_url: /static/mCordServices/service_video.png
+          kind: EDGE
+
diff --git a/xos/configurations/mcord/synchronizer/Dockerfile b/xos/configurations/mcord/synchronizer/Dockerfile
new file mode 100644
index 0000000..011e8dd
--- /dev/null
+++ b/xos/configurations/mcord/synchronizer/Dockerfile
@@ -0,0 +1,48 @@
+FROM       xosproject/xos
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
+    openssh-client \
+    python-crypto \
+    python-jinja2 \
+    python-paramiko \
+    python-yaml \
+    python-httplib2 \
+    rsync \
+    supervisor
+
+RUN pip install -U \
+    jinja2
+
+# Install custom Ansible
+RUN \
+    git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible && \
+    git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras && \
+    git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras && \
+    git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core && \
+    git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core && \
+    # git clone uses cached copy, doesn't pick up latest
+    git -C /opt/ansible pull && \
+    git -C /opt/ansible/lib/ansible/modules/core pull && \
+    git -C /opt/ansible/v2/ansible/modules/core pull
+
+
+# For Observer
+RUN mkdir -p /usr/local/share /bin /etc/ansible
+
+COPY conf/ansible-hosts /etc/ansible/hosts
+
+ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/
+
+RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum && \
+    cd /tmp/fofum; python setup.py install && \
+    rm -rf /tmp/fofum && \
+    tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/ && \
+    rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 && \
+    ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs && \
+    ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs
+
+
+# Supervisor
+COPY conf/synchronizer.conf /etc/supervisor/conf.d/
+
+CMD update-ca-certificates && /usr/bin/supervisord -c /etc/supervisor/conf.d/synchronizer.conf
diff --git a/xos/configurations/mcord/synchronizer/Makefile b/xos/configurations/mcord/synchronizer/Makefile
new file mode 100644
index 0000000..352616a
--- /dev/null
+++ b/xos/configurations/mcord/synchronizer/Makefile
@@ -0,0 +1,15 @@
+IMAGE_NAME:=xosproject/xos-synchronizer-openstack
+CONTAINER_NAME:=xos-synchronizer
+NO_DOCKER_CACHE?=false
+
+.PHONY: build
+build: ; sudo docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} .
+
+.PHONY: run
+run: ; sudo docker run -d --name ${CONTAINER_NAME} -v /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro ${IMAGE_NAME}
+
+.PHONY: stop
+stop: ; sudo docker stop ${CONTAINER_NAME}
+
+.PHONY: rm
+rm: ; sudo docker rm ${CONTAINER_NAME}
diff --git a/xos/configurations/mcord/synchronizer/conf/ansible-hosts b/xos/configurations/mcord/synchronizer/conf/ansible-hosts
new file mode 100644
index 0000000..0dd74f1
--- /dev/null
+++ b/xos/configurations/mcord/synchronizer/conf/ansible-hosts
@@ -0,0 +1,2 @@
+[localhost]
+127.0.0.1
diff --git a/xos/configurations/mcord/synchronizer/conf/synchronizer.conf b/xos/configurations/mcord/synchronizer/conf/synchronizer.conf
new file mode 100644
index 0000000..2131a25
--- /dev/null
+++ b/xos/configurations/mcord/synchronizer/conf/synchronizer.conf
@@ -0,0 +1,9 @@
+[supervisord]
+logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
+pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
+nodaemon=true
+
+[program:synchronizer]
+command=python /opt/xos/synchronizers/openstack/xos-synchronizer.py
+stderr_logfile=/var/log/supervisor/synchronizer.err.log
+stdout_logfile=/var/log/supervisor/synchronizer.out.log
diff --git a/xos/configurations/mcord/vbbu.yaml b/xos/configurations/mcord/vbbu.yaml
new file mode 100644
index 0000000..ee535e3
--- /dev/null
+++ b/xos/configurations/mcord/vbbu.yaml
@@ -0,0 +1,251 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Setup MCORD-related services.
+
+imports:
+   - custom_types/xos.yaml
+
+node_types:
+
+    tosca.nodes.MCORDService:
+        derived_from: tosca.nodes.Root
+        description: >
+            An XOS Service object. Services may be listed in the Service
+            directory and may be linked together via Tenancy Relationships.
+        capabilities:
+            scalable:
+                type: tosca.capabilities.Scalable
+            service:
+                type: tosca.capabilities.xos.Service
+        properties:
+            no-delete:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to delete this object
+            no-create:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to create this object
+            no-update:
+                type: boolean
+                default: false
+                description: Do not allow Tosca to update this object
+            kind:
+                type: string
+                default: RAN
+                description: Type of service.
+            view_url:
+                type: string
+                required: false
+                description: URL to follow when icon is clicked in the Service Directory.
+            icon_url:
+                type: string
+                required: false
+                description: ICON to display in the Service Directory.
+            enabled:
+                type: boolean
+                default: true
+            published:
+                type: boolean
+                default: true
+                description: If True then display this Service in the Service Directory.
+            public_key:
+                type: string
+                required: false
+                description: Public key to install into Instances to allows Services to SSH into them.
+            private_key_fn:
+                type: string
+                required: false
+                description: Location of private key file
+            versionNumber:
+                type: string
+                required: false
+                description: Version number of Service.
+
+    tosca.nodes.VBBUComponent:
+        derived_from: tosca.nodes.Root
+        description: >
+            CORD: vBBU Component of MCORD Service.
+        properties:
+            kind:
+                type: string
+                default: RAN 
+                description: Kind of component
+            s1u_tag:
+                type: string
+                required: false
+                default: 201
+                description: VTN stag port-name
+            s1mme_tag:
+                type: string
+                required: false
+                default: 200
+                description: VTN stag port-name
+            rru_tag:
+                type: string
+                required: false
+                default: 199 
+                description: VTN stag port-name
+            display_message:
+                type: string
+                required: false
+                default: New vBBU Component 
+                description: Just a message 
+                
+
+topology_template:
+  node_templates:
+    vBBU:
+      type: tosca.nodes.MCORDService
+      requirements:
+      properties:
+          kind: RAN
+          icon_url: /static/mCordServices/service_server.png
+          view_url: /admin/mcord/vbbucomponent
+          public_key: { get_artifact: [ SELF, pubkey, LOCAL_FILE] }
+          private_key_fn: /opt/xos/configurations/mcord/mcord_private_key
+      artifacts:
+          pubkey: /opt/xos/configurations/mcord/mcord_public_key
+
+
+    Private:
+      type: tosca.nodes.NetworkTemplate
+
+    External:
+      type: tosca.nodes.NetworkTemplate
+
+    management_template:
+      type: tosca.nodes.NetworkTemplate
+      properties:
+          visibility: private
+          translation: none
+
+    management:
+      type: tosca.nodes.network.Network.XOS
+#      properties:
+#          no-create: true
+#          no-delete: true
+#          no-update: true
+
+    lan_3gpp_s1mme_network:
+      type: tosca.nodes.network.Network.XOS
+      properties:
+          ip_version: 4
+          labels: lan_3gpp_s1uc_net
+          cidr: 172.16.1.0/24
+          start_ip: 172.16.1.3
+          end_ip: 172.16.1.12
+          gateway_ip: 172.16.1.1
+      requirements:
+          - network_template:
+              node: External
+              relationship: tosca.relationships.UsesNetworkTemplate
+          - owner:
+              node: mysite_mobile_net
+              relationship: tosca.relationships.MemberOfSlice
+          - connection:
+              node: mysite_vbbu_slice1
+              relationship: tosca.relationships.ConnectsToSlice
+
+    lan_3gpp_s1u_network:
+      type: tosca.nodes.network.Network.XOS
+      properties:
+          ip_version: 4
+          labels: lan_3gpp_s1u_net
+          cidr: 172.16.2.0/24
+          start_ip: 172.16.2.3
+          end_ip: 172.16.2.12
+          gateway_ip: 172.16.16.1
+      requirements:
+          - network_template:
+              node: External
+              relationship: tosca.relationships.UsesNetworkTemplate
+          - owner:
+              node: mysite_mobile_net
+              relationship: tosca.relationships.MemberOfSlice
+          - connection:
+              node: mysite_vbbu_slice1
+              relationship: tosca.relationships.ConnectsToSlice
+
+    lan_rru_network:
+      type: tosca.nodes.network.Network.XOS
+      properties:
+          ip_version: 4
+          labels: lan_rru_net
+          cidr: 172.16.0.0/24
+          start_ip: 172.16.0.3
+          end_ip: 172.16.0.12
+          gateway_ip: 172.16.0.1
+      requirements:
+          - network_template:
+              node: External
+              relationship: tosca.relationships.UsesNetworkTemplate
+          - owner:
+              node: mysite_mobile_net
+              relationship: tosca.relationships.MemberOfSlice
+          - connection:
+              node: mysite_vbbu_slice1
+              relationship: tosca.relationships.ConnectsToSlice
+
+    mysite:
+      type: tosca.nodes.Site
+
+    mcord-bbu-multi-nic:
+      type: tosca.nodes.Image
+
+    mysite_management:
+      description: This slice exists solely to own the management network
+      type: tosca.nodes.Slice
+      properties:
+          network: noauto
+      requirements:
+          - site:
+              node: mysite
+              relationship: tosca.relationships.MemberOfSite
+
+    mysite_mobile_net:
+      description: This slice exists solely to own the mobile network
+      type: tosca.nodes.Slice
+      properties:
+          network: noauto
+      requirements:
+          - site:
+              node: mysite
+              relationship: tosca.relationships.MemberOfSite
+
+    mysite_vbbu_slice1:
+      description: vBBU Service Slice 1
+      type: tosca.nodes.Slice
+      requirements:
+          - vBBU:
+              node: vBBU
+              relationship: tosca.relationships.MemberOfService
+          - site:
+              node: mysite
+              relationship: tosca.relationships.MemberOfSite
+          - default_image:
+                node: mcord-bbu-multi-nic 
+                relationship: tosca.relationships.DefaultImage
+          - management:
+              node: management
+              relationship: tosca.relationships.ConnectsToNetwork
+      properties:
+          network: noauto
+          default_flavor: m1.xlarge
+          default_node: computeBBU2 
+    
+    mysite_VBBU_Component:
+      description: MCORD Service default Component
+      type: tosca.nodes.VBBUComponent
+      requirements:
+          - provider_service:
+              node: vBBU
+              relationship: tosca.relationships.MemberOfService
+          - vbbu_slice:
+              node: mysite_vbbu_slice1
+              relationship: tosca.relationships.MemberOfSlice
+      properties:
+          display_message: vBBU looks good!
+          s1u_tag: 201
+          s1mme_tag: 200
+          rru_tag: 199 
diff --git a/xos/configurations/mcord/xos/Dockerfile b/xos/configurations/mcord/xos/Dockerfile
new file mode 100644
index 0000000..f65eb37
--- /dev/null
+++ b/xos/configurations/mcord/xos/Dockerfile
@@ -0,0 +1,94 @@
+FROM       ubuntu:14.04.3
+
+# XXX Workaround for docker bug:
+# https://github.com/docker/docker/issues/6345
+# Kernel 3.15 breaks docker, uss the line below as a workaround
+# until there is a fix
+RUN ln -s -f /bin/true /usr/bin/chfn
+# XXX End workaround
+
+# Install.
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
+    curl \
+    gcc \
+    geoip-database \
+    git \
+    graphviz \
+    graphviz-dev \
+    libgeoip1 \
+    libxslt1.1 \
+    libxslt1-dev \
+    libyaml-dev \
+    m4 \
+    pkg-config \
+    python-dev \
+    python-httplib2 \
+    python-pip \
+    python-psycopg2 \
+    python-pycurl \
+    python-setuptools \
+    tar \
+    wget \
+##### observer dependencies
+    python-keystoneclient \
+    python-novaclient \
+    python-neutronclient \
+    python-glanceclient \
+    python-ceilometerclient
+
+RUN pip install \
+    django==1.7 \
+    django-bitfield \
+    django-crispy-forms \
+    django-encrypted-fields \
+    django-extensions \
+    django-filter==0.11.0 \
+    django-geoposition \
+    django-ipware \
+    django_rest_swagger \
+    django-suit==0.3a1 \
+    django-timezones \
+    djangorestframework==2.4.4 \
+    dnslib \
+    lxml \
+    markdown \
+    netaddr \
+    pyOpenSSL \
+    psycopg2 \
+    python-ceilometerclient \
+    python-dateutil \
+    python-keyczar \
+    pygraphviz \
+    pytz \
+    pyyaml \
+    requests
+
+RUN easy_install --upgrade httplib2
+
+RUN easy_install \
+    python_gflags \
+    google_api_python_client \
+    httplib2.ca_certs_locater
+
+ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
+
+# Install XOS
+RUN git clone git://github.com/open-cloud/xos.git /tmp/xos && \
+    mv /tmp/xos/xos /opt/ && \
+    chmod +x /opt/xos/tools/xos-manage && \
+    /opt/xos/tools/xos-manage genkeys
+
+# install Tosca engine
+RUN chmod +x /opt/xos/tosca/run.py
+RUN bash /opt/xos/tosca/install_tosca.sh
+
+EXPOSE 8000
+
+# Set environment variables.
+ENV HOME /root
+
+# Define working directory.
+WORKDIR /opt/xos
+
+# Define default command.
+CMD update-ca-certificates && python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
diff --git a/xos/configurations/mcord/xos/Dockerfile.devel b/xos/configurations/mcord/xos/Dockerfile.devel
new file mode 100644
index 0000000..e0d0c6d
--- /dev/null
+++ b/xos/configurations/mcord/xos/Dockerfile.devel
@@ -0,0 +1,94 @@
+FROM       ubuntu:14.04.3
+
+# XXX Workaround for docker bug:
+# https://github.com/docker/docker/issues/6345
+# Kernel 3.15 breaks docker, uss the line below as a workaround
+# until there is a fix
+RUN ln -s -f /bin/true /usr/bin/chfn
+# XXX End workaround
+
+# Install.
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
+    curl \
+    gcc \
+    geoip-database \
+    git \
+    graphviz \
+    graphviz-dev \
+    libgeoip1 \
+    libxslt1.1 \
+    libxslt1-dev \
+    libyaml-dev \
+    m4 \
+    pkg-config \
+    python-dev \
+    python-httplib2 \
+    python-pip \
+    python-psycopg2 \
+    python-pycurl \
+    python-setuptools \
+    tar \
+    wget \
+##### observer dependencies
+    python-keystoneclient \
+    python-novaclient \
+    python-neutronclient \
+    python-glanceclient \
+    python-ceilometerclient
+
+RUN pip install \
+    django==1.7 \
+    django-bitfield \
+    django-crispy-forms \
+    django-encrypted-fields \
+    django-extensions \
+    django-filter==0.11.0 \
+    django-geoposition \
+    django-ipware \
+    django_rest_swagger \
+    django-suit==0.3a1 \
+    django-timezones \
+    djangorestframework==2.4.4 \
+    dnslib \
+    lxml \
+    markdown \
+    netaddr \
+    pyOpenSSL \
+    psycopg2 \
+    python-ceilometerclient \
+    python-dateutil \
+    python-keyczar \
+    pygraphviz \
+    pytz \
+    pyyaml \
+    requests
+
+RUN easy_install --upgrade httplib2
+
+RUN easy_install \
+    python_gflags \
+    google_api_python_client \
+    httplib2.ca_certs_locater
+
+ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
+
+# Install XOS
+ADD xos /opt/xos
+RUN chmod +x /opt/xos/tools/xos-manage
+RUN /opt/xos/tools/xos-manage genkeys
+
+# install Tosca engine
+RUN chmod +x /opt/xos/tosca/run.py
+RUN bash /opt/xos/tosca/install_tosca.sh
+
+EXPOSE 8000
+
+# Set environment variables.
+ENV HOME /root
+
+# Define working directory.
+WORKDIR /opt/xos
+
+# RUN python /opt/xos/manage.py makemigrations mcordservice 
+# Define default command.
+CMD update-ca-certificates && python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
diff --git a/xos/configurations/mcord/xos/Dockerfile.templ b/xos/configurations/mcord/xos/Dockerfile.templ
new file mode 100644
index 0000000..25270a6
--- /dev/null
+++ b/xos/configurations/mcord/xos/Dockerfile.templ
@@ -0,0 +1,88 @@
+FROM       ubuntu:14.04.3
+
+# XXX Workaround for docker bug:
+# https://github.com/docker/docker/issues/6345
+# Kernel 3.15 breaks docker, uss the line below as a workaround
+# until there is a fix
+RUN ln -s -f /bin/true /usr/bin/chfn
+# XXX End workaround
+
+# Install.
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
+    curl \
+    gcc \
+    geoip-database \
+    git \
+    graphviz \
+    graphviz-dev \
+    libgeoip1 \
+    libxslt1.1 \
+    libxslt1-dev \
+    libyaml-dev \
+    m4 \
+    pkg-config \
+    python-dev \
+    python-httplib2 \
+    python-pip \
+    python-psycopg2 \
+    python-pycurl \
+    python-setuptools \
+    tar \
+    wget \
+##### observer dependencies
+    python-keystoneclient \
+    python-novaclient \
+    python-neutronclient \
+    python-glanceclient \
+    python-ceilometerclient
+
+RUN pip install -U \
+    django==1.7 \
+    django-bitfield \
+    django-crispy-forms \
+    django-encrypted-fields \
+    django_evolution \
+    django-extensions \
+    django-filter==0.11.0 \
+    django-geoposition \
+    django-ipware \
+    django_rest_swagger \
+    django-suit==0.3a1 \
+    django-timezones \
+    djangorestframework==2.4.4 \
+    dnslib \
+    google_api_python_client \
+    httplib2 \
+    httplib2.ca_certs_locater \
+    lxml \
+    markdown \
+    netaddr \
+    python-dateutil \
+    python_gflags \
+    python-keyczar \
+    pygraphviz \
+    pytz \
+    pyyaml \
+    requests
+
+ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
+
+# Install XOS
+RUN git clone XOS_GIT_REPO -b XOS_GIT_BRANCH /tmp/xos && \
+    mv /tmp/xos/xos /opt/ && \
+    chmod +x /opt/xos/tools/xos-manage && \
+    /opt/xos/tools/xos-manage genkeys
+
+# install Tosca engine
+RUN bash /opt/xos/tosca/install_tosca.sh
+
+EXPOSE 8000
+
+# Set environment variables.
+ENV HOME /root
+
+# Define working directory.
+WORKDIR /root
+
+# Define default command.
+CMD update-ca-certificates && python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
diff --git a/xos/configurations/mcord/xos/Makefile b/xos/configurations/mcord/xos/Makefile
new file mode 100644
index 0000000..0ba043d
--- /dev/null
+++ b/xos/configurations/mcord/xos/Makefile
@@ -0,0 +1,27 @@
+CONTAINER_NAME:=xos-server
+IMAGE_NAME:=xosproject/xos
+TOSCA_CONFIG_PATH:=/opt/xos/configurations/opencloud/opencloud.yaml
+XOS_GIT_REPO?=git://github.com/open-cloud/xos.git
+XOS_GIT_BRANCH?=master
+NO_DOCKER_CACHE?=false
+
+.PHONY: build
+build: ; sudo docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} .
+
+.PHONY: custom
+custom: ; cat Dockerfile.templ | sed -e "s|XOS_GIT_REPO|${XOS_GIT_REPO}|g" -e "s|XOS_GIT_BRANCH|${XOS_GIT_BRANCH}|g" | docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} -
+
+.PHONY: devel
+devel: ; cd ../..; ls; sudo docker build -f containers/xos/Dockerfile.devel --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} .
+
+.PHONY: run
+run: ; sudo docker run -d --name ${CONTAINER_NAME} -p 80:8000 -v /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro ${IMAGE_NAME}
+
+.PHONY: runtosca
+runtosca: ; sudo docker exec -it ${CONTAINER_NAME} /usr/bin/python /opt/xos/tosca/run.py padmin@vicci.org ${TOSCA_CONFIG_PATH}
+
+.PHONY: stop
+stop: ; sudo docker stop ${CONTAINER_NAME}
+
+.PHONY: rm
+rm: ; sudo docker rm ${CONTAINER_NAME}
diff --git a/xos/configurations/mcord/xos/initdb b/xos/configurations/mcord/xos/initdb
new file mode 100755
index 0000000..1f5b770
--- /dev/null
+++ b/xos/configurations/mcord/xos/initdb
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+IMAGE_NAME=xosproject/xos
+CONTAINER_NAME=xos_build_helper_$$
+DB_HOST=$(wget http://ipinfo.io/ip -qO -)
+
+# configure db host
+docker run -it --name=$CONTAINER_NAME $IMAGE_NAME sed -i '0,/host/{s/host=localhost/host='$DB_HOST'/}' /opt/xos/xos_configuration/xos_common_config
+docker commit $CONTAINER_NAME $IMAGE_NAME
+docker rm $CONTAINER_NAME
+
+# init db schema
+docker run -it --name=$CONTAINER_NAME $IMAGE_NAME /opt/xos/tools/xos-manage makemigrations
+# run overrides the CMD specifed in the Dockerfile, so we re-set the CMD in the final commit"
+docker commit --change="CMD update-ca-certificates && python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_NAME $IMAGE_NAME
+docker rm $CONTAINER_NAME
diff --git a/xos/configurations/mcord/xos_mcord_config b/xos/configurations/mcord/xos_mcord_config
new file mode 100644
index 0000000..8f4034d
--- /dev/null
+++ b/xos/configurations/mcord/xos_mcord_config
@@ -0,0 +1,6 @@
+[gui]
+branding_name=M-CORD
+branding_icon=/static/cord-logo.png
+branding_favicon=/static/cord-favicon.png
+branding_bg=/static/mcord-bg.jpg
+service_view_class=core.views.mCordServiceGrid.ServiceGridView
diff --git a/xos/core/dashboard/views/home.py b/xos/core/dashboard/views/home.py
index bc721f0..f72be81 100644
--- a/xos/core/dashboard/views/home.py
+++ b/xos/core/dashboard/views/home.py
@@ -2,12 +2,22 @@
 from django.http import HttpResponseRedirect
 import sys
 
+
+def isInt(s):
+    try:
+        int(s)
+        return True
+    except ValueError:
+        return False
+
+
 class LoggedInView(TemplateView):
     def get(self, request, name="root", *args, **kwargs):
         if request.user.login_page:
-             return HttpResponseRedirect(request.user.login_page)
+            return HttpResponseRedirect(request.user.login_page)
         else:
-             return HttpResponseRedirect("/admin/")
+            return HttpResponseRedirect("/admin/")
+
 
 class DashboardDynamicView(TemplateView):
     head_template = r"""{% extends "admin/dashboard/dashboard_base.html" %}
@@ -26,13 +36,13 @@
         context = self.get_context_data(**kwargs)
         context = getDashboardContext(request.user, context)
 
-        if name=="root":
+        if name == "root":
             # maybe it is a bit hacky, didn't want to mess up everything @teone
             user_dashboards = request.user.get_dashboards()
-            first_dasboard_name = user_dashboards[0].id;
+            first_dasboard_name = user_dashboards[0].id
             return self.singleDashboardView(request, first_dasboard_name, context)
             # return self.multiDashboardView(request, context)
-        elif kwargs.get("wholePage",None):
+        elif kwargs.get("wholePage", None):
             return self.singleFullView(request, name, context)
         else:
             return self.singleDashboardView(request, name, context)
@@ -48,8 +58,8 @@
         else:
             return "failed to find %s in %s" % (fn, TEMPLATE_DIRS)
 
-        template= open(pathname, "r").read()
-        if (fn=="tenant"):
+        template = open(pathname, "r").read()
+        if (fn == "tenant"):
             # fix for tenant view - it writes html to a div called tabs-5
             template = '<div id="tabs-5"></div>' + template
         return template
@@ -66,14 +76,14 @@
     def embedDashboardView(self, view, i=0):
         body = ""
         url = view.url
-        if (view.controllers.all().count()>0):
-            body = body + 'Controller: <select id="dashselect-%d">' % i;
-            body = body + '<option value="None">(select a controller)</option>';
-            for j,controllerdashboard in enumerate(view.controllerdashboardviews.all()):
+        if (view.controllers.all().count() > 0):
+            body = body + 'Controller: <select id="dashselect-%d">' % i
+            body = body + '<option value="None">(select a controller)</option>'
+            for j, controllerdashboard in enumerate(view.controllerdashboardviews.all()):
                 body = body + '<option value="%d">%s</option>' % (j, controllerdashboard.controller.name)
             body = body + '</select><hr>'
 
-            for j,controllerdashboard in enumerate(view.controllerdashboardviews.all()):
+            for j, controllerdashboard in enumerate(view.controllerdashboardviews.all()):
                 body = body + '<script type="text/template" id="dashtemplate-%d-%d">\n%s\n</script>\n' % (i,j, self.embedDashboardUrl(controllerdashboard.url));
 
             body = body + '<div id="dashcontent-%d" class="dashcontent"></div>\n' % i
@@ -89,7 +99,7 @@
                              });
                              //$("#dashcontent-%d").html( $("#dashtemplate-%d-0").html() );
                              </script>
-                          """ % (i,i,i,i,i,i,i);
+                          """ % (i, i, i, i, i, i, i)
         else:
             body = body + self.embedDashboardUrl(url)
         return body
@@ -115,7 +125,7 @@
             if (not view.enabled):
                 continue
 
-            tabs.append( '<li><a href="#dashtab-%d">%s</a></li>\n' % (i, view.name) )
+            tabs.append('<li><a href="#dashtab-%d">%s</a></li>\n' % (i, view.name))
             body = '<div id="dashtab-%d">%s</div>\n' % (i, self.embedDashboardView(view, i))
 
             bodies.append(body)
@@ -124,7 +134,7 @@
         # embed content provider dashboards
         for cp in ContentProvider.objects.all():
             if request.user in cp.users.all():
-                tabs.append( '<li><a href="#dashtab-%d">%s</a></li>\n' % (i, cp.name) )
+                tabs.append('<li><a href="#dashtab-%d">%s</a></li>\n' % (i, cp.name))
 
                 body = ""
                 body = body + '<div id="dashtab-%d">\n' % i
@@ -134,7 +144,7 @@
                 bodies.append(body)
                 i = i + 1
 
-        if (len(tabs)==1) and (len(bodies)==1):
+        if (len(tabs) == 1) and (len(bodies) == 1):
             # there is only one dashboard, so optimize out the tabbing
             contents = bodies[0]
         else:
@@ -152,27 +162,29 @@
         response_kwargs = {}
         response_kwargs.setdefault('content_type', self.content_type)
         return self.response_class(
-            request = request,
-            template = t,
-            context = context,
+            request=request,
+            template=t,
+            context=context,
             **response_kwargs)
 
     def singleDashboardView(self, request, id, context):
         head_template = self.head_template
         tail_template = self.tail_template
 
-        view = DashboardView.objects.get(id=id)
-
-        print "XXX", view
-
-        t = template.Template(head_template + self.embedDashboardView(view) + self.tail_template)
+        # if id is a number, load by datamodel,
+        # else look directly for the template
+        if(isInt(id)):
+            view = DashboardView.objects.get(id=id)
+            t = template.Template(head_template + self.embedDashboardView(view) + self.tail_template)
+        else:
+            t = template.Template(head_template + self.readTemplate("xos" + id) + self.tail_template)
 
         response_kwargs = {}
         response_kwargs.setdefault('content_type', self.content_type)
         return self.response_class(
-            request = request,
-            template = t,
-            context = context,
+            request=request,
+            template=t,
+            context=context,
             **response_kwargs)
 
     def singleFullView(self, request, id, context):
@@ -186,8 +198,7 @@
         response_kwargs = {}
         response_kwargs.setdefault('content_type', self.content_type)
         return self.response_class(
-            request = request,
-            template = t,
-            context = context,
+            request=request,
+            template=t,
+            context=context,
             **response_kwargs)
-
diff --git a/xos/core/models/instance.py b/xos/core/models/instance.py
index 6ba7cbf..8cd889a 100644
--- a/xos/core/models/instance.py
+++ b/xos/core/models/instance.py
@@ -137,10 +137,10 @@
 
         if (self.isolation == "container") or (self.isolation == "container_vm"):
             if (self.image.kind != "container"):
-                raise ValidationError("Container instance must use container image")
+               raise ValidationError("Container instance must use container image")
         elif (self.isolation == "vm"):
             if (self.image.kind != "vm"):
-                raise ValidationError("VM instance must use VM image")
+               raise ValidationError("VM instance must use VM image")
 
         if (self.isolation == "container_vm") and (not self.parent):
             raise ValidationError("Container-vm instance must have a parent")
diff --git a/xos/core/models/network.py b/xos/core/models/network.py
index 8373814..37f4cfe 100644
--- a/xos/core/models/network.py
+++ b/xos/core/models/network.py
@@ -138,6 +138,8 @@
     name = models.CharField(max_length=32)
     template = models.ForeignKey(NetworkTemplate)
     subnet = models.CharField(max_length=32, blank=True)
+    start_ip = models.CharField(max_length=32, blank=True)
+    end_ip = models.CharField(max_length=32, blank=True)
     ports = models.CharField(max_length=1024, blank=True, null=True, validators=[ValidateNatList])
     labels = models.CharField(max_length=1024, blank=True, null=True)
     owner = models.ForeignKey(Slice, related_name="ownedNetworks", help_text="Slice that owns control of this Network")
@@ -165,6 +167,7 @@
         if (not self.subnet) and (NO_OBSERVER):
             from util.network_subnet_allocator import find_unused_subnet
             self.subnet = find_unused_subnet(existing_subnets=[x.subnet for x in Network.objects.all()])
+            print "DEF_MOD_NET_IP", self.start_ip
         super(Network, self).save(*args, **kwds)
 
     def can_update(self, user):
@@ -203,6 +206,8 @@
     router_id = models.CharField(null=True, blank=True, max_length=256, help_text="Quantum router id")
     subnet_id = models.CharField(null=True, blank=True, max_length=256, help_text="Quantum subnet id")
     subnet = models.CharField(max_length=32, blank=True)
+    start_ip = models.CharField(max_length=32, blank=True)
+    stop_ip = models.CharField(max_length=32, blank=True)
 
     class Meta:
         unique_together = ('network', 'controller')
diff --git a/xos/core/models/node.py b/xos/core/models/node.py
index d464532..f3ea303 100644
--- a/xos/core/models/node.py
+++ b/xos/core/models/node.py
@@ -2,7 +2,7 @@
 from django.db import models
 from core.models import PlCoreBase
 from core.models.plcorebase import StrippedCharField
-from core.models import Site, SiteDeployment, SitePrivilege
+from core.models.site import Site, SiteDeployment, SitePrivilege
 from core.models import Tag
 from django.contrib.contenttypes import generic
 
diff --git a/xos/core/models/service.py b/xos/core/models/service.py
index 3d38f73..b341e83 100644
--- a/xos/core/models/service.py
+++ b/xos/core/models/service.py
@@ -510,7 +510,11 @@
 
     def pick(self):
         from core.models import Node
-        nodes = Node.objects.all()
+        if not self.slice.default_node:
+            nodes = list(Node.objects.all())
+            nodes = sorted(nodes, key=lambda node: node.instances.all().count())
+        else:
+            nodes = list(Node.objects.filter(name = self.slice.default_node))
 
         if self.label:
             nodes = nodes.filter(nodelabels__name=self.label)
@@ -523,7 +527,7 @@
 
         # TODO: logic to filter nodes by which nodes are up, and which
         #   nodes the slice can instantiate on.
-        nodes = sorted(nodes, key=lambda node: node.instances.all().count())
+#        nodes = sorted(nodes, key=lambda node: node.instances.all().count())
         return [nodes[0], None]
 
 
diff --git a/xos/core/models/slice.py b/xos/core/models/slice.py
index 3934f3f..73fa121 100644
--- a/xos/core/models/slice.py
+++ b/xos/core/models/slice.py
@@ -12,6 +12,7 @@
 from django.contrib.contenttypes import generic
 from core.models import Service
 from core.models import Controller
+from core.models.node import Node
 from core.models import Flavor, Image
 from core.models.plcorebase import StrippedCharField
 from django.core.exceptions import PermissionDenied, ValidationError
@@ -40,6 +41,7 @@
     # for tenant view
     default_flavor = models.ForeignKey(Flavor, related_name = "slices", null=True, blank=True)
     default_image = models.ForeignKey(Image, related_name = "slices", null=True, blank=True);
+    default_node = models.ForeignKey(Node, related_name = "slices", null=True, blank=True)
     mount_data_sets = StrippedCharField(default="GenBank",null=True, blank=True, max_length=256)
 
     default_isolation = models.CharField(null=False, blank=False, max_length=30, choices=ISOLATION_CHOICES, default="vm")
diff --git a/xos/core/static/mCordServices/service_cache.png b/xos/core/static/mCordServices/service_cache.png
new file mode 100644
index 0000000..a8b5480
--- /dev/null
+++ b/xos/core/static/mCordServices/service_cache.png
Binary files differ
diff --git a/xos/core/static/mCordServices/service_common.png b/xos/core/static/mCordServices/service_common.png
new file mode 100644
index 0000000..9fda14e
--- /dev/null
+++ b/xos/core/static/mCordServices/service_common.png
Binary files differ
diff --git a/xos/core/static/mCordServices/service_firewall.png b/xos/core/static/mCordServices/service_firewall.png
new file mode 100644
index 0000000..17e87be
--- /dev/null
+++ b/xos/core/static/mCordServices/service_firewall.png
Binary files differ
diff --git a/xos/core/static/mCordServices/service_rru.png b/xos/core/static/mCordServices/service_rru.png
new file mode 100644
index 0000000..8a667c0
--- /dev/null
+++ b/xos/core/static/mCordServices/service_rru.png
Binary files differ
diff --git a/xos/core/static/mCordServices/service_server.png b/xos/core/static/mCordServices/service_server.png
new file mode 100644
index 0000000..17ce83d
--- /dev/null
+++ b/xos/core/static/mCordServices/service_server.png
Binary files differ
diff --git a/xos/core/static/mCordServices/service_video.png b/xos/core/static/mCordServices/service_video.png
new file mode 100644
index 0000000..91ad760
--- /dev/null
+++ b/xos/core/static/mCordServices/service_video.png
Binary files differ
diff --git a/xos/core/static/mcord-bg.jpg b/xos/core/static/mcord-bg.jpg
new file mode 100644
index 0000000..e378fda
--- /dev/null
+++ b/xos/core/static/mcord-bg.jpg
Binary files differ
diff --git a/xos/core/static/xos.css b/xos/core/static/xos.css
index dd1e8bf..47d1e36 100644
--- a/xos/core/static/xos.css
+++ b/xos/core/static/xos.css
@@ -258,6 +258,11 @@
 .glyphicon-plus:before {
   content: "\002b"; }
 
+#wrapper.toggled #page-content-wrapper {
+    position: absolute;
+    margin-right: -250px;
+}
+
 .glyphicon-euro:before,
 .glyphicon-eur:before {
   content: "\20ac"; }
@@ -367,9 +372,19 @@
 .glyphicon-list-alt:before {
   content: "\e032"; }
 
+.ui-tabs-panel {
+  min-height: 700px;
+  position: relative;
+}
+
+.ui-tabs .ui-tabs-nav {
+  padding: 0 !important;
+}
+
 .glyphicon-lock:before {
   content: "\e033"; }
 
+
 .glyphicon-flag:before {
   content: "\e034"; }
 
@@ -6887,7 +6902,34 @@
   display: inline-block; }
 
 button.ui-dialog-titlebar-close:after {
-  content: "\e014"; }
+    content: "\e014";
+}
+/* M-CORD SERVICE GRID */
+.m-cord .kind-container h2{
+  background-color: #9c0001;
+  padding: 10px;
+  color: #fff;
+  border-radius: 4px;
+  cursor: pointer;
+  box-shadow: 1px 2px 2px black;
+}
+
+.m-cord .kind-container img.img-responsive {
+  display: inline-block;
+}
+
+.m-cord .kind-container .service-container{
+  height: 0px;
+  overflow: hidden;
+  opacity: 0;
+  transition: all .5s ease-in-out;
+}
+
+.m-cord .kind-container.active .service-container{
+  height: 162px;
+  opacity: 1;
+}
+  /*content: "\e014"; }*/
 
 /* VCPe ADMIN FIX
 form#vcpeservice_form ul li {
@@ -6898,6 +6940,4 @@
     padding: 10px;
     border-radius: 5px;
 }
-*/
-
-/*# sourceMappingURL=data:application/json;base64,ewoJInZlcnNpb24iOiAzLAoJImZpbGUiOiAiLi4vLi4veG9zL2NvcmUvc3RhdGljL3hvcy5jc3MiLAoJInNvdXJjZXMiOiBbCgkJInNhc3MveG9zLnNjc3MiLAoJCSJzYXNzL2xpYi9fdmFyaWFibGVzLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9fYm9vdHN0cmFwLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvX3ZhcmlhYmxlcy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL19taXhpbnMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9taXhpbnMvX2hpZGUtdGV4dC5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9fb3BhY2l0eS5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9faW1hZ2Uuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9taXhpbnMvX2xhYmVscy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9fcmVzZXQtZmlsdGVyLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvbWl4aW5zL19yZXNpemUuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9taXhpbnMvX3Jlc3BvbnNpdmUtdmlzaWJpbGl0eS5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9fc2l6ZS5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9fdGFiLWZvY3VzLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvbWl4aW5zL19yZXNldC10ZXh0LnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvbWl4aW5zL190ZXh0LWVtcGhhc2lzLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvbWl4aW5zL190ZXh0LW92ZXJmbG93LnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvbWl4aW5zL192ZW5kb3ItcHJlZml4ZXMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9taXhpbnMvX2FsZXJ0cy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9fYnV0dG9ucy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9fcGFuZWxzLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvbWl4aW5zL19wYWdpbmF0aW9uLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvbWl4aW5zL19saXN0LWdyb3VwLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvbWl4aW5zL19uYXYtZGl2aWRlci5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9fZm9ybXMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9taXhpbnMvX3Byb2dyZXNzLWJhci5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9fdGFibGUtcm93LnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvbWl4aW5zL19iYWNrZ3JvdW5kLXZhcmlhbnQuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9taXhpbnMvX2JvcmRlci1yYWRpdXMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9taXhpbnMvX2dyYWRpZW50cy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9fY2xlYXJmaXguc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9taXhpbnMvX2NlbnRlci1ibG9jay5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9fbmF2LXZlcnRpY2FsLWFsaWduLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvbWl4aW5zL19ncmlkLWZyYW1ld29yay5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL21peGlucy9fZ3JpZC5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL19ub3JtYWxpemUuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fcHJpbnQuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fZ2x5cGhpY29ucy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL19zY2FmZm9sZGluZy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL190eXBlLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvX2NvZGUuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fZ3JpZC5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL190YWJsZXMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fZm9ybXMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fYnV0dG9ucy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL19jb21wb25lbnQtYW5pbWF0aW9ucy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL19kcm9wZG93bnMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fYnV0dG9uLWdyb3Vwcy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL19pbnB1dC1ncm91cHMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fbmF2cy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL19uYXZiYXIuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fYnJlYWRjcnVtYnMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fcGFnaW5hdGlvbi5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL19wYWdlci5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL19sYWJlbHMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fYmFkZ2VzLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvX2p1bWJvdHJvbi5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL190aHVtYm5haWxzLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvX2FsZXJ0cy5zY3NzIiwKCQkic2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL19wcm9ncmVzcy1iYXJzLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvX21lZGlhLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvX2xpc3QtZ3JvdXAuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fcGFuZWxzLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvX3Jlc3BvbnNpdmUtZW1iZWQuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fd2VsbHMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fY2xvc2Uuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fbW9kYWxzLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvX3Rvb2x0aXAuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fcG9wb3ZlcnMuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fY2Fyb3VzZWwuc2NzcyIsCgkJInNhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fdXRpbGl0aWVzLnNjc3MiLAoJCSJzYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvX3Jlc3BvbnNpdmUtdXRpbGl0aWVzLnNjc3MiLAoJCSJzYXNzL2xpYi9oZWFkZXIuc2NzcyIsCgkJInNhc3MvbGliL25hdi5zY3NzIiwKCQkic2Fzcy9saWIvZm9vdGVyLnNjc3MiLAoJCSJzYXNzL2xpYi9kYXRhX3RhYmxlLnNjc3MiLAoJCSJzYXNzL2xpYi90YWJzLnNjc3MiLAoJCSJzYXNzL2xpYi9sb2dpbi5zY3NzIiwKCQkic2Fzcy9saWIvYnJlYWRjcnVtYi5zY3NzIiwKCQkic2Fzcy9saWIvZm9ybS5zY3NzIiwKCQkic2Fzcy9saWIvbG9nb3V0LnNjc3MiCgldLAoJIm1hcHBpbmdzIjogIjtBRUFBOzs7O0dBSUc7QWlDSkgsNEVBQTRFO0FBUTVFLEFBQUEsSUFBSSxDQUFDO0VBQ0gsV0FBVyxFQUFFLFVBQVc7RUFDeEIsb0JBQW9CLEVBQUUsSUFBSztFQUMzQix3QkFBd0IsRUFBRSxJQUFLLEdBQ2hDOztBQU1ELEFBQUEsSUFBSSxDQUFDO0VBQ0gsTUFBTSxFQUFFLENBQUUsR0FDWDs7QUFZRCxBQUFBLE9BQU87QUFDUCxBQUFBLEtBQUs7QUFDTCxBQUFBLE9BQU87QUFDUCxBQUFBLFVBQVU7QUFDVixBQUFBLE1BQU07QUFDTixBQUFBLE1BQU07QUFDTixBQUFBLE1BQU07QUFDTixBQUFBLE1BQU07QUFDTixBQUFBLElBQUk7QUFDSixBQUFBLElBQUk7QUFDSixBQUFBLEdBQUc7QUFDSCxBQUFBLE9BQU87QUFDUCxBQUFBLE9BQU8sQ0FBQztFQUNOLE9BQU8sRUFBRSxLQUFNLEdBQ2hCOztBQU9ELEFBQUEsS0FBSztBQUNMLEFBQUEsTUFBTTtBQUNOLEFBQUEsUUFBUTtBQUNSLEFBQUEsS0FBSyxDQUFDO0VBQ0osT0FBTyxFQUFFLFlBQWE7RUFDdEIsY0FBYyxFQUFFLFFBQVMsR0FDMUI7O0FBT0QsQUFBb0IsS0FBZixBQUFBLElBQUssRUFBQSxBQUFBLEFBQVMsUUFBUixBQUFBLEdBQVc7RUFDcEIsT0FBTyxFQUFFLElBQUs7RUFDZCxNQUFNLEVBQUUsQ0FBRSxHQUNYOztDQU9ELEFBQUEsQUFBTyxNQUFOLEFBQUE7QUFDRCxBQUFBLFFBQVEsQ0FBQztFQUNQLE9BQU8sRUFBRSxJQUFLLEdBQ2Y7O0FBU0QsQUFBQSxDQUFDLENBQUM7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LEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsU0FBUyxFQUFFLEFBQUEsVUFBVSxFQUFFLEFBQUEsVUFBVSxFQUFFLEFBQUEsVUFBVSxFQUFFLEFBQUEsVUFBVSxFQUFFLEFBQUEsVUFBVSxFQUFFLEFBQUEsVUFBVSxFQUFFLEFBQUEsVUFBVSxFQUFFLEFBQUEsVUFBVSxFQUFFLEFBQUEsVUFBVSxFQUFFLEFBQUEsVUFBVSxFQUFFLEFBQUEsVUFBVSxFQUFFLEFBQUEsVUFBVSxDQUExaEI7RUFDRSxRQUFRLEVBQUUsUUFBUztFQUVuQixVQUFVLEVBQUUsR0FBSTtFQUVoQixZQUFZLEVBQUcsSUFBSTtFQUNuQixhQUFhLEVBQUUsSUFBSyxHQUNyQjs7QUFTRCxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFVBQVUsRUFBRSxBQUFBLFVBQVUsRUFBRSxBQUFBLFVBQVUsQ0FBckk7RUFDRSxLQUFLLEVBQUUsSUFBSyxHQUNiOztBQU1DLEFBQUEsU0FBUyxDQUFUO0VBQ0UsS0FBSyxFQUFFLFFBQVUsR0FDbEI7O0FBRkQsQUFBQSxTQUFTLENBQVQ7RUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjs7QUFGRCxBQUFBLFNBQVMsQ0FBVDtFQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCOztBQUZELEFBQUEsU0FBUyxDQUFUO0VBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7O0FBRkQsQUFBQSxTQUFTLENBQVQ7RUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjs7QUFGRCxBQUFBLFNBQVMsQ0FBVDtFQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCOztBQUZELEFBQUEsU0FBUyxDQUFUO0VBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7O0FBRkQsQUFBQSxTQUFTLENBQVQ7RUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjs7QUFGRCxBQUFBLFNBQVMsQ0FBVDtFQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCOztBQUZELEFBQUEsVUFBVSxDQUFWO0VBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7O0FBRkQsQUFBQSxVQUFVLENBQVY7RUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjs7QUFGRCxBQUFBLFVBQVUsQ0FBVjtFQUNFLEtBQUssRUFBRSxJQUFVLEdBQ2xCOztBQWtCRCxBQUFBLGNBQWMsQ0FBZDtFQUNFLEtBQUssRUFBRSxJQUFLLEdBQ2I7O0FBUEQsQUFBQSxjQUFjLENBQWQ7RUFDRSxLQUFLLEVBQUUsUUFBVSxHQUNsQjs7QUFGRCxBQUFBLGNBQWMsQ0FBZDtFQUNFLEtBQUssRUFBRSxTQUFVLEdBQ2xCOztBQUZELEFBQUEsY0FBYyxDQUFkO0VBQ0UsS0FBSyxFQUFFLEdBQVUsR0FDbEI7O0FBRkQsQUFBQSxjQUFjLENBQWQ7RUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjs7QUFGRCxBQUFBLGNBQWMsQ0FBZDtFQUNFLEtBQUssRUFBRSxTQUFVLEdBQ2xCOztBQUZELEFBQUEsY0FBYyxDQUFkO0VBQ0UsS0FBSyxFQUFFLEdBQVUsR0FDbEI7O0FBRkQsQUFBQSxjQUFjLENBQWQ7RUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjs7QUFGRCxBQUFBLGNBQWMsQ0FBZDtFQUNFLEtBQUssRUFBRSxTQUFVLEdBQ2xCOztBQUZELEFBQUEsY0FBYyxDQUFkO0VBQ0UsS0FBSyxFQUFFLEdBQVUsR0FDbEI7O0FBRkQsQUFBQSxlQUFlLENBQWY7RUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjs7QUFGRCxBQUFBLGVBQWUsQ0FBZjtFQUNFLEtBQUssRUFBRSxTQUFVLEdBQ2xCOztBQUZELEFBQUEsZUFBZSxDQUFmO0VBQ0UsS0FBSyxFQUFFLElBQVUsR0FDbEI7O0FBUEQsQUFBQSxjQUFjLENBQWQ7RUFDRSxJQUFJLEVBQUUsSUFBSyxHQUNaOztBQVBELEFBQUEsY0FBYyxDQUFkO0VBQ0UsSUFBSSxFQUFFLFFBQVUsR0FDakI7O0FBRkQsQUFBQSxjQUFjLENBQWQ7RUFDRSxJQUFJLEVBQUUsU0FBVSxHQUNqQjs7QUFGRCxBQUFBLGNBQWMsQ0FBZDtFQUNFLElBQUksRUFBRSxHQUFVLEdBQ2pCOztBQUZELEFBQUEsY0FBYyxDQUFkO0VBQ0UsSUFBSSxFQUFFLFNBQVUsR0FDakI7O0FBRkQsQUFBQSxjQUFjLENBQWQ7RUFDRSxJQUFJLEVBQUUsU0FBVSxHQUNqQjs7QUFGRCxBQUFBLGNBQWMsQ0FBZDtFQUNFLElBQUksRUFBRSxHQUFVLEdBQ2pCOztBQUZELEFBQUEsY0FBYyxDQUFkO0VBQ0UsSUFBSSxFQUFFLFNBQVUsR0FDakI7O0FBRkQsQUFBQSxjQUFjLENBQWQ7RUFDRSxJQUFJLEVBQUUsU0FBVSxHQUNqQjs7QUFGRCxBQUFBLGNBQWMsQ0FBZDtFQUNFLElBQUksRUFBRSxHQUFVLEdBQ2pCOztBQUZELEFBQUEsZUFBZSxDQUFmO0VBQ0UsSUFBSSxFQUFFLFNBQVUsR0FDakI7O0FBRkQsQUFBQSxlQUFlLENBQWY7RUFDRSxJQUFJLEVBQUUsU0FBVSxHQUNqQjs7QUFGRCxBQUFBLGVBQWUsQ0FBZjtFQUNFLElBQUksRUFBRSxJQUFVLEdBQ2pCOztBQWtCRCxBQUFBLGdCQUFnQixDQUFoQjtFQUNFLFdBQVcsRUFBRSxFQUFVLEdBQ3hCOztBQUZELEFBQUEsZ0JBQWdCLENBQWhCO0VBQ0UsV0FBVyxFQUFFLFFBQVUsR0FDeEI7O0FBRkQsQUFBQSxnQkFBZ0IsQ0FBaEI7RUFDRSxXQUFXLEVBQUUsU0FBVSxHQUN4Qjs7QUFGRCxBQUFBLGdCQUFnQixDQUFoQjtFQUNFLFdBQVcsRUFBRSxHQUFVLEdBQ3hCOztBQUZELEFBQUEsZ0JBQWdCLENBQWhCO0VBQ0UsV0FBVyxFQUFFLFNBQVUsR0FDeEI7O0FBRkQsQUFBQSxnQkFBZ0IsQ0FBaEI7RUFDRSxXQUFXLEVBQUUsU0FBVSxHQUN4Qjs7QUFGRCxBQUFBLGdCQUFnQixDQUFoQjtFQUNFLFdBQVcsRUFBRSxHQUFVLEdBQ3hCOztBQUZELEFBQUEsZ0JBQWdCLENBQWhCO0VBQ0UsV0FBVyxFQUFFLFNBQVUsR0FDeEI7O0FBRkQsQUFBQSxnQkFBZ0IsQ0FBaEI7RUFDRSxXQUFXLEVBQUUsU0FBVSxHQUN4Qjs7QUFGRCxBQUFBLGdCQUFnQixDQUFoQjtFQUNFLFdBQVcsRUFBRSxHQUFVLEdBQ3hCOztBQUZELEFBQUEsaUJBQWlCLENBQWpCO0VBQ0UsV0FBVyxFQUFFLFNBQVUsR0FDeEI7O0FBRkQsQUFBQSxpQkFBaUIsQ0FBakI7RUFDRSxXQUFXLEVBQUUsU0FBVSxHQUN4Qjs7QUFGRCxBQUFBLGlCQUFpQixDQUFqQjtFQUNFLFdBQVcsRUFBRSxJQUFVLEdBQ3hCOztBUUVMLE1BQU0sRUFBTCxTQUFTLEVBQUUsS0FBSztFUnJDZixBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFNBQVMsRUFBRSxBQUFBLFVBQVUsRUFBRSxBQUFBLFVBQVUsRUFBRSxBQUFBLFVBQVUsQ0FBckk7SUFDRSxLQUFLLEVBQUUsSUFBSyxHQUNiO0VBTUMsQUFBQSxTQUFTLENBQVQ7SUFDRSxLQUFLLEVBQUUsUUFBVSxHQUNsQjtFQUZELEFBQUEsU0FBUyxDQUFUO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLFNBQVMsQ0FBVDtJQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCO0VBRkQsQUFBQSxTQUFTLENBQVQ7SUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjtFQUZELEFBQUEsU0FBUyxDQUFUO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLFNBQVMsQ0FBVDtJQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCO0VBRkQsQUFBQSxTQUFTLENBQVQ7SUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjtFQUZELEFBQUEsU0FBUyxDQUFUO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLFNBQVMsQ0FBVDtJQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCO0VBRkQsQUFBQSxVQUFVLENBQVY7SUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjtFQUZELEFBQUEsVUFBVSxDQUFWO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLFVBQVUsQ0FBVjtJQUNFLEtBQUssRUFBRSxJQUFVLEdBQ2xCO0VBa0JELEFBQUEsY0FBYyxDQUFkO0lBQ0UsS0FBSyxFQUFFLElBQUssR0FDYjtFQVBELEFBQUEsY0FBYyxDQUFkO0lBQ0UsS0FBSyxFQUFFLFFBQVUsR0FDbEI7RUFGRCxBQUFBLGNBQWMsQ0FBZDtJQUNFLEtBQUssRUFBRSxTQUFVLEdBQ2xCO0VBRkQsQUFBQSxjQUFjLENBQWQ7SUFDRSxLQUFLLEVBQUUsR0FBVSxHQUNsQjtFQUZELEFBQUEsY0FBYyxDQUFkO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLGNBQWMsQ0FBZDtJQUNFLEtBQUssRUFBRSxTQUFVLEdBQ2xCO0VBRkQsQUFBQSxjQUFjLENBQWQ7SUFDRSxLQUFLLEVBQUUsR0FBVSxHQUNsQjtFQUZELEFBQUEsY0FB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UyxDQUFUO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLFNBQVMsQ0FBVDtJQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCO0VBRkQsQUFBQSxTQUFTLENBQVQ7SUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjtFQUZELEFBQUEsU0FBUyxDQUFUO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLFNBQVMsQ0FBVDtJQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCO0VBRkQsQUFBQSxTQUFTLENBQVQ7SUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjtFQUZELEFBQUEsU0FBUyxDQUFUO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLFNBQVMsQ0FBVDtJQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCO0VBRkQsQUFBQSxVQUFVLENBQVY7SUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjtFQUZELEFBQUEsVUFBVSxDQUFWO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLFVBQVUsQ0FBVjtJQUNFLEtBQUssRUFBRSxJQUFVLEdBQ2xCO0VBa0JELEFBQUEsY0FBYyxDQUFkO0lBQ0UsS0FBSyxFQUFFLElBQUssR0FDYjtFQVBELEFBQUEsY0FBYyxDQUFkO0lBQ0UsS0FBSyxFQUFFLFFBQVUsR0FDbEI7RUFGRCxBQUFBLGNBQWMsQ0FBZDtJQUNFLEtBQUssRUFBRSxTQUFVLEdBQ2xCO0VBRkQsQUFBQSxjQUFjLENBQWQ7SUFDRSxLQUFLLEVBQUUsR0FBVSxHQUNsQjtFQUZELEFBQUEsY0FBYyxDQUFkO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLGNBQWMsQ0FBZDtJQUNFLEtBQUssRUFBRSxTQUFVLEdBQ2xCO0VBRkQsQUFBQSxjQUFjLENBQWQ7SUFDRSxLQUFLLEVBQUUsR0FBVSxHQUNsQjtFQUZELEFBQUEsY0FBYyxDQUFkO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLGNBQWMsQ0FBZDtJQUNFLEtBQUssRUFBRSxTQUFV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QVUsR0FDbEI7RUFGRCxBQUFBLFNBQVMsQ0FBVDtJQUNFLEtBQUssRUFBRSxTQUFVLEdBQ2xCO0VBRkQsQUFBQSxTQUFTLENBQVQ7SUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjtFQUZELEFBQUEsU0FBUyxDQUFUO0lBQ0UsS0FBSyxFQUFFLEdBQVUsR0FDbEI7RUFGRCxBQUFBLFNBQVMsQ0FBVDtJQUNFLEtBQUssRUFBRSxTQUFVLEdBQ2xCO0VBRkQsQUFBQSxTQUFTLENBQVQ7SUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjtFQUZELEFBQUEsU0FBUyxDQUFUO0lBQ0UsS0FBSyxFQUFFLEdBQVUsR0FDbEI7RUFGRCxBQUFBLFVBQVUsQ0FBVjtJQUNFLEtBQUssRUFBRSxTQUFVLEdBQ2xCO0VBRkQsQUFBQSxVQUFVLENBQVY7SUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjtFQUZELEFBQUEsVUFBVSxDQUFWO0lBQ0UsS0FBSyxFQUFFLElBQVUsR0FDbEI7RUFrQkQsQUFBQSxjQUFjLENBQWQ7SUFDRSxLQUFLLEVBQUUsSUFBSyxHQUNiO0VBUEQsQUFBQSxjQUFjLENBQWQ7SUFDRSxLQUFLLEVBQUUsUUFBVSxHQUNsQjtFQUZELEFBQUEsY0FBYyxDQUFkO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLGNBQWMsQ0FBZDtJQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCO0VBRkQsQUFBQSxjQUFjLENBQWQ7SUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjtFQUZELEFBQUEsY0FBYyxDQUFkO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLGNBQWMsQ0FBZDtJQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCO0VBRkQsQUFBQSxjQUFjLENBQWQ7SUFDRSxLQUFLLEVBQUUsU0FBVSxHQUNsQjtFQUZELEFBQUEsY0FBYyxDQUFkO0lBQ0UsS0FBSyxFQUFFLFNBQVUsR0FDbEI7RUFGRCxBQUFBLGNBQWMsQ0FBZDtJQUNFLEtBQUssRUFBRSxHQUFVLEdBQ2xCO0VBRkQsQUFBQSxlQUFlLENB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bkIzWUUsWW1CMllVLENuQjNZVixrQkFBa0IsQ0FBQztFQUNqQixLQUFLLEVyQndkd0IsT0FBTztFcUJ2ZHBDLFlBQVksRXJCdWRpQixPQUFPO0VxQnRkcEMsZ0JBQWdCLEVyQnVkYSxPQUFPLEdxQnRkckM7O0FtQnVZSCxBbkJyWUUsWW1CcVlVLENuQnJZVixzQkFBc0IsQ0FBQztFQUNyQixLQUFLLEVyQmtkd0IsT0FBTyxHcUJqZHJDOztBbUJzWUgsQW5CcmFFLFltQnFhVSxDbkJyYVYsV0FBVztBbUJxYWIsQW5CcGFFLFltQm9hVSxDbkJwYVYsY0FBYztBbUJvYWhCLEFuQm5hRSxZbUJtYVUsQ25CbmFWLE1BQU07QW1CbWFSLEFuQmxhRSxZbUJrYVUsQ25CbGFWLFNBQVM7QW1Ca2FYLEFuQmphRSxZbUJpYVUsQ25CamFWLGFBQWE7QW1CaWFmLEFuQmhhRSxZbUJnYVUsQ25CaGFWLGdCQUFnQjtBbUJnYWxCLEFuQi9aVSxZbUIrWkUsQW5CL1pULE1BQU0sQ0FBQyxLQUFLO0FtQitaZixBbkI5WmEsWW1COFpELEFuQjlaVCxTQUFTLENBQUMsS0FBSztBbUI4WmxCLEFuQjdaaUIsWW1CNlpMLEFuQjdaVCxhQUFhLENBQUMsS0FBSztBbUI2WnRCLEFuQjVab0IsWW1CNFpSLEFuQjVaVCxnQkFBZ0IsQ0FBQyxLQUFLLENBQUU7RUFDdkIsS0FBSyxFckI4ZXdCLE9BQU8sR3FCN2VyQzs7QW1CMFpILEFuQnhaRSxZbUJ3WlUsQ25CeFpWLGFBQWEsQ0FBQztFQUNaLFlBQVksRXJCMGVpQixPQUFPO0VjM2J0QyxrQkFBa0IsRU85Q0ksS0FBSyxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLG9CQUFJO0VQK0NsQyxVQUFVLEVPL0NJLEtBQUssQ0FBQyxDQUFDLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxvQkFBSSxHQU16QztFbUJnWkgsQW5CeFpFLFltQndaVSxDbkJ4WlYsYUFBYSxBQUdWLE1BQU0sQ0FBQztJQUNOLFlBQVksRUFBRSxPQUFNO0lQNEN4QixrQkFBa0IsRU8zQ0wsS0FBSyxD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 */
\ No newline at end of file
+*/
\ No newline at end of file
diff --git a/xos/core/static/xosNgLib.css b/xos/core/static/xosNgLib.css
index e6cbaf6..35cb6fa 100644
--- a/xos/core/static/xosNgLib.css
+++ b/xos/core/static/xosNgLib.css
@@ -153,6 +153,9 @@
   margin-top: 15px;
   display: block; }
 
+xos-field {
+  display: block; }
+
 [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
   display: none !important; }
 
@@ -160,4 +163,4 @@
   /* TODO move in xos.scss*/
   margin-top: 15px; }
 
-/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieG9zTmdMaWIuY3NzIiwic291cmNlcyI6WyJtYWluLnNjc3MiLCJhbmltYXRpb25zLnNjc3MiLCIuLi8uLi8uLi8uLi9zdHlsZS9zYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvX3ZhcmlhYmxlcy5zY3NzIiwiLi4vdWlfY29tcG9uZW50cy9kdW1iQ29tcG9uZW50cy90YWJsZS90YWJsZS5zY3NzIiwiLi4vdWlfY29tcG9uZW50cy9kdW1iQ29tcG9uZW50cy9hbGVydC9hbGVydC5zY3NzIiwiLi4vdWlfY29tcG9uZW50cy9kdW1iQ29tcG9uZW50cy92YWxpZGF0aW9uL3ZhbGlkYXRpb24uc2NzcyIsIi4uL3VpX2NvbXBvbmVudHMvc21hcnRDb21wb25lbnRzL3NtYXJ0VGFibGUvc21hcnRUYWJsZS5zY3NzIl0sInNvdXJjZXNDb250ZW50IjpbIkBpbXBvcnQgJy4vYW5pbWF0aW9ucy5zY3NzJztcbkBpbXBvcnQgJy4uLy4uLy4uLy4uLy4uL3ZpZXdzL3N0eWxlL3Nhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fdmFyaWFibGVzLnNjc3MnO1xuXG5AaW1wb3J0ICcuLi91aV9jb21wb25lbnRzL2R1bWJDb21wb25lbnRzL3RhYmxlL3RhYmxlLnNjc3MnO1xuQGltcG9ydCAnLi4vdWlfY29tcG9uZW50cy9kdW1iQ29tcG9uZW50cy9hbGVydC9hbGVydC5zY3NzJztcbkBpbXBvcnQgJy4uL3VpX2NvbXBvbmVudHMvZHVtYkNvbXBvbmVudHMvdmFsaWRhdGlvbi92YWxpZGF0aW9uLnNjc3MnO1xuXG5AaW1wb3J0ICcuLi91aV9jb21wb25lbnRzL3NtYXJ0Q29tcG9uZW50cy9zbWFydFRhYmxlL3NtYXJ0VGFibGUuc2Nzcyc7XG5cbltuZ1xcOmNsb2FrXSwgW25nLWNsb2FrXSwgW2RhdGEtbmctY2xvYWtdLCBbeC1uZy1jbG9ha10sIC5uZy1jbG9haywgLngtbmctY2xvYWsge1xuICBkaXNwbGF5OiBub25lICFpbXBvcnRhbnQ7XG59XG5cbi5yb3cgKyAucm93IHtcbiAgLyogVE9ETyBtb3ZlIGluIHhvcy5zY3NzKi8gXG4gIG1hcmdpbi10b3A6ICRmb3JtLWdyb3VwLW1hcmdpbi1ib3R0b207XG59IiwiQGtleWZyYW1lcyBzbGlkZUluUmlnaHQge1xuICBmcm9tIHtcbiAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZTNkKDEwMCUsIDAsIDApO1xuICAgIHZpc2liaWxpdHk6IHZpc2libGU7XG4gIH1cblxuICB0byB7XG4gICAgdHJhbnNmb3JtOiB0cmFuc2xhdGUzZCgwLCAwLCAwKTtcbiAgfVxufVxuXG5Aa2V5ZnJhbWVzIHNsaWRlT3V0UmlnaHQge1xuICBmcm9tIHtcbiAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZTNkKDAsIDAsIDApO1xuICB9XG5cbiAgdG8ge1xuICAgIHZpc2liaWxpdHk6IGhpZGRlbjtcbiAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZTNkKDEwMCUsIDAsIDApO1xuICB9XG59XG5cbkBrZXlmcmFtZXMgZmFkZUluVXAge1xuICBmcm9tIHtcbiAgICBvcGFjaXR5OiAwO1xuICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlM2QoMCwgMTAwJSwgMCk7XG4gIH1cblxuICB0byB7XG4gICAgb3BhY2l0eTogMTtcbiAgICB0cmFuc2Zvcm06IG5vbmU7XG4gIH1cbn1cblxuQGtleWZyYW1lcyBmYWRlT3V0RG93biB7XG4gIGZyb20ge1xuICAgIG9wYWNpdHk6IDE7XG4gIH1cblxuICB0byB7XG4gICAgb3BhY2l0eTogMDtcbiAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZTNkKDAsIDEwMCUsIDApO1xuICB9XG59IiwiJGJvb3RzdHJhcC1zYXNzLWFzc2V0LWhlbHBlcjogZmFsc2UgIWRlZmF1bHQ7XG4vL1xuLy8gVmFyaWFibGVzXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5cbi8vPT0gQ29sb3JzXG4vL1xuLy8jIyBHcmF5IGFuZCBicmFuZCBjb2xvcnMgZm9yIHVzZSBhY3Jvc3MgQm9vdHN0cmFwLlxuXG4kZ3JheS1iYXNlOiAgICAgICAgICAgICAgIzAwMCAhZGVmYXVsdDtcbiRncmF5LWRhcmtlcjogICAgICAgICAgICBsaWdodGVuKCRncmF5LWJhc2UsIDEzLjUlKSAhZGVmYXVsdDsgLy8gIzIyMlxuJGdyYXktZGFyazogICAgICAgICAgICAgIGxpZ2h0ZW4oJGdyYXktYmFzZSwgMjAlKSAhZGVmYXVsdDsgICAvLyAjMzMzXG4kZ3JheTogICAgICAgICAgICAgICAgICAgbGlnaHRlbigkZ3JheS1iYXNlLCAzMy41JSkgIWRlZmF1bHQ7IC8vICM1NTVcbiRncmF5LWxpZ2h0OiAgICAgICAgICAgICBsaWdodGVuKCRncmF5LWJhc2UsIDQ2LjclKSAhZGVmYXVsdDsgLy8gIzc3N1xuJGdyYXktbGlnaHRlcjogICAgICAgICAgIGxpZ2h0ZW4oJGdyYXktYmFzZSwgOTMuNSUpICFkZWZhdWx0OyAvLyAjZWVlXG5cbiRicmFuZC1wcmltYXJ5OiAgICAgICAgIGRhcmtlbigjNDI4YmNhLCA2LjUlKSAhZGVmYXVsdDsgLy8gIzMzN2FiN1xuJGJyYW5kLXN1Y2Nlc3M6ICAgICAgICAgIzVjYjg1YyAhZGVmYXVsdDtcbiRicmFuZC1pbmZvOiAgICAgICAgICAgICM1YmMwZGUgIWRlZmF1bHQ7XG4kYnJhbmQtd2FybmluZzogICAgICAgICAjZjBhZDRlICFkZWZhdWx0O1xuJGJyYW5kLWRhbmdlcjogICAgICAgICAgI2Q5NTM0ZiAhZGVmYXVsdDtcblxuXG4vLz09IFNjYWZmb2xkaW5nXG4vL1xuLy8jIyBTZXR0aW5ncyBmb3Igc29tZSBvZiB0aGUgbW9zdCBnbG9iYWwgc3R5bGVzLlxuXG4vLyoqIEJhY2tncm91bmQgY29sb3IgZm9yIGA8Ym9keT5gLlxuJGJvZHktYmc6ICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbi8vKiogR2xvYmFsIHRleHQgY29sb3Igb24gYDxib2R5PmAuXG4kdGV4dC1jb2xvcjogICAgICAgICAgICAkZ3JheS1kYXJrICFkZWZhdWx0O1xuXG4vLyoqIEdsb2JhbCB0ZXh0dWFsIGxpbmsgY29sb3IuXG4kbGluay1jb2xvcjogICAgICAgICAgICAkYnJhbmQtcHJpbWFyeSAhZGVmYXVsdDtcbi8vKiogTGluayBob3ZlciBjb2xvciBzZXQgdmlhIGBkYXJrZW4oKWAgZnVuY3Rpb24uXG4kbGluay1ob3Zlci1jb2xvcjogICAgICBkYXJrZW4oJGxpbmstY29sb3IsIDE1JSkgIWRlZmF1bHQ7XG4vLyoqIExpbmsgaG92ZXIgZGVjb3JhdGlvbi5cbiRsaW5rLWhvdmVyLWRlY29yYXRpb246IHVuZGVybGluZSAhZGVmYXVsdDtcblxuXG4vLz09IFR5cG9ncmFwaHlcbi8vXG4vLyMjIEZvbnQsIGxpbmUtaGVpZ2h0LCBhbmQgY29sb3IgZm9yIGJvZHkgdGV4dCwgaGVhZGluZ3MsIGFuZCBtb3JlLlxuXG4kZm9udC1mYW1pbHktc2Fucy1zZXJpZjogIFwiSGVsdmV0aWNhIE5ldWVcIiwgSGVsdmV0aWNhLCBBcmlhbCwgc2Fucy1zZXJpZiAhZGVmYXVsdDtcbiRmb250LWZhbWlseS1zZXJpZjogICAgICAgR2VvcmdpYSwgXCJUaW1lcyBOZXcgUm9tYW5cIiwgVGltZXMsIHNlcmlmICFkZWZhdWx0O1xuLy8qKiBEZWZhdWx0IG1vbm9zcGFjZSBmb250cyBmb3IgYDxjb2RlPmAsIGA8a2JkPmAsIGFuZCBgPHByZT5gLlxuJGZvbnQtZmFtaWx5LW1vbm9zcGFjZTogICBNZW5sbywgTW9uYWNvLCBDb25zb2xhcywgXCJDb3VyaWVyIE5ld1wiLCBtb25vc3BhY2UgIWRlZmF1bHQ7XG4kZm9udC1mYW1pbHktYmFzZTogICAgICAgICRmb250LWZhbWlseS1zYW5zLXNlcmlmICFkZWZhdWx0O1xuXG4kZm9udC1zaXplLWJhc2U6ICAgICAgICAgIDE0cHggIWRlZmF1bHQ7XG4kZm9udC1zaXplLWxhcmdlOiAgICAgICAgIGNlaWwoKCRmb250LXNpemUtYmFzZSAqIDEuMjUpKSAhZGVmYXVsdDsgLy8gfjE4cHhcbiRmb250LXNpemUtc21hbGw6ICAgICAgICAgY2VpbCgoJGZvbnQtc2l6ZS1iYXNlICogMC44NSkpICFkZWZhdWx0OyAvLyB+MTJweFxuXG4kZm9udC1zaXplLWgxOiAgICAgICAgICAgIGZsb29yKCgkZm9udC1zaXplLWJhc2UgKiAyLjYpKSAhZGVmYXVsdDsgLy8gfjM2cHhcbiRmb250LXNpemUtaDI6ICAgICAgICAgICAgZmxvb3IoKCRmb250LXNpemUtYmFzZSAqIDIuMTUpKSAhZGVmYXVsdDsgLy8gfjMwcHhcbiRmb250LXNpemUtaDM6ICAgICAgICAgICAgY2VpbCgoJGZvbnQtc2l6ZS1iYXNlICogMS43KSkgIWRlZmF1bHQ7IC8vIH4yNHB4XG4kZm9udC1zaXplLWg0OiAgICAgICAgICAgIGNlaWwoKCRmb250LXNpemUtYmFzZSAqIDEuMjUpKSAhZGVmYXVsdDsgLy8gfjE4cHhcbiRmb250LXNpemUtaDU6ICAgICAgICAgICAgJGZvbnQtc2l6ZS1iYXNlICFkZWZhdWx0O1xuJGZvbnQtc2l6ZS1oNjogICAgICAgICAgICBjZWlsKCgkZm9udC1zaXplLWJhc2UgKiAwLjg1KSkgIWRlZmF1bHQ7IC8vIH4xMnB4XG5cbi8vKiogVW5pdC1sZXNzIGBsaW5lLWhlaWdodGAgZm9yIHVzZSBpbiBjb21wb25lbnRzIGxpa2UgYnV0dG9ucy5cbiRsaW5lLWhlaWdodC1iYXNlOiAgICAgICAgMS40Mjg1NzE0MjkgIWRlZmF1bHQ7IC8vIDIwLzE0XG4vLyoqIENvbXB1dGVkIFwibGluZS1oZWlnaHRcIiAoYGZvbnQtc2l6ZWAgKiBgbGluZS1oZWlnaHRgKSBmb3IgdXNlIHdpdGggYG1hcmdpbmAsIGBwYWRkaW5nYCwgZXRjLlxuJGxpbmUtaGVpZ2h0LWNvbXB1dGVkOiAgICBmbG9vcigoJGZvbnQtc2l6ZS1iYXNlICogJGxpbmUtaGVpZ2h0LWJhc2UpKSAhZGVmYXVsdDsgLy8gfjIwcHhcblxuLy8qKiBCeSBkZWZhdWx0LCB0aGlzIGluaGVyaXRzIGZyb20gdGhlIGA8Ym9keT5gLlxuJGhlYWRpbmdzLWZvbnQtZmFtaWx5OiAgICBpbmhlcml0ICFkZWZhdWx0O1xuJGhlYWRpbmdzLWZvbnQtd2VpZ2h0OiAgICA1MDAgIWRlZmF1bHQ7XG4kaGVhZGluZ3MtbGluZS1oZWlnaHQ6ICAgIDEuMSAhZGVmYXVsdDtcbiRoZWFkaW5ncy1jb2xvcjogICAgICAgICAgaW5oZXJpdCAhZGVmYXVsdDtcblxuXG4vLz09IEljb25vZ3JhcGh5XG4vL1xuLy8jIyBTcGVjaWZ5IGN1c3RvbSBsb2NhdGlvbiBhbmQgZmlsZW5hbWUgb2YgdGhlIGluY2x1ZGVkIEdseXBoaWNvbnMgaWNvbiBmb250LiBVc2VmdWwgZm9yIHRob3NlIGluY2x1ZGluZyBCb290c3RyYXAgdmlhIEJvd2VyLlxuXG4vLyoqIExvYWQgZm9udHMgZnJvbSB0aGlzIGRpcmVjdG9yeS5cblxuLy8gW2NvbnZlcnRlcl0gSWYgJGJvb3RzdHJhcC1zYXNzLWFzc2V0LWhlbHBlciBpZiB1c2VkLCBwcm92aWRlIHBhdGggcmVsYXRpdmUgdG8gdGhlIGFzc2V0cyBsb2FkIHBhdGguXG4vLyBbY29udmVydGVyXSBUaGlzIGlzIGJlY2F1c2Ugc29tZSBhc3NldCBoZWxwZXJzLCBzdWNoIGFzIFNwcm9ja2V0cywgZG8gbm90IHdvcmsgd2l0aCBmaWxlLXJlbGF0aXZlIHBhdGhzLlxuJGljb24tZm9udC1wYXRoOiBpZigkYm9vdHN0cmFwLXNhc3MtYXNzZXQtaGVscGVyLCBcImJvb3RzdHJhcC9cIiwgXCIuLi9mb250cy9ib290c3RyYXAvXCIpICFkZWZhdWx0O1xuXG4vLyoqIEZpbGUgbmFtZSBmb3IgYWxsIGZvbnQgZmlsZXMuXG4kaWNvbi1mb250LW5hbWU6ICAgICAgICAgIFwiZ2x5cGhpY29ucy1oYWxmbGluZ3MtcmVndWxhclwiICFkZWZhdWx0O1xuLy8qKiBFbGVtZW50IElEIHdpdGhpbiBTVkcgaWNvbiBmaWxlLlxuJGljb24tZm9udC1zdmctaWQ6ICAgICAgICBcImdseXBoaWNvbnNfaGFsZmxpbmdzcmVndWxhclwiICFkZWZhdWx0O1xuXG5cbi8vPT0gQ29tcG9uZW50c1xuLy9cbi8vIyMgRGVmaW5lIGNvbW1vbiBwYWRkaW5nIGFuZCBib3JkZXIgcmFkaXVzIHNpemVzIGFuZCBtb3JlLiBWYWx1ZXMgYmFzZWQgb24gMTRweCB0ZXh0IGFuZCAxLjQyOCBsaW5lLWhlaWdodCAofjIwcHggdG8gc3RhcnQpLlxuXG4kcGFkZGluZy1iYXNlLXZlcnRpY2FsOiAgICAgNnB4ICFkZWZhdWx0O1xuJHBhZGRpbmctYmFzZS1ob3Jpem9udGFsOiAgIDEycHggIWRlZmF1bHQ7XG5cbiRwYWRkaW5nLWxhcmdlLXZlcnRpY2FsOiAgICAxMHB4ICFkZWZhdWx0O1xuJHBhZGRpbmctbGFyZ2UtaG9yaXpvbnRhbDogIDE2cHggIWRlZmF1bHQ7XG5cbiRwYWRkaW5nLXNtYWxsLXZlcnRpY2FsOiAgICA1cHggIWRlZmF1bHQ7XG4kcGFkZGluZy1zbWFsbC1ob3Jpem9udGFsOiAgMTBweCAhZGVmYXVsdDtcblxuJHBhZGRpbmcteHMtdmVydGljYWw6ICAgICAgIDFweCAhZGVmYXVsdDtcbiRwYWRkaW5nLXhzLWhvcml6b250YWw6ICAgICA1cHggIWRlZmF1bHQ7XG5cbiRsaW5lLWhlaWdodC1sYXJnZTogICAgICAgICAxLjMzMzMzMzMgIWRlZmF1bHQ7IC8vIGV4dHJhIGRlY2ltYWxzIGZvciBXaW4gOC4xIENocm9tZVxuJGxpbmUtaGVpZ2h0LXNtYWxsOiAgICAgICAgIDEuNSAhZGVmYXVsdDtcblxuJGJvcmRlci1yYWRpdXMtYmFzZTogICAgICAgIDRweCAhZGVmYXVsdDtcbiRib3JkZXItcmFkaXVzLWxhcmdlOiAgICAgICA2cHggIWRlZmF1bHQ7XG4kYm9yZGVyLXJhZGl1cy1zbWFsbDogICAgICAgM3B4ICFkZWZhdWx0O1xuXG4vLyoqIEdsb2JhbCBjb2xvciBmb3IgYWN0aXZlIGl0ZW1zIChlLmcuLCBuYXZzIG9yIGRyb3Bkb3ducykuXG4kY29tcG9uZW50LWFjdGl2ZS1jb2xvcjogICAgI2ZmZiAhZGVmYXVsdDtcbi8vKiogR2xvYmFsIGJhY2tncm91bmQgY29sb3IgZm9yIGFjdGl2ZSBpdGVtcyAoZS5nLiwgbmF2cyBvciBkcm9wZG93bnMpLlxuJGNvbXBvbmVudC1hY3RpdmUtYmc6ICAgICAgICRicmFuZC1wcmltYXJ5ICFkZWZhdWx0O1xuXG4vLyoqIFdpZHRoIG9mIHRoZSBgYm9yZGVyYCBmb3IgZ2VuZXJhdGluZyBjYXJldHMgdGhhdCBpbmRpY2F0b3IgZHJvcGRvd25zLlxuJGNhcmV0LXdpZHRoLWJhc2U6ICAgICAgICAgIDRweCAhZGVmYXVsdDtcbi8vKiogQ2FyZXRzIGluY3JlYXNlIHNsaWdodGx5IGluIHNpemUgZm9yIGxhcmdlciBjb21wb25lbnRzLlxuJGNhcmV0LXdpZHRoLWxhcmdlOiAgICAgICAgIDVweCAhZGVmYXVsdDtcblxuXG4vLz09IFRhYmxlc1xuLy9cbi8vIyMgQ3VzdG9taXplcyB0aGUgYC50YWJsZWAgY29tcG9uZW50IHdpdGggYmFzaWMgdmFsdWVzLCBlYWNoIHVzZWQgYWNyb3NzIGFsbCB0YWJsZSB2YXJpYXRpb25zLlxuXG4vLyoqIFBhZGRpbmcgZm9yIGA8dGg+YHMgYW5kIGA8dGQ+YHMuXG4kdGFibGUtY2VsbC1wYWRkaW5nOiAgICAgICAgICAgIDhweCAhZGVmYXVsdDtcbi8vKiogUGFkZGluZyBmb3IgY2VsbHMgaW4gYC50YWJsZS1jb25kZW5zZWRgLlxuJHRhYmxlLWNvbmRlbnNlZC1jZWxsLXBhZGRpbmc6ICA1cHggIWRlZmF1bHQ7XG5cbi8vKiogRGVmYXVsdCBiYWNrZ3JvdW5kIGNvbG9yIHVzZWQgZm9yIGFsbCB0YWJsZXMuXG4kdGFibGUtYmc6ICAgICAgICAgICAgICAgICAgICAgIHRyYW5zcGFyZW50ICFkZWZhdWx0O1xuLy8qKiBCYWNrZ3JvdW5kIGNvbG9yIHVzZWQgZm9yIGAudGFibGUtc3RyaXBlZGAuXG4kdGFibGUtYmctYWNjZW50OiAgICAgICAgICAgICAgICNmOWY5ZjkgIWRlZmF1bHQ7XG4vLyoqIEJhY2tncm91bmQgY29sb3IgdXNlZCBmb3IgYC50YWJsZS1ob3ZlcmAuXG4kdGFibGUtYmctaG92ZXI6ICAgICAgICAgICAgICAgICNmNWY1ZjUgIWRlZmF1bHQ7XG4kdGFibGUtYmctYWN0aXZlOiAgICAgICAgICAgICAgICR0YWJsZS1iZy1ob3ZlciAhZGVmYXVsdDtcblxuLy8qKiBCb3JkZXIgY29sb3IgZm9yIHRhYmxlIGFuZCBjZWxsIGJvcmRlcnMuXG4kdGFibGUtYm9yZGVyLWNvbG9yOiAgICAgICAgICAgICNkZGQgIWRlZmF1bHQ7XG5cblxuLy89PSBCdXR0b25zXG4vL1xuLy8jIyBGb3IgZWFjaCBvZiBCb290c3RyYXAncyBidXR0b25zLCBkZWZpbmUgdGV4dCwgYmFja2dyb3VuZCBhbmQgYm9yZGVyIGNvbG9yLlxuXG4kYnRuLWZvbnQtd2VpZ2h0OiAgICAgICAgICAgICAgICBub3JtYWwgIWRlZmF1bHQ7XG5cbiRidG4tZGVmYXVsdC1jb2xvcjogICAgICAgICAgICAgICMzMzMgIWRlZmF1bHQ7XG4kYnRuLWRlZmF1bHQtYmc6ICAgICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuJGJ0bi1kZWZhdWx0LWJvcmRlcjogICAgICAgICAgICAgI2NjYyAhZGVmYXVsdDtcblxuJGJ0bi1wcmltYXJ5LWNvbG9yOiAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRidG4tcHJpbWFyeS1iZzogICAgICAgICAgICAgICAgICRicmFuZC1wcmltYXJ5ICFkZWZhdWx0O1xuJGJ0bi1wcmltYXJ5LWJvcmRlcjogICAgICAgICAgICAgZGFya2VuKCRidG4tcHJpbWFyeS1iZywgNSUpICFkZWZhdWx0O1xuXG4kYnRuLXN1Y2Nlc3MtY29sb3I6ICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuJGJ0bi1zdWNjZXNzLWJnOiAgICAgICAgICAgICAgICAgJGJyYW5kLXN1Y2Nlc3MgIWRlZmF1bHQ7XG4kYnRuLXN1Y2Nlc3MtYm9yZGVyOiAgICAgICAgICAgICBkYXJrZW4oJGJ0bi1zdWNjZXNzLWJnLCA1JSkgIWRlZmF1bHQ7XG5cbiRidG4taW5mby1jb2xvcjogICAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kYnRuLWluZm8tYmc6ICAgICAgICAgICAgICAgICAgICAkYnJhbmQtaW5mbyAhZGVmYXVsdDtcbiRidG4taW5mby1ib3JkZXI6ICAgICAgICAgICAgICAgIGRhcmtlbigkYnRuLWluZm8tYmcsIDUlKSAhZGVmYXVsdDtcblxuJGJ0bi13YXJuaW5nLWNvbG9yOiAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRidG4td2FybmluZy1iZzogICAgICAgICAgICAgICAgICRicmFuZC13YXJuaW5nICFkZWZhdWx0O1xuJGJ0bi13YXJuaW5nLWJvcmRlcjogICAgICAgICAgICAgZGFya2VuKCRidG4td2FybmluZy1iZywgNSUpICFkZWZhdWx0O1xuXG4kYnRuLWRhbmdlci1jb2xvcjogICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuJGJ0bi1kYW5nZXItYmc6ICAgICAgICAgICAgICAgICAgJGJyYW5kLWRhbmdlciAhZGVmYXVsdDtcbiRidG4tZGFuZ2VyLWJvcmRlcjogICAgICAgICAgICAgIGRhcmtlbigkYnRuLWRhbmdlci1iZywgNSUpICFkZWZhdWx0O1xuXG4kYnRuLWxpbmstZGlzYWJsZWQtY29sb3I6ICAgICAgICAkZ3JheS1saWdodCAhZGVmYXVsdDtcblxuLy8gQWxsb3dzIGZvciBjdXN0b21pemluZyBidXR0b24gcmFkaXVzIGluZGVwZW5kZW50bHkgZnJvbSBnbG9iYWwgYm9yZGVyIHJhZGl1c1xuJGJ0bi1ib3JkZXItcmFkaXVzLWJhc2U6ICAgICAgICAgJGJvcmRlci1yYWRpdXMtYmFzZSAhZGVmYXVsdDtcbiRidG4tYm9yZGVyLXJhZGl1cy1sYXJnZTogICAgICAgICRib3JkZXItcmFkaXVzLWxhcmdlICFkZWZhdWx0O1xuJGJ0bi1ib3JkZXItcmFkaXVzLXNtYWxsOiAgICAgICAgJGJvcmRlci1yYWRpdXMtc21hbGwgIWRlZmF1bHQ7XG5cblxuLy89PSBGb3Jtc1xuLy9cbi8vIyNcblxuLy8qKiBgPGlucHV0PmAgYmFja2dyb3VuZCBjb2xvclxuJGlucHV0LWJnOiAgICAgICAgICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbi8vKiogYDxpbnB1dCBkaXNhYmxlZD5gIGJhY2tncm91bmQgY29sb3JcbiRpbnB1dC1iZy1kaXNhYmxlZDogICAgICAgICAgICAgICRncmF5LWxpZ2h0ZXIgIWRlZmF1bHQ7XG5cbi8vKiogVGV4dCBjb2xvciBmb3IgYDxpbnB1dD5gc1xuJGlucHV0LWNvbG9yOiAgICAgICAgICAgICAgICAgICAgJGdyYXkgIWRlZmF1bHQ7XG4vLyoqIGA8aW5wdXQ+YCBib3JkZXIgY29sb3JcbiRpbnB1dC1ib3JkZXI6ICAgICAgICAgICAgICAgICAgICNjY2MgIWRlZmF1bHQ7XG5cbi8vIFRPRE86IFJlbmFtZSBgJGlucHV0LWJvcmRlci1yYWRpdXNgIHRvIGAkaW5wdXQtYm9yZGVyLXJhZGl1cy1iYXNlYCBpbiB2NFxuLy8qKiBEZWZhdWx0IGAuZm9ybS1jb250cm9sYCBib3JkZXIgcmFkaXVzXG4vLyBUaGlzIGhhcyBubyBlZmZlY3Qgb24gYDxzZWxlY3Q+YHMgaW4gc29tZSBicm93c2VycywgZHVlIHRvIHRoZSBsaW1pdGVkIHN0eWxhYmlsaXR5IG9mIGA8c2VsZWN0PmBzIGluIENTUy5cbiRpbnB1dC1ib3JkZXItcmFkaXVzOiAgICAgICAgICAgICRib3JkZXItcmFkaXVzLWJhc2UgIWRlZmF1bHQ7XG4vLyoqIExhcmdlIGAuZm9ybS1jb250cm9sYCBib3JkZXIgcmFkaXVzXG4kaW5wdXQtYm9yZGVyLXJhZGl1cy1sYXJnZTogICAgICAkYm9yZGVyLXJhZGl1cy1sYXJnZSAhZGVmYXVsdDtcbi8vKiogU21hbGwgYC5mb3JtLWNvbnRyb2xgIGJvcmRlciByYWRpdXNcbiRpbnB1dC1ib3JkZXItcmFkaXVzLXNtYWxsOiAgICAgICRib3JkZXItcmFkaXVzLXNtYWxsICFkZWZhdWx0O1xuXG4vLyoqIEJvcmRlciBjb2xvciBmb3IgaW5wdXRzIG9uIGZvY3VzXG4kaW5wdXQtYm9yZGVyLWZvY3VzOiAgICAgICAgICAgICAjNjZhZmU5ICFkZWZhdWx0O1xuXG4vLyoqIFBsYWNlaG9sZGVyIHRleHQgY29sb3JcbiRpbnB1dC1jb2xvci1wbGFjZWhvbGRlcjogICAgICAgICM5OTkgIWRlZmF1bHQ7XG5cbi8vKiogRGVmYXVsdCBgLmZvcm0tY29udHJvbGAgaGVpZ2h0XG4kaW5wdXQtaGVpZ2h0LWJhc2U6ICAgICAgICAgICAgICAoJGxpbmUtaGVpZ2h0LWNvbXB1dGVkICsgKCRwYWRkaW5nLWJhc2UtdmVydGljYWwgKiAyKSArIDIpICFkZWZhdWx0O1xuLy8qKiBMYXJnZSBgLmZvcm0tY29udHJvbGAgaGVpZ2h0XG4kaW5wdXQtaGVpZ2h0LWxhcmdlOiAgICAgICAgICAgICAoY2VpbCgkZm9udC1zaXplLWxhcmdlICogJGxpbmUtaGVpZ2h0LWxhcmdlKSArICgkcGFkZGluZy1sYXJnZS12ZXJ0aWNhbCAqIDIpICsgMikgIWRlZmF1bHQ7XG4vLyoqIFNtYWxsIGAuZm9ybS1jb250cm9sYCBoZWlnaHRcbiRpbnB1dC1oZWlnaHQtc21hbGw6ICAgICAgICAgICAgIChmbG9vcigkZm9udC1zaXplLXNtYWxsICogJGxpbmUtaGVpZ2h0LXNtYWxsKSArICgkcGFkZGluZy1zbWFsbC12ZXJ0aWNhbCAqIDIpICsgMikgIWRlZmF1bHQ7XG5cbi8vKiogYC5mb3JtLWdyb3VwYCBtYXJnaW5cbiRmb3JtLWdyb3VwLW1hcmdpbi1ib3R0b206ICAgICAgIDE1cHggIWRlZmF1bHQ7XG5cbiRsZWdlbmQtY29sb3I6ICAgICAgICAgICAgICAgICAgICRncmF5LWRhcmsgIWRlZmF1bHQ7XG4kbGVnZW5kLWJvcmRlci1jb2xvcjogICAgICAgICAgICAjZTVlNWU1ICFkZWZhdWx0O1xuXG4vLyoqIEJhY2tncm91bmQgY29sb3IgZm9yIHRleHR1YWwgaW5wdXQgYWRkb25zXG4kaW5wdXQtZ3JvdXAtYWRkb24tYmc6ICAgICAgICAgICAkZ3JheS1saWdodGVyICFkZWZhdWx0O1xuLy8qKiBCb3JkZXIgY29sb3IgZm9yIHRleHR1YWwgaW5wdXQgYWRkb25zXG4kaW5wdXQtZ3JvdXAtYWRkb24tYm9yZGVyLWNvbG9yOiAkaW5wdXQtYm9yZGVyICFkZWZhdWx0O1xuXG4vLyoqIERpc2FibGVkIGN1cnNvciBmb3IgZm9ybSBjb250cm9scyBhbmQgYnV0dG9ucy5cbiRjdXJzb3ItZGlzYWJsZWQ6ICAgICAgICAgICAgICAgIG5vdC1hbGxvd2VkICFkZWZhdWx0O1xuXG5cbi8vPT0gRHJvcGRvd25zXG4vL1xuLy8jIyBEcm9wZG93biBtZW51IGNvbnRhaW5lciBhbmQgY29udGVudHMuXG5cbi8vKiogQmFja2dyb3VuZCBmb3IgdGhlIGRyb3Bkb3duIG1lbnUuXG4kZHJvcGRvd24tYmc6ICAgICAgICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuLy8qKiBEcm9wZG93biBtZW51IGBib3JkZXItY29sb3JgLlxuJGRyb3Bkb3duLWJvcmRlcjogICAgICAgICAgICAgICAgcmdiYSgwLDAsMCwuMTUpICFkZWZhdWx0O1xuLy8qKiBEcm9wZG93biBtZW51IGBib3JkZXItY29sb3JgICoqZm9yIElFOCoqLlxuJGRyb3Bkb3duLWZhbGxiYWNrLWJvcmRlcjogICAgICAgI2NjYyAhZGVmYXVsdDtcbi8vKiogRGl2aWRlciBjb2xvciBmb3IgYmV0d2VlbiBkcm9wZG93biBpdGVtcy5cbiRkcm9wZG93bi1kaXZpZGVyLWJnOiAgICAgICAgICAgICNlNWU1ZTUgIWRlZmF1bHQ7XG5cbi8vKiogRHJvcGRvd24gbGluayB0ZXh0IGNvbG9yLlxuJGRyb3Bkb3duLWxpbmstY29sb3I6ICAgICAgICAgICAgJGdyYXktZGFyayAhZGVmYXVsdDtcbi8vKiogSG92ZXIgY29sb3IgZm9yIGRyb3Bkb3duIGxpbmtzLlxuJGRyb3Bkb3duLWxpbmstaG92ZXItY29sb3I6ICAgICAgZGFya2VuKCRncmF5LWRhcmssIDUlKSAhZGVmYXVsdDtcbi8vKiogSG92ZXIgYmFja2dyb3VuZCBmb3IgZHJvcGRvd24gbGlua3MuXG4kZHJvcGRvd24tbGluay1ob3Zlci1iZzogICAgICAgICAjZjVmNWY1ICFkZWZhdWx0O1xuXG4vLyoqIEFjdGl2ZSBkcm9wZG93biBtZW51IGl0ZW0gdGV4dCBjb2xvci5cbiRkcm9wZG93bi1saW5rLWFjdGl2ZS1jb2xvcjogICAgICRjb21wb25lbnQtYWN0aXZlLWNvbG9yICFkZWZhdWx0O1xuLy8qKiBBY3RpdmUgZHJvcGRvd24gbWVudSBpdGVtIGJhY2tncm91bmQgY29sb3IuXG4kZHJvcGRvd24tbGluay1hY3RpdmUtYmc6ICAgICAgICAkY29tcG9uZW50LWFjdGl2ZS1iZyAhZGVmYXVsdDtcblxuLy8qKiBEaXNhYmxlZCBkcm9wZG93biBtZW51IGl0ZW0gYmFja2dyb3VuZCBjb2xvci5cbiRkcm9wZG93bi1saW5rLWRpc2FibGVkLWNvbG9yOiAgICRncmF5LWxpZ2h0ICFkZWZhdWx0O1xuXG4vLyoqIFRleHQgY29sb3IgZm9yIGhlYWRlcnMgd2l0aGluIGRyb3Bkb3duIG1lbnVzLlxuJGRyb3Bkb3duLWhlYWRlci1jb2xvcjogICAgICAgICAgJGdyYXktbGlnaHQgIWRlZmF1bHQ7XG5cbi8vKiogRGVwcmVjYXRlZCBgJGRyb3Bkb3duLWNhcmV0LWNvbG9yYCBhcyBvZiB2My4xLjBcbiRkcm9wZG93bi1jYXJldC1jb2xvcjogICAgICAgICAgICMwMDAgIWRlZmF1bHQ7XG5cblxuLy8tLSBaLWluZGV4IG1hc3RlciBsaXN0XG4vL1xuLy8gV2FybmluZzogQXZvaWQgY3VzdG9taXppbmcgdGhlc2UgdmFsdWVzLiBUaGV5J3JlIHVzZWQgZm9yIGEgYmlyZCdzIGV5ZSB2aWV3XG4vLyBvZiBjb21wb25lbnRzIGRlcGVuZGVudCBvbiB0aGUgei1heGlzIGFuZCBhcmUgZGVzaWduZWQgdG8gYWxsIHdvcmsgdG9nZXRoZXIuXG4vL1xuLy8gTm90ZTogVGhlc2UgdmFyaWFibGVzIGFyZSBub3QgZ2VuZXJhdGVkIGludG8gdGhlIEN1c3RvbWl6ZXIuXG5cbiR6aW5kZXgtbmF2YmFyOiAgICAgICAgICAgIDEwMDAgIWRlZmF1bHQ7XG4kemluZGV4LWRyb3Bkb3duOiAgICAgICAgICAxMDAwICFkZWZhdWx0O1xuJHppbmRleC1wb3BvdmVyOiAgICAgICAgICAgMTA2MCAhZGVmYXVsdDtcbiR6aW5kZXgtdG9vbHRpcDogICAgICAgICAgIDEwNzAgIWRlZmF1bHQ7XG4kemluZGV4LW5hdmJhci1maXhlZDogICAgICAxMDMwICFkZWZhdWx0O1xuJHppbmRleC1tb2RhbC1iYWNrZ3JvdW5kOiAgMTA0MCAhZGVmYXVsdDtcbiR6aW5kZXgtbW9kYWw6ICAgICAgICAgICAgIDEwNTAgIWRlZmF1bHQ7XG5cblxuLy89PSBNZWRpYSBxdWVyaWVzIGJyZWFrcG9pbnRzXG4vL1xuLy8jIyBEZWZpbmUgdGhlIGJyZWFrcG9pbnRzIGF0IHdoaWNoIHlvdXIgbGF5b3V0IHdpbGwgY2hhbmdlLCBhZGFwdGluZyB0byBkaWZmZXJlbnQgc2NyZWVuIHNpemVzLlxuXG4vLyBFeHRyYSBzbWFsbCBzY3JlZW4gLyBwaG9uZVxuLy8qKiBEZXByZWNhdGVkIGAkc2NyZWVuLXhzYCBhcyBvZiB2My4wLjFcbiRzY3JlZW4teHM6ICAgICAgICAgICAgICAgICAgNDgwcHggIWRlZmF1bHQ7XG4vLyoqIERlcHJlY2F0ZWQgYCRzY3JlZW4teHMtbWluYCBhcyBvZiB2My4yLjBcbiRzY3JlZW4teHMtbWluOiAgICAgICAgICAgICAgJHNjcmVlbi14cyAhZGVmYXVsdDtcbi8vKiogRGVwcmVjYXRlZCBgJHNjcmVlbi1waG9uZWAgYXMgb2YgdjMuMC4xXG4kc2NyZWVuLXBob25lOiAgICAgICAgICAgICAgICRzY3JlZW4teHMtbWluICFkZWZhdWx0O1xuXG4vLyBTbWFsbCBzY3JlZW4gLyB0YWJsZXRcbi8vKiogRGVwcmVjYXRlZCBgJHNjcmVlbi1zbWAgYXMgb2YgdjMuMC4xXG4kc2NyZWVuLXNtOiAgICAgICAgICAgICAgICAgIDc2OHB4ICFkZWZhdWx0O1xuJHNjcmVlbi1zbS1taW46ICAgICAgICAgICAgICAkc2NyZWVuLXNtICFkZWZhdWx0O1xuLy8qKiBEZXByZWNhdGVkIGAkc2NyZWVuLXRhYmxldGAgYXMgb2YgdjMuMC4xXG4kc2NyZWVuLXRhYmxldDogICAgICAgICAgICAgICRzY3JlZW4tc20tbWluICFkZWZhdWx0O1xuXG4vLyBNZWRpdW0gc2NyZWVuIC8gZGVza3RvcFxuLy8qKiBEZXByZWNhdGVkIGAkc2NyZWVuLW1kYCBhcyBvZiB2My4wLjFcbiRzY3JlZW4tbWQ6ICAgICAgICAgICAgICAgICAgOTkycHggIWRlZmF1bHQ7XG4kc2NyZWVuLW1kLW1pbjogICAgICAgICAgICAgICRzY3JlZW4tbWQgIWRlZmF1bHQ7XG4vLyoqIERlcHJlY2F0ZWQgYCRzY3JlZW4tZGVza3RvcGAgYXMgb2YgdjMuMC4xXG4kc2NyZWVuLWRlc2t0b3A6ICAgICAgICAgICAgICRzY3JlZW4tbWQtbWluICFkZWZhdWx0O1xuXG4vLyBMYXJnZSBzY3JlZW4gLyB3aWRlIGRlc2t0b3Bcbi8vKiogRGVwcmVjYXRlZCBgJHNjcmVlbi1sZ2AgYXMgb2YgdjMuMC4xXG4kc2NyZWVuLWxnOiAgICAgICAgICAgICAgICAgIDEyMDBweCAhZGVmYXVsdDtcbiRzY3JlZW4tbGctbWluOiAgICAgICAgICAgICAgJHNjcmVlbi1sZyAhZGVmYXVsdDtcbi8vKiogRGVwcmVjYXRlZCBgJHNjcmVlbi1sZy1kZXNrdG9wYCBhcyBvZiB2My4wLjFcbiRzY3JlZW4tbGctZGVza3RvcDogICAgICAgICAgJHNjcmVlbi1sZy1taW4gIWRlZmF1bHQ7XG5cbi8vIFNvIG1lZGlhIHF1ZXJpZXMgZG9uJ3Qgb3ZlcmxhcCB3aGVuIHJlcXVpcmVkLCBwcm92aWRlIGEgbWF4aW11bVxuJHNjcmVlbi14cy1tYXg6ICAgICAgICAgICAgICAoJHNjcmVlbi1zbS1taW4gLSAxKSAhZGVmYXVsdDtcbiRzY3JlZW4tc20tbWF4OiAgICAgICAgICAgICAgKCRzY3JlZW4tbWQtbWluIC0gMSkgIWRlZmF1bHQ7XG4kc2NyZWVuLW1kLW1heDogICAgICAgICAgICAgICgkc2NyZWVuLWxnLW1pbiAtIDEpICFkZWZhdWx0O1xuXG5cbi8vPT0gR3JpZCBzeXN0ZW1cbi8vXG4vLyMjIERlZmluZSB5b3VyIGN1c3RvbSByZXNwb25zaXZlIGdyaWQuXG5cbi8vKiogTnVtYmVyIG9mIGNvbHVtbnMgaW4gdGhlIGdyaWQuXG4kZ3JpZC1jb2x1bW5zOiAgICAgICAgICAgICAgMTIgIWRlZmF1bHQ7XG4vLyoqIFBhZGRpbmcgYmV0d2VlbiBjb2x1bW5zLiBHZXRzIGRpdmlkZWQgaW4gaGFsZiBmb3IgdGhlIGxlZnQgYW5kIHJpZ2h0LlxuJGdyaWQtZ3V0dGVyLXdpZHRoOiAgICAgICAgIDMwcHggIWRlZmF1bHQ7XG4vLyBOYXZiYXIgY29sbGFwc2Vcbi8vKiogUG9pbnQgYXQgd2hpY2ggdGhlIG5hdmJhciBiZWNvbWVzIHVuY29sbGFwc2VkLlxuJGdyaWQtZmxvYXQtYnJlYWtwb2ludDogICAgICRzY3JlZW4tc20tbWluICFkZWZhdWx0O1xuLy8qKiBQb2ludCBhdCB3aGljaCB0aGUgbmF2YmFyIGJlZ2lucyBjb2xsYXBzaW5nLlxuJGdyaWQtZmxvYXQtYnJlYWtwb2ludC1tYXg6ICgkZ3JpZC1mbG9hdC1icmVha3BvaW50IC0gMSkgIWRlZmF1bHQ7XG5cblxuLy89PSBDb250YWluZXIgc2l6ZXNcbi8vXG4vLyMjIERlZmluZSB0aGUgbWF4aW11bSB3aWR0aCBvZiBgLmNvbnRhaW5lcmAgZm9yIGRpZmZlcmVudCBzY3JlZW4gc2l6ZXMuXG5cbi8vIFNtYWxsIHNjcmVlbiAvIHRhYmxldFxuJGNvbnRhaW5lci10YWJsZXQ6ICAgICAgICAgICAgICg3MjBweCArICRncmlkLWd1dHRlci13aWR0aCkgIWRlZmF1bHQ7XG4vLyoqIEZvciBgJHNjcmVlbi1zbS1taW5gIGFuZCB1cC5cbiRjb250YWluZXItc206ICAgICAgICAgICAgICAgICAkY29udGFpbmVyLXRhYmxldCAhZGVmYXVsdDtcblxuLy8gTWVkaXVtIHNjcmVlbiAvIGRlc2t0b3BcbiRjb250YWluZXItZGVza3RvcDogICAgICAgICAgICAoOTQwcHggKyAkZ3JpZC1ndXR0ZXItd2lkdGgpICFkZWZhdWx0O1xuLy8qKiBGb3IgYCRzY3JlZW4tbWQtbWluYCBhbmQgdXAuXG4kY29udGFpbmVyLW1kOiAgICAgICAgICAgICAgICAgJGNvbnRhaW5lci1kZXNrdG9wICFkZWZhdWx0O1xuXG4vLyBMYXJnZSBzY3JlZW4gLyB3aWRlIGRlc2t0b3BcbiRjb250YWluZXItbGFyZ2UtZGVza3RvcDogICAgICAoMTE0MHB4ICsgJGdyaWQtZ3V0dGVyLXdpZHRoKSAhZGVmYXVsdDtcbi8vKiogRm9yIGAkc2NyZWVuLWxnLW1pbmAgYW5kIHVwLlxuJGNvbnRhaW5lci1sZzogICAgICAgICAgICAgICAgICRjb250YWluZXItbGFyZ2UtZGVza3RvcCAhZGVmYXVsdDtcblxuXG4vLz09IE5hdmJhclxuLy9cbi8vIyNcblxuLy8gQmFzaWNzIG9mIGEgbmF2YmFyXG4kbmF2YmFyLWhlaWdodDogICAgICAgICAgICAgICAgICAgIDUwcHggIWRlZmF1bHQ7XG4kbmF2YmFyLW1hcmdpbi1ib3R0b206ICAgICAgICAgICAgICRsaW5lLWhlaWdodC1jb21wdXRlZCAhZGVmYXVsdDtcbiRuYXZiYXItYm9yZGVyLXJhZGl1czogICAgICAgICAgICAgJGJvcmRlci1yYWRpdXMtYmFzZSAhZGVmYXVsdDtcbiRuYXZiYXItcGFkZGluZy1ob3Jpem9udGFsOiAgICAgICAgZmxvb3IoKCRncmlkLWd1dHRlci13aWR0aCAvIDIpKSAhZGVmYXVsdDtcbiRuYXZiYXItcGFkZGluZy12ZXJ0aWNhbDogICAgICAgICAgKCgkbmF2YmFyLWhlaWdodCAtICRsaW5lLWhlaWdodC1jb21wdXRlZCkgLyAyKSAhZGVmYXVsdDtcbiRuYXZiYXItY29sbGFwc2UtbWF4LWhlaWdodDogICAgICAgMzQwcHggIWRlZmF1bHQ7XG5cbiRuYXZiYXItZGVmYXVsdC1jb2xvcjogICAgICAgICAgICAgIzc3NyAhZGVmYXVsdDtcbiRuYXZiYXItZGVmYXVsdC1iZzogICAgICAgICAgICAgICAgI2Y4ZjhmOCAhZGVmYXVsdDtcbiRuYXZiYXItZGVmYXVsdC1ib3JkZXI6ICAgICAgICAgICAgZGFya2VuKCRuYXZiYXItZGVmYXVsdC1iZywgNi41JSkgIWRlZmF1bHQ7XG5cbi8vIE5hdmJhciBsaW5rc1xuJG5hdmJhci1kZWZhdWx0LWxpbmstY29sb3I6ICAgICAgICAgICAgICAgICM3NzcgIWRlZmF1bHQ7XG4kbmF2YmFyLWRlZmF1bHQtbGluay1ob3Zlci1jb2xvcjogICAgICAgICAgIzMzMyAhZGVmYXVsdDtcbiRuYXZiYXItZGVmYXVsdC1saW5rLWhvdmVyLWJnOiAgICAgICAgICAgICB0cmFuc3BhcmVudCAhZGVmYXVsdDtcbiRuYXZiYXItZGVmYXVsdC1saW5rLWFjdGl2ZS1jb2xvcjogICAgICAgICAjNTU1ICFkZWZhdWx0O1xuJG5hdmJhci1kZWZhdWx0LWxpbmstYWN0aXZlLWJnOiAgICAgICAgICAgIGRhcmtlbigkbmF2YmFyLWRlZmF1bHQtYmcsIDYuNSUpICFkZWZhdWx0O1xuJG5hdmJhci1kZWZhdWx0LWxpbmstZGlzYWJsZWQtY29sb3I6ICAgICAgICNjY2MgIWRlZmF1bHQ7XG4kbmF2YmFyLWRlZmF1bHQtbGluay1kaXNhYmxlZC1iZzogICAgICAgICAgdHJhbnNwYXJlbnQgIWRlZmF1bHQ7XG5cbi8vIE5hdmJhciBicmFuZCBsYWJlbFxuJG5hdmJhci1kZWZhdWx0LWJyYW5kLWNvbG9yOiAgICAgICAgICAgICAgICRuYXZiYXItZGVmYXVsdC1saW5rLWNvbG9yICFkZWZhdWx0O1xuJG5hdmJhci1kZWZhdWx0LWJyYW5kLWhvdmVyLWNvbG9yOiAgICAgICAgIGRhcmtlbigkbmF2YmFyLWRlZmF1bHQtYnJhbmQtY29sb3IsIDEwJSkgIWRlZmF1bHQ7XG4kbmF2YmFyLWRlZmF1bHQtYnJhbmQtaG92ZXItYmc6ICAgICAgICAgICAgdHJhbnNwYXJlbnQgIWRlZmF1bHQ7XG5cbi8vIE5hdmJhciB0b2dnbGVcbiRuYXZiYXItZGVmYXVsdC10b2dnbGUtaG92ZXItYmc6ICAgICAgICAgICAjZGRkICFkZWZhdWx0O1xuJG5hdmJhci1kZWZhdWx0LXRvZ2dsZS1pY29uLWJhci1iZzogICAgICAgICM4ODggIWRlZmF1bHQ7XG4kbmF2YmFyLWRlZmF1bHQtdG9nZ2xlLWJvcmRlci1jb2xvcjogICAgICAgI2RkZCAhZGVmYXVsdDtcblxuXG4vLz09PSBJbnZlcnRlZCBuYXZiYXJcbi8vIFJlc2V0IGludmVydGVkIG5hdmJhciBiYXNpY3NcbiRuYXZiYXItaW52ZXJzZS1jb2xvcjogICAgICAgICAgICAgICAgICAgICAgbGlnaHRlbigkZ3JheS1saWdodCwgMTUlKSAhZGVmYXVsdDtcbiRuYXZiYXItaW52ZXJzZS1iZzogICAgICAgICAgICAgICAgICAgICAgICAgIzIyMiAhZGVmYXVsdDtcbiRuYXZiYXItaW52ZXJzZS1ib3JkZXI6ICAgICAgICAgICAgICAgICAgICAgZGFya2VuKCRuYXZiYXItaW52ZXJzZS1iZywgMTAlKSAhZGVmYXVsdDtcblxuLy8gSW52ZXJ0ZWQgbmF2YmFyIGxpbmtzXG4kbmF2YmFyLWludmVyc2UtbGluay1jb2xvcjogICAgICAgICAgICAgICAgIGxpZ2h0ZW4oJGdyYXktbGlnaHQsIDE1JSkgIWRlZmF1bHQ7XG4kbmF2YmFyLWludmVyc2UtbGluay1ob3Zlci1jb2xvcjogICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kbmF2YmFyLWludmVyc2UtbGluay1ob3Zlci1iZzogICAgICAgICAgICAgIHRyYW5zcGFyZW50ICFkZWZhdWx0O1xuJG5hdmJhci1pbnZlcnNlLWxpbmstYWN0aXZlLWNvbG9yOiAgICAgICAgICAkbmF2YmFyLWludmVyc2UtbGluay1ob3Zlci1jb2xvciAhZGVmYXVsdDtcbiRuYXZiYXItaW52ZXJzZS1saW5rLWFjdGl2ZS1iZzogICAgICAgICAgICAgZGFya2VuKCRuYXZiYXItaW52ZXJzZS1iZywgMTAlKSAhZGVmYXVsdDtcbiRuYXZiYXItaW52ZXJzZS1saW5rLWRpc2FibGVkLWNvbG9yOiAgICAgICAgIzQ0NCAhZGVmYXVsdDtcbiRuYXZiYXItaW52ZXJzZS1saW5rLWRpc2FibGVkLWJnOiAgICAgICAgICAgdHJhbnNwYXJlbnQgIWRlZmF1bHQ7XG5cbi8vIEludmVydGVkIG5hdmJhciBicmFuZCBsYWJlbFxuJG5hdmJhci1pbnZlcnNlLWJyYW5kLWNvbG9yOiAgICAgICAgICAgICAgICAkbmF2YmFyLWludmVyc2UtbGluay1jb2xvciAhZGVmYXVsdDtcbiRuYXZiYXItaW52ZXJzZS1icmFuZC1ob3Zlci1jb2xvcjogICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRuYXZiYXItaW52ZXJzZS1icmFuZC1ob3Zlci1iZzogICAgICAgICAgICAgdHJhbnNwYXJlbnQgIWRlZmF1bHQ7XG5cbi8vIEludmVydGVkIG5hdmJhciB0b2dnbGVcbiRuYXZiYXItaW52ZXJzZS10b2dnbGUtaG92ZXItYmc6ICAgICAgICAgICAgIzMzMyAhZGVmYXVsdDtcbiRuYXZiYXItaW52ZXJzZS10b2dnbGUtaWNvbi1iYXItYmc6ICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRuYXZiYXItaW52ZXJzZS10b2dnbGUtYm9yZGVyLWNvbG9yOiAgICAgICAgIzMzMyAhZGVmYXVsdDtcblxuXG4vLz09IE5hdnNcbi8vXG4vLyMjXG5cbi8vPT09IFNoYXJlZCBuYXYgc3R5bGVzXG4kbmF2LWxpbmstcGFkZGluZzogICAgICAgICAgICAgICAgICAgICAgICAgIDEwcHggMTVweCAhZGVmYXVsdDtcbiRuYXYtbGluay1ob3Zlci1iZzogICAgICAgICAgICAgICAgICAgICAgICAgJGdyYXktbGlnaHRlciAhZGVmYXVsdDtcblxuJG5hdi1kaXNhYmxlZC1saW5rLWNvbG9yOiAgICAgICAgICAgICAgICAgICAkZ3JheS1saWdodCAhZGVmYXVsdDtcbiRuYXYtZGlzYWJsZWQtbGluay1ob3Zlci1jb2xvcjogICAgICAgICAgICAgJGdyYXktbGlnaHQgIWRlZmF1bHQ7XG5cbi8vPT0gVGFic1xuJG5hdi10YWJzLWJvcmRlci1jb2xvcjogICAgICAgICAgICAgICAgICAgICAjZGRkICFkZWZhdWx0O1xuXG4kbmF2LXRhYnMtbGluay1ob3Zlci1ib3JkZXItY29sb3I6ICAgICAgICAgICRncmF5LWxpZ2h0ZXIgIWRlZmF1bHQ7XG5cbiRuYXYtdGFicy1hY3RpdmUtbGluay1ob3Zlci1iZzogICAgICAgICAgICAgJGJvZHktYmcgIWRlZmF1bHQ7XG4kbmF2LXRhYnMtYWN0aXZlLWxpbmstaG92ZXItY29sb3I6ICAgICAgICAgICRncmF5ICFkZWZhdWx0O1xuJG5hdi10YWJzLWFjdGl2ZS1saW5rLWhvdmVyLWJvcmRlci1jb2xvcjogICAjZGRkICFkZWZhdWx0O1xuXG4kbmF2LXRhYnMtanVzdGlmaWVkLWxpbmstYm9yZGVyLWNvbG9yOiAgICAgICAgICAgICNkZGQgIWRlZmF1bHQ7XG4kbmF2LXRhYnMtanVzdGlmaWVkLWFjdGl2ZS1saW5rLWJvcmRlci1jb2xvcjogICAgICRib2R5LWJnICFkZWZhdWx0O1xuXG4vLz09IFBpbGxzXG4kbmF2LXBpbGxzLWJvcmRlci1yYWRpdXM6ICAgICAgICAgICAgICAgICAgICRib3JkZXItcmFkaXVzLWJhc2UgIWRlZmF1bHQ7XG4kbmF2LXBpbGxzLWFjdGl2ZS1saW5rLWhvdmVyLWJnOiAgICAgICAgICAgICRjb21wb25lbnQtYWN0aXZlLWJnICFkZWZhdWx0O1xuJG5hdi1waWxscy1hY3RpdmUtbGluay1ob3Zlci1jb2xvcjogICAgICAgICAkY29tcG9uZW50LWFjdGl2ZS1jb2xvciAhZGVmYXVsdDtcblxuXG4vLz09IFBhZ2luYXRpb25cbi8vXG4vLyMjXG5cbiRwYWdpbmF0aW9uLWNvbG9yOiAgICAgICAgICAgICAgICAgICAgICRsaW5rLWNvbG9yICFkZWZhdWx0O1xuJHBhZ2luYXRpb24tYmc6ICAgICAgICAgICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRwYWdpbmF0aW9uLWJvcmRlcjogICAgICAgICAgICAgICAgICAgICNkZGQgIWRlZmF1bHQ7XG5cbiRwYWdpbmF0aW9uLWhvdmVyLWNvbG9yOiAgICAgICAgICAgICAgICRsaW5rLWhvdmVyLWNvbG9yICFkZWZhdWx0O1xuJHBhZ2luYXRpb24taG92ZXItYmc6ICAgICAgICAgICAgICAgICAgJGdyYXktbGlnaHRlciAhZGVmYXVsdDtcbiRwYWdpbmF0aW9uLWhvdmVyLWJvcmRlcjogICAgICAgICAgICAgICNkZGQgIWRlZmF1bHQ7XG5cbiRwYWdpbmF0aW9uLWFjdGl2ZS1jb2xvcjogICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kcGFnaW5hdGlvbi1hY3RpdmUtYmc6ICAgICAgICAgICAgICAgICAkYnJhbmQtcHJpbWFyeSAhZGVmYXVsdDtcbiRwYWdpbmF0aW9uLWFjdGl2ZS1ib3JkZXI6ICAgICAgICAgICAgICRicmFuZC1wcmltYXJ5ICFkZWZhdWx0O1xuXG4kcGFnaW5hdGlvbi1kaXNhYmxlZC1jb2xvcjogICAgICAgICAgICAkZ3JheS1saWdodCAhZGVmYXVsdDtcbiRwYWdpbmF0aW9uLWRpc2FibGVkLWJnOiAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kcGFnaW5hdGlvbi1kaXNhYmxlZC1ib3JkZXI6ICAgICAgICAgICAjZGRkICFkZWZhdWx0O1xuXG5cbi8vPT0gUGFnZXJcbi8vXG4vLyMjXG5cbiRwYWdlci1iZzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICRwYWdpbmF0aW9uLWJnICFkZWZhdWx0O1xuJHBhZ2VyLWJvcmRlcjogICAgICAgICAgICAgICAgICAgICAgICAgJHBhZ2luYXRpb24tYm9yZGVyICFkZWZhdWx0O1xuJHBhZ2VyLWJvcmRlci1yYWRpdXM6ICAgICAgICAgICAgICAgICAgMTVweCAhZGVmYXVsdDtcblxuJHBhZ2VyLWhvdmVyLWJnOiAgICAgICAgICAgICAgICAgICAgICAgJHBhZ2luYXRpb24taG92ZXItYmcgIWRlZmF1bHQ7XG5cbiRwYWdlci1hY3RpdmUtYmc6ICAgICAgICAgICAgICAgICAgICAgICRwYWdpbmF0aW9uLWFjdGl2ZS1iZyAhZGVmYXVsdDtcbiRwYWdlci1hY3RpdmUtY29sb3I6ICAgICAgICAgICAgICAgICAgICRwYWdpbmF0aW9uLWFjdGl2ZS1jb2xvciAhZGVmYXVsdDtcblxuJHBhZ2VyLWRpc2FibGVkLWNvbG9yOiAgICAgICAgICAgICAgICAgJHBhZ2luYXRpb24tZGlzYWJsZWQtY29sb3IgIWRlZmF1bHQ7XG5cblxuLy89PSBKdW1ib3Ryb25cbi8vXG4vLyMjXG5cbiRqdW1ib3Ryb24tcGFkZGluZzogICAgICAgICAgICAgIDMwcHggIWRlZmF1bHQ7XG4kanVtYm90cm9uLWNvbG9yOiAgICAgICAgICAgICAgICBpbmhlcml0ICFkZWZhdWx0O1xuJGp1bWJvdHJvbi1iZzogICAgICAgICAgICAgICAgICAgJGdyYXktbGlnaHRlciAhZGVmYXVsdDtcbiRqdW1ib3Ryb24taGVhZGluZy1jb2xvcjogICAgICAgIGluaGVyaXQgIWRlZmF1bHQ7XG4kanVtYm90cm9uLWZvbnQtc2l6ZTogICAgICAgICAgICBjZWlsKCgkZm9udC1zaXplLWJhc2UgKiAxLjUpKSAhZGVmYXVsdDtcbiRqdW1ib3Ryb24taGVhZGluZy1mb250LXNpemU6ICAgIGNlaWwoKCRmb250LXNpemUtYmFzZSAqIDQuNSkpICFkZWZhdWx0O1xuXG5cbi8vPT0gRm9ybSBzdGF0ZXMgYW5kIGFsZXJ0c1xuLy9cbi8vIyMgRGVmaW5lIGNvbG9ycyBmb3IgZm9ybSBmZWVkYmFjayBzdGF0ZXMgYW5kLCBieSBkZWZhdWx0LCBhbGVydHMuXG5cbiRzdGF0ZS1zdWNjZXNzLXRleHQ6ICAgICAgICAgICAgICMzYzc2M2QgIWRlZmF1bHQ7XG4kc3RhdGUtc3VjY2Vzcy1iZzogICAgICAgICAgICAgICAjZGZmMGQ4ICFkZWZhdWx0O1xuJHN0YXRlLXN1Y2Nlc3MtYm9yZGVyOiAgICAgICAgICAgZGFya2VuKGFkanVzdC1odWUoJHN0YXRlLXN1Y2Nlc3MtYmcsIC0xMCksIDUlKSAhZGVmYXVsdDtcblxuJHN0YXRlLWluZm8tdGV4dDogICAgICAgICAgICAgICAgIzMxNzA4ZiAhZGVmYXVsdDtcbiRzdGF0ZS1pbmZvLWJnOiAgICAgICAgICAgICAgICAgICNkOWVkZjcgIWRlZmF1bHQ7XG4kc3RhdGUtaW5mby1ib3JkZXI6ICAgICAgICAgICAgICBkYXJrZW4oYWRqdXN0LWh1ZSgkc3RhdGUtaW5mby1iZywgLTEwKSwgNyUpICFkZWZhdWx0O1xuXG4kc3RhdGUtd2FybmluZy10ZXh0OiAgICAgICAgICAgICAjOGE2ZDNiICFkZWZhdWx0O1xuJHN0YXRlLXdhcm5pbmctYmc6ICAgICAgICAgICAgICAgI2ZjZjhlMyAhZGVmYXVsdDtcbiRzdGF0ZS13YXJuaW5nLWJvcmRlcjogICAgICAgICAgIGRhcmtlbihhZGp1c3QtaHVlKCRzdGF0ZS13YXJuaW5nLWJnLCAtMTApLCA1JSkgIWRlZmF1bHQ7XG5cbiRzdGF0ZS1kYW5nZXItdGV4dDogICAgICAgICAgICAgICNhOTQ0NDIgIWRlZmF1bHQ7XG4kc3RhdGUtZGFuZ2VyLWJnOiAgICAgICAgICAgICAgICAjZjJkZWRlICFkZWZhdWx0O1xuJHN0YXRlLWRhbmdlci1ib3JkZXI6ICAgICAgICAgICAgZGFya2VuKGFkanVzdC1odWUoJHN0YXRlLWRhbmdlci1iZywgLTEwKSwgNSUpICFkZWZhdWx0O1xuXG5cbi8vPT0gVG9vbHRpcHNcbi8vXG4vLyMjXG5cbi8vKiogVG9vbHRpcCBtYXggd2lkdGhcbiR0b29sdGlwLW1heC13aWR0aDogICAgICAgICAgIDIwMHB4ICFkZWZhdWx0O1xuLy8qKiBUb29sdGlwIHRleHQgY29sb3JcbiR0b29sdGlwLWNvbG9yOiAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4vLyoqIFRvb2x0aXAgYmFja2dyb3VuZCBjb2xvclxuJHRvb2x0aXAtYmc6ICAgICAgICAgICAgICAgICAgIzAwMCAhZGVmYXVsdDtcbiR0b29sdGlwLW9wYWNpdHk6ICAgICAgICAgICAgIC45ICFkZWZhdWx0O1xuXG4vLyoqIFRvb2x0aXAgYXJyb3cgd2lkdGhcbiR0b29sdGlwLWFycm93LXdpZHRoOiAgICAgICAgIDVweCAhZGVmYXVsdDtcbi8vKiogVG9vbHRpcCBhcnJvdyBjb2xvclxuJHRvb2x0aXAtYXJyb3ctY29sb3I6ICAgICAgICAgJHRvb2x0aXAtYmcgIWRlZmF1bHQ7XG5cblxuLy89PSBQb3BvdmVyc1xuLy9cbi8vIyNcblxuLy8qKiBQb3BvdmVyIGJvZHkgYmFja2dyb3VuZCBjb2xvclxuJHBvcG92ZXItYmc6ICAgICAgICAgICAgICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuLy8qKiBQb3BvdmVyIG1heGltdW0gd2lkdGhcbiRwb3BvdmVyLW1heC13aWR0aDogICAgICAgICAgICAgICAgICAgMjc2cHggIWRlZmF1bHQ7XG4vLyoqIFBvcG92ZXIgYm9yZGVyIGNvbG9yXG4kcG9wb3Zlci1ib3JkZXItY29sb3I6ICAgICAgICAgICAgICAgIHJnYmEoMCwwLDAsLjIpICFkZWZhdWx0O1xuLy8qKiBQb3BvdmVyIGZhbGxiYWNrIGJvcmRlciBjb2xvclxuJHBvcG92ZXItZmFsbGJhY2stYm9yZGVyLWNvbG9yOiAgICAgICAjY2NjICFkZWZhdWx0O1xuXG4vLyoqIFBvcG92ZXIgdGl0bGUgYmFja2dyb3VuZCBjb2xvclxuJHBvcG92ZXItdGl0bGUtYmc6ICAgICAgICAgICAgICAgICAgICBkYXJrZW4oJHBvcG92ZXItYmcsIDMlKSAhZGVmYXVsdDtcblxuLy8qKiBQb3BvdmVyIGFycm93IHdpZHRoXG4kcG9wb3Zlci1hcnJvdy13aWR0aDogICAgICAgICAgICAgICAgIDEwcHggIWRlZmF1bHQ7XG4vLyoqIFBvcG92ZXIgYXJyb3cgY29sb3JcbiRwb3BvdmVyLWFycm93LWNvbG9yOiAgICAgICAgICAgICAgICAgJHBvcG92ZXItYmcgIWRlZmF1bHQ7XG5cbi8vKiogUG9wb3ZlciBvdXRlciBhcnJvdyB3aWR0aFxuJHBvcG92ZXItYXJyb3ctb3V0ZXItd2lkdGg6ICAgICAgICAgICAoJHBvcG92ZXItYXJyb3ctd2lkdGggKyAxKSAhZGVmYXVsdDtcbi8vKiogUG9wb3ZlciBvdXRlciBhcnJvdyBjb2xvclxuJHBvcG92ZXItYXJyb3ctb3V0ZXItY29sb3I6ICAgICAgICAgICBmYWRlX2luKCRwb3BvdmVyLWJvcmRlci1jb2xvciwgMC4wNSkgIWRlZmF1bHQ7XG4vLyoqIFBvcG92ZXIgb3V0ZXIgYXJyb3cgZmFsbGJhY2sgY29sb3JcbiRwb3BvdmVyLWFycm93LW91dGVyLWZhbGxiYWNrLWNvbG9yOiAgZGFya2VuKCRwb3BvdmVyLWZhbGxiYWNrLWJvcmRlci1jb2xvciwgMjAlKSAhZGVmYXVsdDtcblxuXG4vLz09IExhYmVsc1xuLy9cbi8vIyNcblxuLy8qKiBEZWZhdWx0IGxhYmVsIGJhY2tncm91bmQgY29sb3JcbiRsYWJlbC1kZWZhdWx0LWJnOiAgICAgICAgICAgICRncmF5LWxpZ2h0ICFkZWZhdWx0O1xuLy8qKiBQcmltYXJ5IGxhYmVsIGJhY2tncm91bmQgY29sb3JcbiRsYWJlbC1wcmltYXJ5LWJnOiAgICAgICAgICAgICRicmFuZC1wcmltYXJ5ICFkZWZhdWx0O1xuLy8qKiBTdWNjZXNzIGxhYmVsIGJhY2tncm91bmQgY29sb3JcbiRsYWJlbC1zdWNjZXNzLWJnOiAgICAgICAgICAgICRicmFuZC1zdWNjZXNzICFkZWZhdWx0O1xuLy8qKiBJbmZvIGxhYmVsIGJhY2tncm91bmQgY29sb3JcbiRsYWJlbC1pbmZvLWJnOiAgICAgICAgICAgICAgICRicmFuZC1pbmZvICFkZWZhdWx0O1xuLy8qKiBXYXJuaW5nIGxhYmVsIGJhY2tncm91bmQgY29sb3JcbiRsYWJlbC13YXJuaW5nLWJnOiAgICAgICAgICAgICRicmFuZC13YXJuaW5nICFkZWZhdWx0O1xuLy8qKiBEYW5nZXIgbGFiZWwgYmFja2dyb3VuZCBjb2xvclxuJGxhYmVsLWRhbmdlci1iZzogICAgICAgICAgICAgJGJyYW5kLWRhbmdlciAhZGVmYXVsdDtcblxuLy8qKiBEZWZhdWx0IGxhYmVsIHRleHQgY29sb3JcbiRsYWJlbC1jb2xvcjogICAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4vLyoqIERlZmF1bHQgdGV4dCBjb2xvciBvZiBhIGxpbmtlZCBsYWJlbFxuJGxhYmVsLWxpbmstaG92ZXItY29sb3I6ICAgICAgI2ZmZiAhZGVmYXVsdDtcblxuXG4vLz09IE1vZGFsc1xuLy9cbi8vIyNcblxuLy8qKiBQYWRkaW5nIGFwcGxpZWQgdG8gdGhlIG1vZGFsIGJvZHlcbiRtb2RhbC1pbm5lci1wYWRkaW5nOiAgICAgICAgIDE1cHggIWRlZmF1bHQ7XG5cbi8vKiogUGFkZGluZyBhcHBsaWVkIHRvIHRoZSBtb2RhbCB0aXRsZVxuJG1vZGFsLXRpdGxlLXBhZGRpbmc6ICAgICAgICAgMTVweCAhZGVmYXVsdDtcbi8vKiogTW9kYWwgdGl0bGUgbGluZS1oZWlnaHRcbiRtb2RhbC10aXRsZS1saW5lLWhlaWdodDogICAgICRsaW5lLWhlaWdodC1iYXNlICFkZWZhdWx0O1xuXG4vLyoqIEJhY2tncm91bmQgY29sb3Igb2YgbW9kYWwgY29udGVudCBhcmVhXG4kbW9kYWwtY29udGVudC1iZzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4vLyoqIE1vZGFsIGNvbnRlbnQgYm9yZGVyIGNvbG9yXG4kbW9kYWwtY29udGVudC1ib3JkZXItY29sb3I6ICAgICAgICAgICAgICAgICAgIHJnYmEoMCwwLDAsLjIpICFkZWZhdWx0O1xuLy8qKiBNb2RhbCBjb250ZW50IGJvcmRlciBjb2xvciAqKmZvciBJRTgqKlxuJG1vZGFsLWNvbnRlbnQtZmFsbGJhY2stYm9yZGVyLWNvbG9yOiAgICAgICAgICAjOTk5ICFkZWZhdWx0O1xuXG4vLyoqIE1vZGFsIGJhY2tkcm9wIGJhY2tncm91bmQgY29sb3JcbiRtb2RhbC1iYWNrZHJvcC1iZzogICAgICAgICAgICMwMDAgIWRlZmF1bHQ7XG4vLyoqIE1vZGFsIGJhY2tkcm9wIG9wYWNpdHlcbiRtb2RhbC1iYWNrZHJvcC1vcGFjaXR5OiAgICAgIC41ICFkZWZhdWx0O1xuLy8qKiBNb2RhbCBoZWFkZXIgYm9yZGVyIGNvbG9yXG4kbW9kYWwtaGVhZGVyLWJvcmRlci1jb2xvcjogICAjZTVlNWU1ICFkZWZhdWx0O1xuLy8qKiBNb2RhbCBmb290ZXIgYm9yZGVyIGNvbG9yXG4kbW9kYWwtZm9vdGVyLWJvcmRlci1jb2xvcjogICAkbW9kYWwtaGVhZGVyLWJvcmRlci1jb2xvciAhZGVmYXVsdDtcblxuJG1vZGFsLWxnOiAgICAgICAgICAgICAgICAgICAgOTAwcHggIWRlZmF1bHQ7XG4kbW9kYWwtbWQ6ICAgICAgICAgICAgICAgICAgICA2MDBweCAhZGVmYXVsdDtcbiRtb2RhbC1zbTogICAgICAgICAgICAgICAgICAgIDMwMHB4ICFkZWZhdWx0O1xuXG5cbi8vPT0gQWxlcnRzXG4vL1xuLy8jIyBEZWZpbmUgYWxlcnQgY29sb3JzLCBib3JkZXIgcmFkaXVzLCBhbmQgcGFkZGluZy5cblxuJGFsZXJ0LXBhZGRpbmc6ICAgICAgICAgICAgICAgMTVweCAhZGVmYXVsdDtcbiRhbGVydC1ib3JkZXItcmFkaXVzOiAgICAgICAgICRib3JkZXItcmFkaXVzLWJhc2UgIWRlZmF1bHQ7XG4kYWxlcnQtbGluay1mb250LXdlaWdodDogICAgICBib2xkICFkZWZhdWx0O1xuXG4kYWxlcnQtc3VjY2Vzcy1iZzogICAgICAgICAgICAkc3RhdGUtc3VjY2Vzcy1iZyAhZGVmYXVsdDtcbiRhbGVydC1zdWNjZXNzLXRleHQ6ICAgICAgICAgICRzdGF0ZS1zdWNjZXNzLXRleHQgIWRlZmF1bHQ7XG4kYWxlcnQtc3VjY2Vzcy1ib3JkZXI6ICAgICAgICAkc3RhdGUtc3VjY2Vzcy1ib3JkZXIgIWRlZmF1bHQ7XG5cbiRhbGVydC1pbmZvLWJnOiAgICAgICAgICAgICAgICRzdGF0ZS1pbmZvLWJnICFkZWZhdWx0O1xuJGFsZXJ0LWluZm8tdGV4dDogICAgICAgICAgICAgJHN0YXRlLWluZm8tdGV4dCAhZGVmYXVsdDtcbiRhbGVydC1pbmZvLWJvcmRlcjogICAgICAgICAgICRzdGF0ZS1pbmZvLWJvcmRlciAhZGVmYXVsdDtcblxuJGFsZXJ0LXdhcm5pbmctYmc6ICAgICAgICAgICAgJHN0YXRlLXdhcm5pbmctYmcgIWRlZmF1bHQ7XG4kYWxlcnQtd2FybmluZy10ZXh0OiAgICAgICAgICAkc3RhdGUtd2FybmluZy10ZXh0ICFkZWZhdWx0O1xuJGFsZXJ0LXdhcm5pbmctYm9yZGVyOiAgICAgICAgJHN0YXRlLXdhcm5pbmctYm9yZGVyICFkZWZhdWx0O1xuXG4kYWxlcnQtZGFuZ2VyLWJnOiAgICAgICAgICAgICAkc3RhdGUtZGFuZ2VyLWJnICFkZWZhdWx0O1xuJGFsZXJ0LWRhbmdlci10ZXh0OiAgICAgICAgICAgJHN0YXRlLWRhbmdlci10ZXh0ICFkZWZhdWx0O1xuJGFsZXJ0LWRhbmdlci1ib3JkZXI6ICAgICAgICAgJHN0YXRlLWRhbmdlci1ib3JkZXIgIWRlZmF1bHQ7XG5cblxuLy89PSBQcm9ncmVzcyBiYXJzXG4vL1xuLy8jI1xuXG4vLyoqIEJhY2tncm91bmQgY29sb3Igb2YgdGhlIHdob2xlIHByb2dyZXNzIGNvbXBvbmVudFxuJHByb2dyZXNzLWJnOiAgICAgICAgICAgICAgICAgI2Y1ZjVmNSAhZGVmYXVsdDtcbi8vKiogUHJvZ3Jlc3MgYmFyIHRleHQgY29sb3JcbiRwcm9ncmVzcy1iYXItY29sb3I6ICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4vLyoqIFZhcmlhYmxlIGZvciBzZXR0aW5nIHJvdW5kZWQgY29ybmVycyBvbiBwcm9ncmVzcyBiYXIuXG4kcHJvZ3Jlc3MtYm9yZGVyLXJhZGl1czogICAgICAkYm9yZGVyLXJhZGl1cy1iYXNlICFkZWZhdWx0O1xuXG4vLyoqIERlZmF1bHQgcHJvZ3Jlc3MgYmFyIGNvbG9yXG4kcHJvZ3Jlc3MtYmFyLWJnOiAgICAgICAgICAgICAkYnJhbmQtcHJpbWFyeSAhZGVmYXVsdDtcbi8vKiogU3VjY2VzcyBwcm9ncmVzcyBiYXIgY29sb3JcbiRwcm9ncmVzcy1iYXItc3VjY2Vzcy1iZzogICAgICRicmFuZC1zdWNjZXNzICFkZWZhdWx0O1xuLy8qKiBXYXJuaW5nIHByb2dyZXNzIGJhciBjb2xvclxuJHByb2dyZXNzLWJhci13YXJuaW5nLWJnOiAgICAgJGJyYW5kLXdhcm5pbmcgIWRlZmF1bHQ7XG4vLyoqIERhbmdlciBwcm9ncmVzcyBiYXIgY29sb3JcbiRwcm9ncmVzcy1iYXItZGFuZ2VyLWJnOiAgICAgICRicmFuZC1kYW5nZXIgIWRlZmF1bHQ7XG4vLyoqIEluZm8gcHJvZ3Jlc3MgYmFyIGNvbG9yXG4kcHJvZ3Jlc3MtYmFyLWluZm8tYmc6ICAgICAgICAkYnJhbmQtaW5mbyAhZGVmYXVsdDtcblxuXG4vLz09IExpc3QgZ3JvdXBcbi8vXG4vLyMjXG5cbi8vKiogQmFja2dyb3VuZCBjb2xvciBvbiBgLmxpc3QtZ3JvdXAtaXRlbWBcbiRsaXN0LWdyb3VwLWJnOiAgICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbi8vKiogYC5saXN0LWdyb3VwLWl0ZW1gIGJvcmRlciBjb2xvclxuJGxpc3QtZ3JvdXAtYm9yZGVyOiAgICAgICAgICAgICAjZGRkICFkZWZhdWx0O1xuLy8qKiBMaXN0IGdyb3VwIGJvcmRlciByYWRpdXNcbiRsaXN0LWdyb3VwLWJvcmRlci1yYWRpdXM6ICAgICAgJGJvcmRlci1yYWRpdXMtYmFzZSAhZGVmYXVsdDtcblxuLy8qKiBCYWNrZ3JvdW5kIGNvbG9yIG9mIHNpbmdsZSBsaXN0IGl0ZW1zIG9uIGhvdmVyXG4kbGlzdC1ncm91cC1ob3Zlci1iZzogICAgICAgICAgICNmNWY1ZjUgIWRlZmF1bHQ7XG4vLyoqIFRleHQgY29sb3Igb2YgYWN0aXZlIGxpc3QgaXRlbXNcbiRsaXN0LWdyb3VwLWFjdGl2ZS1jb2xvcjogICAgICAgJGNvbXBvbmVudC1hY3RpdmUtY29sb3IgIWRlZmF1bHQ7XG4vLyoqIEJhY2tncm91bmQgY29sb3Igb2YgYWN0aXZlIGxpc3QgaXRlbXNcbiRsaXN0LWdyb3VwLWFjdGl2ZS1iZzogICAgICAgICAgJGNvbXBvbmVudC1hY3RpdmUtYmcgIWRlZmF1bHQ7XG4vLyoqIEJvcmRlciBjb2xvciBvZiBhY3RpdmUgbGlzdCBlbGVtZW50c1xuJGxpc3QtZ3JvdXAtYWN0aXZlLWJvcmRlcjogICAgICAkbGlzdC1ncm91cC1hY3RpdmUtYmcgIWRlZmF1bHQ7XG4vLyoqIFRleHQgY29sb3IgZm9yIGNvbnRlbnQgd2l0aGluIGFjdGl2ZSBsaXN0IGl0ZW1zXG4kbGlzdC1ncm91cC1hY3RpdmUtdGV4dC1jb2xvcjogIGxpZ2h0ZW4oJGxpc3QtZ3JvdXAtYWN0aXZlLWJnLCA0MCUpICFkZWZhdWx0O1xuXG4vLyoqIFRleHQgY29sb3Igb2YgZGlzYWJsZWQgbGlzdCBpdGVtc1xuJGxpc3QtZ3JvdXAtZGlzYWJsZWQtY29sb3I6ICAgICAgJGdyYXktbGlnaHQgIWRlZmF1bHQ7XG4vLyoqIEJhY2tncm91bmQgY29sb3Igb2YgZGlzYWJsZWQgbGlzdCBpdGVtc1xuJGxpc3QtZ3JvdXAtZGlzYWJsZWQtYmc6ICAgICAgICAgJGdyYXktbGlnaHRlciAhZGVmYXVsdDtcbi8vKiogVGV4dCBjb2xvciBmb3IgY29udGVudCB3aXRoaW4gZGlzYWJsZWQgbGlzdCBpdGVtc1xuJGxpc3QtZ3JvdXAtZGlzYWJsZWQtdGV4dC1jb2xvcjogJGxpc3QtZ3JvdXAtZGlzYWJsZWQtY29sb3IgIWRlZmF1bHQ7XG5cbiRsaXN0LWdyb3VwLWxpbmstY29sb3I6ICAgICAgICAgIzU1NSAhZGVmYXVsdDtcbiRsaXN0LWdyb3VwLWxpbmstaG92ZXItY29sb3I6ICAgJGxpc3QtZ3JvdXAtbGluay1jb2xvciAhZGVmYXVsdDtcbiRsaXN0LWdyb3VwLWxpbmstaGVhZGluZy1jb2xvcjogIzMzMyAhZGVmYXVsdDtcblxuXG4vLz09IFBhbmVsc1xuLy9cbi8vIyNcblxuJHBhbmVsLWJnOiAgICAgICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRwYW5lbC1ib2R5LXBhZGRpbmc6ICAgICAgICAgIDE1cHggIWRlZmF1bHQ7XG4kcGFuZWwtaGVhZGluZy1wYWRkaW5nOiAgICAgICAxMHB4IDE1cHggIWRlZmF1bHQ7XG4kcGFuZWwtZm9vdGVyLXBhZGRpbmc6ICAgICAgICAkcGFuZWwtaGVhZGluZy1wYWRkaW5nICFkZWZhdWx0O1xuJHBhbmVsLWJvcmRlci1yYWRpdXM6ICAgICAgICAgJGJvcmRlci1yYWRpdXMtYmFzZSAhZGVmYXVsdDtcblxuLy8qKiBCb3JkZXIgY29sb3IgZm9yIGVsZW1lbnRzIHdpdGhpbiBwYW5lbHNcbiRwYW5lbC1pbm5lci1ib3JkZXI6ICAgICAgICAgICNkZGQgIWRlZmF1bHQ7XG4kcGFuZWwtZm9vdGVyLWJnOiAgICAgICAgICAgICAjZjVmNWY1ICFkZWZhdWx0O1xuXG4kcGFuZWwtZGVmYXVsdC10ZXh0OiAgICAgICAgICAkZ3JheS1kYXJrICFkZWZhdWx0O1xuJHBhbmVsLWRlZmF1bHQtYm9yZGVyOiAgICAgICAgI2RkZCAhZGVmYXVsdDtcbiRwYW5lbC1kZWZhdWx0LWhlYWRpbmctYmc6ICAgICNmNWY1ZjUgIWRlZmF1bHQ7XG5cbiRwYW5lbC1wcmltYXJ5LXRleHQ6ICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kcGFuZWwtcHJpbWFyeS1ib3JkZXI6ICAgICAgICAkYnJhbmQtcHJpbWFyeSAhZGVmYXVsdDtcbiRwYW5lbC1wcmltYXJ5LWhlYWRpbmctYmc6ICAgICRicmFuZC1wcmltYXJ5ICFkZWZhdWx0O1xuXG4kcGFuZWwtc3VjY2Vzcy10ZXh0OiAgICAgICAgICAkc3RhdGUtc3VjY2Vzcy10ZXh0ICFkZWZhdWx0O1xuJHBhbmVsLXN1Y2Nlc3MtYm9yZGVyOiAgICAgICAgJHN0YXRlLXN1Y2Nlc3MtYm9yZGVyICFkZWZhdWx0O1xuJHBhbmVsLXN1Y2Nlc3MtaGVhZGluZy1iZzogICAgJHN0YXRlLXN1Y2Nlc3MtYmcgIWRlZmF1bHQ7XG5cbiRwYW5lbC1pbmZvLXRleHQ6ICAgICAgICAgICAgICRzdGF0ZS1pbmZvLXRleHQgIWRlZmF1bHQ7XG4kcGFuZWwtaW5mby1ib3JkZXI6ICAgICAgICAgICAkc3RhdGUtaW5mby1ib3JkZXIgIWRlZmF1bHQ7XG4kcGFuZWwtaW5mby1oZWFkaW5nLWJnOiAgICAgICAkc3RhdGUtaW5mby1iZyAhZGVmYXVsdDtcblxuJHBhbmVsLXdhcm5pbmctdGV4dDogICAgICAgICAgJHN0YXRlLXdhcm5pbmctdGV4dCAhZGVmYXVsdDtcbiRwYW5lbC13YXJuaW5nLWJvcmRlcjogICAgICAgICRzdGF0ZS13YXJuaW5nLWJvcmRlciAhZGVmYXVsdDtcbiRwYW5lbC13YXJuaW5nLWhlYWRpbmctYmc6ICAgICRzdGF0ZS13YXJuaW5nLWJnICFkZWZhdWx0O1xuXG4kcGFuZWwtZGFuZ2VyLXRleHQ6ICAgICAgICAgICAkc3RhdGUtZGFuZ2VyLXRleHQgIWRlZmF1bHQ7XG4kcGFuZWwtZGFuZ2VyLWJvcmRlcjogICAgICAgICAkc3RhdGUtZGFuZ2VyLWJvcmRlciAhZGVmYXVsdDtcbiRwYW5lbC1kYW5nZXItaGVhZGluZy1iZzogICAgICRzdGF0ZS1kYW5nZXItYmcgIWRlZmF1bHQ7XG5cblxuLy89PSBUaHVtYm5haWxzXG4vL1xuLy8jI1xuXG4vLyoqIFBhZGRpbmcgYXJvdW5kIHRoZSB0aHVtYm5haWwgaW1hZ2VcbiR0aHVtYm5haWwtcGFkZGluZzogICAgICAgICAgIDRweCAhZGVmYXVsdDtcbi8vKiogVGh1bWJuYWlsIGJhY2tncm91bmQgY29sb3JcbiR0aHVtYm5haWwtYmc6ICAgICAgICAgICAgICAgICRib2R5LWJnICFkZWZhdWx0O1xuLy8qKiBUaHVtYm5haWwgYm9yZGVyIGNvbG9yXG4kdGh1bWJuYWlsLWJvcmRlcjogICAgICAgICAgICAjZGRkICFkZWZhdWx0O1xuLy8qKiBUaHVtYm5haWwgYm9yZGVyIHJhZGl1c1xuJHRodW1ibmFpbC1ib3JkZXItcmFkaXVzOiAgICAgJGJvcmRlci1yYWRpdXMtYmFzZSAhZGVmYXVsdDtcblxuLy8qKiBDdXN0b20gdGV4dCBjb2xvciBmb3IgdGh1bWJuYWlsIGNhcHRpb25zXG4kdGh1bWJuYWlsLWNhcHRpb24tY29sb3I6ICAgICAkdGV4dC1jb2xvciAhZGVmYXVsdDtcbi8vKiogUGFkZGluZyBhcm91bmQgdGhlIHRodW1ibmFpbCBjYXB0aW9uXG4kdGh1bWJuYWlsLWNhcHRpb24tcGFkZGluZzogICA5cHggIWRlZmF1bHQ7XG5cblxuLy89PSBXZWxsc1xuLy9cbi8vIyNcblxuJHdlbGwtYmc6ICAgICAgICAgICAgICAgICAgICAgI2Y1ZjVmNSAhZGVmYXVsdDtcbiR3ZWxsLWJvcmRlcjogICAgICAgICAgICAgICAgIGRhcmtlbigkd2VsbC1iZywgNyUpICFkZWZhdWx0O1xuXG5cbi8vPT0gQmFkZ2VzXG4vL1xuLy8jI1xuXG4kYmFkZ2UtY29sb3I6ICAgICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuLy8qKiBMaW5rZWQgYmFkZ2UgdGV4dCBjb2xvciBvbiBob3ZlclxuJGJhZGdlLWxpbmstaG92ZXItY29sb3I6ICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRiYWRnZS1iZzogICAgICAgICAgICAgICAgICAgICRncmF5LWxpZ2h0ICFkZWZhdWx0O1xuXG4vLyoqIEJhZGdlIHRleHQgY29sb3IgaW4gYWN0aXZlIG5hdiBsaW5rXG4kYmFkZ2UtYWN0aXZlLWNvbG9yOiAgICAgICAgICAkbGluay1jb2xvciAhZGVmYXVsdDtcbi8vKiogQmFkZ2UgYmFja2dyb3VuZCBjb2xvciBpbiBhY3RpdmUgbmF2IGxpbmtcbiRiYWRnZS1hY3RpdmUtYmc6ICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG5cbiRiYWRnZS1mb250LXdlaWdodDogICAgICAgICAgIGJvbGQgIWRlZmF1bHQ7XG4kYmFkZ2UtbGluZS1oZWlnaHQ6ICAgICAgICAgICAxICFkZWZhdWx0O1xuJGJhZGdlLWJvcmRlci1yYWRpdXM6ICAgICAgICAgMTBweCAhZGVmYXVsdDtcblxuXG4vLz09IEJyZWFkY3J1bWJzXG4vL1xuLy8jI1xuXG4kYnJlYWRjcnVtYi1wYWRkaW5nLXZlcnRpY2FsOiAgIDhweCAhZGVmYXVsdDtcbiRicmVhZGNydW1iLXBhZGRpbmctaG9yaXpvbnRhbDogMTVweCAhZGVmYXVsdDtcbi8vKiogQnJlYWRjcnVtYiBiYWNrZ3JvdW5kIGNvbG9yXG4kYnJlYWRjcnVtYi1iZzogICAgICAgICAgICAgICAgICNmNWY1ZjUgIWRlZmF1bHQ7XG4vLyoqIEJyZWFkY3J1bWIgdGV4dCBjb2xvclxuJGJyZWFkY3J1bWItY29sb3I6ICAgICAgICAgICAgICAjY2NjICFkZWZhdWx0O1xuLy8qKiBUZXh0IGNvbG9yIG9mIGN1cnJlbnQgcGFnZSBpbiB0aGUgYnJlYWRjcnVtYlxuJGJyZWFkY3J1bWItYWN0aXZlLWNvbG9yOiAgICAgICAkZ3JheS1saWdodCAhZGVmYXVsdDtcbi8vKiogVGV4dHVhbCBzZXBhcmF0b3IgZm9yIGJldHdlZW4gYnJlYWRjcnVtYiBlbGVtZW50c1xuJGJyZWFkY3J1bWItc2VwYXJhdG9yOiAgICAgICAgICBcIi9cIiAhZGVmYXVsdDtcblxuXG4vLz09IENhcm91c2VsXG4vL1xuLy8jI1xuXG4kY2Fyb3VzZWwtdGV4dC1zaGFkb3c6ICAgICAgICAgICAgICAgICAgICAgICAgMCAxcHggMnB4IHJnYmEoMCwwLDAsLjYpICFkZWZhdWx0O1xuXG4kY2Fyb3VzZWwtY29udHJvbC1jb2xvcjogICAgICAgICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRjYXJvdXNlbC1jb250cm9sLXdpZHRoOiAgICAgICAgICAgICAgICAgICAgICAxNSUgIWRlZmF1bHQ7XG4kY2Fyb3VzZWwtY29udHJvbC1vcGFjaXR5OiAgICAgICAgICAgICAgICAgICAgLjUgIWRlZmF1bHQ7XG4kY2Fyb3VzZWwtY29udHJvbC1mb250LXNpemU6ICAgICAgICAgICAgICAgICAgMjBweCAhZGVmYXVsdDtcblxuJGNhcm91c2VsLWluZGljYXRvci1hY3RpdmUtYmc6ICAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kY2Fyb3VzZWwtaW5kaWNhdG9yLWJvcmRlci1jb2xvcjogICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcblxuJGNhcm91c2VsLWNhcHRpb24tY29sb3I6ICAgICAgICAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG5cblxuLy89PSBDbG9zZVxuLy9cbi8vIyNcblxuJGNsb3NlLWZvbnQtd2VpZ2h0OiAgICAgICAgICAgYm9sZCAhZGVmYXVsdDtcbiRjbG9zZS1jb2xvcjogICAgICAgICAgICAgICAgICMwMDAgIWRlZmF1bHQ7XG4kY2xvc2UtdGV4dC1zaGFkb3c6ICAgICAgICAgICAwIDFweCAwICNmZmYgIWRlZmF1bHQ7XG5cblxuLy89PSBDb2RlXG4vL1xuLy8jI1xuXG4kY29kZS1jb2xvcjogICAgICAgICAgICAgICAgICAjYzcyNTRlICFkZWZhdWx0O1xuJGNvZGUtYmc6ICAgICAgICAgICAgICAgICAgICAgI2Y5ZjJmNCAhZGVmYXVsdDtcblxuJGtiZC1jb2xvcjogICAgICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRrYmQtYmc6ICAgICAgICAgICAgICAgICAgICAgICMzMzMgIWRlZmF1bHQ7XG5cbiRwcmUtYmc6ICAgICAgICAgICAgICAgICAgICAgICNmNWY1ZjUgIWRlZmF1bHQ7XG4kcHJlLWNvbG9yOiAgICAgICAgICAgICAgICAgICAkZ3JheS1kYXJrICFkZWZhdWx0O1xuJHByZS1ib3JkZXItY29sb3I6ICAgICAgICAgICAgI2NjYyAhZGVmYXVsdDtcbiRwcmUtc2Nyb2xsYWJsZS1tYXgtaGVpZ2h0OiAgIDM0MHB4ICFkZWZhdWx0O1xuXG5cbi8vPT0gVHlwZVxuLy9cbi8vIyNcblxuLy8qKiBIb3Jpem9udGFsIG9mZnNldCBmb3IgZm9ybXMgYW5kIGxpc3RzLlxuJGNvbXBvbmVudC1vZmZzZXQtaG9yaXpvbnRhbDogMTgwcHggIWRlZmF1bHQ7XG4vLyoqIFRleHQgbXV0ZWQgY29sb3JcbiR0ZXh0LW11dGVkOiAgICAgICAgICAgICAgICAgICRncmF5LWxpZ2h0ICFkZWZhdWx0O1xuLy8qKiBBYmJyZXZpYXRpb25zIGFuZCBhY3JvbnltcyBib3JkZXIgY29sb3JcbiRhYmJyLWJvcmRlci1jb2xvcjogICAgICAgICAgICRncmF5LWxpZ2h0ICFkZWZhdWx0O1xuLy8qKiBIZWFkaW5ncyBzbWFsbCBjb2xvclxuJGhlYWRpbmdzLXNtYWxsLWNvbG9yOiAgICAgICAgJGdyYXktbGlnaHQgIWRlZmF1bHQ7XG4vLyoqIEJsb2NrcXVvdGUgc21hbGwgY29sb3JcbiRibG9ja3F1b3RlLXNtYWxsLWNvbG9yOiAgICAgICRncmF5LWxpZ2h0ICFkZWZhdWx0O1xuLy8qKiBCbG9ja3F1b3RlIGZvbnQgc2l6ZVxuJGJsb2NrcXVvdGUtZm9udC1zaXplOiAgICAgICAgKCRmb250LXNpemUtYmFzZSAqIDEuMjUpICFkZWZhdWx0O1xuLy8qKiBCbG9ja3F1b3RlIGJvcmRlciBjb2xvclxuJGJsb2NrcXVvdGUtYm9yZGVyLWNvbG9yOiAgICAgJGdyYXktbGlnaHRlciAhZGVmYXVsdDtcbi8vKiogUGFnZSBoZWFkZXIgYm9yZGVyIGNvbG9yXG4kcGFnZS1oZWFkZXItYm9yZGVyLWNvbG9yOiAgICAkZ3JheS1saWdodGVyICFkZWZhdWx0O1xuLy8qKiBXaWR0aCBvZiBob3Jpem9udGFsIGRlc2NyaXB0aW9uIGxpc3QgdGl0bGVzXG4kZGwtaG9yaXpvbnRhbC1vZmZzZXQ6ICAgICAgICAkY29tcG9uZW50LW9mZnNldC1ob3Jpem9udGFsICFkZWZhdWx0O1xuLy8qKiBQb2ludCBhdCB3aGljaCAuZGwtaG9yaXpvbnRhbCBiZWNvbWVzIGhvcml6b250YWxcbiRkbC1ob3Jpem9udGFsLWJyZWFrcG9pbnQ6ICAgICRncmlkLWZsb2F0LWJyZWFrcG9pbnQgIWRlZmF1bHQ7XG4vLyoqIEhvcml6b250YWwgbGluZSBjb2xvci5cbiRoci1ib3JkZXI6ICAgICAgICAgICAgICAgICAgICRncmF5LWxpZ2h0ZXIgIWRlZmF1bHQ7XG4iLCJAaW1wb3J0ICcuLi8uLi8uLi9zdHlsZXMvYW5pbWF0aW9ucy5zY3NzJztcblxueG9zLXRhYmxlIHtcblxuICBkaXNwbGF5OiBibG9jaztcblxuICB0ci5uZy1tb3ZlLFxuICB0ci5uZy1lbnRlcixcbiAgdHIubmctbGVhdmUge1xuICAgIHRyYW5zaXRpb246YWxsIGxpbmVhciAwLjVzO1xuICB9XG5cbiAgdHIubmctbGVhdmUubmctbGVhdmUtYWN0aXZlLFxuICB0ci5uZy1tb3ZlLFxuICB0ci5uZy1lbnRlciB7XG4gICAgb3BhY2l0eTowO1xuICAgIGFuaW1hdGlvbjogMC41cyBzbGlkZU91dFJpZ2h0IGVhc2UtaW4tb3V0O1xuICB9XG5cbiAgdHIubmctbGVhdmUsXG4gIHRyLm5nLW1vdmUubmctbW92ZS1hY3RpdmUsXG4gIHRyLm5nLWVudGVyLm5nLWVudGVyLWFjdGl2ZSB7XG4gICAgb3BhY2l0eToxO1xuICAgIGFuaW1hdGlvbjogMC41cyBzbGlkZUluUmlnaHQgZWFzZS1pbi1vdXQ7XG4gIH1cblxuICB0ZCBkbCB7XG4gICAgbWFyZ2luLWJvdHRvbTogMDtcblxuICAgIGR0IHtcbiAgICAgIHdpZHRoOiBhdXRvICFpbXBvcnRhbnQ7XG4gICAgICBtYXJnaW4tcmlnaHQ6IDEwcHg7XG4gICAgfVxuICAgIFxuICAgIGR0OmFmdGVyIHtcbiAgICAgIC8qZGlzcGxheTogYmxvY2s7Ki9cbiAgICAgIGNvbnRlbnQ6ICc6JztcbiAgICB9XG5cbiAgICBkZCB7XG4gICAgICBtYXJnaW4tbGVmdDogMCAhaW1wb3J0YW50O1xuICAgIH1cbiAgfVxufSIsIkBpbXBvcnQgJy4uLy4uLy4uL3N0eWxlcy9hbmltYXRpb25zLnNjc3MnO1xuXG54b3MtYWxlcnQge1xuXG4gIC8qIHdoZW4gaGlkaW5nICovXG4gIC5uZy1oaWRlLWFkZCAgICAgICAgIHsgYW5pbWF0aW9uOjAuNXMgZmFkZU91dERvd24gZWFzZS1pbi1vdXQ7IH1cblxuICAvKiB3aGVuIHNob3dpbmcgKi9cbiAgLm5nLWhpZGUtcmVtb3ZlICAgICAgeyBhbmltYXRpb246MC41cyBmYWRlSW5VcCBlYXNlLWluLW91dDsgfVxufSIsIkBpbXBvcnQgJy4uLy4uLy4uL3N0eWxlcy9hbmltYXRpb25zLnNjc3MnO1xuQGltcG9ydCAnLi4vLi4vLi4vLi4vLi4vLi4vc3R5bGUvc2Fzcy9ib290c3RyYXAvYm9vdHN0cmFwL192YXJpYWJsZXMuc2Nzcyc7XG5cbmlucHV0ICsgeG9zLXZhbGlkYXRpb24ge1xuICBtYXJnaW4tdG9wOiAkZm9ybS1ncm91cC1tYXJnaW4tYm90dG9tO1xuICBkaXNwbGF5OiBibG9jaztcbn0iLCJ4b3Mtc21hcnQtdGFibGV7XG4gIFxufSJdLCJtYXBwaW5ncyI6IkFDQUEsVUFBVSxDQUFDLEFBQUEsWUFBWTtFQUNyQixBQUFBLElBQUk7SUFDRixTQUFTLEVBQUUsdUJBQVc7SUFDdEIsVUFBVSxFQUFFLE9BQVE7RUFHdEIsQUFBQSxFQUFFO0lBQ0EsU0FBUyxFQUFFLG9CQUFX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 */
+/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieG9zTmdMaWIuY3NzIiwic291cmNlcyI6WyJtYWluLnNjc3MiLCJhbmltYXRpb25zLnNjc3MiLCIuLi8uLi8uLi8uLi9zdHlsZS9zYXNzL2Jvb3RzdHJhcC9ib290c3RyYXAvX3ZhcmlhYmxlcy5zY3NzIiwiLi4vdWlfY29tcG9uZW50cy9kdW1iQ29tcG9uZW50cy90YWJsZS90YWJsZS5zY3NzIiwiLi4vdWlfY29tcG9uZW50cy9kdW1iQ29tcG9uZW50cy9hbGVydC9hbGVydC5zY3NzIiwiLi4vdWlfY29tcG9uZW50cy9kdW1iQ29tcG9uZW50cy92YWxpZGF0aW9uL3ZhbGlkYXRpb24uc2NzcyIsIi4uL3VpX2NvbXBvbmVudHMvZHVtYkNvbXBvbmVudHMvZmllbGQvZmllbGQuc2NzcyIsIi4uL3VpX2NvbXBvbmVudHMvc21hcnRDb21wb25lbnRzL3NtYXJ0VGFibGUvc21hcnRUYWJsZS5zY3NzIl0sInNvdXJjZXNDb250ZW50IjpbIkBpbXBvcnQgJy4vYW5pbWF0aW9ucy5zY3NzJztcbkBpbXBvcnQgJy4uLy4uLy4uLy4uLy4uL3ZpZXdzL3N0eWxlL3Nhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fdmFyaWFibGVzLnNjc3MnO1xuXG5AaW1wb3J0ICcuLi91aV9jb21wb25lbnRzL2R1bWJDb21wb25lbnRzL3RhYmxlL3RhYmxlLnNjc3MnO1xuQGltcG9ydCAnLi4vdWlfY29tcG9uZW50cy9kdW1iQ29tcG9uZW50cy9hbGVydC9hbGVydC5zY3NzJztcbkBpbXBvcnQgJy4uL3VpX2NvbXBvbmVudHMvZHVtYkNvbXBvbmVudHMvdmFsaWRhdGlvbi92YWxpZGF0aW9uLnNjc3MnO1xuQGltcG9ydCAnLi4vdWlfY29tcG9uZW50cy9kdW1iQ29tcG9uZW50cy9maWVsZC9maWVsZC5zY3NzJztcblxuQGltcG9ydCAnLi4vdWlfY29tcG9uZW50cy9zbWFydENvbXBvbmVudHMvc21hcnRUYWJsZS9zbWFydFRhYmxlLnNjc3MnO1xuXG5bbmdcXDpjbG9ha10sIFtuZy1jbG9ha10sIFtkYXRhLW5nLWNsb2FrXSwgW3gtbmctY2xvYWtdLCAubmctY2xvYWssIC54LW5nLWNsb2FrIHtcbiAgZGlzcGxheTogbm9uZSAhaW1wb3J0YW50O1xufVxuXG4ucm93ICsgLnJvdyB7XG4gIC8qIFRPRE8gbW92ZSBpbiB4b3Muc2NzcyovIFxuICBtYXJnaW4tdG9wOiAkZm9ybS1ncm91cC1tYXJnaW4tYm90dG9tO1xufSIsIkBrZXlmcmFtZXMgc2xpZGVJblJpZ2h0IHtcbiAgZnJvbSB7XG4gICAgdHJhbnNmb3JtOiB0cmFuc2xhdGUzZCgxMDAlLCAwLCAwKTtcbiAgICB2aXNpYmlsaXR5OiB2aXNpYmxlO1xuICB9XG5cbiAgdG8ge1xuICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlM2QoMCwgMCwgMCk7XG4gIH1cbn1cblxuQGtleWZyYW1lcyBzbGlkZU91dFJpZ2h0IHtcbiAgZnJvbSB7XG4gICAgdHJhbnNmb3JtOiB0cmFuc2xhdGUzZCgwLCAwLCAwKTtcbiAgfVxuXG4gIHRvIHtcbiAgICB2aXNpYmlsaXR5OiBoaWRkZW47XG4gICAgdHJhbnNmb3JtOiB0cmFuc2xhdGUzZCgxMDAlLCAwLCAwKTtcbiAgfVxufVxuXG5Aa2V5ZnJhbWVzIGZhZGVJblVwIHtcbiAgZnJvbSB7XG4gICAgb3BhY2l0eTogMDtcbiAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZTNkKDAsIDEwMCUsIDApO1xuICB9XG5cbiAgdG8ge1xuICAgIG9wYWNpdHk6IDE7XG4gICAgdHJhbnNmb3JtOiBub25lO1xuICB9XG59XG5cbkBrZXlmcmFtZXMgZmFkZU91dERvd24ge1xuICBmcm9tIHtcbiAgICBvcGFjaXR5OiAxO1xuICB9XG5cbiAgdG8ge1xuICAgIG9wYWNpdHk6IDA7XG4gICAgdHJhbnNmb3JtOiB0cmFuc2xhdGUzZCgwLCAxMDAlLCAwKTtcbiAgfVxufSIsIiRib290c3RyYXAtc2Fzcy1hc3NldC1oZWxwZXI6IGZhbHNlICFkZWZhdWx0O1xuLy9cbi8vIFZhcmlhYmxlc1xuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuXG4vLz09IENvbG9yc1xuLy9cbi8vIyMgR3JheSBhbmQgYnJhbmQgY29sb3JzIGZvciB1c2UgYWNyb3NzIEJvb3RzdHJhcC5cblxuJGdyYXktYmFzZTogICAgICAgICAgICAgICMwMDAgIWRlZmF1bHQ7XG4kZ3JheS1kYXJrZXI6ICAgICAgICAgICAgbGlnaHRlbigkZ3JheS1iYXNlLCAxMy41JSkgIWRlZmF1bHQ7IC8vICMyMjJcbiRncmF5LWRhcms6ICAgICAgICAgICAgICBsaWdodGVuKCRncmF5LWJhc2UsIDIwJSkgIWRlZmF1bHQ7ICAgLy8gIzMzM1xuJGdyYXk6ICAgICAgICAgICAgICAgICAgIGxpZ2h0ZW4oJGdyYXktYmFzZSwgMzMuNSUpICFkZWZhdWx0OyAvLyAjNTU1XG4kZ3JheS1saWdodDogICAgICAgICAgICAgbGlnaHRlbigkZ3JheS1iYXNlLCA0Ni43JSkgIWRlZmF1bHQ7IC8vICM3NzdcbiRncmF5LWxpZ2h0ZXI6ICAgICAgICAgICBsaWdodGVuKCRncmF5LWJhc2UsIDkzLjUlKSAhZGVmYXVsdDsgLy8gI2VlZVxuXG4kYnJhbmQtcHJpbWFyeTogICAgICAgICBkYXJrZW4oIzQyOGJjYSwgNi41JSkgIWRlZmF1bHQ7IC8vICMzMzdhYjdcbiRicmFuZC1zdWNjZXNzOiAgICAgICAgICM1Y2I4NWMgIWRlZmF1bHQ7XG4kYnJhbmQtaW5mbzogICAgICAgICAgICAjNWJjMGRlICFkZWZhdWx0O1xuJGJyYW5kLXdhcm5pbmc6ICAgICAgICAgI2YwYWQ0ZSAhZGVmYXVsdDtcbiRicmFuZC1kYW5nZXI6ICAgICAgICAgICNkOTUzNGYgIWRlZmF1bHQ7XG5cblxuLy89PSBTY2FmZm9sZGluZ1xuLy9cbi8vIyMgU2V0dGluZ3MgZm9yIHNvbWUgb2YgdGhlIG1vc3QgZ2xvYmFsIHN0eWxlcy5cblxuLy8qKiBCYWNrZ3JvdW5kIGNvbG9yIGZvciBgPGJvZHk+YC5cbiRib2R5LWJnOiAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4vLyoqIEdsb2JhbCB0ZXh0IGNvbG9yIG9uIGA8Ym9keT5gLlxuJHRleHQtY29sb3I6ICAgICAgICAgICAgJGdyYXktZGFyayAhZGVmYXVsdDtcblxuLy8qKiBHbG9iYWwgdGV4dHVhbCBsaW5rIGNvbG9yLlxuJGxpbmstY29sb3I6ICAgICAgICAgICAgJGJyYW5kLXByaW1hcnkgIWRlZmF1bHQ7XG4vLyoqIExpbmsgaG92ZXIgY29sb3Igc2V0IHZpYSBgZGFya2VuKClgIGZ1bmN0aW9uLlxuJGxpbmstaG92ZXItY29sb3I6ICAgICAgZGFya2VuKCRsaW5rLWNvbG9yLCAxNSUpICFkZWZhdWx0O1xuLy8qKiBMaW5rIGhvdmVyIGRlY29yYXRpb24uXG4kbGluay1ob3Zlci1kZWNvcmF0aW9uOiB1bmRlcmxpbmUgIWRlZmF1bHQ7XG5cblxuLy89PSBUeXBvZ3JhcGh5XG4vL1xuLy8jIyBGb250LCBsaW5lLWhlaWdodCwgYW5kIGNvbG9yIGZvciBib2R5IHRleHQsIGhlYWRpbmdzLCBhbmQgbW9yZS5cblxuJGZvbnQtZmFtaWx5LXNhbnMtc2VyaWY6ICBcIkhlbHZldGljYSBOZXVlXCIsIEhlbHZldGljYSwgQXJpYWwsIHNhbnMtc2VyaWYgIWRlZmF1bHQ7XG4kZm9udC1mYW1pbHktc2VyaWY6ICAgICAgIEdlb3JnaWEsIFwiVGltZXMgTmV3IFJvbWFuXCIsIFRpbWVzLCBzZXJpZiAhZGVmYXVsdDtcbi8vKiogRGVmYXVsdCBtb25vc3BhY2UgZm9udHMgZm9yIGA8Y29kZT5gLCBgPGtiZD5gLCBhbmQgYDxwcmU+YC5cbiRmb250LWZhbWlseS1tb25vc3BhY2U6ICAgTWVubG8sIE1vbmFjbywgQ29uc29sYXMsIFwiQ291cmllciBOZXdcIiwgbW9ub3NwYWNlICFkZWZhdWx0O1xuJGZvbnQtZmFtaWx5LWJhc2U6ICAgICAgICAkZm9udC1mYW1pbHktc2Fucy1zZXJpZiAhZGVmYXVsdDtcblxuJGZvbnQtc2l6ZS1iYXNlOiAgICAgICAgICAxNHB4ICFkZWZhdWx0O1xuJGZvbnQtc2l6ZS1sYXJnZTogICAgICAgICBjZWlsKCgkZm9udC1zaXplLWJhc2UgKiAxLjI1KSkgIWRlZmF1bHQ7IC8vIH4xOHB4XG4kZm9udC1zaXplLXNtYWxsOiAgICAgICAgIGNlaWwoKCRmb250LXNpemUtYmFzZSAqIDAuODUpKSAhZGVmYXVsdDsgLy8gfjEycHhcblxuJGZvbnQtc2l6ZS1oMTogICAgICAgICAgICBmbG9vcigoJGZvbnQtc2l6ZS1iYXNlICogMi42KSkgIWRlZmF1bHQ7IC8vIH4zNnB4XG4kZm9udC1zaXplLWgyOiAgICAgICAgICAgIGZsb29yKCgkZm9udC1zaXplLWJhc2UgKiAyLjE1KSkgIWRlZmF1bHQ7IC8vIH4zMHB4XG4kZm9udC1zaXplLWgzOiAgICAgICAgICAgIGNlaWwoKCRmb250LXNpemUtYmFzZSAqIDEuNykpICFkZWZhdWx0OyAvLyB+MjRweFxuJGZvbnQtc2l6ZS1oNDogICAgICAgICAgICBjZWlsKCgkZm9udC1zaXplLWJhc2UgKiAxLjI1KSkgIWRlZmF1bHQ7IC8vIH4xOHB4XG4kZm9udC1zaXplLWg1OiAgICAgICAgICAgICRmb250LXNpemUtYmFzZSAhZGVmYXVsdDtcbiRmb250LXNpemUtaDY6ICAgICAgICAgICAgY2VpbCgoJGZvbnQtc2l6ZS1iYXNlICogMC44NSkpICFkZWZhdWx0OyAvLyB+MTJweFxuXG4vLyoqIFVuaXQtbGVzcyBgbGluZS1oZWlnaHRgIGZvciB1c2UgaW4gY29tcG9uZW50cyBsaWtlIGJ1dHRvbnMuXG4kbGluZS1oZWlnaHQtYmFzZTogICAgICAgIDEuNDI4NTcxNDI5ICFkZWZhdWx0OyAvLyAyMC8xNFxuLy8qKiBDb21wdXRlZCBcImxpbmUtaGVpZ2h0XCIgKGBmb250LXNpemVgICogYGxpbmUtaGVpZ2h0YCkgZm9yIHVzZSB3aXRoIGBtYXJnaW5gLCBgcGFkZGluZ2AsIGV0Yy5cbiRsaW5lLWhlaWdodC1jb21wdXRlZDogICAgZmxvb3IoKCRmb250LXNpemUtYmFzZSAqICRsaW5lLWhlaWdodC1iYXNlKSkgIWRlZmF1bHQ7IC8vIH4yMHB4XG5cbi8vKiogQnkgZGVmYXVsdCwgdGhpcyBpbmhlcml0cyBmcm9tIHRoZSBgPGJvZHk+YC5cbiRoZWFkaW5ncy1mb250LWZhbWlseTogICAgaW5oZXJpdCAhZGVmYXVsdDtcbiRoZWFkaW5ncy1mb250LXdlaWdodDogICAgNTAwICFkZWZhdWx0O1xuJGhlYWRpbmdzLWxpbmUtaGVpZ2h0OiAgICAxLjEgIWRlZmF1bHQ7XG4kaGVhZGluZ3MtY29sb3I6ICAgICAgICAgIGluaGVyaXQgIWRlZmF1bHQ7XG5cblxuLy89PSBJY29ub2dyYXBoeVxuLy9cbi8vIyMgU3BlY2lmeSBjdXN0b20gbG9jYXRpb24gYW5kIGZpbGVuYW1lIG9mIHRoZSBpbmNsdWRlZCBHbHlwaGljb25zIGljb24gZm9udC4gVXNlZnVsIGZvciB0aG9zZSBpbmNsdWRpbmcgQm9vdHN0cmFwIHZpYSBCb3dlci5cblxuLy8qKiBMb2FkIGZvbnRzIGZyb20gdGhpcyBkaXJlY3RvcnkuXG5cbi8vIFtjb252ZXJ0ZXJdIElmICRib290c3RyYXAtc2Fzcy1hc3NldC1oZWxwZXIgaWYgdXNlZCwgcHJvdmlkZSBwYXRoIHJlbGF0aXZlIHRvIHRoZSBhc3NldHMgbG9hZCBwYXRoLlxuLy8gW2NvbnZlcnRlcl0gVGhpcyBpcyBiZWNhdXNlIHNvbWUgYXNzZXQgaGVscGVycywgc3VjaCBhcyBTcHJvY2tldHMsIGRvIG5vdCB3b3JrIHdpdGggZmlsZS1yZWxhdGl2ZSBwYXRocy5cbiRpY29uLWZvbnQtcGF0aDogaWYoJGJvb3RzdHJhcC1zYXNzLWFzc2V0LWhlbHBlciwgXCJib290c3RyYXAvXCIsIFwiLi4vZm9udHMvYm9vdHN0cmFwL1wiKSAhZGVmYXVsdDtcblxuLy8qKiBGaWxlIG5hbWUgZm9yIGFsbCBmb250IGZpbGVzLlxuJGljb24tZm9udC1uYW1lOiAgICAgICAgICBcImdseXBoaWNvbnMtaGFsZmxpbmdzLXJlZ3VsYXJcIiAhZGVmYXVsdDtcbi8vKiogRWxlbWVudCBJRCB3aXRoaW4gU1ZHIGljb24gZmlsZS5cbiRpY29uLWZvbnQtc3ZnLWlkOiAgICAgICAgXCJnbHlwaGljb25zX2hhbGZsaW5nc3JlZ3VsYXJcIiAhZGVmYXVsdDtcblxuXG4vLz09IENvbXBvbmVudHNcbi8vXG4vLyMjIERlZmluZSBjb21tb24gcGFkZGluZyBhbmQgYm9yZGVyIHJhZGl1cyBzaXplcyBhbmQgbW9yZS4gVmFsdWVzIGJhc2VkIG9uIDE0cHggdGV4dCBhbmQgMS40MjggbGluZS1oZWlnaHQgKH4yMHB4IHRvIHN0YXJ0KS5cblxuJHBhZGRpbmctYmFzZS12ZXJ0aWNhbDogICAgIDZweCAhZGVmYXVsdDtcbiRwYWRkaW5nLWJhc2UtaG9yaXpvbnRhbDogICAxMnB4ICFkZWZhdWx0O1xuXG4kcGFkZGluZy1sYXJnZS12ZXJ0aWNhbDogICAgMTBweCAhZGVmYXVsdDtcbiRwYWRkaW5nLWxhcmdlLWhvcml6b250YWw6ICAxNnB4ICFkZWZhdWx0O1xuXG4kcGFkZGluZy1zbWFsbC12ZXJ0aWNhbDogICAgNXB4ICFkZWZhdWx0O1xuJHBhZGRpbmctc21hbGwtaG9yaXpvbnRhbDogIDEwcHggIWRlZmF1bHQ7XG5cbiRwYWRkaW5nLXhzLXZlcnRpY2FsOiAgICAgICAxcHggIWRlZmF1bHQ7XG4kcGFkZGluZy14cy1ob3Jpem9udGFsOiAgICAgNXB4ICFkZWZhdWx0O1xuXG4kbGluZS1oZWlnaHQtbGFyZ2U6ICAgICAgICAgMS4zMzMzMzMzICFkZWZhdWx0OyAvLyBleHRyYSBkZWNpbWFscyBmb3IgV2luIDguMSBDaHJvbWVcbiRsaW5lLWhlaWdodC1zbWFsbDogICAgICAgICAxLjUgIWRlZmF1bHQ7XG5cbiRib3JkZXItcmFkaXVzLWJhc2U6ICAgICAgICA0cHggIWRlZmF1bHQ7XG4kYm9yZGVyLXJhZGl1cy1sYXJnZTogICAgICAgNnB4ICFkZWZhdWx0O1xuJGJvcmRlci1yYWRpdXMtc21hbGw6ICAgICAgIDNweCAhZGVmYXVsdDtcblxuLy8qKiBHbG9iYWwgY29sb3IgZm9yIGFjdGl2ZSBpdGVtcyAoZS5nLiwgbmF2cyBvciBkcm9wZG93bnMpLlxuJGNvbXBvbmVudC1hY3RpdmUtY29sb3I6ICAgICNmZmYgIWRlZmF1bHQ7XG4vLyoqIEdsb2JhbCBiYWNrZ3JvdW5kIGNvbG9yIGZvciBhY3RpdmUgaXRlbXMgKGUuZy4sIG5hdnMgb3IgZHJvcGRvd25zKS5cbiRjb21wb25lbnQtYWN0aXZlLWJnOiAgICAgICAkYnJhbmQtcHJpbWFyeSAhZGVmYXVsdDtcblxuLy8qKiBXaWR0aCBvZiB0aGUgYGJvcmRlcmAgZm9yIGdlbmVyYXRpbmcgY2FyZXRzIHRoYXQgaW5kaWNhdG9yIGRyb3Bkb3ducy5cbiRjYXJldC13aWR0aC1iYXNlOiAgICAgICAgICA0cHggIWRlZmF1bHQ7XG4vLyoqIENhcmV0cyBpbmNyZWFzZSBzbGlnaHRseSBpbiBzaXplIGZvciBsYXJnZXIgY29tcG9uZW50cy5cbiRjYXJldC13aWR0aC1sYXJnZTogICAgICAgICA1cHggIWRlZmF1bHQ7XG5cblxuLy89PSBUYWJsZXNcbi8vXG4vLyMjIEN1c3RvbWl6ZXMgdGhlIGAudGFibGVgIGNvbXBvbmVudCB3aXRoIGJhc2ljIHZhbHVlcywgZWFjaCB1c2VkIGFjcm9zcyBhbGwgdGFibGUgdmFyaWF0aW9ucy5cblxuLy8qKiBQYWRkaW5nIGZvciBgPHRoPmBzIGFuZCBgPHRkPmBzLlxuJHRhYmxlLWNlbGwtcGFkZGluZzogICAgICAgICAgICA4cHggIWRlZmF1bHQ7XG4vLyoqIFBhZGRpbmcgZm9yIGNlbGxzIGluIGAudGFibGUtY29uZGVuc2VkYC5cbiR0YWJsZS1jb25kZW5zZWQtY2VsbC1wYWRkaW5nOiAgNXB4ICFkZWZhdWx0O1xuXG4vLyoqIERlZmF1bHQgYmFja2dyb3VuZCBjb2xvciB1c2VkIGZvciBhbGwgdGFibGVzLlxuJHRhYmxlLWJnOiAgICAgICAgICAgICAgICAgICAgICB0cmFuc3BhcmVudCAhZGVmYXVsdDtcbi8vKiogQmFja2dyb3VuZCBjb2xvciB1c2VkIGZvciBgLnRhYmxlLXN0cmlwZWRgLlxuJHRhYmxlLWJnLWFjY2VudDogICAgICAgICAgICAgICAjZjlmOWY5ICFkZWZhdWx0O1xuLy8qKiBCYWNrZ3JvdW5kIGNvbG9yIHVzZWQgZm9yIGAudGFibGUtaG92ZXJgLlxuJHRhYmxlLWJnLWhvdmVyOiAgICAgICAgICAgICAgICAjZjVmNWY1ICFkZWZhdWx0O1xuJHRhYmxlLWJnLWFjdGl2ZTogICAgICAgICAgICAgICAkdGFibGUtYmctaG92ZXIgIWRlZmF1bHQ7XG5cbi8vKiogQm9yZGVyIGNvbG9yIGZvciB0YWJsZSBhbmQgY2VsbCBib3JkZXJzLlxuJHRhYmxlLWJvcmRlci1jb2xvcjogICAgICAgICAgICAjZGRkICFkZWZhdWx0O1xuXG5cbi8vPT0gQnV0dG9uc1xuLy9cbi8vIyMgRm9yIGVhY2ggb2YgQm9vdHN0cmFwJ3MgYnV0dG9ucywgZGVmaW5lIHRleHQsIGJhY2tncm91bmQgYW5kIGJvcmRlciBjb2xvci5cblxuJGJ0bi1mb250LXdlaWdodDogICAgICAgICAgICAgICAgbm9ybWFsICFkZWZhdWx0O1xuXG4kYnRuLWRlZmF1bHQtY29sb3I6ICAgICAgICAgICAgICAjMzMzICFkZWZhdWx0O1xuJGJ0bi1kZWZhdWx0LWJnOiAgICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRidG4tZGVmYXVsdC1ib3JkZXI6ICAgICAgICAgICAgICNjY2MgIWRlZmF1bHQ7XG5cbiRidG4tcHJpbWFyeS1jb2xvcjogICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kYnRuLXByaW1hcnktYmc6ICAgICAgICAgICAgICAgICAkYnJhbmQtcHJpbWFyeSAhZGVmYXVsdDtcbiRidG4tcHJpbWFyeS1ib3JkZXI6ICAgICAgICAgICAgIGRhcmtlbigkYnRuLXByaW1hcnktYmcsIDUlKSAhZGVmYXVsdDtcblxuJGJ0bi1zdWNjZXNzLWNvbG9yOiAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRidG4tc3VjY2Vzcy1iZzogICAgICAgICAgICAgICAgICRicmFuZC1zdWNjZXNzICFkZWZhdWx0O1xuJGJ0bi1zdWNjZXNzLWJvcmRlcjogICAgICAgICAgICAgZGFya2VuKCRidG4tc3VjY2Vzcy1iZywgNSUpICFkZWZhdWx0O1xuXG4kYnRuLWluZm8tY29sb3I6ICAgICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuJGJ0bi1pbmZvLWJnOiAgICAgICAgICAgICAgICAgICAgJGJyYW5kLWluZm8gIWRlZmF1bHQ7XG4kYnRuLWluZm8tYm9yZGVyOiAgICAgICAgICAgICAgICBkYXJrZW4oJGJ0bi1pbmZvLWJnLCA1JSkgIWRlZmF1bHQ7XG5cbiRidG4td2FybmluZy1jb2xvcjogICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kYnRuLXdhcm5pbmctYmc6ICAgICAgICAgICAgICAgICAkYnJhbmQtd2FybmluZyAhZGVmYXVsdDtcbiRidG4td2FybmluZy1ib3JkZXI6ICAgICAgICAgICAgIGRhcmtlbigkYnRuLXdhcm5pbmctYmcsIDUlKSAhZGVmYXVsdDtcblxuJGJ0bi1kYW5nZXItY29sb3I6ICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbiRidG4tZGFuZ2VyLWJnOiAgICAgICAgICAgICAgICAgICRicmFuZC1kYW5nZXIgIWRlZmF1bHQ7XG4kYnRuLWRhbmdlci1ib3JkZXI6ICAgICAgICAgICAgICBkYXJrZW4oJGJ0bi1kYW5nZXItYmcsIDUlKSAhZGVmYXVsdDtcblxuJGJ0bi1saW5rLWRpc2FibGVkLWNvbG9yOiAgICAgICAgJGdyYXktbGlnaHQgIWRlZmF1bHQ7XG5cbi8vIEFsbG93cyBmb3IgY3VzdG9taXppbmcgYnV0dG9uIHJhZGl1cyBpbmRlcGVuZGVudGx5IGZyb20gZ2xvYmFsIGJvcmRlciByYWRpdXNcbiRidG4tYm9yZGVyLXJhZGl1cy1iYXNlOiAgICAgICAgICRib3JkZXItcmFkaXVzLWJhc2UgIWRlZmF1bHQ7XG4kYnRuLWJvcmRlci1yYWRpdXMtbGFyZ2U6ICAgICAgICAkYm9yZGVyLXJhZGl1cy1sYXJnZSAhZGVmYXVsdDtcbiRidG4tYm9yZGVyLXJhZGl1cy1zbWFsbDogICAgICAgICRib3JkZXItcmFkaXVzLXNtYWxsICFkZWZhdWx0O1xuXG5cbi8vPT0gRm9ybXNcbi8vXG4vLyMjXG5cbi8vKiogYDxpbnB1dD5gIGJhY2tncm91bmQgY29sb3JcbiRpbnB1dC1iZzogICAgICAgICAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4vLyoqIGA8aW5wdXQgZGlzYWJsZWQ+YCBiYWNrZ3JvdW5kIGNvbG9yXG4kaW5wdXQtYmctZGlzYWJsZWQ6ICAgICAgICAgICAgICAkZ3JheS1saWdodGVyICFkZWZhdWx0O1xuXG4vLyoqIFRleHQgY29sb3IgZm9yIGA8aW5wdXQ+YHNcbiRpbnB1dC1jb2xvcjogICAgICAgICAgICAgICAgICAgICRncmF5ICFkZWZhdWx0O1xuLy8qKiBgPGlucHV0PmAgYm9yZGVyIGNvbG9yXG4kaW5wdXQtYm9yZGVyOiAgICAgICAgICAgICAgICAgICAjY2NjICFkZWZhdWx0O1xuXG4vLyBUT0RPOiBSZW5hbWUgYCRpbnB1dC1ib3JkZXItcmFkaXVzYCB0byBgJGlucHV0LWJvcmRlci1yYWRpdXMtYmFzZWAgaW4gdjRcbi8vKiogRGVmYXVsdCBgLmZvcm0tY29udHJvbGAgYm9yZGVyIHJhZGl1c1xuLy8gVGhpcyBoYXMgbm8gZWZmZWN0IG9uIGA8c2VsZWN0PmBzIGluIHNvbWUgYnJvd3NlcnMsIGR1ZSB0byB0aGUgbGltaXRlZCBzdHlsYWJpbGl0eSBvZiBgPHNlbGVjdD5gcyBpbiBDU1MuXG4kaW5wdXQtYm9yZGVyLXJhZGl1czogICAgICAgICAgICAkYm9yZGVyLXJhZGl1cy1iYXNlICFkZWZhdWx0O1xuLy8qKiBMYXJnZSBgLmZvcm0tY29udHJvbGAgYm9yZGVyIHJhZGl1c1xuJGlucHV0LWJvcmRlci1yYWRpdXMtbGFyZ2U6ICAgICAgJGJvcmRlci1yYWRpdXMtbGFyZ2UgIWRlZmF1bHQ7XG4vLyoqIFNtYWxsIGAuZm9ybS1jb250cm9sYCBib3JkZXIgcmFkaXVzXG4kaW5wdXQtYm9yZGVyLXJhZGl1cy1zbWFsbDogICAgICAkYm9yZGVyLXJhZGl1cy1zbWFsbCAhZGVmYXVsdDtcblxuLy8qKiBCb3JkZXIgY29sb3IgZm9yIGlucHV0cyBvbiBmb2N1c1xuJGlucHV0LWJvcmRlci1mb2N1czogICAgICAgICAgICAgIzY2YWZlOSAhZGVmYXVsdDtcblxuLy8qKiBQbGFjZWhvbGRlciB0ZXh0IGNvbG9yXG4kaW5wdXQtY29sb3ItcGxhY2Vob2xkZXI6ICAgICAgICAjOTk5ICFkZWZhdWx0O1xuXG4vLyoqIERlZmF1bHQgYC5mb3JtLWNvbnRyb2xgIGhlaWdodFxuJGlucHV0LWhlaWdodC1iYXNlOiAgICAgICAgICAgICAgKCRsaW5lLWhlaWdodC1jb21wdXRlZCArICgkcGFkZGluZy1iYXNlLXZlcnRpY2FsICogMikgKyAyKSAhZGVmYXVsdDtcbi8vKiogTGFyZ2UgYC5mb3JtLWNvbnRyb2xgIGhlaWdodFxuJGlucHV0LWhlaWdodC1sYXJnZTogICAgICAgICAgICAgKGNlaWwoJGZvbnQtc2l6ZS1sYXJnZSAqICRsaW5lLWhlaWdodC1sYXJnZSkgKyAoJHBhZGRpbmctbGFyZ2UtdmVydGljYWwgKiAyKSArIDIpICFkZWZhdWx0O1xuLy8qKiBTbWFsbCBgLmZvcm0tY29udHJvbGAgaGVpZ2h0XG4kaW5wdXQtaGVpZ2h0LXNtYWxsOiAgICAgICAgICAgICAoZmxvb3IoJGZvbnQtc2l6ZS1zbWFsbCAqICRsaW5lLWhlaWdodC1zbWFsbCkgKyAoJHBhZGRpbmctc21hbGwtdmVydGljYWwgKiAyKSArIDIpICFkZWZhdWx0O1xuXG4vLyoqIGAuZm9ybS1ncm91cGAgbWFyZ2luXG4kZm9ybS1ncm91cC1tYXJnaW4tYm90dG9tOiAgICAgICAxNXB4ICFkZWZhdWx0O1xuXG4kbGVnZW5kLWNvbG9yOiAgICAgICAgICAgICAgICAgICAkZ3JheS1kYXJrICFkZWZhdWx0O1xuJGxlZ2VuZC1ib3JkZXItY29sb3I6ICAgICAgICAgICAgI2U1ZTVlNSAhZGVmYXVsdDtcblxuLy8qKiBCYWNrZ3JvdW5kIGNvbG9yIGZvciB0ZXh0dWFsIGlucHV0IGFkZG9uc1xuJGlucHV0LWdyb3VwLWFkZG9uLWJnOiAgICAgICAgICAgJGdyYXktbGlnaHRlciAhZGVmYXVsdDtcbi8vKiogQm9yZGVyIGNvbG9yIGZvciB0ZXh0dWFsIGlucHV0IGFkZG9uc1xuJGlucHV0LWdyb3VwLWFkZG9uLWJvcmRlci1jb2xvcjogJGlucHV0LWJvcmRlciAhZGVmYXVsdDtcblxuLy8qKiBEaXNhYmxlZCBjdXJzb3IgZm9yIGZvcm0gY29udHJvbHMgYW5kIGJ1dHRvbnMuXG4kY3Vyc29yLWRpc2FibGVkOiAgICAgICAgICAgICAgICBub3QtYWxsb3dlZCAhZGVmYXVsdDtcblxuXG4vLz09IERyb3Bkb3duc1xuLy9cbi8vIyMgRHJvcGRvd24gbWVudSBjb250YWluZXIgYW5kIGNvbnRlbnRzLlxuXG4vLyoqIEJhY2tncm91bmQgZm9yIHRoZSBkcm9wZG93biBtZW51LlxuJGRyb3Bkb3duLWJnOiAgICAgICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbi8vKiogRHJvcGRvd24gbWVudSBgYm9yZGVyLWNvbG9yYC5cbiRkcm9wZG93bi1ib3JkZXI6ICAgICAgICAgICAgICAgIHJnYmEoMCwwLDAsLjE1KSAhZGVmYXVsdDtcbi8vKiogRHJvcGRvd24gbWVudSBgYm9yZGVyLWNvbG9yYCAqKmZvciBJRTgqKi5cbiRkcm9wZG93bi1mYWxsYmFjay1ib3JkZXI6ICAgICAgICNjY2MgIWRlZmF1bHQ7XG4vLyoqIERpdmlkZXIgY29sb3IgZm9yIGJldHdlZW4gZHJvcGRvd24gaXRlbXMuXG4kZHJvcGRvd24tZGl2aWRlci1iZzogICAgICAgICAgICAjZTVlNWU1ICFkZWZhdWx0O1xuXG4vLyoqIERyb3Bkb3duIGxpbmsgdGV4dCBjb2xvci5cbiRkcm9wZG93bi1saW5rLWNvbG9yOiAgICAgICAgICAgICRncmF5LWRhcmsgIWRlZmF1bHQ7XG4vLyoqIEhvdmVyIGNvbG9yIGZvciBkcm9wZG93biBsaW5rcy5cbiRkcm9wZG93bi1saW5rLWhvdmVyLWNvbG9yOiAgICAgIGRhcmtlbigkZ3JheS1kYXJrLCA1JSkgIWRlZmF1bHQ7XG4vLyoqIEhvdmVyIGJhY2tncm91bmQgZm9yIGRyb3Bkb3duIGxpbmtzLlxuJGRyb3Bkb3duLWxpbmstaG92ZXItYmc6ICAgICAgICAgI2Y1ZjVmNSAhZGVmYXVsdDtcblxuLy8qKiBBY3RpdmUgZHJvcGRvd24gbWVudSBpdGVtIHRleHQgY29sb3IuXG4kZHJvcGRvd24tbGluay1hY3RpdmUtY29sb3I6ICAgICAkY29tcG9uZW50LWFjdGl2ZS1jb2xvciAhZGVmYXVsdDtcbi8vKiogQWN0aXZlIGRyb3Bkb3duIG1lbnUgaXRlbSBiYWNrZ3JvdW5kIGNvbG9yLlxuJGRyb3Bkb3duLWxpbmstYWN0aXZlLWJnOiAgICAgICAgJGNvbXBvbmVudC1hY3RpdmUtYmcgIWRlZmF1bHQ7XG5cbi8vKiogRGlzYWJsZWQgZHJvcGRvd24gbWVudSBpdGVtIGJhY2tncm91bmQgY29sb3IuXG4kZHJvcGRvd24tbGluay1kaXNhYmxlZC1jb2xvcjogICAkZ3JheS1saWdodCAhZGVmYXVsdDtcblxuLy8qKiBUZXh0IGNvbG9yIGZvciBoZWFkZXJzIHdpdGhpbiBkcm9wZG93biBtZW51cy5cbiRkcm9wZG93bi1oZWFkZXItY29sb3I6ICAgICAgICAgICRncmF5LWxpZ2h0ICFkZWZhdWx0O1xuXG4vLyoqIERlcHJlY2F0ZWQgYCRkcm9wZG93bi1jYXJldC1jb2xvcmAgYXMgb2YgdjMuMS4wXG4kZHJvcGRvd24tY2FyZXQtY29sb3I6ICAgICAgICAgICAjMDAwICFkZWZhdWx0O1xuXG5cbi8vLS0gWi1pbmRleCBtYXN0ZXIgbGlzdFxuLy9cbi8vIFdhcm5pbmc6IEF2b2lkIGN1c3RvbWl6aW5nIHRoZXNlIHZhbHVlcy4gVGhleSdyZSB1c2VkIGZvciBhIGJpcmQncyBleWUgdmlld1xuLy8gb2YgY29tcG9uZW50cyBkZXBlbmRlbnQgb24gdGhlIHotYXhpcyBhbmQgYXJlIGRlc2lnbmVkIHRvIGFsbCB3b3JrIHRvZ2V0aGVyLlxuLy9cbi8vIE5vdGU6IFRoZXNlIHZhcmlhYmxlcyBhcmUgbm90IGdlbmVyYXRlZCBpbnRvIHRoZSBDdXN0b21pemVyLlxuXG4kemluZGV4LW5hdmJhcjogICAgICAgICAgICAxMDAwICFkZWZhdWx0O1xuJHppbmRleC1kcm9wZG93bjogICAgICAgICAgMTAwMCAhZGVmYXVsdDtcbiR6aW5kZXgtcG9wb3ZlcjogICAgICAgICAgIDEwNjAgIWRlZmF1bHQ7XG4kemluZGV4LXRvb2x0aXA6ICAgICAgICAgICAxMDcwICFkZWZhdWx0O1xuJHppbmRleC1uYXZiYXItZml4ZWQ6ICAgICAgMTAzMCAhZGVmYXVsdDtcbiR6aW5kZXgtbW9kYWwtYmFja2dyb3VuZDogIDEwNDAgIWRlZmF1bHQ7XG4kemluZGV4LW1vZGFsOiAgICAgICAgICAgICAxMDUwICFkZWZhdWx0O1xuXG5cbi8vPT0gTWVkaWEgcXVlcmllcyBicmVha3BvaW50c1xuLy9cbi8vIyMgRGVmaW5lIHRoZSBicmVha3BvaW50cyBhdCB3aGljaCB5b3VyIGxheW91dCB3aWxsIGNoYW5nZSwgYWRhcHRpbmcgdG8gZGlmZmVyZW50IHNjcmVlbiBzaXplcy5cblxuLy8gRXh0cmEgc21hbGwgc2NyZWVuIC8gcGhvbmVcbi8vKiogRGVwcmVjYXRlZCBgJHNjcmVlbi14c2AgYXMgb2YgdjMuMC4xXG4kc2NyZWVuLXhzOiAgICAgICAgICAgICAgICAgIDQ4MHB4ICFkZWZhdWx0O1xuLy8qKiBEZXByZWNhdGVkIGAkc2NyZWVuLXhzLW1pbmAgYXMgb2YgdjMuMi4wXG4kc2NyZWVuLXhzLW1pbjogICAgICAgICAgICAgICRzY3JlZW4teHMgIWRlZmF1bHQ7XG4vLyoqIERlcHJlY2F0ZWQgYCRzY3JlZW4tcGhvbmVgIGFzIG9mIHYzLjAuMVxuJHNjcmVlbi1waG9uZTogICAgICAgICAgICAgICAkc2NyZWVuLXhzLW1pbiAhZGVmYXVsdDtcblxuLy8gU21hbGwgc2NyZWVuIC8gdGFibGV0XG4vLyoqIERlcHJlY2F0ZWQgYCRzY3JlZW4tc21gIGFzIG9mIHYzLjAuMVxuJHNjcmVlbi1zbTogICAgICAgICAgICAgICAgICA3NjhweCAhZGVmYXVsdDtcbiRzY3JlZW4tc20tbWluOiAgICAgICAgICAgICAgJHNjcmVlbi1zbSAhZGVmYXVsdDtcbi8vKiogRGVwcmVjYXRlZCBgJHNjcmVlbi10YWJsZXRgIGFzIG9mIHYzLjAuMVxuJHNjcmVlbi10YWJsZXQ6ICAgICAgICAgICAgICAkc2NyZWVuLXNtLW1pbiAhZGVmYXVsdDtcblxuLy8gTWVkaXVtIHNjcmVlbiAvIGRlc2t0b3Bcbi8vKiogRGVwcmVjYXRlZCBgJHNjcmVlbi1tZGAgYXMgb2YgdjMuMC4xXG4kc2NyZWVuLW1kOiAgICAgICAgICAgICAgICAgIDk5MnB4ICFkZWZhdWx0O1xuJHNjcmVlbi1tZC1taW46ICAgICAgICAgICAgICAkc2NyZWVuLW1kICFkZWZhdWx0O1xuLy8qKiBEZXByZWNhdGVkIGAkc2NyZWVuLWRlc2t0b3BgIGFzIG9mIHYzLjAuMVxuJHNjcmVlbi1kZXNrdG9wOiAgICAgICAgICAgICAkc2NyZWVuLW1kLW1pbiAhZGVmYXVsdDtcblxuLy8gTGFyZ2Ugc2NyZWVuIC8gd2lkZSBkZXNrdG9wXG4vLyoqIERlcHJlY2F0ZWQgYCRzY3JlZW4tbGdgIGFzIG9mIHYzLjAuMVxuJHNjcmVlbi1sZzogICAgICAgICAgICAgICAgICAxMjAwcHggIWRlZmF1bHQ7XG4kc2NyZWVuLWxnLW1pbjogICAgICAgICAgICAgICRzY3JlZW4tbGcgIWRlZmF1bHQ7XG4vLyoqIERlcHJlY2F0ZWQgYCRzY3JlZW4tbGctZGVza3RvcGAgYXMgb2YgdjMuMC4xXG4kc2NyZWVuLWxnLWRlc2t0b3A6ICAgICAgICAgICRzY3JlZW4tbGctbWluICFkZWZhdWx0O1xuXG4vLyBTbyBtZWRpYSBxdWVyaWVzIGRvbid0IG92ZXJsYXAgd2hlbiByZXF1aXJlZCwgcHJvdmlkZSBhIG1heGltdW1cbiRzY3JlZW4teHMtbWF4OiAgICAgICAgICAgICAgKCRzY3JlZW4tc20tbWluIC0gMSkgIWRlZmF1bHQ7XG4kc2NyZWVuLXNtLW1heDogICAgICAgICAgICAgICgkc2NyZWVuLW1kLW1pbiAtIDEpICFkZWZhdWx0O1xuJHNjcmVlbi1tZC1tYXg6ICAgICAgICAgICAgICAoJHNjcmVlbi1sZy1taW4gLSAxKSAhZGVmYXVsdDtcblxuXG4vLz09IEdyaWQgc3lzdGVtXG4vL1xuLy8jIyBEZWZpbmUgeW91ciBjdXN0b20gcmVzcG9uc2l2ZSBncmlkLlxuXG4vLyoqIE51bWJlciBvZiBjb2x1bW5zIGluIHRoZSBncmlkLlxuJGdyaWQtY29sdW1uczogICAgICAgICAgICAgIDEyICFkZWZhdWx0O1xuLy8qKiBQYWRkaW5nIGJldHdlZW4gY29sdW1ucy4gR2V0cyBkaXZpZGVkIGluIGhhbGYgZm9yIHRoZSBsZWZ0IGFuZCByaWdodC5cbiRncmlkLWd1dHRlci13aWR0aDogICAgICAgICAzMHB4ICFkZWZhdWx0O1xuLy8gTmF2YmFyIGNvbGxhcHNlXG4vLyoqIFBvaW50IGF0IHdoaWNoIHRoZSBuYXZiYXIgYmVjb21lcyB1bmNvbGxhcHNlZC5cbiRncmlkLWZsb2F0LWJyZWFrcG9pbnQ6ICAgICAkc2NyZWVuLXNtLW1pbiAhZGVmYXVsdDtcbi8vKiogUG9pbnQgYXQgd2hpY2ggdGhlIG5hdmJhciBiZWdpbnMgY29sbGFwc2luZy5cbiRncmlkLWZsb2F0LWJyZWFrcG9pbnQtbWF4OiAoJGdyaWQtZmxvYXQtYnJlYWtwb2ludCAtIDEpICFkZWZhdWx0O1xuXG5cbi8vPT0gQ29udGFpbmVyIHNpemVzXG4vL1xuLy8jIyBEZWZpbmUgdGhlIG1heGltdW0gd2lkdGggb2YgYC5jb250YWluZXJgIGZvciBkaWZmZXJlbnQgc2NyZWVuIHNpemVzLlxuXG4vLyBTbWFsbCBzY3JlZW4gLyB0YWJsZXRcbiRjb250YWluZXItdGFibGV0OiAgICAgICAgICAgICAoNzIwcHggKyAkZ3JpZC1ndXR0ZXItd2lkdGgpICFkZWZhdWx0O1xuLy8qKiBGb3IgYCRzY3JlZW4tc20tbWluYCBhbmQgdXAuXG4kY29udGFpbmVyLXNtOiAgICAgICAgICAgICAgICAgJGNvbnRhaW5lci10YWJsZXQgIWRlZmF1bHQ7XG5cbi8vIE1lZGl1bSBzY3JlZW4gLyBkZXNrdG9wXG4kY29udGFpbmVyLWRlc2t0b3A6ICAgICAgICAgICAgKDk0MHB4ICsgJGdyaWQtZ3V0dGVyLXdpZHRoKSAhZGVmYXVsdDtcbi8vKiogRm9yIGAkc2NyZWVuLW1kLW1pbmAgYW5kIHVwLlxuJGNvbnRhaW5lci1tZDogICAgICAgICAgICAgICAgICRjb250YWluZXItZGVza3RvcCAhZGVmYXVsdDtcblxuLy8gTGFyZ2Ugc2NyZWVuIC8gd2lkZSBkZXNrdG9wXG4kY29udGFpbmVyLWxhcmdlLWRlc2t0b3A6ICAgICAgKDExNDBweCArICRncmlkLWd1dHRlci13aWR0aCkgIWRlZmF1bHQ7XG4vLyoqIEZvciBgJHNjcmVlbi1sZy1taW5gIGFuZCB1cC5cbiRjb250YWluZXItbGc6ICAgICAgICAgICAgICAgICAkY29udGFpbmVyLWxhcmdlLWRlc2t0b3AgIWRlZmF1bHQ7XG5cblxuLy89PSBOYXZiYXJcbi8vXG4vLyMjXG5cbi8vIEJhc2ljcyBvZiBhIG5hdmJhclxuJG5hdmJhci1oZWlnaHQ6ICAgICAgICAgICAgICAgICAgICA1MHB4ICFkZWZhdWx0O1xuJG5hdmJhci1tYXJnaW4tYm90dG9tOiAgICAgICAgICAgICAkbGluZS1oZWlnaHQtY29tcHV0ZWQgIWRlZmF1bHQ7XG4kbmF2YmFyLWJvcmRlci1yYWRpdXM6ICAgICAgICAgICAgICRib3JkZXItcmFkaXVzLWJhc2UgIWRlZmF1bHQ7XG4kbmF2YmFyLXBhZGRpbmctaG9yaXpvbnRhbDogICAgICAgIGZsb29yKCgkZ3JpZC1ndXR0ZXItd2lkdGggLyAyKSkgIWRlZmF1bHQ7XG4kbmF2YmFyLXBhZGRpbmctdmVydGljYWw6ICAgICAgICAgICgoJG5hdmJhci1oZWlnaHQgLSAkbGluZS1oZWlnaHQtY29tcHV0ZWQpIC8gMikgIWRlZmF1bHQ7XG4kbmF2YmFyLWNvbGxhcHNlLW1heC1oZWlnaHQ6ICAgICAgIDM0MHB4ICFkZWZhdWx0O1xuXG4kbmF2YmFyLWRlZmF1bHQtY29sb3I6ICAgICAgICAgICAgICM3NzcgIWRlZmF1bHQ7XG4kbmF2YmFyLWRlZmF1bHQtYmc6ICAgICAgICAgICAgICAgICNmOGY4ZjggIWRlZmF1bHQ7XG4kbmF2YmFyLWRlZmF1bHQtYm9yZGVyOiAgICAgICAgICAgIGRhcmtlbigkbmF2YmFyLWRlZmF1bHQtYmcsIDYuNSUpICFkZWZhdWx0O1xuXG4vLyBOYXZiYXIgbGlua3NcbiRuYXZiYXItZGVmYXVsdC1saW5rLWNvbG9yOiAgICAgICAgICAgICAgICAjNzc3ICFkZWZhdWx0O1xuJG5hdmJhci1kZWZhdWx0LWxpbmstaG92ZXItY29sb3I6ICAgICAgICAgICMzMzMgIWRlZmF1bHQ7XG4kbmF2YmFyLWRlZmF1bHQtbGluay1ob3Zlci1iZzogICAgICAgICAgICAgdHJhbnNwYXJlbnQgIWRlZmF1bHQ7XG4kbmF2YmFyLWRlZmF1bHQtbGluay1hY3RpdmUtY29sb3I6ICAgICAgICAgIzU1NSAhZGVmYXVsdDtcbiRuYXZiYXItZGVmYXVsdC1saW5rLWFjdGl2ZS1iZzogICAgICAgICAgICBkYXJrZW4oJG5hdmJhci1kZWZhdWx0LWJnLCA2LjUlKSAhZGVmYXVsdDtcbiRuYXZiYXItZGVmYXVsdC1saW5rLWRpc2FibGVkLWNvbG9yOiAgICAgICAjY2NjICFkZWZhdWx0O1xuJG5hdmJhci1kZWZhdWx0LWxpbmstZGlzYWJsZWQtYmc6ICAgICAgICAgIHRyYW5zcGFyZW50ICFkZWZhdWx0O1xuXG4vLyBOYXZiYXIgYnJhbmQgbGFiZWxcbiRuYXZiYXItZGVmYXVsdC1icmFuZC1jb2xvcjogICAgICAgICAgICAgICAkbmF2YmFyLWRlZmF1bHQtbGluay1jb2xvciAhZGVmYXVsdDtcbiRuYXZiYXItZGVmYXVsdC1icmFuZC1ob3Zlci1jb2xvcjogICAgICAgICBkYXJrZW4oJG5hdmJhci1kZWZhdWx0LWJyYW5kLWNvbG9yLCAxMCUpICFkZWZhdWx0O1xuJG5hdmJhci1kZWZhdWx0LWJyYW5kLWhvdmVyLWJnOiAgICAgICAgICAgIHRyYW5zcGFyZW50ICFkZWZhdWx0O1xuXG4vLyBOYXZiYXIgdG9nZ2xlXG4kbmF2YmFyLWRlZmF1bHQtdG9nZ2xlLWhvdmVyLWJnOiAgICAgICAgICAgI2RkZCAhZGVmYXVsdDtcbiRuYXZiYXItZGVmYXVsdC10b2dnbGUtaWNvbi1iYXItYmc6ICAgICAgICAjODg4ICFkZWZhdWx0O1xuJG5hdmJhci1kZWZhdWx0LXRvZ2dsZS1ib3JkZXItY29sb3I6ICAgICAgICNkZGQgIWRlZmF1bHQ7XG5cblxuLy89PT0gSW52ZXJ0ZWQgbmF2YmFyXG4vLyBSZXNldCBpbnZlcnRlZCBuYXZiYXIgYmFzaWNzXG4kbmF2YmFyLWludmVyc2UtY29sb3I6ICAgICAgICAgICAgICAgICAgICAgIGxpZ2h0ZW4oJGdyYXktbGlnaHQsIDE1JSkgIWRlZmF1bHQ7XG4kbmF2YmFyLWludmVyc2UtYmc6ICAgICAgICAgICAgICAgICAgICAgICAgICMyMjIgIWRlZmF1bHQ7XG4kbmF2YmFyLWludmVyc2UtYm9yZGVyOiAgICAgICAgICAgICAgICAgICAgIGRhcmtlbigkbmF2YmFyLWludmVyc2UtYmcsIDEwJSkgIWRlZmF1bHQ7XG5cbi8vIEludmVydGVkIG5hdmJhciBsaW5rc1xuJG5hdmJhci1pbnZlcnNlLWxpbmstY29sb3I6ICAgICAgICAgICAgICAgICBsaWdodGVuKCRncmF5LWxpZ2h0LCAxNSUpICFkZWZhdWx0O1xuJG5hdmJhci1pbnZlcnNlLWxpbmstaG92ZXItY29sb3I6ICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuJG5hdmJhci1pbnZlcnNlLWxpbmstaG92ZXItYmc6ICAgICAgICAgICAgICB0cmFuc3BhcmVudCAhZGVmYXVsdDtcbiRuYXZiYXItaW52ZXJzZS1saW5rLWFjdGl2ZS1jb2xvcjogICAgICAgICAgJG5hdmJhci1pbnZlcnNlLWxpbmstaG92ZXItY29sb3IgIWRlZmF1bHQ7XG4kbmF2YmFyLWludmVyc2UtbGluay1hY3RpdmUtYmc6ICAgICAgICAgICAgIGRhcmtlbigkbmF2YmFyLWludmVyc2UtYmcsIDEwJSkgIWRlZmF1bHQ7XG4kbmF2YmFyLWludmVyc2UtbGluay1kaXNhYmxlZC1jb2xvcjogICAgICAgICM0NDQgIWRlZmF1bHQ7XG4kbmF2YmFyLWludmVyc2UtbGluay1kaXNhYmxlZC1iZzogICAgICAgICAgIHRyYW5zcGFyZW50ICFkZWZhdWx0O1xuXG4vLyBJbnZlcnRlZCBuYXZiYXIgYnJhbmQgbGFiZWxcbiRuYXZiYXItaW52ZXJzZS1icmFuZC1jb2xvcjogICAgICAgICAgICAgICAgJG5hdmJhci1pbnZlcnNlLWxpbmstY29sb3IgIWRlZmF1bHQ7XG4kbmF2YmFyLWludmVyc2UtYnJhbmQtaG92ZXItY29sb3I6ICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kbmF2YmFyLWludmVyc2UtYnJhbmQtaG92ZXItYmc6ICAgICAgICAgICAgIHRyYW5zcGFyZW50ICFkZWZhdWx0O1xuXG4vLyBJbnZlcnRlZCBuYXZiYXIgdG9nZ2xlXG4kbmF2YmFyLWludmVyc2UtdG9nZ2xlLWhvdmVyLWJnOiAgICAgICAgICAgICMzMzMgIWRlZmF1bHQ7XG4kbmF2YmFyLWludmVyc2UtdG9nZ2xlLWljb24tYmFyLWJnOiAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kbmF2YmFyLWludmVyc2UtdG9nZ2xlLWJvcmRlci1jb2xvcjogICAgICAgICMzMzMgIWRlZmF1bHQ7XG5cblxuLy89PSBOYXZzXG4vL1xuLy8jI1xuXG4vLz09PSBTaGFyZWQgbmF2IHN0eWxlc1xuJG5hdi1saW5rLXBhZGRpbmc6ICAgICAgICAgICAgICAgICAgICAgICAgICAxMHB4IDE1cHggIWRlZmF1bHQ7XG4kbmF2LWxpbmstaG92ZXItYmc6ICAgICAgICAgICAgICAgICAgICAgICAgICRncmF5LWxpZ2h0ZXIgIWRlZmF1bHQ7XG5cbiRuYXYtZGlzYWJsZWQtbGluay1jb2xvcjogICAgICAgICAgICAgICAgICAgJGdyYXktbGlnaHQgIWRlZmF1bHQ7XG4kbmF2LWRpc2FibGVkLWxpbmstaG92ZXItY29sb3I6ICAgICAgICAgICAgICRncmF5LWxpZ2h0ICFkZWZhdWx0O1xuXG4vLz09IFRhYnNcbiRuYXYtdGFicy1ib3JkZXItY29sb3I6ICAgICAgICAgICAgICAgICAgICAgI2RkZCAhZGVmYXVsdDtcblxuJG5hdi10YWJzLWxpbmstaG92ZXItYm9yZGVyLWNvbG9yOiAgICAgICAgICAkZ3JheS1saWdodGVyICFkZWZhdWx0O1xuXG4kbmF2LXRhYnMtYWN0aXZlLWxpbmstaG92ZXItYmc6ICAgICAgICAgICAgICRib2R5LWJnICFkZWZhdWx0O1xuJG5hdi10YWJzLWFjdGl2ZS1saW5rLWhvdmVyLWNvbG9yOiAgICAgICAgICAkZ3JheSAhZGVmYXVsdDtcbiRuYXYtdGFicy1hY3RpdmUtbGluay1ob3Zlci1ib3JkZXItY29sb3I6ICAgI2RkZCAhZGVmYXVsdDtcblxuJG5hdi10YWJzLWp1c3RpZmllZC1saW5rLWJvcmRlci1jb2xvcjogICAgICAgICAgICAjZGRkICFkZWZhdWx0O1xuJG5hdi10YWJzLWp1c3RpZmllZC1hY3RpdmUtbGluay1ib3JkZXItY29sb3I6ICAgICAkYm9keS1iZyAhZGVmYXVsdDtcblxuLy89PSBQaWxsc1xuJG5hdi1waWxscy1ib3JkZXItcmFkaXVzOiAgICAgICAgICAgICAgICAgICAkYm9yZGVyLXJhZGl1cy1iYXNlICFkZWZhdWx0O1xuJG5hdi1waWxscy1hY3RpdmUtbGluay1ob3Zlci1iZzogICAgICAgICAgICAkY29tcG9uZW50LWFjdGl2ZS1iZyAhZGVmYXVsdDtcbiRuYXYtcGlsbHMtYWN0aXZlLWxpbmstaG92ZXItY29sb3I6ICAgICAgICAgJGNvbXBvbmVudC1hY3RpdmUtY29sb3IgIWRlZmF1bHQ7XG5cblxuLy89PSBQYWdpbmF0aW9uXG4vL1xuLy8jI1xuXG4kcGFnaW5hdGlvbi1jb2xvcjogICAgICAgICAgICAgICAgICAgICAkbGluay1jb2xvciAhZGVmYXVsdDtcbiRwYWdpbmF0aW9uLWJnOiAgICAgICAgICAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kcGFnaW5hdGlvbi1ib3JkZXI6ICAgICAgICAgICAgICAgICAgICAjZGRkICFkZWZhdWx0O1xuXG4kcGFnaW5hdGlvbi1ob3Zlci1jb2xvcjogICAgICAgICAgICAgICAkbGluay1ob3Zlci1jb2xvciAhZGVmYXVsdDtcbiRwYWdpbmF0aW9uLWhvdmVyLWJnOiAgICAgICAgICAgICAgICAgICRncmF5LWxpZ2h0ZXIgIWRlZmF1bHQ7XG4kcGFnaW5hdGlvbi1ob3Zlci1ib3JkZXI6ICAgICAgICAgICAgICAjZGRkICFkZWZhdWx0O1xuXG4kcGFnaW5hdGlvbi1hY3RpdmUtY29sb3I6ICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuJHBhZ2luYXRpb24tYWN0aXZlLWJnOiAgICAgICAgICAgICAgICAgJGJyYW5kLXByaW1hcnkgIWRlZmF1bHQ7XG4kcGFnaW5hdGlvbi1hY3RpdmUtYm9yZGVyOiAgICAgICAgICAgICAkYnJhbmQtcHJpbWFyeSAhZGVmYXVsdDtcblxuJHBhZ2luYXRpb24tZGlzYWJsZWQtY29sb3I6ICAgICAgICAgICAgJGdyYXktbGlnaHQgIWRlZmF1bHQ7XG4kcGFnaW5hdGlvbi1kaXNhYmxlZC1iZzogICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuJHBhZ2luYXRpb24tZGlzYWJsZWQtYm9yZGVyOiAgICAgICAgICAgI2RkZCAhZGVmYXVsdDtcblxuXG4vLz09IFBhZ2VyXG4vL1xuLy8jI1xuXG4kcGFnZXItYmc6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcGFnaW5hdGlvbi1iZyAhZGVmYXVsdDtcbiRwYWdlci1ib3JkZXI6ICAgICAgICAgICAgICAgICAgICAgICAgICRwYWdpbmF0aW9uLWJvcmRlciAhZGVmYXVsdDtcbiRwYWdlci1ib3JkZXItcmFkaXVzOiAgICAgICAgICAgICAgICAgIDE1cHggIWRlZmF1bHQ7XG5cbiRwYWdlci1ob3Zlci1iZzogICAgICAgICAgICAgICAgICAgICAgICRwYWdpbmF0aW9uLWhvdmVyLWJnICFkZWZhdWx0O1xuXG4kcGFnZXItYWN0aXZlLWJnOiAgICAgICAgICAgICAgICAgICAgICAkcGFnaW5hdGlvbi1hY3RpdmUtYmcgIWRlZmF1bHQ7XG4kcGFnZXItYWN0aXZlLWNvbG9yOiAgICAgICAgICAgICAgICAgICAkcGFnaW5hdGlvbi1hY3RpdmUtY29sb3IgIWRlZmF1bHQ7XG5cbiRwYWdlci1kaXNhYmxlZC1jb2xvcjogICAgICAgICAgICAgICAgICRwYWdpbmF0aW9uLWRpc2FibGVkLWNvbG9yICFkZWZhdWx0O1xuXG5cbi8vPT0gSnVtYm90cm9uXG4vL1xuLy8jI1xuXG4kanVtYm90cm9uLXBhZGRpbmc6ICAgICAgICAgICAgICAzMHB4ICFkZWZhdWx0O1xuJGp1bWJvdHJvbi1jb2xvcjogICAgICAgICAgICAgICAgaW5oZXJpdCAhZGVmYXVsdDtcbiRqdW1ib3Ryb24tYmc6ICAgICAgICAgICAgICAgICAgICRncmF5LWxpZ2h0ZXIgIWRlZmF1bHQ7XG4kanVtYm90cm9uLWhlYWRpbmctY29sb3I6ICAgICAgICBpbmhlcml0ICFkZWZhdWx0O1xuJGp1bWJvdHJvbi1mb250LXNpemU6ICAgICAgICAgICAgY2VpbCgoJGZvbnQtc2l6ZS1iYXNlICogMS41KSkgIWRlZmF1bHQ7XG4kanVtYm90cm9uLWhlYWRpbmctZm9udC1zaXplOiAgICBjZWlsKCgkZm9udC1zaXplLWJhc2UgKiA0LjUpKSAhZGVmYXVsdDtcblxuXG4vLz09IEZvcm0gc3RhdGVzIGFuZCBhbGVydHNcbi8vXG4vLyMjIERlZmluZSBjb2xvcnMgZm9yIGZvcm0gZmVlZGJhY2sgc3RhdGVzIGFuZCwgYnkgZGVmYXVsdCwgYWxlcnRzLlxuXG4kc3RhdGUtc3VjY2Vzcy10ZXh0OiAgICAgICAgICAgICAjM2M3NjNkICFkZWZhdWx0O1xuJHN0YXRlLXN1Y2Nlc3MtYmc6ICAgICAgICAgICAgICAgI2RmZjBkOCAhZGVmYXVsdDtcbiRzdGF0ZS1zdWNjZXNzLWJvcmRlcjogICAgICAgICAgIGRhcmtlbihhZGp1c3QtaHVlKCRzdGF0ZS1zdWNjZXNzLWJnLCAtMTApLCA1JSkgIWRlZmF1bHQ7XG5cbiRzdGF0ZS1pbmZvLXRleHQ6ICAgICAgICAgICAgICAgICMzMTcwOGYgIWRlZmF1bHQ7XG4kc3RhdGUtaW5mby1iZzogICAgICAgICAgICAgICAgICAjZDllZGY3ICFkZWZhdWx0O1xuJHN0YXRlLWluZm8tYm9yZGVyOiAgICAgICAgICAgICAgZGFya2VuKGFkanVzdC1odWUoJHN0YXRlLWluZm8tYmcsIC0xMCksIDclKSAhZGVmYXVsdDtcblxuJHN0YXRlLXdhcm5pbmctdGV4dDogICAgICAgICAgICAgIzhhNmQzYiAhZGVmYXVsdDtcbiRzdGF0ZS13YXJuaW5nLWJnOiAgICAgICAgICAgICAgICNmY2Y4ZTMgIWRlZmF1bHQ7XG4kc3RhdGUtd2FybmluZy1ib3JkZXI6ICAgICAgICAgICBkYXJrZW4oYWRqdXN0LWh1ZSgkc3RhdGUtd2FybmluZy1iZywgLTEwKSwgNSUpICFkZWZhdWx0O1xuXG4kc3RhdGUtZGFuZ2VyLXRleHQ6ICAgICAgICAgICAgICAjYTk0NDQyICFkZWZhdWx0O1xuJHN0YXRlLWRhbmdlci1iZzogICAgICAgICAgICAgICAgI2YyZGVkZSAhZGVmYXVsdDtcbiRzdGF0ZS1kYW5nZXItYm9yZGVyOiAgICAgICAgICAgIGRhcmtlbihhZGp1c3QtaHVlKCRzdGF0ZS1kYW5nZXItYmcsIC0xMCksIDUlKSAhZGVmYXVsdDtcblxuXG4vLz09IFRvb2x0aXBzXG4vL1xuLy8jI1xuXG4vLyoqIFRvb2x0aXAgbWF4IHdpZHRoXG4kdG9vbHRpcC1tYXgtd2lkdGg6ICAgICAgICAgICAyMDBweCAhZGVmYXVsdDtcbi8vKiogVG9vbHRpcCB0ZXh0IGNvbG9yXG4kdG9vbHRpcC1jb2xvcjogICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuLy8qKiBUb29sdGlwIGJhY2tncm91bmQgY29sb3JcbiR0b29sdGlwLWJnOiAgICAgICAgICAgICAgICAgICMwMDAgIWRlZmF1bHQ7XG4kdG9vbHRpcC1vcGFjaXR5OiAgICAgICAgICAgICAuOSAhZGVmYXVsdDtcblxuLy8qKiBUb29sdGlwIGFycm93IHdpZHRoXG4kdG9vbHRpcC1hcnJvdy13aWR0aDogICAgICAgICA1cHggIWRlZmF1bHQ7XG4vLyoqIFRvb2x0aXAgYXJyb3cgY29sb3JcbiR0b29sdGlwLWFycm93LWNvbG9yOiAgICAgICAgICR0b29sdGlwLWJnICFkZWZhdWx0O1xuXG5cbi8vPT0gUG9wb3ZlcnNcbi8vXG4vLyMjXG5cbi8vKiogUG9wb3ZlciBib2R5IGJhY2tncm91bmQgY29sb3JcbiRwb3BvdmVyLWJnOiAgICAgICAgICAgICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbi8vKiogUG9wb3ZlciBtYXhpbXVtIHdpZHRoXG4kcG9wb3Zlci1tYXgtd2lkdGg6ICAgICAgICAgICAgICAgICAgIDI3NnB4ICFkZWZhdWx0O1xuLy8qKiBQb3BvdmVyIGJvcmRlciBjb2xvclxuJHBvcG92ZXItYm9yZGVyLWNvbG9yOiAgICAgICAgICAgICAgICByZ2JhKDAsMCwwLC4yKSAhZGVmYXVsdDtcbi8vKiogUG9wb3ZlciBmYWxsYmFjayBib3JkZXIgY29sb3JcbiRwb3BvdmVyLWZhbGxiYWNrLWJvcmRlci1jb2xvcjogICAgICAgI2NjYyAhZGVmYXVsdDtcblxuLy8qKiBQb3BvdmVyIHRpdGxlIGJhY2tncm91bmQgY29sb3JcbiRwb3BvdmVyLXRpdGxlLWJnOiAgICAgICAgICAgICAgICAgICAgZGFya2VuKCRwb3BvdmVyLWJnLCAzJSkgIWRlZmF1bHQ7XG5cbi8vKiogUG9wb3ZlciBhcnJvdyB3aWR0aFxuJHBvcG92ZXItYXJyb3ctd2lkdGg6ICAgICAgICAgICAgICAgICAxMHB4ICFkZWZhdWx0O1xuLy8qKiBQb3BvdmVyIGFycm93IGNvbG9yXG4kcG9wb3Zlci1hcnJvdy1jb2xvcjogICAgICAgICAgICAgICAgICRwb3BvdmVyLWJnICFkZWZhdWx0O1xuXG4vLyoqIFBvcG92ZXIgb3V0ZXIgYXJyb3cgd2lkdGhcbiRwb3BvdmVyLWFycm93LW91dGVyLXdpZHRoOiAgICAgICAgICAgKCRwb3BvdmVyLWFycm93LXdpZHRoICsgMSkgIWRlZmF1bHQ7XG4vLyoqIFBvcG92ZXIgb3V0ZXIgYXJyb3cgY29sb3JcbiRwb3BvdmVyLWFycm93LW91dGVyLWNvbG9yOiAgICAgICAgICAgZmFkZV9pbigkcG9wb3Zlci1ib3JkZXItY29sb3IsIDAuMDUpICFkZWZhdWx0O1xuLy8qKiBQb3BvdmVyIG91dGVyIGFycm93IGZhbGxiYWNrIGNvbG9yXG4kcG9wb3Zlci1hcnJvdy1vdXRlci1mYWxsYmFjay1jb2xvcjogIGRhcmtlbigkcG9wb3Zlci1mYWxsYmFjay1ib3JkZXItY29sb3IsIDIwJSkgIWRlZmF1bHQ7XG5cblxuLy89PSBMYWJlbHNcbi8vXG4vLyMjXG5cbi8vKiogRGVmYXVsdCBsYWJlbCBiYWNrZ3JvdW5kIGNvbG9yXG4kbGFiZWwtZGVmYXVsdC1iZzogICAgICAgICAgICAkZ3JheS1saWdodCAhZGVmYXVsdDtcbi8vKiogUHJpbWFyeSBsYWJlbCBiYWNrZ3JvdW5kIGNvbG9yXG4kbGFiZWwtcHJpbWFyeS1iZzogICAgICAgICAgICAkYnJhbmQtcHJpbWFyeSAhZGVmYXVsdDtcbi8vKiogU3VjY2VzcyBsYWJlbCBiYWNrZ3JvdW5kIGNvbG9yXG4kbGFiZWwtc3VjY2Vzcy1iZzogICAgICAgICAgICAkYnJhbmQtc3VjY2VzcyAhZGVmYXVsdDtcbi8vKiogSW5mbyBsYWJlbCBiYWNrZ3JvdW5kIGNvbG9yXG4kbGFiZWwtaW5mby1iZzogICAgICAgICAgICAgICAkYnJhbmQtaW5mbyAhZGVmYXVsdDtcbi8vKiogV2FybmluZyBsYWJlbCBiYWNrZ3JvdW5kIGNvbG9yXG4kbGFiZWwtd2FybmluZy1iZzogICAgICAgICAgICAkYnJhbmQtd2FybmluZyAhZGVmYXVsdDtcbi8vKiogRGFuZ2VyIGxhYmVsIGJhY2tncm91bmQgY29sb3JcbiRsYWJlbC1kYW5nZXItYmc6ICAgICAgICAgICAgICRicmFuZC1kYW5nZXIgIWRlZmF1bHQ7XG5cbi8vKiogRGVmYXVsdCBsYWJlbCB0ZXh0IGNvbG9yXG4kbGFiZWwtY29sb3I6ICAgICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuLy8qKiBEZWZhdWx0IHRleHQgY29sb3Igb2YgYSBsaW5rZWQgbGFiZWxcbiRsYWJlbC1saW5rLWhvdmVyLWNvbG9yOiAgICAgICNmZmYgIWRlZmF1bHQ7XG5cblxuLy89PSBNb2RhbHNcbi8vXG4vLyMjXG5cbi8vKiogUGFkZGluZyBhcHBsaWVkIHRvIHRoZSBtb2RhbCBib2R5XG4kbW9kYWwtaW5uZXItcGFkZGluZzogICAgICAgICAxNXB4ICFkZWZhdWx0O1xuXG4vLyoqIFBhZGRpbmcgYXBwbGllZCB0byB0aGUgbW9kYWwgdGl0bGVcbiRtb2RhbC10aXRsZS1wYWRkaW5nOiAgICAgICAgIDE1cHggIWRlZmF1bHQ7XG4vLyoqIE1vZGFsIHRpdGxlIGxpbmUtaGVpZ2h0XG4kbW9kYWwtdGl0bGUtbGluZS1oZWlnaHQ6ICAgICAkbGluZS1oZWlnaHQtYmFzZSAhZGVmYXVsdDtcblxuLy8qKiBCYWNrZ3JvdW5kIGNvbG9yIG9mIG1vZGFsIGNvbnRlbnQgYXJlYVxuJG1vZGFsLWNvbnRlbnQtYmc6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuLy8qKiBNb2RhbCBjb250ZW50IGJvcmRlciBjb2xvclxuJG1vZGFsLWNvbnRlbnQtYm9yZGVyLWNvbG9yOiAgICAgICAgICAgICAgICAgICByZ2JhKDAsMCwwLC4yKSAhZGVmYXVsdDtcbi8vKiogTW9kYWwgY29udGVudCBib3JkZXIgY29sb3IgKipmb3IgSUU4KipcbiRtb2RhbC1jb250ZW50LWZhbGxiYWNrLWJvcmRlci1jb2xvcjogICAgICAgICAgIzk5OSAhZGVmYXVsdDtcblxuLy8qKiBNb2RhbCBiYWNrZHJvcCBiYWNrZ3JvdW5kIGNvbG9yXG4kbW9kYWwtYmFja2Ryb3AtYmc6ICAgICAgICAgICAjMDAwICFkZWZhdWx0O1xuLy8qKiBNb2RhbCBiYWNrZHJvcCBvcGFjaXR5XG4kbW9kYWwtYmFja2Ryb3Atb3BhY2l0eTogICAgICAuNSAhZGVmYXVsdDtcbi8vKiogTW9kYWwgaGVhZGVyIGJvcmRlciBjb2xvclxuJG1vZGFsLWhlYWRlci1ib3JkZXItY29sb3I6ICAgI2U1ZTVlNSAhZGVmYXVsdDtcbi8vKiogTW9kYWwgZm9vdGVyIGJvcmRlciBjb2xvclxuJG1vZGFsLWZvb3Rlci1ib3JkZXItY29sb3I6ICAgJG1vZGFsLWhlYWRlci1ib3JkZXItY29sb3IgIWRlZmF1bHQ7XG5cbiRtb2RhbC1sZzogICAgICAgICAgICAgICAgICAgIDkwMHB4ICFkZWZhdWx0O1xuJG1vZGFsLW1kOiAgICAgICAgICAgICAgICAgICAgNjAwcHggIWRlZmF1bHQ7XG4kbW9kYWwtc206ICAgICAgICAgICAgICAgICAgICAzMDBweCAhZGVmYXVsdDtcblxuXG4vLz09IEFsZXJ0c1xuLy9cbi8vIyMgRGVmaW5lIGFsZXJ0IGNvbG9ycywgYm9yZGVyIHJhZGl1cywgYW5kIHBhZGRpbmcuXG5cbiRhbGVydC1wYWRkaW5nOiAgICAgICAgICAgICAgIDE1cHggIWRlZmF1bHQ7XG4kYWxlcnQtYm9yZGVyLXJhZGl1czogICAgICAgICAkYm9yZGVyLXJhZGl1cy1iYXNlICFkZWZhdWx0O1xuJGFsZXJ0LWxpbmstZm9udC13ZWlnaHQ6ICAgICAgYm9sZCAhZGVmYXVsdDtcblxuJGFsZXJ0LXN1Y2Nlc3MtYmc6ICAgICAgICAgICAgJHN0YXRlLXN1Y2Nlc3MtYmcgIWRlZmF1bHQ7XG4kYWxlcnQtc3VjY2Vzcy10ZXh0OiAgICAgICAgICAkc3RhdGUtc3VjY2Vzcy10ZXh0ICFkZWZhdWx0O1xuJGFsZXJ0LXN1Y2Nlc3MtYm9yZGVyOiAgICAgICAgJHN0YXRlLXN1Y2Nlc3MtYm9yZGVyICFkZWZhdWx0O1xuXG4kYWxlcnQtaW5mby1iZzogICAgICAgICAgICAgICAkc3RhdGUtaW5mby1iZyAhZGVmYXVsdDtcbiRhbGVydC1pbmZvLXRleHQ6ICAgICAgICAgICAgICRzdGF0ZS1pbmZvLXRleHQgIWRlZmF1bHQ7XG4kYWxlcnQtaW5mby1ib3JkZXI6ICAgICAgICAgICAkc3RhdGUtaW5mby1ib3JkZXIgIWRlZmF1bHQ7XG5cbiRhbGVydC13YXJuaW5nLWJnOiAgICAgICAgICAgICRzdGF0ZS13YXJuaW5nLWJnICFkZWZhdWx0O1xuJGFsZXJ0LXdhcm5pbmctdGV4dDogICAgICAgICAgJHN0YXRlLXdhcm5pbmctdGV4dCAhZGVmYXVsdDtcbiRhbGVydC13YXJuaW5nLWJvcmRlcjogICAgICAgICRzdGF0ZS13YXJuaW5nLWJvcmRlciAhZGVmYXVsdDtcblxuJGFsZXJ0LWRhbmdlci1iZzogICAgICAgICAgICAgJHN0YXRlLWRhbmdlci1iZyAhZGVmYXVsdDtcbiRhbGVydC1kYW5nZXItdGV4dDogICAgICAgICAgICRzdGF0ZS1kYW5nZXItdGV4dCAhZGVmYXVsdDtcbiRhbGVydC1kYW5nZXItYm9yZGVyOiAgICAgICAgICRzdGF0ZS1kYW5nZXItYm9yZGVyICFkZWZhdWx0O1xuXG5cbi8vPT0gUHJvZ3Jlc3MgYmFyc1xuLy9cbi8vIyNcblxuLy8qKiBCYWNrZ3JvdW5kIGNvbG9yIG9mIHRoZSB3aG9sZSBwcm9ncmVzcyBjb21wb25lbnRcbiRwcm9ncmVzcy1iZzogICAgICAgICAgICAgICAgICNmNWY1ZjUgIWRlZmF1bHQ7XG4vLyoqIFByb2dyZXNzIGJhciB0ZXh0IGNvbG9yXG4kcHJvZ3Jlc3MtYmFyLWNvbG9yOiAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuLy8qKiBWYXJpYWJsZSBmb3Igc2V0dGluZyByb3VuZGVkIGNvcm5lcnMgb24gcHJvZ3Jlc3MgYmFyLlxuJHByb2dyZXNzLWJvcmRlci1yYWRpdXM6ICAgICAgJGJvcmRlci1yYWRpdXMtYmFzZSAhZGVmYXVsdDtcblxuLy8qKiBEZWZhdWx0IHByb2dyZXNzIGJhciBjb2xvclxuJHByb2dyZXNzLWJhci1iZzogICAgICAgICAgICAgJGJyYW5kLXByaW1hcnkgIWRlZmF1bHQ7XG4vLyoqIFN1Y2Nlc3MgcHJvZ3Jlc3MgYmFyIGNvbG9yXG4kcHJvZ3Jlc3MtYmFyLXN1Y2Nlc3MtYmc6ICAgICAkYnJhbmQtc3VjY2VzcyAhZGVmYXVsdDtcbi8vKiogV2FybmluZyBwcm9ncmVzcyBiYXIgY29sb3JcbiRwcm9ncmVzcy1iYXItd2FybmluZy1iZzogICAgICRicmFuZC13YXJuaW5nICFkZWZhdWx0O1xuLy8qKiBEYW5nZXIgcHJvZ3Jlc3MgYmFyIGNvbG9yXG4kcHJvZ3Jlc3MtYmFyLWRhbmdlci1iZzogICAgICAkYnJhbmQtZGFuZ2VyICFkZWZhdWx0O1xuLy8qKiBJbmZvIHByb2dyZXNzIGJhciBjb2xvclxuJHByb2dyZXNzLWJhci1pbmZvLWJnOiAgICAgICAgJGJyYW5kLWluZm8gIWRlZmF1bHQ7XG5cblxuLy89PSBMaXN0IGdyb3VwXG4vL1xuLy8jI1xuXG4vLyoqIEJhY2tncm91bmQgY29sb3Igb24gYC5saXN0LWdyb3VwLWl0ZW1gXG4kbGlzdC1ncm91cC1iZzogICAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4vLyoqIGAubGlzdC1ncm91cC1pdGVtYCBib3JkZXIgY29sb3JcbiRsaXN0LWdyb3VwLWJvcmRlcjogICAgICAgICAgICAgI2RkZCAhZGVmYXVsdDtcbi8vKiogTGlzdCBncm91cCBib3JkZXIgcmFkaXVzXG4kbGlzdC1ncm91cC1ib3JkZXItcmFkaXVzOiAgICAgICRib3JkZXItcmFkaXVzLWJhc2UgIWRlZmF1bHQ7XG5cbi8vKiogQmFja2dyb3VuZCBjb2xvciBvZiBzaW5nbGUgbGlzdCBpdGVtcyBvbiBob3ZlclxuJGxpc3QtZ3JvdXAtaG92ZXItYmc6ICAgICAgICAgICAjZjVmNWY1ICFkZWZhdWx0O1xuLy8qKiBUZXh0IGNvbG9yIG9mIGFjdGl2ZSBsaXN0IGl0ZW1zXG4kbGlzdC1ncm91cC1hY3RpdmUtY29sb3I6ICAgICAgICRjb21wb25lbnQtYWN0aXZlLWNvbG9yICFkZWZhdWx0O1xuLy8qKiBCYWNrZ3JvdW5kIGNvbG9yIG9mIGFjdGl2ZSBsaXN0IGl0ZW1zXG4kbGlzdC1ncm91cC1hY3RpdmUtYmc6ICAgICAgICAgICRjb21wb25lbnQtYWN0aXZlLWJnICFkZWZhdWx0O1xuLy8qKiBCb3JkZXIgY29sb3Igb2YgYWN0aXZlIGxpc3QgZWxlbWVudHNcbiRsaXN0LWdyb3VwLWFjdGl2ZS1ib3JkZXI6ICAgICAgJGxpc3QtZ3JvdXAtYWN0aXZlLWJnICFkZWZhdWx0O1xuLy8qKiBUZXh0IGNvbG9yIGZvciBjb250ZW50IHdpdGhpbiBhY3RpdmUgbGlzdCBpdGVtc1xuJGxpc3QtZ3JvdXAtYWN0aXZlLXRleHQtY29sb3I6ICBsaWdodGVuKCRsaXN0LWdyb3VwLWFjdGl2ZS1iZywgNDAlKSAhZGVmYXVsdDtcblxuLy8qKiBUZXh0IGNvbG9yIG9mIGRpc2FibGVkIGxpc3QgaXRlbXNcbiRsaXN0LWdyb3VwLWRpc2FibGVkLWNvbG9yOiAgICAgICRncmF5LWxpZ2h0ICFkZWZhdWx0O1xuLy8qKiBCYWNrZ3JvdW5kIGNvbG9yIG9mIGRpc2FibGVkIGxpc3QgaXRlbXNcbiRsaXN0LWdyb3VwLWRpc2FibGVkLWJnOiAgICAgICAgICRncmF5LWxpZ2h0ZXIgIWRlZmF1bHQ7XG4vLyoqIFRleHQgY29sb3IgZm9yIGNvbnRlbnQgd2l0aGluIGRpc2FibGVkIGxpc3QgaXRlbXNcbiRsaXN0LWdyb3VwLWRpc2FibGVkLXRleHQtY29sb3I6ICRsaXN0LWdyb3VwLWRpc2FibGVkLWNvbG9yICFkZWZhdWx0O1xuXG4kbGlzdC1ncm91cC1saW5rLWNvbG9yOiAgICAgICAgICM1NTUgIWRlZmF1bHQ7XG4kbGlzdC1ncm91cC1saW5rLWhvdmVyLWNvbG9yOiAgICRsaXN0LWdyb3VwLWxpbmstY29sb3IgIWRlZmF1bHQ7XG4kbGlzdC1ncm91cC1saW5rLWhlYWRpbmctY29sb3I6ICMzMzMgIWRlZmF1bHQ7XG5cblxuLy89PSBQYW5lbHNcbi8vXG4vLyMjXG5cbiRwYW5lbC1iZzogICAgICAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kcGFuZWwtYm9keS1wYWRkaW5nOiAgICAgICAgICAxNXB4ICFkZWZhdWx0O1xuJHBhbmVsLWhlYWRpbmctcGFkZGluZzogICAgICAgMTBweCAxNXB4ICFkZWZhdWx0O1xuJHBhbmVsLWZvb3Rlci1wYWRkaW5nOiAgICAgICAgJHBhbmVsLWhlYWRpbmctcGFkZGluZyAhZGVmYXVsdDtcbiRwYW5lbC1ib3JkZXItcmFkaXVzOiAgICAgICAgICRib3JkZXItcmFkaXVzLWJhc2UgIWRlZmF1bHQ7XG5cbi8vKiogQm9yZGVyIGNvbG9yIGZvciBlbGVtZW50cyB3aXRoaW4gcGFuZWxzXG4kcGFuZWwtaW5uZXItYm9yZGVyOiAgICAgICAgICAjZGRkICFkZWZhdWx0O1xuJHBhbmVsLWZvb3Rlci1iZzogICAgICAgICAgICAgI2Y1ZjVmNSAhZGVmYXVsdDtcblxuJHBhbmVsLWRlZmF1bHQtdGV4dDogICAgICAgICAgJGdyYXktZGFyayAhZGVmYXVsdDtcbiRwYW5lbC1kZWZhdWx0LWJvcmRlcjogICAgICAgICNkZGQgIWRlZmF1bHQ7XG4kcGFuZWwtZGVmYXVsdC1oZWFkaW5nLWJnOiAgICAjZjVmNWY1ICFkZWZhdWx0O1xuXG4kcGFuZWwtcHJpbWFyeS10ZXh0OiAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuJHBhbmVsLXByaW1hcnktYm9yZGVyOiAgICAgICAgJGJyYW5kLXByaW1hcnkgIWRlZmF1bHQ7XG4kcGFuZWwtcHJpbWFyeS1oZWFkaW5nLWJnOiAgICAkYnJhbmQtcHJpbWFyeSAhZGVmYXVsdDtcblxuJHBhbmVsLXN1Y2Nlc3MtdGV4dDogICAgICAgICAgJHN0YXRlLXN1Y2Nlc3MtdGV4dCAhZGVmYXVsdDtcbiRwYW5lbC1zdWNjZXNzLWJvcmRlcjogICAgICAgICRzdGF0ZS1zdWNjZXNzLWJvcmRlciAhZGVmYXVsdDtcbiRwYW5lbC1zdWNjZXNzLWhlYWRpbmctYmc6ICAgICRzdGF0ZS1zdWNjZXNzLWJnICFkZWZhdWx0O1xuXG4kcGFuZWwtaW5mby10ZXh0OiAgICAgICAgICAgICAkc3RhdGUtaW5mby10ZXh0ICFkZWZhdWx0O1xuJHBhbmVsLWluZm8tYm9yZGVyOiAgICAgICAgICAgJHN0YXRlLWluZm8tYm9yZGVyICFkZWZhdWx0O1xuJHBhbmVsLWluZm8taGVhZGluZy1iZzogICAgICAgJHN0YXRlLWluZm8tYmcgIWRlZmF1bHQ7XG5cbiRwYW5lbC13YXJuaW5nLXRleHQ6ICAgICAgICAgICRzdGF0ZS13YXJuaW5nLXRleHQgIWRlZmF1bHQ7XG4kcGFuZWwtd2FybmluZy1ib3JkZXI6ICAgICAgICAkc3RhdGUtd2FybmluZy1ib3JkZXIgIWRlZmF1bHQ7XG4kcGFuZWwtd2FybmluZy1oZWFkaW5nLWJnOiAgICAkc3RhdGUtd2FybmluZy1iZyAhZGVmYXVsdDtcblxuJHBhbmVsLWRhbmdlci10ZXh0OiAgICAgICAgICAgJHN0YXRlLWRhbmdlci10ZXh0ICFkZWZhdWx0O1xuJHBhbmVsLWRhbmdlci1ib3JkZXI6ICAgICAgICAgJHN0YXRlLWRhbmdlci1ib3JkZXIgIWRlZmF1bHQ7XG4kcGFuZWwtZGFuZ2VyLWhlYWRpbmctYmc6ICAgICAkc3RhdGUtZGFuZ2VyLWJnICFkZWZhdWx0O1xuXG5cbi8vPT0gVGh1bWJuYWlsc1xuLy9cbi8vIyNcblxuLy8qKiBQYWRkaW5nIGFyb3VuZCB0aGUgdGh1bWJuYWlsIGltYWdlXG4kdGh1bWJuYWlsLXBhZGRpbmc6ICAgICAgICAgICA0cHggIWRlZmF1bHQ7XG4vLyoqIFRodW1ibmFpbCBiYWNrZ3JvdW5kIGNvbG9yXG4kdGh1bWJuYWlsLWJnOiAgICAgICAgICAgICAgICAkYm9keS1iZyAhZGVmYXVsdDtcbi8vKiogVGh1bWJuYWlsIGJvcmRlciBjb2xvclxuJHRodW1ibmFpbC1ib3JkZXI6ICAgICAgICAgICAgI2RkZCAhZGVmYXVsdDtcbi8vKiogVGh1bWJuYWlsIGJvcmRlciByYWRpdXNcbiR0aHVtYm5haWwtYm9yZGVyLXJhZGl1czogICAgICRib3JkZXItcmFkaXVzLWJhc2UgIWRlZmF1bHQ7XG5cbi8vKiogQ3VzdG9tIHRleHQgY29sb3IgZm9yIHRodW1ibmFpbCBjYXB0aW9uc1xuJHRodW1ibmFpbC1jYXB0aW9uLWNvbG9yOiAgICAgJHRleHQtY29sb3IgIWRlZmF1bHQ7XG4vLyoqIFBhZGRpbmcgYXJvdW5kIHRoZSB0aHVtYm5haWwgY2FwdGlvblxuJHRodW1ibmFpbC1jYXB0aW9uLXBhZGRpbmc6ICAgOXB4ICFkZWZhdWx0O1xuXG5cbi8vPT0gV2VsbHNcbi8vXG4vLyMjXG5cbiR3ZWxsLWJnOiAgICAgICAgICAgICAgICAgICAgICNmNWY1ZjUgIWRlZmF1bHQ7XG4kd2VsbC1ib3JkZXI6ICAgICAgICAgICAgICAgICBkYXJrZW4oJHdlbGwtYmcsIDclKSAhZGVmYXVsdDtcblxuXG4vLz09IEJhZGdlc1xuLy9cbi8vIyNcblxuJGJhZGdlLWNvbG9yOiAgICAgICAgICAgICAgICAgI2ZmZiAhZGVmYXVsdDtcbi8vKiogTGlua2VkIGJhZGdlIHRleHQgY29sb3Igb24gaG92ZXJcbiRiYWRnZS1saW5rLWhvdmVyLWNvbG9yOiAgICAgICNmZmYgIWRlZmF1bHQ7XG4kYmFkZ2UtYmc6ICAgICAgICAgICAgICAgICAgICAkZ3JheS1saWdodCAhZGVmYXVsdDtcblxuLy8qKiBCYWRnZSB0ZXh0IGNvbG9yIGluIGFjdGl2ZSBuYXYgbGlua1xuJGJhZGdlLWFjdGl2ZS1jb2xvcjogICAgICAgICAgJGxpbmstY29sb3IgIWRlZmF1bHQ7XG4vLyoqIEJhZGdlIGJhY2tncm91bmQgY29sb3IgaW4gYWN0aXZlIG5hdiBsaW5rXG4kYmFkZ2UtYWN0aXZlLWJnOiAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuXG4kYmFkZ2UtZm9udC13ZWlnaHQ6ICAgICAgICAgICBib2xkICFkZWZhdWx0O1xuJGJhZGdlLWxpbmUtaGVpZ2h0OiAgICAgICAgICAgMSAhZGVmYXVsdDtcbiRiYWRnZS1ib3JkZXItcmFkaXVzOiAgICAgICAgIDEwcHggIWRlZmF1bHQ7XG5cblxuLy89PSBCcmVhZGNydW1ic1xuLy9cbi8vIyNcblxuJGJyZWFkY3J1bWItcGFkZGluZy12ZXJ0aWNhbDogICA4cHggIWRlZmF1bHQ7XG4kYnJlYWRjcnVtYi1wYWRkaW5nLWhvcml6b250YWw6IDE1cHggIWRlZmF1bHQ7XG4vLyoqIEJyZWFkY3J1bWIgYmFja2dyb3VuZCBjb2xvclxuJGJyZWFkY3J1bWItYmc6ICAgICAgICAgICAgICAgICAjZjVmNWY1ICFkZWZhdWx0O1xuLy8qKiBCcmVhZGNydW1iIHRleHQgY29sb3JcbiRicmVhZGNydW1iLWNvbG9yOiAgICAgICAgICAgICAgI2NjYyAhZGVmYXVsdDtcbi8vKiogVGV4dCBjb2xvciBvZiBjdXJyZW50IHBhZ2UgaW4gdGhlIGJyZWFkY3J1bWJcbiRicmVhZGNydW1iLWFjdGl2ZS1jb2xvcjogICAgICAgJGdyYXktbGlnaHQgIWRlZmF1bHQ7XG4vLyoqIFRleHR1YWwgc2VwYXJhdG9yIGZvciBiZXR3ZWVuIGJyZWFkY3J1bWIgZWxlbWVudHNcbiRicmVhZGNydW1iLXNlcGFyYXRvcjogICAgICAgICAgXCIvXCIgIWRlZmF1bHQ7XG5cblxuLy89PSBDYXJvdXNlbFxuLy9cbi8vIyNcblxuJGNhcm91c2VsLXRleHQtc2hhZG93OiAgICAgICAgICAgICAgICAgICAgICAgIDAgMXB4IDJweCByZ2JhKDAsMCwwLC42KSAhZGVmYXVsdDtcblxuJGNhcm91c2VsLWNvbnRyb2wtY29sb3I6ICAgICAgICAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4kY2Fyb3VzZWwtY29udHJvbC13aWR0aDogICAgICAgICAgICAgICAgICAgICAgMTUlICFkZWZhdWx0O1xuJGNhcm91c2VsLWNvbnRyb2wtb3BhY2l0eTogICAgICAgICAgICAgICAgICAgIC41ICFkZWZhdWx0O1xuJGNhcm91c2VsLWNvbnRyb2wtZm9udC1zaXplOiAgICAgICAgICAgICAgICAgIDIwcHggIWRlZmF1bHQ7XG5cbiRjYXJvdXNlbC1pbmRpY2F0b3ItYWN0aXZlLWJnOiAgICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuJGNhcm91c2VsLWluZGljYXRvci1ib3JkZXItY29sb3I6ICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG5cbiRjYXJvdXNlbC1jYXB0aW9uLWNvbG9yOiAgICAgICAgICAgICAgICAgICAgICAjZmZmICFkZWZhdWx0O1xuXG5cbi8vPT0gQ2xvc2Vcbi8vXG4vLyMjXG5cbiRjbG9zZS1mb250LXdlaWdodDogICAgICAgICAgIGJvbGQgIWRlZmF1bHQ7XG4kY2xvc2UtY29sb3I6ICAgICAgICAgICAgICAgICAjMDAwICFkZWZhdWx0O1xuJGNsb3NlLXRleHQtc2hhZG93OiAgICAgICAgICAgMCAxcHggMCAjZmZmICFkZWZhdWx0O1xuXG5cbi8vPT0gQ29kZVxuLy9cbi8vIyNcblxuJGNvZGUtY29sb3I6ICAgICAgICAgICAgICAgICAgI2M3MjU0ZSAhZGVmYXVsdDtcbiRjb2RlLWJnOiAgICAgICAgICAgICAgICAgICAgICNmOWYyZjQgIWRlZmF1bHQ7XG5cbiRrYmQtY29sb3I6ICAgICAgICAgICAgICAgICAgICNmZmYgIWRlZmF1bHQ7XG4ka2JkLWJnOiAgICAgICAgICAgICAgICAgICAgICAjMzMzICFkZWZhdWx0O1xuXG4kcHJlLWJnOiAgICAgICAgICAgICAgICAgICAgICAjZjVmNWY1ICFkZWZhdWx0O1xuJHByZS1jb2xvcjogICAgICAgICAgICAgICAgICAgJGdyYXktZGFyayAhZGVmYXVsdDtcbiRwcmUtYm9yZGVyLWNvbG9yOiAgICAgICAgICAgICNjY2MgIWRlZmF1bHQ7XG4kcHJlLXNjcm9sbGFibGUtbWF4LWhlaWdodDogICAzNDBweCAhZGVmYXVsdDtcblxuXG4vLz09IFR5cGVcbi8vXG4vLyMjXG5cbi8vKiogSG9yaXpvbnRhbCBvZmZzZXQgZm9yIGZvcm1zIGFuZCBsaXN0cy5cbiRjb21wb25lbnQtb2Zmc2V0LWhvcml6b250YWw6IDE4MHB4ICFkZWZhdWx0O1xuLy8qKiBUZXh0IG11dGVkIGNvbG9yXG4kdGV4dC1tdXRlZDogICAgICAgICAgICAgICAgICAkZ3JheS1saWdodCAhZGVmYXVsdDtcbi8vKiogQWJicmV2aWF0aW9ucyBhbmQgYWNyb255bXMgYm9yZGVyIGNvbG9yXG4kYWJici1ib3JkZXItY29sb3I6ICAgICAgICAgICAkZ3JheS1saWdodCAhZGVmYXVsdDtcbi8vKiogSGVhZGluZ3Mgc21hbGwgY29sb3JcbiRoZWFkaW5ncy1zbWFsbC1jb2xvcjogICAgICAgICRncmF5LWxpZ2h0ICFkZWZhdWx0O1xuLy8qKiBCbG9ja3F1b3RlIHNtYWxsIGNvbG9yXG4kYmxvY2txdW90ZS1zbWFsbC1jb2xvcjogICAgICAkZ3JheS1saWdodCAhZGVmYXVsdDtcbi8vKiogQmxvY2txdW90ZSBmb250IHNpemVcbiRibG9ja3F1b3RlLWZvbnQtc2l6ZTogICAgICAgICgkZm9udC1zaXplLWJhc2UgKiAxLjI1KSAhZGVmYXVsdDtcbi8vKiogQmxvY2txdW90ZSBib3JkZXIgY29sb3JcbiRibG9ja3F1b3RlLWJvcmRlci1jb2xvcjogICAgICRncmF5LWxpZ2h0ZXIgIWRlZmF1bHQ7XG4vLyoqIFBhZ2UgaGVhZGVyIGJvcmRlciBjb2xvclxuJHBhZ2UtaGVhZGVyLWJvcmRlci1jb2xvcjogICAgJGdyYXktbGlnaHRlciAhZGVmYXVsdDtcbi8vKiogV2lkdGggb2YgaG9yaXpvbnRhbCBkZXNjcmlwdGlvbiBsaXN0IHRpdGxlc1xuJGRsLWhvcml6b250YWwtb2Zmc2V0OiAgICAgICAgJGNvbXBvbmVudC1vZmZzZXQtaG9yaXpvbnRhbCAhZGVmYXVsdDtcbi8vKiogUG9pbnQgYXQgd2hpY2ggLmRsLWhvcml6b250YWwgYmVjb21lcyBob3Jpem9udGFsXG4kZGwtaG9yaXpvbnRhbC1icmVha3BvaW50OiAgICAkZ3JpZC1mbG9hdC1icmVha3BvaW50ICFkZWZhdWx0O1xuLy8qKiBIb3Jpem9udGFsIGxpbmUgY29sb3IuXG4kaHItYm9yZGVyOiAgICAgICAgICAgICAgICAgICAkZ3JheS1saWdodGVyICFkZWZhdWx0O1xuIiwiQGltcG9ydCAnLi4vLi4vLi4vc3R5bGVzL2FuaW1hdGlvbnMuc2Nzcyc7XG5cbnhvcy10YWJsZSB7XG5cbiAgZGlzcGxheTogYmxvY2s7XG5cbiAgdHIubmctbW92ZSxcbiAgdHIubmctZW50ZXIsXG4gIHRyLm5nLWxlYXZlIHtcbiAgICB0cmFuc2l0aW9uOmFsbCBsaW5lYXIgMC41cztcbiAgfVxuXG4gIHRyLm5nLWxlYXZlLm5nLWxlYXZlLWFjdGl2ZSxcbiAgdHIubmctbW92ZSxcbiAgdHIubmctZW50ZXIge1xuICAgIG9wYWNpdHk6MDtcbiAgICBhbmltYXRpb246IDAuNXMgc2xpZGVPdXRSaWdodCBlYXNlLWluLW91dDtcbiAgfVxuXG4gIHRyLm5nLWxlYXZlLFxuICB0ci5uZy1tb3ZlLm5nLW1vdmUtYWN0aXZlLFxuICB0ci5uZy1lbnRlci5uZy1lbnRlci1hY3RpdmUge1xuICAgIG9wYWNpdHk6MTtcbiAgICBhbmltYXRpb246IDAuNXMgc2xpZGVJblJpZ2h0IGVhc2UtaW4tb3V0O1xuICB9XG5cbiAgdGQgZGwge1xuICAgIG1hcmdpbi1ib3R0b206IDA7XG5cbiAgICBkdCB7XG4gICAgICB3aWR0aDogYXV0byAhaW1wb3J0YW50O1xuICAgICAgbWFyZ2luLXJpZ2h0OiAxMHB4O1xuICAgIH1cbiAgICBcbiAgICBkdDphZnRlciB7XG4gICAgICAvKmRpc3BsYXk6IGJsb2NrOyovXG4gICAgICBjb250ZW50OiAnOic7XG4gICAgfVxuXG4gICAgZGQge1xuICAgICAgbWFyZ2luLWxlZnQ6IDAgIWltcG9ydGFudDtcbiAgICB9XG4gIH1cbn0iLCJAaW1wb3J0ICcuLi8uLi8uLi9zdHlsZXMvYW5pbWF0aW9ucy5zY3NzJztcblxueG9zLWFsZXJ0IHtcblxuICAvKiB3aGVuIGhpZGluZyAqL1xuICAubmctaGlkZS1hZGQgICAgICAgICB7IGFuaW1hdGlvbjowLjVzIGZhZGVPdXREb3duIGVhc2UtaW4tb3V0OyB9XG5cbiAgLyogd2hlbiBzaG93aW5nICovXG4gIC5uZy1oaWRlLXJlbW92ZSAgICAgIHsgYW5pbWF0aW9uOjAuNXMgZmFkZUluVXAgZWFzZS1pbi1vdXQ7IH1cbn0iLCJAaW1wb3J0ICcuLi8uLi8uLi9zdHlsZXMvYW5pbWF0aW9ucy5zY3NzJztcbkBpbXBvcnQgJy4uLy4uLy4uLy4uLy4uLy4uL3N0eWxlL3Nhc3MvYm9vdHN0cmFwL2Jvb3RzdHJhcC9fdmFyaWFibGVzLnNjc3MnO1xuXG5pbnB1dCArIHhvcy12YWxpZGF0aW9uIHtcbiAgbWFyZ2luLXRvcDogJGZvcm0tZ3JvdXAtbWFyZ2luLWJvdHRvbTtcbiAgZGlzcGxheTogYmxvY2s7XG59IiwieG9zLWZpZWxkIHtcbiAgZGlzcGxheTogYmxvY2s7XG59IiwieG9zLXNtYXJ0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 */
diff --git a/xos/core/views/mCordServiceGrid.py b/xos/core/views/mCordServiceGrid.py
new file mode 100644
index 0000000..56c820a
--- /dev/null
+++ b/xos/core/views/mCordServiceGrid.py
@@ -0,0 +1,72 @@
+from django.http import HttpResponse
+from django.views.generic import TemplateView, View
+from django import template
+from django.shortcuts import render
+from core.models import *
+import json
+import os
+import time
+import tempfile
+
+
+class ServiceGridView(TemplateView):
+    head_template = r"""{% extends "admin/dashboard/dashboard_base.html" %}
+       {% load admin_static %}
+       {% block content %}
+    """
+
+    # I hate myself for doing this
+    script = """
+    <script type="text/javascript">
+        $(window).ready(function(){
+            $('.kind-container').on('click', function(){
+                $(this).toggleClass('active')
+            });
+        })
+    </script>
+    """
+
+    tail_template = r"{% endblock %}"
+
+    def get(self, request, name="root", *args, **kwargs):
+        head_template = self.head_template
+        tail_template = self.tail_template
+        html = self.script
+        html = html + '<div class="col-xs-12 m-cord">'
+
+        # Select the unique kind of services
+        for kind in Service.objects.values('kind').distinct():
+
+            html = html + '<div class="kind-container row">'
+            html = html + '<div class="col-xs-12"><h2>%s</h2></div>' % (kind["kind"])
+
+            # for each kind select services
+            for service in Service.objects.filter(kind=kind["kind"]):
+                image_url = service.icon_url
+                if (not image_url):
+                    image_url = "/static/mCordServices/service_common.png"
+                #if service.view_url.startswith("http"):
+                #    target = 'target="_blank"'
+                #else:
+                #    target = ''
+                target = ''
+
+                html = html + '<div class="col-xs-4 text-center service-container">'
+                html = html + '<a href="%s" %s>' % (service.view_url, target)
+                html = html + '<img class="img-responsive" src="%s">' % (image_url)
+                html = html + "<h4>" + service.name + "</h4>"
+                html = html + '</a>'
+                html = html + "</div>"
+
+            html = html + "</div>"
+
+        html = html + "</div>"
+        t = template.Template(head_template + html + self.tail_template)
+
+        response_kwargs = {}
+        response_kwargs.setdefault('content_type', self.content_type)
+        return self.response_class(
+            request=request,
+            template=t,
+            **response_kwargs
+        )
diff --git a/xos/core/views/serviceGraph.py b/xos/core/views/serviceGraph.py
index 783a5e9..69631b9 100644
--- a/xos/core/views/serviceGraph.py
+++ b/xos/core/views/serviceGraph.py
@@ -64,7 +64,7 @@
 
         html = '<table class="service-grid"><tr>'
 
-        icons=[]
+        icons = []
         for service in Service.objects.all():
             view_url = service.view_url
             if (not view_url):
@@ -75,27 +75,27 @@
             if (not image_url):
                 image_url = "/static/primarycons_blue/gear_2.png"
 
-            icons.append( {"name": service.name, "view_url": view_url, "image_url": image_url} )
+            icons.append({"name": service.name, "view_url": view_url, "image_url": image_url})
 
-        icons.append( {"name": "Tenancy Graph", "view_url": "/serviceGraph.png", "image_url": "/static/primarycons_blue/service_graph.png", "horiz_rule": True} )
-        icons.append( {"name": "Add Service", "view_url": "/admin/core/service/add/", "image_url": "/static/primarycons_blue/plus.png"} )
+        icons.append({"name": "Tenancy Graph", "view_url": "/serviceGraph.png", "image_url": "/static/primarycons_blue/service_graph.png", "horiz_rule": True})
+        icons.append({"name": "Add Service", "view_url": "/admin/core/service/add/", "image_url": "/static/primarycons_blue/plus.png"})
 
-        i=0
+        i = 0
         for icon in icons:
             if icon.get("horiz_rule", False):
                 html = html + "</tr><tr><td colspan=4><hr></td></tr><tr>"
-                i=0
+                i = 0
 
             service_name = icon["name"]
             view_url = icon["view_url"]
             image_url = icon["image_url"]
 
-            if (i%4) == 0:
+            if (i % 4) == 0:
                 html = html + '</tr><tr>'
 
             html = html + '<td width=96 height=128 valign=top align=center><a class="service-grid-icon" href="%s"><img src="%s" height=64 width=64></img></a>' % (view_url, image_url)
             html = html + '<p><a class="service-grid-icon-link" href="%s">%s</a></p></td>' % (view_url, service_name)
-            i=i+1
+            i = i+1
 
         html = html + '</tr></table>'
 
@@ -104,9 +104,11 @@
         response_kwargs = {}
         response_kwargs.setdefault('content_type', self.content_type)
         return self.response_class(
-            request = request,
-            template = t,
-            **response_kwargs)
+            request=request,
+            template=t,
+            **response_kwargs
+        )
+
 
 class ServiceGraphViewOld(TemplateView):
     #  this attempt used networkx
@@ -121,14 +123,14 @@
         import matplotlib.pyplot as plt
         import nxedges
 
-        plt.figure(figsize=(10,8))
+        plt.figure(figsize=(10, 8))
 
         g = nx.DiGraph()
 
         labels = {}
         for service in Service.objects.all():
             g.add_node(service.id)
-            if len(service.name)>8:
+            if len(service.name) > 8:
                 labels[service.id] = service.name[:8] + "\n" + service.name[8:]
             else:
                 labels[service.id] = service.name
@@ -139,13 +141,14 @@
             g.add_edge(tenant.subscriber_service.id, tenant.provider_service.id)
 
         pos = nx.graphviz_layout(g)
-        nxedges.xos_draw_networkx_edges(g,pos,arrow_len=30)
-        nx.draw_networkx_nodes(g,pos,node_size=5000)
-        nx.draw_networkx_labels(g,pos,labels,font_size=12)
-        #plt.axis('off')
+        nxedges.xos_draw_networkx_edges(g, pos, arrow_len=30)
+        nx.draw_networkx_nodes(g, pos, node_size=5000)
+        nx.draw_networkx_labels(g, pos, labels, font_size=12)
+        # plt.axis('off')
         plt.savefig("/tmp/foo.png")
 
-        return HttpResponse(open("/tmp/foo.png","r").read(), content_type="image/png")
+        return HttpResponse(open("/tmp/foo.png", "r").read(), content_type="image/png")
+
 
 class ServiceGraphView(TemplateView):
     # this attempt just uses graphviz directly
@@ -158,7 +161,7 @@
         g = pgv.AGraph(directed=True)
         g.graph_attr.update(size="8,4!")
         g.graph_attr.update(dpi="100")
-        #g.graph_attr.update(nodesep="2.5")
+        # g.graph_attr.update(nodesep="2.5")
         g.graph_attr.update(overlap="false")
         g.graph_attr.update(graphdir="TB")
 
@@ -166,8 +169,8 @@
             provided_tenants = Tenant.objects.filter(provider_service=service, subscriber_service__isnull=False)
             subscribed_tenants = Tenant.objects.filter(subscriber_service=service, provider_service__isnull=False)
             if not (provided_tenants or subscribed_tenants):
-               # nodes with no edges aren't interesting
-               continue
+                # nodes with no edges aren't interesting
+                continue
             g.add_node(service.id, label=service.name)
 
         for tenant in Tenant.objects.all():
diff --git a/xos/core/xoslib/dashboards/xosMcordTopology.html b/xos/core/xoslib/dashboards/xosMcordTopology.html
new file mode 100644
index 0000000..a4b67a0
--- /dev/null
+++ b/xos/core/xoslib/dashboards/xosMcordTopology.html
@@ -0,0 +1,15 @@
+<!-- browserSync -->
+
+<!-- inject:css -->
+<link rel="stylesheet" href="/static/css/xosMcordTopology.css">
+<!-- endinject -->
+
+<div ng-app="xos.mcordTopology" id="xosMcordTopology" class="container-fluid">
+    <div ui-view></div>
+</div>
+
+
+<!-- inject:js -->
+<script src="/static/js/vendor/xosMcordTopologyVendor.js"></script>
+<script src="/static/js/xosMcordTopology.js"></script>
+<!-- endinject -->
diff --git a/xos/core/xoslib/dashboards/xosSubscribers.html b/xos/core/xoslib/dashboards/xosSubscribers.html
new file mode 100644
index 0000000..cb58882
--- /dev/null
+++ b/xos/core/xoslib/dashboards/xosSubscribers.html
@@ -0,0 +1,16 @@
+<!-- browserSync -->
+
+<!-- endcss -->
+<!-- inject:css -->
+<link rel="stylesheet" href="/static/css/xosSubscribers.css">
+<!-- endinject -->
+
+<div ng-app="xos.subscribers" id="xosSubscribers" class="container-fluid">
+  <div ui-view></div>
+</div>
+
+
+<!-- endjs -->
+<!-- inject:js -->
+<script src="/static/js/xosSubscribers.js"></script>
+<!-- endinject -->
\ No newline at end of file
diff --git a/xos/core/xoslib/static/css/xosDiagnostic.css b/xos/core/xoslib/static/css/xosDiagnostic.css
index 7aee881..f96d289 100644
--- a/xos/core/xoslib/static/css/xosDiagnostic.css
+++ b/xos/core/xoslib/static/css/xosDiagnostic.css
@@ -1 +1 @@
-#xosDiagnostic,[ui-view]{min-height:700px;position:relative}diagnostic-container .form-control.small-padding{padding:6px}diagnostic-container .half-height{position:relative;height:50%}diagnostic-container .onethird-height{position:relative;height:33%;border-bottom:1px solid #999}diagnostic-container .twothird-height{position:relative;height:67%}diagnostic-container .subscriber-select{max-width:200px;position:absolute;top:20px;right:20px;z-index:1}diagnostic-container .onethird-height .well,diagnostic-container .twothird-height .well{font-weight:700;max-width:165px;text-align:center;margin-top:15px;background:#eee;border-color:steelblue;padding:10px}diagnostic-container .onethird-height .well.pull-right{position:absolute;right:0;top:-15px;cursor:pointer;z-index:200}subscriber-status-modal .row+.row{margin-top:20px}.half-height+.half-height{border-top:1px solid black}service-topology,logic-topology{height:100%;width:100%;display:block;position:absolute;top:0}logic-topology .subscriber circle,logic-topology .device circle{fill:#fff;stroke:green;stroke-width:1px}logic-topology>svg{position:absolute;top:0}logic-topology .network .cloud{fill:#fff;stroke:green;stroke-width:1px}logic-topology .node.rack>g>rect{fill:#ccc;stroke:steelblue;stroke-width:1px}logic-topology .compute-node>rect{fill:#fff;stroke:steelblue;stroke-width:1px}logic-topology .compute-node>text{font-size:16px}logic-topology .instance>rect{fill:#eee;stroke:steelblue;stroke-width:1px}logic-topology .node .instance.active rect{fill:lightsteelblue;stroke:steelblue;stroke-width:1px}logic-topology .node .instance.active.good>rect{fill:green}logic-topology .node .instance.active.provisioning>rect{fill:yellow}logic-topology .node .instance.active.bad>rect{fill:red}logic-topology .node .instance .stats-container rect{fill:white}logic-topology .node .instance .stats-container text.name{font-weight:700}logic-topology .node .instance .stats-container text.ip{font-style:italic;font-size:10px}logic-topology .node .instance .stats-container .container rect{fill:#eee;stroke:steelblue;stroke-width:1px}.legend{fill:#fff;stroke:#ccc;stroke-width:1px;position:relative}.legend text{stroke:#000}.node{cursor:pointer}.node circle,.node rect{fill:#fff;stroke:steelblue;stroke-width:1px}.node.subscriber circle,.node.subscriber rect,.node.router circle,.node.router rect{stroke:#05ffcb}.node.slice rect{stroke:#b01dff}.node.instance rect{stroke:#ccc}.node.instance rect.active{stroke:#ff8b00}.node rect.slice-detail{fill:#fff;stroke:steelblue;stroke-width:3px}.node text{font:18px sans-serif}.node .instance text{font:12px sans-serif}.node text.small{font-size:10px}.link,.device-link{fill:none;stroke:#ccc;stroke-width:2px}.link.slice{stroke:rgba(157,4,183,.29)}.link.instance{stroke:#ccc}.link.instance.active{stroke:rgba(255,138,0,.65)}.service-details{width:200px;position:absolute;top:20px;right:20px}.animate.ng-hide-remove{animation:.5s bounceInRight ease}.animate.ng-hide-add{animation:.5s bounceOutRight ease}.loader{font-size:10px;margin:150px auto;text-indent:-9999em;width:11em;height:11em;border-radius:50%;background:#fff;background:linear-gradient(to right,#fff 10%,rgba(255,255,255,0) 42%);position:relative;animation:load3 1.4s infinite linear;transform:translateZ(0)}.loader:before{width:50%;height:50%;background:#105e9e;border-radius:100% 0 0;position:absolute;top:0;left:0;content:''}.loader:after{background:#fff;width:75%;height:75%;border-radius:50%;content:'';margin:auto;position:absolute;top:0;left:0;bottom:0;right:0}@keyframes load3{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.modal.fade.in{display:block}@keyframes bounceInRight{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}from{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes bounceOutRight{20%{opacity:1;transform:translate3d(-20px,0,0)}to{opacity:0;transform:translate3d(2000px,0,0)}}
\ No newline at end of file
+#xosDiagnostic,[ui-view]{min-height:700px;position:relative}diagnostic-container .form-control.small-padding{padding:6px}diagnostic-container .half-height{position:relative;height:50%}diagnostic-container .onethird-height{position:relative;height:33%;border-bottom:1px solid #999}diagnostic-container .twothird-height{position:relative;height:67%}diagnostic-container .subscriber-select{max-width:200px;position:absolute;top:20px;right:20px;z-index:1}diagnostic-container .onethird-height .well,diagnostic-container .twothird-height .well{font-weight:700;max-width:165px;text-align:center;margin-top:15px;background:#eee;border-color:steelblue;padding:10px}diagnostic-container .onethird-height .well.pull-right{position:absolute;right:0;top:-15px;cursor:pointer;z-index:200}subscriber-status-modal .row+.row{margin-top:20px}.half-height+.half-height{border-top:1px solid black}service-topology,logic-topology{height:100%;width:100%;display:block;position:absolute;top:0}logic-topology .subscriber circle,logic-topology .device circle{fill:#fff;stroke:green;stroke-width:1px}logic-topology>svg{position:absolute;top:0}logic-topology .network .cloud{fill:#fff;stroke:green;stroke-width:1px}logic-topology .node.rack>g>rect{fill:#ccc;stroke:steelblue;stroke-width:1px}logic-topology .compute-node>rect{fill:#fff;stroke:steelblue;stroke-width:1px}logic-topology .compute-node>text{font-size:16px}logic-topology .instance>rect{fill:#eee;stroke:steelblue;stroke-width:1px}logic-topology .node .instance.active rect{fill:lightsteelblue;stroke:steelblue;stroke-width:1px}logic-topology .node .instance.active.good>rect{fill:green}logic-topology .node .instance.active.provisioning>rect{fill:yellow}logic-topology .node .instance.active.bad>rect{fill:red}logic-topology .node .instance .stats-container rect{fill:white}logic-topology .node .instance .stats-container text.name{font-weight:700}logic-topology .node .instance .stats-container text.ip{font-style:italic;font-size:10px}logic-topology .node .instance .stats-container .container rect{fill:#eee;stroke:steelblue;stroke-width:1px}.legend{fill:#fff;stroke:#ccc;stroke-width:1px;position:relative}.legend text{stroke:#000}.node{cursor:pointer}.node circle,.node rect{fill:#fff;stroke:steelblue;stroke-width:1px}.node.subscriber circle,.node.subscriber rect,.node.router circle,.node.router rect{stroke:#05ffcb}.node.slice rect{stroke:#b01dff}.node.instance rect{stroke:#ccc}.node.instance rect.active{stroke:#ff8b00}.node rect.slice-detail{fill:#fff;stroke:steelblue;stroke-width:3px}.node text{font:18px sans-serif}.node .instance text{font:12px sans-serif}.node text.small{font-size:10px}.link,.device-link{fill:none;stroke:#ccc;stroke-width:2px}.link.slice{stroke:rgba(157,4,183,.29)}.link.instance{stroke:#ccc}.link.instance.active{stroke:rgba(255,138,0,.65)}.service-details{width:200px;position:absolute;top:20px;right:20px}.animate.ng-hide-remove{animation:.5s bounceInRight ease}.animate.ng-hide-add{animation:.5s bounceOutRight ease}.loader{font-size:10px;margin:150px auto;text-indent:-9999em;width:11em;height:11em;border-radius:50%;background:#fff;background:linear-gradient(to right,#fff 10%,rgba(255,255,255,0) 42%);position:relative;animation:load3 1.4s infinite linear;transform:translateZ(0)}.loader:before{width:50%;height:50%;background:#105e9e;border-radius:100% 0 0;position:absolute;top:0;left:0;content:''}.loader:after{background:#fff;width:75%;height:75%;border-radius:50%;content:'';margin:auto;position:absolute;top:0;left:0;bottom:0;right:0}@keyframes load3{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.modal.fade.in{display:block}@keyframes bounceInRight{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}from{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes bounceOutRight{20%{opacity:1;transform:translate3d(-20px,0,0)}to{opacity:0;transform:translate3d(2000px,0,0)}}
diff --git a/xos/core/xoslib/static/css/xosMcordTopology.css b/xos/core/xoslib/static/css/xosMcordTopology.css
new file mode 100644
index 0000000..fe0343c
--- /dev/null
+++ b/xos/core/xoslib/static/css/xosMcordTopology.css
@@ -0,0 +1,2 @@
+
+#xosMcordTopology{height:700px}[ui-view],m-cord-topology{width:100%;height:100%;display:block}line{stroke:blue}line.big{stroke-width:2}circle,rect{fill:#fff;stroke-width:1}.fabric{stroke:none;fill:#123456;fill-rule:evenodd}.fabric-container{fill:transparent;stroke:#000;stroke-width:1}.bbu{stroke:black;fill:#ff7f0e}.rru{stroke:#000;fill:#ffbb78}.rru.antenna{stroke:#000;fill:brown}.rru-shadow{fill:#ffbb78;opacity:.4}.MME,.SGW,.PGW,.Vid{fill:purple;stroke:#000}rect.MME,rect.SGW,rect.PGW,rect.bbu,rect.Vid{fill:#fff;stroke:#fff}.bbu text,.MME text,.SGW text,.PGW text,.Vid text{font-size:10px;stroke-width:0;fill:#000}
\ No newline at end of file
diff --git a/xos/core/xoslib/static/css/xosSubscribers.css b/xos/core/xoslib/static/css/xosSubscribers.css
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/core/xoslib/static/css/xosSubscribers.css
diff --git a/xos/core/xoslib/static/css/xosSynchronizerNotifier.css b/xos/core/xoslib/static/css/xosSynchronizerNotifier.css
index 51c473f..e3520d4 100644
--- a/xos/core/xoslib/static/css/xosSynchronizerNotifier.css
+++ b/xos/core/xoslib/static/css/xosSynchronizerNotifier.css
@@ -1 +1 @@
-#xosSynchronizerNotifier{float:left}#xosSynchronizerNotifier .alert{margin-bottom:0!important}#xosSynchronizerNotifier .sync-status-container{position:relative}#xosSynchronizerNotifier .notification-panel{position:absolute;width:200px}#xosSynchronizerNotifier sync-status .badge.success{background-color:#5cb85c}#xosSynchronizerNotifier sync-status .badge.danger{background-color:#d9534f}
\ No newline at end of file
+#xosSynchronizerNotifier{float:left}#xosSynchronizerNotifier .alert{margin-bottom:0!important}#xosSynchronizerNotifier .sync-status-container{position:relative}#xosSynchronizerNotifier .notification-panel{position:absolute;width:200px}#xosSynchronizerNotifier sync-status .badge.success{background-color:#5cb85c}#xosSynchronizerNotifier sync-status .badge.warning{background-color:#f0ad4e}
\ No newline at end of file
diff --git a/xos/core/xoslib/static/js/vendor/ngXosHelpers.js b/xos/core/xoslib/static/js/vendor/ngXosHelpers.js
index e1cfb38..dc77fdf 100644
--- a/xos/core/xoslib/static/js/vendor/ngXosHelpers.js
+++ b/xos/core/xoslib/static/js/vendor/ngXosHelpers.js
@@ -1,2270 +1 @@
-'use strict';
-
-/**
- * © OpenCORD
- *
- * Visit http://guide.xosproject.org/devguide/addview/ for more information
- *
- * Created by teone on 3/24/16.
- */
-
-(function () {
-  'use strict';
-
-  /**
-  * @ngdoc overview
-  * @name xos.uiComponents
-  * @description
-  * A collection of UI components useful for Dashboard development.
-  * Currently available components are:
-  * - [xosAlert](/#/module/xos.uiComponents.directive:xosAlert)
-  * - [xosForm](/#/module/xos.uiComponents.directive:xosForm)
-  * - [xosPagination](/#/module/xos.uiComponents.directive:xosPagination)
-  * - [xosSmartTable](/#/module/xos.uiComponents.directive:xosSmartTable)
-  * - [xosTable](/#/module/xos.uiComponents.directive:xosTable)
-  * - [xosValidation](/#/module/xos.uiComponents.directive:xosValidation)
-  **/
-
-  angular.module('xos.uiComponents', ['chart.js']);
-})();
-//# sourceMappingURL=../maps/ui_components/ui-components.module.js.map
-
-'use strict';
-
-/**
- * © OpenCORD
- *
- * Visit http://guide.xosproject.org/devguide/addview/ for more information
- *
- * Created by teone on 3/24/16.
- */
-
-(function () {
-  'use strict';
-
-  angular.module('xos.uiComponents')
-
-  /**
-  * @ngdoc directive
-  * @name xos.uiComponents.directive:xosSmartTable
-  * @link xos.uiComponents.directive:xosTable xosTable
-  * @link xos.uiComponents.directive:xosForm xosForm
-  * @restrict E
-  * @description The xos-table directive
-  * @param {Object} config The configuration for the component,
-  * it is composed by the name of an angular [$resource](https://docs.angularjs.org/api/ngResource/service/$resource)
-  * and an array of fields that shouldn't be printed.
-  * ```
-  * {
-      resource: 'Users',
-      hiddenFields: []
-    }
-  * ```
-  * @scope
-  * @example
-   <example module="sampleSmartTable">
-    <file name="index.html">
-      <div ng-controller="SampleCtrl as vm">
-        <xos-smart-table config="vm.config"></xos-smart-table>
-      </div>
-    </file>
-    <file name="script.js">
-      angular.module('sampleSmartTable', ['xos.uiComponents', 'ngResource', 'ngMockE2E'])
-      // This is only for documentation purpose
-      .run(function($httpBackend, _){
-        let datas = [{id: 1, name: 'Jhon', surname: 'Doe'}];
-        let count = 1;
-         let paramsUrl = new RegExp(/\/test\/(.+)/);
-         $httpBackend.whenDELETE(paramsUrl, undefined, ['id']).respond((method, url, data, headers, params) => {
-          data = angular.fromJson(data);
-          let id = url.match(paramsUrl)[1];
-          _.remove(datas, (d) => {
-            return d.id === parseInt(id);
-          })
-          return [204];
-        });
-         $httpBackend.whenGET('/test').respond(200, datas)
-        $httpBackend.whenPOST('/test').respond((method, url, data) => {
-          data = angular.fromJson(data);
-          data.id = ++count;
-          datas.push(data);
-          return [201, data, {}];
-        });
-      })
-      .factory('_', function($window){
-        return $window._;
-      })
-      .service('SampleResource', function($resource){
-        return $resource('/test/:id', {id: '@id'});
-      })
-      // End of documentation purpose, example start
-      .controller('SampleCtrl', function(){
-        this.config = {
-          resource: 'SampleResource'
-        };
-      });
-    </file>
-  </example>
-  */
-
-  .directive('xosSmartTable', function () {
-    return {
-      restrict: 'E',
-      scope: {
-        config: '='
-      },
-      template: '\n        <div class="row" ng-show="vm.data.length > 0">\n          <div class="col-xs-12 text-right">\n            <a href="" class="btn btn-success" ng-click="vm.createItem()">\n              Add\n            </a>\n          </div>\n        </div>\n        <div class="row">\n          <div class="col-xs-12 table-responsive">\n            <xos-table config="vm.tableConfig" data="vm.data"></xos-table>\n          </div>\n        </div>\n        <div class="panel panel-default" ng-show="vm.detailedItem">\n          <div class="panel-heading">\n            <div class="row">\n              <div class="col-xs-11">\n                <h3 class="panel-title" ng-show="vm.detailedItem.id">Update {{vm.config.resource}} {{vm.detailedItem.id}}</h3>\n                <h3 class="panel-title" ng-show="!vm.detailedItem.id">Create {{vm.config.resource}} item</h3>\n              </div>\n              <div class="col-xs-1">\n                <a href="" ng-click="vm.cleanForm()">\n                  <i class="glyphicon glyphicon-remove pull-right"></i>\n                </a>\n              </div>\n            </div>\n          </div>\n          <div class="panel-body">\n            <xos-form config="vm.formConfig" ng-model="vm.detailedItem"></xos-form>\n          </div>\n        </div>\n        <xos-alert config="{type: \'success\', closeBtn: true}" show="vm.responseMsg">{{vm.responseMsg}}</xos-alert>\n        <xos-alert config="{type: \'danger\', closeBtn: true}" show="vm.responseErr">{{vm.responseErr}}</xos-alert>\n      ',
-      bindToController: true,
-      controllerAs: 'vm',
-      controller: ["$injector", "LabelFormatter", "_", "XosFormHelpers", function controller($injector, LabelFormatter, _, XosFormHelpers) {
-        var _this = this;
-
-        // TODO
-        // - Validate the config (what if resource does not exist?)
-
-        // NOTE
-        // Corner case
-        // - if response is empty, how can we generate a form ?
-
-        this.responseMsg = false;
-        this.responseErr = false;
-
-        this.tableConfig = {
-          columns: [],
-          actions: [{
-            label: 'delete',
-            icon: 'remove',
-            cb: function cb(item) {
-              _this.Resource.delete({ id: item.id }).$promise.then(function () {
-                _.remove(_this.data, function (d) {
-                  return d.id === item.id;
-                });
-                _this.responseMsg = _this.config.resource + ' with id ' + item.id + ' successfully deleted';
-              }).catch(function (err) {
-                _this.responseErr = err.data.detail || 'Error while deleting ' + _this.config.resource + ' with id ' + item.id;
-              });
-            },
-            color: 'red'
-          }, {
-            label: 'details',
-            icon: 'search',
-            cb: function cb(item) {
-              _this.detailedItem = item;
-            }
-          }],
-          classes: 'table table-striped table-bordered table-responsive',
-          filter: 'field',
-          order: true,
-          pagination: {
-            pageSize: 10
-          }
-        };
-
-        this.formConfig = {
-          exclude: this.config.hiddenFields,
-          fields: {},
-          formName: this.config.resource + 'Form',
-          actions: [{
-            label: 'Save',
-            icon: 'ok',
-            cb: function cb(item) {
-              var p = void 0;
-              var isNew = true;
-
-              if (item.id) {
-                p = item.$update();
-                isNew = false;
-              } else {
-                p = item.$save();
-              }
-
-              p.then(function (res) {
-                if (isNew) {
-                  _this.data.push(angular.copy(res));
-                }
-                delete _this.detailedItem;
-                _this.responseMsg = _this.config.resource + ' with id ' + item.id + ' successfully saved';
-              }).catch(function (err) {
-                _this.responseErr = err.data.detail || 'Error while saving ' + _this.config.resource + ' with id ' + item.id;
-              });
-            },
-            class: 'success'
-          }]
-        };
-
-        this.cleanForm = function () {
-          delete _this.detailedItem;
-        };
-
-        this.createItem = function () {
-          _this.detailedItem = new _this.Resource();
-        };
-
-        this.Resource = $injector.get(this.config.resource);
-
-        var getData = function getData() {
-          _this.Resource.query().$promise.then(function (res) {
-
-            if (!res[0]) {
-              return;
-            }
-
-            var item = res[0];
-            var props = Object.keys(item);
-
-            _.remove(props, function (p) {
-              return p == 'id' || p == 'validators';
-            });
-
-            // TODO move out cb
-            if (angular.isArray(_this.config.hiddenFields)) {
-              props = _.difference(props, _this.config.hiddenFields);
-            }
-
-            var labels = props.map(function (p) {
-              return LabelFormatter.format(p);
-            });
-
-            props.forEach(function (p, i) {
-              _this.tableConfig.columns.push({
-                label: labels[i],
-                prop: p
-              });
-            });
-
-            // build form structure
-            props.forEach(function (p, i) {
-              _this.formConfig.fields[p] = {
-                label: LabelFormatter.format(labels[i]).replace(':', ''),
-                type: XosFormHelpers._getFieldFormat(item[p])
-              };
-            });
-
-            _this.data = res;
-          });
-        };
-
-        getData();
-      }]
-    };
-  });
-})();
-//# sourceMappingURL=../../../maps/ui_components/smartComponents/smartTable/smartTable.component.js.map
-
-'use strict';
-
-/**
- * © OpenCORD
- *
- * Visit http://guide.xosproject.org/devguide/addview/ for more information
- *
- * Created by teone on 3/24/16.
- */
-
-(function () {
-  'use strict';
-
-  angular.module('xos.uiComponents')
-  /**
-    * @ngdoc directive
-    * @name xos.uiComponents.directive:xosSmartPie
-    * @restrict E
-    * @description The xos-table directive
-    * @param {Object} config The configuration for the component,
-    * it is composed by the name of an angular [$resource](https://docs.angularjs.org/api/ngResource/service/$resource)
-    * and a field name that is used to group the data.
-    * ```
-    * {
-        resource: 'Users',
-        groupBy: 'fieldName',
-        classes: 'my-custom-class',
-        labelFormatter: (labels) => {
-          // here you can format your label,
-          // you should return an array with the same order
-          return labels;
-        }
-      }
-    * ```
-    * @scope
-    * @example
-    
-    Displaying Local data
-     <example module="sampleSmartPieLocal">
-      <file name="index.html">
-        <div ng-controller="SampleCtrlLocal as vm">
-          <xos-smart-pie config="vm.configLocal"></xos-smart-pie>
-        </div>
-      </file>
-      <file name="script.js">
-        angular.module('sampleSmartPieLocal', ['xos.uiComponents'])
-        .factory('_', function($window){
-          return $window._;
-        })
-        .controller('SampleCtrlLocal', function($timeout){
-          
-          this.datas = [
-            {id: 1, first_name: 'Jon', last_name: 'aaa', category: 2},
-            {id: 2, first_name: 'Danaerys', last_name: 'Targaryen', category: 1},
-            {id: 3, first_name: 'Aria', last_name: 'Stark', category: 2}
-          ];
-           this.configLocal = {
-            data: [],
-            groupBy: 'category',
-            classes: 'local',
-            labelFormatter: (labels) => {
-              return labels.map(l => l === '1' ? 'North' : 'Dragon');
-            }
-          };
-          
-          $timeout(() => {
-            // this need to be triggered in this way just because of ngDoc,
-            // otherwise you can assign data directly in the config
-            this.configLocal.data = this.datas;
-          }, 1)
-        });
-      </file>
-    </example>
-     Fetching data from API
-     <example module="sampleSmartPieResource">
-      <file name="index.html">
-        <div ng-controller="SampleCtrl as vm">
-          <xos-smart-pie config="vm.config"></xos-smart-pie>
-        </div>
-      </file>
-      <file name="script.js">
-        angular.module('sampleSmartPieResource', ['xos.uiComponents', 'ngResource', 'ngMockE2E'])
-        .controller('SampleCtrl', function(){
-          this.config = {
-            resource: 'SampleResource',
-            groupBy: 'category',
-            classes: 'resource',
-            labelFormatter: (labels) => {
-              return labels.map(l => l === '1' ? 'North' : 'Dragon');
-            }
-          };
-        });
-      </file>
-      <file name="backendPoll.js">
-        angular.module('sampleSmartPieResource')
-        .run(function($httpBackend, _){
-          let datas = [
-            {id: 1, first_name: 'Jon', last_name: 'Snow', category: 1},
-            {id: 2, first_name: 'Danaerys', last_name: 'Targaryen', category: 2},
-            {id: 3, first_name: 'Aria', last_name: 'Stark', category: 1}
-          ];
-           $httpBackend.whenGET('/test').respond(200, datas)
-        })
-        .factory('_', function($window){
-          return $window._;
-        })
-        .service('SampleResource', function($resource){
-          return $resource('/test/:id', {id: '@id'});
-        })
-      </file>
-    </example>
-     Polling data from API
-     <example module="sampleSmartPiePoll">
-      <file name="index.html">
-        <div ng-controller="SampleCtrl as vm">
-          <xos-smart-pie config="vm.config"></xos-smart-pie>
-        </div>
-      </file>
-      <file name="script.js">
-        angular.module('sampleSmartPiePoll', ['xos.uiComponents', 'ngResource', 'ngMockE2E'])
-        .controller('SampleCtrl', function(){
-          this.config = {
-            resource: 'SampleResource',
-            groupBy: 'category',
-            poll: 2,
-            labelFormatter: (labels) => {
-              return labels.map(l => l === '1' ? 'Active' : 'Banned');
-            }
-          };
-        });
-      </file>
-      <file name="backend.js">
-        angular.module('sampleSmartPiePoll')
-        .run(function($httpBackend, _){
-          let mock = [
-            [
-              {id: 1, first_name: 'Jon', last_name: 'Snow', category: 1},
-              {id: 2, first_name: 'Danaerys', last_name: 'Targaryen', category: 2},
-              {id: 3, first_name: 'Aria', last_name: 'Stark', category: 1},
-              {id: 3, first_name: 'Tyrion', last_name: 'Lannister', category: 1}
-            ],
-             [
-              {id: 1, first_name: 'Jon', last_name: 'Snow', category: 1},
-              {id: 2, first_name: 'Danaerys', last_name: 'Targaryen', category: 2},
-              {id: 3, first_name: 'Aria', last_name: 'Stark', category: 2},
-              {id: 3, first_name: 'Tyrion', last_name: 'Lannister', category: 2}
-            ],
-             [
-              {id: 1, first_name: 'Jon', last_name: 'Snow', category: 1},
-              {id: 2, first_name: 'Danaerys', last_name: 'Targaryen', category: 2},
-              {id: 3, first_name: 'Aria', last_name: 'Stark', category: 1},
-              {id: 3, first_name: 'Tyrion', last_name: 'Lannister', category: 2}
-            ]
-          ];
-          $httpBackend.whenGET('/test').respond(function(method, url, data, headers, params) {
-            return [200, mock[Math.round(Math.random() * 3)]];
-          });
-        })
-        .factory('_', function($window){
-          return $window._;
-        })
-        .service('SampleResource', function($resource){
-          return $resource('/test/:id', {id: '@id'});
-        })
-      </file>
-    </example>
-    */
-  .directive('xosSmartPie', function () {
-    return {
-      restrict: 'E',
-      scope: {
-        config: '='
-      },
-      template: '\n        <canvas\n          class="chart chart-pie {{vm.config.classes}}"\n          chart-data="vm.data" chart-labels="vm.labels"\n          chart-legend="{{vm.config.legend}}">\n        </canvas>\n      ',
-      bindToController: true,
-      controllerAs: 'vm',
-      controller: ["$injector", "$interval", "$scope", "$timeout", "_", function controller($injector, $interval, $scope, $timeout, _) {
-        var _this = this;
-
-        if (!this.config.resource && !this.config.data) {
-          throw new Error('[xosSmartPie] Please provide a resource or an array of data in the configuration');
-        }
-
-        var groupData = function groupData(data) {
-          return _.groupBy(data, _this.config.groupBy);
-        };
-        var formatData = function formatData(data) {
-          return _.reduce(Object.keys(data), function (list, group) {
-            return list.concat(data[group].length);
-          }, []);
-        };
-        var formatLabels = function formatLabels(data) {
-          return angular.isFunction(_this.config.labelFormatter) ? _this.config.labelFormatter(Object.keys(data)) : Object.keys(data);
-        };
-
-        var prepareData = function prepareData(data) {
-          // $timeout(() => {
-          // group data
-          var grouped = groupData(data);
-          _this.data = formatData(grouped);
-          // create labels
-          _this.labels = formatLabels(grouped);
-          // }, 10);
-        };
-
-        if (this.config.resource) {
-          (function () {
-
-            _this.Resource = $injector.get(_this.config.resource);
-            var getData = function getData() {
-              _this.Resource.query().$promise.then(function (res) {
-
-                if (!res[0]) {
-                  return;
-                }
-
-                prepareData(res);
-              });
-            };
-
-            getData();
-
-            if (_this.config.poll) {
-              $interval(function () {
-                getData();
-              }, _this.config.poll * 1000);
-            }
-          })();
-        } else {
-          $scope.$watch(function () {
-            return _this.config.data;
-          }, function (data) {
-            if (data) {
-              prepareData(_this.config.data);
-            }
-          }, true);
-        }
-
-        $scope.$on('create', function (event, chart) {
-          console.log('create: ' + chart.id);
-        });
-
-        $scope.$on('destroy', function (event, chart) {
-          console.log('destroy: ' + chart.id);
-        });
-      }]
-    };
-  });
-})();
-//# sourceMappingURL=../../../maps/ui_components/smartComponents/smartPie/smartPie.component.js.map
-
-'use strict';
-
-/**
- * © OpenCORD
- *
- * Visit http://guide.xosproject.org/devguide/addview/ for more information
- *
- * Created by teone on 4/15/16.
- */
-
-(function () {
-  'use strict';
-
-  angular.module('xos.uiComponents')
-
-  /**
-    * @ngdoc directive
-    * @name xos.uiComponents.directive:xosValidation
-    * @restrict E
-    * @description The xos-validation directive
-    * @param {Object} errors The error object
-    * @element ANY
-    * @scope
-  * @example
-  <example module="sampleValidation">
-    <file name="index.html">
-      <div ng-controller="SampleCtrl as vm">
-        <div class="row">
-          <div class="col-xs-12">
-            <label>Set an error type:</label>
-          </div>
-          <div class="col-xs-2">
-            <a class="btn"
-              ng-click="vm.errors.required = !vm.errors.required"
-              ng-class="{'btn-default': !vm.errors.required, 'btn-success': vm.errors.required}">
-              Required
-            </a>
-          </div>
-          <div class="col-xs-2">
-            <a class="btn"
-              ng-click="vm.errors.email = !vm.errors.email"
-              ng-class="{'btn-default': !vm.errors.email, 'btn-success': vm.errors.email}">
-              Email
-            </a>
-          </div>
-          <div class="col-xs-2">
-            <a class="btn"
-              ng-click="vm.errors.minlength = !vm.errors.minlength"
-              ng-class="{'btn-default': !vm.errors.minlength, 'btn-success': vm.errors.minlength}">
-              Min Length
-            </a>
-          </div>
-          <div class="col-xs-2">
-            <a class="btn"
-              ng-click="vm.errors.maxlength = !vm.errors.maxlength"
-              ng-class="{'btn-default': !vm.errors.maxlength, 'btn-success': vm.errors.maxlength}">
-              Max Length
-            </a>
-          </div>
-        </div>
-        <xos-validation errors="vm.errors"></xos-validation>
-      </div>
-    </file>
-    <file name="script.js">
-      angular.module('sampleValidation', ['xos.uiComponents'])
-      .controller('SampleCtrl', function(){
-        this.errors = {
-          email: false
-        }
-      });
-    </file>
-  </example>
-    */
-
-  .directive('xosValidation', function () {
-    return {
-      restrict: 'E',
-      scope: {
-        errors: '='
-      },
-      template: '\n        <div ng-cloak>\n          <!-- <pre>{{vm.errors.email | json}}</pre> -->\n          <xos-alert config="vm.config" show="vm.errors.required !== undefined && vm.errors.required !== false">\n            Field required\n          </xos-alert>\n          <xos-alert config="vm.config" show="vm.errors.email !== undefined && vm.errors.email !== false">\n            This is not a valid email\n          </xos-alert>\n          <xos-alert config="vm.config" show="vm.errors.minlength !== undefined && vm.errors.minlength !== false">\n            Too short\n          </xos-alert>\n          <xos-alert config="vm.config" show="vm.errors.maxlength !== undefined && vm.errors.maxlength !== false">\n            Too long\n          </xos-alert>\n          <xos-alert config="vm.config" show="vm.errors.custom !== undefined && vm.errors.custom !== false">\n            Field invalid\n          </xos-alert>\n        </div>\n      ',
-      transclude: true,
-      bindToController: true,
-      controllerAs: 'vm',
-      controller: function controller() {
-        this.config = {
-          type: 'danger'
-        };
-      }
-    };
-  });
-})();
-//# sourceMappingURL=../../../maps/ui_components/dumbComponents/validation/validation.component.js.map
-
-'use strict';
-
-/**
- * © OpenCORD
- *
- * Visit http://guide.xosproject.org/devguide/addview/ for more information
- *
- * Created by teone on 3/24/16.
- */
-
-(function () {
-  'use strict';
-
-  angular.module('xos.uiComponents')
-
-  /**
-  * @ngdoc directive
-  * @name xos.uiComponents.directive:xosTable
-  * @restrict E
-  * @description The xos-table directive
-  * @param {Object} config The configuration for the component.
-  * ```
-  * {
-  *   columns: [
-  *     {
-  *       label: 'Human readable name',
-  *       prop: 'Property to read in the model object',
-  *       type: 'boolean'| 'array'| 'object'| 'custom'| 'date' | 'icon' // see examples for more details
-          formatter: fn(), // receive the whole item if tipe is custom and return a string
-          link: fn() // receive the whole item and return an url
-  *     }
-  *   ],
-  *   classes: 'table table-striped table-bordered',
-  *   actions: [ // if defined add an action column
-        {
-          label: 'delete',
-          icon: 'remove', // refers to bootstraps glyphicon
-          cb: (user) => { // receive the model
-            console.log(user);
-          },
-          color: 'red'
-        }
-      ],
-      filter: 'field', // can be by `field` or `fulltext`
-      order: true | {field: 'property name', reverse: true | false} // whether to show ordering arrows, or a configuration for a default ordering
-  * }
-  * ```
-  * @param {Array} data The data that should be rendered
-  * @element ANY
-  * @scope
-  * @example
-   # Basic usage
-  <example module="sampleTable1">
-  <file name="index.html">
-    <div ng-controller="SampleCtrl1 as vm">
-      <xos-table data="vm.data" config="vm.config"></xos-table>
-    </div>
-  </file>
-  <file name="script.js">
-    angular.module('sampleTable1', ['xos.uiComponents'])
-    .factory('_', function($window){
-      return $window._;
-    })
-    .controller('SampleCtrl1', function(){
-      this.config = {
-        columns: [
-          {
-            label: 'First Name', // column title
-            prop: 'name' // property to read in the data array
-          },
-          {
-            label: 'Last Name',
-            prop: 'lastname'
-          }
-        ]
-      };
-       this.data = [
-        {
-          name: 'John',
-          lastname: 'Doe'
-        },
-        {
-          name: 'Gili',
-          lastname: 'Fereydoun'
-        }
-      ]
-    });
-  </file>
-  </example>
-   # Filtering
-  <example module="sampleTable2" animations="true">
-  <file name="index.html">
-    <div ng-controller="SampleCtrl2 as vm">
-      <xos-table data="vm.data" config="vm.config"></xos-table>
-    </div>
-  </file>
-  <file name="script.js">
-    angular.module('sampleTable2', ['xos.uiComponents', 'ngAnimate'])
-    .factory('_', function($window){
-      return $window._;
-    })
-    .controller('SampleCtrl2', function(){
-      this.config = {
-        columns: [
-          {
-            label: 'First Name', // column title
-            prop: 'name' // property to read in the data array
-          },
-          {
-            label: 'Last Name',
-            prop: 'lastname'
-          }
-        ],
-        classes: 'table table-striped table-condensed', // table classes, default to `table table-striped table-bordered`
-        actions: [ // if defined add an action column
-          {
-            label: 'delete', // label
-            icon: 'remove', // icons, refers to bootstraps glyphicon
-            cb: (user) => { // callback, get feeded with the full object
-              console.log(user);
-            },
-            color: 'red' // icon color
-          }
-        ],
-        filter: 'field', // can be by `field` or `fulltext`
-        order: true
-      };
-       this.data = [
-        {
-          name: 'John',
-          lastname: 'Doe'
-        },
-        {
-          name: 'Gili',
-          lastname: 'Fereydoun'
-        }
-      ]
-    });
-  </file>
-  </example>
-   # Pagination
-  <example module="sampleTable3">
-  <file name="index.html">
-    <div ng-controller="SampleCtrl3 as vm">
-      <xos-table data="vm.data" config="vm.config"></xos-table>
-    </div>
-  </file>
-  <file name="script.js">
-    angular.module('sampleTable3', ['xos.uiComponents'])
-    .factory('_', function($window){
-      return $window._;
-    })
-    .controller('SampleCtrl3', function(){
-      this.config = {
-        columns: [
-          {
-            label: 'First Name', // column title
-            prop: 'name' // property to read in the data array
-          },
-          {
-            label: 'Last Name',
-            prop: 'lastname'
-          }
-        ],
-        pagination: {
-          pageSize: 2
-        }
-      };
-       this.data = [
-        {
-          name: 'John',
-          lastname: 'Doe'
-        },
-        {
-          name: 'Gili',
-          lastname: 'Fereydoun'
-        },
-        {
-          name: 'Lucky',
-          lastname: 'Clarkson'
-        },
-        {
-          name: 'Tate',
-          lastname: 'Spalding'
-        }
-      ]
-    });
-  </file>
-  </example>
-   # Field formatter
-  <example module="sampleTable4">
-  <file name="index.html">
-    <div ng-controller="SampleCtrl as vm">
-      <xos-table data="vm.data" config="vm.config"></xos-table>
-    </div>
-  </file>
-  <file name="script.js">
-    angular.module('sampleTable4', ['xos.uiComponents'])
-    .factory('_', function($window){
-      return $window._;
-    })
-    .controller('SampleCtrl', function(){
-      this.config = {
-        columns: [
-          {
-            label: 'First Name',
-            prop: 'name',
-            link: item => `https://www.google.it/#q=${item.name}`
-          },
-          {
-            label: 'Enabled',
-            prop: 'enabled',
-            type: 'boolean'
-          },
-          {
-            label: 'Services',
-            prop: 'services',
-            type: 'array'
-          },
-          {
-            label: 'Details',
-            prop: 'details',
-            type: 'object'
-          },
-          {
-            label: 'Created',
-            prop: 'created',
-            type: 'date'
-          },
-          {
-            label: 'Icon',
-            type: 'icon',
-            formatter: item => item.icon //note that this refer to [Bootstrap Glyphicon](http://getbootstrap.com/components/#glyphicons)
-          }
-        ]
-      };
-       this.data = [
-        {
-          name: 'John',
-          enabled: true,
-          services: ['Cdn', 'IpTv'],
-          details: {
-            c_tag: '243',
-            s_tag: '444'
-          },
-          created: new Date('December 17, 1995 03:24:00'),
-          icon: 'music'
-        },
-        {
-          name: 'Gili',
-          enabled: false,
-          services: ['Cdn', 'IpTv', 'Cache'],
-          details: {
-            c_tag: '675',
-            s_tag: '893'
-          },
-          created: new Date(),
-          icon: 'camera'
-        }
-      ]
-    });
-  </file>
-  </example>
-  # Custom formatter
-  <example module="sampleTable5">
-  <file name="index.html">
-    <div ng-controller="SampleCtrl as vm">
-      <xos-table data="vm.data" config="vm.config"></xos-table>
-    </div>
-  </file>
-  <file name="script.js">
-    angular.module('sampleTable5', ['xos.uiComponents'])
-    .factory('_', function($window){
-      return $window._;
-    })
-    .controller('SampleCtrl', function(){
-      this.config = {
-        columns: [
-          {
-            label: 'Username',
-            prop: 'username'
-          },
-          {
-            label: 'Features',
-            type: 'custom',
-            formatter: (val) => {
-              
-              let cdnEnabled = val.features.cdn ? 'enabled' : 'disabled';
-              return `
-                Cdn is ${cdnEnabled},
-                uplink speed is ${val.features.uplink_speed}
-                and downlink speed is ${val.features.downlink_speed}
-              `;
-            }
-          }
-        ]
-      };
-       this.data = [
-        {
-          username: 'John',
-          features: {
-            "cdn": false,
-            "uplink_speed": 1000000000,
-            "downlink_speed": 1000000000,
-            "uverse": true,
-            "status": "enabled"
-          }
-        },
-        {
-          username: 'Gili',
-          features: {
-            "cdn": true,
-            "uplink_speed": 3000000000,
-            "downlink_speed": 2000000000,
-            "uverse": true,
-            "status": "enabled"
-          }
-        }
-      ]
-    });
-  </file>
-  </example>
-  **/
-
-  .directive('xosTable', function () {
-    return {
-      restrict: 'E',
-      scope: {
-        data: '=',
-        config: '='
-      },
-      template: '\n          <div ng-show="vm.data.length > 0">\n            <div class="row" ng-if="vm.config.filter == \'fulltext\'">\n              <div class="col-xs-12">\n                <input\n                  class="form-control"\n                  placeholder="Type to search.."\n                  type="text"\n                  ng-model="vm.query"/>\n              </div>\n            </div>\n            <table ng-class="vm.classes" ng-hide="vm.data.length == 0">\n              <thead>\n                <tr>\n                  <th ng-repeat="col in vm.columns">\n                    {{col.label}}\n                    <span ng-if="vm.config.order">\n                      <a href="" ng-click="vm.orderBy = col.prop; vm.reverse = false">\n                        <i class="glyphicon glyphicon-chevron-up"></i>\n                      </a>\n                      <a href="" ng-click="vm.orderBy = col.prop; vm.reverse = true">\n                        <i class="glyphicon glyphicon-chevron-down"></i>\n                      </a>\n                    </span>\n                  </th>\n                  <th ng-if="vm.config.actions">Actions:</th>\n                </tr>\n              </thead>\n              <tbody ng-if="vm.config.filter == \'field\'">\n                <tr>\n                  <td ng-repeat="col in vm.columns">\n                    <input\n                      ng-if="col.type !== \'boolean\'"\n                      class="form-control"\n                      placeholder="Type to search by {{col.label}}"\n                      type="text"\n                      ng-model="vm.query[col.prop]"/>\n                    <select\n                      ng-if="col.type === \'boolean\'"\n                      class="form-control"\n                      ng-model="vm.query[col.prop]">\n                      <option value="">-</option>\n                      <option value="true">True</option>\n                      <option value="false">False</option>\n                    </select>\n                  </td>\n                  <td ng-if="vm.config.actions"></td>\n                </tr>\n              </tbody>\n              <tbody>\n                <tr ng-repeat="item in vm.data | filter:vm.query | orderBy:vm.orderBy:vm.reverse | pagination:vm.currentPage * vm.config.pagination.pageSize | limitTo: (vm.config.pagination.pageSize || vm.data.length) track by $index">\n                  <td ng-repeat="col in vm.columns" link-wrapper>\n                    <span ng-if="!col.type">{{item[col.prop]}}</span>\n                    <span ng-if="col.type === \'boolean\'">\n                      <i class="glyphicon"\n                        ng-class="{\'glyphicon-ok\': item[col.prop], \'glyphicon-remove\': !item[col.prop]}">\n                      </i>\n                    </span>\n                    <span ng-if="col.type === \'date\'">\n                      {{item[col.prop] | date:\'H:mm MMM d, yyyy\'}}\n                    </span>\n                    <span ng-if="col.type === \'array\'">\n                      {{item[col.prop] | arrayToList}}\n                    </span>\n                    <span ng-if="col.type === \'object\'">\n                      <dl class="dl-horizontal">\n                        <span ng-repeat="(k,v) in item[col.prop]">\n                          <dt>{{k}}</dt>\n                          <dd>{{v}}</dd>\n                        </span>\n                      </dl>\n                    </span>\n                    <span ng-if="col.type === \'custom\'">\n                      {{col.formatter(item)}}\n                    </span>\n                    <span ng-if="col.type === \'icon\'">\n                      <i class="glyphicon glyphicon-{{col.formatter(item)}}">\n                      </i>\n                    </span>\n                  </td>\n                  <td ng-if="vm.config.actions">\n                    <a href=""\n                      ng-repeat="action in vm.config.actions"\n                      ng-click="action.cb(item)"\n                      title="{{action.label}}">\n                      <i\n                        class="glyphicon glyphicon-{{action.icon}}"\n                        style="color: {{action.color}};"></i>\n                    </a>\n                  </td>\n                </tr>\n              </tbody>\n            </table>\n            <xos-pagination\n              ng-if="vm.config.pagination"\n              page-size="vm.config.pagination.pageSize"\n              total-elements="vm.data.length"\n              change="vm.goToPage">\n              </xos-pagination>\n          </div>\n          <div ng-show="vm.data.length == 0 || !vm.data">\n             <xos-alert config="{type: \'info\'}">\n              No data to show.\n            </xos-alert>\n          </div>\n        ',
-      bindToController: true,
-      controllerAs: 'vm',
-      controller: ["_", function controller(_) {
-        var _this = this;
-
-        if (!this.config) {
-          throw new Error('[xosTable] Please provide a configuration via the "config" attribute');
-        }
-
-        if (!this.config.columns) {
-          throw new Error('[xosTable] Please provide a columns list in the configuration');
-        }
-
-        // handle default ordering
-        if (this.config.order && angular.isObject(this.config.order)) {
-          this.reverse = this.config.order.reverse || false;
-          this.orderBy = this.config.order.field || 'id';
-        }
-
-        // if columns with type 'custom' are provided
-        // check that a custom formatte3 is provided too
-        var customCols = _.filter(this.config.columns, { type: 'custom' });
-        if (angular.isArray(customCols) && customCols.length > 0) {
-          _.forEach(customCols, function (col) {
-            if (!col.formatter || !angular.isFunction(col.formatter)) {
-              throw new Error('[xosTable] You have provided a custom field type, a formatter function should provided too.');
-            }
-          });
-        }
-
-        // if columns with type 'icon' are provided
-        // check that a custom formatte3 is provided too
-        var iconCols = _.filter(this.config.columns, { type: 'icon' });
-        if (angular.isArray(iconCols) && iconCols.length > 0) {
-          _.forEach(iconCols, function (col) {
-            if (!col.formatter || !angular.isFunction(col.formatter)) {
-              throw new Error('[xosTable] You have provided an icon field type, a formatter function should provided too.');
-            }
-          });
-        }
-
-        // if a link property is passed,
-        // it should be a function
-        var linkedColumns = _.filter(this.config.columns, function (col) {
-          return angular.isDefined(col.link);
-        });
-        if (angular.isArray(linkedColumns) && linkedColumns.length > 0) {
-          _.forEach(linkedColumns, function (col) {
-            if (!angular.isFunction(col.link)) {
-              throw new Error('[xosTable] The link property should be a function.');
-            }
-          });
-        }
-
-        this.columns = this.config.columns;
-        this.classes = this.config.classes || 'table table-striped table-bordered';
-
-        if (this.config.actions) {
-          // TODO validate action format
-        }
-        if (this.config.pagination) {
-          this.currentPage = 0;
-          this.goToPage = function (n) {
-            _this.currentPage = n;
-          };
-        }
-      }]
-    };
-  })
-  // TODO move in separate files
-  // TODO test
-  .filter('arrayToList', function () {
-    return function (input) {
-      if (!angular.isArray(input)) {
-        return input;
-      }
-      return input.join(', ');
-    };
-  })
-  // TODO test
-  .directive('linkWrapper', function () {
-    return {
-      restrict: 'A',
-      transclude: true,
-      template: '\n          <a ng-if="col.link" href="{{col.link(item)}}">\n            <div ng-transclude></div>\n          </a>\n          <div ng-transclude ng-if="!col.link"></div>\n        '
-    };
-  });
-})();
-//# sourceMappingURL=../../../maps/ui_components/dumbComponents/table/table.component.js.map
-
-'use strict';
-
-/**
- * © OpenCORD
- *
- * Visit http://guide.xosproject.org/devguide/addview/ for more information
- *
- * Created by teone on 4/15/16.
- */
-
-(function () {
-  'use strict';
-
-  angular.module('xos.uiComponents')
-
-  /**
-    * @ngdoc directive
-    * @name xos.uiComponents.directive:xosPagination
-    * @restrict E
-    * @description The xos-table directive
-    * @param {Number} pageSize Number of elements per page
-    * @param {Number} totalElements Number of total elements in the collection
-    * @param {Function} change The callback to be triggered on page change.
-    * * @element ANY
-    * @scope
-    * @example
-  <example module="samplePagination">
-    <file name="index.html">
-      <div ng-controller="SampleCtrl1 as vm">
-        <xos-pagination
-          page-size="vm.pageSize"
-          total-elements="vm.totalElements"
-          change="vm.change">
-        </xos-pagination>
-      </div>
-    </file>
-    <file name="script.js">
-      angular.module('samplePagination', ['xos.uiComponents'])
-      .controller('SampleCtrl1', function(){
-        this.pageSize = 10;
-        this.totalElements = 35;
-        this.change = (pageNumber) => {
-          console.log(pageNumber);
-        }
-      });
-    </file>
-  </example>
-  **/
-
-  .directive('xosPagination', function () {
-    return {
-      restrict: 'E',
-      scope: {
-        pageSize: '=',
-        totalElements: '=',
-        change: '='
-      },
-      template: '\n        <div class="row" ng-if="vm.pageList.length > 1">\n          <div class="col-xs-12 text-center">\n            <ul class="pagination">\n              <li\n                ng-click="vm.goToPage(vm.currentPage - 1)"\n                ng-class="{disabled: vm.currentPage == 0}">\n                <a href="" aria-label="Previous">\n                    <span aria-hidden="true">&laquo;</span>\n                </a>\n              </li>\n              <li ng-repeat="i in vm.pageList" ng-class="{active: i === vm.currentPage}">\n                <a href="" ng-click="vm.goToPage(i)">{{i + 1}}</a>\n              </li>\n              <li\n                ng-click="vm.goToPage(vm.currentPage + 1)"\n                ng-class="{disabled: vm.currentPage == vm.pages - 1}">\n                <a href="" aria-label="Next">\n                    <span aria-hidden="true">&raquo;</span>\n                </a>\n              </li>\n            </ul>\n          </div>\n        </div>\n      ',
-      bindToController: true,
-      controllerAs: 'vm',
-      controller: ["$scope", function controller($scope) {
-        var _this = this;
-
-        this.currentPage = 0;
-
-        this.goToPage = function (n) {
-          if (n < 0 || n === _this.pages) {
-            return;
-          }
-          _this.currentPage = n;
-          _this.change(n);
-        };
-
-        this.createPages = function (pages) {
-          var arr = [];
-          for (var i = 0; i < pages; i++) {
-            arr.push(i);
-          }
-          return arr;
-        };
-
-        // watch for data changes
-        $scope.$watch(function () {
-          return _this.totalElements;
-        }, function () {
-          if (_this.totalElements) {
-            _this.pages = Math.ceil(_this.totalElements / _this.pageSize);
-            _this.pageList = _this.createPages(_this.pages);
-          }
-        });
-      }]
-    };
-  }).filter('pagination', function () {
-    return function (input, start) {
-      if (!input || !angular.isArray(input)) {
-        return input;
-      }
-      start = parseInt(start, 10);
-      return input.slice(start);
-    };
-  });
-})();
-//# sourceMappingURL=../../../maps/ui_components/dumbComponents/pagination/pagination.component.js.map
-
-'use strict';
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
-
-/**
- * © OpenCORD
- *
- * Visit http://guide.xosproject.org/devguide/addview/ for more information
- *
- * Created by teone on 4/18/16.
- */
-
-(function () {
-  'use strict';
-
-  angular.module('xos.uiComponents')
-
-  /**
-    * @ngdoc directive
-    * @name xos.uiComponents.directive:xosForm
-    * @restrict E
-    * @description The xos-form directive.
-    * This components have two usage, given a model it is able to autogenerate a form or it can be configured to create a custom form.
-    * @param {Object} config The configuration object
-    * ```
-    * {
-    *   exclude: ['id', 'validators', 'created', 'updated', 'deleted'], //field to be skipped in the form, the provide values are concatenated
-    *   actions: [ // define the form buttons with related callback
-    *     {
-            label: 'save',
-            icon: 'ok', // refers to bootstraps glyphicon
-            cb: (user) => { // receive the model
-              console.log(user);
-            },
-            class: 'success'
-          }
-    *   ],
-    *   fields: {
-    *     field_name: {
-    *       label: 'Field Label',
-    *       type: 'string' // options are: [date, boolean, number, email, string],
-    *       validators: {
-    *         minlength: number,
-              maxlength: number,
-              required: boolean,
-              min: number,
-              max: number
-    *       }
-    *     }
-    *   }
-    * }
-    * ```
-    * @element ANY
-    * @scope
-    * @example
-    
-    Autogenerated form
-   <example module="sampleForm">
-    <file name="script.js">
-      angular.module('sampleForm', ['xos.uiComponents'])
-      .factory('_', function($window){
-        return $window._;
-      })
-      .controller('SampleCtrl', function(){
-        this.model = {
-          first_name: 'Jhon',
-          last_name: 'Doe',
-          email: 'jhon.doe@sample.com',
-          active: true,
-          birthDate: '2015-02-17T22:06:38.059000Z'
-        }
-        this.config = {
-          exclude: ['password', 'last_login'],
-          formName: 'sampleForm',
-          actions: [
-            {
-              label: 'Save',
-              icon: 'ok', // refers to bootstraps glyphicon
-              cb: (user) => { // receive the model
-                console.log(user);
-              },
-              class: 'success'
-            }
-          ]
-        };
-      });
-    </file>
-    <file name="index.html">
-      <div ng-controller="SampleCtrl as vm">
-        <xos-form ng-model="vm.model" config="vm.config"></xos-form>
-      </div>
-    </file>
-  </example>
-   Configuration defined form
-   <example module="sampleForm1">
-    <file name="script.js">
-      angular.module('sampleForm1', ['xos.uiComponents'])
-      .factory('_', function($window){
-        return $window._;
-      })
-      .controller('SampleCtrl1', function(){
-        this.model = {
-        };
-         this.config = {
-          exclude: ['password', 'last_login'],
-          formName: 'sampleForm1',
-          actions: [
-            {
-              label: 'Save',
-              icon: 'ok', // refers to bootstraps glyphicon
-              cb: (user) => { // receive the model
-                console.log(user);
-              },
-              class: 'success'
-            }
-          ],
-          fields: {
-            first_name: {
-              type: 'string',
-              validators: {
-                required: true
-              }
-            },
-            last_name: {
-              label: 'Surname',
-              type: 'string',
-              validators: {
-                required: true,
-                minlength: 10
-              }
-            },
-            age: {
-              type: 'number',
-              validators: {
-                required: true,
-                min: 21
-              }
-            },
-          }
-        };
-      });
-    </file>
-    <file name="index.html">
-      <div ng-controller="SampleCtrl1 as vm">
-        <xos-form ng-model="vm.model" config="vm.config"></xos-form>
-      </div>
-    </file>
-  </example>
-   **/
-
-  .directive('xosForm', function () {
-    return {
-      restrict: 'E',
-      scope: {
-        config: '=',
-        ngModel: '='
-      },
-      template: '\n        <ng-form name="vm.{{vm.config.formName || \'form\'}}">\n          <div class="form-group" ng-repeat="(name, field) in vm.formField">\n            <label>{{field.label}}</label>\n            <input\n              ng-if="field.type !== \'boolean\'"\n              type="{{field.type}}"\n              name="{{name}}"\n              class="form-control"\n              ng-model="vm.ngModel[name]"\n              ng-minlength="field.validators.minlength || 0"\n              ng-maxlength="field.validators.maxlength || 2000"\n              ng-required="field.validators.required || false" />\n            <span class="boolean-field" ng-if="field.type === \'boolean\'">\n              <button\n                class="btn btn-success"\n                ng-show="vm.ngModel[name]"\n                ng-click="vm.ngModel[name] = false">\n                <i class="glyphicon glyphicon-ok"></i>\n              </button>\n              <button\n                class="btn btn-danger"\n                ng-show="!vm.ngModel[name]"\n                ng-click="vm.ngModel[name] = true">\n                <i class="glyphicon glyphicon-remove"></i>\n              </button>\n            </span>\n            <!-- <pre>{{vm[vm.config.formName][name].$error | json}}</pre> -->\n            <xos-validation errors="vm[vm.config.formName || \'form\'][name].$error"></xos-validation>\n          </div>\n          <div class="form-group" ng-if="vm.config.actions">\n            <button role="button" href=""\n              ng-repeat="action in vm.config.actions"\n              ng-click="action.cb(vm.ngModel)"\n              class="btn btn-{{action.class}}"\n              title="{{action.label}}">\n              <i class="glyphicon glyphicon-{{action.icon}}"></i>\n              {{action.label}}\n            </button>\n          </div>\n        </ng-form>\n      ',
-      bindToController: true,
-      controllerAs: 'vm',
-      controller: ["$scope", "$log", "_", "XosFormHelpers", function controller($scope, $log, _, XosFormHelpers) {
-        var _this = this;
-
-        if (!this.config) {
-          throw new Error('[xosForm] Please provide a configuration via the "config" attribute');
-        }
-
-        if (!this.config.actions) {
-          throw new Error('[xosForm] Please provide an action list in the configuration');
-        }
-
-        this.excludedField = ['id', 'validators', 'created', 'updated', 'deleted', 'backend_status'];
-        if (this.config && this.config.exclude) {
-          this.excludedField = this.excludedField.concat(this.config.exclude);
-        }
-
-        this.formField = [];
-        $scope.$watch(function () {
-          return _this.ngModel;
-        }, function (model) {
-
-          // empty from old stuff
-          _this.formField = {};
-
-          if (!model) {
-            return;
-          }
-
-          var diff = _.difference(Object.keys(model), _this.excludedField);
-          var modelField = XosFormHelpers.parseModelField(diff);
-          _this.formField = XosFormHelpers.buildFormStructure(modelField, _this.config.fields, model);
-        });
-      }]
-    };
-  }).service('XosFormHelpers', ["_", "LabelFormatter", function (_, LabelFormatter) {
-    var _this2 = this;
-
-    this._isEmail = function (text) {
-      var re = /(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
-      return re.test(text);
-    };
-
-    this._getFieldFormat = function (value) {
-
-      // check if is date
-      if (_.isDate(value) || !Number.isNaN(Date.parse(value)) && new Date(value).getTime() > 631180800000) {
-        return 'date';
-      }
-
-      // check if is boolean
-      // isNaN(false) = false, false is a number (0), true is a number (1)
-      if (typeof value === 'boolean') {
-        return 'boolean';
-      }
-
-      // check if a string is a number
-      if (!isNaN(value) && value !== null) {
-        return 'number';
-      }
-
-      // check if a string is an email
-      if (_this2._isEmail(value)) {
-        return 'email';
-      }
-
-      // if null return string
-      if (value === null) {
-        return 'string';
-      }
-
-      return typeof value === 'undefined' ? 'undefined' : _typeof(value);
-    };
-
-    this.buildFormStructure = function (modelField, customField, model) {
-
-      modelField = Object.keys(modelField).length > 0 ? modelField : customField; //if no model field are provided, check custom
-      customField = customField || {};
-
-      return _.reduce(Object.keys(modelField), function (form, f) {
-
-        form[f] = {
-          label: customField[f] && customField[f].label ? customField[f].label + ':' : LabelFormatter.format(f),
-          type: customField[f] && customField[f].type ? customField[f].type : _this2._getFieldFormat(model[f]),
-          validators: customField[f] && customField[f].validators ? customField[f].validators : {}
-        };
-
-        if (form[f].type === 'date') {
-          model[f] = new Date(model[f]);
-        }
-
-        if (form[f].type === 'number') {
-          model[f] = parseInt(model[f], 10);
-        }
-
-        return form;
-      }, {});
-    };
-
-    this.parseModelField = function (fields) {
-      return _.reduce(fields, function (form, f) {
-        form[f] = {};
-        return form;
-      }, {});
-    };
-  }]);
-})();
-//# sourceMappingURL=../../../maps/ui_components/dumbComponents/form/form.component.js.map
-
-'use strict';
-
-/**
- * © OpenCORD
- *
- * Visit http://guide.xosproject.org/devguide/addview/ for more information
- *
- * Created by teone on 4/15/16.
- */
-
-(function () {
-  'use strict';
-
-  angular.module('xos.uiComponents')
-
-  /**
-    * @ngdoc directive
-    * @name xos.uiComponents.directive:xosAlert
-    * @restrict E
-    * @description The xos-alert directive
-    * @param {Object} config The configuration object
-    * ```
-    * {
-    *   type: 'danger', //info, success, warning
-    *   closeBtn: true, //default false
-    *   autoHide: 3000 //delay to automatically hide the alert
-    * }
-    * ```
-    * @param {Boolean=} show Binding to show and hide the alert, default to true
-    * @element ANY
-    * @scope
-    * @example
-  <example module="sampleAlert1">
-    <file name="index.html">
-      <div ng-controller="SampleCtrl1 as vm">
-        <xos-alert config="vm.config1">
-          A sample alert message
-        </xos-alert>
-        <xos-alert config="vm.config2">
-          A sample alert message (with close button)
-        </xos-alert>
-        <xos-alert config="vm.config3">
-          A sample info message
-        </xos-alert>
-        <xos-alert config="vm.config4">
-          A sample success message
-        </xos-alert>
-        <xos-alert config="vm.config5">
-          A sample warning message
-        </xos-alert>
-      </div>
-    </file>
-    <file name="script.js">
-      angular.module('sampleAlert1', ['xos.uiComponents'])
-      .controller('SampleCtrl1', function(){
-        this.config1 = {
-          type: 'danger'
-        };
-         this.config2 = {
-          type: 'danger',
-          closeBtn: true
-        };
-         this.config3 = {
-          type: 'info'
-        };
-         this.config4 = {
-          type: 'success'
-        };
-         this.config5 = {
-          type: 'warning'
-        };
-      });
-    </file>
-  </example>
-   <example module="sampleAlert2" animations="true">
-    <file name="index.html">
-      <div ng-controller="SampleCtrl as vm" class="row">
-        <div class="col-sm-4">
-          <a class="btn btn-default btn-block" ng-show="!vm.show" ng-click="vm.show = true">Show Alert</a>
-          <a class="btn btn-default btn-block" ng-show="vm.show" ng-click="vm.show = false">Hide Alert</a>
-        </div>
-        <div class="col-sm-8">
-          <xos-alert config="vm.config1" show="vm.show">
-            A sample alert message, not displayed by default.
-          </xos-alert>
-        </div>
-      </div>
-    </file>
-    <file name="script.js">
-      angular.module('sampleAlert2', ['xos.uiComponents', 'ngAnimate'])
-      .controller('SampleCtrl', function(){
-        this.config1 = {
-          type: 'success'
-        };
-         this.show = false;
-      });
-    </file>
-  </example>
-  **/
-
-  .directive('xosAlert', function () {
-    return {
-      restrict: 'E',
-      scope: {
-        config: '=',
-        show: '=?'
-      },
-      template: '\n        <div ng-cloak class="alert alert-{{vm.config.type}}" ng-hide="!vm.show">\n          <button type="button" class="close" ng-if="vm.config.closeBtn" ng-click="vm.dismiss()">\n            <span aria-hidden="true">&times;</span>\n          </button>\n          <p ng-transclude></p>\n        </div>\n      ',
-      transclude: true,
-      bindToController: true,
-      controllerAs: 'vm',
-      controller: ["$timeout", function controller($timeout) {
-        var _this = this;
-
-        if (!this.config) {
-          throw new Error('[xosAlert] Please provide a configuration via the "config" attribute');
-        }
-
-        // default the value to true
-        this.show = this.show !== false;
-
-        this.dismiss = function () {
-          _this.show = false;
-        };
-
-        if (this.config.autoHide) {
-          (function () {
-            var to = $timeout(function () {
-              _this.dismiss();
-              $timeout.cancel(to);
-            }, _this.config.autoHide);
-          })();
-        }
-      }]
-    };
-  });
-})();
-//# sourceMappingURL=../../../maps/ui_components/dumbComponents/alert/alert.component.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  config.$inject = ["$httpProvider", "$interpolateProvider", "$resourceProvider"];
-  angular.module('bugSnag', []).factory('$exceptionHandler', function () {
-    return function (exception, cause) {
-      if (window.Bugsnag) {
-        Bugsnag.notifyException(exception, { diagnostics: { cause: cause } });
-      } else {
-        console.error(exception, cause, exception.stack);
-      }
-    };
-  });
-
-  /**
-  * @ngdoc overview
-  * @name xos.helpers
-  * @description this is the module that group all the helpers service and components for XOS
-  **/
-
-  angular.module('xos.helpers', ['ngCookies', 'ngResource', 'ngAnimate', 'bugSnag', 'xos.uiComponents']).config(config).factory('_', ["$window", function ($window) {
-    return $window._;
-  }]);
-
-  function config($httpProvider, $interpolateProvider, $resourceProvider) {
-    $httpProvider.interceptors.push('SetCSRFToken');
-
-    $interpolateProvider.startSymbol('{$');
-    $interpolateProvider.endSymbol('$}');
-
-    // NOTE http://www.masnun.com/2013/09/18/django-rest-framework-angularjs-resource-trailing-slash-problem.html
-    $resourceProvider.defaults.stripTrailingSlashes = false;
-  }
-})();
-//# sourceMappingURL=maps/xosHelpers.module.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.vSG-Collection
-  * @description Angular resource to fetch /api/service/vsg/
-  **/
-  .service('vSG-Collection', ["$resource", function ($resource) {
-    return $resource('/api/service/vsg/');
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/vSG.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.vOLT-Collection
-  * @description Angular resource to fetch /api/tenant/cord/volt/:volt_id/
-  **/
-  .service('vOLT-Collection', ["$resource", function ($resource) {
-    return $resource('/api/tenant/cord/volt/:volt_id/', { volt_id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/vOLT.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Login
-  * @description Angular resource to fetch /api/utility/login/
-  **/
-  .service('Login', ["$resource", function ($resource) {
-    return $resource('/api/utility/login/');
-  }])
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Logout
-  * @description Angular resource to fetch /api/utility/logout/
-  **/
-  .service('Logout', ["$resource", function ($resource) {
-    return $resource('/api/utility/logout/');
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Utility.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Users
-  * @description Angular resource to fetch /api/core/users/:id/
-  **/
-  .service('Users', ["$resource", function ($resource) {
-    return $resource('/api/core/users/:id/', { id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Users.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Truckroll
-  * @description Angular resource to fetch /api/tenant/truckroll/:id/
-  **/
-  .service('Truckroll', ["$resource", function ($resource) {
-    return $resource('/api/tenant/truckroll/:id/', { id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Truckroll.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Tenant
-  * @description Angular resource to fetch /api/core/tenant/:id/
-  **/
-  .service('Tenants', ["$resource", function ($resource) {
-    return $resource('/api/core/tenants/:id/', { id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Tenant.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Subscribers
-  * @description Angular resource to fetch Subscribers
-  **/
-  .service('Subscribers', ["$resource", function ($resource) {
-    return $resource('/api/tenant/cord/subscriber/:id/', { id: '@id' }, {
-      update: { method: 'PUT' },
-      /**
-      * @ngdoc method
-      * @name xos.helpers.Subscribers#View-a-Subscriber-Features-Detail
-      * @methodOf xos.helpers.Subscribers
-      * @description
-      * View-a-Subscriber-Features-Detail
-      **/
-      'View-a-Subscriber-Features-Detail': {
-        method: 'GET',
-        isArray: false,
-        url: '/api/tenant/cord/subscriber/:id/features/'
-      },
-      /**
-      * @ngdoc method
-      * @name xos.helpers.Subscribers#Read-Subscriber-uplink_speed
-      * @methodOf xos.helpers.Subscribers
-      * @description
-      * Read-Subscriber-uplink_speed
-      **/
-      'Read-Subscriber-uplink_speed': {
-        method: 'GET',
-        isArray: false,
-        url: '/api/tenant/cord/subscriber/:id/features/uplink_speed/'
-      },
-      /**
-      * @ngdoc method
-      * @name xos.helpers.Subscribers#Update-Subscriber-uplink_speed
-      * @methodOf xos.helpers.Subscribers
-      * @description
-      * Update-Subscriber-uplink_speed
-      **/
-      'Update-Subscriber-uplink_speed': {
-        method: 'PUT',
-        isArray: false,
-        url: '/api/tenant/cord/subscriber/:id/features/uplink_speed/'
-      },
-      /**
-      * @ngdoc method
-      * @name xos.helpers.Subscribers#Read-Subscriber-downlink_speed
-      * @methodOf xos.helpers.Subscribers
-      * @description
-      * Read-Subscriber-downlink_speed
-      **/
-      'Read-Subscriber-downlink_speed': {
-        method: 'GET',
-        isArray: false,
-        url: '/api/tenant/cord/subscriber/:id/features/downlink_speed/'
-      },
-      /**
-      * @ngdoc method
-      * @name xos.helpers.Subscribers#Update-Subscriber-downlink_speed
-      * @methodOf xos.helpers.Subscribers
-      * @description
-      * Update-Subscriber-downlink_speed
-      **/
-      'Update-Subscriber-downlink_speed': {
-        method: 'PUT',
-        isArray: false,
-        url: '/api/tenant/cord/subscriber/:id/features/downlink_speed/'
-      },
-      /**
-      * @ngdoc method
-      * @name xos.helpers.Subscribers#Read-Subscriber-cdn
-      * @methodOf xos.helpers.Subscribers
-      * @description
-      * Read-Subscriber-cdn
-      **/
-      'Read-Subscriber-cdn': {
-        method: 'GET',
-        isArray: false,
-        url: '/api/tenant/cord/subscriber/:id/features/cdn/'
-      },
-      /**
-      * @ngdoc method
-      * @name xos.helpers.Subscribers#Update-Subscriber-cdn
-      * @methodOf xos.helpers.Subscribers
-      * @description
-      * Update-Subscriber-cdn
-      **/
-      'Update-Subscriber-cdn': {
-        method: 'PUT',
-        isArray: false,
-        url: '/api/tenant/cord/subscriber/:id/features/cdn/'
-      },
-      /**
-      * @ngdoc method
-      * @name xos.helpers.Subscribers#Read-Subscriber-uverse
-      * @methodOf xos.helpers.Subscribers
-      * @description
-      * Read-Subscriber-uverse
-      **/
-      'Read-Subscriber-uverse': {
-        method: 'GET',
-        isArray: false,
-        url: '/api/tenant/cord/subscriber/:id/features/uverse/'
-      },
-      /**
-      * @ngdoc method
-      * @name xos.helpers.Subscribers#Update-Subscriber-uverse
-      * @methodOf xos.helpers.Subscribers
-      * @description
-      * Update-Subscriber-uverse
-      **/
-      'Update-Subscriber-uverse': {
-        method: 'PUT',
-        isArray: false,
-        url: '/api/tenant/cord/subscriber/:id/features/uverse/'
-      },
-      /**
-      * @ngdoc method
-      * @name xos.helpers.Subscribers#Read-Subscriber-status
-      * @methodOf xos.helpers.Subscribers
-      * @description
-      * Read-Subscriber-status
-      **/
-      'Read-Subscriber-status': {
-        method: 'GET',
-        isArray: false,
-        url: '/api/tenant/cord/subscriber/:id/features/status/'
-      },
-      /**
-      * @ngdoc method
-      * @name xos.helpers.Subscribers#Update-Subscriber-status
-      * @methodOf xos.helpers.Subscribers
-      * @description
-      * Update-Subscriber-status
-      **/
-      'Update-Subscriber-status': {
-        method: 'PUT',
-        isArray: false,
-        url: '/api/tenant/cord/subscriber/:id/features/status/'
-      }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Subscribers.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.SlicesPlus
-  * @description Angular resource to fetch /api/utility/slicesplus/
-  * This is a read-only API and only the `query` method is currently supported.
-  **/
-  .service('SlicesPlus', ["$http", "$q", function ($http, $q) {
-    this.query = function (params) {
-      var deferred = $q.defer();
-
-      $http.get('/api/utility/slicesplus/', { params: params }).then(function (res) {
-        deferred.resolve(res.data);
-      }).catch(function (res) {
-        deferred.reject(res.data);
-      });
-
-      return { $promise: deferred.promise };
-    };
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Slices_plus.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Slices
-  * @description Angular resource to fetch /api/core/slices/:id/
-  **/
-  .service('Slices', ["$resource", function ($resource) {
-    return $resource('/api/core/slices/:id/', { id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Slices.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Sites
-  * @description Angular resource to fetch /api/core/sites/:id/
-  **/
-  .service('Sites', ["$resource", function ($resource) {
-    return $resource('/api/core/sites/:id/', { id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Sites.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Services
-  * @description Angular resource to fetch /api/core/services/:id/
-  **/
-  .service('Services', ["$resource", function ($resource) {
-    return $resource('/api/core/services/:id/', { id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Services.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.ONOS-Services-Collection
-  * @description Angular resource to fetch /api/service/onos/
-  **/
-  .service('ONOS-Services-Collection', ["$resource", function ($resource) {
-    return $resource('/api/service/onos/');
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/ONOS-Services.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.ONOS-App-Collection
-  * @description Angular resource to fetch /api/tenant/onos/app/
-  **/
-  .service('ONOS-App-Collection', ["$resource", function ($resource) {
-    return $resource('/api/tenant/onos/app/');
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/ONOS-Apps.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Nodes
-  * @description Angular resource to fetch /api/core/nodes/:id/
-  **/
-  .service('Nodes', ["$resource", function ($resource) {
-    return $resource('/api/core/nodes/:id/', { id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Nodes.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Networks
-  * @description Angular resource to fetch /api/core/networks/:id/
-  **/
-  .service('Networks', ["$resource", function ($resource) {
-    return $resource('/api/core/networks/:id/', { id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Networks.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Instances
-  * @description Angular resource to fetch /api/core/instances/:id/
-  **/
-  .service('Instances', ["$resource", function ($resource) {
-    return $resource('/api/core/instances/:id/', { id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Instances.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Flavors
-  * @description Angular resource to fetch /api/core/flavors/:id/
-  **/
-  .service('Flavors', ["$resource", function ($resource) {
-    return $resource('/api/core/flavors/:id/', { id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Flavors.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Example-Services-Collection
-  * @description Angular resource to fetch /api/service/exampleservice/
-  **/
-  .service('Example-Services-Collection', ["$resource", function ($resource) {
-    return $resource('/api/service/exampleservice/');
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Example.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  angular.module('xos.helpers')
-  /**
-  * @ngdoc service
-  * @name xos.helpers.Deployments
-  * @description Angular resource to fetch /api/core/deployments/:id/
-  **/
-  .service('Deployments', ["$resource", function ($resource) {
-    return $resource('/api/core/deployments/:id/', { id: '@id' }, {
-      update: { method: 'PUT' }
-    });
-  }]);
-})();
-//# sourceMappingURL=../../maps/services/rest/Deployments.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  /**
-  * @ngdoc service
-  * @name xos.helpers.ServiceGraph
-  * @description This factory define a set of helper function to query the service tenancy graph
-  **/
-
-  angular.module('xos.helpers').service('GraphService', ["$q", "Tenants", "Services", function ($q, Tenants, Services) {
-    var _this = this;
-
-    this.loadCoarseData = function () {
-
-      var services = void 0;
-
-      var deferred = $q.defer();
-
-      Services.query().$promise.then(function (res) {
-        services = res;
-        return Tenants.query({ kind: 'coarse' }).$promise;
-      }).then(function (tenants) {
-        deferred.resolve({
-          tenants: tenants,
-          services: services
-        });
-      });
-
-      return deferred.promise;
-    };
-
-    this.getCoarseGraph = function () {
-      _this.loadCoarseData().then(function (res) {
-        console.log(res);
-      });
-      return 'ciao';
-    };
-  }]);
-})();
-//# sourceMappingURL=../maps/services/service_graph.service.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  /**
-  * @ngdoc service
-  * @name xos.helpers.NoHyperlinks
-  * @description This factory is automatically loaded trough xos.helpers and will add an $http interceptor that will add ?no_hyperlinks=1 to your api request, that is required by django
-  **/
-
-  angular.module('xos.helpers').factory('NoHyperlinks', noHyperlinks);
-
-  function noHyperlinks() {
-    return {
-      request: function request(_request) {
-        if (_request.url.indexOf('.html') === -1) {
-          _request.url += '?no_hyperlinks=1';
-        }
-        return _request;
-      }
-    };
-  }
-})();
-//# sourceMappingURL=../maps/services/noHyperlinks.interceptor.js.map
-
-'use strict';
-
-// TODO write tests for log
-
-angular.module('xos.helpers').config(['$provide', function ($provide) {
-  // Use the `decorator` solution to substitute or attach behaviors to
-  // original service instance; @see angular-mocks for more examples....
-
-  $provide.decorator('$log', ['$delegate', function ($delegate) {
-
-    var isLogEnabled = function isLogEnabled() {
-      return window.location.href.indexOf('debug=true') >= 0;
-    };
-    // Save the original $log.debug()
-    var logFn = $delegate.log;
-    var infoFn = $delegate.info;
-    var warnFn = $delegate.warn;
-    var errorFn = $delegate.error;
-    var debugFn = $delegate.debug;
-
-    // create the replacement function
-    var replacement = function replacement(fn) {
-      return function () {
-        // console.log(`Is Log Enabled: ${isLogEnabled()}`)
-        if (!isLogEnabled()) {
-          // console.log('logging is disabled');
-          return;
-        }
-        var args = [].slice.call(arguments);
-        var now = new Date();
-
-        // Prepend timestamp
-        args[0] = '[' + now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds() + '] ' + args[0];
-
-        // HACK awfull fix for angular mock implementation whithin jasmine test failing issue
-        if (typeof $delegate.reset === 'function' && !($delegate.debug.logs instanceof Array)) {
-          // if we are within the mock and did not reset yet, we call it to avoid issue
-          // console.log('mock log impl fix to avoid logs array not existing...');
-          $delegate.reset();
-        }
-
-        // Call the original with the output prepended with formatted timestamp
-        fn.apply(null, args);
-      };
-    };
-
-    $delegate.info = replacement(infoFn);
-    $delegate.log = replacement(logFn);
-    $delegate.warn = replacement(warnFn);
-    $delegate.error = replacement(errorFn);
-    $delegate.debug = replacement(debugFn);
-
-    return $delegate;
-  }]);
-}]);
-//# sourceMappingURL=../maps/services/log.decorator.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  /**
-  * @ngdoc service
-  * @name xos.helpers.LabelFormatter
-  * @description This factory define a set of helper function to format label started from an object property
-  **/
-
-  angular.module('xos.uiComponents').factory('LabelFormatter', labelFormatter);
-
-  function labelFormatter() {
-
-    var _formatByUnderscore = function _formatByUnderscore(string) {
-      return string.split('_').join(' ').trim();
-    };
-
-    var _formatByUppercase = function _formatByUppercase(string) {
-      return string.split(/(?=[A-Z])/).map(function (w) {
-        return w.toLowerCase();
-      }).join(' ');
-    };
-
-    var _capitalize = function _capitalize(string) {
-      return string.slice(0, 1).toUpperCase() + string.slice(1);
-    };
-
-    var format = function format(string) {
-      string = _formatByUnderscore(string);
-      string = _formatByUppercase(string);
-
-      string = _capitalize(string).replace(/\s\s+/g, ' ') + ':';
-      return string.replace('::', ':');
-    };
-
-    return {
-      // test export
-      _formatByUnderscore: _formatByUnderscore,
-      _formatByUppercase: _formatByUppercase,
-      _capitalize: _capitalize,
-      // export to use
-      format: format
-    };
-  }
-})();
-//# sourceMappingURL=../maps/services/label_formatter.service.js.map
-
-'use strict';
-
-(function () {
-  'use strict';
-
-  /**
-  * @ngdoc service
-  * @name xos.helpers.SetCSRFToken
-  * @description This factory is automatically loaded trough xos.helpers and will add an $http interceptor that will the CSRF-Token to your request headers
-  **/
-
-  setCSRFToken.$inject = ["$cookies"];
-  angular.module('xos.helpers').factory('SetCSRFToken', setCSRFToken);
-
-  function setCSRFToken($cookies) {
-    return {
-      request: function request(_request) {
-        if (_request.method !== 'GET') {
-          _request.headers['X-CSRFToken'] = $cookies.get('xoscsrftoken');
-        }
-        return _request;
-      }
-    };
-  }
-})();
-//# sourceMappingURL=../maps/services/csrfToken.interceptor.js.map
+"use strict";!function(){angular.module("xos.uiComponents",["chart.js","RecursionHelper"])}();var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};!function(){angular.module("xos.uiComponents").directive("xosSmartTable",function(){return{restrict:"E",scope:{config:"="},template:'\n        <div class="row" ng-show="vm.data.length > 0">\n          <div class="col-xs-12 text-right">\n            <a href="" class="btn btn-success" ng-click="vm.createItem()">\n              Add\n            </a>\n          </div>\n        </div>\n        <div class="row">\n          <div class="col-xs-12 table-responsive">\n            <xos-table config="vm.tableConfig" data="vm.data"></xos-table>\n          </div>\n        </div>\n        <div class="panel panel-default" ng-show="vm.detailedItem">\n          <div class="panel-heading">\n            <div class="row">\n              <div class="col-xs-11">\n                <h3 class="panel-title" ng-show="vm.detailedItem.id">Update {{vm.config.resource}} {{vm.detailedItem.id}}</h3>\n                <h3 class="panel-title" ng-show="!vm.detailedItem.id">Create {{vm.config.resource}} item</h3>\n              </div>\n              <div class="col-xs-1">\n                <a href="" ng-click="vm.cleanForm()">\n                  <i class="glyphicon glyphicon-remove pull-right"></i>\n                </a>\n              </div>\n            </div>\n          </div>\n          <div class="panel-body">\n            <xos-form config="vm.formConfig" ng-model="vm.detailedItem"></xos-form>\n          </div>\n        </div>\n        <xos-alert config="{type: \'success\', closeBtn: true}" show="vm.responseMsg">{{vm.responseMsg}}</xos-alert>\n        <xos-alert config="{type: \'danger\', closeBtn: true}" show="vm.responseErr">{{vm.responseErr}}</xos-alert>\n      ',bindToController:!0,controllerAs:"vm",controller:["$injector","LabelFormatter","_","XosFormHelpers",function(e,n,o,t){var i=this;this.responseMsg=!1,this.responseErr=!1,this.tableConfig={columns:[],actions:[{label:"delete",icon:"remove",cb:function(e){i.Resource["delete"]({id:e.id}).$promise.then(function(){o.remove(i.data,function(n){return n.id===e.id}),i.responseMsg=i.config.resource+" with id "+e.id+" successfully deleted"})["catch"](function(n){i.responseErr=n.data.detail||"Error while deleting "+i.config.resource+" with id "+e.id})},color:"red"},{label:"details",icon:"search",cb:function(e){i.detailedItem=e}}],classes:"table table-striped table-bordered table-responsive",filter:"field",order:!0,pagination:{pageSize:10}},this.formConfig={exclude:this.config.hiddenFields,fields:{},formName:this.config.resource+"Form",actions:[{label:"Save",icon:"ok",cb:function(e){var n=void 0,o=!0;e.id?(n=e.$update(),o=!1):n=e.$save(),n.then(function(n){o&&i.data.push(angular.copy(n)),delete i.detailedItem,i.responseMsg=i.config.resource+" with id "+e.id+" successfully saved"})["catch"](function(n){i.responseErr=n.data.detail||"Error while saving "+i.config.resource+" with id "+e.id})},"class":"success"}]},this.cleanForm=function(){delete i.detailedItem},this.createItem=function(){i.detailedItem=new i.Resource},this.Resource=e.get(this.config.resource);var r=function(){i.Resource.query().$promise.then(function(e){if(e[0]){var r=e[0],a=Object.keys(r);o.remove(a,function(e){return"id"==e||"validators"==e}),angular.isArray(i.config.hiddenFields)&&(a=o.difference(a,i.config.hiddenFields));var s=a.map(function(e){return n.format(e)});a.forEach(function(e,n){var o={label:s[n],prop:e};"string"!=typeof r[e]&&"undefined"!=typeof r[e]&&(o.type=_typeof(r[e])),i.tableConfig.columns.push(o)}),a.forEach(function(e,o){i.formConfig.fields[e]={label:n.format(s[o]).replace(":",""),type:t._getFieldFormat(r[e])}}),i.data=e}})};r()}]}})}(),function(){angular.module("xos.uiComponents").directive("xosSmartPie",function(){return{restrict:"E",scope:{config:"="},template:'\n        <canvas\n          class="chart chart-pie {{vm.config.classes}}"\n          chart-data="vm.data" chart-labels="vm.labels"\n          chart-legend="{{vm.config.legend}}">\n        </canvas>\n      ',bindToController:!0,controllerAs:"vm",controller:["$injector","$interval","$scope","$timeout","_",function(e,n,o,t,i){var r=this;if(!this.config.resource&&!this.config.data)throw new Error("[xosSmartPie] Please provide a resource or an array of data in the configuration");var a=function(e){return i.groupBy(e,r.config.groupBy)},s=function(e){return i.reduce(Object.keys(e),function(n,o){return n.concat(e[o].length)},[])},c=function(e){return angular.isFunction(r.config.labelFormatter)?r.config.labelFormatter(Object.keys(e)):Object.keys(e)},l=function(e){var n=a(e);r.data=s(n),r.labels=c(n)};this.config.resource?!function(){r.Resource=e.get(r.config.resource);var o=function(){r.Resource.query().$promise.then(function(e){e[0]&&l(e)})};o(),r.config.poll&&n(function(){o()},1e3*r.config.poll)}():o.$watch(function(){return r.config.data},function(e){e&&l(r.config.data)},!0),o.$on("create",function(e,n){console.log("create: "+n.id)}),o.$on("destroy",function(e,n){console.log("destroy: "+n.id)})}]}})}(),function(){angular.module("xos.uiComponents").directive("xosValidation",function(){return{restrict:"E",scope:{field:"=",form:"="},template:'\n        <div ng-cloak>\n          <xos-alert config="vm.config" show="vm.field.$error.required !== undefined && vm.field.$error.required !== false  && (vm.field.$touched || vm.form.$submitted)">\n            Field required\n          </xos-alert>\n          <xos-alert config="vm.config" show="vm.field.$error.email !== undefined && vm.field.$error.email !== false  && (vm.field.$touched || vm.form.$submitted)">\n            This is not a valid email\n          </xos-alert>\n          <xos-alert config="vm.config" show="vm.field.$error.minlength !== undefined && vm.field.$error.minlength !== false  && (vm.field.$touched || vm.form.$submitted)">\n            Too short\n          </xos-alert>\n          <xos-alert config="vm.config" show="vm.field.$error.maxlength !== undefined && vm.field.$error.maxlength !== false  && (vm.field.$touched || vm.form.$submitted)">\n            Too long\n          </xos-alert>\n          <xos-alert config="vm.config" show="vm.field.$error.custom !== undefined && vm.field.$error.custom !== false  && (vm.field.$touched || vm.form.$submitted)">\n            Field invalid\n          </xos-alert>\n        </div>\n      ',transclude:!0,bindToController:!0,controllerAs:"vm",controller:function(){this.config={type:"danger"}}}})}(),function(){angular.module("xos.uiComponents").directive("xosTable",function(){return{restrict:"E",scope:{data:"=",config:"="},template:'\n          <div ng-show="vm.data.length > 0">\n            <div class="row" ng-if="vm.config.filter == \'fulltext\'">\n              <div class="col-xs-12">\n                <input\n                  class="form-control"\n                  placeholder="Type to search.."\n                  type="text"\n                  ng-model="vm.query"/>\n              </div>\n            </div>\n            <table ng-class="vm.classes" ng-hide="vm.data.length == 0">\n              <thead>\n                <tr>\n                  <th ng-repeat="col in vm.columns">\n                    {{col.label}}\n                    <span ng-if="vm.config.order">\n                      <a href="" ng-click="vm.orderBy = col.prop; vm.reverse = false">\n                        <i class="glyphicon glyphicon-chevron-up"></i>\n                      </a>\n                      <a href="" ng-click="vm.orderBy = col.prop; vm.reverse = true">\n                        <i class="glyphicon glyphicon-chevron-down"></i>\n                      </a>\n                    </span>\n                  </th>\n                  <th ng-if="vm.config.actions">Actions:</th>\n                </tr>\n              </thead>\n              <tbody ng-if="vm.config.filter == \'field\'">\n                <tr>\n                  <td ng-repeat="col in vm.columns">\n                    <input\n                      ng-if="col.type !== \'boolean\'"\n                      class="form-control"\n                      placeholder="Type to search by {{col.label}}"\n                      type="text"\n                      ng-model="vm.query[col.prop]"/>\n                    <select\n                      ng-if="col.type === \'boolean\'"\n                      class="form-control"\n                      ng-model="vm.query[col.prop]">\n                      <option value="">-</option>\n                      <option value="true">True</option>\n                      <option value="false">False</option>\n                    </select>\n                  </td>\n                  <td ng-if="vm.config.actions"></td>\n                </tr>\n              </tbody>\n              <tbody>\n                <tr ng-repeat="item in vm.data | filter:vm.query | orderBy:vm.orderBy:vm.reverse | pagination:vm.currentPage * vm.config.pagination.pageSize | limitTo: (vm.config.pagination.pageSize || vm.data.length) track by $index">\n                  <td ng-repeat="col in vm.columns" link-wrapper>\n                    <span ng-if="!col.type">{{item[col.prop]}}</span>\n                    <span ng-if="col.type === \'boolean\'">\n                      <i class="glyphicon"\n                        ng-class="{\'glyphicon-ok\': item[col.prop], \'glyphicon-remove\': !item[col.prop]}">\n                      </i>\n                    </span>\n                    <span ng-if="col.type === \'date\'">\n                      {{item[col.prop] | date:\'H:mm MMM d, yyyy\'}}\n                    </span>\n                    <span ng-if="col.type === \'array\'">\n                      {{item[col.prop] | arrayToList}}\n                    </span>\n                    <span ng-if="col.type === \'object\'">\n                      <dl class="dl-horizontal">\n                        <span ng-repeat="(k,v) in item[col.prop]">\n                          <dt>{{k}}</dt>\n                          <dd>{{v}}</dd>\n                        </span>\n                      </dl>\n                    </span>\n                    <span ng-if="col.type === \'custom\'">\n                      {{col.formatter(item)}}\n                    </span>\n                    <span ng-if="col.type === \'icon\'">\n                      <i class="glyphicon glyphicon-{{col.formatter(item)}}">\n                      </i>\n                    </span>\n                  </td>\n                  <td ng-if="vm.config.actions">\n                    <a href=""\n                      ng-repeat="action in vm.config.actions"\n                      ng-click="action.cb(item)"\n                      title="{{action.label}}">\n                      <i\n                        class="glyphicon glyphicon-{{action.icon}}"\n                        style="color: {{action.color}};"></i>\n                    </a>\n                  </td>\n                </tr>\n              </tbody>\n            </table>\n            <xos-pagination\n              ng-if="vm.config.pagination"\n              page-size="vm.config.pagination.pageSize"\n              total-elements="vm.data.length"\n              change="vm.goToPage">\n              </xos-pagination>\n          </div>\n          <div ng-show="vm.data.length == 0 || !vm.data">\n             <xos-alert config="{type: \'info\'}">\n              No data to show.\n            </xos-alert>\n          </div>\n        ',bindToController:!0,controllerAs:"vm",controller:["_",function(e){var n=this;if(!this.config)throw new Error('[xosTable] Please provide a configuration via the "config" attribute');if(!this.config.columns)throw new Error("[xosTable] Please provide a columns list in the configuration");this.config.order&&angular.isObject(this.config.order)&&(this.reverse=this.config.order.reverse||!1,this.orderBy=this.config.order.field||"id");var o=e.filter(this.config.columns,{type:"custom"});angular.isArray(o)&&o.length>0&&e.forEach(o,function(e){if(!e.formatter||!angular.isFunction(e.formatter))throw new Error("[xosTable] You have provided a custom field type, a formatter function should provided too.")});var t=e.filter(this.config.columns,{type:"icon"});angular.isArray(t)&&t.length>0&&e.forEach(t,function(e){if(!e.formatter||!angular.isFunction(e.formatter))throw new Error("[xosTable] You have provided an icon field type, a formatter function should provided too.")});var i=e.filter(this.config.columns,function(e){return angular.isDefined(e.link)});angular.isArray(i)&&i.length>0&&e.forEach(i,function(e){if(!angular.isFunction(e.link))throw new Error("[xosTable] The link property should be a function.")}),this.columns=this.config.columns,this.classes=this.config.classes||"table table-striped table-bordered",this.config.actions,this.config.pagination&&(this.currentPage=0,this.goToPage=function(e){n.currentPage=e})}]}}).filter("arrayToList",function(){return function(e){return angular.isArray(e)?e.join(", "):e}}).directive("linkWrapper",function(){return{restrict:"A",transclude:!0,template:'\n          <a ng-if="col.link" href="{{col.link(item)}}">\n            <div ng-transclude></div>\n          </a>\n          <div ng-transclude ng-if="!col.link"></div>\n        '}})}(),function(){angular.module("xos.uiComponents").directive("xosPagination",function(){return{restrict:"E",scope:{pageSize:"=",totalElements:"=",change:"="},template:'\n        <div class="row" ng-if="vm.pageList.length > 1">\n          <div class="col-xs-12 text-center">\n            <ul class="pagination">\n              <li\n                ng-click="vm.goToPage(vm.currentPage - 1)"\n                ng-class="{disabled: vm.currentPage == 0}">\n                <a href="" aria-label="Previous">\n                    <span aria-hidden="true">&laquo;</span>\n                </a>\n              </li>\n              <li ng-repeat="i in vm.pageList" ng-class="{active: i === vm.currentPage}">\n                <a href="" ng-click="vm.goToPage(i)">{{i + 1}}</a>\n              </li>\n              <li\n                ng-click="vm.goToPage(vm.currentPage + 1)"\n                ng-class="{disabled: vm.currentPage == vm.pages - 1}">\n                <a href="" aria-label="Next">\n                    <span aria-hidden="true">&raquo;</span>\n                </a>\n              </li>\n            </ul>\n          </div>\n        </div>\n      ',bindToController:!0,controllerAs:"vm",controller:["$scope",function(e){var n=this;this.currentPage=0,this.goToPage=function(e){0>e||e===n.pages||(n.currentPage=e,n.change(e))},this.createPages=function(e){for(var n=[],o=0;e>o;o++)n.push(o);return n},e.$watch(function(){return n.totalElements},function(){n.totalElements&&(n.pages=Math.ceil(n.totalElements/n.pageSize),n.pageList=n.createPages(n.pages))})}]}}).filter("pagination",function(){return function(e,n){return e&&angular.isArray(e)?(n=parseInt(n,10),e.slice(n)):e}})}(),function(){angular.module("xos.uiComponents").directive("xosField",["RecursionHelper",function(e){return{restrict:"E",scope:{name:"=",field:"=",ngModel:"="},template:'\n        <label ng-if="vm.field.type !== \'object\'">{{vm.field.label}}</label>\n            <input\n              ng-if="vm.field.type !== \'boolean\' && vm.field.type !== \'object\'"\n              type="{{vm.field.type}}"\n              name="{{vm.name}}"\n              class="form-control"\n              ng-model="vm.ngModel"\n              ng-minlength="vm.field.validators.minlength || 0"\n              ng-maxlength="vm.field.validators.maxlength || 2000"\n              ng-required="vm.field.validators.required || false" />\n            <span class="boolean-field" ng-if="vm.field.type === \'boolean\'">\n              <button\n                class="btn btn-success"\n                ng-show="vm.ngModel"\n                ng-click="vm.ngModel = false">\n                <i class="glyphicon glyphicon-ok"></i>\n              </button>\n              <button\n                class="btn btn-danger"\n                ng-show="!vm.ngModel"\n                ng-click="vm.ngModel = true">\n                <i class="glyphicon glyphicon-remove"></i>\n              </button>\n            </span>\n            <div\n              class="panel panel-default object-field"\n              ng-if="vm.field.type == \'object\' && !vm.isEmptyObject(vm.ngModel)"\n              >\n              <div class="panel-heading">{{vm.field.label}}</div>\n              <div class="panel-body">\n                <div ng-repeat="(k, v) in vm.ngModel">\n                  <xos-field\n                    name="k"\n                    field="{label: vm.formatLabel(k), type: vm.getType(v)}"\n                    ng-model="v">\n                  </xos-field>\n                </div>\n              </div>\n            </div>\n      ',bindToController:!0,controllerAs:"vm",compile:function(n){return e.compile(n)},controller:["$attrs","XosFormHelpers","LabelFormatter",function(e,n,o){if(!this.name)throw new Error("[xosField] Please provide a field name");if(!this.field)throw new Error("[xosField] Please provide a field definition");if(!e.ngModel)throw new Error("[xosField] Please provide an ng-model");this.getType=n._getFieldFormat,this.formatLabel=o.format,this.isEmptyObject=function(e){return 0===Object.keys(e).length}}]}}])}(),function(){angular.module("xos.uiComponents").directive("xosForm",function(){return{restrict:"E",scope:{config:"=",ngModel:"="},template:'\n        <ng-form name="vm.{{vm.config.formName || \'form\'}}">\n          <div class="form-group" ng-repeat="(name, field) in vm.formField">\n            <xos-field name="name" field="field" ng-model="vm.ngModel[name]"></xos-field>\n            <xos-validation errors="vm[vm.config.formName || \'form\'][name].$error"></xos-validation>\n          </div>\n          <div class="form-group" ng-if="vm.config.actions">\n            <button role="button" href=""\n              ng-repeat="action in vm.config.actions"\n              ng-click="action.cb(vm.ngModel)"\n              class="btn btn-{{action.class}}"\n              title="{{action.label}}">\n              <i class="glyphicon glyphicon-{{action.icon}}"></i>\n              {{action.label}}\n            </button>\n          </div>\n        </ng-form>\n      ',bindToController:!0,controllerAs:"vm",controller:["$scope","$log","_","XosFormHelpers",function(e,n,o,t){var i=this;if(!this.config)throw new Error('[xosForm] Please provide a configuration via the "config" attribute');if(!this.config.actions)throw new Error("[xosForm] Please provide an action list in the configuration");this.excludedField=["id","validators","created","updated","deleted","backend_status"],this.config&&this.config.exclude&&(this.excludedField=this.excludedField.concat(this.config.exclude)),this.formField=[],e.$watch(function(){return i.ngModel},function(e){if(i.formField={},e){var n=o.difference(Object.keys(e),i.excludedField),r=t.parseModelField(n);i.formField=t.buildFormStructure(r,i.config.fields,e)}})}]}})}(),function(){angular.module("xos.uiComponents").directive("xosAlert",function(){return{restrict:"E",scope:{config:"=",show:"=?"},template:'\n        <div ng-cloak class="alert alert-{{vm.config.type}}" ng-hide="!vm.show">\n          <button type="button" class="close" ng-if="vm.config.closeBtn" ng-click="vm.dismiss()">\n            <span aria-hidden="true">&times;</span>\n          </button>\n          <p ng-transclude></p>\n        </div>\n      ',transclude:!0,bindToController:!0,controllerAs:"vm",controller:["$timeout",function(e){var n=this;if(!this.config)throw new Error('[xosAlert] Please provide a configuration via the "config" attribute');this.show=this.show!==!1,this.dismiss=function(){n.show=!1},this.config.autoHide&&!function(){var o=e(function(){n.dismiss(),e.cancel(o)},n.config.autoHide)}()}]}})}(),function(){function e(){var e=function(e){return e.split("_").join(" ").trim()},n=function(e){return e.split(/(?=[A-Z])/).map(function(e){return e.toLowerCase()}).join(" ")},o=function(e){return e.slice(0,1).toUpperCase()+e.slice(1)},t=function(t){return t=e(t),t=n(t),t=o(t).replace(/\s\s+/g," ")+":",t.replace("::",":")};return{_formatByUnderscore:e,_formatByUppercase:n,_capitalize:o,format:t}}angular.module("xos.uiComponents").factory("LabelFormatter",e)}();var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};!function(){angular.module("xos.uiComponents").service("XosFormHelpers",["_","LabelFormatter",function(e,n){var o=this;this._isEmail=function(e){var n=/(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;return n.test(e)},this._getFieldFormat=function(n){return angular.isArray(n)?"array":e.isDate(n)||!Number.isNaN(Date.parse(n))&&new Date(n).getTime()>6311808e5?"date":"boolean"==typeof n?"boolean":o._isEmail(n)?"email":"string"==typeof n||null===n?"text":"undefined"==typeof n?"undefined":_typeof(n)},this.buildFormStructure=function(t,i,r){return t=Object.keys(t).length>0?t:i,i=i||{},e.reduce(Object.keys(t),function(e,t){return e[t]={label:i[t]&&i[t].label?i[t].label+":":n.format(t),type:i[t]&&i[t].type?i[t].type:o._getFieldFormat(r[t]),validators:i[t]&&i[t].validators?i[t].validators:{},hint:i[t]&&i[t].hint?i[t].hint:""},"date"===e[t].type&&(r[t]=new Date(r[t])),"number"===e[t].type&&(r[t]=parseInt(r[t],10)),e},{})},this.parseModelField=function(n){return e.reduce(n,function(e,n){return e[n]={},e},{})}}])}(),function(){function e(e,n,o){e.interceptors.push("SetCSRFToken"),n.startSymbol("{$"),n.endSymbol("$}"),o.defaults.stripTrailingSlashes=!1}e.$inject=["$httpProvider","$interpolateProvider","$resourceProvider"],angular.module("bugSnag",[]).factory("$exceptionHandler",function(){return function(e,n){window.Bugsnag?Bugsnag.notifyException(e,{diagnostics:{cause:n}}):console.error(e,n,e.stack)}}),angular.module("xos.helpers",["ngCookies","ngResource","ngAnimate","bugSnag","xos.uiComponents"]).config(e).factory("_",["$window",function(e){return e._}])}(),function(){angular.module("xos.helpers").service("vSG-Collection",["$resource",function(e){return e("/api/service/vsg/")}])}(),function(){angular.module("xos.helpers").service("vOLT-Collection",["$resource",function(e){return e("/api/tenant/cord/volt/:volt_id/",{volt_id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("Login",["$resource",function(e){return e("/api/utility/login/")}]).service("Logout",["$resource",function(e){return e("/api/utility/logout/")}])}(),function(){angular.module("xos.helpers").service("Users",["$resource",function(e){return e("/api/core/users/:id/",{id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("Truckroll",["$resource",function(e){return e("/api/tenant/truckroll/:id/",{id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("Tenants",["$resource",function(e){return e("/api/core/tenants/:id/",{id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("Subscribers",["$resource",function(e){return e("/api/tenant/cord/subscriber/:id/",{id:"@id"},{update:{method:"PUT"},"View-a-Subscriber-Features-Detail":{method:"GET",isArray:!1,url:"/api/tenant/cord/subscriber/:id/features/"},"Read-Subscriber-uplink_speed":{method:"GET",isArray:!1,url:"/api/tenant/cord/subscriber/:id/features/uplink_speed/"},"Update-Subscriber-uplink_speed":{method:"PUT",isArray:!1,url:"/api/tenant/cord/subscriber/:id/features/uplink_speed/"},"Read-Subscriber-downlink_speed":{method:"GET",isArray:!1,url:"/api/tenant/cord/subscriber/:id/features/downlink_speed/"},"Update-Subscriber-downlink_speed":{method:"PUT",isArray:!1,url:"/api/tenant/cord/subscriber/:id/features/downlink_speed/"},"Read-Subscriber-cdn":{method:"GET",isArray:!1,url:"/api/tenant/cord/subscriber/:id/features/cdn/"},"Update-Subscriber-cdn":{method:"PUT",isArray:!1,url:"/api/tenant/cord/subscriber/:id/features/cdn/"},"Read-Subscriber-uverse":{method:"GET",isArray:!1,url:"/api/tenant/cord/subscriber/:id/features/uverse/"},"Update-Subscriber-uverse":{method:"PUT",isArray:!1,url:"/api/tenant/cord/subscriber/:id/features/uverse/"},"Read-Subscriber-status":{method:"GET",isArray:!1,url:"/api/tenant/cord/subscriber/:id/features/status/"},"Update-Subscriber-status":{method:"PUT",isArray:!1,url:"/api/tenant/cord/subscriber/:id/features/status/"}})}])}(),function(){angular.module("xos.helpers").service("SlicesPlus",["$http","$q",function(e,n){this.query=function(o){var t=n.defer();return e.get("/api/utility/slicesplus/",{params:o}).then(function(e){t.resolve(e.data)})["catch"](function(e){t.reject(e.data)}),{$promise:t.promise}},this.get=function(o,t){var i=n.defer();return e.get("/api/utility/slicesplus/"+o,{params:t}).then(function(e){i.resolve(e.data)})["catch"](function(e){i.reject(e.data)}),{$promise:i.promise}}}])}(),function(){angular.module("xos.helpers").service("Slices",["$resource",function(e){return e("/api/core/slices/:id/",{id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("Sites",["$resource",function(e){return e("/api/core/sites/:id/",{id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("Services",["$resource",function(e){return e("/api/core/services/:id/",{id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("ONOS-Services-Collection",["$resource",function(e){return e("/api/service/onos/")}])}(),function(){angular.module("xos.helpers").service("ONOS-App-Collection",["$resource",function(e){return e("/api/tenant/onos/app/")}])}(),function(){angular.module("xos.helpers").service("Nodes",["$resource",function(e){return e("/api/core/nodes/:id/",{id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("Networks",["$resource",function(e){return e("/api/core/networks/:id/",{id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("Instances",["$resource",function(e){return e("/api/core/instances/:id/",{id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("Flavors",["$resource",function(e){return e("/api/core/flavors/:id/",{id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("Example-Services-Collection",["$resource",function(e){return e("/api/service/exampleservice/")}])}(),function(){angular.module("xos.helpers").service("Deployments",["$resource",function(e){return e("/api/core/deployments/:id/",{id:"@id"},{update:{method:"PUT"}})}])}(),function(){angular.module("xos.helpers").service("GraphService",["$q","Tenants","Services",function(e,n,o){var t=this;this.loadCoarseData=function(){var t=void 0,i=e.defer();return o.query().$promise.then(function(e){return t=e,n.query({kind:"coarse"}).$promise}).then(function(e){i.resolve({tenants:e,services:t})}),i.promise},this.getCoarseGraph=function(){return t.loadCoarseData().then(function(e){console.log(e)}),"ciao"}}])}(),function(){angular.module("xos.helpers").factory("Notification",function(){return window.Notification}).service("xosNotification",["$q","$log","Notification",function(e,n,o){var t=this;this.checkPermission=function(){var n=e.defer();return o.requestPermission().then(function(e){"granted"===e?n.resolve(e):n.reject(e)}),n.promise},this.sendNotification=function(e,t){var i=new o(e,t);i.onerror=function(e){n.error(e)}},this.notify=function(e,i){"Notification"in window?"granted"!==o.permission?t.checkPermission().then(function(){return t.sendNotification(e,i)}):"granted"===o.permission&&t.sendNotification(e,i):n.info("This browser does not support desktop notification")}}])}(),function(){function e(){return{request:function(e){return-1===e.url.indexOf(".html")&&(e.url+="?no_hyperlinks=1"),e}}}angular.module("xos.helpers").factory("NoHyperlinks",e)}(),angular.module("xos.helpers").config(["$provide",function(e){e.decorator("$log",["$delegate",function(e){var n=function(){return window.location.href.indexOf("debug=true")>=0},o=e.log,t=e.info,i=e.warn,r=e.error,a=e.debug,s=function(o){return function(){if(n()){var t=[].slice.call(arguments),i=new Date;t[0]="["+i.getHours()+":"+i.getMinutes()+":"+i.getSeconds()+"] "+t[0],"function"!=typeof e.reset||e.debug.logs instanceof Array||e.reset(),o.apply(null,t)}}};return e.info=s(t),e.log=s(o),e.warn=s(i),e.error=s(r),e.debug=s(a),e}])}]),function(){function e(){var e=function(e){return e.split("_").join(" ").trim()},n=function(e){return e.split(/(?=[A-Z])/).map(function(e){return e.toLowerCase()}).join(" ")},o=function(e){return e.slice(0,1).toUpperCase()+e.slice(1)},t=function(t){return t=e(t),t=n(t),t=o(t).replace(/\s\s+/g," ")+":",t.replace("::",":")};return{_formatByUnderscore:e,_formatByUppercase:n,_capitalize:o,format:t}}angular.module("xos.uiComponents").factory("LabelFormatter",e)}(),function(){function e(e){return{request:function(n){return"GET"!==n.method&&(n.headers["X-CSRFToken"]=e.get("xoscsrftoken")),n}}}e.$inject=["$cookies"],angular.module("xos.helpers").factory("SetCSRFToken",e)}();
\ No newline at end of file
diff --git a/xos/core/xoslib/static/js/vendor/ngXosVendor.js b/xos/core/xoslib/static/js/vendor/ngXosVendor.js
index ab8f370..78eee30 100644
--- a/xos/core/xoslib/static/js/vendor/ngXosVendor.js
+++ b/xos/core/xoslib/static/js/vendor/ngXosVendor.js
@@ -13,4 +13,4 @@
 }function Pe(t){return t[1]}function Oe(t){for(var n=t.length,e=[0,1],r=2,i=2;n>i;i++){for(;r>1&&Q(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function Te(t,n){return t[0]-n[0]||t[1]-n[1]}function Le(t,n,e){return(e[0]-n[0])*(t[1]-n[1])<(e[1]-n[1])*(t[0]-n[0])}function je(t,n,e,r){var i=t[0],o=e[0],a=n[0]-i,u=r[0]-o,s=t[1],l=e[1],c=n[1]-s,f=r[1]-l,h=(u*(s-l)-f*(i-o))/(f*a-u*c);return[i+h*a,s+h*c]}function Ne(t){var n=t[0],e=t[t.length-1];return!(n[0]-e[0]||n[1]-e[1])}function Re(){rr(this),this.edge=this.site=this.circle=null}function De(t){var n=ls.pop()||new Re;return n.site=t,n}function Fe(t){Ge(t),as.remove(t),ls.push(t),rr(t)}function Ie(t){var n=t.circle,e=n.x,r=n.cy,i={x:e,y:r},o=t.P,a=t.N,u=[t];Fe(t);for(var s=o;s.circle&&xa(e-s.circle.x)<Da&&xa(r-s.circle.cy)<Da;)o=s.P,u.unshift(s),Fe(s),s=o;u.unshift(s),Ge(s);for(var l=a;l.circle&&xa(e-l.circle.x)<Da&&xa(r-l.circle.cy)<Da;)a=l.N,u.push(l),Fe(l),l=a;u.push(l),Ge(l);var c,f=u.length;for(c=1;f>c;++c)l=u[c],s=u[c-1],tr(l.edge,s.site,l.site,i);s=u[0],l=u[f-1],l.edge=Ke(s.site,l.site,null,i),Ye(s),Ye(l)}function ze(t){for(var n,e,r,i,o=t.x,a=t.y,u=as._;u;)if(r=qe(u,a)-o,r>Da)u=u.L;else{if(i=o-Ve(u,a),!(i>Da)){r>-Da?(n=u.P,e=u):i>-Da?(n=u,e=u.N):n=e=u;break}if(!u.R){n=u;break}u=u.R}var s=De(t);if(as.insert(n,s),n||e){if(n===e)return Ge(n),e=De(n.site),as.insert(s,e),s.edge=e.edge=Ke(n.site,s.site),Ye(n),void Ye(e);if(!e)return void(s.edge=Ke(n.site,s.site));Ge(n),Ge(e);var l=n.site,c=l.x,f=l.y,h=t.x-c,p=t.y-f,d=e.site,v=d.x-c,g=d.y-f,m=2*(h*g-p*v),y=h*h+p*p,$=v*v+g*g,x={x:(g*y-p*$)/m+c,y:(h*$-v*y)/m+f};tr(e.edge,l,d,x),s.edge=Ke(l,t,null,x),e.edge=Ke(t,d,null,x),Ye(n),Ye(e)}}function qe(t,n){var e=t.site,r=e.x,i=e.y,o=i-n;if(!o)return r;var a=t.P;if(!a)return-(1/0);e=a.site;var u=e.x,s=e.y,l=s-n;if(!l)return u;var c=u-r,f=1/o-1/l,h=c/l;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*l)-s+l/2+i-o/2)))/f+r:(r+u)/2}function Ve(t,n){var e=t.N;if(e)return qe(e,n);var r=t.site;return r.y===n?r.x:1/0}function Be(t){this.site=t,this.edges=[]}function We(t){for(var n,e,r,i,o,a,u,s,l,c,f=t[0][0],h=t[1][0],p=t[0][1],d=t[1][1],v=os,g=v.length;g--;)if(o=v[g],o&&o.prepare())for(u=o.edges,s=u.length,a=0;s>a;)c=u[a].end(),r=c.x,i=c.y,l=u[++a%s].start(),n=l.x,e=l.y,(xa(r-n)>Da||xa(i-e)>Da)&&(u.splice(a,0,new nr(Qe(o.site,c,xa(r-f)<Da&&d-i>Da?{x:f,y:xa(n-f)<Da?e:d}:xa(i-d)<Da&&h-r>Da?{x:xa(e-d)<Da?n:h,y:d}:xa(r-h)<Da&&i-p>Da?{x:h,y:xa(n-h)<Da?e:p}:xa(i-p)<Da&&r-f>Da?{x:xa(e-p)<Da?n:f,y:p}:null),o.site,null)),++s)}function Ue(t,n){return n.angle-t.angle}function He(){rr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ye(t){var n=t.P,e=t.N;if(n&&e){var r=n.site,i=t.site,o=e.site;if(r!==o){var a=i.x,u=i.y,s=r.x-a,l=r.y-u,c=o.x-a,f=o.y-u,h=2*(s*f-l*c);if(!(h>=-Fa)){var p=s*s+l*l,d=c*c+f*f,v=(f*p-l*d)/h,g=(s*d-c*p)/h,f=g+u,m=cs.pop()||new He;m.arc=t,m.site=i,m.x=v+a,m.y=f+Math.sqrt(v*v+g*g),m.cy=f,t.circle=m;for(var y=null,$=ss._;$;)if(m.y<$.y||m.y===$.y&&m.x<=$.x){if(!$.L){y=$.P;break}$=$.L}else{if(!$.R){y=$;break}$=$.R}ss.insert(y,m),y||(us=m)}}}}function Ge(t){var n=t.circle;n&&(n.P||(us=n.N),ss.remove(n),cs.push(n),rr(n),t.circle=null)}function Xe(t){for(var n,e=is,r=Bn(t[0][0],t[0][1],t[1][0],t[1][1]),i=e.length;i--;)n=e[i],(!Ze(n,t)||!r(n)||xa(n.a.x-n.b.x)<Da&&xa(n.a.y-n.b.y)<Da)&&(n.a=n.b=null,e.splice(i,1))}function Ze(t,n){var e=t.b;if(e)return!0;var r,i,o=t.a,a=n[0][0],u=n[1][0],s=n[0][1],l=n[1][1],c=t.l,f=t.r,h=c.x,p=c.y,d=f.x,v=f.y,g=(h+d)/2,m=(p+v)/2;if(v===p){if(a>g||g>=u)return;if(h>d){if(o){if(o.y>=l)return}else o={x:g,y:s};e={x:g,y:l}}else{if(o){if(o.y<s)return}else o={x:g,y:l};e={x:g,y:s}}}else if(r=(h-d)/(v-p),i=m-r*g,-1>r||r>1)if(h>d){if(o){if(o.y>=l)return}else o={x:(s-i)/r,y:s};e={x:(l-i)/r,y:l}}else{if(o){if(o.y<s)return}else o={x:(l-i)/r,y:l};e={x:(s-i)/r,y:s}}else if(v>p){if(o){if(o.x>=u)return}else o={x:a,y:r*a+i};e={x:u,y:r*u+i}}else{if(o){if(o.x<a)return}else o={x:u,y:r*u+i};e={x:a,y:r*a+i}}return t.a=o,t.b=e,!0}function Je(t,n){this.l=t,this.r=n,this.a=this.b=null}function Ke(t,n,e,r){var i=new Je(t,n);return is.push(i),e&&tr(i,t,n,e),r&&tr(i,n,t,r),os[t.i].edges.push(new nr(i,t,n)),os[n.i].edges.push(new nr(i,n,t)),i}function Qe(t,n,e){var r=new Je(t,null);return r.a=n,r.b=e,is.push(r),r}function tr(t,n,e,r){t.a||t.b?t.l===e?t.b=r:t.a=r:(t.a=r,t.l=n,t.r=e)}function nr(t,n,e){var r=t.a,i=t.b;this.edge=t,this.site=n,this.angle=e?Math.atan2(e.y-n.y,e.x-n.x):t.l===n?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function er(){this._=null}function rr(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function ir(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function or(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function ar(t){for(;t.L;)t=t.L;return t}function ur(t,n){var e,r,i,o=t.sort(sr).pop();for(is=[],os=new Array(t.length),as=new er,ss=new er;;)if(i=us,o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x))o.x===e&&o.y===r||(os[o.i]=new Be(o),ze(o),e=o.x,r=o.y),o=t.pop();else{if(!i)break;Ie(i.arc)}n&&(Xe(n),We(n));var a={cells:os,edges:is};return as=ss=is=os=null,a}function sr(t,n){return n.y-t.y||n.x-t.x}function lr(t,n,e){return(t.x-e.x)*(n.y-t.y)-(t.x-n.x)*(e.y-t.y)}function cr(t){return t.x}function fr(t){return t.y}function hr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pr(t,n,e,r,i,o){if(!t(n,e,r,i,o)){var a=.5*(e+i),u=.5*(r+o),s=n.nodes;s[0]&&pr(t,s[0],e,r,a,u),s[1]&&pr(t,s[1],a,r,i,u),s[2]&&pr(t,s[2],e,u,a,o),s[3]&&pr(t,s[3],a,u,i,o)}}function dr(t,n,e,r,i,o,a){var u,s=1/0;return function l(t,c,f,h,p){if(!(c>o||f>a||r>h||i>p)){if(d=t.point){var d,v=n-t.x,g=e-t.y,m=v*v+g*g;if(s>m){var y=Math.sqrt(s=m);r=n-y,i=e-y,o=n+y,a=e+y,u=d}}for(var $=t.nodes,x=.5*(c+h),b=.5*(f+p),w=n>=x,C=e>=b,S=C<<1|w,_=S+4;_>S;++S)if(t=$[3&S])switch(3&S){case 0:l(t,c,f,x,b);break;case 1:l(t,x,f,h,b);break;case 2:l(t,c,b,x,p);break;case 3:l(t,x,b,h,p)}}}(t,r,i,o,a),u}function vr(t,n){t=sa.rgb(t),n=sa.rgb(n);var e=t.r,r=t.g,i=t.b,o=n.r-e,a=n.g-r,u=n.b-i;return function(t){return"#"+xt(Math.round(e+o*t))+xt(Math.round(r+a*t))+xt(Math.round(i+u*t))}}function gr(t,n){var e,r={},i={};for(e in t)e in n?r[e]=$r(t[e],n[e]):i[e]=t[e];for(e in n)e in t||(i[e]=n[e]);return function(t){for(e in r)i[e]=r[e](t);return i}}function mr(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function yr(t,n){var e,r,i,o=hs.lastIndex=ps.lastIndex=0,a=-1,u=[],s=[];for(t+="",n+="";(e=hs.exec(t))&&(r=ps.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:mr(e,r)})),o=ps.lastIndex;return o<n.length&&(i=n.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?s[0]?(n=s[0].x,function(t){return n(t)+""}):function(){return n}:(n=s.length,function(t){for(var e,r=0;n>r;++r)u[(e=s[r]).i]=e.x(t);return u.join("")})}function $r(t,n){for(var e,r=sa.interpolators.length;--r>=0&&!(e=sa.interpolators[r](t,n)););return e}function xr(t,n){var e,r=[],i=[],o=t.length,a=n.length,u=Math.min(t.length,n.length);for(e=0;u>e;++e)r.push($r(t[e],n[e]));for(;o>e;++e)i[e]=t[e];for(;a>e;++e)i[e]=n[e];return function(t){for(e=0;u>e;++e)i[e]=r[e](t);return i}}function br(t){return function(n){return 0>=n?0:n>=1?1:t(n)}}function wr(t){return function(n){return 1-t(1-n)}}function Cr(t){return function(n){return.5*(.5>n?t(2*n):2-t(2-2*n))}}function Sr(t){return t*t}function _r(t){return t*t*t}function Mr(t){if(0>=t)return 0;if(t>=1)return 1;var n=t*t,e=n*t;return 4*(.5>t?e:3*(t-n)+e-.75)}function kr(t){return function(n){return Math.pow(n,t)}}function Ar(t){return 1-Math.cos(t*Va)}function Er(t){return Math.pow(2,10*(t-1))}function Pr(t){return 1-Math.sqrt(1-t*t)}function Or(t,n){var e;return arguments.length<2&&(n=.45),arguments.length?e=n/za*Math.asin(1/t):(t=1,e=n/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-e)*za/n)}}function Tr(t){return t||(t=1.70158),function(n){return n*n*((t+1)*n-t)}}function Lr(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function jr(t,n){t=sa.hcl(t),n=sa.hcl(n);var e=t.h,r=t.c,i=t.l,o=n.h-e,a=n.c-r,u=n.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?n.c:r),isNaN(o)?(o=0,e=isNaN(e)?n.h:e):o>180?o-=360:-180>o&&(o+=360),function(t){return ct(e+o*t,r+a*t,i+u*t)+""}}function Nr(t,n){t=sa.hsl(t),n=sa.hsl(n);var e=t.h,r=t.s,i=t.l,o=n.h-e,a=n.s-r,u=n.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?n.s:r),isNaN(o)?(o=0,e=isNaN(e)?n.h:e):o>180?o-=360:-180>o&&(o+=360),function(t){return st(e+o*t,r+a*t,i+u*t)+""}}function Rr(t,n){t=sa.lab(t),n=sa.lab(n);var e=t.l,r=t.a,i=t.b,o=n.l-e,a=n.a-r,u=n.b-i;return function(t){return ht(e+o*t,r+a*t,i+u*t)+""}}function Dr(t,n){return n-=t,function(e){return Math.round(t+n*e)}}function Fr(t){var n=[t.a,t.b],e=[t.c,t.d],r=zr(n),i=Ir(n,e),o=zr(qr(e,n,-i))||0;n[0]*e[1]<e[0]*n[1]&&(n[0]*=-1,n[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(n[1],n[0]):Math.atan2(-e[0],e[1]))*Wa,this.translate=[t.e,t.f],this.scale=[r,o],this.skew=o?Math.atan2(i,o)*Wa:0}function Ir(t,n){return t[0]*n[0]+t[1]*n[1]}function zr(t){var n=Math.sqrt(Ir(t,t));return n&&(t[0]/=n,t[1]/=n),n}function qr(t,n,e){return t[0]+=e*n[0],t[1]+=e*n[1],t}function Vr(t){return t.length?t.pop()+",":""}function Br(t,n,e,r){if(t[0]!==n[0]||t[1]!==n[1]){var i=e.push("translate(",null,",",null,")");r.push({i:i-4,x:mr(t[0],n[0])},{i:i-2,x:mr(t[1],n[1])})}else(n[0]||n[1])&&e.push("translate("+n+")")}function Wr(t,n,e,r){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),r.push({i:e.push(Vr(e)+"rotate(",null,")")-2,x:mr(t,n)})):n&&e.push(Vr(e)+"rotate("+n+")")}function Ur(t,n,e,r){t!==n?r.push({i:e.push(Vr(e)+"skewX(",null,")")-2,x:mr(t,n)}):n&&e.push(Vr(e)+"skewX("+n+")")}function Hr(t,n,e,r){if(t[0]!==n[0]||t[1]!==n[1]){var i=e.push(Vr(e)+"scale(",null,",",null,")");r.push({i:i-4,x:mr(t[0],n[0])},{i:i-2,x:mr(t[1],n[1])})}else 1===n[0]&&1===n[1]||e.push(Vr(e)+"scale("+n+")")}function Yr(t,n){var e=[],r=[];return t=sa.transform(t),n=sa.transform(n),Br(t.translate,n.translate,e,r),Wr(t.rotate,n.rotate,e,r),Ur(t.skew,n.skew,e,r),Hr(t.scale,n.scale,e,r),t=n=null,function(t){for(var n,i=-1,o=r.length;++i<o;)e[(n=r[i]).i]=n.x(t);return e.join("")}}function Gr(t,n){return n=(n-=t=+t)||1/n,function(e){return(e-t)/n}}function Xr(t,n){return n=(n-=t=+t)||1/n,function(e){return Math.max(0,Math.min(1,(e-t)/n))}}function Zr(t){for(var n=t.source,e=t.target,r=Kr(n,e),i=[n];n!==r;)n=n.parent,i.push(n);for(var o=i.length;e!==r;)i.splice(o,0,e),e=e.parent;return i}function Jr(t){for(var n=[],e=t.parent;null!=e;)n.push(t),t=e,e=e.parent;return n.push(t),n}function Kr(t,n){if(t===n)return t;for(var e=Jr(t),r=Jr(n),i=e.pop(),o=r.pop(),a=null;i===o;)a=i,i=e.pop(),o=r.pop();return a}function Qr(t){t.fixed|=2}function ti(t){t.fixed&=-7}function ni(t){t.fixed|=4,t.px=t.x,t.py=t.y}function ei(t){t.fixed&=-5}function ri(t,n,e){var r=0,i=0;if(t.charge=0,!t.leaf)for(var o,a=t.nodes,u=a.length,s=-1;++s<u;)o=a[s],null!=o&&(ri(o,n,e),t.charge+=o.charge,r+=o.charge*o.cx,i+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var l=n*e[t.point.index];t.charge+=t.pointCharge=l,r+=l*t.point.x,i+=l*t.point.y}t.cx=r/t.charge,t.cy=i/t.charge}function ii(t,n){return sa.rebind(t,n,"sort","children","value"),t.nodes=t,t.links=ci,t}function oi(t,n){for(var e=[t];null!=(t=e.pop());)if(n(t),(i=t.children)&&(r=i.length))for(var r,i;--r>=0;)e.push(i[r])}function ai(t,n){for(var e=[t],r=[];null!=(t=e.pop());)if(r.push(t),(o=t.children)&&(i=o.length))for(var i,o,a=-1;++a<i;)e.push(o[a]);for(;null!=(t=r.pop());)n(t)}function ui(t){return t.children}function si(t){return t.value}function li(t,n){return n.value-t.value}function ci(t){return sa.merge(t.map(function(t){return(t.children||[]).map(function(n){return{source:t,target:n}})}))}function fi(t){return t.x}function hi(t){return t.y}function pi(t,n,e){t.y0=n,t.y=e}function di(t){return sa.range(t.length)}function vi(t){for(var n=-1,e=t[0].length,r=[];++n<e;)r[n]=0;return r}function gi(t){for(var n,e=1,r=0,i=t[0][1],o=t.length;o>e;++e)(n=t[e][1])>i&&(r=e,i=n);return r}function mi(t){return t.reduce(yi,0)}function yi(t,n){return t+n[1]}function $i(t,n){return xi(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function xi(t,n){for(var e=-1,r=+t[0],i=(t[1]-r)/n,o=[];++e<=n;)o[e]=i*e+r;return o}function bi(t){return[sa.min(t),sa.max(t)]}function wi(t,n){return t.value-n.value}function Ci(t,n){var e=t._pack_next;t._pack_next=n,n._pack_prev=t,n._pack_next=e,e._pack_prev=n}function Si(t,n){t._pack_next=n,n._pack_prev=t}function _i(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r+n.r;return.999*i*i>e*e+r*r}function Mi(t){function n(t){c=Math.min(t.x-t.r,c),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),p=Math.max(t.y+t.r,p)}if((e=t.children)&&(l=e.length)){var e,r,i,o,a,u,s,l,c=1/0,f=-(1/0),h=1/0,p=-(1/0);if(e.forEach(ki),r=e[0],r.x=-r.r,r.y=0,n(r),l>1&&(i=e[1],i.x=i.r,i.y=0,n(i),l>2))for(o=e[2],Pi(r,i,o),n(o),Ci(r,o),r._pack_prev=o,Ci(o,i),i=r._pack_next,a=3;l>a;a++){Pi(r,i,o=e[a]);var d=0,v=1,g=1;for(u=i._pack_next;u!==i;u=u._pack_next,v++)if(_i(u,o)){d=1;break}if(1==d)for(s=r._pack_prev;s!==u._pack_prev&&!_i(s,o);s=s._pack_prev,g++);d?(g>v||v==g&&i.r<r.r?Si(r,i=u):Si(r=s,i),a--):(Ci(r,o),i=o,n(o))}var m=(c+f)/2,y=(h+p)/2,$=0;for(a=0;l>a;a++)o=e[a],o.x-=m,o.y-=y,$=Math.max($,o.r+Math.sqrt(o.x*o.x+o.y*o.y));t.r=$,e.forEach(Ai)}}function ki(t){t._pack_next=t._pack_prev=t}function Ai(t){delete t._pack_next,delete t._pack_prev}function Ei(t,n,e,r){var i=t.children;if(t.x=n+=r*t.x,t.y=e+=r*t.y,t.r*=r,i)for(var o=-1,a=i.length;++o<a;)Ei(i[o],n,e,r)}function Pi(t,n,e){var r=t.r+e.r,i=n.x-t.x,o=n.y-t.y;if(r&&(i||o)){var a=n.r+e.r,u=i*i+o*o;a*=a,r*=r;var s=.5+(r-a)/(2*u),l=Math.sqrt(Math.max(0,2*a*(r+u)-(r-=u)*r-a*a))/(2*u);e.x=t.x+s*i+l*o,e.y=t.y+s*o-l*i}else e.x=t.x+r,e.y=t.y}function Oi(t,n){return t.parent==n.parent?1:2}function Ti(t){var n=t.children;return n.length?n[0]:t.t}function Li(t){var n,e=t.children;return(n=e.length)?e[n-1]:t.t}function ji(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function Ni(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)n=i[o],n.z+=e,n.m+=e,e+=n.s+(r+=n.c)}function Ri(t,n,e){return t.a.parent===n.parent?t.a:e}function Di(t){return 1+sa.max(t,function(t){return t.y})}function Fi(t){return t.reduce(function(t,n){return t+n.x},0)/t.length}function Ii(t){var n=t.children;return n&&n.length?Ii(n[0]):t}function zi(t){var n,e=t.children;return e&&(n=e.length)?zi(e[n-1]):t}function qi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Vi(t,n){var e=t.x+n[3],r=t.y+n[0],i=t.dx-n[1]-n[3],o=t.dy-n[0]-n[2];return 0>i&&(e+=i/2,i=0),0>o&&(r+=o/2,o=0),{x:e,y:r,dx:i,dy:o}}function Bi(t){var n=t[0],e=t[t.length-1];return e>n?[n,e]:[e,n]}function Wi(t){return t.rangeExtent?t.rangeExtent():Bi(t.range())}function Ui(t,n,e,r){var i=e(t[0],t[1]),o=r(n[0],n[1]);return function(t){return o(i(t))}}function Hi(t,n){var e,r=0,i=t.length-1,o=t[r],a=t[i];return o>a&&(e=r,r=i,i=e,e=o,o=a,a=e),t[r]=n.floor(o),t[i]=n.ceil(a),t}function Yi(t){return t?{floor:function(n){return Math.floor(n/t)*t},ceil:function(n){return Math.ceil(n/t)*t}}:Ss}function Gi(t,n,e,r){var i=[],o=[],a=0,u=Math.min(t.length,n.length)-1;for(t[u]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<=u;)i.push(e(t[a-1],t[a])),o.push(r(n[a-1],n[a]));return function(n){var e=sa.bisect(t,n,1,u)-1;return o[e](i[e](n))}}function Xi(t,n,e,r){function i(){var i=Math.min(t.length,n.length)>2?Gi:Ui,s=r?Xr:Gr;return a=i(t,n,s,e),u=i(n,t,s,$r),o}function o(t){return a(t)}var a,u;return o.invert=function(t){return u(t)},o.domain=function(n){return arguments.length?(t=n.map(Number),i()):t},o.range=function(t){return arguments.length?(n=t,i()):n},o.rangeRound=function(t){return o.range(t).interpolate(Dr)},o.clamp=function(t){return arguments.length?(r=t,i()):r},o.interpolate=function(t){return arguments.length?(e=t,i()):e},o.ticks=function(n){return Qi(t,n)},o.tickFormat=function(n,e){return to(t,n,e)},o.nice=function(n){return Ji(t,n),i()},o.copy=function(){return Xi(t,n,e,r)},i()}function Zi(t,n){return sa.rebind(t,n,"range","rangeRound","interpolate","clamp")}function Ji(t,n){return Hi(t,Yi(Ki(t,n)[2])),Hi(t,Yi(Ki(t,n)[2])),t}function Ki(t,n){null==n&&(n=10);var e=Bi(t),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/n)/Math.LN10)),o=n/r*i;return.15>=o?i*=10:.35>=o?i*=5:.75>=o&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function Qi(t,n){return sa.range.apply(sa,Ki(t,n))}function to(t,n,e){var r=Ki(t,n);if(e){var i=hu.exec(e);if(i.shift(),"s"===i[8]){var o=sa.formatPrefix(Math.max(xa(r[0]),xa(r[1])));return i[7]||(i[7]="."+no(o.scale(r[2]))),i[8]="f",e=sa.format(i.join("")),function(t){return e(o.scale(t))+o.symbol}}i[7]||(i[7]="."+eo(i[8],r)),e=i.join("")}else e=",."+no(r[2])+"f";return sa.format(e)}function no(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function eo(t,n){var e=no(n[2]);return t in _s?Math.abs(e-no(Math.max(xa(n[0]),xa(n[1]))))+ +("e"!==t):e-2*("%"===t)}function ro(t,n,e,r){function i(t){return(e?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function o(t){return e?Math.pow(n,t):-Math.pow(n,-t)}function a(n){return t(i(n))}return a.invert=function(n){return o(t.invert(n))},a.domain=function(n){return arguments.length?(e=n[0]>=0,t.domain((r=n.map(Number)).map(i)),a):r},a.base=function(e){return arguments.length?(n=+e,t.domain(r.map(i)),a):n},a.nice=function(){var n=Hi(r.map(i),e?Math:ks);return t.domain(n),r=n.map(o),a},a.ticks=function(){var t=Bi(r),a=[],u=t[0],s=t[1],l=Math.floor(i(u)),c=Math.ceil(i(s)),f=n%1?2:n;if(isFinite(c-l)){if(e){for(;c>l;l++)for(var h=1;f>h;h++)a.push(o(l)*h);a.push(o(l))}else for(a.push(o(l));l++<c;)for(var h=f-1;h>0;h--)a.push(o(l)*h);for(l=0;a[l]<u;l++);for(c=a.length;a[c-1]>s;c--);a=a.slice(l,c)}return a},a.tickFormat=function(t,e){if(!arguments.length)return Ms;arguments.length<2?e=Ms:"function"!=typeof e&&(e=sa.format(e));var r=Math.max(1,n*t/a.ticks().length);return function(t){var a=t/o(Math.round(i(t)));return n-.5>a*n&&(a*=n),r>=a?e(t):""}},a.copy=function(){return ro(t.copy(),n,e,r)},Zi(a,t)}function io(t,n,e){function r(n){return t(i(n))}var i=oo(n),o=oo(1/n);return r.invert=function(n){return o(t.invert(n))},r.domain=function(n){return arguments.length?(t.domain((e=n.map(Number)).map(i)),r):e},r.ticks=function(t){return Qi(e,t)},r.tickFormat=function(t,n){return to(e,t,n)},r.nice=function(t){return r.domain(Ji(e,t))},r.exponent=function(a){return arguments.length?(i=oo(n=a),o=oo(1/n),t.domain(e.map(i)),r):n},r.copy=function(){return io(t.copy(),n,e)},Zi(r,t)}function oo(t){return function(n){return 0>n?-Math.pow(-n,t):Math.pow(n,t)}}function ao(t,n){function e(e){return o[((i.get(e)||("range"===n.t?i.set(e,t.push(e)):NaN))-1)%o.length]}function r(n,e){return sa.range(t.length).map(function(t){return n+e*t})}var i,o,a;return e.domain=function(r){if(!arguments.length)return t;t=[],i=new l;for(var o,a=-1,u=r.length;++a<u;)i.has(o=r[a])||i.set(o,t.push(o));return e[n.t].apply(e,n.a)},e.range=function(t){return arguments.length?(o=t,a=0,n={t:"range",a:arguments},e):o},e.rangePoints=function(i,u){arguments.length<2&&(u=0);var s=i[0],l=i[1],c=t.length<2?(s=(s+l)/2,0):(l-s)/(t.length-1+u);return o=r(s+c*u/2,c),a=0,n={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(i,u){arguments.length<2&&(u=0);var s=i[0],l=i[1],c=t.length<2?(s=l=Math.round((s+l)/2),0):(l-s)/(t.length-1+u)|0;return o=r(s+Math.round(c*u/2+(l-s-(t.length-1+u)*c)/2),c),a=0,n={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(i,u,s){arguments.length<2&&(u=0),arguments.length<3&&(s=u);var l=i[1]<i[0],c=i[l-0],f=i[1-l],h=(f-c)/(t.length-u+2*s);return o=r(c+h*s,h),l&&o.reverse(),a=h*(1-u),n={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(i,u,s){arguments.length<2&&(u=0),arguments.length<3&&(s=u);var l=i[1]<i[0],c=i[l-0],f=i[1-l],h=Math.floor((f-c)/(t.length-u+2*s));return o=r(c+Math.round((f-c-(t.length-u)*h)/2),h),l&&o.reverse(),a=Math.round(h*(1-u)),n={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return a},e.rangeExtent=function(){return Bi(n.a[0])},e.copy=function(){return ao(t,n)},e.domain(t)}function uo(t,n){function o(){var e=0,r=n.length;for(u=[];++e<r;)u[e-1]=sa.quantile(t,e/r);return a}function a(t){return isNaN(t=+t)?void 0:n[sa.bisect(u,t)]}var u;return a.domain=function(n){return arguments.length?(t=n.map(r).filter(i).sort(e),o()):t},a.range=function(t){return arguments.length?(n=t,o()):n},a.quantiles=function(){return u},a.invertExtent=function(e){return e=n.indexOf(e),0>e?[NaN,NaN]:[e>0?u[e-1]:t[0],e<u.length?u[e]:t[t.length-1]]},a.copy=function(){return uo(t,n)},o()}function so(t,n,e){function r(n){return e[Math.max(0,Math.min(a,Math.floor(o*(n-t))))]}function i(){return o=e.length/(n-t),a=e.length-1,r}var o,a;return r.domain=function(e){return arguments.length?(t=+e[0],n=+e[e.length-1],i()):[t,n]},r.range=function(t){return arguments.length?(e=t,i()):e},r.invertExtent=function(n){return n=e.indexOf(n),n=0>n?NaN:n/o+t,[n,n+1/o]},r.copy=function(){return so(t,n,e)},i()}function lo(t,n){function e(e){return e>=e?n[sa.bisect(t,e)]:void 0}return e.domain=function(n){return arguments.length?(t=n,e):t},e.range=function(t){return arguments.length?(n=t,e):n},e.invertExtent=function(e){return e=n.indexOf(e),[t[e-1],t[e]]},e.copy=function(){return lo(t,n)},e}function co(t){function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=e.map(n),n):t},n.ticks=function(n){return Qi(t,n)},n.tickFormat=function(n,e){return to(t,n,e)},n.copy=function(){return co(t)},n}function fo(){return 0}function ho(t){return t.innerRadius}function po(t){return t.outerRadius}function vo(t){return t.startAngle}function go(t){return t.endAngle}function mo(t){return t&&t.padAngle}function yo(t,n,e,r){return(t-e)*n-(n-r)*t>0?0:1}function $o(t,n,e,r,i){var o=t[0]-n[0],a=t[1]-n[1],u=(i?r:-r)/Math.sqrt(o*o+a*a),s=u*a,l=-u*o,c=t[0]+s,f=t[1]+l,h=n[0]+s,p=n[1]+l,d=(c+h)/2,v=(f+p)/2,g=h-c,m=p-f,y=g*g+m*m,$=e-r,x=c*p-h*f,b=(0>m?-1:1)*Math.sqrt(Math.max(0,$*$*y-x*x)),w=(x*m-g*b)/y,C=(-x*g-m*b)/y,S=(x*m+g*b)/y,_=(-x*g+m*b)/y,M=w-d,k=C-v,A=S-d,E=_-v;return M*M+k*k>A*A+E*E&&(w=S,C=_),[[w-s,C-l],[w*e/$,C*e/$]]}function xo(t){function n(n){function a(){l.push("M",o(t(c),u))}for(var s,l=[],c=[],f=-1,h=n.length,p=Mt(e),d=Mt(r);++f<h;)i.call(this,s=n[f],f)?c.push([+p.call(this,s,f),+d.call(this,s,f)]):c.length&&(a(),c=[]);return c.length&&a(),l.length?l.join(""):null}var e=Ee,r=Pe,i=Pn,o=bo,a=o.key,u=.7;return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n.defined=function(t){return arguments.length?(i=t,n):i},n.interpolate=function(t){return arguments.length?(a="function"==typeof t?o=t:(o=Ls.get(t)||bo).key,n):a},n.tension=function(t){return arguments.length?(u=t,n):u},n}function bo(t){return t.length>1?t.join("L"):t+"Z"}function wo(t){return t.join("L")+"Z"}function Co(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];++n<e;)i.push("H",(r[0]+(r=t[n])[0])/2,"V",r[1]);return e>1&&i.push("H",r[0]),i.join("")}function So(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];++n<e;)i.push("V",(r=t[n])[1],"H",r[0]);return i.join("")}function _o(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];++n<e;)i.push("H",(r=t[n])[0],"V",r[1]);return i.join("")}function Mo(t,n){return t.length<4?bo(t):t[1]+Eo(t.slice(1,-1),Po(t,n))}function ko(t,n){return t.length<3?wo(t):t[0]+Eo((t.push(t[0]),t),Po([t[t.length-2]].concat(t,[t[1]]),n))}function Ao(t,n){return t.length<3?bo(t):t[0]+Eo(t,Po(t,n))}function Eo(t,n){if(n.length<1||t.length!=n.length&&t.length!=n.length+2)return bo(t);var e=t.length!=n.length,r="",i=t[0],o=t[1],a=n[0],u=a,s=1;if(e&&(r+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1],i=t[1],s=2),n.length>1){u=n[1],o=t[s],s++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-u[0])+","+(o[1]-u[1])+","+o[0]+","+o[1];for(var l=2;l<n.length;l++,s++)o=t[s],u=n[l],r+="S"+(o[0]-u[0])+","+(o[1]-u[1])+","+o[0]+","+o[1]}if(e){var c=t[s];r+="Q"+(o[0]+2*u[0]/3)+","+(o[1]+2*u[1]/3)+","+c[0]+","+c[1]}return r}function Po(t,n){for(var e,r=[],i=(1-n)/2,o=t[0],a=t[1],u=1,s=t.length;++u<s;)e=o,o=a,a=t[u],r.push([i*(a[0]-e[0]),i*(a[1]-e[1])]);return r}function Oo(t){if(t.length<3)return bo(t);var n=1,e=t.length,r=t[0],i=r[0],o=r[1],a=[i,i,i,(r=t[1])[0]],u=[o,o,o,r[1]],s=[i,",",o,"L",No(Rs,a),",",No(Rs,u)];for(t.push(t[e-1]);++n<=e;)r=t[n],a.shift(),a.push(r[0]),u.shift(),u.push(r[1]),Ro(s,a,u);return t.pop(),s.push("L",r),s.join("")}function To(t){if(t.length<4)return bo(t);for(var n,e=[],r=-1,i=t.length,o=[0],a=[0];++r<3;)n=t[r],o.push(n[0]),a.push(n[1]);for(e.push(No(Rs,o)+","+No(Rs,a)),--r;++r<i;)n=t[r],o.shift(),o.push(n[0]),a.shift(),a.push(n[1]),Ro(e,o,a);return e.join("")}function Lo(t){for(var n,e,r=-1,i=t.length,o=i+4,a=[],u=[];++r<4;)e=t[r%i],a.push(e[0]),u.push(e[1]);for(n=[No(Rs,a),",",No(Rs,u)],--r;++r<o;)e=t[r%i],a.shift(),a.push(e[0]),u.shift(),u.push(e[1]),Ro(n,a,u);return n.join("")}function jo(t,n){var e=t.length-1;if(e)for(var r,i,o=t[0][0],a=t[0][1],u=t[e][0]-o,s=t[e][1]-a,l=-1;++l<=e;)r=t[l],i=l/e,r[0]=n*r[0]+(1-n)*(o+i*u),r[1]=n*r[1]+(1-n)*(a+i*s);return Oo(t)}function No(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function Ro(t,n,e){t.push("C",No(js,n),",",No(js,e),",",No(Ns,n),",",No(Ns,e),",",No(Rs,n),",",No(Rs,e))}function Do(t,n){return(n[1]-t[1])/(n[0]-t[0])}function Fo(t){for(var n=0,e=t.length-1,r=[],i=t[0],o=t[1],a=r[0]=Do(i,o);++n<e;)r[n]=(a+(a=Do(i=o,o=t[n+1])))/2;return r[n]=a,r}function Io(t){for(var n,e,r,i,o=[],a=Fo(t),u=-1,s=t.length-1;++u<s;)n=Do(t[u],t[u+1]),xa(n)<Da?a[u]=a[u+1]=0:(e=a[u]/n,r=a[u+1]/n,i=e*e+r*r,i>9&&(i=3*n/Math.sqrt(i),a[u]=i*e,a[u+1]=i*r));for(u=-1;++u<=s;)i=(t[Math.min(s,u+1)][0]-t[Math.max(0,u-1)][0])/(6*(1+a[u]*a[u])),o.push([i||0,a[u]*i||0]);return o}function zo(t){return t.length<3?bo(t):t[0]+Eo(t,Io(t))}function qo(t){for(var n,e,r,i=-1,o=t.length;++i<o;)n=t[i],e=n[0],r=n[1]-Va,n[0]=e*Math.cos(r),n[1]=e*Math.sin(r);return t}function Vo(t){function n(n){function s(){v.push("M",u(t(m),f),c,l(t(g.reverse()),f),"Z")}for(var h,p,d,v=[],g=[],m=[],y=-1,$=n.length,x=Mt(e),b=Mt(i),w=e===r?function(){return p}:Mt(r),C=i===o?function(){return d}:Mt(o);++y<$;)a.call(this,h=n[y],y)?(g.push([p=+x.call(this,h,y),d=+b.call(this,h,y)]),m.push([+w.call(this,h,y),+C.call(this,h,y)])):g.length&&(s(),g=[],m=[]);return g.length&&s(),v.length?v.join(""):null}var e=Ee,r=Ee,i=0,o=Pe,a=Pn,u=bo,s=u.key,l=u,c="L",f=.7;return n.x=function(t){return arguments.length?(e=r=t,n):r},n.x0=function(t){return arguments.length?(e=t,n):e},n.x1=function(t){return arguments.length?(r=t,n):r},n.y=function(t){return arguments.length?(i=o=t,n):o},n.y0=function(t){return arguments.length?(i=t,n):i},n.y1=function(t){return arguments.length?(o=t,n):o},n.defined=function(t){return arguments.length?(a=t,n):a},n.interpolate=function(t){return arguments.length?(s="function"==typeof t?u=t:(u=Ls.get(t)||bo).key,l=u.reverse||u,c=u.closed?"M":"L",n):s},n.tension=function(t){return arguments.length?(f=t,n):f},n}function Bo(t){return t.radius}function Wo(t){return[t.x,t.y]}function Uo(t){return function(){var n=t.apply(this,arguments),e=n[0],r=n[1]-Va;return[e*Math.cos(r),e*Math.sin(r)]}}function Ho(){return 64}function Yo(){return"circle"}function Go(t){var n=Math.sqrt(t/Ia);return"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z"}function Xo(t){return function(){var n,e,r;(n=this[t])&&(r=n[e=n.active])&&(r.timer.c=null,r.timer.t=NaN,--n.count?delete n[e]:delete this[t],n.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Zo(t,n,e){return _a(t,Bs),t.namespace=n,t.id=e,t}function Jo(t,n,e,r){var i=t.id,o=t.namespace;return B(t,"function"==typeof e?function(t,a,u){t[o][i].tween.set(n,r(e.call(t,t.__data__,a,u)))}:(e=r(e),function(t){t[o][i].tween.set(n,e)}))}function Ko(t){return null==t&&(t=""),function(){this.textContent=t}}function Qo(t){return null==t?"__transition__":"__transition_"+t+"__"}function ta(t,n,e,r,i){function o(t){var n=v.delay;return c.t=n+s,t>=n?a(t-n):void(c.c=a)}function a(e){var i=d.active,o=d[i];o&&(o.timer.c=null,o.timer.t=NaN,--d.count,delete d[i],o.event&&o.event.interrupt.call(t,t.__data__,o.index));for(var a in d)if(r>+a){var l=d[a];l.timer.c=null,l.timer.t=NaN,--d.count,delete d[a]}c.c=u,Ot(function(){return c.c&&u(e||1)&&(c.c=null,c.t=NaN),1},0,s),d.active=r,v.event&&v.event.start.call(t,t.__data__,n),p=[],v.tween.forEach(function(e,r){(r=r.call(t,t.__data__,n))&&p.push(r)}),h=v.ease,f=v.duration}function u(i){for(var o=i/f,a=h(o),u=p.length;u>0;)p[--u].call(t,a);return o>=1?(v.event&&v.event.end.call(t,t.__data__,n),--d.count?delete d[r]:delete t[e],1):void 0}var s,c,f,h,p,d=t[e]||(t[e]={active:0,count:0}),v=d[r];v||(s=i.time,c=Ot(o,0,s),v=d[r]={tween:new l,time:s,timer:c,delay:i.delay,duration:i.duration,ease:i.ease,index:n},i=null,++d.count)}function na(t,n,e){t.attr("transform",function(t){var r=n(t);return"translate("+(isFinite(r)?r:e(t))+",0)"})}function ea(t,n,e){t.attr("transform",function(t){var r=n(t);return"translate(0,"+(isFinite(r)?r:e(t))+")"})}function ra(t){return t.toISOString()}function ia(t,n,e){function r(n){return t(n)}function i(t,e){var r=t[1]-t[0],i=r/e,o=sa.bisect(Ks,i);return o==Ks.length?[n.year,Ki(t.map(function(t){return t/31536e6}),e)[2]]:o?n[i/Ks[o-1]<Ks[o]/i?o-1:o]:[nl,Ki(t,e)[2]]}return r.invert=function(n){return oa(t.invert(n))},r.domain=function(n){return arguments.length?(t.domain(n),r):t.domain().map(oa)},r.nice=function(t,n){function e(e){return!isNaN(e)&&!t.range(e,oa(+e+1),n).length}var o=r.domain(),a=Bi(o),u=null==t?i(a,10):"number"==typeof t&&i(a,t);return u&&(t=u[0],n=u[1]),r.domain(Hi(o,n>1?{floor:function(n){for(;e(n=t.floor(n));)n=oa(n-1);return n},ceil:function(n){for(;e(n=t.ceil(n));)n=oa(+n+1);return n}}:t))},r.ticks=function(t,n){var e=Bi(r.domain()),o=null==t?i(e,10):"number"==typeof t?i(e,t):!t.range&&[{range:t},n];return o&&(t=o[0],n=o[1]),t.range(e[0],oa(+e[1]+1),1>n?1:n)},r.tickFormat=function(){return e},r.copy=function(){return ia(t.copy(),n,e)},Zi(r,t)}function oa(t){return new Date(t)}function aa(t){return JSON.parse(t.responseText)}function ua(t){var n=fa.createRange();return n.selectNode(fa.body),n.createContextualFragment(t.responseText)}var sa={version:"3.5.17"},la=[].slice,ca=function(t){return la.call(t)},fa=this.document;if(fa)try{ca(fa.documentElement.childNodes)[0].nodeType}catch(ha){ca=function(t){for(var n=t.length,e=new Array(n);n--;)e[n]=t[n];return e}}if(Date.now||(Date.now=function(){return+new Date}),fa)try{fa.createElement("DIV").style.setProperty("opacity",0,"")}catch(pa){var da=this.Element.prototype,va=da.setAttribute,ga=da.setAttributeNS,ma=this.CSSStyleDeclaration.prototype,ya=ma.setProperty;da.setAttribute=function(t,n){va.call(this,t,n+"")},da.setAttributeNS=function(t,n,e){ga.call(this,t,n,e+"")},ma.setProperty=function(t,n,e){ya.call(this,t,n+"",e)}}sa.ascending=e,sa.descending=function(t,n){return t>n?-1:n>t?1:n>=t?0:NaN},sa.min=function(t,n){var e,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<o;)null!=(r=t[i])&&e>r&&(e=r)}else{for(;++i<o;)if(null!=(r=n.call(t,t[i],i))&&r>=r){e=r;break}for(;++i<o;)null!=(r=n.call(t,t[i],i))&&e>r&&(e=r)}return e},sa.max=function(t,n){var e,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<o;)null!=(r=t[i])&&r>e&&(e=r)}else{for(;++i<o;)if(null!=(r=n.call(t,t[i],i))&&r>=r){e=r;break}for(;++i<o;)null!=(r=n.call(t,t[i],i))&&r>e&&(e=r)}return e},sa.extent=function(t,n){var e,r,i,o=-1,a=t.length;if(1===arguments.length){for(;++o<a;)if(null!=(r=t[o])&&r>=r){e=i=r;break}for(;++o<a;)null!=(r=t[o])&&(e>r&&(e=r),r>i&&(i=r))}else{for(;++o<a;)if(null!=(r=n.call(t,t[o],o))&&r>=r){e=i=r;break}for(;++o<a;)null!=(r=n.call(t,t[o],o))&&(e>r&&(e=r),r>i&&(i=r))}return[e,i]},sa.sum=function(t,n){var e,r=0,o=t.length,a=-1;if(1===arguments.length)for(;++a<o;)i(e=+t[a])&&(r+=e);else for(;++a<o;)i(e=+n.call(t,t[a],a))&&(r+=e);return r},sa.mean=function(t,n){
 var e,o=0,a=t.length,u=-1,s=a;if(1===arguments.length)for(;++u<a;)i(e=r(t[u]))?o+=e:--s;else for(;++u<a;)i(e=r(n.call(t,t[u],u)))?o+=e:--s;return s?o/s:void 0},sa.quantile=function(t,n){var e=(t.length-1)*n+1,r=Math.floor(e),i=+t[r-1],o=e-r;return o?i+o*(t[r]-i):i},sa.median=function(t,n){var o,a=[],u=t.length,s=-1;if(1===arguments.length)for(;++s<u;)i(o=r(t[s]))&&a.push(o);else for(;++s<u;)i(o=r(n.call(t,t[s],s)))&&a.push(o);return a.length?sa.quantile(a.sort(e),.5):void 0},sa.variance=function(t,n){var e,o,a=t.length,u=0,s=0,l=-1,c=0;if(1===arguments.length)for(;++l<a;)i(e=r(t[l]))&&(o=e-u,u+=o/++c,s+=o*(e-u));else for(;++l<a;)i(e=r(n.call(t,t[l],l)))&&(o=e-u,u+=o/++c,s+=o*(e-u));return c>1?s/(c-1):void 0},sa.deviation=function(){var t=sa.variance.apply(this,arguments);return t?Math.sqrt(t):t};var $a=o(e);sa.bisectLeft=$a.left,sa.bisect=sa.bisectRight=$a.right,sa.bisector=function(t){return o(1===t.length?function(n,r){return e(t(n),r)}:t)},sa.shuffle=function(t,n,e){(o=arguments.length)<3&&(e=t.length,2>o&&(n=0));for(var r,i,o=e-n;o;)i=Math.random()*o--|0,r=t[o+n],t[o+n]=t[i+n],t[i+n]=r;return t},sa.permute=function(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r},sa.pairs=function(t){for(var n,e=0,r=t.length-1,i=t[0],o=new Array(0>r?0:r);r>e;)o[e]=[n=i,i=t[++e]];return o},sa.transpose=function(t){if(!(i=t.length))return[];for(var n=-1,e=sa.min(t,a),r=new Array(e);++n<e;)for(var i,o=-1,u=r[n]=new Array(i);++o<i;)u[o]=t[o][n];return r},sa.zip=function(){return sa.transpose(arguments)},sa.keys=function(t){var n=[];for(var e in t)n.push(e);return n},sa.values=function(t){var n=[];for(var e in t)n.push(t[e]);return n},sa.entries=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},sa.merge=function(t){for(var n,e,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(e=new Array(a);--i>=0;)for(r=t[i],n=r.length;--n>=0;)e[--a]=r[n];return e};var xa=Math.abs;sa.range=function(t,n,e){if(arguments.length<3&&(e=1,arguments.length<2&&(n=t,t=0)),(n-t)/e===1/0)throw new Error("infinite range");var r,i=[],o=u(xa(e)),a=-1;if(t*=o,n*=o,e*=o,0>e)for(;(r=t+e*++a)>n;)i.push(r/o);else for(;(r=t+e*++a)<n;)i.push(r/o);return i},sa.map=function(t,n){var e=new l;if(t instanceof l)t.forEach(function(t,n){e.set(t,n)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(1===arguments.length)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n.call(t,r=t[i],i),r)}else for(var a in t)e.set(a,t[a]);return e};var ba="__proto__",wa="\x00";s(l,{has:h,get:function(t){return this._[c(t)]},set:function(t,n){return this._[c(t)]=n},remove:p,keys:d,values:function(){var t=[];for(var n in this._)t.push(this._[n]);return t},entries:function(){var t=[];for(var n in this._)t.push({key:f(n),value:this._[n]});return t},size:v,empty:g,forEach:function(t){for(var n in this._)t.call(this,f(n),this._[n])}}),sa.nest=function(){function t(n,a,u){if(u>=o.length)return r?r.call(i,a):e?a.sort(e):a;for(var s,c,f,h,p=-1,d=a.length,v=o[u++],g=new l;++p<d;)(h=g.get(s=v(c=a[p])))?h.push(c):g.set(s,[c]);return n?(c=n(),f=function(e,r){c.set(e,t(n,r,u))}):(c={},f=function(e,r){c[e]=t(n,r,u)}),g.forEach(f),c}function n(t,e){if(e>=o.length)return t;var r=[],i=a[e++];return t.forEach(function(t,i){r.push({key:t,values:n(i,e)})}),i?r.sort(function(t,n){return i(t.key,n.key)}):r}var e,r,i={},o=[],a=[];return i.map=function(n,e){return t(e,n,0)},i.entries=function(e){return n(t(sa.map,e,0),0)},i.key=function(t){return o.push(t),i},i.sortKeys=function(t){return a[o.length-1]=t,i},i.sortValues=function(t){return e=t,i},i.rollup=function(t){return r=t,i},i},sa.set=function(t){var n=new m;if(t)for(var e=0,r=t.length;r>e;++e)n.add(t[e]);return n},s(m,{has:h,add:function(t){return this._[c(t+="")]=!0,t},remove:p,values:d,size:v,empty:g,forEach:function(t){for(var n in this._)t.call(this,f(n))}}),sa.behavior={},sa.rebind=function(t,n){for(var e,r=1,i=arguments.length;++r<i;)t[e=arguments[r]]=$(t,n,n[e]);return t};var Ca=["webkit","ms","moz","Moz","o","O"];sa.dispatch=function(){for(var t=new w,n=-1,e=arguments.length;++n<e;)t[arguments[n]]=C(t);return t},w.prototype.on=function(t,n){var e=t.indexOf("."),r="";if(e>=0&&(r=t.slice(e+1),t=t.slice(0,e)),t)return arguments.length<2?this[t].on(r):this[t].on(r,n);if(2===arguments.length){if(null==n)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},sa.event=null,sa.requote=function(t){return t.replace(Sa,"\\$&")};var Sa=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,_a={}.__proto__?function(t,n){t.__proto__=n}:function(t,n){for(var e in n)t[e]=n[e]},Ma=function(t,n){return n.querySelector(t)},ka=function(t,n){return n.querySelectorAll(t)},Aa=function(t,n){var e=t.matches||t[x(t,"matchesSelector")];return(Aa=function(t,n){return e.call(t,n)})(t,n)};"function"==typeof Sizzle&&(Ma=function(t,n){return Sizzle(t,n)[0]||null},ka=Sizzle,Aa=Sizzle.matchesSelector),sa.selection=function(){return sa.select(fa.documentElement)};var Ea=sa.selection.prototype=[];Ea.select=function(t){var n,e,r,i,o=[];t=A(t);for(var a=-1,u=this.length;++a<u;){o.push(n=[]),n.parentNode=(r=this[a]).parentNode;for(var s=-1,l=r.length;++s<l;)(i=r[s])?(n.push(e=t.call(i,i.__data__,s,a)),e&&"__data__"in i&&(e.__data__=i.__data__)):n.push(null)}return k(o)},Ea.selectAll=function(t){var n,e,r=[];t=E(t);for(var i=-1,o=this.length;++i<o;)for(var a=this[i],u=-1,s=a.length;++u<s;)(e=a[u])&&(r.push(n=ca(t.call(e,e.__data__,u,i))),n.parentNode=e);return k(r)};var Pa="http://www.w3.org/1999/xhtml",Oa={svg:"http://www.w3.org/2000/svg",xhtml:Pa,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};sa.ns={prefix:Oa,qualify:function(t){var n=t.indexOf(":"),e=t;return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Oa.hasOwnProperty(e)?{space:Oa[e],local:t}:t}},Ea.attr=function(t,n){if(arguments.length<2){if("string"==typeof t){var e=this.node();return t=sa.ns.qualify(t),t.local?e.getAttributeNS(t.space,t.local):e.getAttribute(t)}for(n in t)this.each(P(n,t[n]));return this}return this.each(P(t,n))},Ea.classed=function(t,n){if(arguments.length<2){if("string"==typeof t){var e=this.node(),r=(t=L(t)).length,i=-1;if(n=e.classList){for(;++i<r;)if(!n.contains(t[i]))return!1}else for(n=e.getAttribute("class");++i<r;)if(!T(t[i]).test(n))return!1;return!0}for(n in t)this.each(j(n,t[n]));return this}return this.each(j(t,n))},Ea.style=function(t,e,r){var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e="");for(r in t)this.each(R(r,t[r],e));return this}if(2>i){var o=this.node();return n(o).getComputedStyle(o,null).getPropertyValue(t)}r=""}return this.each(R(t,e,r))},Ea.property=function(t,n){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(n in t)this.each(D(n,t[n]));return this}return this.each(D(t,n))},Ea.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Ea.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Ea.append=function(t){return t=F(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Ea.insert=function(t,n){return t=F(t),n=A(n),this.select(function(){return this.insertBefore(t.apply(this,arguments),n.apply(this,arguments)||null)})},Ea.remove=function(){return this.each(I)},Ea.data=function(t,n){function e(t,e){var r,i,o,a=t.length,f=e.length,h=Math.min(a,f),p=new Array(f),d=new Array(f),v=new Array(a);if(n){var g,m=new l,y=new Array(a);for(r=-1;++r<a;)(i=t[r])&&(m.has(g=n.call(i,i.__data__,r))?v[r]=i:m.set(g,i),y[r]=g);for(r=-1;++r<f;)(i=m.get(g=n.call(e,o=e[r],r)))?i!==!0&&(p[r]=i,i.__data__=o):d[r]=z(o),m.set(g,!0);for(r=-1;++r<a;)r in y&&m.get(y[r])!==!0&&(v[r]=t[r])}else{for(r=-1;++r<h;)i=t[r],o=e[r],i?(i.__data__=o,p[r]=i):d[r]=z(o);for(;f>r;++r)d[r]=z(e[r]);for(;a>r;++r)v[r]=t[r]}d.update=p,d.parentNode=p.parentNode=v.parentNode=t.parentNode,u.push(d),s.push(p),c.push(v)}var r,i,o=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++o<a;)(i=r[o])&&(t[o]=i.__data__);return t}var u=W([]),s=k([]),c=k([]);if("function"==typeof t)for(;++o<a;)e(r=this[o],t.call(r,r.parentNode.__data__,o));else for(;++o<a;)e(r=this[o],t);return s.enter=function(){return u},s.exit=function(){return c},s},Ea.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Ea.filter=function(t){var n,e,r,i=[];"function"!=typeof t&&(t=q(t));for(var o=0,a=this.length;a>o;o++){i.push(n=[]),n.parentNode=(e=this[o]).parentNode;for(var u=0,s=e.length;s>u;u++)(r=e[u])&&t.call(r,r.__data__,u,o)&&n.push(r)}return k(i)},Ea.order=function(){for(var t=-1,n=this.length;++t<n;)for(var e,r=this[t],i=r.length-1,o=r[i];--i>=0;)(e=r[i])&&(o&&o!==e.nextSibling&&o.parentNode.insertBefore(e,o),o=e);return this},Ea.sort=function(t){t=V.apply(this,arguments);for(var n=-1,e=this.length;++n<e;)this[n].sort(t);return this.order()},Ea.each=function(t){return B(this,function(n,e,r){t.call(n,n.__data__,e,r)})},Ea.call=function(t){var n=ca(arguments);return t.apply(n[0]=this,n),this},Ea.empty=function(){return!this.node()},Ea.node=function(){for(var t=0,n=this.length;n>t;t++)for(var e=this[t],r=0,i=e.length;i>r;r++){var o=e[r];if(o)return o}return null},Ea.size=function(){var t=0;return B(this,function(){++t}),t};var Ta=[];sa.selection.enter=W,sa.selection.enter.prototype=Ta,Ta.append=Ea.append,Ta.empty=Ea.empty,Ta.node=Ea.node,Ta.call=Ea.call,Ta.size=Ea.size,Ta.select=function(t){for(var n,e,r,i,o,a=[],u=-1,s=this.length;++u<s;){r=(i=this[u]).update,a.push(n=[]),n.parentNode=i.parentNode;for(var l=-1,c=i.length;++l<c;)(o=i[l])?(n.push(r[l]=e=t.call(i.parentNode,o.__data__,l,u)),e.__data__=o.__data__):n.push(null)}return k(a)},Ta.insert=function(t,n){return arguments.length<2&&(n=U(this)),Ea.insert.call(this,t,n)},sa.select=function(n){var e;return"string"==typeof n?(e=[Ma(n,fa)],e.parentNode=fa.documentElement):(e=[n],e.parentNode=t(n)),k([e])},sa.selectAll=function(t){var n;return"string"==typeof t?(n=ca(ka(t,fa)),n.parentNode=fa.documentElement):(n=ca(t),n.parentNode=null),k([n])},Ea.on=function(t,n,e){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(n=!1);for(e in t)this.each(H(e,t[e],n));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;e=!1}return this.each(H(t,n,e))};var La=sa.map({mouseenter:"mouseover",mouseleave:"mouseout"});fa&&La.forEach(function(t){"on"+t in fa&&La.remove(t)});var ja,Na=0;sa.mouse=function(t){return Z(t,_())};var Ra=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;sa.touch=function(t,n,e){if(arguments.length<3&&(e=n,n=_().changedTouches),n)for(var r,i=0,o=n.length;o>i;++i)if((r=n[i]).identifier===e)return Z(t,r)},sa.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function e(t,n,e,o,a){return function(){function u(){var t,e,r=n(h,v);r&&(t=r[0]-$[0],e=r[1]-$[1],d|=t|e,$=r,p({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e}))}function s(){n(h,v)&&(m.on(o+g,null).on(a+g,null),y(d),p({type:"dragend"}))}var l,c=this,f=sa.event.target.correspondingElement||sa.event.target,h=c.parentNode,p=r.of(c,arguments),d=0,v=t(),g=".drag"+(null==v?"":"-"+v),m=sa.select(e(f)).on(o+g,u).on(a+g,s),y=X(f),$=n(h,v);i?(l=i.apply(c,arguments),l=[l.x-$[0],l.y-$[1]]):l=[0,0],p({type:"dragstart"})}}var r=M(t,"drag","dragstart","dragend"),i=null,o=e(b,sa.mouse,n,"mousemove","mouseup"),a=e(J,sa.touch,y,"touchmove","touchend");return t.origin=function(n){return arguments.length?(i=n,t):i},sa.rebind(t,r,"on")},sa.touches=function(t,n){return arguments.length<2&&(n=_().touches),n?ca(n).map(function(n){var e=Z(t,n);return e.identifier=n.identifier,e}):[]};var Da=1e-6,Fa=Da*Da,Ia=Math.PI,za=2*Ia,qa=za-Da,Va=Ia/2,Ba=Ia/180,Wa=180/Ia,Ua=Math.SQRT2,Ha=2,Ya=4;sa.interpolateZoom=function(t,n){var e,r,i=t[0],o=t[1],a=t[2],u=n[0],s=n[1],l=n[2],c=u-i,f=s-o,h=c*c+f*f;if(Fa>h)r=Math.log(l/a)/Ua,e=function(t){return[i+t*c,o+t*f,a*Math.exp(Ua*t*r)]};else{var p=Math.sqrt(h),d=(l*l-a*a+Ya*h)/(2*a*Ha*p),v=(l*l-a*a-Ya*h)/(2*l*Ha*p),g=Math.log(Math.sqrt(d*d+1)-d),m=Math.log(Math.sqrt(v*v+1)-v);r=(m-g)/Ua,e=function(t){var n=t*r,e=rt(g),u=a/(Ha*p)*(e*it(Ua*n+g)-et(g));return[i+u*c,o+u*f,a*e/rt(Ua*n+g)]}}return e.duration=1e3*r,e},sa.behavior.zoom=function(){function t(t){t.on(O,f).on(Xa+".zoom",p).on("dblclick.zoom",d).on(j,h)}function e(t){return[(t[0]-_.x)/_.k,(t[1]-_.y)/_.k]}function r(t){return[t[0]*_.k+_.x,t[1]*_.k+_.y]}function i(t){_.k=Math.max(A[0],Math.min(A[1],t))}function o(t,n){n=r(n),_.x+=t[0]-n[0],_.y+=t[1]-n[1]}function a(n,e,r,a){n.__chart__={x:_.x,y:_.y,k:_.k},i(Math.pow(2,a)),o(g=e,r),n=sa.select(n),E>0&&(n=n.transition().duration(E)),n.call(t.event)}function u(){b&&b.domain(x.range().map(function(t){return(t-_.x)/_.k}).map(x.invert)),C&&C.domain(w.range().map(function(t){return(t-_.y)/_.k}).map(w.invert))}function s(t){P++||t({type:"zoomstart"})}function l(t){u(),t({type:"zoom",scale:_.k,translate:[_.x,_.y]})}function c(t){--P||(t({type:"zoomend"}),g=null)}function f(){function t(){u=1,o(sa.mouse(i),h),l(a)}function r(){f.on(T,null).on(L,null),p(u),c(a)}var i=this,a=N.of(i,arguments),u=0,f=sa.select(n(i)).on(T,t).on(L,r),h=e(sa.mouse(i)),p=X(i);Vs.call(i),s(a)}function h(){function t(){var t=sa.touches(d);return p=_.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function n(){var n=sa.event.target;sa.select(n).on(x,r).on(b,u),w.push(n);for(var e=sa.event.changedTouches,i=0,o=e.length;o>i;++i)g[e[i].identifier]=null;var s=t(),l=Date.now();if(1===s.length){if(500>l-$){var c=s[0];a(d,c,g[c.identifier],Math.floor(Math.log(_.k)/Math.LN2)+1),S()}$=l}else if(s.length>1){var c=s[0],f=s[1],h=c[0]-f[0],p=c[1]-f[1];m=h*h+p*p}}function r(){var t,n,e,r,a=sa.touches(d);Vs.call(d);for(var u=0,s=a.length;s>u;++u,r=null)if(e=a[u],r=g[e.identifier]){if(n)break;t=e,n=r}if(r){var c=(c=e[0]-t[0])*c+(c=e[1]-t[1])*c,f=m&&Math.sqrt(c/m);t=[(t[0]+e[0])/2,(t[1]+e[1])/2],n=[(n[0]+r[0])/2,(n[1]+r[1])/2],i(f*p)}$=null,o(t,n),l(v)}function u(){if(sa.event.touches.length){for(var n=sa.event.changedTouches,e=0,r=n.length;r>e;++e)delete g[n[e].identifier];for(var i in g)return void t()}sa.selectAll(w).on(y,null),C.on(O,f).on(j,h),M(),c(v)}var p,d=this,v=N.of(d,arguments),g={},m=0,y=".zoom-"+sa.event.changedTouches[0].identifier,x="touchmove"+y,b="touchend"+y,w=[],C=sa.select(d),M=X(d);n(),s(v),C.on(O,null).on(j,n)}function p(){var t=N.of(this,arguments);y?clearTimeout(y):(Vs.call(this),v=e(g=m||sa.mouse(this)),s(t)),y=setTimeout(function(){y=null,c(t)},50),S(),i(Math.pow(2,.002*Ga())*_.k),o(g,v),l(t)}function d(){var t=sa.mouse(this),n=Math.log(_.k)/Math.LN2;a(this,t,e(t),sa.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var v,g,m,y,$,x,b,w,C,_={x:0,y:0,k:1},k=[960,500],A=Za,E=250,P=0,O="mousedown.zoom",T="mousemove.zoom",L="mouseup.zoom",j="touchstart.zoom",N=M(t,"zoomstart","zoom","zoomend");return Xa||(Xa="onwheel"in fa?(Ga=function(){return-sa.event.deltaY*(sa.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fa?(Ga=function(){return sa.event.wheelDelta},"mousewheel"):(Ga=function(){return-sa.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=N.of(this,arguments),n=_;zs?sa.select(this).transition().each("start.zoom",function(){_=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var e=k[0],r=k[1],i=g?g[0]:e/2,o=g?g[1]:r/2,a=sa.interpolateZoom([(i-_.x)/_.k,(o-_.y)/_.k,e/_.k],[(i-n.x)/n.k,(o-n.y)/n.k,e/n.k]);return function(n){var r=a(n),u=e/r[2];this.__chart__=_={x:i-r[0]*u,y:o-r[1]*u,k:u},l(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)}):(this.__chart__=_,s(t),l(t),c(t))})},t.translate=function(n){return arguments.length?(_={x:+n[0],y:+n[1],k:_.k},u(),t):[_.x,_.y]},t.scale=function(n){return arguments.length?(_={x:_.x,y:_.y,k:null},i(+n),u(),t):_.k},t.scaleExtent=function(n){return arguments.length?(A=null==n?Za:[+n[0],+n[1]],t):A},t.center=function(n){return arguments.length?(m=n&&[+n[0],+n[1]],t):m},t.size=function(n){return arguments.length?(k=n&&[+n[0],+n[1]],t):k},t.duration=function(n){return arguments.length?(E=+n,t):E},t.x=function(n){return arguments.length?(b=n,x=n.copy(),_={x:0,y:0,k:1},t):b},t.y=function(n){return arguments.length?(C=n,w=n.copy(),_={x:0,y:0,k:1},t):C},sa.rebind(t,N,"on")};var Ga,Xa,Za=[0,1/0];sa.color=at,at.prototype.toString=function(){return this.rgb()+""},sa.hsl=ut;var Ja=ut.prototype=new at;Ja.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,this.l/t)},Ja.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,t*this.l)},Ja.rgb=function(){return st(this.h,this.s,this.l)},sa.hcl=lt;var Ka=lt.prototype=new at;Ka.brighter=function(t){return new lt(this.h,this.c,Math.min(100,this.l+Qa*(arguments.length?t:1)))},Ka.darker=function(t){return new lt(this.h,this.c,Math.max(0,this.l-Qa*(arguments.length?t:1)))},Ka.rgb=function(){return ct(this.h,this.c,this.l).rgb()},sa.lab=ft;var Qa=18,tu=.95047,nu=1,eu=1.08883,ru=ft.prototype=new at;ru.brighter=function(t){return new ft(Math.min(100,this.l+Qa*(arguments.length?t:1)),this.a,this.b)},ru.darker=function(t){return new ft(Math.max(0,this.l-Qa*(arguments.length?t:1)),this.a,this.b)},ru.rgb=function(){return ht(this.l,this.a,this.b)},sa.rgb=mt;var iu=mt.prototype=new at;iu.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var n=this.r,e=this.g,r=this.b,i=30;return n||e||r?(n&&i>n&&(n=i),e&&i>e&&(e=i),r&&i>r&&(r=i),new mt(Math.min(255,n/t),Math.min(255,e/t),Math.min(255,r/t))):new mt(i,i,i)},iu.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new mt(t*this.r,t*this.g,t*this.b)},iu.hsl=function(){return wt(this.r,this.g,this.b)},iu.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var ou=sa.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ou.forEach(function(t,n){ou.set(t,yt(n))}),sa.functor=Mt,sa.xhr=kt(y),sa.dsv=function(t,n){function e(t,e,o){arguments.length<3&&(o=e,e=null);var a=At(t,n,null==e?r:i(e),o);return a.row=function(t){return arguments.length?a.response(null==(e=t)?r:i(t)):e},a}function r(t){return e.parse(t.responseText)}function i(t){return function(n){return e.parse(n.responseText,t)}}function o(n){return n.map(a).join(t)}function a(t){return u.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var u=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return e.parse=function(t,n){var r;return e.parseRows(t,function(t,e){if(r)return r(t,e-1);var i=new Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}");r=n?function(t,e){return n(i(t),e)}:i})},e.parseRows=function(t,n){function e(){if(c>=l)return a;if(i)return i=!1,o;var n=c;if(34===t.charCodeAt(n)){for(var e=n;e++<l;)if(34===t.charCodeAt(e)){if(34!==t.charCodeAt(e+1))break;++e}c=e+2;var r=t.charCodeAt(e+1);return 13===r?(i=!0,10===t.charCodeAt(e+2)&&++c):10===r&&(i=!0),t.slice(n+1,e).replace(/""/g,'"')}for(;l>c;){var r=t.charCodeAt(c++),u=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(c)&&(++c,++u);else if(r!==s)continue;return t.slice(n,c-u)}return t.slice(n)}for(var r,i,o={},a={},u=[],l=t.length,c=0,f=0;(r=e())!==a;){for(var h=[];r!==o&&r!==a;)h.push(r),r=e();n&&null==(h=n(h,f++))||u.push(h)}return u},e.format=function(n){if(Array.isArray(n[0]))return e.formatRows(n);var r=new m,i=[];return n.forEach(function(t){for(var n in t)r.has(n)||i.push(r.add(n))}),[i.map(a).join(t)].concat(n.map(function(n){return i.map(function(t){return a(n[t])}).join(t)})).join("\n")},e.formatRows=function(t){return t.map(o).join("\n")},e},sa.csv=sa.dsv(",","text/csv"),sa.tsv=sa.dsv("	","text/tab-separated-values");var au,uu,su,lu,cu=this[x(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};sa.timer=function(){Ot.apply(this,arguments)},sa.timer.flush=function(){Lt(),jt()},sa.round=function(t,n){return n?Math.round(t*(n=Math.pow(10,n)))/n:Math.round(t)};var fu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Rt);sa.formatPrefix=function(t,n){var e=0;return(t=+t)&&(0>t&&(t*=-1),n&&(t=sa.round(t,Nt(t,n))),e=1+Math.floor(1e-12+Math.log(t)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),fu[8+e/3]};var hu=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,pu=sa.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,n){return t.toPrecision(n)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},r:function(t,n){return(t=sa.round(t,Nt(t,n))).toFixed(Math.max(0,Math.min(20,Nt(t*(1+1e-15),n))))}}),du=sa.time={},vu=Date;It.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){gu.setUTCDate.apply(this._,arguments)},setDay:function(){gu.setUTCDay.apply(this._,arguments)},setFullYear:function(){gu.setUTCFullYear.apply(this._,arguments)},setHours:function(){gu.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){gu.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){gu.setUTCMinutes.apply(this._,arguments)},setMonth:function(){gu.setUTCMonth.apply(this._,arguments)},setSeconds:function(){gu.setUTCSeconds.apply(this._,arguments)},setTime:function(){gu.setTime.apply(this._,arguments)}};var gu=Date.prototype;du.year=zt(function(t){return t=du.day(t),t.setMonth(0,1),t},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t){return t.getFullYear()}),du.years=du.year.range,du.years.utc=du.year.utc.range,du.day=zt(function(t){var n=new vu(2e3,0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n},function(t,n){t.setDate(t.getDate()+n)},function(t){return t.getDate()-1}),du.days=du.day.range,du.days.utc=du.day.utc.range,du.dayOfYear=function(t){var n=du.year(t);return Math.floor((t-n-6e4*(t.getTimezoneOffset()-n.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,n){n=7-n;var e=du[t]=zt(function(t){return(t=du.day(t)).setDate(t.getDate()-(t.getDay()+n)%7),t},function(t,n){t.setDate(t.getDate()+7*Math.floor(n))},function(t){var e=du.year(t).getDay();return Math.floor((du.dayOfYear(t)+(e+n)%7)/7)-(e!==n)});du[t+"s"]=e.range,du[t+"s"].utc=e.utc.range,du[t+"OfYear"]=function(t){var e=du.year(t).getDay();return Math.floor((du.dayOfYear(t)+(e+n)%7)/7)}}),du.week=du.sunday,du.weeks=du.sunday.range,du.weeks.utc=du.sunday.utc.range,du.weekOfYear=du.sundayOfYear;var mu={"-":"",_:" ",0:"0"},yu=/^\s*\d+/,$u=/^%/;sa.locale=function(t){return{numberFormat:Dt(t),timeFormat:Vt(t)}};var xu=sa.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});sa.format=xu.numberFormat,sa.geo={},cn.prototype={s:0,t:0,add:function(t){fn(t,this.t,bu),fn(bu.s,this.s,this),this.s?this.t+=bu.t:this.s=bu.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var bu=new cn;sa.geo.stream=function(t,n){t&&wu.hasOwnProperty(t.type)?wu[t.type](t,n):hn(t,n)};var wu={Feature:function(t,n){hn(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)hn(e[r].geometry,n)}},Cu={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){pn(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)pn(e[r],n,0)},Polygon:function(t,n){dn(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)dn(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)hn(e[r],n)}};sa.geo.area=function(t){return Su=0,sa.geo.stream(t,Mu),Su};var Su,_u=new cn,Mu={sphere:function(){Su+=4*Ia},point:b,lineStart:b,lineEnd:b,polygonStart:function(){_u.reset(),Mu.lineStart=vn},polygonEnd:function(){var t=2*_u;Su+=0>t?4*Ia+t:t,Mu.lineStart=Mu.lineEnd=Mu.point=b}};sa.geo.bounds=function(){function t(t,n){$.push(x=[c=t,h=t]),f>n&&(f=n),n>p&&(p=n)}function n(n,e){var r=gn([n*Ba,e*Ba]);if(m){var i=yn(m,r),o=[i[1],-i[0],0],a=yn(o,i);bn(a),a=wn(a);var s=n-d,l=s>0?1:-1,v=a[0]*Wa*l,g=xa(s)>180;if(g^(v>l*d&&l*n>v)){var y=a[1]*Wa;y>p&&(p=y)}else if(v=(v+360)%360-180,g^(v>l*d&&l*n>v)){var y=-a[1]*Wa;f>y&&(f=y)}else f>e&&(f=e),e>p&&(p=e);g?d>n?u(c,n)>u(c,h)&&(h=n):u(n,h)>u(c,h)&&(c=n):h>=c?(c>n&&(c=n),n>h&&(h=n)):n>d?u(c,n)>u(c,h)&&(h=n):u(n,h)>u(c,h)&&(c=n)}else t(n,e);m=r,d=n}function e(){b.point=n}function r(){x[0]=c,x[1]=h,b.point=t,m=null}function i(t,e){if(m){var r=t-d;y+=xa(r)>180?r+(r>0?360:-360):r}else v=t,g=e;Mu.point(t,e),n(t,e)}function o(){Mu.lineStart()}function a(){i(v,g),Mu.lineEnd(),xa(y)>Da&&(c=-(h=180)),x[0]=c,x[1]=h,m=null}function u(t,n){return(n-=t)<0?n+360:n}function s(t,n){return t[0]-n[0]}function l(t,n){return n[0]<=n[1]?n[0]<=t&&t<=n[1]:t<n[0]||n[1]<t}var c,f,h,p,d,v,g,m,y,$,x,b={point:t,lineStart:e,lineEnd:r,polygonStart:function(){b.point=i,b.lineStart=o,b.lineEnd=a,y=0,Mu.polygonStart()},polygonEnd:function(){Mu.polygonEnd(),b.point=t,b.lineStart=e,b.lineEnd=r,0>_u?(c=-(h=180),f=-(p=90)):y>Da?p=90:-Da>y&&(f=-90),x[0]=c,x[1]=h}};return function(t){p=h=-(c=f=1/0),$=[],sa.geo.stream(t,b);var n=$.length;if(n){$.sort(s);for(var e,r=1,i=$[0],o=[i];n>r;++r)e=$[r],l(e[0],i)||l(e[1],i)?(u(i[0],e[1])>u(i[0],i[1])&&(i[1]=e[1]),u(e[0],i[1])>u(i[0],i[1])&&(i[0]=e[0])):o.push(i=e);for(var a,e,d=-(1/0),n=o.length-1,r=0,i=o[n];n>=r;i=e,++r)e=o[r],(a=u(i[1],e[0]))>d&&(d=a,c=e[0],h=i[1])}return $=x=null,c===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,f],[h,p]]}}(),sa.geo.centroid=function(t){ku=Au=Eu=Pu=Ou=Tu=Lu=ju=Nu=Ru=Du=0,sa.geo.stream(t,Fu);var n=Nu,e=Ru,r=Du,i=n*n+e*e+r*r;return Fa>i&&(n=Tu,e=Lu,r=ju,Da>Au&&(n=Eu,e=Pu,r=Ou),i=n*n+e*e+r*r,Fa>i)?[NaN,NaN]:[Math.atan2(e,n)*Wa,nt(r/Math.sqrt(i))*Wa]};var ku,Au,Eu,Pu,Ou,Tu,Lu,ju,Nu,Ru,Du,Fu={sphere:b,point:Sn,lineStart:Mn,lineEnd:kn,polygonStart:function(){Fu.lineStart=An},polygonEnd:function(){Fu.lineStart=Mn}},Iu=jn(Pn,Fn,zn,[-Ia,-Ia/2]),zu=1e9;sa.geo.clipExtent=function(){var t,n,e,r,i,o,a={stream:function(t){return i&&(i.valid=!1),i=o(t),i.valid=!0,i},extent:function(u){return arguments.length?(o=Wn(t=+u[0][0],n=+u[0][1],e=+u[1][0],r=+u[1][1]),i&&(i.valid=!1,i=null),a):[[t,n],[e,r]]}};return a.extent([[0,0],[960,500]])},(sa.geo.conicEqualArea=function(){return Un(Hn)}).raw=Hn,sa.geo.albers=function(){return sa.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},sa.geo.albersUsa=function(){function t(t){var o=t[0],a=t[1];return n=null,e(o,a),n||(r(o,a),n)||i(o,a),n}var n,e,r,i,o=sa.geo.albers(),a=sa.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=sa.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,e){n=[t,e]}};return t.invert=function(t){var n=o.scale(),e=o.translate(),r=(t[0]-e[0])/n,i=(t[1]-e[1])/n;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?a:i>=.166&&.234>i&&r>=-.214&&-.115>r?u:o).invert(t)},t.stream=function(t){var n=o.stream(t),e=a.stream(t),r=u.stream(t);return{point:function(t,i){n.point(t,i),e.point(t,i),r.point(t,i)},sphere:function(){n.sphere(),e.sphere(),r.sphere()},lineStart:function(){n.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){n.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){n.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){n.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},t.precision=function(n){return arguments.length?(o.precision(n),a.precision(n),u.precision(n),t):o.precision()},t.scale=function(n){return arguments.length?(o.scale(n),a.scale(.35*n),u.scale(n),t.translate(o.translate())):o.scale()},t.translate=function(n){if(!arguments.length)return o.translate();var l=o.scale(),c=+n[0],f=+n[1];return e=o.translate(n).clipExtent([[c-.455*l,f-.238*l],[c+.455*l,f+.238*l]]).stream(s).point,r=a.translate([c-.307*l,f+.201*l]).clipExtent([[c-.425*l+Da,f+.12*l+Da],[c-.214*l-Da,f+.234*l-Da]]).stream(s).point,i=u.translate([c-.205*l,f+.212*l]).clipExtent([[c-.214*l+Da,f+.166*l+Da],[c-.115*l-Da,f+.234*l-Da]]).stream(s).point,t},t.scale(1070)};var qu,Vu,Bu,Wu,Uu,Hu,Yu={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Vu=0,Yu.lineStart=Yn;
 },polygonEnd:function(){Yu.lineStart=Yu.lineEnd=Yu.point=b,qu+=xa(Vu/2)}},Gu={point:Gn,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Xu={point:Jn,lineStart:Kn,lineEnd:Qn,polygonStart:function(){Xu.lineStart=te},polygonEnd:function(){Xu.point=Jn,Xu.lineStart=Kn,Xu.lineEnd=Qn}};sa.geo.path=function(){function t(t){return t&&("function"==typeof u&&o.pointRadius(+u.apply(this,arguments)),a&&a.valid||(a=i(o)),sa.geo.stream(t,a)),o.result()}function n(){return a=null,t}var e,r,i,o,a,u=4.5;return t.area=function(t){return qu=0,sa.geo.stream(t,i(Yu)),qu},t.centroid=function(t){return Eu=Pu=Ou=Tu=Lu=ju=Nu=Ru=Du=0,sa.geo.stream(t,i(Xu)),Du?[Nu/Du,Ru/Du]:ju?[Tu/ju,Lu/ju]:Ou?[Eu/Ou,Pu/Ou]:[NaN,NaN]},t.bounds=function(t){return Uu=Hu=-(Bu=Wu=1/0),sa.geo.stream(t,i(Gu)),[[Bu,Wu],[Uu,Hu]]},t.projection=function(t){return arguments.length?(i=(e=t)?t.stream||re(t):y,n()):e},t.context=function(t){return arguments.length?(o=null==(r=t)?new Xn:new ne(t),"function"!=typeof u&&o.pointRadius(u),n()):r},t.pointRadius=function(n){return arguments.length?(u="function"==typeof n?n:(o.pointRadius(+n),+n),t):u},t.projection(sa.geo.albersUsa()).context(null)},sa.geo.transform=function(t){return{stream:function(n){var e=new ie(n);for(var r in t)e[r]=t[r];return e}}},ie.prototype={point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},sa.geo.projection=ae,sa.geo.projectionMutator=ue,(sa.geo.equirectangular=function(){return ae(le)}).raw=le.invert=le,sa.geo.rotation=function(t){function n(n){return n=t(n[0]*Ba,n[1]*Ba),n[0]*=Wa,n[1]*=Wa,n}return t=fe(t[0]%360*Ba,t[1]*Ba,t.length>2?t[2]*Ba:0),n.invert=function(n){return n=t.invert(n[0]*Ba,n[1]*Ba),n[0]*=Wa,n[1]*=Wa,n},n},ce.invert=le,sa.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,n=fe(-t[0]*Ba,-t[1]*Ba,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Wa,t[1]*=Wa}}),{type:"Polygon",coordinates:[i]}}var n,e,r=[0,0],i=6;return t.origin=function(n){return arguments.length?(r=n,t):r},t.angle=function(r){return arguments.length?(e=ve((n=+r)*Ba,i*Ba),t):n},t.precision=function(r){return arguments.length?(e=ve(n*Ba,(i=+r)*Ba),t):i},t.angle(90)},sa.geo.distance=function(t,n){var e,r=(n[0]-t[0])*Ba,i=t[1]*Ba,o=n[1]*Ba,a=Math.sin(r),u=Math.cos(r),s=Math.sin(i),l=Math.cos(i),c=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((e=f*a)*e+(e=l*c-s*f*u)*e),s*c+l*f*u)},sa.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return sa.range(Math.ceil(o/g)*g,i,g).map(h).concat(sa.range(Math.ceil(l/m)*m,s,m).map(p)).concat(sa.range(Math.ceil(r/d)*d,e,d).filter(function(t){return xa(t%g)>Da}).map(c)).concat(sa.range(Math.ceil(u/v)*v,a,v).filter(function(t){return xa(t%m)>Da}).map(f))}var e,r,i,o,a,u,s,l,c,f,h,p,d=10,v=d,g=90,m=360,y=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(p(s).slice(1),h(i).reverse().slice(1),p(l).reverse().slice(1))]}},t.extent=function(n){return arguments.length?t.majorExtent(n).minorExtent(n):t.minorExtent()},t.majorExtent=function(n){return arguments.length?(o=+n[0][0],i=+n[1][0],l=+n[0][1],s=+n[1][1],o>i&&(n=o,o=i,i=n),l>s&&(n=l,l=s,s=n),t.precision(y)):[[o,l],[i,s]]},t.minorExtent=function(n){return arguments.length?(r=+n[0][0],e=+n[1][0],u=+n[0][1],a=+n[1][1],r>e&&(n=r,r=e,e=n),u>a&&(n=u,u=a,a=n),t.precision(y)):[[r,u],[e,a]]},t.step=function(n){return arguments.length?t.majorStep(n).minorStep(n):t.minorStep()},t.majorStep=function(n){return arguments.length?(g=+n[0],m=+n[1],t):[g,m]},t.minorStep=function(n){return arguments.length?(d=+n[0],v=+n[1],t):[d,v]},t.precision=function(n){return arguments.length?(y=+n,c=me(u,a,90),f=ye(r,e,y),h=me(l,s,90),p=ye(o,i,y),t):y},t.majorExtent([[-180,-90+Da],[180,90-Da]]).minorExtent([[-180,-80-Da],[180,80+Da]])},sa.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[n||r.apply(this,arguments),e||i.apply(this,arguments)]}}var n,e,r=$e,i=xe;return t.distance=function(){return sa.geo.distance(n||r.apply(this,arguments),e||i.apply(this,arguments))},t.source=function(e){return arguments.length?(r=e,n="function"==typeof e?null:e,t):r},t.target=function(n){return arguments.length?(i=n,e="function"==typeof n?null:n,t):i},t.precision=function(){return arguments.length?t:0},t},sa.geo.interpolate=function(t,n){return be(t[0]*Ba,t[1]*Ba,n[0]*Ba,n[1]*Ba)},sa.geo.length=function(t){return Zu=0,sa.geo.stream(t,Ju),Zu};var Zu,Ju={sphere:b,point:b,lineStart:we,lineEnd:b,polygonStart:b,polygonEnd:b},Ku=Ce(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(sa.geo.azimuthalEqualArea=function(){return ae(Ku)}).raw=Ku;var Qu=Ce(function(t){var n=Math.acos(t);return n&&n/Math.sin(n)},y);(sa.geo.azimuthalEquidistant=function(){return ae(Qu)}).raw=Qu,(sa.geo.conicConformal=function(){return Un(Se)}).raw=Se,(sa.geo.conicEquidistant=function(){return Un(_e)}).raw=_e;var ts=Ce(function(t){return 1/t},Math.atan);(sa.geo.gnomonic=function(){return ae(ts)}).raw=ts,Me.invert=function(t,n){return[t,2*Math.atan(Math.exp(n))-Va]},(sa.geo.mercator=function(){return ke(Me)}).raw=Me;var ns=Ce(function(){return 1},Math.asin);(sa.geo.orthographic=function(){return ae(ns)}).raw=ns;var es=Ce(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(sa.geo.stereographic=function(){return ae(es)}).raw=es,Ae.invert=function(t,n){return[-n,2*Math.atan(Math.exp(t))-Va]},(sa.geo.transverseMercator=function(){var t=ke(Ae),n=t.center,e=t.rotate;return t.center=function(t){return t?n([-t[1],t[0]]):(t=n(),[t[1],-t[0]])},t.rotate=function(t){return t?e([t[0],t[1],t.length>2?t[2]+90:90]):(t=e(),[t[0],t[1],t[2]-90])},e([0,0,90])}).raw=Ae,sa.geom={},sa.geom.hull=function(t){function n(t){if(t.length<3)return[];var n,i=Mt(e),o=Mt(r),a=t.length,u=[],s=[];for(n=0;a>n;n++)u.push([+i.call(this,t[n],n),+o.call(this,t[n],n),n]);for(u.sort(Te),n=0;a>n;n++)s.push([u[n][0],-u[n][1]]);var l=Oe(u),c=Oe(s),f=c[0]===l[0],h=c[c.length-1]===l[l.length-1],p=[];for(n=l.length-1;n>=0;--n)p.push(t[u[l[n]][2]]);for(n=+f;n<c.length-h;++n)p.push(t[u[c[n]][2]]);return p}var e=Ee,r=Pe;return arguments.length?n(t):(n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n)},sa.geom.polygon=function(t){return _a(t,rs),t};var rs=sa.geom.polygon.prototype=[];rs.area=function(){for(var t,n=-1,e=this.length,r=this[e-1],i=0;++n<e;)t=r,r=this[n],i+=t[1]*r[0]-t[0]*r[1];return.5*i},rs.centroid=function(t){var n,e,r=-1,i=this.length,o=0,a=0,u=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++r<i;)n=u,u=this[r],e=n[0]*u[1]-u[0]*n[1],o+=(n[0]+u[0])*e,a+=(n[1]+u[1])*e;return[o*t,a*t]},rs.clip=function(t){for(var n,e,r,i,o,a,u=Ne(t),s=-1,l=this.length-Ne(this),c=this[l-1];++s<l;){for(n=t.slice(),t.length=0,i=this[s],o=n[(r=n.length-u)-1],e=-1;++e<r;)a=n[e],Le(a,c,i)?(Le(o,c,i)||t.push(je(o,a,c,i)),t.push(a)):Le(o,c,i)&&t.push(je(o,a,c,i)),o=a;u&&t.push(t[0]),c=i}return t};var is,os,as,us,ss,ls=[],cs=[];Be.prototype.prepare=function(){for(var t,n=this.edges,e=n.length;e--;)t=n[e].edge,t.b&&t.a||n.splice(e,1);return n.sort(Ue),n.length},nr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},er.prototype={insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=ar(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)r=e.U,e===r.L?(i=r.R,i&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(ir(this,e),t=e,e=t.U),e.C=!1,r.C=!0,or(this,r))):(i=r.L,i&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(or(this,e),t=e,e=t.U),e.C=!1,r.C=!0,ir(this,r))),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,o=t.L,a=t.R;if(e=o?a?ar(a):o:a,i?i.L===t?i.L=e:i.R=e:this._=e,o&&a?(r=e.C,e.C=t.C,e.L=o,o.U=e,e!==a?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=a,a.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if(n=i.R,n.C&&(n.C=!1,i.C=!0,ir(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,or(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,ir(this,i),t=this._;break}}else if(n=i.L,n.C&&(n.C=!1,i.C=!0,or(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,ir(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,or(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},sa.geom.voronoi=function(t){function n(t){var n=new Array(t.length),r=u[0][0],i=u[0][1],o=u[1][0],a=u[1][1];return ur(e(t),u).cells.forEach(function(e,u){var s=e.edges,l=e.site,c=n[u]=s.length?s.map(function(t){var n=t.start();return[n.x,n.y]}):l.x>=r&&l.x<=o&&l.y>=i&&l.y<=a?[[r,a],[o,a],[o,i],[r,i]]:[];c.point=t[u]}),n}function e(t){return t.map(function(t,n){return{x:Math.round(o(t,n)/Da)*Da,y:Math.round(a(t,n)/Da)*Da,i:n}})}var r=Ee,i=Pe,o=r,a=i,u=fs;return t?n(t):(n.links=function(t){return ur(e(t)).edges.filter(function(t){return t.l&&t.r}).map(function(n){return{source:t[n.l.i],target:t[n.r.i]}})},n.triangles=function(t){var n=[];return ur(e(t)).cells.forEach(function(e,r){for(var i,o,a=e.site,u=e.edges.sort(Ue),s=-1,l=u.length,c=u[l-1].edge,f=c.l===a?c.r:c.l;++s<l;)i=c,o=f,c=u[s].edge,f=c.l===a?c.r:c.l,r<o.i&&r<f.i&&lr(a,o,f)<0&&n.push([t[r],t[o.i],t[f.i]])}),n},n.x=function(t){return arguments.length?(o=Mt(r=t),n):r},n.y=function(t){return arguments.length?(a=Mt(i=t),n):i},n.clipExtent=function(t){return arguments.length?(u=null==t?fs:t,n):u===fs?null:u},n.size=function(t){return arguments.length?n.clipExtent(t&&[[0,0],t]):u===fs?null:u&&u[1]},n)};var fs=[[-1e6,-1e6],[1e6,1e6]];sa.geom.delaunay=function(t){return sa.geom.voronoi().triangles(t)},sa.geom.quadtree=function(t,n,e,r,i){function o(t){function o(t,n,e,r,i,o,a,u){if(!isNaN(e)&&!isNaN(r))if(t.leaf){var s=t.x,c=t.y;if(null!=s)if(xa(s-e)+xa(c-r)<.01)l(t,n,e,r,i,o,a,u);else{var f=t.point;t.x=t.y=t.point=null,l(t,f,s,c,i,o,a,u),l(t,n,e,r,i,o,a,u)}else t.x=e,t.y=r,t.point=n}else l(t,n,e,r,i,o,a,u)}function l(t,n,e,r,i,a,u,s){var l=.5*(i+u),c=.5*(a+s),f=e>=l,h=r>=c,p=h<<1|f;t.leaf=!1,t=t.nodes[p]||(t.nodes[p]=hr()),f?i=l:u=l,h?a=c:s=c,o(t,n,e,r,i,a,u,s)}var c,f,h,p,d,v,g,m,y,$=Mt(u),x=Mt(s);if(null!=n)v=n,g=e,m=r,y=i;else if(m=y=-(v=g=1/0),f=[],h=[],d=t.length,a)for(p=0;d>p;++p)c=t[p],c.x<v&&(v=c.x),c.y<g&&(g=c.y),c.x>m&&(m=c.x),c.y>y&&(y=c.y),f.push(c.x),h.push(c.y);else for(p=0;d>p;++p){var b=+$(c=t[p],p),w=+x(c,p);v>b&&(v=b),g>w&&(g=w),b>m&&(m=b),w>y&&(y=w),f.push(b),h.push(w)}var C=m-v,S=y-g;C>S?y=g+C:m=v+S;var _=hr();if(_.add=function(t){o(_,t,+$(t,++p),+x(t,p),v,g,m,y)},_.visit=function(t){pr(t,_,v,g,m,y)},_.find=function(t){return dr(_,t[0],t[1],v,g,m,y)},p=-1,null==n){for(;++p<d;)o(_,t[p],f[p],h[p],v,g,m,y);--p}else t.forEach(_.add);return f=h=t=c=null,_}var a,u=Ee,s=Pe;return(a=arguments.length)?(u=cr,s=fr,3===a&&(i=e,r=n,e=n=0),o(t)):(o.x=function(t){return arguments.length?(u=t,o):u},o.y=function(t){return arguments.length?(s=t,o):s},o.extent=function(t){return arguments.length?(null==t?n=e=r=i=null:(n=+t[0][0],e=+t[0][1],r=+t[1][0],i=+t[1][1]),o):null==n?null:[[n,e],[r,i]]},o.size=function(t){return arguments.length?(null==t?n=e=r=i=null:(n=e=0,r=+t[0],i=+t[1]),o):null==n?null:[r-n,i-e]},o)},sa.interpolateRgb=vr,sa.interpolateObject=gr,sa.interpolateNumber=mr,sa.interpolateString=yr;var hs=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ps=new RegExp(hs.source,"g");sa.interpolate=$r,sa.interpolators=[function(t,n){var e=typeof n;return("string"===e?ou.has(n.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(n)?vr:yr:n instanceof at?vr:Array.isArray(n)?xr:"object"===e&&isNaN(n)?gr:mr)(t,n)}],sa.interpolateArray=xr;var ds=function(){return y},vs=sa.map({linear:ds,poly:kr,quad:function(){return Sr},cubic:function(){return _r},sin:function(){return Ar},exp:function(){return Er},circle:function(){return Pr},elastic:Or,back:Tr,bounce:function(){return Lr}}),gs=sa.map({"in":y,out:wr,"in-out":Cr,"out-in":function(t){return Cr(wr(t))}});sa.ease=function(t){var n=t.indexOf("-"),e=n>=0?t.slice(0,n):t,r=n>=0?t.slice(n+1):"in";return e=vs.get(e)||ds,r=gs.get(r)||y,br(r(e.apply(null,la.call(arguments,1))))},sa.interpolateHcl=jr,sa.interpolateHsl=Nr,sa.interpolateLab=Rr,sa.interpolateRound=Dr,sa.transform=function(t){var n=fa.createElementNS(sa.ns.prefix.svg,"g");return(sa.transform=function(t){if(null!=t){n.setAttribute("transform",t);var e=n.transform.baseVal.consolidate()}return new Fr(e?e.matrix:ms)})(t)},Fr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ms={a:1,b:0,c:0,d:1,e:0,f:0};sa.interpolateTransform=Yr,sa.layout={},sa.layout.bundle=function(){return function(t){for(var n=[],e=-1,r=t.length;++e<r;)n.push(Zr(t[e]));return n}},sa.layout.chord=function(){function t(){var t,l,f,h,p,d={},v=[],g=sa.range(o),m=[];for(e=[],r=[],t=0,h=-1;++h<o;){for(l=0,p=-1;++p<o;)l+=i[h][p];v.push(l),m.push(sa.range(o)),t+=l}for(a&&g.sort(function(t,n){return a(v[t],v[n])}),u&&m.forEach(function(t,n){t.sort(function(t,e){return u(i[n][t],i[n][e])})}),t=(za-c*o)/t,l=0,h=-1;++h<o;){for(f=l,p=-1;++p<o;){var y=g[h],$=m[y][p],x=i[y][$],b=l,w=l+=x*t;d[y+"-"+$]={index:y,subindex:$,startAngle:b,endAngle:w,value:x}}r[y]={index:y,startAngle:f,endAngle:l,value:v[y]},l+=c}for(h=-1;++h<o;)for(p=h-1;++p<o;){var C=d[h+"-"+p],S=d[p+"-"+h];(C.value||S.value)&&e.push(C.value<S.value?{source:S,target:C}:{source:C,target:S})}s&&n()}function n(){e.sort(function(t,n){return s((t.source.value+t.target.value)/2,(n.source.value+n.target.value)/2)})}var e,r,i,o,a,u,s,l={},c=0;return l.matrix=function(t){return arguments.length?(o=(i=t)&&i.length,e=r=null,l):i},l.padding=function(t){return arguments.length?(c=t,e=r=null,l):c},l.sortGroups=function(t){return arguments.length?(a=t,e=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(u=t,e=null,l):u},l.sortChords=function(t){return arguments.length?(s=t,e&&n(),l):s},l.chords=function(){return e||t(),e},l.groups=function(){return r||t(),r},l},sa.layout.force=function(){function t(t){return function(n,e,r,i){if(n.point!==t){var o=n.cx-t.x,a=n.cy-t.y,u=i-e,s=o*o+a*a;if(s>u*u/m){if(v>s){var l=n.charge/s;t.px-=o*l,t.py-=a*l}return!0}if(n.point&&s&&v>s){var l=n.pointCharge/s;t.px-=o*l,t.py-=a*l}}return!n.charge}}function n(t){t.px=sa.event.x,t.py=sa.event.y,s.resume()}var e,r,i,o,a,u,s={},l=sa.dispatch("start","tick","end"),c=[1,1],f=.9,h=ys,p=$s,d=-30,v=xs,g=.1,m=.64,$=[],x=[];return s.tick=function(){if((i*=.99)<.005)return e=null,l.end({type:"end",alpha:i=0}),!0;var n,r,s,h,p,v,m,y,b,w=$.length,C=x.length;for(r=0;C>r;++r)s=x[r],h=s.source,p=s.target,y=p.x-h.x,b=p.y-h.y,(v=y*y+b*b)&&(v=i*a[r]*((v=Math.sqrt(v))-o[r])/v,y*=v,b*=v,p.x-=y*(m=h.weight+p.weight?h.weight/(h.weight+p.weight):.5),p.y-=b*m,h.x+=y*(m=1-m),h.y+=b*m);if((m=i*g)&&(y=c[0]/2,b=c[1]/2,r=-1,m))for(;++r<w;)s=$[r],s.x+=(y-s.x)*m,s.y+=(b-s.y)*m;if(d)for(ri(n=sa.geom.quadtree($),i,u),r=-1;++r<w;)(s=$[r]).fixed||n.visit(t(s));for(r=-1;++r<w;)s=$[r],s.fixed?(s.x=s.px,s.y=s.py):(s.x-=(s.px-(s.px=s.x))*f,s.y-=(s.py-(s.py=s.y))*f);l.tick({type:"tick",alpha:i})},s.nodes=function(t){return arguments.length?($=t,s):$},s.links=function(t){return arguments.length?(x=t,s):x},s.size=function(t){return arguments.length?(c=t,s):c},s.linkDistance=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(p="function"==typeof t?t:+t,s):p},s.friction=function(t){return arguments.length?(f=+t,s):f},s.charge=function(t){return arguments.length?(d="function"==typeof t?t:+t,s):d},s.chargeDistance=function(t){return arguments.length?(v=t*t,s):Math.sqrt(v)},s.gravity=function(t){return arguments.length?(g=+t,s):g},s.theta=function(t){return arguments.length?(m=t*t,s):Math.sqrt(m)},s.alpha=function(t){return arguments.length?(t=+t,i?t>0?i=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:i=0})):t>0&&(l.start({type:"start",alpha:i=t}),e=Ot(s.tick)),s):i},s.start=function(){function t(t,r){if(!e){for(e=new Array(i),s=0;i>s;++s)e[s]=[];for(s=0;l>s;++s){var o=x[s];e[o.source.index].push(o.target),e[o.target.index].push(o.source)}}for(var a,u=e[n],s=-1,c=u.length;++s<c;)if(!isNaN(a=u[s][t]))return a;return Math.random()*r}var n,e,r,i=$.length,l=x.length,f=c[0],v=c[1];for(n=0;i>n;++n)(r=$[n]).index=n,r.weight=0;for(n=0;l>n;++n)r=x[n],"number"==typeof r.source&&(r.source=$[r.source]),"number"==typeof r.target&&(r.target=$[r.target]),++r.source.weight,++r.target.weight;for(n=0;i>n;++n)r=$[n],isNaN(r.x)&&(r.x=t("x",f)),isNaN(r.y)&&(r.y=t("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(o=[],"function"==typeof h)for(n=0;l>n;++n)o[n]=+h.call(this,x[n],n);else for(n=0;l>n;++n)o[n]=h;if(a=[],"function"==typeof p)for(n=0;l>n;++n)a[n]=+p.call(this,x[n],n);else for(n=0;l>n;++n)a[n]=p;if(u=[],"function"==typeof d)for(n=0;i>n;++n)u[n]=+d.call(this,$[n],n);else for(n=0;i>n;++n)u[n]=d;return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){return r||(r=sa.behavior.drag().origin(y).on("dragstart.force",Qr).on("drag.force",n).on("dragend.force",ti)),arguments.length?void this.on("mouseover.force",ni).on("mouseout.force",ei).call(r):r},sa.rebind(s,l,"on")};var ys=20,$s=1,xs=1/0;sa.layout.hierarchy=function(){function t(i){var o,a=[i],u=[];for(i.depth=0;null!=(o=a.pop());)if(u.push(o),(l=e.call(t,o,o.depth))&&(s=l.length)){for(var s,l,c;--s>=0;)a.push(c=l[s]),c.parent=o,c.depth=o.depth+1;r&&(o.value=0),o.children=l}else r&&(o.value=+r.call(t,o,o.depth)||0),delete o.children;return ai(i,function(t){var e,i;n&&(e=t.children)&&e.sort(n),r&&(i=t.parent)&&(i.value+=t.value)}),u}var n=li,e=ui,r=si;return t.sort=function(e){return arguments.length?(n=e,t):n},t.children=function(n){return arguments.length?(e=n,t):e},t.value=function(n){return arguments.length?(r=n,t):r},t.revalue=function(n){return r&&(oi(n,function(t){t.children&&(t.value=0)}),ai(n,function(n){var e;n.children||(n.value=+r.call(t,n,n.depth)||0),(e=n.parent)&&(e.value+=n.value)})),n},t},sa.layout.partition=function(){function t(n,e,r,i){var o=n.children;if(n.x=e,n.y=n.depth*i,n.dx=r,n.dy=i,o&&(a=o.length)){var a,u,s,l=-1;for(r=n.value?r/n.value:0;++l<a;)t(u=o[l],e,s=u.value*r,i),e+=s}}function n(t){var e=t.children,r=0;if(e&&(i=e.length))for(var i,o=-1;++o<i;)r=Math.max(r,n(e[o]));return 1+r}function e(e,o){var a=r.call(this,e,o);return t(a[0],0,i[0],i[1]/n(a[0])),a}var r=sa.layout.hierarchy(),i=[1,1];return e.size=function(t){return arguments.length?(i=t,e):i},ii(e,r)},sa.layout.pie=function(){function t(a){var u,s=a.length,l=a.map(function(e,r){return+n.call(t,e,r)}),c=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof i?i.apply(this,arguments):i)-c,h=Math.min(Math.abs(f)/s,+("function"==typeof o?o.apply(this,arguments):o)),p=h*(0>f?-1:1),d=sa.sum(l),v=d?(f-s*p)/d:0,g=sa.range(s),m=[];return null!=e&&g.sort(e===bs?function(t,n){return l[n]-l[t]}:function(t,n){return e(a[t],a[n])}),g.forEach(function(t){m[t]={data:a[t],value:u=l[t],startAngle:c,endAngle:c+=u*v+p,padAngle:h}}),m}var n=Number,e=bs,r=0,i=za,o=0;return t.value=function(e){return arguments.length?(n=e,t):n},t.sort=function(n){return arguments.length?(e=n,t):e},t.startAngle=function(n){return arguments.length?(r=n,t):r},t.endAngle=function(n){return arguments.length?(i=n,t):i},t.padAngle=function(n){return arguments.length?(o=n,t):o},t};var bs={};sa.layout.stack=function(){function t(u,s){if(!(h=u.length))return u;var l=u.map(function(e,r){return n.call(t,e,r)}),c=l.map(function(n){return n.map(function(n,e){return[o.call(t,n,e),a.call(t,n,e)]})}),f=e.call(t,c,s);l=sa.permute(l,f),c=sa.permute(c,f);var h,p,d,v,g=r.call(t,c,s),m=l[0].length;for(d=0;m>d;++d)for(i.call(t,l[0][d],v=g[d],c[0][d][1]),p=1;h>p;++p)i.call(t,l[p][d],v+=c[p-1][d][1],c[p][d][1]);return u}var n=y,e=di,r=vi,i=pi,o=fi,a=hi;return t.values=function(e){return arguments.length?(n=e,t):n},t.order=function(n){return arguments.length?(e="function"==typeof n?n:ws.get(n)||di,t):e},t.offset=function(n){return arguments.length?(r="function"==typeof n?n:Cs.get(n)||vi,t):r},t.x=function(n){return arguments.length?(o=n,t):o},t.y=function(n){return arguments.length?(a=n,t):a},t.out=function(n){return arguments.length?(i=n,t):i},t};var ws=sa.map({"inside-out":function(t){var n,e,r=t.length,i=t.map(gi),o=t.map(mi),a=sa.range(r).sort(function(t,n){return i[t]-i[n]}),u=0,s=0,l=[],c=[];for(n=0;r>n;++n)e=a[n],s>u?(u+=o[e],l.push(e)):(s+=o[e],c.push(e));return c.reverse().concat(l)},reverse:function(t){return sa.range(t.length).reverse()},"default":di}),Cs=sa.map({silhouette:function(t){var n,e,r,i=t.length,o=t[0].length,a=[],u=0,s=[];for(e=0;o>e;++e){for(n=0,r=0;i>n;n++)r+=t[n][e][1];r>u&&(u=r),a.push(r)}for(e=0;o>e;++e)s[e]=(u-a[e])/2;return s},wiggle:function(t){var n,e,r,i,o,a,u,s,l,c=t.length,f=t[0],h=f.length,p=[];for(p[0]=s=l=0,e=1;h>e;++e){for(n=0,i=0;c>n;++n)i+=t[n][e][1];for(n=0,o=0,u=f[e][0]-f[e-1][0];c>n;++n){for(r=0,a=(t[n][e][1]-t[n][e-1][1])/(2*u);n>r;++r)a+=(t[r][e][1]-t[r][e-1][1])/u;o+=a*t[n][e][1]}p[e]=s-=i?o/i*u:0,l>s&&(l=s)}for(e=0;h>e;++e)p[e]-=l;return p},expand:function(t){var n,e,r,i=t.length,o=t[0].length,a=1/i,u=[];for(e=0;o>e;++e){for(n=0,r=0;i>n;n++)r+=t[n][e][1];if(r)for(n=0;i>n;n++)t[n][e][1]/=r;else for(n=0;i>n;n++)t[n][e][1]=a}for(e=0;o>e;++e)u[e]=0;return u},zero:vi});sa.layout.histogram=function(){function t(t,o){for(var a,u,s=[],l=t.map(e,this),c=r.call(this,l,o),f=i.call(this,c,l,o),o=-1,h=l.length,p=f.length-1,d=n?1:1/h;++o<p;)a=s[o]=[],a.dx=f[o+1]-(a.x=f[o]),a.y=0;if(p>0)for(o=-1;++o<h;)u=l[o],u>=c[0]&&u<=c[1]&&(a=s[sa.bisect(f,u,1,p)-1],a.y+=d,a.push(t[o]));return s}var n=!0,e=Number,r=bi,i=$i;return t.value=function(n){return arguments.length?(e=n,t):e},t.range=function(n){return arguments.length?(r=Mt(n),t):r},t.bins=function(n){return arguments.length?(i="number"==typeof n?function(t){return xi(t,n)}:Mt(n),t):i},t.frequency=function(e){return arguments.length?(n=!!e,t):n},t},sa.layout.pack=function(){function t(t,o){var a=e.call(this,t,o),u=a[0],s=i[0],l=i[1],c=null==n?Math.sqrt:"function"==typeof n?n:function(){return n};if(u.x=u.y=0,ai(u,function(t){t.r=+c(t.value)}),ai(u,Mi),r){var f=r*(n?1:Math.max(2*u.r/s,2*u.r/l))/2;ai(u,function(t){t.r+=f}),ai(u,Mi),ai(u,function(t){t.r-=f})}return Ei(u,s/2,l/2,n?1:1/Math.max(2*u.r/s,2*u.r/l)),a}var n,e=sa.layout.hierarchy().sort(wi),r=0,i=[1,1];return t.size=function(n){return arguments.length?(i=n,t):i},t.radius=function(e){return arguments.length?(n=null==e||"function"==typeof e?e:+e,t):n},t.padding=function(n){return arguments.length?(r=+n,t):r},ii(t,e)},sa.layout.tree=function(){function t(t,i){var c=a.call(this,t,i),f=c[0],h=n(f);if(ai(h,e),h.parent.m=-h.z,oi(h,r),l)oi(f,o);else{var p=f,d=f,v=f;oi(f,function(t){t.x<p.x&&(p=t),t.x>d.x&&(d=t),t.depth>v.depth&&(v=t)});var g=u(p,d)/2-p.x,m=s[0]/(d.x+u(d,p)/2+g),y=s[1]/(v.depth||1);oi(f,function(t){t.x=(t.x+g)*m,t.y=t.depth*y})}return c}function n(t){for(var n,e={A:null,children:[t]},r=[e];null!=(n=r.pop());)for(var i,o=n.children,a=0,u=o.length;u>a;++a)r.push((o[a]=i={_:o[a],parent:n,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return e.children[0]}function e(t){var n=t.children,e=t.parent.children,r=t.i?e[t.i-1]:null;if(n.length){Ni(t);var o=(n[0].z+n[n.length-1].z)/2;r?(t.z=r.z+u(t._,r._),t.m=t.z-o):t.z=o}else r&&(t.z=r.z+u(t._,r._));t.parent.A=i(t,r,t.parent.A||e[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,n,e){if(n){for(var r,i=t,o=t,a=n,s=i.parent.children[0],l=i.m,c=o.m,f=a.m,h=s.m;a=Li(a),i=Ti(i),a&&i;)s=Ti(s),o=Li(o),o.a=t,r=a.z+f-i.z-l+u(a._,i._),r>0&&(ji(Ri(a,t,e),t,r),l+=r,c+=r),f+=a.m,l+=i.m,h+=s.m,c+=o.m;a&&!Li(o)&&(o.t=a,o.m+=f-c),i&&!Ti(s)&&(s.t=i,s.m+=l-h,e=t)}return e}function o(t){t.x*=s[0],t.y=t.depth*s[1]}var a=sa.layout.hierarchy().sort(null).value(null),u=Oi,s=[1,1],l=null;return t.separation=function(n){return arguments.length?(u=n,t):u},t.size=function(n){return arguments.length?(l=null==(s=n)?o:null,t):l?null:s},t.nodeSize=function(n){return arguments.length?(l=null==(s=n)?null:o,t):l?s:null},ii(t,a)},sa.layout.cluster=function(){function t(t,o){var a,u=n.call(this,t,o),s=u[0],l=0;ai(s,function(t){var n=t.children;n&&n.length?(t.x=Fi(n),t.y=Di(n)):(t.x=a?l+=e(t,a):0,t.y=0,a=t)});var c=Ii(s),f=zi(s),h=c.x-e(c,f)/2,p=f.x+e(f,c)/2;return ai(s,i?function(t){t.x=(t.x-s.x)*r[0],t.y=(s.y-t.y)*r[1]}:function(t){t.x=(t.x-h)/(p-h)*r[0],t.y=(1-(s.y?t.y/s.y:1))*r[1]}),u}var n=sa.layout.hierarchy().sort(null).value(null),e=Oi,r=[1,1],i=!1;return t.separation=function(n){return arguments.length?(e=n,t):e},t.size=function(n){return arguments.length?(i=null==(r=n),t):i?null:r},t.nodeSize=function(n){return arguments.length?(i=null!=(r=n),t):i?r:null},ii(t,n)},sa.layout.treemap=function(){function t(t,n){for(var e,r,i=-1,o=t.length;++i<o;)r=(e=t[i]).value*(0>n?0:n),e.area=isNaN(r)||0>=r?0:r}function n(e){var o=e.children;if(o&&o.length){var a,u,s,l=f(e),c=[],h=o.slice(),d=1/0,v="slice"===p?l.dx:"dice"===p?l.dy:"slice-dice"===p?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(t(h,l.dx*l.dy/e.value),c.area=0;(s=h.length)>0;)c.push(a=h[s-1]),c.area+=a.area,"squarify"!==p||(u=r(c,v))<=d?(h.pop(),d=u):(c.area-=c.pop().area,i(c,v,l,!1),v=Math.min(l.dx,l.dy),c.length=c.area=0,d=1/0);c.length&&(i(c,v,l,!0),c.length=c.area=0),o.forEach(n)}}function e(n){var r=n.children;if(r&&r.length){var o,a=f(n),u=r.slice(),s=[];for(t(u,a.dx*a.dy/n.value),s.area=0;o=u.pop();)s.push(o),s.area+=o.area,null!=o.z&&(i(s,o.z?a.dx:a.dy,a,!u.length),s.length=s.area=0);r.forEach(e)}}function r(t,n){for(var e,r=t.area,i=0,o=1/0,a=-1,u=t.length;++a<u;)(e=t[a].area)&&(o>e&&(o=e),e>i&&(i=e));return r*=r,n*=n,r?Math.max(n*i*d/r,r/(n*o*d)):1/0}function i(t,n,e,r){var i,o=-1,a=t.length,u=e.x,l=e.y,c=n?s(t.area/n):0;if(n==e.dx){for((r||c>e.dy)&&(c=e.dy);++o<a;)i=t[o],i.x=u,i.y=l,i.dy=c,u+=i.dx=Math.min(e.x+e.dx-u,c?s(i.area/c):0);i.z=!0,i.dx+=e.x+e.dx-u,e.y+=c,e.dy-=c}else{for((r||c>e.dx)&&(c=e.dx);++o<a;)i=t[o],i.x=u,i.y=l,i.dx=c,l+=i.dy=Math.min(e.y+e.dy-l,c?s(i.area/c):0);i.z=!1,i.dy+=e.y+e.dy-l,e.x+=c,e.dx-=c}}function o(r){var i=a||u(r),o=i[0];return o.x=o.y=0,o.value?(o.dx=l[0],o.dy=l[1]):o.dx=o.dy=0,a&&u.revalue(o),t([o],o.dx*o.dy/o.value),(a?e:n)(o),h&&(a=i),i}var a,u=sa.layout.hierarchy(),s=Math.round,l=[1,1],c=null,f=qi,h=!1,p="squarify",d=.5*(1+Math.sqrt(5));return o.size=function(t){return arguments.length?(l=t,o):l},o.padding=function(t){function n(n){var e=t.call(o,n,n.depth);return null==e?qi(n):Vi(n,"number"==typeof e?[e,e,e,e]:e)}function e(n){return Vi(n,t)}if(!arguments.length)return c;var r;return f=null==(c=t)?qi:"function"==(r=typeof t)?n:"number"===r?(t=[t,t,t,t],e):e,o},o.round=function(t){return arguments.length?(s=t?Math.round:Number,o):s!=Number},o.sticky=function(t){return arguments.length?(h=t,a=null,o):h},o.ratio=function(t){return arguments.length?(d=t,o):d},o.mode=function(t){return arguments.length?(p=t+"",o):p},ii(o,u)},sa.random={normal:function(t,n){var e=arguments.length;return 2>e&&(n=1),1>e&&(t=0),function(){var e,r,i;do e=2*Math.random()-1,r=2*Math.random()-1,i=e*e+r*r;while(!i||i>1);return t+n*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=sa.random.normal.apply(sa,arguments);return function(){return Math.exp(t())}},bates:function(t){var n=sa.random.irwinHall(t);return function(){return n()/t}},irwinHall:function(t){return function(){for(var n=0,e=0;t>e;e++)n+=Math.random();return n}}},sa.scale={};var Ss={floor:y,ceil:y};sa.scale.linear=function(){return Xi([0,1],[0,1],$r,!1)};var _s={s:1,g:1,p:1,r:1,e:1};sa.scale.log=function(){return ro(sa.scale.linear().domain([0,1]),10,!0,[1,10])};var Ms=sa.format(".0e"),ks={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};sa.scale.pow=function(){return io(sa.scale.linear(),1,[0,1])},sa.scale.sqrt=function(){return sa.scale.pow().exponent(.5)},sa.scale.ordinal=function(){return ao([],{t:"range",a:[[]]})},sa.scale.category10=function(){return sa.scale.ordinal().range(As)},sa.scale.category20=function(){return sa.scale.ordinal().range(Es)},sa.scale.category20b=function(){return sa.scale.ordinal().range(Ps)},sa.scale.category20c=function(){return sa.scale.ordinal().range(Os)};var As=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map($t),Es=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map($t),Ps=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map($t),Os=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map($t);sa.scale.quantile=function(){return uo([],[])},sa.scale.quantize=function(){return so(0,1,[0,1])},sa.scale.threshold=function(){return lo([.5],[0,1])},sa.scale.identity=function(){return co([0,1])},sa.svg={},sa.svg.arc=function(){function t(){var t=Math.max(0,+e.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),c=a.apply(this,arguments)-Va,f=u.apply(this,arguments)-Va,h=Math.abs(f-c),p=c>f?0:1;if(t>l&&(d=l,l=t,t=d),h>=qa)return n(l,p)+(t?n(t,1-p):"")+"Z";var d,v,g,m,y,$,x,b,w,C,S,_,M=0,k=0,A=[];if((m=(+s.apply(this,arguments)||0)/2)&&(g=o===Ts?Math.sqrt(t*t+l*l):+o.apply(this,arguments),p||(k*=-1),l&&(k=nt(g/l*Math.sin(m))),t&&(M=nt(g/t*Math.sin(m)))),l){y=l*Math.cos(c+k),$=l*Math.sin(c+k),x=l*Math.cos(f-k),b=l*Math.sin(f-k);var E=Math.abs(f-c-2*k)<=Ia?0:1;if(k&&yo(y,$,x,b)===p^E){var P=(c+f)/2;y=l*Math.cos(P),$=l*Math.sin(P),x=b=null}}else y=$=0;if(t){w=t*Math.cos(f-M),C=t*Math.sin(f-M),S=t*Math.cos(c+M),_=t*Math.sin(c+M);var O=Math.abs(c-f+2*M)<=Ia?0:1;if(M&&yo(w,C,S,_)===1-p^O){var T=(c+f)/2;w=t*Math.cos(T),C=t*Math.sin(T),S=_=null}}else w=C=0;if(h>Da&&(d=Math.min(Math.abs(l-t)/2,+i.apply(this,arguments)))>.001){v=l>t^p?0:1;var L=d,j=d;if(Ia>h){var N=null==S?[w,C]:null==x?[y,$]:je([y,$],[S,_],[x,b],[w,C]),R=y-N[0],D=$-N[1],F=x-N[0],I=b-N[1],z=1/Math.sin(Math.acos((R*F+D*I)/(Math.sqrt(R*R+D*D)*Math.sqrt(F*F+I*I)))/2),q=Math.sqrt(N[0]*N[0]+N[1]*N[1]);j=Math.min(d,(t-q)/(z-1)),L=Math.min(d,(l-q)/(z+1))}if(null!=x){var V=$o(null==S?[w,C]:[S,_],[y,$],l,L,p),B=$o([x,b],[w,C],l,L,p);d===L?A.push("M",V[0],"A",L,",",L," 0 0,",v," ",V[1],"A",l,",",l," 0 ",1-p^yo(V[1][0],V[1][1],B[1][0],B[1][1]),",",p," ",B[1],"A",L,",",L," 0 0,",v," ",B[0]):A.push("M",V[0],"A",L,",",L," 0 1,",v," ",B[0])}else A.push("M",y,",",$);if(null!=S){var W=$o([y,$],[S,_],t,-j,p),U=$o([w,C],null==x?[y,$]:[x,b],t,-j,p);d===j?A.push("L",U[0],"A",j,",",j," 0 0,",v," ",U[1],"A",t,",",t," 0 ",p^yo(U[1][0],U[1][1],W[1][0],W[1][1]),",",1-p," ",W[1],"A",j,",",j," 0 0,",v," ",W[0]):A.push("L",U[0],"A",j,",",j," 0 0,",v," ",W[0])}else A.push("L",w,",",C)}else A.push("M",y,",",$),null!=x&&A.push("A",l,",",l," 0 ",E,",",p," ",x,",",b),A.push("L",w,",",C),null!=S&&A.push("A",t,",",t," 0 ",O,",",1-p," ",S,",",_);return A.push("Z"),A.join("")}function n(t,n){return"M0,"+t+"A"+t+","+t+" 0 1,"+n+" 0,"+-t+"A"+t+","+t+" 0 1,"+n+" 0,"+t}var e=ho,r=po,i=fo,o=Ts,a=vo,u=go,s=mo;return t.innerRadius=function(n){return arguments.length?(e=Mt(n),t):e},t.outerRadius=function(n){return arguments.length?(r=Mt(n),t):r},t.cornerRadius=function(n){return arguments.length?(i=Mt(n),t):i},t.padRadius=function(n){return arguments.length?(o=n==Ts?Ts:Mt(n),t):o},t.startAngle=function(n){return arguments.length?(a=Mt(n),t):a;
-},t.endAngle=function(n){return arguments.length?(u=Mt(n),t):u},t.padAngle=function(n){return arguments.length?(s=Mt(n),t):s},t.centroid=function(){var t=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +u.apply(this,arguments))/2-Va;return[Math.cos(n)*t,Math.sin(n)*t]},t};var Ts="auto";sa.svg.line=function(){return xo(y)};var Ls=sa.map({linear:bo,"linear-closed":wo,step:Co,"step-before":So,"step-after":_o,basis:Oo,"basis-open":To,"basis-closed":Lo,bundle:jo,cardinal:Ao,"cardinal-open":Mo,"cardinal-closed":ko,monotone:zo});Ls.forEach(function(t,n){n.key=t,n.closed=/-closed$/.test(t)});var js=[0,2/3,1/3,0],Ns=[0,1/3,2/3,0],Rs=[0,1/6,2/3,1/6];sa.svg.line.radial=function(){var t=xo(qo);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},So.reverse=_o,_o.reverse=So,sa.svg.area=function(){return Vo(y)},sa.svg.area.radial=function(){var t=Vo(qo);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},sa.svg.chord=function(){function t(t,u){var s=n(this,o,t,u),l=n(this,a,t,u);return"M"+s.p0+r(s.r,s.p1,s.a1-s.a0)+(e(s,l)?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+i(l.r,l.p1,s.r,s.p0))+"Z"}function n(t,n,e,r){var i=n.call(t,e,r),o=u.call(t,i,r),a=s.call(t,i,r)-Va,c=l.call(t,i,r)-Va;return{r:o,a0:a,a1:c,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(c),o*Math.sin(c)]}}function e(t,n){return t.a0==n.a0&&t.a1==n.a1}function r(t,n,e){return"A"+t+","+t+" 0 "+ +(e>Ia)+",1 "+n}function i(t,n,e,r){return"Q 0,0 "+r}var o=$e,a=xe,u=Bo,s=vo,l=go;return t.radius=function(n){return arguments.length?(u=Mt(n),t):u},t.source=function(n){return arguments.length?(o=Mt(n),t):o},t.target=function(n){return arguments.length?(a=Mt(n),t):a},t.startAngle=function(n){return arguments.length?(s=Mt(n),t):s},t.endAngle=function(n){return arguments.length?(l=Mt(n),t):l},t},sa.svg.diagonal=function(){function t(t,i){var o=n.call(this,t,i),a=e.call(this,t,i),u=(o.y+a.y)/2,s=[o,{x:o.x,y:u},{x:a.x,y:u},a];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var n=$e,e=xe,r=Wo;return t.source=function(e){return arguments.length?(n=Mt(e),t):n},t.target=function(n){return arguments.length?(e=Mt(n),t):e},t.projection=function(n){return arguments.length?(r=n,t):r},t},sa.svg.diagonal.radial=function(){var t=sa.svg.diagonal(),n=Wo,e=t.projection;return t.projection=function(t){return arguments.length?e(Uo(n=t)):n},t},sa.svg.symbol=function(){function t(t,r){return(Ds.get(n.call(this,t,r))||Go)(e.call(this,t,r))}var n=Yo,e=Ho;return t.type=function(e){return arguments.length?(n=Mt(e),t):n},t.size=function(n){return arguments.length?(e=Mt(n),t):e},t};var Ds=sa.map({circle:Go,cross:function(t){var n=Math.sqrt(t/5)/2;return"M"+-3*n+","+-n+"H"+-n+"V"+-3*n+"H"+n+"V"+-n+"H"+3*n+"V"+n+"H"+n+"V"+3*n+"H"+-n+"V"+n+"H"+-3*n+"Z"},diamond:function(t){var n=Math.sqrt(t/(2*Is)),e=n*Is;return"M0,"+-n+"L"+e+",0 0,"+n+" "+-e+",0Z"},square:function(t){var n=Math.sqrt(t)/2;return"M"+-n+","+-n+"L"+n+","+-n+" "+n+","+n+" "+-n+","+n+"Z"},"triangle-down":function(t){var n=Math.sqrt(t/Fs),e=n*Fs/2;return"M0,"+e+"L"+n+","+-e+" "+-n+","+-e+"Z"},"triangle-up":function(t){var n=Math.sqrt(t/Fs),e=n*Fs/2;return"M0,"+-e+"L"+n+","+e+" "+-n+","+e+"Z"}});sa.svg.symbolTypes=Ds.keys();var Fs=Math.sqrt(3),Is=Math.tan(30*Ba);Ea.transition=function(t){for(var n,e,r=zs||++Ws,i=Qo(t),o=[],a=qs||{time:Date.now(),ease:Mr,delay:0,duration:250},u=-1,s=this.length;++u<s;){o.push(n=[]);for(var l=this[u],c=-1,f=l.length;++c<f;)(e=l[c])&&ta(e,c,i,r,a),n.push(e)}return Zo(o,i,r)},Ea.interrupt=function(t){return this.each(null==t?Vs:Xo(Qo(t)))};var zs,qs,Vs=Xo(Qo()),Bs=[],Ws=0;Bs.call=Ea.call,Bs.empty=Ea.empty,Bs.node=Ea.node,Bs.size=Ea.size,sa.transition=function(t,n){return t&&t.transition?zs?t.transition(n):t:sa.selection().transition(t)},sa.transition.prototype=Bs,Bs.select=function(t){var n,e,r,i=this.id,o=this.namespace,a=[];t=A(t);for(var u=-1,s=this.length;++u<s;){a.push(n=[]);for(var l=this[u],c=-1,f=l.length;++c<f;)(r=l[c])&&(e=t.call(r,r.__data__,c,u))?("__data__"in r&&(e.__data__=r.__data__),ta(e,c,o,i,r[o][i]),n.push(e)):n.push(null)}return Zo(a,o,i)},Bs.selectAll=function(t){var n,e,r,i,o,a=this.id,u=this.namespace,s=[];t=E(t);for(var l=-1,c=this.length;++l<c;)for(var f=this[l],h=-1,p=f.length;++h<p;)if(r=f[h]){o=r[u][a],e=t.call(r,r.__data__,h,l),s.push(n=[]);for(var d=-1,v=e.length;++d<v;)(i=e[d])&&ta(i,d,u,a,o),n.push(i)}return Zo(s,u,a)},Bs.filter=function(t){var n,e,r,i=[];"function"!=typeof t&&(t=q(t));for(var o=0,a=this.length;a>o;o++){i.push(n=[]);for(var e=this[o],u=0,s=e.length;s>u;u++)(r=e[u])&&t.call(r,r.__data__,u,o)&&n.push(r)}return Zo(i,this.namespace,this.id)},Bs.tween=function(t,n){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(t):B(this,null==n?function(n){n[r][e].tween.remove(t)}:function(i){i[r][e].tween.set(t,n)})},Bs.attr=function(t,n){function e(){this.removeAttribute(u)}function r(){this.removeAttributeNS(u.space,u.local)}function i(t){return null==t?e:(t+="",function(){var n,e=this.getAttribute(u);return e!==t&&(n=a(e,t),function(t){this.setAttribute(u,n(t))})})}function o(t){return null==t?r:(t+="",function(){var n,e=this.getAttributeNS(u.space,u.local);return e!==t&&(n=a(e,t),function(t){this.setAttributeNS(u.space,u.local,n(t))})})}if(arguments.length<2){for(n in t)this.attr(n,t[n]);return this}var a="transform"==t?Yr:$r,u=sa.ns.qualify(t);return Jo(this,"attr."+t,n,u.local?o:i)},Bs.attrTween=function(t,n){function e(t,e){var r=n.call(this,t,e,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,e){var r=n.call(this,t,e,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=sa.ns.qualify(t);return this.tween("attr."+t,i.local?r:e)},Bs.style=function(t,e,r){function i(){this.style.removeProperty(t)}function o(e){return null==e?i:(e+="",function(){var i,o=n(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(i=$r(o,e),function(n){this.style.setProperty(t,i(n),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof t){2>a&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Jo(this,"style."+t,e,o)},Bs.styleTween=function(t,e,r){function i(i,o){var a=e.call(this,i,o,n(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(n){this.style.setProperty(t,a(n),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Bs.text=function(t){return Jo(this,"text",t,Ko)},Bs.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var n;this[t].count<2&&(n=this.parentNode)&&n.removeChild(this)})},Bs.ease=function(t){var n=this.id,e=this.namespace;return arguments.length<1?this.node()[e][n].ease:("function"!=typeof t&&(t=sa.ease.apply(sa,arguments)),B(this,function(r){r[e][n].ease=t}))},Bs.delay=function(t){var n=this.id,e=this.namespace;return arguments.length<1?this.node()[e][n].delay:B(this,"function"==typeof t?function(r,i,o){r[e][n].delay=+t.call(r,r.__data__,i,o)}:(t=+t,function(r){r[e][n].delay=t}))},Bs.duration=function(t){var n=this.id,e=this.namespace;return arguments.length<1?this.node()[e][n].duration:B(this,"function"==typeof t?function(r,i,o){r[e][n].duration=Math.max(1,t.call(r,r.__data__,i,o))}:(t=Math.max(1,t),function(r){r[e][n].duration=t}))},Bs.each=function(t,n){var e=this.id,r=this.namespace;if(arguments.length<2){var i=qs,o=zs;try{zs=e,B(this,function(n,i,o){qs=n[r][e],t.call(n,n.__data__,i,o)})}finally{qs=i,zs=o}}else B(this,function(i){var o=i[r][e];(o.event||(o.event=sa.dispatch("start","end","interrupt"))).on(t,n)});return this},Bs.transition=function(){for(var t,n,e,r,i=this.id,o=++Ws,a=this.namespace,u=[],s=0,l=this.length;l>s;s++){u.push(t=[]);for(var n=this[s],c=0,f=n.length;f>c;c++)(e=n[c])&&(r=e[a][i],ta(e,c,a,o,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),t.push(e)}return Zo(u,a,o)},sa.svg.axis=function(){function t(t){t.each(function(){var t,l=sa.select(this),c=this.__chart__||e,f=this.__chart__=e.copy(),h=null==s?f.ticks?f.ticks.apply(f,u):f.domain():s,p=null==n?f.tickFormat?f.tickFormat.apply(f,u):y:n,d=l.selectAll(".tick").data(h,f),v=d.enter().insert("g",".domain").attr("class","tick").style("opacity",Da),g=sa.transition(d.exit()).style("opacity",Da).remove(),m=sa.transition(d.order()).style("opacity",1),$=Math.max(i,0)+a,x=Wi(f),b=l.selectAll(".domain").data([0]),w=(b.enter().append("path").attr("class","domain"),sa.transition(b));v.append("line"),v.append("text");var C,S,_,M,k=v.select("line"),A=m.select("line"),E=d.select("text").text(p),P=v.select("text"),O=m.select("text"),T="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(t=na,C="x",_="y",S="x2",M="y2",E.attr("dy",0>T?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+T*o+"V0H"+x[1]+"V"+T*o)):(t=ea,C="y",_="x",S="y2",M="x2",E.attr("dy",".32em").style("text-anchor",0>T?"end":"start"),w.attr("d","M"+T*o+","+x[0]+"H0V"+x[1]+"H"+T*o)),k.attr(M,T*i),P.attr(_,T*$),A.attr(S,0).attr(M,T*i),O.attr(C,0).attr(_,T*$),f.rangeBand){var L=f,j=L.rangeBand()/2;c=f=function(t){return L(t)+j}}else c.rangeBand?c=f:g.call(t,f,c);v.call(t,c,f),m.call(t,f,f)})}var n,e=sa.scale.linear(),r=Us,i=6,o=6,a=3,u=[10],s=null;return t.scale=function(n){return arguments.length?(e=n,t):e},t.orient=function(n){return arguments.length?(r=n in Hs?n+"":Us,t):r},t.ticks=function(){return arguments.length?(u=ca(arguments),t):u},t.tickValues=function(n){return arguments.length?(s=n,t):s},t.tickFormat=function(e){return arguments.length?(n=e,t):n},t.tickSize=function(n){var e=arguments.length;return e?(i=+n,o=+arguments[e-1],t):i},t.innerTickSize=function(n){return arguments.length?(i=+n,t):i},t.outerTickSize=function(n){return arguments.length?(o=+n,t):o},t.tickPadding=function(n){return arguments.length?(a=+n,t):a},t.tickSubdivide=function(){return arguments.length&&t},t};var Us="bottom",Hs={top:1,right:1,bottom:1,left:1};sa.svg.brush=function(){function t(n){n.each(function(){var n=sa.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),a=n.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var u=n.selectAll(".resize").data(v,y);u.exit().remove(),u.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ys[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),u.style("display",t.empty()?"none":null);var s,f=sa.transition(n),h=sa.transition(a);l&&(s=Wi(l),h.attr("x",s[0]).attr("width",s[1]-s[0]),r(f)),c&&(s=Wi(c),h.attr("y",s[0]).attr("height",s[1]-s[0]),i(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",f[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function o(){function o(){32==sa.event.keyCode&&(E||($=null,O[0]-=f[1],O[1]-=h[1],E=2),S())}function v(){32==sa.event.keyCode&&2==E&&(O[0]+=f[1],O[1]+=h[1],E=0,S())}function g(){var t=sa.mouse(b),n=!1;x&&(t[0]+=x[0],t[1]+=x[1]),E||(sa.event.altKey?($||($=[(f[0]+f[1])/2,(h[0]+h[1])/2]),O[0]=f[+(t[0]<$[0])],O[1]=h[+(t[1]<$[1])]):$=null),k&&m(t,l,0)&&(r(_),n=!0),A&&m(t,c,1)&&(i(_),n=!0),n&&(e(_),C({type:"brush",mode:E?"move":"resize"}))}function m(t,n,e){var r,i,o=Wi(n),s=o[0],l=o[1],c=O[e],v=e?h:f,g=v[1]-v[0];return E&&(s-=c,l-=g+c),r=(e?d:p)?Math.max(s,Math.min(l,t[e])):t[e],E?i=(r+=c)+g:($&&(c=Math.max(s,Math.min(l,2*$[e]-r))),r>c?(i=r,r=c):i=c),v[0]!=r||v[1]!=i?(e?u=null:a=null,v[0]=r,v[1]=i,!0):void 0}function y(){g(),_.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),sa.select("body").style("cursor",null),T.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),P(),C({type:"brushend"})}var $,x,b=this,w=sa.select(sa.event.target),C=s.of(b,arguments),_=sa.select(b),M=w.datum(),k=!/^(n|s)$/.test(M)&&l,A=!/^(e|w)$/.test(M)&&c,E=w.classed("extent"),P=X(b),O=sa.mouse(b),T=sa.select(n(b)).on("keydown.brush",o).on("keyup.brush",v);if(sa.event.changedTouches?T.on("touchmove.brush",g).on("touchend.brush",y):T.on("mousemove.brush",g).on("mouseup.brush",y),_.interrupt().selectAll("*").interrupt(),E)O[0]=f[0]-O[0],O[1]=h[0]-O[1];else if(M){var L=+/w$/.test(M),j=+/^n/.test(M);x=[f[1-L]-O[0],h[1-j]-O[1]],O[0]=f[L],O[1]=h[j]}else sa.event.altKey&&($=O.slice());_.style("pointer-events","none").selectAll(".resize").style("display",null),sa.select("body").style("cursor",w.style("cursor")),C({type:"brushstart"}),g()}var a,u,s=M(t,"brushstart","brush","brushend"),l=null,c=null,f=[0,0],h=[0,0],p=!0,d=!0,v=Gs[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),n={x:f,y:h,i:a,j:u},e=this.__chart__||n;this.__chart__=n,zs?sa.select(this).transition().each("start.brush",function(){a=e.i,u=e.j,f=e.x,h=e.y,t({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(f,n.x),r=xr(h,n.y);return a=u=null,function(i){f=n.x=e(i),h=n.y=r(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=n.i,u=n.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(n){return arguments.length?(l=n,v=Gs[!l<<1|!c],t):l},t.y=function(n){return arguments.length?(c=n,v=Gs[!l<<1|!c],t):c},t.clamp=function(n){return arguments.length?(l&&c?(p=!!n[0],d=!!n[1]):l?p=!!n:c&&(d=!!n),t):l&&c?[p,d]:l?p:c?d:null},t.extent=function(n){var e,r,i,o,s;return arguments.length?(l&&(e=n[0],r=n[1],c&&(e=e[0],r=r[0]),a=[e,r],l.invert&&(e=l(e),r=l(r)),e>r&&(s=e,e=r,r=s),e==f[0]&&r==f[1]||(f=[e,r])),c&&(i=n[0],o=n[1],l&&(i=i[1],o=o[1]),u=[i,o],c.invert&&(i=c(i),o=c(o)),i>o&&(s=i,i=o,o=s),i==h[0]&&o==h[1]||(h=[i,o])),t):(l&&(a?(e=a[0],r=a[1]):(e=f[0],r=f[1],l.invert&&(e=l.invert(e),r=l.invert(r)),e>r&&(s=e,e=r,r=s))),c&&(u?(i=u[0],o=u[1]):(i=h[0],o=h[1],c.invert&&(i=c.invert(i),o=c.invert(o)),i>o&&(s=i,i=o,o=s))),l&&c?[[e,i],[r,o]]:l?[e,r]:c&&[i,o])},t.clear=function(){return t.empty()||(f=[0,0],h=[0,0],a=u=null),t},t.empty=function(){return!!l&&f[0]==f[1]||!!c&&h[0]==h[1]},sa.rebind(t,s,"on")};var Ys={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Gs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Xs=du.format=xu.timeFormat,Zs=Xs.utc,Js=Zs("%Y-%m-%dT%H:%M:%S.%LZ");Xs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?ra:Js,ra.parse=function(t){var n=new Date(t);return isNaN(n)?null:n},ra.toString=Js.toString,du.second=zt(function(t){return new vu(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(t.getTime()+1e3*Math.floor(n))},function(t){return t.getSeconds()}),du.seconds=du.second.range,du.seconds.utc=du.second.utc.range,du.minute=zt(function(t){return new vu(6e4*Math.floor(t/6e4))},function(t,n){t.setTime(t.getTime()+6e4*Math.floor(n))},function(t){return t.getMinutes()}),du.minutes=du.minute.range,du.minutes.utc=du.minute.utc.range,du.hour=zt(function(t){var n=t.getTimezoneOffset()/60;return new vu(36e5*(Math.floor(t/36e5-n)+n))},function(t,n){t.setTime(t.getTime()+36e5*Math.floor(n))},function(t){return t.getHours()}),du.hours=du.hour.range,du.hours.utc=du.hour.utc.range,du.month=zt(function(t){return t=du.day(t),t.setDate(1),t},function(t,n){t.setMonth(t.getMonth()+n)},function(t){return t.getMonth()}),du.months=du.month.range,du.months.utc=du.month.utc.range;var Ks=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Qs=[[du.second,1],[du.second,5],[du.second,15],[du.second,30],[du.minute,1],[du.minute,5],[du.minute,15],[du.minute,30],[du.hour,1],[du.hour,3],[du.hour,6],[du.hour,12],[du.day,1],[du.day,2],[du.week,1],[du.month,1],[du.month,3],[du.year,1]],tl=Xs.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Pn]]),nl={range:function(t,n,e){return sa.range(Math.ceil(t/e)*e,+n,e).map(oa)},floor:y,ceil:y};Qs.year=du.year,du.scale=function(){return ia(sa.scale.linear(),Qs,tl)};var el=Qs.map(function(t){return[t[0].utc,t[1]]}),rl=Zs.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Pn]]);el.year=du.year.utc,du.scale.utc=function(){return ia(sa.scale.linear(),el,rl)},sa.text=kt(function(t){return t.responseText}),sa.json=function(t,n){return At(t,"application/json",aa,n)},sa.html=function(t,n){return At(t,"text/html",ua,n)},sa.xml=kt(function(t){return t.responseXML}),"function"==typeof define&&define.amd?(this.d3=sa,define(sa)):"object"==typeof module&&module.exports?module.exports=sa:this.d3=sa}();
\ No newline at end of file
+},t.endAngle=function(n){return arguments.length?(u=Mt(n),t):u},t.padAngle=function(n){return arguments.length?(s=Mt(n),t):s},t.centroid=function(){var t=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +u.apply(this,arguments))/2-Va;return[Math.cos(n)*t,Math.sin(n)*t]},t};var Ts="auto";sa.svg.line=function(){return xo(y)};var Ls=sa.map({linear:bo,"linear-closed":wo,step:Co,"step-before":So,"step-after":_o,basis:Oo,"basis-open":To,"basis-closed":Lo,bundle:jo,cardinal:Ao,"cardinal-open":Mo,"cardinal-closed":ko,monotone:zo});Ls.forEach(function(t,n){n.key=t,n.closed=/-closed$/.test(t)});var js=[0,2/3,1/3,0],Ns=[0,1/3,2/3,0],Rs=[0,1/6,2/3,1/6];sa.svg.line.radial=function(){var t=xo(qo);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},So.reverse=_o,_o.reverse=So,sa.svg.area=function(){return Vo(y)},sa.svg.area.radial=function(){var t=Vo(qo);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},sa.svg.chord=function(){function t(t,u){var s=n(this,o,t,u),l=n(this,a,t,u);return"M"+s.p0+r(s.r,s.p1,s.a1-s.a0)+(e(s,l)?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+i(l.r,l.p1,s.r,s.p0))+"Z"}function n(t,n,e,r){var i=n.call(t,e,r),o=u.call(t,i,r),a=s.call(t,i,r)-Va,c=l.call(t,i,r)-Va;return{r:o,a0:a,a1:c,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(c),o*Math.sin(c)]}}function e(t,n){return t.a0==n.a0&&t.a1==n.a1}function r(t,n,e){return"A"+t+","+t+" 0 "+ +(e>Ia)+",1 "+n}function i(t,n,e,r){return"Q 0,0 "+r}var o=$e,a=xe,u=Bo,s=vo,l=go;return t.radius=function(n){return arguments.length?(u=Mt(n),t):u},t.source=function(n){return arguments.length?(o=Mt(n),t):o},t.target=function(n){return arguments.length?(a=Mt(n),t):a},t.startAngle=function(n){return arguments.length?(s=Mt(n),t):s},t.endAngle=function(n){return arguments.length?(l=Mt(n),t):l},t},sa.svg.diagonal=function(){function t(t,i){var o=n.call(this,t,i),a=e.call(this,t,i),u=(o.y+a.y)/2,s=[o,{x:o.x,y:u},{x:a.x,y:u},a];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var n=$e,e=xe,r=Wo;return t.source=function(e){return arguments.length?(n=Mt(e),t):n},t.target=function(n){return arguments.length?(e=Mt(n),t):e},t.projection=function(n){return arguments.length?(r=n,t):r},t},sa.svg.diagonal.radial=function(){var t=sa.svg.diagonal(),n=Wo,e=t.projection;return t.projection=function(t){return arguments.length?e(Uo(n=t)):n},t},sa.svg.symbol=function(){function t(t,r){return(Ds.get(n.call(this,t,r))||Go)(e.call(this,t,r))}var n=Yo,e=Ho;return t.type=function(e){return arguments.length?(n=Mt(e),t):n},t.size=function(n){return arguments.length?(e=Mt(n),t):e},t};var Ds=sa.map({circle:Go,cross:function(t){var n=Math.sqrt(t/5)/2;return"M"+-3*n+","+-n+"H"+-n+"V"+-3*n+"H"+n+"V"+-n+"H"+3*n+"V"+n+"H"+n+"V"+3*n+"H"+-n+"V"+n+"H"+-3*n+"Z"},diamond:function(t){var n=Math.sqrt(t/(2*Is)),e=n*Is;return"M0,"+-n+"L"+e+",0 0,"+n+" "+-e+",0Z"},square:function(t){var n=Math.sqrt(t)/2;return"M"+-n+","+-n+"L"+n+","+-n+" "+n+","+n+" "+-n+","+n+"Z"},"triangle-down":function(t){var n=Math.sqrt(t/Fs),e=n*Fs/2;return"M0,"+e+"L"+n+","+-e+" "+-n+","+-e+"Z"},"triangle-up":function(t){var n=Math.sqrt(t/Fs),e=n*Fs/2;return"M0,"+-e+"L"+n+","+e+" "+-n+","+e+"Z"}});sa.svg.symbolTypes=Ds.keys();var Fs=Math.sqrt(3),Is=Math.tan(30*Ba);Ea.transition=function(t){for(var n,e,r=zs||++Ws,i=Qo(t),o=[],a=qs||{time:Date.now(),ease:Mr,delay:0,duration:250},u=-1,s=this.length;++u<s;){o.push(n=[]);for(var l=this[u],c=-1,f=l.length;++c<f;)(e=l[c])&&ta(e,c,i,r,a),n.push(e)}return Zo(o,i,r)},Ea.interrupt=function(t){return this.each(null==t?Vs:Xo(Qo(t)))};var zs,qs,Vs=Xo(Qo()),Bs=[],Ws=0;Bs.call=Ea.call,Bs.empty=Ea.empty,Bs.node=Ea.node,Bs.size=Ea.size,sa.transition=function(t,n){return t&&t.transition?zs?t.transition(n):t:sa.selection().transition(t)},sa.transition.prototype=Bs,Bs.select=function(t){var n,e,r,i=this.id,o=this.namespace,a=[];t=A(t);for(var u=-1,s=this.length;++u<s;){a.push(n=[]);for(var l=this[u],c=-1,f=l.length;++c<f;)(r=l[c])&&(e=t.call(r,r.__data__,c,u))?("__data__"in r&&(e.__data__=r.__data__),ta(e,c,o,i,r[o][i]),n.push(e)):n.push(null)}return Zo(a,o,i)},Bs.selectAll=function(t){var n,e,r,i,o,a=this.id,u=this.namespace,s=[];t=E(t);for(var l=-1,c=this.length;++l<c;)for(var f=this[l],h=-1,p=f.length;++h<p;)if(r=f[h]){o=r[u][a],e=t.call(r,r.__data__,h,l),s.push(n=[]);for(var d=-1,v=e.length;++d<v;)(i=e[d])&&ta(i,d,u,a,o),n.push(i)}return Zo(s,u,a)},Bs.filter=function(t){var n,e,r,i=[];"function"!=typeof t&&(t=q(t));for(var o=0,a=this.length;a>o;o++){i.push(n=[]);for(var e=this[o],u=0,s=e.length;s>u;u++)(r=e[u])&&t.call(r,r.__data__,u,o)&&n.push(r)}return Zo(i,this.namespace,this.id)},Bs.tween=function(t,n){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(t):B(this,null==n?function(n){n[r][e].tween.remove(t)}:function(i){i[r][e].tween.set(t,n)})},Bs.attr=function(t,n){function e(){this.removeAttribute(u)}function r(){this.removeAttributeNS(u.space,u.local)}function i(t){return null==t?e:(t+="",function(){var n,e=this.getAttribute(u);return e!==t&&(n=a(e,t),function(t){this.setAttribute(u,n(t))})})}function o(t){return null==t?r:(t+="",function(){var n,e=this.getAttributeNS(u.space,u.local);return e!==t&&(n=a(e,t),function(t){this.setAttributeNS(u.space,u.local,n(t))})})}if(arguments.length<2){for(n in t)this.attr(n,t[n]);return this}var a="transform"==t?Yr:$r,u=sa.ns.qualify(t);return Jo(this,"attr."+t,n,u.local?o:i)},Bs.attrTween=function(t,n){function e(t,e){var r=n.call(this,t,e,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,e){var r=n.call(this,t,e,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=sa.ns.qualify(t);return this.tween("attr."+t,i.local?r:e)},Bs.style=function(t,e,r){function i(){this.style.removeProperty(t)}function o(e){return null==e?i:(e+="",function(){var i,o=n(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(i=$r(o,e),function(n){this.style.setProperty(t,i(n),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof t){2>a&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Jo(this,"style."+t,e,o)},Bs.styleTween=function(t,e,r){function i(i,o){var a=e.call(this,i,o,n(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(n){this.style.setProperty(t,a(n),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Bs.text=function(t){return Jo(this,"text",t,Ko)},Bs.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var n;this[t].count<2&&(n=this.parentNode)&&n.removeChild(this)})},Bs.ease=function(t){var n=this.id,e=this.namespace;return arguments.length<1?this.node()[e][n].ease:("function"!=typeof t&&(t=sa.ease.apply(sa,arguments)),B(this,function(r){r[e][n].ease=t}))},Bs.delay=function(t){var n=this.id,e=this.namespace;return arguments.length<1?this.node()[e][n].delay:B(this,"function"==typeof t?function(r,i,o){r[e][n].delay=+t.call(r,r.__data__,i,o)}:(t=+t,function(r){r[e][n].delay=t}))},Bs.duration=function(t){var n=this.id,e=this.namespace;return arguments.length<1?this.node()[e][n].duration:B(this,"function"==typeof t?function(r,i,o){r[e][n].duration=Math.max(1,t.call(r,r.__data__,i,o))}:(t=Math.max(1,t),function(r){r[e][n].duration=t}))},Bs.each=function(t,n){var e=this.id,r=this.namespace;if(arguments.length<2){var i=qs,o=zs;try{zs=e,B(this,function(n,i,o){qs=n[r][e],t.call(n,n.__data__,i,o)})}finally{qs=i,zs=o}}else B(this,function(i){var o=i[r][e];(o.event||(o.event=sa.dispatch("start","end","interrupt"))).on(t,n)});return this},Bs.transition=function(){for(var t,n,e,r,i=this.id,o=++Ws,a=this.namespace,u=[],s=0,l=this.length;l>s;s++){u.push(t=[]);for(var n=this[s],c=0,f=n.length;f>c;c++)(e=n[c])&&(r=e[a][i],ta(e,c,a,o,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),t.push(e)}return Zo(u,a,o)},sa.svg.axis=function(){function t(t){t.each(function(){var t,l=sa.select(this),c=this.__chart__||e,f=this.__chart__=e.copy(),h=null==s?f.ticks?f.ticks.apply(f,u):f.domain():s,p=null==n?f.tickFormat?f.tickFormat.apply(f,u):y:n,d=l.selectAll(".tick").data(h,f),v=d.enter().insert("g",".domain").attr("class","tick").style("opacity",Da),g=sa.transition(d.exit()).style("opacity",Da).remove(),m=sa.transition(d.order()).style("opacity",1),$=Math.max(i,0)+a,x=Wi(f),b=l.selectAll(".domain").data([0]),w=(b.enter().append("path").attr("class","domain"),sa.transition(b));v.append("line"),v.append("text");var C,S,_,M,k=v.select("line"),A=m.select("line"),E=d.select("text").text(p),P=v.select("text"),O=m.select("text"),T="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(t=na,C="x",_="y",S="x2",M="y2",E.attr("dy",0>T?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+T*o+"V0H"+x[1]+"V"+T*o)):(t=ea,C="y",_="x",S="y2",M="x2",E.attr("dy",".32em").style("text-anchor",0>T?"end":"start"),w.attr("d","M"+T*o+","+x[0]+"H0V"+x[1]+"H"+T*o)),k.attr(M,T*i),P.attr(_,T*$),A.attr(S,0).attr(M,T*i),O.attr(C,0).attr(_,T*$),f.rangeBand){var L=f,j=L.rangeBand()/2;c=f=function(t){return L(t)+j}}else c.rangeBand?c=f:g.call(t,f,c);v.call(t,c,f),m.call(t,f,f)})}var n,e=sa.scale.linear(),r=Us,i=6,o=6,a=3,u=[10],s=null;return t.scale=function(n){return arguments.length?(e=n,t):e},t.orient=function(n){return arguments.length?(r=n in Hs?n+"":Us,t):r},t.ticks=function(){return arguments.length?(u=ca(arguments),t):u},t.tickValues=function(n){return arguments.length?(s=n,t):s},t.tickFormat=function(e){return arguments.length?(n=e,t):n},t.tickSize=function(n){var e=arguments.length;return e?(i=+n,o=+arguments[e-1],t):i},t.innerTickSize=function(n){return arguments.length?(i=+n,t):i},t.outerTickSize=function(n){return arguments.length?(o=+n,t):o},t.tickPadding=function(n){return arguments.length?(a=+n,t):a},t.tickSubdivide=function(){return arguments.length&&t},t};var Us="bottom",Hs={top:1,right:1,bottom:1,left:1};sa.svg.brush=function(){function t(n){n.each(function(){var n=sa.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),a=n.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var u=n.selectAll(".resize").data(v,y);u.exit().remove(),u.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ys[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),u.style("display",t.empty()?"none":null);var s,f=sa.transition(n),h=sa.transition(a);l&&(s=Wi(l),h.attr("x",s[0]).attr("width",s[1]-s[0]),r(f)),c&&(s=Wi(c),h.attr("y",s[0]).attr("height",s[1]-s[0]),i(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",f[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function o(){function o(){32==sa.event.keyCode&&(E||($=null,O[0]-=f[1],O[1]-=h[1],E=2),S())}function v(){32==sa.event.keyCode&&2==E&&(O[0]+=f[1],O[1]+=h[1],E=0,S())}function g(){var t=sa.mouse(b),n=!1;x&&(t[0]+=x[0],t[1]+=x[1]),E||(sa.event.altKey?($||($=[(f[0]+f[1])/2,(h[0]+h[1])/2]),O[0]=f[+(t[0]<$[0])],O[1]=h[+(t[1]<$[1])]):$=null),k&&m(t,l,0)&&(r(_),n=!0),A&&m(t,c,1)&&(i(_),n=!0),n&&(e(_),C({type:"brush",mode:E?"move":"resize"}))}function m(t,n,e){var r,i,o=Wi(n),s=o[0],l=o[1],c=O[e],v=e?h:f,g=v[1]-v[0];return E&&(s-=c,l-=g+c),r=(e?d:p)?Math.max(s,Math.min(l,t[e])):t[e],E?i=(r+=c)+g:($&&(c=Math.max(s,Math.min(l,2*$[e]-r))),r>c?(i=r,r=c):i=c),v[0]!=r||v[1]!=i?(e?u=null:a=null,v[0]=r,v[1]=i,!0):void 0}function y(){g(),_.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),sa.select("body").style("cursor",null),T.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),P(),C({type:"brushend"})}var $,x,b=this,w=sa.select(sa.event.target),C=s.of(b,arguments),_=sa.select(b),M=w.datum(),k=!/^(n|s)$/.test(M)&&l,A=!/^(e|w)$/.test(M)&&c,E=w.classed("extent"),P=X(b),O=sa.mouse(b),T=sa.select(n(b)).on("keydown.brush",o).on("keyup.brush",v);if(sa.event.changedTouches?T.on("touchmove.brush",g).on("touchend.brush",y):T.on("mousemove.brush",g).on("mouseup.brush",y),_.interrupt().selectAll("*").interrupt(),E)O[0]=f[0]-O[0],O[1]=h[0]-O[1];else if(M){var L=+/w$/.test(M),j=+/^n/.test(M);x=[f[1-L]-O[0],h[1-j]-O[1]],O[0]=f[L],O[1]=h[j]}else sa.event.altKey&&($=O.slice());_.style("pointer-events","none").selectAll(".resize").style("display",null),sa.select("body").style("cursor",w.style("cursor")),C({type:"brushstart"}),g()}var a,u,s=M(t,"brushstart","brush","brushend"),l=null,c=null,f=[0,0],h=[0,0],p=!0,d=!0,v=Gs[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),n={x:f,y:h,i:a,j:u},e=this.__chart__||n;this.__chart__=n,zs?sa.select(this).transition().each("start.brush",function(){a=e.i,u=e.j,f=e.x,h=e.y,t({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(f,n.x),r=xr(h,n.y);return a=u=null,function(i){f=n.x=e(i),h=n.y=r(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=n.i,u=n.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(n){return arguments.length?(l=n,v=Gs[!l<<1|!c],t):l},t.y=function(n){return arguments.length?(c=n,v=Gs[!l<<1|!c],t):c},t.clamp=function(n){return arguments.length?(l&&c?(p=!!n[0],d=!!n[1]):l?p=!!n:c&&(d=!!n),t):l&&c?[p,d]:l?p:c?d:null},t.extent=function(n){var e,r,i,o,s;return arguments.length?(l&&(e=n[0],r=n[1],c&&(e=e[0],r=r[0]),a=[e,r],l.invert&&(e=l(e),r=l(r)),e>r&&(s=e,e=r,r=s),e==f[0]&&r==f[1]||(f=[e,r])),c&&(i=n[0],o=n[1],l&&(i=i[1],o=o[1]),u=[i,o],c.invert&&(i=c(i),o=c(o)),i>o&&(s=i,i=o,o=s),i==h[0]&&o==h[1]||(h=[i,o])),t):(l&&(a?(e=a[0],r=a[1]):(e=f[0],r=f[1],l.invert&&(e=l.invert(e),r=l.invert(r)),e>r&&(s=e,e=r,r=s))),c&&(u?(i=u[0],o=u[1]):(i=h[0],o=h[1],c.invert&&(i=c.invert(i),o=c.invert(o)),i>o&&(s=i,i=o,o=s))),l&&c?[[e,i],[r,o]]:l?[e,r]:c&&[i,o])},t.clear=function(){return t.empty()||(f=[0,0],h=[0,0],a=u=null),t},t.empty=function(){return!!l&&f[0]==f[1]||!!c&&h[0]==h[1]},sa.rebind(t,s,"on")};var Ys={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Gs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Xs=du.format=xu.timeFormat,Zs=Xs.utc,Js=Zs("%Y-%m-%dT%H:%M:%S.%LZ");Xs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?ra:Js,ra.parse=function(t){var n=new Date(t);return isNaN(n)?null:n},ra.toString=Js.toString,du.second=zt(function(t){return new vu(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(t.getTime()+1e3*Math.floor(n))},function(t){return t.getSeconds()}),du.seconds=du.second.range,du.seconds.utc=du.second.utc.range,du.minute=zt(function(t){return new vu(6e4*Math.floor(t/6e4))},function(t,n){t.setTime(t.getTime()+6e4*Math.floor(n))},function(t){return t.getMinutes()}),du.minutes=du.minute.range,du.minutes.utc=du.minute.utc.range,du.hour=zt(function(t){var n=t.getTimezoneOffset()/60;return new vu(36e5*(Math.floor(t/36e5-n)+n))},function(t,n){t.setTime(t.getTime()+36e5*Math.floor(n))},function(t){return t.getHours()}),du.hours=du.hour.range,du.hours.utc=du.hour.utc.range,du.month=zt(function(t){return t=du.day(t),t.setDate(1),t},function(t,n){t.setMonth(t.getMonth()+n)},function(t){return t.getMonth()}),du.months=du.month.range,du.months.utc=du.month.utc.range;var Ks=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Qs=[[du.second,1],[du.second,5],[du.second,15],[du.second,30],[du.minute,1],[du.minute,5],[du.minute,15],[du.minute,30],[du.hour,1],[du.hour,3],[du.hour,6],[du.hour,12],[du.day,1],[du.day,2],[du.week,1],[du.month,1],[du.month,3],[du.year,1]],tl=Xs.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Pn]]),nl={range:function(t,n,e){return sa.range(Math.ceil(t/e)*e,+n,e).map(oa)},floor:y,ceil:y};Qs.year=du.year,du.scale=function(){return ia(sa.scale.linear(),Qs,tl)};var el=Qs.map(function(t){return[t[0].utc,t[1]]}),rl=Zs.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Pn]]);el.year=du.year.utc,du.scale.utc=function(){return ia(sa.scale.linear(),el,rl)},sa.text=kt(function(t){return t.responseText}),sa.json=function(t,n){return At(t,"application/json",aa,n)},sa.html=function(t,n){return At(t,"text/html",ua,n)},sa.xml=kt(function(t){return t.responseXML}),"function"==typeof define&&define.amd?(this.d3=sa,define(sa)):"object"==typeof module&&module.exports?module.exports=sa:this.d3=sa}(),angular.module("RecursionHelper",[]).factory("RecursionHelper",["$compile",function(t){return{compile:function(n,e){angular.isFunction(e)&&(e={post:e});var r,i=n.contents().remove();return{pre:e&&e.pre?e.pre:null,post:function(n,o){r||(r=t(i)),r(n,function(t){o.append(t)}),e&&e.post&&e.post.apply(null,arguments)}}}}}]);
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/vendor/d3/d3.min.js b/xos/core/xoslib/static/js/vendor/xosMcordTopologyVendor.js
similarity index 92%
rename from views/ngXosViews/serviceGrid/src/vendor/d3/d3.min.js
rename to xos/core/xoslib/static/js/vendor/xosMcordTopologyVendor.js
index 1664873..103c7e8 100644
--- a/views/ngXosViews/serviceGrid/src/vendor/d3/d3.min.js
+++ b/xos/core/xoslib/static/js/vendor/xosMcordTopologyVendor.js
@@ -1,5 +1,5 @@
-!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function i(n){return!isNaN(n)}function u(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function f(n){return(n+="")===bo||n[0]===_o?_o+n:n}function s(n){return(n+="")[0]===_o?n.slice(1):n}function h(n){return f(n)in this._}function p(n){return(n=f(n))in this._&&delete this._[n]}function g(){var n=[];for(var t in this._)n.push(s(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function y(){this._=Object.create(null)}function m(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=wo.length;r>e;++e){var i=wo[e]+t;if(i in n)return i}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,i=-1,u=r.length;++i<u;)(t=r[i].on)&&t.apply(this,arguments);return n}var e=[],r=new c;return t.on=function(t,i){var u,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,u=e.indexOf(o)).concat(e.slice(u+1)),r.remove(t)),i&&e.push(r.set(t,{on:i})),n)},t}function S(){ao.event.preventDefault()}function k(){for(var n,t=ao.event;n=t.sourceEvent;)t=n;return t}function N(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(i){try{var u=i.sourceEvent=ao.event;i.target=n,ao.event=i,t[i.type].apply(e,r)}finally{ao.event=u}}},t}function E(n){return ko(n,Co),n}function A(n){return"function"==typeof n?n:function(){return No(n,this)}}function C(n){return"function"==typeof n?n:function(){return Eo(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function i(){this.setAttribute(n,t)}function u(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ao.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?u:i}function L(n){return n.trim().replace(/\s+/g," ")}function q(n){return new RegExp("(?:^|\\s+)"+ao.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<i;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<i;)n[e](this,r)}n=T(n).map(D);var i=n.length;return"function"==typeof t?r:e}function D(n){var t=q(n);return function(e,r){if(i=e.classList)return r?i.add(n):i.remove(n);var i=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(i)||e.setAttribute("class",L(i+" "+n))):e.setAttribute("class",L(i.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function i(){this.style.setProperty(n,t,e)}function u(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?u:i}function U(n,t){function e(){delete this[n]}function r(){this[n]=t}function i(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?i:r}function j(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e===zo&&t.documentElement.namespaceURI===zo?t.createElement(n):t.createElementNS(e,n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=ao.ns.qualify(n)).local?e:t}function F(){var n=this.parentNode;n&&n.removeChild(this)}function H(n){return{__data__:n}}function O(n){return function(){return Ao(this,n)}}function I(n){return arguments.length||(n=e),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function Y(n,t){for(var e=0,r=n.length;r>e;e++)for(var i,u=n[e],o=0,a=u.length;a>o;o++)(i=u[o])&&t(i,o,e);return n}function Z(n){return ko(n,qo),n}function V(n){var t,e;return function(r,i,u){var o,a=n[u].update,l=a.length;for(u!=e&&(e=u,t=0),i>=t&&(t=i+1);!(o=a[t])&&++t<l;);return o}}function X(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function i(){var i=l(t,co(arguments));r.call(this),this.addEventListener(n,this[o]=i,i.$=e),i._=t}function u(){var t,e=new RegExp("^__on([^.]+)"+ao.requote(n)+"$");for(var r in this)if(t=r.match(e)){var i=this[r];this.removeEventListener(t[1],i,i.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),l=$;a>0&&(n=n.slice(0,a));var c=To.get(n);return c&&(n=c,l=B),a?t?i:r:t?b:u}function $(n,t){return function(e){var r=ao.event;ao.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ao.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Do,i="click"+r,u=ao.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ro&&(Ro="onselectstart"in e?!1:x(e.style,"userSelect")),Ro){var o=n(e).style,a=o[Ro];o[Ro]="none"}return function(n){if(u.on(r,null),Ro&&(o[Ro]=a),n){var t=function(){u.on(i,null)};u.on(i,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Po){var u=t(n);if(u.scrollX||u.scrollY){r=ao.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Po=!(o.f||o.e),r.remove()}}return Po?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ao.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?Fo:Math.acos(n)}function tn(n){return n>1?Io:-1>n?-Io:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function on(n){return(n=Math.sin(n/2))*n}function an(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?u+(o-u)*n/60:180>n?o:240>n?u+(o-u)*(240-n)/60:u}function i(n){return Math.round(255*r(n))}var u,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,u=2*e-o,new mn(i(n+120),i(n),i(n-120))}function fn(n,t,e){return this instanceof fn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof fn?new fn(n.h,n.c,n.l):n instanceof hn?gn(n.l,n.a,n.b):gn((n=Sn((n=ao.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new fn(n,t,e)}function sn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Yo)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof fn?sn(n.h,n.c,n.l):Sn((n=mn(n)).r,n.g,n.b):new hn(n,t,e)}function pn(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return i=vn(i)*na,r=vn(r)*ta,u=vn(u)*ea,new mn(yn(3.2404542*i-1.5371385*r-.4985314*u),yn(-.969266*i+1.8760108*r+.041556*u),yn(.0556434*i-.2040259*r+1.0572252*u))}function gn(n,t,e){return n>0?new fn(Math.atan2(e,t)*Zo,Math.sqrt(t*t+e*e),n):new fn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function yn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mn(n,t,e){return this instanceof mn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mn?new mn(n.r,n.g,n.b):_n(""+n,mn,cn):new mn(n,t,e)}function Mn(n){return new mn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(Nn(i[0]),Nn(i[1]),Nn(i[2]))}return(u=ua.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o=o>>4|o,a=240&u,a=a>>4|a,l=15&u,l=l<<4|l):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function wn(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=.5>l?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=NaN,i=l>0&&1>l?0:r),new ln(r,i,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/na),i=dn((.2126729*n+.7151522*t+.072175*e)/ta),u=dn((.0193339*n+.119192*t+.9503041*e)/ea);return hn(116*i-16,500*(r-i),200*(i-u))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function i(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(u,l)}catch(r){return void o.error.call(u,r)}o.load.call(u,n)}else o.error.call(u,l)}var u={},o=ao.dispatch("beforesend","progress","load","error"),a={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(n){var t=ao.event;ao.event=n;try{o.progress.call(u,l)}finally{ao.event=t}},u.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",u)},u.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",u):t},u.responseType=function(n){return arguments.length?(c=n,u):c},u.response=function(n){return e=n,u},["get","post"].forEach(function(n){u[n]=function(){return u.send.apply(u,[n].concat(co(arguments)))}}),u.send=function(e,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),l.setRequestHeader)for(var f in a)l.setRequestHeader(f,a[f]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=i&&u.on("error",i).on("load",function(n){i(null,n)}),o.beforesend.call(u,l),l.send(null==r?null:r),u},u.abort=function(){return l.abort(),u},ao.rebind(u,o,"on"),null==r?u:u.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var i=e+t,u={c:n,t:i,n:null};return aa?aa.n=u:oa=u,aa=u,la||(ca=clearTimeout(ca),la=1,fa(Tn)),u}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(ca),ca=setTimeout(Tn,t)),la=0):(la=1,fa(Tn))}function Rn(){for(var n=Date.now(),t=oa;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=oa,e=1/0;t;)t.c?(t.t<e&&(e=t.t),t=(n=t).n):t=n?n.n=t.n:oa=t.n;return aa=n,e}function Pn(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Un(n,t){var e=Math.pow(10,3*xo(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function jn(n){var t=n.decimal,e=n.thousands,r=n.grouping,i=n.currency,u=r&&e?function(n,t){for(var i=n.length,u=[],o=0,a=r[0],l=0;i>0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),u.push(n.substring(i-=a,i+a)),!((l+=a+1)>t));)a=r[o=(o+1)%r.length];return u.reverse().join(e)}:m;return function(n){var e=ha.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",l=e[4]||"",c=e[5],f=+e[6],s=e[7],h=e[8],p=e[9],g=1,v="",d="",y=!1,m=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===o)&&(c=r="0",o="="),p){case"n":s=!0,p="g";break;case"%":g=100,d="%",p="f";break;case"p":g=100,d="%",p="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+p.toLowerCase());case"c":m=!1;case"d":y=!0,h=0;break;case"s":g=-1,p="r"}"$"===l&&(v=i[0],d=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):"e"!=p&&"f"!=p||(h=Math.max(0,Math.min(20,h)))),p=pa.get(p)||Fn;var M=c&&s;return function(n){var e=d;if(y&&n%1)return"";var i=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>g){var l=ao.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=g;n=p(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=m?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&s&&(x=u(x,1/0));var S=v.length+x.length+b.length+(M?0:i.length),k=f>S?new Array(S=f-S+1).join(r):"";return M&&(x=u(k+x,k.length?f-b.length:1/0)),i+=v,n=x+b,("<"===o?i+n+k:">"===o?k+i+n:"^"===o?k.substring(0,S>>=1)+i+n+k.substring(S):i+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=u(e,1);return r-t>t-e?e:r}function i(e){return t(e=n(new va(e-1)),1),e}function u(n,e){return t(n=new va(+n),e),n}function o(n,r,u){var o=i(n),a=[];if(u>1)for(;r>o;)e(o)%u||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{va=Hn;var r=new Hn;return r._=n,o(r,t,e)}finally{va=Date}}n.floor=n,n.round=r,n.ceil=i,n.offset=u,n.range=o;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(i),l.offset=In(u),l.range=a,n}function In(n){return function(t,e){try{va=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{va=Date}}}function Yn(n){function t(n){function t(t){for(var e,i,u,o=[],a=-1,l=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.slice(l,a)),null!=(i=ya[e=n.charAt(++a)])&&(e=n.charAt(++a)),(u=A[e])&&(e=u(t,null==i?"e"===e?" ":"0":i)),o.push(e),l=a+1);return o.push(n.slice(l,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=e(r,n,t,0);if(i!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var u=null!=r.Z&&va!==Hn,o=new(u?Hn:va);return"j"in r?o.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),u?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var i,u,o,a=0,l=t.length,c=e.length;l>a;){if(r>=c)return-1;if(i=t.charCodeAt(a++),37===i){if(o=t.charAt(a++),u=C[o in ya?t.charAt(a++):o],!u||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function f(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var s=n.dateTime,h=n.date,p=n.time,g=n.periods,v=n.days,d=n.shortDays,y=n.months,m=n.shortMonths;t.utc=function(n){function e(n){try{va=Hn;var t=new va;return t._=n,r(t)}finally{va=Date}}var r=t(n);return e.parse=function(n){try{va=Hn;var t=r.parse(n);return t&&t._}finally{va=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=ao.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(y),k=Xn(y),N=Vn(m),E=Xn(m);g.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return m[n.getMonth()]},B:function(n){return y[n.getMonth()]},c:t(s),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+ga.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return g[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(ga.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(ga.mondayOfYear(n),t,2)},x:t(h),X:t(p),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:at,"%":function(){return"%"}},C={a:r,A:i,b:u,B:o,c:a,d:tt,e:tt,H:rt,I:rt,j:et,L:ot,m:nt,M:it,p:f,S:ut,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",i=(r?-n:n)+"",u=i.length;return r+(e>u?new Array(e-u+1).join(t)+i:i)}function Vn(n){return new RegExp("^(?:"+n.map(ao.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function $n(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Bn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function Wn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Jn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Gn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.y=Qn(+r[0]),e+r[0].length):-1}function Kn(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Qn(n){return n+(n>68?1900:2e3)}function nt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function it(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ut(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ot(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function at(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=xo(t)/60|0,i=xo(t)%60;return e+Zn(r,"0",2)+Zn(i,"0",2)}function lt(n,t,e){Ma.lastIndex=0;var r=Ma.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ft(){}function st(n,t,e){var r=e.s=n+t,i=r-n,u=r-i;e.t=n-u+(t-i)}function ht(n,t){n&&wa.hasOwnProperty(n.type)&&wa[n.type](n,t)}function pt(n,t,e){var r,i=-1,u=n.length-e;for(t.lineStart();++i<u;)r=n[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function gt(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)pt(n[e],t,1);t.polygonEnd()}function vt(){function n(n,t){n*=Yo,t=t*Yo/2+Fo/4;var e=n-r,o=e>=0?1:-1,a=o*e,l=Math.cos(t),c=Math.sin(t),f=u*c,s=i*l+f*Math.cos(a),h=f*o*Math.sin(a);ka.add(Math.atan2(h,s)),r=n,i=l,u=c}var t,e,r,i,u;Na.point=function(o,a){Na.point=n,r=(t=o)*Yo,i=Math.cos(a=(e=a)*Yo/2+Fo/4),u=Math.sin(a)},Na.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function yt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function mt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return xo(n[0]-t[0])<Uo&&xo(n[1]-t[1])<Uo}function St(n,t){n*=Yo;var e=Math.cos(t*=Yo);kt(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function kt(n,t,e){++Ea,Ca+=(n-Ca)/Ea,za+=(t-za)/Ea,La+=(e-La)/Ea}function Nt(){function n(n,i){n*=Yo;var u=Math.cos(i*=Yo),o=u*Math.cos(n),a=u*Math.sin(n),l=Math.sin(i),c=Math.atan2(Math.sqrt((c=e*l-r*a)*c+(c=r*o-t*l)*c+(c=t*a-e*o)*c),t*o+e*a+r*l);Aa+=c,qa+=c*(t+(t=o)),Ta+=c*(e+(e=a)),Ra+=c*(r+(r=l)),kt(t,e,r)}var t,e,r;ja.point=function(i,u){i*=Yo;var o=Math.cos(u*=Yo);t=o*Math.cos(i),e=o*Math.sin(i),r=Math.sin(u),ja.point=n,kt(t,e,r)}}function Et(){ja.point=St}function At(){function n(n,t){n*=Yo;var e=Math.cos(t*=Yo),o=e*Math.cos(n),a=e*Math.sin(n),l=Math.sin(t),c=i*l-u*a,f=u*o-r*l,s=r*a-i*o,h=Math.sqrt(c*c+f*f+s*s),p=r*o+i*a+u*l,g=h&&-nn(p)/h,v=Math.atan2(h,p);Da+=g*c,Pa+=g*f,Ua+=g*s,Aa+=v,qa+=v*(r+(r=o)),Ta+=v*(i+(i=a)),Ra+=v*(u+(u=l)),kt(r,i,u)}var t,e,r,i,u;ja.point=function(o,a){t=o,e=a,ja.point=n,o*=Yo;var l=Math.cos(a*=Yo);r=l*Math.cos(o),i=l*Math.sin(o),u=Math.sin(a),kt(r,i,u)},ja.lineEnd=function(){n(t,e),ja.lineEnd=Et,ja.point=St}}function Ct(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function zt(){return!0}function Lt(n,t,e,r,i){var u=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(wt(e,r)){i.lineStart();for(var a=0;t>a;++a)i.point((e=n[a])[0],e[1]);return void i.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,u.push(l),o.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,u.push(l),o.push(c)}}),o.sort(t),qt(u),qt(o),u.length){for(var a=0,l=e,c=o.length;c>a;++a)o[a].e=l=!l;for(var f,s,h=u[0];;){for(var p=h,g=!0;p.v;)if((p=p.n)===h)return;f=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(g)for(var a=0,c=f.length;c>a;++a)i.point((s=f[a])[0],s[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(g){f=p.p.z;for(var a=f.length-1;a>=0;--a)i.point((s=f[a])[0],s[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,f=p.z,g=!g}while(!p.v);i.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r<t;)i.n=e=n[r],e.p=i,i=e;i.n=e=n[0],e.p=i}}function Tt(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Rt(n,t,e,r){return function(i,u){function o(t,e){var r=i(t,e);n(t=r[0],e=r[1])&&u.point(t,e)}function a(n,t){var e=i(n,t);d.point(e[0],e[1])}function l(){m.point=a,d.lineStart()}function c(){m.point=o,d.lineEnd()}function f(n,t){v.push([n,t]);var e=i(n,t);x.point(e[0],e[1])}function s(){x.lineStart(),v=[]}function h(){f(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),g.push(v),v=null,r)if(1&t){n=e[0];var i,r=n.length-1,o=-1;if(r>0){for(b||(u.polygonStart(),b=!0),u.lineStart();++o<r;)u.point((i=n[o])[0],i[1]);u.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),p.push(e.filter(Dt))}var p,g,v,d=t(u),y=i.invert(r[0],r[1]),m={point:o,lineStart:l,lineEnd:c,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=h,p=[],g=[]},polygonEnd:function(){m.point=o,m.lineStart=l,m.lineEnd=c,p=ao.merge(p);var n=Ot(y,g);p.length?(b||(u.polygonStart(),b=!0),Lt(p,Ut,n,e,u)):n&&(b||(u.polygonStart(),b=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),b&&(u.polygonEnd(),b=!1),p=g=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}},M=Pt(),x=t(M),b=!1;return m}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Ut(n,t){return((n=n.x)[0]<0?n[1]-Io-Uo:Io-n[1])-((t=t.x)[0]<0?t[1]-Io-Uo:Io-t[1])}function jt(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a=u>0?Fo:-Fo,l=xo(u-e);xo(l-Fo)<Uo?(n.point(e,r=(r+o)/2>0?Io:-Io),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(u,r),t=0):i!==a&&l>=Fo&&(xo(e-i)<Uo&&(e-=i*Uo),xo(u-a)<Uo&&(u-=a*Uo),r=Ft(e,r,u,o),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=u,r=o),i=a},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}}function Ft(n,t,e,r){var i,u,o=Math.sin(n-e);return xo(o)>Uo?Math.atan((Math.sin(t)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(t))*Math.sin(n))/(i*u*o)):(t+r)/2}function Ht(n,t,e,r){var i;if(null==n)i=e*Io,r.point(-Fo,i),r.point(0,i),r.point(Fo,i),r.point(Fo,0),r.point(Fo,-i),r.point(0,-i),r.point(-Fo,-i),r.point(-Fo,0),r.point(-Fo,i);else if(xo(n[0]-t[0])>Uo){var u=n[0]<t[0]?Fo:-Fo;i=e*u/2,r.point(-u,i),r.point(0,i),r.point(u,i)}else r.point(t[0],t[1])}function Ot(n,t){var e=n[0],r=n[1],i=[Math.sin(e),-Math.cos(e),0],u=0,o=0;ka.reset();for(var a=0,l=t.length;l>a;++a){var c=t[a],f=c.length;if(f)for(var s=c[0],h=s[0],p=s[1]/2+Fo/4,g=Math.sin(p),v=Math.cos(p),d=1;;){d===f&&(d=0),n=c[d];var y=n[0],m=n[1]/2+Fo/4,M=Math.sin(m),x=Math.cos(m),b=y-h,_=b>=0?1:-1,w=_*b,S=w>Fo,k=g*M;if(ka.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*Ho:b,S^h>=e^y>=e){var N=mt(dt(s),dt(n));bt(N);var E=mt(i,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(-Uo>u||Uo>u&&-Uo>ka)^1&o}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>u}function e(n){var e,u,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=t(s,h),d=o?v?0:i(s,h):v?i(s+(0>s?Fo:-Fo),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(p=r(e,g),(wt(e,p)||wt(g,p))&&(g[0]+=Uo,g[1]+=Uo,v=t(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=r(g,e),n.point(p[0],p[1])):(p=r(e,g),n.point(p[0],p[1]),n.lineEnd()),e=p;else if(a&&e&&o^v){var y;d&u||!(y=r(g,e,!0))||(f=0,o?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||e&&wt(e,g)||n.point(g[0],g[1]),e=g,l=v,u=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return f|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),i=dt(t),o=[1,0,0],a=mt(r,i),l=yt(a,a),c=a[0],f=l-c*c;if(!f)return!e&&n;var s=u*l/f,h=-u*c/f,p=mt(o,a),g=xt(o,s),v=xt(a,h);Mt(g,v);var d=p,y=yt(g,d),m=yt(d,d),M=y*y-m*(yt(g,g)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-y-x)/m);if(Mt(b,g),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=xo(E-Fo)<Uo,C=A||Uo>E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(xo(b[0]-w)<Uo?k:N):k<=b[1]&&b[1]<=N:E>Fo^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-y+x)/m);return Mt(z,g),[b,_t(z)]}}}function i(t,e){var r=o?n:Fo-n,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>e?i|=4:e>r&&(i|=8),i}var u=Math.cos(n),o=u>0,a=xo(u)>Uo,l=ve(n,6*Yo);return Rt(t,e,l,o?[0,-n]:[-Fo,n-Fo])}function Yt(n,t,e,r){return function(i){var u,o=i.a,a=i.b,l=o.x,c=o.y,f=a.x,s=a.y,h=0,p=1,g=f-l,v=s-c;if(u=n-l,g||!(u>0)){if(u/=g,0>g){if(h>u)return;p>u&&(p=u)}else if(g>0){if(u>p)return;u>h&&(h=u)}if(u=e-l,g||!(0>u)){if(u/=g,0>g){if(u>p)return;u>h&&(h=u)}else if(g>0){if(h>u)return;p>u&&(p=u)}if(u=t-c,v||!(u>0)){if(u/=v,0>v){if(h>u)return;p>u&&(p=u)}else if(v>0){if(u>p)return;u>h&&(h=u)}if(u=r-c,v||!(0>u)){if(u/=v,0>v){if(u>p)return;u>h&&(h=u)}else if(v>0){if(h>u)return;p>u&&(p=u)}return h>0&&(i.a={x:l+h*g,y:c+h*v}),1>p&&(i.b={x:l+p*g,y:c+p*v}),i}}}}}}function Zt(n,t,e,r){function i(r,i){return xo(r[0]-n)<Uo?i>0?0:3:xo(r[0]-e)<Uo?i>0?2:1:xo(r[1]-t)<Uo?i>0?1:0:i>0?3:2}function u(n,t){return o(n.x,t.x)}function o(n,t){var e=i(n,1),r=i(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function l(n){for(var t=0,e=d.length,r=n[1],i=0;e>i;++i)for(var u,o=1,a=d[i],l=a.length,c=a[0];l>o;++o)u=a[o],c[1]<=r?u[1]>r&&Q(c,u,n)>0&&++t:u[1]<=r&&Q(c,u,n)<0&&--t,c=u;return 0!==t}function c(u,a,l,c){var f=0,s=0;if(null==u||(f=i(u,l))!==(s=i(a,l))||o(u,a)<0^l>0){do c.point(0===f||3===f?n:e,f>1?r:t);while((f=(f+l+4)%4)!==s)}else c.point(a[0],a[1])}function f(i,u){return i>=n&&e>=i&&u>=t&&r>=u}function s(n,t){f(n,t)&&a.point(n,t)}function h(){C.point=g,d&&d.push(y=[]),S=!0,w=!1,b=_=NaN}function p(){v&&(g(m,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=s,w&&a.lineEnd()}function g(n,t){n=Math.max(-Ha,Math.min(Ha,n)),t=Math.max(-Ha,Math.min(Ha,t));var e=f(n,t);if(d&&y.push([n,t]),S)m=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,y,m,M,x,b,_,w,S,k,N=a,E=Pt(),A=Yt(n,t,e,r),C={point:s,lineStart:h,lineEnd:p,polygonStart:function(){a=E,v=[],d=[],k=!0},polygonEnd:function(){a=N,v=ao.merge(v);var t=l([n,r]),e=k&&t,i=v.length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),c(null,null,1,a),a.lineEnd()),i&&Lt(v,u,t,c,a),a.polygonEnd()),v=d=y=null}};return C}}function Vt(n){var t=0,e=Fo/3,r=ae(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*Fo/180,e=n[1]*Fo/180):[t/Fo*180,e/Fo*180]},i}function Xt(n,t){function e(n,t){var e=Math.sqrt(u-2*i*Math.sin(t))/i;return[e*Math.sin(n*=i),o-e*Math.cos(n)]}var r=Math.sin(n),i=(r+Math.sin(t))/2,u=1+r*(2*i-r),o=Math.sqrt(u)/i;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/i,tn((u-(n*n+e*e)*i*i)/(2*i))]},e}function $t(){function n(n,t){Ia+=i*n-r*t,r=n,i=t}var t,e,r,i;$a.point=function(u,o){$a.point=n,t=r=u,e=i=o},$a.lineEnd=function(){n(t,e)}}function Bt(n,t){Ya>n&&(Ya=n),n>Va&&(Va=n),Za>t&&(Za=t),t>Xa&&(Xa=t)}function Wt(){function n(n,t){o.push("M",n,",",t,u)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function i(){o.push("Z")}var u=Jt(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return u=Jt(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Ca+=n,za+=t,++La}function Kt(){function n(n,r){var i=n-t,u=r-e,o=Math.sqrt(i*i+u*u);qa+=o*(t+n)/2,Ta+=o*(e+r)/2,Ra+=o,Gt(t=n,e=r)}var t,e;Wa.point=function(r,i){Wa.point=n,Gt(t=r,e=i)}}function Qt(){Wa.point=Gt}function ne(){function n(n,t){var e=n-r,u=t-i,o=Math.sqrt(e*e+u*u);qa+=o*(r+n)/2,Ta+=o*(i+t)/2,Ra+=o,o=i*n-r*t,Da+=o*(r+n),Pa+=o*(i+t),Ua+=3*o,Gt(r=n,i=t)}var t,e,r,i;Wa.point=function(u,o){Wa.point=n,Gt(t=r=u,e=i=o)},Wa.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,Ho)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function i(){a.point=t}function u(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:i,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=i,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function ee(n){function t(n){return(a?r:e)(n)}function e(t){return ue(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=u,t.lineStart()}function u(e,r){var u=dt([e,r]),o=n(e,r);i(M,x,m,b,_,w,M=o[0],x=o[1],m=e,b=u[0],_=u[1],w=u[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function l(){
+!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function i(n){return!isNaN(n)}function u(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function f(n){return(n+="")===bo||n[0]===_o?_o+n:n}function s(n){return(n+="")[0]===_o?n.slice(1):n}function h(n){return f(n)in this._}function p(n){return(n=f(n))in this._&&delete this._[n]}function g(){var n=[];for(var t in this._)n.push(s(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function y(){this._=Object.create(null)}function m(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=wo.length;r>e;++e){var i=wo[e]+t;if(i in n)return i}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,i=-1,u=r.length;++i<u;)(t=r[i].on)&&t.apply(this,arguments);return n}var e=[],r=new c;return t.on=function(t,i){var u,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,u=e.indexOf(o)).concat(e.slice(u+1)),r.remove(t)),i&&e.push(r.set(t,{on:i})),n)},t}function S(){ao.event.preventDefault()}function k(){for(var n,t=ao.event;n=t.sourceEvent;)t=n;return t}function N(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(i){try{var u=i.sourceEvent=ao.event;i.target=n,ao.event=i,t[i.type].apply(e,r)}finally{ao.event=u}}},t}function E(n){return ko(n,Co),n}function A(n){return"function"==typeof n?n:function(){return No(n,this)}}function C(n){return"function"==typeof n?n:function(){return Eo(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function i(){this.setAttribute(n,t)}function u(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ao.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?u:i}function L(n){return n.trim().replace(/\s+/g," ")}function q(n){return new RegExp("(?:^|\\s+)"+ao.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<i;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<i;)n[e](this,r)}n=T(n).map(D);var i=n.length;return"function"==typeof t?r:e}function D(n){var t=q(n);return function(e,r){if(i=e.classList)return r?i.add(n):i.remove(n);var i=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(i)||e.setAttribute("class",L(i+" "+n))):e.setAttribute("class",L(i.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function i(){this.style.setProperty(n,t,e)}function u(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?u:i}function U(n,t){function e(){delete this[n]}function r(){this[n]=t}function i(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?i:r}function j(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e===zo&&t.documentElement.namespaceURI===zo?t.createElement(n):t.createElementNS(e,n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=ao.ns.qualify(n)).local?e:t}function F(){var n=this.parentNode;n&&n.removeChild(this)}function H(n){return{__data__:n}}function O(n){return function(){return Ao(this,n)}}function I(n){return arguments.length||(n=e),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function Y(n,t){for(var e=0,r=n.length;r>e;e++)for(var i,u=n[e],o=0,a=u.length;a>o;o++)(i=u[o])&&t(i,o,e);return n}function Z(n){return ko(n,qo),n}function V(n){var t,e;return function(r,i,u){var o,a=n[u].update,l=a.length;for(u!=e&&(e=u,t=0),i>=t&&(t=i+1);!(o=a[t])&&++t<l;);return o}}function X(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function i(){var i=l(t,co(arguments));r.call(this),this.addEventListener(n,this[o]=i,i.$=e),i._=t}function u(){var t,e=new RegExp("^__on([^.]+)"+ao.requote(n)+"$");for(var r in this)if(t=r.match(e)){var i=this[r];this.removeEventListener(t[1],i,i.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),l=$;a>0&&(n=n.slice(0,a));var c=To.get(n);return c&&(n=c,l=B),a?t?i:r:t?b:u}function $(n,t){return function(e){var r=ao.event;ao.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ao.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Do,i="click"+r,u=ao.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ro&&(Ro="onselectstart"in e?!1:x(e.style,"userSelect")),Ro){var o=n(e).style,a=o[Ro];o[Ro]="none"}return function(n){if(u.on(r,null),Ro&&(o[Ro]=a),n){var t=function(){u.on(i,null)};u.on(i,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Po){var u=t(n);if(u.scrollX||u.scrollY){r=ao.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Po=!(o.f||o.e),r.remove()}}return Po?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ao.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?Fo:Math.acos(n)}function tn(n){return n>1?Io:-1>n?-Io:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function on(n){return(n=Math.sin(n/2))*n}function an(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?u+(o-u)*n/60:180>n?o:240>n?u+(o-u)*(240-n)/60:u}function i(n){return Math.round(255*r(n))}var u,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,u=2*e-o,new mn(i(n+120),i(n),i(n-120))}function fn(n,t,e){return this instanceof fn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof fn?new fn(n.h,n.c,n.l):n instanceof hn?gn(n.l,n.a,n.b):gn((n=Sn((n=ao.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new fn(n,t,e)}function sn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Yo)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof fn?sn(n.h,n.c,n.l):Sn((n=mn(n)).r,n.g,n.b):new hn(n,t,e)}function pn(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return i=vn(i)*na,r=vn(r)*ta,u=vn(u)*ea,new mn(yn(3.2404542*i-1.5371385*r-.4985314*u),yn(-.969266*i+1.8760108*r+.041556*u),yn(.0556434*i-.2040259*r+1.0572252*u))}function gn(n,t,e){return n>0?new fn(Math.atan2(e,t)*Zo,Math.sqrt(t*t+e*e),n):new fn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function yn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mn(n,t,e){return this instanceof mn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mn?new mn(n.r,n.g,n.b):_n(""+n,mn,cn):new mn(n,t,e)}function Mn(n){return new mn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(Nn(i[0]),Nn(i[1]),Nn(i[2]))}return(u=ua.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o=o>>4|o,a=240&u,a=a>>4|a,l=15&u,l=l<<4|l):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function wn(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=.5>l?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=NaN,i=l>0&&1>l?0:r),new ln(r,i,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/na),i=dn((.2126729*n+.7151522*t+.072175*e)/ta),u=dn((.0193339*n+.119192*t+.9503041*e)/ea);return hn(116*i-16,500*(r-i),200*(i-u))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function i(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(u,l)}catch(r){return void o.error.call(u,r)}o.load.call(u,n)}else o.error.call(u,l)}var u={},o=ao.dispatch("beforesend","progress","load","error"),a={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(n){var t=ao.event;ao.event=n;try{o.progress.call(u,l)}finally{ao.event=t}},u.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",u)},u.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",u):t},u.responseType=function(n){return arguments.length?(c=n,u):c},u.response=function(n){return e=n,u},["get","post"].forEach(function(n){u[n]=function(){return u.send.apply(u,[n].concat(co(arguments)))}}),u.send=function(e,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),l.setRequestHeader)for(var f in a)l.setRequestHeader(f,a[f]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=i&&u.on("error",i).on("load",function(n){i(null,n)}),o.beforesend.call(u,l),l.send(null==r?null:r),u},u.abort=function(){return l.abort(),u},ao.rebind(u,o,"on"),null==r?u:u.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var i=e+t,u={c:n,t:i,n:null};return aa?aa.n=u:oa=u,aa=u,la||(ca=clearTimeout(ca),la=1,fa(Tn)),u}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(ca),ca=setTimeout(Tn,t)),la=0):(la=1,fa(Tn))}function Rn(){for(var n=Date.now(),t=oa;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=oa,e=1/0;t;)t.c?(t.t<e&&(e=t.t),t=(n=t).n):t=n?n.n=t.n:oa=t.n;return aa=n,e}function Pn(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Un(n,t){var e=Math.pow(10,3*xo(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function jn(n){var t=n.decimal,e=n.thousands,r=n.grouping,i=n.currency,u=r&&e?function(n,t){for(var i=n.length,u=[],o=0,a=r[0],l=0;i>0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),u.push(n.substring(i-=a,i+a)),!((l+=a+1)>t));)a=r[o=(o+1)%r.length];return u.reverse().join(e)}:m;return function(n){var e=ha.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",l=e[4]||"",c=e[5],f=+e[6],s=e[7],h=e[8],p=e[9],g=1,v="",d="",y=!1,m=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===o)&&(c=r="0",o="="),p){case"n":s=!0,p="g";break;case"%":g=100,d="%",p="f";break;case"p":g=100,d="%",p="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+p.toLowerCase());case"c":m=!1;case"d":y=!0,h=0;break;case"s":g=-1,p="r"}"$"===l&&(v=i[0],d=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):"e"!=p&&"f"!=p||(h=Math.max(0,Math.min(20,h)))),p=pa.get(p)||Fn;var M=c&&s;return function(n){var e=d;if(y&&n%1)return"";var i=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>g){var l=ao.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=g;n=p(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=m?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&s&&(x=u(x,1/0));var S=v.length+x.length+b.length+(M?0:i.length),k=f>S?new Array(S=f-S+1).join(r):"";return M&&(x=u(k+x,k.length?f-b.length:1/0)),i+=v,n=x+b,("<"===o?i+n+k:">"===o?k+i+n:"^"===o?k.substring(0,S>>=1)+i+n+k.substring(S):i+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=u(e,1);return r-t>t-e?e:r}function i(e){return t(e=n(new va(e-1)),1),e}function u(n,e){return t(n=new va(+n),e),n}function o(n,r,u){var o=i(n),a=[];if(u>1)for(;r>o;)e(o)%u||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{va=Hn;var r=new Hn;return r._=n,o(r,t,e)}finally{va=Date}}n.floor=n,n.round=r,n.ceil=i,n.offset=u,n.range=o;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(i),l.offset=In(u),l.range=a,n}function In(n){return function(t,e){try{va=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{va=Date}}}function Yn(n){function t(n){function t(t){for(var e,i,u,o=[],a=-1,l=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.slice(l,a)),null!=(i=ya[e=n.charAt(++a)])&&(e=n.charAt(++a)),(u=A[e])&&(e=u(t,null==i?"e"===e?" ":"0":i)),o.push(e),l=a+1);return o.push(n.slice(l,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=e(r,n,t,0);if(i!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var u=null!=r.Z&&va!==Hn,o=new(u?Hn:va);return"j"in r?o.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),u?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var i,u,o,a=0,l=t.length,c=e.length;l>a;){if(r>=c)return-1;if(i=t.charCodeAt(a++),37===i){if(o=t.charAt(a++),u=C[o in ya?t.charAt(a++):o],!u||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function f(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var s=n.dateTime,h=n.date,p=n.time,g=n.periods,v=n.days,d=n.shortDays,y=n.months,m=n.shortMonths;t.utc=function(n){function e(n){try{va=Hn;var t=new va;return t._=n,r(t)}finally{va=Date}}var r=t(n);return e.parse=function(n){try{va=Hn;var t=r.parse(n);return t&&t._}finally{va=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=ao.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(y),k=Xn(y),N=Vn(m),E=Xn(m);g.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return m[n.getMonth()]},B:function(n){return y[n.getMonth()]},c:t(s),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+ga.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return g[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(ga.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(ga.mondayOfYear(n),t,2)},x:t(h),X:t(p),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:at,"%":function(){return"%"}},C={a:r,A:i,b:u,B:o,c:a,d:tt,e:tt,H:rt,I:rt,j:et,L:ot,m:nt,M:it,p:f,S:ut,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",i=(r?-n:n)+"",u=i.length;return r+(e>u?new Array(e-u+1).join(t)+i:i)}function Vn(n){return new RegExp("^(?:"+n.map(ao.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function $n(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Bn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function Wn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Jn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Gn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.y=Qn(+r[0]),e+r[0].length):-1}function Kn(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Qn(n){return n+(n>68?1900:2e3)}function nt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function it(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ut(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ot(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function at(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=xo(t)/60|0,i=xo(t)%60;return e+Zn(r,"0",2)+Zn(i,"0",2)}function lt(n,t,e){Ma.lastIndex=0;var r=Ma.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ft(){}function st(n,t,e){var r=e.s=n+t,i=r-n,u=r-i;e.t=n-u+(t-i)}function ht(n,t){n&&wa.hasOwnProperty(n.type)&&wa[n.type](n,t)}function pt(n,t,e){var r,i=-1,u=n.length-e;for(t.lineStart();++i<u;)r=n[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function gt(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)pt(n[e],t,1);t.polygonEnd()}function vt(){function n(n,t){n*=Yo,t=t*Yo/2+Fo/4;var e=n-r,o=e>=0?1:-1,a=o*e,l=Math.cos(t),c=Math.sin(t),f=u*c,s=i*l+f*Math.cos(a),h=f*o*Math.sin(a);ka.add(Math.atan2(h,s)),r=n,i=l,u=c}var t,e,r,i,u;Na.point=function(o,a){Na.point=n,r=(t=o)*Yo,i=Math.cos(a=(e=a)*Yo/2+Fo/4),u=Math.sin(a)},Na.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function yt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function mt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return xo(n[0]-t[0])<Uo&&xo(n[1]-t[1])<Uo}function St(n,t){n*=Yo;var e=Math.cos(t*=Yo);kt(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function kt(n,t,e){++Ea,Ca+=(n-Ca)/Ea,za+=(t-za)/Ea,La+=(e-La)/Ea}function Nt(){function n(n,i){n*=Yo;var u=Math.cos(i*=Yo),o=u*Math.cos(n),a=u*Math.sin(n),l=Math.sin(i),c=Math.atan2(Math.sqrt((c=e*l-r*a)*c+(c=r*o-t*l)*c+(c=t*a-e*o)*c),t*o+e*a+r*l);Aa+=c,qa+=c*(t+(t=o)),Ta+=c*(e+(e=a)),Ra+=c*(r+(r=l)),kt(t,e,r)}var t,e,r;ja.point=function(i,u){i*=Yo;var o=Math.cos(u*=Yo);t=o*Math.cos(i),e=o*Math.sin(i),r=Math.sin(u),ja.point=n,kt(t,e,r)}}function Et(){ja.point=St}function At(){function n(n,t){n*=Yo;var e=Math.cos(t*=Yo),o=e*Math.cos(n),a=e*Math.sin(n),l=Math.sin(t),c=i*l-u*a,f=u*o-r*l,s=r*a-i*o,h=Math.sqrt(c*c+f*f+s*s),p=r*o+i*a+u*l,g=h&&-nn(p)/h,v=Math.atan2(h,p);Da+=g*c,Pa+=g*f,Ua+=g*s,Aa+=v,qa+=v*(r+(r=o)),Ta+=v*(i+(i=a)),Ra+=v*(u+(u=l)),kt(r,i,u)}var t,e,r,i,u;ja.point=function(o,a){t=o,e=a,ja.point=n,o*=Yo;var l=Math.cos(a*=Yo);r=l*Math.cos(o),i=l*Math.sin(o),u=Math.sin(a),kt(r,i,u)},ja.lineEnd=function(){n(t,e),ja.lineEnd=Et,ja.point=St}}function Ct(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function zt(){return!0}function Lt(n,t,e,r,i){var u=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(wt(e,r)){i.lineStart();for(var a=0;t>a;++a)i.point((e=n[a])[0],e[1]);return void i.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,u.push(l),o.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,u.push(l),o.push(c)}}),o.sort(t),qt(u),qt(o),u.length){for(var a=0,l=e,c=o.length;c>a;++a)o[a].e=l=!l;for(var f,s,h=u[0];;){for(var p=h,g=!0;p.v;)if((p=p.n)===h)return;f=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(g)for(var a=0,c=f.length;c>a;++a)i.point((s=f[a])[0],s[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(g){f=p.p.z;for(var a=f.length-1;a>=0;--a)i.point((s=f[a])[0],s[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,f=p.z,g=!g}while(!p.v);i.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r<t;)i.n=e=n[r],e.p=i,i=e;i.n=e=n[0],e.p=i}}function Tt(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Rt(n,t,e,r){return function(i,u){function o(t,e){var r=i(t,e);n(t=r[0],e=r[1])&&u.point(t,e)}function a(n,t){var e=i(n,t);d.point(e[0],e[1])}function l(){m.point=a,d.lineStart()}function c(){m.point=o,d.lineEnd()}function f(n,t){v.push([n,t]);var e=i(n,t);x.point(e[0],e[1])}function s(){x.lineStart(),v=[]}function h(){f(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),g.push(v),v=null,r)if(1&t){n=e[0];var i,r=n.length-1,o=-1;if(r>0){for(b||(u.polygonStart(),b=!0),u.lineStart();++o<r;)u.point((i=n[o])[0],i[1]);u.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),p.push(e.filter(Dt))}var p,g,v,d=t(u),y=i.invert(r[0],r[1]),m={point:o,lineStart:l,lineEnd:c,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=h,p=[],g=[]},polygonEnd:function(){m.point=o,m.lineStart=l,m.lineEnd=c,p=ao.merge(p);var n=Ot(y,g);p.length?(b||(u.polygonStart(),b=!0),Lt(p,Ut,n,e,u)):n&&(b||(u.polygonStart(),b=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),b&&(u.polygonEnd(),b=!1),p=g=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}},M=Pt(),x=t(M),b=!1;return m}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Ut(n,t){return((n=n.x)[0]<0?n[1]-Io-Uo:Io-n[1])-((t=t.x)[0]<0?t[1]-Io-Uo:Io-t[1])}function jt(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a=u>0?Fo:-Fo,l=xo(u-e);xo(l-Fo)<Uo?(n.point(e,r=(r+o)/2>0?Io:-Io),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(u,r),t=0):i!==a&&l>=Fo&&(xo(e-i)<Uo&&(e-=i*Uo),xo(u-a)<Uo&&(u-=a*Uo),r=Ft(e,r,u,o),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=u,r=o),i=a},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}}function Ft(n,t,e,r){var i,u,o=Math.sin(n-e);return xo(o)>Uo?Math.atan((Math.sin(t)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(t))*Math.sin(n))/(i*u*o)):(t+r)/2}function Ht(n,t,e,r){var i;if(null==n)i=e*Io,r.point(-Fo,i),r.point(0,i),r.point(Fo,i),r.point(Fo,0),r.point(Fo,-i),r.point(0,-i),r.point(-Fo,-i),r.point(-Fo,0),r.point(-Fo,i);else if(xo(n[0]-t[0])>Uo){var u=n[0]<t[0]?Fo:-Fo;i=e*u/2,r.point(-u,i),r.point(0,i),r.point(u,i)}else r.point(t[0],t[1])}function Ot(n,t){var e=n[0],r=n[1],i=[Math.sin(e),-Math.cos(e),0],u=0,o=0;ka.reset();for(var a=0,l=t.length;l>a;++a){var c=t[a],f=c.length;if(f)for(var s=c[0],h=s[0],p=s[1]/2+Fo/4,g=Math.sin(p),v=Math.cos(p),d=1;;){d===f&&(d=0),n=c[d];var y=n[0],m=n[1]/2+Fo/4,M=Math.sin(m),x=Math.cos(m),b=y-h,_=b>=0?1:-1,w=_*b,S=w>Fo,k=g*M;if(ka.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*Ho:b,S^h>=e^y>=e){var N=mt(dt(s),dt(n));bt(N);var E=mt(i,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(-Uo>u||Uo>u&&0>ka)^1&o}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>u}function e(n){var e,u,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=t(s,h),d=o?v?0:i(s,h):v?i(s+(0>s?Fo:-Fo),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(p=r(e,g),(wt(e,p)||wt(g,p))&&(g[0]+=Uo,g[1]+=Uo,v=t(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=r(g,e),n.point(p[0],p[1])):(p=r(e,g),n.point(p[0],p[1]),n.lineEnd()),e=p;else if(a&&e&&o^v){var y;d&u||!(y=r(g,e,!0))||(f=0,o?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||e&&wt(e,g)||n.point(g[0],g[1]),e=g,l=v,u=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return f|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),i=dt(t),o=[1,0,0],a=mt(r,i),l=yt(a,a),c=a[0],f=l-c*c;if(!f)return!e&&n;var s=u*l/f,h=-u*c/f,p=mt(o,a),g=xt(o,s),v=xt(a,h);Mt(g,v);var d=p,y=yt(g,d),m=yt(d,d),M=y*y-m*(yt(g,g)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-y-x)/m);if(Mt(b,g),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=xo(E-Fo)<Uo,C=A||Uo>E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(xo(b[0]-w)<Uo?k:N):k<=b[1]&&b[1]<=N:E>Fo^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-y+x)/m);return Mt(z,g),[b,_t(z)]}}}function i(t,e){var r=o?n:Fo-n,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>e?i|=4:e>r&&(i|=8),i}var u=Math.cos(n),o=u>0,a=xo(u)>Uo,l=ve(n,6*Yo);return Rt(t,e,l,o?[0,-n]:[-Fo,n-Fo])}function Yt(n,t,e,r){return function(i){var u,o=i.a,a=i.b,l=o.x,c=o.y,f=a.x,s=a.y,h=0,p=1,g=f-l,v=s-c;if(u=n-l,g||!(u>0)){if(u/=g,0>g){if(h>u)return;p>u&&(p=u)}else if(g>0){if(u>p)return;u>h&&(h=u)}if(u=e-l,g||!(0>u)){if(u/=g,0>g){if(u>p)return;u>h&&(h=u)}else if(g>0){if(h>u)return;p>u&&(p=u)}if(u=t-c,v||!(u>0)){if(u/=v,0>v){if(h>u)return;p>u&&(p=u)}else if(v>0){if(u>p)return;u>h&&(h=u)}if(u=r-c,v||!(0>u)){if(u/=v,0>v){if(u>p)return;u>h&&(h=u)}else if(v>0){if(h>u)return;p>u&&(p=u)}return h>0&&(i.a={x:l+h*g,y:c+h*v}),1>p&&(i.b={x:l+p*g,y:c+p*v}),i}}}}}}function Zt(n,t,e,r){function i(r,i){return xo(r[0]-n)<Uo?i>0?0:3:xo(r[0]-e)<Uo?i>0?2:1:xo(r[1]-t)<Uo?i>0?1:0:i>0?3:2}function u(n,t){return o(n.x,t.x)}function o(n,t){var e=i(n,1),r=i(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function l(n){for(var t=0,e=d.length,r=n[1],i=0;e>i;++i)for(var u,o=1,a=d[i],l=a.length,c=a[0];l>o;++o)u=a[o],c[1]<=r?u[1]>r&&Q(c,u,n)>0&&++t:u[1]<=r&&Q(c,u,n)<0&&--t,c=u;return 0!==t}function c(u,a,l,c){var f=0,s=0;if(null==u||(f=i(u,l))!==(s=i(a,l))||o(u,a)<0^l>0){do c.point(0===f||3===f?n:e,f>1?r:t);while((f=(f+l+4)%4)!==s)}else c.point(a[0],a[1])}function f(i,u){return i>=n&&e>=i&&u>=t&&r>=u}function s(n,t){f(n,t)&&a.point(n,t)}function h(){C.point=g,d&&d.push(y=[]),S=!0,w=!1,b=_=NaN}function p(){v&&(g(m,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=s,w&&a.lineEnd()}function g(n,t){n=Math.max(-Ha,Math.min(Ha,n)),t=Math.max(-Ha,Math.min(Ha,t));var e=f(n,t);if(d&&y.push([n,t]),S)m=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,y,m,M,x,b,_,w,S,k,N=a,E=Pt(),A=Yt(n,t,e,r),C={point:s,lineStart:h,lineEnd:p,polygonStart:function(){a=E,v=[],d=[],k=!0},polygonEnd:function(){a=N,v=ao.merge(v);var t=l([n,r]),e=k&&t,i=v.length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),c(null,null,1,a),a.lineEnd()),i&&Lt(v,u,t,c,a),a.polygonEnd()),v=d=y=null}};return C}}function Vt(n){var t=0,e=Fo/3,r=ae(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*Fo/180,e=n[1]*Fo/180):[t/Fo*180,e/Fo*180]},i}function Xt(n,t){function e(n,t){var e=Math.sqrt(u-2*i*Math.sin(t))/i;return[e*Math.sin(n*=i),o-e*Math.cos(n)]}var r=Math.sin(n),i=(r+Math.sin(t))/2,u=1+r*(2*i-r),o=Math.sqrt(u)/i;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/i,tn((u-(n*n+e*e)*i*i)/(2*i))]},e}function $t(){function n(n,t){Ia+=i*n-r*t,r=n,i=t}var t,e,r,i;$a.point=function(u,o){$a.point=n,t=r=u,e=i=o},$a.lineEnd=function(){n(t,e)}}function Bt(n,t){Ya>n&&(Ya=n),n>Va&&(Va=n),Za>t&&(Za=t),t>Xa&&(Xa=t)}function Wt(){function n(n,t){o.push("M",n,",",t,u)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function i(){o.push("Z")}var u=Jt(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return u=Jt(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Ca+=n,za+=t,++La}function Kt(){function n(n,r){var i=n-t,u=r-e,o=Math.sqrt(i*i+u*u);qa+=o*(t+n)/2,Ta+=o*(e+r)/2,Ra+=o,Gt(t=n,e=r)}var t,e;Wa.point=function(r,i){Wa.point=n,Gt(t=r,e=i)}}function Qt(){Wa.point=Gt}function ne(){function n(n,t){var e=n-r,u=t-i,o=Math.sqrt(e*e+u*u);qa+=o*(r+n)/2,Ta+=o*(i+t)/2,Ra+=o,o=i*n-r*t,Da+=o*(r+n),Pa+=o*(i+t),Ua+=3*o,Gt(r=n,i=t)}var t,e,r,i;Wa.point=function(u,o){Wa.point=n,Gt(t=r=u,e=i=o)},Wa.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,Ho)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function i(){a.point=t}function u(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:i,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=i,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function ee(n){function t(n){return(a?r:e)(n)}function e(t){return ue(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=u,t.lineStart()}function u(e,r){var u=dt([e,r]),o=n(e,r);i(M,x,m,b,_,w,M=o[0],x=o[1],m=e,b=u[0],_=u[1],w=u[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function l(){
 r(),S.point=c,S.lineEnd=f}function c(n,t){u(s=n,h=t),p=M,g=x,v=b,d=_,y=w,S.point=u}function f(){i(M,x,m,b,_,w,p,g,s,v,d,y,a,t),S.lineEnd=o,o()}var s,h,p,g,v,d,y,m,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function i(t,e,r,a,l,c,f,s,h,p,g,v,d,y){var m=f-t,M=s-e,x=m*m+M*M;if(x>4*u&&d--){var b=a+p,_=l+g,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=xo(xo(w)-1)<Uo||xo(r-h)<Uo?(r+h)/2:Math.atan2(_,b),E=n(N,k),A=E[0],C=E[1],z=A-t,L=C-e,q=M*z-m*L;(q*q/x>u||xo((m*z+M*L)/x-.5)>.3||o>a*p+l*g+c*v)&&(i(t,e,r,a,l,c,A,C,N,b/=S,_/=S,w,d,y),y.point(A,C),i(A,C,N,b,_,w,f,s,h,p,g,v,d,y))}}var u=.5,o=Math.cos(30*Yo),a=16;return t.precision=function(n){return arguments.length?(a=(u=n*n)>0&&16,t):Math.sqrt(u)},t}function re(n){var t=ee(function(t,e){return n([t*Zo,e*Zo])});return function(n){return le(t(n))}}function ie(n){this.stream=n}function ue(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function oe(n){return ae(function(){return n})()}function ae(n){function t(n){return n=a(n[0]*Yo,n[1]*Yo),[n[0]*h+l,c-n[1]*h]}function e(n){return n=a.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Zo,n[1]*Zo]}function r(){a=Ct(o=se(y,M,x),u);var n=u(v,d);return l=p-n[0]*h,c=g+n[1]*h,i()}function i(){return f&&(f.valid=!1,f=null),t}var u,o,a,l,c,f,s=ee(function(n,t){return n=u(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,p=480,g=250,v=0,d=0,y=0,M=0,x=0,b=Fa,_=m,w=null,S=null;return t.stream=function(n){return f&&(f.valid=!1),f=le(b(o,s(_(n)))),f.valid=!0,f},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Fa):It((w=+n)*Yo),i()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):m,i()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(p=+n[0],g=+n[1],r()):[p,g]},t.center=function(n){return arguments.length?(v=n[0]%360*Yo,d=n[1]%360*Yo,r()):[v*Zo,d*Zo]},t.rotate=function(n){return arguments.length?(y=n[0]%360*Yo,M=n[1]%360*Yo,x=n.length>2?n[2]%360*Yo:0,r()):[y*Zo,M*Zo,x*Zo]},ao.rebind(t,s,"precision"),function(){return u=n.apply(this,arguments),t.invert=u.invert&&e,r()}}function le(n){return ue(n,function(t,e){n.point(t*Yo,e*Yo)})}function ce(n,t){return[n,t]}function fe(n,t){return[n>Fo?n-Ho:-Fo>n?n+Ho:n,t]}function se(n,t,e){return n?t||e?Ct(pe(n),ge(t,e)):pe(n):t||e?ge(t,e):fe}function he(n){return function(t,e){return t+=n,[t>Fo?t-Ho:-Fo>t?t+Ho:t,e]}}function pe(n){var t=he(n);return t.invert=he(-n),t}function ge(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*r+a*i;return[Math.atan2(l*u-f*o,a*r-c*i),tn(f*u+l*o)]}var r=Math.cos(n),i=Math.sin(n),u=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*u-l*o;return[Math.atan2(l*u+c*o,a*r+f*i),tn(f*r-a*i)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var l=o*t;null!=i?(i=de(e,i),u=de(e,u),(o>0?u>i:i>u)&&(i+=o*Ho)):(i=n+o*Ho,u=n-.5*l);for(var c,f=i;o>0?f>u:u>f;f-=l)a.point((c=_t([e,-r*Math.cos(f),-r*Math.sin(f)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Uo)%(2*Math.PI)}function ye(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function me(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var i=Math.cos(t),u=Math.sin(t),o=Math.cos(r),a=Math.sin(r),l=i*Math.cos(n),c=i*Math.sin(n),f=o*Math.cos(e),s=o*Math.sin(e),h=2*Math.asin(Math.sqrt(on(r-t)+i*o*on(e-n))),p=1/Math.sin(h),g=h?function(n){var t=Math.sin(n*=h)*p,e=Math.sin(h-n)*p,r=e*l+t*f,i=e*c+t*s,o=e*u+t*a;return[Math.atan2(i,r)*Zo,Math.atan2(o,Math.sqrt(r*r+i*i))*Zo]}:function(){return[n*Zo,t*Zo]};return g.distance=h,g}function _e(){function n(n,i){var u=Math.sin(i*=Yo),o=Math.cos(i),a=xo((n*=Yo)-t),l=Math.cos(a);Ja+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*u-e*o*l)*a),e*u+r*o*l),t=n,e=u,r=o}var t,e,r;Ga.point=function(i,u){t=i*Yo,e=Math.sin(u*=Yo),r=Math.cos(u),Ga.point=n},Ga.lineEnd=function(){Ga.point=Ga.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}function Se(n,t){function e(n,t){o>0?-Io+Uo>t&&(t=-Io+Uo):t>Io-Uo&&(t=Io-Uo);var e=o/Math.pow(i(t),u);return[e*Math.sin(u*n),o-e*Math.cos(u*n)]}var r=Math.cos(n),i=function(n){return Math.tan(Fo/4+n/2)},u=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(i(t)/i(n)),o=r*Math.pow(i(n),u)/u;return u?(e.invert=function(n,t){var e=o-t,r=K(u)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/u,2*Math.atan(Math.pow(o/r,1/u))-Io]},e):Ne}function ke(n,t){function e(n,t){var e=u-t;return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}var r=Math.cos(n),i=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),u=r/i+n;return xo(i)<Uo?ce:(e.invert=function(n,t){var e=u-t;return[Math.atan2(n,e)/i,u-K(i)*Math.sqrt(n*n+e*e)]},e)}function Ne(n,t){return[n,Math.log(Math.tan(Fo/4+t/2))]}function Ee(n){var t,e=oe(n),r=e.scale,i=e.translate,u=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=i.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=u.apply(e,arguments);if(o===e){if(t=null==n){var a=Fo*r(),l=i();u([[l[0]-a,l[1]-a],[l[0]+a,l[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function Ae(n,t){return[Math.log(Math.tan(Fo/4+t/2)),-n]}function Ce(n){return n[0]}function ze(n){return n[1]}function Le(n){for(var t=n.length,e=[0,1],r=2,i=2;t>i;i++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var i=n[0],u=e[0],o=t[0]-i,a=r[0]-u,l=n[1],c=e[1],f=t[1]-l,s=r[1]-c,h=(a*(l-c)-s*(i-u))/(s*o-a*f);return[i+h*o,l+h*f]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function Ue(n){var t=cl.pop()||new Pe;return t.site=n,t}function je(n){Be(n),ol.remove(n),cl.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,i={x:e,y:r},u=n.P,o=n.N,a=[n];je(n);for(var l=u;l.circle&&xo(e-l.circle.x)<Uo&&xo(r-l.circle.cy)<Uo;)u=l.P,a.unshift(l),je(l),l=u;a.unshift(l),Be(l);for(var c=o;c.circle&&xo(e-c.circle.x)<Uo&&xo(r-c.circle.cy)<Uo;)o=c.N,a.push(c),je(c),c=o;a.push(c),Be(c);var f,s=a.length;for(f=1;s>f;++f)c=a[f],l=a[f-1],nr(c.edge,l.site,c.site,i);l=a[0],c=a[s-1],c.edge=Ke(l.site,c.site,null,i),$e(l),$e(c)}function He(n){for(var t,e,r,i,u=n.x,o=n.y,a=ol._;a;)if(r=Oe(a,o)-u,r>Uo)a=a.L;else{if(i=u-Ie(a,o),!(i>Uo)){r>-Uo?(t=a.P,e=a):i>-Uo?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=Ue(n);if(ol.insert(t,l),t||e){if(t===e)return Be(t),e=Ue(t.site),ol.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,f=c.x,s=c.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,M=v*v+d*d,x={x:(d*m-p*M)/y+f,y:(h*M-v*m)/y+s};nr(e.edge,c,g,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,g,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-(1/0);e=o.site;var a=e.x,l=e.y,c=l-t;if(!c)return a;var f=a-r,s=1/u-1/c,h=f/c;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*c)-l+c/2+i-u/2)))/s+r:(r+a)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,i,u,o,a,l,c,f,s=n[0][0],h=n[1][0],p=n[0][1],g=n[1][1],v=ul,d=v.length;d--;)if(u=v[d],u&&u.prepare())for(a=u.edges,l=a.length,o=0;l>o;)f=a[o].end(),r=f.x,i=f.y,c=a[++o%l].start(),t=c.x,e=c.y,(xo(r-t)>Uo||xo(i-e)>Uo)&&(a.splice(o,0,new tr(Qe(u.site,f,xo(r-s)<Uo&&g-i>Uo?{x:s,y:xo(t-s)<Uo?e:g}:xo(i-g)<Uo&&h-r>Uo?{x:xo(e-g)<Uo?t:h,y:g}:xo(r-h)<Uo&&i-p>Uo?{x:h,y:xo(t-h)<Uo?e:p}:xo(i-p)<Uo&&r-s>Uo?{x:xo(e-p)<Uo?t:s,y:p}:null),u.site,null)),++l)}function Ve(n,t){return t.angle-n.angle}function Xe(){rr(this),this.x=this.y=this.arc=this.site=this.cy=null}function $e(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,i=n.site,u=e.site;if(r!==u){var o=i.x,a=i.y,l=r.x-o,c=r.y-a,f=u.x-o,s=u.y-a,h=2*(l*s-c*f);if(!(h>=-jo)){var p=l*l+c*c,g=f*f+s*s,v=(s*p-c*g)/h,d=(l*g-f*p)/h,s=d+a,y=fl.pop()||new Xe;y.arc=n,y.site=i,y.x=v+o,y.y=s+Math.sqrt(v*v+d*d),y.cy=s,n.circle=y;for(var m=null,M=ll._;M;)if(y.y<M.y||y.y===M.y&&y.x<=M.x){if(!M.L){m=M.P;break}M=M.L}else{if(!M.R){m=M;break}M=M.R}ll.insert(m,y),m||(al=y)}}}}function Be(n){var t=n.circle;t&&(t.P||(al=t.N),ll.remove(t),fl.push(t),rr(t),n.circle=null)}function We(n){for(var t,e=il,r=Yt(n[0][0],n[0][1],n[1][0],n[1][1]),i=e.length;i--;)t=e[i],(!Je(t,n)||!r(t)||xo(t.a.x-t.b.x)<Uo&&xo(t.a.y-t.b.y)<Uo)&&(t.a=t.b=null,e.splice(i,1))}function Je(n,t){var e=n.b;if(e)return!0;var r,i,u=n.a,o=t[0][0],a=t[1][0],l=t[0][1],c=t[1][1],f=n.l,s=n.r,h=f.x,p=f.y,g=s.x,v=s.y,d=(h+g)/2,y=(p+v)/2;if(v===p){if(o>d||d>=a)return;if(h>g){if(u){if(u.y>=c)return}else u={x:d,y:l};e={x:d,y:c}}else{if(u){if(u.y<l)return}else u={x:d,y:c};e={x:d,y:l}}}else if(r=(h-g)/(v-p),i=y-r*d,-1>r||r>1)if(h>g){if(u){if(u.y>=c)return}else u={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(u){if(u.y<l)return}else u={x:(c-i)/r,y:c};e={x:(l-i)/r,y:l}}else if(v>p){if(u){if(u.x>=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.x<o)return}else u={x:a,y:r*a+i};e={x:o,y:r*o+i}}return n.a=u,n.b=e,!0}function Ge(n,t){this.l=n,this.r=t,this.a=this.b=null}function Ke(n,t,e,r){var i=new Ge(n,t);return il.push(i),e&&nr(i,n,t,e),r&&nr(i,t,n,r),ul[n.i].edges.push(new tr(i,n,t)),ul[t.i].edges.push(new tr(i,t,n)),i}function Qe(n,t,e){var r=new Ge(n,null);return r.a=t,r.b=e,il.push(r),r}function nr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function tr(n,t,e){var r=n.a,i=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function er(){this._=null}function rr(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function ir(n,t){var e=t,r=t.R,i=e.U;i?i.L===e?i.L=r:i.R=r:n._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ur(n,t){var e=t,r=t.L,i=e.U;i?i.L===e?i.L=r:i.R=r:n._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function or(n){for(;n.L;)n=n.L;return n}function ar(n,t){var e,r,i,u=n.sort(lr).pop();for(il=[],ul=new Array(n.length),ol=new er,ll=new er;;)if(i=al,u&&(!i||u.y<i.y||u.y===i.y&&u.x<i.x))u.x===e&&u.y===r||(ul[u.i]=new Ye(u),He(u),e=u.x,r=u.y),u=n.pop();else{if(!i)break;Fe(i.arc)}t&&(We(t),Ze(t));var o={cells:ul,edges:il};return ol=ll=il=ul=null,o}function lr(n,t){return t.y-n.y||t.x-n.x}function cr(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function fr(n){return n.x}function sr(n){return n.y}function hr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pr(n,t,e,r,i,u){if(!n(t,e,r,i,u)){var o=.5*(e+i),a=.5*(r+u),l=t.nodes;l[0]&&pr(n,l[0],e,r,o,a),l[1]&&pr(n,l[1],o,r,i,a),l[2]&&pr(n,l[2],e,a,o,u),l[3]&&pr(n,l[3],o,a,i,u)}}function gr(n,t,e,r,i,u,o){var a,l=1/0;return function c(n,f,s,h,p){if(!(f>u||s>o||r>h||i>p)){if(g=n.point){var g,v=t-n.x,d=e-n.y,y=v*v+d*d;if(l>y){var m=Math.sqrt(l=y);r=t-m,i=e-m,u=t+m,o=e+m,a=g}}for(var M=n.nodes,x=.5*(f+h),b=.5*(s+p),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,f,s,x,b);break;case 1:c(n,x,s,h,b);break;case 2:c(n,f,b,x,p);break;case 3:c(n,x,b,h,p)}}}(n,r,i,u,o),a}function vr(n,t){n=ao.rgb(n),t=ao.rgb(t);var e=n.r,r=n.g,i=n.b,u=t.r-e,o=t.g-r,a=t.b-i;return function(n){return"#"+bn(Math.round(e+u*n))+bn(Math.round(r+o*n))+bn(Math.round(i+a*n))}}function dr(n,t){var e,r={},i={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):i[e]=n[e];for(e in t)e in n||(i[e]=t[e]);return function(n){for(e in r)i[e]=r[e](n);return i}}function yr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function mr(n,t){var e,r,i,u=hl.lastIndex=pl.lastIndex=0,o=-1,a=[],l=[];for(n+="",t+="";(e=hl.exec(n))&&(r=pl.exec(t));)(i=r.index)>u&&(i=t.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:yr(e,r)})),u=pl.lastIndex;return u<t.length&&(i=t.slice(u),a[o]?a[o]+=i:a[++o]=i),a.length<2?l[0]?(t=l[0].x,function(n){return t(n)+""}):function(){return t}:(t=l.length,function(n){for(var e,r=0;t>r;++r)a[(e=l[r]).i]=e.x(n);return a.join("")})}function Mr(n,t){for(var e,r=ao.interpolators.length;--r>=0&&!(e=ao.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(Mr(n[e],t[e]));for(;u>e;++e)i[e]=n[e];for(;o>e;++e)i[e]=t[e];return function(n){for(e=0;a>e;++e)i[e]=r[e](n);return i}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Io)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Ho*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Ho/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=ao.hcl(n),t=ao.hcl(t);var e=n.h,r=n.c,i=n.l,u=t.h-e,o=t.c-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return sn(e+u*n,r+o*n,i+a*n)+""}}function Dr(n,t){n=ao.hsl(n),t=ao.hsl(t);var e=n.h,r=n.s,i=n.l,u=t.h-e,o=t.s-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return cn(e+u*n,r+o*n,i+a*n)+""}}function Pr(n,t){n=ao.lab(n),t=ao.lab(t);var e=n.l,r=n.a,i=n.b,u=t.l-e,o=t.a-r,a=t.b-i;return function(n){return pn(e+u*n,r+o*n,i+a*n)+""}}function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function jr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),i=Fr(t,e),u=Hr(Or(e,t,-i))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Zo,this.translate=[n.e,n.f],this.scale=[r,u],this.skew=u?Math.atan2(i,u)*Zo:0}function Fr(n,t){return n[0]*t[0]+n[1]*t[1]}function Hr(n){var t=Math.sqrt(Fr(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Or(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Ir(n){return n.length?n.pop()+",":""}function Yr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push("translate(",null,",",null,")");r.push({i:i-4,x:yr(n[0],t[0])},{i:i-2,x:yr(n[1],t[1])})}else(t[0]||t[1])&&e.push("translate("+t+")")}function Zr(n,t,e,r){n!==t?(n-t>180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:yr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:yr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:i-4,x:yr(n[0],t[0])},{i:i-2,x:yr(n[1],t[1])})}else 1===t[0]&&1===t[1]||e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=ao.transform(n),t=ao.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,i=-1,u=r.length;++i<u;)e[(t=r[i]).i]=t.x(n);return e.join("")}}function Br(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Wr(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Jr(n){for(var t=n.source,e=n.target,r=Kr(t,e),i=[t];t!==r;)t=t.parent,i.push(t);for(var u=i.length;e!==r;)i.splice(u,0,e),e=e.parent;return i}function Gr(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Kr(n,t){if(n===t)return n;for(var e=Gr(n),r=Gr(t),i=e.pop(),u=r.pop(),o=null;i===u;)o=i,i=e.pop(),u=r.pop();return o}function Qr(n){n.fixed|=2}function ni(n){n.fixed&=-7}function ti(n){n.fixed|=4,n.px=n.x,n.py=n.y}function ei(n){n.fixed&=-5}function ri(n,t,e){var r=0,i=0;if(n.charge=0,!n.leaf)for(var u,o=n.nodes,a=o.length,l=-1;++l<a;)u=o[l],null!=u&&(ri(u,t,e),n.charge+=u.charge,r+=u.charge*u.cx,i+=u.charge*u.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var c=t*e[n.point.index];n.charge+=n.pointCharge=c,r+=c*n.point.x,i+=c*n.point.y}n.cx=r/n.charge,n.cy=i/n.charge}function ii(n,t){return ao.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=fi,n}function ui(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(i=n.children)&&(r=i.length))for(var r,i;--r>=0;)e.push(i[r])}function oi(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++o<i;)e.push(u[o]);for(;null!=(n=r.pop());)t(n)}function ai(n){return n.children}function li(n){return n.value}function ci(n,t){return t.value-n.value}function fi(n){return ao.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function si(n){return n.x}function hi(n){return n.y}function pi(n,t,e){n.y0=t,n.y=e}function gi(n){return ao.range(n.length)}function vi(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function di(n){for(var t,e=1,r=0,i=n[0][1],u=n.length;u>e;++e)(t=n[e][1])>i&&(r=e,i=t);return r}function yi(n){return n.reduce(mi,0)}function mi(n,t){return n+t[1]}function Mi(n,t){return xi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xi(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function bi(n){return[ao.min(n),ao.max(n)]}function _i(n,t){return n.value-t.value}function wi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Si(n,t){n._pack_next=t,t._pack_prev=n}function ki(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function Ni(n){function t(n){f=Math.min(n.x-n.r,f),s=Math.max(n.x+n.r,s),h=Math.min(n.y-n.r,h),p=Math.max(n.y+n.r,p)}if((e=n.children)&&(c=e.length)){var e,r,i,u,o,a,l,c,f=1/0,s=-(1/0),h=1/0,p=-(1/0);if(e.forEach(Ei),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(i=e[1],i.x=i.r,i.y=0,t(i),c>2))for(u=e[2],zi(r,i,u),t(u),wi(r,u),r._pack_prev=u,wi(u,i),i=r._pack_next,o=3;c>o;o++){zi(r,i,u=e[o]);var g=0,v=1,d=1;for(a=i._pack_next;a!==i;a=a._pack_next,v++)if(ki(a,u)){g=1;break}if(1==g)for(l=r._pack_prev;l!==a._pack_prev&&!ki(l,u);l=l._pack_prev,d++);g?(d>v||v==d&&i.r<r.r?Si(r,i=a):Si(r=l,i),o--):(wi(r,u),i=u,t(u))}var y=(f+s)/2,m=(h+p)/2,M=0;for(o=0;c>o;o++)u=e[o],u.x-=y,u.y-=m,M=Math.max(M,u.r+Math.sqrt(u.x*u.x+u.y*u.y));n.r=M,e.forEach(Ai)}}function Ei(n){n._pack_next=n._pack_prev=n}function Ai(n){delete n._pack_next,delete n._pack_prev}function Ci(n,t,e,r){var i=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,i)for(var u=-1,o=i.length;++u<o;)Ci(i[u],t,e,r)}function zi(n,t,e){var r=n.r+e.r,i=t.x-n.x,u=t.y-n.y;if(r&&(i||u)){var o=t.r+e.r,a=i*i+u*u;o*=o,r*=r;var l=.5+(r-o)/(2*a),c=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+l*i+c*u,e.y=n.y+l*u-c*i}else e.x=n.x+r,e.y=n.y}function Li(n,t){return n.parent==t.parent?1:2}function qi(n){var t=n.children;return t.length?t[0]:n.t}function Ti(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ri(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Di(n){for(var t,e=0,r=0,i=n.children,u=i.length;--u>=0;)t=i[u],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pi(n,t,e){return n.a.parent===t.parent?n.a:e}function Ui(n){return 1+ao.max(n,function(n){return n.y})}function ji(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fi(n){var t=n.children;return t&&t.length?Fi(t[0]):n}function Hi(n){var t,e=n.children;return e&&(t=e.length)?Hi(e[t-1]):n}function Oi(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Ii(n,t){var e=n.x+t[3],r=n.y+t[0],i=n.dx-t[1]-t[3],u=n.dy-t[0]-t[2];return 0>i&&(e+=i/2,i=0),0>u&&(r+=u/2,u=0),{x:e,y:r,dx:i,dy:u}}function Yi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zi(n){return n.rangeExtent?n.rangeExtent():Yi(n.range())}function Vi(n,t,e,r){var i=e(n[0],n[1]),u=r(t[0],t[1]);return function(n){return u(i(n))}}function Xi(n,t){var e,r=0,i=n.length-1,u=n[r],o=n[i];return u>o&&(e=r,r=i,i=e,e=u,u=o,o=e),n[r]=t.floor(u),n[i]=t.ceil(o),n}function $i(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:Sl}function Bi(n,t,e,r){var i=[],u=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)i.push(e(n[o-1],n[o])),u.push(r(t[o-1],t[o]));return function(t){var e=ao.bisect(n,t,1,a)-1;return u[e](i[e](t))}}function Wi(n,t,e,r){function i(){var i=Math.min(n.length,t.length)>2?Bi:Vi,l=r?Wr:Br;return o=i(n,t,l,e),a=i(t,n,l,Mr),u}function u(n){return o(n)}var o,a;return u.invert=function(n){return a(n)},u.domain=function(t){return arguments.length?(n=t.map(Number),i()):n},u.range=function(n){return arguments.length?(t=n,i()):t},u.rangeRound=function(n){return u.range(n).interpolate(Ur)},u.clamp=function(n){return arguments.length?(r=n,i()):r},u.interpolate=function(n){return arguments.length?(e=n,i()):e},u.ticks=function(t){return Qi(n,t)},u.tickFormat=function(t,e){return nu(n,t,e)},u.nice=function(t){return Gi(n,t),i()},u.copy=function(){return Wi(n,t,e,r)},i()}function Ji(n,t){return ao.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gi(n,t){return Xi(n,$i(Ki(n,t)[2])),Xi(n,$i(Ki(n,t)[2])),n}function Ki(n,t){null==t&&(t=10);var e=Yi(n),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),u=t/r*i;return.15>=u?i*=10:.35>=u?i*=5:.75>=u&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function Qi(n,t){return ao.range.apply(ao,Ki(n,t))}function nu(n,t,e){var r=Ki(n,t);if(e){var i=ha.exec(e);if(i.shift(),"s"===i[8]){var u=ao.formatPrefix(Math.max(xo(r[0]),xo(r[1])));return i[7]||(i[7]="."+tu(u.scale(r[2]))),i[8]="f",e=ao.format(i.join("")),function(n){return e(u.scale(n))+u.symbol}}i[7]||(i[7]="."+eu(i[8],r)),e=i.join("")}else e=",."+tu(r[2])+"f";return ao.format(e)}function tu(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function eu(n,t){var e=tu(t[2]);return n in kl?Math.abs(e-tu(Math.max(xo(t[0]),xo(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ru(n,t,e,r){function i(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function u(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(i(t))}return o.invert=function(t){return u(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(i)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(i)),o):t},o.nice=function(){var t=Xi(r.map(i),e?Math:El);return n.domain(t),r=t.map(u),o},o.ticks=function(){var n=Yi(r),o=[],a=n[0],l=n[1],c=Math.floor(i(a)),f=Math.ceil(i(l)),s=t%1?2:t;if(isFinite(f-c)){if(e){for(;f>c;c++)for(var h=1;s>h;h++)o.push(u(c)*h);o.push(u(c))}else for(o.push(u(c));c++<f;)for(var h=s-1;h>0;h--)o.push(u(c)*h);for(c=0;o[c]<a;c++);for(f=o.length;o[f-1]>l;f--);o=o.slice(c,f)}return o},o.tickFormat=function(n,e){if(!arguments.length)return Nl;arguments.length<2?e=Nl:"function"!=typeof e&&(e=ao.format(e));var r=Math.max(1,t*n/o.ticks().length);return function(n){var o=n/u(Math.round(i(n)));return t-.5>o*t&&(o*=t),r>=o?e(n):""}},o.copy=function(){return ru(n.copy(),t,e,r)},Ji(o,n)}function iu(n,t,e){function r(t){return n(i(t))}var i=uu(t),u=uu(1/t);return r.invert=function(t){return u(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(i)),r):e},r.ticks=function(n){return Qi(e,n)},r.tickFormat=function(n,t){return nu(e,n,t)},r.nice=function(n){return r.domain(Gi(e,n))},r.exponent=function(o){return arguments.length?(i=uu(t=o),u=uu(1/t),n.domain(e.map(i)),r):t},r.copy=function(){return iu(n.copy(),t,e)},Ji(r,n)}function uu(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ou(n,t){function e(e){return u[((i.get(e)||("range"===t.t?i.set(e,n.push(e)):NaN))-1)%u.length]}function r(t,e){return ao.range(n.length).map(function(n){return t+e*n})}var i,u,o;return e.domain=function(r){if(!arguments.length)return n;n=[],i=new c;for(var u,o=-1,a=r.length;++o<a;)i.has(u=r[o])||i.set(u,n.push(u));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(u=n,o=0,t={t:"range",a:arguments},e):u},e.rangePoints=function(i,a){arguments.length<2&&(a=0);var l=i[0],c=i[1],f=n.length<2?(l=(l+c)/2,0):(c-l)/(n.length-1+a);return u=r(l+f*a/2,f),o=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(i,a){arguments.length<2&&(a=0);var l=i[0],c=i[1],f=n.length<2?(l=c=Math.round((l+c)/2),0):(c-l)/(n.length-1+a)|0;return u=r(l+Math.round(f*a/2+(c-l-(n.length-1+a)*f)/2),f),o=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(i,a,l){arguments.length<2&&(a=0),arguments.length<3&&(l=a);var c=i[1]<i[0],f=i[c-0],s=i[1-c],h=(s-f)/(n.length-a+2*l);return u=r(f+h*l,h),c&&u.reverse(),o=h*(1-a),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(i,a,l){arguments.length<2&&(a=0),arguments.length<3&&(l=a);var c=i[1]<i[0],f=i[c-0],s=i[1-c],h=Math.floor((s-f)/(n.length-a+2*l));return u=r(f+Math.round((s-f-(n.length-a)*h)/2),h),c&&u.reverse(),o=Math.round(h*(1-a)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return Yi(t.a[0])},e.copy=function(){return ou(n,t)},e.domain(n)}function au(n,t){function u(){var e=0,r=t.length;for(a=[];++e<r;)a[e-1]=ao.quantile(n,e/r);return o}function o(n){return isNaN(n=+n)?void 0:t[ao.bisect(a,n)]}var a;return o.domain=function(t){return arguments.length?(n=t.map(r).filter(i).sort(e),u()):n},o.range=function(n){return arguments.length?(t=n,u()):t},o.quantiles=function(){return a},o.invertExtent=function(e){return e=t.indexOf(e),0>e?[NaN,NaN]:[e>0?a[e-1]:n[0],e<a.length?a[e]:n[n.length-1]]},o.copy=function(){return au(n,t)},u()}function lu(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(u*(t-n))))]}function i(){return u=e.length/(t-n),o=e.length-1,r}var u,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],i()):[n,t]},r.range=function(n){return arguments.length?(e=n,i()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?NaN:t/u+n,[t,t+1/u]},r.copy=function(){return lu(n,t,e)},i()}function cu(n,t){function e(e){return e>=e?t[ao.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return cu(n,t)},e}function fu(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qi(n,t)},t.tickFormat=function(t,e){return nu(n,t,e)},t.copy=function(){return fu(n)},t}function su(){return 0}function hu(n){return n.innerRadius}function pu(n){return n.outerRadius}function gu(n){return n.startAngle}function vu(n){return n.endAngle}function du(n){return n&&n.padAngle}function yu(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function mu(n,t,e,r,i){var u=n[0]-t[0],o=n[1]-t[1],a=(i?r:-r)/Math.sqrt(u*u+o*o),l=a*o,c=-a*u,f=n[0]+l,s=n[1]+c,h=t[0]+l,p=t[1]+c,g=(f+h)/2,v=(s+p)/2,d=h-f,y=p-s,m=d*d+y*y,M=e-r,x=f*p-h*s,b=(0>y?-1:1)*Math.sqrt(Math.max(0,M*M*m-x*x)),_=(x*y-d*b)/m,w=(-x*d-y*b)/m,S=(x*y+d*b)/m,k=(-x*d+y*b)/m,N=_-g,E=w-v,A=S-g,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mu(n){function t(t){function o(){c.push("M",u(n(f),a))}for(var l,c=[],f=[],s=-1,h=t.length,p=En(e),g=En(r);++s<h;)i.call(this,l=t[s],s)?f.push([+p.call(this,l,s),+g.call(this,l,s)]):f.length&&(o(),f=[]);return f.length&&o(),c.length?c.join(""):null}var e=Ce,r=ze,i=zt,u=xu,o=u.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(i=n,t):i},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?u=n:(u=Tl.get(n)||xu).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function xu(n){return n.length>1?n.join("L"):n+"Z"}function bu(n){return n.join("L")+"Z"}function _u(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&i.push("H",r[0]),i.join("")}function wu(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("V",(r=n[t])[1],"H",r[0]);return i.join("")}function Su(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("H",(r=n[t])[0],"V",r[1]);return i.join("")}function ku(n,t){return n.length<4?xu(n):n[1]+Au(n.slice(1,-1),Cu(n,t))}function Nu(n,t){return n.length<3?bu(n):n[0]+Au((n.push(n[0]),n),Cu([n[n.length-2]].concat(n,[n[1]]),t))}function Eu(n,t){return n.length<3?xu(n):n[0]+Au(n,Cu(n,t))}function Au(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return xu(n);var e=n.length!=t.length,r="",i=n[0],u=n[1],o=t[0],a=o,l=1;if(e&&(r+="Q"+(u[0]-2*o[0]/3)+","+(u[1]-2*o[1]/3)+","+u[0]+","+u[1],i=n[1],l=2),t.length>1){a=t[1],u=n[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var c=2;c<t.length;c++,l++)u=n[l],a=t[c],r+="S"+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1]}if(e){var f=n[l];r+="Q"+(u[0]+2*a[0]/3)+","+(u[1]+2*a[1]/3)+","+f[0]+","+f[1]}return r}function Cu(n,t){for(var e,r=[],i=(1-t)/2,u=n[0],o=n[1],a=1,l=n.length;++a<l;)e=u,u=o,o=n[a],r.push([i*(o[0]-e[0]),i*(o[1]-e[1])]);return r}function zu(n){if(n.length<3)return xu(n);var t=1,e=n.length,r=n[0],i=r[0],u=r[1],o=[i,i,i,(r=n[1])[0]],a=[u,u,u,r[1]],l=[i,",",u,"L",Ru(Pl,o),",",Ru(Pl,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),Du(l,o,a);return n.pop(),l.push("L",r),l.join("")}function Lu(n){if(n.length<4)return xu(n);for(var t,e=[],r=-1,i=n.length,u=[0],o=[0];++r<3;)t=n[r],u.push(t[0]),o.push(t[1]);for(e.push(Ru(Pl,u)+","+Ru(Pl,o)),--r;++r<i;)t=n[r],u.shift(),u.push(t[0]),o.shift(),o.push(t[1]),Du(e,u,o);return e.join("")}function qu(n){for(var t,e,r=-1,i=n.length,u=i+4,o=[],a=[];++r<4;)e=n[r%i],o.push(e[0]),a.push(e[1]);for(t=[Ru(Pl,o),",",Ru(Pl,a)],--r;++r<u;)e=n[r%i],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Du(t,o,a);return t.join("")}function Tu(n,t){var e=n.length-1;if(e)for(var r,i,u=n[0][0],o=n[0][1],a=n[e][0]-u,l=n[e][1]-o,c=-1;++c<=e;)r=n[c],i=c/e,r[0]=t*r[0]+(1-t)*(u+i*a),r[1]=t*r[1]+(1-t)*(o+i*l);return zu(n)}function Ru(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Du(n,t,e){n.push("C",Ru(Rl,t),",",Ru(Rl,e),",",Ru(Dl,t),",",Ru(Dl,e),",",Ru(Pl,t),",",Ru(Pl,e))}function Pu(n,t){return(t[1]-n[1])/(t[0]-n[0])}function Uu(n){for(var t=0,e=n.length-1,r=[],i=n[0],u=n[1],o=r[0]=Pu(i,u);++t<e;)r[t]=(o+(o=Pu(i=u,u=n[t+1])))/2;return r[t]=o,r}function ju(n){for(var t,e,r,i,u=[],o=Uu(n),a=-1,l=n.length-1;++a<l;)t=Pu(n[a],n[a+1]),xo(t)<Uo?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,i=e*e+r*r,i>9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));for(a=-1;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}function Fu(n){return n.length<3?xu(n):n[0]+Au(n,ju(n))}function Hu(n){for(var t,e,r,i=-1,u=n.length;++i<u;)t=n[i],e=t[0],r=t[1]-Io,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Ou(n){function t(t){function l(){v.push("M",a(n(y),s),f,c(n(d.reverse()),s),"Z")}for(var h,p,g,v=[],d=[],y=[],m=-1,M=t.length,x=En(e),b=En(i),_=e===r?function(){
-return p}:En(r),w=i===u?function(){return g}:En(u);++m<M;)o.call(this,h=t[m],m)?(d.push([p=+x.call(this,h,m),g=+b.call(this,h,m)]),y.push([+_.call(this,h,m),+w.call(this,h,m)])):d.length&&(l(),d=[],y=[]);return d.length&&l(),v.length?v.join(""):null}var e=Ce,r=Ce,i=0,u=ze,o=zt,a=xu,l=a.key,c=a,f="L",s=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(i=u=n,t):u},t.y0=function(n){return arguments.length?(i=n,t):i},t.y1=function(n){return arguments.length?(u=n,t):u},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(l="function"==typeof n?a=n:(a=Tl.get(n)||xu).key,c=a.reverse||a,f=a.closed?"M":"L",t):l},t.tension=function(n){return arguments.length?(s=n,t):s},t}function Iu(n){return n.radius}function Yu(n){return[n.x,n.y]}function Zu(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Io;return[e*Math.cos(r),e*Math.sin(r)]}}function Vu(){return 64}function Xu(){return"circle"}function $u(n){var t=Math.sqrt(n/Fo);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Bu(n){return function(){var t,e,r;(t=this[n])&&(r=t[e=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[e]:delete this[n],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Wu(n,t,e){return ko(n,Yl),n.namespace=t,n.id=e,n}function Ju(n,t,e,r){var i=n.id,u=n.namespace;return Y(n,"function"==typeof e?function(n,o,a){n[u][i].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[u][i].tween.set(t,e)}))}function Gu(n){return null==n&&(n=""),function(){this.textContent=n}}function Ku(n){return null==n?"__transition__":"__transition_"+n+"__"}function Qu(n,t,e,r,i){function u(n){var t=v.delay;return f.t=t+l,n>=t?o(n-t):void(f.c=o)}function o(e){var i=g.active,u=g[i];u&&(u.timer.c=null,u.timer.t=NaN,--g.count,delete g[i],u.event&&u.event.interrupt.call(n,n.__data__,u.index));for(var o in g)if(r>+o){var c=g[o];c.timer.c=null,c.timer.t=NaN,--g.count,delete g[o]}f.c=a,qn(function(){return f.c&&a(e||1)&&(f.c=null,f.t=NaN),1},0,l),g.active=r,v.event&&v.event.start.call(n,n.__data__,t),p=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&p.push(r)}),h=v.ease,s=v.duration}function a(i){for(var u=i/s,o=h(u),a=p.length;a>0;)p[--a].call(n,o);return u>=1?(v.event&&v.event.end.call(n,n.__data__,t),--g.count?delete g[r]:delete n[e],1):void 0}var l,f,s,h,p,g=n[e]||(n[e]={active:0,count:0}),v=g[r];v||(l=i.time,f=qn(u,0,l),v=g[r]={tween:new c,time:l,timer:f,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++g.count)}function no(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function to(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function eo(n){return n.toISOString()}function ro(n,t,e){function r(t){return n(t)}function i(n,e){var r=n[1]-n[0],i=r/e,u=ao.bisect(Kl,i);return u==Kl.length?[t.year,Ki(n.map(function(n){return n/31536e6}),e)[2]]:u?t[i/Kl[u-1]<Kl[u]/i?u-1:u]:[tc,Ki(n,e)[2]]}return r.invert=function(t){return io(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(io)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,io(+e+1),t).length}var u=r.domain(),o=Yi(u),a=null==n?i(o,10):"number"==typeof n&&i(o,n);return a&&(n=a[0],t=a[1]),r.domain(Xi(u,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=io(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=io(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yi(r.domain()),u=null==n?i(e,10):"number"==typeof n?i(e,n):!n.range&&[{range:n},t];return u&&(n=u[0],t=u[1]),n.range(e[0],io(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ro(n.copy(),t,e)},Ji(r,n)}function io(n){return new Date(n)}function uo(n){return JSON.parse(n.responseText)}function oo(n){var t=fo.createRange();return t.selectNode(fo.body),t.createContextualFragment(n.responseText)}var ao={version:"3.5.17"},lo=[].slice,co=function(n){return lo.call(n)},fo=this.document;if(fo)try{co(fo.documentElement.childNodes)[0].nodeType}catch(so){co=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(ho){var po=this.Element.prototype,go=po.setAttribute,vo=po.setAttributeNS,yo=this.CSSStyleDeclaration.prototype,mo=yo.setProperty;po.setAttribute=function(n,t){go.call(this,n,t+"")},po.setAttributeNS=function(n,t,e){vo.call(this,n,t,e+"")},yo.setProperty=function(n,t,e){mo.call(this,n,t+"",e)}}ao.ascending=e,ao.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},ao.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i<u;)if(null!=(r=n[i])&&r>=r){e=r;break}for(;++i<u;)null!=(r=n[i])&&e>r&&(e=r)}else{for(;++i<u;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=r;break}for(;++i<u;)null!=(r=t.call(n,n[i],i))&&e>r&&(e=r)}return e},ao.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i<u;)if(null!=(r=n[i])&&r>=r){e=r;break}for(;++i<u;)null!=(r=n[i])&&r>e&&(e=r)}else{for(;++i<u;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=r;break}for(;++i<u;)null!=(r=t.call(n,n[i],i))&&r>e&&(e=r)}return e},ao.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u<o;)if(null!=(r=n[u])&&r>=r){e=i=r;break}for(;++u<o;)null!=(r=n[u])&&(e>r&&(e=r),r>i&&(i=r))}else{for(;++u<o;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=i=r;break}for(;++u<o;)null!=(r=t.call(n,n[u],u))&&(e>r&&(e=r),r>i&&(i=r))}return[e,i]},ao.sum=function(n,t){var e,r=0,u=n.length,o=-1;if(1===arguments.length)for(;++o<u;)i(e=+n[o])&&(r+=e);else for(;++o<u;)i(e=+t.call(n,n[o],o))&&(r+=e);return r},ao.mean=function(n,t){var e,u=0,o=n.length,a=-1,l=o;if(1===arguments.length)for(;++a<o;)i(e=r(n[a]))?u+=e:--l;else for(;++a<o;)i(e=r(t.call(n,n[a],a)))?u+=e:--l;return l?u/l:void 0},ao.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),i=+n[r-1],u=e-r;return u?i+u*(n[r]-i):i},ao.median=function(n,t){var u,o=[],a=n.length,l=-1;if(1===arguments.length)for(;++l<a;)i(u=r(n[l]))&&o.push(u);else for(;++l<a;)i(u=r(t.call(n,n[l],l)))&&o.push(u);return o.length?ao.quantile(o.sort(e),.5):void 0},ao.variance=function(n,t){var e,u,o=n.length,a=0,l=0,c=-1,f=0;if(1===arguments.length)for(;++c<o;)i(e=r(n[c]))&&(u=e-a,a+=u/++f,l+=u*(e-a));else for(;++c<o;)i(e=r(t.call(n,n[c],c)))&&(u=e-a,a+=u/++f,l+=u*(e-a));return f>1?l/(f-1):void 0},ao.deviation=function(){var n=ao.variance.apply(this,arguments);return n?Math.sqrt(n):n};var Mo=u(e);ao.bisectLeft=Mo.left,ao.bisect=ao.bisectRight=Mo.right,ao.bisector=function(n){return u(1===n.length?function(t,r){return e(n(t),r)}:n)},ao.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,2>u&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},ao.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ao.pairs=function(n){for(var t,e=0,r=n.length-1,i=n[0],u=new Array(0>r?0:r);r>e;)u[e]=[t=i,i=n[++e]];return u},ao.transpose=function(n){if(!(i=n.length))return[];for(var t=-1,e=ao.min(n,o),r=new Array(e);++t<e;)for(var i,u=-1,a=r[t]=new Array(i);++u<i;)a[u]=n[u][t];return r},ao.zip=function(){return ao.transpose(arguments)},ao.keys=function(n){var t=[];for(var e in n)t.push(e);return t},ao.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},ao.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},ao.merge=function(n){for(var t,e,r,i=n.length,u=-1,o=0;++u<i;)o+=n[u].length;for(e=new Array(o);--i>=0;)for(r=n[i],t=r.length;--t>=0;)e[--o]=r[t];return e};var xo=Math.abs;ao.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,i=[],u=a(xo(e)),o=-1;if(n*=u,t*=u,e*=u,0>e)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)<t;)i.push(r/u);return i},ao.map=function(n,t){var e=new c;if(n instanceof c)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,i=-1,u=n.length;if(1===arguments.length)for(;++i<u;)e.set(i,n[i]);else for(;++i<u;)e.set(t.call(n,r=n[i],i),r)}else for(var o in n)e.set(o,n[o]);return e};var bo="__proto__",_o="\x00";l(c,{has:h,get:function(n){return this._[f(n)]},set:function(n,t){return this._[f(n)]=t},remove:p,keys:g,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:s(t),value:this._[t]});return n},size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t),this._[t])}}),ao.nest=function(){function n(t,o,a){if(a>=u.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,f,s,h,p=-1,g=o.length,v=u[a++],d=new c;++p<g;)(h=d.get(l=v(f=o[p])))?h.push(f):d.set(l,[f]);return t?(f=t(),s=function(e,r){f.set(e,n(t,r,a))}):(f={},s=function(e,r){f[e]=n(t,r,a)}),d.forEach(s),f}function t(n,e){if(e>=u.length)return n;var r=[],i=o[e++];return n.forEach(function(n,i){r.push({key:n,values:t(i,e)})}),i?r.sort(function(n,t){return i(n.key,t.key)}):r}var e,r,i={},u=[],o=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(ao.map,e,0),0)},i.key=function(n){return u.push(n),i},i.sortKeys=function(n){return o[u.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},ao.set=function(n){var t=new y;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(y,{has:h,add:function(n){return this._[f(n+="")]=!0,n},remove:p,values:g,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t))}}),ao.behavior={},ao.rebind=function(n,t){for(var e,r=1,i=arguments.length;++r<i;)n[e=arguments[r]]=M(n,t,t[e]);return n};var wo=["webkit","ms","moz","Moz","o","O"];ao.dispatch=function(){for(var n=new _,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=w(n);return n},_.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ao.event=null,ao.requote=function(n){return n.replace(So,"\\$&")};var So=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ko={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},No=function(n,t){return t.querySelector(n)},Eo=function(n,t){return t.querySelectorAll(n)},Ao=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ao=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(No=function(n,t){return Sizzle(n,t)[0]||null},Eo=Sizzle,Ao=Sizzle.matchesSelector),ao.selection=function(){return ao.select(fo.documentElement)};var Co=ao.selection.prototype=[];Co.select=function(n){var t,e,r,i,u=[];n=A(n);for(var o=-1,a=this.length;++o<a;){u.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var l=-1,c=r.length;++l<c;)(i=r[l])?(t.push(e=n.call(i,i.__data__,l,o)),e&&"__data__"in i&&(e.__data__=i.__data__)):t.push(null)}return E(u)},Co.selectAll=function(n){var t,e,r=[];n=C(n);for(var i=-1,u=this.length;++i<u;)for(var o=this[i],a=-1,l=o.length;++a<l;)(e=o[a])&&(r.push(t=co(n.call(e,e.__data__,a,i))),t.parentNode=e);return E(r)};var zo="http://www.w3.org/1999/xhtml",Lo={svg:"http://www.w3.org/2000/svg",xhtml:zo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ao.ns={prefix:Lo,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Lo.hasOwnProperty(e)?{space:Lo[e],local:n}:n}},Co.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ao.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Co.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,i=-1;if(t=e.classList){for(;++i<r;)if(!t.contains(n[i]))return!1}else for(t=e.getAttribute("class");++i<r;)if(!q(n[i]).test(t))return!1;return!0}for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},Co.style=function(n,e,r){var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>i){var u=this.node();return t(u).getComputedStyle(u,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Co.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},Co.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Co.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Co.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Co.insert=function(n,t){return n=j(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Co.remove=function(){return this.each(F)},Co.data=function(n,t){function e(n,e){var r,i,u,o=n.length,s=e.length,h=Math.min(o,s),p=new Array(s),g=new Array(s),v=new Array(o);if(t){var d,y=new c,m=new Array(o);for(r=-1;++r<o;)(i=n[r])&&(y.has(d=t.call(i,i.__data__,r))?v[r]=i:y.set(d,i),m[r]=d);for(r=-1;++r<s;)(i=y.get(d=t.call(e,u=e[r],r)))?i!==!0&&(p[r]=i,i.__data__=u):g[r]=H(u),y.set(d,!0);for(r=-1;++r<o;)r in m&&y.get(m[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)i=n[r],u=e[r],i?(i.__data__=u,p[r]=i):g[r]=H(u);for(;s>r;++r)g[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}g.update=p,g.parentNode=p.parentNode=v.parentNode=n.parentNode,a.push(g),l.push(p),f.push(v)}var r,i,u=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++u<o;)(i=r[u])&&(n[u]=i.__data__);return n}var a=Z([]),l=E([]),f=E([]);if("function"==typeof n)for(;++u<o;)e(r=this[u],n.call(r,r.parentNode.__data__,u));else for(;++u<o;)e(r=this[u],n);return l.enter=function(){return a},l.exit=function(){return f},l},Co.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},Co.filter=function(n){var t,e,r,i=[];"function"!=typeof n&&(n=O(n));for(var u=0,o=this.length;o>u;u++){i.push(t=[]),t.parentNode=(e=this[u]).parentNode;for(var a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return E(i)},Co.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],i=r.length-1,u=r[i];--i>=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},Co.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},Co.each=function(n){return Y(this,function(t,e,r){n.call(t,t.__data__,e,r)})},Co.call=function(n){var t=co(arguments);return n.apply(t[0]=this,t),this},Co.empty=function(){return!this.node()},Co.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,i=e.length;i>r;r++){var u=e[r];if(u)return u}return null},Co.size=function(){var n=0;return Y(this,function(){++n}),n};var qo=[];ao.selection.enter=Z,ao.selection.enter.prototype=qo,qo.append=Co.append,qo.empty=Co.empty,qo.node=Co.node,qo.call=Co.call,qo.size=Co.size,qo.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++a<l;){r=(i=this[a]).update,o.push(t=[]),t.parentNode=i.parentNode;for(var c=-1,f=i.length;++c<f;)(u=i[c])?(t.push(r[c]=e=n.call(i.parentNode,u.__data__,c,a)),e.__data__=u.__data__):t.push(null)}return E(o)},qo.insert=function(n,t){return arguments.length<2&&(t=V(this)),Co.insert.call(this,n,t)},ao.select=function(t){var e;return"string"==typeof t?(e=[No(t,fo)],e.parentNode=fo.documentElement):(e=[t],e.parentNode=n(t)),E([e])},ao.selectAll=function(n){var t;return"string"==typeof n?(t=co(Eo(n,fo)),t.parentNode=fo.documentElement):(t=co(n),t.parentNode=null),E([t])},Co.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var To=ao.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&To.forEach(function(n){"on"+n in fo&&To.remove(n)});var Ro,Do=0;ao.mouse=function(n){return J(n,k())};var Po=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ao.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,i=0,u=t.length;u>i;++i)if((r=t[i]).identifier===e)return J(n,r)},ao.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",o)}function e(n,t,e,u,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],g|=n|e,M=r,p({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(y.on(u+d,null).on(o+d,null),m(g),p({type:"dragend"}))}var c,f=this,s=ao.event.target.correspondingElement||ao.event.target,h=f.parentNode,p=r.of(f,arguments),g=0,v=n(),d=".drag"+(null==v?"":"-"+v),y=ao.select(e(s)).on(u+d,a).on(o+d,l),m=W(s),M=t(h,v);i?(c=i.apply(f,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],p({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),i=null,u=e(b,ao.mouse,t,"mousemove","mouseup"),o=e(G,ao.touch,m,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},ao.rebind(n,r,"on")},ao.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?co(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Uo=1e-6,jo=Uo*Uo,Fo=Math.PI,Ho=2*Fo,Oo=Ho-Uo,Io=Fo/2,Yo=Fo/180,Zo=180/Fo,Vo=Math.SQRT2,Xo=2,$o=4;ao.interpolateZoom=function(n,t){var e,r,i=n[0],u=n[1],o=n[2],a=t[0],l=t[1],c=t[2],f=a-i,s=l-u,h=f*f+s*s;if(jo>h)r=Math.log(c/o)/Vo,e=function(n){return[i+n*f,u+n*s,o*Math.exp(Vo*n*r)]};else{var p=Math.sqrt(h),g=(c*c-o*o+$o*h)/(2*o*Xo*p),v=(c*c-o*o-$o*h)/(2*c*Xo*p),d=Math.log(Math.sqrt(g*g+1)-g),y=Math.log(Math.sqrt(v*v+1)-v);r=(y-d)/Vo,e=function(n){var t=n*r,e=rn(d),a=o/(Xo*p)*(e*un(Vo*t+d)-en(d));return[i+a*f,u+a*s,o*e/rn(Vo*t+d)]}}return e.duration=1e3*r,e},ao.behavior.zoom=function(){function n(n){n.on(L,s).on(Wo+".zoom",p).on("dblclick.zoom",g).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function i(n){k.k=Math.max(A[0],Math.min(A[1],n))}function u(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),u(d=e,r),t=ao.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function f(n){--z||(n({type:"zoomend"}),d=null)}function s(){function n(){a=1,u(ao.mouse(i),h),c(o)}function r(){s.on(q,null).on(T,null),p(a),f(o)}var i=this,o=D.of(i,arguments),a=0,s=ao.select(t(i)).on(q,n).on(T,r),h=e(ao.mouse(i)),p=W(i);Il.call(i),l(o)}function h(){function n(){var n=ao.touches(g);return p=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ao.event.target;ao.select(t).on(x,r).on(b,a),_.push(t);for(var e=ao.event.changedTouches,i=0,u=e.length;u>i;++i)d[e[i].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var f=l[0];o(g,f,d[f.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var f=l[0],s=l[1],h=f[0]-s[0],p=f[1]-s[1];y=h*h+p*p}}function r(){var n,t,e,r,o=ao.touches(g);Il.call(g);for(var a=0,l=o.length;l>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var f=(f=e[0]-n[0])*f+(f=e[1]-n[1])*f,s=y&&Math.sqrt(f/y);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],i(s*p)}M=null,u(n,t),c(v)}function a(){if(ao.event.touches.length){for(var t=ao.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var i in d)return void n()}ao.selectAll(_).on(m,null),w.on(L,s).on(R,h),N(),f(v)}var p,g=this,v=D.of(g,arguments),d={},y=0,m=".zoom-"+ao.event.changedTouches[0].identifier,x="touchmove"+m,b="touchend"+m,_=[],w=ao.select(g),N=W(g);t(),l(v),w.on(L,null).on(R,t)}function p(){var n=D.of(this,arguments);m?clearTimeout(m):(Il.call(this),v=e(d=y||ao.mouse(this)),l(n)),m=setTimeout(function(){m=null,f(n)},50),S(),i(Math.pow(2,.002*Bo())*k.k),u(d,v),c(n)}function g(){var n=ao.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ao.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,y,m,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Jo,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return Wo||(Wo="onwheel"in fo?(Bo=function(){return-ao.event.deltaY*(ao.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Bo=function(){return ao.event.wheelDelta},"mousewheel"):(Bo=function(){return-ao.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Hl?ao.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],i=d?d[0]:e/2,u=d?d[1]:r/2,o=ao.interpolateZoom([(i-k.x)/k.k,(u-k.y)/k.k,e/k.k],[(i-t.x)/t.k,(u-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:i-r[0]*a,y:u-r[1]*a,k:a},c(n)}}).each("interrupt.zoom",function(){f(n)}).each("end.zoom",function(){f(n)}):(this.__chart__=k,l(n),c(n),f(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},i(+t),a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Jo:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(y=t&&[+t[0],+t[1]],n):y},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ao.rebind(n,D,"on")};var Bo,Wo,Jo=[0,1/0];ao.color=an,an.prototype.toString=function(){return this.rgb()+""},ao.hsl=ln;var Go=ln.prototype=new an;Go.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Go.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Go.rgb=function(){return cn(this.h,this.s,this.l)},ao.hcl=fn;var Ko=fn.prototype=new an;Ko.brighter=function(n){return new fn(this.h,this.c,Math.min(100,this.l+Qo*(arguments.length?n:1)))},Ko.darker=function(n){return new fn(this.h,this.c,Math.max(0,this.l-Qo*(arguments.length?n:1)))},Ko.rgb=function(){return sn(this.h,this.c,this.l).rgb()},ao.lab=hn;var Qo=18,na=.95047,ta=1,ea=1.08883,ra=hn.prototype=new an;ra.brighter=function(n){return new hn(Math.min(100,this.l+Qo*(arguments.length?n:1)),this.a,this.b)},ra.darker=function(n){return new hn(Math.max(0,this.l-Qo*(arguments.length?n:1)),this.a,this.b)},ra.rgb=function(){return pn(this.l,this.a,this.b)},ao.rgb=mn;var ia=mn.prototype=new an;ia.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,i=30;return t||e||r?(t&&i>t&&(t=i),e&&i>e&&(e=i),r&&i>r&&(r=i),new mn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mn(i,i,i)},ia.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mn(n*this.r,n*this.g,n*this.b)},ia.hsl=function(){return wn(this.r,this.g,this.b)},ia.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ua=ao.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ua.forEach(function(n,t){ua.set(n,Mn(t))}),ao.functor=En,ao.xhr=An(m),ao.dsv=function(n,t){function e(n,e,u){arguments.length<3&&(u=e,e=null);var o=Cn(n,t,null==e?r:i(e),u);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:i(n)):e},o}function r(n){return e.parse(n.responseText)}function i(n){return function(t){return e.parse(t.responseText,n)}}function u(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(i(n),e)}:i})},e.parseRows=function(n,t){function e(){if(f>=c)return o;if(i)return i=!1,u;var t=f;if(34===n.charCodeAt(t)){for(var e=t;e++<c;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}f=e+2;var r=n.charCodeAt(e+1);return 13===r?(i=!0,10===n.charCodeAt(e+2)&&++f):10===r&&(i=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;c>f;){var r=n.charCodeAt(f++),a=1;if(10===r)i=!0;else if(13===r)i=!0,10===n.charCodeAt(f)&&(++f,++a);else if(r!==l)continue;return n.slice(t,f-a)}return n.slice(t)}for(var r,i,u={},o={},a=[],c=n.length,f=0,s=0;(r=e())!==o;){for(var h=[];r!==u&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,s++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new y,i=[];return t.forEach(function(n){for(var t in n)r.has(t)||i.push(r.add(t))}),[i.map(o).join(n)].concat(t.map(function(t){return i.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(u).join("\n")},e},ao.csv=ao.dsv(",","text/csv"),ao.tsv=ao.dsv("	","text/tab-separated-values");var oa,aa,la,ca,fa=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ao.timer=function(){qn.apply(this,arguments)},ao.timer.flush=function(){Rn(),Dn()},ao.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var sa=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Un);ao.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=ao.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),sa[8+e/3]};var ha=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,pa=ao.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ao.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ga=ao.time={},va=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){da.setUTCDate.apply(this._,arguments)},setDay:function(){da.setUTCDay.apply(this._,arguments)},setFullYear:function(){da.setUTCFullYear.apply(this._,arguments)},setHours:function(){da.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){da.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){da.setUTCMinutes.apply(this._,arguments)},setMonth:function(){da.setUTCMonth.apply(this._,arguments)},setSeconds:function(){da.setUTCSeconds.apply(this._,arguments)},setTime:function(){da.setTime.apply(this._,arguments)}};var da=Date.prototype;ga.year=On(function(n){return n=ga.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ga.years=ga.year.range,ga.years.utc=ga.year.utc.range,ga.day=On(function(n){var t=new va(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ga.days=ga.day.range,ga.days.utc=ga.day.utc.range,ga.dayOfYear=function(n){var t=ga.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ga[n]=On(function(n){return(n=ga.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ga[n+"s"]=e.range,ga[n+"s"].utc=e.utc.range,ga[n+"OfYear"]=function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)}}),ga.week=ga.sunday,ga.weeks=ga.sunday.range,ga.weeks.utc=ga.sunday.utc.range,ga.weekOfYear=ga.sundayOfYear;var ya={"-":"",_:" ",0:"0"},ma=/^\s*\d+/,Ma=/^%/;ao.locale=function(n){return{numberFormat:jn(n),timeFormat:Yn(n)}};var xa=ao.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
+return p}:En(r),w=i===u?function(){return g}:En(u);++m<M;)o.call(this,h=t[m],m)?(d.push([p=+x.call(this,h,m),g=+b.call(this,h,m)]),y.push([+_.call(this,h,m),+w.call(this,h,m)])):d.length&&(l(),d=[],y=[]);return d.length&&l(),v.length?v.join(""):null}var e=Ce,r=Ce,i=0,u=ze,o=zt,a=xu,l=a.key,c=a,f="L",s=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(i=u=n,t):u},t.y0=function(n){return arguments.length?(i=n,t):i},t.y1=function(n){return arguments.length?(u=n,t):u},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(l="function"==typeof n?a=n:(a=Tl.get(n)||xu).key,c=a.reverse||a,f=a.closed?"M":"L",t):l},t.tension=function(n){return arguments.length?(s=n,t):s},t}function Iu(n){return n.radius}function Yu(n){return[n.x,n.y]}function Zu(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Io;return[e*Math.cos(r),e*Math.sin(r)]}}function Vu(){return 64}function Xu(){return"circle"}function $u(n){var t=Math.sqrt(n/Fo);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Bu(n){return function(){var t,e,r;(t=this[n])&&(r=t[e=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[e]:delete this[n],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Wu(n,t,e){return ko(n,Yl),n.namespace=t,n.id=e,n}function Ju(n,t,e,r){var i=n.id,u=n.namespace;return Y(n,"function"==typeof e?function(n,o,a){n[u][i].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[u][i].tween.set(t,e)}))}function Gu(n){return null==n&&(n=""),function(){this.textContent=n}}function Ku(n){return null==n?"__transition__":"__transition_"+n+"__"}function Qu(n,t,e,r,i){function u(n){var t=v.delay;return f.t=t+l,n>=t?o(n-t):void(f.c=o)}function o(e){var i=g.active,u=g[i];u&&(u.timer.c=null,u.timer.t=NaN,--g.count,delete g[i],u.event&&u.event.interrupt.call(n,n.__data__,u.index));for(var o in g)if(r>+o){var c=g[o];c.timer.c=null,c.timer.t=NaN,--g.count,delete g[o]}f.c=a,qn(function(){return f.c&&a(e||1)&&(f.c=null,f.t=NaN),1},0,l),g.active=r,v.event&&v.event.start.call(n,n.__data__,t),p=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&p.push(r)}),h=v.ease,s=v.duration}function a(i){for(var u=i/s,o=h(u),a=p.length;a>0;)p[--a].call(n,o);return u>=1?(v.event&&v.event.end.call(n,n.__data__,t),--g.count?delete g[r]:delete n[e],1):void 0}var l,f,s,h,p,g=n[e]||(n[e]={active:0,count:0}),v=g[r];v||(l=i.time,f=qn(u,0,l),v=g[r]={tween:new c,time:l,timer:f,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++g.count)}function no(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function to(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function eo(n){return n.toISOString()}function ro(n,t,e){function r(t){return n(t)}function i(n,e){var r=n[1]-n[0],i=r/e,u=ao.bisect(Kl,i);return u==Kl.length?[t.year,Ki(n.map(function(n){return n/31536e6}),e)[2]]:u?t[i/Kl[u-1]<Kl[u]/i?u-1:u]:[tc,Ki(n,e)[2]]}return r.invert=function(t){return io(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(io)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,io(+e+1),t).length}var u=r.domain(),o=Yi(u),a=null==n?i(o,10):"number"==typeof n&&i(o,n);return a&&(n=a[0],t=a[1]),r.domain(Xi(u,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=io(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=io(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yi(r.domain()),u=null==n?i(e,10):"number"==typeof n?i(e,n):!n.range&&[{range:n},t];return u&&(n=u[0],t=u[1]),n.range(e[0],io(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ro(n.copy(),t,e)},Ji(r,n)}function io(n){return new Date(n)}function uo(n){return JSON.parse(n.responseText)}function oo(n){var t=fo.createRange();return t.selectNode(fo.body),t.createContextualFragment(n.responseText)}var ao={version:"3.5.16"},lo=[].slice,co=function(n){return lo.call(n)},fo=this.document;if(fo)try{co(fo.documentElement.childNodes)[0].nodeType}catch(so){co=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(ho){var po=this.Element.prototype,go=po.setAttribute,vo=po.setAttributeNS,yo=this.CSSStyleDeclaration.prototype,mo=yo.setProperty;po.setAttribute=function(n,t){go.call(this,n,t+"")},po.setAttributeNS=function(n,t,e){vo.call(this,n,t,e+"")},yo.setProperty=function(n,t,e){mo.call(this,n,t+"",e)}}ao.ascending=e,ao.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},ao.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i<u;)if(null!=(r=n[i])&&r>=r){e=r;break}for(;++i<u;)null!=(r=n[i])&&e>r&&(e=r)}else{for(;++i<u;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=r;break}for(;++i<u;)null!=(r=t.call(n,n[i],i))&&e>r&&(e=r)}return e},ao.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i<u;)if(null!=(r=n[i])&&r>=r){e=r;break}for(;++i<u;)null!=(r=n[i])&&r>e&&(e=r)}else{for(;++i<u;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=r;break}for(;++i<u;)null!=(r=t.call(n,n[i],i))&&r>e&&(e=r)}return e},ao.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u<o;)if(null!=(r=n[u])&&r>=r){e=i=r;break}for(;++u<o;)null!=(r=n[u])&&(e>r&&(e=r),r>i&&(i=r))}else{for(;++u<o;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=i=r;break}for(;++u<o;)null!=(r=t.call(n,n[u],u))&&(e>r&&(e=r),r>i&&(i=r))}return[e,i]},ao.sum=function(n,t){var e,r=0,u=n.length,o=-1;if(1===arguments.length)for(;++o<u;)i(e=+n[o])&&(r+=e);else for(;++o<u;)i(e=+t.call(n,n[o],o))&&(r+=e);return r},ao.mean=function(n,t){var e,u=0,o=n.length,a=-1,l=o;if(1===arguments.length)for(;++a<o;)i(e=r(n[a]))?u+=e:--l;else for(;++a<o;)i(e=r(t.call(n,n[a],a)))?u+=e:--l;return l?u/l:void 0},ao.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),i=+n[r-1],u=e-r;return u?i+u*(n[r]-i):i},ao.median=function(n,t){var u,o=[],a=n.length,l=-1;if(1===arguments.length)for(;++l<a;)i(u=r(n[l]))&&o.push(u);else for(;++l<a;)i(u=r(t.call(n,n[l],l)))&&o.push(u);return o.length?ao.quantile(o.sort(e),.5):void 0},ao.variance=function(n,t){var e,u,o=n.length,a=0,l=0,c=-1,f=0;if(1===arguments.length)for(;++c<o;)i(e=r(n[c]))&&(u=e-a,a+=u/++f,l+=u*(e-a));else for(;++c<o;)i(e=r(t.call(n,n[c],c)))&&(u=e-a,a+=u/++f,l+=u*(e-a));return f>1?l/(f-1):void 0},ao.deviation=function(){var n=ao.variance.apply(this,arguments);return n?Math.sqrt(n):n};var Mo=u(e);ao.bisectLeft=Mo.left,ao.bisect=ao.bisectRight=Mo.right,ao.bisector=function(n){return u(1===n.length?function(t,r){return e(n(t),r)}:n)},ao.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,2>u&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},ao.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ao.pairs=function(n){for(var t,e=0,r=n.length-1,i=n[0],u=new Array(0>r?0:r);r>e;)u[e]=[t=i,i=n[++e]];return u},ao.transpose=function(n){if(!(i=n.length))return[];for(var t=-1,e=ao.min(n,o),r=new Array(e);++t<e;)for(var i,u=-1,a=r[t]=new Array(i);++u<i;)a[u]=n[u][t];return r},ao.zip=function(){return ao.transpose(arguments)},ao.keys=function(n){var t=[];for(var e in n)t.push(e);return t},ao.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},ao.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},ao.merge=function(n){for(var t,e,r,i=n.length,u=-1,o=0;++u<i;)o+=n[u].length;for(e=new Array(o);--i>=0;)for(r=n[i],t=r.length;--t>=0;)e[--o]=r[t];return e};var xo=Math.abs;ao.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,i=[],u=a(xo(e)),o=-1;if(n*=u,t*=u,e*=u,0>e)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)<t;)i.push(r/u);return i},ao.map=function(n,t){var e=new c;if(n instanceof c)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,i=-1,u=n.length;if(1===arguments.length)for(;++i<u;)e.set(i,n[i]);else for(;++i<u;)e.set(t.call(n,r=n[i],i),r)}else for(var o in n)e.set(o,n[o]);return e};var bo="__proto__",_o="\x00";l(c,{has:h,get:function(n){return this._[f(n)]},set:function(n,t){return this._[f(n)]=t},remove:p,keys:g,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:s(t),value:this._[t]});return n},size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t),this._[t])}}),ao.nest=function(){function n(t,o,a){if(a>=u.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,f,s,h,p=-1,g=o.length,v=u[a++],d=new c;++p<g;)(h=d.get(l=v(f=o[p])))?h.push(f):d.set(l,[f]);return t?(f=t(),s=function(e,r){f.set(e,n(t,r,a))}):(f={},s=function(e,r){f[e]=n(t,r,a)}),d.forEach(s),f}function t(n,e){if(e>=u.length)return n;var r=[],i=o[e++];return n.forEach(function(n,i){r.push({key:n,values:t(i,e)})}),i?r.sort(function(n,t){return i(n.key,t.key)}):r}var e,r,i={},u=[],o=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(ao.map,e,0),0)},i.key=function(n){return u.push(n),i},i.sortKeys=function(n){return o[u.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},ao.set=function(n){var t=new y;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(y,{has:h,add:function(n){return this._[f(n+="")]=!0,n},remove:p,values:g,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t))}}),ao.behavior={},ao.rebind=function(n,t){for(var e,r=1,i=arguments.length;++r<i;)n[e=arguments[r]]=M(n,t,t[e]);return n};var wo=["webkit","ms","moz","Moz","o","O"];ao.dispatch=function(){for(var n=new _,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=w(n);return n},_.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ao.event=null,ao.requote=function(n){return n.replace(So,"\\$&")};var So=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ko={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},No=function(n,t){return t.querySelector(n)},Eo=function(n,t){return t.querySelectorAll(n)},Ao=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ao=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(No=function(n,t){return Sizzle(n,t)[0]||null},Eo=Sizzle,Ao=Sizzle.matchesSelector),ao.selection=function(){return ao.select(fo.documentElement)};var Co=ao.selection.prototype=[];Co.select=function(n){var t,e,r,i,u=[];n=A(n);for(var o=-1,a=this.length;++o<a;){u.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var l=-1,c=r.length;++l<c;)(i=r[l])?(t.push(e=n.call(i,i.__data__,l,o)),e&&"__data__"in i&&(e.__data__=i.__data__)):t.push(null)}return E(u)},Co.selectAll=function(n){var t,e,r=[];n=C(n);for(var i=-1,u=this.length;++i<u;)for(var o=this[i],a=-1,l=o.length;++a<l;)(e=o[a])&&(r.push(t=co(n.call(e,e.__data__,a,i))),t.parentNode=e);return E(r)};var zo="http://www.w3.org/1999/xhtml",Lo={svg:"http://www.w3.org/2000/svg",xhtml:zo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ao.ns={prefix:Lo,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Lo.hasOwnProperty(e)?{space:Lo[e],local:n}:n}},Co.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ao.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Co.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,i=-1;if(t=e.classList){for(;++i<r;)if(!t.contains(n[i]))return!1}else for(t=e.getAttribute("class");++i<r;)if(!q(n[i]).test(t))return!1;return!0}for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},Co.style=function(n,e,r){var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>i){var u=this.node();return t(u).getComputedStyle(u,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Co.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},Co.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Co.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Co.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Co.insert=function(n,t){return n=j(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Co.remove=function(){return this.each(F)},Co.data=function(n,t){function e(n,e){var r,i,u,o=n.length,s=e.length,h=Math.min(o,s),p=new Array(s),g=new Array(s),v=new Array(o);if(t){var d,y=new c,m=new Array(o);for(r=-1;++r<o;)(i=n[r])&&(y.has(d=t.call(i,i.__data__,r))?v[r]=i:y.set(d,i),m[r]=d);for(r=-1;++r<s;)(i=y.get(d=t.call(e,u=e[r],r)))?i!==!0&&(p[r]=i,i.__data__=u):g[r]=H(u),y.set(d,!0);for(r=-1;++r<o;)r in m&&y.get(m[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)i=n[r],u=e[r],i?(i.__data__=u,p[r]=i):g[r]=H(u);for(;s>r;++r)g[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}g.update=p,g.parentNode=p.parentNode=v.parentNode=n.parentNode,a.push(g),l.push(p),f.push(v)}var r,i,u=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++u<o;)(i=r[u])&&(n[u]=i.__data__);return n}var a=Z([]),l=E([]),f=E([]);if("function"==typeof n)for(;++u<o;)e(r=this[u],n.call(r,r.parentNode.__data__,u));else for(;++u<o;)e(r=this[u],n);return l.enter=function(){return a},l.exit=function(){return f},l},Co.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},Co.filter=function(n){var t,e,r,i=[];"function"!=typeof n&&(n=O(n));for(var u=0,o=this.length;o>u;u++){i.push(t=[]),t.parentNode=(e=this[u]).parentNode;for(var a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return E(i)},Co.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],i=r.length-1,u=r[i];--i>=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},Co.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},Co.each=function(n){return Y(this,function(t,e,r){n.call(t,t.__data__,e,r)})},Co.call=function(n){var t=co(arguments);return n.apply(t[0]=this,t),this},Co.empty=function(){return!this.node()},Co.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,i=e.length;i>r;r++){var u=e[r];if(u)return u}return null},Co.size=function(){var n=0;return Y(this,function(){++n}),n};var qo=[];ao.selection.enter=Z,ao.selection.enter.prototype=qo,qo.append=Co.append,qo.empty=Co.empty,qo.node=Co.node,qo.call=Co.call,qo.size=Co.size,qo.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++a<l;){r=(i=this[a]).update,o.push(t=[]),t.parentNode=i.parentNode;for(var c=-1,f=i.length;++c<f;)(u=i[c])?(t.push(r[c]=e=n.call(i.parentNode,u.__data__,c,a)),e.__data__=u.__data__):t.push(null)}return E(o)},qo.insert=function(n,t){return arguments.length<2&&(t=V(this)),Co.insert.call(this,n,t)},ao.select=function(t){var e;return"string"==typeof t?(e=[No(t,fo)],e.parentNode=fo.documentElement):(e=[t],e.parentNode=n(t)),E([e])},ao.selectAll=function(n){var t;return"string"==typeof n?(t=co(Eo(n,fo)),t.parentNode=fo.documentElement):(t=co(n),t.parentNode=null),E([t])},Co.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var To=ao.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&To.forEach(function(n){"on"+n in fo&&To.remove(n)});var Ro,Do=0;ao.mouse=function(n){return J(n,k())};var Po=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ao.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,i=0,u=t.length;u>i;++i)if((r=t[i]).identifier===e)return J(n,r)},ao.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",o)}function e(n,t,e,u,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],g|=n|e,M=r,p({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(y.on(u+d,null).on(o+d,null),m(g),p({type:"dragend"}))}var c,f=this,s=ao.event.target.correspondingElement||ao.event.target,h=f.parentNode,p=r.of(f,arguments),g=0,v=n(),d=".drag"+(null==v?"":"-"+v),y=ao.select(e(s)).on(u+d,a).on(o+d,l),m=W(s),M=t(h,v);i?(c=i.apply(f,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],p({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),i=null,u=e(b,ao.mouse,t,"mousemove","mouseup"),o=e(G,ao.touch,m,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},ao.rebind(n,r,"on")},ao.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?co(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Uo=1e-6,jo=Uo*Uo,Fo=Math.PI,Ho=2*Fo,Oo=Ho-Uo,Io=Fo/2,Yo=Fo/180,Zo=180/Fo,Vo=Math.SQRT2,Xo=2,$o=4;ao.interpolateZoom=function(n,t){var e,r,i=n[0],u=n[1],o=n[2],a=t[0],l=t[1],c=t[2],f=a-i,s=l-u,h=f*f+s*s;if(jo>h)r=Math.log(c/o)/Vo,e=function(n){return[i+n*f,u+n*s,o*Math.exp(Vo*n*r)]};else{var p=Math.sqrt(h),g=(c*c-o*o+$o*h)/(2*o*Xo*p),v=(c*c-o*o-$o*h)/(2*c*Xo*p),d=Math.log(Math.sqrt(g*g+1)-g),y=Math.log(Math.sqrt(v*v+1)-v);r=(y-d)/Vo,e=function(n){var t=n*r,e=rn(d),a=o/(Xo*p)*(e*un(Vo*t+d)-en(d));return[i+a*f,u+a*s,o*e/rn(Vo*t+d)]}}return e.duration=1e3*r,e},ao.behavior.zoom=function(){function n(n){n.on(L,s).on(Wo+".zoom",p).on("dblclick.zoom",g).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function i(n){k.k=Math.max(A[0],Math.min(A[1],n))}function u(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),u(d=e,r),t=ao.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function f(n){--z||(n({type:"zoomend"}),d=null)}function s(){function n(){a=1,u(ao.mouse(i),h),c(o)}function r(){s.on(q,null).on(T,null),p(a),f(o)}var i=this,o=D.of(i,arguments),a=0,s=ao.select(t(i)).on(q,n).on(T,r),h=e(ao.mouse(i)),p=W(i);Il.call(i),l(o)}function h(){function n(){var n=ao.touches(g);return p=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ao.event.target;ao.select(t).on(x,r).on(b,a),_.push(t);for(var e=ao.event.changedTouches,i=0,u=e.length;u>i;++i)d[e[i].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var f=l[0];o(g,f,d[f.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var f=l[0],s=l[1],h=f[0]-s[0],p=f[1]-s[1];y=h*h+p*p}}function r(){var n,t,e,r,o=ao.touches(g);Il.call(g);for(var a=0,l=o.length;l>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var f=(f=e[0]-n[0])*f+(f=e[1]-n[1])*f,s=y&&Math.sqrt(f/y);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],i(s*p)}M=null,u(n,t),c(v)}function a(){if(ao.event.touches.length){for(var t=ao.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var i in d)return void n()}ao.selectAll(_).on(m,null),w.on(L,s).on(R,h),N(),f(v)}var p,g=this,v=D.of(g,arguments),d={},y=0,m=".zoom-"+ao.event.changedTouches[0].identifier,x="touchmove"+m,b="touchend"+m,_=[],w=ao.select(g),N=W(g);t(),l(v),w.on(L,null).on(R,t)}function p(){var n=D.of(this,arguments);m?clearTimeout(m):(Il.call(this),v=e(d=y||ao.mouse(this)),l(n)),m=setTimeout(function(){m=null,f(n)},50),S(),i(Math.pow(2,.002*Bo())*k.k),u(d,v),c(n)}function g(){var n=ao.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ao.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,y,m,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Jo,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return Wo||(Wo="onwheel"in fo?(Bo=function(){return-ao.event.deltaY*(ao.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Bo=function(){return ao.event.wheelDelta},"mousewheel"):(Bo=function(){return-ao.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Hl?ao.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],i=d?d[0]:e/2,u=d?d[1]:r/2,o=ao.interpolateZoom([(i-k.x)/k.k,(u-k.y)/k.k,e/k.k],[(i-t.x)/t.k,(u-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:i-r[0]*a,y:u-r[1]*a,k:a},c(n)}}).each("interrupt.zoom",function(){f(n)}).each("end.zoom",function(){f(n)}):(this.__chart__=k,l(n),c(n),f(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},i(+t),a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Jo:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(y=t&&[+t[0],+t[1]],n):y},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ao.rebind(n,D,"on")};var Bo,Wo,Jo=[0,1/0];ao.color=an,an.prototype.toString=function(){return this.rgb()+""},ao.hsl=ln;var Go=ln.prototype=new an;Go.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Go.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Go.rgb=function(){return cn(this.h,this.s,this.l)},ao.hcl=fn;var Ko=fn.prototype=new an;Ko.brighter=function(n){return new fn(this.h,this.c,Math.min(100,this.l+Qo*(arguments.length?n:1)))},Ko.darker=function(n){return new fn(this.h,this.c,Math.max(0,this.l-Qo*(arguments.length?n:1)))},Ko.rgb=function(){return sn(this.h,this.c,this.l).rgb()},ao.lab=hn;var Qo=18,na=.95047,ta=1,ea=1.08883,ra=hn.prototype=new an;ra.brighter=function(n){return new hn(Math.min(100,this.l+Qo*(arguments.length?n:1)),this.a,this.b)},ra.darker=function(n){return new hn(Math.max(0,this.l-Qo*(arguments.length?n:1)),this.a,this.b)},ra.rgb=function(){return pn(this.l,this.a,this.b)},ao.rgb=mn;var ia=mn.prototype=new an;ia.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,i=30;return t||e||r?(t&&i>t&&(t=i),e&&i>e&&(e=i),r&&i>r&&(r=i),new mn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mn(i,i,i)},ia.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mn(n*this.r,n*this.g,n*this.b)},ia.hsl=function(){return wn(this.r,this.g,this.b)},ia.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ua=ao.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ua.forEach(function(n,t){ua.set(n,Mn(t))}),ao.functor=En,ao.xhr=An(m),ao.dsv=function(n,t){function e(n,e,u){arguments.length<3&&(u=e,e=null);var o=Cn(n,t,null==e?r:i(e),u);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:i(n)):e},o}function r(n){return e.parse(n.responseText)}function i(n){return function(t){return e.parse(t.responseText,n)}}function u(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(i(n),e)}:i})},e.parseRows=function(n,t){function e(){if(f>=c)return o;if(i)return i=!1,u;var t=f;if(34===n.charCodeAt(t)){for(var e=t;e++<c;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}f=e+2;var r=n.charCodeAt(e+1);return 13===r?(i=!0,10===n.charCodeAt(e+2)&&++f):10===r&&(i=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;c>f;){var r=n.charCodeAt(f++),a=1;if(10===r)i=!0;else if(13===r)i=!0,10===n.charCodeAt(f)&&(++f,++a);else if(r!==l)continue;return n.slice(t,f-a)}return n.slice(t)}for(var r,i,u={},o={},a=[],c=n.length,f=0,s=0;(r=e())!==o;){for(var h=[];r!==u&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,s++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new y,i=[];return t.forEach(function(n){for(var t in n)r.has(t)||i.push(r.add(t))}),[i.map(o).join(n)].concat(t.map(function(t){return i.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(u).join("\n")},e},ao.csv=ao.dsv(",","text/csv"),ao.tsv=ao.dsv("	","text/tab-separated-values");var oa,aa,la,ca,fa=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ao.timer=function(){qn.apply(this,arguments)},ao.timer.flush=function(){Rn(),Dn()},ao.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var sa=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Un);ao.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=ao.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),sa[8+e/3]};var ha=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,pa=ao.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ao.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ga=ao.time={},va=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){da.setUTCDate.apply(this._,arguments)},setDay:function(){da.setUTCDay.apply(this._,arguments)},setFullYear:function(){da.setUTCFullYear.apply(this._,arguments)},setHours:function(){da.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){da.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){da.setUTCMinutes.apply(this._,arguments)},setMonth:function(){da.setUTCMonth.apply(this._,arguments)},setSeconds:function(){da.setUTCSeconds.apply(this._,arguments)},setTime:function(){da.setTime.apply(this._,arguments)}};var da=Date.prototype;ga.year=On(function(n){return n=ga.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ga.years=ga.year.range,ga.years.utc=ga.year.utc.range,ga.day=On(function(n){var t=new va(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ga.days=ga.day.range,ga.days.utc=ga.day.utc.range,ga.dayOfYear=function(n){var t=ga.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ga[n]=On(function(n){return(n=ga.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ga[n+"s"]=e.range,ga[n+"s"].utc=e.utc.range,ga[n+"OfYear"]=function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)}}),ga.week=ga.sunday,ga.weeks=ga.sunday.range,ga.weeks.utc=ga.sunday.utc.range,ga.weekOfYear=ga.sundayOfYear;var ya={"-":"",_:" ",0:"0"},ma=/^\s*\d+/,Ma=/^%/;ao.locale=function(n){return{numberFormat:jn(n),timeFormat:Yn(n)}};var xa=ao.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
 shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ao.format=xa.numberFormat,ao.geo={},ft.prototype={s:0,t:0,add:function(n){st(n,this.t,ba),st(ba.s,this.s,this),this.s?this.t+=ba.t:this.s=ba.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ba=new ft;ao.geo.stream=function(n,t){n&&_a.hasOwnProperty(n.type)?_a[n.type](n,t):ht(n,t)};var _a={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r<i;)ht(e[r].geometry,t)}},wa={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){pt(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)pt(e[r],t,0)},Polygon:function(n,t){gt(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)gt(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,i=e.length;++r<i;)ht(e[r],t)}};ao.geo.area=function(n){return Sa=0,ao.geo.stream(n,Na),Sa};var Sa,ka=new ft,Na={sphere:function(){Sa+=4*Fo},point:b,lineStart:b,lineEnd:b,polygonStart:function(){ka.reset(),Na.lineStart=vt},polygonEnd:function(){var n=2*ka;Sa+=0>n?4*Fo+n:n,Na.lineStart=Na.lineEnd=Na.point=b}};ao.geo.bounds=function(){function n(n,t){M.push(x=[f=n,h=n]),s>t&&(s=t),t>p&&(p=t)}function t(t,e){var r=dt([t*Yo,e*Yo]);if(y){var i=mt(y,r),u=[i[1],-i[0],0],o=mt(u,i);bt(o),o=_t(o);var l=t-g,c=l>0?1:-1,v=o[0]*Zo*c,d=xo(l)>180;if(d^(v>c*g&&c*t>v)){var m=o[1]*Zo;m>p&&(p=m)}else if(v=(v+360)%360-180,d^(v>c*g&&c*t>v)){var m=-o[1]*Zo;s>m&&(s=m)}else s>e&&(s=e),e>p&&(p=e);d?g>t?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t):h>=f?(f>t&&(f=t),t>h&&(h=t)):t>g?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t)}else n(t,e);y=r,g=t}function e(){b.point=t}function r(){x[0]=f,x[1]=h,b.point=n,y=null}function i(n,e){if(y){var r=n-g;m+=xo(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Na.point(n,e),t(n,e)}function u(){Na.lineStart()}function o(){i(v,d),Na.lineEnd(),xo(m)>Uo&&(f=-(h=180)),x[0]=f,x[1]=h,y=null}function a(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var f,s,h,p,g,v,d,y,m,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=i,b.lineStart=u,b.lineEnd=o,m=0,Na.polygonStart()},polygonEnd:function(){Na.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>ka?(f=-(h=180),s=-(p=90)):m>Uo?p=90:-Uo>m&&(s=-90),x[0]=f,x[1]=h}};return function(n){p=h=-(f=s=1/0),M=[],ao.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,i=M[0],u=[i];t>r;++r)e=M[r],c(e[0],i)||c(e[1],i)?(a(i[0],e[1])>a(i[0],i[1])&&(i[1]=e[1]),a(e[0],i[1])>a(i[0],i[1])&&(i[0]=e[0])):u.push(i=e);for(var o,e,g=-(1/0),t=u.length-1,r=0,i=u[t];t>=r;i=e,++r)e=u[r],(o=a(i[1],e[0]))>g&&(g=o,f=e[0],h=i[1])}return M=x=null,f===1/0||s===1/0?[[NaN,NaN],[NaN,NaN]]:[[f,s],[h,p]]}}(),ao.geo.centroid=function(n){Ea=Aa=Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,ja);var t=Da,e=Pa,r=Ua,i=t*t+e*e+r*r;return jo>i&&(t=qa,e=Ta,r=Ra,Uo>Aa&&(t=Ca,e=za,r=La),i=t*t+e*e+r*r,jo>i)?[NaN,NaN]:[Math.atan2(e,t)*Zo,tn(r/Math.sqrt(i))*Zo]};var Ea,Aa,Ca,za,La,qa,Ta,Ra,Da,Pa,Ua,ja={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){ja.lineStart=At},polygonEnd:function(){ja.lineStart=Nt}},Fa=Rt(zt,jt,Ht,[-Fo,-Fo/2]),Ha=1e9;ao.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),i=u(n),i.valid=!0,i},extent:function(a){return arguments.length?(u=Zt(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ao.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,ao.geo.albers=function(){return ao.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ao.geo.albersUsa=function(){function n(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}var t,e,r,i,u=ao.geo.albers(),o=ao.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ao.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?o:i>=.166&&.234>i&&r>=-.214&&-.115>r?a:u).invert(n)},n.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(u.precision(t),o.precision(t),a.precision(t),n):u.precision()},n.scale=function(t){return arguments.length?(u.scale(t),o.scale(.35*t),a.scale(t),n.translate(u.translate())):u.scale()},n.translate=function(t){if(!arguments.length)return u.translate();var c=u.scale(),f=+t[0],s=+t[1];return e=u.translate(t).clipExtent([[f-.455*c,s-.238*c],[f+.455*c,s+.238*c]]).stream(l).point,r=o.translate([f-.307*c,s+.201*c]).clipExtent([[f-.425*c+Uo,s+.12*c+Uo],[f-.214*c-Uo,s+.234*c-Uo]]).stream(l).point,i=a.translate([f-.205*c,s+.212*c]).clipExtent([[f-.214*c+Uo,s+.166*c+Uo],[f-.115*c-Uo,s+.234*c-Uo]]).stream(l).point,n},n.scale(1070)};var Oa,Ia,Ya,Za,Va,Xa,$a={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Ia=0,$a.lineStart=$t},polygonEnd:function(){$a.lineStart=$a.lineEnd=$a.point=b,Oa+=xo(Ia/2)}},Ba={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Wa={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Wa.lineStart=ne},polygonEnd:function(){Wa.point=Gt,Wa.lineStart=Kt,Wa.lineEnd=Qt}};ao.geo.path=function(){function n(n){return n&&("function"==typeof a&&u.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=i(u)),ao.geo.stream(n,o)),u.result()}function t(){return o=null,n}var e,r,i,u,o,a=4.5;return n.area=function(n){return Oa=0,ao.geo.stream(n,i($a)),Oa},n.centroid=function(n){return Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,i(Wa)),Ua?[Da/Ua,Pa/Ua]:Ra?[qa/Ra,Ta/Ra]:La?[Ca/La,za/La]:[NaN,NaN]},n.bounds=function(n){return Va=Xa=-(Ya=Za=1/0),ao.geo.stream(n,i(Ba)),[[Ya,Za],[Va,Xa]]},n.projection=function(n){return arguments.length?(i=(e=n)?n.stream||re(n):m,t()):e},n.context=function(n){return arguments.length?(u=null==(r=n)?new Wt:new te(n),"function"!=typeof a&&u.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(u.pointRadius(+t),+t),n):a},n.projection(ao.geo.albersUsa()).context(null)},ao.geo.transform=function(n){return{stream:function(t){var e=new ie(t);for(var r in n)e[r]=n[r];return e}}},ie.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ao.geo.projection=oe,ao.geo.projectionMutator=ae,(ao.geo.equirectangular=function(){return oe(ce)}).raw=ce.invert=ce,ao.geo.rotation=function(n){function t(t){return t=n(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t}return n=se(n[0]%360*Yo,n[1]*Yo,n.length>2?n[2]*Yo:0),t.invert=function(t){return t=n.invert(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t},t},fe.invert=ce,ao.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=se(-n[0]*Yo,-n[1]*Yo,0).invert,i=[];return e(null,null,1,{point:function(n,e){i.push(n=t(n,e)),n[0]*=Zo,n[1]*=Zo}}),{type:"Polygon",coordinates:[i]}}var t,e,r=[0,0],i=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Yo,i*Yo),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Yo,(i=+r)*Yo),n):i},n.angle(90)},ao.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Yo,i=n[1]*Yo,u=t[1]*Yo,o=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=c*f-l*s*a)*e),l*f+c*s*a)},ao.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ao.range(Math.ceil(u/d)*d,i,d).map(h).concat(ao.range(Math.ceil(c/y)*y,l,y).map(p)).concat(ao.range(Math.ceil(r/g)*g,e,g).filter(function(n){return xo(n%d)>Uo}).map(f)).concat(ao.range(Math.ceil(a/v)*v,o,v).filter(function(n){return xo(n%y)>Uo}).map(s))}var e,r,i,u,o,a,l,c,f,s,h,p,g=10,v=g,d=90,y=360,m=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(p(l).slice(1),h(i).reverse().slice(1),p(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(u=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],u>i&&(t=u,u=i,i=t),c>l&&(t=c,c=l,l=t),n.precision(m)):[[u,c],[i,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(m)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],y=+t[1],n):[d,y]},n.minorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],n):[g,v]},n.precision=function(t){return arguments.length?(m=+t,f=ye(a,o,90),s=me(r,e,m),h=ye(c,l,90),p=me(u,i,m),n):m},n.majorExtent([[-180,-90+Uo],[180,90-Uo]]).minorExtent([[-180,-80-Uo],[180,80+Uo]])},ao.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}var t,e,r=Me,i=xe;return n.distance=function(){return ao.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(i=t,e="function"==typeof t?null:t,n):i},n.precision=function(){return arguments.length?n:0},n},ao.geo.interpolate=function(n,t){return be(n[0]*Yo,n[1]*Yo,t[0]*Yo,t[1]*Yo)},ao.geo.length=function(n){return Ja=0,ao.geo.stream(n,Ga),Ja};var Ja,Ga={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Ka=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ao.geo.azimuthalEqualArea=function(){return oe(Ka)}).raw=Ka;var Qa=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},m);(ao.geo.azimuthalEquidistant=function(){return oe(Qa)}).raw=Qa,(ao.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(ao.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var nl=we(function(n){return 1/n},Math.atan);(ao.geo.gnomonic=function(){return oe(nl)}).raw=nl,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Io]},(ao.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var tl=we(function(){return 1},Math.asin);(ao.geo.orthographic=function(){return oe(tl)}).raw=tl;var el=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ao.geo.stereographic=function(){return oe(el)}).raw=el,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Io]},(ao.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,ao.geom={},ao.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,i=En(e),u=En(r),o=n.length,a=[],l=[];for(t=0;o>t;t++)a.push([+i.call(this,n[t],t),+u.call(this,n[t],t),t]);for(a.sort(qe),t=0;o>t;t++)l.push([a[t][0],-a[t][1]]);var c=Le(a),f=Le(l),s=f[0]===c[0],h=f[f.length-1]===c[c.length-1],p=[];for(t=c.length-1;t>=0;--t)p.push(n[a[c[t]][2]]);for(t=+s;t<f.length-h;++t)p.push(n[a[f[t]][2]]);return p}var e=Ce,r=ze;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},ao.geom.polygon=function(n){return ko(n,rl),n};var rl=ao.geom.polygon.prototype=[];rl.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],i=0;++t<e;)n=r,r=this[t],i+=n[1]*r[0]-n[0]*r[1];return.5*i},rl.centroid=function(n){var t,e,r=-1,i=this.length,u=0,o=0,a=this[i-1];for(arguments.length||(n=-1/(6*this.area()));++r<i;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],u+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[u*n,o*n]},rl.clip=function(n){for(var t,e,r,i,u,o,a=De(n),l=-1,c=this.length-De(this),f=this[c-1];++l<c;){for(t=n.slice(),n.length=0,i=this[l],u=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],Te(o,f,i)?(Te(u,f,i)||n.push(Re(u,o,f,i)),n.push(o)):Te(u,f,i)&&n.push(Re(u,o,f,i)),u=o;a&&n.push(n[0]),f=i}return n};var il,ul,ol,al,ll,cl=[],fl=[];Ye.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Ve),t.length},tr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},er.prototype={insert:function(n,t){var e,r,i;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=or(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(i=r.R,i&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.R&&(ir(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ur(this,r))):(i=r.L,i&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.L&&(ur(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ir(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,i=n.U,u=n.L,o=n.R;if(e=u?o?or(o):u:o,i?i.L===n?i.L=e:i.R=e:this._=e,u&&o?(r=e.C,e.C=n.C,e.L=u,u.U=e,e!==o?(i=e.U,e.U=n.U,n=e.R,i.L=n,e.R=o,o.U=e):(e.U=i,i=e,n=e.R)):(r=n.C,n=e),n&&(n.U=i),!r){if(n&&n.C)return void(n.C=!1);do{if(n===this._)break;if(n===i.L){if(t=i.R,t.C&&(t.C=!1,i.C=!0,ir(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ur(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,ir(this,i),n=this._;break}}else if(t=i.L,t.C&&(t.C=!1,i.C=!0,ur(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ir(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,ur(this,i),n=this._;break}t.C=!0,n=i,i=i.U}while(!n.C);n&&(n.C=!1)}}},ao.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],i=a[0][1],u=a[1][0],o=a[1][1];return ar(e(n),a).cells.forEach(function(e,a){var l=e.edges,c=e.site,f=t[a]=l.length?l.map(function(n){var t=n.start();return[t.x,t.y]}):c.x>=r&&c.x<=u&&c.y>=i&&c.y<=o?[[r,o],[u,o],[u,i],[r,i]]:[];f.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(u(n,t)/Uo)*Uo,y:Math.round(o(n,t)/Uo)*Uo,i:t}})}var r=Ce,i=ze,u=r,o=i,a=sl;return n?t(n):(t.links=function(n){return ar(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return ar(e(n)).cells.forEach(function(e,r){for(var i,u,o=e.site,a=e.edges.sort(Ve),l=-1,c=a.length,f=a[c-1].edge,s=f.l===o?f.r:f.l;++l<c;)i=f,u=s,f=a[l].edge,s=f.l===o?f.r:f.l,r<u.i&&r<s.i&&cr(o,u,s)<0&&t.push([n[r],n[u.i],n[s.i]])}),t},t.x=function(n){return arguments.length?(u=En(r=n),t):r},t.y=function(n){return arguments.length?(o=En(i=n),t):i},t.clipExtent=function(n){return arguments.length?(a=null==n?sl:n,t):a===sl?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===sl?null:a&&a[1]},t)};var sl=[[-1e6,-1e6],[1e6,1e6]];ao.geom.delaunay=function(n){return ao.geom.voronoi().triangles(n)},ao.geom.quadtree=function(n,t,e,r,i){function u(n){function u(n,t,e,r,i,u,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var l=n.x,f=n.y;if(null!=l)if(xo(l-e)+xo(f-r)<.01)c(n,t,e,r,i,u,o,a);else{var s=n.point;n.x=n.y=n.point=null,c(n,s,l,f,i,u,o,a),c(n,t,e,r,i,u,o,a)}else n.x=e,n.y=r,n.point=t}else c(n,t,e,r,i,u,o,a)}function c(n,t,e,r,i,o,a,l){var c=.5*(i+a),f=.5*(o+l),s=e>=c,h=r>=f,p=h<<1|s;n.leaf=!1,n=n.nodes[p]||(n.nodes[p]=hr()),s?i=c:a=c,h?o=f:l=f,u(n,t,e,r,i,o,a,l)}var f,s,h,p,g,v,d,y,m,M=En(a),x=En(l);if(null!=t)v=t,d=e,y=r,m=i;else if(y=m=-(v=d=1/0),s=[],h=[],g=n.length,o)for(p=0;g>p;++p)f=n[p],f.x<v&&(v=f.x),f.y<d&&(d=f.y),f.x>y&&(y=f.x),f.y>m&&(m=f.y),s.push(f.x),h.push(f.y);else for(p=0;g>p;++p){var b=+M(f=n[p],p),_=+x(f,p);v>b&&(v=b),d>_&&(d=_),b>y&&(y=b),_>m&&(m=_),s.push(b),h.push(_)}var w=y-v,S=m-d;w>S?m=d+w:y=v+S;var k=hr();if(k.add=function(n){u(k,n,+M(n,++p),+x(n,p),v,d,y,m)},k.visit=function(n){pr(n,k,v,d,y,m)},k.find=function(n){return gr(k,n[0],n[1],v,d,y,m)},p=-1,null==t){for(;++p<g;)u(k,n[p],s[p],h[p],v,d,y,m);--p}else n.forEach(k.add);return s=h=n=f=null,k}var o,a=Ce,l=ze;return(o=arguments.length)?(a=fr,l=sr,3===o&&(i=e,r=t,e=t=0),u(n)):(u.x=function(n){return arguments.length?(a=n,u):a},u.y=function(n){return arguments.length?(l=n,u):l},u.extent=function(n){return arguments.length?(null==n?t=e=r=i=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],i=+n[1][1]),u):null==t?null:[[t,e],[r,i]]},u.size=function(n){return arguments.length?(null==n?t=e=r=i=null:(t=e=0,r=+n[0],i=+n[1]),u):null==t?null:[r-t,i-e]},u)},ao.interpolateRgb=vr,ao.interpolateObject=dr,ao.interpolateNumber=yr,ao.interpolateString=mr;var hl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pl=new RegExp(hl.source,"g");ao.interpolate=Mr,ao.interpolators=[function(n,t){var e=typeof t;return("string"===e?ua.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?vr:mr:t instanceof an?vr:Array.isArray(t)?xr:"object"===e&&isNaN(t)?dr:yr)(n,t)}],ao.interpolateArray=xr;var gl=function(){return m},vl=ao.map({linear:gl,poly:Er,quad:function(){return Sr},cubic:function(){return kr},sin:function(){return Ar},exp:function(){return Cr},circle:function(){return zr},elastic:Lr,back:qr,bounce:function(){return Tr}}),dl=ao.map({"in":m,out:_r,"in-out":wr,"out-in":function(n){return wr(_r(n))}});ao.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=vl.get(e)||gl,r=dl.get(r)||m,br(r(e.apply(null,lo.call(arguments,1))))},ao.interpolateHcl=Rr,ao.interpolateHsl=Dr,ao.interpolateLab=Pr,ao.interpolateRound=Ur,ao.transform=function(n){var t=fo.createElementNS(ao.ns.prefix.svg,"g");return(ao.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new jr(e?e.matrix:yl)})(n)},jr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yl={a:1,b:0,c:0,d:1,e:0,f:0};ao.interpolateTransform=$r,ao.layout={},ao.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Jr(n[e]));return t}},ao.layout.chord=function(){function n(){var n,c,s,h,p,g={},v=[],d=ao.range(u),y=[];for(e=[],r=[],n=0,h=-1;++h<u;){for(c=0,p=-1;++p<u;)c+=i[h][p];v.push(c),y.push(ao.range(u)),n+=c}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&y.forEach(function(n,t){n.sort(function(n,e){return a(i[t][n],i[t][e])})}),n=(Ho-f*u)/n,c=0,h=-1;++h<u;){for(s=c,p=-1;++p<u;){var m=d[h],M=y[m][p],x=i[m][M],b=c,_=c+=x*n;g[m+"-"+M]={index:m,subindex:M,startAngle:b,endAngle:_,value:x}}r[m]={index:m,startAngle:s,endAngle:c,value:v[m]},c+=f}for(h=-1;++h<u;)for(p=h-1;++p<u;){var w=g[h+"-"+p],S=g[p+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}l&&t()}function t(){e.sort(function(n,t){return l((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,i,u,o,a,l,c={},f=0;return c.matrix=function(n){return arguments.length?(u=(i=n)&&i.length,e=r=null,c):i},c.padding=function(n){return arguments.length?(f=n,e=r=null,c):f},c.sortGroups=function(n){return arguments.length?(o=n,e=r=null,c):o},c.sortSubgroups=function(n){return arguments.length?(a=n,e=null,c):a},c.sortChords=function(n){return arguments.length?(l=n,e&&t(),c):l},c.chords=function(){return e||n(),e},c.groups=function(){return r||n(),r},c},ao.layout.force=function(){function n(n){return function(t,e,r,i){if(t.point!==n){var u=t.cx-n.x,o=t.cy-n.y,a=i-e,l=u*u+o*o;if(l>a*a/y){if(v>l){var c=t.charge/l;n.px-=u*c,n.py-=o*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=u*c,n.py-=o*c}}return!t.charge}}function t(n){n.px=ao.event.x,n.py=ao.event.y,l.resume()}var e,r,i,u,o,a,l={},c=ao.dispatch("start","tick","end"),f=[1,1],s=.9,h=ml,p=Ml,g=-30,v=xl,d=.1,y=.64,M=[],x=[];return l.tick=function(){if((i*=.99)<.005)return e=null,c.end({type:"end",alpha:i=0}),!0;var t,r,l,h,p,v,y,m,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,p=l.target,m=p.x-h.x,b=p.y-h.y,(v=m*m+b*b)&&(v=i*o[r]*((v=Math.sqrt(v))-u[r])/v,m*=v,b*=v,p.x-=m*(y=h.weight+p.weight?h.weight/(h.weight+p.weight):.5),p.y-=b*y,h.x+=m*(y=1-y),h.y+=b*y);if((y=i*d)&&(m=f[0]/2,b=f[1]/2,r=-1,y))for(;++r<_;)l=M[r],l.x+=(m-l.x)*y,l.y+=(b-l.y)*y;if(g)for(ri(t=ao.geom.quadtree(M),i,a),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*s,l.y-=(l.py-(l.py=l.y))*s);c.tick({type:"tick",alpha:i})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(f=n,l):f},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.friction=function(n){return arguments.length?(s=+n,l):s},l.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(y=n*n,l):Math.sqrt(y)},l.alpha=function(n){return arguments.length?(n=+n,i?n>0?i=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:i=0})):n>0&&(c.start({type:"start",alpha:i=n}),e=qn(l.tick)),l):i},l.start=function(){function n(n,r){if(!e){for(e=new Array(i),l=0;i>l;++l)e[l]=[];for(l=0;c>l;++l){var u=x[l];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var o,a=e[t],l=-1,f=a.length;++l<f;)if(!isNaN(o=a[l][n]))return o;return Math.random()*r}var t,e,r,i=M.length,c=x.length,s=f[0],v=f[1];for(t=0;i>t;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;i>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",s)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof h)for(t=0;c>t;++t)u[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)u[t]=h;if(o=[],"function"==typeof p)for(t=0;c>t;++t)o[t]=+p.call(this,x[t],t);else for(t=0;c>t;++t)o[t]=p;if(a=[],"function"==typeof g)for(t=0;i>t;++t)a[t]=+g.call(this,M[t],t);else for(t=0;i>t;++t)a[t]=g;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=ao.behavior.drag().origin(m).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",ni)),arguments.length?void this.on("mouseover.force",ti).on("mouseout.force",ei).call(r):r},ao.rebind(l,c,"on")};var ml=20,Ml=1,xl=1/0;ao.layout.hierarchy=function(){function n(i){var u,o=[i],a=[];for(i.depth=0;null!=(u=o.pop());)if(a.push(u),(c=e.call(n,u,u.depth))&&(l=c.length)){for(var l,c,f;--l>=0;)o.push(f=c[l]),f.parent=u,f.depth=u.depth+1;r&&(u.value=0),u.children=c}else r&&(u.value=+r.call(n,u,u.depth)||0),delete u.children;return oi(i,function(n){var e,i;t&&(e=n.children)&&e.sort(t),r&&(i=n.parent)&&(i.value+=n.value)}),a}var t=ci,e=ai,r=li;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(ui(t,function(n){n.children&&(n.value=0)}),oi(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ao.layout.partition=function(){function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,l,c=-1;for(r=t.value?r/t.value:0;++c<o;)n(a=u[c],e,l=a.value*r,i),e+=l}}function t(n){var e=n.children,r=0;if(e&&(i=e.length))for(var i,u=-1;++u<i;)r=Math.max(r,t(e[u]));return 1+r}function e(e,u){var o=r.call(this,e,u);return n(o[0],0,i[0],i[1]/t(o[0])),o}var r=ao.layout.hierarchy(),i=[1,1];return e.size=function(n){return arguments.length?(i=n,e):i},ii(e,r)},ao.layout.pie=function(){function n(o){var a,l=o.length,c=o.map(function(e,r){return+t.call(n,e,r)}),f=+("function"==typeof r?r.apply(this,arguments):r),s=("function"==typeof i?i.apply(this,arguments):i)-f,h=Math.min(Math.abs(s)/l,+("function"==typeof u?u.apply(this,arguments):u)),p=h*(0>s?-1:1),g=ao.sum(c),v=g?(s-l*p)/g:0,d=ao.range(l),y=[];return null!=e&&d.sort(e===bl?function(n,t){return c[t]-c[n]}:function(n,t){return e(o[n],o[t])}),d.forEach(function(n){y[n]={data:o[n],value:a=c[n],startAngle:f,endAngle:f+=a*v+p,padAngle:h}}),y}var t=Number,e=bl,r=0,i=Ho,u=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(i=t,n):i},n.padAngle=function(t){return arguments.length?(u=t,n):u},n};var bl={};ao.layout.stack=function(){function n(a,l){if(!(h=a.length))return a;var c=a.map(function(e,r){return t.call(n,e,r)}),f=c.map(function(t){return t.map(function(t,e){return[u.call(n,t,e),o.call(n,t,e)]})}),s=e.call(n,f,l);c=ao.permute(c,s),f=ao.permute(f,s);var h,p,g,v,d=r.call(n,f,l),y=c[0].length;for(g=0;y>g;++g)for(i.call(n,c[0][g],v=d[g],f[0][g][1]),p=1;h>p;++p)i.call(n,c[p][g],v+=f[p-1][g][1],f[p][g][1]);return a}var t=m,e=gi,r=vi,i=pi,u=si,o=hi;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:_l.get(t)||gi,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:wl.get(t)||vi,n):r},n.x=function(t){return arguments.length?(u=t,n):u},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(i=t,n):i},n};var _l=ao.map({"inside-out":function(n){var t,e,r=n.length,i=n.map(di),u=n.map(yi),o=ao.range(r).sort(function(n,t){return i[n]-i[t]}),a=0,l=0,c=[],f=[];for(t=0;r>t;++t)e=o[t],l>a?(a+=u[e],c.push(e)):(l+=u[e],f.push(e));return f.reverse().concat(c)},reverse:function(n){return ao.range(n.length).reverse()},"default":gi}),wl=ao.map({silhouette:function(n){var t,e,r,i=n.length,u=n[0].length,o=[],a=0,l=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;u>e;++e)l[e]=(a-o[e])/2;return l},wiggle:function(n){var t,e,r,i,u,o,a,l,c,f=n.length,s=n[0],h=s.length,p=[];for(p[0]=l=c=0,e=1;h>e;++e){for(t=0,i=0;f>t;++t)i+=n[t][e][1];for(t=0,u=0,a=s[e][0]-s[e-1][0];f>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;u+=o*n[t][e][1]}p[e]=l-=i?u/i*a:0,c>l&&(c=l)}for(e=0;h>e;++e)p[e]-=c;return p},expand:function(n){var t,e,r,i=n.length,u=n[0].length,o=1/i,a=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];if(r)for(t=0;i>t;t++)n[t][e][1]/=r;else for(t=0;i>t;t++)n[t][e][1]=o}for(e=0;u>e;++e)a[e]=0;return a},zero:vi});ao.layout.histogram=function(){function n(n,u){for(var o,a,l=[],c=n.map(e,this),f=r.call(this,c,u),s=i.call(this,f,c,u),u=-1,h=c.length,p=s.length-1,g=t?1:1/h;++u<p;)o=l[u]=[],o.dx=s[u+1]-(o.x=s[u]),o.y=0;if(p>0)for(u=-1;++u<h;)a=c[u],a>=f[0]&&a<=f[1]&&(o=l[ao.bisect(s,a,1,p)-1],o.y+=g,o.push(n[u]));return l}var t=!0,e=Number,r=bi,i=Mi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(i="number"==typeof t?function(n){return xi(n,t)}:En(t),n):i},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ao.layout.pack=function(){function n(n,u){var o=e.call(this,n,u),a=o[0],l=i[0],c=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,oi(a,function(n){n.r=+f(n.value)}),oi(a,Ni),r){var s=r*(t?1:Math.max(2*a.r/l,2*a.r/c))/2;oi(a,function(n){n.r+=s}),oi(a,Ni),oi(a,function(n){n.r-=s})}return Ci(a,l/2,c/2,t?1:1/Math.max(2*a.r/l,2*a.r/c)),o}var t,e=ao.layout.hierarchy().sort(_i),r=0,i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},ii(n,e)},ao.layout.tree=function(){function n(n,i){var f=o.call(this,n,i),s=f[0],h=t(s);if(oi(h,e),h.parent.m=-h.z,ui(h,r),c)ui(s,u);else{var p=s,g=s,v=s;ui(s,function(n){n.x<p.x&&(p=n),n.x>g.x&&(g=n),n.depth>v.depth&&(v=n)});var d=a(p,g)/2-p.x,y=l[0]/(g.x+a(g,p)/2+d),m=l[1]/(v.depth||1);ui(s,function(n){n.x=(n.x+d)*y,n.y=n.depth*m})}return f}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var i,u=t.children,o=0,a=u.length;a>o;++o)r.push((u[o]=i={_:u[o],parent:t,children:(i=u[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Di(n);var u=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-u):n.z=u}else r&&(n.z=r.z+a(n._,r._));n.parent.A=i(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function i(n,t,e){if(t){for(var r,i=n,u=n,o=t,l=i.parent.children[0],c=i.m,f=u.m,s=o.m,h=l.m;o=Ti(o),i=qi(i),o&&i;)l=qi(l),u=Ti(u),u.a=n,r=o.z+s-i.z-c+a(o._,i._),r>0&&(Ri(Pi(o,n,e),n,r),c+=r,f+=r),s+=o.m,c+=i.m,h+=l.m,f+=u.m;o&&!Ti(u)&&(u.t=o,u.m+=s-f),i&&!qi(l)&&(l.t=i,l.m+=c-h,e=n)}return e}function u(n){n.x*=l[0],n.y=n.depth*l[1]}var o=ao.layout.hierarchy().sort(null).value(null),a=Li,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(c=null==(l=t)?u:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:u,n):c?l:null},ii(n,o)},ao.layout.cluster=function(){function n(n,u){var o,a=t.call(this,n,u),l=a[0],c=0;oi(l,function(n){var t=n.children;t&&t.length?(n.x=ji(t),n.y=Ui(t)):(n.x=o?c+=e(n,o):0,n.y=0,o=n)});var f=Fi(l),s=Hi(l),h=f.x-e(f,s)/2,p=s.x+e(s,f)/2;return oi(l,i?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(p-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),a}var t=ao.layout.hierarchy().sort(null).value(null),e=Li,r=[1,1],i=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(i=null==(r=t),n):i?null:r},n.nodeSize=function(t){return arguments.length?(i=null!=(r=t),n):i?r:null},ii(n,t)},ao.layout.treemap=function(){function n(n,t){for(var e,r,i=-1,u=n.length;++i<u;)r=(e=n[i]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var u=e.children;if(u&&u.length){var o,a,l,c=s(e),f=[],h=u.slice(),g=1/0,v="slice"===p?c.dx:"dice"===p?c.dy:"slice-dice"===p?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),f.area=0;(l=h.length)>0;)f.push(o=h[l-1]),f.area+=o.area,"squarify"!==p||(a=r(f,v))<=g?(h.pop(),g=a):(f.area-=f.pop().area,i(f,v,c,!1),v=Math.min(c.dx,c.dy),f.length=f.area=0,g=1/0);f.length&&(i(f,v,c,!0),f.length=f.area=0),u.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var u,o=s(t),a=r.slice(),l=[];for(n(a,o.dx*o.dy/t.value),l.area=0;u=a.pop();)l.push(u),l.area+=u.area,null!=u.z&&(i(l,u.z?o.dx:o.dy,o,!a.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(u>e&&(u=e),e>i&&(i=e));return r*=r,t*=t,r?Math.max(t*i*g/r,r/(t*u*g)):1/0}function i(n,t,e,r){var i,u=-1,o=n.length,a=e.x,c=e.y,f=t?l(n.area/t):0;
 if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++u<o;)i=n[u],i.x=a,i.y=c,i.dy=f,a+=i.dx=Math.min(e.x+e.dx-a,f?l(i.area/f):0);i.z=!0,i.dx+=e.x+e.dx-a,e.y+=f,e.dy-=f}else{for((r||f>e.dx)&&(f=e.dx);++u<o;)i=n[u],i.x=a,i.y=c,i.dx=f,c+=i.dy=Math.min(e.y+e.dy-c,f?l(i.area/f):0);i.z=!1,i.dy+=e.y+e.dy-c,e.x+=f,e.dx-=f}}function u(r){var i=o||a(r),u=i[0];return u.x=u.y=0,u.value?(u.dx=c[0],u.dy=c[1]):u.dx=u.dy=0,o&&a.revalue(u),n([u],u.dx*u.dy/u.value),(o?e:t)(u),h&&(o=i),i}var o,a=ao.layout.hierarchy(),l=Math.round,c=[1,1],f=null,s=Oi,h=!1,p="squarify",g=.5*(1+Math.sqrt(5));return u.size=function(n){return arguments.length?(c=n,u):c},u.padding=function(n){function t(t){var e=n.call(u,t,t.depth);return null==e?Oi(t):Ii(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Ii(t,n)}if(!arguments.length)return f;var r;return s=null==(f=n)?Oi:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,u},u.round=function(n){return arguments.length?(l=n?Math.round:Number,u):l!=Number},u.sticky=function(n){return arguments.length?(h=n,o=null,u):h},u.ratio=function(n){return arguments.length?(g=n,u):g},u.mode=function(n){return arguments.length?(p=n+"",u):p},ii(u,a)},ao.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,i;do e=2*Math.random()-1,r=2*Math.random()-1,i=e*e+r*r;while(!i||i>1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var n=ao.random.normal.apply(ao,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ao.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ao.scale={};var Sl={floor:m,ceil:m};ao.scale.linear=function(){return Wi([0,1],[0,1],Mr,!1)};var kl={s:1,g:1,p:1,r:1,e:1};ao.scale.log=function(){return ru(ao.scale.linear().domain([0,1]),10,!0,[1,10])};var Nl=ao.format(".0e"),El={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ao.scale.pow=function(){return iu(ao.scale.linear(),1,[0,1])},ao.scale.sqrt=function(){return ao.scale.pow().exponent(.5)},ao.scale.ordinal=function(){return ou([],{t:"range",a:[[]]})},ao.scale.category10=function(){return ao.scale.ordinal().range(Al)},ao.scale.category20=function(){return ao.scale.ordinal().range(Cl)},ao.scale.category20b=function(){return ao.scale.ordinal().range(zl)},ao.scale.category20c=function(){return ao.scale.ordinal().range(Ll)};var Al=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xn),Cl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xn),zl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xn),Ll=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xn);ao.scale.quantile=function(){return au([],[])},ao.scale.quantize=function(){return lu(0,1,[0,1])},ao.scale.threshold=function(){return cu([.5],[0,1])},ao.scale.identity=function(){return fu([0,1])},ao.svg={},ao.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),f=o.apply(this,arguments)-Io,s=a.apply(this,arguments)-Io,h=Math.abs(s-f),p=f>s?0:1;if(n>c&&(g=c,c=n,n=g),h>=Oo)return t(c,p)+(n?t(n,1-p):"")+"Z";var g,v,d,y,m,M,x,b,_,w,S,k,N=0,E=0,A=[];if((y=(+l.apply(this,arguments)||0)/2)&&(d=u===ql?Math.sqrt(n*n+c*c):+u.apply(this,arguments),p||(E*=-1),c&&(E=tn(d/c*Math.sin(y))),n&&(N=tn(d/n*Math.sin(y)))),c){m=c*Math.cos(f+E),M=c*Math.sin(f+E),x=c*Math.cos(s-E),b=c*Math.sin(s-E);var C=Math.abs(s-f-2*E)<=Fo?0:1;if(E&&yu(m,M,x,b)===p^C){var z=(f+s)/2;m=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else m=M=0;if(n){_=n*Math.cos(s-N),w=n*Math.sin(s-N),S=n*Math.cos(f+N),k=n*Math.sin(f+N);var L=Math.abs(f-s+2*N)<=Fo?0:1;if(N&&yu(_,w,S,k)===1-p^L){var q=(f+s)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Uo&&(g=Math.min(Math.abs(c-n)/2,+i.apply(this,arguments)))>.001){v=c>n^p?0:1;var T=g,R=g;if(Fo>h){var D=null==S?[_,w]:null==x?[m,M]:Re([m,M],[S,k],[x,b],[_,w]),P=m-D[0],U=M-D[1],j=x-D[0],F=b-D[1],H=1/Math.sin(Math.acos((P*j+U*F)/(Math.sqrt(P*P+U*U)*Math.sqrt(j*j+F*F)))/2),O=Math.sqrt(D[0]*D[0]+D[1]*D[1]);R=Math.min(g,(n-O)/(H-1)),T=Math.min(g,(c-O)/(H+1))}if(null!=x){var I=mu(null==S?[_,w]:[S,k],[m,M],c,T,p),Y=mu([x,b],[_,w],c,T,p);g===T?A.push("M",I[0],"A",T,",",T," 0 0,",v," ",I[1],"A",c,",",c," 0 ",1-p^yu(I[1][0],I[1][1],Y[1][0],Y[1][1]),",",p," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):A.push("M",I[0],"A",T,",",T," 0 1,",v," ",Y[0])}else A.push("M",m,",",M);if(null!=S){var Z=mu([m,M],[S,k],n,-R,p),V=mu([_,w],null==x?[m,M]:[x,b],n,-R,p);g===R?A.push("L",V[0],"A",R,",",R," 0 0,",v," ",V[1],"A",n,",",n," 0 ",p^yu(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-p," ",Z[1],"A",R,",",R," 0 0,",v," ",Z[0]):A.push("L",V[0],"A",R,",",R," 0 0,",v," ",Z[0])}else A.push("L",_,",",w)}else A.push("M",m,",",M),null!=x&&A.push("A",c,",",c," 0 ",C,",",p," ",x,",",b),A.push("L",_,",",w),null!=S&&A.push("A",n,",",n," 0 ",L,",",1-p," ",S,",",k);return A.push("Z"),A.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=hu,r=pu,i=su,u=ql,o=gu,a=vu,l=du;return n.innerRadius=function(t){return arguments.length?(e=En(t),n):e},n.outerRadius=function(t){return arguments.length?(r=En(t),n):r},n.cornerRadius=function(t){return arguments.length?(i=En(t),n):i},n.padRadius=function(t){return arguments.length?(u=t==ql?ql:En(t),n):u},n.startAngle=function(t){return arguments.length?(o=En(t),n):o},n.endAngle=function(t){return arguments.length?(a=En(t),n):a},n.padAngle=function(t){return arguments.length?(l=En(t),n):l},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Io;return[Math.cos(t)*n,Math.sin(t)*n]},n};var ql="auto";ao.svg.line=function(){return Mu(m)};var Tl=ao.map({linear:xu,"linear-closed":bu,step:_u,"step-before":wu,"step-after":Su,basis:zu,"basis-open":Lu,"basis-closed":qu,bundle:Tu,cardinal:Eu,"cardinal-open":ku,"cardinal-closed":Nu,monotone:Fu});Tl.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Rl=[0,2/3,1/3,0],Dl=[0,1/3,2/3,0],Pl=[0,1/6,2/3,1/6];ao.svg.line.radial=function(){var n=Mu(Hu);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},wu.reverse=Su,Su.reverse=wu,ao.svg.area=function(){return Ou(m)},ao.svg.area.radial=function(){var n=Ou(Hu);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ao.svg.chord=function(){function n(n,a){var l=t(this,u,n,a),c=t(this,o,n,a);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(e(l,c)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,l.r,l.p0))+"Z"}function t(n,t,e,r){var i=t.call(n,e,r),u=a.call(n,i,r),o=l.call(n,i,r)-Io,f=c.call(n,i,r)-Io;return{r:u,a0:o,a1:f,p0:[u*Math.cos(o),u*Math.sin(o)],p1:[u*Math.cos(f),u*Math.sin(f)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Fo)+",1 "+t}function i(n,t,e,r){return"Q 0,0 "+r}var u=Me,o=xe,a=Iu,l=gu,c=vu;return n.radius=function(t){return arguments.length?(a=En(t),n):a},n.source=function(t){return arguments.length?(u=En(t),n):u},n.target=function(t){return arguments.length?(o=En(t),n):o},n.startAngle=function(t){return arguments.length?(l=En(t),n):l},n.endAngle=function(t){return arguments.length?(c=En(t),n):c},n},ao.svg.diagonal=function(){function n(n,i){var u=t.call(this,n,i),o=e.call(this,n,i),a=(u.y+o.y)/2,l=[u,{x:u.x,y:a},{x:o.x,y:a},o];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var t=Me,e=xe,r=Yu;return n.source=function(e){return arguments.length?(t=En(e),n):t},n.target=function(t){return arguments.length?(e=En(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ao.svg.diagonal.radial=function(){var n=ao.svg.diagonal(),t=Yu,e=n.projection;return n.projection=function(n){return arguments.length?e(Zu(t=n)):t},n},ao.svg.symbol=function(){function n(n,r){return(Ul.get(t.call(this,n,r))||$u)(e.call(this,n,r))}var t=Xu,e=Vu;return n.type=function(e){return arguments.length?(t=En(e),n):t},n.size=function(t){return arguments.length?(e=En(t),n):e},n};var Ul=ao.map({circle:$u,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Fl)),e=t*Fl;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ao.svg.symbolTypes=Ul.keys();var jl=Math.sqrt(3),Fl=Math.tan(30*Yo);Co.transition=function(n){for(var t,e,r=Hl||++Zl,i=Ku(n),u=[],o=Ol||{time:Date.now(),ease:Nr,delay:0,duration:250},a=-1,l=this.length;++a<l;){u.push(t=[]);for(var c=this[a],f=-1,s=c.length;++f<s;)(e=c[f])&&Qu(e,f,i,r,o),t.push(e)}return Wu(u,i,r)},Co.interrupt=function(n){return this.each(null==n?Il:Bu(Ku(n)))};var Hl,Ol,Il=Bu(Ku()),Yl=[],Zl=0;Yl.call=Co.call,Yl.empty=Co.empty,Yl.node=Co.node,Yl.size=Co.size,ao.transition=function(n,t){return n&&n.transition?Hl?n.transition(t):n:ao.selection().transition(n)},ao.transition.prototype=Yl,Yl.select=function(n){var t,e,r,i=this.id,u=this.namespace,o=[];n=A(n);for(var a=-1,l=this.length;++a<l;){o.push(t=[]);for(var c=this[a],f=-1,s=c.length;++f<s;)(r=c[f])&&(e=n.call(r,r.__data__,f,a))?("__data__"in r&&(e.__data__=r.__data__),Qu(e,f,u,i,r[u][i]),t.push(e)):t.push(null)}return Wu(o,u,i)},Yl.selectAll=function(n){var t,e,r,i,u,o=this.id,a=this.namespace,l=[];n=C(n);for(var c=-1,f=this.length;++c<f;)for(var s=this[c],h=-1,p=s.length;++h<p;)if(r=s[h]){u=r[a][o],e=n.call(r,r.__data__,h,c),l.push(t=[]);for(var g=-1,v=e.length;++g<v;)(i=e[g])&&Qu(i,g,a,o,u),t.push(i)}return Wu(l,a,o)},Yl.filter=function(n){var t,e,r,i=[];"function"!=typeof n&&(n=O(n));for(var u=0,o=this.length;o>u;u++){i.push(t=[]);for(var e=this[u],a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return Wu(i,this.namespace,this.id)},Yl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(i){i[r][e].tween.set(n,t)})},Yl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function i(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function u(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?$r:Mr,a=ao.ns.qualify(n);return Ju(this,"attr."+n,t,a.local?u:i)},Yl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(i));return r&&function(n){this.setAttribute(i,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(i.space,i.local));return r&&function(n){this.setAttributeNS(i.space,i.local,r(n))}}var i=ao.ns.qualify(n);return this.tween("attr."+n,i.local?r:e)},Yl.style=function(n,e,r){function i(){this.style.removeProperty(n)}function u(e){return null==e?i:(e+="",function(){var i,u=t(this).getComputedStyle(this,null).getPropertyValue(n);return u!==e&&(i=Mr(u,e),function(t){this.style.setProperty(n,i(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Ju(this,"style."+n,e,u)},Yl.styleTween=function(n,e,r){function i(i,u){var o=e.call(this,i,u,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,i)},Yl.text=function(n){return Ju(this,"text",n,Gu)},Yl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Yl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ao.ease.apply(ao,arguments)),Y(this,function(r){r[e][t].ease=n}))},Yl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,i,u){r[e][t].delay=+n.call(r,r.__data__,i,u)}:(n=+n,function(r){r[e][t].delay=n}))},Yl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,i,u){r[e][t].duration=Math.max(1,n.call(r,r.__data__,i,u))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Yl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var i=Ol,u=Hl;try{Hl=e,Y(this,function(t,i,u){Ol=t[r][e],n.call(t,t.__data__,i,u)})}finally{Ol=i,Hl=u}}else Y(this,function(i){var u=i[r][e];(u.event||(u.event=ao.dispatch("start","end","interrupt"))).on(n,t)});return this},Yl.transition=function(){for(var n,t,e,r,i=this.id,u=++Zl,o=this.namespace,a=[],l=0,c=this.length;c>l;l++){a.push(n=[]);for(var t=this[l],f=0,s=t.length;s>f;f++)(e=t[f])&&(r=e[o][i],Qu(e,f,o,u,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Wu(a,o,u)},ao.svg.axis=function(){function n(n){n.each(function(){var n,c=ao.select(this),f=this.__chart__||e,s=this.__chart__=e.copy(),h=null==l?s.ticks?s.ticks.apply(s,a):s.domain():l,p=null==t?s.tickFormat?s.tickFormat.apply(s,a):m:t,g=c.selectAll(".tick").data(h,s),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Uo),d=ao.transition(g.exit()).style("opacity",Uo).remove(),y=ao.transition(g.order()).style("opacity",1),M=Math.max(i,0)+o,x=Zi(s),b=c.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ao.transition(b));v.append("line"),v.append("text");var w,S,k,N,E=v.select("line"),A=y.select("line"),C=g.select("text").text(p),z=v.select("text"),L=y.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=no,w="x",k="y",S="x2",N="y2",C.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+q*u+"V0H"+x[1]+"V"+q*u)):(n=to,w="y",k="x",S="y2",N="x2",C.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),_.attr("d","M"+q*u+","+x[0]+"H0V"+x[1]+"H"+q*u)),E.attr(N,q*i),z.attr(k,q*M),A.attr(S,0).attr(N,q*i),L.attr(w,0).attr(k,q*M),s.rangeBand){var T=s,R=T.rangeBand()/2;f=s=function(n){return T(n)+R}}else f.rangeBand?f=s:d.call(n,s,f);v.call(n,f,s),y.call(n,s,s)})}var t,e=ao.scale.linear(),r=Vl,i=6,u=6,o=3,a=[10],l=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Xl?t+"":Vl,n):r},n.ticks=function(){return arguments.length?(a=co(arguments),n):a},n.tickValues=function(t){return arguments.length?(l=t,n):l},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(i=+t,u=+arguments[e-1],n):i},n.innerTickSize=function(t){return arguments.length?(i=+t,n):i},n.outerTickSize=function(t){return arguments.length?(u=+t,n):u},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Vl="bottom",Xl={top:1,right:1,bottom:1,left:1};ao.svg.brush=function(){function n(t){t.each(function(){var t=ao.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,m);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return $l[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,s=ao.transition(t),h=ao.transition(o);c&&(l=Zi(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(s)),f&&(l=Zi(f),h.attr("y",l[0]).attr("height",l[1]-l[0]),i(s)),e(s)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function i(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function u(){function u(){32==ao.event.keyCode&&(C||(M=null,L[0]-=s[1],L[1]-=h[1],C=2),S())}function v(){32==ao.event.keyCode&&2==C&&(L[0]+=s[1],L[1]+=h[1],C=0,S())}function d(){var n=ao.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ao.event.altKey?(M||(M=[(s[0]+s[1])/2,(h[0]+h[1])/2]),L[0]=s[+(n[0]<M[0])],L[1]=h[+(n[1]<M[1])]):M=null),E&&y(n,c,0)&&(r(k),t=!0),A&&y(n,f,1)&&(i(k),t=!0),t&&(e(k),w({type:"brush",mode:C?"move":"resize"}))}function y(n,t,e){var r,i,u=Zi(t),l=u[0],c=u[1],f=L[e],v=e?h:s,d=v[1]-v[0];return C&&(l-=f,c-=d+f),r=(e?g:p)?Math.max(l,Math.min(c,n[e])):n[e],C?i=(r+=f)+d:(M&&(f=Math.max(l,Math.min(c,2*M[e]-r))),r>f?(i=r,r=f):i=f),v[0]!=r||v[1]!=i?(e?a=null:o=null,v[0]=r,v[1]=i,!0):void 0}function m(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ao.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ao.select(ao.event.target),w=l.of(b,arguments),k=ao.select(b),N=_.datum(),E=!/^(n|s)$/.test(N)&&c,A=!/^(e|w)$/.test(N)&&f,C=_.classed("extent"),z=W(b),L=ao.mouse(b),q=ao.select(t(b)).on("keydown.brush",u).on("keyup.brush",v);if(ao.event.changedTouches?q.on("touchmove.brush",d).on("touchend.brush",m):q.on("mousemove.brush",d).on("mouseup.brush",m),k.interrupt().selectAll("*").interrupt(),C)L[0]=s[0]-L[0],L[1]=h[0]-L[1];else if(N){var T=+/w$/.test(N),R=+/^n/.test(N);x=[s[1-T]-L[0],h[1-R]-L[1]],L[0]=s[T],L[1]=h[R]}else ao.event.altKey&&(M=L.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ao.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,l=N(n,"brushstart","brush","brushend"),c=null,f=null,s=[0,0],h=[0,0],p=!0,g=!0,v=Bl[0];return n.event=function(n){n.each(function(){var n=l.of(this,arguments),t={x:s,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Hl?ao.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,s=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(s,t.x),r=xr(h,t.y);return o=a=null,function(i){s=t.x=e(i),h=t.y=r(i),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=Bl[!c<<1|!f],n):c},n.y=function(t){return arguments.length?(f=t,v=Bl[!c<<1|!f],n):f},n.clamp=function(t){return arguments.length?(c&&f?(p=!!t[0],g=!!t[1]):c?p=!!t:f&&(g=!!t),n):c&&f?[p,g]:c?p:f?g:null},n.extent=function(t){var e,r,i,u,l;return arguments.length?(c&&(e=t[0],r=t[1],f&&(e=e[0],r=r[0]),o=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(l=e,e=r,r=l),e==s[0]&&r==s[1]||(s=[e,r])),f&&(i=t[0],u=t[1],c&&(i=i[1],u=u[1]),a=[i,u],f.invert&&(i=f(i),u=f(u)),i>u&&(l=i,i=u,u=l),i==h[0]&&u==h[1]||(h=[i,u])),n):(c&&(o?(e=o[0],r=o[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(l=e,e=r,r=l))),f&&(a?(i=a[0],u=a[1]):(i=h[0],u=h[1],f.invert&&(i=f.invert(i),u=f.invert(u)),i>u&&(l=i,i=u,u=l))),c&&f?[[e,i],[r,u]]:c?[e,r]:f&&[i,u])},n.clear=function(){return n.empty()||(s=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!f&&h[0]==h[1]},ao.rebind(n,l,"on")};var $l={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Wl=ga.format=xa.timeFormat,Jl=Wl.utc,Gl=Jl("%Y-%m-%dT%H:%M:%S.%LZ");Wl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?eo:Gl,eo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},eo.toString=Gl.toString,ga.second=On(function(n){return new va(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ga.seconds=ga.second.range,ga.seconds.utc=ga.second.utc.range,ga.minute=On(function(n){return new va(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ga.minutes=ga.minute.range,ga.minutes.utc=ga.minute.utc.range,ga.hour=On(function(n){var t=n.getTimezoneOffset()/60;return new va(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ga.hours=ga.hour.range,ga.hours.utc=ga.hour.utc.range,ga.month=On(function(n){return n=ga.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ga.months=ga.month.range,ga.months.utc=ga.month.utc.range;var Kl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ql=[[ga.second,1],[ga.second,5],[ga.second,15],[ga.second,30],[ga.minute,1],[ga.minute,5],[ga.minute,15],[ga.minute,30],[ga.hour,1],[ga.hour,3],[ga.hour,6],[ga.hour,12],[ga.day,1],[ga.day,2],[ga.week,1],[ga.month,1],[ga.month,3],[ga.year,1]],nc=Wl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",zt]]),tc={range:function(n,t,e){return ao.range(Math.ceil(n/e)*e,+t,e).map(io)},floor:m,ceil:m};Ql.year=ga.year,ga.scale=function(){return ro(ao.scale.linear(),Ql,nc)};var ec=Ql.map(function(n){return[n[0].utc,n[1]]}),rc=Jl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",zt]]);ec.year=ga.year.utc,ga.scale.utc=function(){return ro(ao.scale.linear(),ec,rc)},ao.text=An(function(n){return n.responseText}),ao.json=function(n,t){return Cn(n,"application/json",uo,t)},ao.html=function(n,t){return Cn(n,"text/html",oo,t)},ao.xml=An(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=ao,define(ao)):"object"==typeof module&&module.exports?module.exports=ao:this.d3=ao}();
\ No newline at end of file
diff --git a/xos/core/xoslib/static/js/xosMcordTopology.js b/xos/core/xoslib/static/js/xosMcordTopology.js
new file mode 100644
index 0000000..c1decb6
--- /dev/null
+++ b/xos/core/xoslib/static/js/xosMcordTopology.js
@@ -0,0 +1 @@
+"use strict";angular.module("xos.mcordTopology",["ngResource","ngCookies","ui.router","xos.helpers"]).config(["$stateProvider",function(t){t.state("topology",{url:"/",template:"<m-cord-topology></m-cord-topology>"})}]).config(["$httpProvider",function(t){t.interceptors.push("NoHyperlinks")}]).factory("_",["$window",function(t){return t._}]).service("Traffic",["$http","$q",function(t,n){this.get=function(){var e=n.defer();return t.get("videoLocal.txt").then(function(t){e.resolve(t.data)})["catch"](function(t){console.log(t),e.resolve(10*Math.random())}),e.promise}}]).directive("mCordTopology",function(){return{restrict:"E",scope:{},bindToController:!0,controllerAs:"vm",template:"",controller:["$element","$interval","$rootScope","_","$http","TopologyElements","NodeDrawer","Traffic",function(t,n,e,r,a,i,o,c){var s=t[0],u=[],l=[],d=0,p=1,f=5,h=function(t){return r.filter(t,function(t){return t.name.indexOf("bbu")>=0})},m=function(t){return i.fakedInstance},y=function(){d3.select("svg").style("width",s.clientWidth+"px").style("height",s.clientHeight+"px"),u=i.nodes,l=i.links,c.get().then(function(t){if(d)if(t===d)p=p;else{var n=t-d;n>0?p+=n/f:p-=-1*n/f}else p=2;return.2>p&&(p=.2),d=t,a.get("/api/core/xos/instances")}).then(function(t){b(h(t.data)),w(m(t.data)),V(g,u,l)})["catch"](function(t){throw new Error(t)})},v=d3.layout.force(),g=d3.select(s).append("svg").style("width",s.clientWidth+"px").style("height",s.clientHeight+"px"),x=(g.append("g").attr({"class":"link-container"}),g.append("g").attr({"class":"node-container"}),function(t,n){return t.map(function(t){console.log(r.find);var e=r.findIndex(n,{id:t.source}),a=r.findIndex(n,{id:t.target});return{source:e,target:a,value:1,id:"link-"+e+"-"+a,type:t.source.indexOf("fabric")>=0?"big":"small"}})}),H=function(t){return r.map(t,function(t){return"fabric"!==t.type?t:(t.x=t.x*Z,t.y=t.y*M,t)})},b=function(t){var n=s.clientWidth/2/(t.length+1),e=t.map(function(t,e){return{type:"bbu",name:t.name,id:"bbu-"+t.id,fixed:!0,y:3*M,x:n*(e+1)}}),r=e.map(function(t){return{source:t.id,target:"fabric4"}});t.forEach(function(t,a){e.push({type:"rru",name:"rru",id:"rru-"+t.id,fixed:!0,y:4*M,x:n*(a+1)}),r.push({source:"rru-"+t.id,target:"bbu-"+t.id})}),u=u.concat(e),l=l.concat(r)},w=function(t){var n=s.clientWidth/2/(t.length+1),e=t.map(function(t,e){return{type:t.name.substring(0,3),name:t.name,id:t.name.substring(0,3)+"-"+t.id,fixed:!0,y:3*M,x:s.clientWidth/2+n*(e+1)}}),r=e.map(function(t){return{source:t.id,target:"fabric4"}});u=u.concat(e),l=l.concat(r)},Z=void 0,M=void 0;Z=s.clientWidth/3,M=s.clientHeight/5;var V=function(t,n,e){Z=s.clientWidth/3,M=s.clientHeight/5,e=x(e,n),n=H(n),console.log(n),v.nodes(n).links(e).size([s.clientWidth,s.clientHeight]).charge(-20).chargeDistance(200).linkDistance(80).linkStrength(.1).start();var r=d3.select(".link-container"),a=d3.select(".node-container");o.drawFabricBox(a,Z,M);var i=r.selectAll(".link").data(e,function(t){return t.id});i.enter().append("line").attr({"class":function(t){return"link "+t.type},"stroke-width":p,id:function(t){return t.id},opacity:0}).transition().duration(1e3).attr({opacity:1}),i.transition().duration(1e3).attr({"stroke-width":p,opacity:1}),i.exit().remove();var c=a.selectAll(".node").data(n,function(t){return t.id}),u=c.enter().append("g",function(t){return t.interfaceCfgIdentifier}).attr({"class":function(t){return t.type+" node"},transform:function(t){return"translate("+t.x+", "+t.y+")"}});o.drawBbus(u.filter(".bbu")),o.drawRrus(u.filter(".rru")),o.drawFabric(u.filter(".fabric")),o.drawOthers(u.filter(function(t){return console.log(t.type),"MME"===t.type||"SGW"===t.type||"PGW"===t.type||"Vid"===t.type}));var l=c.exit();o.removeElements(l),v.on("tick",function(){i.attr("x1",function(t){return t.source.x}).attr("y1",function(t){return t.source.y}).attr("x2",function(t){return t.target.x}).attr("y2",function(t){return t.target.y}),c.attr("transform",function(t){return"translate("+t.x+","+t.y+")"})})};y()}]}}),angular.module("xos.mcordTopology").run(["$templateCache",function(t){t.put("templates/users-list.tpl.html",'<div class="row">\n  <div class="col-xs-12">\n    <h1>Users List</h1>\n    <p>This is only an example view.</p>\n  </div>\n</div>\n<div class="row">\n  <div class="col-xs-4">Email</div>\n  <div class="col-xs-4">First Name</div>\n  <div class="col-xs-4">Last Name</div>\n</div>  \n<div class="row" ng-repeat="user in vm.users">\n  <div class="col-xs-4">{{user.email}}</div>\n  <div class="col-xs-4">{{user.firstname}}</div>\n  <div class="col-xs-4">{{user.lastname}}</div>\n</div>  ')}]),angular.module("xos.mcordTopology").constant("TopologyElements",{nodes:[{id:"fabric4",type:"fabric",name:"fabric4",fixed:!0,x:1.5,y:1.5}],links:[],fakedInstance:[{humanReadableName:"MME",name:"MME"},{humanReadableName:"PGW",name:"PGW"},{humanReadableName:"SGW",name:"SGW"},{humanReadableName:"Video Server",name:"Video Server"}],icons:{bbu:"M11.08,4.66H24.76l6.81,6.82H4.23Z M4.24,18.34V13.21H31.6v5.13H4.24Zm25.64-1.72V14.94H28.19v1.69h1.68Zm-13.65-1.7v1.69h1.69V14.93H16.22Zm-3.42,0v1.69h1.68V14.93H12.8Zm-3.42,0v1.69h1.68V14.93H9.38ZM6,14.93v1.69H7.64V14.93H6Z M32.8,33.23H3V11.42l0,0c1.17-1.16,2.54-2.5,3.87-3.8S9.59,5,10.72,3.87l0,0H25.08l0,0C26.25,5,27.6,6.32,28.9,7.61s2.68,2.63,3.83,3.78l0,0v0.06ZM3.3,33H32.53l0-21.43C31.36,10.39,30,9.07,28.71,7.8S26.09,5.22,25,4.1H10.86C9.75,5.21,8.41,6.52,7.12,7.77s-2.67,2.61-3.83,3.76V33Z M4.24,25.18V20.05H31.6v5.13H4.24Zm24-1.73h1.68V21.78H28.19v1.67Zm-12,0H17.9V21.78H16.21v1.68Zm-1.73-1.68H12.81v1.67h1.68V21.78Zm-3.43,1.68V21.78H9.38v1.69h1.68ZM6,23.46H7.64V21.78H6v1.68Z M31.6,26.89V32H4.24V26.89H31.6Zm-3.4,1.72V30.3h1.68V28.61H28.19Zm-10.28,0H16.22V30.3h1.68V28.62Zm-3.43,1.69V28.62H12.8v1.69h1.68Zm-3.42,0V28.62H9.38v1.69h1.68ZM7.65,28.62H6v1.67H7.65V28.62Z","switch":"M10,20a10,10,0,0,1,10-10h70a10,10,0,0,1,10,10v70a10,10,\n            0,0,1-10,10h-70a10,10,0,0,1-10-10zM60,26l12,0,0-8,18,13-18,13,0\n            -8-12,0zM60,60l12,0,0-8,18,13-18,13,0-8-12,0zM50,40l-12,0,0-8\n            -18,13,18,13,0-8,12,0zM50,74l-12,0,0-8-18,13,18,13,0-8,12,0z",rru:"M18.11,11a2.25,2.25,0,0,1,2.13,1.53A2.2,2.2,0,0,1,19.52,15a0.74,0.74,0,0,0-.3.61A7.49,7.49,0,0,0,20,19.35c2,4.55,3.94,9.13,5.89,13.7a1.14,1.14,0,0,1-.59,1.64A1.11,1.11,0,0,1,23.86,34q-0.53-1.2-1-2.41a0.38,0.38,0,0,0-.41-0.28H13.78a0.36,0.36,0,0,0-.39.26q-0.51,1.24-1.06,2.47a1.11,1.11,0,0,1-1.14.67,1.07,1.07,0,0,1-1-.89,1.47,1.47,0,0,1,.1-0.75q2.84-6.66,5.7-13.32a4.06,4.06,0,0,1,.18-0.42A6.39,6.39,0,0,0,17,15.53,0.58,0.58,0,0,0,16.74,15,2.21,2.21,0,0,1,16,12.5,2.26,2.26,0,0,1,18.11,11ZM21.74,29.1c-0.32-.74-0.61-1.43-0.92-2.12a0.35,0.35,0,0,0-.27-0.14H15.66a0.33,0.33,0,0,0-.26.11c-0.32.7-.62,1.41-0.93,2.15h7.26Zm-5.31-4.55h3.37L18.1,20.63Z M2.23,13.56A16,16,0,0,1,6.76,2.16a1.68,1.68,0,0,1,.8-0.46,1.06,1.06,0,0,1,1.18.59,1.16,1.16,0,0,1-.23,1.37A14.48,14.48,0,0,0,6.19,6.77a13.57,13.57,0,0,0,1.9,15.59l0.46,0.49a1.16,1.16,0,1,1-1.68,1.59,15.6,15.6,0,0,1-4.41-8.64C2.32,14.95,2.28,14.07,2.23,13.56Z M34,13.84a15.51,15.51,0,0,1-4.54,10.52,1.19,1.19,0,0,1-1.65.18,1.17,1.17,0,0,1,0-1.77,13.81,13.81,0,0,0,2.79-4.1,13.6,13.6,0,0,0-2.7-14.91A1.8,1.8,0,0,1,27.41,3,1.08,1.08,0,0,1,28,1.8,1.15,1.15,0,0,1,29.38,2a15.59,15.59,0,0,1,2.51,3.28A16.47,16.47,0,0,1,34,13.84Z M10.93,21.6A1.33,1.33,0,0,1,9.87,21a11.06,11.06,0,0,1-2.8-5.27A11.22,11.22,0,0,1,9.8,5.51l0.27-.28a1.16,1.16,0,1,1,1.64,1.63,8.62,8.62,0,0,0-2.06,3.22A8.87,8.87,0,0,0,11.18,19c0.18,0.23.4,0.44,0.59,0.66A1.13,1.13,0,0,1,11.95,21,1.08,1.08,0,0,1,10.93,21.6Z M29.47,13.57a11.11,11.11,0,0,1-3.27,7.64,1.18,1.18,0,0,1-1.51.21,1.13,1.13,0,0,1-.43-1.4,2.06,2.06,0,0,1,.39-0.54,8.85,8.85,0,0,0,2.49-5.89A9,9,0,0,0,24.64,7a1.85,1.85,0,0,1-.44-0.85A1,1,0,0,1,24.82,5a1.07,1.07,0,0,1,1.3.21,20.11,20.11,0,0,1,1.79,2.31A11.09,11.09,0,0,1,29.47,13.57Z M11.3,13.18a6.73,6.73,0,0,1,2-4.73,1.15,1.15,0,0,1,1.45-.2,1.12,1.12,0,0,1,.49,1.32,1.58,1.58,0,0,1-.33.53,4.49,4.49,0,0,0,0,6.26,1.16,1.16,0,1,1-1.7,1.57A6.81,6.81,0,0,1,11.3,13.18Z M24.94,13.14A6.9,6.9,0,0,1,23,18a1.16,1.16,0,1,1-1.7-1.58,4.5,4.5,0,0,0,0-6.29A1.16,1.16,0,1,1,23,8.5,6.75,6.75,0,0,1,24.94,13.14Z"}}),angular.module("xos.mcordTopology").service("NodeDrawer",["TopologyElements",function(t){var n=500,e=!1;this.drawFabricBox=function(t,n,r){if(!e){var a=t.append("g").attr({transform:"translate("+(n-25)+", "+(r-25)+")"});a.append("rect").attr({width:n+50,height:r+50,"class":"fabric-container"}),e=!0}},this.drawBbus=function(e){e.append("rect").attr({"class":function(t){return t.type},width:30,height:30,x:-15,y:-15,opacity:0}).transition().duration(n).attr({r:15,opacity:1}),e.append("path").attr({"class":function(t){return t.type+" antenna"},opacity:0,d:function(){return t.icons.bbu},transform:"translate(-18, -18)"}).transition().duration(n).attr({opacity:1}),e.append("text").attr({"text-anchor":"start",y:25,x:5,opacity:0}).text(function(t){return"vBBU "+t.name.substr(t.name.length-1,1)}).transition().duration(2*n).attr({opacity:1})},this.drawRrus=function(e){e.append("circle").attr({"class":function(t){return t.type+"-shadow"},r:0,opacity:0}).transition().duration(2*n).attr({r:40,opacity:1}),e.append("path").attr({"class":function(t){return t.type+" antenna"},opacity:0,d:function(){return t.icons.rru},transform:"translate(-18, -18)"}).transition().duration(n).attr({opacity:1})},this.drawFabric=function(e){e.append("rect").attr({width:30,height:30,x:-15,y:-15}),e.append("path").attr({"class":function(t){return t.type},opacity:0,d:function(){return t.icons["switch"]},transform:"translate(-22, -22), scale(0.4)"}).transition().duration(n).attr({opacity:1})},this.drawOthers=function(e){e.append("rect").attr({"class":function(t){return t.type},width:30,height:30,x:-15,y:-15,opacity:0}).transition().duration(n).attr({r:15,opacity:1}),e.append("path").attr({"class":function(t){return t.type+" antenna"},opacity:0,d:function(){return t.icons.bbu},transform:"translate(-18, -18)"}).transition().duration(n).attr({opacity:1}),e.append("text").attr({"text-anchor":"start",y:25,x:-12,opacity:0}).text(function(t){return t.name.toUpperCase()}).transition().duration(2*n).attr({opacity:1})},this.removeElements=function(t){t.transition().duration(n).attr({opacity:0}).remove()}}]),angular.module("xos.mcordTopology").run(["$location",function(t){t.path("/")}]);
diff --git a/xos/core/xoslib/static/js/xosSubscribers.js b/xos/core/xoslib/static/js/xosSubscribers.js
new file mode 100644
index 0000000..21fa10c
--- /dev/null
+++ b/xos/core/xoslib/static/js/xosSubscribers.js
@@ -0,0 +1 @@
+"use strict";angular.module("xos.subscribers",["ngResource","ngCookies","ui.router","xos.helpers"]).config(["$stateProvider",function(s){s.state("user-list",{url:"/",template:"<subscribers-list></subscribers-list>"})}]).config(["$httpProvider",function(s){s.interceptors.push("NoHyperlinks")}]).directive("subscribersList",function(){return{restrict:"E",scope:{},bindToController:!0,controllerAs:"vm",templateUrl:"templates/subscribers-list.tpl.html",controller:function(){this.smartTableConfig={resource:"Subscribers"},this.model={label:{name:"aaa"},empty:{}},this.config={exclude:["password","last_login"],formName:"sampleForm",actions:[{label:"Save",icon:"ok",cb:function(s){console.log(s)},"class":"success"}]}}}}),angular.module("xos.subscribers").run(["$templateCache",function(s){s.put("templates/subscribers-list.tpl.html",'<!-- <xos-form ng-model="vm.model" config="vm.config"></xos-form> -->\n<xos-smart-table config="vm.smartTableConfig"></xos-smart-table>')}]),angular.module("xos.subscribers").run(["$location",function(s){s.path("/")}]);
\ No newline at end of file
diff --git a/xos/core/xoslib/static/js/xosSynchronizerNotifier.js b/xos/core/xoslib/static/js/xosSynchronizerNotifier.js
index e5341e7..5cd2670 100644
--- a/xos/core/xoslib/static/js/xosSynchronizerNotifier.js
+++ b/xos/core/xoslib/static/js/xosSynchronizerNotifier.js
@@ -1 +1 @@
-"use strict";angular.module("xos.synchronizerNotifier",["ngResource","ngCookies","ui.router","xos.helpers"]).config(["$provide",function(n){n.decorator("$rootScope",["$delegate",function(n){var t=n.constructor,s=t.prototype.$on;return t.prototype.$on=function(){return s.apply(this,arguments)},n}])}]).service("Diag",["$rootScope","$http","$q","$interval",function(n,t,s,e){var o=this,i=!1;this.getDiags=function(){var n=s.defer();return t.get("/api/core/diags").then(function(t){n.resolve(t.data)})["catch"](function(t){n.reject(t)}),n.promise},this.sendEvents=function(t){t.forEach(function(t){var s=JSON.parse(t.backend_register);s.last_run=new Date(1e3*s.last_run),n.$broadcast("diag",{name:t.name,updated:t.updated,info:s,status:o.getSyncStatus(s)})})},this.start=function(){return i=!0,o.getDiags().then(function(n){o.sendEvents(n)}),i},this.stop=function(){return i=!1},this.getSyncStatus=function(n){var t=3e5;return!(new Date-n.last_run>t)},e(function(){i&&o.getDiags().then(function(n){o.sendEvents(n)})},25e3)}]).run(["$log",function(n){n.info("Listening for Syncronizers Events!")}]).directive("syncStatus",function(){return{restrict:"E",scope:{},bindToController:!0,controllerAs:"vm",templateUrl:"templates/sync-status.tpl.html",controller:["$log","$rootScope","Diag",function(n,t,s){var e=this;s.start(),this.synchronizers={},this.showNoSync=!0,t.$on("diag",function(n,t){e.synchronizers[t.name]=t,e.showNoSync=!1,0===Object.keys(e.synchronizers).length&&(e.showNoSync=!0)})}]}}),angular.element(document).ready(function(){angular.bootstrap("#xosSynchronizerNotifier",["xos.synchronizerNotifier"])}),angular.module("xos.synchronizerNotifier").run(["$templateCache",function(n){n.put("templates/sync-status.tpl.html",'<div class="sync-status-container">\n  <div class="btn btn-default" ng-click="vm.showNotificationPanel = !vm.showNotificationPanel">\n    <i class="glyphicon glyphicon-inbox"></i>\n  </div>\n  <div class="notification-panel panel panel-default" ng-show="vm.showNotificationPanel">\n    <ul class="list-group" ng-show="vm.showNoSync">\n      <li class="list-group-item" ng-repeat="(syncName, syncStatus) in vm.synchronizers">\n        <span class="badge" ng-class="{success: syncStatus.status, danger: !syncStatus.status}">\n          <span ng-show="syncStatus.status"><i class="glyphicon glyphicon-ok"></i></span>\n          <span ng-hide="syncStatus.status"><i class="glyphicon glyphicon-remove"></i></span>\n        </span>\n        <b>{{syncName}}</b>\n        <br/>\n        <small><i>{{syncStatus.info.last_run | date:\'mediumTime\'}}</i></small>\n      </li>\n    </ul>\n    <div class="alert alert-info" ng-show="vm.showNoSync">\n      No syncronizers are running.\n    </div>\n  </div>\n</div>\n')}]),angular.module("xos.synchronizerNotifier").run(["$location",function(n){n.path("/")}]);
\ No newline at end of file
+"use strict";angular.module("xos.synchronizerNotifier",["ngResource","ngCookies","ui.router","xos.helpers"]).service("Diag",["$rootScope","$http","$q","$interval",function(n,t,s,e){var a=this,o=!1;this.getDiags=function(){var n=s.defer();return t.get("/api/core/diags").then(function(t){n.resolve(t.data)})["catch"](function(t){n.reject(t)}),n.promise},this.sendEvents=function(t){t.forEach(function(t){var s=JSON.parse(t.backend_register);s.last_run=new Date(1e3*s.last_run),s.last_duration=1e3*s.last_duration,s.last_synchronizer_start=new Date(1e3*s.last_synchronizer_start),s.last_syncrecord_start=s.last_syncrecord_start?new Date(1e3*s.last_syncrecord_start):null,n.$broadcast("diag",{name:t.name,updated:t.updated,info:s,status:a.getSyncStatus(s)})})},this.start=function(){return o=!0,a.getDiags().then(function(n){a.sendEvents(n)}),o},this.stop=function(){return o=!1},this.getSyncStatus=function(n){var t=new Date,s=6e4;return!(t-n.last_synchronizer_start>s&&t-n.last_syncrecord_start>s&&t-n.last_run>s)},e(function(){o&&a.getDiags().then(function(n){a.sendEvents(n)})},1e4)}]).directive("syncStatus",function(){return{restrict:"E",scope:{},bindToController:!0,controllerAs:"vm",templateUrl:"templates/sync-status.tpl.html",controller:["$log","$rootScope","Diag","xosNotification",function(n,t,s,e){var a=this;s.start(),this.showNotificationPanel=!0,this.synchronizers={};var o={};this.showNoSync=!0,t.$on("diag",function(n,t){a.synchronizers[t.name]=t,t.status?o[t.name]=!1:(o[t.name]||e.notify("CORD Synchronizer Error",{icon:"/xos/core/static/cord-logo.png",body:"The "+t.name+" synchronizer has stopped."}),o[t.name]=!0),a.showNoSync=!1,0===Object.keys(a.synchronizers).length&&(a.showNoSync=!0)})}]}}),angular.element(document).ready(function(){angular.bootstrap("#xosSynchronizerNotifier",["xos.synchronizerNotifier"])}),angular.module("xos.synchronizerNotifier").run(["$templateCache",function(n){n.put("templates/sync-status.tpl.html",'<div class="sync-status-container">\n  <div class="btn btn-default" ng-click="vm.showNotificationPanel = !vm.showNotificationPanel">\n    <i class="glyphicon glyphicon-inbox"></i>\n  </div>\n  <div class="notification-panel panel panel-default" ng-show="vm.showNotificationPanel">\n    <ul class="list-group" ng-show="!vm.showNoSync">\n      <li class="list-group-item" ng-repeat="(syncName, syncStatus) in vm.synchronizers">\n        <span class="badge" ng-class="{success: syncStatus.status, warning: !syncStatus.status}">\n          <span ng-show="syncStatus.status"><i class="glyphicon glyphicon-ok"></i></span>\n          <span ng-hide="syncStatus.status"><i class="glyphicon glyphicon-time"></i></span>\n        </span>\n        <b>{{syncName}}</b>\n        <br/>\n        <small><i>{{syncStatus.info.last_run | date:\'mediumTime\'}}</i></small>\n      </li>\n    </ul>\n    <div class="alert alert-info" ng-show="vm.showNoSync">\n      No syncronizers are running.\n    </div>\n  </div>\n</div>\n')}]),angular.module("xos.synchronizerNotifier").run(["$location",function(n){n.path("/")}]);
\ No newline at end of file
diff --git a/xos/services/__init__.py b/xos/services/__init__.py
index 8b13789..e69de29 100644
--- a/xos/services/__init__.py
+++ b/xos/services/__init__.py
@@ -1 +0,0 @@
-
diff --git a/xos/services/ceilometer/migrations/0001_initial.py b/xos/services/ceilometer/migrations/0001_initial.py
new file mode 100644
index 0000000..6a3dd15
--- /dev/null
+++ b/xos/services/ceilometer/migrations/0001_initial.py
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='CeilometerService',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'Ceilometer Service',
+                'proxy': True,
+            },
+            bases=('core.service',),
+        ),
+        migrations.CreateModel(
+            name='MonitoringChannel',
+            fields=[
+            ],
+            options={
+                'proxy': True,
+            },
+            bases=('core.tenantwithcontainer',),
+        ),
+        migrations.CreateModel(
+            name='SFlowService',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'sFlow Collection Service',
+                'proxy': True,
+            },
+            bases=('core.service',),
+        ),
+        migrations.CreateModel(
+            name='SFlowTenant',
+            fields=[
+            ],
+            options={
+                'proxy': True,
+            },
+            bases=('core.tenant',),
+        ),
+    ]
diff --git a/xos/services/ceilometer/migrations/__init__.py b/xos/services/ceilometer/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/services/ceilometer/migrations/__init__.py
diff --git a/xos/services/cord/migrations/0001_initial.py b/xos/services/cord/migrations/0001_initial.py
new file mode 100644
index 0000000..3651371
--- /dev/null
+++ b/xos/services/cord/migrations/0001_initial.py
@@ -0,0 +1,80 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='CordSubscriberRoot',
+            fields=[
+            ],
+            options={
+                'proxy': True,
+            },
+            bases=('core.subscriber',),
+        ),
+        migrations.CreateModel(
+            name='VBNGService',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'vBNG Service',
+                'proxy': True,
+            },
+            bases=('core.service',),
+        ),
+        migrations.CreateModel(
+            name='VBNGTenant',
+            fields=[
+            ],
+            options={
+                'proxy': True,
+            },
+            bases=('core.tenant',),
+        ),
+        migrations.CreateModel(
+            name='VOLTService',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'vOLT Service',
+                'proxy': True,
+            },
+            bases=('core.service',),
+        ),
+        migrations.CreateModel(
+            name='VOLTTenant',
+            fields=[
+            ],
+            options={
+                'proxy': True,
+            },
+            bases=('core.tenant',),
+        ),
+        migrations.CreateModel(
+            name='VSGService',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'vSG Service',
+                'proxy': True,
+            },
+            bases=('core.service',),
+        ),
+        migrations.CreateModel(
+            name='VSGTenant',
+            fields=[
+            ],
+            options={
+                'proxy': True,
+            },
+            bases=('core.tenantwithcontainer',),
+        ),
+    ]
diff --git a/xos/services/cord/migrations/__init__.py b/xos/services/cord/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/services/cord/migrations/__init__.py
diff --git a/xos/services/cord/templates/vcpeadmin.html b/xos/services/cord/templates/vcpeadmin.html
index c93f032..334a3e8 100644
--- a/xos/services/cord/templates/vcpeadmin.html
+++ b/xos/services/cord/templates/vcpeadmin.html
@@ -3,7 +3,7 @@
         <a class="btn btn-primary" href="/admin/cord/vsgtenant/">vSG Tenants</a>
     </div>
     <div class="col-xs-6">
-        <a class="btn btn-primary" href="/admin/dashboard/cord/">Subscriber View</a>
+        <a class="btn btn-primary" href="/admin/dashboard/subscribers/">Subscriber View</a>
     </div>
 </div>
 
diff --git a/xos/services/hpc/migrations/0001_initial.py b/xos/services/hpc/migrations/0001_initial.py
deleted file mode 100644
index e1bdd01..0000000
--- a/xos/services/hpc/migrations/0001_initial.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import django.utils.timezone
-from django.conf import settings
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
-        ('core', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='AccessMap',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('name', models.CharField(help_text=b'Name of the Access Map', max_length=64)),
-                ('description', models.TextField(max_length=130, null=True, blank=True)),
-                ('map', models.FileField(help_text=b'specifies which client requests are allowed', upload_to=b'maps/')),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-        migrations.CreateModel(
-            name='CDNPrefix',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
-                ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
-                ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
-                ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
-                ('deleted', models.BooleanField(default=False)),
-                ('cdn_prefix_id', models.IntegerField(null=True, blank=True)),
-                ('prefix', models.CharField(help_text=b'Registered Prefix for Domain', max_length=200)),
-                ('description', models.TextField(help_text=b'Description of Content Provider', max_length=254, null=True, blank=True)),
-                ('enabled', models.BooleanField(default=True)),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-        migrations.CreateModel(
-            name='ContentProvider',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
-                ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
-                ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
-                ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
-                ('deleted', models.BooleanField(default=False)),
-                ('content_provider_id', models.IntegerField(null=True, blank=True)),
-                ('name', models.CharField(max_length=254)),
-                ('enabled', models.BooleanField(default=True)),
-                ('description', models.TextField(help_text=b'Description of Content Provider', max_length=254, null=True, blank=True)),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-        migrations.CreateModel(
-            name='HpcService',
-            fields=[
-                ('service_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='core.Service')),
-            ],
-            options={
-                'verbose_name': 'HPC Service',
-            },
-            bases=('core.service', models.Model),
-        ),
-        migrations.CreateModel(
-            name='OriginServer',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
-                ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
-                ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
-                ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
-                ('deleted', models.BooleanField(default=False)),
-                ('origin_server_id', models.IntegerField(null=True, blank=True)),
-                ('url', models.URLField()),
-                ('authenticated', models.BooleanField(default=False, help_text=b'Status for this Site')),
-                ('enabled', models.BooleanField(default=True, help_text=b'Status for this Site')),
-                ('protocol', models.CharField(default=b'HTTP', max_length=12, choices=[(b'http', b'HTTP'), (b'rtmp', b'RTMP'), (b'rtp', b'RTP'), (b'shout', b'SHOUTcast')])),
-                ('redirects', models.BooleanField(default=True, help_text=b'Indicates whether Origin Server redirects should be used for this Origin Server')),
-                ('description', models.TextField(max_length=255, null=True, blank=True)),
-                ('contentProvider', models.ForeignKey(to='hpc.ContentProvider')),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-        migrations.CreateModel(
-            name='ServiceProvider',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
-                ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
-                ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
-                ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
-                ('deleted', models.BooleanField(default=False)),
-                ('service_provider_id', models.IntegerField(null=True, blank=True)),
-                ('name', models.CharField(help_text=b'Service Provider Name', max_length=254)),
-                ('description', models.TextField(help_text=b'Description of Service Provider', max_length=254, null=True, blank=True)),
-                ('enabled', models.BooleanField(default=True)),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-        migrations.CreateModel(
-            name='SiteMap',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('name', models.CharField(help_text=b'Name of the Site Map', max_length=64)),
-                ('description', models.TextField(max_length=130, null=True, blank=True)),
-                ('map', models.FileField(help_text=b'specifies how to map requests to hpc instances', upload_to=b'maps/')),
-                ('contentProvider', models.ForeignKey(blank=True, to='hpc.ContentProvider', null=True)),
-                ('serviceProvider', models.ForeignKey(blank=True, to='hpc.ServiceProvider', null=True)),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-        migrations.AddField(
-            model_name='contentprovider',
-            name='serviceProvider',
-            field=models.ForeignKey(to='hpc.ServiceProvider'),
-            preserve_default=True,
-        ),
-        migrations.AddField(
-            model_name='contentprovider',
-            name='users',
-            field=models.ManyToManyField(to=settings.AUTH_USER_MODEL),
-            preserve_default=True,
-        ),
-        migrations.AddField(
-            model_name='cdnprefix',
-            name='contentProvider',
-            field=models.ForeignKey(to='hpc.ContentProvider'),
-            preserve_default=True,
-        ),
-        migrations.AddField(
-            model_name='cdnprefix',
-            name='defaultOriginServer',
-            field=models.ForeignKey(blank=True, to='hpc.OriginServer', null=True),
-            preserve_default=True,
-        ),
-        migrations.AddField(
-            model_name='accessmap',
-            name='contentProvider',
-            field=models.ForeignKey(to='hpc.ContentProvider'),
-            preserve_default=True,
-        ),
-    ]
diff --git a/xos/services/mcord/__init__.py b/xos/services/mcord/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/services/mcord/__init__.py
diff --git a/xos/services/mcord/admin.py b/xos/services/mcord/admin.py
new file mode 100644
index 0000000..b496ef7
--- /dev/null
+++ b/xos/services/mcord/admin.py
@@ -0,0 +1,141 @@
+
+from core.admin import ReadOnlyAwareAdmin, SliceInline
+from core.middleware import get_request
+from core.models import User
+from django import forms
+from django.contrib import admin
+from services.mcord.models import MCORDService, VBBUComponent, MCORD_KIND
+
+# The class to provide an admin interface on the web for the service.
+# We do only configuration here and don't change any logic because the logic
+# is taken care of for us by ReadOnlyAwareAdmin
+class MCORDServiceAdmin(ReadOnlyAwareAdmin):
+    # We must set the model so that the admin knows what fields to use
+    model = MCORDService
+    verbose_name = "MCORD Service"
+    verbose_name_plural = "MCORD Services"
+
+    # Setting list_display creates columns on the admin page, each value here
+    # is a column, the column is populated for every instance of the model.
+    list_display = ("backend_status_icon", "name", "enabled")
+
+    # Used to indicate which values in the columns of the admin form are links.
+    list_display_links = ('backend_status_icon', 'name', )
+
+    # Denotes the sections of the form, the fields in the section, and the
+    # CSS classes used to style them. We represent this as a set of tuples, each
+    # tuple as a name (or None) and a set of fields and classes.
+    # Here the first section does not have a name so we use none. That first
+    # section has several fields indicated in the 'fields' attribute, and styled
+    # by the classes indicated in the 'classes' attribute. The classes given
+    # here are important for rendering the tabs on the form. To give the tabs
+    # we must assign the classes suit-tab and suit-tab-<name> where
+    # where <name> will be used later.
+    fieldsets = [(None, {'fields': ['backend_status_text', 'name', 'enabled',
+                                    'versionNumber', 'description', "view_url"],
+                         'classes':['suit-tab suit-tab-general']})]
+
+    # Denotes the fields that are readonly and cannot be changed.
+    readonly_fields = ('backend_status_text', )
+
+    # Inlines are used to denote other models that can be edited on the same
+    # form as this one. In this case the service form also allows changes
+    # to slices.
+    inlines = [SliceInline]
+
+    extracontext_registered_admins = True
+
+    # Denotes the fields that can be changed by an admin but not be all users
+    user_readonly_fields = ["name", "enabled", "versionNumber", "description"]
+
+    # Associates fieldsets from this form and from the inlines.
+    # The format here are tuples, of (<name>, tab title). <name> comes from the
+    # <name> in the fieldsets.
+    suit_form_tabs = (('general', 'MCORD Service Details'),
+                      ('administration', 'Components'),
+                      ('slices', 'Slices'),)
+
+    # Used to include a template for a tab. Here we include the
+    # helloworldserviceadmin template in the top position for the administration
+    # tab.
+    suit_form_includes = (('mcordadmin.html',
+                           'top',
+                           'administration'),)
+
+    # Used to get the objects for this model that are associated with the
+    # requesting user.
+    def queryset(self, request):
+        return MCORDService.get_service_objects_by_user(request.user)
+
+# Class to represent the form to add and edit tenants.
+# We need to define this instead of just using an admin like we did for the
+# service because tenants vary more than services and there isn't a common form.
+# This allows us to change the python behavior for the admin form to save extra
+# fields and control defaults.
+class VBBUComponentForm(forms.ModelForm):
+    # Defines a field for the creator of this service. It is a dropdown which
+    # is populated with all of the users.
+    creator = forms.ModelChoiceField(queryset=User.objects.all())
+    # Defines a text field for the display message, it is not required.
+    display_message = forms.CharField(required=False)
+
+    def __init__(self, *args, **kwargs):
+        super(VBBUComponentForm, self).__init__(*args, **kwargs)
+        # Set the kind field to readonly
+        self.fields['kind'].widget.attrs['readonly'] = True
+        # Define the logic for obtaining the objects for the provider_service
+        # dropdown of the tenant form.
+        self.fields[
+            'provider_service'].queryset = MCORDService.get_service_objects().all()
+        # Set the initial kind to HELLO_WORLD_KIND for this tenant.
+        self.fields['kind'].initial = MCORD_KIND
+        # If there is an instance of this model then we can set the initial
+        # form values to the existing values.
+        if self.instance:
+            self.fields['creator'].initial = self.instance.creator
+            self.fields[
+                'display_message'].initial = self.instance.display_message
+
+        # If there is not an instance then we need to set initial values.
+        if (not self.instance) or (not self.instance.pk):
+            self.fields['creator'].initial = get_request().user
+            if MCORDService.get_service_objects().exists():
+                self.fields["provider_service"].initial = MCORDService.get_service_objects().all()[0]
+
+    # This function describes what happens when the save button is pressed on
+    # the tenant form. In this case we set the values for the instance that were
+    # entered.
+    def save(self, commit=True):
+        self.instance.creator = self.cleaned_data.get("creator")
+        self.instance.display_message = self.cleaned_data.get(
+            "display_message")
+        return super(VBBUComponentForm, self).save(commit=commit)
+
+    class Meta:
+        model = VBBUComponent
+
+# Define the admin form for the tenant. This uses a similar structure as the
+# service but uses HelloWorldTenantCompleteForm to change the python behavior.
+
+
+class VBBUComponentAdmin(ReadOnlyAwareAdmin):
+    verbose_name = "vBBU Component"
+    verbose_name_plural = "vBBU Components"
+    list_display = ('id', 'backend_status_icon', 'instance', 'display_message')
+    list_display_links = ('backend_status_icon', 'instance', 'display_message',
+                          'id')
+    fieldsets = [(None, {'fields': ['backend_status_text', 'kind',
+                                    'provider_service', 'instance', 'creator',
+                                    'display_message'],
+                         'classes': ['suit-tab suit-tab-general']})]
+    readonly_fields = ('backend_status_text', 'instance',)
+    form = VBBUComponentForm
+
+    suit_form_tabs = (('general', 'Details'),)
+
+    def queryset(self, request):
+        return VBBUComponent.get_tenant_objects_by_user(request.user)
+
+# Associate the admin forms with the models.
+admin.site.register(MCORDService, MCORDServiceAdmin)
+admin.site.register(VBBUComponent, VBBUComponentAdmin)
diff --git a/xos/services/mcord/migrations/0001_initial.py b/xos/services/mcord/migrations/0001_initial.py
new file mode 100644
index 0000000..c53e548
--- /dev/null
+++ b/xos/services/mcord/migrations/0001_initial.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='MCORDService',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'MCORD Service',
+                'proxy': True,
+            },
+            bases=('core.service',),
+        ),
+        migrations.CreateModel(
+            name='VBBUComponent',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'VBBU MCORD Service Component',
+                'proxy': True,
+            },
+            bases=('core.tenantwithcontainer',),
+        ),
+    ]
diff --git a/xos/services/mcord/migrations/__init__.py b/xos/services/mcord/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/services/mcord/migrations/__init__.py
diff --git a/xos/services/mcord/models.py b/xos/services/mcord/models.py
new file mode 100644
index 0000000..1b2bd65
--- /dev/null
+++ b/xos/services/mcord/models.py
@@ -0,0 +1,283 @@
+from django.db import models
+from core.models import Service, PlCoreBase, Slice, Instance, Tenant, TenantWithContainer, Node, Image, User, Flavor, Subscriber, NetworkParameter, NetworkParameterType, AddressPool, Port
+from core.models.plcorebase import StrippedCharField
+import os
+from django.db import models, transaction
+from django.forms.models import model_to_dict
+from django.db.models import Q
+from operator import itemgetter, attrgetter, methodcaller
+from core.models import Tag
+from core.models.service import LeastLoadedNodeScheduler
+import traceback
+from xos.exceptions import *
+from core.models import SlicePrivilege, SitePrivilege
+from sets import Set
+from xos.config import Config
+
+MCORD_KIND = "RAN" # This should be changed later I did it fo demo
+MCORD_USE_VTN = getattr(Config(), "networking_use_vtn", False)
+VBBU_KIND = "RAN"
+VSGW_KIND = "vSGW"
+VPGW_KIND = "vPGW"
+net_types = ("s1u", "s1mme", "rru")
+# The class to represent the service. Most of the service logic is given for us
+# in the Service class but, we have some configuration that is specific for
+# this example.
+class MCORDService(Service):
+    KIND = MCORD_KIND
+
+    class Meta:
+        # When the proxy field is set to True the model is represented as
+        # it's superclass in the database, but we can still change the python
+        # behavior. In this case HelloWorldServiceComplete is a Service in the
+        # database.
+        proxy = True
+        # The name used to find this service, all directories are named this
+        app_label = "mcord"
+        verbose_name = "MCORD Service"
+
+# This is the class to represent the tenant. Most of the logic is given to use
+# in TenantWithContainer, however there is some configuration and logic that
+# we need to define for this example.
+class VBBUComponent(TenantWithContainer):
+
+    class Meta:
+        # Same as a above, HelloWorldTenantComplete is represented as a
+        # TenantWithContainer, but we change the python behavior.
+        proxy = True
+        verbose_name = "VBBU MCORD Service Component"
+
+    # The kind of the service is used on forms to differentiate this service
+    # from the other services.
+    KIND = VBBU_KIND
+
+    # Ansible requires that the sync_attributes field contain nat_ip and nat_mac
+    # these will be used to determine where to SSH to for ansible.
+    # Getters must be defined for every attribute specified here.
+    sync_attributes = ("s1u_ip", "s1u_mac",
+                       "s1mme_ip", "s1mme_mac",
+                       "rru_ip", "rru_mac")
+    # default_attributes is used cleanly indicate what the default values for
+    # the fields are.
+    default_attributes = {"display_message": "New vBBU Component", "s1u_tag": "901", "s1mme_tag": "900", "rru_tag": "999"}
+    def __init__(self, *args, **kwargs):
+        mcord_services = MCORDService.get_service_objects().all()
+        # When the tenant is created the default service in the form is set
+        # to be the first created HelloWorldServiceComplete
+        if mcord_services:
+            self._meta.get_field(
+                "provider_service").default = mcord_services[0].id
+        super(VBBUComponent, self).__init__(*args, **kwargs)
+
+    def can_update(self, user):
+        #Allow creation of this model instances for non-admin users also
+        return True
+
+    def save(self, *args, **kwargs):
+        if not self.creator:
+            if not getattr(self, "caller", None):
+                # caller must be set when creating a monitoring channel since it creates a slice
+                raise XOSProgrammingError("ServiceComponents's self.caller was not set")
+            self.creator = self.caller
+            if not self.creator:
+                raise XOSProgrammingError("ServiceComponents's self.creator was not set")
+
+        super(VBBUComponent, self).save(*args, **kwargs)
+        # This call needs to happen so that an instance is created for this
+        # tenant is created in the slice. One instance is created per tenant.
+        model_policy_mcord_servicecomponent(self.pk)
+
+    def save_instance(self, instance):
+        with transaction.atomic():
+            super(VBBUComponent, self).save_instance(instance)
+            if instance.isolation in ["vm"]:
+                for ntype in net_types:
+                    lan_network = self.get_lan_network(instance, ntype)
+                    port = self.find_or_make_port(instance,lan_network)
+                    if (ntype == "s1u"):
+                        port.set_parameter("s_tag", self.s1u_tag)
+                        port.set_parameter("neutron_port_name", "stag-%s" % self.s1u_tag)
+                        port.save()
+                    elif (ntype == "s1mme"):
+                        port.set_parameter("s_tag", self.s1mme_tag)
+                        port.set_parameter("neutron_port_name", "stag-%s" % self.s1mme_tag)
+                        port.save()
+                    elif (ntype == "rru"):
+                        port.set_parameter("s_tag", self.rru_tag)
+                        port.set_parameter("neutron_port_name", "stag-%s" % self.rru_tag)
+                        port.save()
+    
+    def delete(self, *args, **kwargs):
+        # Delete the instance that was created for this tenant
+        self.cleanup_container()
+        super(VBBUComponent, self).delete(*args, **kwargs)
+
+    def find_or_make_port(self, instance, network, **kwargs):
+        port = Port.objects.filter(instance=instance, network=network)
+        if port:
+            port = port[0]
+            print "port already exist", port[0]
+        else:
+            port = Port(instance=instance, network=network, **kwargs)
+            print "NETWORK", network, "MAKE_PORT", port 
+            port.save()
+        return port
+
+    def get_lan_network(self, instance, ntype):
+        slice = self.provider_service.slices.all()[0]
+        lan_networks = [x for x in slice.networks.all() if ntype in x.name]
+        if not lan_networks:
+            raise XOSProgrammingError("No lan_network")
+        return lan_networks[0]
+
+    def manage_container(self):
+        from core.models import Instance, Flavor
+
+        if self.deleted:
+            return
+
+        # For container or container_vm isolation, use what TenantWithCotnainer
+        # provides us
+        slice = self.get_slice()
+        if slice.default_isolation in ["container_vm", "container"]:
+            super(VBBUComponent,self).manage_container()
+            return
+
+        if not self.s1u_tag:
+            raise XOSConfigurationError("S1U_TAG is missed")
+
+        if not self.s1mme_tag:
+            raise XOSConfigurationError("S1U_TAG is missed")
+
+        if not self.rru_tag:
+            raise XOSConfigurationError("S1U_TAG is missed")
+
+        if self.instance:
+            # We're good.
+            return
+
+        instance = self.make_instance()
+        self.instance = instance
+        super(TenantWithContainer, self).save()
+
+    def get_slice(self):
+        if not self.provider_service.slices.count():
+            raise XOSConfigurationError("The service has no slices")
+        slice = self.provider_service.slices.all()[0]
+        return slice
+
+    def make_instance(self):
+        slice = self.provider_service.slices.all()[0]            
+        flavors = Flavor.objects.filter(name=slice.default_flavor)
+#        flavors = Flavor.objects.filter(name="m1.xlarge")
+        if not flavors:
+            raise XOSConfigurationError("No default flavor")
+        default_flavor = slice.default_flavor
+        slice = self.provider_service.slices.all()[0]
+        if slice.default_isolation == "container_vm":
+            (node, parent) = ContainerVmScheduler(slice).pick()
+        else:
+            (node, parent) = LeastLoadedNodeScheduler(slice).pick()
+        instance = Instance(slice = slice,
+                        node = node,
+                        image = self.image,
+                        creator = self.creator,
+                        deployment = node.site_deployment.deployment,
+                        flavor = flavors[0],
+                        isolation = slice.default_isolation,
+                        parent = parent)
+        self.save_instance(instance)
+        return instance
+
+    def ip_to_mac(self, ip):
+        (a, b, c, d) = ip.split('.')
+        return "02:42:%02x:%02x:%02x:%02x" % (int(a), int(b), int(c), int(d))
+
+    # Getter for the message that will appear on the webpage
+    # By default it is "Hello World!"
+    @property
+    def display_message(self):
+        return self.get_attribute(
+            "display_message",
+            self.default_attributes['display_message'])
+
+    @display_message.setter
+    def display_message(self, value):
+        self.set_attribute("display_message", value)
+
+    @property
+    def s1u_tag(self):
+        return self.get_attribute(
+            "s1u_tag",
+            self.default_attributes['s1u_tag'])
+
+    @s1u_tag.setter
+    def s1u_tag(self, value):
+        self.set_attribute("s1u_tag", value)
+
+    @property
+    def s1mme_tag(self):
+        return self.get_attribute(
+            "s1mme_tag",
+            self.default_attributes['s1mme_tag'])
+
+    @s1mme_tag.setter
+    def s1mme_tag(self, value):
+        self.set_attribute("s1mme_tag", value)
+
+    @property
+    def rru_tag(self):
+        return self.get_attribute(
+            "rru_tag",
+            self.default_attributes['rru_tag'])
+
+    @rru_tag.setter
+    def rru_tag(self, value):
+        self.set_attribute("rru_tag", value)
+
+
+    @property
+    def addresses(self):
+        if (not self.id) or (not self.instance):
+            return {}
+
+        addresses = {}
+        for ns in self.instance.ports.all():
+            if "s1u" in ns.network.name.lower():
+                addresses["s1u"] = (ns.ip, ns.mac)
+            elif "s1mme" in ns.network.name.lower():
+                addresses["s1mme"] = (ns.ip, ns.mac)
+            elif "rru" in ns.network.name.lower():
+                addresses["rru"] = (ns.ip, ns.mac)
+        return addresses
+
+
+    @property
+    def s1u_ip(self):
+        return self.addresses.get("s1u", (None, None))[0]
+    @property
+    def s1u_mac(self):
+        return self.addresses.get("s1u", (None, None))[1]
+    @property
+    def s1mme_ip(self):
+        return self.addresses.get("s1mme", (None, None))[0]
+    @property
+    def s1mme_mac(self):
+        return self.addresses.get("s1mme", (None, None))[1]
+    @property
+    def rru_ip(self):
+        return self.addresses.get("rru", (None, None))[0]
+    @property
+    def rru_mac(self):
+        return self.addresses.get("rru", (None, None))[1]
+
+def model_policy_mcord_servicecomponent(pk):
+    # This section of code is atomic to prevent race conditions
+    with transaction.atomic():
+        # We find all of the tenants that are waiting to update
+        component = VBBUComponent.objects.select_for_update().filter(pk=pk)
+        if not component:
+            return
+        # Since this code is atomic it is safe to always use the first tenant
+        component = component[0]
+        component.manage_container()
diff --git a/xos/services/mcord/templates/mcordadmin.html b/xos/services/mcord/templates/mcordadmin.html
new file mode 100644
index 0000000..4a69dcc
--- /dev/null
+++ b/xos/services/mcord/templates/mcordadmin.html
@@ -0,0 +1,10 @@
+<!-- Template used to for the button leading to the HelloWorldTenantComplete form. -->
+<div class = "left-nav">
+  <ul>
+    <li>
+      <a href="/admin/mcordservice/vbbucomponent/">
+        MCORD Service Components
+      </a>
+    </li>
+  </ul>
+</div>
diff --git a/xos/services/mcord/view.py b/xos/services/mcord/view.py
new file mode 100644
index 0000000..dc5f06a
--- /dev/null
+++ b/xos/services/mcord/view.py
@@ -0,0 +1,106 @@
+from django.http import HttpResponse
+from django.views.generic import TemplateView, View
+from django import template
+from core.models import *
+import json
+import os
+import time
+import tempfile
+
+
+class MCordView(TemplateView):
+    head_template = r"""{% extends "admin/dashboard/dashboard_base.html" %}
+       {% load admin_static %}
+       {% block content %}
+    """
+
+    tail_template = r"{% endblock %}"
+
+    def get(self, request, name="root", *args, **kwargs):
+        head_template = self.head_template
+        tail_template = self.tail_template
+
+        title = request.GET.get('service', '')
+        url = "/mcord/?service=%s" % (title)
+
+        form = """
+        <h2 class="content-title">Change %s Service</h2>
+        <div id="content-main">
+            <form class="form-horizontal">
+                <div class="tab-content tab-content-main">
+                    <div class="suit-include suit-tab suit-tab-administration hide">
+                        <div class="left-nav">
+                            <ul>
+                                <li><a href="/admin/ceilometer/monitoringchannel/">Monitoring Channels</a></li>
+                            </ul>
+                        </div>
+                    </div>
+                    <fieldset class="module aligned suit-tab suit-tab-general show">
+                        <div class="panel fieldset-body">
+                            <div class="form-group field-backend_status_text ">
+                                <label class="control-label col-xs-12 col-sm-2"><label>Backend status text:</label></label>
+                                <div class="form-column col-xs-12 col-sm-8 col-md-6 col-lg-4">
+                                    <p><img src="/static/admin/img/icon_clock.gif"> Pending sync, last_status = 0 - Provisioning in progress</p>
+                                </div>
+                            </div>
+                            <div class="form-group field-name ">
+                                <label class="control-label col-xs-12 col-sm-2"><label class="required" for="id_name">Name:</label></label>
+                                <div class="form-column widget-AdminTextInputWidget col-xs-12 col-sm-8 col-md-6 col-lg-4">
+                                    <input class="vTextField form-control" id="id_name" maxlength="30" name="name" type="text" value="%s">
+                                    <div class="help-block">Service Name</div>
+                                </div>
+                            </div>
+                            <div class="form-group field-enabled ">
+                                <label class="control-label col-xs-12 col-sm-2"><label class="vCheckboxLabel" for="id_enabled">Enabled</label></label>
+                                <div class="form-column widget-CheckboxInput col-xs-12 col-sm-8 col-md-6 col-lg-4">
+                                    <input checked="checked" id="id_enabled" name="enabled" type="checkbox">
+                                </div>
+                            </div>
+                            <div class="form-group field-versionNumber ">
+                                <label class="control-label col-xs-12 col-sm-2"><label class="required" for="id_versionNumber">VersionNumber:</label></label>
+                                <div class="form-column widget-AdminTextInputWidget col-xs-12 col-sm-8 col-md-6 col-lg-4">
+                                    <input class="vTextField form-control" id="id_versionNumber" maxlength="30" name="versionNumber" type="text">
+                                    <div class="help-block">Version of Service Definition</div>
+                                </div>
+                            </div>
+                            <div class="form-group field-description ">
+                                <label class="control-label col-xs-12 col-sm-2"><label for="id_description">Description:</label></label>
+                                <div class="form-column widget-AdminTextareaWidget col-xs-12 col-sm-8 col-md-6 col-lg-4">
+                                    <textarea class="vLargeTextField form-control" cols="40" id="id_description" maxlength="254" name="description" rows="10"></textarea>
+                                    <div class="help-block">Description of Service</div>
+                                </div>
+                            </div>
+                            <div class="form-group field-view_url ">
+                                <label class="control-label col-xs-12 col-sm-2"><label for="id_view_url">View url:</label></label>
+                                <div class="form-column widget-AdminTextInputWidget col-xs-12 col-sm-8 col-md-6 col-lg-4">
+                                    <input class="vTextField form-control" id="id_view_url" maxlength="1024" name="view_url" type="text" value="%s">
+                                </div>
+                            </div>
+                            <div class="form-group field-icon_url ">
+                                <label class="control-label col-xs-12 col-sm-2"><label for="id_icon_url">Icon url:</label></label>
+                                <div class="form-column widget-AdminTextInputWidget col-xs-12 col-sm-8 col-md-6 col-lg-4">
+                                    <input class="vTextField form-control" id="id_icon_url" maxlength="1024" name="icon_url" type="text">
+                                </div>
+                            </div>
+                        </div>
+                    </fieldset>
+                </div>
+            </form>
+            <div class="form-buttons clearfix">
+                <button type="submit" class="btn btn-high btn-success" name="_save">Save</button>
+                <button type="submit" name="_continue" class=" btn btn-high btn-info">Save and continue editing</button>
+                <button type="submit" name="_addanother" class="btn btn-info">Save and add another</button>
+                <a href="delete/" class="text-error deletelink">Delete</a>
+            </div>
+        </div>
+        """ % (title, title, url)
+
+        t = template.Template(head_template + form + tail_template)
+
+        response_kwargs = {}
+        response_kwargs.setdefault('content_type', self.content_type)
+        return self.response_class(
+            request=request,
+            template=t,
+            **response_kwargs
+        )
diff --git a/xos/services/onos/migrations/0001_initial.py b/xos/services/onos/migrations/0001_initial.py
new file mode 100644
index 0000000..1df9da7
--- /dev/null
+++ b/xos/services/onos/migrations/0001_initial.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='ONOSApp',
+            fields=[
+            ],
+            options={
+                'proxy': True,
+            },
+            bases=('core.tenant',),
+        ),
+        migrations.CreateModel(
+            name='ONOSService',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'ONOS Service',
+                'proxy': True,
+            },
+            bases=('core.service',),
+        ),
+    ]
diff --git a/xos/services/onos/migrations/__init__.py b/xos/services/onos/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/services/onos/migrations/__init__.py
diff --git a/xos/services/requestrouter/migrations/0001_initial.py b/xos/services/requestrouter/migrations/0001_initial.py
deleted file mode 100644
index a398283..0000000
--- a/xos/services/requestrouter/migrations/0001_initial.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import django.utils.timezone
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('core', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='RequestRouterService',
-            fields=[
-                ('service_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='core.Service')),
-                ('behindNat', models.BooleanField(default=False, help_text=b"Enables 'Behind NAT' mode.")),
-                ('defaultTTL', models.PositiveIntegerField(default=30, help_text=b'DNS response time-to-live(TTL)')),
-                ('defaultAction', models.CharField(default=b'best', help_text=b'Review if this should be enum', max_length=30)),
-                ('lastResortAction', models.CharField(default=b'random', help_text=b'Review if this should be enum', max_length=30)),
-                ('maxAnswers', models.PositiveIntegerField(default=3, help_text=b'Maximum number of answers in DNS response.')),
-            ],
-            options={
-                'verbose_name': 'Request Router Service',
-            },
-            bases=('core.service', models.Model),
-        ),
-        migrations.CreateModel(
-            name='ServiceMap',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
-                ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
-                ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
-                ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
-                ('deleted', models.BooleanField(default=False)),
-                ('name', models.SlugField(help_text=b'name of this service map', unique=True)),
-                ('prefix', models.CharField(help_text=b'FQDN of the region of URI space managed by RR on behalf of this service', max_length=256)),
-                ('siteMap', models.FileField(help_text=b'maps client requests to service instances', upload_to=b'maps/', blank=True)),
-                ('accessMap', models.FileField(help_text=b'specifies which client requests are allowed', upload_to=b'maps/', blank=True)),
-                ('owner', models.ForeignKey(help_text=b'service which owns this map', to='core.Service')),
-                ('slice', models.ForeignKey(help_text=b'slice that implements this service', to='core.Slice')),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-    ]
diff --git a/xos/services/syndicate_storage/migrations/0001_initial.py b/xos/services/syndicate_storage/migrations/0001_initial.py
deleted file mode 100644
index f0065ce..0000000
--- a/xos/services/syndicate_storage/migrations/0001_initial.py
+++ /dev/null
@@ -1,127 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import services.syndicate_storage.models
-import django.utils.timezone
-from django.conf import settings
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
-        ('core', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='SliceSecret',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('secret', services.syndicate_storage.models.ObserverSecretValue(help_text=b"Shared secret between OpenCloud and this slice's Syndicate daemons.", blank=True)),
-                ('slice_id', models.ForeignKey(to='core.Slice')),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-        migrations.CreateModel(
-            name='SyndicatePrincipal',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
-                ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
-                ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
-                ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
-                ('deleted', models.BooleanField(default=False)),
-                ('principal_id', models.TextField(unique=True)),
-                ('public_key_pem', models.TextField()),
-                ('sealed_private_key', models.TextField()),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-        migrations.CreateModel(
-            name='SyndicateService',
-            fields=[
-                ('service_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='core.Service')),
-            ],
-            options={
-                'verbose_name': 'Syndicate Service',
-                'verbose_name_plural': 'Syndicate Service',
-            },
-            bases=('core.service', models.Model),
-        ),
-        migrations.CreateModel(
-            name='Volume',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
-                ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
-                ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
-                ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
-                ('deleted', models.BooleanField(default=False)),
-                ('name', models.CharField(help_text=b'Human-readable, searchable name of the Volume', max_length=64)),
-                ('description', models.TextField(help_text=b'Human-readable description of what this Volume is used for.', max_length=130, null=True, blank=True)),
-                ('blocksize', models.PositiveIntegerField(help_text=b'Number of bytes per block.')),
-                ('private', models.BooleanField(default=True, help_text=b'Indicates if the Volume is visible to users other than the Volume Owner and Syndicate Administrators.')),
-                ('archive', models.BooleanField(default=False, help_text=b'Indicates if this Volume is read-only, and only an Aquisition Gateway owned by the Volume owner (or Syndicate admin) can write to it.')),
-                ('cap_read_data', models.BooleanField(default=True, help_text=b'VM can read Volume data')),
-                ('cap_write_data', models.BooleanField(default=True, help_text=b'VM can write Volume data')),
-                ('cap_host_data', models.BooleanField(default=True, help_text=b'VM can host Volume data')),
-                ('owner_id', models.ForeignKey(verbose_name=b'Owner', to=settings.AUTH_USER_MODEL)),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-        migrations.CreateModel(
-            name='VolumeAccessRight',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
-                ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
-                ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
-                ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
-                ('deleted', models.BooleanField(default=False)),
-                ('cap_read_data', models.BooleanField(default=True, help_text=b'VM can read Volume data')),
-                ('cap_write_data', models.BooleanField(default=True, help_text=b'VM can write Volume data')),
-                ('cap_host_data', models.BooleanField(default=True, help_text=b'VM can host Volume data')),
-                ('owner_id', models.ForeignKey(verbose_name=b'user', to=settings.AUTH_USER_MODEL)),
-                ('volume', models.ForeignKey(to='syndicate_storage.Volume')),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-        migrations.CreateModel(
-            name='VolumeSlice',
-            fields=[
-                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
-                ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
-                ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
-                ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
-                ('deleted', models.BooleanField(default=False)),
-                ('cap_read_data', models.BooleanField(default=True, help_text=b'VM can read Volume data')),
-                ('cap_write_data', models.BooleanField(default=True, help_text=b'VM can write Volume data')),
-                ('cap_host_data', models.BooleanField(default=True, help_text=b'VM can host Volume data')),
-                ('UG_portnum', models.PositiveIntegerField(help_text=b'User Gateway port.  Any port above 1024 will work, but it must be available slice-wide.', verbose_name=b'UG port')),
-                ('RG_portnum', models.PositiveIntegerField(help_text=b'Replica Gateway port.  Any port above 1024 will work, but it must be available slice-wide.', verbose_name=b'RG port')),
-                ('credentials_blob', models.TextField(help_text=b'Encrypted slice credentials, sealed with the slice secret.', null=True, blank=True)),
-                ('slice_id', models.ForeignKey(verbose_name=b'Slice', to='core.Slice')),
-                ('volume_id', models.ForeignKey(verbose_name=b'Volume', to='syndicate_storage.Volume')),
-            ],
-            options={
-            },
-            bases=(models.Model,),
-        ),
-        migrations.AddField(
-            model_name='volume',
-            name='slice_id',
-            field=models.ManyToManyField(to='core.Slice', through='syndicate_storage.VolumeSlice'),
-            preserve_default=True,
-        ),
-    ]
diff --git a/xos/services/vrouter/migrations/0001_initial.py b/xos/services/vrouter/migrations/0001_initial.py
new file mode 100644
index 0000000..f11fc91
--- /dev/null
+++ b/xos/services/vrouter/migrations/0001_initial.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='VRouterService',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'vRouter Service',
+                'proxy': True,
+            },
+            bases=('core.service',),
+        ),
+        migrations.CreateModel(
+            name='VRouterTenant',
+            fields=[
+            ],
+            options={
+                'proxy': True,
+            },
+            bases=('core.tenant',),
+        ),
+    ]
diff --git a/xos/services/vrouter/migrations/__init__.py b/xos/services/vrouter/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/services/vrouter/migrations/__init__.py
diff --git a/xos/services/vtn/migrations/0001_initial.py b/xos/services/vtn/migrations/0001_initial.py
new file mode 100644
index 0000000..90bf43f
--- /dev/null
+++ b/xos/services/vtn/migrations/0001_initial.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='VTNService',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'VTN Service',
+                'proxy': True,
+            },
+            bases=('core.service',),
+        ),
+    ]
diff --git a/xos/services/vtn/migrations/__init__.py b/xos/services/vtn/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/services/vtn/migrations/__init__.py
diff --git a/xos/services/vtr/migrations/0001_initial.py b/xos/services/vtr/migrations/0001_initial.py
new file mode 100644
index 0000000..540eccb
--- /dev/null
+++ b/xos/services/vtr/migrations/0001_initial.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='VTRService',
+            fields=[
+            ],
+            options={
+                'verbose_name': 'vTR Service',
+                'proxy': True,
+            },
+            bases=('core.service',),
+        ),
+        migrations.CreateModel(
+            name='VTRTenant',
+            fields=[
+            ],
+            options={
+                'proxy': True,
+            },
+            bases=('core.tenant',),
+        ),
+    ]
diff --git a/xos/services/vtr/migrations/__init__.py b/xos/services/vtr/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/services/vtr/migrations/__init__.py
diff --git a/xos/synchronizers/base/diag.py b/xos/synchronizers/base/diag.py
index 170daad..87fab70 100644
--- a/xos/synchronizers/base/diag.py
+++ b/xos/synchronizers/base/diag.py
@@ -14,7 +14,7 @@
     try:
         observer_name = Config().observer_name
     except:
-        observer_name = 'global'
+        observer_name = 'openstack'
 
     try:
         diag = Diag.objects.filter(name=observer_name).first()
diff --git a/xos/synchronizers/base/event_loop.py b/xos/synchronizers/base/event_loop.py
index 5f31c96..37ec4ca 100644
--- a/xos/synchronizers/base/event_loop.py
+++ b/xos/synchronizers/base/event_loop.py
@@ -524,6 +524,7 @@
                         loop_end = time.time()
 
                         update_diag(loop_end=loop_end, loop_start=loop_start, backend_status="1 - Bottom Of Loop")
+
                 except Exception, e:
                         logger.error('Core error. This seems like a misconfiguration or bug: %r. This error will not be relayed to the user!' % e)
                         logger.log_exc("Exception in observer run loop")
diff --git a/xos/synchronizers/base/syncstep.py b/xos/synchronizers/base/syncstep.py
index 27bb358..2fa6c38 100644
--- a/xos/synchronizers/base/syncstep.py
+++ b/xos/synchronizers/base/syncstep.py
@@ -229,7 +229,16 @@
                         o.delete(purge=True)
                     else:
                         new_enacted = timezone.now()
+                        try:
+                            run_always = self.run_always
+                        except AttributeError:
+                            run_always = False
+
                         self.sync_record(o)
+
+#                         if (not run_always):
+#                             o.enacted = new_enacted
+
                         update_diag(syncrecord_start = time.time(), backend_status="1 - Synced Record")
                         o.enacted = new_enacted
                         scratchpad = {'next_run':0, 'exponent':0, 'last_success':time.time()}
diff --git a/xos/synchronizers/openstack/steps/sync_controller_networks.py b/xos/synchronizers/openstack/steps/sync_controller_networks.py
index 5375a8d..cf855c6 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_networks.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_networks.py
@@ -56,8 +56,21 @@
             # If a subnet is already specified (pass in by the creator), then
             # use that rather than auto-generating one.
             cidr = controller_network.subnet.strip()
+            print "CIDR_MS", cidr
         else:
             cidr = self.alloc_subnet(controller_network.pk)
+            print "CIDR_AMS", cidr
+
+        if controller_network.network.start_ip and controller_network.network.start_ip.strip():
+            start_ip = controller_network.network.start_ip.strip()
+        else:
+            start_ip = None
+
+        if controller_network.network.end_ip and controller_network.network.end_ip.strip():
+            end_ip = controller_network.network.end_ip.strip()
+        else:
+            end_ip = None
+
         self.cidr=cidr
         slice = controller_network.network.owner
 
@@ -72,6 +85,8 @@
                     'ansible_tag':'%s-%s@%s'%(network_name,slice.slicename,controller_network.controller.name),
                     'cidr':cidr,
                     'gateway':self.alloc_gateway(cidr),
+                    'start_ip':start_ip,
+                    'end_ip':end_ip,
                     'use_vtn':getattr(Config(), "networking_use_vtn", False),
                     'delete':False
                     }
diff --git a/xos/synchronizers/openstack/steps/sync_controller_networks.yaml b/xos/synchronizers/openstack/steps/sync_controller_networks.yaml
index b885516..6fb9a92 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_networks.yaml
+++ b/xos/synchronizers/openstack/steps/sync_controller_networks.yaml
@@ -35,5 +35,11 @@
         {% endif %}
         dns_nameservers=8.8.8.8
         cidr={{ cidr }}
+  {% if start_ip %}
+        allocation_pool_start={{ start_ip }}
+  {% endif %}
+  {% if end_ip %}
+        allocation_pool_end={{ end_ip }}
+  {% endif %}
         {% endif %}
   {% endif %}
diff --git a/xos/synchronizers/openstack/steps/sync_instances.py b/xos/synchronizers/openstack/steps/sync_instances.py
index 3a1bc52..faeb860 100644
--- a/xos/synchronizers/openstack/steps/sync_instances.py
+++ b/xos/synchronizers/openstack/steps/sync_instances.py
@@ -56,8 +56,9 @@
             if network:
                 tem = network.template
                 if (tem.visibility == "private") and (tem.translation=="none") and ("management" in tem.name):
-                    if len(result)!=1:
-                        raise Exception("Management network needs to be inserted in slot 1, but there are %d private nics" % len(result))
+#MCORD
+#                    if len(result)!=1:
+#                        raise Exception("Management network needs to be inserted in slot 1, but there are %d private nics" % len(result))
                     result.append(nic)
                     nics.remove(nic)
 
diff --git a/xos/synchronizers/vbbu/__init__.py b/xos/synchronizers/vbbu/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/synchronizers/vbbu/__init__.py
diff --git a/xos/synchronizers/vbbu/model-deps b/xos/synchronizers/vbbu/model-deps
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/xos/synchronizers/vbbu/model-deps
@@ -0,0 +1 @@
+{}
diff --git a/xos/synchronizers/vbbu/run.sh b/xos/synchronizers/vbbu/run.sh
new file mode 100644
index 0000000..27d4e24
--- /dev/null
+++ b/xos/synchronizers/vbbu/run.sh
@@ -0,0 +1,3 @@
+# Runs the XOS observer using helloworldservice_config
+export XOS_DIR=/opt/xos
+python vbbu-synchronizer.py  -C $XOS_DIR/synchronizers/vbbu/vbbu_config
diff --git a/xos/synchronizers/vbbu/steps/sync_vbbu.py b/xos/synchronizers/vbbu/steps/sync_vbbu.py
new file mode 100644
index 0000000..09b1fe8
--- /dev/null
+++ b/xos/synchronizers/vbbu/steps/sync_vbbu.py
@@ -0,0 +1,37 @@
+import os
+import sys
+from django.db.models import Q, F
+from services.mcord.models import MCORDService, VBBUComponent
+from synchronizers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
+
+parentdir = os.path.join(os.path.dirname(__file__), "..")
+sys.path.insert(0, parentdir)
+
+class SyncVBBUComponent(SyncInstanceUsingAnsible):
+
+    provides = [VBBUComponent]
+
+    observes = VBBUComponent
+
+    requested_interval = 0
+
+    template_name = "sync_vbbu.yaml"
+
+    service_key_name = "/opt/xos/configurations/mcord/mcord_private_key"
+
+    def __init__(self, *args, **kwargs):
+        super(SyncVBBUComponent, self).__init__(*args, **kwargs)
+
+    def fetch_pending(self, deleted):
+
+        if (not deleted):
+            objs = VBBUComponent.get_tenant_objects().filter(
+                Q(enacted__lt=F('updated')) | Q(enacted=None), Q(lazy_blocked=False))
+        else:
+
+            objs = VBBUComponent.get_deleted_tenant_objects()
+
+        return objs
+
+    def get_extra_attributes(self, o):
+        return {"display_message": o.display_message, "s1u_tag": o.s1u_tag, "s1mme_tag": o.s1mme_tag, "rru_tag": o.rru_tag}
diff --git a/xos/synchronizers/vbbu/steps/sync_vbbu.yaml b/xos/synchronizers/vbbu/steps/sync_vbbu.yaml
new file mode 100644
index 0000000..1e1e258
--- /dev/null
+++ b/xos/synchronizers/vbbu/steps/sync_vbbu.yaml
@@ -0,0 +1,19 @@
+---
+- hosts: {{ instance_name }}
+  gather_facts: False
+  connection: ssh
+  user: ubuntu
+  sudo: yes
+  tasks:
+
+  - name: write message
+    shell: echo "{{ display_message }}" > /var/tmp/index.html
+
+  - name: setup s1u interface config
+    shell: ./start_3gpp_int.sh eth1 {{ s1u_tag }} {{ s1u_ip }}/24 
+
+  - name: setup s1mme interface config
+    shell: ./start_3gpp_int.sh eth2 {{ s1mme_tag }} {{ s1mme_ip }}/24 
+
+  - name: setup rru interface config
+    shell: ./start_3gpp_int.sh eth3 {{ rru_tag }} {{ rru_ip }}/24 
diff --git a/xos/synchronizers/vbbu/stop.sh b/xos/synchronizers/vbbu/stop.sh
new file mode 100644
index 0000000..7ad7f4c
--- /dev/null
+++ b/xos/synchronizers/vbbu/stop.sh
@@ -0,0 +1,2 @@
+# Kill the observer
+pkill -9 -f vbbu-synchronizer.py
diff --git a/xos/synchronizers/vbbu/vbbu-synchronizer.py b/xos/synchronizers/vbbu/vbbu-synchronizer.py
new file mode 100644
index 0000000..95f4081
--- /dev/null
+++ b/xos/synchronizers/vbbu/vbbu-synchronizer.py
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+# This imports and runs ../../xos-observer.py
+# Runs the standard XOS observer
+
+import importlib
+import os
+import sys
+observer_path = os.path.join(os.path.dirname(
+    os.path.realpath(__file__)), "../../synchronizers/base")
+sys.path.append(observer_path)
+mod = importlib.import_module("xos-synchronizer")
+mod.main()
diff --git a/xos/synchronizers/vbbu/vbbu_config b/xos/synchronizers/vbbu/vbbu_config
new file mode 100644
index 0000000..3713b67
--- /dev/null
+++ b/xos/synchronizers/vbbu/vbbu_config
@@ -0,0 +1,40 @@
+# Required by XOS
+[db]
+name=xos
+user=postgres
+password=password
+host=localhost
+port=5432
+
+# Required by XOS
+[api]
+nova_enabled=True
+
+# Sets options for the observer
+[observer]
+# Optional name
+name=vbbu
+# This is the location to the dependency graph you generate
+dependency_graph=/opt/xos/synchronizers/vbbu/model-deps
+# The location of your SyncSteps
+steps_dir=/opt/xos/synchronizers/vbbu/steps
+# A temporary directory that will be used by ansible
+sys_dir=/opt/xos/synchronizers/vbbu/sys
+# Location of the file to save logging messages to the backend log is often used
+logfile=/var/log/xos_backend.log
+# If this option is true, then nothing will change, we simply pretend to run
+pretend=False
+# If this is False then XOS will use an exponential backoff when the observer
+# fails, since we will be waiting for an instance, we don't want this.
+backoff_disabled=True
+# We want the output from ansible to be logged
+save_ansible_output=True
+# This determines how we SSH to a client, if this is set to True then we try
+# to ssh using the instance name as a proxy, if this is disabled we ssh using
+# the NAT IP of the instance. On CloudLab the first option will fail so we must
+# set this to False
+proxy_ssh=True
+proxy_ssh_key=/root/setup/id_rsa
+proxy_ssh_user=root
+[networking]
+use_vtn=True
diff --git a/xos/tools/xos-manage b/xos/tools/xos-manage
index 709882b..a4705d9 100755
--- a/xos/tools/xos-manage
+++ b/xos/tools/xos-manage
@@ -143,6 +143,7 @@
     python ./manage.py makemigrations requestrouter
     python ./manage.py makemigrations syndicate_storage
     python ./manage.py makemigrations cord
+    python ./manage.py makemigrations mcord
     python ./manage.py makemigrations ceilometer
     python ./manage.py makemigrations onos
     python ./manage.py makemigrations openvpn
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index fe08043..473e313 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -715,6 +715,10 @@
                 type: string
                 required: false
                 description: comma-separated list of protocol _space_ port that represent ports the slice should expose
+            default_node:
+                type: string
+                required: false
+                description: default node to use for this slice
 
     tosca.nodes.Node:
         derived_from: tosca.nodes.Root
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index edc5e5f..67d5367 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -1329,6 +1329,10 @@
                 type: string
                 required: false
                 description: comma-separated list of protocol _space_ port that represent ports the slice should expose
+            default_node:
+                type: string
+                required: false
+                description: default node to use for this slice
 
     tosca.nodes.Node:
         derived_from: tosca.nodes.Root
diff --git a/xos/tosca/resources/mcordservice.py b/xos/tosca/resources/mcordservice.py
new file mode 100644
index 0000000..d77e54d
--- /dev/null
+++ b/xos/tosca/resources/mcordservice.py
@@ -0,0 +1,19 @@
+import os
+import pdb
+import sys
+import tempfile
+sys.path.append("/opt/tosca")
+from translator.toscalib.tosca_template import ToscaTemplate
+import pdb
+
+from services.mcord.models import MCORDService
+
+from service import XOSService
+
+class XOSMCORDService(XOSService):
+    provides = "tosca.nodes.MCORDService"
+    xos_model = MCORDService
+    copyin_props = ["view_url", "icon_url", "enabled", "published", "public_key",
+                    "private_key_fn", "versionNumber",
+                    ]
+
diff --git a/xos/tosca/resources/network.py b/xos/tosca/resources/network.py
index 32e3fc1..fc143d0 100644
--- a/xos/tosca/resources/network.py
+++ b/xos/tosca/resources/network.py
@@ -42,6 +42,16 @@
         cidr = self.get_property_default("cidr", None)
         if cidr:
             args["subnet"] = cidr
+        print "DEF_RES_CIDR", cidr 
+
+        start_ip = self.get_property_default("start_ip", None)
+        if start_ip:
+            args["start_ip"] = start_ip 
+        print "DEF_RES_IP", start_ip 
+
+        end_ip = self.get_property_default("end_ip", None)
+        if end_ip:
+            args["end_ip"] = end_ip
 
         return args
 
diff --git a/xos/tosca/resources/slice.py b/xos/tosca/resources/slice.py
index 0add5ac..693d6ab 100644
--- a/xos/tosca/resources/slice.py
+++ b/xos/tosca/resources/slice.py
@@ -5,7 +5,7 @@
 sys.path.append("/opt/tosca")
 from translator.toscalib.tosca_template import ToscaTemplate
 
-from core.models import Slice,User,Site,Network,NetworkSlice,SliceRole,SlicePrivilege,Service,Image,Flavor
+from core.models import Slice,User,Site,Network,NetworkSlice,SliceRole,SlicePrivilege,Service,Image,Flavor,Node
 
 from xosresource import XOSResource
 
@@ -36,6 +36,11 @@
             default_flavor = self.get_xos_object(Flavor, name=default_flavor_name, throw_exception=True)
             args["default_flavor"] = default_flavor
 
+        default_node_name = self.get_property_default("default_node", None)
+        if default_node_name:
+            default_node = self.get_xos_object(Node, name=default_node_name, throw_exception=True)
+            args["default_node"] = default_node
+
         return args
 
     def postprocess(self, obj):
diff --git a/xos/tosca/resources/vbbucomponent.py b/xos/tosca/resources/vbbucomponent.py
new file mode 100644
index 0000000..ee60d0c
--- /dev/null
+++ b/xos/tosca/resources/vbbucomponent.py
@@ -0,0 +1,40 @@
+import os
+import pdb
+import sys
+import tempfile
+sys.path.append("/opt/tosca")
+from translator.toscalib.tosca_template import ToscaTemplate
+import pdb
+
+from services.mcord.models import VBBUComponent, MCORDService
+
+from xosresource import XOSResource
+
+class XOSVBBUComponent(XOSResource):
+    provides = "tosca.nodes.VBBUComponent"
+    xos_model = VBBUComponent
+    copyin_props = ["s1u_tag", "s1mme_tag", "rru_tag", "display_message"]
+    name_field = None
+
+    def get_xos_args(self, throw_exception=True):
+        args = super(XOSVBBUComponent, self).get_xos_args()
+
+        provider_name = self.get_requirement("tosca.relationships.MemberOfService", throw_exception=throw_exception)
+        if provider_name:
+            args["provider_service"] = self.get_xos_object(MCORDService, throw_exception=throw_exception, name=provider_name)
+
+        return args
+
+    def get_existing_objs(self):
+        args = self.get_xos_args(throw_exception=False)
+        provider_service = args.get("provider", None)
+        if provider_service:
+            return [ self.get_xos_object(provider_service=provider_service) ]
+        return []
+
+    def postprocess(self, obj):
+        pass
+
+    def can_delete(self, obj):
+        return super(XOSVBBUComponent, self).can_delete(obj)
+
diff --git a/xos/tosca/run.py b/xos/tosca/run.py
old mode 100644
new mode 100755
diff --git a/xos/xos/settings.py b/xos/xos/settings.py
index 417be81..2f8fa27 100644
--- a/xos/xos/settings.py
+++ b/xos/xos/settings.py
@@ -10,6 +10,7 @@
 from config import set_override
 config = Config()
 
+
 # Override the config from the environment. This is used leverage the LINK
 # capability of docker. It would be far better to use DNS and that can be
 # done in environments like kubernetes. Look for environment variables that
@@ -21,7 +22,7 @@
     config.db_port = parsed.port
 
 env_to_config_dict = {
-    "XOS_DB_PORT" : overrideDbSettings
+    "XOS_DB_PORT": overrideDbSettings
 }
 
 for key, ofunc in env_to_config_dict.items():
@@ -38,14 +39,14 @@
     # ('Your Name', 'your_email@example.com'),
 )
 
-#LOGIN_REDIRECT_URL = '/admin/core/user'
+# LOGIN_REDIRECT_URL = '/admin/core/user'
 LOGIN_REDIRECT_URL = '/admin/loggedin/'
 
 MANAGERS = ADMINS
 
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
+        'ENGINE': 'django.db.backends.postgresql_psycopg2',  # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
         'NAME': config.db_name,                      # Or path to database file if using sqlite3.
         # The following settings are not used with sqlite3:
         'USER': config.db_user,
@@ -167,7 +168,7 @@
     'django.contrib.auth',
     'django.contrib.contenttypes',
     'django.contrib.sessions',
-#    'django.contrib.sites',
+    # 'django.contrib.sites',
     'django.contrib.messages',
     'django.contrib.staticfiles',
     # Uncomment the next line to enable the admin:
@@ -182,6 +183,7 @@
     'core',
     'services.hpc',
     'services.cord',
+    'services.mcord',
     'services.onos',
     'services.ceilometer',
     'services.requestrouter',
@@ -195,7 +197,7 @@
     'rest_framework_swagger',
 )
 
-if DJANGO_VERSION[1]>=7:
+if DJANGO_VERSION[1] >= 7:
     # if django >= 1.7, then change the admin module
     INSTALLED_APPS = list(INSTALLED_APPS)
     INSTALLED_APPS[INSTALLED_APPS.index('django.contrib.admin')] = 'django.contrib.admin.apps.SimpleAdminConfig'
diff --git a/xos/xos/urls.py b/xos/xos/urls.py
index 570b768..b9f2bf1 100644
--- a/xos/xos/urls.py
+++ b/xos/xos/urls.py
@@ -1,3 +1,4 @@
+import importlib
 from django.conf.urls import patterns, include, url
 
 # Uncomment the next two lines to enable the admin:
@@ -9,24 +10,63 @@
 
 from core.views.legacyapi import LegacyXMLRPC
 from core.views.serviceGraph import ServiceGridView, ServiceGraphView
+from services.mcord.view import *
+# from core.views.analytics import AnalyticsAjaxView
+
 from core.models import *
 from rest_framework import generics
 from core.dashboard.sites import SitePlus
 from django.http import HttpResponseRedirect
-#from api import import_api_methods
+
+# from core.xoslib import XOSLibDataView
+
+# Django settings for XOS.
+from config import Config
+from config import set_override
+config = Config()
+
+
+def load_class(full_class_string):
+    """
+    dynamically load a class from a string
+    """
+
+    class_data = full_class_string.split(".")
+    module_path = ".".join(class_data[:-1])
+    class_str = class_data[-1]
+
+    module = importlib.import_module(module_path)
+    # Finally, we retrieve the Class
+    return getattr(module, class_str)
+
+servicePage = getattr(config, "gui_service_view_class", ServiceGridView)
+
+if(isinstance(servicePage, basestring)):
+    serviceClass = getattr(load_class(servicePage), "as_view")
+else:
+    serviceClass = getattr(servicePage, "as_view")
+
+# from api import import_api_methods
 
 admin.site = SitePlus()
 admin.autodiscover()
 
-def redirect_to_apache(request):
-     """ bounce a request back to the apache server that is running on the machine """
-     apache_url = "http://%s%s" % (request.META['HOSTNAME'], request.path)
-     return HttpResponseRedirect(apache_url)
 
-urlpatterns = patterns('',
-    # Examples:
+def redirect_to_apache(request):
+    """ bounce a request back to the apache server that is running on the machine """
+    apache_url = "http://%s%s" % (request.META['HOSTNAME'], request.path)
+    return HttpResponseRedirect(apache_url)
+
+urlpatterns = patterns(
+    '',
     url(r'^observer', 'core.views.observer.Observer', name='observer'),
+
+    url(r'^mcord', MCordView.as_view(), name='mcord'),
+
+    url(r'^serviceGrid', serviceClass(), name='serviceGrid'),
+
     url(r'^serviceGrid', ServiceGridView.as_view(), name='serviceGrid'),
+
     url(r'^serviceGraph.png', ServiceGraphView.as_view(), name='serviceGraph'),
     url(r'^hpcConfig', 'core.views.hpc_config.HpcConfig', name='hpcConfig'),
 
@@ -38,10 +78,14 @@
     # Uncomment the next line to enable the admin:
     url(r'^admin/', include(admin.site.urls)),
     url(r'^', include(admin.site.urls)),
-    #url(r'^profile/home', 'core.views.home'),
+    # url(r'^profile/home', 'core.views.home'),
+
+    # url(r'^admin/xoslib/(?P<name>\w+)/$', XOSLibDataView.as_view(), name="xoslib"),
 
     url(r'^xmlrpc/legacyapi/$', 'core.views.legacyapi.LegacyXMLRPC', name='xmlrpc'),
 
+    # url(r'^analytics/(?P<name>\w+)/$', AnalyticsAjaxView.as_view(), name="analytics"),
+
     url(r'^files/', redirect_to_apache),
 
     # Adding in rest_framework urls
@@ -53,4 +97,3 @@
     url(r'^', include('api.import_methods', namespace='api')),
 
   ) + get_REST_patterns() + get_hpc_REST_patterns()
-
diff --git a/xos/xos_configuration/README.md b/xos/xos_configuration/README.md
index b5ba51b..9b1e68a 100644
--- a/xos/xos_configuration/README.md
+++ b/xos/xos_configuration/README.md
@@ -59,6 +59,7 @@
 branding_name=Open Cloud
 #branding_css= #no branding css is provided by default
 branding_icon=/static/logo.png
+service_view_class=core.views.mCordServiceGrid.ServiceGridView
 
 ``
 
